@spiffcommerce/core 31.2.3-beta.026ad90d-92e9-500b-a212-bd6dfa71283c → 31.2.3-beta.3eaa5ef7-903f-53ab-8b16-a79ca8ddc239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +250 -256
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -4,32 +4,32 @@ import { onError as ur } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as hr } from "preact-render-to-string";
|
5
5
|
import { removeTypenameFromVariables as mr } from "@apollo/client/link/remove-typename";
|
6
6
|
import { orientation as gr } from "exifr/dist/mini.umd.cjs";
|
7
|
-
import { parse as
|
7
|
+
import { parse as ln } from "css";
|
8
8
|
import pr from "fuse.js";
|
9
9
|
import { Pith as Aa } from "pith";
|
10
|
-
import
|
11
|
-
import { toString as
|
10
|
+
import St from "lodash.clonedeep";
|
11
|
+
import { toString as cn } from "qrcode";
|
12
12
|
import fr from "svg-path-bbox";
|
13
13
|
import { parse as ta } from "opentype.js";
|
14
14
|
import { jsx as D, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
|
15
15
|
import Cr from "handlebars";
|
16
16
|
import { dataUriToBuffer as wr } from "data-uri-to-buffer";
|
17
|
-
import
|
18
|
-
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as
|
17
|
+
import xa from "lodash.chunk";
|
18
|
+
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Sr } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import vr from "dinero.js";
|
20
|
-
import * as
|
21
|
-
import
|
20
|
+
import * as Ma from "currency-codes";
|
21
|
+
import dn from "lodash.isequal";
|
22
22
|
import { split as ea } from "unicode-default-word-boundary";
|
23
|
-
import
|
23
|
+
import An from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
26
|
var ye = /* @__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))(ye || {}), L = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(L || {}), v = /* @__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))(v || {}), Er = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Er || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(br || {}), Br = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Br || {}), Ir = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Ir || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Pr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Pr || {}), Se = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(Se || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__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))(j || {}), Dr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Dr || {});
|
27
|
-
class
|
27
|
+
class un extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
30
30
|
}
|
31
31
|
}
|
32
|
-
class Xt extends
|
32
|
+
class Xt extends un {
|
33
33
|
constructor(t) {
|
34
34
|
super(`ConfigurationError - ${t}`);
|
35
35
|
}
|
@@ -44,7 +44,7 @@ class Y extends Xt {
|
|
44
44
|
super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
|
45
45
|
}
|
46
46
|
}
|
47
|
-
class
|
47
|
+
class vt extends Xt {
|
48
48
|
constructor(t) {
|
49
49
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
50
50
|
}
|
@@ -59,7 +59,7 @@ class Ee extends Xt {
|
|
59
59
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
60
60
|
}
|
61
61
|
}
|
62
|
-
class xe extends
|
62
|
+
class xe extends un {
|
63
63
|
constructor(t) {
|
64
64
|
super(`ImplementationError - ${t}`);
|
65
65
|
}
|
@@ -104,7 +104,7 @@ class Fr {
|
|
104
104
|
this.set(t, a);
|
105
105
|
}
|
106
106
|
}
|
107
|
-
class
|
107
|
+
class Ta {
|
108
108
|
constructor() {
|
109
109
|
this.storage = /* @__PURE__ */ new Map();
|
110
110
|
}
|
@@ -129,9 +129,9 @@ class Ma {
|
|
129
129
|
}
|
130
130
|
const xr = () => {
|
131
131
|
try {
|
132
|
-
return localStorage ? new Fr() : new
|
132
|
+
return localStorage ? new Fr() : new Ta();
|
133
133
|
} catch {
|
134
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
134
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ta();
|
135
135
|
}
|
136
136
|
}, k = xr();
|
137
137
|
class kr {
|
@@ -183,19 +183,19 @@ function rt(r, t) {
|
|
183
183
|
}
|
184
184
|
return na(r, t);
|
185
185
|
}
|
186
|
-
const
|
187
|
-
const t =
|
186
|
+
const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @__PURE__ */ new Map(), mn = async (r) => {
|
187
|
+
const t = Na.get(r);
|
188
188
|
if (t) return t;
|
189
189
|
const a = (async () => {
|
190
190
|
const n = await rt(r);
|
191
|
-
return
|
191
|
+
return hn.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
|
192
192
|
})();
|
193
|
-
return
|
193
|
+
return Na.set(r, a), a;
|
194
194
|
}, Mr = async (r) => {
|
195
|
-
const t =
|
195
|
+
const t = Qa.get(r);
|
196
196
|
if (t) return t;
|
197
197
|
const a = (async () => await (await rt(r)).text())();
|
198
|
-
return
|
198
|
+
return Qa.set(r, a), a;
|
199
199
|
}, Tt = (r) => r.every((t) => t !== "undefined"), se = (r) => Tt([typeof document]) ? document.createElement(r) : Zt().document.createElement(r), Tr = (r, t) => {
|
200
200
|
if (Tt([typeof document]))
|
201
201
|
return document.createElementNS(r, t);
|
@@ -207,7 +207,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
207
207
|
const r = Zt();
|
208
208
|
return new r.DOMParser();
|
209
209
|
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Me = (r, t) => new Promise((e, a) => {
|
210
|
-
t ?
|
210
|
+
t ? mn(r).then(e).catch(a) : rt(r).then((n) => {
|
211
211
|
n.arrayBuffer().then(e).catch(a);
|
212
212
|
}).catch((n) => {
|
213
213
|
a(n);
|
@@ -216,7 +216,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
216
216
|
t ? Mr(r).then(e).catch(a) : rt(r).then((n) => {
|
217
217
|
n.text().then(e).catch(a);
|
218
218
|
}).catch(a);
|
219
|
-
}),
|
219
|
+
}), gn = (r) => hr(r), Ue = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
|
220
220
|
if (Tt([typeof FontFace])) {
|
221
221
|
if (Ue.has(t))
|
222
222
|
return Ue.get(t);
|
@@ -230,7 +230,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
230
230
|
return new XMLSerializer();
|
231
231
|
const r = Zt();
|
232
232
|
return new r.XMLSerializer();
|
233
|
-
},
|
233
|
+
}, Ra = (r) => btoa(r), Te = (r) => {
|
234
234
|
function t() {
|
235
235
|
const a = new Uint8Array(r), n = 4;
|
236
236
|
if (a.length >= n) {
|
@@ -257,7 +257,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
257
257
|
const e = t();
|
258
258
|
return e || "image/svg+xml";
|
259
259
|
}, Qc = async (r) => {
|
260
|
-
const t = await
|
260
|
+
const t = await mn(r), e = hn.get(r) || Te(t);
|
261
261
|
return await $r(new Blob([t], { type: e }));
|
262
262
|
}, Rr = (r) => {
|
263
263
|
let t = "";
|
@@ -268,7 +268,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
268
268
|
}, Or = async (r) => {
|
269
269
|
const t = Te(r), e = new Uint8Array(r), a = Rr(e), n = btoa(a);
|
270
270
|
return `data:${t};base64,${n}`;
|
271
|
-
}, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`,
|
271
|
+
}, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, pn = (r) => {
|
272
272
|
const t = r.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
273
273
|
if (e === -1 || e <= 4)
|
274
274
|
throw new TypeError("malformed data: URI");
|
@@ -291,9 +291,9 @@ let Ur, ma;
|
|
291
291
|
const Lr = (r) => {
|
292
292
|
ma = r;
|
293
293
|
}, Vr = () => ma;
|
294
|
-
let
|
294
|
+
let fn;
|
295
295
|
const zr = (r) => {
|
296
|
-
|
296
|
+
fn = r;
|
297
297
|
}, Gr = () => new Promise((r) => {
|
298
298
|
const t = gt.getHubUrl(), e = (a) => {
|
299
299
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
@@ -303,7 +303,7 @@ const zr = (r) => {
|
|
303
303
|
const r = {
|
304
304
|
applicationKey: ma,
|
305
305
|
customerToken: Ur,
|
306
|
-
bearer:
|
306
|
+
bearer: fn
|
307
307
|
};
|
308
308
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Gr(), ...r } : r;
|
309
309
|
};
|
@@ -369,8 +369,8 @@ const pt = (r, t, e) => {
|
|
369
369
|
if (ra !== void 0)
|
370
370
|
return ra(r, t, e);
|
371
371
|
try {
|
372
|
-
const a =
|
373
|
-
return
|
372
|
+
const a = wn(!0);
|
373
|
+
return Cn(a), a.createCanvas(r, t, e);
|
374
374
|
} catch {
|
375
375
|
throw new Error("Canvas module not set");
|
376
376
|
}
|
@@ -378,16 +378,16 @@ const pt = (r, t, e) => {
|
|
378
378
|
if (ia !== void 0)
|
379
379
|
return ia(r, t);
|
380
380
|
try {
|
381
|
-
const e =
|
382
|
-
return
|
381
|
+
const e = wn(!0);
|
382
|
+
return Cn(e), e.loadImage(r, t);
|
383
383
|
} catch {
|
384
384
|
throw new Error("Canvas module not set");
|
385
385
|
}
|
386
386
|
};
|
387
|
-
function
|
387
|
+
function Cn(r) {
|
388
388
|
ra = r?.createCanvas, ia = r?.loadImage;
|
389
389
|
}
|
390
|
-
function
|
390
|
+
function wn(r) {
|
391
391
|
try {
|
392
392
|
if (document.createElement("canvas").getContext("2d"))
|
393
393
|
return {
|
@@ -3187,23 +3187,23 @@ function $c(r, t) {
|
|
3187
3187
|
let Qt = null;
|
3188
3188
|
function ti(r) {
|
3189
3189
|
if (r.startsWith("#"))
|
3190
|
-
return
|
3190
|
+
return Oa(r);
|
3191
3191
|
if (!document)
|
3192
3192
|
throw new Error("browserColorToHex is only supported on browsers");
|
3193
3193
|
if (Qt || (Qt = document.createElement("canvas").getContext("2d")), !Qt)
|
3194
3194
|
throw new Error("Failed to create canvas context required to convert colors");
|
3195
3195
|
Qt.fillStyle = r;
|
3196
|
-
const t =
|
3196
|
+
const t = Oa(Qt.fillStyle);
|
3197
3197
|
return t || console.error(`Unknown browser color ${r}`), t;
|
3198
3198
|
}
|
3199
|
-
function
|
3199
|
+
function Oa(r) {
|
3200
3200
|
const t = r.substring(1).toUpperCase();
|
3201
3201
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3202
3202
|
}
|
3203
3203
|
const le = (r) => {
|
3204
|
-
const t =
|
3204
|
+
const t = yn(r.spotColor);
|
3205
3205
|
return t ? `${r.browserValue} ${t}` : r.browserValue;
|
3206
|
-
},
|
3206
|
+
}, yn = (r) => {
|
3207
3207
|
if (!r)
|
3208
3208
|
return "";
|
3209
3209
|
if (r.profileName.includes("/") && r.profileName.includes(".icc")) {
|
@@ -3211,7 +3211,7 @@ const le = (r) => {
|
|
3211
3211
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${r.namedColor})`;
|
3212
3212
|
}
|
3213
3213
|
return `icc-named-color(${r.profileName}, ${r.namedColor})`;
|
3214
|
-
},
|
3214
|
+
}, $a = (r) => {
|
3215
3215
|
const t = r.split(/[ ](?=[^)]*?(?:\(|$))/);
|
3216
3216
|
if (t.length === 0)
|
3217
3217
|
return { browserValue: "#000000" };
|
@@ -3255,7 +3255,7 @@ const le = (r) => {
|
|
3255
3255
|
}
|
3256
3256
|
if (a.tagName === "style") {
|
3257
3257
|
try {
|
3258
|
-
|
3258
|
+
ln(a.innerHTML).stylesheet?.rules.forEach((s) => {
|
3259
3259
|
e.push(s);
|
3260
3260
|
}), a.remove();
|
3261
3261
|
} catch (i) {
|
@@ -3287,9 +3287,9 @@ const le = (r) => {
|
|
3287
3287
|
const t = /pt|pc|mm|cm|in/gm, e = r.getAttribute("viewBox"), a = r.getAttribute("width"), n = r.getAttribute("height");
|
3288
3288
|
if (!e) throw new Error("viewBox not specified on SVG!");
|
3289
3289
|
a && r.setAttribute("width", a.replace(t, "")), n && r.setAttribute("height", n.replace(t, ""));
|
3290
|
-
},
|
3290
|
+
}, Sn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
|
3291
3291
|
r.setAttribute("height", `${e}px`), r.setAttribute("width", `${t}px`);
|
3292
|
-
},
|
3292
|
+
}, vn = (r, t, e) => {
|
3293
3293
|
kt(r, (a) => {
|
3294
3294
|
const n = a.attributes.getNamedItem("fill");
|
3295
3295
|
n && n.value !== "none" && a.classList.forEach((s) => {
|
@@ -3328,16 +3328,16 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
},
|
3332
|
-
const i =
|
3331
|
+
}, En = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
|
3332
|
+
const i = Sn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
3335
|
-
return ii(i, t, e),
|
3335
|
+
return ii(i, t, e), vn(i, a, n), En(i);
|
3336
3336
|
}, Ca = (r, t, e) => {
|
3337
|
-
const a =
|
3337
|
+
const a = Sn(r);
|
3338
3338
|
if (!a)
|
3339
3339
|
throw new Error("Failed to read SVG.");
|
3340
|
-
return
|
3340
|
+
return vn(a, t, e), En(a);
|
3341
3341
|
}, si = (r) => {
|
3342
3342
|
const t = /<svg.*<\/svg>/s, e = r.match(t) || [], a = e?.length > 0 ? e[0] : "";
|
3343
3343
|
return dt().parseFromString(a, "image/svg+xml");
|
@@ -3351,12 +3351,12 @@ const le = (r) => {
|
|
3351
3351
|
ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
|
3352
3352
|
const o = s.attributes.getNamedItem("fill");
|
3353
3353
|
if (o && o.value !== "none" && !o.value.startsWith("url(")) {
|
3354
|
-
const c =
|
3354
|
+
const c = $a(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
3355
3355
|
s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
|
3356
3356
|
}
|
3357
3357
|
const l = s.attributes.getNamedItem("stroke");
|
3358
3358
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
3359
|
-
const c =
|
3359
|
+
const c = $a(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
3360
3360
|
s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
|
3361
3361
|
}
|
3362
3362
|
});
|
@@ -3748,7 +3748,7 @@ const Rt = "persistentAssets", lt = class lt {
|
|
3748
3748
|
};
|
3749
3749
|
lt.callbacks = [];
|
3750
3750
|
let At = lt;
|
3751
|
-
const
|
3751
|
+
const Ua = "bgrmPersistentAssets";
|
3752
3752
|
class J {
|
3753
3753
|
static has(t) {
|
3754
3754
|
return J.getMap().has(t);
|
@@ -3775,10 +3775,10 @@ class J {
|
|
3775
3775
|
a && (e.delete(a), J.setMap(e));
|
3776
3776
|
}
|
3777
3777
|
static getMap() {
|
3778
|
-
return k.getMap(
|
3778
|
+
return k.getMap(Ua) || /* @__PURE__ */ new Map();
|
3779
3779
|
}
|
3780
3780
|
static setMap(t) {
|
3781
|
-
k.setMap(
|
3781
|
+
k.setMap(Ua, t);
|
3782
3782
|
}
|
3783
3783
|
}
|
3784
3784
|
const O = new mi();
|
@@ -3811,7 +3811,7 @@ class gi {
|
|
3811
3811
|
this.disabled = t;
|
3812
3812
|
}
|
3813
3813
|
}
|
3814
|
-
const Kt = new gi(),
|
3814
|
+
const Kt = new gi(), bn = w`
|
3815
3815
|
fragment OptionFields on Option {
|
3816
3816
|
id
|
3817
3817
|
name
|
@@ -3851,7 +3851,7 @@ const Kt = new gi(), En = w`
|
|
3851
3851
|
`, pi = w`
|
3852
3852
|
${ee(!1)}
|
3853
3853
|
${wa}
|
3854
|
-
${
|
3854
|
+
${bn}
|
3855
3855
|
query GetOptions($ids: [String]!) {
|
3856
3856
|
options(ids: $ids) {
|
3857
3857
|
...OptionFields
|
@@ -3920,7 +3920,7 @@ class yi {
|
|
3920
3920
|
}
|
3921
3921
|
}
|
3922
3922
|
}
|
3923
|
-
const H = new yi(),
|
3923
|
+
const H = new yi(), Bn = w`
|
3924
3924
|
fragment ActiveIntegrationFields on Integration {
|
3925
3925
|
id
|
3926
3926
|
logo
|
@@ -4048,7 +4048,7 @@ const H = new yi(), bn = w`
|
|
4048
4048
|
}
|
4049
4049
|
}
|
4050
4050
|
}
|
4051
|
-
`,
|
4051
|
+
`, In = w`
|
4052
4052
|
fragment StakeholderFields on Stakeholder {
|
4053
4053
|
id
|
4054
4054
|
type
|
@@ -4056,7 +4056,7 @@ const H = new yi(), bn = w`
|
|
4056
4056
|
authorizationNote
|
4057
4057
|
authorizationStatus
|
4058
4058
|
}
|
4059
|
-
`,
|
4059
|
+
`, Pn = w`
|
4060
4060
|
fragment TransactionShareActionFields on TransactionShareAction {
|
4061
4061
|
id
|
4062
4062
|
title
|
@@ -4067,9 +4067,9 @@ const H = new yi(), bn = w`
|
|
4067
4067
|
}
|
4068
4068
|
`, vi = w`
|
4069
4069
|
${Qe}
|
4070
|
-
${Bn}
|
4071
4070
|
${In}
|
4072
|
-
${
|
4071
|
+
${Pn}
|
4072
|
+
${Bn}
|
4073
4073
|
query ReadTransactions($ids: [String]!) {
|
4074
4074
|
transactions(ids: $ids) {
|
4075
4075
|
customLogoLink
|
@@ -4332,7 +4332,7 @@ const H = new yi(), bn = w`
|
|
4332
4332
|
}
|
4333
4333
|
}
|
4334
4334
|
`, Pi = w`
|
4335
|
-
${
|
4335
|
+
${Pn}
|
4336
4336
|
query ReadTransactionForShareActions($id: String!) {
|
4337
4337
|
transactions(ids: [$id]) {
|
4338
4338
|
id
|
@@ -4342,14 +4342,14 @@ const H = new yi(), bn = w`
|
|
4342
4342
|
}
|
4343
4343
|
}
|
4344
4344
|
}
|
4345
|
-
`,
|
4345
|
+
`, Dn = w`
|
4346
4346
|
query ReadWorkflowStates($ids: [String]!) {
|
4347
4347
|
transactions(ids: $ids) {
|
4348
4348
|
id
|
4349
4349
|
workflowState
|
4350
4350
|
}
|
4351
4351
|
}
|
4352
|
-
`,
|
4352
|
+
`, Fn = (r) => w`
|
4353
4353
|
${Qe}
|
4354
4354
|
fragment IntegrationProductFields on IntegrationProduct {
|
4355
4355
|
id
|
@@ -4433,14 +4433,14 @@ const H = new yi(), bn = w`
|
|
4433
4433
|
}
|
4434
4434
|
}
|
4435
4435
|
`, Di = (r) => w`
|
4436
|
-
${
|
4436
|
+
${Fn(r)}
|
4437
4437
|
query GetIntegrationProducts($ids: [String!]!) {
|
4438
4438
|
integrationProducts(ids: $ids) {
|
4439
4439
|
...IntegrationProductFields
|
4440
4440
|
}
|
4441
4441
|
}
|
4442
4442
|
`, Fi = (r) => w`
|
4443
|
-
${
|
4443
|
+
${Fn(r)}
|
4444
4444
|
query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
|
4445
4445
|
integrationProductFromExternalIds(
|
4446
4446
|
externalIntegrationId: $externalIntegrationId
|
@@ -4450,7 +4450,7 @@ const H = new yi(), bn = w`
|
|
4450
4450
|
}
|
4451
4451
|
}
|
4452
4452
|
`, xi = w`
|
4453
|
-
${
|
4453
|
+
${In}
|
4454
4454
|
query ReadTransactionForStakeholders($id: String!) {
|
4455
4455
|
transactions(ids: [$id]) {
|
4456
4456
|
stakeholders {
|
@@ -4588,7 +4588,7 @@ const H = new yi(), bn = w`
|
|
4588
4588
|
`, Ri = (r) => w`
|
4589
4589
|
${ee(r)}
|
4590
4590
|
${wa}
|
4591
|
-
${
|
4591
|
+
${bn}
|
4592
4592
|
${Mi}
|
4593
4593
|
${Ti}
|
4594
4594
|
${Ni}
|
@@ -5113,7 +5113,7 @@ const H = new yi(), bn = w`
|
|
5113
5113
|
}
|
5114
5114
|
}
|
5115
5115
|
`, Li = w`
|
5116
|
-
${
|
5116
|
+
${Bn}
|
5117
5117
|
${Re}
|
5118
5118
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
5119
5119
|
currentIntegration {
|
@@ -5213,7 +5213,7 @@ const H = new yi(), bn = w`
|
|
5213
5213
|
],
|
5214
5214
|
silentSteps: []
|
5215
5215
|
}), t;
|
5216
|
-
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)),
|
5216
|
+
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
|
5217
5217
|
const a = t[e.targetStepName];
|
5218
5218
|
if (a && a.selectedVariants) {
|
5219
5219
|
const n = a.selectedVariants;
|
@@ -5226,8 +5226,8 @@ const H = new yi(), bn = w`
|
|
5226
5226
|
const e = {
|
5227
5227
|
name: r.name,
|
5228
5228
|
title: r.title,
|
5229
|
-
renderableSteps: r.renderableSteps.filter((a) =>
|
5230
|
-
silentSteps: r.silentSteps.filter((a) =>
|
5229
|
+
renderableSteps: r.renderableSteps.filter((a) => yt(a, t)),
|
5230
|
+
silentSteps: r.silentSteps.filter((a) => yt(a, t))
|
5231
5231
|
};
|
5232
5232
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
5233
5233
|
}, Pt = (r, t) => r.map((e) => Hi(e, t)).filter((e) => e !== null), Yi = async (r, t, e = !1) => {
|
@@ -5246,12 +5246,12 @@ const H = new yi(), bn = w`
|
|
5246
5246
|
);
|
5247
5247
|
return i;
|
5248
5248
|
};
|
5249
|
-
class
|
5249
|
+
class xn {
|
5250
5250
|
constructor() {
|
5251
5251
|
this.timestamp = Date.now();
|
5252
5252
|
}
|
5253
5253
|
}
|
5254
|
-
class
|
5254
|
+
class kn {
|
5255
5255
|
/**
|
5256
5256
|
* Constructs a new promise queue.
|
5257
5257
|
* @param queueMaxSize An optional maximum size, when the max size is hit.
|
@@ -5346,7 +5346,7 @@ const M = () => {
|
|
5346
5346
|
...E,
|
5347
5347
|
_renderingConfiguration: a,
|
5348
5348
|
mask: l ? `url(#viewmask-${C})` : void 0
|
5349
|
-
})), f =
|
5349
|
+
})), f = va(I);
|
5350
5350
|
return /* @__PURE__ */ ct(
|
5351
5351
|
"svg",
|
5352
5352
|
{
|
@@ -5502,7 +5502,7 @@ const M = () => {
|
|
5502
5502
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
5503
5503
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
5504
5504
|
};
|
5505
|
-
}, Jc = 0.352778, Kc = 0.035277,
|
5505
|
+
}, Jc = 0.352778, Kc = 0.035277, Mn = (r) => {
|
5506
5506
|
const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e);
|
5507
5507
|
return /* @__PURE__ */ D("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ D(
|
5508
5508
|
"g",
|
@@ -5524,8 +5524,8 @@ const M = () => {
|
|
5524
5524
|
)
|
5525
5525
|
}
|
5526
5526
|
) });
|
5527
|
-
},
|
5528
|
-
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s =
|
5527
|
+
}, Tn = (r) => {
|
5528
|
+
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
|
5529
5529
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5530
5530
|
/* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ D("path", { d: r.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: r.width, height: r.height }) }) }),
|
5531
5531
|
/* @__PURE__ */ ct(
|
@@ -5629,7 +5629,7 @@ const M = () => {
|
|
5629
5629
|
matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
|
5630
5630
|
`,
|
5631
5631
|
children: /* @__PURE__ */ D(
|
5632
|
-
|
5632
|
+
Tn,
|
5633
5633
|
{
|
5634
5634
|
id: t,
|
5635
5635
|
x: 0,
|
@@ -5646,7 +5646,7 @@ const M = () => {
|
|
5646
5646
|
}
|
5647
5647
|
)
|
5648
5648
|
] });
|
5649
|
-
},
|
5649
|
+
}, Nn = /* @__PURE__ */ new Map();
|
5650
5650
|
class _i {
|
5651
5651
|
constructor(t) {
|
5652
5652
|
this.font = t, this.glyphsFromText = /* @__PURE__ */ new Map(), this.kerningValues = /* @__PURE__ */ new Map(), this.height = this.calculateApproximateHeight();
|
@@ -5701,10 +5701,10 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5701
5701
|
return ze.get(r);
|
5702
5702
|
const e = (async () => {
|
5703
5703
|
try {
|
5704
|
-
return
|
5704
|
+
return Et(r).getFont();
|
5705
5705
|
} catch {
|
5706
5706
|
if (Xi(r)) {
|
5707
|
-
const a =
|
5707
|
+
const a = pn(r), n = ta(a);
|
5708
5708
|
return sa(r, n), n;
|
5709
5709
|
} else {
|
5710
5710
|
const a = await Me(r, !0), n = ta(a);
|
@@ -5714,20 +5714,20 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5714
5714
|
})();
|
5715
5715
|
return ze.set(r, e), e;
|
5716
5716
|
}, Zi = (r) => {
|
5717
|
-
const t =
|
5717
|
+
const t = pn(r), e = ta(t);
|
5718
5718
|
return sa(r, e), e;
|
5719
|
-
},
|
5720
|
-
const t =
|
5719
|
+
}, Et = (r) => {
|
5720
|
+
const t = Nn.get(r);
|
5721
5721
|
if (t)
|
5722
5722
|
return t;
|
5723
5723
|
throw new Error("Font metrics unavailable for font");
|
5724
5724
|
}, sa = (r, t) => {
|
5725
5725
|
const e = new _i(t);
|
5726
|
-
return
|
5726
|
+
return Nn.set(r, e), e;
|
5727
5727
|
}, _c = async (r) => {
|
5728
5728
|
const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
|
5729
5729
|
a.querySelectorAll("style").forEach((d) => {
|
5730
|
-
|
5730
|
+
ln(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
5731
5731
|
if (u.type === "font-face" && u.declarations) {
|
5732
5732
|
const h = u.declarations.find(
|
5733
5733
|
(g) => g.property === "font-family"
|
@@ -5759,9 +5759,9 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5759
5759
|
}
|
5760
5760
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
|
5761
5761
|
}, Be = (r, t, e, a) => Math.max(ns(r.join(`
|
5762
|
-
`), e, a), t),
|
5762
|
+
`), e, a), t), La = (r, t, e, a, n, i) => {
|
5763
5763
|
console.log("LOG: getLines");
|
5764
|
-
const s = (i ||
|
5764
|
+
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
5765
5765
|
`);
|
5766
5766
|
try {
|
5767
5767
|
const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
@@ -5814,13 +5814,13 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5814
5814
|
return { lines: o, width: l };
|
5815
5815
|
}, ts = (r, t, e, a, n, i) => {
|
5816
5816
|
console.log("LOG: calcFontSize");
|
5817
|
-
const s = (i ??
|
5817
|
+
const s = (i ?? ya) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Qn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
|
5818
5818
|
return Math.min(A, d);
|
5819
5819
|
}, es = (r, t, e, a) => {
|
5820
5820
|
console.log("LOG: refit");
|
5821
|
-
const n =
|
5821
|
+
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5822
5822
|
if (!e)
|
5823
|
-
return
|
5823
|
+
return La(t, r, t.fontSize, s, n, a);
|
5824
5824
|
let o;
|
5825
5825
|
if (t.text ? o = t.text.split(`
|
5826
5826
|
`) : o = t.input?.split(`
|
@@ -5837,12 +5837,12 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5837
5837
|
requiredHeight: t.height,
|
5838
5838
|
requiredWidth: Be(o, t.width, s, n),
|
5839
5839
|
fontSize: ts(o, n, i, t.width, t.height, a)
|
5840
|
-
} :
|
5840
|
+
} : La(t, r, t.fontSize, s, n, a);
|
5841
5841
|
}, as = (r, t, e, a, n) => {
|
5842
5842
|
console.log("LOG: recalc");
|
5843
|
-
const s =
|
5843
|
+
const s = Et(t.assetUrl).getFont();
|
5844
5844
|
let o = { ...r };
|
5845
|
-
const l = { ...r }, c =
|
5845
|
+
const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Et(t.assetUrl));
|
5846
5846
|
return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([d, A]) => d === A) && (o = l)), o;
|
5847
5847
|
}, Ge = 1, mt = (r, t, e) => {
|
5848
5848
|
let a = 0;
|
@@ -5862,21 +5862,21 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5862
5862
|
a = Math.max(a, o || 0);
|
5863
5863
|
}
|
5864
5864
|
}), a *= t, a;
|
5865
|
-
},
|
5865
|
+
}, Qn = (r, t, e) => {
|
5866
5866
|
let a = 0;
|
5867
5867
|
return r.forEach((n) => {
|
5868
5868
|
a = Math.max(a, mt(n, t, e));
|
5869
5869
|
}), a;
|
5870
|
-
},
|
5870
|
+
}, Va = {
|
5871
5871
|
stripControlCharacters: !0,
|
5872
5872
|
vertical: !1,
|
5873
5873
|
uppercase: !1
|
5874
|
-
}, Ie = (r, t =
|
5875
|
-
const e = { ...
|
5874
|
+
}, Ie = (r, t = Va) => {
|
5875
|
+
const e = { ...Va, ...t };
|
5876
5876
|
let a = r || "";
|
5877
5877
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5878
5878
|
`)), a;
|
5879
|
-
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r,
|
5879
|
+
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r, Rn = (r) => r === "left" ? "start" : r === "right" ? "end" : "middle", ae = (r, t, e) => r.fontData ? {
|
5880
5880
|
...r,
|
5881
5881
|
...(() => {
|
5882
5882
|
if (r.algorithm === Mt.Traditional) {
|
@@ -5894,7 +5894,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5894
5894
|
text: t
|
5895
5895
|
};
|
5896
5896
|
})()
|
5897
|
-
} : r,
|
5897
|
+
} : r, ya = 1.1;
|
5898
5898
|
function Ft(r, t) {
|
5899
5899
|
return On(r, t.getTemplatingContext());
|
5900
5900
|
}
|
@@ -5911,7 +5911,7 @@ const ss = (r) => {
|
|
5911
5911
|
`), A = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
|
5912
5912
|
if (r.curved && !r.paths || !r.fontData)
|
5913
5913
|
return null;
|
5914
|
-
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${
|
5914
|
+
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${yn(r.fillSpotColorDefinition)}` : r.fill;
|
5915
5915
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5916
5916
|
/* @__PURE__ */ ct("defs", { children: [
|
5917
5917
|
r.textFillImage && /* @__PURE__ */ D(
|
@@ -5978,8 +5978,7 @@ const ss = (r) => {
|
|
5978
5978
|
textboxWidth: r.width,
|
5979
5979
|
lineHeight: r.lineHeight,
|
5980
5980
|
vertical: r.vertical,
|
5981
|
-
verticalAlign: r.verticalAlign
|
5982
|
-
fontData: r.fontData
|
5981
|
+
verticalAlign: r.verticalAlign
|
5983
5982
|
},
|
5984
5983
|
p
|
5985
5984
|
))
|
@@ -5987,12 +5986,7 @@ const ss = (r) => {
|
|
5987
5986
|
) }) })
|
5988
5987
|
] });
|
5989
5988
|
}, os = (r) => {
|
5990
|
-
const t = () => {
|
5991
|
-
if (r.lineHeight !== void 0)
|
5992
|
-
return r.lineHeight;
|
5993
|
-
const n = Ct(r.fontData.assetUrl), i = n.getFont(), s = r.fontSize / i.unitsPerEm;
|
5994
|
-
return n.getApproximateHeight() * s;
|
5995
|
-
}, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
|
5989
|
+
const t = () => r.lineHeight !== void 0 ? r.lineHeight : ya, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
|
5996
5990
|
const n = r.fontSize * t();
|
5997
5991
|
console.log(`LOG: text span. line height: ${n}`);
|
5998
5992
|
const i = r.textboxHeight / 2;
|
@@ -6005,14 +5999,14 @@ const ss = (r) => {
|
|
6005
5999
|
const s = (r.amountLines - 1) / 2;
|
6006
6000
|
return (r.thisLineIdx - s) * n + r.fontSize / 4;
|
6007
6001
|
};
|
6008
|
-
return /* @__PURE__ */ D("tspan", { textAnchor:
|
6002
|
+
return /* @__PURE__ */ D("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
|
6009
6003
|
}, ls = (r) => {
|
6010
6004
|
const t = `#${r.curvedPathId}`;
|
6011
6005
|
return /* @__PURE__ */ D(
|
6012
6006
|
"textPath",
|
6013
6007
|
{
|
6014
6008
|
startOffset: r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%",
|
6015
|
-
textAnchor:
|
6009
|
+
textAnchor: Rn(r.align),
|
6016
6010
|
href: t,
|
6017
6011
|
xlinkHref: t,
|
6018
6012
|
children: r.text
|
@@ -6021,7 +6015,7 @@ const ss = (r) => {
|
|
6021
6015
|
}, cs = (r) => {
|
6022
6016
|
if (r.cachedObjectURL && !r._renderingConfiguration?.omitCachedFields)
|
6023
6017
|
return /* @__PURE__ */ D(
|
6024
|
-
|
6018
|
+
Mn,
|
6025
6019
|
{
|
6026
6020
|
id: r.id,
|
6027
6021
|
src: r.cachedObjectURL,
|
@@ -6126,7 +6120,7 @@ class ds {
|
|
6126
6120
|
layout: t,
|
6127
6121
|
elements: e
|
6128
6122
|
},
|
6129
|
-
getComponentWithProps: (a) =>
|
6123
|
+
getComponentWithProps: (a) => Sa(t, e, a)
|
6130
6124
|
};
|
6131
6125
|
}
|
6132
6126
|
initialize(t, e) {
|
@@ -6151,7 +6145,7 @@ class ds {
|
|
6151
6145
|
return { ...t, transaction: e.apply(a) };
|
6152
6146
|
}
|
6153
6147
|
}
|
6154
|
-
const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(
|
6148
|
+
const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(Ki, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(cs, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(ss, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
|
6155
6149
|
const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
|
6156
6150
|
return /* @__PURE__ */ D(
|
6157
6151
|
Ji,
|
@@ -6182,7 +6176,7 @@ const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(kn, { ...r }, r.id) : r
|
|
6182
6176
|
}
|
6183
6177
|
);
|
6184
6178
|
};
|
6185
|
-
function
|
6179
|
+
function va(r) {
|
6186
6180
|
return r.sort((t, e) => {
|
6187
6181
|
const a = t.layer || 0, n = e.layer || 0;
|
6188
6182
|
if (a < n) return -1;
|
@@ -6259,7 +6253,7 @@ const ne = (r) => {
|
|
6259
6253
|
throw new Error("Malformed frame SVG");
|
6260
6254
|
})();
|
6261
6255
|
return We.set(r, e), e;
|
6262
|
-
},
|
6256
|
+
}, Ea = (r, t, e, a) => {
|
6263
6257
|
const n = t.width / t.height, i = r.width / r.height;
|
6264
6258
|
let s;
|
6265
6259
|
a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
|
@@ -6282,7 +6276,7 @@ const ne = (r) => {
|
|
6282
6276
|
return ut.set(r, i), i;
|
6283
6277
|
}
|
6284
6278
|
if ((r.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
6285
|
-
const e = await
|
6279
|
+
const e = await ba(r), a = e.width, n = e.height, i = {
|
6286
6280
|
src: r,
|
6287
6281
|
width: a,
|
6288
6282
|
height: n,
|
@@ -6298,14 +6292,14 @@ const ne = (r) => {
|
|
6298
6292
|
};
|
6299
6293
|
return ut.set(r, n), n;
|
6300
6294
|
}
|
6301
|
-
},
|
6295
|
+
}, ba = async (r) => {
|
6302
6296
|
const t = await nt(r);
|
6303
6297
|
return Ln(t);
|
6304
|
-
},
|
6298
|
+
}, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
|
6305
6299
|
const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
|
6306
6300
|
if (!a)
|
6307
6301
|
throw new Error("No svg tag found, this svg must be malformed!");
|
6308
|
-
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0,
|
6302
|
+
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n?.split(" ").map((l) => Number(l));
|
6309
6303
|
if (!o)
|
6310
6304
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
6311
6305
|
return {
|
@@ -6379,7 +6373,7 @@ const ne = (r) => {
|
|
6379
6373
|
}
|
6380
6374
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
6381
6375
|
await Nt(e);
|
6382
|
-
const l =
|
6376
|
+
const l = Et(e), c = mt(a.text, a?.fontScale, l);
|
6383
6377
|
o.width = Math.min(c, n.width * 0.85), o.left = n.x + n.width / 2 - o.width / 2;
|
6384
6378
|
}
|
6385
6379
|
return o;
|
@@ -6550,13 +6544,13 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6550
6544
|
throw new U();
|
6551
6545
|
return e;
|
6552
6546
|
}, X = (r, t) => {
|
6553
|
-
const e = [...t.elements.filter((n) => n.id !== r.id), r], a =
|
6547
|
+
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
|
6554
6548
|
return {
|
6555
6549
|
layout: t.layout,
|
6556
6550
|
elements: a,
|
6557
6551
|
modificationID: M()
|
6558
6552
|
};
|
6559
|
-
},
|
6553
|
+
}, Ga = async (r) => {
|
6560
6554
|
const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
|
6561
6555
|
for (let a = 0; a < e.length; a++) {
|
6562
6556
|
const n = e[a], i = r.layouts[n];
|
@@ -6616,7 +6610,7 @@ class N {
|
|
6616
6610
|
this.oldState = t;
|
6617
6611
|
}
|
6618
6612
|
}
|
6619
|
-
class
|
6613
|
+
class Wa extends N {
|
6620
6614
|
constructor(t) {
|
6621
6615
|
super(), this.serializableWorkflow = t;
|
6622
6616
|
}
|
@@ -6878,7 +6872,7 @@ class hs extends N {
|
|
6878
6872
|
};
|
6879
6873
|
}
|
6880
6874
|
}
|
6881
|
-
class
|
6875
|
+
class qa extends N {
|
6882
6876
|
constructor(t, e) {
|
6883
6877
|
super(), this.id = t, this.fontData = e;
|
6884
6878
|
}
|
@@ -7216,7 +7210,7 @@ class sd extends N {
|
|
7216
7210
|
};
|
7217
7211
|
}
|
7218
7212
|
}
|
7219
|
-
class
|
7213
|
+
class ja {
|
7220
7214
|
constructor(t, e, a) {
|
7221
7215
|
this.processRegion = async (n) => {
|
7222
7216
|
const i = this.layouts.find((l) => l.panelId === n.panelId);
|
@@ -7413,7 +7407,7 @@ class ys {
|
|
7413
7407
|
return t.data.regions.map(e);
|
7414
7408
|
}
|
7415
7409
|
async command(t, e, a, n) {
|
7416
|
-
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await
|
7410
|
+
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await cn(t, { type: "svg" }))}`, l = e.map((c) => {
|
7417
7411
|
const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
|
7418
7412
|
if (!A && d)
|
7419
7413
|
throw new Y(d);
|
@@ -7449,7 +7443,7 @@ class Pe {
|
|
7449
7443
|
return oa(e);
|
7450
7444
|
const a = t.asset;
|
7451
7445
|
if (!a)
|
7452
|
-
throw new
|
7446
|
+
throw new vt(t);
|
7453
7447
|
const n = a.fileLink;
|
7454
7448
|
if (n)
|
7455
7449
|
return nt(n, !0);
|
@@ -7613,7 +7607,7 @@ class Pe {
|
|
7613
7607
|
}
|
7614
7608
|
async loadPatternFromString(t, e, a = !0, n = void 0, i) {
|
7615
7609
|
if (t.endsWith("svg")) {
|
7616
|
-
const s = await
|
7610
|
+
const s = await ba(t), o = s.width, l = s.height, c = await nt(t);
|
7617
7611
|
if (i) {
|
7618
7612
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
7619
7613
|
if (u && u.length > 0)
|
@@ -7716,7 +7710,7 @@ class Pe {
|
|
7716
7710
|
i && i(!0);
|
7717
7711
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
7718
7712
|
t.data.regions.map(async (h, m) => {
|
7719
|
-
const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ?
|
7713
|
+
const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? Ea(
|
7720
7714
|
g,
|
7721
7715
|
p,
|
7722
7716
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7807,7 +7801,7 @@ class Pe {
|
|
7807
7801
|
), this.validateColorCount(e, a);
|
7808
7802
|
}
|
7809
7803
|
}
|
7810
|
-
const
|
7804
|
+
const wt = new Pe();
|
7811
7805
|
class Ss {
|
7812
7806
|
async getIllustrationBody(t) {
|
7813
7807
|
return new Promise((e) => {
|
@@ -7968,7 +7962,7 @@ class Ss {
|
|
7968
7962
|
t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
|
7969
7963
|
const o = e.asset;
|
7970
7964
|
if (!o)
|
7971
|
-
throw new
|
7965
|
+
throw new vt(e);
|
7972
7966
|
const l = o.fileLink;
|
7973
7967
|
if (!l)
|
7974
7968
|
throw new Yt(o);
|
@@ -8099,7 +8093,7 @@ class vs {
|
|
8099
8093
|
n(!0);
|
8100
8094
|
const s = e.material;
|
8101
8095
|
if (!s)
|
8102
|
-
throw n(!1), new
|
8096
|
+
throw n(!1), new vt(e);
|
8103
8097
|
return {
|
8104
8098
|
command: void 0,
|
8105
8099
|
followup: async () => {
|
@@ -8150,7 +8144,7 @@ class Es {
|
|
8150
8144
|
const u = e.getModelContainer();
|
8151
8145
|
if (u && t.option) {
|
8152
8146
|
const h = d.asset?.fileLink;
|
8153
|
-
if (!h) throw new
|
8147
|
+
if (!h) throw new vt(d);
|
8154
8148
|
await u.applyModelVariant(
|
8155
8149
|
t.stepName || "",
|
8156
8150
|
{
|
@@ -8174,7 +8168,7 @@ class Es {
|
|
8174
8168
|
n(!0);
|
8175
8169
|
const i = e.asset?.fileLink;
|
8176
8170
|
if (!i)
|
8177
|
-
throw new
|
8171
|
+
throw new vt(e);
|
8178
8172
|
return {
|
8179
8173
|
command: void 0,
|
8180
8174
|
followup: async () => {
|
@@ -8351,7 +8345,7 @@ class Bs {
|
|
8351
8345
|
async selectVariantCommand(t, e, a, n) {
|
8352
8346
|
const i = e.asset;
|
8353
8347
|
if (!i)
|
8354
|
-
throw new
|
8348
|
+
throw new vt(e);
|
8355
8349
|
const s = i?.fileLink;
|
8356
8350
|
if (!s)
|
8357
8351
|
return console.error("No URL for picture!"), null;
|
@@ -8677,7 +8671,7 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
|
8677
8671
|
}, fe = (r, t, e, a, n) => {
|
8678
8672
|
console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
|
8679
8673
|
let i, s;
|
8680
|
-
const o =
|
8674
|
+
const o = Et(t.assetUrl), l = o.getFont();
|
8681
8675
|
if (n.size) {
|
8682
8676
|
const u = r / l.unitsPerEm;
|
8683
8677
|
return [i, s] = Ye(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
|
@@ -8712,7 +8706,7 @@ class ks {
|
|
8712
8706
|
/(\r\n|\r|(\u2665|\u00a9|\u00ae|[\u2000-\u2017]|[\u201E-\u3300]]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))/gm,
|
8713
8707
|
""
|
8714
8708
|
);
|
8715
|
-
const n = [], i = e ?
|
8709
|
+
const n = [], i = e ? Et(e.assetUrl) : void 0;
|
8716
8710
|
if (i) {
|
8717
8711
|
const s = a.split("").filter((l) => !xs.includes(l)).join(""), o = s.split("").map((l) => i.getFont().charToGlyph(l));
|
8718
8712
|
for (let l = 0; l < o.length; l++)
|
@@ -8998,7 +8992,7 @@ class ks {
|
|
8998
8992
|
u,
|
8999
8993
|
async () => {
|
9000
8994
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
9001
|
-
const g = o.map((S) => new
|
8995
|
+
const g = o.map((S) => new qa(S.id, A)), C = new R(g);
|
9002
8996
|
e.getCommandDispatcher()(C);
|
9003
8997
|
}
|
9004
8998
|
), o.length === 0 && l) {
|
@@ -9088,7 +9082,7 @@ class ks {
|
|
9088
9082
|
async fontDataFromVariant(t) {
|
9089
9083
|
const e = t.asset;
|
9090
9084
|
if (!e)
|
9091
|
-
throw new
|
9085
|
+
throw new vt(t);
|
9092
9086
|
const a = e.fileLink;
|
9093
9087
|
if (!a)
|
9094
9088
|
throw new Yt(e);
|
@@ -9101,7 +9095,7 @@ class ks {
|
|
9101
9095
|
async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
|
9102
9096
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
9103
9097
|
if (n.length > 0) {
|
9104
|
-
const u = n.map((p) => new
|
9098
|
+
const u = n.map((p) => new qa(p.id, A));
|
9105
9099
|
if (l) {
|
9106
9100
|
const p = n.map((g) => new je(g.id, l));
|
9107
9101
|
u.push(...p);
|
@@ -9361,7 +9355,7 @@ function $s(r, t, e, a) {
|
|
9361
9355
|
const n = e / r, i = a / t;
|
9362
9356
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
9363
9357
|
}
|
9364
|
-
const
|
9358
|
+
const Ha = {
|
9365
9359
|
m: ["x", "y"],
|
9366
9360
|
z: [],
|
9367
9361
|
l: ["x", "y"],
|
@@ -9391,7 +9385,7 @@ class Us {
|
|
9391
9385
|
const n = (i) => {
|
9392
9386
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
9393
9387
|
let l = e !== o;
|
9394
|
-
const c =
|
9388
|
+
const c = Ha[i.type];
|
9395
9389
|
l && (s.push(o), e = o);
|
9396
9390
|
for (const d of c) {
|
9397
9391
|
const A = i[d];
|
@@ -9416,7 +9410,7 @@ class Us {
|
|
9416
9410
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
9417
9411
|
let i;
|
9418
9412
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
9419
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
9413
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
|
9420
9414
|
if (o.length < c.length)
|
9421
9415
|
throw new Dt(
|
9422
9416
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
@@ -9622,7 +9616,7 @@ const re = w`
|
|
9622
9616
|
name
|
9623
9617
|
}
|
9624
9618
|
}
|
9625
|
-
`,
|
9619
|
+
`, Ba = w`
|
9626
9620
|
${Ws}
|
9627
9621
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
9628
9622
|
id
|
@@ -9633,7 +9627,7 @@ const re = w`
|
|
9633
9627
|
}
|
9634
9628
|
}
|
9635
9629
|
`, ie = (r) => w`
|
9636
|
-
${r ?
|
9630
|
+
${r ? Ba : ""}
|
9637
9631
|
fragment ProductCollectionFields on ProductCollection {
|
9638
9632
|
id
|
9639
9633
|
name
|
@@ -9746,7 +9740,7 @@ const re = w`
|
|
9746
9740
|
quoteId
|
9747
9741
|
}
|
9748
9742
|
}
|
9749
|
-
`,
|
9743
|
+
`, Ya = w`
|
9750
9744
|
query GetBundleStakeholders($id: String!) {
|
9751
9745
|
bundles(ids: [$id]) {
|
9752
9746
|
id
|
@@ -9821,7 +9815,7 @@ const re = w`
|
|
9821
9815
|
}
|
9822
9816
|
}
|
9823
9817
|
`, Hs = w`
|
9824
|
-
${
|
9818
|
+
${Ba}
|
9825
9819
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
9826
9820
|
productCollections(ids: [$id], productIds: $productIds) {
|
9827
9821
|
id
|
@@ -9854,7 +9848,7 @@ const re = w`
|
|
9854
9848
|
}
|
9855
9849
|
}
|
9856
9850
|
`, Js = w`
|
9857
|
-
${
|
9851
|
+
${Ba}
|
9858
9852
|
query GetProductCollectionForProductsFeed(
|
9859
9853
|
$id: String!
|
9860
9854
|
$limit: Int
|
@@ -10235,7 +10229,7 @@ const re = w`
|
|
10235
10229
|
`;
|
10236
10230
|
var $e = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))($e || {});
|
10237
10231
|
const wo = 1e3;
|
10238
|
-
class
|
10232
|
+
class Ja extends xn {
|
10239
10233
|
constructor(t) {
|
10240
10234
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
10241
10235
|
}
|
@@ -10249,7 +10243,7 @@ class Ya extends Fn {
|
|
10249
10243
|
}
|
10250
10244
|
class yo {
|
10251
10245
|
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, p, g = !1, C = !1, S = !1) {
|
10252
|
-
this.workflowStatePromiseQueue = new
|
10246
|
+
this.workflowStatePromiseQueue = new kn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
10253
10247
|
if (!this.previewService) return;
|
10254
10248
|
const b = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
|
10255
10249
|
if (I)
|
@@ -10664,9 +10658,9 @@ class yo {
|
|
10664
10658
|
...this.storage,
|
10665
10659
|
[t]: { ...this.storage[t], ...e }
|
10666
10660
|
};
|
10667
|
-
if (!
|
10661
|
+
if (!dn(a, this.storage)) {
|
10668
10662
|
this.storage = a;
|
10669
|
-
const n = new
|
10663
|
+
const n = new Wa(this.constructSerializableWorkflow());
|
10670
10664
|
this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
10671
10665
|
}
|
10672
10666
|
}
|
@@ -10685,7 +10679,7 @@ class yo {
|
|
10685
10679
|
if (this.readOnly) return;
|
10686
10680
|
const t = this.serialize();
|
10687
10681
|
this.workflowStatePromiseQueue.enqueue(
|
10688
|
-
new
|
10682
|
+
new Ja(async () => {
|
10689
10683
|
await new Promise((e) => {
|
10690
10684
|
setTimeout(() => {
|
10691
10685
|
e();
|
@@ -10702,7 +10696,7 @@ class yo {
|
|
10702
10696
|
async updateStateWithServerImmediate() {
|
10703
10697
|
if (this.readOnly) return;
|
10704
10698
|
const t = this.serialize();
|
10705
|
-
return new
|
10699
|
+
return new Ja(async () => {
|
10706
10700
|
await this.updateTransaction({
|
10707
10701
|
variables: {
|
10708
10702
|
id: this.transaction.id,
|
@@ -10715,7 +10709,7 @@ class yo {
|
|
10715
10709
|
const t = this.getCommandContext().getState();
|
10716
10710
|
if (!t)
|
10717
10711
|
throw new V("Attempted to serialize state before it was initialized.");
|
10718
|
-
const e =
|
10712
|
+
const e = St(t.transaction), a = this.dehydrateState(e);
|
10719
10713
|
return JSON.stringify(a);
|
10720
10714
|
}
|
10721
10715
|
/**
|
@@ -10751,12 +10745,12 @@ class yo {
|
|
10751
10745
|
this.stepElements = e(this.stepElements, t);
|
10752
10746
|
}
|
10753
10747
|
getInvalidCanvasRegions() {
|
10754
|
-
return this.workflow.steps.reduce((t, e) => (
|
10748
|
+
return this.workflow.steps.reduce((t, e) => (yt(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
|
10755
10749
|
(a) => t.push(a)
|
10756
10750
|
), t), []);
|
10757
10751
|
}
|
10758
10752
|
getInvalidModelVariants() {
|
10759
|
-
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !
|
10753
|
+
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !yt(e, this.stepSelections) && t.push(e.stepName), t), []);
|
10760
10754
|
}
|
10761
10755
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
10762
10756
|
const a = this.product;
|
@@ -10764,10 +10758,10 @@ class yo {
|
|
10764
10758
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
10765
10759
|
const n = async (c, d, A) => {
|
10766
10760
|
if (c.type === v.SilentIllustration) {
|
10767
|
-
const u = await new
|
10761
|
+
const u = await new ja(c, d).trigger();
|
10768
10762
|
return { step: c, results: u };
|
10769
10763
|
} else if (c.type === v.ProductOverlay) {
|
10770
|
-
const u = await new
|
10764
|
+
const u = await new ja(
|
10771
10765
|
c,
|
10772
10766
|
d,
|
10773
10767
|
A
|
@@ -10856,13 +10850,13 @@ class yo {
|
|
10856
10850
|
...this.stepSelections,
|
10857
10851
|
[t]: { selectedVariants: e }
|
10858
10852
|
}, this.selectionCost = Object.values(this.stepSelections).reduce((f, E) => f + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((f) => {
|
10859
|
-
|
10853
|
+
yt(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1, delete this.stepMetadata[f.stepName], delete this.stepSelections[f.stepName], delete this.storage[f.stepName]);
|
10860
10854
|
});
|
10861
10855
|
const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((f) => f.silentSteps).flat(), A = l.map((f) => f.silentSteps).flat().filter(
|
10862
10856
|
(f) => !c.some((E) => E.stepName === f.stepName)
|
10863
10857
|
);
|
10864
10858
|
c.forEach((f) => {
|
10865
|
-
|
10859
|
+
yt(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1);
|
10866
10860
|
});
|
10867
10861
|
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
10868
10862
|
this.stepElements = {
|
@@ -10872,7 +10866,7 @@ class yo {
|
|
10872
10866
|
}, this.removeElements(u);
|
10873
10867
|
const p = this.workflow.steps.find((f) => f.stepName === t);
|
10874
10868
|
p?.type === v.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10875
|
-
const g = u.map((f) => new bt(f.id)), C = new
|
10869
|
+
const g = u.map((f) => new bt(f.id)), C = new Wa(this.constructSerializableWorkflow()), S = [...m, ...g, C];
|
10876
10870
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10877
10871
|
const b = this.getInvalidModelVariants(), I = this.modelContainer;
|
10878
10872
|
if (I) {
|
@@ -10904,7 +10898,7 @@ class yo {
|
|
10904
10898
|
);
|
10905
10899
|
break;
|
10906
10900
|
case v.Frame:
|
10907
|
-
a.push(
|
10901
|
+
a.push(wt.init(l, this, this.reloadedState));
|
10908
10902
|
break;
|
10909
10903
|
case v.Illustration:
|
10910
10904
|
a.push(
|
@@ -11835,7 +11829,7 @@ const To = async (r, t) => {
|
|
11835
11829
|
headers: e
|
11836
11830
|
}
|
11837
11831
|
})).data?.designCreateMany;
|
11838
|
-
},
|
11832
|
+
}, Ka = (r, t, e) => {
|
11839
11833
|
const a = (i) => {
|
11840
11834
|
const s = {};
|
11841
11835
|
if (i.type === "Frame") {
|
@@ -11919,7 +11913,7 @@ const To = async (r, t) => {
|
|
11919
11913
|
if (c !== void 0) return c;
|
11920
11914
|
await r.outstandingRequestsPromise();
|
11921
11915
|
const F = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await y.getShadowGraphqlClient().query({
|
11922
|
-
query:
|
11916
|
+
query: Dn,
|
11923
11917
|
variables: { ids: [n.id] },
|
11924
11918
|
fetchPolicy: "no-cache",
|
11925
11919
|
errorPolicy: "all",
|
@@ -11931,7 +11925,7 @@ const To = async (r, t) => {
|
|
11931
11925
|
T.errors && console.log("Server Error:", et.message);
|
11932
11926
|
}), null) : tt ?? null;
|
11933
11927
|
})() || (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"));
|
11934
|
-
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l &&
|
11928
|
+
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ka(l, t, !0), g = l && Ka(l, t, !1), C = async (B) => {
|
11935
11929
|
const F = {};
|
11936
11930
|
let Q = 0;
|
11937
11931
|
if (Object.keys(i).length > 0)
|
@@ -11940,12 +11934,12 @@ const To = async (r, t) => {
|
|
11940
11934
|
for (let W = 0; W < tt.selections.length; ++W) {
|
11941
11935
|
const q = tt.selections[W];
|
11942
11936
|
if (et && (!B || et.option && (et.option.variants || []).length > 1 && !et.data.hideSelectionInCart && !et.data.hideSelectionsInCart)) {
|
11943
|
-
const
|
11944
|
-
F[
|
11937
|
+
const Ct = et.stepTitle;
|
11938
|
+
F[Ct] ? F[Ct].push({
|
11945
11939
|
id: q.id || "",
|
11946
11940
|
name: q.name,
|
11947
11941
|
priceModifier: q.priceModifier
|
11948
|
-
}) : F[
|
11942
|
+
}) : F[Ct] = [
|
11949
11943
|
{
|
11950
11944
|
id: q.id || "",
|
11951
11945
|
name: q.name,
|
@@ -12042,7 +12036,7 @@ const To = async (r, t) => {
|
|
12042
12036
|
);
|
12043
12037
|
const n = await (async () => {
|
12044
12038
|
const l = await y.getShadowGraphqlClient().query({
|
12045
|
-
query:
|
12039
|
+
query: Dn,
|
12046
12040
|
variables: { ids: r.map((c) => c.transaction.id) },
|
12047
12041
|
fetchPolicy: "no-cache",
|
12048
12042
|
errorPolicy: "all"
|
@@ -12195,7 +12189,7 @@ const Ke = new $o(), Uo = w`
|
|
12195
12189
|
var zo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(zo || {});
|
12196
12190
|
class Go {
|
12197
12191
|
constructor(t, e) {
|
12198
|
-
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate =
|
12192
|
+
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = An(async () => {
|
12199
12193
|
await Ke.getSavedDesignByTransaction(
|
12200
12194
|
this.getWorkflowManager().getTransaction().id
|
12201
12195
|
) && this.save();
|
@@ -12316,13 +12310,13 @@ class Go {
|
|
12316
12310
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
12317
12311
|
if (!h)
|
12318
12312
|
throw new ke("Failed to obtain 2D context for preview image creation");
|
12319
|
-
const m = this.workflowManager.getTemplatingContext(), p =
|
12313
|
+
const m = this.workflowManager.getTemplatingContext(), p = Sa(u.layoutState.layout, u.layoutState.elements, {
|
12320
12314
|
renderingConfiguration: {
|
12321
12315
|
purpose: Ht.Print,
|
12322
12316
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12323
12317
|
templatingContext: m
|
12324
12318
|
}
|
12325
|
-
}), g =
|
12319
|
+
}), g = gn(p);
|
12326
12320
|
await (await Aa.from(h, g, {
|
12327
12321
|
anonymousCrossOrigin: !0,
|
12328
12322
|
ignoreDimensions: !1,
|
@@ -12349,7 +12343,7 @@ class Go {
|
|
12349
12343
|
getStepsConditionallyActive() {
|
12350
12344
|
return this.getScenes().flatMap(
|
12351
12345
|
(t) => this.getStepsByScene(t).filter(
|
12352
|
-
(e) =>
|
12346
|
+
(e) => yt(e.getRaw(), this.getWorkflowManager().getStepSelections())
|
12353
12347
|
)
|
12354
12348
|
);
|
12355
12349
|
}
|
@@ -12500,7 +12494,7 @@ class Go {
|
|
12500
12494
|
return await Ke.addDesign(n), n;
|
12501
12495
|
}
|
12502
12496
|
async copy() {
|
12503
|
-
const t =
|
12497
|
+
const t = St(this.getCommandContext().getState());
|
12504
12498
|
if (!t) throw new V("Internal state is undefined! Cannot copy experience!");
|
12505
12499
|
const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = this.getWorkflowManager().getTransaction().integrationProduct?.id;
|
12506
12500
|
if (!n) throw new V("Integration product id is undefined!");
|
@@ -12687,8 +12681,8 @@ const Wo = (r) => {
|
|
12687
12681
|
"tspan"
|
12688
12682
|
], Ho = async (r, t, e) => {
|
12689
12683
|
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);
|
12690
|
-
o.searchParams.append("video",
|
12691
|
-
const l = o.toString(), d = `data:image/svg+xml;base64,${
|
12684
|
+
o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
12685
|
+
const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await cn(l, { type: "svg" }))}`, A = (h) => {
|
12692
12686
|
const m = r.find((g) => g.panelId === h.panelId);
|
12693
12687
|
if (!m)
|
12694
12688
|
throw new Y(h);
|
@@ -12721,7 +12715,7 @@ const Wo = (r) => {
|
|
12721
12715
|
const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
|
12722
12716
|
if (!h)
|
12723
12717
|
throw new Y(c);
|
12724
|
-
const m =
|
12718
|
+
const m = Ea(
|
12725
12719
|
s,
|
12726
12720
|
A,
|
12727
12721
|
{
|
@@ -13218,7 +13212,7 @@ const rl = () => new Promise((r, t) => {
|
|
13218
13212
|
}), il = rl();
|
13219
13213
|
class sl {
|
13220
13214
|
constructor(t, e, a, n, i) {
|
13221
|
-
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new
|
13215
|
+
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new kn(2), this.id = t, this.name = e, this.service = a, this.panelSize = n, this.getWorkflowManager = i;
|
13222
13216
|
}
|
13223
13217
|
getID() {
|
13224
13218
|
return this.id;
|
@@ -13264,7 +13258,7 @@ class sl {
|
|
13264
13258
|
* Actions to perform when a static render event is fired for this canvas.
|
13265
13259
|
*/
|
13266
13260
|
async render(t) {
|
13267
|
-
const e =
|
13261
|
+
const e = St(t);
|
13268
13262
|
this.lastRequestedRenderArguments = e;
|
13269
13263
|
const a = this.getStaticContext();
|
13270
13264
|
if (!a) {
|
@@ -13285,7 +13279,7 @@ class sl {
|
|
13285
13279
|
);
|
13286
13280
|
}
|
13287
13281
|
}
|
13288
|
-
class ol extends
|
13282
|
+
class ol extends xn {
|
13289
13283
|
constructor(t, e, a, n, i, s) {
|
13290
13284
|
super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = n, this.layouts = i, this.getWorkflowManager = s;
|
13291
13285
|
}
|
@@ -13335,12 +13329,12 @@ class ol extends Fn {
|
|
13335
13329
|
l = g.width, c = g.height;
|
13336
13330
|
} else
|
13337
13331
|
l = i.width, c = i.height;
|
13338
|
-
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A =
|
13332
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Sa(t.layoutState.layout, e, {
|
13339
13333
|
renderingConfiguration: {
|
13340
13334
|
purpose: Ht.ThreeD,
|
13341
13335
|
templatingContext: d
|
13342
13336
|
}
|
13343
|
-
}), u =
|
13337
|
+
}), u = gn(A), h = await Aa.from(this.ctx, u, {
|
13344
13338
|
anonymousCrossOrigin: !0,
|
13345
13339
|
ignoreDimensions: !this.nonPOTSupport,
|
13346
13340
|
ignoreAnimation: !0,
|
@@ -13419,14 +13413,14 @@ class ll {
|
|
13419
13413
|
case L.FileUpload:
|
13420
13414
|
return new cl(this.bundle, t).initialize();
|
13421
13415
|
case L.ColorOption:
|
13422
|
-
return new
|
13416
|
+
return new _a(
|
13423
13417
|
this.bundle,
|
13424
13418
|
t,
|
13425
13419
|
t.entityId ? await H.getOption(t.entityId) : void 0
|
13426
13420
|
);
|
13427
13421
|
case L.Option: {
|
13428
13422
|
const e = t.entityId ? await H.getOption(t.entityId) : void 0;
|
13429
|
-
return e?.type === "Color" ? new
|
13423
|
+
return e?.type === "Color" ? new _a(this.bundle, t, e) : new tr(this.bundle, t, e);
|
13430
13424
|
}
|
13431
13425
|
case L.Text:
|
13432
13426
|
return new dl(this.bundle, t);
|
@@ -13435,7 +13429,7 @@ class ll {
|
|
13435
13429
|
}
|
13436
13430
|
}
|
13437
13431
|
}
|
13438
|
-
class
|
13432
|
+
class Ia {
|
13439
13433
|
constructor(t, e) {
|
13440
13434
|
this.bundle = t, this.property = e;
|
13441
13435
|
}
|
@@ -13496,7 +13490,7 @@ class Ba {
|
|
13496
13490
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
13497
13491
|
}
|
13498
13492
|
}
|
13499
|
-
class cl extends
|
13493
|
+
class cl extends Ia {
|
13500
13494
|
constructor(t, e) {
|
13501
13495
|
super(t, e);
|
13502
13496
|
}
|
@@ -13507,7 +13501,7 @@ class cl extends Ba {
|
|
13507
13501
|
const t = await this.getImage();
|
13508
13502
|
if (t?.fileLink)
|
13509
13503
|
if (t?.fileLink.endsWith(".svg")) {
|
13510
|
-
const e = await nt(t?.fileLink), a = await
|
13504
|
+
const e = await nt(t?.fileLink), a = await ba(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
|
13511
13505
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
13512
13506
|
s.colors[c.key] = {
|
13513
13507
|
browserValue: c.browserValue,
|
@@ -13722,7 +13716,7 @@ class cl extends Ba {
|
|
13722
13716
|
);
|
13723
13717
|
}
|
13724
13718
|
}
|
13725
|
-
class dl extends
|
13719
|
+
class dl extends Ia {
|
13726
13720
|
constructor(t, e) {
|
13727
13721
|
super(t, e);
|
13728
13722
|
}
|
@@ -13761,7 +13755,7 @@ class dl extends Ba {
|
|
13761
13755
|
await Promise.all(n);
|
13762
13756
|
}
|
13763
13757
|
}
|
13764
|
-
class tr extends
|
13758
|
+
class tr extends Ia {
|
13765
13759
|
constructor(t, e, a) {
|
13766
13760
|
super(t, e), this.optionResource = a;
|
13767
13761
|
}
|
@@ -13823,7 +13817,7 @@ class tr extends Ba {
|
|
13823
13817
|
await Promise.all(n);
|
13824
13818
|
}
|
13825
13819
|
}
|
13826
|
-
class
|
13820
|
+
class _a extends tr {
|
13827
13821
|
constructor(t, e, a) {
|
13828
13822
|
super(t, e, a);
|
13829
13823
|
}
|
@@ -13924,7 +13918,7 @@ class hl {
|
|
13924
13918
|
}
|
13925
13919
|
async setGlobalPropertyState(t) {
|
13926
13920
|
this.globalPropertyState || await this.initPromise;
|
13927
|
-
const e =
|
13921
|
+
const e = St(this.globalPropertyState);
|
13928
13922
|
this.globalPropertyState = { ...t, id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
13929
13923
|
}
|
13930
13924
|
getAspectMandatoryFulfilled(t) {
|
@@ -13951,7 +13945,7 @@ class hl {
|
|
13951
13945
|
if (!i)
|
13952
13946
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13953
13947
|
this.mandatoryFulfilledAspects.set(t, e !== "");
|
13954
|
-
const s =
|
13948
|
+
const s = St(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
|
13955
13949
|
if (o.length > 0)
|
13956
13950
|
if (n) {
|
13957
13951
|
const l = o.find((c) => c.channel === n);
|
@@ -13994,7 +13988,7 @@ class hl {
|
|
13994
13988
|
const n = this.configuration.aspects.find((o) => o.name === t);
|
13995
13989
|
if (!n)
|
13996
13990
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13997
|
-
const i =
|
13991
|
+
const i = St(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((o) => o.name === t);
|
13998
13992
|
if (s.length > 0)
|
13999
13993
|
if (a) {
|
14000
13994
|
const o = s.find((l) => l.channel === a);
|
@@ -14391,7 +14385,7 @@ class ar {
|
|
14391
14385
|
if (u || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
14392
14386
|
return;
|
14393
14387
|
l.abort(), u = !0, h.unsubscribe();
|
14394
|
-
const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(
|
14388
|
+
const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(St(g))) || [];
|
14395
14389
|
A({
|
14396
14390
|
items: p,
|
14397
14391
|
// Clone items because it could be cached data (immutable)
|
@@ -15140,7 +15134,7 @@ class _e {
|
|
15140
15134
|
}
|
15141
15135
|
async getAllStakeholders() {
|
15142
15136
|
const t = await y.getShadowGraphqlClient().query({
|
15143
|
-
query:
|
15137
|
+
query: Ya,
|
15144
15138
|
errorPolicy: "all",
|
15145
15139
|
fetchPolicy: "no-cache",
|
15146
15140
|
variables: {
|
@@ -15156,7 +15150,7 @@ class _e {
|
|
15156
15150
|
}
|
15157
15151
|
async getCurrentStakeholder() {
|
15158
15152
|
const t = await y.getShadowGraphqlClient().query({
|
15159
|
-
query:
|
15153
|
+
query: Ya,
|
15160
15154
|
errorPolicy: "all",
|
15161
15155
|
fetchPolicy: "no-cache",
|
15162
15156
|
variables: {
|
@@ -15560,7 +15554,7 @@ class ue {
|
|
15560
15554
|
return this.getArtifacts().get(t);
|
15561
15555
|
}
|
15562
15556
|
}
|
15563
|
-
class
|
15557
|
+
class Pa {
|
15564
15558
|
constructor(t) {
|
15565
15559
|
this.value = t;
|
15566
15560
|
}
|
@@ -15573,12 +15567,12 @@ class Ia {
|
|
15573
15567
|
}
|
15574
15568
|
}
|
15575
15569
|
var Fl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Fl || {});
|
15576
|
-
class Ad extends
|
15570
|
+
class Ad extends Pa {
|
15577
15571
|
constructor(t) {
|
15578
15572
|
super(`"${t}"`);
|
15579
15573
|
}
|
15580
15574
|
}
|
15581
|
-
class nr extends
|
15575
|
+
class nr extends Pa {
|
15582
15576
|
constructor(t, e) {
|
15583
15577
|
if (e !== "Asset" && !nr.validUUID(t))
|
15584
15578
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
@@ -15588,12 +15582,12 @@ class nr extends Ia {
|
|
15588
15582
|
return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
15589
15583
|
}
|
15590
15584
|
}
|
15591
|
-
class ud extends
|
15585
|
+
class ud extends Pa {
|
15592
15586
|
constructor(t) {
|
15593
15587
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
15594
15588
|
}
|
15595
15589
|
}
|
15596
|
-
class
|
15590
|
+
class Xa {
|
15597
15591
|
constructor(t) {
|
15598
15592
|
this.integrationProduct = t;
|
15599
15593
|
}
|
@@ -15781,7 +15775,7 @@ class Nl {
|
|
15781
15775
|
}
|
15782
15776
|
async generateCode(t) {
|
15783
15777
|
const e = await this.cognitoClient?.send(
|
15784
|
-
new
|
15778
|
+
new ka({
|
15785
15779
|
AuthFlow: "CUSTOM_AUTH",
|
15786
15780
|
ClientId: this.userPoolClientId,
|
15787
15781
|
AuthParameters: {
|
@@ -15815,7 +15809,7 @@ class Nl {
|
|
15815
15809
|
throw new Error("Failed to find existing tokens.");
|
15816
15810
|
const e = JSON.parse(t);
|
15817
15811
|
return await this.cognitoClient?.send(
|
15818
|
-
new
|
15812
|
+
new ka({
|
15819
15813
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
15820
15814
|
ClientId: this.userPoolClientId,
|
15821
15815
|
AuthParameters: {
|
@@ -15845,7 +15839,7 @@ class Ql {
|
|
15845
15839
|
* @param currency The currency to determine precision for.
|
15846
15840
|
*/
|
15847
15841
|
getPrecisionForCurrency(t) {
|
15848
|
-
const e = t, a =
|
15842
|
+
const e = t, a = Ma.code(e);
|
15849
15843
|
return a ? a.digits : 2;
|
15850
15844
|
}
|
15851
15845
|
/**
|
@@ -15856,11 +15850,11 @@ class Ql {
|
|
15856
15850
|
*/
|
15857
15851
|
getSpecialFormat(t) {
|
15858
15852
|
const e = t;
|
15859
|
-
if (
|
15853
|
+
if (Ma.code(e)?.code === "CLP")
|
15860
15854
|
return "USD0,0";
|
15861
15855
|
}
|
15862
15856
|
}
|
15863
|
-
const
|
15857
|
+
const Za = new Ql();
|
15864
15858
|
class Rl {
|
15865
15859
|
constructor(t, e, a, n) {
|
15866
15860
|
this.presentmentCurrency = void 0, this.presentmentCurrency = n, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
|
@@ -15892,13 +15886,13 @@ class Rl {
|
|
15892
15886
|
* Converts a monetary value from the database to the units of its currency.
|
15893
15887
|
*/
|
15894
15888
|
units(t, e) {
|
15895
|
-
return t / Math.pow(10,
|
15889
|
+
return t / Math.pow(10, Za.getPrecisionForCurrency(e));
|
15896
15890
|
}
|
15897
15891
|
/**
|
15898
15892
|
* Converts a monetary value in units to the subunits of its currency.
|
15899
15893
|
*/
|
15900
15894
|
subunits(t, e) {
|
15901
|
-
return t * Math.pow(10,
|
15895
|
+
return t * Math.pow(10, Za.getPrecisionForCurrency(e));
|
15902
15896
|
}
|
15903
15897
|
}
|
15904
15898
|
const Ol = async (r, t) => {
|
@@ -15965,7 +15959,7 @@ class md {
|
|
15965
15959
|
} catch (a) {
|
15966
15960
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15967
15961
|
}
|
15968
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.
|
15962
|
+
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.31c9ba15-a663-564f-ae8f-4ab38e25e1d4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15969
15963
|
}
|
15970
15964
|
configure(t) {
|
15971
15965
|
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 && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -16477,7 +16471,7 @@ class md {
|
|
16477
16471
|
}));
|
16478
16472
|
}, s = t.map((f, E) => ({ option: f, index: E })), o = s.filter((f) => f.option.type === "transaction"), l = s.filter(
|
16479
16473
|
(f) => f.option.type === "integration" || f.option.type === "external"
|
16480
|
-
), c =
|
16474
|
+
), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
|
16481
16475
|
...c.map(n),
|
16482
16476
|
...d.map(i)
|
16483
16477
|
])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await rr(u, e), m = new Map(h.map((f) => [f.id, f])), p = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), g = A.map(async (f) => {
|
@@ -16504,10 +16498,10 @@ class md {
|
|
16504
16498
|
};
|
16505
16499
|
if (T.type === "transaction" && E.workflowState) {
|
16506
16500
|
const q = JSON.parse(E.workflowState);
|
16507
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16501
|
+
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
|
16508
16502
|
} else if (!B && T.workflowState) {
|
16509
16503
|
const q = JSON.parse(T.workflowState);
|
16510
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16504
|
+
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
|
16511
16505
|
} else
|
16512
16506
|
W.layouts = Ll(
|
16513
16507
|
W.transaction,
|
@@ -16539,7 +16533,7 @@ class md {
|
|
16539
16533
|
})).data?.integrationProducts;
|
16540
16534
|
if (!i || i.length === 0 || !i[0]?.id)
|
16541
16535
|
throw new Error("Integration product not found.");
|
16542
|
-
return new
|
16536
|
+
return new Xa(i[0]);
|
16543
16537
|
}
|
16544
16538
|
async getIntegrationProductFromExternalIds(t, e, a) {
|
16545
16539
|
const s = (await y.getShadowGraphqlClient().query({
|
@@ -16553,7 +16547,7 @@ class md {
|
|
16553
16547
|
})).data?.integrationProductFromExternalIds;
|
16554
16548
|
if (!s?.id)
|
16555
16549
|
throw new Error("Integration product not found.");
|
16556
|
-
return new
|
16550
|
+
return new Xa(s);
|
16557
16551
|
}
|
16558
16552
|
async getIntegrationProduct(t) {
|
16559
16553
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
@@ -16650,7 +16644,7 @@ function me(r, t, e) {
|
|
16650
16644
|
}
|
16651
16645
|
class Gl {
|
16652
16646
|
constructor(t, e) {
|
16653
|
-
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets =
|
16647
|
+
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = An(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
|
16654
16648
|
useThreshold: !1,
|
16655
16649
|
invertThreshold: !1,
|
16656
16650
|
threshold: 128,
|
@@ -16671,7 +16665,7 @@ class Gl {
|
|
16671
16665
|
let i = !1;
|
16672
16666
|
for (let s = 0; s < n.currentFrameSources.length; s++) {
|
16673
16667
|
const o = n.currentFrameSources[s], l = await Oe(o), c = this.frameData ? this.frameData[s] : void 0;
|
16674
|
-
|
16668
|
+
dn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
|
16675
16669
|
}
|
16676
16670
|
i && (this.onFrameDataChangeListeners.forEach(
|
16677
16671
|
(s) => s(this.frameData)
|
@@ -16860,7 +16854,7 @@ class Gl {
|
|
16860
16854
|
}
|
16861
16855
|
recalculateOffsets(t) {
|
16862
16856
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
16863
|
-
this.offsets[a] =
|
16857
|
+
this.offsets[a] = Ea(
|
16864
16858
|
t,
|
16865
16859
|
e,
|
16866
16860
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
@@ -17040,7 +17034,7 @@ class ql extends Z {
|
|
17040
17034
|
}
|
17041
17035
|
selectVariant(t) {
|
17042
17036
|
const e = this.manager.getRegionElements(this.step.stepName);
|
17043
|
-
return
|
17037
|
+
return wt.selectVariant(
|
17044
17038
|
this.step,
|
17045
17039
|
t.getResource(),
|
17046
17040
|
e,
|
@@ -17060,7 +17054,7 @@ class ql extends Z {
|
|
17060
17054
|
* @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
|
17061
17055
|
*/
|
17062
17056
|
async selectImage(t, e = !0, a = !0) {
|
17063
|
-
if (await
|
17057
|
+
if (await wt.selectImage(this.step, t, this.manager, a), e) {
|
17064
17058
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17065
17059
|
this.manager.updateStorage(this.step.stepName, {
|
17066
17060
|
framePatternData: {
|
@@ -17098,7 +17092,7 @@ class ql extends Z {
|
|
17098
17092
|
if (!e)
|
17099
17093
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
17100
17094
|
const a = await O.removeBackgroundFromAsset(e);
|
17101
|
-
t && await
|
17095
|
+
t && await wt.selectImage(this.step, a, this.manager, !1);
|
17102
17096
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17103
17097
|
return this.manager.updateStorage(this.step.stepName, {
|
17104
17098
|
framePatternData: {
|
@@ -17109,7 +17103,7 @@ class ql extends Z {
|
|
17109
17103
|
}), a;
|
17110
17104
|
}
|
17111
17105
|
changeColors(t) {
|
17112
|
-
|
17106
|
+
wt.changeColors(this.step, this.manager, t);
|
17113
17107
|
}
|
17114
17108
|
getImageData() {
|
17115
17109
|
if (this.frameService)
|
@@ -17119,7 +17113,7 @@ class ql extends Z {
|
|
17119
17113
|
return this.step.data.colorOption;
|
17120
17114
|
}
|
17121
17115
|
getAvailableColors() {
|
17122
|
-
return this.step.data.colorPickerEnabled ?
|
17116
|
+
return this.step.data.colorPickerEnabled ? wt.availableColors(this.step, this.manager) : Promise.resolve([]);
|
17123
17117
|
}
|
17124
17118
|
isColorPickerEnabled() {
|
17125
17119
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -17132,7 +17126,7 @@ class ql extends Z {
|
|
17132
17126
|
return this.step.data.maxColors;
|
17133
17127
|
}
|
17134
17128
|
getUniqueColorCount() {
|
17135
|
-
return
|
17129
|
+
return wt.getUniqueColorCount(this.step, this.manager);
|
17136
17130
|
}
|
17137
17131
|
getCurrentFrameStep(t, e, a, n) {
|
17138
17132
|
return n && n.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
|
@@ -17202,7 +17196,7 @@ const jl = w`
|
|
17202
17196
|
id
|
17203
17197
|
}
|
17204
17198
|
}
|
17205
|
-
`,
|
17199
|
+
`, Da = w`
|
17206
17200
|
query GetCustomerTransactions(
|
17207
17201
|
$id: String!
|
17208
17202
|
$limit: Int!
|
@@ -17369,7 +17363,7 @@ const jl = w`
|
|
17369
17363
|
},
|
17370
17364
|
context: t
|
17371
17365
|
}), Pd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17372
|
-
query:
|
17366
|
+
query: Da,
|
17373
17367
|
errorPolicy: "all",
|
17374
17368
|
fetchPolicy: "no-cache",
|
17375
17369
|
variables: {
|
@@ -17389,7 +17383,7 @@ const jl = w`
|
|
17389
17383
|
limit: t
|
17390
17384
|
}
|
17391
17385
|
}))?.data.customerTransactionsFeed?.items || [], Dd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17392
|
-
query:
|
17386
|
+
query: Da,
|
17393
17387
|
errorPolicy: "all",
|
17394
17388
|
fetchPolicy: "no-cache",
|
17395
17389
|
variables: {
|
@@ -17409,7 +17403,7 @@ const jl = w`
|
|
17409
17403
|
limit: t
|
17410
17404
|
}
|
17411
17405
|
}))?.data.customerTransactionsFeed?.items || [], Fd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17412
|
-
query:
|
17406
|
+
query: Da,
|
17413
17407
|
errorPolicy: "all",
|
17414
17408
|
fetchPolicy: "no-cache",
|
17415
17409
|
variables: {
|
@@ -17456,7 +17450,7 @@ K = { __e: function(r, t, e, a) {
|
|
17456
17450
|
}
|
17457
17451
|
throw r;
|
17458
17452
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17459
|
-
var st, Xe,
|
17453
|
+
var st, Xe, tn, ir = [], Ze = [], en = K.__b, an = K.__r, nn = K.diffed, rn = K.__c, sn = K.unmount;
|
17460
17454
|
function ec() {
|
17461
17455
|
for (var r; r = ir.shift(); )
|
17462
17456
|
if (r.__P && r.__H)
|
@@ -17467,17 +17461,17 @@ function ec() {
|
|
17467
17461
|
}
|
17468
17462
|
}
|
17469
17463
|
K.__b = function(r) {
|
17470
|
-
st = null,
|
17464
|
+
st = null, en && en(r);
|
17471
17465
|
}, K.__r = function(r) {
|
17472
|
-
|
17466
|
+
an && an(r);
|
17473
17467
|
var t = (st = r.__c).__H;
|
17474
17468
|
t && (Xe === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
17475
17469
|
e.__N && (e.__ = e.__N), e.__V = Ze, e.__N = e.i = void 0;
|
17476
17470
|
})) : (t.__h.forEach(we), t.__h.forEach(da), t.__h = [])), Xe = st;
|
17477
17471
|
}, K.diffed = function(r) {
|
17478
|
-
|
17472
|
+
nn && nn(r);
|
17479
17473
|
var t = r.__c;
|
17480
|
-
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 &&
|
17474
|
+
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && tn === K.requestAnimationFrame || ((tn = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
|
17481
17475
|
e.i && (e.__H = e.i), e.__V !== Ze && (e.__ = e.__V), e.i = void 0, e.__V = Ze;
|
17482
17476
|
})), Xe = st = null;
|
17483
17477
|
}, K.__c = function(r, t) {
|
@@ -17491,9 +17485,9 @@ K.__b = function(r) {
|
|
17491
17485
|
n.__h && (n.__h = []);
|
17492
17486
|
}), t = [], K.__e(a, e.__v);
|
17493
17487
|
}
|
17494
|
-
}),
|
17488
|
+
}), rn && rn(r, t);
|
17495
17489
|
}, K.unmount = function(r) {
|
17496
|
-
|
17490
|
+
sn && sn(r);
|
17497
17491
|
var t, e = r.__c;
|
17498
17492
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17499
17493
|
try {
|
@@ -17503,12 +17497,12 @@ K.__b = function(r) {
|
|
17503
17497
|
}
|
17504
17498
|
}), e.__H = void 0, t && K.__e(t, e.__v));
|
17505
17499
|
};
|
17506
|
-
var
|
17500
|
+
var on = typeof requestAnimationFrame == "function";
|
17507
17501
|
function ac(r) {
|
17508
17502
|
var t, e = function() {
|
17509
|
-
clearTimeout(a),
|
17503
|
+
clearTimeout(a), on && cancelAnimationFrame(t), setTimeout(r);
|
17510
17504
|
}, a = setTimeout(e, 100);
|
17511
|
-
|
17505
|
+
on && (t = requestAnimationFrame(e));
|
17512
17506
|
}
|
17513
17507
|
function we(r) {
|
17514
17508
|
var t = st, e = r.__c;
|
@@ -17540,7 +17534,7 @@ const sr = w`
|
|
17540
17534
|
}
|
17541
17535
|
missingComponentTypes
|
17542
17536
|
}
|
17543
|
-
`,
|
17537
|
+
`, Fa = w`
|
17544
17538
|
${sr}
|
17545
17539
|
fragment AddressValidationJobFields on AddressValidationJob {
|
17546
17540
|
id
|
@@ -17553,14 +17547,14 @@ const sr = w`
|
|
17553
17547
|
}
|
17554
17548
|
}
|
17555
17549
|
`, nc = w`
|
17556
|
-
${
|
17550
|
+
${Fa}
|
17557
17551
|
query GetAddressValidationJobs($ids: [String!]!) {
|
17558
17552
|
addressValidationJobs(ids: $ids) {
|
17559
17553
|
...AddressValidationJobFields
|
17560
17554
|
}
|
17561
17555
|
}
|
17562
17556
|
`, rc = w`
|
17563
|
-
${
|
17557
|
+
${Fa}
|
17564
17558
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
17565
17559
|
recipients(ids: $ids) {
|
17566
17560
|
id
|
@@ -17577,7 +17571,7 @@ const sr = w`
|
|
17577
17571
|
}
|
17578
17572
|
}
|
17579
17573
|
`, sc = w`
|
17580
|
-
${
|
17574
|
+
${Fa}
|
17581
17575
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
17582
17576
|
recipientValidateBatch(ids: $ids) {
|
17583
17577
|
...AddressValidationJobFields
|
@@ -17634,7 +17628,7 @@ export {
|
|
17634
17628
|
oc as AddressValidationResultConfirmationLevel,
|
17635
17629
|
ud as ArrayInput,
|
17636
17630
|
L as AspectType,
|
17637
|
-
|
17631
|
+
vt as AssetNotFoundError,
|
17638
17632
|
ye as AssetType,
|
17639
17633
|
id as BringForwardCommand,
|
17640
17634
|
rd as BringToBackCommand,
|
@@ -17642,7 +17636,7 @@ export {
|
|
17642
17636
|
br as BundleDesignCreationCartAddMode,
|
17643
17637
|
N as CanvasCommand,
|
17644
17638
|
Ae as CollectionProduct,
|
17645
|
-
|
17639
|
+
_a as ColorOptionGlobalPropertyHandle,
|
17646
17640
|
ds as CommandContext,
|
17647
17641
|
Ce as ConversionDataType,
|
17648
17642
|
tc as ConversionLocation,
|
@@ -17659,16 +17653,16 @@ export {
|
|
17659
17653
|
ms as FontAlignmentCommand,
|
17660
17654
|
us as FontColorCommand,
|
17661
17655
|
hs as FontSizeCommand,
|
17662
|
-
|
17656
|
+
qa as FontSourceCommand,
|
17663
17657
|
Gl as FrameService,
|
17664
17658
|
Wl as FrameStep,
|
17665
17659
|
ql as FrameStepHandle,
|
17666
|
-
|
17660
|
+
Ia as GlobalPropertyHandle,
|
17667
17661
|
R as GroupCommand,
|
17668
17662
|
So as IllustrationStepHandle,
|
17669
17663
|
$e as InformationMessageType,
|
17670
17664
|
Do as InformationStepHandle,
|
17671
|
-
|
17665
|
+
Xa as IntegrationProduct,
|
17672
17666
|
Ir as IntegrationType,
|
17673
17667
|
Xc as LayoutElementFactory,
|
17674
17668
|
x as LayoutElementType,
|
@@ -17691,9 +17685,9 @@ export {
|
|
17691
17685
|
Cl as ProductCollectionProductSortKey,
|
17692
17686
|
qt as ProductWorkflow,
|
17693
17687
|
Kt as PromiseCache,
|
17694
|
-
|
17688
|
+
kn as PromiseQueue,
|
17695
17689
|
Bo as QuestionStepHandle,
|
17696
|
-
|
17690
|
+
xn as QueueablePromise,
|
17697
17691
|
ed as ResizeCommand,
|
17698
17692
|
Yt as ResourceNotFoundError,
|
17699
17693
|
td as RotateCommand,
|
@@ -17736,7 +17730,7 @@ export {
|
|
17736
17730
|
$ as findElement,
|
17737
17731
|
$c as findPmsColors,
|
17738
17732
|
Vt as frameDataCache,
|
17739
|
-
|
17733
|
+
wt as frameStepService,
|
17740
17734
|
M as generate,
|
17741
17735
|
al as generateCommands,
|
17742
17736
|
ot as generateSVGWithUnknownColors,
|
@@ -17759,7 +17753,7 @@ export {
|
|
17759
17753
|
Gc as getPointOfRotation,
|
17760
17754
|
dd as getProductCollections,
|
17761
17755
|
jc as getSEPoint,
|
17762
|
-
|
17756
|
+
Sa as getSvgElement,
|
17763
17757
|
xd as getTemplateBundles,
|
17764
17758
|
Fd as getTemplateTransactions,
|
17765
17759
|
gd as getTransaction,
|
@@ -17792,17 +17786,17 @@ export {
|
|
17792
17786
|
Jn as questionStepService,
|
17793
17787
|
Nc as registerFetchImplementation,
|
17794
17788
|
Tc as registerWindowImplementation,
|
17795
|
-
|
17789
|
+
Ga as rehydrateSerializedLayout,
|
17796
17790
|
_r as rgbToPms,
|
17797
17791
|
ce as rotateAroundPoint,
|
17798
17792
|
pa as sanitizeSvgTree,
|
17799
17793
|
zr as setBearerAuthenticationToken,
|
17800
|
-
|
17794
|
+
Cn as setCanvasModule,
|
17801
17795
|
zt as shapeStepService,
|
17802
17796
|
ws as shortenUrl,
|
17803
17797
|
gt as spiffCoreConfiguration,
|
17804
17798
|
ld as stepAspectValuesToDesignInputSteps,
|
17805
|
-
|
17799
|
+
$a as svgColorValueToDefinition,
|
17806
17800
|
Ln as svgStringDimensions,
|
17807
17801
|
ha as svgToDataUrl,
|
17808
17802
|
G as textStepService,
|