@spiffcommerce/core 32.2.7 → 32.3.0-beta.a29b838d-4b58-56cd-884c-4af2137bb2ba
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +63 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +449 -431
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -163,10 +163,10 @@ class Qr {
|
|
163
163
|
}
|
164
164
|
const gt = new Qr();
|
165
165
|
let ra, ia;
|
166
|
-
function
|
166
|
+
function zc(n) {
|
167
167
|
ra = n;
|
168
168
|
}
|
169
|
-
function
|
169
|
+
function Gc(n) {
|
170
170
|
ia = n;
|
171
171
|
}
|
172
172
|
function Zt() {
|
@@ -257,7 +257,7 @@ const gn = /* @__PURE__ */ new Map(), Ra = /* @__PURE__ */ new Map(), Oa = /* @_
|
|
257
257
|
}
|
258
258
|
const e = t();
|
259
259
|
return e || "image/svg+xml";
|
260
|
-
},
|
260
|
+
}, Wc = async (n) => {
|
261
261
|
const t = await pn(n), e = gn.get(n) || Qe(t);
|
262
262
|
return await zr(new Blob([t], { type: e }));
|
263
263
|
}, Lr = (n) => {
|
@@ -343,8 +343,8 @@ class Kr {
|
|
343
343
|
const f = window.__SENTRY__.hub;
|
344
344
|
if (f) {
|
345
345
|
const S = f.traceHeaders();
|
346
|
-
Object.entries(S).forEach(([
|
347
|
-
l[
|
346
|
+
Object.entries(S).forEach(([B, I]) => {
|
347
|
+
l[B] = I;
|
348
348
|
});
|
349
349
|
}
|
350
350
|
}
|
@@ -3155,7 +3155,7 @@ const _r = (n) => new Promise((t) => {
|
|
3155
3155
|
parseInt(n.substring(2, 4), 16),
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
3157
3157
|
]);
|
3158
|
-
function
|
3158
|
+
function qc(n) {
|
3159
3159
|
const t = Jt.indexOf(n);
|
3160
3160
|
return t >= 0 ? xt[t] : "";
|
3161
3161
|
}
|
@@ -3163,7 +3163,7 @@ function ei(n) {
|
|
3163
3163
|
const t = xt.indexOf(n);
|
3164
3164
|
return t >= 0 ? Jt[t] : "";
|
3165
3165
|
}
|
3166
|
-
function
|
3166
|
+
function Hc(n, t = 64) {
|
3167
3167
|
const e = [], a = [], r = ei(n);
|
3168
3168
|
r && e.push({
|
3169
3169
|
pms: r,
|
@@ -3182,7 +3182,7 @@ function qc(n, t = 64) {
|
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
3183
3183
|
}
|
3184
3184
|
const ai = Jt.map((n, t) => ({ pms: n, hex: xt[t] })), ni = new wr(ai, { keys: ["pms"] });
|
3185
|
-
function
|
3185
|
+
function jc(n, t) {
|
3186
3186
|
return ni.search(n, t ? { limit: t } : void 0);
|
3187
3187
|
}
|
3188
3188
|
let Qt = null;
|
@@ -5342,7 +5342,7 @@ const M = () => {
|
|
5342
5342
|
viewBox: A,
|
5343
5343
|
width: u
|
5344
5344
|
}) => {
|
5345
|
-
const h = e || 0, m = 2 * (l?.scale || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = M(), S = a.purpose === jt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: g.width, height: g.height, rx: h }) }) }),
|
5345
|
+
const h = e || 0, m = 2 * (l?.scale || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = M(), S = a.purpose === jt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: g.width, height: g.height, rx: h }) }) }), B = a.colorProfiles?.map((E, P) => (
|
5346
5346
|
/* @ts-ignore */
|
5347
5347
|
/* @__PURE__ */ D("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, P)
|
5348
5348
|
)), I = r.map((E) => ({
|
@@ -5369,7 +5369,7 @@ const M = () => {
|
|
5369
5369
|
},
|
5370
5370
|
viewBox: p,
|
5371
5371
|
children: [
|
5372
|
-
|
5372
|
+
B,
|
5373
5373
|
S,
|
5374
5374
|
!!n && /* @__PURE__ */ D(
|
5375
5375
|
"rect",
|
@@ -5427,33 +5427,33 @@ const M = () => {
|
|
5427
5427
|
]
|
5428
5428
|
}
|
5429
5429
|
);
|
5430
|
-
},
|
5431
|
-
const i = ft(r), s = e / 2, o = a / 2, l = n + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, S = u * d + m * A,
|
5430
|
+
}, Yc = (n, t, e, a, r) => {
|
5431
|
+
const i = ft(r), s = e / 2, o = a / 2, l = n + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, S = u * d + m * A, B = h * d + g * A, I = Math.max(Math.abs(p), Math.abs(f)), C = Math.max(Math.abs(S), Math.abs(B));
|
5432
5432
|
return {
|
5433
5433
|
minX: l - I,
|
5434
5434
|
maxX: l + I,
|
5435
5435
|
minY: c - C,
|
5436
5436
|
maxY: c + C
|
5437
5437
|
};
|
5438
|
-
},
|
5438
|
+
}, Jc = (n, t, e) => {
|
5439
5439
|
const a = Math.sqrt(Math.pow(t.x - n.x, 2) + Math.pow(t.y - n.y, 2)), r = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), i = Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2));
|
5440
5440
|
return Math.acos((r * r + a * a - i * i) / (2 * r * a)) * (180 / Math.PI);
|
5441
|
-
}, ft = (n) => n * (Math.PI / 180),
|
5441
|
+
}, ft = (n) => n * (Math.PI / 180), Kc = (n, t, e) => Math.abs(n - t) < e, _c = (n, t, e) => {
|
5442
5442
|
const a = Math.sin(ft(e)), r = Math.cos(ft(e));
|
5443
5443
|
return {
|
5444
5444
|
x: (n.x - t.x) * r - (n.y - t.y) * a + t.x,
|
5445
5445
|
y: (n.x - t.x) * a + (n.y - t.y) * r + t.y
|
5446
5446
|
};
|
5447
|
-
},
|
5447
|
+
}, Xc = (n, t) => ({
|
5448
5448
|
x: (n.x + t.x) / 2,
|
5449
5449
|
y: (n.y + t.y) / 2
|
5450
|
-
}),
|
5450
|
+
}), Zc = (n, t, e, a) => ({
|
5451
5451
|
x: n.x + t?.x * e,
|
5452
5452
|
y: n.y + t?.y * a
|
5453
|
-
}),
|
5453
|
+
}), td = (n, t, e, a) => ({
|
5454
5454
|
x: n.x + (t?.x + t?.width) * e,
|
5455
5455
|
y: n.y + t?.y * a
|
5456
|
-
}),
|
5456
|
+
}), ed = (n, t, e, a) => ({
|
5457
5457
|
x: n.x + (t?.x + t?.width) * e,
|
5458
5458
|
y: n.y + (t?.y + t?.height) * a
|
5459
5459
|
}), Pt = (n) => {
|
@@ -5475,7 +5475,7 @@ const M = () => {
|
|
5475
5475
|
case H.Southwest:
|
5476
5476
|
return H.Northwest;
|
5477
5477
|
}
|
5478
|
-
},
|
5478
|
+
}, ad = (n, t) => t > 45 && t <= 135 ? Pt(n) : t > 135 && t <= 225 ? Pt(Pt(n)) : t > 225 && t <= 315 ? Pt(Pt(Pt(n))) : n, nd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
5479
5479
|
const a = ft(n.rotation), r = {
|
5480
5480
|
x: t.x + n.x * e.x,
|
5481
5481
|
y: t.x + n.y * e.y
|
@@ -5505,7 +5505,7 @@ const M = () => {
|
|
5505
5505
|
x: (n.x - t.x) * r - (n.y - t.y) * a + t.x,
|
5506
5506
|
y: (n.x - t.x) * a + (n.y - t.y) * r + t.y
|
5507
5507
|
};
|
5508
|
-
},
|
5508
|
+
}, rd = 0.352778, id = 0.035277, Nn = (n) => {
|
5509
5509
|
const t = n.rotation || 0, e = ft(t), a = Math.cos(e), r = -Math.sin(e);
|
5510
5510
|
return /* @__PURE__ */ D("g", { mask: n.stepName || n.productOverlay ? void 0 : n.mask, children: /* @__PURE__ */ D(
|
5511
5511
|
"g",
|
@@ -5727,7 +5727,7 @@ const as = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5727
5727
|
}, la = (n, t) => {
|
5728
5728
|
const e = new es(t);
|
5729
5729
|
return Rn.set(n, e), e;
|
5730
|
-
},
|
5730
|
+
}, sd = async (n) => {
|
5731
5731
|
const t = dt(), e = t.parseFromString(n, "image/svg+xml"), a = e.firstElementChild, r = /* @__PURE__ */ new Map();
|
5732
5732
|
a.querySelectorAll("style").forEach((d) => {
|
5733
5733
|
dn(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
@@ -5741,12 +5741,12 @@ const as = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5741
5741
|
});
|
5742
5742
|
const s = e.querySelectorAll("tspan");
|
5743
5743
|
for (let d = 0; d < s.length; d++) {
|
5744
|
-
const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Nt(r.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"),
|
5744
|
+
const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Nt(r.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), B = g.getPath(
|
5745
5745
|
A.innerHTML,
|
5746
5746
|
0,
|
5747
5747
|
0,
|
5748
5748
|
parseInt(u.getAttribute("font-size") ?? "72")
|
5749
|
-
), I =
|
5749
|
+
), I = B.getBoundingBox().x2 - B.getBoundingBox().x1;
|
5750
5750
|
let C = 0;
|
5751
5751
|
const E = A.getAttribute("text-anchor");
|
5752
5752
|
E === "middle" ? C = I / 2 : E === "end" && (C = I);
|
@@ -5757,7 +5757,7 @@ const as = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5757
5757
|
parseInt(u.getAttribute("font-size") ?? "72")
|
5758
5758
|
);
|
5759
5759
|
P.fill = p, P.stroke = f, P.strokeWidth = parseFloat(S ?? "0");
|
5760
|
-
const
|
5760
|
+
const b = P.toSVG(2), Q = t.parseFromString(b, "image/svg+xml").firstElementChild;
|
5761
5761
|
h.appendChild(Q);
|
5762
5762
|
}
|
5763
5763
|
return e.querySelectorAll("text").forEach((d) => d.remove()), It().serializeToString(a);
|
@@ -6380,7 +6380,7 @@ const ne = (n) => {
|
|
6380
6380
|
}
|
6381
6381
|
return o;
|
6382
6382
|
};
|
6383
|
-
class
|
6383
|
+
class od {
|
6384
6384
|
static async getFrame(t, e) {
|
6385
6385
|
const a = await zn(e.region, e.src), r = await Ue(a), i = e.region || await Ut(t, x.Frame);
|
6386
6386
|
return {
|
@@ -6623,7 +6623,7 @@ class Ha extends N {
|
|
6623
6623
|
};
|
6624
6624
|
}
|
6625
6625
|
}
|
6626
|
-
class
|
6626
|
+
class ld extends N {
|
6627
6627
|
constructor(t, e, a) {
|
6628
6628
|
super(), this.id = t, this.x = e, this.y = a;
|
6629
6629
|
}
|
@@ -6646,7 +6646,7 @@ class od extends N {
|
|
6646
6646
|
};
|
6647
6647
|
}
|
6648
6648
|
}
|
6649
|
-
class
|
6649
|
+
class cd extends N {
|
6650
6650
|
constructor(t, e) {
|
6651
6651
|
super(), this.id = t, this.angle = e;
|
6652
6652
|
}
|
@@ -6668,7 +6668,7 @@ class ld extends N {
|
|
6668
6668
|
};
|
6669
6669
|
}
|
6670
6670
|
}
|
6671
|
-
class
|
6671
|
+
class dd extends N {
|
6672
6672
|
constructor(t, e, a) {
|
6673
6673
|
super(), this.id = t, this.width = Math.abs(e), this.height = Math.abs(a);
|
6674
6674
|
}
|
@@ -6979,7 +6979,7 @@ class ys extends N {
|
|
6979
6979
|
};
|
6980
6980
|
}
|
6981
6981
|
}
|
6982
|
-
class
|
6982
|
+
class Ad extends N {
|
6983
6983
|
constructor(t, e) {
|
6984
6984
|
super(), this.id = t, this.src = e;
|
6985
6985
|
}
|
@@ -7098,7 +7098,7 @@ class vs extends N {
|
|
7098
7098
|
};
|
7099
7099
|
}
|
7100
7100
|
}
|
7101
|
-
class
|
7101
|
+
class ud extends N {
|
7102
7102
|
/**
|
7103
7103
|
* @param id The targeted element to bring to the front.
|
7104
7104
|
*/
|
@@ -7127,7 +7127,7 @@ class Ad extends N {
|
|
7127
7127
|
};
|
7128
7128
|
}
|
7129
7129
|
}
|
7130
|
-
class
|
7130
|
+
class hd extends N {
|
7131
7131
|
/**
|
7132
7132
|
* @param id The targeted element to bring to the back.
|
7133
7133
|
*/
|
@@ -7158,7 +7158,7 @@ class ud extends N {
|
|
7158
7158
|
};
|
7159
7159
|
}
|
7160
7160
|
}
|
7161
|
-
class
|
7161
|
+
class md extends N {
|
7162
7162
|
/**
|
7163
7163
|
* @param id The targeted element to bring to the front.
|
7164
7164
|
*/
|
@@ -7185,7 +7185,7 @@ class hd extends N {
|
|
7185
7185
|
};
|
7186
7186
|
}
|
7187
7187
|
}
|
7188
|
-
class
|
7188
|
+
class gd extends N {
|
7189
7189
|
/**
|
7190
7190
|
* @param id The targeted element to bring to the front.
|
7191
7191
|
*/
|
@@ -7717,7 +7717,7 @@ class Fe {
|
|
7717
7717
|
g,
|
7718
7718
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
7719
7719
|
t.data.forceImageCover
|
7720
|
-
) : void 0,
|
7720
|
+
) : void 0, B = p ? {
|
7721
7721
|
id: M(),
|
7722
7722
|
src: p.src,
|
7723
7723
|
x: S?.x || 0,
|
@@ -7733,7 +7733,7 @@ class Fe {
|
|
7733
7733
|
return {
|
7734
7734
|
command: this.getCreateElementCommand(I, h, E, {
|
7735
7735
|
frameData: g,
|
7736
|
-
pattern:
|
7736
|
+
pattern: B,
|
7737
7737
|
disablePlaceholder: t.data.disablePlaceholder,
|
7738
7738
|
stepName: t.stepName
|
7739
7739
|
}),
|
@@ -7972,10 +7972,10 @@ class Bs {
|
|
7972
7972
|
const S = i.getLayouts().find((I) => I.panelId === f.panelId);
|
7973
7973
|
if (!S)
|
7974
7974
|
throw new Y(f);
|
7975
|
-
const
|
7975
|
+
const B = M();
|
7976
7976
|
return {
|
7977
|
-
regionElement: { id:
|
7978
|
-
command: this.getCreateElementCommand(
|
7977
|
+
regionElement: { id: B, region: f },
|
7978
|
+
command: this.getCreateElementCommand(B, f, S, {
|
7979
7979
|
stepName: t.stepName,
|
7980
7980
|
src: l,
|
7981
7981
|
objectURL: d,
|
@@ -8013,9 +8013,9 @@ class Bs {
|
|
8013
8013
|
);
|
8014
8014
|
}
|
8015
8015
|
if (t.data.colorPickerEnabled) {
|
8016
|
-
const S = await this.availableColors(t, i) || [],
|
8016
|
+
const S = await this.availableColors(t, i) || [], B = Object.keys(c.colors), I = S.length === 1 && B.length === 1;
|
8017
8017
|
if (I) {
|
8018
|
-
const C = S[0], E =
|
8018
|
+
const C = S[0], E = B[0];
|
8019
8019
|
await this.changeColors(
|
8020
8020
|
t,
|
8021
8021
|
u.map((P) => P.regionElement),
|
@@ -8654,11 +8654,11 @@ const Ts = new Ms(), Ke = (n, t, e, a, r) => {
|
|
8654
8654
|
const A = Math.max(...o);
|
8655
8655
|
if (A <= n.width)
|
8656
8656
|
return [i, A];
|
8657
|
-
const u = o.reduce((p, f, S,
|
8657
|
+
const u = o.reduce((p, f, S, B) => f > B[p] ? S : p, 0), h = i[u];
|
8658
8658
|
let m = !1, g = h.length;
|
8659
8659
|
for (; !m && g > -1; ) {
|
8660
8660
|
g = h.lastIndexOf(" ", g - 1);
|
8661
|
-
const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((
|
8661
|
+
const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((B) => mt(B, a, r));
|
8662
8662
|
f[0] <= n.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
|
8663
8663
|
...o.slice(0, u),
|
8664
8664
|
...f,
|
@@ -8978,11 +8978,11 @@ class Qs {
|
|
8978
8978
|
const g = e.getWorkflowExperience().getBundle();
|
8979
8979
|
if (g && t.globalPropertyAspectConfigurations) {
|
8980
8980
|
const f = g.getGlobalPropertyConfiguration()?.aspects?.find(
|
8981
|
-
(S) => S.type === U.Text && t.globalPropertyAspectConfigurations?.map((
|
8981
|
+
(S) => S.type === U.Text && t.globalPropertyAspectConfigurations?.map((B) => B.aspectName).includes(S.name)
|
8982
8982
|
);
|
8983
8983
|
if (f) {
|
8984
|
-
const
|
8985
|
-
|
8984
|
+
const B = g.getGlobalPropertyStateManager().getAspect(f.name);
|
8985
|
+
B && (m = B);
|
8986
8986
|
}
|
8987
8987
|
}
|
8988
8988
|
if (await e.setSelectionsAndElements(
|
@@ -9185,11 +9185,11 @@ class Qs {
|
|
9185
9185
|
colorProfileAssetKey: p.colorProfile?.key
|
9186
9186
|
});
|
9187
9187
|
}
|
9188
|
-
const S = await this.getDefaultColor(a),
|
9188
|
+
const S = await this.getDefaultColor(a), B = S || "#000000", I = {
|
9189
9189
|
stepRegion: u,
|
9190
9190
|
stepName: t,
|
9191
9191
|
align: this.textAlign(a),
|
9192
|
-
fill: i.color ? i.color :
|
9192
|
+
fill: i.color ? i.color : B,
|
9193
9193
|
fontSize: a.size || _e,
|
9194
9194
|
fontData: r,
|
9195
9195
|
id: g,
|
@@ -9211,7 +9211,7 @@ class Qs {
|
|
9211
9211
|
fillSpotColorDefinition: f
|
9212
9212
|
}, C = [], E = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
|
9213
9213
|
if (!I.fontData) throw new V("Failed to resolve font data for text.");
|
9214
|
-
const [
|
9214
|
+
const [b, F] = Ce(
|
9215
9215
|
I.fontSize,
|
9216
9216
|
I.fontData,
|
9217
9217
|
{
|
@@ -9225,11 +9225,11 @@ class Qs {
|
|
9225
9225
|
[c],
|
9226
9226
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
9227
9227
|
);
|
9228
|
-
E.set(I.id,
|
9228
|
+
E.set(I.id, b), P.set(I.id, F);
|
9229
9229
|
const Q = a.curved || a.vertical ? c : (F || []).join(`
|
9230
9230
|
`);
|
9231
9231
|
C.push(
|
9232
|
-
this.generateTextChangeCommandsForRegion(
|
9232
|
+
this.generateTextChangeCommandsForRegion(b, a, I.id, Q)
|
9233
9233
|
);
|
9234
9234
|
const T = new z(I, m);
|
9235
9235
|
return {
|
@@ -9286,13 +9286,13 @@ class Qs {
|
|
9286
9286
|
return d && d(!0), { info: "0" };
|
9287
9287
|
const C = s.getProfanities(), E = na(h.toLowerCase());
|
9288
9288
|
for (const P of E)
|
9289
|
-
for (const
|
9290
|
-
const F = C[
|
9289
|
+
for (const b in C) {
|
9290
|
+
const F = C[b].toLowerCase().replace(/\s/g, "");
|
9291
9291
|
if (P === F)
|
9292
9292
|
return l(!0), { error: "Blocked profanity." };
|
9293
9293
|
}
|
9294
9294
|
return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
|
9295
|
-
`) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((
|
9295
|
+
`) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((b) => b) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
|
9296
9296
|
})();
|
9297
9297
|
if (S.error) {
|
9298
9298
|
c(S.error);
|
@@ -9303,11 +9303,11 @@ class Qs {
|
|
9303
9303
|
s.updateStorage(t.stepName, { text: A }), s.updateMetadata(t.stepName, {
|
9304
9304
|
text: this.injectReplaceableText(A, t.data)
|
9305
9305
|
}), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
|
9306
|
-
const
|
9306
|
+
const B = [];
|
9307
9307
|
for (const C of m) {
|
9308
9308
|
const E = t.data.curved ? h : (p.get(C.id) || []).join(`
|
9309
9309
|
`);
|
9310
|
-
|
9310
|
+
B.push(
|
9311
9311
|
this.generateTextChangeCommandsForRegion(
|
9312
9312
|
g.get(C.id) || 1,
|
9313
9313
|
t.data,
|
@@ -9316,7 +9316,7 @@ class Qs {
|
|
9316
9316
|
)
|
9317
9317
|
);
|
9318
9318
|
}
|
9319
|
-
return new R(
|
9319
|
+
return new R(B);
|
9320
9320
|
}
|
9321
9321
|
}
|
9322
9322
|
const G = new Qs();
|
@@ -9475,21 +9475,21 @@ class Ws extends Rs {
|
|
9475
9475
|
return this.svgElement(t, e);
|
9476
9476
|
}
|
9477
9477
|
svgElement(t, e) {
|
9478
|
-
const a = ns(Os), i = t !== "" ? ((
|
9479
|
-
const
|
9480
|
-
|
9478
|
+
const a = ns(Os), i = t !== "" ? ((B) => B.charAt(0).toUpperCase() + B.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 = () => {
|
9479
|
+
const B = at("g");
|
9480
|
+
B.classList.add("module-text-group");
|
9481
9481
|
const I = at("defs");
|
9482
|
-
|
9482
|
+
B.appendChild(I), I.appendChild(Us(0, 2, 2, "shadow"));
|
9483
9483
|
const C = at("path");
|
9484
9484
|
C.setAttribute("d", d), C.setAttribute("stroke", "black"), C.setAttribute("stroke-width", "3"), I.appendChild(C);
|
9485
9485
|
const E = at("g");
|
9486
|
-
E.classList.add("module-layer0"),
|
9486
|
+
E.classList.add("module-layer0"), B.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = C.outerHTML;
|
9487
9487
|
const P = at("g");
|
9488
|
-
P.classList.add("module-layer1"),
|
9489
|
-
const
|
9490
|
-
|
9488
|
+
P.classList.add("module-layer1"), B.appendChild(P), P.setAttribute("stroke-width", "3"), P.setAttribute("stroke", "rgb(45,41,38)"), P.setAttribute("fill", "rgb(45,41,38)"), P.setAttribute("transform", "translate(0.5,0)"), P.innerHTML = o;
|
9489
|
+
const b = at("g");
|
9490
|
+
b.classList.add("module-layer2"), B.appendChild(b), b.setAttribute("fill", "rgb(255,209,0)"), b.setAttribute("transform", "translate(1,-0.1)"), b.innerHTML = o;
|
9491
9491
|
const F = at("g");
|
9492
|
-
return F.classList.add("module-layer3"),
|
9492
|
+
return F.classList.add("module-layer3"), B.appendChild(F), F.setAttribute("fill", "white"), F.innerHTML = o, new Gs(B).transform(([T, tt]) => [T, tt + (c / 2 - T) ** 2 / (c * 6)]), B;
|
9493
9493
|
}, u = at("g");
|
9494
9494
|
u.classList.add("module-root");
|
9495
9495
|
const h = at("defs");
|
@@ -9563,7 +9563,7 @@ const re = w`
|
|
9563
9563
|
}
|
9564
9564
|
}
|
9565
9565
|
}
|
9566
|
-
`,
|
9566
|
+
`, pd = async (n) => (await y.getShadowGraphqlClient().query({
|
9567
9567
|
query: js,
|
9568
9568
|
fetchPolicy: "cache-first",
|
9569
9569
|
errorPolicy: "all",
|
@@ -10227,9 +10227,13 @@ const re = w`
|
|
10227
10227
|
id
|
10228
10228
|
}
|
10229
10229
|
}
|
10230
|
+
`, Eo = w`
|
10231
|
+
mutation DeleteBundle($id: String!) {
|
10232
|
+
bundleDelete(id: $id)
|
10233
|
+
}
|
10230
10234
|
`;
|
10231
10235
|
var Le = /* @__PURE__ */ ((n) => (n.Error = "Error", n.Warning = "Warning", n.Info = "Info", n))(Le || {});
|
10232
|
-
const
|
10236
|
+
const bo = 1e3;
|
10233
10237
|
class _a extends Mn {
|
10234
10238
|
constructor(t) {
|
10235
10239
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
@@ -10238,24 +10242,24 @@ class _a extends Mn {
|
|
10238
10242
|
await this.update(), await new Promise((t) => {
|
10239
10243
|
window.setTimeout(() => {
|
10240
10244
|
t();
|
10241
|
-
},
|
10245
|
+
}, bo);
|
10242
10246
|
});
|
10243
10247
|
}
|
10244
10248
|
}
|
10245
|
-
class
|
10249
|
+
class Bo {
|
10246
10250
|
constructor(t, e, a, r, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, S = !1) {
|
10247
10251
|
this.workflowStatePromiseQueue = new Tn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
10248
10252
|
if (!this.previewService) return;
|
10249
|
-
const
|
10253
|
+
const B = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
|
10250
10254
|
if (I)
|
10251
10255
|
for (const [, C] of I)
|
10252
|
-
C.render(
|
10253
|
-
}, 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 = r, 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, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((
|
10254
|
-
this.stepTags[
|
10256
|
+
C.render(B);
|
10257
|
+
}, 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 = r, 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, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((B) => {
|
10258
|
+
this.stepTags[B.stepName] = B.tags ?? [];
|
10255
10259
|
}), S && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
|
10256
10260
|
this.initialized = !0;
|
10257
|
-
}), this.initializationPromise.catch((
|
10258
|
-
throw console.error(
|
10261
|
+
}), this.initializationPromise.catch((B) => {
|
10262
|
+
throw console.error(B), this.initialized = !1, new Error("Workflow initialization failed due to an error. See console.");
|
10259
10263
|
}), this.initializationPromise.finally(
|
10260
10264
|
() => this.getCommandContext().registerStateCallback(() => {
|
10261
10265
|
this.updateStateWithServer(), this.renderLayouts();
|
@@ -10853,7 +10857,7 @@ class bo {
|
|
10853
10857
|
this.stepSelections = {
|
10854
10858
|
...this.stepSelections,
|
10855
10859
|
[t]: { selectedVariants: e }
|
10856
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((C, E) => C + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P,
|
10860
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((C, E) => C + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, b) => P + b, 0), 0), this.workflow.steps.forEach((C) => {
|
10857
10861
|
vt(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1, delete this.stepMetadata[C.stepName], delete this.stepSelections[C.stepName], delete this.storage[C.stepName]);
|
10858
10862
|
});
|
10859
10863
|
const s = this.allScenes, o = yt(s, i), l = yt(s, this.stepSelections), c = o.map((C) => C.silentSteps).flat(), A = l.map((C) => C.silentSteps).flat().filter(
|
@@ -10872,9 +10876,9 @@ class bo {
|
|
10872
10876
|
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10873
10877
|
const p = u.map((C) => new Bt(C.id)), f = new Ha(this.constructSerializableWorkflow()), S = [...m, ...p, f];
|
10874
10878
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10875
|
-
const
|
10879
|
+
const B = this.getInvalidModelVariants(), I = this.modelContainer;
|
10876
10880
|
if (I) {
|
10877
|
-
const C =
|
10881
|
+
const C = B.map(
|
10878
10882
|
(E) => I.applyModelVariant(
|
10879
10883
|
E,
|
10880
10884
|
{
|
@@ -11208,7 +11212,7 @@ const Ht = class Ht {
|
|
11208
11212
|
};
|
11209
11213
|
Ht.updateState = /* @__PURE__ */ new Map();
|
11210
11214
|
let Z = Ht;
|
11211
|
-
class
|
11215
|
+
class Io extends Z {
|
11212
11216
|
constructor(t, e, a) {
|
11213
11217
|
super(t, e, a);
|
11214
11218
|
}
|
@@ -11282,7 +11286,7 @@ class Bo extends Z {
|
|
11282
11286
|
return this.step.data.pmsPickerEnabled ?? !1;
|
11283
11287
|
}
|
11284
11288
|
}
|
11285
|
-
class
|
11289
|
+
class Po extends Z {
|
11286
11290
|
constructor(t, e, a) {
|
11287
11291
|
super(t, e, a);
|
11288
11292
|
}
|
@@ -11295,7 +11299,7 @@ class Io extends Z {
|
|
11295
11299
|
);
|
11296
11300
|
}
|
11297
11301
|
}
|
11298
|
-
class
|
11302
|
+
class Do extends Z {
|
11299
11303
|
constructor(t, e, a) {
|
11300
11304
|
super(t, e, a);
|
11301
11305
|
}
|
@@ -11308,7 +11312,7 @@ class Po extends Z {
|
|
11308
11312
|
);
|
11309
11313
|
}
|
11310
11314
|
}
|
11311
|
-
class
|
11315
|
+
class Fo extends Z {
|
11312
11316
|
constructor(t, e, a) {
|
11313
11317
|
super(t, e, a);
|
11314
11318
|
}
|
@@ -11326,7 +11330,7 @@ class Do extends Z {
|
|
11326
11330
|
);
|
11327
11331
|
}
|
11328
11332
|
}
|
11329
|
-
class
|
11333
|
+
class xo extends Z {
|
11330
11334
|
constructor(t, e, a) {
|
11331
11335
|
super(t, e, a);
|
11332
11336
|
}
|
@@ -11342,7 +11346,7 @@ class Fo extends Z {
|
|
11342
11346
|
return this.step.data.displayType || this.step.option?.displayType;
|
11343
11347
|
}
|
11344
11348
|
}
|
11345
|
-
class
|
11349
|
+
class ko extends Z {
|
11346
11350
|
constructor(t, e, a) {
|
11347
11351
|
super(t, e, a);
|
11348
11352
|
}
|
@@ -11401,7 +11405,7 @@ class xo extends Z {
|
|
11401
11405
|
return t;
|
11402
11406
|
}
|
11403
11407
|
}
|
11404
|
-
class
|
11408
|
+
class Mo extends Z {
|
11405
11409
|
constructor(t, e, a) {
|
11406
11410
|
super(t, e, a);
|
11407
11411
|
}
|
@@ -11594,7 +11598,7 @@ class ko extends Z {
|
|
11594
11598
|
await G.changeStrokeColor(this.step, t, e, this.manager);
|
11595
11599
|
}
|
11596
11600
|
}
|
11597
|
-
class
|
11601
|
+
class To extends Z {
|
11598
11602
|
constructor(t, e, a) {
|
11599
11603
|
super(t, e, a);
|
11600
11604
|
}
|
@@ -11607,7 +11611,7 @@ class Mo extends Z {
|
|
11607
11611
|
return this.step.data.content;
|
11608
11612
|
}
|
11609
11613
|
}
|
11610
|
-
class
|
11614
|
+
class No extends Z {
|
11611
11615
|
constructor(t, e, a) {
|
11612
11616
|
super(t, e, a);
|
11613
11617
|
}
|
@@ -11633,7 +11637,7 @@ class To extends Z {
|
|
11633
11637
|
);
|
11634
11638
|
}
|
11635
11639
|
}
|
11636
|
-
class
|
11640
|
+
class Qo extends Z {
|
11637
11641
|
constructor(t, e, a) {
|
11638
11642
|
super(t, e, a);
|
11639
11643
|
}
|
@@ -11684,27 +11688,27 @@ class de {
|
|
11684
11688
|
static get(t, e) {
|
11685
11689
|
switch (e.type) {
|
11686
11690
|
case v.DigitalContent:
|
11687
|
-
return new
|
11691
|
+
return new No(t, e, t.getStepTags(e.stepName));
|
11688
11692
|
case v.Information:
|
11689
|
-
return new
|
11693
|
+
return new To(t, e, t.getStepTags(e.stepName));
|
11690
11694
|
case v.Question:
|
11691
|
-
return new
|
11695
|
+
return new xo(t, e, t.getStepTags(e.stepName));
|
11692
11696
|
case v.Text:
|
11693
|
-
return new
|
11697
|
+
return new Mo(t, e, t.getStepTags(e.stepName));
|
11694
11698
|
case v.Illustration:
|
11695
|
-
return new
|
11699
|
+
return new Io(t, e, t.getStepTags(e.stepName));
|
11696
11700
|
case v.Picture:
|
11697
|
-
return new
|
11701
|
+
return new Fo(t, e, t.getStepTags(e.stepName));
|
11698
11702
|
case v.Shape:
|
11699
|
-
return new
|
11703
|
+
return new ko(t, e, t.getStepTags(e.stepName));
|
11700
11704
|
case v.Material:
|
11701
|
-
return new Io(t, e, t.getStepTags(e.stepName));
|
11702
|
-
case v.Model:
|
11703
11705
|
return new Po(t, e, t.getStepTags(e.stepName));
|
11706
|
+
case v.Model:
|
11707
|
+
return new Do(t, e, t.getStepTags(e.stepName));
|
11704
11708
|
case v.Frame:
|
11705
|
-
return new
|
11709
|
+
return new Xl(t, e, t.getStepTags(e.stepName));
|
11706
11710
|
case v.Module:
|
11707
|
-
return new
|
11711
|
+
return new Qo(t, e, t.getStepTags(e.stepName));
|
11708
11712
|
default:
|
11709
11713
|
throw new V(`Step type ${e.type} not yet supported in Core SDK`);
|
11710
11714
|
}
|
@@ -11735,7 +11739,7 @@ const tr = w`
|
|
11735
11739
|
externalProductVariantId
|
11736
11740
|
}
|
11737
11741
|
}
|
11738
|
-
`,
|
11742
|
+
`, Ro = w`
|
11739
11743
|
${tr}
|
11740
11744
|
mutation CreateDesign(
|
11741
11745
|
$name: String!
|
@@ -11767,7 +11771,7 @@ const tr = w`
|
|
11767
11771
|
}
|
11768
11772
|
}
|
11769
11773
|
}
|
11770
|
-
`,
|
11774
|
+
`, Oo = w`
|
11771
11775
|
${tr}
|
11772
11776
|
mutation CreateDesigns($inputs: [DesignCreateInput]!) {
|
11773
11777
|
designCreateMany(inputs: $inputs) {
|
@@ -11786,7 +11790,7 @@ function Wt(n) {
|
|
11786
11790
|
const t = JSON.parse(atob(n.split(".")[1])).exp;
|
11787
11791
|
return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) >= t;
|
11788
11792
|
}
|
11789
|
-
const
|
11793
|
+
const $o = async (n, t) => {
|
11790
11794
|
const e = {};
|
11791
11795
|
try {
|
11792
11796
|
if (!t) throw new Error();
|
@@ -11795,7 +11799,7 @@ const Oo = async (n, t) => {
|
|
11795
11799
|
o && !Wt(o) && (e.Authorization = `Bearer ${o}`);
|
11796
11800
|
}
|
11797
11801
|
return (await y.getShadowGraphqlClient().mutate({
|
11798
|
-
mutation:
|
11802
|
+
mutation: Ro,
|
11799
11803
|
errorPolicy: "all",
|
11800
11804
|
fetchPolicy: "no-cache",
|
11801
11805
|
variables: {
|
@@ -11812,7 +11816,7 @@ const Oo = async (n, t) => {
|
|
11812
11816
|
headers: e
|
11813
11817
|
}
|
11814
11818
|
})).data?.designCreate;
|
11815
|
-
},
|
11819
|
+
}, Uo = async (n, t) => {
|
11816
11820
|
const e = {};
|
11817
11821
|
try {
|
11818
11822
|
if (!t) throw new Error();
|
@@ -11821,7 +11825,7 @@ const Oo = async (n, t) => {
|
|
11821
11825
|
o && !Wt(o) && (e.Authorization = `Bearer ${o}`);
|
11822
11826
|
}
|
11823
11827
|
return (await y.getShadowGraphqlClient().mutate({
|
11824
|
-
mutation:
|
11828
|
+
mutation: Oo,
|
11825
11829
|
errorPolicy: "all",
|
11826
11830
|
fetchPolicy: "no-cache",
|
11827
11831
|
variables: {
|
@@ -11876,7 +11880,7 @@ const Oo = async (n, t) => {
|
|
11876
11880
|
return t.steps.forEach((i) => {
|
11877
11881
|
Object.assign(r, a(i));
|
11878
11882
|
}), r;
|
11879
|
-
},
|
11883
|
+
}, Lo = (n, t, e, a) => {
|
11880
11884
|
const r = {};
|
11881
11885
|
let i = {};
|
11882
11886
|
a && (i = a);
|
@@ -11897,7 +11901,7 @@ const Oo = async (n, t) => {
|
|
11897
11901
|
}
|
11898
11902
|
return r;
|
11899
11903
|
}, er = (n, t, e, a, r, i, s, o) => {
|
11900
|
-
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d =
|
11904
|
+
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = Lo(a, e, void 0, i), u = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), h = {
|
11901
11905
|
additionalExternalProductId: n.integrationProduct?.additionalExternalProductId,
|
11902
11906
|
additionalExternalVariantId: n.integrationProduct?.additionalExternalVariantId,
|
11903
11907
|
baseCost: l,
|
@@ -11936,7 +11940,7 @@ const Oo = async (n, t) => {
|
|
11936
11940
|
T.errors && console.log("Server Error:", et.message);
|
11937
11941
|
}), null) : tt ?? null;
|
11938
11942
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await n.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
11939
|
-
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && Xa(l, t, !0), p = l && Xa(l, t, !1), f = async (
|
11943
|
+
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && Xa(l, t, !0), p = l && Xa(l, t, !1), f = async (b) => {
|
11940
11944
|
const F = {};
|
11941
11945
|
let Q = 0;
|
11942
11946
|
if (Object.keys(i).length > 0)
|
@@ -11944,7 +11948,7 @@ const Oo = async (n, t) => {
|
|
11944
11948
|
const tt = i[T], et = t.steps.find((W) => W.stepName === T);
|
11945
11949
|
for (let W = 0; W < tt.selections.length; ++W) {
|
11946
11950
|
const q = tt.selections[W];
|
11947
|
-
if (et && (!
|
11951
|
+
if (et && (!b || et.option && (et.option.variants || []).length > 1 && !et.data.hideSelectionInCart && !et.data.hideSelectionsInCart)) {
|
11948
11952
|
const wt = et.stepTitle;
|
11949
11953
|
F[wt] ? F[wt].push({
|
11950
11954
|
id: q.id || "",
|
@@ -11962,19 +11966,19 @@ const Oo = async (n, t) => {
|
|
11962
11966
|
}
|
11963
11967
|
}
|
11964
11968
|
return [F, Q];
|
11965
|
-
}, [S] = await f(!0),
|
11966
|
-
Object.keys(S).map((
|
11969
|
+
}, [S] = await f(!0), B = Object.fromEntries(
|
11970
|
+
Object.keys(S).map((b) => [b, S[b].map((F) => F.id)])
|
11967
11971
|
), [I] = await f(!1), C = Object.fromEntries(
|
11968
|
-
Object.keys(I).map((
|
11969
|
-
|
11970
|
-
I[
|
11972
|
+
Object.keys(I).map((b) => [
|
11973
|
+
b,
|
11974
|
+
I[b].map((F) => F.id)
|
11971
11975
|
])
|
11972
11976
|
);
|
11973
11977
|
let E = await o(m, r.id);
|
11974
11978
|
if (E) {
|
11975
|
-
const
|
11979
|
+
const b = await (await rt(E)).blob();
|
11976
11980
|
E = (await O.uploadAsset(
|
11977
|
-
{ name: `${r.id}-preview-image.png`, blob:
|
11981
|
+
{ name: `${r.id}-preview-image.png`, blob: b },
|
11978
11982
|
ve.Image,
|
11979
11983
|
!0,
|
11980
11984
|
!1
|
@@ -11982,7 +11986,7 @@ const Oo = async (n, t) => {
|
|
11982
11986
|
}
|
11983
11987
|
return {
|
11984
11988
|
designDetails: (() => {
|
11985
|
-
const
|
11989
|
+
const b = {
|
11986
11990
|
name: s,
|
11987
11991
|
layouts: e.map((F) => ({
|
11988
11992
|
index: F.index,
|
@@ -11997,20 +12001,20 @@ const Oo = async (n, t) => {
|
|
11997
12001
|
const F = [];
|
11998
12002
|
for (const [Q, T] of Object.entries(p))
|
11999
12003
|
F.push({ key: Q, value: T });
|
12000
|
-
|
12004
|
+
b.metadata = F;
|
12001
12005
|
}
|
12002
|
-
if (
|
12006
|
+
if (B) {
|
12003
12007
|
const F = [];
|
12004
12008
|
for (const [Q, T] of Object.entries(C))
|
12005
12009
|
F.push({ key: Q, ids: T });
|
12006
|
-
|
12010
|
+
b.selectedVariants = F;
|
12007
12011
|
}
|
12008
|
-
return
|
12012
|
+
return b;
|
12009
12013
|
})(),
|
12010
12014
|
cartSelectionsWithPrices: S,
|
12011
12015
|
cartMetadata: g
|
12012
12016
|
};
|
12013
|
-
},
|
12017
|
+
}, Vo = async (n, t, e, a, r, i, s, o, l, c, d) => {
|
12014
12018
|
l("workflow.steps.finish.finalize.buildingLayouts");
|
12015
12019
|
const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await ar(
|
12016
12020
|
n,
|
@@ -12024,7 +12028,7 @@ const Oo = async (n, t) => {
|
|
12024
12028
|
d
|
12025
12029
|
);
|
12026
12030
|
l("workflow.steps.finish.finalize.creatingDesign");
|
12027
|
-
const m = await
|
12031
|
+
const m = await $o(A), g = m?.transaction?.previewImageLink;
|
12028
12032
|
if (!m?.transaction)
|
12029
12033
|
throw new Error("Failed to create design");
|
12030
12034
|
l("workflow.steps.finish.finalize.updatingTransaction");
|
@@ -12039,7 +12043,7 @@ const Oo = async (n, t) => {
|
|
12039
12043
|
g,
|
12040
12044
|
m?.processExecution?.id
|
12041
12045
|
);
|
12042
|
-
},
|
12046
|
+
}, zo = async (n, t, e) => {
|
12043
12047
|
t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
|
12044
12048
|
n.map(async (o) => {
|
12045
12049
|
await o.workflowManager.outstandingRequestsPromise();
|
@@ -12070,7 +12074,7 @@ const Oo = async (n, t) => {
|
|
12070
12074
|
))
|
12071
12075
|
);
|
12072
12076
|
t("workflow.steps.finish.finalize.creatingDesign");
|
12073
|
-
const s = await
|
12077
|
+
const s = await Uo(i.map((o) => o.designDetails));
|
12074
12078
|
if (!s)
|
12075
12079
|
throw new Error("Failed to create designs");
|
12076
12080
|
return t("workflow.steps.finish.finalize.updatingTransaction"), s.map((o, l) => {
|
@@ -12087,7 +12091,7 @@ const Oo = async (n, t) => {
|
|
12087
12091
|
);
|
12088
12092
|
});
|
12089
12093
|
};
|
12090
|
-
class
|
12094
|
+
class Go {
|
12091
12095
|
constructor() {
|
12092
12096
|
this.localPersistenceKey = "designTransactions", this.storageMethod = "Local", this.designSavedListeners = [];
|
12093
12097
|
}
|
@@ -12154,7 +12158,7 @@ class zo {
|
|
12154
12158
|
throw new V("Unexpected storage method requested");
|
12155
12159
|
}
|
12156
12160
|
}
|
12157
|
-
const Xe = new
|
12161
|
+
const Xe = new Go(), Wo = w`
|
12158
12162
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
12159
12163
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
12160
12164
|
id
|
@@ -12168,7 +12172,7 @@ const Xe = new zo(), Go = w`
|
|
12168
12172
|
}
|
12169
12173
|
}
|
12170
12174
|
}
|
12171
|
-
`,
|
12175
|
+
`, qo = w`
|
12172
12176
|
mutation AddAddressToTransaction(
|
12173
12177
|
$transactionId: String!
|
12174
12178
|
$streetAddress: String
|
@@ -12190,15 +12194,15 @@ const Xe = new zo(), Go = w`
|
|
12190
12194
|
id
|
12191
12195
|
}
|
12192
12196
|
}
|
12193
|
-
`,
|
12197
|
+
`, Ho = w`
|
12194
12198
|
mutation AddOrganizationToTransaction($transactionId: String!, $organizationName: String!) {
|
12195
12199
|
organizationAttachToTransaction(transactionId: $transactionId, organizationName: $organizationName) {
|
12196
12200
|
id
|
12197
12201
|
}
|
12198
12202
|
}
|
12199
12203
|
`;
|
12200
|
-
var
|
12201
|
-
class
|
12204
|
+
var jo = /* @__PURE__ */ ((n) => (n.QuantityChanged = "QuantityChanged", n.PriceBreakChanged = "PriceBreakChanged", n))(jo || {});
|
12205
|
+
class Yo {
|
12202
12206
|
constructor(t, e) {
|
12203
12207
|
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = un(async () => {
|
12204
12208
|
await Xe.getSavedDesignByTransaction(
|
@@ -12219,7 +12223,7 @@ class jo {
|
|
12219
12223
|
throw new Error("No Workflow ID provided.");
|
12220
12224
|
this.client = t;
|
12221
12225
|
const a = e.layouts;
|
12222
|
-
this.commandContext = new ms(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new
|
12226
|
+
this.commandContext = new ms(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new Bo(
|
12223
12227
|
this,
|
12224
12228
|
t,
|
12225
12229
|
e.workflow,
|
@@ -12260,7 +12264,7 @@ class jo {
|
|
12260
12264
|
}
|
12261
12265
|
async attachAddress(t, e, a, r, i, s) {
|
12262
12266
|
await this.graphQlClient().mutate({
|
12263
|
-
mutation:
|
12267
|
+
mutation: qo,
|
12264
12268
|
variables: {
|
12265
12269
|
transactionId: this.getWorkflowManager().getTransaction().id,
|
12266
12270
|
streetAddress: t || void 0,
|
@@ -12274,7 +12278,7 @@ class jo {
|
|
12274
12278
|
}
|
12275
12279
|
async attachOrganization(t) {
|
12276
12280
|
await this.graphQlClient().mutate({
|
12277
|
-
mutation:
|
12281
|
+
mutation: Ho,
|
12278
12282
|
variables: {
|
12279
12283
|
transactionId: this.getWorkflowManager().getTransaction().id,
|
12280
12284
|
organizationName: t
|
@@ -12308,7 +12312,7 @@ class jo {
|
|
12308
12312
|
}
|
12309
12313
|
let i = 2048;
|
12310
12314
|
e && e <= 2048 && (i = e);
|
12311
|
-
const s = pt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((
|
12315
|
+
const s = pt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((B) => B.layoutState?.layout.panelId === c?.name) || o[0], A = d.layoutState.layout.previewRegion ? {
|
12312
12316
|
x: d.layoutState.layout.previewRegion.left,
|
12313
12317
|
y: d.layoutState.layout.previewRegion.top,
|
12314
12318
|
width: d.layoutState.layout.previewRegion.width,
|
@@ -12465,7 +12469,7 @@ class jo {
|
|
12465
12469
|
}
|
12466
12470
|
async assignCustomerDetails(t) {
|
12467
12471
|
const a = (await this.graphQlClient().mutate({
|
12468
|
-
mutation:
|
12472
|
+
mutation: Wo,
|
12469
12473
|
variables: {
|
12470
12474
|
id: this.getWorkflowManager().getTransaction().id,
|
12471
12475
|
details: t,
|
@@ -12531,7 +12535,7 @@ class jo {
|
|
12531
12535
|
transactionId: a.id,
|
12532
12536
|
workflowViewerLink: "",
|
12533
12537
|
workflowViewerReadOnlyLink: ""
|
12534
|
-
}) :
|
12538
|
+
}) : Vo(
|
12535
12539
|
this.workflowManager,
|
12536
12540
|
this.workflowManager.getWorkflow(),
|
12537
12541
|
this.workflowManager.getLayouts(),
|
@@ -12562,7 +12566,7 @@ class jo {
|
|
12562
12566
|
title: i.stepTitle,
|
12563
12567
|
properties: []
|
12564
12568
|
};
|
12565
|
-
if (l &&
|
12569
|
+
if (l && Ko(i, a) && c.properties.push({
|
12566
12570
|
type: "selection",
|
12567
12571
|
value: l.name,
|
12568
12572
|
priceModifier: l.priceModifier
|
@@ -12656,7 +12660,7 @@ class jo {
|
|
12656
12660
|
(this.eventCallbacks.get(t) || []).forEach((e) => e(this));
|
12657
12661
|
}
|
12658
12662
|
}
|
12659
|
-
const
|
12663
|
+
const Jo = (n) => {
|
12660
12664
|
if ([
|
12661
12665
|
v.Question,
|
12662
12666
|
v.Frame,
|
@@ -12671,14 +12675,14 @@ const Yo = (n) => {
|
|
12671
12675
|
return !!e.displaySelectionOnFinishStep || !!e.displaySelectionsOnFinishStep;
|
12672
12676
|
}
|
12673
12677
|
return !1;
|
12674
|
-
},
|
12675
|
-
if (!
|
12678
|
+
}, Ko = (n, t) => {
|
12679
|
+
if (!Jo(n)) return !1;
|
12676
12680
|
if (n.option && (n.option.variants || []).length > 1) {
|
12677
12681
|
const e = t[n.stepName];
|
12678
12682
|
return !!(e && e.selections.length > 0);
|
12679
12683
|
}
|
12680
12684
|
return !1;
|
12681
|
-
},
|
12685
|
+
}, _o = [
|
12682
12686
|
"altGlyph",
|
12683
12687
|
"circle",
|
12684
12688
|
"ellipse",
|
@@ -12690,7 +12694,7 @@ const Yo = (n) => {
|
|
12690
12694
|
"textPath",
|
12691
12695
|
"tref",
|
12692
12696
|
"tspan"
|
12693
|
-
],
|
12697
|
+
], Xo = async (n, t, e) => {
|
12694
12698
|
const a = t.data, r = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = r.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + r);
|
12695
12699
|
o.searchParams.append("video", $a(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
12696
12700
|
const l = o.toString(), d = `data:image/svg+xml;base64,${$a(await An(l, { type: "svg" }))}`, A = (h) => {
|
@@ -12717,7 +12721,7 @@ const Yo = (n) => {
|
|
12717
12721
|
} catch (h) {
|
12718
12722
|
return console.error(h), [];
|
12719
12723
|
}
|
12720
|
-
},
|
12724
|
+
}, Zo = async (n, t, e, a) => {
|
12721
12725
|
const r = e.data, i = r.assetUrl, s = await da(i);
|
12722
12726
|
try {
|
12723
12727
|
const o = gs(r, a.option);
|
@@ -12774,7 +12778,7 @@ const Yo = (n) => {
|
|
12774
12778
|
} catch (o) {
|
12775
12779
|
return console.error(o), [];
|
12776
12780
|
}
|
12777
|
-
},
|
12781
|
+
}, tl = async (n, t, e, a) => {
|
12778
12782
|
const r = e.data, i = a.option;
|
12779
12783
|
if (!i)
|
12780
12784
|
return console.error(`No option for step ${a.stepName}.`), [];
|
@@ -12793,16 +12797,16 @@ const Yo = (n) => {
|
|
12793
12797
|
wa(m);
|
12794
12798
|
const g = {};
|
12795
12799
|
kt(m, (C) => {
|
12796
|
-
|
12800
|
+
_o.includes(C.tagName) && !C.attributes.getNamedItem("fill") && C.setAttribute("fill", "#000000");
|
12797
12801
|
const E = C.attributes.getNamedItem("fill");
|
12798
12802
|
if (E && E.value !== "none") {
|
12799
|
-
const
|
12800
|
-
C.classList.add(Q), g[Q] = { browserValue:
|
12803
|
+
const b = E.value, Q = `spiff-fill-${b.replace(/\W/g, "")}`;
|
12804
|
+
C.classList.add(Q), g[Q] = { browserValue: b };
|
12801
12805
|
}
|
12802
12806
|
const P = C.attributes.getNamedItem("stroke");
|
12803
12807
|
if (P && P.value !== "none") {
|
12804
|
-
const
|
12805
|
-
C.classList.add(Q), g[Q] = { browserValue:
|
12808
|
+
const b = P.value, Q = `spiff-stroke-${b.replace(/\W/g, "")}`;
|
12809
|
+
C.classList.add(Q), g[Q] = { browserValue: b };
|
12806
12810
|
}
|
12807
12811
|
});
|
12808
12812
|
const f = It().serializeToString(m), S = r.colors;
|
@@ -12814,8 +12818,8 @@ const Yo = (n) => {
|
|
12814
12818
|
break;
|
12815
12819
|
}
|
12816
12820
|
}
|
12817
|
-
const
|
12818
|
-
const E = n.find((
|
12821
|
+
const B = (C) => {
|
12822
|
+
const E = n.find((b) => b.panelId === C.panelId);
|
12819
12823
|
if (!E)
|
12820
12824
|
throw new Y(C);
|
12821
12825
|
const P = M();
|
@@ -12838,11 +12842,11 @@ const Yo = (n) => {
|
|
12838
12842
|
);
|
12839
12843
|
}, I = a.data.regions;
|
12840
12844
|
try {
|
12841
|
-
return I.map(
|
12845
|
+
return I.map(B);
|
12842
12846
|
} catch (C) {
|
12843
12847
|
return console.error(C), [];
|
12844
12848
|
}
|
12845
|
-
},
|
12849
|
+
}, el = async (n, t, e) => {
|
12846
12850
|
const a = await Zn(e.data.module), r = t.data, i = (o, l) => {
|
12847
12851
|
const c = n.find((A) => A.panelId === l.panelId);
|
12848
12852
|
if (!c)
|
@@ -12872,7 +12876,7 @@ const Yo = (n) => {
|
|
12872
12876
|
} catch (o) {
|
12873
12877
|
return console.error(o), [];
|
12874
12878
|
}
|
12875
|
-
},
|
12879
|
+
}, al = async (n, t, e, a) => {
|
12876
12880
|
const r = e.data, i = a.option;
|
12877
12881
|
if (!i)
|
12878
12882
|
return console.error(`No option for step ${a.stepName}.`), [];
|
@@ -12913,7 +12917,7 @@ const Yo = (n) => {
|
|
12913
12917
|
} catch (d) {
|
12914
12918
|
return console.error(d), [];
|
12915
12919
|
}
|
12916
|
-
},
|
12920
|
+
}, nl = async (n, t, e, a) => {
|
12917
12921
|
const r = e.data, i = a.option;
|
12918
12922
|
if (!i)
|
12919
12923
|
return console.error(`No option for step ${a.stepName}.`), [];
|
@@ -12969,7 +12973,7 @@ const Yo = (n) => {
|
|
12969
12973
|
} catch (c) {
|
12970
12974
|
return console.error(c), [];
|
12971
12975
|
}
|
12972
|
-
},
|
12976
|
+
}, rl = async (n, t, e) => {
|
12973
12977
|
const a = [], i = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", o = i.endsWith(".jpeg") || i.endsWith(".jpg") || i.endsWith(".png") ? x.Image : (i.endsWith(".svg"), x.Illustration), l = t.data.regions;
|
12974
12978
|
if (o === "image")
|
12975
12979
|
try {
|
@@ -13033,12 +13037,12 @@ const Yo = (n) => {
|
|
13033
13037
|
});
|
13034
13038
|
}
|
13035
13039
|
return a;
|
13036
|
-
},
|
13040
|
+
}, il = async (n, t, e, a) => {
|
13037
13041
|
const r = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
|
13038
13042
|
const p = a.option;
|
13039
13043
|
if (!p)
|
13040
13044
|
return;
|
13041
|
-
const f = p.variants?.find((
|
13045
|
+
const f = p.variants?.find((B) => B.id === i.fontVariantId) || ne(p);
|
13042
13046
|
if (!f || !f.asset)
|
13043
13047
|
return;
|
13044
13048
|
t[a.stepName] = { selectedVariants: [f] };
|
@@ -13062,7 +13066,7 @@ const Yo = (n) => {
|
|
13062
13066
|
return f ? j.getDefaultVariant(f)?.color : void 0;
|
13063
13067
|
}, m = i.color || await h(a.data), g = a.data.regions;
|
13064
13068
|
for (const p of g) {
|
13065
|
-
const f = n.find((
|
13069
|
+
const f = n.find((B) => B.panelId === p.panelId);
|
13066
13070
|
if (!f)
|
13067
13071
|
continue;
|
13068
13072
|
const S = {
|
@@ -13087,7 +13091,7 @@ const Yo = (n) => {
|
|
13087
13091
|
y: p.top
|
13088
13092
|
};
|
13089
13093
|
if (d) {
|
13090
|
-
const [
|
13094
|
+
const [B, I] = Ce(
|
13091
13095
|
a.data.size || s,
|
13092
13096
|
d,
|
13093
13097
|
p,
|
@@ -13107,7 +13111,7 @@ const Yo = (n) => {
|
|
13107
13111
|
new z(
|
13108
13112
|
{
|
13109
13113
|
...S,
|
13110
|
-
fontSize:
|
13114
|
+
fontSize: B,
|
13111
13115
|
text: S.curved ? S.text : (I || []).join(`
|
13112
13116
|
`)
|
13113
13117
|
},
|
@@ -13118,7 +13122,7 @@ const Yo = (n) => {
|
|
13118
13122
|
r.push(new z(S, f));
|
13119
13123
|
}
|
13120
13124
|
return r;
|
13121
|
-
},
|
13125
|
+
}, sl = (n, t) => n.conditions ? n.conditions.every((e) => {
|
13122
13126
|
const a = t[e.targetStepName];
|
13123
13127
|
if (a && a.selectedVariants) {
|
13124
13128
|
const r = a.selectedVariants;
|
@@ -13127,7 +13131,7 @@ const Yo = (n) => {
|
|
13127
13131
|
);
|
13128
13132
|
}
|
13129
13133
|
return !1;
|
13130
|
-
}) : !0,
|
13134
|
+
}) : !0, ol = async (n, t, e, a) => {
|
13131
13135
|
const r = [], i = {};
|
13132
13136
|
for (const s of n) {
|
13133
13137
|
const o = t.steps.find((l) => l.stepName === s.name);
|
@@ -13135,18 +13139,18 @@ const Yo = (n) => {
|
|
13135
13139
|
switch (o.type) {
|
13136
13140
|
case v.DigitalContent:
|
13137
13141
|
r.push(
|
13138
|
-
...await
|
13142
|
+
...await Xo(e, s, o)
|
13139
13143
|
);
|
13140
13144
|
break;
|
13141
13145
|
case v.Frame:
|
13142
13146
|
case v.Photo:
|
13143
13147
|
r.push(
|
13144
|
-
...await
|
13148
|
+
...await Zo(e, i, s, o)
|
13145
13149
|
);
|
13146
13150
|
break;
|
13147
13151
|
case v.Illustration:
|
13148
13152
|
r.push(
|
13149
|
-
...await
|
13153
|
+
...await tl(
|
13150
13154
|
e,
|
13151
13155
|
i,
|
13152
13156
|
s,
|
@@ -13155,39 +13159,39 @@ const Yo = (n) => {
|
|
13155
13159
|
);
|
13156
13160
|
break;
|
13157
13161
|
case v.Module:
|
13158
|
-
r.push(...await
|
13162
|
+
r.push(...await el(e, s, o));
|
13159
13163
|
break;
|
13160
13164
|
case v.Picture:
|
13161
13165
|
r.push(
|
13162
|
-
...await
|
13166
|
+
...await al(e, i, s, o)
|
13163
13167
|
);
|
13164
13168
|
break;
|
13165
13169
|
case v.Shape:
|
13166
13170
|
r.push(
|
13167
|
-
...await
|
13171
|
+
...await nl(e, i, s, o)
|
13168
13172
|
);
|
13169
13173
|
break;
|
13170
13174
|
case v.Text:
|
13171
13175
|
r.push(
|
13172
|
-
...await
|
13176
|
+
...await il(e, i, s, o)
|
13173
13177
|
);
|
13174
13178
|
break;
|
13175
13179
|
}
|
13176
13180
|
}
|
13177
13181
|
for (const s of t.steps)
|
13178
|
-
s.type !== v.SilentIllustration && s.type !== v.ProductOverlay ||
|
13179
|
-
...await
|
13182
|
+
s.type !== v.SilentIllustration && s.type !== v.ProductOverlay || sl(s, i) && r.push(
|
13183
|
+
...await rl(e, s, a)
|
13180
13184
|
);
|
13181
13185
|
return r;
|
13182
13186
|
};
|
13183
|
-
class
|
13187
|
+
class ll {
|
13184
13188
|
constructor(t) {
|
13185
13189
|
this.handleCompleteRender = null;
|
13186
13190
|
const e = /* @__PURE__ */ new Map();
|
13187
13191
|
t.forEach(
|
13188
13192
|
(a) => e.set(
|
13189
13193
|
a.id,
|
13190
|
-
new
|
13194
|
+
new Al(
|
13191
13195
|
a.id,
|
13192
13196
|
a.name,
|
13193
13197
|
this,
|
@@ -13213,15 +13217,15 @@ class ol {
|
|
13213
13217
|
return this.workflowManager;
|
13214
13218
|
}
|
13215
13219
|
}
|
13216
|
-
const
|
13220
|
+
const cl = () => new Promise((n, t) => {
|
13217
13221
|
try {
|
13218
13222
|
const a = pt().getContext("webgl2");
|
13219
13223
|
n(!!a);
|
13220
13224
|
} catch {
|
13221
13225
|
n(!1);
|
13222
13226
|
}
|
13223
|
-
}),
|
13224
|
-
class
|
13227
|
+
}), dl = cl();
|
13228
|
+
class Al {
|
13225
13229
|
constructor(t, e, a, r, i) {
|
13226
13230
|
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new Tn(2), this.id = t, this.name = e, this.service = a, this.panelSize = r, this.getWorkflowManager = i;
|
13227
13231
|
}
|
@@ -13277,10 +13281,10 @@ class dl {
|
|
13277
13281
|
return;
|
13278
13282
|
}
|
13279
13283
|
this.renderQueue.enqueue(
|
13280
|
-
new
|
13284
|
+
new ul(
|
13281
13285
|
this.getID(),
|
13282
13286
|
a,
|
13283
|
-
await
|
13287
|
+
await dl,
|
13284
13288
|
() => {
|
13285
13289
|
this.markLastCompletedStaticRender(), this.setStaticContextDirty(!0);
|
13286
13290
|
},
|
@@ -13290,7 +13294,7 @@ class dl {
|
|
13290
13294
|
);
|
13291
13295
|
}
|
13292
13296
|
}
|
13293
|
-
class
|
13297
|
+
class ul extends Mn {
|
13294
13298
|
constructor(t, e, a, r, i, s) {
|
13295
13299
|
super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = r, this.layouts = i, this.getWorkflowManager = s;
|
13296
13300
|
}
|
@@ -13360,7 +13364,7 @@ class Al extends Mn {
|
|
13360
13364
|
h.resize(l, c), await h.render(), this.onRender();
|
13361
13365
|
}
|
13362
13366
|
}
|
13363
|
-
const
|
13367
|
+
const fd = (n, t) => {
|
13364
13368
|
const e = [];
|
13365
13369
|
return n.forEach((a) => {
|
13366
13370
|
const r = t.steps.find((i) => i.stepName === a.stepName);
|
@@ -13371,16 +13375,16 @@ const pd = (n, t) => {
|
|
13371
13375
|
}
|
13372
13376
|
});
|
13373
13377
|
}), e;
|
13374
|
-
},
|
13378
|
+
}, Cd = async (n, t, e, a) => {
|
13375
13379
|
let r = {
|
13376
13380
|
serializableWorkflow: { steps: [] },
|
13377
13381
|
layouts: {}
|
13378
13382
|
};
|
13379
13383
|
r = new R(e.map((l) => new qn(l))).apply(r);
|
13380
|
-
const s = await
|
13384
|
+
const s = await ol(n, t, e, a);
|
13381
13385
|
return new R(s).apply(r);
|
13382
13386
|
};
|
13383
|
-
class
|
13387
|
+
class hl {
|
13384
13388
|
constructor(t) {
|
13385
13389
|
this.handleCache = {}, this.bundle = t;
|
13386
13390
|
}
|
@@ -13422,7 +13426,7 @@ class ul {
|
|
13422
13426
|
async createHandle(t) {
|
13423
13427
|
switch (t.type) {
|
13424
13428
|
case U.FileUpload:
|
13425
|
-
return new
|
13429
|
+
return new ml(this.bundle, t).initialize();
|
13426
13430
|
case U.ColorOption:
|
13427
13431
|
return new Za(
|
13428
13432
|
this.bundle,
|
@@ -13434,7 +13438,7 @@ class ul {
|
|
13434
13438
|
return e?.type === "Color" ? new Za(this.bundle, t, e) : new nr(this.bundle, t, e);
|
13435
13439
|
}
|
13436
13440
|
case U.Text:
|
13437
|
-
return new
|
13441
|
+
return new gl(this.bundle, t);
|
13438
13442
|
default:
|
13439
13443
|
throw new Error("Unhandled Global Property Aspect Type");
|
13440
13444
|
}
|
@@ -13501,7 +13505,7 @@ class Da {
|
|
13501
13505
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
13502
13506
|
}
|
13503
13507
|
}
|
13504
|
-
class
|
13508
|
+
class ml extends Da {
|
13505
13509
|
constructor(t, e) {
|
13506
13510
|
super(t, e);
|
13507
13511
|
}
|
@@ -13727,7 +13731,7 @@ class hl extends Da {
|
|
13727
13731
|
);
|
13728
13732
|
}
|
13729
13733
|
}
|
13730
|
-
class
|
13734
|
+
class gl extends Da {
|
13731
13735
|
constructor(t, e) {
|
13732
13736
|
super(t, e);
|
13733
13737
|
}
|
@@ -13878,8 +13882,8 @@ class Za extends nr {
|
|
13878
13882
|
return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor || this.getCurrentVariant()?.getColor() || "#ffffff";
|
13879
13883
|
}
|
13880
13884
|
}
|
13881
|
-
const
|
13882
|
-
const r =
|
13885
|
+
const pl = (n, t, e, a) => n.flatMap((r) => r.getSteps()).filter((r) => r.getGlobalPropertyAspects(t).includes(e) && r.getType() === a), fl = (n, t, e) => {
|
13886
|
+
const r = pl(
|
13883
13887
|
n,
|
13884
13888
|
t,
|
13885
13889
|
e,
|
@@ -13892,21 +13896,21 @@ const gl = (n, t, e, a) => n.flatMap((r) => r.getSteps()).filter((r) => r.getGlo
|
|
13892
13896
|
};
|
13893
13897
|
function ua(n, t) {
|
13894
13898
|
function e(a) {
|
13895
|
-
if (typeof a > "u" || !Array.isArray(a) && !
|
13899
|
+
if (typeof a > "u" || !Array.isArray(a) && !wl(a))
|
13896
13900
|
return a;
|
13897
13901
|
if (Array.isArray(a))
|
13898
13902
|
return ua(a, t);
|
13899
13903
|
let r = {};
|
13900
13904
|
for (const [i, s] of Object.entries(a))
|
13901
|
-
r[i] =
|
13905
|
+
r[i] = Cl(s) ? s : ua(s, t);
|
13902
13906
|
return Ir(r, t);
|
13903
13907
|
}
|
13904
13908
|
return Array.isArray(n) ? n.map(e) : e(n);
|
13905
13909
|
}
|
13906
|
-
function
|
13910
|
+
function Cl(n) {
|
13907
13911
|
return n == null;
|
13908
13912
|
}
|
13909
|
-
function
|
13913
|
+
function wl(n) {
|
13910
13914
|
return typeof n == "object" && !Array.isArray(n) && n !== null;
|
13911
13915
|
}
|
13912
13916
|
function rr(n) {
|
@@ -13918,7 +13922,7 @@ function rr(n) {
|
|
13918
13922
|
function Ae(n) {
|
13919
13923
|
return ua(n, ["__typename"]);
|
13920
13924
|
}
|
13921
|
-
class
|
13925
|
+
class yl {
|
13922
13926
|
constructor(t, e, a, r, i) {
|
13923
13927
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = i;
|
13924
13928
|
const s = i?.existingGlobalPropertyState;
|
@@ -14100,7 +14104,7 @@ class wl {
|
|
14100
14104
|
throw new Error(`Unable to create global property state for bundle: ${this.bundleId}`);
|
14101
14105
|
}
|
14102
14106
|
}
|
14103
|
-
class
|
14107
|
+
class Sl {
|
14104
14108
|
constructor(t) {
|
14105
14109
|
this.setState(t);
|
14106
14110
|
}
|
@@ -14186,7 +14190,7 @@ class yl {
|
|
14186
14190
|
};
|
14187
14191
|
}
|
14188
14192
|
}
|
14189
|
-
const
|
14193
|
+
const vl = w`
|
14190
14194
|
query GetManyMetafields($entityIds: [String!]!) {
|
14191
14195
|
metafieldsMany(entityIds: $entityIds) {
|
14192
14196
|
id
|
@@ -14198,7 +14202,7 @@ const Sl = w`
|
|
14198
14202
|
}
|
14199
14203
|
}
|
14200
14204
|
`;
|
14201
|
-
class
|
14205
|
+
class El {
|
14202
14206
|
constructor() {
|
14203
14207
|
this.internalMap = /* @__PURE__ */ new Map();
|
14204
14208
|
}
|
@@ -14219,7 +14223,7 @@ class vl {
|
|
14219
14223
|
async ensureIdsArePresent(t) {
|
14220
14224
|
if (t.every((a) => this.internalMap.has(a))) return;
|
14221
14225
|
const e = await y.getShadowGraphqlClient().query({
|
14222
|
-
query:
|
14226
|
+
query: vl,
|
14223
14227
|
errorPolicy: "all",
|
14224
14228
|
variables: {
|
14225
14229
|
entityIds: t.filter((a) => !this.internalMap.has(a))
|
@@ -14260,8 +14264,8 @@ class vl {
|
|
14260
14264
|
return JSON.parse(r.value);
|
14261
14265
|
}
|
14262
14266
|
}
|
14263
|
-
const
|
14264
|
-
var
|
14267
|
+
const bl = new El();
|
14268
|
+
var Bl = /* @__PURE__ */ ((n) => (n.Default = "Default", n.Name = "Name", n.Price = "Price", n))(Bl || {});
|
14265
14269
|
class ir {
|
14266
14270
|
constructor(t) {
|
14267
14271
|
this.fullFetched = !1, this.collection = t;
|
@@ -14435,7 +14439,7 @@ class ir {
|
|
14435
14439
|
}
|
14436
14440
|
getTransformCollection() {
|
14437
14441
|
if (this.collection.transformCollection)
|
14438
|
-
return new
|
14442
|
+
return new Il(this.collection.transformCollection);
|
14439
14443
|
}
|
14440
14444
|
/**
|
14441
14445
|
* The raw collection resource. This is generally not needed and should be avoided.
|
@@ -14561,7 +14565,7 @@ class ue {
|
|
14561
14565
|
* @returns A map of metafield key to value. Any unavailable keys will not be present in the map. use map.has() to check if a key is present.
|
14562
14566
|
*/
|
14563
14567
|
async requestMetafields(t) {
|
14564
|
-
return
|
14568
|
+
return bl.requestKeysForEntity(this.product.id, t);
|
14565
14569
|
}
|
14566
14570
|
}
|
14567
14571
|
class qt {
|
@@ -14588,7 +14592,7 @@ class qt {
|
|
14588
14592
|
return this.workflow.imageUrl;
|
14589
14593
|
}
|
14590
14594
|
}
|
14591
|
-
class
|
14595
|
+
class Il {
|
14592
14596
|
constructor(t) {
|
14593
14597
|
this.collection = t;
|
14594
14598
|
}
|
@@ -14608,10 +14612,10 @@ class Bl {
|
|
14608
14612
|
* @returns The transforms in this collection.
|
14609
14613
|
*/
|
14610
14614
|
getTransforms() {
|
14611
|
-
return this.collection.transforms.map((t) => new
|
14615
|
+
return this.collection.transforms.map((t) => new Pl(t));
|
14612
14616
|
}
|
14613
14617
|
}
|
14614
|
-
class
|
14618
|
+
class Pl {
|
14615
14619
|
constructor(t) {
|
14616
14620
|
this.transform = t;
|
14617
14621
|
}
|
@@ -14638,21 +14642,21 @@ class Il {
|
|
14638
14642
|
};
|
14639
14643
|
}
|
14640
14644
|
}
|
14641
|
-
const
|
14645
|
+
const Dl = w`
|
14642
14646
|
${ie(!1)}
|
14643
14647
|
query GetProductCollections($ids: [String!]!) {
|
14644
14648
|
productCollections(ids: $ids) {
|
14645
14649
|
...ProductCollectionFields
|
14646
14650
|
}
|
14647
14651
|
}
|
14648
|
-
`,
|
14649
|
-
query:
|
14652
|
+
`, wd = async (n) => (await y.getShadowGraphqlClient().query({
|
14653
|
+
query: Dl,
|
14650
14654
|
errorPolicy: "all",
|
14651
14655
|
variables: {
|
14652
14656
|
ids: n
|
14653
14657
|
}
|
14654
14658
|
})).data?.productCollections?.map((e) => new ir(e));
|
14655
|
-
class
|
14659
|
+
class Fl {
|
14656
14660
|
constructor() {
|
14657
14661
|
this.listeners = {};
|
14658
14662
|
}
|
@@ -14679,7 +14683,7 @@ class Dl {
|
|
14679
14683
|
delete this.listeners[e];
|
14680
14684
|
}
|
14681
14685
|
}
|
14682
|
-
const
|
14686
|
+
const xl = w`
|
14683
14687
|
mutation AddAddressToBundle(
|
14684
14688
|
$bundleId: String!
|
14685
14689
|
$streetAddress: String
|
@@ -14701,13 +14705,13 @@ const Fl = w`
|
|
14701
14705
|
id
|
14702
14706
|
}
|
14703
14707
|
}
|
14704
|
-
`,
|
14708
|
+
`, kl = w`
|
14705
14709
|
mutation AddOrganizationToBundle($bundleId: String!, $organizationName: String!) {
|
14706
14710
|
organizationAttachToBundle(bundleId: $bundleId, organizationName: $organizationName) {
|
14707
14711
|
id
|
14708
14712
|
}
|
14709
14713
|
}
|
14710
|
-
`,
|
14714
|
+
`, Ml = w`
|
14711
14715
|
mutation GenerateQuoteId($id: String!) {
|
14712
14716
|
bundleGenerateQuoteId(id: $id) {
|
14713
14717
|
id
|
@@ -14717,15 +14721,15 @@ const Fl = w`
|
|
14717
14721
|
`;
|
14718
14722
|
class Ze {
|
14719
14723
|
constructor(t, e, a, r, i, s) {
|
14720
|
-
this.workflowExperiences = [], this.eventEmitter = new
|
14724
|
+
this.workflowExperiences = [], this.eventEmitter = new Fl(), this.updatesLocked = !1, this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new Sl(e.bundleStateData);
|
14721
14725
|
const o = this.productCollection?.globalPropertyConfiguration;
|
14722
|
-
this.globalConfigurationPropertyId = o?.id, this.globalPropertyStateManager = new
|
14726
|
+
this.globalConfigurationPropertyId = o?.id, this.globalPropertyStateManager = new yl(
|
14723
14727
|
this.id,
|
14724
14728
|
this.ownerId,
|
14725
14729
|
o,
|
14726
14730
|
this.onGlobalPropertiesChanged.bind(this),
|
14727
14731
|
s
|
14728
|
-
), this.globalPropertyHandleService = new
|
14732
|
+
), this.globalPropertyHandleService = new hl(this), this.setPreviewService(a);
|
14729
14733
|
const l = new Promise((c, d) => {
|
14730
14734
|
if (s?.readonly) {
|
14731
14735
|
c([]);
|
@@ -14761,7 +14765,7 @@ class Ze {
|
|
14761
14765
|
}
|
14762
14766
|
async generateQuoteId() {
|
14763
14767
|
const e = (await y.getShadowGraphqlClient().mutate({
|
14764
|
-
mutation:
|
14768
|
+
mutation: Ml,
|
14765
14769
|
variables: {
|
14766
14770
|
id: this.id
|
14767
14771
|
},
|
@@ -14773,7 +14777,7 @@ class Ze {
|
|
14773
14777
|
}
|
14774
14778
|
async attachAddress(t, e, a, r, i, s) {
|
14775
14779
|
await y.getShadowGraphqlClient().mutate({
|
14776
|
-
mutation:
|
14780
|
+
mutation: xl,
|
14777
14781
|
variables: {
|
14778
14782
|
bundleId: this.id,
|
14779
14783
|
streetAddress: t || void 0,
|
@@ -14790,7 +14794,7 @@ class Ze {
|
|
14790
14794
|
}
|
14791
14795
|
async attachOrganization(t) {
|
14792
14796
|
await y.getShadowGraphqlClient().mutate({
|
14793
|
-
mutation:
|
14797
|
+
mutation: kl,
|
14794
14798
|
variables: {
|
14795
14799
|
bundleId: this.id,
|
14796
14800
|
organizationName: t
|
@@ -14927,7 +14931,7 @@ class Ze {
|
|
14927
14931
|
(s) => s.name === r
|
14928
14932
|
);
|
14929
14933
|
if (i && i.type === U.ColorOption) {
|
14930
|
-
const s = e.getCurrentVariant()?.getAssetResource(), o = s?.assetConfiguration?.channelNumbers || [], l = s?.assetConfiguration?.defaultColorVariants || [], c =
|
14934
|
+
const s = e.getCurrentVariant()?.getAssetResource(), o = s?.assetConfiguration?.channelNumbers || [], l = s?.assetConfiguration?.defaultColorVariants || [], c = fl(
|
14931
14935
|
this.getWorkflowExperiences(),
|
14932
14936
|
this.globalConfigurationPropertyId || "",
|
14933
14937
|
r
|
@@ -15210,7 +15214,7 @@ class Ze {
|
|
15210
15214
|
bundleId: this.id
|
15211
15215
|
}
|
15212
15216
|
});
|
15213
|
-
const a = await
|
15217
|
+
const a = await zo(
|
15214
15218
|
this.workflowExperiences.map((r) => ({
|
15215
15219
|
workflowManager: r.getWorkflowManager(),
|
15216
15220
|
workflow: r.getWorkflowManager().getWorkflow(),
|
@@ -15445,14 +15449,14 @@ class Ze {
|
|
15445
15449
|
};
|
15446
15450
|
}
|
15447
15451
|
}
|
15448
|
-
const
|
15452
|
+
const Tl = w`
|
15449
15453
|
mutation processFlowCreate($processFlowId: String!, $inputs: [String]!) {
|
15450
15454
|
processExecutionCreate(processFlowId: $processFlowId, inputs: $inputs) {
|
15451
15455
|
id
|
15452
15456
|
}
|
15453
15457
|
}
|
15454
15458
|
`;
|
15455
|
-
class
|
15459
|
+
class Nl {
|
15456
15460
|
/**
|
15457
15461
|
*
|
15458
15462
|
* @param id
|
@@ -15462,7 +15466,7 @@ class Tl {
|
|
15462
15466
|
*/
|
15463
15467
|
async execute(t, e, a) {
|
15464
15468
|
const i = (await y.getShadowGraphqlClient().mutate({
|
15465
|
-
mutation:
|
15469
|
+
mutation: Tl,
|
15466
15470
|
variables: {
|
15467
15471
|
processFlowId: t,
|
15468
15472
|
inputs: [...e.map((A) => A.getValueForTransmission())]
|
@@ -15502,7 +15506,7 @@ class Tl {
|
|
15502
15506
|
"Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
|
15503
15507
|
);
|
15504
15508
|
if (A.completedAt) {
|
15505
|
-
o = !0, d = new
|
15509
|
+
o = !0, d = new Ql(A);
|
15506
15510
|
break;
|
15507
15511
|
}
|
15508
15512
|
l += 1;
|
@@ -15514,7 +15518,7 @@ class Tl {
|
|
15514
15518
|
return Promise.resolve(d);
|
15515
15519
|
}
|
15516
15520
|
}
|
15517
|
-
class
|
15521
|
+
class Ql {
|
15518
15522
|
constructor(t) {
|
15519
15523
|
this.execution = t;
|
15520
15524
|
}
|
@@ -15599,8 +15603,8 @@ class Fa {
|
|
15599
15603
|
return t.startsWith("[") ? JSON.stringify(JSON.parse(t)) : t;
|
15600
15604
|
}
|
15601
15605
|
}
|
15602
|
-
var
|
15603
|
-
class
|
15606
|
+
var Rl = /* @__PURE__ */ ((n) => (n.Transaction = "Transaction", n.Bundle = "Bundle", n.Product = "Product", n.Variant = "Variant", n.Option = "Option", n.LineItem = "LineItem", n.Asset = "Asset", n))(Rl || {});
|
15607
|
+
class yd extends Fa {
|
15604
15608
|
constructor(t) {
|
15605
15609
|
super(`"${t}"`);
|
15606
15610
|
}
|
@@ -15615,7 +15619,7 @@ class sr extends Fa {
|
|
15615
15619
|
return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
15616
15620
|
}
|
15617
15621
|
}
|
15618
|
-
class
|
15622
|
+
class Sd extends Fa {
|
15619
15623
|
constructor(t) {
|
15620
15624
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
15621
15625
|
}
|
@@ -15677,7 +15681,7 @@ const me = w`
|
|
15677
15681
|
}
|
15678
15682
|
}
|
15679
15683
|
}
|
15680
|
-
`,
|
15684
|
+
`, Ol = w`
|
15681
15685
|
mutation CustomerCreate($details: CustomerDetailsInput!) {
|
15682
15686
|
customerCreate(details: $details) {
|
15683
15687
|
id
|
@@ -15719,7 +15723,7 @@ w`
|
|
15719
15723
|
}
|
15720
15724
|
}
|
15721
15725
|
`;
|
15722
|
-
const
|
15726
|
+
const $l = w`
|
15723
15727
|
mutation CustomerGenerateVerificationCode($emailAddress: String!) {
|
15724
15728
|
customerGenerateVerificationCode(emailAddress: $emailAddress)
|
15725
15729
|
}
|
@@ -15756,7 +15760,7 @@ w`
|
|
15756
15760
|
}
|
15757
15761
|
}
|
15758
15762
|
`;
|
15759
|
-
const
|
15763
|
+
const Ul = w`
|
15760
15764
|
query CustomerMetafields($id: String!) {
|
15761
15765
|
metafields(entityId: $id) {
|
15762
15766
|
id
|
@@ -15775,7 +15779,7 @@ const $l = w`
|
|
15775
15779
|
}
|
15776
15780
|
}
|
15777
15781
|
`;
|
15778
|
-
class
|
15782
|
+
class Ll {
|
15779
15783
|
constructor(t, e = y.getShadowGraphqlClient.bind(y)) {
|
15780
15784
|
this.options = t, this.client = e;
|
15781
15785
|
}
|
@@ -15802,7 +15806,7 @@ class Ul {
|
|
15802
15806
|
});
|
15803
15807
|
}
|
15804
15808
|
}
|
15805
|
-
class
|
15809
|
+
class Vl {
|
15806
15810
|
init(t, e, a) {
|
15807
15811
|
this.cognitoClient = new Er({ region: e }), this.spiffRegion = t, this.userPoolClientId = a;
|
15808
15812
|
}
|
@@ -15852,8 +15856,8 @@ class Ll {
|
|
15852
15856
|
);
|
15853
15857
|
}
|
15854
15858
|
}
|
15855
|
-
const Lt = new
|
15856
|
-
class
|
15859
|
+
const Lt = new Vl();
|
15860
|
+
class zl {
|
15857
15861
|
/**
|
15858
15862
|
* Returns a formatted string representing a given amount with desired currency.
|
15859
15863
|
* @param currency The currency to represent the amount in.
|
@@ -15887,8 +15891,8 @@ class Vl {
|
|
15887
15891
|
return "USD0,0";
|
15888
15892
|
}
|
15889
15893
|
}
|
15890
|
-
const en = new
|
15891
|
-
class
|
15894
|
+
const en = new zl();
|
15895
|
+
class Gl {
|
15892
15896
|
constructor(t, e, a, r) {
|
15893
15897
|
this.presentmentCurrency = void 0, this.presentmentCurrency = r, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
|
15894
15898
|
}
|
@@ -15928,7 +15932,7 @@ class zl {
|
|
15928
15932
|
return t * Math.pow(10, en.getPrecisionForCurrency(e));
|
15929
15933
|
}
|
15930
15934
|
}
|
15931
|
-
const
|
15935
|
+
const Wl = async (n, t) => {
|
15932
15936
|
const e = await y.getShadowGraphqlClient().query({
|
15933
15937
|
query: Li(t?.assets?.metadata || !1),
|
15934
15938
|
errorPolicy: "all",
|
@@ -15950,7 +15954,7 @@ const Gl = async (n, t) => {
|
|
15950
15954
|
}), Kt.set({ id: i.option.id }, Promise.resolve(i.option)));
|
15951
15955
|
}), r.finalizeStepConfig || (r.finalizeStepConfig = {}), r.finalizeStepConfig.termsMarkdown = r.finalizeStepConfig.termsMarkdown || r.partner.termsMarkdown;
|
15952
15956
|
}), a;
|
15953
|
-
},
|
15957
|
+
}, ql = async (n, t) => {
|
15954
15958
|
const a = (await t).find((r) => r.id === n);
|
15955
15959
|
if (!a)
|
15956
15960
|
throw new Error(`Workflow not found: ${n}`);
|
@@ -15959,11 +15963,11 @@ const Gl = async (n, t) => {
|
|
15959
15963
|
const e = n.map((o) => Kt.get({ id: o, options: t })), a = n.filter((o, l) => e[l] === void 0);
|
15960
15964
|
if (a.length === 0)
|
15961
15965
|
return Promise.all(e);
|
15962
|
-
const r =
|
15963
|
-
(o) => Kt.set({ id: o, options: t },
|
15966
|
+
const r = Wl(a, t), i = a.map(
|
15967
|
+
(o) => Kt.set({ id: o, options: t }, ql(o, r))
|
15964
15968
|
), s = e.filter((o) => o !== void 0);
|
15965
15969
|
return await Promise.all(s.concat(i));
|
15966
|
-
},
|
15970
|
+
}, vd = async (n, t) => (await or([n], t))[0], Hl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
15967
15971
|
id: M(),
|
15968
15972
|
panelId: t.name,
|
15969
15973
|
name: t.name,
|
@@ -15977,11 +15981,11 @@ const Gl = async (n, t) => {
|
|
15977
15981
|
previewRegion: t.previewRegion,
|
15978
15982
|
useEditableArea: t.useEditableArea,
|
15979
15983
|
editableArea: t.editableArea
|
15980
|
-
})),
|
15984
|
+
})), jl = (n, t) => {
|
15981
15985
|
const e = n.workflowState, a = e ? JSON.parse(e) : void 0;
|
15982
|
-
return a ? Object.values(a.layouts).map((r) => r.layout) :
|
15986
|
+
return a ? Object.values(a.layouts).map((r) => r.layout) : Hl(t.panels);
|
15983
15987
|
};
|
15984
|
-
class
|
15988
|
+
class Ed {
|
15985
15989
|
constructor(t) {
|
15986
15990
|
this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
|
15987
15991
|
try {
|
@@ -15992,7 +15996,7 @@ class vd {
|
|
15992
15996
|
} catch (a) {
|
15993
15997
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15994
15998
|
}
|
15995
|
-
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.
|
15999
|
+
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.3.0-beta.69d8a509-cc6d-54dc-80c5-1c8b6fee8d45"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15996
16000
|
}
|
15997
16001
|
configure(t) {
|
15998
16002
|
gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Hr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -16006,7 +16010,7 @@ class vd {
|
|
16006
16010
|
}
|
16007
16011
|
getFlowService() {
|
16008
16012
|
if (!qr()) throw new Error("Application key required to use Flow Service.");
|
16009
|
-
return new
|
16013
|
+
return new Nl();
|
16010
16014
|
}
|
16011
16015
|
async getCurrencyContext(t) {
|
16012
16016
|
const a = (await this.getIntegration()).partner.currencyCode, i = await y.getShadowGraphqlClient().query({
|
@@ -16018,14 +16022,14 @@ class vd {
|
|
16018
16022
|
to: t
|
16019
16023
|
}
|
16020
16024
|
}), { rateFrom: s, rateTo: o } = i.data.currencyConversion;
|
16021
|
-
return new
|
16025
|
+
return new Gl(s, o, a, t);
|
16022
16026
|
}
|
16023
16027
|
async getIntegration() {
|
16024
16028
|
if (this.activeIntegration)
|
16025
16029
|
return this.activeIntegration;
|
16026
16030
|
if (!this.options.applicationKey)
|
16027
16031
|
throw new Error("Cannot get current Integration without specifying an Application Key.");
|
16028
|
-
return this.activeIntegration =
|
16032
|
+
return this.activeIntegration = Yl(this.options.applicationKey), this.activeIntegration;
|
16029
16033
|
}
|
16030
16034
|
async canUseAddon(t) {
|
16031
16035
|
try {
|
@@ -16152,7 +16156,7 @@ class vd {
|
|
16152
16156
|
})).data.customer;
|
16153
16157
|
if (!r.id) {
|
16154
16158
|
const o = (await e.mutate({
|
16155
|
-
mutation:
|
16159
|
+
mutation: Ol,
|
16156
16160
|
errorPolicy: "all",
|
16157
16161
|
fetchPolicy: "no-cache",
|
16158
16162
|
variables: {
|
@@ -16210,7 +16214,7 @@ class vd {
|
|
16210
16214
|
*/
|
16211
16215
|
async generateVerificationCode(t) {
|
16212
16216
|
await y.getShadowGraphqlClient().mutate({
|
16213
|
-
mutation:
|
16217
|
+
mutation: $l,
|
16214
16218
|
variables: {
|
16215
16219
|
emailAddress: t
|
16216
16220
|
}
|
@@ -16265,7 +16269,7 @@ class vd {
|
|
16265
16269
|
if (!this.customer?.id)
|
16266
16270
|
throw new Error("Customer must be logged in before calling this function.");
|
16267
16271
|
return (await y.getShadowGraphqlClient().query({
|
16268
|
-
query:
|
16272
|
+
query: Ul,
|
16269
16273
|
variables: {
|
16270
16274
|
id: this.customer.id
|
16271
16275
|
}
|
@@ -16461,12 +16465,12 @@ class vd {
|
|
16461
16465
|
},
|
16462
16466
|
errorPolicy: "all",
|
16463
16467
|
fetchPolicy: "no-cache"
|
16464
|
-
}),
|
16465
|
-
if (
|
16468
|
+
}), b = P.data.transactions;
|
16469
|
+
if (b.length !== C.length) {
|
16466
16470
|
const F = P.errors?.[0]?.message || "Unknown error";
|
16467
16471
|
throw new ht(`Not all transactions were found: ${F}`);
|
16468
16472
|
}
|
16469
|
-
return !this.activeIntegration &&
|
16473
|
+
return !this.activeIntegration && b[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(b[0].integrationProduct.integration)), b.map((F, Q) => ({
|
16470
16474
|
transaction: F,
|
16471
16475
|
workflowId: F.workflowId,
|
16472
16476
|
readOnly: C.find((T) => T.option.transactionId === F.id)?.option.readOnly ?? !1,
|
@@ -16478,13 +16482,15 @@ class vd {
|
|
16478
16482
|
const E = await a.mutate({
|
16479
16483
|
mutation: Bi,
|
16480
16484
|
variables: {
|
16481
|
-
inputs: C.map((
|
16482
|
-
integrationProductId:
|
16483
|
-
externalIntegrationId:
|
16484
|
-
externalProductId:
|
16485
|
-
workflowId:
|
16486
|
-
designName:
|
16487
|
-
claim: !0
|
16485
|
+
inputs: C.map((b) => ({
|
16486
|
+
integrationProductId: b.option.type === "integration" ? b.option.integrationProductId : void 0,
|
16487
|
+
externalIntegrationId: b.option.type === "external" ? b.option.externalIntegrationId : void 0,
|
16488
|
+
externalProductId: b.option.type === "external" ? b.option.externalProductId : void 0,
|
16489
|
+
workflowId: b.option.workflowId,
|
16490
|
+
designName: b.option.designName,
|
16491
|
+
claim: !0,
|
16492
|
+
quantity: b.option.type === "integration" ? b.option.quantity : void 0,
|
16493
|
+
recipient: b.option.type === "integration" ? b.option.recipient : void 0
|
16488
16494
|
})),
|
16489
16495
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
16490
16496
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
@@ -16493,24 +16499,24 @@ class vd {
|
|
16493
16499
|
fetchPolicy: "no-cache"
|
16494
16500
|
}), P = E.data?.transactionCreateMany;
|
16495
16501
|
if (!P || P.length === 0) {
|
16496
|
-
const
|
16497
|
-
throw new ht(`Failed to create transactions: ${
|
16502
|
+
const b = E.errors?.[0]?.message || "Unknown error";
|
16503
|
+
throw new ht(`Failed to create transactions: ${b}`);
|
16498
16504
|
}
|
16499
|
-
return P.map((
|
16500
|
-
transaction:
|
16501
|
-
workflowId:
|
16505
|
+
return P.map((b, F) => ({
|
16506
|
+
transaction: b,
|
16507
|
+
workflowId: b.workflowId,
|
16502
16508
|
readOnly: !1,
|
16503
16509
|
index: C[F].index
|
16504
16510
|
}));
|
16505
16511
|
}, s = t.map((C, E) => ({ option: C, index: E })), o = s.filter((C) => C.option.type === "transaction"), l = s.filter(
|
16506
16512
|
(C) => C.option.type === "integration" || C.option.type === "external"
|
16507
|
-
), c = Ma(o,
|
16513
|
+
), c = Ma(o, 50), d = Ma(l, 50), A = (await Promise.all([
|
16508
16514
|
...c.map(r),
|
16509
16515
|
...d.map(i)
|
16510
16516
|
])).flat(), u = [...new Set(A.map((C) => C.workflowId))], h = await or(u, e), m = new Map(h.map((C) => [C.id, C])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (C) => {
|
16511
|
-
const { transaction: E, workflowId: P, readOnly:
|
16517
|
+
const { transaction: E, workflowId: P, readOnly: b, index: F } = C, Q = m.get(P), T = t[F];
|
16512
16518
|
!g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
|
16513
|
-
const tt = g.get(E.id) || void 0, et = new
|
16519
|
+
const tt = g.get(E.id) || void 0, et = new Ll({
|
16514
16520
|
onMutate: () => ({ context: { transactionOwnerId: tt, bundleOwnerId: e?.bundleOwnerId } }),
|
16515
16521
|
onQuery: () => ({ context: { transactionOwnerId: tt, bundleOwnerId: e?.bundleOwnerId } })
|
16516
16522
|
}), W = {
|
@@ -16518,37 +16524,37 @@ class vd {
|
|
16518
16524
|
transaction: E,
|
16519
16525
|
layouts: [],
|
16520
16526
|
singleVariantsRenderable: T?.workflowConfiguration?.singleVariantsRenderable,
|
16521
|
-
stateMutationFunc:
|
16527
|
+
stateMutationFunc: b ? async () => {
|
16522
16528
|
throw new V("State mutation is forbidden in read only mode!");
|
16523
16529
|
} : async (q) => this.updateTransactionState({
|
16524
16530
|
...q,
|
16525
16531
|
context: { transactionOwnerId: tt, bundleOwnerId: e?.bundleOwnerId }
|
16526
16532
|
}),
|
16527
16533
|
graphQlClient: () => et,
|
16528
|
-
readOnly:
|
16534
|
+
readOnly: b,
|
16529
16535
|
workflow: Q,
|
16530
16536
|
isReloadedTransaction: T.type === "transaction"
|
16531
16537
|
};
|
16532
16538
|
if (T.type === "transaction" && E.workflowState) {
|
16533
16539
|
const q = JSON.parse(E.workflowState);
|
16534
16540
|
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await qa(q), W.reloadedState = q;
|
16535
|
-
} else if (!
|
16541
|
+
} else if (!b && T.workflowState) {
|
16536
16542
|
const q = JSON.parse(T.workflowState);
|
16537
16543
|
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await qa(q), W.reloadedState = q;
|
16538
16544
|
} else
|
16539
|
-
W.layouts =
|
16545
|
+
W.layouts = jl(
|
16540
16546
|
W.transaction,
|
16541
16547
|
W.workflow
|
16542
16548
|
);
|
16543
|
-
return W.renderableContextService = new
|
16549
|
+
return W.renderableContextService = new ll(
|
16544
16550
|
W.layouts
|
16545
16551
|
), W.delayWorkflowStateSync = !0, { experienceOptions: W, index: F, options: T };
|
16546
16552
|
}), f = await Promise.all(p);
|
16547
16553
|
k.setMap("transactionOwnerIds", g);
|
16548
|
-
const
|
16549
|
-
const { experienceOptions: E, options: P } = C,
|
16550
|
-
return await
|
16551
|
-
}), I = await Promise.all(
|
16554
|
+
const B = f.sort((C, E) => C.index - E.index).map(async (C) => {
|
16555
|
+
const { experienceOptions: E, options: P } = C, b = new Yo(this, E);
|
16556
|
+
return await b.getWorkflowManager().getInitializationPromise(), P.type !== "transaction" && this.customer && await b.attachCustomerDetails({ email: this.customer.emailAddress }), b;
|
16557
|
+
}), I = await Promise.all(B);
|
16552
16558
|
return I.forEach((C) => C.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), I;
|
16553
16559
|
}
|
16554
16560
|
storeCustomer(t) {
|
@@ -16618,7 +16624,7 @@ class vd {
|
|
16618
16624
|
};
|
16619
16625
|
}
|
16620
16626
|
}
|
16621
|
-
const
|
16627
|
+
const Yl = async (n, t) => (await y.getShadowGraphqlClient().query({
|
16622
16628
|
query: Wi,
|
16623
16629
|
errorPolicy: "all",
|
16624
16630
|
fetchPolicy: "no-cache",
|
@@ -16630,7 +16636,7 @@ const jl = async (n, t) => (await y.getShadowGraphqlClient().query({
|
|
16630
16636
|
variables: {
|
16631
16637
|
themeConfigurationId: t
|
16632
16638
|
}
|
16633
|
-
})).data.currentIntegration,
|
16639
|
+
})).data.currentIntegration, bd = async (n) => {
|
16634
16640
|
const e = await y.getShadowGraphqlClient().query({
|
16635
16641
|
query: xi,
|
16636
16642
|
errorPolicy: "all",
|
@@ -16641,27 +16647,38 @@ const jl = async (n, t) => (await y.getShadowGraphqlClient().query({
|
|
16641
16647
|
});
|
16642
16648
|
if (e.data.transactions.length !== 0)
|
16643
16649
|
return e.data.transactions[0];
|
16644
|
-
},
|
16650
|
+
}, Bd = async (n, t) => (await y.getShadowGraphqlClient().query({
|
16645
16651
|
query: Gi,
|
16646
16652
|
errorPolicy: "all",
|
16647
16653
|
variables: {
|
16648
16654
|
themeConfigurationId: n,
|
16649
16655
|
themeInstallId: t
|
16650
16656
|
}
|
16651
|
-
})).data?.marketplaceThemeInstallConfiguration,
|
16657
|
+
})).data?.marketplaceThemeInstallConfiguration, Id = async (n) => (await y.getShadowGraphqlClient().query({
|
16652
16658
|
query: Hi,
|
16653
16659
|
errorPolicy: "all",
|
16654
16660
|
variables: {
|
16655
16661
|
id: n
|
16656
16662
|
}
|
16657
|
-
})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,
|
16663
|
+
})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration, Pd = async (n) => (await y.getShadowGraphqlClient().query({
|
16658
16664
|
query: qi,
|
16659
16665
|
errorPolicy: "all",
|
16660
16666
|
variables: {
|
16661
16667
|
id: n
|
16662
16668
|
}
|
16663
|
-
})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration
|
16664
|
-
|
16669
|
+
})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration, Dd = async (n) => {
|
16670
|
+
const t = await y.getShadowGraphqlClient().mutate({
|
16671
|
+
mutation: Eo,
|
16672
|
+
errorPolicy: "all",
|
16673
|
+
fetchPolicy: "no-cache",
|
16674
|
+
variables: {
|
16675
|
+
id: n
|
16676
|
+
}
|
16677
|
+
});
|
16678
|
+
if (t.data?.bundleDelete !== n)
|
16679
|
+
throw new Error(`Failed to delete bundle: ${t.errors}`);
|
16680
|
+
};
|
16681
|
+
function Jl(n, t, e, a) {
|
16665
16682
|
const r = e.width * n.zoom, i = e.height * n.zoom;
|
16666
16683
|
if (a) {
|
16667
16684
|
const o = n, l = Math.max(t.width / e.width, t.height / e.height);
|
@@ -16675,7 +16692,7 @@ function Yl(n, t, e, a) {
|
|
16675
16692
|
function ge(n, t, e) {
|
16676
16693
|
return Math.min(Math.max(n, t), e);
|
16677
16694
|
}
|
16678
|
-
class
|
16695
|
+
class Kl {
|
16679
16696
|
constructor(t, e) {
|
16680
16697
|
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = un(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
|
16681
16698
|
useThreshold: !1,
|
@@ -16818,7 +16835,7 @@ class Jl {
|
|
16818
16835
|
return;
|
16819
16836
|
}
|
16820
16837
|
(!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((s, o) => {
|
16821
|
-
this.offsets[o] =
|
16838
|
+
this.offsets[o] = Jl(t[o], s, this.imageData, this.forceImageCover);
|
16822
16839
|
}), this._debouncedUpdateFrameOffsets(
|
16823
16840
|
this.offsets,
|
16824
16841
|
r,
|
@@ -16896,7 +16913,7 @@ class Jl {
|
|
16896
16913
|
}), this._debouncedUpdateFrameOffsets(this.offsets, t, this.frameData, this.thresholdSettings));
|
16897
16914
|
}
|
16898
16915
|
}
|
16899
|
-
class
|
16916
|
+
class Fd {
|
16900
16917
|
traversableScenes() {
|
16901
16918
|
throw new Error("Method not implemented.");
|
16902
16919
|
}
|
@@ -17061,12 +17078,12 @@ class Pd {
|
|
17061
17078
|
return [];
|
17062
17079
|
}
|
17063
17080
|
}
|
17064
|
-
var
|
17065
|
-
class
|
17081
|
+
var _l = /* @__PURE__ */ ((n) => (n.SelectFrame = "SelectFrame", n.SelectImage = "SelectImage", n.Position = "Position", n))(_l || {});
|
17082
|
+
class Xl extends Z {
|
17066
17083
|
constructor(t, e, a) {
|
17067
17084
|
super(t, e, a);
|
17068
17085
|
const r = e.data;
|
17069
|
-
this.frameService = new
|
17086
|
+
this.frameService = new Kl(r.forceImageCover, r.initialZoomLevel), this.frameService.connectWorkflowManager(t, e.stepName);
|
17070
17087
|
}
|
17071
17088
|
selectVariant(t) {
|
17072
17089
|
const e = this.manager.getRegionElements(this.step.stepName);
|
@@ -17226,7 +17243,7 @@ class _l extends Z {
|
|
17226
17243
|
return this.manager.getStepStorage(this.step.stepName);
|
17227
17244
|
}
|
17228
17245
|
}
|
17229
|
-
const
|
17246
|
+
const Zl = w`
|
17230
17247
|
query GetLoggedInCustomer($email: String!) {
|
17231
17248
|
customer(emailAddress: $email) {
|
17232
17249
|
id
|
@@ -17269,21 +17286,21 @@ const Xl = w`
|
|
17269
17286
|
total
|
17270
17287
|
}
|
17271
17288
|
}
|
17272
|
-
`,
|
17289
|
+
`, tc = w`
|
17273
17290
|
mutation SetTransactionDesignName($id: String!, $name: String!) {
|
17274
17291
|
transactionUpdate(id: $id, designName: $name) {
|
17275
17292
|
id
|
17276
17293
|
designName
|
17277
17294
|
}
|
17278
17295
|
}
|
17279
|
-
`,
|
17296
|
+
`, ec = w`
|
17280
17297
|
mutation DuplicateTransaction($id: String!, $template: Boolean!) {
|
17281
17298
|
transactionDuplicate(id: $id, template: $template) {
|
17282
17299
|
id
|
17283
17300
|
workflowViewerLink
|
17284
17301
|
}
|
17285
17302
|
}
|
17286
|
-
`,
|
17303
|
+
`, ac = w`
|
17287
17304
|
query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
|
17288
17305
|
customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
|
17289
17306
|
items {
|
@@ -17298,7 +17315,7 @@ const Xl = w`
|
|
17298
17315
|
total
|
17299
17316
|
}
|
17300
17317
|
}
|
17301
|
-
`,
|
17318
|
+
`, nc = w`
|
17302
17319
|
query GetTransactionsForBundle($id: String!) {
|
17303
17320
|
bundles(ids: [$id]) {
|
17304
17321
|
id
|
@@ -17319,21 +17336,21 @@ const Xl = w`
|
|
17319
17336
|
}
|
17320
17337
|
}
|
17321
17338
|
}
|
17322
|
-
`,
|
17339
|
+
`, rc = w`
|
17323
17340
|
mutation SetBundleName($id: String!, $name: String!) {
|
17324
17341
|
bundleUpdate(id: $id, name: $name) {
|
17325
17342
|
id
|
17326
17343
|
name
|
17327
17344
|
}
|
17328
17345
|
}
|
17329
|
-
`,
|
17346
|
+
`, ic = w`
|
17330
17347
|
mutation DuplicateBundle($id: String!, $template: Boolean!) {
|
17331
17348
|
bundleDuplicate(id: $id, template: $template) {
|
17332
17349
|
id
|
17333
17350
|
workflowViewerLink
|
17334
17351
|
}
|
17335
17352
|
}
|
17336
|
-
`,
|
17353
|
+
`, sc = w`
|
17337
17354
|
query GetBundleTemplates($id: String!, $limit: Int!, $offset: Int!) {
|
17338
17355
|
customerBundlesFeed(id: $id, limit: $limit, offset: $offset, template: true) {
|
17339
17356
|
items {
|
@@ -17346,43 +17363,43 @@ const Xl = w`
|
|
17346
17363
|
total
|
17347
17364
|
}
|
17348
17365
|
}
|
17349
|
-
`,
|
17350
|
-
mutation:
|
17366
|
+
`, xd = async (n, t, e) => await y.getShadowGraphqlClient().mutate({
|
17367
|
+
mutation: rc,
|
17351
17368
|
errorPolicy: "all",
|
17352
17369
|
variables: {
|
17353
17370
|
id: n,
|
17354
17371
|
name: t
|
17355
17372
|
},
|
17356
17373
|
context: e
|
17357
|
-
}),
|
17358
|
-
mutation:
|
17374
|
+
}), kd = async (n, t) => await y.getShadowGraphqlClient().mutate({
|
17375
|
+
mutation: tc,
|
17359
17376
|
errorPolicy: "all",
|
17360
17377
|
variables: {
|
17361
17378
|
id: n,
|
17362
17379
|
name: t
|
17363
17380
|
}
|
17364
|
-
}),
|
17365
|
-
mutation:
|
17381
|
+
}), Md = async (n, t) => await y.getShadowGraphqlClient().mutate({
|
17382
|
+
mutation: ic,
|
17366
17383
|
errorPolicy: "all",
|
17367
17384
|
variables: {
|
17368
17385
|
id: n,
|
17369
17386
|
template: t
|
17370
17387
|
}
|
17371
|
-
}),
|
17372
|
-
mutation:
|
17388
|
+
}), Td = async (n, t) => await y.getShadowGraphqlClient().mutate({
|
17389
|
+
mutation: ec,
|
17373
17390
|
errorPolicy: "all",
|
17374
17391
|
variables: {
|
17375
17392
|
id: n,
|
17376
17393
|
template: t
|
17377
17394
|
}
|
17378
|
-
}),
|
17379
|
-
query:
|
17395
|
+
}), Nd = async (n) => (await y.getShadowGraphqlClient().query({
|
17396
|
+
query: Zl,
|
17380
17397
|
errorPolicy: "all",
|
17381
17398
|
variables: {
|
17382
17399
|
email: n
|
17383
17400
|
}
|
17384
|
-
})).data.customer,
|
17385
|
-
query:
|
17401
|
+
})).data.customer, Qd = async (n, t, e) => await y.getShadowGraphqlClient().query({
|
17402
|
+
query: ac,
|
17386
17403
|
errorPolicy: "all",
|
17387
17404
|
fetchPolicy: "no-cache",
|
17388
17405
|
variables: {
|
@@ -17390,15 +17407,15 @@ const Xl = w`
|
|
17390
17407
|
offset: e,
|
17391
17408
|
limit: t
|
17392
17409
|
}
|
17393
|
-
}),
|
17394
|
-
query:
|
17410
|
+
}), Rd = async (n, t) => await y.getShadowGraphqlClient().query({
|
17411
|
+
query: nc,
|
17395
17412
|
errorPolicy: "all",
|
17396
17413
|
fetchPolicy: "no-cache",
|
17397
17414
|
variables: {
|
17398
17415
|
id: n
|
17399
17416
|
},
|
17400
17417
|
context: t
|
17401
|
-
}),
|
17418
|
+
}), Od = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
17402
17419
|
query: xa,
|
17403
17420
|
errorPolicy: "all",
|
17404
17421
|
fetchPolicy: "no-cache",
|
@@ -17418,7 +17435,7 @@ const Xl = w`
|
|
17418
17435
|
offset: e,
|
17419
17436
|
limit: t
|
17420
17437
|
}
|
17421
|
-
}))?.data.customerTransactionsFeed?.items || [],
|
17438
|
+
}))?.data.customerTransactionsFeed?.items || [], $d = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
17422
17439
|
query: xa,
|
17423
17440
|
errorPolicy: "all",
|
17424
17441
|
fetchPolicy: "no-cache",
|
@@ -17438,7 +17455,7 @@ const Xl = w`
|
|
17438
17455
|
offset: e,
|
17439
17456
|
limit: t
|
17440
17457
|
}
|
17441
|
-
}))?.data.customerTransactionsFeed?.items || [],
|
17458
|
+
}))?.data.customerTransactionsFeed?.items || [], Ud = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
17442
17459
|
query: xa,
|
17443
17460
|
errorPolicy: "all",
|
17444
17461
|
fetchPolicy: "no-cache",
|
@@ -17454,8 +17471,8 @@ const Xl = w`
|
|
17454
17471
|
offset: e,
|
17455
17472
|
limit: t
|
17456
17473
|
}
|
17457
|
-
}))?.data.customerTransactionsFeed?.items || [],
|
17458
|
-
query:
|
17474
|
+
}))?.data.customerTransactionsFeed?.items || [], Ld = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
17475
|
+
query: sc,
|
17459
17476
|
errorPolicy: "all",
|
17460
17477
|
fetchPolicy: "no-cache",
|
17461
17478
|
variables: {
|
@@ -17474,7 +17491,7 @@ const Xl = w`
|
|
17474
17491
|
console.error("vite-plugin-css-injected-by-js", t);
|
17475
17492
|
}
|
17476
17493
|
})();
|
17477
|
-
var
|
17494
|
+
var oc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(oc || {}), we = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(we || {}), K;
|
17478
17495
|
K = { __e: function(n, t, e, a) {
|
17479
17496
|
for (var r, i, s; t = t.__; )
|
17480
17497
|
if ((r = t.__c) && !r.__)
|
@@ -17487,7 +17504,7 @@ K = { __e: function(n, t, e, a) {
|
|
17487
17504
|
throw n;
|
17488
17505
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17489
17506
|
var st, ta, an, lr = [], ea = [], nn = K.__b, rn = K.__r, sn = K.diffed, on = K.__c, ln = K.unmount;
|
17490
|
-
function
|
17507
|
+
function lc() {
|
17491
17508
|
for (var n; n = lr.shift(); )
|
17492
17509
|
if (n.__P && n.__H)
|
17493
17510
|
try {
|
@@ -17507,7 +17524,7 @@ K.__b = function(n) {
|
|
17507
17524
|
}, K.diffed = function(n) {
|
17508
17525
|
sn && sn(n);
|
17509
17526
|
var t = n.__c;
|
17510
|
-
t && t.__H && (t.__H.__h.length && (lr.push(t) !== 1 && an === K.requestAnimationFrame || ((an = K.requestAnimationFrame) ||
|
17527
|
+
t && t.__H && (t.__H.__h.length && (lr.push(t) !== 1 && an === K.requestAnimationFrame || ((an = K.requestAnimationFrame) || cc)(lc)), t.__H.__.forEach(function(e) {
|
17511
17528
|
e.i && (e.__H = e.i), e.__V !== ea && (e.__ = e.__V), e.i = void 0, e.__V = ea;
|
17512
17529
|
})), ta = st = null;
|
17513
17530
|
}, K.__c = function(n, t) {
|
@@ -17534,7 +17551,7 @@ K.__b = function(n) {
|
|
17534
17551
|
}), e.__H = void 0, t && K.__e(t, e.__v));
|
17535
17552
|
};
|
17536
17553
|
var cn = typeof requestAnimationFrame == "function";
|
17537
|
-
function
|
17554
|
+
function cc(n) {
|
17538
17555
|
var t, e = function() {
|
17539
17556
|
clearTimeout(a), cn && cancelAnimationFrame(t), setTimeout(n);
|
17540
17557
|
}, a = setTimeout(e, 100);
|
@@ -17582,14 +17599,14 @@ const cr = w`
|
|
17582
17599
|
...AddressValidationResultFields
|
17583
17600
|
}
|
17584
17601
|
}
|
17585
|
-
`,
|
17602
|
+
`, dc = w`
|
17586
17603
|
${ka}
|
17587
17604
|
query GetAddressValidationJobs($ids: [String!]!) {
|
17588
17605
|
addressValidationJobs(ids: $ids) {
|
17589
17606
|
...AddressValidationJobFields
|
17590
17607
|
}
|
17591
17608
|
}
|
17592
|
-
`,
|
17609
|
+
`, Ac = w`
|
17593
17610
|
${ka}
|
17594
17611
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
17595
17612
|
recipients(ids: $ids) {
|
@@ -17599,31 +17616,31 @@ const cr = w`
|
|
17599
17616
|
}
|
17600
17617
|
}
|
17601
17618
|
}
|
17602
|
-
`,
|
17619
|
+
`, uc = w`
|
17603
17620
|
${cr}
|
17604
17621
|
mutation ValidateRecipientAddress($id: String!) {
|
17605
17622
|
recipientValidate(id: $id) {
|
17606
17623
|
...AddressValidationResultFields
|
17607
17624
|
}
|
17608
17625
|
}
|
17609
|
-
`,
|
17626
|
+
`, hc = w`
|
17610
17627
|
${ka}
|
17611
17628
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
17612
17629
|
recipientValidateBatch(ids: $ids) {
|
17613
17630
|
...AddressValidationJobFields
|
17614
17631
|
}
|
17615
17632
|
}
|
17616
|
-
`,
|
17633
|
+
`, mc = w`
|
17617
17634
|
mutation OverrideRecipientAddress($id: String!) {
|
17618
17635
|
recipientOverrideAddress(id: $id) {
|
17619
17636
|
id
|
17620
17637
|
}
|
17621
17638
|
}
|
17622
17639
|
`;
|
17623
|
-
var
|
17624
|
-
const
|
17640
|
+
var gc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(gc || {}), pc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(pc || {});
|
17641
|
+
const Vd = async (n) => {
|
17625
17642
|
const t = n.map((a) => a.getWorkflowManager().getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().query({
|
17626
|
-
query:
|
17643
|
+
query: Ac,
|
17627
17644
|
errorPolicy: "all",
|
17628
17645
|
fetchPolicy: "network-only",
|
17629
17646
|
variables: {
|
@@ -17635,23 +17652,23 @@ const Ud = async (n) => {
|
|
17635
17652
|
if (r)
|
17636
17653
|
return e.data?.recipients?.find((i) => i.id === r)?.addressValidationJob;
|
17637
17654
|
});
|
17638
|
-
},
|
17639
|
-
query:
|
17655
|
+
}, zd = async (n) => (await y.getShadowGraphqlClient().query({
|
17656
|
+
query: dc,
|
17640
17657
|
errorPolicy: "all",
|
17641
17658
|
fetchPolicy: "network-only",
|
17642
17659
|
variables: {
|
17643
17660
|
ids: n
|
17644
17661
|
}
|
17645
|
-
})).data?.addressValidationJobs,
|
17646
|
-
mutation:
|
17662
|
+
})).data?.addressValidationJobs, Gd = async (n) => n.getWorkflowManager().getTransaction().recipient?.id ? (await y.getShadowGraphqlClient().mutate({
|
17663
|
+
mutation: uc,
|
17647
17664
|
errorPolicy: "all",
|
17648
17665
|
fetchPolicy: "network-only",
|
17649
17666
|
variables: {
|
17650
17667
|
id: n.getWorkflowManager().getTransaction().recipient.id
|
17651
17668
|
}
|
17652
|
-
})).data?.recipientValidate : void 0,
|
17669
|
+
})).data?.recipientValidate : void 0, Wd = async (n) => {
|
17653
17670
|
const t = n.map((a) => a.getWorkflowManager().getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
|
17654
|
-
mutation:
|
17671
|
+
mutation: hc,
|
17655
17672
|
errorPolicy: "all",
|
17656
17673
|
fetchPolicy: "network-only",
|
17657
17674
|
variables: {
|
@@ -17663,12 +17680,12 @@ const Ud = async (n) => {
|
|
17663
17680
|
if (r)
|
17664
17681
|
return e.data?.recipientValidateBatch?.find((i) => i.entityId === r);
|
17665
17682
|
});
|
17666
|
-
},
|
17683
|
+
}, qd = async (n) => {
|
17667
17684
|
const t = n.getWorkflowManager().getTransaction().recipient?.id;
|
17668
17685
|
if (!t)
|
17669
17686
|
return;
|
17670
17687
|
(await y.getShadowGraphqlClient().mutate({
|
17671
|
-
mutation:
|
17688
|
+
mutation: mc,
|
17672
17689
|
errorPolicy: "all",
|
17673
17690
|
fetchPolicy: "network-only",
|
17674
17691
|
variables: {
|
@@ -17678,170 +17695,171 @@ const Ud = async (n) => {
|
|
17678
17695
|
};
|
17679
17696
|
export {
|
17680
17697
|
ga as AddonHandle,
|
17681
|
-
|
17682
|
-
|
17698
|
+
pc as AddressValidationJobStatus,
|
17699
|
+
gc as AddressValidationResultConfirmationLevel,
|
17683
17700
|
hn as AddressValidationStatus,
|
17684
|
-
|
17701
|
+
Sd as ArrayInput,
|
17685
17702
|
U as AspectType,
|
17686
17703
|
bt as AssetNotFoundError,
|
17687
17704
|
ve as AssetType,
|
17688
|
-
|
17689
|
-
|
17690
|
-
|
17705
|
+
md as BringForwardCommand,
|
17706
|
+
hd as BringToBackCommand,
|
17707
|
+
ud as BringToFrontCommand,
|
17691
17708
|
Dr as BundleDesignCreationCartAddMode,
|
17692
17709
|
N as CanvasCommand,
|
17693
17710
|
ue as CollectionProduct,
|
17694
17711
|
Za as ColorOptionGlobalPropertyHandle,
|
17695
17712
|
ms as CommandContext,
|
17696
17713
|
we as ConversionDataType,
|
17697
|
-
|
17714
|
+
oc as ConversionLocation,
|
17698
17715
|
z as CreateElementCommand,
|
17699
17716
|
qn as CreateLayoutCommand,
|
17700
|
-
|
17701
|
-
|
17717
|
+
Gl as CurrencyContext,
|
17718
|
+
zl as CurrencyService,
|
17702
17719
|
Bt as DeleteElementCommand,
|
17703
|
-
|
17704
|
-
|
17720
|
+
No as DigitalContentStepHandle,
|
17721
|
+
ml as FileUploadGlobalPropertyHandle,
|
17705
17722
|
he as FlowExecutionNodeResult,
|
17706
|
-
|
17707
|
-
|
17723
|
+
Ql as FlowExecutionResult,
|
17724
|
+
Nl as FlowService,
|
17708
17725
|
Cs as FontAlignmentCommand,
|
17709
17726
|
ps as FontColorCommand,
|
17710
17727
|
fs as FontSizeCommand,
|
17711
17728
|
ja as FontSourceCommand,
|
17712
|
-
|
17713
|
-
|
17714
|
-
|
17729
|
+
Kl as FrameService,
|
17730
|
+
_l as FrameStep,
|
17731
|
+
Xl as FrameStepHandle,
|
17715
17732
|
Da as GlobalPropertyHandle,
|
17716
17733
|
R as GroupCommand,
|
17717
|
-
|
17734
|
+
Io as IllustrationStepHandle,
|
17718
17735
|
Le as InformationMessageType,
|
17719
|
-
|
17736
|
+
To as InformationStepHandle,
|
17720
17737
|
tn as IntegrationProduct,
|
17721
17738
|
xr as IntegrationType,
|
17722
|
-
|
17739
|
+
od as LayoutElementFactory,
|
17723
17740
|
x as LayoutElementType,
|
17724
17741
|
Y as LayoutNotFoundError,
|
17725
17742
|
jt as LayoutRenderingPurpose,
|
17726
|
-
|
17743
|
+
Po as MaterialStepHandle,
|
17727
17744
|
Be as MisconfigurationError,
|
17728
|
-
|
17729
|
-
|
17730
|
-
|
17731
|
-
|
17745
|
+
Fd as MockWorkflowManager,
|
17746
|
+
Do as ModelStepHandle,
|
17747
|
+
Qo as ModuleStepHandle,
|
17748
|
+
ld as MoveCommand,
|
17732
17749
|
sr as ObjectInput,
|
17733
|
-
|
17750
|
+
Rl as ObjectInputType,
|
17734
17751
|
nr as OptionGlobalPropertyHandle,
|
17735
17752
|
be as OptionNotFoundError,
|
17736
17753
|
Dt as ParseError,
|
17737
|
-
|
17754
|
+
Fo as PictureStepHandle,
|
17738
17755
|
kr as ProductCameraRig,
|
17739
17756
|
ir as ProductCollection,
|
17740
|
-
|
17757
|
+
Bl as ProductCollectionProductSortKey,
|
17741
17758
|
qt as ProductWorkflow,
|
17742
17759
|
Kt as PromiseCache,
|
17743
17760
|
Tn as PromiseQueue,
|
17744
|
-
|
17761
|
+
xo as QuestionStepHandle,
|
17745
17762
|
Mn as QueueablePromise,
|
17746
|
-
|
17763
|
+
dd as ResizeCommand,
|
17747
17764
|
Yt as ResourceNotFoundError,
|
17748
|
-
|
17765
|
+
cd as RotateCommand,
|
17749
17766
|
H as ScaleAxis,
|
17750
|
-
|
17751
|
-
|
17767
|
+
gd as SendBackwardsCommand,
|
17768
|
+
ko as ShapeStepHandle,
|
17752
17769
|
Fr as ShareActionType,
|
17753
|
-
|
17770
|
+
Ed as SpiffCommerceClient,
|
17754
17771
|
Ee as StakeholderType,
|
17755
17772
|
Pr as StepAspectType,
|
17756
17773
|
Z as StepHandle,
|
17757
17774
|
v as StepType,
|
17758
17775
|
Mt as TextAlgorithm,
|
17759
17776
|
Ss as TextChangeCommand,
|
17760
|
-
|
17761
|
-
|
17762
|
-
|
17763
|
-
|
17764
|
-
|
17777
|
+
gl as TextGlobalPropertyHandle,
|
17778
|
+
yd as TextInput,
|
17779
|
+
Mo as TextStepHandle,
|
17780
|
+
Pl as Transform,
|
17781
|
+
Il as TransformCollection,
|
17765
17782
|
V as UnhandledBehaviorError,
|
17766
17783
|
Mr as UnitOfMeasurement,
|
17767
|
-
|
17784
|
+
Ad as UpdateImageSourceCommand,
|
17768
17785
|
it as Variant,
|
17769
|
-
|
17770
|
-
|
17786
|
+
jo as WorkflowExperienceEventType,
|
17787
|
+
Yo as WorkflowExperienceImpl,
|
17771
17788
|
O as assetService,
|
17772
17789
|
ri as browserColorToHex,
|
17773
|
-
|
17774
|
-
|
17775
|
-
|
17776
|
-
|
17790
|
+
id as cmPerPixel,
|
17791
|
+
Vo as createDesign,
|
17792
|
+
ad as currentDirection,
|
17793
|
+
Wc as dataUrlFromExternalUrl,
|
17794
|
+
Dd as deleteBundle,
|
17777
17795
|
Xe as designService,
|
17778
17796
|
Ce as determineCorrectFontSizeAndLines,
|
17779
17797
|
jn as digitalContentStepService,
|
17780
17798
|
dt as domParser,
|
17781
|
-
|
17782
|
-
|
17799
|
+
Md as duplicateBundle,
|
17800
|
+
Td as duplicateTransaction,
|
17783
17801
|
nt as fetchAsString,
|
17784
|
-
|
17802
|
+
Jc as findAngle,
|
17785
17803
|
$ as findElement,
|
17786
|
-
|
17804
|
+
jc as findPmsColors,
|
17787
17805
|
Vt as frameDataCache,
|
17788
17806
|
St as frameStepService,
|
17789
17807
|
M as generate,
|
17790
|
-
|
17808
|
+
ol as generateCommands,
|
17791
17809
|
ot as generateSVGWithUnknownColors,
|
17792
|
-
|
17793
|
-
|
17810
|
+
Cd as generateStateFromDesignInputSteps,
|
17811
|
+
zd as getAddressValidationJobs,
|
17794
17812
|
Re as getAttributesFromArrayBuffer,
|
17795
|
-
|
17796
|
-
|
17797
|
-
|
17798
|
-
|
17799
|
-
|
17800
|
-
|
17813
|
+
Yc as getAxisAlignedBoundingBox,
|
17814
|
+
Jl as getBoundedOffsets,
|
17815
|
+
Id as getBundleThemeConfiguration,
|
17816
|
+
Nd as getCustomer,
|
17817
|
+
Qd as getCustomerBundles,
|
17818
|
+
nd as getElementVertices,
|
17801
17819
|
Ue as getFrameData,
|
17802
|
-
|
17803
|
-
|
17804
|
-
|
17805
|
-
|
17806
|
-
|
17807
|
-
|
17808
|
-
|
17809
|
-
|
17810
|
-
|
17820
|
+
pd as getGlobalPropertyStateForBundle,
|
17821
|
+
Yl as getIntegration,
|
17822
|
+
td as getNEPoint,
|
17823
|
+
Zc as getNWPoint,
|
17824
|
+
$d as getOrderedTransactions,
|
17825
|
+
Bd as getOverrideThemeConfiguration,
|
17826
|
+
Xc as getPointOfRotation,
|
17827
|
+
wd as getProductCollections,
|
17828
|
+
ed as getSEPoint,
|
17811
17829
|
Ea as getSvgElement,
|
17812
|
-
|
17813
|
-
|
17814
|
-
|
17815
|
-
|
17816
|
-
|
17817
|
-
|
17818
|
-
|
17819
|
-
|
17820
|
-
|
17830
|
+
Ld as getTemplateBundles,
|
17831
|
+
Ud as getTemplateTransactions,
|
17832
|
+
bd as getTransaction,
|
17833
|
+
Pd as getTransactionThemeConfiguration,
|
17834
|
+
Rd as getTransactionsForBundle,
|
17835
|
+
_c as getTrueCoordinates,
|
17836
|
+
Od as getUnorderedTransactions,
|
17837
|
+
Vd as getValidationJobsForWorkflowExperiences,
|
17838
|
+
vd as getWorkflow,
|
17821
17839
|
or as getWorkflows,
|
17822
17840
|
y as graphQlManager,
|
17823
17841
|
fe as illustrationStepService,
|
17824
|
-
|
17842
|
+
Kc as isCloseToValue,
|
17825
17843
|
Nt as loadFont,
|
17826
|
-
|
17844
|
+
Hc as matchHexToPms,
|
17827
17845
|
Yn as materialStepService,
|
17828
|
-
|
17829
|
-
|
17846
|
+
bl as metafieldManager,
|
17847
|
+
rd as mmPerPixel,
|
17830
17848
|
Jn as modelStepService,
|
17831
17849
|
Sa as modifySVGColors,
|
17832
17850
|
Kn as moduleStepService,
|
17833
|
-
|
17834
|
-
|
17851
|
+
xd as nameBundle,
|
17852
|
+
kd as nameTransaction,
|
17835
17853
|
j as optionService,
|
17836
|
-
|
17837
|
-
|
17854
|
+
sd as outlineFontsInSvg,
|
17855
|
+
qd as overrideWorkflowExperienceRecipientAddress,
|
17838
17856
|
ut as patternImageDataCache,
|
17839
17857
|
k as persistenceService,
|
17840
17858
|
_n as pictureStepService,
|
17841
|
-
|
17859
|
+
qc as pmsToRgb,
|
17842
17860
|
Xn as questionStepService,
|
17843
|
-
|
17844
|
-
|
17861
|
+
Gc as registerFetchImplementation,
|
17862
|
+
zc as registerWindowImplementation,
|
17845
17863
|
qa as rehydrateSerializedLayout,
|
17846
17864
|
ei as rgbToPms,
|
17847
17865
|
ce as rotateAroundPoint,
|
@@ -17851,14 +17869,14 @@ export {
|
|
17851
17869
|
zt as shapeStepService,
|
17852
17870
|
Es as shortenUrl,
|
17853
17871
|
gt as spiffCoreConfiguration,
|
17854
|
-
|
17872
|
+
fd as stepAspectValuesToDesignInputSteps,
|
17855
17873
|
La as svgColorValueToDefinition,
|
17856
17874
|
Gn as svgStringDimensions,
|
17857
17875
|
pa as svgToDataUrl,
|
17858
17876
|
G as textStepService,
|
17859
17877
|
Ts as toast,
|
17860
|
-
|
17861
|
-
|
17878
|
+
Gd as validateWorkflowExperienceRecipient,
|
17879
|
+
Wd as validateWorkflowExperienceRecipients,
|
17862
17880
|
It as xmlSerializer
|
17863
17881
|
};
|
17864
17882
|
//# sourceMappingURL=index.mjs.map
|