@spiffcommerce/core 27.2.1-beta.53daa97c-6932-5a12-a2b0-5f55ecb6f4c7 → 27.2.1-beta.6052719b-af8d-5bf1-8a8e-b0e595b7c178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -7
- package/dist/index.js +100 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +272 -262
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
|
|
|
21
21
|
import ln from "lodash.debounce";
|
|
22
22
|
import "fs";
|
|
23
23
|
import "path";
|
|
24
|
-
var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}),
|
|
24
|
+
var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), qt = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(qt || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
|
|
25
25
|
class cn extends Error {
|
|
26
26
|
constructor(t) {
|
|
27
27
|
super(t), this.name = this.constructor.name;
|
|
@@ -47,7 +47,7 @@ class vt extends _t {
|
|
|
47
47
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
class
|
|
50
|
+
class Ht extends _t {
|
|
51
51
|
constructor(t) {
|
|
52
52
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
53
53
|
}
|
|
@@ -296,18 +296,18 @@ const Rr = (r) => {
|
|
|
296
296
|
let mn;
|
|
297
297
|
const $r = (r) => {
|
|
298
298
|
mn = r;
|
|
299
|
-
},
|
|
299
|
+
}, Lr = () => new Promise((r) => {
|
|
300
300
|
const t = mt.getHubUrl(), e = (a) => {
|
|
301
301
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
|
302
302
|
};
|
|
303
303
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
304
|
-
}),
|
|
304
|
+
}), Ur = async () => {
|
|
305
305
|
const r = {
|
|
306
306
|
applicationKey: ma,
|
|
307
307
|
customerToken: Qr,
|
|
308
308
|
bearer: mn
|
|
309
309
|
};
|
|
310
|
-
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await
|
|
310
|
+
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
|
|
311
311
|
};
|
|
312
312
|
async function Vr(r, t) {
|
|
313
313
|
const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
|
|
@@ -331,7 +331,7 @@ class Gr {
|
|
|
331
331
|
uri: `${mt.getServerUrl()}/graphql`,
|
|
332
332
|
fetch: Vr
|
|
333
333
|
}), e = lr(async (i, s) => {
|
|
334
|
-
const { headers: o } = s, l = o || {}, c = await
|
|
334
|
+
const { headers: o } = s, l = o || {}, c = await Ur();
|
|
335
335
|
let d = s.bearer ?? c.bearer;
|
|
336
336
|
if (this.spiffClient)
|
|
337
337
|
try {
|
|
@@ -427,7 +427,7 @@ const zr = (r) => new Promise((t) => {
|
|
|
427
427
|
}, jr = (r) => {
|
|
428
428
|
const e = r.naturalWidth / r.naturalHeight;
|
|
429
429
|
return r.naturalHeight <= 8192 && r.naturalWidth <= 8192 ? [r.naturalWidth, r.naturalHeight] : r.naturalHeight > r.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
|
430
|
-
},
|
|
430
|
+
}, qr = async (r) => {
|
|
431
431
|
var A;
|
|
432
432
|
const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
|
|
433
433
|
if (!await Wr()) {
|
|
@@ -460,7 +460,7 @@ const zr = (r) => new Promise((t) => {
|
|
|
460
460
|
}
|
|
461
461
|
return d.drawImage(e, 0, 0, o, l), c;
|
|
462
462
|
}, Me = async (r) => {
|
|
463
|
-
const t = await
|
|
463
|
+
const t = await qr(r);
|
|
464
464
|
return ke(r) === "image/jpeg" ? {
|
|
465
465
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
|
466
466
|
height: t.height,
|
|
@@ -3154,7 +3154,7 @@ const zr = (r) => new Promise((t) => {
|
|
|
3154
3154
|
"3E2B2E",
|
|
3155
3155
|
"101820",
|
|
3156
3156
|
"3D3935"
|
|
3157
|
-
],
|
|
3157
|
+
], Le = Ft.map((r) => [
|
|
3158
3158
|
parseInt(r.substring(0, 2), 16),
|
|
3159
3159
|
parseInt(r.substring(2, 4), 16),
|
|
3160
3160
|
parseInt(r.substring(4, 6), 16)
|
|
@@ -3163,12 +3163,12 @@ function Ic(r) {
|
|
|
3163
3163
|
const t = Yt.indexOf(r);
|
|
3164
3164
|
return t >= 0 ? Ft[t] : "";
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function Hr(r) {
|
|
3167
3167
|
const t = Ft.indexOf(r);
|
|
3168
3168
|
return t >= 0 ? Yt[t] : "";
|
|
3169
3169
|
}
|
|
3170
3170
|
function Pc(r, t = 64) {
|
|
3171
|
-
const e = [], a = [], n =
|
|
3171
|
+
const e = [], a = [], n = Hr(r);
|
|
3172
3172
|
n && e.push({
|
|
3173
3173
|
pms: n,
|
|
3174
3174
|
hex: r,
|
|
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
|
|
|
3177
3177
|
const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
|
|
3178
3178
|
let l, c, d;
|
|
3179
3179
|
for (let A = 0; A < Ft.length; A++) {
|
|
3180
|
-
l =
|
|
3180
|
+
l = Le[A][0], c = Le[A][1], d = Le[A][2];
|
|
3181
3181
|
const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
|
|
3182
3182
|
a.push(u);
|
|
3183
3183
|
}
|
|
@@ -3799,7 +3799,7 @@ class K {
|
|
|
3799
3799
|
N.setMap($a, t);
|
|
3800
3800
|
}
|
|
3801
3801
|
}
|
|
3802
|
-
const
|
|
3802
|
+
const L = new di();
|
|
3803
3803
|
class Ai {
|
|
3804
3804
|
constructor() {
|
|
3805
3805
|
this.cache = {}, this.disabled = !1;
|
|
@@ -3887,8 +3887,8 @@ const Jt = new Ai(), vn = v`
|
|
|
3887
3887
|
});
|
|
3888
3888
|
return t.data.options.forEach((e) => {
|
|
3889
3889
|
var a, n;
|
|
3890
|
-
(a = e.defaultVariant) != null && a.asset &&
|
|
3891
|
-
i.asset &&
|
|
3890
|
+
(a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
|
|
3891
|
+
i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
|
|
3892
3892
|
});
|
|
3893
3893
|
}), t.data.options;
|
|
3894
3894
|
}, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
|
|
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
|
|
|
5134
5134
|
internalId
|
|
5135
5135
|
}
|
|
5136
5136
|
}
|
|
5137
|
-
`, Ot = [P.SilentIllustration, P.ProductOverlay],
|
|
5137
|
+
`, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
|
|
5138
5138
|
const t = [];
|
|
5139
5139
|
r.introduction && t.push({
|
|
5140
5140
|
name: "Introduction",
|
|
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
|
|
|
5152
5152
|
silentSteps: []
|
|
5153
5153
|
});
|
|
5154
5154
|
for (const a of r.steps) {
|
|
5155
|
-
const n =
|
|
5155
|
+
const n = Ui(a.stepName, r.stepGroups);
|
|
5156
5156
|
if (!n)
|
|
5157
5157
|
t.push({
|
|
5158
5158
|
name: a.stepName,
|
|
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
|
|
|
5189
5189
|
],
|
|
5190
5190
|
silentSteps: []
|
|
5191
5191
|
}), t;
|
|
5192
|
-
},
|
|
5192
|
+
}, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
|
|
5193
5193
|
const a = t[e.targetStepName];
|
|
5194
5194
|
if (a && a.selectedVariants) {
|
|
5195
5195
|
const n = a.selectedVariants;
|
|
@@ -5317,7 +5317,7 @@ const Q = () => {
|
|
|
5317
5317
|
width: u
|
|
5318
5318
|
}) => {
|
|
5319
5319
|
var E;
|
|
5320
|
-
const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose ===
|
|
5320
|
+
const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
|
|
5321
5321
|
/* @ts-ignore */
|
|
5322
5322
|
/* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
|
|
5323
5323
|
)), S = n.map((B) => ({
|
|
@@ -5360,7 +5360,7 @@ const Q = () => {
|
|
|
5360
5360
|
"g",
|
|
5361
5361
|
{
|
|
5362
5362
|
id: "element-group",
|
|
5363
|
-
clipPath: a.purpose ===
|
|
5363
|
+
clipPath: a.purpose === qt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5364
5364
|
children: y.map((B) => Qn(B)).filter((B) => !!B)
|
|
5365
5365
|
}
|
|
5366
5366
|
),
|
|
@@ -5433,22 +5433,22 @@ const Q = () => {
|
|
|
5433
5433
|
y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
|
|
5434
5434
|
}), Pt = (r) => {
|
|
5435
5435
|
switch (r) {
|
|
5436
|
-
case
|
|
5437
|
-
return
|
|
5438
|
-
case
|
|
5439
|
-
return
|
|
5440
|
-
case
|
|
5441
|
-
return
|
|
5442
|
-
case
|
|
5443
|
-
return
|
|
5444
|
-
case
|
|
5445
|
-
return
|
|
5446
|
-
case
|
|
5447
|
-
return
|
|
5448
|
-
case
|
|
5449
|
-
return
|
|
5450
|
-
case
|
|
5451
|
-
return
|
|
5436
|
+
case H.North:
|
|
5437
|
+
return H.East;
|
|
5438
|
+
case H.East:
|
|
5439
|
+
return H.South;
|
|
5440
|
+
case H.South:
|
|
5441
|
+
return H.West;
|
|
5442
|
+
case H.West:
|
|
5443
|
+
return H.North;
|
|
5444
|
+
case H.Northwest:
|
|
5445
|
+
return H.Northeast;
|
|
5446
|
+
case H.Northeast:
|
|
5447
|
+
return H.Southeast;
|
|
5448
|
+
case H.Southeast:
|
|
5449
|
+
return H.Southwest;
|
|
5450
|
+
case H.Southwest:
|
|
5451
|
+
return H.Northwest;
|
|
5452
5452
|
}
|
|
5453
5453
|
}, Oc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, $c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5454
5454
|
const a = pt(r.rotation), n = {
|
|
@@ -5480,7 +5480,7 @@ const Q = () => {
|
|
|
5480
5480
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
|
5481
5481
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
|
5482
5482
|
};
|
|
5483
|
-
},
|
|
5483
|
+
}, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
|
|
5484
5484
|
const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
|
|
5485
5485
|
return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
|
|
5486
5486
|
"g",
|
|
@@ -5677,14 +5677,14 @@ class ji {
|
|
|
5677
5677
|
}), a - n;
|
|
5678
5678
|
}
|
|
5679
5679
|
}
|
|
5680
|
-
const
|
|
5681
|
-
if (
|
|
5682
|
-
return
|
|
5680
|
+
const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
|
|
5681
|
+
if (Ue.has(r))
|
|
5682
|
+
return Ue.get(r);
|
|
5683
5683
|
const e = (async () => {
|
|
5684
5684
|
try {
|
|
5685
5685
|
return Et(r).getFont();
|
|
5686
5686
|
} catch {
|
|
5687
|
-
if (
|
|
5687
|
+
if (qi(r)) {
|
|
5688
5688
|
const a = hn(r), n = Xe(a);
|
|
5689
5689
|
return ra(r, n), n;
|
|
5690
5690
|
} else {
|
|
@@ -5693,8 +5693,8 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5693
5693
|
}
|
|
5694
5694
|
}
|
|
5695
5695
|
})();
|
|
5696
|
-
return
|
|
5697
|
-
},
|
|
5696
|
+
return Ue.set(r, e), e;
|
|
5697
|
+
}, Hi = (r) => {
|
|
5698
5698
|
const t = hn(r), e = Xe(t);
|
|
5699
5699
|
return ra(r, e), e;
|
|
5700
5700
|
}, Et = (r) => {
|
|
@@ -5742,7 +5742,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5742
5742
|
}
|
|
5743
5743
|
return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
|
|
5744
5744
|
}, Ee = (r, t, e, a) => Math.max(_i(r.join(`
|
|
5745
|
-
`), e, a), t),
|
|
5745
|
+
`), e, a), t), La = (r, t, e, a, n, i) => {
|
|
5746
5746
|
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
|
5747
5747
|
`);
|
|
5748
5748
|
try {
|
|
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5800
5800
|
var c;
|
|
5801
5801
|
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
|
5802
5802
|
if (!e)
|
|
5803
|
-
return
|
|
5803
|
+
return La(t, r, t.fontSize, s, n, a);
|
|
5804
5804
|
let o;
|
|
5805
5805
|
if (t.text ? o = t.text.split(`
|
|
5806
5806
|
`) : o = ((c = t.input) == null ? void 0 : c.split(`
|
|
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5817
5817
|
requiredHeight: t.height,
|
|
5818
5818
|
requiredWidth: Ee(o, t.width, s, n),
|
|
5819
5819
|
fontSize: Yi(o, n, i, t.width, t.height, a)
|
|
5820
|
-
} :
|
|
5820
|
+
} : La(t, r, t.fontSize, s, n, a);
|
|
5821
5821
|
}, Ki = (r, t, e, a, n) => {
|
|
5822
5822
|
const s = Et(t.assetUrl).getFont();
|
|
5823
5823
|
let o = { ...r };
|
|
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5846
5846
|
return r.forEach((n) => {
|
|
5847
5847
|
a = Math.max(a, ht(n, t, e));
|
|
5848
5848
|
}), a;
|
|
5849
|
-
},
|
|
5849
|
+
}, Ua = {
|
|
5850
5850
|
stripControlCharacters: !0,
|
|
5851
5851
|
vertical: !1,
|
|
5852
5852
|
uppercase: !1
|
|
5853
|
-
}, Be = (r, t =
|
|
5854
|
-
const e = { ...
|
|
5853
|
+
}, Be = (r, t = Ua) => {
|
|
5854
|
+
const e = { ...Ua, ...t };
|
|
5855
5855
|
let a = r || "";
|
|
5856
5856
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
5857
5857
|
`)), a;
|
|
@@ -6046,7 +6046,7 @@ class rs {
|
|
|
6046
6046
|
return this.state;
|
|
6047
6047
|
}
|
|
6048
6048
|
runStateCallbacks() {
|
|
6049
|
-
|
|
6049
|
+
this.stateCallbacks.forEach((t) => t());
|
|
6050
6050
|
}
|
|
6051
6051
|
apply(t, e) {
|
|
6052
6052
|
if (!this.state)
|
|
@@ -6114,7 +6114,7 @@ class rs {
|
|
|
6114
6114
|
layouts: {}
|
|
6115
6115
|
};
|
|
6116
6116
|
t.forEach((n) => {
|
|
6117
|
-
a = new
|
|
6117
|
+
a = new Ln(n).apply(a);
|
|
6118
6118
|
}), this.runStateCallbacks(), this.state = {
|
|
6119
6119
|
transaction: a
|
|
6120
6120
|
};
|
|
@@ -6332,7 +6332,7 @@ const ae = (r) => {
|
|
|
6332
6332
|
return await A.render(), await t(c);
|
|
6333
6333
|
})();
|
|
6334
6334
|
return ze.set(r, a), a;
|
|
6335
|
-
},
|
|
6335
|
+
}, Lt = async (r, t, e, a) => {
|
|
6336
6336
|
const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
|
|
6337
6337
|
width: r.layoutState.layout.width,
|
|
6338
6338
|
height: r.layoutState.layout.height,
|
|
@@ -6366,7 +6366,7 @@ const ae = (r) => {
|
|
|
6366
6366
|
};
|
|
6367
6367
|
class Gc {
|
|
6368
6368
|
static async getFrame(t, e) {
|
|
6369
|
-
const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await
|
|
6369
|
+
const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
|
|
6370
6370
|
return {
|
|
6371
6371
|
id: Q(),
|
|
6372
6372
|
x: i.left,
|
|
@@ -6392,7 +6392,7 @@ class Gc {
|
|
|
6392
6392
|
};
|
|
6393
6393
|
}
|
|
6394
6394
|
static async getImage(t, e) {
|
|
6395
|
-
const a = e.region || await
|
|
6395
|
+
const a = e.region || await Lt(t, M.Image, e.src);
|
|
6396
6396
|
return {
|
|
6397
6397
|
id: Q(),
|
|
6398
6398
|
src: e.src,
|
|
@@ -6416,7 +6416,7 @@ class Gc {
|
|
|
6416
6416
|
}, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
|
|
6417
6417
|
vertical: a.vertical,
|
|
6418
6418
|
uppercase: a.uppercase
|
|
6419
|
-
}), A = e.region || await
|
|
6419
|
+
}), A = e.region || await Lt(t, M.Textbox, n, {
|
|
6420
6420
|
text: d,
|
|
6421
6421
|
fontScale: a.size ? a.size / s.unitsPerEm : void 0
|
|
6422
6422
|
}), u = ee(
|
|
@@ -6482,7 +6482,7 @@ class Gc {
|
|
|
6482
6482
|
</svg>
|
|
6483
6483
|
`, n = {};
|
|
6484
6484
|
n["spiff-fill-shape"] = { browserValue: e.color };
|
|
6485
|
-
const i = e.region || await
|
|
6485
|
+
const i = e.region || await Lt(t, M.Illustration), s = Q();
|
|
6486
6486
|
return {
|
|
6487
6487
|
stepRegion: e.region,
|
|
6488
6488
|
colors: n,
|
|
@@ -6500,7 +6500,7 @@ class Gc {
|
|
|
6500
6500
|
};
|
|
6501
6501
|
}
|
|
6502
6502
|
static async getIllustration(t, e) {
|
|
6503
|
-
const a = e.region || await
|
|
6503
|
+
const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
|
|
6504
6504
|
return {
|
|
6505
6505
|
cachedObjectURL: i,
|
|
6506
6506
|
stepRegion: e.region,
|
|
@@ -6525,7 +6525,7 @@ class V extends Error {
|
|
|
6525
6525
|
super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
|
|
6526
6526
|
}
|
|
6527
6527
|
}
|
|
6528
|
-
const
|
|
6528
|
+
const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
|
|
6529
6529
|
const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
|
|
6530
6530
|
if (!e)
|
|
6531
6531
|
throw new V();
|
|
@@ -6616,7 +6616,7 @@ class zc extends O {
|
|
|
6616
6616
|
}
|
|
6617
6617
|
apply(t) {
|
|
6618
6618
|
this.oldState = t;
|
|
6619
|
-
const e =
|
|
6619
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6620
6620
|
if (!e.id)
|
|
6621
6621
|
throw new V();
|
|
6622
6622
|
const a = {
|
|
@@ -6639,7 +6639,7 @@ class Wc extends O {
|
|
|
6639
6639
|
}
|
|
6640
6640
|
apply(t) {
|
|
6641
6641
|
this.oldState = t;
|
|
6642
|
-
const e =
|
|
6642
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6643
6643
|
if (!e.id)
|
|
6644
6644
|
throw new V();
|
|
6645
6645
|
const a = {
|
|
@@ -6661,7 +6661,7 @@ class jc extends O {
|
|
|
6661
6661
|
}
|
|
6662
6662
|
apply(t) {
|
|
6663
6663
|
this.oldState = t;
|
|
6664
|
-
const e =
|
|
6664
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6665
6665
|
if (!e.id)
|
|
6666
6666
|
throw new V();
|
|
6667
6667
|
let a = {
|
|
@@ -6694,7 +6694,7 @@ class $ extends O {
|
|
|
6694
6694
|
return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
|
|
6695
6695
|
}
|
|
6696
6696
|
}
|
|
6697
|
-
class
|
|
6697
|
+
class Ln extends O {
|
|
6698
6698
|
constructor(t) {
|
|
6699
6699
|
super(), this.layout = t;
|
|
6700
6700
|
}
|
|
@@ -6800,7 +6800,7 @@ class ss extends O {
|
|
|
6800
6800
|
}
|
|
6801
6801
|
apply(t) {
|
|
6802
6802
|
this.oldState = t;
|
|
6803
|
-
const e =
|
|
6803
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6804
6804
|
if (!e.id)
|
|
6805
6805
|
throw new V();
|
|
6806
6806
|
const a = {
|
|
@@ -6824,7 +6824,7 @@ class We extends O {
|
|
|
6824
6824
|
}
|
|
6825
6825
|
apply(t) {
|
|
6826
6826
|
this.oldState = t;
|
|
6827
|
-
const e =
|
|
6827
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6828
6828
|
if (!e.id)
|
|
6829
6829
|
throw new V();
|
|
6830
6830
|
const a = {
|
|
@@ -6846,7 +6846,7 @@ class os extends O {
|
|
|
6846
6846
|
}
|
|
6847
6847
|
apply(t) {
|
|
6848
6848
|
this.oldState = t;
|
|
6849
|
-
const e =
|
|
6849
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6850
6850
|
if (!e.id)
|
|
6851
6851
|
throw new V();
|
|
6852
6852
|
const a = {
|
|
@@ -6868,7 +6868,7 @@ class Wa extends O {
|
|
|
6868
6868
|
}
|
|
6869
6869
|
apply(t) {
|
|
6870
6870
|
this.oldState = t;
|
|
6871
|
-
const e =
|
|
6871
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6872
6872
|
if (!e.id)
|
|
6873
6873
|
throw new V();
|
|
6874
6874
|
const a = {
|
|
@@ -6890,7 +6890,7 @@ class ls extends O {
|
|
|
6890
6890
|
}
|
|
6891
6891
|
apply(t) {
|
|
6892
6892
|
this.oldState = t;
|
|
6893
|
-
const e =
|
|
6893
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6894
6894
|
if (!e.id)
|
|
6895
6895
|
throw new V();
|
|
6896
6896
|
const a = {
|
|
@@ -6948,7 +6948,7 @@ class ds extends O {
|
|
|
6948
6948
|
}
|
|
6949
6949
|
apply(t) {
|
|
6950
6950
|
this.oldState = t;
|
|
6951
|
-
const e =
|
|
6951
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6952
6952
|
if (!e.id)
|
|
6953
6953
|
throw new V();
|
|
6954
6954
|
const a = {
|
|
@@ -6967,13 +6967,13 @@ class ds extends O {
|
|
|
6967
6967
|
};
|
|
6968
6968
|
}
|
|
6969
6969
|
}
|
|
6970
|
-
class
|
|
6970
|
+
class qc extends O {
|
|
6971
6971
|
constructor(t, e) {
|
|
6972
6972
|
super(), this.id = t, this.src = e;
|
|
6973
6973
|
}
|
|
6974
6974
|
apply(t) {
|
|
6975
6975
|
this.oldState = t;
|
|
6976
|
-
const e =
|
|
6976
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6977
6977
|
if (!e.id)
|
|
6978
6978
|
throw new V();
|
|
6979
6979
|
const a = {
|
|
@@ -6995,7 +6995,7 @@ class As extends O {
|
|
|
6995
6995
|
}
|
|
6996
6996
|
apply(t) {
|
|
6997
6997
|
this.oldState = t;
|
|
6998
|
-
const e =
|
|
6998
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6999
6999
|
if (!e.id)
|
|
7000
7000
|
throw new V();
|
|
7001
7001
|
const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
|
|
@@ -7014,7 +7014,7 @@ class je extends O {
|
|
|
7014
7014
|
}
|
|
7015
7015
|
apply(t) {
|
|
7016
7016
|
this.oldState = t;
|
|
7017
|
-
const e =
|
|
7017
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7018
7018
|
if (!e.id)
|
|
7019
7019
|
throw new V();
|
|
7020
7020
|
const a = {
|
|
@@ -7037,7 +7037,7 @@ class oa extends O {
|
|
|
7037
7037
|
}
|
|
7038
7038
|
apply(t) {
|
|
7039
7039
|
this.oldState = t;
|
|
7040
|
-
const e =
|
|
7040
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7041
7041
|
if (!e.id)
|
|
7042
7042
|
throw new V();
|
|
7043
7043
|
const a = e.colors || {}, n = a[this.className];
|
|
@@ -7069,7 +7069,7 @@ class us extends O {
|
|
|
7069
7069
|
}
|
|
7070
7070
|
apply(t) {
|
|
7071
7071
|
this.oldState = t;
|
|
7072
|
-
const e =
|
|
7072
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7073
7073
|
if (!e.id)
|
|
7074
7074
|
throw new V();
|
|
7075
7075
|
const a = {
|
|
@@ -7086,7 +7086,7 @@ class us extends O {
|
|
|
7086
7086
|
};
|
|
7087
7087
|
}
|
|
7088
7088
|
}
|
|
7089
|
-
class
|
|
7089
|
+
class Hc extends O {
|
|
7090
7090
|
/**
|
|
7091
7091
|
* @param id The targeted element to bring to the front.
|
|
7092
7092
|
*/
|
|
@@ -7094,7 +7094,7 @@ class qc extends O {
|
|
|
7094
7094
|
super(), this.id = t;
|
|
7095
7095
|
}
|
|
7096
7096
|
apply(t) {
|
|
7097
|
-
if (this.oldState = t, !
|
|
7097
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7098
7098
|
throw new V();
|
|
7099
7099
|
const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
|
|
7100
7100
|
if (!a)
|
|
@@ -7124,7 +7124,7 @@ class Yc extends O {
|
|
|
7124
7124
|
}
|
|
7125
7125
|
apply(t) {
|
|
7126
7126
|
this.oldState = t;
|
|
7127
|
-
const e =
|
|
7127
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7128
7128
|
if (!e.id)
|
|
7129
7129
|
throw new V();
|
|
7130
7130
|
const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
|
|
@@ -7154,7 +7154,7 @@ class Jc extends O {
|
|
|
7154
7154
|
super(), this.id = t;
|
|
7155
7155
|
}
|
|
7156
7156
|
apply(t) {
|
|
7157
|
-
if (this.oldState = t, !
|
|
7157
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7158
7158
|
throw new V();
|
|
7159
7159
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
|
7160
7160
|
if (!a)
|
|
@@ -7181,7 +7181,7 @@ class Kc extends O {
|
|
|
7181
7181
|
super(), this.id = t;
|
|
7182
7182
|
}
|
|
7183
7183
|
apply(t) {
|
|
7184
|
-
if (this.oldState = t, !
|
|
7184
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7185
7185
|
throw new V();
|
|
7186
7186
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
|
7187
7187
|
if (!a)
|
|
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
|
|
|
7315
7315
|
throw console.error(e), new xe("Failed to shorten URL, see console.");
|
|
7316
7316
|
}
|
|
7317
7317
|
};
|
|
7318
|
-
class
|
|
7318
|
+
class Un {
|
|
7319
7319
|
async poll() {
|
|
7320
7320
|
try {
|
|
7321
7321
|
if (await this.predicate()) {
|
|
@@ -7362,12 +7362,12 @@ class ms {
|
|
|
7362
7362
|
const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
|
|
7363
7363
|
return { asset: h, link: m };
|
|
7364
7364
|
}, s = await new Promise((h, m) => {
|
|
7365
|
-
new
|
|
7365
|
+
new Un(
|
|
7366
7366
|
async () => !!(await i()).link,
|
|
7367
7367
|
async () => {
|
|
7368
7368
|
const g = await i();
|
|
7369
7369
|
if (!g.link || !g.link)
|
|
7370
|
-
throw new
|
|
7370
|
+
throw new Ht(g.asset);
|
|
7371
7371
|
h({
|
|
7372
7372
|
rel: "mpeg4",
|
|
7373
7373
|
href: g.link
|
|
@@ -7442,7 +7442,7 @@ class be {
|
|
|
7442
7442
|
const n = a.fileLink;
|
|
7443
7443
|
if (n)
|
|
7444
7444
|
return at(n, !0);
|
|
7445
|
-
throw new
|
|
7445
|
+
throw new Ht(a);
|
|
7446
7446
|
};
|
|
7447
7447
|
}
|
|
7448
7448
|
async init(t, e, a) {
|
|
@@ -7456,7 +7456,7 @@ class be {
|
|
|
7456
7456
|
const s = e.getWorkflowExperience().getBundle();
|
|
7457
7457
|
if (s && t.globalPropertyAspectConfigurations) {
|
|
7458
7458
|
const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
|
|
7459
|
-
c && c.originalAssetKey && (i = (await
|
|
7459
|
+
c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
|
|
7460
7460
|
}
|
|
7461
7461
|
if (t.option && t.option.variants && t.option.variants.length > 0) {
|
|
7462
7462
|
const o = t.option, l = Y.getDefaultVariant(o);
|
|
@@ -7552,14 +7552,14 @@ class be {
|
|
|
7552
7552
|
const o = e.fileLink || "";
|
|
7553
7553
|
return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
|
|
7554
7554
|
a.addPoller(
|
|
7555
|
-
new
|
|
7555
|
+
new Un(
|
|
7556
7556
|
async () => {
|
|
7557
7557
|
var h;
|
|
7558
|
-
const A = (h = (await
|
|
7558
|
+
const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
|
|
7559
7559
|
return A ? (await rt(A.link)).status === 200 : !1;
|
|
7560
7560
|
},
|
|
7561
7561
|
() => {
|
|
7562
|
-
|
|
7562
|
+
L.getLocalOrFromServer(e.key || "").then((d) => {
|
|
7563
7563
|
this.loadPatternFromAsset(d, t, a, n).then(
|
|
7564
7564
|
c
|
|
7565
7565
|
);
|
|
@@ -7786,7 +7786,7 @@ class be {
|
|
|
7786
7786
|
const a = t.fileLink;
|
|
7787
7787
|
if (a)
|
|
7788
7788
|
return a;
|
|
7789
|
-
throw new
|
|
7789
|
+
throw new Ht(t);
|
|
7790
7790
|
}
|
|
7791
7791
|
async loadPatternFromAsset(t, e, a, n) {
|
|
7792
7792
|
var c, d;
|
|
@@ -7854,7 +7854,7 @@ class gs {
|
|
|
7854
7854
|
if (a.length === 0)
|
|
7855
7855
|
return [];
|
|
7856
7856
|
try {
|
|
7857
|
-
return
|
|
7857
|
+
return U(
|
|
7858
7858
|
a[0].id,
|
|
7859
7859
|
e.getAllLayoutData()
|
|
7860
7860
|
).colors;
|
|
@@ -7939,7 +7939,7 @@ class gs {
|
|
|
7939
7939
|
var h, m;
|
|
7940
7940
|
if (e.length === 0)
|
|
7941
7941
|
return;
|
|
7942
|
-
const s =
|
|
7942
|
+
const s = U(
|
|
7943
7943
|
e[0].id,
|
|
7944
7944
|
n().map((g) => g.layoutState)
|
|
7945
7945
|
), o = { ...s.colors }, l = {};
|
|
@@ -7991,7 +7991,7 @@ class gs {
|
|
|
7991
7991
|
throw new vt(e);
|
|
7992
7992
|
const l = o.fileLink;
|
|
7993
7993
|
if (!l)
|
|
7994
|
-
throw new
|
|
7994
|
+
throw new Ht(o);
|
|
7995
7995
|
const c = await lt(await this.getIllustrationBody(l)), d = await Kt(c.svg), A = (C) => {
|
|
7996
7996
|
const w = i.getLayouts().find((y) => y.panelId === C.panelId);
|
|
7997
7997
|
if (!w)
|
|
@@ -8472,31 +8472,31 @@ class ys {
|
|
|
8472
8472
|
}
|
|
8473
8473
|
}
|
|
8474
8474
|
async selectVariant(t, e, a) {
|
|
8475
|
-
await a.getInitializationPromise();
|
|
8475
|
+
console.log("LOG: q select variant"), await a.getInitializationPromise();
|
|
8476
8476
|
const n = await this.selectVariantLambda(t, e, a);
|
|
8477
|
-
n && (n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
|
|
8477
|
+
n && (console.log("LOG: q select variant result"), n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
|
|
8478
8478
|
}
|
|
8479
8479
|
async selectVariantLambda(t, e, a) {
|
|
8480
8480
|
const n = t.option;
|
|
8481
8481
|
if (!n)
|
|
8482
|
-
return null;
|
|
8482
|
+
return console.log("LOG: q select variant no option"), null;
|
|
8483
8483
|
const i = n.variants;
|
|
8484
8484
|
if (!i)
|
|
8485
|
-
return null;
|
|
8485
|
+
return console.log("LOG: q select variant no variants"), null;
|
|
8486
8486
|
const s = i.length > 1 ? i.find((o) => o.id === e) : i[0];
|
|
8487
8487
|
if (!s)
|
|
8488
|
-
throw new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
|
|
8488
|
+
throw console.log("LOG: q select variant no variant"), new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
|
|
8489
8489
|
return {
|
|
8490
8490
|
command: void 0,
|
|
8491
8491
|
followup: async () => {
|
|
8492
|
-
await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
|
|
8492
|
+
console.log("LOG: q select variant follow up"), await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
|
|
8493
8493
|
a.setMandatoryFulfilled(t.stepName, !0);
|
|
8494
8494
|
});
|
|
8495
8495
|
}
|
|
8496
8496
|
};
|
|
8497
8497
|
}
|
|
8498
8498
|
}
|
|
8499
|
-
const
|
|
8499
|
+
const qn = new ys();
|
|
8500
8500
|
class Ss {
|
|
8501
8501
|
constructor() {
|
|
8502
8502
|
this.shapeFillId = "spiff-fill-shape";
|
|
@@ -8695,7 +8695,7 @@ class vs {
|
|
|
8695
8695
|
);
|
|
8696
8696
|
}
|
|
8697
8697
|
}
|
|
8698
|
-
const Es = new vs(),
|
|
8698
|
+
const Es = new vs(), qe = (r, t, e, a, n) => {
|
|
8699
8699
|
if (t.some((d) => d == null))
|
|
8700
8700
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
|
8701
8701
|
let i = t.map((d) => d.split(`
|
|
@@ -8727,19 +8727,19 @@ const Es = new vs(), He = (r, t, e, a, n) => {
|
|
|
8727
8727
|
const o = Et(t.assetUrl), l = o.getFont();
|
|
8728
8728
|
if (n.size) {
|
|
8729
8729
|
const u = r / l.unitsPerEm;
|
|
8730
|
-
return [i, s] =
|
|
8730
|
+
return [i, s] = qe(e, a, r, u, o), [n.size, i, s];
|
|
8731
8731
|
}
|
|
8732
8732
|
const c = 6;
|
|
8733
8733
|
let d = c - Ve;
|
|
8734
8734
|
if (a.length > 0) {
|
|
8735
8735
|
let u = a, h = 0;
|
|
8736
8736
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
|
8737
|
-
d += Ve, h = d / l.unitsPerEm, [u, s] =
|
|
8737
|
+
d += Ve, h = d / l.unitsPerEm, [u, s] = qe(e, a, d, h, o);
|
|
8738
8738
|
}
|
|
8739
8739
|
d > c && (d -= Ve), n.minSize && d < n.minSize && (d = n.minSize);
|
|
8740
8740
|
const A = d / l.unitsPerEm;
|
|
8741
|
-
return [i, s] =
|
|
8742
|
-
},
|
|
8741
|
+
return [i, s] = qe(e, a, d, A, o), [d, i, s];
|
|
8742
|
+
}, He = 30;
|
|
8743
8743
|
class Ie extends Error {
|
|
8744
8744
|
constructor(t) {
|
|
8745
8745
|
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ie.name;
|
|
@@ -8786,12 +8786,14 @@ class bs {
|
|
|
8786
8786
|
}
|
|
8787
8787
|
async init(t, e, a) {
|
|
8788
8788
|
var i, s, o, l;
|
|
8789
|
+
console.log(`LOG: t (${t.stepName}) init`);
|
|
8789
8790
|
const n = t.option;
|
|
8790
8791
|
if (!n)
|
|
8791
|
-
return null;
|
|
8792
|
+
return console.log(`LOG: t (${t.stepName}) no option`), null;
|
|
8792
8793
|
if (a)
|
|
8793
|
-
await this.reload(t, e, a);
|
|
8794
|
+
console.log(`LOG: t (${t.stepName}) reload`), await this.reload(t, e, a);
|
|
8794
8795
|
else {
|
|
8796
|
+
console.log(`LOG: t (${t.stepName}) no reload`);
|
|
8795
8797
|
const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
|
|
8796
8798
|
src: A.src,
|
|
8797
8799
|
height: A.height,
|
|
@@ -8827,7 +8829,7 @@ class bs {
|
|
|
8827
8829
|
});
|
|
8828
8830
|
const f = Y.getDefaultVariant(n);
|
|
8829
8831
|
if (f)
|
|
8830
|
-
return this.selectVariantCommand(
|
|
8832
|
+
return console.log(`LOG: t (${t.stepName}) variant`), this.selectVariantCommand(
|
|
8831
8833
|
t,
|
|
8832
8834
|
f,
|
|
8833
8835
|
{ text: g },
|
|
@@ -8841,10 +8843,10 @@ class bs {
|
|
|
8841
8843
|
m
|
|
8842
8844
|
);
|
|
8843
8845
|
}
|
|
8844
|
-
return null;
|
|
8846
|
+
return console.log(`LOG: t (${t.stepName}) end`), null;
|
|
8845
8847
|
}
|
|
8846
8848
|
findLayoutElements(t, e) {
|
|
8847
|
-
return t.getRegionElements(e.stepName).map((i) =>
|
|
8849
|
+
return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
|
|
8848
8850
|
}
|
|
8849
8851
|
/**
|
|
8850
8852
|
* Get the colors that can be used for a given text step.
|
|
@@ -9040,10 +9042,12 @@ class bs {
|
|
|
9040
9042
|
a.serializableWorkflow.steps
|
|
9041
9043
|
), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
|
|
9042
9044
|
if (n != null && n.selectedVariants) {
|
|
9045
|
+
console.log(`LOG: text (${t.stepName}) reload selections`);
|
|
9043
9046
|
const m = n.selectedVariants[0].id;
|
|
9044
9047
|
if (l && m) {
|
|
9045
9048
|
const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
|
|
9046
9049
|
if (g) {
|
|
9050
|
+
console.log(`LOG: text (${t.stepName}) reload selections variant`);
|
|
9047
9051
|
const p = await this.fontDataFromVariant(g), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
|
|
9048
9052
|
let w = (A = n.storage) == null ? void 0 : A.text;
|
|
9049
9053
|
const S = e.getWorkflowExperience().getBundle();
|
|
@@ -9067,8 +9071,10 @@ class bs {
|
|
|
9067
9071
|
e.getCommandDispatcher()(E);
|
|
9068
9072
|
}
|
|
9069
9073
|
), o.length === 0 && l) {
|
|
9074
|
+
console.log(`LOG: text (${t.stepName}) reload cond`);
|
|
9070
9075
|
const y = Y.getDefaultVariant(l);
|
|
9071
9076
|
if (y) {
|
|
9077
|
+
console.log(`LOG: text (${t.stepName}) reload cond default`);
|
|
9072
9078
|
const E = await this.selectVariantCommand(
|
|
9073
9079
|
t,
|
|
9074
9080
|
y,
|
|
@@ -9083,6 +9089,7 @@ class bs {
|
|
|
9083
9089
|
e.getCommandDispatcher()(E.command);
|
|
9084
9090
|
}
|
|
9085
9091
|
} else {
|
|
9092
|
+
console.log(`LOG: text (${t.stepName}) reload noncond`);
|
|
9086
9093
|
const { command: y } = j.updateInputText(
|
|
9087
9094
|
w || "",
|
|
9088
9095
|
o,
|
|
@@ -9094,6 +9101,7 @@ class bs {
|
|
|
9094
9101
|
}
|
|
9095
9102
|
}
|
|
9096
9103
|
} else {
|
|
9104
|
+
console.log(`LOG: text (${t.stepName}) reload else`);
|
|
9097
9105
|
const m = e.getWorkflowExperience().getBundle();
|
|
9098
9106
|
if (m && t.globalPropertyAspectConfigurations) {
|
|
9099
9107
|
const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
|
|
@@ -9102,8 +9110,9 @@ class bs {
|
|
|
9102
9110
|
});
|
|
9103
9111
|
if (p) {
|
|
9104
9112
|
const C = m.getGlobalPropertyStateManager().getAspect(p.name);
|
|
9105
|
-
if (C)
|
|
9113
|
+
if (console.log(`LOG: text (${t.stepName}) reload else aspect, aspect text ${C}`), C)
|
|
9106
9114
|
if (o.length === 0 && l) {
|
|
9115
|
+
console.log(`LOG: text (${t.stepName}) reload else aspect text a`);
|
|
9107
9116
|
const w = Y.getDefaultVariant(l);
|
|
9108
9117
|
if (w) {
|
|
9109
9118
|
const S = await this.selectVariantCommand(
|
|
@@ -9120,6 +9129,7 @@ class bs {
|
|
|
9120
9129
|
e.getCommandDispatcher()(S.command);
|
|
9121
9130
|
}
|
|
9122
9131
|
} else {
|
|
9132
|
+
console.log(`LOG: text (${t.stepName}) reload else aspect text b`);
|
|
9123
9133
|
const { command: w } = j.updateInputText(
|
|
9124
9134
|
C,
|
|
9125
9135
|
o,
|
|
@@ -9160,7 +9170,7 @@ class bs {
|
|
|
9160
9170
|
throw new vt(t);
|
|
9161
9171
|
const a = e.fileLink;
|
|
9162
9172
|
if (!a)
|
|
9163
|
-
throw new
|
|
9173
|
+
throw new Ht(e);
|
|
9164
9174
|
const n = await Nt(a);
|
|
9165
9175
|
return {
|
|
9166
9176
|
assetUrl: a,
|
|
@@ -9184,7 +9194,7 @@ class bs {
|
|
|
9184
9194
|
}
|
|
9185
9195
|
const m = await this.changeInputTextWithRegion(
|
|
9186
9196
|
t,
|
|
9187
|
-
t.data.size ||
|
|
9197
|
+
t.data.size || He,
|
|
9188
9198
|
A,
|
|
9189
9199
|
a.text || "",
|
|
9190
9200
|
a,
|
|
@@ -9209,7 +9219,7 @@ class bs {
|
|
|
9209
9219
|
i
|
|
9210
9220
|
), m = await this.changeInputTextWithRegion(
|
|
9211
9221
|
t,
|
|
9212
|
-
t.data.size ||
|
|
9222
|
+
t.data.size || He,
|
|
9213
9223
|
A,
|
|
9214
9224
|
((u = h[0]) == null ? void 0 : u.newElement.input) || a.text || t.data.defaultText || "",
|
|
9215
9225
|
a,
|
|
@@ -9271,7 +9281,7 @@ class bs {
|
|
|
9271
9281
|
stepName: t,
|
|
9272
9282
|
align: this.textAlign(a),
|
|
9273
9283
|
fill: i.color ? i.color : w,
|
|
9274
|
-
fontSize: a.size ||
|
|
9284
|
+
fontSize: a.size || He,
|
|
9275
9285
|
fontData: n,
|
|
9276
9286
|
id: m,
|
|
9277
9287
|
layer: A.layer,
|
|
@@ -9326,7 +9336,7 @@ class bs {
|
|
|
9326
9336
|
}, d = await Promise.all(a.regions.map(c)).catch((A) => {
|
|
9327
9337
|
throw A instanceof Ie ? (Es.setLatestToast("Failed to load font.", Re.Error), A) : A instanceof Pe ? A : new Error(A);
|
|
9328
9338
|
});
|
|
9329
|
-
return await s.setSelectionsAndElements(
|
|
9339
|
+
return console.log(`LOG: step (${t}) created ${d.length} new text elements for ${a.regions.length} regions`), await s.setSelectionsAndElements(
|
|
9330
9340
|
t,
|
|
9331
9341
|
[e],
|
|
9332
9342
|
d.map((A) => A.regionElement),
|
|
@@ -9436,7 +9446,7 @@ function Ms(r, t, e, a) {
|
|
|
9436
9446
|
const n = e / r, i = a / t;
|
|
9437
9447
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
|
9438
9448
|
}
|
|
9439
|
-
const
|
|
9449
|
+
const qa = {
|
|
9440
9450
|
m: ["x", "y"],
|
|
9441
9451
|
z: [],
|
|
9442
9452
|
l: ["x", "y"],
|
|
@@ -9466,7 +9476,7 @@ class Ts {
|
|
|
9466
9476
|
const n = (i) => {
|
|
9467
9477
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
|
9468
9478
|
let l = e !== o;
|
|
9469
|
-
const c =
|
|
9479
|
+
const c = qa[i.type];
|
|
9470
9480
|
l && (s.push(o), e = o);
|
|
9471
9481
|
for (const d of c) {
|
|
9472
9482
|
const A = i[d];
|
|
@@ -9491,7 +9501,7 @@ class Ts {
|
|
|
9491
9501
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
|
9492
9502
|
let i;
|
|
9493
9503
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
|
9494
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
|
9504
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = qa[s];
|
|
9495
9505
|
if (o.length < c.length)
|
|
9496
9506
|
throw new xt(
|
|
9497
9507
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
|
@@ -9557,7 +9567,7 @@ class Ns extends Is {
|
|
|
9557
9567
|
return this.svgElement(t, e);
|
|
9558
9568
|
}
|
|
9559
9569
|
svgElement(t, e) {
|
|
9560
|
-
const a =
|
|
9570
|
+
const a = Hi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
|
|
9561
9571
|
const w = et("g");
|
|
9562
9572
|
w.classList.add("module-text-group");
|
|
9563
9573
|
const S = et("defs");
|
|
@@ -9588,7 +9598,7 @@ class Ns extends Is {
|
|
|
9588
9598
|
return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
|
|
9589
9599
|
}
|
|
9590
9600
|
}
|
|
9591
|
-
async function
|
|
9601
|
+
async function Hn(r) {
|
|
9592
9602
|
if (r === "Vegemite")
|
|
9593
9603
|
return new Ns();
|
|
9594
9604
|
throw new z(`Failed to resolve Module, Module ${r} not found`);
|
|
@@ -9765,7 +9775,7 @@ const ne = v`
|
|
|
9765
9775
|
}
|
|
9766
9776
|
}
|
|
9767
9777
|
}
|
|
9768
|
-
`,
|
|
9778
|
+
`, Ls = (r) => v`
|
|
9769
9779
|
${ne}
|
|
9770
9780
|
${re(r)}
|
|
9771
9781
|
query GetBundle($id: String!) {
|
|
@@ -9809,7 +9819,7 @@ const ne = v`
|
|
|
9809
9819
|
quoteId
|
|
9810
9820
|
}
|
|
9811
9821
|
}
|
|
9812
|
-
`,
|
|
9822
|
+
`, Ha = v`
|
|
9813
9823
|
query GetBundleStakeholders($id: String!) {
|
|
9814
9824
|
bundles(ids: [$id]) {
|
|
9815
9825
|
id
|
|
@@ -9854,7 +9864,7 @@ const ne = v`
|
|
|
9854
9864
|
}
|
|
9855
9865
|
}
|
|
9856
9866
|
}
|
|
9857
|
-
`,
|
|
9867
|
+
`, Us = v`
|
|
9858
9868
|
query GetBundlesForCustomer($id: String!) {
|
|
9859
9869
|
customers(ids: [$id]) {
|
|
9860
9870
|
bundleStakeholders {
|
|
@@ -10015,7 +10025,7 @@ const ne = v`
|
|
|
10015
10025
|
}
|
|
10016
10026
|
}
|
|
10017
10027
|
}
|
|
10018
|
-
`,
|
|
10028
|
+
`, qs = v`
|
|
10019
10029
|
mutation UpdateBundle(
|
|
10020
10030
|
$id: String!
|
|
10021
10031
|
$name: String
|
|
@@ -10035,7 +10045,7 @@ const ne = v`
|
|
|
10035
10045
|
id
|
|
10036
10046
|
}
|
|
10037
10047
|
}
|
|
10038
|
-
`,
|
|
10048
|
+
`, Hs = v`
|
|
10039
10049
|
mutation BundleAddTransaction($id: String!, $transactionId: String!) {
|
|
10040
10050
|
bundleAddTransaction(id: $id, transactionId: $transactionId) {
|
|
10041
10051
|
id
|
|
@@ -10283,11 +10293,10 @@ class mo {
|
|
|
10283
10293
|
var w;
|
|
10284
10294
|
this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
|
10285
10295
|
var E;
|
|
10286
|
-
if (
|
|
10296
|
+
if (!this.previewService)
|
|
10287
10297
|
return;
|
|
10288
|
-
console.log("LOG: render layouts: service exists");
|
|
10289
10298
|
const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
|
|
10290
|
-
if (
|
|
10299
|
+
if (y)
|
|
10291
10300
|
for (const [, B] of y)
|
|
10292
10301
|
B.render(S);
|
|
10293
10302
|
}, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
|
|
@@ -10394,7 +10403,7 @@ class mo {
|
|
|
10394
10403
|
};
|
|
10395
10404
|
this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
|
|
10396
10405
|
this.storage[o.stepName] = o.storage || {};
|
|
10397
|
-
}), this.allScenes = await
|
|
10406
|
+
}), this.allScenes = await Li(t);
|
|
10398
10407
|
const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
|
|
10399
10408
|
this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
|
10400
10409
|
}
|
|
@@ -10850,6 +10859,9 @@ class mo {
|
|
|
10850
10859
|
})
|
|
10851
10860
|
), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
|
|
10852
10861
|
}
|
|
10862
|
+
unsetInitialized() {
|
|
10863
|
+
this.stepInitialised = {};
|
|
10864
|
+
}
|
|
10853
10865
|
async setSelectionsAndElements(t, e, a, n) {
|
|
10854
10866
|
var y;
|
|
10855
10867
|
const i = this.stepSelections;
|
|
@@ -10896,7 +10908,7 @@ class mo {
|
|
|
10896
10908
|
async ensureStepsAreLoaded() {
|
|
10897
10909
|
const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
|
|
10898
10910
|
for (const l of n)
|
|
10899
|
-
if (!this.stepInitialised[l.stepName])
|
|
10911
|
+
if (l.stepTitle === "Sleeve Message" && console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
|
|
10900
10912
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
10901
10913
|
case P.DigitalContent:
|
|
10902
10914
|
a.push(
|
|
@@ -10925,7 +10937,7 @@ class mo {
|
|
|
10925
10937
|
break;
|
|
10926
10938
|
case P.Module:
|
|
10927
10939
|
this.stepSpecificServices[l.stepName] = {
|
|
10928
|
-
module: await
|
|
10940
|
+
module: await Hn(l.data.module)
|
|
10929
10941
|
}, a.push(
|
|
10930
10942
|
Wn.init(l, this, this.reloadedState)
|
|
10931
10943
|
);
|
|
@@ -10937,14 +10949,14 @@ class mo {
|
|
|
10937
10949
|
break;
|
|
10938
10950
|
case P.Question:
|
|
10939
10951
|
a.push(
|
|
10940
|
-
|
|
10952
|
+
qn.init(l, this, this.reloadedState)
|
|
10941
10953
|
);
|
|
10942
10954
|
break;
|
|
10943
10955
|
case P.Shape:
|
|
10944
10956
|
a.push(Gt.init(l, this, this.reloadedState));
|
|
10945
10957
|
break;
|
|
10946
10958
|
case P.Text:
|
|
10947
|
-
a.push(j.init(l, this, this.reloadedState));
|
|
10959
|
+
console.log("LOG: ensure text loaded"), a.push(j.init(l, this, this.reloadedState));
|
|
10948
10960
|
break;
|
|
10949
10961
|
}
|
|
10950
10962
|
const i = (await Promise.allSettled(a)).map((l) => {
|
|
@@ -11251,7 +11263,7 @@ class go extends it {
|
|
|
11251
11263
|
const t = this.manager.getRegionElements(this.step.stepName) || [];
|
|
11252
11264
|
if (t.length === 0)
|
|
11253
11265
|
return;
|
|
11254
|
-
const a =
|
|
11266
|
+
const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
|
|
11255
11267
|
if (s.length !== 0) {
|
|
11256
11268
|
const l = {};
|
|
11257
11269
|
return s.forEach((c) => {
|
|
@@ -11352,7 +11364,7 @@ class wo extends it {
|
|
|
11352
11364
|
async selectVariant(t) {
|
|
11353
11365
|
if (!t.getId())
|
|
11354
11366
|
throw new Error("Unable to select variant with a null ID");
|
|
11355
|
-
await
|
|
11367
|
+
await qn.selectVariant(this.step, t.getId(), this.manager);
|
|
11356
11368
|
}
|
|
11357
11369
|
/**
|
|
11358
11370
|
* The way that this step expects to be rendered.
|
|
@@ -11985,22 +11997,22 @@ const Po = async (r, t) => {
|
|
|
11985
11997
|
for (const T of Object.keys(i)) {
|
|
11986
11998
|
const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
|
|
11987
11999
|
for (let tt = 0; tt < nt.selections.length; ++tt) {
|
|
11988
|
-
const
|
|
12000
|
+
const q = nt.selections[tt];
|
|
11989
12001
|
if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
|
|
11990
12002
|
const ft = R.stepTitle;
|
|
11991
12003
|
x[ft] ? x[ft].push({
|
|
11992
|
-
id:
|
|
11993
|
-
name:
|
|
11994
|
-
priceModifier:
|
|
12004
|
+
id: q.id || "",
|
|
12005
|
+
name: q.name,
|
|
12006
|
+
priceModifier: q.priceModifier
|
|
11995
12007
|
}) : x[ft] = [
|
|
11996
12008
|
{
|
|
11997
|
-
id:
|
|
11998
|
-
name:
|
|
11999
|
-
priceModifier:
|
|
12009
|
+
id: q.id || "",
|
|
12010
|
+
name: q.name,
|
|
12011
|
+
priceModifier: q.priceModifier
|
|
12000
12012
|
}
|
|
12001
12013
|
];
|
|
12002
12014
|
}
|
|
12003
|
-
k +=
|
|
12015
|
+
k += q.priceModifier;
|
|
12004
12016
|
}
|
|
12005
12017
|
}
|
|
12006
12018
|
return [x, k];
|
|
@@ -12015,7 +12027,7 @@ const Po = async (r, t) => {
|
|
|
12015
12027
|
let E = await o(m, n.id);
|
|
12016
12028
|
if (E) {
|
|
12017
12029
|
const D = await (await rt(E)).blob();
|
|
12018
|
-
E = (await
|
|
12030
|
+
E = (await L.uploadAsset(
|
|
12019
12031
|
{ name: `${n.id}-preview-image.png`, blob: D },
|
|
12020
12032
|
Ce.Image,
|
|
12021
12033
|
!0,
|
|
@@ -12373,7 +12385,7 @@ class Oo {
|
|
|
12373
12385
|
throw new xe("Failed to obtain 2D context for preview image creation");
|
|
12374
12386
|
const m = Sa(u.layoutState.layout, u.layoutState.elements, {
|
|
12375
12387
|
renderingConfiguration: {
|
|
12376
|
-
purpose:
|
|
12388
|
+
purpose: qt.Print,
|
|
12377
12389
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
12378
12390
|
templatingContext: this.workflowManager.getTemplatingContext()
|
|
12379
12391
|
}
|
|
@@ -12683,7 +12695,7 @@ const $o = [
|
|
|
12683
12695
|
"textPath",
|
|
12684
12696
|
"tref",
|
|
12685
12697
|
"tspan"
|
|
12686
|
-
],
|
|
12698
|
+
], Lo = async (r, t, e) => {
|
|
12687
12699
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
|
12688
12700
|
o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
|
12689
12701
|
const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
|
|
@@ -12710,7 +12722,7 @@ const $o = [
|
|
|
12710
12722
|
} catch (h) {
|
|
12711
12723
|
return console.error(h), [];
|
|
12712
12724
|
}
|
|
12713
|
-
},
|
|
12725
|
+
}, Uo = async (r, t, e, a) => {
|
|
12714
12726
|
const n = e.data, i = n.assetUrl, s = await sa(i);
|
|
12715
12727
|
try {
|
|
12716
12728
|
const o = is(n, a.option);
|
|
@@ -12838,7 +12850,7 @@ const $o = [
|
|
|
12838
12850
|
return console.error(B), [];
|
|
12839
12851
|
}
|
|
12840
12852
|
}, Go = async (r, t, e) => {
|
|
12841
|
-
const a = await
|
|
12853
|
+
const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
|
|
12842
12854
|
const c = r.find((A) => A.panelId === l.panelId);
|
|
12843
12855
|
if (!c)
|
|
12844
12856
|
throw new J(l);
|
|
@@ -13033,7 +13045,7 @@ const $o = [
|
|
|
13033
13045
|
});
|
|
13034
13046
|
}
|
|
13035
13047
|
return a;
|
|
13036
|
-
},
|
|
13048
|
+
}, qo = async (r, t, e, a) => {
|
|
13037
13049
|
const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
|
|
13038
13050
|
var w;
|
|
13039
13051
|
const p = a.option;
|
|
@@ -13122,7 +13134,7 @@ const $o = [
|
|
|
13122
13134
|
n.push(new W(C, f));
|
|
13123
13135
|
}
|
|
13124
13136
|
return n;
|
|
13125
|
-
},
|
|
13137
|
+
}, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
|
|
13126
13138
|
const a = t[e.targetStepName];
|
|
13127
13139
|
if (a && a.selectedVariants) {
|
|
13128
13140
|
const n = a.selectedVariants;
|
|
@@ -13139,13 +13151,13 @@ const $o = [
|
|
|
13139
13151
|
switch (o.type) {
|
|
13140
13152
|
case P.DigitalContent:
|
|
13141
13153
|
n.push(
|
|
13142
|
-
...await
|
|
13154
|
+
...await Lo(e, s, o)
|
|
13143
13155
|
);
|
|
13144
13156
|
break;
|
|
13145
13157
|
case P.Frame:
|
|
13146
13158
|
case P.Photo:
|
|
13147
13159
|
n.push(
|
|
13148
|
-
...await
|
|
13160
|
+
...await Uo(e, i, s, o)
|
|
13149
13161
|
);
|
|
13150
13162
|
break;
|
|
13151
13163
|
case P.Illustration:
|
|
@@ -13173,13 +13185,13 @@ const $o = [
|
|
|
13173
13185
|
break;
|
|
13174
13186
|
case P.Text:
|
|
13175
13187
|
n.push(
|
|
13176
|
-
...await
|
|
13188
|
+
...await qo(e, i, s, o)
|
|
13177
13189
|
);
|
|
13178
13190
|
break;
|
|
13179
13191
|
}
|
|
13180
13192
|
}
|
|
13181
13193
|
for (const s of t.steps)
|
|
13182
|
-
s.type !== P.SilentIllustration && s.type !== P.ProductOverlay ||
|
|
13194
|
+
s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || Ho(s, i) && n.push(
|
|
13183
13195
|
...await jo(e, s, a)
|
|
13184
13196
|
);
|
|
13185
13197
|
return n;
|
|
@@ -13347,7 +13359,7 @@ class Zo extends Dn {
|
|
|
13347
13359
|
l = i.width, c = i.height;
|
|
13348
13360
|
const d = Sa(t.layoutState.layout, e, {
|
|
13349
13361
|
renderingConfiguration: {
|
|
13350
|
-
purpose:
|
|
13362
|
+
purpose: qt.ThreeD,
|
|
13351
13363
|
templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
|
|
13352
13364
|
}
|
|
13353
13365
|
}), A = un(d), u = await Aa.from(this.ctx, A, {
|
|
@@ -13381,7 +13393,7 @@ const Xc = (r, t) => {
|
|
|
13381
13393
|
serializableWorkflow: { steps: [] },
|
|
13382
13394
|
layouts: {}
|
|
13383
13395
|
};
|
|
13384
|
-
n = new $(e.map((l) => new
|
|
13396
|
+
n = new $(e.map((l) => new Ln(l))).apply(n);
|
|
13385
13397
|
const s = await Yo(r, t, e, a);
|
|
13386
13398
|
return new $(s).apply(n);
|
|
13387
13399
|
};
|
|
@@ -13486,18 +13498,16 @@ class Ia {
|
|
|
13486
13498
|
* Returns all steps that share this property.
|
|
13487
13499
|
* @param targetExperiences Optionally filter the steps to only those in the given experiences.
|
|
13488
13500
|
*/
|
|
13489
|
-
getSharedSteps(t) {
|
|
13490
|
-
return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
})
|
|
13500
|
-
);
|
|
13501
|
+
getSharedSteps(t, e) {
|
|
13502
|
+
return (t ?? this.bundle.getWorkflowExperiences()).flatMap((i) => (e ? i.getSteps() : i.getStepsConditionallyActive()).filter((o) => {
|
|
13503
|
+
var l;
|
|
13504
|
+
return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
|
|
13505
|
+
(c) => {
|
|
13506
|
+
var d, A;
|
|
13507
|
+
return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
|
|
13508
|
+
}
|
|
13509
|
+
);
|
|
13510
|
+
}));
|
|
13501
13511
|
}
|
|
13502
13512
|
getStateValue() {
|
|
13503
13513
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
@@ -13569,7 +13579,7 @@ class el extends Ia {
|
|
|
13569
13579
|
const e = await this.getOriginalImage();
|
|
13570
13580
|
if (!e)
|
|
13571
13581
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
13572
|
-
const a = this.bundle.getGlobalPropertyStateManager(), n = await
|
|
13582
|
+
const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
|
|
13573
13583
|
...a.getAspectStorage(this.property.name),
|
|
13574
13584
|
backgroundRemovedAssetKey: n.key,
|
|
13575
13585
|
useOriginalAsset: !t
|
|
@@ -13589,7 +13599,7 @@ class el extends Ia {
|
|
|
13589
13599
|
async getImage() {
|
|
13590
13600
|
const t = this.getStateValue();
|
|
13591
13601
|
if (t)
|
|
13592
|
-
return
|
|
13602
|
+
return L.getLocalOrFromServer(t);
|
|
13593
13603
|
}
|
|
13594
13604
|
async getImageWithColors() {
|
|
13595
13605
|
var t, e;
|
|
@@ -13602,7 +13612,7 @@ class el extends Ia {
|
|
|
13602
13612
|
async getOriginalImage() {
|
|
13603
13613
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13604
13614
|
if (t != null && t.originalAssetKey)
|
|
13605
|
-
return
|
|
13615
|
+
return L.getLocalOrFromServer(t.originalAssetKey);
|
|
13606
13616
|
}
|
|
13607
13617
|
/**
|
|
13608
13618
|
* Retrieves the version of the image selection that has the background removed, if one exists.
|
|
@@ -13611,7 +13621,7 @@ class el extends Ia {
|
|
|
13611
13621
|
async getBackgroundRemovedImage() {
|
|
13612
13622
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13613
13623
|
if (t != null && t.backgroundRemovedAssetKey)
|
|
13614
|
-
return
|
|
13624
|
+
return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
|
|
13615
13625
|
}
|
|
13616
13626
|
getUseOriginalImage() {
|
|
13617
13627
|
var t;
|
|
@@ -13643,26 +13653,26 @@ class el extends Ia {
|
|
|
13643
13653
|
}
|
|
13644
13654
|
o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
|
|
13645
13655
|
}
|
|
13646
|
-
async applyGlobalState(t) {
|
|
13647
|
-
const
|
|
13648
|
-
if (!e)
|
|
13649
|
-
return;
|
|
13650
|
-
const a = await U.getLocalOrFromServer(e);
|
|
13656
|
+
async applyGlobalState(t, e) {
|
|
13657
|
+
const a = this.getStateValue();
|
|
13651
13658
|
if (!a)
|
|
13652
13659
|
return;
|
|
13653
|
-
await
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
|
|
13660
|
+
const n = await L.getLocalOrFromServer(a);
|
|
13661
|
+
if (!n)
|
|
13662
|
+
return;
|
|
13663
|
+
await this.applyImageSelection(n, t, !1, !0);
|
|
13664
|
+
const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13665
|
+
if (i) {
|
|
13666
|
+
if (this.updateSharedStepStorage({ ...i }), i.colors) {
|
|
13667
|
+
const s = new Map(
|
|
13668
|
+
i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
|
|
13659
13669
|
);
|
|
13660
|
-
this.getSharedSteps(t).forEach((
|
|
13661
|
-
|
|
13670
|
+
this.getSharedSteps(t, e).forEach((o) => {
|
|
13671
|
+
o.changeColors(s);
|
|
13662
13672
|
});
|
|
13663
13673
|
}
|
|
13664
13674
|
} else
|
|
13665
|
-
this.updateSharedStepStorage({ originalAssetKey:
|
|
13675
|
+
this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
|
|
13666
13676
|
}
|
|
13667
13677
|
getAvailableColors() {
|
|
13668
13678
|
var t, e, a, n;
|
|
@@ -13689,22 +13699,22 @@ class el extends Ia {
|
|
|
13689
13699
|
var e;
|
|
13690
13700
|
return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
|
|
13691
13701
|
}
|
|
13692
|
-
async changeColors(t) {
|
|
13693
|
-
var
|
|
13694
|
-
if (!((
|
|
13702
|
+
async changeColors(t, e) {
|
|
13703
|
+
var s;
|
|
13704
|
+
if (!((s = this.imageData) != null && s.svg))
|
|
13695
13705
|
return;
|
|
13696
|
-
const
|
|
13697
|
-
|
|
13698
|
-
|
|
13706
|
+
const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
|
|
13707
|
+
a.forEach((o) => {
|
|
13708
|
+
o.changeColors(n);
|
|
13699
13709
|
});
|
|
13700
|
-
const
|
|
13710
|
+
const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13701
13711
|
await Promise.all([
|
|
13702
13712
|
this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
|
|
13703
|
-
...
|
|
13704
|
-
colors: Object.entries(t).map(([
|
|
13705
|
-
key:
|
|
13706
|
-
browserValue:
|
|
13707
|
-
pmsValue:
|
|
13713
|
+
...i,
|
|
13714
|
+
colors: Object.entries(t).map(([o, l]) => ({
|
|
13715
|
+
key: o,
|
|
13716
|
+
browserValue: l.browserValue,
|
|
13717
|
+
pmsValue: l.pmsValue
|
|
13708
13718
|
}))
|
|
13709
13719
|
}),
|
|
13710
13720
|
await this.loadImageData()
|
|
@@ -13754,10 +13764,10 @@ class al extends Ia {
|
|
|
13754
13764
|
/**
|
|
13755
13765
|
* Set the text.
|
|
13756
13766
|
*/
|
|
13757
|
-
async setText(t) {
|
|
13767
|
+
async setText(t, e) {
|
|
13758
13768
|
await Promise.all([
|
|
13759
13769
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
|
|
13760
|
-
this.applyTextSelection(t)
|
|
13770
|
+
this.applyTextSelection(t, void 0, e)
|
|
13761
13771
|
]);
|
|
13762
13772
|
}
|
|
13763
13773
|
async applyGlobalState(t) {
|
|
@@ -13766,13 +13776,11 @@ class al extends Ia {
|
|
|
13766
13776
|
return Promise.resolve();
|
|
13767
13777
|
await this.applyTextSelection(e, t);
|
|
13768
13778
|
}
|
|
13769
|
-
async applyTextSelection(t, e) {
|
|
13770
|
-
const
|
|
13771
|
-
|
|
13772
|
-
const n = a.map((i) => {
|
|
13773
|
-
i.setText(t);
|
|
13779
|
+
async applyTextSelection(t, e, a) {
|
|
13780
|
+
const i = this.getSharedSteps(e, a).map((s) => {
|
|
13781
|
+
s.setText(t);
|
|
13774
13782
|
});
|
|
13775
|
-
await Promise.all(
|
|
13783
|
+
await Promise.all(i);
|
|
13776
13784
|
}
|
|
13777
13785
|
}
|
|
13778
13786
|
class Xn extends Ia {
|
|
@@ -13831,10 +13839,10 @@ class Xn extends Ia {
|
|
|
13831
13839
|
* Select a given variant on the option for all shared steps.
|
|
13832
13840
|
* @param variant The variant to select.
|
|
13833
13841
|
*/
|
|
13834
|
-
async selectVariant(t, e) {
|
|
13842
|
+
async selectVariant(t, e, a) {
|
|
13835
13843
|
await Promise.all([
|
|
13836
13844
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
|
|
13837
|
-
this.applyVariantSelection(t)
|
|
13845
|
+
this.applyVariantSelection(t, void 0, a)
|
|
13838
13846
|
]);
|
|
13839
13847
|
}
|
|
13840
13848
|
async applyGlobalState(t) {
|
|
@@ -13845,9 +13853,9 @@ class Xn extends Ia {
|
|
|
13845
13853
|
const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
|
|
13846
13854
|
return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
|
|
13847
13855
|
}
|
|
13848
|
-
async applyVariantSelection(t, e) {
|
|
13849
|
-
const
|
|
13850
|
-
await Promise.all(
|
|
13856
|
+
async applyVariantSelection(t, e, a) {
|
|
13857
|
+
const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
|
|
13858
|
+
await Promise.all(i);
|
|
13851
13859
|
}
|
|
13852
13860
|
}
|
|
13853
13861
|
class Ja extends Xn {
|
|
@@ -13896,8 +13904,8 @@ class Ja extends Xn {
|
|
|
13896
13904
|
/**
|
|
13897
13905
|
* Sets a custom color on the global state.
|
|
13898
13906
|
*/
|
|
13899
|
-
setCustomColor(t) {
|
|
13900
|
-
this.getSharedSteps().forEach((
|
|
13907
|
+
setCustomColor(t, e) {
|
|
13908
|
+
this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
|
|
13901
13909
|
}
|
|
13902
13910
|
/**
|
|
13903
13911
|
* Gets the custom color used by the global state.
|
|
@@ -14859,10 +14867,12 @@ class Je {
|
|
|
14859
14867
|
async applyGlobalPropertyState(t) {
|
|
14860
14868
|
var a;
|
|
14861
14869
|
const e = await this.globalPropertyHandleService.getHandles();
|
|
14862
|
-
console.log(`LOG: ${e.length} handles`);
|
|
14863
14870
|
for (const n of t.aspects) {
|
|
14871
|
+
console.log(`LOG: unsetting init for ${this.workflowExperiences.length} experiences`);
|
|
14872
|
+
for (const o of this.workflowExperiences)
|
|
14873
|
+
o.getWorkflowManager().unsetInitialized();
|
|
14864
14874
|
const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
|
|
14865
|
-
if (
|
|
14875
|
+
if (s)
|
|
14866
14876
|
switch (n.type) {
|
|
14867
14877
|
case G.FileUpload: {
|
|
14868
14878
|
const o = s, l = await ve([n.value]);
|
|
@@ -14872,7 +14882,7 @@ class Je {
|
|
|
14872
14882
|
const d = Object.fromEntries(
|
|
14873
14883
|
c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
|
|
14874
14884
|
);
|
|
14875
|
-
await o.changeColors(d);
|
|
14885
|
+
await o.changeColors(d, !0);
|
|
14876
14886
|
}
|
|
14877
14887
|
break;
|
|
14878
14888
|
}
|
|
@@ -14882,16 +14892,16 @@ class Je {
|
|
|
14882
14892
|
const c = o.getAllVariants().find((d) => d.getId() === n.value);
|
|
14883
14893
|
c && await o.selectVariant(c);
|
|
14884
14894
|
} else
|
|
14885
|
-
o.setCustomColor(n.value);
|
|
14895
|
+
o.setCustomColor(n.value, !0);
|
|
14886
14896
|
break;
|
|
14887
14897
|
}
|
|
14888
14898
|
case G.Option: {
|
|
14889
14899
|
const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
|
|
14890
|
-
console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c);
|
|
14900
|
+
console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
|
|
14891
14901
|
break;
|
|
14892
14902
|
}
|
|
14893
14903
|
case G.Text: {
|
|
14894
|
-
console.log(`LOG: text ${n.value}`), await s.setText(n.value);
|
|
14904
|
+
console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
|
|
14895
14905
|
break;
|
|
14896
14906
|
}
|
|
14897
14907
|
}
|
|
@@ -14988,7 +14998,7 @@ class Je {
|
|
|
14988
14998
|
throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
14989
14999
|
const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
|
|
14990
15000
|
await b.getShadowGraphqlClient().mutate({
|
|
14991
|
-
mutation:
|
|
15001
|
+
mutation: Hs,
|
|
14992
15002
|
variables: {
|
|
14993
15003
|
id: this.id,
|
|
14994
15004
|
transactionId: a
|
|
@@ -15171,7 +15181,7 @@ class Je {
|
|
|
15171
15181
|
}
|
|
15172
15182
|
async getAllStakeholders() {
|
|
15173
15183
|
const t = await b.getShadowGraphqlClient().query({
|
|
15174
|
-
query:
|
|
15184
|
+
query: Ha,
|
|
15175
15185
|
errorPolicy: "all",
|
|
15176
15186
|
fetchPolicy: "no-cache",
|
|
15177
15187
|
variables: {
|
|
@@ -15188,7 +15198,7 @@ class Je {
|
|
|
15188
15198
|
}
|
|
15189
15199
|
async getCurrentStakeholder() {
|
|
15190
15200
|
const t = await b.getShadowGraphqlClient().query({
|
|
15191
|
-
query:
|
|
15201
|
+
query: Ha,
|
|
15192
15202
|
errorPolicy: "all",
|
|
15193
15203
|
fetchPolicy: "no-cache",
|
|
15194
15204
|
variables: {
|
|
@@ -15343,7 +15353,7 @@ class Je {
|
|
|
15343
15353
|
async updateBundle() {
|
|
15344
15354
|
var e;
|
|
15345
15355
|
if (!((e = (await b.getShadowGraphqlClient().mutate({
|
|
15346
|
-
mutation:
|
|
15356
|
+
mutation: qs,
|
|
15347
15357
|
variables: {
|
|
15348
15358
|
id: this.id,
|
|
15349
15359
|
name: this.name,
|
|
@@ -15843,7 +15853,7 @@ class Il {
|
|
|
15843
15853
|
));
|
|
15844
15854
|
}
|
|
15845
15855
|
}
|
|
15846
|
-
const
|
|
15856
|
+
const Ut = new Il(), Pl = async (r, t) => {
|
|
15847
15857
|
var n;
|
|
15848
15858
|
const e = await b.getShadowGraphqlClient().query({
|
|
15849
15859
|
query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
|
|
@@ -15862,8 +15872,8 @@ const Lt = new Il(), Pl = async (r, t) => {
|
|
|
15862
15872
|
return a.forEach((i) => {
|
|
15863
15873
|
i.steps.forEach((s) => {
|
|
15864
15874
|
var o, l, c;
|
|
15865
|
-
delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset &&
|
|
15866
|
-
d.asset &&
|
|
15875
|
+
delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
|
|
15876
|
+
d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
|
|
15867
15877
|
}), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
|
|
15868
15878
|
}), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
|
|
15869
15879
|
}), a;
|
|
@@ -15909,17 +15919,17 @@ class rd {
|
|
|
15909
15919
|
} catch (a) {
|
|
15910
15920
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15911
15921
|
}
|
|
15912
|
-
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.
|
|
15922
|
+
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.d1700123-3835-51b2-8677-b33ff1a4b7e2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15913
15923
|
}
|
|
15914
15924
|
configure(t) {
|
|
15915
|
-
mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId &&
|
|
15925
|
+
mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
15916
15926
|
}
|
|
15917
15927
|
/**
|
|
15918
15928
|
* @returns The asset manager allows for common operations related to assets
|
|
15919
15929
|
* and the Spiff Commerce platform.
|
|
15920
15930
|
*/
|
|
15921
15931
|
getAssetManager() {
|
|
15922
|
-
return
|
|
15932
|
+
return L;
|
|
15923
15933
|
}
|
|
15924
15934
|
getCurrencyCode() {
|
|
15925
15935
|
if (this.currencyCode === void 0)
|
|
@@ -16119,7 +16129,7 @@ class rd {
|
|
|
16119
16129
|
return !1;
|
|
16120
16130
|
const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
|
|
16121
16131
|
if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
|
|
16122
|
-
const l = await
|
|
16132
|
+
const l = await Ut.refreshTokens();
|
|
16123
16133
|
if (l != null && l.AuthenticationResult)
|
|
16124
16134
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
|
|
16125
16135
|
else
|
|
@@ -16144,14 +16154,14 @@ class rd {
|
|
|
16144
16154
|
variables: {
|
|
16145
16155
|
emailAddress: t
|
|
16146
16156
|
}
|
|
16147
|
-
}), await
|
|
16157
|
+
}), await Ut.generateCode(t);
|
|
16148
16158
|
}
|
|
16149
16159
|
/**
|
|
16150
16160
|
* Verify an email code to log in as a Spiff user.
|
|
16151
16161
|
* Always returns true if it doesn't throw.
|
|
16152
16162
|
*/
|
|
16153
16163
|
async verifyCode(t, e) {
|
|
16154
|
-
const a = (await this.getIntegration()).partner.id || "", n = await
|
|
16164
|
+
const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
|
|
16155
16165
|
if (n != null && n.AuthenticationResult) {
|
|
16156
16166
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16157
16167
|
const s = (await b.getShadowGraphqlClient().query({
|
|
@@ -16181,7 +16191,7 @@ class rd {
|
|
|
16181
16191
|
throw new Error("No token data in storage.");
|
|
16182
16192
|
const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
|
|
16183
16193
|
if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
|
|
16184
|
-
const s = await
|
|
16194
|
+
const s = await Ut.refreshTokens();
|
|
16185
16195
|
if (s != null && s.AuthenticationResult)
|
|
16186
16196
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
|
|
16187
16197
|
else
|
|
@@ -16252,7 +16262,7 @@ class rd {
|
|
|
16252
16262
|
...o,
|
|
16253
16263
|
...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
|
|
16254
16264
|
}, c = await b.getShadowGraphqlClient().query({
|
|
16255
|
-
query:
|
|
16265
|
+
query: Ls(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
|
|
16256
16266
|
variables: {
|
|
16257
16267
|
id: t
|
|
16258
16268
|
},
|
|
@@ -16351,7 +16361,7 @@ class rd {
|
|
|
16351
16361
|
if (!this.customer)
|
|
16352
16362
|
throw new Error("Customer not authenticated.");
|
|
16353
16363
|
const t = await b.getShadowGraphqlClient().query({
|
|
16354
|
-
query:
|
|
16364
|
+
query: Us,
|
|
16355
16365
|
variables: {
|
|
16356
16366
|
id: this.customer.id
|
|
16357
16367
|
},
|
|
@@ -16462,8 +16472,8 @@ class rd {
|
|
|
16462
16472
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16463
16473
|
stateMutationFunc: I ? async () => {
|
|
16464
16474
|
throw new z("State mutation is forbidden in read only mode!");
|
|
16465
|
-
} : async (
|
|
16466
|
-
...
|
|
16475
|
+
} : async (q) => this.updateTransactionState({
|
|
16476
|
+
...q,
|
|
16467
16477
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16468
16478
|
}),
|
|
16469
16479
|
graphQlClient: () => nt,
|
|
@@ -16472,11 +16482,11 @@ class rd {
|
|
|
16472
16482
|
isReloadedTransaction: k.type === "transaction"
|
|
16473
16483
|
};
|
|
16474
16484
|
if (k.type === "transaction" && E.workflowState) {
|
|
16475
|
-
const
|
|
16476
|
-
R.layouts = Object.values(
|
|
16485
|
+
const q = JSON.parse(E.workflowState);
|
|
16486
|
+
R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
|
|
16477
16487
|
} else if (!I && k.workflowState) {
|
|
16478
|
-
const
|
|
16479
|
-
R.layouts = Object.values(
|
|
16488
|
+
const q = JSON.parse(k.workflowState);
|
|
16489
|
+
R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
|
|
16480
16490
|
} else
|
|
16481
16491
|
R.layouts = Fl(
|
|
16482
16492
|
R.transaction,
|
|
@@ -17081,7 +17091,7 @@ class Ql extends it {
|
|
|
17081
17091
|
const e = await this.getOriginalImageSelection();
|
|
17082
17092
|
if (!e)
|
|
17083
17093
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
17084
|
-
const a = await
|
|
17094
|
+
const a = await L.removeBackgroundFromAsset(e);
|
|
17085
17095
|
t && await wt.selectImage(this.step, a, this.manager, !1);
|
|
17086
17096
|
const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
|
|
17087
17097
|
return this.manager.updateStorage(this.step.stepName, {
|
|
@@ -17140,13 +17150,13 @@ class Ql extends it {
|
|
|
17140
17150
|
var e, a;
|
|
17141
17151
|
const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
|
|
17142
17152
|
if (t)
|
|
17143
|
-
return
|
|
17153
|
+
return L.getLocalOrFromServer(t);
|
|
17144
17154
|
}
|
|
17145
17155
|
async getBackgroundRemovedImageSelection() {
|
|
17146
17156
|
var e, a;
|
|
17147
17157
|
const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
|
|
17148
17158
|
if (t)
|
|
17149
|
-
return
|
|
17159
|
+
return L.getLocalOrFromServer(t);
|
|
17150
17160
|
}
|
|
17151
17161
|
hasOriginalImageSelection() {
|
|
17152
17162
|
var t, e;
|
|
@@ -17243,7 +17253,7 @@ const Rl = v`
|
|
|
17243
17253
|
workflowViewerLink
|
|
17244
17254
|
}
|
|
17245
17255
|
}
|
|
17246
|
-
`,
|
|
17256
|
+
`, Ll = v`
|
|
17247
17257
|
query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
|
|
17248
17258
|
customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
|
|
17249
17259
|
items {
|
|
@@ -17258,7 +17268,7 @@ const Rl = v`
|
|
|
17258
17268
|
total
|
|
17259
17269
|
}
|
|
17260
17270
|
}
|
|
17261
|
-
`,
|
|
17271
|
+
`, Ul = v`
|
|
17262
17272
|
query GetTransactionsForBundle($id: String!) {
|
|
17263
17273
|
bundles(ids: [$id]) {
|
|
17264
17274
|
id
|
|
@@ -17342,7 +17352,7 @@ const Rl = v`
|
|
|
17342
17352
|
email: r
|
|
17343
17353
|
}
|
|
17344
17354
|
})).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
|
|
17345
|
-
query:
|
|
17355
|
+
query: Ll,
|
|
17346
17356
|
errorPolicy: "all",
|
|
17347
17357
|
fetchPolicy: "no-cache",
|
|
17348
17358
|
variables: {
|
|
@@ -17351,7 +17361,7 @@ const Rl = v`
|
|
|
17351
17361
|
limit: t
|
|
17352
17362
|
}
|
|
17353
17363
|
}), pd = async (r, t) => await b.getShadowGraphqlClient().query({
|
|
17354
|
-
query:
|
|
17364
|
+
query: Ul,
|
|
17355
17365
|
errorPolicy: "all",
|
|
17356
17366
|
fetchPolicy: "no-cache",
|
|
17357
17367
|
variables: {
|
|
@@ -17463,7 +17473,7 @@ _ = { __e: function(r, t, e, a) {
|
|
|
17463
17473
|
throw r;
|
|
17464
17474
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
17465
17475
|
var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
|
|
17466
|
-
function
|
|
17476
|
+
function ql() {
|
|
17467
17477
|
for (var r; r = ar.shift(); )
|
|
17468
17478
|
if (r.__P && r.__H)
|
|
17469
17479
|
try {
|
|
@@ -17483,7 +17493,7 @@ _.__b = function(r) {
|
|
|
17483
17493
|
}, _.diffed = function(r) {
|
|
17484
17494
|
tn && tn(r);
|
|
17485
17495
|
var t = r.__c;
|
|
17486
|
-
t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) ||
|
|
17496
|
+
t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || Hl)(ql)), t.__H.__.forEach(function(e) {
|
|
17487
17497
|
e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
|
|
17488
17498
|
})), Ke = ot = null;
|
|
17489
17499
|
}, _.__c = function(r, t) {
|
|
@@ -17510,7 +17520,7 @@ _.__b = function(r) {
|
|
|
17510
17520
|
}), e.__H = void 0, t && _.__e(t, e.__v));
|
|
17511
17521
|
};
|
|
17512
17522
|
var nn = typeof requestAnimationFrame == "function";
|
|
17513
|
-
function
|
|
17523
|
+
function Hl(r) {
|
|
17514
17524
|
var t, e = function() {
|
|
17515
17525
|
clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
|
|
17516
17526
|
}, a = setTimeout(e, 100);
|
|
@@ -17658,7 +17668,7 @@ export {
|
|
|
17658
17668
|
Ce as AssetType,
|
|
17659
17669
|
Jc as BringForwardCommand,
|
|
17660
17670
|
Yc as BringToBackCommand,
|
|
17661
|
-
|
|
17671
|
+
Hc as BringToFrontCommand,
|
|
17662
17672
|
yr as BundleDesignCreationCartAddMode,
|
|
17663
17673
|
O as CanvasCommand,
|
|
17664
17674
|
de as CollectionProduct,
|
|
@@ -17667,7 +17677,7 @@ export {
|
|
|
17667
17677
|
jl as ConversionDataType,
|
|
17668
17678
|
Wl as ConversionLocation,
|
|
17669
17679
|
W as CreateElementCommand,
|
|
17670
|
-
|
|
17680
|
+
Ln as CreateLayoutCommand,
|
|
17671
17681
|
Bt as DeleteElementCommand,
|
|
17672
17682
|
Eo as DigitalContentStepHandle,
|
|
17673
17683
|
el as FileUploadGlobalPropertyHandle,
|
|
@@ -17691,7 +17701,7 @@ export {
|
|
|
17691
17701
|
Gc as LayoutElementFactory,
|
|
17692
17702
|
M as LayoutElementType,
|
|
17693
17703
|
J as LayoutNotFoundError,
|
|
17694
|
-
|
|
17704
|
+
qt as LayoutRenderingPurpose,
|
|
17695
17705
|
po as MaterialStepHandle,
|
|
17696
17706
|
Se as MisconfigurationError,
|
|
17697
17707
|
cd as MockWorkflowManager,
|
|
@@ -17713,9 +17723,9 @@ export {
|
|
|
17713
17723
|
wo as QuestionStepHandle,
|
|
17714
17724
|
Dn as QueueablePromise,
|
|
17715
17725
|
jc as ResizeCommand,
|
|
17716
|
-
|
|
17726
|
+
Ht as ResourceNotFoundError,
|
|
17717
17727
|
Wc as RotateCommand,
|
|
17718
|
-
|
|
17728
|
+
H as ScaleAxis,
|
|
17719
17729
|
Kc as SendBackwardsCommand,
|
|
17720
17730
|
yo as ShapeStepHandle,
|
|
17721
17731
|
Sr as ShareActionType,
|
|
@@ -17733,13 +17743,13 @@ export {
|
|
|
17733
17743
|
Al as TransformCollection,
|
|
17734
17744
|
z as UnhandledBehaviorError,
|
|
17735
17745
|
Br as UnitOfMeasurement,
|
|
17736
|
-
|
|
17746
|
+
qc as UpdateImageSourceCommand,
|
|
17737
17747
|
st as Variant,
|
|
17738
17748
|
Ro as WorkflowExperienceEventType,
|
|
17739
17749
|
Oo as WorkflowExperienceImpl,
|
|
17740
|
-
|
|
17750
|
+
L as assetService,
|
|
17741
17751
|
Kr as browserColorToHex,
|
|
17742
|
-
|
|
17752
|
+
Uc as cmPerPixel,
|
|
17743
17753
|
Fo as createDesign,
|
|
17744
17754
|
Oc as currentDirection,
|
|
17745
17755
|
bc as dataUrlFromExternalUrl,
|
|
@@ -17751,7 +17761,7 @@ export {
|
|
|
17751
17761
|
hd as duplicateTransaction,
|
|
17752
17762
|
at as fetchAsString,
|
|
17753
17763
|
Fc as findAngle,
|
|
17754
|
-
|
|
17764
|
+
U as findElement,
|
|
17755
17765
|
Dc as findPmsColors,
|
|
17756
17766
|
Vt as frameDataCache,
|
|
17757
17767
|
wt as frameStepService,
|
|
@@ -17795,7 +17805,7 @@ export {
|
|
|
17795
17805
|
Pc as matchHexToPms,
|
|
17796
17806
|
Gn as materialStepService,
|
|
17797
17807
|
cl as metafieldManager,
|
|
17798
|
-
|
|
17808
|
+
Lc as mmPerPixel,
|
|
17799
17809
|
zn as modelStepService,
|
|
17800
17810
|
Ca as modifySVGColors,
|
|
17801
17811
|
Wn as moduleStepService,
|
|
@@ -17807,11 +17817,11 @@ export {
|
|
|
17807
17817
|
N as persistenceService,
|
|
17808
17818
|
jn as pictureStepService,
|
|
17809
17819
|
Ic as pmsToRgb,
|
|
17810
|
-
|
|
17820
|
+
qn as questionStepService,
|
|
17811
17821
|
Bc as registerFetchImplementation,
|
|
17812
17822
|
Ec as registerWindowImplementation,
|
|
17813
17823
|
Ga as rehydrateSerializedLayout,
|
|
17814
|
-
|
|
17824
|
+
Hr as rgbToPms,
|
|
17815
17825
|
le as rotateAroundPoint,
|
|
17816
17826
|
pa as sanitizeSvgTree,
|
|
17817
17827
|
$r as setBearerAuthenticationToken,
|