@spiffcommerce/core 34.4.3 → 34.4.4
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/CHANGELOG.md +6 -0
- package/dist/index.js +104 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHttpLink as Ei, ApolloClient as bi, InMemoryCache as Ii, from as Bi, gql as C } from "@apollo/client/core";
|
|
2
2
|
import { setContext as Pi } from "@apollo/client/link/context";
|
|
3
3
|
import { onError as xi } from "@apollo/client/link/error";
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
import { removeTypenameFromVariables as
|
|
4
|
+
import { renderToStaticMarkup as Di } from "preact-render-to-string";
|
|
5
|
+
import { removeTypenameFromVariables as Fi } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as ki } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as wn } from "css";
|
|
8
8
|
import Mi from "fuse.js";
|
|
@@ -24,7 +24,7 @@ import Sn from "lodash.debounce";
|
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Ui from "lodash.omit";
|
|
27
|
-
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), vn = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(vn || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}),
|
|
27
|
+
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), vn = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(vn || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), D = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(D || {}), Vi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Vi || {}), En = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(En || {}), zi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(zi || {}), Gi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(Gi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Wi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Wi || {}), Ee = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Ee || {}), kt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(kt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), qi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(qi || {});
|
|
28
28
|
class bn extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -134,7 +134,7 @@ const ji = () => {
|
|
|
134
134
|
} catch {
|
|
135
135
|
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new za();
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, F = ji();
|
|
138
138
|
class Yi {
|
|
139
139
|
constructor() {
|
|
140
140
|
this.defaultServerUrl = "https://api.au.spiffcommerce.com", this.defaultServicesApiUrl = "https://services.au.spiffcommerce.com", this.defaultHubUrl = "https://hub.au.spiffcommerce.com", this.serverUrl = this.defaultServerUrl, this.servicesApiUrl = this.defaultServicesApiUrl, this.hubUrl = this.defaultHubUrl, this.serverUrlCallbacks = [];
|
|
@@ -217,7 +217,7 @@ const In = /* @__PURE__ */ new Map(), Ga = /* @__PURE__ */ new Map(), Wa = /* @_
|
|
|
217
217
|
t ? Ji(n).then(e).catch(a) : nt(n).then((i) => {
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
|
-
}), Pn = (n) =>
|
|
220
|
+
}), Pn = (n) => Di(n), He = /* @__PURE__ */ new Map(), Xi = async (n, t) => {
|
|
221
221
|
if (Mt([typeof FontFace])) {
|
|
222
222
|
if (He.has(t))
|
|
223
223
|
return He.get(t);
|
|
@@ -292,9 +292,9 @@ let ar, Ia;
|
|
|
292
292
|
const nr = (n) => {
|
|
293
293
|
Ia = n;
|
|
294
294
|
}, ir = () => Ia;
|
|
295
|
-
let
|
|
295
|
+
let Dn;
|
|
296
296
|
const rr = (n) => {
|
|
297
|
-
|
|
297
|
+
Dn = n;
|
|
298
298
|
}, or = () => new Promise((n) => {
|
|
299
299
|
const t = pt.getHubUrl(), e = (a) => {
|
|
300
300
|
a.origin === t && (window.removeEventListener("message", e), n(a.data));
|
|
@@ -304,7 +304,7 @@ const rr = (n) => {
|
|
|
304
304
|
const n = {
|
|
305
305
|
applicationKey: Ia,
|
|
306
306
|
customerToken: ar,
|
|
307
|
-
bearer:
|
|
307
|
+
bearer: Dn
|
|
308
308
|
};
|
|
309
309
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await or(), ...n } : n;
|
|
310
310
|
};
|
|
@@ -356,7 +356,7 @@ class cr {
|
|
|
356
356
|
}), a = xi(({ operation: r, graphQLErrors: o, networkError: s }) => {
|
|
357
357
|
const l = o || [], c = r.getContext();
|
|
358
358
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
359
|
-
}), i =
|
|
359
|
+
}), i = Fi();
|
|
360
360
|
return new bi({
|
|
361
361
|
link: Bi([i, a, e, t]),
|
|
362
362
|
cache: new Ii(),
|
|
@@ -371,7 +371,7 @@ const ft = (n, t, e) => {
|
|
|
371
371
|
return ua(n, t, e);
|
|
372
372
|
try {
|
|
373
373
|
const a = kn(!0);
|
|
374
|
-
return
|
|
374
|
+
return Fn(a), a.createCanvas(n, t, e);
|
|
375
375
|
} catch {
|
|
376
376
|
throw new Error("Canvas module not set");
|
|
377
377
|
}
|
|
@@ -380,12 +380,12 @@ const ft = (n, t, e) => {
|
|
|
380
380
|
return ha(n, t);
|
|
381
381
|
try {
|
|
382
382
|
const e = kn(!0);
|
|
383
|
-
return
|
|
383
|
+
return Fn(e), e.loadImage(n, t);
|
|
384
384
|
} catch {
|
|
385
385
|
throw new Error("Canvas module not set");
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
function
|
|
388
|
+
function Fn(n) {
|
|
389
389
|
ua = n?.createCanvas, ha = n?.loadImage;
|
|
390
390
|
}
|
|
391
391
|
function kn(n) {
|
|
@@ -1808,7 +1808,7 @@ const dr = (n) => new Promise((t) => {
|
|
|
1808
1808
|
"Black 5 C",
|
|
1809
1809
|
"Black 6 C",
|
|
1810
1810
|
"Black 7 C"
|
|
1811
|
-
],
|
|
1811
|
+
], Dt = [
|
|
1812
1812
|
"FEDD00",
|
|
1813
1813
|
"FFD700",
|
|
1814
1814
|
"FE5000",
|
|
@@ -3150,17 +3150,17 @@ const dr = (n) => new Promise((t) => {
|
|
|
3150
3150
|
"3E2B2E",
|
|
3151
3151
|
"101820",
|
|
3152
3152
|
"3D3935"
|
|
3153
|
-
], Ye =
|
|
3153
|
+
], Ye = Dt.map((n) => [
|
|
3154
3154
|
parseInt(n.substring(0, 2), 16),
|
|
3155
3155
|
parseInt(n.substring(2, 4), 16),
|
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
|
3157
3157
|
]);
|
|
3158
3158
|
function ld(n) {
|
|
3159
3159
|
const t = Kt.indexOf(n);
|
|
3160
|
-
return t >= 0 ?
|
|
3160
|
+
return t >= 0 ? Dt[t] : "";
|
|
3161
3161
|
}
|
|
3162
3162
|
function gr(n) {
|
|
3163
|
-
const t =
|
|
3163
|
+
const t = Dt.indexOf(n);
|
|
3164
3164
|
return t >= 0 ? Kt[t] : "";
|
|
3165
3165
|
}
|
|
3166
3166
|
function cd(n, t = 64) {
|
|
@@ -3172,16 +3172,16 @@ function cd(n, t = 64) {
|
|
|
3172
3172
|
});
|
|
3173
3173
|
const r = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), s = parseInt(n.substring(4, 6), 16);
|
|
3174
3174
|
let l, c, d;
|
|
3175
|
-
for (let A = 0; A <
|
|
3175
|
+
for (let A = 0; A < Dt.length; A++) {
|
|
3176
3176
|
l = Ye[A][0], c = Ye[A][1], d = Ye[A][2];
|
|
3177
3177
|
const u = Math.sqrt(Math.pow(r - l, 2) + Math.pow(o - c, 2) + Math.pow(s - d, 2));
|
|
3178
3178
|
a.push(u);
|
|
3179
3179
|
}
|
|
3180
3180
|
for (let A = 0; A < a.length; A++)
|
|
3181
|
-
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex:
|
|
3181
|
+
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: Dt[A], distance: a[A] });
|
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
|
3183
3183
|
}
|
|
3184
|
-
const mr = Kt.map((n, t) => ({ pms: n, hex:
|
|
3184
|
+
const mr = Kt.map((n, t) => ({ pms: n, hex: Dt[t] })), pr = new Mi(mr, { keys: ["pms"] });
|
|
3185
3185
|
function dd(n, t) {
|
|
3186
3186
|
return pr.search(n, t ? { limit: t } : void 0);
|
|
3187
3187
|
}
|
|
@@ -3238,8 +3238,8 @@ const ce = (n) => {
|
|
|
3238
3238
|
"textPath",
|
|
3239
3239
|
"tref",
|
|
3240
3240
|
"tspan"
|
|
3241
|
-
], wr = ["fill", "stroke"],
|
|
3242
|
-
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) =>
|
|
3241
|
+
], wr = ["fill", "stroke"], Ft = (n, t) => {
|
|
3242
|
+
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => Ft(e, t));
|
|
3243
3243
|
}, Tn = (n, t) => {
|
|
3244
3244
|
const e = t(n);
|
|
3245
3245
|
if (e)
|
|
@@ -3256,7 +3256,7 @@ const ce = (n) => {
|
|
|
3256
3256
|
}, Pa = (n, t = !1) => {
|
|
3257
3257
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3258
3258
|
const e = [];
|
|
3259
|
-
|
|
3259
|
+
Ft(n, (a) => {
|
|
3260
3260
|
if (a.tagName === "script") {
|
|
3261
3261
|
a.remove();
|
|
3262
3262
|
return;
|
|
@@ -3282,7 +3282,7 @@ const ce = (n) => {
|
|
|
3282
3282
|
}
|
|
3283
3283
|
}), r.length > 0 ? a.setAttribute("style", r.join(";")) : a.removeAttribute("style");
|
|
3284
3284
|
}
|
|
3285
|
-
}),
|
|
3285
|
+
}), Ft(n, (a) => {
|
|
3286
3286
|
e.forEach((i) => {
|
|
3287
3287
|
i.selectors?.forEach((r) => {
|
|
3288
3288
|
yr(a, r) && i.declarations?.forEach((o) => {
|
|
@@ -3298,7 +3298,7 @@ const ce = (n) => {
|
|
|
3298
3298
|
}, Nn = (n) => dt().parseFromString(n, "image/svg+xml").firstElementChild, vr = (n, t, e) => {
|
|
3299
3299
|
n.setAttribute("height", `${e}px`), n.setAttribute("width", `${t}px`);
|
|
3300
3300
|
}, Qn = (n, t, e) => {
|
|
3301
|
-
|
|
3301
|
+
Ft(n, (a) => {
|
|
3302
3302
|
const i = a.attributes.getNamedItem("fill");
|
|
3303
3303
|
i && i.value !== "none" && a.classList.forEach((o) => {
|
|
3304
3304
|
if (o.startsWith("spiff-fill")) {
|
|
@@ -3341,7 +3341,7 @@ const ce = (n) => {
|
|
|
3341
3341
|
if (!r)
|
|
3342
3342
|
throw new Error("Failed to read SVG.");
|
|
3343
3343
|
return vr(r, t, e), Qn(r, a, i), Rn(r);
|
|
3344
|
-
},
|
|
3344
|
+
}, Da = (n, t, e) => {
|
|
3345
3345
|
const a = Nn(n);
|
|
3346
3346
|
if (!a)
|
|
3347
3347
|
throw new Error("Failed to read SVG.");
|
|
@@ -3355,7 +3355,7 @@ const ce = (n) => {
|
|
|
3355
3355
|
throw new Error("Failed to read SVG.");
|
|
3356
3356
|
Pa(e);
|
|
3357
3357
|
const a = {};
|
|
3358
|
-
|
|
3358
|
+
Ft(e, (o) => {
|
|
3359
3359
|
if (Cr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
|
|
3360
3360
|
let c = "black";
|
|
3361
3361
|
const d = o.parentElement;
|
|
@@ -3445,7 +3445,7 @@ const ce = (n) => {
|
|
|
3445
3445
|
...AssetFields
|
|
3446
3446
|
}
|
|
3447
3447
|
}
|
|
3448
|
-
`,
|
|
3448
|
+
`, Fa = C`
|
|
3449
3449
|
fragment MaterialFields on Material {
|
|
3450
3450
|
id
|
|
3451
3451
|
name
|
|
@@ -3493,7 +3493,7 @@ const ce = (n) => {
|
|
|
3493
3493
|
}
|
|
3494
3494
|
}
|
|
3495
3495
|
`, Br = C`
|
|
3496
|
-
${
|
|
3496
|
+
${Fa}
|
|
3497
3497
|
query GetMaterials($ids: [String]) {
|
|
3498
3498
|
materials(id: $ids) {
|
|
3499
3499
|
...MaterialFields
|
|
@@ -3527,13 +3527,13 @@ const ce = (n) => {
|
|
|
3527
3527
|
variables: {
|
|
3528
3528
|
keys: n
|
|
3529
3529
|
}
|
|
3530
|
-
})).data.assets,
|
|
3530
|
+
})).data.assets, Dr = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3531
3531
|
query: Br,
|
|
3532
3532
|
errorPolicy: "all",
|
|
3533
3533
|
variables: {
|
|
3534
3534
|
ids: n
|
|
3535
3535
|
}
|
|
3536
|
-
})).data.materials,
|
|
3536
|
+
})).data.materials, Fr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
|
|
3537
3537
|
mutation: Pr,
|
|
3538
3538
|
errorPolicy: "all",
|
|
3539
3539
|
fetchPolicy: "no-cache",
|
|
@@ -3609,7 +3609,7 @@ class kr {
|
|
|
3609
3609
|
async getMaterialLocalOrFromServer(t) {
|
|
3610
3610
|
if (this.materialCache.has(t))
|
|
3611
3611
|
return this.materialCache.get(t);
|
|
3612
|
-
const a = (async () => (await
|
|
3612
|
+
const a = (async () => (await Dr([t]))[0])();
|
|
3613
3613
|
return this.materialCache.set(t, a), a;
|
|
3614
3614
|
}
|
|
3615
3615
|
/**
|
|
@@ -3698,7 +3698,7 @@ class kr {
|
|
|
3698
3698
|
* @param assetType The type of asset we're expecting to upload
|
|
3699
3699
|
*/
|
|
3700
3700
|
async dispatchCreateAssetRequest(t, e, a, i) {
|
|
3701
|
-
const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await
|
|
3701
|
+
const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await Fr(t.name, e, r, a, i);
|
|
3702
3702
|
if (o)
|
|
3703
3703
|
return {
|
|
3704
3704
|
assetResponse: o,
|
|
@@ -3731,26 +3731,26 @@ const Rt = "persistentAssets", lt = class lt {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
const e = /* @__PURE__ */ new Map();
|
|
3733
3733
|
e.set(t.key || "", t.fileLink);
|
|
3734
|
-
const a =
|
|
3734
|
+
const a = F.getMap(Rt);
|
|
3735
3735
|
a && a.forEach((i, r) => {
|
|
3736
3736
|
e.set(r, i);
|
|
3737
|
-
}),
|
|
3737
|
+
}), F.setMap(Rt, e), lt.executeCallbacks();
|
|
3738
3738
|
}
|
|
3739
3739
|
/**
|
|
3740
3740
|
* Remove an existing asset from persistence. Noop if the asset doesn't exist.
|
|
3741
3741
|
* @param assetKey The key to remove.
|
|
3742
3742
|
*/
|
|
3743
3743
|
static remove(t) {
|
|
3744
|
-
const e =
|
|
3744
|
+
const e = F.getMap(Rt);
|
|
3745
3745
|
if (!e) return;
|
|
3746
3746
|
const a = Array.from(e.entries()).find((i) => i[0] === t);
|
|
3747
|
-
a && (e.delete(a[0]),
|
|
3747
|
+
a && (e.delete(a[0]), F.setMap(Rt, e), lt.executeCallbacks());
|
|
3748
3748
|
}
|
|
3749
3749
|
/**
|
|
3750
3750
|
* Get a list of all persisted assets.
|
|
3751
3751
|
*/
|
|
3752
3752
|
static list() {
|
|
3753
|
-
const t =
|
|
3753
|
+
const t = F.getMap(Rt);
|
|
3754
3754
|
return t ? Array.from(t.entries()).map((e) => ({ assetKey: e[0], src: e[1] })) : [];
|
|
3755
3755
|
}
|
|
3756
3756
|
/**
|
|
@@ -3798,10 +3798,10 @@ class K {
|
|
|
3798
3798
|
a && (e.delete(a), K.setMap(e));
|
|
3799
3799
|
}
|
|
3800
3800
|
static getMap() {
|
|
3801
|
-
return
|
|
3801
|
+
return F.getMap(Ya) || /* @__PURE__ */ new Map();
|
|
3802
3802
|
}
|
|
3803
3803
|
static setMap(t) {
|
|
3804
|
-
|
|
3804
|
+
F.setMap(Ya, t);
|
|
3805
3805
|
}
|
|
3806
3806
|
}
|
|
3807
3807
|
const U = new kr();
|
|
@@ -3877,7 +3877,7 @@ const _t = new Mr(), On = C`
|
|
|
3877
3877
|
}
|
|
3878
3878
|
`, Tr = C`
|
|
3879
3879
|
${ae(!1)}
|
|
3880
|
-
${
|
|
3880
|
+
${Fa}
|
|
3881
3881
|
${On}
|
|
3882
3882
|
query GetOptions($ids: [String]!) {
|
|
3883
3883
|
options(ids: $ids) {
|
|
@@ -4566,7 +4566,7 @@ const V = new Or(), $n = C`
|
|
|
4566
4566
|
}
|
|
4567
4567
|
`, ao = (n) => C`
|
|
4568
4568
|
${ae(n)}
|
|
4569
|
-
${
|
|
4569
|
+
${Fa}
|
|
4570
4570
|
${On}
|
|
4571
4571
|
${Xr}
|
|
4572
4572
|
${Zr}
|
|
@@ -5534,7 +5534,7 @@ const M = () => {
|
|
|
5534
5534
|
if (!n.pattern)
|
|
5535
5535
|
return "";
|
|
5536
5536
|
if (n.pattern.svg) {
|
|
5537
|
-
const A =
|
|
5537
|
+
const A = Da(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5538
5538
|
return ba(A);
|
|
5539
5539
|
}
|
|
5540
5540
|
return n.pattern.src;
|
|
@@ -5564,7 +5564,7 @@ const M = () => {
|
|
|
5564
5564
|
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, g = n.pattern?.height || 0, m = n.pattern?.scaleX || 1, p = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
|
5565
5565
|
return [n.pattern?.svg ? {
|
|
5566
5566
|
id: `${t}-contents`,
|
|
5567
|
-
type:
|
|
5567
|
+
type: D.Illustration,
|
|
5568
5568
|
x: A,
|
|
5569
5569
|
y: u,
|
|
5570
5570
|
rotation: f,
|
|
@@ -5575,7 +5575,7 @@ const M = () => {
|
|
|
5575
5575
|
colors: n.pattern?.colors
|
|
5576
5576
|
} : {
|
|
5577
5577
|
id: `${t}-contents`,
|
|
5578
|
-
type:
|
|
5578
|
+
type: D.Image,
|
|
5579
5579
|
x: A,
|
|
5580
5580
|
y: u,
|
|
5581
5581
|
rotation: f,
|
|
@@ -5935,7 +5935,7 @@ const Po = (n) => {
|
|
|
5935
5935
|
},
|
|
5936
5936
|
stroke: A,
|
|
5937
5937
|
strokeWidth: u,
|
|
5938
|
-
children: n.curved ? /* @__PURE__ */ P(
|
|
5938
|
+
children: n.curved ? /* @__PURE__ */ P(Do, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ P(
|
|
5939
5939
|
xo,
|
|
5940
5940
|
{
|
|
5941
5941
|
align: n.vertical ? "center" : n.align,
|
|
@@ -5973,7 +5973,7 @@ const Po = (n) => {
|
|
|
5973
5973
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5974
5974
|
};
|
|
5975
5975
|
return /* @__PURE__ */ P("tspan", { textAnchor: Jn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5976
|
-
},
|
|
5976
|
+
}, Do = (n) => {
|
|
5977
5977
|
const t = `#${n.curvedPathId}`;
|
|
5978
5978
|
return /* @__PURE__ */ P(
|
|
5979
5979
|
"textPath",
|
|
@@ -5985,7 +5985,7 @@ const Po = (n) => {
|
|
|
5985
5985
|
children: n.text
|
|
5986
5986
|
}
|
|
5987
5987
|
);
|
|
5988
|
-
},
|
|
5988
|
+
}, Fo = (n) => {
|
|
5989
5989
|
if (n.cachedObjectURL && !n._renderingConfiguration?.omitCachedFields)
|
|
5990
5990
|
return /* @__PURE__ */ P(
|
|
5991
5991
|
qn,
|
|
@@ -6118,7 +6118,7 @@ class ko {
|
|
|
6118
6118
|
return { ...t, transaction: e.apply(a) };
|
|
6119
6119
|
}
|
|
6120
6120
|
}
|
|
6121
|
-
const Xn = (n) => n.type ===
|
|
6121
|
+
const Xn = (n) => n.type === D.Image ? /* @__PURE__ */ P(qn, { ...n }, n.id) : n.type === D.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === D.Illustration ? /* @__PURE__ */ P(Fo, { ...n }, n.id) : n.type === D.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === D.Group ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : null, ka = (n, t, e) => {
|
|
6122
6122
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6123
6123
|
return /* @__PURE__ */ P(
|
|
6124
6124
|
po,
|
|
@@ -6326,17 +6326,17 @@ const ht = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), _e = /* @_
|
|
|
6326
6326
|
rotation: 0,
|
|
6327
6327
|
panelId: n.layoutState.layout.panelId
|
|
6328
6328
|
};
|
|
6329
|
-
if (e && t ===
|
|
6329
|
+
if (e && t === D.Illustration) {
|
|
6330
6330
|
const l = await st(await ei(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6331
6331
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6332
6332
|
const h = s.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
|
|
6333
6333
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6334
6334
|
}
|
|
6335
|
-
if (e && t ===
|
|
6335
|
+
if (e && t === D.Image) {
|
|
6336
6336
|
const l = s.height, c = await Qe(e), d = await Oe(c), A = d.width / d.height;
|
|
6337
6337
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6338
6338
|
}
|
|
6339
|
-
if (e && t ===
|
|
6339
|
+
if (e && t === D.Textbox && a?.text && a?.fontScale) {
|
|
6340
6340
|
await Tt(e);
|
|
6341
6341
|
const l = wt(e), c = mt(a.text, a?.fontScale, l);
|
|
6342
6342
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6345,7 +6345,7 @@ const ht = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), _e = /* @_
|
|
|
6345
6345
|
};
|
|
6346
6346
|
class bd {
|
|
6347
6347
|
static async getFrame(t, e) {
|
|
6348
|
-
const a = await Zn(e.region, e.src), i = await Le(a), r = e.region || await Ut(t,
|
|
6348
|
+
const a = await Zn(e.region, e.src), i = await Le(a), r = e.region || await Ut(t, D.Frame);
|
|
6349
6349
|
return {
|
|
6350
6350
|
id: M(),
|
|
6351
6351
|
x: r.left,
|
|
@@ -6360,7 +6360,7 @@ class bd {
|
|
|
6360
6360
|
path: i.path,
|
|
6361
6361
|
dataWidth: i.width,
|
|
6362
6362
|
dataHeight: i.height,
|
|
6363
|
-
type:
|
|
6363
|
+
type: D.Frame,
|
|
6364
6364
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6365
6365
|
focalBlur: e.configuration.focalBlur,
|
|
6366
6366
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6371,11 +6371,11 @@ class bd {
|
|
|
6371
6371
|
};
|
|
6372
6372
|
}
|
|
6373
6373
|
static async getImage(t, e) {
|
|
6374
|
-
const a = e.region || await Ut(t,
|
|
6374
|
+
const a = e.region || await Ut(t, D.Image, e.src);
|
|
6375
6375
|
return {
|
|
6376
6376
|
id: M(),
|
|
6377
6377
|
src: e.src,
|
|
6378
|
-
type:
|
|
6378
|
+
type: D.Image,
|
|
6379
6379
|
y: a.top,
|
|
6380
6380
|
x: a.left,
|
|
6381
6381
|
rotation: a.rotation,
|
|
@@ -6394,13 +6394,13 @@ class bd {
|
|
|
6394
6394
|
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = xe(c, {
|
|
6395
6395
|
vertical: a.vertical,
|
|
6396
6396
|
uppercase: a.uppercase
|
|
6397
|
-
}), A = e.region || await Ut(t,
|
|
6397
|
+
}), A = e.region || await Ut(t, D.Textbox, i, {
|
|
6398
6398
|
text: d,
|
|
6399
6399
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6400
6400
|
}), u = ie(
|
|
6401
6401
|
{
|
|
6402
6402
|
id: M(),
|
|
6403
|
-
type:
|
|
6403
|
+
type: D.Textbox,
|
|
6404
6404
|
x: A.left,
|
|
6405
6405
|
y: A.top,
|
|
6406
6406
|
width: A.width,
|
|
@@ -6460,14 +6460,14 @@ class bd {
|
|
|
6460
6460
|
</svg>
|
|
6461
6461
|
`, i = {};
|
|
6462
6462
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6463
|
-
const r = e.region?.item || await Ut(t,
|
|
6463
|
+
const r = e.region?.item || await Ut(t, D.Illustration), o = M();
|
|
6464
6464
|
return {
|
|
6465
6465
|
stepRegion: e.region?.item,
|
|
6466
6466
|
stepRegionIndex: e.region?.index,
|
|
6467
6467
|
colors: i,
|
|
6468
6468
|
id: o,
|
|
6469
6469
|
svg: a,
|
|
6470
|
-
type:
|
|
6470
|
+
type: D.Illustration,
|
|
6471
6471
|
y: r.top,
|
|
6472
6472
|
x: r.left,
|
|
6473
6473
|
rotation: r.rotation,
|
|
@@ -6479,7 +6479,7 @@ class bd {
|
|
|
6479
6479
|
};
|
|
6480
6480
|
}
|
|
6481
6481
|
static async getIllustration(t, e) {
|
|
6482
|
-
const a = e.region?.item || await Ut(t,
|
|
6482
|
+
const a = e.region?.item || await Ut(t, D.Illustration, e.src), i = await st(await ei(e.src)), r = await Xt(i.svg), o = M();
|
|
6483
6483
|
return {
|
|
6484
6484
|
cachedObjectURL: r,
|
|
6485
6485
|
stepRegion: e.region?.item,
|
|
@@ -6488,7 +6488,7 @@ class bd {
|
|
|
6488
6488
|
id: o,
|
|
6489
6489
|
src: e.src,
|
|
6490
6490
|
svg: i.svg,
|
|
6491
|
-
type:
|
|
6491
|
+
type: D.Illustration,
|
|
6492
6492
|
y: a.top,
|
|
6493
6493
|
x: a.left,
|
|
6494
6494
|
rotation: a.rotation,
|
|
@@ -6547,7 +6547,7 @@ const z = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6547
6547
|
}
|
|
6548
6548
|
for (const a in n.layouts) {
|
|
6549
6549
|
const i = n.layouts[a].elements.filter(
|
|
6550
|
-
(o) => o.type ===
|
|
6550
|
+
(o) => o.type === D.Illustration
|
|
6551
6551
|
);
|
|
6552
6552
|
for (let o = 0; o < i.length; ++o) {
|
|
6553
6553
|
const s = i[o];
|
|
@@ -6559,7 +6559,7 @@ const z = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6559
6559
|
}
|
|
6560
6560
|
}
|
|
6561
6561
|
const r = n.layouts[a].elements.filter(
|
|
6562
|
-
(o) => o.type ===
|
|
6562
|
+
(o) => o.type === D.Textbox
|
|
6563
6563
|
);
|
|
6564
6564
|
for (let o = 0; o < r.length; ++o) {
|
|
6565
6565
|
const s = r[o];
|
|
@@ -7063,7 +7063,7 @@ class Uo extends O {
|
|
|
7063
7063
|
};
|
|
7064
7064
|
}
|
|
7065
7065
|
}
|
|
7066
|
-
class
|
|
7066
|
+
class Dd extends O {
|
|
7067
7067
|
/**
|
|
7068
7068
|
* @param id The targeted element to bring to the front.
|
|
7069
7069
|
*/
|
|
@@ -7092,7 +7092,7 @@ class Fd extends O {
|
|
|
7092
7092
|
};
|
|
7093
7093
|
}
|
|
7094
7094
|
}
|
|
7095
|
-
class
|
|
7095
|
+
class Fd extends O {
|
|
7096
7096
|
/**
|
|
7097
7097
|
* @param id The targeted element to bring to the back.
|
|
7098
7098
|
*/
|
|
@@ -7190,7 +7190,7 @@ class en {
|
|
|
7190
7190
|
throw new Ie(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7191
7191
|
}
|
|
7192
7192
|
const s = this.evaluateAssetType();
|
|
7193
|
-
if (s ===
|
|
7193
|
+
if (s === D.Image) {
|
|
7194
7194
|
const l = this.configuration.type === b.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7195
7195
|
if (!l)
|
|
7196
7196
|
throw new Error("Undefined raster silent step source");
|
|
@@ -7272,7 +7272,7 @@ class en {
|
|
|
7272
7272
|
}
|
|
7273
7273
|
evaluateAssetType() {
|
|
7274
7274
|
const t = this.configuration.type === b.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7275
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7275
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
|
|
7276
7276
|
}
|
|
7277
7277
|
}
|
|
7278
7278
|
const Lo = async (n) => {
|
|
@@ -7393,7 +7393,7 @@ class Vo {
|
|
|
7393
7393
|
stepName: i,
|
|
7394
7394
|
id: c.id,
|
|
7395
7395
|
src: s,
|
|
7396
|
-
type:
|
|
7396
|
+
type: D.Image,
|
|
7397
7397
|
y: d.top,
|
|
7398
7398
|
x: d.left,
|
|
7399
7399
|
width: d.width,
|
|
@@ -7408,7 +7408,7 @@ class Vo {
|
|
|
7408
7408
|
}
|
|
7409
7409
|
}
|
|
7410
7410
|
const ii = new Vo();
|
|
7411
|
-
class
|
|
7411
|
+
class De {
|
|
7412
7412
|
constructor() {
|
|
7413
7413
|
this.frameSourceSvg = async (t, e) => {
|
|
7414
7414
|
if (!t)
|
|
@@ -7519,7 +7519,7 @@ class Fe {
|
|
|
7519
7519
|
})) ?? [];
|
|
7520
7520
|
}
|
|
7521
7521
|
selectImage(t, e, a, i = !0) {
|
|
7522
|
-
const r =
|
|
7522
|
+
const r = De.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
|
|
7523
7523
|
if (o && o === r)
|
|
7524
7524
|
return Promise.resolve();
|
|
7525
7525
|
a.setEditedStatus(t.stepName, !0);
|
|
@@ -7559,7 +7559,7 @@ class Fe {
|
|
|
7559
7559
|
return new q(
|
|
7560
7560
|
{
|
|
7561
7561
|
id: t,
|
|
7562
|
-
type:
|
|
7562
|
+
type: D.Frame,
|
|
7563
7563
|
x: e.left,
|
|
7564
7564
|
y: e.top,
|
|
7565
7565
|
width: e.width,
|
|
@@ -7752,7 +7752,7 @@ class Fe {
|
|
|
7752
7752
|
throw new Jt(t);
|
|
7753
7753
|
}
|
|
7754
7754
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7755
|
-
const r =
|
|
7755
|
+
const r = De.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
7756
7756
|
if (!s)
|
|
7757
7757
|
throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
|
|
7758
7758
|
try {
|
|
@@ -7779,7 +7779,7 @@ class Fe {
|
|
|
7779
7779
|
), this.validateColorCount(e, a);
|
|
7780
7780
|
}
|
|
7781
7781
|
}
|
|
7782
|
-
const St = new
|
|
7782
|
+
const St = new De();
|
|
7783
7783
|
class zo {
|
|
7784
7784
|
async getIllustrationBody(t) {
|
|
7785
7785
|
return new Promise((e) => {
|
|
@@ -7799,7 +7799,7 @@ class zo {
|
|
|
7799
7799
|
src: r.src,
|
|
7800
7800
|
svg: r.svg.svg,
|
|
7801
7801
|
cachedObjectURL: r.objectURL,
|
|
7802
|
-
type:
|
|
7802
|
+
type: D.Illustration,
|
|
7803
7803
|
y: e.top,
|
|
7804
7804
|
x: e.left,
|
|
7805
7805
|
rotation: e.rotation,
|
|
@@ -7860,7 +7860,7 @@ class zo {
|
|
|
7860
7860
|
async () => {
|
|
7861
7861
|
e.updateMetadata(t.stepName, {
|
|
7862
7862
|
colors: i.storage?.colors
|
|
7863
|
-
})
|
|
7863
|
+
});
|
|
7864
7864
|
}
|
|
7865
7865
|
);
|
|
7866
7866
|
}
|
|
@@ -7976,7 +7976,7 @@ class zo {
|
|
|
7976
7976
|
[e],
|
|
7977
7977
|
u.map((S) => S.regionElement),
|
|
7978
7978
|
async () => {
|
|
7979
|
-
|
|
7979
|
+
i(!1);
|
|
7980
7980
|
}
|
|
7981
7981
|
);
|
|
7982
7982
|
const f = s.assetConfiguration?.defaultColorVariants || [];
|
|
@@ -8061,9 +8061,7 @@ class Go {
|
|
|
8061
8061
|
l.id || "",
|
|
8062
8062
|
A || {}
|
|
8063
8063
|
));
|
|
8064
|
-
Promise.all(g)
|
|
8065
|
-
() => e.setMandatoryFulfilled(t.stepName, !0)
|
|
8066
|
-
);
|
|
8064
|
+
Promise.all(g);
|
|
8067
8065
|
}
|
|
8068
8066
|
}
|
|
8069
8067
|
);
|
|
@@ -8088,7 +8086,7 @@ class Go {
|
|
|
8088
8086
|
try {
|
|
8089
8087
|
r && t.data.targetMaterials.forEach((s) => {
|
|
8090
8088
|
t.option && r.applyMaterialVariant(s, t.option.id || "", o);
|
|
8091
|
-
})
|
|
8089
|
+
});
|
|
8092
8090
|
} finally {
|
|
8093
8091
|
i(!1);
|
|
8094
8092
|
}
|
|
@@ -8143,7 +8141,7 @@ class Wo {
|
|
|
8143
8141
|
contextService: e.getLayoutPreviewService()
|
|
8144
8142
|
},
|
|
8145
8143
|
t.data.replaceProductModel || !1
|
|
8146
|
-
)
|
|
8144
|
+
);
|
|
8147
8145
|
}
|
|
8148
8146
|
}
|
|
8149
8147
|
);
|
|
@@ -8173,7 +8171,7 @@ class Wo {
|
|
|
8173
8171
|
contextService: a.getLayoutPreviewService()
|
|
8174
8172
|
},
|
|
8175
8173
|
t.data.replaceProductModel || !1
|
|
8176
|
-
)
|
|
8174
|
+
);
|
|
8177
8175
|
} finally {
|
|
8178
8176
|
i(!1);
|
|
8179
8177
|
}
|
|
@@ -8233,7 +8231,7 @@ class qo {
|
|
|
8233
8231
|
colors: {},
|
|
8234
8232
|
id: g,
|
|
8235
8233
|
svg: d,
|
|
8236
|
-
type:
|
|
8234
|
+
type: D.Illustration,
|
|
8237
8235
|
y: A.top,
|
|
8238
8236
|
x: A.left,
|
|
8239
8237
|
rotation: A.rotation,
|
|
@@ -8334,10 +8332,7 @@ class Ho {
|
|
|
8334
8332
|
await e.setSelectionsAndElements(
|
|
8335
8333
|
t.stepName,
|
|
8336
8334
|
[d],
|
|
8337
|
-
A
|
|
8338
|
-
async () => {
|
|
8339
|
-
e.setMandatoryFulfilled(t.stepName, !0);
|
|
8340
|
-
}
|
|
8335
|
+
A
|
|
8341
8336
|
);
|
|
8342
8337
|
}
|
|
8343
8338
|
}
|
|
@@ -8369,7 +8364,7 @@ class Ho {
|
|
|
8369
8364
|
stepRegionIndex: u,
|
|
8370
8365
|
id: m,
|
|
8371
8366
|
src: o,
|
|
8372
|
-
type:
|
|
8367
|
+
type: D.Image,
|
|
8373
8368
|
y: A.top,
|
|
8374
8369
|
x: A.left,
|
|
8375
8370
|
rotation: A.rotation,
|
|
@@ -8392,7 +8387,7 @@ class Ho {
|
|
|
8392
8387
|
[e],
|
|
8393
8388
|
d.map((A) => A.regionElement),
|
|
8394
8389
|
async () => {
|
|
8395
|
-
|
|
8390
|
+
i(!1);
|
|
8396
8391
|
}
|
|
8397
8392
|
);
|
|
8398
8393
|
}
|
|
@@ -8446,9 +8441,7 @@ class jo {
|
|
|
8446
8441
|
return {
|
|
8447
8442
|
command: void 0,
|
|
8448
8443
|
followup: async () => {
|
|
8449
|
-
await a.setSelectionsAndElements(t.stepName, [o], []
|
|
8450
|
-
a.setMandatoryFulfilled(t.stepName, !0);
|
|
8451
|
-
});
|
|
8444
|
+
await a.setSelectionsAndElements(t.stepName, [o], []);
|
|
8452
8445
|
}
|
|
8453
8446
|
};
|
|
8454
8447
|
}
|
|
@@ -8522,7 +8515,7 @@ class Yo {
|
|
|
8522
8515
|
async () => {
|
|
8523
8516
|
e.updateStorage(t.stepName, {
|
|
8524
8517
|
colour: i?.storage?.colour || ""
|
|
8525
|
-
})
|
|
8518
|
+
});
|
|
8526
8519
|
}
|
|
8527
8520
|
);
|
|
8528
8521
|
}
|
|
@@ -8592,7 +8585,7 @@ class Yo {
|
|
|
8592
8585
|
colors: f,
|
|
8593
8586
|
id: S,
|
|
8594
8587
|
svg: p,
|
|
8595
|
-
type:
|
|
8588
|
+
type: D.Illustration,
|
|
8596
8589
|
y: u.top,
|
|
8597
8590
|
x: u.left,
|
|
8598
8591
|
rotation: u.rotation,
|
|
@@ -8694,9 +8687,9 @@ const Ko = new Jo(), ea = (n, t, e, a, i) => {
|
|
|
8694
8687
|
const A = d / l.unitsPerEm;
|
|
8695
8688
|
return [r, o] = ea(e, a, d, A, s), [d, r, o];
|
|
8696
8689
|
}, aa = 30;
|
|
8697
|
-
class
|
|
8690
|
+
class Fe extends Error {
|
|
8698
8691
|
constructor(t) {
|
|
8699
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
8692
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Fe.name;
|
|
8700
8693
|
}
|
|
8701
8694
|
}
|
|
8702
8695
|
const _o = ["‘", "’", "“", "”", `
|
|
@@ -9215,7 +9208,7 @@ class Xo {
|
|
|
9215
9208
|
rotation: u.rotation,
|
|
9216
9209
|
text: c,
|
|
9217
9210
|
input: s,
|
|
9218
|
-
type:
|
|
9211
|
+
type: D.Textbox,
|
|
9219
9212
|
vertical: a.vertical,
|
|
9220
9213
|
x: u.left,
|
|
9221
9214
|
y: u.top,
|
|
@@ -9256,10 +9249,10 @@ class Xo {
|
|
|
9256
9249
|
fontData: i
|
|
9257
9250
|
};
|
|
9258
9251
|
} catch (f) {
|
|
9259
|
-
throw console.log(f), new
|
|
9252
|
+
throw console.log(f), new Fe("Error adding font to region");
|
|
9260
9253
|
}
|
|
9261
9254
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
|
9262
|
-
throw u instanceof
|
|
9255
|
+
throw u instanceof Fe ? (Ko.setLatestToast("Failed to load font.", Ge.Error), u) : u instanceof ke ? u : new Error(u);
|
|
9263
9256
|
});
|
|
9264
9257
|
return await o.setSelectionsAndElements(
|
|
9265
9258
|
t,
|
|
@@ -9552,7 +9545,7 @@ const ls = [
|
|
|
9552
9545
|
{
|
|
9553
9546
|
id: m,
|
|
9554
9547
|
src: d,
|
|
9555
|
-
type:
|
|
9548
|
+
type: D.Image,
|
|
9556
9549
|
y: h.top,
|
|
9557
9550
|
x: h.left,
|
|
9558
9551
|
width: h.width,
|
|
@@ -9591,7 +9584,7 @@ const ls = [
|
|
|
9591
9584
|
{
|
|
9592
9585
|
id: u,
|
|
9593
9586
|
path: A.path,
|
|
9594
|
-
type:
|
|
9587
|
+
type: D.Frame,
|
|
9595
9588
|
forceImageCover: a.data.forceImageCover,
|
|
9596
9589
|
x: c.left,
|
|
9597
9590
|
y: c.top,
|
|
@@ -9642,7 +9635,7 @@ const ls = [
|
|
|
9642
9635
|
return console.error("Failed to read SVG."), [];
|
|
9643
9636
|
Pa(g);
|
|
9644
9637
|
const m = {};
|
|
9645
|
-
|
|
9638
|
+
Ft(g, (v) => {
|
|
9646
9639
|
ls.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9647
9640
|
const E = v.attributes.getNamedItem("fill");
|
|
9648
9641
|
if (E && E.value !== "none") {
|
|
@@ -9674,7 +9667,7 @@ const ls = [
|
|
|
9674
9667
|
colors: m,
|
|
9675
9668
|
id: I,
|
|
9676
9669
|
svg: f,
|
|
9677
|
-
type:
|
|
9670
|
+
type: D.Illustration,
|
|
9678
9671
|
y: v.top,
|
|
9679
9672
|
x: v.left,
|
|
9680
9673
|
rotation: v.rotation,
|
|
@@ -9703,7 +9696,7 @@ const ls = [
|
|
|
9703
9696
|
colors: {},
|
|
9704
9697
|
id: d,
|
|
9705
9698
|
svg: s,
|
|
9706
|
-
type:
|
|
9699
|
+
type: D.Illustration,
|
|
9707
9700
|
y: l.top,
|
|
9708
9701
|
x: l.left,
|
|
9709
9702
|
rotation: l.rotation,
|
|
@@ -9744,7 +9737,7 @@ const ls = [
|
|
|
9744
9737
|
{
|
|
9745
9738
|
id: u,
|
|
9746
9739
|
src: s,
|
|
9747
|
-
type:
|
|
9740
|
+
type: D.Image,
|
|
9748
9741
|
y: d.top,
|
|
9749
9742
|
x: d.left,
|
|
9750
9743
|
rotation: d.rotation,
|
|
@@ -9801,7 +9794,7 @@ const ls = [
|
|
|
9801
9794
|
colors: h,
|
|
9802
9795
|
id: g,
|
|
9803
9796
|
svg: A,
|
|
9804
|
-
type:
|
|
9797
|
+
type: D.Illustration,
|
|
9805
9798
|
y: c.top,
|
|
9806
9799
|
x: c.left,
|
|
9807
9800
|
rotation: c.rotation,
|
|
@@ -9820,7 +9813,7 @@ const ls = [
|
|
|
9820
9813
|
return console.error(c), [];
|
|
9821
9814
|
}
|
|
9822
9815
|
}, ms = async (n, t, e) => {
|
|
9823
|
-
const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ?
|
|
9816
|
+
const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? D.Image : (r.endsWith(".svg"), D.Illustration), l = t.data.regions;
|
|
9824
9817
|
if (s === "image")
|
|
9825
9818
|
try {
|
|
9826
9819
|
l.forEach((c) => {
|
|
@@ -9929,7 +9922,7 @@ const ls = [
|
|
|
9929
9922
|
paths: a.data.paths,
|
|
9930
9923
|
rotation: p.rotation,
|
|
9931
9924
|
text: u,
|
|
9932
|
-
type:
|
|
9925
|
+
type: D.Textbox,
|
|
9933
9926
|
vertical: a.data.vertical,
|
|
9934
9927
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9935
9928
|
width: p.width,
|
|
@@ -10515,7 +10508,7 @@ const Td = (n, t) => {
|
|
|
10515
10508
|
}
|
|
10516
10509
|
}
|
|
10517
10510
|
}
|
|
10518
|
-
`,
|
|
10511
|
+
`, Ds = C`
|
|
10519
10512
|
query GetBundlesForCustomer($id: String!) {
|
|
10520
10513
|
customers(ids: [$id]) {
|
|
10521
10514
|
bundleStakeholders {
|
|
@@ -10544,7 +10537,7 @@ const Td = (n, t) => {
|
|
|
10544
10537
|
}
|
|
10545
10538
|
}
|
|
10546
10539
|
}
|
|
10547
|
-
`,
|
|
10540
|
+
`, Fs = C`
|
|
10548
10541
|
${Qa(!1)}
|
|
10549
10542
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10550
10543
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
@@ -11625,7 +11618,7 @@ const nl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11625
11618
|
);
|
|
11626
11619
|
await Promise.all(E);
|
|
11627
11620
|
}
|
|
11628
|
-
await this.onSelectionChange(), i && await i();
|
|
11621
|
+
await this.onSelectionChange(), p?.type !== b.Frame && p?.type !== b.Text && this.setMandatoryFulfilled(t, !0), i && await i();
|
|
11629
11622
|
}
|
|
11630
11623
|
async ensureStepsAreLoaded() {
|
|
11631
11624
|
const e = yt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], i = e.flat();
|
|
@@ -12590,7 +12583,7 @@ const fl = async (n, t) => {
|
|
|
12590
12583
|
}
|
|
12591
12584
|
return i;
|
|
12592
12585
|
}, wl = (n, t, e, a, i, r, o, s) => {
|
|
12593
|
-
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = Cl(a, e, void 0, r), u = (
|
|
12586
|
+
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = Cl(a, e, void 0, r), u = (F.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), h = {
|
|
12594
12587
|
additionalExternalProductId: n.integrationProduct?.additionalExternalProductId,
|
|
12595
12588
|
additionalExternalVariantId: n.integrationProduct?.additionalExternalVariantId,
|
|
12596
12589
|
baseCost: l,
|
|
@@ -12769,7 +12762,7 @@ class Sl {
|
|
|
12769
12762
|
*/
|
|
12770
12763
|
async getSavedDesigns() {
|
|
12771
12764
|
if (this.storageMethod === "Local") {
|
|
12772
|
-
const t =
|
|
12765
|
+
const t = F.get(this.localPersistenceKey);
|
|
12773
12766
|
return t ? JSON.parse(t) : [];
|
|
12774
12767
|
}
|
|
12775
12768
|
throw new Q("Unexpected storage method requested");
|
|
@@ -12809,7 +12802,7 @@ class Sl {
|
|
|
12809
12802
|
}
|
|
12810
12803
|
async setDesigns(t) {
|
|
12811
12804
|
if (this.storageMethod === "Local") {
|
|
12812
|
-
|
|
12805
|
+
F.set(this.localPersistenceKey, JSON.stringify(t));
|
|
12813
12806
|
return;
|
|
12814
12807
|
}
|
|
12815
12808
|
throw new Q("Unexpected storage method requested");
|
|
@@ -13280,8 +13273,8 @@ class Il {
|
|
|
13280
13273
|
);
|
|
13281
13274
|
if (a?.customer) {
|
|
13282
13275
|
this.getWorkflowManager().setTransactionCustomer(a.customer);
|
|
13283
|
-
const i =
|
|
13284
|
-
i.set(this.getTransaction().id, a.customer.id),
|
|
13276
|
+
const i = F.getMap("transactionCustomerIds") || /* @__PURE__ */ new Map();
|
|
13277
|
+
i.set(this.getTransaction().id, a.customer.id), F.setMap("transactionCustomerIds", i);
|
|
13285
13278
|
}
|
|
13286
13279
|
}
|
|
13287
13280
|
attachRenderableSceneListener(t) {
|
|
@@ -13539,7 +13532,7 @@ class xl {
|
|
|
13539
13532
|
async createHandle(t) {
|
|
13540
13533
|
switch (t.type) {
|
|
13541
13534
|
case G.FileUpload:
|
|
13542
|
-
return new
|
|
13535
|
+
return new Dl(this.bundle, t).initialize();
|
|
13543
13536
|
case G.ColorOption:
|
|
13544
13537
|
return new ln(
|
|
13545
13538
|
this.bundle,
|
|
@@ -13551,7 +13544,7 @@ class xl {
|
|
|
13551
13544
|
return e?.type === "Color" ? new ln(this.bundle, t, e) : new hi(this.bundle, t, e);
|
|
13552
13545
|
}
|
|
13553
13546
|
case G.Text:
|
|
13554
|
-
return new
|
|
13547
|
+
return new Fl(this.bundle, t);
|
|
13555
13548
|
default:
|
|
13556
13549
|
throw new Error("Unhandled Global Property Aspect Type");
|
|
13557
13550
|
}
|
|
@@ -13618,7 +13611,7 @@ class Ra {
|
|
|
13618
13611
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
13619
13612
|
}
|
|
13620
13613
|
}
|
|
13621
|
-
class
|
|
13614
|
+
class Dl extends Ra {
|
|
13622
13615
|
constructor(t, e) {
|
|
13623
13616
|
super(t, e);
|
|
13624
13617
|
}
|
|
@@ -13710,7 +13703,7 @@ class Fl extends Ra {
|
|
|
13710
13703
|
return U.getLocalOrFromServer(t);
|
|
13711
13704
|
}
|
|
13712
13705
|
async getImageWithColors() {
|
|
13713
|
-
return await this.loadImageData(), this.imageData?.svg ? ba(
|
|
13706
|
+
return await this.loadImageData(), this.imageData?.svg ? ba(Da(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13714
13707
|
}
|
|
13715
13708
|
/**
|
|
13716
13709
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13844,7 +13837,7 @@ class Fl extends Ra {
|
|
|
13844
13837
|
);
|
|
13845
13838
|
}
|
|
13846
13839
|
}
|
|
13847
|
-
class
|
|
13840
|
+
class Fl extends Ra {
|
|
13848
13841
|
constructor(t, e) {
|
|
13849
13842
|
super(t, e);
|
|
13850
13843
|
}
|
|
@@ -14449,7 +14442,7 @@ class mi {
|
|
|
14449
14442
|
if (this.fullFetched)
|
|
14450
14443
|
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new he(a));
|
|
14451
14444
|
const e = await y.getShadowGraphqlClient().query({
|
|
14452
|
-
query:
|
|
14445
|
+
query: Fs,
|
|
14453
14446
|
variables: {
|
|
14454
14447
|
id: this.getId(),
|
|
14455
14448
|
productIds: t
|
|
@@ -15140,7 +15133,7 @@ class cn {
|
|
|
15140
15133
|
throw new Error(
|
|
15141
15134
|
"Unable to add transaction to bundle - Already Exists: " + a.filter((s) => !!s).map((s) => s?.getTransaction().id).join(", ")
|
|
15142
15135
|
);
|
|
15143
|
-
const i =
|
|
15136
|
+
const i = F.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), r = e.map((s) => i.get(s));
|
|
15144
15137
|
await y.getShadowGraphqlClient().mutate({
|
|
15145
15138
|
mutation: Rs,
|
|
15146
15139
|
variables: {
|
|
@@ -15169,7 +15162,7 @@ class cn {
|
|
|
15169
15162
|
async appendWorkflowExperience(t, e = !0) {
|
|
15170
15163
|
const a = t.getTransaction().id;
|
|
15171
15164
|
if (this.workflowExperiences.find((s) => s.getTransaction().id === a)) throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
15172
|
-
const o = (
|
|
15165
|
+
const o = (F.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
|
|
15173
15166
|
await y.getShadowGraphqlClient().mutate({
|
|
15174
15167
|
mutation: Qs,
|
|
15175
15168
|
variables: {
|
|
@@ -16181,7 +16174,7 @@ class Ud {
|
|
|
16181
16174
|
} catch (a) {
|
|
16182
16175
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16183
16176
|
}
|
|
16184
|
-
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.4.
|
|
16177
|
+
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.4.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16185
16178
|
}
|
|
16186
16179
|
configure(t) {
|
|
16187
16180
|
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && rr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16230,12 +16223,12 @@ class Ud {
|
|
|
16230
16223
|
* @returns An object containing the success status of the authentication attempt, and the type of stakeholder when successful.
|
|
16231
16224
|
*/
|
|
16232
16225
|
async authenticateBundleFromLocalStorage(t) {
|
|
16233
|
-
if (
|
|
16226
|
+
if (F.getMap("bundleOwnerIds")?.has(t))
|
|
16234
16227
|
return Promise.resolve({ success: !0, stakeholderType: Ee.Owner });
|
|
16235
|
-
const a =
|
|
16228
|
+
const a = F.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16236
16229
|
if (a.has(t)) {
|
|
16237
16230
|
const i = a.get(t);
|
|
16238
|
-
if ((
|
|
16231
|
+
if ((F.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map()).get(i) && await this.reloadLoggedInCustomer()) {
|
|
16239
16232
|
const l = this.customer?.bundleStakeholders?.find(
|
|
16240
16233
|
(c) => c.bundle?.id === t
|
|
16241
16234
|
);
|
|
@@ -16274,9 +16267,9 @@ class Ud {
|
|
|
16274
16267
|
throw new Error(`Unable to read transaction: ${t}`);
|
|
16275
16268
|
if (i.isOrdered)
|
|
16276
16269
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
|
16277
|
-
if (
|
|
16270
|
+
if (F.getMap("transactionOwnerIds")?.has(t))
|
|
16278
16271
|
return Promise.resolve({ success: !0, stakeholderType: Ee.Owner });
|
|
16279
|
-
const s =
|
|
16272
|
+
const s = F.getMap("transactionCustomerIds");
|
|
16280
16273
|
if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
|
|
16281
16274
|
const u = this.customer?.bundleStakeholders?.find(
|
|
16282
16275
|
(h) => h.bundle?.transactions?.some((g) => g.id === t)
|
|
@@ -16308,8 +16301,8 @@ class Ud {
|
|
|
16308
16301
|
this.customer = void 0;
|
|
16309
16302
|
}
|
|
16310
16303
|
clearCustomerForTransaction(t) {
|
|
16311
|
-
const e =
|
|
16312
|
-
e?.has(t) && (e.delete(t),
|
|
16304
|
+
const e = F.getMap("transactionCustomerIds");
|
|
16305
|
+
e?.has(t) && (e.delete(t), F.setMap("transactionCustomerIds", e));
|
|
16313
16306
|
}
|
|
16314
16307
|
async customerHasBundleTemplates(t) {
|
|
16315
16308
|
const i = (await y.getShadowGraphqlClient().query({
|
|
@@ -16477,10 +16470,10 @@ class Ud {
|
|
|
16477
16470
|
})).data?.bundleCreate;
|
|
16478
16471
|
if (!r?.id)
|
|
16479
16472
|
throw new Error("Unable to create bundle");
|
|
16480
|
-
const o =
|
|
16481
|
-
o.set(r.id, r.partner.id),
|
|
16482
|
-
const s =
|
|
16483
|
-
s.set(r.id, r.bundleOwnerId),
|
|
16473
|
+
const o = F.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16474
|
+
o.set(r.id, r.partner.id), F.setMap("bundlePartnerIds", o);
|
|
16475
|
+
const s = F.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16476
|
+
s.set(r.id, r.bundleOwnerId), F.setMap("bundleOwnerIds", s);
|
|
16484
16477
|
const l = new cn(this, r, void 0, void 0, r.bundleOwnerId, {
|
|
16485
16478
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
|
16486
16479
|
});
|
|
@@ -16495,7 +16488,7 @@ class Ud {
|
|
|
16495
16488
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16496
16489
|
*/
|
|
16497
16490
|
async getExistingBundle(t, e, a, i, r) {
|
|
16498
|
-
const s =
|
|
16491
|
+
const s = F.getMap("bundleOwnerIds")?.get(t), l = {};
|
|
16499
16492
|
try {
|
|
16500
16493
|
const g = await this.loggedInBearerToken();
|
|
16501
16494
|
l.Authorization = `Bearer ${g}`;
|
|
@@ -16519,8 +16512,8 @@ class Ud {
|
|
|
16519
16512
|
});
|
|
16520
16513
|
if (!d.data?.bundles || d.data?.bundles.length === 0 || !d.data?.bundles[0])
|
|
16521
16514
|
throw new Error(`Unable to find bundle: ${t}`);
|
|
16522
|
-
const A = d.data?.bundles[0], u =
|
|
16523
|
-
u.set(A.id, A.partner.id),
|
|
16515
|
+
const A = d.data?.bundles[0], u = F.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16516
|
+
u.set(A.id, A.partner.id), F.setMap("bundlePartnerIds", u);
|
|
16524
16517
|
const h = new cn(
|
|
16525
16518
|
this,
|
|
16526
16519
|
A,
|
|
@@ -16563,10 +16556,10 @@ class Ud {
|
|
|
16563
16556
|
})).data?.bundleDuplicate;
|
|
16564
16557
|
if (!l?.id)
|
|
16565
16558
|
throw new Error("Unable to duplicate bundle");
|
|
16566
|
-
const c =
|
|
16567
|
-
c.set(l.id, l.partner.id),
|
|
16568
|
-
const d =
|
|
16569
|
-
return d.set(l.id, l.bundleOwnerId),
|
|
16559
|
+
const c = F.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16560
|
+
c.set(l.id, l.partner.id), F.setMap("bundlePartnerIds", c);
|
|
16561
|
+
const d = F.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16562
|
+
return d.set(l.id, l.bundleOwnerId), F.setMap("bundleOwnerIds", d), async () => await this.getExistingBundle(l.id, void 0, void 0, {
|
|
16570
16563
|
graphql: {
|
|
16571
16564
|
productCollection: {
|
|
16572
16565
|
eagerFetchProducts: i?.graphql?.productCollection?.eagerFetchProducts || !1
|
|
@@ -16604,7 +16597,7 @@ class Ud {
|
|
|
16604
16597
|
if (!this.customer)
|
|
16605
16598
|
throw new Error("Customer not authenticated.");
|
|
16606
16599
|
const t = await y.getShadowGraphqlClient().query({
|
|
16607
|
-
query:
|
|
16600
|
+
query: Ds,
|
|
16608
16601
|
variables: {
|
|
16609
16602
|
id: this.customer.id
|
|
16610
16603
|
},
|
|
@@ -16612,10 +16605,10 @@ class Ud {
|
|
|
16612
16605
|
});
|
|
16613
16606
|
if (!t.data?.customers || t.data.customers.length === 0)
|
|
16614
16607
|
throw new Error("Unable to find customer.");
|
|
16615
|
-
const a = t.data.customers[0].bundleStakeholders || [], i =
|
|
16608
|
+
const a = t.data.customers[0].bundleStakeholders || [], i = F.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16616
16609
|
return a.forEach((r) => {
|
|
16617
16610
|
r.bundle?.id && r.bundle.partner?.id && i.set(r.bundle.id, r.bundle.partner.id);
|
|
16618
|
-
}),
|
|
16611
|
+
}), F.setMap("bundlePartnerIds", i), a;
|
|
16619
16612
|
}
|
|
16620
16613
|
/**
|
|
16621
16614
|
* Creates a new instance of WorkflowExperience. A high level wrapper for workflows.
|
|
@@ -16712,8 +16705,8 @@ class Ud {
|
|
|
16712
16705
|
const it = x.get(T.integrationProductId);
|
|
16713
16706
|
T.integrationProduct = it, T.product = it?.product, T.integrationProduct || console.error("failed to find transaction's product");
|
|
16714
16707
|
}
|
|
16715
|
-
const re =
|
|
16716
|
-
!re.get(T.id) && T.transactionOwnerId && (re.set(T.id, T.transactionOwnerId),
|
|
16708
|
+
const re = F.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map();
|
|
16709
|
+
!re.get(T.id) && T.transactionOwnerId && (re.set(T.id, T.transactionOwnerId), F.setMap("transactionOwnerIds", re));
|
|
16717
16710
|
const qe = re.get(T.id) || void 0, vi = new ec({
|
|
16718
16711
|
onMutate: () => ({ context: { transactionOwnerId: qe, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16719
16712
|
onQuery: () => ({ context: { transactionOwnerId: qe, bundleOwnerId: e?.bundleOwnerId } })
|
|
@@ -16748,8 +16741,8 @@ class Ud {
|
|
|
16748
16741
|
return R;
|
|
16749
16742
|
}
|
|
16750
16743
|
storeCustomer(t) {
|
|
16751
|
-
const e =
|
|
16752
|
-
e.set(t.partner.id, t.id),
|
|
16744
|
+
const e = F.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
|
|
16745
|
+
e.set(t.partner.id, t.id), F.setMap("partnerCustomerIds", e);
|
|
16753
16746
|
}
|
|
16754
16747
|
async getIntegrationProductById(t, e) {
|
|
16755
16748
|
const r = (await y.getShadowGraphqlClient().query({
|
|
@@ -16782,7 +16775,7 @@ class Ud {
|
|
|
16782
16775
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
|
16783
16776
|
}
|
|
16784
16777
|
async getShareActionsForTransaction(t) {
|
|
16785
|
-
const a = (
|
|
16778
|
+
const a = (F.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t) || void 0, i = await y.getShadowGraphqlClient().query({
|
|
16786
16779
|
query: Hr,
|
|
16787
16780
|
errorPolicy: "all",
|
|
16788
16781
|
fetchPolicy: "no-cache",
|
|
@@ -16869,14 +16862,14 @@ async function Ci() {
|
|
|
16869
16862
|
return n;
|
|
16870
16863
|
}
|
|
16871
16864
|
async function wi(n) {
|
|
16872
|
-
const e =
|
|
16865
|
+
const e = F.getMap("bundleOwnerIds")?.get(n), a = await Ci();
|
|
16873
16866
|
return {
|
|
16874
16867
|
bundleOwnerId: e,
|
|
16875
16868
|
...a
|
|
16876
16869
|
};
|
|
16877
16870
|
}
|
|
16878
16871
|
async function dc(n) {
|
|
16879
|
-
const e =
|
|
16872
|
+
const e = F.getMap("transactionOwnerIds")?.get(n), a = await Ci();
|
|
16880
16873
|
return {
|
|
16881
16874
|
transactionOwnerId: e,
|
|
16882
16875
|
...a
|
|
@@ -17001,7 +16994,7 @@ class uc {
|
|
|
17001
16994
|
getImageSrc() {
|
|
17002
16995
|
if (this.imageData) {
|
|
17003
16996
|
if (this.imageData.svg) {
|
|
17004
|
-
const t =
|
|
16997
|
+
const t = Da(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
17005
16998
|
return ba(t);
|
|
17006
16999
|
}
|
|
17007
17000
|
return this.imageData.src;
|
|
@@ -17855,14 +17848,14 @@ const Si = C`
|
|
|
17855
17848
|
...AddressValidationResultFields
|
|
17856
17849
|
}
|
|
17857
17850
|
}
|
|
17858
|
-
`,
|
|
17851
|
+
`, Dc = C`
|
|
17859
17852
|
${Ua}
|
|
17860
17853
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
|
17861
17854
|
recipientValidateBatch(ids: $ids) {
|
|
17862
17855
|
...AddressValidationJobFields
|
|
17863
17856
|
}
|
|
17864
17857
|
}
|
|
17865
|
-
`,
|
|
17858
|
+
`, Fc = C`
|
|
17866
17859
|
mutation OverrideRecipientAddress($id: String!) {
|
|
17867
17860
|
recipientOverrideAddress(id: $id) {
|
|
17868
17861
|
id
|
|
@@ -17900,7 +17893,7 @@ const iA = async (n) => {
|
|
|
17900
17893
|
}
|
|
17901
17894
|
})).data?.recipientValidate : void 0, sA = async (n) => {
|
|
17902
17895
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
|
|
17903
|
-
mutation:
|
|
17896
|
+
mutation: Dc,
|
|
17904
17897
|
errorPolicy: "all",
|
|
17905
17898
|
fetchPolicy: "network-only",
|
|
17906
17899
|
variables: {
|
|
@@ -17917,7 +17910,7 @@ const iA = async (n) => {
|
|
|
17917
17910
|
if (!t)
|
|
17918
17911
|
return;
|
|
17919
17912
|
(await y.getShadowGraphqlClient().mutate({
|
|
17920
|
-
mutation:
|
|
17913
|
+
mutation: Fc,
|
|
17921
17914
|
errorPolicy: "all",
|
|
17922
17915
|
fetchPolicy: "network-only",
|
|
17923
17916
|
variables: {
|
|
@@ -17950,8 +17943,8 @@ export {
|
|
|
17950
17943
|
bt as AssetNotFoundError,
|
|
17951
17944
|
ve as AssetType,
|
|
17952
17945
|
kd as BringForwardCommand,
|
|
17953
|
-
|
|
17954
|
-
|
|
17946
|
+
Fd as BringToBackCommand,
|
|
17947
|
+
Dd as BringToFrontCommand,
|
|
17955
17948
|
Vi as BundleDesignCreationCartAddMode,
|
|
17956
17949
|
O as CanvasCommand,
|
|
17957
17950
|
he as CollectionProduct,
|
|
@@ -17965,7 +17958,7 @@ export {
|
|
|
17965
17958
|
nc as CurrencyService,
|
|
17966
17959
|
Nt as DeleteElementCommand,
|
|
17967
17960
|
hl as DigitalContentStepHandle,
|
|
17968
|
-
|
|
17961
|
+
Dl as FileUploadGlobalPropertyHandle,
|
|
17969
17962
|
ge as FlowExecutionNodeResult,
|
|
17970
17963
|
Kl as FlowExecutionResult,
|
|
17971
17964
|
Jl as FlowService,
|
|
@@ -17984,7 +17977,7 @@ export {
|
|
|
17984
17977
|
dn as IntegrationProduct,
|
|
17985
17978
|
Gi as IntegrationType,
|
|
17986
17979
|
bd as LayoutElementFactory,
|
|
17987
|
-
|
|
17980
|
+
D as LayoutElementType,
|
|
17988
17981
|
J as LayoutNotFoundError,
|
|
17989
17982
|
Yt as LayoutRenderingPurpose,
|
|
17990
17983
|
ol as MaterialStepHandle,
|
|
@@ -18021,7 +18014,7 @@ export {
|
|
|
18021
18014
|
b as StepType,
|
|
18022
18015
|
kt as TextAlgorithm,
|
|
18023
18016
|
$o as TextChangeCommand,
|
|
18024
|
-
|
|
18017
|
+
Fl as TextGlobalPropertyHandle,
|
|
18025
18018
|
Od as TextInput,
|
|
18026
18019
|
Al as TextStepHandle,
|
|
18027
18020
|
zl as Transform,
|
|
@@ -18094,7 +18087,7 @@ export {
|
|
|
18094
18087
|
Ul as metafieldManager,
|
|
18095
18088
|
Sd as mmPerPixel,
|
|
18096
18089
|
oi as modelStepService,
|
|
18097
|
-
|
|
18090
|
+
Da as modifySVGColors,
|
|
18098
18091
|
si as moduleStepService,
|
|
18099
18092
|
jd as nameBundle,
|
|
18100
18093
|
Yd as nameTransaction,
|
|
@@ -18102,7 +18095,7 @@ export {
|
|
|
18102
18095
|
Ed as outlineFontsInSvg,
|
|
18103
18096
|
lA as overrideWorkflowExperienceRecipientAddress,
|
|
18104
18097
|
ht as patternImageDataCache,
|
|
18105
|
-
|
|
18098
|
+
F as persistenceService,
|
|
18106
18099
|
li as pictureStepService,
|
|
18107
18100
|
ld as pmsToRgb,
|
|
18108
18101
|
ci as questionStepService,
|
|
@@ -18113,7 +18106,7 @@ export {
|
|
|
18113
18106
|
de as rotateAroundPoint,
|
|
18114
18107
|
Pa as sanitizeSvgTree,
|
|
18115
18108
|
rr as setBearerAuthenticationToken,
|
|
18116
|
-
|
|
18109
|
+
Fn as setCanvasModule,
|
|
18117
18110
|
zt as shapeStepService,
|
|
18118
18111
|
Lo as shortenUrl,
|
|
18119
18112
|
pt as spiffCoreConfiguration,
|