@spiffcommerce/core 34.1.0-beta.e726c178-ca4d-5f86-9fa4-962d8fc2d6fc → 34.2.0
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -139
- 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 Fi } from "preact-render-to-string";
|
|
5
|
+
import { removeTypenameFromVariables as Di } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as ki } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as yn } from "css";
|
|
8
8
|
import Mi from "fuse.js";
|
|
@@ -24,7 +24,7 @@ import vn from "lodash.debounce";
|
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Ui from "lodash.omit";
|
|
27
|
-
var Ee = /* @__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))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), 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 Ee = /* @__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))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), 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 || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Vi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Vi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), 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 || {}), ba = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ba || {}), Wi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Wi || {}), be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(be || {}), kt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(kt || {}), j = /* @__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))(j || {}), qi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(qi || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
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
|
-
}), xn = (n) =>
|
|
220
|
+
}), xn = (n) => Fi(n), je = /* @__PURE__ */ new Map(), Xi = async (n, t) => {
|
|
221
221
|
if (Mt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
@@ -269,7 +269,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
269
269
|
}, tr = async (n) => {
|
|
270
270
|
const t = Oe(n), e = new Uint8Array(n), a = Zi(e), i = btoa(a);
|
|
271
271
|
return `data:${t};base64,${i}`;
|
|
272
|
-
}, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`,
|
|
272
|
+
}, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Fn = (n) => {
|
|
273
273
|
const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
|
274
274
|
if (e === -1 || e <= 4)
|
|
275
275
|
throw new TypeError("malformed data: URI");
|
|
@@ -292,9 +292,9 @@ let ar, Ba;
|
|
|
292
292
|
const nr = (n) => {
|
|
293
293
|
Ba = n;
|
|
294
294
|
}, ir = () => Ba;
|
|
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: Ba,
|
|
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 = Di();
|
|
360
360
|
return new bi({
|
|
361
361
|
link: Bi([i, a, e, t]),
|
|
362
362
|
cache: new Ii(),
|
|
@@ -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
|
+
], Ft = [
|
|
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
|
-
], Je =
|
|
3153
|
+
], Je = Ft.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 od(n) {
|
|
3159
3159
|
const t = Kt.indexOf(n);
|
|
3160
|
-
return t >= 0 ?
|
|
3160
|
+
return t >= 0 ? Ft[t] : "";
|
|
3161
3161
|
}
|
|
3162
3162
|
function gr(n) {
|
|
3163
|
-
const t =
|
|
3163
|
+
const t = Ft.indexOf(n);
|
|
3164
3164
|
return t >= 0 ? Kt[t] : "";
|
|
3165
3165
|
}
|
|
3166
3166
|
function sd(n, t = 64) {
|
|
@@ -3172,16 +3172,16 @@ function sd(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 < Ft.length; A++) {
|
|
3176
3176
|
l = Je[A][0], c = Je[A][1], d = Je[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: Ft[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: Ft[t] })), pr = new Mi(mr, { keys: ["pms"] });
|
|
3185
3185
|
function ld(n, t) {
|
|
3186
3186
|
return pr.search(n, t ? { limit: t } : void 0);
|
|
3187
3187
|
}
|
|
@@ -3238,8 +3238,8 @@ const de = (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"], Dt = (n, t) => {
|
|
3242
|
+
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => Dt(e, t));
|
|
3243
3243
|
}, Nn = (n, t) => {
|
|
3244
3244
|
const e = t(n);
|
|
3245
3245
|
if (e)
|
|
@@ -3256,7 +3256,7 @@ const de = (n) => {
|
|
|
3256
3256
|
}, xa = (n, t = !1) => {
|
|
3257
3257
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3258
3258
|
const e = [];
|
|
3259
|
-
|
|
3259
|
+
Dt(n, (a) => {
|
|
3260
3260
|
if (a.tagName === "script") {
|
|
3261
3261
|
a.remove();
|
|
3262
3262
|
return;
|
|
@@ -3282,7 +3282,7 @@ const de = (n) => {
|
|
|
3282
3282
|
}
|
|
3283
3283
|
}), r.length > 0 ? a.setAttribute("style", r.join(";")) : a.removeAttribute("style");
|
|
3284
3284
|
}
|
|
3285
|
-
}),
|
|
3285
|
+
}), Dt(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 de = (n) => {
|
|
|
3298
3298
|
}, Qn = (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
|
}, Rn = (n, t, e) => {
|
|
3301
|
-
|
|
3301
|
+
Dt(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")) {
|
|
@@ -3336,12 +3336,12 @@ const de = (n) => {
|
|
|
3336
3336
|
}
|
|
3337
3337
|
});
|
|
3338
3338
|
});
|
|
3339
|
-
}, On = (n) => It().serializeToString(n),
|
|
3339
|
+
}, On = (n) => It().serializeToString(n), Fa = (n, t, e, a, i) => {
|
|
3340
3340
|
const r = Qn(n);
|
|
3341
3341
|
if (!r)
|
|
3342
3342
|
throw new Error("Failed to read SVG.");
|
|
3343
3343
|
return vr(r, t, e), Rn(r, a, i), On(r);
|
|
3344
|
-
},
|
|
3344
|
+
}, Da = (n, t, e) => {
|
|
3345
3345
|
const a = Qn(n);
|
|
3346
3346
|
if (!a)
|
|
3347
3347
|
throw new Error("Failed to read SVG.");
|
|
@@ -3355,7 +3355,7 @@ const de = (n) => {
|
|
|
3355
3355
|
throw new Error("Failed to read SVG.");
|
|
3356
3356
|
xa(e);
|
|
3357
3357
|
const a = {};
|
|
3358
|
-
|
|
3358
|
+
Dt(e, (o) => {
|
|
3359
3359
|
if (Cr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
|
|
3360
3360
|
let c = "black";
|
|
3361
3361
|
const d = o.parentElement;
|
|
@@ -3527,13 +3527,13 @@ const de = (n) => {
|
|
|
3527
3527
|
variables: {
|
|
3528
3528
|
keys: n
|
|
3529
3529
|
}
|
|
3530
|
-
})).data.assets,
|
|
3530
|
+
})).data.assets, Fr = 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, Dr = 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 Fr([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 Dr(t.name, e, r, a, i);
|
|
3702
3702
|
if (o)
|
|
3703
3703
|
return {
|
|
3704
3704
|
assetResponse: o,
|
|
@@ -5529,7 +5529,7 @@ const M = () => {
|
|
|
5529
5529
|
if (!n.pattern)
|
|
5530
5530
|
return "";
|
|
5531
5531
|
if (n.pattern.svg) {
|
|
5532
|
-
const A =
|
|
5532
|
+
const A = Da(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5533
5533
|
return Ia(A);
|
|
5534
5534
|
}
|
|
5535
5535
|
return n.pattern.src;
|
|
@@ -5559,7 +5559,7 @@ const M = () => {
|
|
|
5559
5559
|
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;
|
|
5560
5560
|
return [n.pattern?.svg ? {
|
|
5561
5561
|
id: `${t}-contents`,
|
|
5562
|
-
type:
|
|
5562
|
+
type: F.Illustration,
|
|
5563
5563
|
x: A,
|
|
5564
5564
|
y: u,
|
|
5565
5565
|
rotation: f,
|
|
@@ -5570,7 +5570,7 @@ const M = () => {
|
|
|
5570
5570
|
colors: n.pattern?.colors
|
|
5571
5571
|
} : {
|
|
5572
5572
|
id: `${t}-contents`,
|
|
5573
|
-
type:
|
|
5573
|
+
type: F.Image,
|
|
5574
5574
|
x: A,
|
|
5575
5575
|
y: u,
|
|
5576
5576
|
rotation: f,
|
|
@@ -5673,7 +5673,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5673
5673
|
return wt(n).getFont();
|
|
5674
5674
|
} catch {
|
|
5675
5675
|
if (wo(n)) {
|
|
5676
|
-
const a =
|
|
5676
|
+
const a = Fn(n), i = la(a);
|
|
5677
5677
|
return ma(n, i), i;
|
|
5678
5678
|
} else {
|
|
5679
5679
|
const a = await Re(n, !0), i = la(a);
|
|
@@ -5683,7 +5683,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5683
5683
|
})();
|
|
5684
5684
|
return Ke.set(n, e), e;
|
|
5685
5685
|
}, yo = (n) => {
|
|
5686
|
-
const t =
|
|
5686
|
+
const t = Fn(n), e = la(t);
|
|
5687
5687
|
return ma(n, e), e;
|
|
5688
5688
|
}, wt = (n) => {
|
|
5689
5689
|
const t = Yn.get(n);
|
|
@@ -5835,7 +5835,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5835
5835
|
stripControlCharacters: !0,
|
|
5836
5836
|
vertical: !1,
|
|
5837
5837
|
uppercase: !1
|
|
5838
|
-
},
|
|
5838
|
+
}, Fe = (n, t = _a) => {
|
|
5839
5839
|
const e = { ..._a, ...t };
|
|
5840
5840
|
let a = n || "";
|
|
5841
5841
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
@@ -5930,7 +5930,7 @@ const Po = (n) => {
|
|
|
5930
5930
|
},
|
|
5931
5931
|
stroke: A,
|
|
5932
5932
|
strokeWidth: u,
|
|
5933
|
-
children: n.curved ? /* @__PURE__ */ P(
|
|
5933
|
+
children: n.curved ? /* @__PURE__ */ P(Fo, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ P(
|
|
5934
5934
|
xo,
|
|
5935
5935
|
{
|
|
5936
5936
|
align: n.vertical ? "center" : n.align,
|
|
@@ -5968,7 +5968,7 @@ const Po = (n) => {
|
|
|
5968
5968
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5969
5969
|
};
|
|
5970
5970
|
return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5971
|
-
},
|
|
5971
|
+
}, Fo = (n) => {
|
|
5972
5972
|
const t = `#${n.curvedPathId}`;
|
|
5973
5973
|
return /* @__PURE__ */ P(
|
|
5974
5974
|
"textPath",
|
|
@@ -5980,7 +5980,7 @@ const Po = (n) => {
|
|
|
5980
5980
|
children: n.text
|
|
5981
5981
|
}
|
|
5982
5982
|
);
|
|
5983
|
-
},
|
|
5983
|
+
}, Do = (n) => {
|
|
5984
5984
|
if (n.cachedObjectURL && !n._renderingConfiguration?.omitCachedFields)
|
|
5985
5985
|
return /* @__PURE__ */ P(
|
|
5986
5986
|
Hn,
|
|
@@ -6012,7 +6012,7 @@ const Po = (n) => {
|
|
|
6012
6012
|
{
|
|
6013
6013
|
transform: r,
|
|
6014
6014
|
dangerouslySetInnerHTML: {
|
|
6015
|
-
__html:
|
|
6015
|
+
__html: Fa(
|
|
6016
6016
|
n.svg,
|
|
6017
6017
|
n.width,
|
|
6018
6018
|
n.height,
|
|
@@ -6113,7 +6113,7 @@ class ko {
|
|
|
6113
6113
|
return { ...t, transaction: e.apply(a) };
|
|
6114
6114
|
}
|
|
6115
6115
|
}
|
|
6116
|
-
const Zn = (n) => n.type ===
|
|
6116
|
+
const Zn = (n) => n.type === F.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === F.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === F.Illustration ? /* @__PURE__ */ P(Do, { ...n }, n.id) : n.type === F.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === F.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, Ma = (n, t, e) => {
|
|
6117
6117
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6118
6118
|
return /* @__PURE__ */ P(
|
|
6119
6119
|
po,
|
|
@@ -6329,17 +6329,17 @@ const re = (n) => {
|
|
|
6329
6329
|
rotation: 0,
|
|
6330
6330
|
panelId: n.layoutState.layout.panelId
|
|
6331
6331
|
};
|
|
6332
|
-
if (e && t ===
|
|
6332
|
+
if (e && t === F.Illustration) {
|
|
6333
6333
|
const l = await st(await ai(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6334
6334
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6335
6335
|
const h = s.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
|
|
6336
6336
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6337
6337
|
}
|
|
6338
|
-
if (e && t ===
|
|
6338
|
+
if (e && t === F.Image) {
|
|
6339
6339
|
const l = s.height, c = await Re(e), d = await $e(c), A = d.width / d.height;
|
|
6340
6340
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6341
6341
|
}
|
|
6342
|
-
if (e && t ===
|
|
6342
|
+
if (e && t === F.Textbox && a?.text && a?.fontScale) {
|
|
6343
6343
|
await Tt(e);
|
|
6344
6344
|
const l = wt(e), c = mt(a.text, a?.fontScale, l);
|
|
6345
6345
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6348,7 +6348,7 @@ const re = (n) => {
|
|
|
6348
6348
|
};
|
|
6349
6349
|
class vd {
|
|
6350
6350
|
static async getFrame(t, e) {
|
|
6351
|
-
const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t,
|
|
6351
|
+
const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t, F.Frame);
|
|
6352
6352
|
return {
|
|
6353
6353
|
id: M(),
|
|
6354
6354
|
x: r.left,
|
|
@@ -6363,7 +6363,7 @@ class vd {
|
|
|
6363
6363
|
path: i.path,
|
|
6364
6364
|
dataWidth: i.width,
|
|
6365
6365
|
dataHeight: i.height,
|
|
6366
|
-
type:
|
|
6366
|
+
type: F.Frame,
|
|
6367
6367
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6368
6368
|
focalBlur: e.configuration.focalBlur,
|
|
6369
6369
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6374,11 +6374,11 @@ class vd {
|
|
|
6374
6374
|
};
|
|
6375
6375
|
}
|
|
6376
6376
|
static async getImage(t, e) {
|
|
6377
|
-
const a = e.region || await Ut(t,
|
|
6377
|
+
const a = e.region || await Ut(t, F.Image, e.src);
|
|
6378
6378
|
return {
|
|
6379
6379
|
id: M(),
|
|
6380
6380
|
src: e.src,
|
|
6381
|
-
type:
|
|
6381
|
+
type: F.Image,
|
|
6382
6382
|
y: a.top,
|
|
6383
6383
|
x: a.left,
|
|
6384
6384
|
rotation: a.rotation,
|
|
@@ -6394,16 +6394,16 @@ class vd {
|
|
|
6394
6394
|
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Tt(i), s = {
|
|
6395
6395
|
assetUrl: i,
|
|
6396
6396
|
name: o.names.fullName.en
|
|
6397
|
-
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
|
6397
|
+
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Fe(c, {
|
|
6398
6398
|
vertical: a.vertical,
|
|
6399
6399
|
uppercase: a.uppercase
|
|
6400
|
-
}), A = e.region || await Ut(t,
|
|
6400
|
+
}), A = e.region || await Ut(t, F.Textbox, i, {
|
|
6401
6401
|
text: d,
|
|
6402
6402
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6403
6403
|
}), u = ie(
|
|
6404
6404
|
{
|
|
6405
6405
|
id: M(),
|
|
6406
|
-
type:
|
|
6406
|
+
type: F.Textbox,
|
|
6407
6407
|
x: A.left,
|
|
6408
6408
|
y: A.top,
|
|
6409
6409
|
width: A.width,
|
|
@@ -6463,14 +6463,14 @@ class vd {
|
|
|
6463
6463
|
</svg>
|
|
6464
6464
|
`, i = {};
|
|
6465
6465
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6466
|
-
const r = e.region?.item || await Ut(t,
|
|
6466
|
+
const r = e.region?.item || await Ut(t, F.Illustration), o = M();
|
|
6467
6467
|
return {
|
|
6468
6468
|
stepRegion: e.region?.item,
|
|
6469
6469
|
stepRegionIndex: e.region?.index,
|
|
6470
6470
|
colors: i,
|
|
6471
6471
|
id: o,
|
|
6472
6472
|
svg: a,
|
|
6473
|
-
type:
|
|
6473
|
+
type: F.Illustration,
|
|
6474
6474
|
y: r.top,
|
|
6475
6475
|
x: r.left,
|
|
6476
6476
|
rotation: r.rotation,
|
|
@@ -6482,7 +6482,7 @@ class vd {
|
|
|
6482
6482
|
};
|
|
6483
6483
|
}
|
|
6484
6484
|
static async getIllustration(t, e) {
|
|
6485
|
-
const a = e.region?.item || await Ut(t,
|
|
6485
|
+
const a = e.region?.item || await Ut(t, F.Illustration, e.src), i = await st(await ai(e.src)), r = await Xt(i.svg), o = M();
|
|
6486
6486
|
return {
|
|
6487
6487
|
cachedObjectURL: r,
|
|
6488
6488
|
stepRegion: e.region?.item,
|
|
@@ -6491,7 +6491,7 @@ class vd {
|
|
|
6491
6491
|
id: o,
|
|
6492
6492
|
src: e.src,
|
|
6493
6493
|
svg: i.svg,
|
|
6494
|
-
type:
|
|
6494
|
+
type: F.Illustration,
|
|
6495
6495
|
y: a.top,
|
|
6496
6496
|
x: a.left,
|
|
6497
6497
|
rotation: a.rotation,
|
|
@@ -6530,7 +6530,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6530
6530
|
const s = o;
|
|
6531
6531
|
if (s.src && !s.svg) {
|
|
6532
6532
|
const l = await at(s.src), c = await st(l);
|
|
6533
|
-
s.svg =
|
|
6533
|
+
s.svg = Fa(
|
|
6534
6534
|
c.svg,
|
|
6535
6535
|
s.width,
|
|
6536
6536
|
s.height,
|
|
@@ -6550,7 +6550,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6550
6550
|
}
|
|
6551
6551
|
for (const a in n.layouts) {
|
|
6552
6552
|
const i = n.layouts[a].elements.filter(
|
|
6553
|
-
(o) => o.type ===
|
|
6553
|
+
(o) => o.type === F.Illustration
|
|
6554
6554
|
);
|
|
6555
6555
|
for (let o = 0; o < i.length; ++o) {
|
|
6556
6556
|
const s = i[o];
|
|
@@ -6562,7 +6562,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6562
6562
|
}
|
|
6563
6563
|
}
|
|
6564
6564
|
const r = n.layouts[a].elements.filter(
|
|
6565
|
-
(o) => o.type ===
|
|
6565
|
+
(o) => o.type === F.Textbox
|
|
6566
6566
|
);
|
|
6567
6567
|
for (let o = 0; o < r.length; ++o) {
|
|
6568
6568
|
const s = r[o];
|
|
@@ -7126,7 +7126,7 @@ class xd extends O {
|
|
|
7126
7126
|
};
|
|
7127
7127
|
}
|
|
7128
7128
|
}
|
|
7129
|
-
class
|
|
7129
|
+
class Fd extends O {
|
|
7130
7130
|
/**
|
|
7131
7131
|
* @param id The targeted element to bring to the front.
|
|
7132
7132
|
*/
|
|
@@ -7153,7 +7153,7 @@ class Dd extends O {
|
|
|
7153
7153
|
};
|
|
7154
7154
|
}
|
|
7155
7155
|
}
|
|
7156
|
-
class
|
|
7156
|
+
class Dd extends O {
|
|
7157
7157
|
/**
|
|
7158
7158
|
* @param id The targeted element to bring to the front.
|
|
7159
7159
|
*/
|
|
@@ -7193,7 +7193,7 @@ class an {
|
|
|
7193
7193
|
throw new Be(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7194
7194
|
}
|
|
7195
7195
|
const s = this.evaluateAssetType();
|
|
7196
|
-
if (s ===
|
|
7196
|
+
if (s === F.Image) {
|
|
7197
7197
|
const l = this.configuration.type === b.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7198
7198
|
if (!l)
|
|
7199
7199
|
throw new Error("Undefined raster silent step source");
|
|
@@ -7275,7 +7275,7 @@ class an {
|
|
|
7275
7275
|
}
|
|
7276
7276
|
evaluateAssetType() {
|
|
7277
7277
|
const t = this.configuration.type === b.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7278
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7278
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? F.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), F.Illustration);
|
|
7279
7279
|
}
|
|
7280
7280
|
}
|
|
7281
7281
|
const Lo = async (n) => {
|
|
@@ -7396,7 +7396,7 @@ class Vo {
|
|
|
7396
7396
|
stepName: i,
|
|
7397
7397
|
id: c.id,
|
|
7398
7398
|
src: s,
|
|
7399
|
-
type:
|
|
7399
|
+
type: F.Image,
|
|
7400
7400
|
y: d.top,
|
|
7401
7401
|
x: d.left,
|
|
7402
7402
|
width: d.width,
|
|
@@ -7411,7 +7411,7 @@ class Vo {
|
|
|
7411
7411
|
}
|
|
7412
7412
|
}
|
|
7413
7413
|
const ri = new Vo();
|
|
7414
|
-
class
|
|
7414
|
+
class De {
|
|
7415
7415
|
constructor() {
|
|
7416
7416
|
this.frameSourceSvg = async (t, e) => {
|
|
7417
7417
|
if (!t)
|
|
@@ -7522,7 +7522,7 @@ class Fe {
|
|
|
7522
7522
|
})) ?? [];
|
|
7523
7523
|
}
|
|
7524
7524
|
selectImage(t, e, a, i = !0) {
|
|
7525
|
-
const r =
|
|
7525
|
+
const r = De.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
|
|
7526
7526
|
if (o && o === r)
|
|
7527
7527
|
return Promise.resolve();
|
|
7528
7528
|
a.setEditedStatus(t.stepName, !0);
|
|
@@ -7562,7 +7562,7 @@ class Fe {
|
|
|
7562
7562
|
return new W(
|
|
7563
7563
|
{
|
|
7564
7564
|
id: t,
|
|
7565
|
-
type:
|
|
7565
|
+
type: F.Frame,
|
|
7566
7566
|
x: e.left,
|
|
7567
7567
|
y: e.top,
|
|
7568
7568
|
width: e.width,
|
|
@@ -7755,7 +7755,7 @@ class Fe {
|
|
|
7755
7755
|
throw new Jt(t);
|
|
7756
7756
|
}
|
|
7757
7757
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7758
|
-
const r =
|
|
7758
|
+
const r = De.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
7759
7759
|
if (!s)
|
|
7760
7760
|
throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
|
|
7761
7761
|
try {
|
|
@@ -7782,7 +7782,7 @@ class Fe {
|
|
|
7782
7782
|
), this.validateColorCount(e, a);
|
|
7783
7783
|
}
|
|
7784
7784
|
}
|
|
7785
|
-
const St = new
|
|
7785
|
+
const St = new De();
|
|
7786
7786
|
class zo {
|
|
7787
7787
|
async getIllustrationBody(t) {
|
|
7788
7788
|
return new Promise((e) => {
|
|
@@ -7802,7 +7802,7 @@ class zo {
|
|
|
7802
7802
|
src: r.src,
|
|
7803
7803
|
svg: r.svg.svg,
|
|
7804
7804
|
cachedObjectURL: r.objectURL,
|
|
7805
|
-
type:
|
|
7805
|
+
type: F.Illustration,
|
|
7806
7806
|
y: e.top,
|
|
7807
7807
|
x: e.left,
|
|
7808
7808
|
rotation: e.rotation,
|
|
@@ -7892,7 +7892,7 @@ class zo {
|
|
|
7892
7892
|
spotColor: A.spotColor,
|
|
7893
7893
|
pmsValue: A.pmsValue
|
|
7894
7894
|
};
|
|
7895
|
-
const s =
|
|
7895
|
+
const s = Fa(t, e, a, o), l = await Xt(s), c = [];
|
|
7896
7896
|
for (const d of i) {
|
|
7897
7897
|
for (const [A, u] of r.entries())
|
|
7898
7898
|
c.push(new Ca(d, A, u));
|
|
@@ -8236,7 +8236,7 @@ class qo {
|
|
|
8236
8236
|
colors: {},
|
|
8237
8237
|
id: g,
|
|
8238
8238
|
svg: d,
|
|
8239
|
-
type:
|
|
8239
|
+
type: F.Illustration,
|
|
8240
8240
|
y: A.top,
|
|
8241
8241
|
x: A.left,
|
|
8242
8242
|
rotation: A.rotation,
|
|
@@ -8372,7 +8372,7 @@ class Ho {
|
|
|
8372
8372
|
stepRegionIndex: u,
|
|
8373
8373
|
id: m,
|
|
8374
8374
|
src: o,
|
|
8375
|
-
type:
|
|
8375
|
+
type: F.Image,
|
|
8376
8376
|
y: A.top,
|
|
8377
8377
|
x: A.left,
|
|
8378
8378
|
rotation: A.rotation,
|
|
@@ -8596,7 +8596,7 @@ class Yo {
|
|
|
8596
8596
|
colors: f,
|
|
8597
8597
|
id: S,
|
|
8598
8598
|
svg: p,
|
|
8599
|
-
type:
|
|
8599
|
+
type: F.Illustration,
|
|
8600
8600
|
y: u.top,
|
|
8601
8601
|
x: u.left,
|
|
8602
8602
|
rotation: u.rotation,
|
|
@@ -8919,7 +8919,7 @@ class Xo {
|
|
|
8919
8919
|
}
|
|
8920
8920
|
getProcessedInput(t, e, a) {
|
|
8921
8921
|
const i = a ? t : this.injectReplaceableText(t, e);
|
|
8922
|
-
return
|
|
8922
|
+
return Fe(i, {
|
|
8923
8923
|
vertical: e.vertical,
|
|
8924
8924
|
uppercase: e.uppercase
|
|
8925
8925
|
});
|
|
@@ -9196,8 +9196,8 @@ class Xo {
|
|
|
9196
9196
|
const f = a.colorOption;
|
|
9197
9197
|
let S;
|
|
9198
9198
|
if (f && f.variants) {
|
|
9199
|
-
const
|
|
9200
|
-
S = this.createTextFillSpotColor(f,
|
|
9199
|
+
const D = f.variants.find((q) => q.id === f.defaultVariant?.id) || f.variants[0];
|
|
9200
|
+
S = this.createTextFillSpotColor(f, D), o.updateStorage(t, {
|
|
9201
9201
|
colorProfileAssetKey: f.colorProfile?.key
|
|
9202
9202
|
});
|
|
9203
9203
|
}
|
|
@@ -9215,7 +9215,7 @@ class Xo {
|
|
|
9215
9215
|
rotation: u.rotation,
|
|
9216
9216
|
text: c,
|
|
9217
9217
|
input: s,
|
|
9218
|
-
type:
|
|
9218
|
+
type: F.Textbox,
|
|
9219
9219
|
vertical: a.vertical,
|
|
9220
9220
|
x: u.left,
|
|
9221
9221
|
y: u.top,
|
|
@@ -9552,7 +9552,7 @@ const ls = [
|
|
|
9552
9552
|
{
|
|
9553
9553
|
id: m,
|
|
9554
9554
|
src: d,
|
|
9555
|
-
type:
|
|
9555
|
+
type: F.Image,
|
|
9556
9556
|
y: h.top,
|
|
9557
9557
|
x: h.left,
|
|
9558
9558
|
width: h.width,
|
|
@@ -9591,7 +9591,7 @@ const ls = [
|
|
|
9591
9591
|
{
|
|
9592
9592
|
id: u,
|
|
9593
9593
|
path: A.path,
|
|
9594
|
-
type:
|
|
9594
|
+
type: F.Frame,
|
|
9595
9595
|
forceImageCover: a.data.forceImageCover,
|
|
9596
9596
|
x: c.left,
|
|
9597
9597
|
y: c.top,
|
|
@@ -9642,7 +9642,7 @@ const ls = [
|
|
|
9642
9642
|
return console.error("Failed to read SVG."), [];
|
|
9643
9643
|
xa(g);
|
|
9644
9644
|
const m = {};
|
|
9645
|
-
|
|
9645
|
+
Dt(g, (v) => {
|
|
9646
9646
|
ls.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9647
9647
|
const E = v.attributes.getNamedItem("fill");
|
|
9648
9648
|
if (E && E.value !== "none") {
|
|
@@ -9674,7 +9674,7 @@ const ls = [
|
|
|
9674
9674
|
colors: m,
|
|
9675
9675
|
id: I,
|
|
9676
9676
|
svg: f,
|
|
9677
|
-
type:
|
|
9677
|
+
type: F.Illustration,
|
|
9678
9678
|
y: v.top,
|
|
9679
9679
|
x: v.left,
|
|
9680
9680
|
rotation: v.rotation,
|
|
@@ -9703,7 +9703,7 @@ const ls = [
|
|
|
9703
9703
|
colors: {},
|
|
9704
9704
|
id: d,
|
|
9705
9705
|
svg: s,
|
|
9706
|
-
type:
|
|
9706
|
+
type: F.Illustration,
|
|
9707
9707
|
y: l.top,
|
|
9708
9708
|
x: l.left,
|
|
9709
9709
|
rotation: l.rotation,
|
|
@@ -9744,7 +9744,7 @@ const ls = [
|
|
|
9744
9744
|
{
|
|
9745
9745
|
id: u,
|
|
9746
9746
|
src: s,
|
|
9747
|
-
type:
|
|
9747
|
+
type: F.Image,
|
|
9748
9748
|
y: d.top,
|
|
9749
9749
|
x: d.left,
|
|
9750
9750
|
rotation: d.rotation,
|
|
@@ -9801,7 +9801,7 @@ const ls = [
|
|
|
9801
9801
|
colors: h,
|
|
9802
9802
|
id: g,
|
|
9803
9803
|
svg: A,
|
|
9804
|
-
type:
|
|
9804
|
+
type: F.Illustration,
|
|
9805
9805
|
y: c.top,
|
|
9806
9806
|
x: c.left,
|
|
9807
9807
|
rotation: c.rotation,
|
|
@@ -9820,7 +9820,7 @@ const ls = [
|
|
|
9820
9820
|
return console.error(c), [];
|
|
9821
9821
|
}
|
|
9822
9822
|
}, 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") ?
|
|
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") ? F.Image : (r.endsWith(".svg"), F.Illustration), l = t.data.regions;
|
|
9824
9824
|
if (s === "image")
|
|
9825
9825
|
try {
|
|
9826
9826
|
l.forEach((c) => {
|
|
@@ -9904,7 +9904,7 @@ const ls = [
|
|
|
9904
9904
|
assetUrl: p,
|
|
9905
9905
|
name: f.names.fullName.en
|
|
9906
9906
|
};
|
|
9907
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u =
|
|
9907
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = Fe(A, {
|
|
9908
9908
|
vertical: a.data.vertical,
|
|
9909
9909
|
uppercase: a.data.uppercase
|
|
9910
9910
|
}), h = async (p) => {
|
|
@@ -9929,7 +9929,7 @@ const ls = [
|
|
|
9929
9929
|
paths: a.data.paths,
|
|
9930
9930
|
rotation: p.rotation,
|
|
9931
9931
|
text: u,
|
|
9932
|
-
type:
|
|
9932
|
+
type: F.Textbox,
|
|
9933
9933
|
vertical: a.data.vertical,
|
|
9934
9934
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9935
9935
|
width: p.width,
|
|
@@ -9942,7 +9942,7 @@ const ls = [
|
|
|
9942
9942
|
d,
|
|
9943
9943
|
p,
|
|
9944
9944
|
[
|
|
9945
|
-
|
|
9945
|
+
Fe(u, {
|
|
9946
9946
|
vertical: a.data.vertical,
|
|
9947
9947
|
uppercase: a.data.uppercase
|
|
9948
9948
|
})
|
|
@@ -10515,7 +10515,7 @@ const kd = (n, t) => {
|
|
|
10515
10515
|
}
|
|
10516
10516
|
}
|
|
10517
10517
|
}
|
|
10518
|
-
`,
|
|
10518
|
+
`, Fs = C`
|
|
10519
10519
|
query GetBundlesForCustomer($id: String!) {
|
|
10520
10520
|
customers(ids: [$id]) {
|
|
10521
10521
|
bundleStakeholders {
|
|
@@ -10544,7 +10544,7 @@ const kd = (n, t) => {
|
|
|
10544
10544
|
}
|
|
10545
10545
|
}
|
|
10546
10546
|
}
|
|
10547
|
-
`,
|
|
10547
|
+
`, Ds = C`
|
|
10548
10548
|
${Ra(!1)}
|
|
10549
10549
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10550
10550
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
@@ -12612,22 +12612,22 @@ const pl = async (n, t) => {
|
|
|
12612
12612
|
for (const R of Object.keys(r)) {
|
|
12613
12613
|
const B = r[R], T = t.steps.find((L) => L.stepName === R);
|
|
12614
12614
|
for (let L = 0; L < B.selections.length; ++L) {
|
|
12615
|
-
const
|
|
12615
|
+
const D = B.selections[L];
|
|
12616
12616
|
if (T && (!E || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
|
|
12617
12617
|
const q = T.stepTitle;
|
|
12618
12618
|
I[q] ? I[q].push({
|
|
12619
|
-
id:
|
|
12620
|
-
name:
|
|
12621
|
-
priceModifier:
|
|
12619
|
+
id: D.id || "",
|
|
12620
|
+
name: D.name,
|
|
12621
|
+
priceModifier: D.priceModifier
|
|
12622
12622
|
}) : I[q] = [
|
|
12623
12623
|
{
|
|
12624
|
-
id:
|
|
12625
|
-
name:
|
|
12626
|
-
priceModifier:
|
|
12624
|
+
id: D.id || "",
|
|
12625
|
+
name: D.name,
|
|
12626
|
+
priceModifier: D.priceModifier
|
|
12627
12627
|
}
|
|
12628
12628
|
];
|
|
12629
12629
|
}
|
|
12630
|
-
N +=
|
|
12630
|
+
N += D.priceModifier;
|
|
12631
12631
|
}
|
|
12632
12632
|
}
|
|
12633
12633
|
return [I, N];
|
|
@@ -13539,7 +13539,7 @@ class Pl {
|
|
|
13539
13539
|
return e?.type === "Color" ? new cn(this.bundle, t, e) : new gi(this.bundle, t, e);
|
|
13540
13540
|
}
|
|
13541
13541
|
case z.Text:
|
|
13542
|
-
return new
|
|
13542
|
+
return new Fl(this.bundle, t);
|
|
13543
13543
|
default:
|
|
13544
13544
|
throw new Error("Unhandled Global Property Aspect Type");
|
|
13545
13545
|
}
|
|
@@ -13698,7 +13698,7 @@ class xl extends Oa {
|
|
|
13698
13698
|
return U.getLocalOrFromServer(t);
|
|
13699
13699
|
}
|
|
13700
13700
|
async getImageWithColors() {
|
|
13701
|
-
return await this.loadImageData(), this.imageData?.svg ? Ia(
|
|
13701
|
+
return await this.loadImageData(), this.imageData?.svg ? Ia(Da(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13702
13702
|
}
|
|
13703
13703
|
/**
|
|
13704
13704
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13832,7 +13832,7 @@ class xl extends Oa {
|
|
|
13832
13832
|
);
|
|
13833
13833
|
}
|
|
13834
13834
|
}
|
|
13835
|
-
class
|
|
13835
|
+
class Fl extends Oa {
|
|
13836
13836
|
constructor(t, e) {
|
|
13837
13837
|
super(t, e);
|
|
13838
13838
|
}
|
|
@@ -13983,8 +13983,8 @@ class cn extends gi {
|
|
|
13983
13983
|
return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor || this.getCurrentVariant()?.getColor() || "#ffffff";
|
|
13984
13984
|
}
|
|
13985
13985
|
}
|
|
13986
|
-
const
|
|
13987
|
-
const i =
|
|
13986
|
+
const Dl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlobalPropertyAspects(t).includes(e) && i.getType() === a), kl = (n, t, e) => {
|
|
13987
|
+
const i = Dl(
|
|
13988
13988
|
n,
|
|
13989
13989
|
t,
|
|
13990
13990
|
e,
|
|
@@ -14437,7 +14437,7 @@ class pi {
|
|
|
14437
14437
|
if (this.fullFetched)
|
|
14438
14438
|
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new ge(a));
|
|
14439
14439
|
const e = await y.getShadowGraphqlClient().query({
|
|
14440
|
-
query:
|
|
14440
|
+
query: Ds,
|
|
14441
14441
|
variables: {
|
|
14442
14442
|
id: this.getId(),
|
|
14443
14443
|
productIds: t
|
|
@@ -15110,14 +15110,13 @@ class dn {
|
|
|
15110
15110
|
}
|
|
15111
15111
|
}
|
|
15112
15112
|
async addWorkflowExperience(t) {
|
|
15113
|
-
|
|
15113
|
+
await this.initializeAdditionalRequiredColorChannels(t), t.setBundle(this), await this.appendWorkflowExperience(t), await this.injectExperienceIntoPreviewService(t), await t.getWorkflowManager().getInitializationPromise();
|
|
15114
15114
|
const e = await this.getGlobalProperties();
|
|
15115
|
-
console.log(`log: awe 7 ${Date.now()}`);
|
|
15116
15115
|
for (const a of e)
|
|
15117
|
-
await a.applyGlobalState([t])
|
|
15116
|
+
await a.applyGlobalState([t]);
|
|
15118
15117
|
this.fireEvent("workflow-experience-added", {
|
|
15119
15118
|
workflowExperiences: [t]
|
|
15120
|
-
})
|
|
15119
|
+
});
|
|
15121
15120
|
}
|
|
15122
15121
|
async addWorkflowExperiences(t) {
|
|
15123
15122
|
for (const s of t)
|
|
@@ -16159,7 +16158,7 @@ class Od {
|
|
|
16159
16158
|
} catch (a) {
|
|
16160
16159
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16161
16160
|
}
|
|
16162
|
-
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.
|
|
16161
|
+
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.2.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16163
16162
|
}
|
|
16164
16163
|
configure(t) {
|
|
16165
16164
|
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);
|
|
@@ -16582,7 +16581,7 @@ class Od {
|
|
|
16582
16581
|
if (!this.customer)
|
|
16583
16582
|
throw new Error("Customer not authenticated.");
|
|
16584
16583
|
const t = await y.getShadowGraphqlClient().query({
|
|
16585
|
-
query:
|
|
16584
|
+
query: Fs,
|
|
16586
16585
|
variables: {
|
|
16587
16586
|
id: this.customer.id
|
|
16588
16587
|
},
|
|
@@ -16631,12 +16630,12 @@ class Od {
|
|
|
16631
16630
|
},
|
|
16632
16631
|
errorPolicy: "all",
|
|
16633
16632
|
fetchPolicy: "no-cache"
|
|
16634
|
-
}),
|
|
16635
|
-
if (A = A +
|
|
16633
|
+
}), D = L.data.transactions;
|
|
16634
|
+
if (A = A + D.length, i && i(A, o.length), D.length !== B.length) {
|
|
16636
16635
|
const q = L.errors?.[0]?.message || "Unknown error";
|
|
16637
16636
|
throw new gt(`Not all transactions were found: ${q}`);
|
|
16638
16637
|
}
|
|
16639
|
-
return !this.activeIntegration &&
|
|
16638
|
+
return !this.activeIntegration && D[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(D[0].integrationProduct.integration)), D.map((q, qe) => ({
|
|
16640
16639
|
transaction: q,
|
|
16641
16640
|
workflowId: q.workflowId,
|
|
16642
16641
|
readOnly: B.find((At) => At.option.transactionId === q.id)?.option.readOnly ?? !1,
|
|
@@ -16648,15 +16647,15 @@ class Od {
|
|
|
16648
16647
|
const T = await u.mutate({
|
|
16649
16648
|
mutation: $r,
|
|
16650
16649
|
variables: {
|
|
16651
|
-
inputs: B.map((
|
|
16652
|
-
integrationProductId:
|
|
16653
|
-
externalIntegrationId:
|
|
16654
|
-
externalProductId:
|
|
16655
|
-
workflowId:
|
|
16656
|
-
designName:
|
|
16650
|
+
inputs: B.map((D) => ({
|
|
16651
|
+
integrationProductId: D.option.type === "integration" ? D.option.integrationProductId : void 0,
|
|
16652
|
+
externalIntegrationId: D.option.type === "external" ? D.option.externalIntegrationId : void 0,
|
|
16653
|
+
externalProductId: D.option.type === "external" ? D.option.externalProductId : void 0,
|
|
16654
|
+
workflowId: D.option.workflowId,
|
|
16655
|
+
designName: D.option.designName,
|
|
16657
16656
|
claim: !0,
|
|
16658
|
-
quantity:
|
|
16659
|
-
recipient:
|
|
16657
|
+
quantity: D.option.quantity,
|
|
16658
|
+
recipient: D.option.recipient
|
|
16660
16659
|
})),
|
|
16661
16660
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16662
16661
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
@@ -16665,12 +16664,12 @@ class Od {
|
|
|
16665
16664
|
fetchPolicy: "no-cache"
|
|
16666
16665
|
}), L = T.data?.transactionCreateMany;
|
|
16667
16666
|
if (!L || L.length === 0) {
|
|
16668
|
-
const
|
|
16669
|
-
throw new gt(`Failed to create transactions: ${
|
|
16667
|
+
const D = T.errors?.[0]?.message || "Unknown error";
|
|
16668
|
+
throw new gt(`Failed to create transactions: ${D}`);
|
|
16670
16669
|
}
|
|
16671
|
-
return A = A + L.length, i && i(A, o.length), L.map((
|
|
16672
|
-
transaction:
|
|
16673
|
-
workflowId:
|
|
16670
|
+
return A = A + L.length, i && i(A, o.length), L.map((D, q) => ({
|
|
16671
|
+
transaction: D,
|
|
16672
|
+
workflowId: D.workflowId,
|
|
16674
16673
|
readOnly: !1,
|
|
16675
16674
|
index: B[q].index
|
|
16676
16675
|
}));
|
|
@@ -16685,7 +16684,7 @@ class Od {
|
|
|
16685
16684
|
(async () => p.length > 0 ? await sc(p) : [])(),
|
|
16686
16685
|
(async () => f.length > 0 ? await Ci(f, e) : [])()
|
|
16687
16686
|
]), x = new Map(S.map((B) => [B.id, B])), v = new Map(w.map((B) => [B.id, B])), E = m.map(async (B) => {
|
|
16688
|
-
const { transaction: T, workflowId: L, readOnly:
|
|
16687
|
+
const { transaction: T, workflowId: L, readOnly: D, index: q } = B, qe = L ? v.get(L) : void 0, At = t[q];
|
|
16689
16688
|
if (T.integrationProductId) {
|
|
16690
16689
|
const it = x.get(T.integrationProductId);
|
|
16691
16690
|
T.integrationProduct = it, T.product = it?.product, T.integrationProduct || console.error("failed to find transaction's product");
|
|
@@ -16699,20 +16698,20 @@ class Od {
|
|
|
16699
16698
|
workflow: qe,
|
|
16700
16699
|
transaction: T,
|
|
16701
16700
|
singleVariantsRenderable: At?.workflowConfiguration?.singleVariantsRenderable,
|
|
16702
|
-
stateMutationFunc:
|
|
16701
|
+
stateMutationFunc: D ? async () => {
|
|
16703
16702
|
throw new Q("State mutation is forbidden in read only mode!");
|
|
16704
16703
|
} : async (it) => this.updateTransactionState({
|
|
16705
16704
|
...it,
|
|
16706
16705
|
context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
|
|
16707
16706
|
}),
|
|
16708
16707
|
graphQlClient: () => vi,
|
|
16709
|
-
readOnly:
|
|
16708
|
+
readOnly: D,
|
|
16710
16709
|
isReloadedTransaction: At.type === "transaction"
|
|
16711
16710
|
};
|
|
16712
16711
|
if (At.type === "transaction" && T.workflowState) {
|
|
16713
16712
|
const it = JSON.parse(T.workflowState);
|
|
16714
16713
|
await Za(it), se.reloadedState = it;
|
|
16715
|
-
} else if (!
|
|
16714
|
+
} else if (!D && At.workflowState) {
|
|
16716
16715
|
const it = JSON.parse(At.workflowState);
|
|
16717
16716
|
await Za(it), se.reloadedState = it;
|
|
16718
16717
|
}
|
|
@@ -16720,8 +16719,8 @@ class Od {
|
|
|
16720
16719
|
}), N = (await Promise.all(E)).sort((B, T) => B.index - T.index);
|
|
16721
16720
|
let R = [];
|
|
16722
16721
|
for (const B of N) {
|
|
16723
|
-
const { experienceOptions: T, options: L } = B,
|
|
16724
|
-
await
|
|
16722
|
+
const { experienceOptions: T, options: L } = B, D = new bl(this, T);
|
|
16723
|
+
await D.getWorkflowManager().getInitializationPromise(), a && a(), L.type !== "transaction" && this.customer && await D.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, D], D.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16725
16724
|
}
|
|
16726
16725
|
return R;
|
|
16727
16726
|
}
|
|
@@ -16953,7 +16952,7 @@ class dc {
|
|
|
16953
16952
|
getImageSrc() {
|
|
16954
16953
|
if (this.imageData) {
|
|
16955
16954
|
if (this.imageData.svg) {
|
|
16956
|
-
const t =
|
|
16955
|
+
const t = Da(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
16957
16956
|
return Ia(t);
|
|
16958
16957
|
}
|
|
16959
16958
|
return this.imageData.src;
|
|
@@ -17821,7 +17820,7 @@ const Si = C`
|
|
|
17821
17820
|
}
|
|
17822
17821
|
}
|
|
17823
17822
|
`;
|
|
17824
|
-
var
|
|
17823
|
+
var Fc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Fc || {}), Dc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(Dc || {});
|
|
17825
17824
|
const eA = async (n) => {
|
|
17826
17825
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().query({
|
|
17827
17826
|
query: Ic,
|
|
@@ -17894,14 +17893,14 @@ const eA = async (n) => {
|
|
|
17894
17893
|
})).data.integrationProducts;
|
|
17895
17894
|
export {
|
|
17896
17895
|
ba as AddonHandle,
|
|
17897
|
-
|
|
17898
|
-
|
|
17896
|
+
Dc as AddressValidationJobStatus,
|
|
17897
|
+
Fc as AddressValidationResultConfirmationLevel,
|
|
17899
17898
|
bn as AddressValidationStatus,
|
|
17900
17899
|
Rd as ArrayInput,
|
|
17901
17900
|
z as AspectType,
|
|
17902
17901
|
bt as AssetNotFoundError,
|
|
17903
17902
|
Ee as AssetType,
|
|
17904
|
-
|
|
17903
|
+
Fd as BringForwardCommand,
|
|
17905
17904
|
xd as BringToBackCommand,
|
|
17906
17905
|
Pd as BringToFrontCommand,
|
|
17907
17906
|
Vi as BundleDesignCreationCartAddMode,
|
|
@@ -17936,7 +17935,7 @@ export {
|
|
|
17936
17935
|
An as IntegrationProduct,
|
|
17937
17936
|
Gi as IntegrationType,
|
|
17938
17937
|
vd as LayoutElementFactory,
|
|
17939
|
-
|
|
17938
|
+
F as LayoutElementType,
|
|
17940
17939
|
J as LayoutNotFoundError,
|
|
17941
17940
|
Yt as LayoutRenderingPurpose,
|
|
17942
17941
|
rl as MaterialStepHandle,
|
|
@@ -17963,7 +17962,7 @@ export {
|
|
|
17963
17962
|
Jt as ResourceNotFoundError,
|
|
17964
17963
|
bd as RotateCommand,
|
|
17965
17964
|
j as ScaleAxis,
|
|
17966
|
-
|
|
17965
|
+
Dd as SendBackwardsCommand,
|
|
17967
17966
|
cl as ShapeStepHandle,
|
|
17968
17967
|
zi as ShareActionType,
|
|
17969
17968
|
Od as SpiffCommerceClient,
|
|
@@ -17973,7 +17972,7 @@ export {
|
|
|
17973
17972
|
b as StepType,
|
|
17974
17973
|
kt as TextAlgorithm,
|
|
17975
17974
|
$o as TextChangeCommand,
|
|
17976
|
-
|
|
17975
|
+
Fl as TextGlobalPropertyHandle,
|
|
17977
17976
|
Qd as TextInput,
|
|
17978
17977
|
dl as TextStepHandle,
|
|
17979
17978
|
Vl as Transform,
|
|
@@ -18045,7 +18044,7 @@ export {
|
|
|
18045
18044
|
$l as metafieldManager,
|
|
18046
18045
|
wd as mmPerPixel,
|
|
18047
18046
|
si as modelStepService,
|
|
18048
|
-
|
|
18047
|
+
Da as modifySVGColors,
|
|
18049
18048
|
li as moduleStepService,
|
|
18050
18049
|
Wd as nameBundle,
|
|
18051
18050
|
qd as nameTransaction,
|