@primestyleai/tryon 5.10.47 → 5.10.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +719 -711
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +10 -2
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { P as sP, L as wP, b as ag, a as tn, c as jg, A as dg, S as Ug, i as Fg } from "../index-DfsSxOUa.js";
|
|
3
3
|
import { jsxs as f, jsx as A, Fragment as rA } from "react/jsx-runtime";
|
|
4
|
-
import { useState as d, useRef as
|
|
4
|
+
import { useState as d, useRef as aA, useCallback as EA, useEffect as NA, useMemo as pf } from "react";
|
|
5
5
|
import { createPortal as Vn } from "react-dom";
|
|
6
6
|
const mn = 11, Jn = 12, vP = 13, tP = 14, iP = 15, DP = 16, Nn = 23, Sn = 24, rP = 25, CP = 26, HP = 27, QP = 28, zP = 0;
|
|
7
7
|
let En = null, Qn = null;
|
|
@@ -31,7 +31,7 @@ async function Un(n) {
|
|
|
31
31
|
const g = await TP(n), e = En.detect(g);
|
|
32
32
|
if (!e?.landmarks?.length || e.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2, c = H - w, z = w + c * 0.28, T = Math.abs(D.x - P.x), x = Math.min(P.x, D.x) - T * 0.05, l = Math.max(P.x, D.x) + T * 0.05,
|
|
34
|
+
const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2, c = H - w, z = w + c * 0.28, T = Math.abs(D.x - P.x), x = Math.min(P.x, D.x) - T * 0.05, l = Math.max(P.x, D.x) + T * 0.05, fA = Math.abs(C.x - i.x), r = Math.min(i.x, C.x) - fA * 0.15, b = Math.max(i.x, C.x) + fA * 0.15, k = z + (H - z) * 0.55, v = T * 0.85, O = (P.x + D.x + i.x + C.x) / 4, s = O - v / 2, S = O + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: z, x1: x, x2: l },
|
|
37
37
|
waist: { y: k, x1: s, x2: S },
|
|
@@ -199,24 +199,24 @@ function Ig(n, g, e) {
|
|
|
199
199
|
const C = D > 0 ? cP / D : 0, w = (K, F) => Math.hypot(
|
|
200
200
|
(K.x - F.x) * g,
|
|
201
201
|
(K.y - F.y) * e
|
|
202
|
-
) * C, H = w(n.leftIrisCenter, n.rightIrisCenter), z = w(n.leftInnerEye, n.rightInnerEye) / 1.6, T = w(n.leftTragus, n.rightTragus), x = w(n.leftTragus, n.leftOuterEye), l = w(n.rightTragus, n.rightOuterEye),
|
|
202
|
+
) * C, H = w(n.leftIrisCenter, n.rightIrisCenter), z = w(n.leftInnerEye, n.rightInnerEye) / 1.6, T = w(n.leftTragus, n.rightTragus), x = w(n.leftTragus, n.leftOuterEye), l = w(n.rightTragus, n.rightOuterEye), fA = (x + l) / 2, r = T * 1.07, k = Math.abs((n.forehead.z ?? 0) - (n.chin.z ?? 0)) * g * C, v = Math.max(170, Math.min(210, k || 190)), O = r / 2, s = v / 2, S = Math.PI * Math.sqrt(2 * (O * O + s * s));
|
|
203
203
|
return {
|
|
204
204
|
measurements: {
|
|
205
205
|
irisDiameter: cP,
|
|
206
|
-
pd:
|
|
207
|
-
bridgeWidth:
|
|
208
|
-
faceWidth:
|
|
209
|
-
templeLengthLeft:
|
|
210
|
-
templeLengthRight:
|
|
211
|
-
templeLength:
|
|
212
|
-
headWidth:
|
|
213
|
-
headDepth:
|
|
214
|
-
headCircumference:
|
|
206
|
+
pd: uf(H),
|
|
207
|
+
bridgeWidth: uf(z),
|
|
208
|
+
faceWidth: uf(T),
|
|
209
|
+
templeLengthLeft: uf(x),
|
|
210
|
+
templeLengthRight: uf(l),
|
|
211
|
+
templeLength: uf(fA),
|
|
212
|
+
headWidth: uf(r),
|
|
213
|
+
headDepth: uf(v),
|
|
214
|
+
headCircumference: uf(S)
|
|
215
215
|
},
|
|
216
216
|
irisConfidence: i
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function uf(n) {
|
|
220
220
|
return Math.round(n * 10) / 10;
|
|
221
221
|
}
|
|
222
222
|
async function Rg(n) {
|
|
@@ -6948,7 +6948,7 @@ function ne({ view: n, stepIndex: g }) {
|
|
|
6948
6948
|
return n === "error" || n === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: bg }, (e, B) => B + 1).map((e) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${e < g ? " ps-done" : e === g ? " ps-active" : ""}` }, e)) });
|
|
6949
6949
|
}
|
|
6950
6950
|
function Pe({ activeLocale: n, onSelect: g }) {
|
|
6951
|
-
const [e, B] = d(!1), P =
|
|
6951
|
+
const [e, B] = d(!1), P = aA(null), D = aA(null), [i, C] = d({ top: 0, right: 0 }), w = wP[n] || "English", H = EA(() => {
|
|
6952
6952
|
if (!P.current) return;
|
|
6953
6953
|
const c = P.current.getBoundingClientRect();
|
|
6954
6954
|
C({ top: c.bottom + 4, right: window.innerWidth - c.right });
|
|
@@ -7035,7 +7035,7 @@ function yP({
|
|
|
7035
7035
|
typeof k == "number" && k > 0 && (r[b] = String(k));
|
|
7036
7036
|
}
|
|
7037
7037
|
return r;
|
|
7038
|
-
}), T = i === "female" ? ee : ge, [x, l] = d(""),
|
|
7038
|
+
}), T = i === "female" ? ee : ge, [x, l] = d(""), fA = () => {
|
|
7039
7039
|
const r = [];
|
|
7040
7040
|
P.trim() || r.push(B("Profile Name"));
|
|
7041
7041
|
for (const k of T)
|
|
@@ -7131,7 +7131,7 @@ function yP({
|
|
|
7131
7131
|
x && /* @__PURE__ */ A("div", { className: "ps-tryon-pe-error", children: x }),
|
|
7132
7132
|
/* @__PURE__ */ f("div", { className: "ps-tryon-pe-actions", children: [
|
|
7133
7133
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-est-back", onClick: e, children: B("Cancel") }),
|
|
7134
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-pe-save", onClick:
|
|
7134
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-pe-save", onClick: fA, children: B(n ? "Save Changes" : "Create Profile") })
|
|
7135
7135
|
] })
|
|
7136
7136
|
] });
|
|
7137
7137
|
}
|
|
@@ -7154,7 +7154,7 @@ function Be({
|
|
|
7154
7154
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
7155
7155
|
createdAt: Date.now()
|
|
7156
7156
|
};
|
|
7157
|
-
B((
|
|
7157
|
+
B((fA) => [l, ...fA]), c(!1);
|
|
7158
7158
|
};
|
|
7159
7159
|
return /* @__PURE__ */ f("div", { className: `ps-tryon-drawer${n ? " ps-tryon-drawer-open" : ""}`, children: [
|
|
7160
7160
|
/* @__PURE__ */ f("div", { className: "ps-tryon-drawer-header", children: [
|
|
@@ -7198,15 +7198,15 @@ function Be({
|
|
|
7198
7198
|
/* @__PURE__ */ A("span", { className: "ps-tryon-history-size-badge", children: x.recommendedSize }),
|
|
7199
7199
|
x.reasoning && /* @__PURE__ */ A("span", { className: "ps-tryon-history-sizing-reason", children: x.reasoning })
|
|
7200
7200
|
] }),
|
|
7201
|
-
z(x) && x.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(x.sizingResult.sections).map(([
|
|
7202
|
-
|
|
7201
|
+
z(x) && x.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(x.sizingResult.sections).map(([fA, r]) => /* @__PURE__ */ f("span", { className: "ps-tryon-history-section-chip", children: [
|
|
7202
|
+
fA,
|
|
7203
7203
|
": ",
|
|
7204
7204
|
r.recommendedSize
|
|
7205
|
-
] },
|
|
7205
|
+
] }, fA)) }),
|
|
7206
7206
|
x.resultImageUrl && /* @__PURE__ */ A("span", { className: "ps-tryon-history-tryon-badge", children: w("Try-on") })
|
|
7207
7207
|
] }),
|
|
7208
|
-
/* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (
|
|
7209
|
-
|
|
7208
|
+
/* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (fA) => {
|
|
7209
|
+
fA.stopPropagation(), D((r) => r.filter((b, k) => k !== l));
|
|
7210
7210
|
}, children: /* @__PURE__ */ A(yg, {}) })
|
|
7211
7211
|
] }, x.id)),
|
|
7212
7212
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-clear", onClick: () => D([]), children: w("Clear All") })
|
|
@@ -7392,11 +7392,11 @@ function te({
|
|
|
7392
7392
|
setSizingMethod: T,
|
|
7393
7393
|
setSizingLoading: x,
|
|
7394
7394
|
setView: l,
|
|
7395
|
-
submitSizing:
|
|
7395
|
+
submitSizing: fA,
|
|
7396
7396
|
t: r
|
|
7397
7397
|
}) {
|
|
7398
7398
|
const b = C === "in" ? "in" : "cm", k = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), v = P.filter((s) => s.required && s.unit === "cm" && !k.has(s.key)), O = () => {
|
|
7399
|
-
D.current.gender = i, T("exact"), x(!0), l("size-result"),
|
|
7399
|
+
D.current.gender = i, T("exact"), x(!0), l("size-result"), fA("exact");
|
|
7400
7400
|
};
|
|
7401
7401
|
return B || !e ? /* @__PURE__ */ f("div", { className: "ps-bp-layout", children: [
|
|
7402
7402
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: n, alt: g, className: "ps-bp-image-img" }) }),
|
|
@@ -7563,7 +7563,7 @@ function ce({ landmarks: n, w: g, h: e }) {
|
|
|
7563
7563
|
}
|
|
7564
7564
|
const zn = 22, Ln = 27, bn = 2 * Math.PI * Ln;
|
|
7565
7565
|
function pe({ t: n }) {
|
|
7566
|
-
const g =
|
|
7566
|
+
const g = aA(Date.now()), e = aA(null), B = aA(null), P = aA(null), D = aA(null);
|
|
7567
7567
|
return NA(() => {
|
|
7568
7568
|
g.current = Date.now();
|
|
7569
7569
|
const i = setInterval(() => {
|
|
@@ -7634,7 +7634,7 @@ function UP({
|
|
|
7634
7634
|
}, [H.length, P]), NA(() => {
|
|
7635
7635
|
w && e && x === 0 && l(1);
|
|
7636
7636
|
}, [e]);
|
|
7637
|
-
const
|
|
7637
|
+
const fA = H[x] ?? H[0];
|
|
7638
7638
|
return /* @__PURE__ */ f("div", { className: "ps-msc-root", children: [
|
|
7639
7639
|
/* @__PURE__ */ f("div", { className: "ps-msc-viewfinder", children: [
|
|
7640
7640
|
C && /* @__PURE__ */ A(
|
|
@@ -7649,8 +7649,8 @@ function UP({
|
|
|
7649
7649
|
w && e && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(ce, { landmarks: e, w: c.w, h: c.h }) })
|
|
7650
7650
|
] }),
|
|
7651
7651
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ f("div", { className: "ps-msc-stage-slot", children: [
|
|
7652
|
-
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children:
|
|
7653
|
-
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children:
|
|
7652
|
+
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: fA.title }),
|
|
7653
|
+
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: fA.desc })
|
|
7654
7654
|
] }, x) }),
|
|
7655
7655
|
P && /* @__PURE__ */ A("div", { style: { display: "flex", justifyContent: "center", padding: "0 16px", width: "100%" }, children: /* @__PURE__ */ A(pe, { t: i }) }),
|
|
7656
7656
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
@@ -7699,7 +7699,7 @@ function Ue({
|
|
|
7699
7699
|
overlayNode: T,
|
|
7700
7700
|
showLines: x,
|
|
7701
7701
|
onToggleLines: l,
|
|
7702
|
-
onImageLoad:
|
|
7702
|
+
onImageLoad: fA,
|
|
7703
7703
|
t: r
|
|
7704
7704
|
}) {
|
|
7705
7705
|
const b = pf(() => {
|
|
@@ -7726,7 +7726,7 @@ function Ue({
|
|
|
7726
7726
|
src: k,
|
|
7727
7727
|
alt: g,
|
|
7728
7728
|
className: "ps-msr-product-img",
|
|
7729
|
-
onLoad:
|
|
7729
|
+
onLoad: fA
|
|
7730
7730
|
}
|
|
7731
7731
|
),
|
|
7732
7732
|
x && T,
|
|
@@ -7850,7 +7850,7 @@ const Ee = [
|
|
|
7850
7850
|
["rightKnee", "rightAnkle"]
|
|
7851
7851
|
], cn = 22, Zn = 27, Xn = 2 * Math.PI * Zn;
|
|
7852
7852
|
function LP({ t: n, isActive: g }) {
|
|
7853
|
-
const e =
|
|
7853
|
+
const e = aA(null), B = aA(null), P = aA(null), D = aA(null), i = aA(null);
|
|
7854
7854
|
return NA(() => {
|
|
7855
7855
|
if (!g) {
|
|
7856
7856
|
e.current = null;
|
|
@@ -8087,12 +8087,12 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
|
|
|
8087
8087
|
{ key: "waist", line: n.waist, label: "Waist" },
|
|
8088
8088
|
{ key: "hips", line: n.hips, label: "Hips" }
|
|
8089
8089
|
], C = B, w = P, H = Math.max(C, w) / 500, c = Math.max(5, 3 * H), z = Math.max(7, 5 * H);
|
|
8090
|
-
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${C} ${w}`, preserveAspectRatio: "xMidYMid meet", children: i.map(({ key: T, line: x, label: l },
|
|
8090
|
+
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${C} ${w}`, preserveAspectRatio: "xMidYMid meet", children: i.map(({ key: T, line: x, label: l }, fA) => {
|
|
8091
8091
|
if (!x || typeof x.x1 != "number" || typeof x.x2 != "number" || typeof x.y != "number") return null;
|
|
8092
8092
|
const r = x.x1 * C, b = x.x2 * C, k = x.y * w, v = b - r, O = v * 0.06, s = (r + b) / 2, S = g.find((iA) => {
|
|
8093
8093
|
const BA = iA.area.toLowerCase().trim();
|
|
8094
8094
|
return !!(BA === T || T === "chest" && (BA.includes("bust") || BA.includes("chest")) || T === "waist" && BA.includes("waist") || T === "hips" && (BA.includes("hip") || BA === "hips"));
|
|
8095
|
-
}), K = S ? D(S.fit) : "#2154EF", F =
|
|
8095
|
+
}), K = S ? D(S.fit) : "#2154EF", F = fA * 0.35, tA = `M ${r} ${k} Q ${s} ${k + O} ${b} ${k}`, wA = v * 1.05, YA = S ? S.fit === "good" ? "✓ Fit" : S.isLength ? S.fit.includes("short") || S.fit.includes("tight") ? "Short" : "Long" : S.fit.includes("tight") ? "Tight" : "Loose" : l, h = Math.round(14 * H), a = YA.length * h * 0.62, RA = C - b - 12 * H < a, vA = RA ? r - 10 * H : b + 10 * H, N = RA ? "end" : "start", PA = RA ? r : b, kA = RA ? r - 6 * H : b + 6 * H;
|
|
8096
8096
|
return /* @__PURE__ */ f("g", { children: [
|
|
8097
8097
|
/* @__PURE__ */ A(
|
|
8098
8098
|
"path",
|
|
@@ -8133,7 +8133,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
|
|
|
8133
8133
|
/* @__PURE__ */ A(
|
|
8134
8134
|
"line",
|
|
8135
8135
|
{
|
|
8136
|
-
x1:
|
|
8136
|
+
x1: PA,
|
|
8137
8137
|
y1: k,
|
|
8138
8138
|
x2: kA,
|
|
8139
8139
|
y2: k,
|
|
@@ -8151,7 +8151,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
|
|
|
8151
8151
|
fontWeight: "700",
|
|
8152
8152
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
8153
8153
|
dominantBaseline: "middle",
|
|
8154
|
-
textAnchor:
|
|
8154
|
+
textAnchor: N,
|
|
8155
8155
|
children: YA
|
|
8156
8156
|
}
|
|
8157
8157
|
)
|
|
@@ -8163,7 +8163,7 @@ const qn = (n) => {
|
|
|
8163
8163
|
if (n == null) return "";
|
|
8164
8164
|
const g = n.replace(/[^\d.\-\u2013]/g, " ").trim().split(/[\s\-\u2013]+/).filter(Boolean).map((e) => parseFloat(e)).filter((e) => !isNaN(e));
|
|
8165
8165
|
return g.length === 1 ? `${g[0]}` : g.length > 1 ? `${g[0]}–${g[1]}` : n;
|
|
8166
|
-
},
|
|
8166
|
+
}, kf = (n) => {
|
|
8167
8167
|
if (n == null) return 0;
|
|
8168
8168
|
const g = parseFloat(n.replace(/[^\d.]/g, ""));
|
|
8169
8169
|
return isNaN(g) ? 0 : g;
|
|
@@ -8215,7 +8215,7 @@ function pn({
|
|
|
8215
8215
|
isTryOnImage: T,
|
|
8216
8216
|
showLines: x,
|
|
8217
8217
|
onToggleLines: l,
|
|
8218
|
-
overlayNode:
|
|
8218
|
+
overlayNode: fA,
|
|
8219
8219
|
onImageLoad: r,
|
|
8220
8220
|
onTryOn: b,
|
|
8221
8221
|
tryOnProcessing: k,
|
|
@@ -8228,34 +8228,34 @@ function pn({
|
|
|
8228
8228
|
onRegenerateTryOn: tA,
|
|
8229
8229
|
pendingCustomSize: wA
|
|
8230
8230
|
}) {
|
|
8231
|
-
const YA = e?.recommendedSize || "", [h, a] = d(null),
|
|
8231
|
+
const YA = e?.recommendedSize || "", [h, a] = d(null), uA = P.toLowerCase(), RA = uA.includes("mm") ? "mm" : uA.includes("cm") ? "cm" : "in", vA = D || RA, N = (E) => ZP(E, vA, RA), PA = (E) => Re(E, vA, RA), kA = O ? Object.keys(O) : [], [iA, BA] = d(null), OA = i?.secResult?.recommendedSize || "", [gf, KA] = d(null), ef = pf(() => {
|
|
8232
8232
|
if (!i) return [];
|
|
8233
|
-
const E = i.section, y = E.headers.findIndex((FA) => /size|taglia|größe|taille/i.test(FA.trim())),
|
|
8233
|
+
const E = i.section, y = E.headers.findIndex((FA) => /size|taglia|größe|taille/i.test(FA.trim())), QA = y >= 0 ? y : 0, Q = E.headers[QA] || "Size", Z = E.rows.map((FA) => Rf(FA, QA, Q)).filter(Boolean);
|
|
8234
8234
|
return [...new Set(Z)];
|
|
8235
8235
|
}, [i]), hA = pf(() => ({}), []), Pf = pf(() => {
|
|
8236
8236
|
const E = g.headers.findIndex((y) => /size|taglia|größe|taille/i.test(y.trim()));
|
|
8237
8237
|
if (E >= 0) return E;
|
|
8238
8238
|
for (let y = 0; y < g.headers.length; y++) {
|
|
8239
|
-
const
|
|
8240
|
-
if (g.rows.some((Q) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Rf(Q, y,
|
|
8239
|
+
const QA = g.headers[y];
|
|
8240
|
+
if (g.rows.some((Q) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Rf(Q, y, QA)))) return y;
|
|
8241
8241
|
}
|
|
8242
8242
|
return 0;
|
|
8243
8243
|
}, [g]), ZA = g.headers[Pf] || "Size", df = pf(() => {
|
|
8244
8244
|
const E = g.rows.map((y) => Rf(y, Pf, ZA)).filter(Boolean);
|
|
8245
8245
|
return [...new Set(E)];
|
|
8246
|
-
}, [g, Pf, ZA]),
|
|
8246
|
+
}, [g, Pf, ZA]), jA = h || YA, Bf = jA === YA, DA = pf(() => {
|
|
8247
8247
|
if (Bf) return null;
|
|
8248
|
-
const E = e?.matchDetails ?? [], y = /tight|loose|large|small|very/i,
|
|
8249
|
-
return w(
|
|
8250
|
-
}, [Bf, e, w]), TA = iA && Bf && O && O[iA] ? O[iA] :
|
|
8248
|
+
const E = e?.matchDetails ?? [], y = /tight|loose|large|small|very/i, QA = E.some((Q) => y.test(Q.fit || ""));
|
|
8249
|
+
return w(QA ? "Not Recommended" : "Your Selection");
|
|
8250
|
+
}, [Bf, e, w]), TA = iA && Bf && O && O[iA] ? O[iA] : jA, I = pf(() => {
|
|
8251
8251
|
const E = [];
|
|
8252
8252
|
for (let y = 0; y < g.headers.length; y++) {
|
|
8253
|
-
const
|
|
8254
|
-
if (/\(cm\)|centimeter/i.test(
|
|
8253
|
+
const QA = (g.headers[y] || "").toLowerCase();
|
|
8254
|
+
if (/\(cm\)|centimeter/i.test(QA)) {
|
|
8255
8255
|
E.push("cm");
|
|
8256
8256
|
continue;
|
|
8257
8257
|
}
|
|
8258
|
-
if (/\(in\)|\(inch|inch/i.test(
|
|
8258
|
+
if (/\(in\)|\(inch|inch/i.test(QA)) {
|
|
8259
8259
|
E.push("in");
|
|
8260
8260
|
continue;
|
|
8261
8261
|
}
|
|
@@ -8276,16 +8276,16 @@ function pn({
|
|
|
8276
8276
|
E.push(Q);
|
|
8277
8277
|
}
|
|
8278
8278
|
return E;
|
|
8279
|
-
}, [g]),
|
|
8280
|
-
const
|
|
8279
|
+
}, [g]), XA = EA((E, y) => {
|
|
8280
|
+
const QA = E.toLowerCase().trim(), Q = P === "cm" || P === "", Z = Q ? "cm" : "in", FA = [];
|
|
8281
8281
|
for (let V = 0; V < g.headers.length; V++) {
|
|
8282
8282
|
const xA = (g.headers[V] || "").toLowerCase().trim();
|
|
8283
|
-
if (xA ===
|
|
8283
|
+
if (xA === QA) {
|
|
8284
8284
|
FA.push(V);
|
|
8285
8285
|
continue;
|
|
8286
8286
|
}
|
|
8287
8287
|
const wf = xA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8288
|
-
(wf ===
|
|
8288
|
+
(wf === QA || xA.includes(QA) || QA.includes(wf)) && FA.push(V);
|
|
8289
8289
|
}
|
|
8290
8290
|
if (FA.length === 0) return null;
|
|
8291
8291
|
let SA = FA.find((V) => I[V] === Z);
|
|
@@ -8308,16 +8308,16 @@ function pn({
|
|
|
8308
8308
|
return { range: String(V(W.min)) + (W.min !== W.max ? "–" + String(V(W.max)) : ""), min: V(W.min), max: V(W.max) };
|
|
8309
8309
|
}
|
|
8310
8310
|
return { range: qA, ...W };
|
|
8311
|
-
}, [g, Pf, ZA, P, I]),
|
|
8311
|
+
}, [g, Pf, ZA, P, I]), AA = pf(() => {
|
|
8312
8312
|
if (S)
|
|
8313
8313
|
return (e?.matchDetails || []).map((L) => {
|
|
8314
8314
|
let V = L.chartRange, xA = L.fit;
|
|
8315
|
-
if (
|
|
8316
|
-
const wf =
|
|
8315
|
+
if (jA !== YA) {
|
|
8316
|
+
const wf = XA(L.measurement, jA);
|
|
8317
8317
|
if (wf && (wf.min > 0 || wf.max > 0)) {
|
|
8318
|
-
const
|
|
8319
|
-
V = wf.range + (
|
|
8320
|
-
const Df =
|
|
8318
|
+
const cA = (L.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
|
|
8319
|
+
V = wf.range + (cA ? ` ${cA.trim()}` : "");
|
|
8320
|
+
const Df = kf(L.userValue);
|
|
8321
8321
|
if (Df > 0) {
|
|
8322
8322
|
const Af = wf.min, Hf = wf.max, WA = Hf - Af, ff = WA > 0 ? WA * 0.5 : Af * 0.05 || 3, nf = Math.max((Hf || Af) * 5e-3, 0.25);
|
|
8323
8323
|
if (Df >= Af - nf && Df <= Hf + nf) xA = "good";
|
|
@@ -8341,9 +8341,9 @@ function pn({
|
|
|
8341
8341
|
isLength: !1
|
|
8342
8342
|
};
|
|
8343
8343
|
});
|
|
8344
|
-
const E = e?.matchDetails || [], y = i?.secResult?.matchDetails || [],
|
|
8344
|
+
const E = e?.matchDetails || [], y = i?.secResult?.matchDetails || [], QA = /* @__PURE__ */ new Set(), Q = [...E, ...y].filter((W) => {
|
|
8345
8345
|
const L = String(W?.measurement ?? "").toLowerCase().trim();
|
|
8346
|
-
return !L ||
|
|
8346
|
+
return !L || QA.has(L) ? !1 : (QA.add(L), !0);
|
|
8347
8347
|
}), Z = e?.length || "", FA = (e?.availableLengths?.length || 0) > 0, SA = OA || Z, tf = !!(i || FA), bA = Q.some((W) => W.measurement.toLowerCase() === "height"), _ = !!i?.section?.headers?.some((W) => /height|altezza|estatura|\(cm\)/i.test(W));
|
|
8348
8348
|
if (i && _ && !bA) {
|
|
8349
8349
|
const W = B.height || 0;
|
|
@@ -8366,50 +8366,50 @@ function pn({
|
|
|
8366
8366
|
const qA = new Set(y.map((W) => W.measurement));
|
|
8367
8367
|
return tf && qA.add("Height"), Q.map((W) => {
|
|
8368
8368
|
if (qA.has(W.measurement)) {
|
|
8369
|
-
const VA = B[W.measurement.toLowerCase()] ||
|
|
8369
|
+
const VA = B[W.measurement.toLowerCase()] || kf(W.userValue), o = gf || SA || W.chartRange;
|
|
8370
8370
|
if (!i)
|
|
8371
8371
|
return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: o, fit: "good", isLength: !0 };
|
|
8372
8372
|
const j = i.section, U = W.measurement.toLowerCase(), R = U === "height", u = j.headers.findIndex((zf) => /size|length/i.test(zf.trim())), Y = P === "in";
|
|
8373
|
-
let MA = -1,
|
|
8373
|
+
let MA = -1, HA = !1;
|
|
8374
8374
|
if (R) {
|
|
8375
|
-
const zf = j.headers.findIndex((
|
|
8376
|
-
MA = zf >= 0 ? zf : $A,
|
|
8375
|
+
const zf = j.headers.findIndex((UA) => /cm|\(cm\)|height.*cm/i.test(UA.toLowerCase())), $A = j.headers.findIndex((UA) => /height|altezza|estatura/i.test(UA.toLowerCase()) && !/cm/i.test(UA));
|
|
8376
|
+
MA = zf >= 0 ? zf : $A, HA = MA === zf;
|
|
8377
8377
|
} else
|
|
8378
8378
|
MA = j.headers.findIndex((zf) => {
|
|
8379
8379
|
const $A = zf.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8380
8380
|
return $A ? $A === U || $A.includes(U) || U.includes($A) : !1;
|
|
8381
|
-
}),
|
|
8382
|
-
const JA = u >= 0 ? u : 0, X = MA >= 0 ? MA : -1,
|
|
8381
|
+
}), HA = MA >= 0 ? /cm/i.test(j.headers[MA] || "") : !1;
|
|
8382
|
+
const JA = u >= 0 ? u : 0, X = MA >= 0 ? MA : -1, dA = ((() => {
|
|
8383
8383
|
const zf = (o || "").toLowerCase().trim();
|
|
8384
8384
|
return /big.*tall|tall/.test(zf) ? "Long" : /^big$/.test(zf) ? "Regular" : o;
|
|
8385
|
-
})() || "").toLowerCase().trim(), q = j.rows.find((zf) => Rf(zf, JA, j.headers[JA]) === o) || j.rows.find((zf) => Rf(zf, JA, j.headers[JA]).trim().toLowerCase() ===
|
|
8386
|
-
let
|
|
8385
|
+
})() || "").toLowerCase().trim(), q = j.rows.find((zf) => Rf(zf, JA, j.headers[JA]) === o) || j.rows.find((zf) => Rf(zf, JA, j.headers[JA]).trim().toLowerCase() === dA) || null;
|
|
8386
|
+
let nA = o, vf = "good";
|
|
8387
8387
|
if (q && X >= 0) {
|
|
8388
8388
|
const zf = Rf(q, X, j.headers[X]);
|
|
8389
8389
|
if (zf) {
|
|
8390
|
-
const { min: $A, max:
|
|
8391
|
-
if ($A > 0 &&
|
|
8392
|
-
const sf =
|
|
8393
|
-
if (sf >= $A -
|
|
8390
|
+
const { min: $A, max: UA } = Fn(zf);
|
|
8391
|
+
if ($A > 0 && UA > 0) {
|
|
8392
|
+
const sf = HA && Y || !HA && !Y ? +(VA * 2.54).toFixed(1) : VA, Cn = UA - $A, mf = Cn > 0 ? Cn * 0.5 : $A * 0.05 || 3, Xf = Math.max((UA || $A) * 5e-3, 0.25);
|
|
8393
|
+
if (sf >= $A - Xf && sf <= UA + Xf) vf = "good";
|
|
8394
8394
|
else if (sf < $A) {
|
|
8395
8395
|
const Yf = $A - sf;
|
|
8396
8396
|
vf = Yf > mf * 2 ? "too-long" : Yf > mf ? "long" : "a-bit-long";
|
|
8397
8397
|
} else {
|
|
8398
|
-
const Yf = sf -
|
|
8398
|
+
const Yf = sf - UA;
|
|
8399
8399
|
vf = Yf > mf * 2 ? "too-short" : Yf > mf ? "short" : "a-bit-short";
|
|
8400
8400
|
}
|
|
8401
|
-
const Wf =
|
|
8402
|
-
|
|
8401
|
+
const Wf = HA && Y || !HA && !Y, Vf = Wf ? HA ? +($A / 2.54).toFixed(1) : +($A * 2.54).toFixed(1) : $A, Jf = Wf ? HA ? +(UA / 2.54).toFixed(1) : +(UA * 2.54).toFixed(1) : UA;
|
|
8402
|
+
nA = `${Vf}-${Jf}`;
|
|
8403
8403
|
} else
|
|
8404
|
-
|
|
8404
|
+
nA = zf;
|
|
8405
8405
|
}
|
|
8406
8406
|
}
|
|
8407
|
-
return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: qn(
|
|
8407
|
+
return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: qn(nA), fit: vf, isLength: !0 };
|
|
8408
8408
|
}
|
|
8409
|
-
const L = B[W.measurement.toLowerCase()] ||
|
|
8409
|
+
const L = B[W.measurement.toLowerCase()] || kf(W.userValue);
|
|
8410
8410
|
let { min: V, max: xA } = Fn(W.chartRange), wf = W.chartRange;
|
|
8411
|
-
const
|
|
8412
|
-
|
|
8411
|
+
const cA = XA(W.measurement, jA);
|
|
8412
|
+
cA && (wf = cA.range, V = cA.min, xA = cA.max);
|
|
8413
8413
|
const Df = xA - V, Af = Df > 0 ? Df * 0.5 : V * 0.05 || 3, Hf = W.measurement.toLowerCase(), WA = /length|inseam|sleeve|hem|rise/.test(Hf);
|
|
8414
8414
|
let ff;
|
|
8415
8415
|
const nf = Math.max((xA || V) * 0.03, 0.5);
|
|
@@ -8427,9 +8427,9 @@ function pn({
|
|
|
8427
8427
|
}
|
|
8428
8428
|
return { area: W.measurement, userNum: L, chartLabel: qn(wf), fit: ff, isLength: WA };
|
|
8429
8429
|
});
|
|
8430
|
-
}, [e, i, B,
|
|
8430
|
+
}, [e, i, B, jA, YA, XA, gf, OA, S]), sA = AA.filter(
|
|
8431
8431
|
(E) => E.fit === "good" || E.fit === "a-bit-tight" || E.fit === "a-bit-loose"
|
|
8432
|
-
).length, yA =
|
|
8432
|
+
).length, yA = AA.length > 0 ? Math.round(sA / AA.length * 100) : 0, Of = !S, LA = e, gA = LA?.size || YA, Uf = (e?.matchDetails || []).find(
|
|
8433
8433
|
(E) => /inseam|length/i.test(E.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(E.measurement)
|
|
8434
8434
|
), jf = Uf ? (Uf.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", lA = LA?.length || OA || jf, Mf = LA?.availableSizes || [], Qf = LA?.availableLengths || [], af = gf || lA, xf = Mf.length > 0 ? Mf : df, _A = (() => {
|
|
8435
8435
|
if (xf.length <= 3) return xf;
|
|
@@ -8448,7 +8448,7 @@ function pn({
|
|
|
8448
8448
|
const E = n.replace(/\s*[—–-]\s*.*/g, ""), y = (Q) => {
|
|
8449
8449
|
const Z = Q.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8450
8450
|
return Z.includes("chest") || Z.includes("bust") ? w("Full circumference at the widest point.") : Z.includes("waist") ? w("Circumference at the natural waistline.") : Z.includes("hip") ? w("Circumference at the fullest point.") : Z.includes("shoulder") ? w("Shoulder edge to shoulder edge.") : Z.includes("sleeve") || Z.includes("arm") ? w("Shoulder seam to cuff edge.") : Z.includes("neck") || Z.includes("collar") ? w("Around the base of the neck.") : Z.includes("inseam") || Z.includes("inside leg") ? w("Inner leg seam length.") : Z.includes("thigh") ? w("Circumference around the upper leg.") : Z.includes("length") || Z.includes("height") ? w("Top to bottom length.") : "";
|
|
8451
|
-
},
|
|
8451
|
+
}, QA = (Q, Z) => Z && Q === "good" ? w("EDITORIAL LENGTH") : Q === "good" ? w("PERFECT TENSION") : Q === "a-bit-tight" ? w("SLIGHTLY TIGHT") : Q === "a-bit-loose" ? w("SLIGHT EASE") : Q.includes("tight") ? w("TIGHT") : Q.includes("loose") ? w("LOOSE") : w("FIT");
|
|
8452
8452
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ f("div", { className: "ps-msd-scroll", children: [
|
|
8453
8453
|
/* @__PURE__ */ f("div", { className: "ps-msd-topbar", children: [
|
|
8454
8454
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: C, "aria-label": w("Back"), children: /* @__PURE__ */ f("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -8472,7 +8472,7 @@ function pn({
|
|
|
8472
8472
|
onLoad: r
|
|
8473
8473
|
}
|
|
8474
8474
|
),
|
|
8475
|
-
x &&
|
|
8475
|
+
x && fA,
|
|
8476
8476
|
T && l && /* @__PURE__ */ f(
|
|
8477
8477
|
"button",
|
|
8478
8478
|
{
|
|
@@ -8510,7 +8510,7 @@ function pn({
|
|
|
8510
8510
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: w("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8511
8511
|
] }) }),
|
|
8512
8512
|
K !== !1 && /* @__PURE__ */ f("div", { className: "ps-msd-card", children: [
|
|
8513
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: w(
|
|
8513
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: w(jA === gA ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
|
|
8514
8514
|
/* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
8515
8515
|
kA.length > 1 && /* @__PURE__ */ f(
|
|
8516
8516
|
"select",
|
|
@@ -8569,10 +8569,10 @@ function pn({
|
|
|
8569
8569
|
] }),
|
|
8570
8570
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: w("Based on your measurements and the garment's tailoring chart.") })
|
|
8571
8571
|
] }),
|
|
8572
|
-
K !== !1 &&
|
|
8572
|
+
K !== !1 && AA.length > 0 && /* @__PURE__ */ f("div", { className: "ps-msd-blueprint", children: [
|
|
8573
8573
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: w("MEASUREMENT BLUEPRINT") }),
|
|
8574
8574
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8575
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children:
|
|
8575
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: AA.map((Q, Z) => {
|
|
8576
8576
|
const FA = Q.isLength && Q.fit.includes("short") || Q.fit.includes("tight"), SA = Q.fit === "good" ? "ps-good" : FA ? "ps-tight" : "ps-loose", tf = y(Q.area), bA = String(Z + 1).padStart(2, "0");
|
|
8577
8577
|
return /* @__PURE__ */ f("div", { className: "ps-msd-row", children: [
|
|
8578
8578
|
/* @__PURE__ */ f("div", { className: "ps-msd-row-num", children: [
|
|
@@ -8584,19 +8584,19 @@ function pn({
|
|
|
8584
8584
|
/* @__PURE__ */ f("div", { className: "ps-msd-row-cells", children: [
|
|
8585
8585
|
/* @__PURE__ */ f("div", { className: "ps-msd-row-cell", children: [
|
|
8586
8586
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: w("USER") }),
|
|
8587
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawUserValue || "—" : isNaN(Q.userNum) || Q.userNum === 0 ? "—" : `${
|
|
8587
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawUserValue || "—" : isNaN(Q.userNum) || Q.userNum === 0 ? "—" : `${N(Q.userNum)} ${P}` })
|
|
8588
8588
|
] }),
|
|
8589
8589
|
/* @__PURE__ */ f("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
8590
8590
|
/* @__PURE__ */ f("span", { className: "ps-msd-cell-label", children: [
|
|
8591
8591
|
w("SIZE"),
|
|
8592
8592
|
" ",
|
|
8593
|
-
|
|
8593
|
+
jA
|
|
8594
8594
|
] }),
|
|
8595
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawChartRange || "—" :
|
|
8595
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawChartRange || "—" : PA(Q.chartLabel) })
|
|
8596
8596
|
] })
|
|
8597
8597
|
] }),
|
|
8598
8598
|
/* @__PURE__ */ f("div", { className: `ps-msd-row-badge ${SA}`, children: [
|
|
8599
|
-
Q.isLength ? EP(Q.fit, w).toUpperCase() :
|
|
8599
|
+
Q.isLength ? EP(Q.fit, w).toUpperCase() : QA(Q.fit, Q.isLength),
|
|
8600
8600
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
8601
8601
|
] })
|
|
8602
8602
|
] }, Z);
|
|
@@ -8608,7 +8608,7 @@ function pn({
|
|
|
8608
8608
|
"button",
|
|
8609
8609
|
{
|
|
8610
8610
|
type: "button",
|
|
8611
|
-
className: `ps-msd-size-pill${Q ===
|
|
8611
|
+
className: `ps-msd-size-pill${Q === jA ? " ps-active" : ""}`,
|
|
8612
8612
|
onClick: () => a(Q === YA ? null : Q),
|
|
8613
8613
|
children: Q
|
|
8614
8614
|
},
|
|
@@ -8638,7 +8638,7 @@ function pn({
|
|
|
8638
8638
|
K !== !1 && /* @__PURE__ */ f("p", { className: "ps-msd-footer-note", children: [
|
|
8639
8639
|
w("*Our sizing engine recommends"),
|
|
8640
8640
|
" ",
|
|
8641
|
-
|
|
8641
|
+
gA,
|
|
8642
8642
|
lA ? ` (${lA})` : "",
|
|
8643
8643
|
" ",
|
|
8644
8644
|
w("based on your measurements and the garment's tailoring chart.")
|
|
@@ -8769,10 +8769,10 @@ function pn({
|
|
|
8769
8769
|
}, children: [
|
|
8770
8770
|
/* @__PURE__ */ A("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: TA }),
|
|
8771
8771
|
af && (() => {
|
|
8772
|
-
const E = /^\d+(\.\d+)?$/.test(String(af).trim()), y = (n || "").toLowerCase(),
|
|
8772
|
+
const E = /^\d+(\.\d+)?$/.test(String(af).trim()), y = (n || "").toLowerCase(), QA = E ? /pant|trouser|inseam/.test(y) ? w("Inseam") : w("Length") : null;
|
|
8773
8773
|
return /* @__PURE__ */ f("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
|
|
8774
8774
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
|
|
8775
|
-
|
|
8775
|
+
QA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: QA }),
|
|
8776
8776
|
/* @__PURE__ */ A("span", { children: af })
|
|
8777
8777
|
] });
|
|
8778
8778
|
})(),
|
|
@@ -8794,20 +8794,20 @@ function pn({
|
|
|
8794
8794
|
w("Match based on your silhouette profile")
|
|
8795
8795
|
] })
|
|
8796
8796
|
] }),
|
|
8797
|
-
|
|
8797
|
+
AA.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ f("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
8798
8798
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
|
8799
8799
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Measurement") }),
|
|
8800
8800
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Your Body") }),
|
|
8801
8801
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Garment Spec") }),
|
|
8802
8802
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Fit Result") })
|
|
8803
8803
|
] }) }),
|
|
8804
|
-
/* @__PURE__ */ A("tbody", { children:
|
|
8805
|
-
const
|
|
8806
|
-
return /* @__PURE__ */ f("tr", { style: { borderBottom: y <
|
|
8804
|
+
/* @__PURE__ */ A("tbody", { children: AA.map((E, y) => {
|
|
8805
|
+
const QA = E.fit === "good" ? "#2154EF" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "#dc2626" : "#d97706" : E.fit.includes("tight") ? "#dc2626" : "#d97706", Q = E.fit === "good" ? "rgba(33,84,239,0.08)" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8806
|
+
return /* @__PURE__ */ f("tr", { style: { borderBottom: y < AA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8807
8807
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: E.area }),
|
|
8808
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawUserValue || "—" : isNaN(E.userNum) || E.userNum === 0 ? "—" : `${
|
|
8809
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawChartRange || "—" :
|
|
8810
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color:
|
|
8808
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawUserValue || "—" : isNaN(E.userNum) || E.userNum === 0 ? "—" : `${N(E.userNum)} ${P}` }),
|
|
8809
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawChartRange || "—" : PA(E.chartLabel) }),
|
|
8810
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: QA, background: Q, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: E.isLength ? EP(E.fit, w) : Ie(E.fit, w) }) })
|
|
8811
8811
|
] }, y);
|
|
8812
8812
|
}) })
|
|
8813
8813
|
] }) }),
|
|
@@ -8820,7 +8820,7 @@ function pn({
|
|
|
8820
8820
|
w("Size")
|
|
8821
8821
|
] }),
|
|
8822
8822
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: _A.map((E) => {
|
|
8823
|
-
const y = E ===
|
|
8823
|
+
const y = E === jA;
|
|
8824
8824
|
return /* @__PURE__ */ A(
|
|
8825
8825
|
"button",
|
|
8826
8826
|
{
|
|
@@ -8848,7 +8848,7 @@ function pn({
|
|
|
8848
8848
|
mA.length > 0 && /* @__PURE__ */ f("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
|
|
8849
8849
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: w("Length Adjustment") }),
|
|
8850
8850
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: mA.map((E) => {
|
|
8851
|
-
const y = String(af ?? "").trim() === String(E ?? "").trim(),
|
|
8851
|
+
const y = String(af ?? "").trim() === String(E ?? "").trim(), QA = hA[String(E).trim()];
|
|
8852
8852
|
return /* @__PURE__ */ f(
|
|
8853
8853
|
"button",
|
|
8854
8854
|
{
|
|
@@ -8872,7 +8872,7 @@ function pn({
|
|
|
8872
8872
|
},
|
|
8873
8873
|
children: [
|
|
8874
8874
|
/* @__PURE__ */ A("span", { children: E }),
|
|
8875
|
-
|
|
8875
|
+
QA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: QA })
|
|
8876
8876
|
]
|
|
8877
8877
|
},
|
|
8878
8878
|
E
|
|
@@ -8880,7 +8880,7 @@ function pn({
|
|
|
8880
8880
|
}) })
|
|
8881
8881
|
] }),
|
|
8882
8882
|
(F || tA) && (!Bf || gf && gf !== lA) && /* @__PURE__ */ A("div", { style: { marginTop: "0.6vw", marginBottom: "0.2vw" }, children: (() => {
|
|
8883
|
-
const E =
|
|
8883
|
+
const E = jA, y = gf || lA || "", QA = !!(gf && gf !== lA), Q = y ? `${E} / ${y}` : E, Z = () => {
|
|
8884
8884
|
const SA = e?.matchDetails || [];
|
|
8885
8885
|
if (!SA.length) return;
|
|
8886
8886
|
const tf = new Set(
|
|
@@ -8896,10 +8896,10 @@ function pn({
|
|
|
8896
8896
|
if (xA < 0) return bA;
|
|
8897
8897
|
const wf = W.rows.find((Df) => Rf(Df, V, W.headers[V]) === y);
|
|
8898
8898
|
if (!wf) return bA;
|
|
8899
|
-
const
|
|
8900
|
-
return
|
|
8899
|
+
const cA = Rf(wf, xA, W.headers[xA]);
|
|
8900
|
+
return cA ? { ...bA, chartRange: cA } : bA;
|
|
8901
8901
|
}
|
|
8902
|
-
const qA =
|
|
8902
|
+
const qA = XA(bA.measurement, E);
|
|
8903
8903
|
return qA?.range ? { ...bA, chartRange: qA.range } : bA;
|
|
8904
8904
|
});
|
|
8905
8905
|
}, FA = wA === E;
|
|
@@ -8909,7 +8909,7 @@ function pn({
|
|
|
8909
8909
|
type: "button",
|
|
8910
8910
|
onClick: () => tA({
|
|
8911
8911
|
selectedSize: E,
|
|
8912
|
-
selectedLength:
|
|
8912
|
+
selectedLength: QA ? y : void 0,
|
|
8913
8913
|
displayLabel: Q,
|
|
8914
8914
|
matchDetails: Z()
|
|
8915
8915
|
}),
|
|
@@ -8946,7 +8946,7 @@ function pn({
|
|
|
8946
8946
|
onClick: () => {
|
|
8947
8947
|
F && F(FA ? null : {
|
|
8948
8948
|
selectedSize: E,
|
|
8949
|
-
selectedLength:
|
|
8949
|
+
selectedLength: QA ? y : void 0,
|
|
8950
8950
|
displayLabel: Q,
|
|
8951
8951
|
matchDetails: Z()
|
|
8952
8952
|
});
|
|
@@ -9073,7 +9073,7 @@ function Oe({
|
|
|
9073
9073
|
previewUrl: T,
|
|
9074
9074
|
handleFileSelect: x,
|
|
9075
9075
|
handleRemovePreview: l,
|
|
9076
|
-
handleTryOnSubmit:
|
|
9076
|
+
handleTryOnSubmit: fA,
|
|
9077
9077
|
tryOnProcessing: r,
|
|
9078
9078
|
bodyLandmarks: b,
|
|
9079
9079
|
faceLandmarks: k = null,
|
|
@@ -9089,7 +9089,7 @@ function Oe({
|
|
|
9089
9089
|
onRegenerateTryOn: h,
|
|
9090
9090
|
t: a
|
|
9091
9091
|
}) {
|
|
9092
|
-
const
|
|
9092
|
+
const uA = (g?.unit || i || "").toString().toLowerCase(), RA = uA === "mm" ? "mm" : uA === "cm" ? "cm" : "in", vA = a(RA === "mm" ? "mm" : i === "cm" ? "cm" : "in"), [N, PA] = d({}), kA = Fn, iA = EA((o, j, U) => Rf(o, j, U), []), BA = pf(() => {
|
|
9093
9093
|
if (!e?.headers || !e?.rows) return -1;
|
|
9094
9094
|
const o = e.headers.findIndex((j) => /size|taglia|größe|taille/i.test(j.trim()));
|
|
9095
9095
|
if (o >= 0) return o;
|
|
@@ -9134,34 +9134,34 @@ function Oe({
|
|
|
9134
9134
|
if (!e?.headers || !e?.rows || BA < 0) return null;
|
|
9135
9135
|
const U = o.toLowerCase().trim(), R = vA === "cm" || vA === "", u = R ? "cm" : "in", Y = [];
|
|
9136
9136
|
for (let q = 0; q < e.headers.length; q++) {
|
|
9137
|
-
const
|
|
9138
|
-
if (
|
|
9137
|
+
const nA = (e.headers[q] || "").toLowerCase().trim();
|
|
9138
|
+
if (nA === U) {
|
|
9139
9139
|
Y.push(q);
|
|
9140
9140
|
continue;
|
|
9141
9141
|
}
|
|
9142
|
-
const vf =
|
|
9143
|
-
(vf === U ||
|
|
9142
|
+
const vf = nA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
9143
|
+
(vf === U || nA.includes(U) || U.includes(vf)) && Y.push(q);
|
|
9144
9144
|
}
|
|
9145
9145
|
if (Y.length === 0) return null;
|
|
9146
9146
|
let MA = Y.find((q) => gf[q] === u);
|
|
9147
9147
|
MA == null && (MA = Y[0]);
|
|
9148
|
-
const
|
|
9148
|
+
const HA = e.headers[MA], JA = e.rows.find((q) => iA(q, BA, OA) === j);
|
|
9149
9149
|
if (!JA) return null;
|
|
9150
|
-
const X = iA(JA, MA,
|
|
9150
|
+
const X = iA(JA, MA, HA);
|
|
9151
9151
|
if (!X) return null;
|
|
9152
|
-
const
|
|
9153
|
-
if (
|
|
9154
|
-
const q = (
|
|
9155
|
-
return { range: String(q(
|
|
9152
|
+
const J = kA(X), dA = gf[MA];
|
|
9153
|
+
if (dA === "in" && R) {
|
|
9154
|
+
const q = (nA) => +(nA * 2.54).toFixed(1);
|
|
9155
|
+
return { range: String(q(J.min)) + (J.min !== J.max ? "–" + String(q(J.max)) : ""), min: q(J.min), max: q(J.max) };
|
|
9156
9156
|
}
|
|
9157
|
-
if (
|
|
9158
|
-
const q = (
|
|
9159
|
-
return { range: String(q(
|
|
9157
|
+
if (dA === "cm" && !R) {
|
|
9158
|
+
const q = (nA) => +(nA / 2.54).toFixed(1);
|
|
9159
|
+
return { range: String(q(J.min)) + (J.min !== J.max ? "–" + String(q(J.max)) : ""), min: q(J.min), max: q(J.max) };
|
|
9160
9160
|
}
|
|
9161
|
-
return { range: X, ...
|
|
9161
|
+
return { range: X, ...J };
|
|
9162
9162
|
}, [e, BA, OA, vA, iA, kA, gf]), ef = g?.recommendedSize || "";
|
|
9163
9163
|
pf(() => g?.internationalSizes || {}, [g]);
|
|
9164
|
-
const [hA, Pf] = d("fit"), [ZA, df] = d(null), [
|
|
9164
|
+
const [hA, Pf] = d("fit"), [ZA, df] = d(null), [jA, Bf] = d(!1), [DA, TA] = d(!1), [I, XA] = d(!1), [AA, sA] = d(null), [yA, Of] = d(!1), [LA, gA] = d({ w: 800, h: 1200 }), Uf = wA ?? null, jf = (o) => {
|
|
9165
9165
|
YA?.(o);
|
|
9166
9166
|
};
|
|
9167
9167
|
NA(() => {
|
|
@@ -9169,7 +9169,7 @@ function Oe({
|
|
|
9169
9169
|
}, [g?.recommendedSize]);
|
|
9170
9170
|
const lA = EA((o) => {
|
|
9171
9171
|
const j = o.currentTarget;
|
|
9172
|
-
j.naturalWidth && j.naturalHeight &&
|
|
9172
|
+
j.naturalWidth && j.naturalHeight && gA({ w: j.naturalWidth, h: j.naturalHeight });
|
|
9173
9173
|
}, []);
|
|
9174
9174
|
NA(() => {
|
|
9175
9175
|
if (!B || r) {
|
|
@@ -9183,8 +9183,8 @@ function Oe({
|
|
|
9183
9183
|
});
|
|
9184
9184
|
}, [B, r]);
|
|
9185
9185
|
const [Mf, Qf] = d(!1), [af, xf] = d(!1);
|
|
9186
|
-
|
|
9187
|
-
const [_A, of] = d(!1), [mA, E] = d(null), [y,
|
|
9186
|
+
aA(null);
|
|
9187
|
+
const [_A, of] = d(!1), [mA, E] = d(null), [y, QA] = d(!1), Q = aA(null), [Z, FA] = d(null), [SA, tf] = d(!1);
|
|
9188
9188
|
NA(() => {
|
|
9189
9189
|
if (mA) {
|
|
9190
9190
|
const o = URL.createObjectURL(mA);
|
|
@@ -9200,24 +9200,24 @@ function Oe({
|
|
|
9200
9200
|
const R = U.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
9201
9201
|
return o.has(R) ? !1 : (o.add(R), !0);
|
|
9202
9202
|
}).map((U) => {
|
|
9203
|
-
const R =
|
|
9203
|
+
const R = kf(U.userValue);
|
|
9204
9204
|
let u = U.chartRange, Y = U.fit;
|
|
9205
9205
|
if (bA !== ef) {
|
|
9206
9206
|
const MA = KA(U.measurement, bA);
|
|
9207
9207
|
if (MA && MA.min > 0) {
|
|
9208
9208
|
u = qn(MA.range);
|
|
9209
|
-
const
|
|
9210
|
-
if (R >=
|
|
9211
|
-
else if (R <
|
|
9212
|
-
const q =
|
|
9213
|
-
Y = q >
|
|
9209
|
+
const HA = MA.min, JA = MA.max, X = JA - HA, J = X > 0 ? X * 0.5 : HA * 0.05 || 3, dA = Math.max((JA || HA) * 5e-3, 0.25);
|
|
9210
|
+
if (R >= HA - dA && R <= JA + dA) Y = "good";
|
|
9211
|
+
else if (R < HA) {
|
|
9212
|
+
const q = HA - R;
|
|
9213
|
+
Y = q > J * 2 ? "too-loose" : q > J ? "loose" : "a-bit-loose";
|
|
9214
9214
|
} else {
|
|
9215
9215
|
const q = R - JA;
|
|
9216
|
-
Y = q >
|
|
9216
|
+
Y = q > J * 2 ? "too-tight" : q > J ? "tight" : "a-bit-tight";
|
|
9217
9217
|
}
|
|
9218
9218
|
}
|
|
9219
9219
|
}
|
|
9220
|
-
return { area: U.measurement, userNum:
|
|
9220
|
+
return { area: U.measurement, userNum: kf(U.userValue), chartLabel: u, fit: Y };
|
|
9221
9221
|
});
|
|
9222
9222
|
}, [g, bA, ef, KA]), pf(() => {
|
|
9223
9223
|
if (!e?.headers || !e?.rows || BA < 0) return null;
|
|
@@ -9238,7 +9238,7 @@ function Oe({
|
|
|
9238
9238
|
for (const R of U) {
|
|
9239
9239
|
const u = R.measurement.toLowerCase();
|
|
9240
9240
|
if (o[u] == null) {
|
|
9241
|
-
const Y =
|
|
9241
|
+
const Y = kf(R.userValue);
|
|
9242
9242
|
Y > 0 && (o[u] = Y);
|
|
9243
9243
|
}
|
|
9244
9244
|
}
|
|
@@ -9249,26 +9249,26 @@ function Oe({
|
|
|
9249
9249
|
const u = U.toLowerCase();
|
|
9250
9250
|
let Y = e?.sections?.[U];
|
|
9251
9251
|
if (!Y && e?.sections) {
|
|
9252
|
-
const
|
|
9253
|
-
const X = JA.toLowerCase(),
|
|
9254
|
-
return
|
|
9252
|
+
const HA = Object.entries(e.sections).find(([JA]) => {
|
|
9253
|
+
const X = JA.toLowerCase(), J = X.replace(/\s*(size|sizing)\s*/gi, "").trim();
|
|
9254
|
+
return J ? u === X || u.includes(J) || J.includes(u) : !1;
|
|
9255
9255
|
});
|
|
9256
|
-
|
|
9256
|
+
HA && (Y = HA[1]);
|
|
9257
9257
|
}
|
|
9258
9258
|
Y || (Y = { headers: [], rows: [], requiredFields: [] });
|
|
9259
9259
|
const MA = { ...o };
|
|
9260
9260
|
if (R.matchDetails)
|
|
9261
|
-
for (const
|
|
9262
|
-
const JA =
|
|
9263
|
-
JA > 0 && (MA[
|
|
9261
|
+
for (const HA of R.matchDetails) {
|
|
9262
|
+
const JA = kf(HA.userValue);
|
|
9263
|
+
JA > 0 && (MA[HA.measurement.toLowerCase()] = JA);
|
|
9264
9264
|
}
|
|
9265
9265
|
return { name: U, section: Y, secResult: R, userMeasurements: MA };
|
|
9266
9266
|
}) : !_ || !e?.sections ? [] : Object.entries(e.sections).map(([U, R]) => {
|
|
9267
9267
|
const u = g?.sections?.[U] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, Y = { ...o };
|
|
9268
9268
|
if (u.matchDetails)
|
|
9269
9269
|
for (const MA of u.matchDetails) {
|
|
9270
|
-
const
|
|
9271
|
-
|
|
9270
|
+
const HA = kf(MA.userValue);
|
|
9271
|
+
HA > 0 && (Y[MA.measurement.toLowerCase()] = HA);
|
|
9272
9272
|
}
|
|
9273
9273
|
return { name: U, section: R, secResult: u, userMeasurements: Y };
|
|
9274
9274
|
});
|
|
@@ -9283,8 +9283,8 @@ function Oe({
|
|
|
9283
9283
|
}
|
|
9284
9284
|
if (/^x(tra)?[- ]?long/.test(u)) return /^\d/.test(j) ? `${j}XL` : `${j} / Extra Long`;
|
|
9285
9285
|
if (/^\d/.test(j)) {
|
|
9286
|
-
const
|
|
9287
|
-
return `${j}${
|
|
9286
|
+
const HA = u.charAt(0).toUpperCase();
|
|
9287
|
+
return `${j}${HA}`;
|
|
9288
9288
|
}
|
|
9289
9289
|
const MA = R.replace(/\s+/g, " ").trim();
|
|
9290
9290
|
return `${j} / ${MA}`;
|
|
@@ -9296,7 +9296,7 @@ function Oe({
|
|
|
9296
9296
|
return `${U}'${R}"`;
|
|
9297
9297
|
}
|
|
9298
9298
|
return `${Math.round(o)} cm`;
|
|
9299
|
-
}, [tA, vA]), wf = !!T,
|
|
9299
|
+
}, [tA, vA]), wf = !!T, cA = wf && (r || n && !g), Df = !wf && n && !g, Af = !!g, Hf = !!B && !r, WA = wf ? Af && Hf : Af, ff = AP(), nf = v === "face" || v === "head";
|
|
9300
9300
|
g?.found;
|
|
9301
9301
|
const VA = v === "foot";
|
|
9302
9302
|
return /* @__PURE__ */ f("div", { className: "ps-tryon-sr", children: [
|
|
@@ -9317,7 +9317,7 @@ function Oe({
|
|
|
9317
9317
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw" }, children: a("Generating your size recommendation...") })
|
|
9318
9318
|
] })
|
|
9319
9319
|
] }),
|
|
9320
|
-
ff &&
|
|
9320
|
+
ff && cA && !WA && T && /* @__PURE__ */ A(
|
|
9321
9321
|
UP,
|
|
9322
9322
|
{
|
|
9323
9323
|
previewUrl: T,
|
|
@@ -9328,7 +9328,7 @@ function Oe({
|
|
|
9328
9328
|
t: a
|
|
9329
9329
|
}
|
|
9330
9330
|
),
|
|
9331
|
-
!ff &&
|
|
9331
|
+
!ff && cA && !WA && /* @__PURE__ */ f("div", { className: "ps-tryon-sr-split", children: [
|
|
9332
9332
|
/* @__PURE__ */ f("div", { className: "ps-tryon-sr-img-col", style: { position: "relative" }, children: [
|
|
9333
9333
|
/* @__PURE__ */ A(
|
|
9334
9334
|
"img",
|
|
@@ -9355,7 +9355,7 @@ function Oe({
|
|
|
9355
9355
|
) });
|
|
9356
9356
|
})()
|
|
9357
9357
|
] }),
|
|
9358
|
-
(WA || g && !
|
|
9358
|
+
(WA || g && !cA) && /* @__PURE__ */ f(rA, { children: [
|
|
9359
9359
|
_ ? s ? (
|
|
9360
9360
|
/* ── Detail view for a single section ── */
|
|
9361
9361
|
(() => {
|
|
@@ -9386,10 +9386,10 @@ function Oe({
|
|
|
9386
9386
|
showLines: DA,
|
|
9387
9387
|
onToggleLines: nf ? void 0 : () => TA(!DA),
|
|
9388
9388
|
onImageLoad: lA,
|
|
9389
|
-
overlayNode: B && yA &&
|
|
9389
|
+
overlayNode: B && yA && AA ? /* @__PURE__ */ A(
|
|
9390
9390
|
wn,
|
|
9391
9391
|
{
|
|
9392
|
-
lines:
|
|
9392
|
+
lines: AA,
|
|
9393
9393
|
fitRows: (() => {
|
|
9394
9394
|
const j = [...g?.matchDetails || []];
|
|
9395
9395
|
if (g?.sections)
|
|
@@ -9461,10 +9461,10 @@ function Oe({
|
|
|
9461
9461
|
showLines: DA,
|
|
9462
9462
|
onToggleLines: nf ? void 0 : () => TA(!DA),
|
|
9463
9463
|
onImageLoad: lA,
|
|
9464
|
-
overlayNode: B && yA &&
|
|
9464
|
+
overlayNode: B && yA && AA ? /* @__PURE__ */ A(
|
|
9465
9465
|
wn,
|
|
9466
9466
|
{
|
|
9467
|
-
lines:
|
|
9467
|
+
lines: AA,
|
|
9468
9468
|
fitRows: (() => {
|
|
9469
9469
|
const o = [...g?.matchDetails || []];
|
|
9470
9470
|
if (g?.sections)
|
|
@@ -9494,7 +9494,7 @@ function Oe({
|
|
|
9494
9494
|
/* @__PURE__ */ A("span", { children: a("Generating try-on...") }),
|
|
9495
9495
|
/* @__PURE__ */ A(LP, { t: a, isActive: !0 })
|
|
9496
9496
|
] }),
|
|
9497
|
-
B && !r && yA &&
|
|
9497
|
+
B && !r && yA && AA && /* @__PURE__ */ A(wn, { lines: AA, fitRows: (() => {
|
|
9498
9498
|
const o = [...g?.matchDetails || []];
|
|
9499
9499
|
if (g?.sections)
|
|
9500
9500
|
for (const U of Object.values(g.sections))
|
|
@@ -9538,10 +9538,10 @@ function Oe({
|
|
|
9538
9538
|
o.replace(/\s*[—–-]\s*.*/g, "")
|
|
9539
9539
|
] }),
|
|
9540
9540
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: MA.found === !1 ? a("No fit") : (() => {
|
|
9541
|
-
const
|
|
9542
|
-
return JA === -1 ?
|
|
9543
|
-
/* @__PURE__ */ A("span", { children:
|
|
9544
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value-suffix", children:
|
|
9541
|
+
const HA = V(o, MA.size || j.recommendedSize || ""), JA = HA.indexOf(" / ");
|
|
9542
|
+
return JA === -1 ? HA : /* @__PURE__ */ f(rA, { children: [
|
|
9543
|
+
/* @__PURE__ */ A("span", { children: HA.slice(0, JA) }),
|
|
9544
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value-suffix", children: HA.slice(JA) })
|
|
9545
9545
|
] });
|
|
9546
9546
|
})() }),
|
|
9547
9547
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-rec", children: xA ? `${a("recommended")} · ${xA}` : a("recommended") })
|
|
@@ -9602,7 +9602,7 @@ function Oe({
|
|
|
9602
9602
|
(() => {
|
|
9603
9603
|
const o = e?.found ? { headers: e.headers || [], rows: e.rows || [], requiredFields: e.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, j = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, U = {};
|
|
9604
9604
|
if (g?.matchDetails)
|
|
9605
|
-
for (const Y of g.matchDetails) U[Y.measurement.toLowerCase()] =
|
|
9605
|
+
for (const Y of g.matchDetails) U[Y.measurement.toLowerCase()] = kf(Y.userValue);
|
|
9606
9606
|
const R = a("Your Fit"), u = () => {
|
|
9607
9607
|
B || (E(z || null), of(!0));
|
|
9608
9608
|
};
|
|
@@ -9636,10 +9636,10 @@ function Oe({
|
|
|
9636
9636
|
showLines: DA,
|
|
9637
9637
|
onToggleLines: nf ? void 0 : () => TA(!DA),
|
|
9638
9638
|
onImageLoad: lA,
|
|
9639
|
-
overlayNode: B && yA &&
|
|
9639
|
+
overlayNode: B && yA && AA ? /* @__PURE__ */ A(
|
|
9640
9640
|
wn,
|
|
9641
9641
|
{
|
|
9642
|
-
lines:
|
|
9642
|
+
lines: AA,
|
|
9643
9643
|
fitRows: (g?.matchDetails || []).map((Y) => ({ area: Y.measurement, userNum: parseFloat(Y.userValue) || 0, chartLabel: Y.chartRange || "", fit: Y.fit })),
|
|
9644
9644
|
show: DA,
|
|
9645
9645
|
imgWidth: LA.w,
|
|
@@ -9651,7 +9651,7 @@ function Oe({
|
|
|
9651
9651
|
) : /* @__PURE__ */ f("div", { className: "ps-tryon-v2", children: [
|
|
9652
9652
|
/* @__PURE__ */ f("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9653
9653
|
/* @__PURE__ */ A("img", { src: B || P, alt: D, className: "ps-tryon-v2-bg-img", onLoad: lA }),
|
|
9654
|
-
B && yA &&
|
|
9654
|
+
B && yA && AA && /* @__PURE__ */ A(wn, { lines: AA, fitRows: (g?.matchDetails || []).map((Y) => ({ area: Y.measurement, userNum: parseFloat(Y.userValue) || 0, chartLabel: Y.chartRange || "", fit: Y.fit })), show: DA, imgWidth: LA.w, imgHeight: LA.h }),
|
|
9655
9655
|
B && !r && /* @__PURE__ */ f("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9656
9656
|
!nf && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => TA(!DA), children: a(DA ? "Hide Fit" : "Show Fit") }),
|
|
9657
9657
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: w, children: a("Download") })
|
|
@@ -9768,7 +9768,7 @@ function Oe({
|
|
|
9768
9768
|
className: "ps-pm-primary-btn",
|
|
9769
9769
|
disabled: !mA,
|
|
9770
9770
|
onClick: () => {
|
|
9771
|
-
mA && (x(mA),
|
|
9771
|
+
mA && (x(mA), fA(mA), of(!1));
|
|
9772
9772
|
},
|
|
9773
9773
|
children: a("START TRY-ON")
|
|
9774
9774
|
}
|
|
@@ -9801,11 +9801,11 @@ function Oe({
|
|
|
9801
9801
|
{
|
|
9802
9802
|
onClick: () => Q.current?.click(),
|
|
9803
9803
|
onDragOver: (o) => {
|
|
9804
|
-
o.preventDefault(),
|
|
9804
|
+
o.preventDefault(), QA(!0);
|
|
9805
9805
|
},
|
|
9806
|
-
onDragLeave: () =>
|
|
9806
|
+
onDragLeave: () => QA(!1),
|
|
9807
9807
|
onDrop: (o) => {
|
|
9808
|
-
o.preventDefault(),
|
|
9808
|
+
o.preventDefault(), QA(!1);
|
|
9809
9809
|
const j = o.dataTransfer.files[0];
|
|
9810
9810
|
j && E(j);
|
|
9811
9811
|
},
|
|
@@ -9928,7 +9928,7 @@ function Oe({
|
|
|
9928
9928
|
a("Back")
|
|
9929
9929
|
] }),
|
|
9930
9930
|
/* @__PURE__ */ f("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, disabled: !mA, onClick: () => {
|
|
9931
|
-
mA && (x(mA),
|
|
9931
|
+
mA && (x(mA), fA(mA), of(!1));
|
|
9932
9932
|
}, children: [
|
|
9933
9933
|
/* @__PURE__ */ A(_f, { size: 14 }),
|
|
9934
9934
|
" ",
|
|
@@ -9936,13 +9936,13 @@ function Oe({
|
|
|
9936
9936
|
] })
|
|
9937
9937
|
] })
|
|
9938
9938
|
] }) }),
|
|
9939
|
-
|
|
9939
|
+
jA && e && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ f("div", { className: "ps-tryon-sr-chart-modal", children: [
|
|
9940
9940
|
/* @__PURE__ */ f("div", { className: "ps-tryon-sr-chart-header", children: [
|
|
9941
9941
|
/* @__PURE__ */ A("h4", { children: a("Full Size Chart") }),
|
|
9942
9942
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => Bf(!1), children: "✕" })
|
|
9943
9943
|
] }),
|
|
9944
9944
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: e.sections && Object.keys(e.sections).length > 1 ? Object.entries(e.sections).map(([o, j]) => {
|
|
9945
|
-
const R = g?.sections?.[o]?.recommendedSize || "", u = j.headers.findIndex((
|
|
9945
|
+
const R = g?.sections?.[o]?.recommendedSize || "", u = j.headers.findIndex((HA) => /size|taglia|größe|taille|fit|length/i.test(HA.trim())), Y = u >= 0 ? u : 0, MA = j.headers[Y] || "Size";
|
|
9946
9946
|
return /* @__PURE__ */ f("div", { className: "ps-tryon-chart-section", children: [
|
|
9947
9947
|
/* @__PURE__ */ f("div", { className: "ps-tryon-chart-section-title", children: [
|
|
9948
9948
|
/* @__PURE__ */ A("span", { children: o }),
|
|
@@ -9953,10 +9953,10 @@ function Oe({
|
|
|
9953
9953
|
] })
|
|
9954
9954
|
] }),
|
|
9955
9955
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ f("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
9956
|
-
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: j.headers.map((
|
|
9957
|
-
/* @__PURE__ */ A("tbody", { children: j.rows.map((
|
|
9958
|
-
const
|
|
9959
|
-
return /* @__PURE__ */ A("tr", { className:
|
|
9956
|
+
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: j.headers.map((HA, JA) => /* @__PURE__ */ A("th", { className: JA === Y ? "ps-size-col" : "", children: HA }, JA)) }) }),
|
|
9957
|
+
/* @__PURE__ */ A("tbody", { children: j.rows.map((HA, JA) => {
|
|
9958
|
+
const J = Rf(HA, Y, MA) === R;
|
|
9959
|
+
return /* @__PURE__ */ A("tr", { className: J ? "ps-active-row" : "", children: j.headers.map((dA, q) => /* @__PURE__ */ A("td", { className: q === Y ? "ps-size-col" : "", children: Rf(HA, q, dA) }, q)) }, JA);
|
|
9960
9960
|
}) })
|
|
9961
9961
|
] }) })
|
|
9962
9962
|
] }, o);
|
|
@@ -10054,8 +10054,8 @@ function Ke({
|
|
|
10054
10054
|
D.current = l;
|
|
10055
10055
|
}, []), x = EA((l) => {
|
|
10056
10056
|
if (i.current = l, l) {
|
|
10057
|
-
const
|
|
10058
|
-
l.style.strokeDashoffset = String(
|
|
10057
|
+
const fA = kn * (1 - Math.round(g.current) / 100);
|
|
10058
|
+
l.style.strokeDashoffset = String(fA);
|
|
10059
10059
|
}
|
|
10060
10060
|
}, []);
|
|
10061
10061
|
return /* @__PURE__ */ f("div", { className: "ps-tryon-processing", children: [
|
|
@@ -10183,55 +10183,55 @@ function an({
|
|
|
10183
10183
|
] }, n);
|
|
10184
10184
|
}
|
|
10185
10185
|
function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P }) {
|
|
10186
|
-
const [D, i] = d(null), [C, w] = d("identity"), [H, c] = d("name-photo"), [z, T] = d(!1), [x, l] = d(null),
|
|
10186
|
+
const [D, i] = d(null), [C, w] = d("identity"), [H, c] = d("name-photo"), [z, T] = d(!1), [x, l] = d(null), fA = aA(null);
|
|
10187
10187
|
NA(() => {
|
|
10188
|
-
|
|
10188
|
+
fA.current && (fA.current.scrollTop = 0);
|
|
10189
10189
|
}, [D, C]);
|
|
10190
|
-
const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [
|
|
10190
|
+
const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [uA, RA] = d(""), [vA, N] = d(""), [PA, kA] = d(null), [iA, BA] = d(!1), [OA, gf] = d(null), [KA, ef] = d({ w: 800, h: 1200 }), [hA, Pf] = d(0), [ZA, df] = d(!1), [jA, Bf] = d(!1);
|
|
10191
10191
|
NA(() => {
|
|
10192
|
-
if (H !== "calculating" || !
|
|
10192
|
+
if (H !== "calculating" || !PA) return;
|
|
10193
10193
|
let o = !1;
|
|
10194
|
-
return $f(
|
|
10194
|
+
return $f(PA).then((j) => {
|
|
10195
10195
|
!o && j && gf(j);
|
|
10196
10196
|
}).catch(() => {
|
|
10197
10197
|
}), () => {
|
|
10198
10198
|
o = !0;
|
|
10199
10199
|
};
|
|
10200
|
-
}, [H,
|
|
10200
|
+
}, [H, PA]), NA(() => {
|
|
10201
10201
|
if (H !== "calculating" || !z) return;
|
|
10202
10202
|
const o = setInterval(() => Pf((j) => j + 1), 1500);
|
|
10203
10203
|
return () => clearInterval(o);
|
|
10204
10204
|
}, [H, z]);
|
|
10205
|
-
const DA =
|
|
10206
|
-
|
|
10205
|
+
const DA = aA(null), TA = aA(null), [I, XA] = d(!1), [AA, sA] = d(null), yA = () => {
|
|
10206
|
+
AA === !0 && DA.current?.click();
|
|
10207
10207
|
}, Of = async (o) => {
|
|
10208
10208
|
const j = o.target.files?.[0];
|
|
10209
10209
|
if (j) {
|
|
10210
|
-
if (
|
|
10211
|
-
|
|
10210
|
+
if (AA !== !0) {
|
|
10211
|
+
N(P("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
10212
10212
|
return;
|
|
10213
10213
|
}
|
|
10214
10214
|
if (!j.type.startsWith("image/")) {
|
|
10215
|
-
|
|
10215
|
+
N(P("Please upload an image file"));
|
|
10216
10216
|
return;
|
|
10217
10217
|
}
|
|
10218
10218
|
if (j.size > 10 * 1024 * 1024) {
|
|
10219
|
-
|
|
10219
|
+
N(P("Image must be under 10MB"));
|
|
10220
10220
|
return;
|
|
10221
10221
|
}
|
|
10222
10222
|
BA(!0);
|
|
10223
10223
|
try {
|
|
10224
10224
|
const U = await tn(j);
|
|
10225
|
-
kA(U), e?.(U),
|
|
10225
|
+
kA(U), e?.(U), N("");
|
|
10226
10226
|
} catch {
|
|
10227
|
-
|
|
10227
|
+
N(P("Failed to process image"));
|
|
10228
10228
|
} finally {
|
|
10229
10229
|
BA(!1);
|
|
10230
10230
|
}
|
|
10231
10231
|
}
|
|
10232
10232
|
}, LA = () => {
|
|
10233
10233
|
kA(null), e?.(null), DA.current && (DA.current.value = "");
|
|
10234
|
-
}, [
|
|
10234
|
+
}, [gA, Uf] = d(null), [jf, lA] = d(null), [Mf, Qf] = d(null), [af, xf] = d(null), [_A, of] = d(null), [mA, E] = d(null), y = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], QA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], Q = k === "female", Z = Q ? GA.female : GA.male, FA = Q ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], SA = FA.indexOf(C), tf = FA.length, bA = SA === tf - 1, _ = () => {
|
|
10235
10235
|
if (O === "in") {
|
|
10236
10236
|
const o = parseInt(F, 10), j = parseInt(wA, 10);
|
|
10237
10237
|
!isNaN(o) && o >= 0 && !isNaN(j) && j >= 0 && K(String(Math.round((o * 12 + j) * 2.54)));
|
|
@@ -10245,7 +10245,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10245
10245
|
s("in");
|
|
10246
10246
|
}, W = () => {
|
|
10247
10247
|
if (!r.trim())
|
|
10248
|
-
return
|
|
10248
|
+
return N(P("Please enter a profile name")), !1;
|
|
10249
10249
|
let o;
|
|
10250
10250
|
if (O === "in") {
|
|
10251
10251
|
const R = parseInt(F, 10), u = parseInt(wA, 10);
|
|
@@ -10255,10 +10255,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10255
10255
|
o = !isNaN(R) && R > 0;
|
|
10256
10256
|
}
|
|
10257
10257
|
if (!o)
|
|
10258
|
-
return
|
|
10259
|
-
const j = parseFloat(h), U = parseFloat(
|
|
10260
|
-
return !j || j <= 0 ? (
|
|
10261
|
-
}, L = () => r.trim() ? (
|
|
10258
|
+
return N(P("Please enter a valid height")), !1;
|
|
10259
|
+
const j = parseFloat(h), U = parseFloat(uA);
|
|
10260
|
+
return !j || j <= 0 ? (N(P("Please enter a valid weight")), !1) : !U || U <= 0 ? (N(P("Please enter a valid age")), !1) : (N(""), !0);
|
|
10261
|
+
}, L = () => r.trim() ? (N(""), !0) : (N(P("Please enter a profile name")), !1), V = () => {
|
|
10262
10262
|
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S);
|
|
10263
10263
|
return {
|
|
10264
10264
|
name: r.trim(),
|
|
@@ -10270,15 +10270,15 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10270
10270
|
weightKg: parseFloat(h),
|
|
10271
10271
|
height: o,
|
|
10272
10272
|
weight: parseFloat(h),
|
|
10273
|
-
age: parseFloat(
|
|
10274
|
-
chestProfile:
|
|
10273
|
+
age: parseFloat(uA),
|
|
10274
|
+
chestProfile: gA || void 0,
|
|
10275
10275
|
midsectionProfile: jf || void 0,
|
|
10276
10276
|
hipProfile: Q ? af || void 0 : Mf || void 0,
|
|
10277
10277
|
bandSize: Q && _A || void 0,
|
|
10278
10278
|
cupSize: Q && mA || void 0
|
|
10279
10279
|
};
|
|
10280
10280
|
}, xA = () => {
|
|
10281
|
-
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(
|
|
10281
|
+
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(uA);
|
|
10282
10282
|
return {
|
|
10283
10283
|
name: r.trim(),
|
|
10284
10284
|
gender: k,
|
|
@@ -10288,38 +10288,38 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10288
10288
|
...o > 0 ? { heightCm: o, height: o } : {},
|
|
10289
10289
|
...j > 0 ? { weightKg: j, weight: j } : {},
|
|
10290
10290
|
...U > 0 ? { age: U } : {},
|
|
10291
|
-
photoBase64:
|
|
10291
|
+
photoBase64: PA || void 0
|
|
10292
10292
|
};
|
|
10293
10293
|
}, wf = () => {
|
|
10294
10294
|
if (!(C === "identity" && !W())) {
|
|
10295
|
-
if (C === "chest" && !
|
|
10296
|
-
|
|
10295
|
+
if (C === "chest" && !gA) {
|
|
10296
|
+
N(P("Please pick an option"));
|
|
10297
10297
|
return;
|
|
10298
10298
|
}
|
|
10299
10299
|
if (C === "stomach" && !jf) {
|
|
10300
|
-
|
|
10300
|
+
N(P("Please pick an option"));
|
|
10301
10301
|
return;
|
|
10302
10302
|
}
|
|
10303
10303
|
if (C === "seat" && !Mf) {
|
|
10304
|
-
|
|
10304
|
+
N(P("Please pick an option"));
|
|
10305
10305
|
return;
|
|
10306
10306
|
}
|
|
10307
10307
|
if (C === "hips" && !af) {
|
|
10308
|
-
|
|
10308
|
+
N(P("Please pick an option"));
|
|
10309
10309
|
return;
|
|
10310
10310
|
}
|
|
10311
10311
|
if (C === "bra" && (!_A || !mA)) {
|
|
10312
|
-
|
|
10312
|
+
N(P("Please pick band and cup size"));
|
|
10313
10313
|
return;
|
|
10314
10314
|
}
|
|
10315
|
-
if (
|
|
10315
|
+
if (N(""), bA) {
|
|
10316
10316
|
n(V());
|
|
10317
10317
|
return;
|
|
10318
10318
|
}
|
|
10319
10319
|
w(FA[SA + 1]);
|
|
10320
10320
|
}
|
|
10321
|
-
},
|
|
10322
|
-
|
|
10321
|
+
}, cA = (o, j) => {
|
|
10322
|
+
N(""), o === "chest" ? Uf(j) : o === "stomach" ? lA(j) : o === "seat" ? Qf(j) : o === "hips" && xf(j);
|
|
10323
10323
|
const U = FA.indexOf(o), R = U === tf - 1;
|
|
10324
10324
|
setTimeout(() => {
|
|
10325
10325
|
if (R) {
|
|
@@ -10329,7 +10329,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10329
10329
|
w(FA[U + 1]);
|
|
10330
10330
|
}, 220);
|
|
10331
10331
|
}, Df = () => {
|
|
10332
|
-
if (
|
|
10332
|
+
if (N(""), C === "identity") {
|
|
10333
10333
|
i(null);
|
|
10334
10334
|
return;
|
|
10335
10335
|
}
|
|
@@ -10337,33 +10337,33 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10337
10337
|
}, Af = D === "manual" && (C === "chest" || C === "stomach" || C === "seat" || C === "hips"), Hf = async () => {
|
|
10338
10338
|
if (H === "name-photo") {
|
|
10339
10339
|
if (!L()) return;
|
|
10340
|
-
if (!
|
|
10341
|
-
|
|
10340
|
+
if (!PA) {
|
|
10341
|
+
N(P("Please upload a photo"));
|
|
10342
10342
|
return;
|
|
10343
10343
|
}
|
|
10344
10344
|
if (O === "in") {
|
|
10345
10345
|
const U = parseFloat(F);
|
|
10346
10346
|
if (!U || U < 3 || U > 8) {
|
|
10347
|
-
|
|
10347
|
+
N(P("Please enter a valid height"));
|
|
10348
10348
|
return;
|
|
10349
10349
|
}
|
|
10350
10350
|
} else {
|
|
10351
10351
|
const U = parseFloat(S);
|
|
10352
10352
|
if (!U || U < 100 || U > 250) {
|
|
10353
|
-
|
|
10353
|
+
N(P("Please enter a valid height"));
|
|
10354
10354
|
return;
|
|
10355
10355
|
}
|
|
10356
10356
|
}
|
|
10357
10357
|
const j = parseFloat(h);
|
|
10358
10358
|
if (!j || j <= 0) {
|
|
10359
|
-
|
|
10359
|
+
N(P("Please enter a valid weight"));
|
|
10360
10360
|
return;
|
|
10361
10361
|
}
|
|
10362
|
-
if (
|
|
10363
|
-
const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(
|
|
10362
|
+
if (N(""), c("calculating"), T(!0), B && PA) {
|
|
10363
|
+
const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(uA);
|
|
10364
10364
|
try {
|
|
10365
10365
|
const u = await B({
|
|
10366
|
-
photoBase64:
|
|
10366
|
+
photoBase64: PA,
|
|
10367
10367
|
height: U || 0,
|
|
10368
10368
|
weight: j || 0,
|
|
10369
10369
|
heightUnit: O,
|
|
@@ -10385,7 +10385,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10385
10385
|
const o = xA();
|
|
10386
10386
|
x && (o.measurements = x, o.measurementsUnit = "cm"), n(o);
|
|
10387
10387
|
}, WA = () => {
|
|
10388
|
-
if (
|
|
10388
|
+
if (N(""), H === "details") {
|
|
10389
10389
|
c("name-photo");
|
|
10390
10390
|
return;
|
|
10391
10391
|
}
|
|
@@ -10416,14 +10416,14 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10416
10416
|
if (D == null) return 0;
|
|
10417
10417
|
if (D === "manual") return Math.round((SA + 1) / tf * 100);
|
|
10418
10418
|
let o = 0;
|
|
10419
|
-
return r.trim() && (o += 50),
|
|
10419
|
+
return r.trim() && (o += 50), PA && (o += 50), o;
|
|
10420
10420
|
})();
|
|
10421
10421
|
return /* @__PURE__ */ f("div", { className: "ps-cpw-root", children: [
|
|
10422
10422
|
!(D === "image" && H === "name-photo") && /* @__PURE__ */ f("div", { className: "ps-cpw-step-head", children: [
|
|
10423
10423
|
/* @__PURE__ */ A("h2", { className: "ps-cpw-step-title", children: nf }),
|
|
10424
10424
|
D != null && /* @__PURE__ */ A("div", { className: "ps-cpw-progress", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-track", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-fill", style: { width: `${VA}%` } }) }) })
|
|
10425
10425
|
] }),
|
|
10426
|
-
/* @__PURE__ */ f("div", { className: "ps-cpw-body", ref:
|
|
10426
|
+
/* @__PURE__ */ f("div", { className: "ps-cpw-body", ref: fA, children: [
|
|
10427
10427
|
D == null && /* @__PURE__ */ A("div", { className: "ps-cpw-method-picker ps-cpw-fade-in", children: /* @__PURE__ */ f("div", { className: "ps-cpw-method-grid", children: [
|
|
10428
10428
|
/* @__PURE__ */ f(
|
|
10429
10429
|
"button",
|
|
@@ -10490,7 +10490,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10490
10490
|
value: r,
|
|
10491
10491
|
placeholder: P("e.g. My Measurements"),
|
|
10492
10492
|
onChange: (o) => {
|
|
10493
|
-
b(o.target.value),
|
|
10493
|
+
b(o.target.value), N("");
|
|
10494
10494
|
}
|
|
10495
10495
|
}
|
|
10496
10496
|
) })
|
|
@@ -10507,7 +10507,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10507
10507
|
value: S,
|
|
10508
10508
|
placeholder: P("e.g. 173"),
|
|
10509
10509
|
onChange: (o) => {
|
|
10510
|
-
K(o.target.value),
|
|
10510
|
+
K(o.target.value), N("");
|
|
10511
10511
|
}
|
|
10512
10512
|
}
|
|
10513
10513
|
),
|
|
@@ -10523,7 +10523,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10523
10523
|
value: F,
|
|
10524
10524
|
placeholder: "5",
|
|
10525
10525
|
onChange: (o) => {
|
|
10526
|
-
tA(o.target.value),
|
|
10526
|
+
tA(o.target.value), N("");
|
|
10527
10527
|
}
|
|
10528
10528
|
}
|
|
10529
10529
|
),
|
|
@@ -10538,7 +10538,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10538
10538
|
value: wA,
|
|
10539
10539
|
placeholder: "8",
|
|
10540
10540
|
onChange: (o) => {
|
|
10541
|
-
YA(o.target.value),
|
|
10541
|
+
YA(o.target.value), N("");
|
|
10542
10542
|
}
|
|
10543
10543
|
}
|
|
10544
10544
|
),
|
|
@@ -10557,7 +10557,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10557
10557
|
value: h,
|
|
10558
10558
|
placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"),
|
|
10559
10559
|
onChange: (o) => {
|
|
10560
|
-
a(o.target.value),
|
|
10560
|
+
a(o.target.value), N("");
|
|
10561
10561
|
}
|
|
10562
10562
|
}
|
|
10563
10563
|
),
|
|
@@ -10573,10 +10573,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10573
10573
|
type: "number",
|
|
10574
10574
|
inputMode: "numeric",
|
|
10575
10575
|
className: "ps-bp-inline-input",
|
|
10576
|
-
value:
|
|
10576
|
+
value: uA,
|
|
10577
10577
|
placeholder: P("e.g. 30"),
|
|
10578
10578
|
onChange: (o) => {
|
|
10579
|
-
RA(o.target.value),
|
|
10579
|
+
RA(o.target.value), N("");
|
|
10580
10580
|
}
|
|
10581
10581
|
}
|
|
10582
10582
|
),
|
|
@@ -10593,9 +10593,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10593
10593
|
title: P("CHEST PROFILE"),
|
|
10594
10594
|
subtitle: P("Select the profile that best matches your chest breadth"),
|
|
10595
10595
|
children: [
|
|
10596
|
-
/* @__PURE__ */ A(Gf, { img: Z.chest?.narrow ?? null, label: P("NARROW"), selected:
|
|
10597
|
-
/* @__PURE__ */ A(Gf, { img: Z.chest?.average ?? null, label: P("AVERAGE"), selected:
|
|
10598
|
-
/* @__PURE__ */ A(Gf, { img: Z.chest?.broad ?? null, label: P("BROAD"), selected:
|
|
10596
|
+
/* @__PURE__ */ A(Gf, { img: Z.chest?.narrow ?? null, label: P("NARROW"), selected: gA === "narrow", onSelect: () => cA("chest", "narrow") }),
|
|
10597
|
+
/* @__PURE__ */ A(Gf, { img: Z.chest?.average ?? null, label: P("AVERAGE"), selected: gA === "average", onSelect: () => cA("chest", "average") }),
|
|
10598
|
+
/* @__PURE__ */ A(Gf, { img: Z.chest?.broad ?? null, label: P("BROAD"), selected: gA === "broad", onSelect: () => cA("chest", "broad") })
|
|
10599
10599
|
]
|
|
10600
10600
|
}
|
|
10601
10601
|
),
|
|
@@ -10606,9 +10606,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10606
10606
|
title: P("STOMACH PROFILE"),
|
|
10607
10607
|
subtitle: P("Describe your mid-section silhouette"),
|
|
10608
10608
|
children: [
|
|
10609
|
-
/* @__PURE__ */ A(Gf, { img: Z.stomach?.flat ?? null, label: P("FLAT"), selected: jf === "flat", onSelect: () =>
|
|
10610
|
-
/* @__PURE__ */ A(Gf, { img: Z.stomach?.average ?? null, label: P("AVERAGE"), selected: jf === "average", onSelect: () =>
|
|
10611
|
-
/* @__PURE__ */ A(Gf, { img: Z.stomach?.round ?? null, label: P("ROUND"), selected: jf === "round", onSelect: () =>
|
|
10609
|
+
/* @__PURE__ */ A(Gf, { img: Z.stomach?.flat ?? null, label: P("FLAT"), selected: jf === "flat", onSelect: () => cA("stomach", "flat") }),
|
|
10610
|
+
/* @__PURE__ */ A(Gf, { img: Z.stomach?.average ?? null, label: P("AVERAGE"), selected: jf === "average", onSelect: () => cA("stomach", "average") }),
|
|
10611
|
+
/* @__PURE__ */ A(Gf, { img: Z.stomach?.round ?? null, label: P("ROUND"), selected: jf === "round", onSelect: () => cA("stomach", "round") })
|
|
10612
10612
|
]
|
|
10613
10613
|
}
|
|
10614
10614
|
),
|
|
@@ -10619,9 +10619,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10619
10619
|
title: P("BACK & SEAT"),
|
|
10620
10620
|
subtitle: P("The curvature of your lower spine and seat profile"),
|
|
10621
10621
|
children: [
|
|
10622
|
-
/* @__PURE__ */ A(Gf, { img: Z.seat?.narrow ?? null, label: P("STRAIGHT"), selected: Mf === "narrow", onSelect: () =>
|
|
10623
|
-
/* @__PURE__ */ A(Gf, { img: Z.seat?.average ?? null, label: P("CURVED"), selected: Mf === "average", onSelect: () =>
|
|
10624
|
-
/* @__PURE__ */ A(Gf, { img: Z.seat?.full ?? null, label: P("DEEP"), selected: Mf === "full", onSelect: () =>
|
|
10622
|
+
/* @__PURE__ */ A(Gf, { img: Z.seat?.narrow ?? null, label: P("STRAIGHT"), selected: Mf === "narrow", onSelect: () => cA("seat", "narrow") }),
|
|
10623
|
+
/* @__PURE__ */ A(Gf, { img: Z.seat?.average ?? null, label: P("CURVED"), selected: Mf === "average", onSelect: () => cA("seat", "average") }),
|
|
10624
|
+
/* @__PURE__ */ A(Gf, { img: Z.seat?.full ?? null, label: P("DEEP"), selected: Mf === "full", onSelect: () => cA("seat", "full") })
|
|
10625
10625
|
]
|
|
10626
10626
|
}
|
|
10627
10627
|
),
|
|
@@ -10632,9 +10632,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10632
10632
|
title: P("HIP PROFILE"),
|
|
10633
10633
|
subtitle: P("The curvature of your hips and thighs"),
|
|
10634
10634
|
children: [
|
|
10635
|
-
/* @__PURE__ */ A(Gf, { img: Z.hips.narrow ?? null, label: P("NARROW"), selected: af === "narrow", onSelect: () =>
|
|
10636
|
-
/* @__PURE__ */ A(Gf, { img: Z.hips.average ?? null, label: P("AVERAGE"), selected: af === "average", onSelect: () =>
|
|
10637
|
-
/* @__PURE__ */ A(Gf, { img: Z.hips.full ?? null, label: P("FULL"), selected: af === "full", onSelect: () =>
|
|
10635
|
+
/* @__PURE__ */ A(Gf, { img: Z.hips.narrow ?? null, label: P("NARROW"), selected: af === "narrow", onSelect: () => cA("hips", "narrow") }),
|
|
10636
|
+
/* @__PURE__ */ A(Gf, { img: Z.hips.average ?? null, label: P("AVERAGE"), selected: af === "average", onSelect: () => cA("hips", "average") }),
|
|
10637
|
+
/* @__PURE__ */ A(Gf, { img: Z.hips.full ?? null, label: P("FULL"), selected: af === "full", onSelect: () => cA("hips", "full") })
|
|
10638
10638
|
]
|
|
10639
10639
|
}
|
|
10640
10640
|
),
|
|
@@ -10652,7 +10652,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10652
10652
|
className: "ps-cpw-input",
|
|
10653
10653
|
value: _A ?? "",
|
|
10654
10654
|
onChange: (o) => {
|
|
10655
|
-
of(o.target.value || null),
|
|
10655
|
+
of(o.target.value || null), N("");
|
|
10656
10656
|
},
|
|
10657
10657
|
children: [
|
|
10658
10658
|
/* @__PURE__ */ A("option", { value: "", children: P("Select") }),
|
|
@@ -10669,11 +10669,11 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10669
10669
|
className: "ps-cpw-input",
|
|
10670
10670
|
value: mA ?? "",
|
|
10671
10671
|
onChange: (o) => {
|
|
10672
|
-
E(o.target.value || null),
|
|
10672
|
+
E(o.target.value || null), N("");
|
|
10673
10673
|
},
|
|
10674
10674
|
children: [
|
|
10675
10675
|
/* @__PURE__ */ A("option", { value: "", children: P("Select") }),
|
|
10676
|
-
|
|
10676
|
+
QA.map((o) => /* @__PURE__ */ A("option", { value: o, children: o }, o))
|
|
10677
10677
|
]
|
|
10678
10678
|
}
|
|
10679
10679
|
)
|
|
@@ -10696,10 +10696,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10696
10696
|
"div",
|
|
10697
10697
|
{
|
|
10698
10698
|
onClick: () => {
|
|
10699
|
-
!
|
|
10699
|
+
!PA && AA === !0 && yA();
|
|
10700
10700
|
},
|
|
10701
10701
|
onMouseEnter: () => {
|
|
10702
|
-
!
|
|
10702
|
+
!PA && AA === !0 && Bf(!0);
|
|
10703
10703
|
},
|
|
10704
10704
|
onMouseLeave: () => Bf(!1),
|
|
10705
10705
|
style: {
|
|
@@ -10708,16 +10708,16 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10708
10708
|
flexDirection: "column",
|
|
10709
10709
|
alignItems: "center",
|
|
10710
10710
|
justifyContent: "center",
|
|
10711
|
-
border:
|
|
10711
|
+
border: PA ? "2px solid var(--ps-accent)" : AA === !0 && jA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
|
|
10712
10712
|
borderRadius: "0.5vw",
|
|
10713
|
-
cursor:
|
|
10713
|
+
cursor: PA ? "default" : AA === !0 ? "pointer" : "default",
|
|
10714
10714
|
position: "relative",
|
|
10715
|
-
background:
|
|
10715
|
+
background: PA ? "var(--ps-bg-secondary)" : AA === !0 && jA ? "rgba(33,84,239,0.04)" : AA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
|
|
10716
10716
|
transition: "border-color 0.18s, background 0.18s",
|
|
10717
10717
|
overflow: "hidden"
|
|
10718
10718
|
},
|
|
10719
|
-
children:
|
|
10720
|
-
/* @__PURE__ */ A("img", { src:
|
|
10719
|
+
children: PA ? /* @__PURE__ */ f(rA, { children: [
|
|
10720
|
+
/* @__PURE__ */ A("img", { src: PA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
10721
10721
|
/* @__PURE__ */ A("button", { onClick: (o) => {
|
|
10722
10722
|
o.stopPropagation(), LA();
|
|
10723
10723
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
@@ -10730,7 +10730,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10730
10730
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: P(iA ? "Processing..." : "Upload your photo") }),
|
|
10731
10731
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: P("Click or drag a full-body photo") }),
|
|
10732
10732
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.5vw", color: "var(--ps-text-dim)", marginTop: "0.4vw" }, children: "JPEG, PNG (max 10MB)" }),
|
|
10733
|
-
|
|
10733
|
+
AA === null && /* @__PURE__ */ f(
|
|
10734
10734
|
"div",
|
|
10735
10735
|
{
|
|
10736
10736
|
role: "dialog",
|
|
@@ -10755,7 +10755,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10755
10755
|
{
|
|
10756
10756
|
type: "button",
|
|
10757
10757
|
onClick: (o) => {
|
|
10758
|
-
o.stopPropagation(), sA(!0),
|
|
10758
|
+
o.stopPropagation(), sA(!0), N("");
|
|
10759
10759
|
},
|
|
10760
10760
|
style: {
|
|
10761
10761
|
padding: "0.4vw 1vw",
|
|
@@ -10795,7 +10795,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10795
10795
|
]
|
|
10796
10796
|
}
|
|
10797
10797
|
),
|
|
10798
|
-
|
|
10798
|
+
AA === !1 && /* @__PURE__ */ f(
|
|
10799
10799
|
"div",
|
|
10800
10800
|
{
|
|
10801
10801
|
role: "alert",
|
|
@@ -10907,23 +10907,23 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10907
10907
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
10908
10908
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("NAME") }),
|
|
10909
10909
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: TA, type: "text", className: `ps-bp-inline-input${I ? " ps-cpw-shake" : ""}`, value: r, placeholder: P("e.g. My Photo Profile"), onChange: (o) => {
|
|
10910
|
-
b(o.target.value),
|
|
10911
|
-
}, onAnimationEnd: () =>
|
|
10910
|
+
b(o.target.value), N("");
|
|
10911
|
+
}, onAnimationEnd: () => XA(!1) }) })
|
|
10912
10912
|
] }),
|
|
10913
10913
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
10914
10914
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("HEIGHT") }),
|
|
10915
10915
|
O === "cm" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
10916
10916
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: S, placeholder: P("e.g. 173"), onChange: (o) => {
|
|
10917
|
-
K(o.target.value),
|
|
10917
|
+
K(o.target.value), N("");
|
|
10918
10918
|
} }),
|
|
10919
10919
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
10920
10920
|
] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
10921
10921
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: F, placeholder: "5", onChange: (o) => {
|
|
10922
|
-
tA(o.target.value),
|
|
10922
|
+
tA(o.target.value), N("");
|
|
10923
10923
|
} }),
|
|
10924
10924
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
10925
10925
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: wA, placeholder: "8", onChange: (o) => {
|
|
10926
|
-
YA(o.target.value),
|
|
10926
|
+
YA(o.target.value), N("");
|
|
10927
10927
|
} }),
|
|
10928
10928
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
10929
10929
|
] })
|
|
@@ -10932,7 +10932,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10932
10932
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("WEIGHT") }),
|
|
10933
10933
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
10934
10934
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: h, placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"), onChange: (o) => {
|
|
10935
|
-
a(o.target.value),
|
|
10935
|
+
a(o.target.value), N("");
|
|
10936
10936
|
} }),
|
|
10937
10937
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: O === "in" ? "lbs" : "kg" })
|
|
10938
10938
|
] })
|
|
@@ -10940,8 +10940,8 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10940
10940
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
10941
10941
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
|
|
10942
10942
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
10943
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10944
|
-
RA(o.target.value),
|
|
10943
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: uA, placeholder: P("e.g. 30"), onChange: (o) => {
|
|
10944
|
+
RA(o.target.value), N("");
|
|
10945
10945
|
} }),
|
|
10946
10946
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
|
|
10947
10947
|
] })
|
|
@@ -11051,16 +11051,16 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11051
11051
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("HEIGHT") }),
|
|
11052
11052
|
O === "cm" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
11053
11053
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: S, placeholder: P("e.g. 173"), onChange: (o) => {
|
|
11054
|
-
K(o.target.value),
|
|
11054
|
+
K(o.target.value), N("");
|
|
11055
11055
|
} }),
|
|
11056
11056
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
11057
11057
|
] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
11058
11058
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: F, placeholder: "5", onChange: (o) => {
|
|
11059
|
-
tA(o.target.value),
|
|
11059
|
+
tA(o.target.value), N("");
|
|
11060
11060
|
} }),
|
|
11061
11061
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
11062
11062
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: wA, placeholder: "8", onChange: (o) => {
|
|
11063
|
-
YA(o.target.value),
|
|
11063
|
+
YA(o.target.value), N("");
|
|
11064
11064
|
} }),
|
|
11065
11065
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
11066
11066
|
] })
|
|
@@ -11069,7 +11069,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11069
11069
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("WEIGHT") }),
|
|
11070
11070
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
11071
11071
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: h, placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"), onChange: (o) => {
|
|
11072
|
-
a(o.target.value),
|
|
11072
|
+
a(o.target.value), N("");
|
|
11073
11073
|
} }),
|
|
11074
11074
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: O === "in" ? "lbs" : "kg" })
|
|
11075
11075
|
] })
|
|
@@ -11077,8 +11077,8 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11077
11077
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
11078
11078
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
|
|
11079
11079
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
11080
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
11081
|
-
RA(o.target.value),
|
|
11080
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: uA, placeholder: P("e.g. 30"), onChange: (o) => {
|
|
11081
|
+
RA(o.target.value), N("");
|
|
11082
11082
|
} }),
|
|
11083
11083
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
|
|
11084
11084
|
] })
|
|
@@ -11120,10 +11120,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11120
11120
|
overflow: "hidden",
|
|
11121
11121
|
minHeight: "20vw"
|
|
11122
11122
|
}, children: [
|
|
11123
|
-
|
|
11123
|
+
PA && /* @__PURE__ */ A(
|
|
11124
11124
|
"img",
|
|
11125
11125
|
{
|
|
11126
|
-
src:
|
|
11126
|
+
src: PA,
|
|
11127
11127
|
alt: "",
|
|
11128
11128
|
style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain", display: "block" },
|
|
11129
11129
|
onLoad: (R) => {
|
|
@@ -11144,14 +11144,14 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11144
11144
|
"aria-hidden": "true",
|
|
11145
11145
|
children: [
|
|
11146
11146
|
U.map(([R, u], Y) => {
|
|
11147
|
-
const MA = OA[R],
|
|
11148
|
-
return !MA || !
|
|
11147
|
+
const MA = OA[R], HA = OA[u];
|
|
11148
|
+
return !MA || !HA ? null : /* @__PURE__ */ A(
|
|
11149
11149
|
"line",
|
|
11150
11150
|
{
|
|
11151
11151
|
x1: MA.x * KA.w,
|
|
11152
11152
|
y1: MA.y * KA.h,
|
|
11153
|
-
x2:
|
|
11154
|
-
y2:
|
|
11153
|
+
x2: HA.x * KA.w,
|
|
11154
|
+
y2: HA.y * KA.h,
|
|
11155
11155
|
stroke: "rgba(100,210,255,0.95)",
|
|
11156
11156
|
strokeWidth: Math.max(3, KA.w / 180),
|
|
11157
11157
|
strokeLinecap: "round"
|
|
@@ -11219,7 +11219,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11219
11219
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: ff, children: D == null ? P("Cancel") : `← ${P("Back")}` }),
|
|
11220
11220
|
D === "manual" && !Af && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: wf, children: P(bA ? "CALCULATE MY FIT" : "Continue") }),
|
|
11221
11221
|
D === "image" && H === "name-photo" && (() => {
|
|
11222
|
-
const o = O === "in" ? parseFloat(F) > 0 || parseFloat(wA) > 0 : parseFloat(S) > 0, j = parseFloat(h) > 0, U = !!r.trim(), R = !!
|
|
11222
|
+
const o = O === "in" ? parseFloat(F) > 0 || parseFloat(wA) > 0 : parseFloat(S) > 0, j = parseFloat(h) > 0, U = !!r.trim(), R = !!PA, u = P(R ? U ? o ? j ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Y = !R || !U || !o || !j;
|
|
11223
11223
|
return /* @__PURE__ */ A(
|
|
11224
11224
|
"button",
|
|
11225
11225
|
{
|
|
@@ -11227,7 +11227,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11227
11227
|
className: "ps-cpw-next-btn",
|
|
11228
11228
|
onClick: () => {
|
|
11229
11229
|
if (!U) {
|
|
11230
|
-
|
|
11230
|
+
XA(!0), TA.current?.focus();
|
|
11231
11231
|
return;
|
|
11232
11232
|
}
|
|
11233
11233
|
Hf();
|
|
@@ -11241,7 +11241,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11241
11241
|
D === "image" && H === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Calculate My Body Parts") }),
|
|
11242
11242
|
D === "image" && H === "calculating" && !z && x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Save Profile") }),
|
|
11243
11243
|
D === "image" && H === "calculating" && !z && !x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
11244
|
-
c("details"),
|
|
11244
|
+
c("details"), N("");
|
|
11245
11245
|
}, children: P("Try Again") })
|
|
11246
11246
|
] })
|
|
11247
11247
|
] });
|
|
@@ -11277,7 +11277,7 @@ function oB({
|
|
|
11277
11277
|
isEstimating: w = !1,
|
|
11278
11278
|
t: H
|
|
11279
11279
|
}) {
|
|
11280
|
-
const c = n.gender === "female" ? gB : PB, z = n.measurements || {}, T = Object.keys(z).some((K) => z[K] != null), [x, l] = d(n.measurementsUnit || "cm"), [
|
|
11280
|
+
const c = n.gender === "female" ? gB : PB, z = n.measurements || {}, T = Object.keys(z).some((K) => z[K] != null), [x, l] = d(n.measurementsUnit || "cm"), [fA, r] = d(() => {
|
|
11281
11281
|
const K = {};
|
|
11282
11282
|
return c.forEach((F) => {
|
|
11283
11283
|
const tA = z[F.key];
|
|
@@ -11305,7 +11305,7 @@ function oB({
|
|
|
11305
11305
|
}), l(K));
|
|
11306
11306
|
}, S = () => {
|
|
11307
11307
|
const K = { ...n.measurements || {} };
|
|
11308
|
-
for (const [F, tA] of Object.entries(
|
|
11308
|
+
for (const [F, tA] of Object.entries(fA)) {
|
|
11309
11309
|
const wA = parseFloat(tA);
|
|
11310
11310
|
!isNaN(wA) && wA > 0 && (K[F] = wA);
|
|
11311
11311
|
}
|
|
@@ -11346,7 +11346,7 @@ function oB({
|
|
|
11346
11346
|
] }) }),
|
|
11347
11347
|
/* @__PURE__ */ f("div", { className: "ps-pmv-measure-list", children: [
|
|
11348
11348
|
c.map((K) => {
|
|
11349
|
-
const F = z[K.key], tA = w && F == null && !
|
|
11349
|
+
const F = z[K.key], tA = w && F == null && !fA[K.key];
|
|
11350
11350
|
return /* @__PURE__ */ f("div", { className: `ps-pmv-measure-row${F == null ? " ps-loading" : ""}`, children: [
|
|
11351
11351
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
11352
11352
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: H(K.label) }),
|
|
@@ -11360,7 +11360,7 @@ function oB({
|
|
|
11360
11360
|
type: "number",
|
|
11361
11361
|
step: "0.1",
|
|
11362
11362
|
className: "ps-pmv-inline-input",
|
|
11363
|
-
value:
|
|
11363
|
+
value: fA[K.key] ?? "",
|
|
11364
11364
|
placeholder: "—",
|
|
11365
11365
|
onChange: (wA) => r((YA) => ({ ...YA, [K.key]: wA.target.value }))
|
|
11366
11366
|
}
|
|
@@ -11553,14 +11553,14 @@ function iB({
|
|
|
11553
11553
|
t: T,
|
|
11554
11554
|
onRegisterBackInterceptor: x
|
|
11555
11555
|
}) {
|
|
11556
|
-
const [l,
|
|
11556
|
+
const [l, fA] = d(!1), [r, b] = d(null), k = r && n.find((v) => v.id === r) || null;
|
|
11557
11557
|
return NA(() => {
|
|
11558
11558
|
r && !n.find((v) => v.id === r) && b(null);
|
|
11559
11559
|
}, [n, r]), NA(() => {
|
|
11560
11560
|
if (!x) return;
|
|
11561
11561
|
x(() => l || r !== null, () => {
|
|
11562
11562
|
if (l) {
|
|
11563
|
-
|
|
11563
|
+
fA(!1);
|
|
11564
11564
|
return;
|
|
11565
11565
|
}
|
|
11566
11566
|
if (r !== null) {
|
|
@@ -11599,9 +11599,9 @@ function iB({
|
|
|
11599
11599
|
}
|
|
11600
11600
|
} catch {
|
|
11601
11601
|
}
|
|
11602
|
-
|
|
11602
|
+
fA(!1), O && b(O);
|
|
11603
11603
|
},
|
|
11604
|
-
onCancel: () =>
|
|
11604
|
+
onCancel: () => fA(!1),
|
|
11605
11605
|
onPhotoPreview: H,
|
|
11606
11606
|
onEstimate: c,
|
|
11607
11607
|
t: T
|
|
@@ -11612,7 +11612,7 @@ function iB({
|
|
|
11612
11612
|
/* @__PURE__ */ A("p", { className: "ps-msp-subtitle", children: T("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
|
|
11613
11613
|
] }),
|
|
11614
11614
|
/* @__PURE__ */ f("div", { className: "ps-msp-grid", children: [
|
|
11615
|
-
/* @__PURE__ */ A(tB, { onClick: () =>
|
|
11615
|
+
/* @__PURE__ */ A(tB, { onClick: () => fA(!0), t: T }),
|
|
11616
11616
|
n.map((v) => /* @__PURE__ */ A(
|
|
11617
11617
|
vB,
|
|
11618
11618
|
{
|
|
@@ -11668,7 +11668,7 @@ function HB({
|
|
|
11668
11668
|
setAge: T,
|
|
11669
11669
|
switchToMetric: x,
|
|
11670
11670
|
switchToImperial: l,
|
|
11671
|
-
onUploadPhoto:
|
|
11671
|
+
onUploadPhoto: fA,
|
|
11672
11672
|
onSwitchToScan: r,
|
|
11673
11673
|
onNext: b,
|
|
11674
11674
|
canProceed: k,
|
|
@@ -11679,14 +11679,14 @@ function HB({
|
|
|
11679
11679
|
error: K,
|
|
11680
11680
|
t: F
|
|
11681
11681
|
}) {
|
|
11682
|
-
const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154),
|
|
11682
|
+
const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154), uA = parseFloat(z) || 30, RA = g === "kg" ? 30 : 66, vA = g === "kg" ? 200 : 440, N = 120, PA = 220, kA = 48, iA = 84, BA = 13, OA = 100, gf = (tA - N) / (PA - N) * 100, KA = (wA - kA) / (iA - kA) * 100, ef = (a - RA) / (vA - RA) * 100, hA = (uA - BA) / (OA - BA) * 100, Pf = e ? parseFloat(D) > 0 || parseFloat(C) > 0 : parseFloat(B) > 0, ZA = parseFloat(H) > 0, df = Pf && ZA, jA = (sA) => {
|
|
11683
11683
|
const yA = Math.max(kA, Math.min(iA, sA));
|
|
11684
11684
|
i(String(Math.floor(yA / 12))), w(String(yA % 12));
|
|
11685
11685
|
}, Bf = () => {
|
|
11686
|
-
n === "in" ?
|
|
11686
|
+
n === "in" ? jA(wA + 1) : P(String(Math.min(PA, tA + 1)));
|
|
11687
11687
|
}, DA = () => {
|
|
11688
|
-
n === "in" ?
|
|
11689
|
-
}, TA = () => c(String(Math.min(vA, a + 1))), I = () => c(String(Math.max(RA, a - 1))),
|
|
11688
|
+
n === "in" ? jA(wA - 1) : P(String(Math.max(N, tA - 1)));
|
|
11689
|
+
}, TA = () => c(String(Math.min(vA, a + 1))), I = () => c(String(Math.max(RA, a - 1))), XA = () => T(String(Math.min(OA, uA + 1))), AA = () => T(String(Math.max(BA, uA - 1)));
|
|
11690
11690
|
return /* @__PURE__ */ f("div", { className: "ps-bpm-root", children: [
|
|
11691
11691
|
/* @__PURE__ */ f("div", { className: "ps-bpm-header", children: [
|
|
11692
11692
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
|
|
@@ -11738,7 +11738,7 @@ function HB({
|
|
|
11738
11738
|
max: iA,
|
|
11739
11739
|
step: 1,
|
|
11740
11740
|
value: wA,
|
|
11741
|
-
onChange: (sA) =>
|
|
11741
|
+
onChange: (sA) => jA(parseInt(sA.target.value, 10)),
|
|
11742
11742
|
style: { "--ps-pct": `${KA}%` }
|
|
11743
11743
|
}
|
|
11744
11744
|
) : /* @__PURE__ */ A(
|
|
@@ -11746,8 +11746,8 @@ function HB({
|
|
|
11746
11746
|
{
|
|
11747
11747
|
type: "range",
|
|
11748
11748
|
className: "ps-bpm-slider",
|
|
11749
|
-
min:
|
|
11750
|
-
max:
|
|
11749
|
+
min: N,
|
|
11750
|
+
max: PA,
|
|
11751
11751
|
step: 1,
|
|
11752
11752
|
value: tA,
|
|
11753
11753
|
onChange: (sA) => P(sA.target.value),
|
|
@@ -11788,13 +11788,13 @@ function HB({
|
|
|
11788
11788
|
/* @__PURE__ */ f("div", { className: "ps-bpm-row-top", children: [
|
|
11789
11789
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: F("AGE") }),
|
|
11790
11790
|
/* @__PURE__ */ f("span", { className: "ps-bpm-value-display", children: [
|
|
11791
|
-
Math.round(
|
|
11791
|
+
Math.round(uA),
|
|
11792
11792
|
" ",
|
|
11793
11793
|
F("YEARS")
|
|
11794
11794
|
] })
|
|
11795
11795
|
] }),
|
|
11796
11796
|
/* @__PURE__ */ f("div", { className: "ps-bpm-slider-row", children: [
|
|
11797
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
11797
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: AA, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(hn, {}) }),
|
|
11798
11798
|
/* @__PURE__ */ A(
|
|
11799
11799
|
"input",
|
|
11800
11800
|
{
|
|
@@ -11803,12 +11803,12 @@ function HB({
|
|
|
11803
11803
|
min: BA,
|
|
11804
11804
|
max: OA,
|
|
11805
11805
|
step: 1,
|
|
11806
|
-
value:
|
|
11806
|
+
value: uA,
|
|
11807
11807
|
onChange: (sA) => T(sA.target.value),
|
|
11808
11808
|
style: { "--ps-pct": `${hA}%` }
|
|
11809
11809
|
}
|
|
11810
11810
|
),
|
|
11811
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
11811
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: XA, "aria-label": F("Increase"), children: /* @__PURE__ */ A(ln, {}) })
|
|
11812
11812
|
] })
|
|
11813
11813
|
] })
|
|
11814
11814
|
] }),
|
|
@@ -11819,7 +11819,7 @@ function HB({
|
|
|
11819
11819
|
{
|
|
11820
11820
|
type: "button",
|
|
11821
11821
|
className: "ps-bpm-upload-link",
|
|
11822
|
-
onClick:
|
|
11822
|
+
onClick: fA,
|
|
11823
11823
|
disabled: !df,
|
|
11824
11824
|
"aria-describedby": df ? void 0 : "ps-bpm-upload-link-hint",
|
|
11825
11825
|
children: [
|
|
@@ -11896,7 +11896,7 @@ function ng({
|
|
|
11896
11896
|
onAgeConfirmedChange: c,
|
|
11897
11897
|
t: z
|
|
11898
11898
|
}) {
|
|
11899
|
-
const T = i === "close-up", x =
|
|
11899
|
+
const T = i === "close-up", x = aA(null), l = !!n, fA = !l && H !== !0;
|
|
11900
11900
|
return /* @__PURE__ */ f("div", { className: "ps-pm-root", children: [
|
|
11901
11901
|
/* @__PURE__ */ f("div", { className: "ps-pm-header", children: [
|
|
11902
11902
|
/* @__PURE__ */ A("h2", { className: "ps-pm-title", children: z(T ? "Upload a face photo or selfie" : "Review your photo") }),
|
|
@@ -11929,13 +11929,13 @@ function ng({
|
|
|
11929
11929
|
"button",
|
|
11930
11930
|
{
|
|
11931
11931
|
type: "button",
|
|
11932
|
-
className: `ps-pm-preview-empty${
|
|
11932
|
+
className: `ps-pm-preview-empty${fA ? " ps-pm-preview-blurred" : ""}`,
|
|
11933
11933
|
onClick: () => {
|
|
11934
|
-
|
|
11934
|
+
fA || x.current?.click();
|
|
11935
11935
|
},
|
|
11936
|
-
disabled:
|
|
11937
|
-
"aria-hidden":
|
|
11938
|
-
tabIndex:
|
|
11936
|
+
disabled: fA,
|
|
11937
|
+
"aria-hidden": fA,
|
|
11938
|
+
tabIndex: fA ? -1 : 0,
|
|
11939
11939
|
children: [
|
|
11940
11940
|
/* @__PURE__ */ A(QB, {}),
|
|
11941
11941
|
/* @__PURE__ */ A("span", { className: "ps-pm-preview-empty-title", children: z("Tap to upload") }),
|
|
@@ -12181,7 +12181,7 @@ function MB({
|
|
|
12181
12181
|
onSnapSubmit: T,
|
|
12182
12182
|
hasActiveProfileWithMeasurements: x = !1,
|
|
12183
12183
|
onUseActiveProfile: l,
|
|
12184
|
-
activeProfileName:
|
|
12184
|
+
activeProfileName: fA,
|
|
12185
12185
|
onStartFresh: r,
|
|
12186
12186
|
activeProfile: b,
|
|
12187
12187
|
onBack: k,
|
|
@@ -12189,30 +12189,30 @@ function MB({
|
|
|
12189
12189
|
}) {
|
|
12190
12190
|
const O = e ? UB : dB, [s, S] = d("basics");
|
|
12191
12191
|
s === "photo" || O.indexOf(s);
|
|
12192
|
-
const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit,
|
|
12192
|
+
const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit, uA = tA != null && h === "cm" ? String(Math.round(tA)) : tA != null && (h === "in" || h === "ft") ? String(Math.round(tA * 2.54)) : B.current.height || "173", RA = tA != null && (h === "in" || h === "ft") ? Math.round(tA) : tA != null && h === "cm" ? Math.round(tA / 2.54) : null, vA = RA != null ? String(Math.floor(RA / 12)) : B.current.heightFeet || "5", N = RA != null ? String(RA % 12) : B.current.heightInches || "8", PA = wA != null ? String(Math.round(wA)) : B.current.weight || (F ? "154" : "70"), kA = YA != null ? String(YA) : B.current.age || "30", [iA, BA] = d(uA), [OA, gf] = d(vA), [KA, ef] = d(N), [hA, Pf] = d(PA), [ZA, df] = d(kA), [jA, Bf] = d(
|
|
12193
12193
|
h || (D === "ft" ? "in" : D || (F ? "in" : "cm"))
|
|
12194
12194
|
), [DA, TA] = d(
|
|
12195
12195
|
a || C || (F ? "lbs" : "kg")
|
|
12196
|
-
), I =
|
|
12197
|
-
const
|
|
12198
|
-
if (!
|
|
12196
|
+
), I = jA === "in" || DA === "lbs", [XA, AA] = d(null), [sA, yA] = d(null), [Of, LA] = d(null), [gA, Uf] = d(!1), jf = aA(null), [lA, Mf] = d(null), [Qf, af] = d(!1), [xf, _A] = d(!1), [of, mA] = d(() => RA != null ? String(Math.round(RA * 2.54)) : uA), [E, y] = d(null), [QA, Q] = d(null), [Z, FA] = d(null), [SA, tf] = d(null), [bA, _] = d(""), [qA, W] = d(null), [L, V] = d(null), [xA, wf] = d(() => ["US", "UK", "AU"].includes(P) ? P === "AU" ? "UK" : P : ["FR", "ES"].includes(P) ? "FR" : ["IT"].includes(P) ? "IT" : ["JP", "CN", "KR"].includes(P) ? "JP" : "EU"), [cA, Df] = d(!1), Af = xP[xA] || xP.US, [Hf, WA] = d(""), ff = EA(async (X) => {
|
|
12197
|
+
const J = X.target.files?.[0];
|
|
12198
|
+
if (!J) return;
|
|
12199
12199
|
if (lA !== !0) {
|
|
12200
12200
|
WA(v("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
12201
12201
|
return;
|
|
12202
12202
|
}
|
|
12203
|
-
if (!
|
|
12203
|
+
if (!J.type.startsWith("image/")) {
|
|
12204
12204
|
WA(v("Please upload an image file"));
|
|
12205
12205
|
return;
|
|
12206
12206
|
}
|
|
12207
|
-
if (
|
|
12207
|
+
if (J.size > 10 * 1024 * 1024) {
|
|
12208
12208
|
WA(v("Image must be under 10MB"));
|
|
12209
12209
|
return;
|
|
12210
12210
|
}
|
|
12211
|
-
WA(""), Uf(!0),
|
|
12212
|
-
const
|
|
12213
|
-
yA(
|
|
12211
|
+
WA(""), Uf(!0), AA(J);
|
|
12212
|
+
const dA = URL.createObjectURL(J);
|
|
12213
|
+
yA(dA);
|
|
12214
12214
|
try {
|
|
12215
|
-
const q = await tn(
|
|
12215
|
+
const q = await tn(J);
|
|
12216
12216
|
LA(q);
|
|
12217
12217
|
} catch {
|
|
12218
12218
|
WA(v("Failed to process image")), yA(null);
|
|
@@ -12220,15 +12220,15 @@ function MB({
|
|
|
12220
12220
|
Uf(!1);
|
|
12221
12221
|
}
|
|
12222
12222
|
}, [v, lA]), nf = EA(() => {
|
|
12223
|
-
sA && URL.revokeObjectURL(sA),
|
|
12223
|
+
sA && URL.revokeObjectURL(sA), AA(null), yA(null), LA(null), jf.current && (jf.current.value = "");
|
|
12224
12224
|
}, [sA]), VA = EA(() => {
|
|
12225
|
-
if (
|
|
12226
|
-
const
|
|
12227
|
-
if (!
|
|
12225
|
+
if (jA === "in") {
|
|
12226
|
+
const J = parseFloat(OA);
|
|
12227
|
+
if (!J || J < 3 || J > 8)
|
|
12228
12228
|
return WA(v("Please enter a valid height")), !1;
|
|
12229
12229
|
} else {
|
|
12230
|
-
const
|
|
12231
|
-
if (!
|
|
12230
|
+
const J = parseFloat(iA);
|
|
12231
|
+
if (!J || J < 100 || J > 250)
|
|
12232
12232
|
return WA(v("Please enter a valid height (100-250 cm)")), !1;
|
|
12233
12233
|
}
|
|
12234
12234
|
const X = parseFloat(hA);
|
|
@@ -12238,28 +12238,28 @@ function MB({
|
|
|
12238
12238
|
} else if (!X || X < 30 || X > 300)
|
|
12239
12239
|
return WA(v("Please enter a valid weight (30-300 kg)")), !1;
|
|
12240
12240
|
return WA(""), !0;
|
|
12241
|
-
}, [
|
|
12241
|
+
}, [jA, DA, iA, OA, hA, v]), o = () => {
|
|
12242
12242
|
let X;
|
|
12243
|
-
if (
|
|
12244
|
-
const
|
|
12245
|
-
X =
|
|
12243
|
+
if (jA === "in") {
|
|
12244
|
+
const J = parseFloat(OA) || 0, dA = parseFloat(KA) || 0;
|
|
12245
|
+
X = J * 12 + dA;
|
|
12246
12246
|
} else
|
|
12247
12247
|
X = parseFloat(iA);
|
|
12248
12248
|
return { heightVal: X, weightVal: parseFloat(hA) };
|
|
12249
12249
|
}, j = e ? "female" : "male", U = (X) => {
|
|
12250
|
-
const
|
|
12251
|
-
return
|
|
12250
|
+
const J = O.indexOf(X);
|
|
12251
|
+
return J < O.length - 1 ? O[J + 1] : "submit";
|
|
12252
12252
|
}, R = () => {
|
|
12253
|
-
const { heightVal: X, weightVal:
|
|
12254
|
-
B.current.height = String(X), B.current.weight = String(
|
|
12253
|
+
const { heightVal: X, weightVal: J } = o();
|
|
12254
|
+
B.current.height = String(X), B.current.weight = String(J), B.current.gender = j, ZA && (B.current.age = ZA), i(jA), w(DA), z({
|
|
12255
12255
|
height: X,
|
|
12256
|
-
weight:
|
|
12257
|
-
heightUnit:
|
|
12256
|
+
weight: J,
|
|
12257
|
+
heightUnit: jA,
|
|
12258
12258
|
weightUnit: DA,
|
|
12259
12259
|
gender: j,
|
|
12260
12260
|
age: ZA ? parseInt(ZA, 10) : void 0,
|
|
12261
12261
|
chestProfile: E || void 0,
|
|
12262
|
-
midsectionProfile:
|
|
12262
|
+
midsectionProfile: QA,
|
|
12263
12263
|
hipProfile: Z,
|
|
12264
12264
|
bodyImage: Of || void 0,
|
|
12265
12265
|
bandSize: qA || void 0,
|
|
@@ -12273,7 +12273,7 @@ function MB({
|
|
|
12273
12273
|
if (!E) return;
|
|
12274
12274
|
S(U("chest"));
|
|
12275
12275
|
} else if (s === "midsection") {
|
|
12276
|
-
if (!
|
|
12276
|
+
if (!QA) return;
|
|
12277
12277
|
S(U("midsection"));
|
|
12278
12278
|
} else if (s === "seat") {
|
|
12279
12279
|
if (!SA) return;
|
|
@@ -12290,7 +12290,7 @@ function MB({
|
|
|
12290
12290
|
}
|
|
12291
12291
|
WA(""), R();
|
|
12292
12292
|
} else if (s === "photo") {
|
|
12293
|
-
if (!Of || !
|
|
12293
|
+
if (!Of || !XA) {
|
|
12294
12294
|
if (x && l) {
|
|
12295
12295
|
l();
|
|
12296
12296
|
return;
|
|
@@ -12298,21 +12298,21 @@ function MB({
|
|
|
12298
12298
|
WA(v("Please upload a photo"));
|
|
12299
12299
|
return;
|
|
12300
12300
|
}
|
|
12301
|
-
const X =
|
|
12301
|
+
const X = jA === "in" ? (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0) : parseFloat(iA) || 0, J = parseFloat(hA) || 0, dA = parseFloat(ZA) || void 0;
|
|
12302
12302
|
T({
|
|
12303
|
-
photoFile:
|
|
12303
|
+
photoFile: XA,
|
|
12304
12304
|
photoBase64: Of,
|
|
12305
12305
|
height: X,
|
|
12306
|
-
weight:
|
|
12307
|
-
heightUnit:
|
|
12306
|
+
weight: J,
|
|
12307
|
+
heightUnit: jA,
|
|
12308
12308
|
weightUnit: DA,
|
|
12309
12309
|
gender: j,
|
|
12310
|
-
...
|
|
12310
|
+
...dA ? { age: dA } : {}
|
|
12311
12311
|
});
|
|
12312
12312
|
}
|
|
12313
|
-
}, [s, O, VA, E,
|
|
12314
|
-
const
|
|
12315
|
-
return
|
|
12313
|
+
}, [s, O, VA, E, QA, Z, SA, qA, L, jA, DA, iA, OA, KA, hA, ZA, Of, XA, of, B, i, w, z, T, e, j, x, l]), Y = (X) => {
|
|
12314
|
+
const J = O.indexOf(X);
|
|
12315
|
+
return J > 0 ? O[J - 1] : null;
|
|
12316
12316
|
}, MA = EA(() => {
|
|
12317
12317
|
if (WA(""), s === "basics")
|
|
12318
12318
|
k();
|
|
@@ -12322,21 +12322,21 @@ function MB({
|
|
|
12322
12322
|
const X = Y(s);
|
|
12323
12323
|
X ? S(X) : k();
|
|
12324
12324
|
}
|
|
12325
|
-
}, [s, O, k]),
|
|
12325
|
+
}, [s, O, k]), HA = s === "basics" ? !0 : s === "chest" ? !!E : s === "midsection" ? !!QA : s === "seat" ? !!SA : s === "hips" ? !!Z : s === "bra" ? !!(qA && L) : s === "photo", JA = s === O[O.length - 1];
|
|
12326
12326
|
if (s === "photo") {
|
|
12327
|
-
const X =
|
|
12328
|
-
|
|
12329
|
-
const
|
|
12330
|
-
if (
|
|
12331
|
-
const
|
|
12332
|
-
|
|
12327
|
+
const X = jA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, J = parseFloat(hA) > 0, dA = !!sA, q = [];
|
|
12328
|
+
dA || q.push(v("Upload a photo")), X || q.push(v("Enter your height")), J || q.push(v("Enter your weight"));
|
|
12329
|
+
const nA = q.length > 0, vf = nA ? q[0] ?? v("Analyze My Size") : v("Analyze My Size"), zf = () => {
|
|
12330
|
+
if (jA === "in") {
|
|
12331
|
+
const UA = (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0);
|
|
12332
|
+
UA > 0 && BA(String(Math.round(UA * 2.54)));
|
|
12333
12333
|
}
|
|
12334
12334
|
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), c?.("cm");
|
|
12335
12335
|
}, $A = () => {
|
|
12336
|
-
if (
|
|
12337
|
-
const
|
|
12338
|
-
if (
|
|
12339
|
-
const sf = Math.round(
|
|
12336
|
+
if (jA === "cm") {
|
|
12337
|
+
const UA = parseFloat(iA);
|
|
12338
|
+
if (UA > 0) {
|
|
12339
|
+
const sf = Math.round(UA / 2.54);
|
|
12340
12340
|
gf(String(Math.floor(sf / 12))), ef(String(sf % 12));
|
|
12341
12341
|
}
|
|
12342
12342
|
}
|
|
@@ -12354,8 +12354,8 @@ function MB({
|
|
|
12354
12354
|
photoStepHeight: of,
|
|
12355
12355
|
onPhotoStepHeightChange: mA,
|
|
12356
12356
|
ageConfirmed: lA,
|
|
12357
|
-
onAgeConfirmedChange: (
|
|
12358
|
-
Mf(
|
|
12357
|
+
onAgeConfirmedChange: (UA) => {
|
|
12358
|
+
Mf(UA), UA === !0 && WA("");
|
|
12359
12359
|
},
|
|
12360
12360
|
t: v
|
|
12361
12361
|
}
|
|
@@ -12395,8 +12395,8 @@ function MB({
|
|
|
12395
12395
|
},
|
|
12396
12396
|
children: sA ? /* @__PURE__ */ f(rA, { children: [
|
|
12397
12397
|
/* @__PURE__ */ A("img", { src: sA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
12398
|
-
/* @__PURE__ */ A("button", { onClick: (
|
|
12399
|
-
|
|
12398
|
+
/* @__PURE__ */ A("button", { onClick: (UA) => {
|
|
12399
|
+
UA.stopPropagation(), nf();
|
|
12400
12400
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
12401
12401
|
] }) : /* @__PURE__ */ f(rA, { children: [
|
|
12402
12402
|
/* @__PURE__ */ A(Mn, { size: 32 }),
|
|
@@ -12408,7 +12408,7 @@ function MB({
|
|
|
12408
12408
|
{
|
|
12409
12409
|
role: "dialog",
|
|
12410
12410
|
"aria-labelledby": "ps-bp-age-q",
|
|
12411
|
-
onClick: (
|
|
12411
|
+
onClick: (UA) => UA.stopPropagation(),
|
|
12412
12412
|
style: {
|
|
12413
12413
|
marginTop: "1.1vw",
|
|
12414
12414
|
padding: "0.75vw 1.1vw",
|
|
@@ -12428,8 +12428,8 @@ function MB({
|
|
|
12428
12428
|
"button",
|
|
12429
12429
|
{
|
|
12430
12430
|
type: "button",
|
|
12431
|
-
onClick: (
|
|
12432
|
-
|
|
12431
|
+
onClick: (UA) => {
|
|
12432
|
+
UA.stopPropagation(), Mf(!0), WA("");
|
|
12433
12433
|
},
|
|
12434
12434
|
style: {
|
|
12435
12435
|
padding: "0.4vw 1vw",
|
|
@@ -12449,8 +12449,8 @@ function MB({
|
|
|
12449
12449
|
"button",
|
|
12450
12450
|
{
|
|
12451
12451
|
type: "button",
|
|
12452
|
-
onClick: (
|
|
12453
|
-
|
|
12452
|
+
onClick: (UA) => {
|
|
12453
|
+
UA.stopPropagation(), Mf(!1);
|
|
12454
12454
|
},
|
|
12455
12455
|
style: {
|
|
12456
12456
|
padding: "0.4vw 1vw",
|
|
@@ -12473,7 +12473,7 @@ function MB({
|
|
|
12473
12473
|
"div",
|
|
12474
12474
|
{
|
|
12475
12475
|
role: "alert",
|
|
12476
|
-
onClick: (
|
|
12476
|
+
onClick: (UA) => UA.stopPropagation(),
|
|
12477
12477
|
style: {
|
|
12478
12478
|
marginTop: "1.1vw",
|
|
12479
12479
|
padding: "0.75vw 1.1vw",
|
|
@@ -12492,8 +12492,8 @@ function MB({
|
|
|
12492
12492
|
"button",
|
|
12493
12493
|
{
|
|
12494
12494
|
type: "button",
|
|
12495
|
-
onClick: (
|
|
12496
|
-
|
|
12495
|
+
onClick: (UA) => {
|
|
12496
|
+
UA.stopPropagation(), Mf(null);
|
|
12497
12497
|
},
|
|
12498
12498
|
style: {
|
|
12499
12499
|
padding: "0.4vw 1vw",
|
|
@@ -12529,7 +12529,7 @@ function MB({
|
|
|
12529
12529
|
"button",
|
|
12530
12530
|
{
|
|
12531
12531
|
type: "button",
|
|
12532
|
-
onClick: () => af((
|
|
12532
|
+
onClick: () => af((UA) => !UA),
|
|
12533
12533
|
"aria-label": v("How to take a good photo"),
|
|
12534
12534
|
title: v("How to take a good photo"),
|
|
12535
12535
|
style: {
|
|
@@ -12581,20 +12581,20 @@ function MB({
|
|
|
12581
12581
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-fields", children: [
|
|
12582
12582
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
12583
12583
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
|
|
12584
|
-
|
|
12585
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (
|
|
12584
|
+
jA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12585
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (UA) => gf(UA.target.value), min: 3, max: 8 }),
|
|
12586
12586
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
12587
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (
|
|
12587
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (UA) => ef(UA.target.value), min: 0, max: 11 }),
|
|
12588
12588
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
12589
12589
|
] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12590
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (
|
|
12590
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (UA) => BA(UA.target.value), min: 100, max: 250 }),
|
|
12591
12591
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
12592
12592
|
] })
|
|
12593
12593
|
] }),
|
|
12594
12594
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
12595
12595
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
|
|
12596
12596
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12597
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (
|
|
12597
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (UA) => Pf(UA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
|
|
12598
12598
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: DA })
|
|
12599
12599
|
] })
|
|
12600
12600
|
] })
|
|
@@ -12731,11 +12731,11 @@ function MB({
|
|
|
12731
12731
|
/* @__PURE__ */ A(
|
|
12732
12732
|
"button",
|
|
12733
12733
|
{
|
|
12734
|
-
className: `ps-bp-next-btn${
|
|
12734
|
+
className: `ps-bp-next-btn${nA ? " ps-bp-btn-disabled" : ""}`,
|
|
12735
12735
|
onClick: u,
|
|
12736
|
-
disabled:
|
|
12736
|
+
disabled: nA,
|
|
12737
12737
|
type: "button",
|
|
12738
|
-
title:
|
|
12738
|
+
title: nA ? q.join(" · ") : void 0,
|
|
12739
12739
|
children: vf
|
|
12740
12740
|
}
|
|
12741
12741
|
)
|
|
@@ -12757,14 +12757,14 @@ function MB({
|
|
|
12757
12757
|
/* @__PURE__ */ f("div", { className: "ps-bp-root", children: [
|
|
12758
12758
|
s === "basics" && (() => {
|
|
12759
12759
|
const X = () => {
|
|
12760
|
-
if (
|
|
12761
|
-
const
|
|
12762
|
-
BA(String(Math.round(
|
|
12760
|
+
if (jA === "in") {
|
|
12761
|
+
const dA = (parseFloat(OA) || 5) * 12 + (parseFloat(KA) || 8);
|
|
12762
|
+
BA(String(Math.round(dA * 2.54)));
|
|
12763
12763
|
}
|
|
12764
12764
|
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), c?.("cm");
|
|
12765
|
-
},
|
|
12766
|
-
if (
|
|
12767
|
-
const
|
|
12765
|
+
}, J = () => {
|
|
12766
|
+
if (jA === "cm") {
|
|
12767
|
+
const dA = parseFloat(iA) || 173, q = Math.round(dA / 2.54);
|
|
12768
12768
|
gf(String(Math.floor(q / 12))), ef(String(q % 12));
|
|
12769
12769
|
}
|
|
12770
12770
|
DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), c?.("in");
|
|
@@ -12772,7 +12772,7 @@ function MB({
|
|
|
12772
12772
|
return K ? /* @__PURE__ */ A(
|
|
12773
12773
|
HB,
|
|
12774
12774
|
{
|
|
12775
|
-
hUnit:
|
|
12775
|
+
hUnit: jA,
|
|
12776
12776
|
wUnit: DA,
|
|
12777
12777
|
isImperialMode: I,
|
|
12778
12778
|
height: iA,
|
|
@@ -12786,14 +12786,14 @@ function MB({
|
|
|
12786
12786
|
age: ZA,
|
|
12787
12787
|
setAge: df,
|
|
12788
12788
|
switchToMetric: X,
|
|
12789
|
-
switchToImperial:
|
|
12789
|
+
switchToImperial: J,
|
|
12790
12790
|
onUploadPhoto: () => S("photo"),
|
|
12791
12791
|
onSwitchToScan: () => S("photo"),
|
|
12792
12792
|
hidePhotoOptions: x,
|
|
12793
12793
|
onNext: x && l ? l : u,
|
|
12794
12794
|
canProceed: !0,
|
|
12795
|
-
fastPathLabel: x ? v("Find My Best Fit") + (bf(
|
|
12796
|
-
activeProfileName: x ?
|
|
12795
|
+
fastPathLabel: x ? v("Find My Best Fit") + (bf(jA) ? ` (${bf(jA)})` : "") : void 0,
|
|
12796
|
+
activeProfileName: x ? fA : null,
|
|
12797
12797
|
onStartFresh: r,
|
|
12798
12798
|
error: Hf,
|
|
12799
12799
|
t: v
|
|
@@ -12801,10 +12801,10 @@ function MB({
|
|
|
12801
12801
|
"step-basics-mobile"
|
|
12802
12802
|
) : /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
12803
12803
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Body Measurements") }),
|
|
12804
|
-
x &&
|
|
12804
|
+
x && fA && /* @__PURE__ */ f("p", { className: "ps-bp-profile-hint", children: [
|
|
12805
12805
|
v("Using"),
|
|
12806
12806
|
" ",
|
|
12807
|
-
/* @__PURE__ */ A("strong", { children:
|
|
12807
|
+
/* @__PURE__ */ A("strong", { children: fA }),
|
|
12808
12808
|
r && /* @__PURE__ */ f(rA, { children: [
|
|
12809
12809
|
" · ",
|
|
12810
12810
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: r, children: v("start fresh") })
|
|
@@ -12812,38 +12812,38 @@ function MB({
|
|
|
12812
12812
|
] }),
|
|
12813
12813
|
/* @__PURE__ */ f("div", { className: "ps-bp-system-toggle", children: [
|
|
12814
12814
|
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? "" : " ps-bp-system-active"}`, onClick: X, type: "button", children: v("Metric") }),
|
|
12815
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? " ps-bp-system-active" : ""}`, onClick:
|
|
12815
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? " ps-bp-system-active" : ""}`, onClick: J, type: "button", children: v("Imperial") })
|
|
12816
12816
|
] }),
|
|
12817
12817
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-fields", children: [
|
|
12818
12818
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
12819
12819
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
|
|
12820
|
-
|
|
12821
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (
|
|
12820
|
+
jA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12821
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (dA) => gf(dA.target.value), min: 3, max: 8 }),
|
|
12822
12822
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
12823
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (
|
|
12823
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (dA) => ef(dA.target.value), min: 0, max: 11 }),
|
|
12824
12824
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
12825
12825
|
] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12826
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (
|
|
12826
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (dA) => BA(dA.target.value), min: 100, max: 250 }),
|
|
12827
12827
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
12828
12828
|
] })
|
|
12829
12829
|
] }),
|
|
12830
12830
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
12831
12831
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
|
|
12832
12832
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12833
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (
|
|
12833
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (dA) => Pf(dA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
|
|
12834
12834
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: DA })
|
|
12835
12835
|
] })
|
|
12836
12836
|
] }),
|
|
12837
12837
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
12838
12838
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("AGE") }),
|
|
12839
12839
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
12840
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: ZA, onChange: (
|
|
12840
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: ZA, onChange: (dA) => df(dA.target.value), min: 13, max: 100 }),
|
|
12841
12841
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: v("years") })
|
|
12842
12842
|
] })
|
|
12843
12843
|
] })
|
|
12844
12844
|
] }),
|
|
12845
12845
|
(() => {
|
|
12846
|
-
const
|
|
12846
|
+
const dA = jA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, q = parseFloat(hA) > 0, nA = dA && q;
|
|
12847
12847
|
return /* @__PURE__ */ f(rA, { children: [
|
|
12848
12848
|
/* @__PURE__ */ f(
|
|
12849
12849
|
"button",
|
|
@@ -12851,8 +12851,8 @@ function MB({
|
|
|
12851
12851
|
className: "ps-bp-photo-cta",
|
|
12852
12852
|
onClick: () => S("photo"),
|
|
12853
12853
|
type: "button",
|
|
12854
|
-
disabled: !
|
|
12855
|
-
title:
|
|
12854
|
+
disabled: !nA,
|
|
12855
|
+
title: nA ? void 0 : v("Enter height and weight first"),
|
|
12856
12856
|
children: [
|
|
12857
12857
|
/* @__PURE__ */ A(jB, {}),
|
|
12858
12858
|
/* @__PURE__ */ A("span", { children: v("Or upload a photo for AI sizing") }),
|
|
@@ -12860,7 +12860,7 @@ function MB({
|
|
|
12860
12860
|
]
|
|
12861
12861
|
}
|
|
12862
12862
|
),
|
|
12863
|
-
!
|
|
12863
|
+
!nA && /* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-hint", children: v("Enter height and weight first") })
|
|
12864
12864
|
] });
|
|
12865
12865
|
})(),
|
|
12866
12866
|
Hf && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: Hf })
|
|
@@ -12906,7 +12906,7 @@ function MB({
|
|
|
12906
12906
|
{ value: "average", label: v("Average"), img: GA.male.stomach.average },
|
|
12907
12907
|
{ value: "round", label: v("Full"), img: GA.male.stomach.round }
|
|
12908
12908
|
],
|
|
12909
|
-
selected:
|
|
12909
|
+
selected: QA,
|
|
12910
12910
|
onSelect: (X) => Q(X),
|
|
12911
12911
|
t: v
|
|
12912
12912
|
},
|
|
@@ -12914,13 +12914,13 @@ function MB({
|
|
|
12914
12914
|
) : /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12915
12915
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
|
|
12916
12916
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: e ? /* @__PURE__ */ f(rA, { children: [
|
|
12917
|
-
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.flat, label: v("Flat"), selected:
|
|
12918
|
-
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.average, label: v("Average"), selected:
|
|
12919
|
-
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.round, label: v("Full"), selected:
|
|
12917
|
+
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.flat, label: v("Flat"), selected: QA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
|
|
12918
|
+
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.average, label: v("Average"), selected: QA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
|
|
12919
|
+
/* @__PURE__ */ A(Ff, { img: GA.female.stomach.round, label: v("Full"), selected: QA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
|
|
12920
12920
|
] }) : /* @__PURE__ */ f(rA, { children: [
|
|
12921
|
-
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.flat, label: v("Flat"), selected:
|
|
12922
|
-
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.average, label: v("Average"), selected:
|
|
12923
|
-
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.round, label: v("Full"), selected:
|
|
12921
|
+
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.flat, label: v("Flat"), selected: QA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
|
|
12922
|
+
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.average, label: v("Average"), selected: QA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
|
|
12923
|
+
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.round, label: v("Full"), selected: QA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
|
|
12924
12924
|
] }) }),
|
|
12925
12925
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: bA || " " })
|
|
12926
12926
|
] }, "step-midsection")),
|
|
@@ -12992,16 +12992,16 @@ function MB({
|
|
|
12992
12992
|
"button",
|
|
12993
12993
|
{
|
|
12994
12994
|
className: "ps-bp-bra-region-trigger",
|
|
12995
|
-
onClick: () => Df(!
|
|
12995
|
+
onClick: () => Df(!cA),
|
|
12996
12996
|
type: "button",
|
|
12997
12997
|
children: [
|
|
12998
12998
|
xA,
|
|
12999
12999
|
" ",
|
|
13000
|
-
/* @__PURE__ */ A("span", { className: `ps-bp-bra-region-arrow${
|
|
13000
|
+
/* @__PURE__ */ A("span", { className: `ps-bp-bra-region-arrow${cA ? " ps-open" : ""}`, children: "▾" })
|
|
13001
13001
|
]
|
|
13002
13002
|
}
|
|
13003
13003
|
),
|
|
13004
|
-
|
|
13004
|
+
cA && /* @__PURE__ */ A("div", { className: "ps-bp-bra-region-dropdown", children: ["US", "UK", "EU", "FR", "IT", "JP"].map((X) => /* @__PURE__ */ A(
|
|
13005
13005
|
"button",
|
|
13006
13006
|
{
|
|
13007
13007
|
className: `ps-bp-bra-region-item${xA === X ? " ps-selected" : ""}`,
|
|
@@ -13056,7 +13056,7 @@ function MB({
|
|
|
13056
13056
|
Hf && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: Hf })
|
|
13057
13057
|
] }, "step-bra"),
|
|
13058
13058
|
!(K && s === "basics") && (() => {
|
|
13059
|
-
const X = s === "basics" && x && !!l,
|
|
13059
|
+
const X = s === "basics" && x && !!l, J = X ? l : u, dA = bf(jA) ? ` (${bf(jA)})` : "", q = X ? v("Find My Best Fit") + dA : JA ? v("Find My Size") + dA : v("Next");
|
|
13060
13060
|
return /* @__PURE__ */ f("div", { className: "ps-bp-nav", children: [
|
|
13061
13061
|
s !== "basics" ? /* @__PURE__ */ f("button", { className: "ps-bp-back-btn", onClick: MA, type: "button", children: [
|
|
13062
13062
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -13066,9 +13066,9 @@ function MB({
|
|
|
13066
13066
|
/* @__PURE__ */ A(
|
|
13067
13067
|
"button",
|
|
13068
13068
|
{
|
|
13069
|
-
className: `ps-bp-next-btn${!X && !
|
|
13070
|
-
onClick:
|
|
13071
|
-
disabled: !X && !
|
|
13069
|
+
className: `ps-bp-next-btn${!X && !HA ? " ps-bp-btn-disabled" : ""}`,
|
|
13070
|
+
onClick: J,
|
|
13071
|
+
disabled: !X && !HA,
|
|
13072
13072
|
type: "button",
|
|
13073
13073
|
children: q
|
|
13074
13074
|
}
|
|
@@ -13100,52 +13100,52 @@ function fP({
|
|
|
13100
13100
|
setView: T,
|
|
13101
13101
|
submitSizing: x,
|
|
13102
13102
|
onSnapSubmit: l,
|
|
13103
|
-
onBack:
|
|
13103
|
+
onBack: fA,
|
|
13104
13104
|
t: r
|
|
13105
13105
|
}) {
|
|
13106
13106
|
const b = B === "close-up", k = AP(), [v, O] = d("manual"), [s, S] = d(() => {
|
|
13107
13107
|
const I = {};
|
|
13108
|
-
return g.forEach((
|
|
13109
|
-
I[
|
|
13108
|
+
return g.forEach((XA) => {
|
|
13109
|
+
I[XA.key] = C.current[XA.key] || "";
|
|
13110
13110
|
}), I;
|
|
13111
|
-
}), [K, F] = d(""), tA =
|
|
13112
|
-
const
|
|
13113
|
-
if (!
|
|
13114
|
-
const
|
|
13115
|
-
a(
|
|
13111
|
+
}), [K, F] = d(""), tA = aA(null), [wA, YA] = d(null), [h, a] = d(null), [uA, RA] = d(null), [vA, N] = d(!1), [PA, kA] = d(null), [iA, BA] = d(!1), OA = EA(async (I) => {
|
|
13112
|
+
const XA = I.target.files?.[0];
|
|
13113
|
+
if (!XA) return;
|
|
13114
|
+
const AA = URL.createObjectURL(XA);
|
|
13115
|
+
a(XA), YA(AA);
|
|
13116
13116
|
try {
|
|
13117
|
-
const sA = await tn(
|
|
13117
|
+
const sA = await tn(XA, b ? { maxDimension: 1536, quality: 0.85 } : {});
|
|
13118
13118
|
RA(sA);
|
|
13119
13119
|
} catch {
|
|
13120
13120
|
}
|
|
13121
13121
|
}, [b]), gf = EA(() => {
|
|
13122
13122
|
wA && URL.revokeObjectURL(wA), a(null), YA(null), RA(null);
|
|
13123
|
-
}, [wA]), KA = (I,
|
|
13124
|
-
S((
|
|
13123
|
+
}, [wA]), KA = (I, XA) => {
|
|
13124
|
+
S((AA) => ({ ...AA, [I]: XA })), F("");
|
|
13125
13125
|
}, ef = () => {
|
|
13126
13126
|
const I = g[0];
|
|
13127
13127
|
if (!I) return;
|
|
13128
|
-
const
|
|
13129
|
-
if (!
|
|
13128
|
+
const XA = parseFloat(s[I.key] || "");
|
|
13129
|
+
if (!XA || XA <= 0) {
|
|
13130
13130
|
F(r("Please enter your ") + r(I.label).toLowerCase());
|
|
13131
13131
|
return;
|
|
13132
13132
|
}
|
|
13133
|
-
g.forEach((
|
|
13134
|
-
const sA = parseFloat(s[
|
|
13135
|
-
sA > 0 && (C.current[
|
|
13133
|
+
g.forEach((AA) => {
|
|
13134
|
+
const sA = parseFloat(s[AA.key] || "");
|
|
13135
|
+
sA > 0 && (C.current[AA.key] = String(sA));
|
|
13136
13136
|
}), C.current.gender = C.current.gender || "male", c("exact"), z(!0), T("size-result"), x("exact");
|
|
13137
13137
|
}, hA = () => {
|
|
13138
|
-
if (
|
|
13138
|
+
if (PA !== !0) {
|
|
13139
13139
|
F(r("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
13140
13140
|
return;
|
|
13141
13141
|
}
|
|
13142
|
-
if (!h || !
|
|
13142
|
+
if (!h || !uA) {
|
|
13143
13143
|
F(r("Please upload a photo"));
|
|
13144
13144
|
return;
|
|
13145
13145
|
}
|
|
13146
13146
|
l({
|
|
13147
13147
|
photoFile: h,
|
|
13148
|
-
photoBase64:
|
|
13148
|
+
photoBase64: uA,
|
|
13149
13149
|
height: 0,
|
|
13150
13150
|
weight: 0,
|
|
13151
13151
|
heightUnit: "cm",
|
|
@@ -13164,7 +13164,7 @@ function fP({
|
|
|
13164
13164
|
onSwitchToManual: () => O("manual"),
|
|
13165
13165
|
error: K,
|
|
13166
13166
|
photoVariant: B,
|
|
13167
|
-
ageConfirmed:
|
|
13167
|
+
ageConfirmed: PA,
|
|
13168
13168
|
onAgeConfirmedChange: (I) => {
|
|
13169
13169
|
kA(I), I === !0 && F("");
|
|
13170
13170
|
},
|
|
@@ -13194,7 +13194,7 @@ function fP({
|
|
|
13194
13194
|
type: "number",
|
|
13195
13195
|
className: "ps-bpm-value-input",
|
|
13196
13196
|
value: s[I.key],
|
|
13197
|
-
onChange: (
|
|
13197
|
+
onChange: (XA) => KA(I.key, XA.target.value),
|
|
13198
13198
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13199
13199
|
step: I.step ?? 0.5,
|
|
13200
13200
|
min: I.min,
|
|
@@ -13234,7 +13234,7 @@ function fP({
|
|
|
13234
13234
|
)
|
|
13235
13235
|
] })
|
|
13236
13236
|
] }) });
|
|
13237
|
-
const ZA = g.some((I) => (parseFloat(s[I.key] || "") || 0) > 0), df = !!h &&
|
|
13237
|
+
const ZA = g.some((I) => (parseFloat(s[I.key] || "") || 0) > 0), df = !!h && PA === !0, Bf = !df && !ZA, DA = df ? r("Analyze") : `${r("Find My Size")}${bf(w) ? ` (${bf(w)})` : ""}`, TA = df ? hA : ef;
|
|
13238
13238
|
return v !== "photo" || P ? /* @__PURE__ */ f("div", { className: "ps-bp-layout", children: [
|
|
13239
13239
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: D, alt: i, className: "ps-bp-image-img" }) }),
|
|
13240
13240
|
/* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
@@ -13258,7 +13258,7 @@ function fP({
|
|
|
13258
13258
|
type: "number",
|
|
13259
13259
|
className: "ps-bp-inline-input",
|
|
13260
13260
|
value: s[I.key],
|
|
13261
|
-
onChange: (
|
|
13261
|
+
onChange: (XA) => KA(I.key, XA.target.value),
|
|
13262
13262
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13263
13263
|
step: I.step ?? 0.5,
|
|
13264
13264
|
min: I.min,
|
|
@@ -13295,23 +13295,23 @@ function fP({
|
|
|
13295
13295
|
"div",
|
|
13296
13296
|
{
|
|
13297
13297
|
onClick: () => {
|
|
13298
|
-
!wA &&
|
|
13298
|
+
!wA && PA === !0 && tA.current?.click();
|
|
13299
13299
|
},
|
|
13300
13300
|
onMouseEnter: () => {
|
|
13301
|
-
!wA &&
|
|
13301
|
+
!wA && PA === !0 && N(!0);
|
|
13302
13302
|
},
|
|
13303
|
-
onMouseLeave: () =>
|
|
13303
|
+
onMouseLeave: () => N(!1),
|
|
13304
13304
|
style: {
|
|
13305
13305
|
flex: 1,
|
|
13306
13306
|
display: "flex",
|
|
13307
13307
|
flexDirection: "column",
|
|
13308
13308
|
alignItems: "center",
|
|
13309
13309
|
justifyContent: "center",
|
|
13310
|
-
border: wA ? "2px solid var(--ps-accent)" :
|
|
13310
|
+
border: wA ? "2px solid var(--ps-accent)" : PA === !0 && vA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
|
|
13311
13311
|
borderRadius: "0.5vw",
|
|
13312
|
-
cursor: wA ? "default" :
|
|
13312
|
+
cursor: wA ? "default" : PA === !0 ? "pointer" : "default",
|
|
13313
13313
|
position: "relative",
|
|
13314
|
-
background: wA ? "var(--ps-bg-secondary)" :
|
|
13314
|
+
background: wA ? "var(--ps-bg-secondary)" : PA === !0 && vA ? "rgba(33,84,239,0.04)" : PA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
|
|
13315
13315
|
transition: "border-color 0.18s, background 0.18s",
|
|
13316
13316
|
overflow: "hidden"
|
|
13317
13317
|
},
|
|
@@ -13325,7 +13325,7 @@ function fP({
|
|
|
13325
13325
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: r(b ? "Upload close-up photo" : "Upload your photo") }),
|
|
13326
13326
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: r(b ? "Click or drag a close-up face photo" : "Click or drag a full-body photo") }),
|
|
13327
13327
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.5vw", color: "var(--ps-text-dim)", marginTop: "0.4vw" }, children: "JPEG, PNG (max 10MB)" }),
|
|
13328
|
-
|
|
13328
|
+
PA === null && /* @__PURE__ */ f(
|
|
13329
13329
|
"div",
|
|
13330
13330
|
{
|
|
13331
13331
|
role: "dialog",
|
|
@@ -13389,7 +13389,7 @@ function fP({
|
|
|
13389
13389
|
]
|
|
13390
13390
|
}
|
|
13391
13391
|
),
|
|
13392
|
-
|
|
13392
|
+
PA === !1 && /* @__PURE__ */ f(
|
|
13393
13393
|
"div",
|
|
13394
13394
|
{
|
|
13395
13395
|
role: "alert",
|
|
@@ -13557,7 +13557,7 @@ function fP({
|
|
|
13557
13557
|
type: "number",
|
|
13558
13558
|
className: "ps-bp-inline-input",
|
|
13559
13559
|
value: s[I.key],
|
|
13560
|
-
onChange: (
|
|
13560
|
+
onChange: (XA) => KA(I.key, XA.target.value),
|
|
13561
13561
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13562
13562
|
step: I.step ?? 0.5,
|
|
13563
13563
|
min: I.min,
|
|
@@ -13879,7 +13879,7 @@ function XB({
|
|
|
13879
13879
|
className: T,
|
|
13880
13880
|
style: x,
|
|
13881
13881
|
onOpen: l,
|
|
13882
|
-
onClose:
|
|
13882
|
+
onClose: fA,
|
|
13883
13883
|
onUpload: r,
|
|
13884
13884
|
onProcessing: b,
|
|
13885
13885
|
onComplete: k,
|
|
@@ -13894,32 +13894,32 @@ function XB({
|
|
|
13894
13894
|
NA(() => {
|
|
13895
13895
|
YA(!0);
|
|
13896
13896
|
}, []);
|
|
13897
|
-
const [h, a] = d("idle"), [
|
|
13897
|
+
const [h, a] = d("idle"), [uA, RA] = d(null), [vA, N] = d(null), [PA, kA] = d(null), [iA, BA] = d(null), [OA, gf] = d(!1), [KA, ef] = d(!1), [hA, Pf] = d(null), [ZA, df] = d(null), jA = aA(null);
|
|
13898
13898
|
NA(() => {
|
|
13899
|
-
|
|
13899
|
+
jA.current = ZA;
|
|
13900
13900
|
}, [ZA]);
|
|
13901
|
-
const [Bf, DA] = d(null), [TA, I] = d(null), [
|
|
13901
|
+
const [Bf, DA] = d(null), [TA, I] = d(null), [XA, AA] = d(!1), [sA, yA] = d(!1), [Of, LA] = d(!1), [gA, Uf] = d(null), [jf, lA] = d(!1), Mf = aA(!1), [Qf, af] = d(hg), xf = JP(Qf), [_A, of] = d(xf ? "in" : "cm"), [mA, E] = d(xf ? "in" : "cm"), [y, QA] = d(xf ? "lbs" : "kg");
|
|
13902
13902
|
NA(() => {
|
|
13903
13903
|
const t = Lf(g);
|
|
13904
13904
|
t === "foot" || t === "head" ? of("cm") : t === "face" && of("mm");
|
|
13905
13905
|
}, [g]);
|
|
13906
|
-
const Q =
|
|
13906
|
+
const Q = aA({}), [Z, FA] = d("male"), [SA, tf] = d(0), [bA, _] = d(null), [qA, W] = d(!1), [L, V] = d(() => Kf("profiles", [])), [xA, wf] = d(() => Kf("history", [])), [cA, Df] = d(() => kP()), [Af, Hf] = d(() => /* @__PURE__ */ new Set()), [WA, ff] = d(null), nf = EA((t) => {
|
|
13907
13907
|
Df(t), Xg(t);
|
|
13908
|
-
}, []), [VA, o] = d(!1), [j, U] = d(null), [R, u] = d(null), Y =
|
|
13908
|
+
}, []), [VA, o] = d(!1), [j, U] = d(null), [R, u] = d(null), Y = aA(null), MA = aA(() => !1), HA = aA(() => {
|
|
13909
13909
|
}), JA = EA((t, p) => {
|
|
13910
|
-
MA.current = t,
|
|
13911
|
-
}, []), X =
|
|
13910
|
+
MA.current = t, HA.current = p;
|
|
13911
|
+
}, []), X = aA(null), J = aA(null), dA = aA(null), q = aA(null), nA = aA(null), vf = aA(!1), zf = aA(null), $A = aA(null), [UA, sf] = d(null), [Cn, mf] = d(null), Xf = aA(null);
|
|
13912
13912
|
NA(() => {
|
|
13913
13913
|
try {
|
|
13914
13914
|
const t = Zf(), p = qf(P);
|
|
13915
|
-
|
|
13915
|
+
J.current = new dg(t, p), dA.current = new Ug(J.current.getStreamUrl());
|
|
13916
13916
|
} catch {
|
|
13917
13917
|
}
|
|
13918
13918
|
return () => {
|
|
13919
|
-
q.current?.(),
|
|
13919
|
+
q.current?.(), dA.current?.disconnect(), nA.current && clearInterval(nA.current);
|
|
13920
13920
|
};
|
|
13921
13921
|
}, [P]);
|
|
13922
|
-
const Wf = 22, Vf =
|
|
13922
|
+
const Wf = 22, Vf = aA(0), Jf = aA(null), Yf = aA(null), An = aA(null), fn = aA(null), nn = aA(null), xn = aA(null), In = aA(""), Nf = aA(null);
|
|
13923
13923
|
NA(() => {
|
|
13924
13924
|
if (h === "processing") {
|
|
13925
13925
|
if (Nf.current) return;
|
|
@@ -13934,19 +13934,19 @@ function XB({
|
|
|
13934
13934
|
], p = 2 * Math.PI * 27;
|
|
13935
13935
|
return Nf.current = setInterval(() => {
|
|
13936
13936
|
if (vf.current) return;
|
|
13937
|
-
const G = xn.current || Date.now(),
|
|
13937
|
+
const G = xn.current || Date.now(), pA = (Date.now() - G) / 1e3, $ = Math.min(95, pA / Wf * 100);
|
|
13938
13938
|
Vf.current = $;
|
|
13939
|
-
const
|
|
13940
|
-
if (Jf.current && (Jf.current.style.width = `${
|
|
13939
|
+
const eA = Math.round($);
|
|
13940
|
+
if (Jf.current && (Jf.current.style.width = `${eA}%`), Yf.current && (Yf.current.textContent = `${eA}%`), nn.current) {
|
|
13941
13941
|
const M = p * (1 - $ / 100);
|
|
13942
13942
|
nn.current.style.strokeDashoffset = String(M);
|
|
13943
13943
|
}
|
|
13944
13944
|
if (fn.current) {
|
|
13945
|
-
const M = Math.max(0, Wf - Math.floor(
|
|
13946
|
-
fn.current.textContent =
|
|
13945
|
+
const M = Math.max(0, Wf - Math.floor(pA));
|
|
13946
|
+
fn.current.textContent = pA >= Wf ? "•••" : `~${M}s`;
|
|
13947
13947
|
}
|
|
13948
13948
|
if (An.current) {
|
|
13949
|
-
const M = [...t].reverse().find((m) =>
|
|
13949
|
+
const M = [...t].reverse().find((m) => eA >= m.at);
|
|
13950
13950
|
if (M && M.text !== In.current) {
|
|
13951
13951
|
const m = An.current;
|
|
13952
13952
|
m.style.opacity = "0", setTimeout(() => {
|
|
@@ -13981,7 +13981,7 @@ function XB({
|
|
|
13981
13981
|
Uf({ found: !1 });
|
|
13982
13982
|
return;
|
|
13983
13983
|
}
|
|
13984
|
-
if (!
|
|
13984
|
+
if (!J.current) {
|
|
13985
13985
|
Uf({ found: !1 });
|
|
13986
13986
|
return;
|
|
13987
13987
|
}
|
|
@@ -14014,8 +14014,8 @@ function XB({
|
|
|
14014
14014
|
}
|
|
14015
14015
|
}, [h]), Pn = EA(
|
|
14016
14016
|
(t, p) => {
|
|
14017
|
-
let G =
|
|
14018
|
-
if (!
|
|
14017
|
+
let G = cA, pA = L.find(($) => $.id === G);
|
|
14018
|
+
if (!pA) {
|
|
14019
14019
|
const $ = {
|
|
14020
14020
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
14021
14021
|
name: (t.gender === "female", "My Profile"),
|
|
@@ -14033,7 +14033,7 @@ function XB({
|
|
|
14033
14033
|
createdAt: Date.now(),
|
|
14034
14034
|
lastUsedAt: Date.now()
|
|
14035
14035
|
};
|
|
14036
|
-
V((
|
|
14036
|
+
V((eA) => [$, ...eA]), nf($.id), G = $.id, pA = $;
|
|
14037
14037
|
}
|
|
14038
14038
|
if (Yn({
|
|
14039
14039
|
apiUrl: P,
|
|
@@ -14052,7 +14052,7 @@ function XB({
|
|
|
14052
14052
|
}).catch(() => {
|
|
14053
14053
|
}).finally(() => yA(!0)), p?.recommendedSize && G) {
|
|
14054
14054
|
const $ = p.sections ? Object.fromEntries(
|
|
14055
|
-
Object.entries(p.sections).map(([
|
|
14055
|
+
Object.entries(p.sections).map(([eA, M]) => [eA, M.recommendedSize])
|
|
14056
14056
|
) : void 0;
|
|
14057
14057
|
lP(G, {
|
|
14058
14058
|
productId: s,
|
|
@@ -14065,14 +14065,14 @@ function XB({
|
|
|
14065
14065
|
}), V(Kf("profiles", []));
|
|
14066
14066
|
}
|
|
14067
14067
|
},
|
|
14068
|
-
[
|
|
14069
|
-
), Rn =
|
|
14070
|
-
const p = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0,
|
|
14071
|
-
if (!
|
|
14068
|
+
[cA, L, P, n, g, s, nf]
|
|
14069
|
+
), Rn = aA(null), [gn, On] = d(null), nP = EA(async (t) => {
|
|
14070
|
+
const p = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0, pA = !!t.measurements && Object.keys(t.measurements).length > 0, $ = t.photoBase64;
|
|
14071
|
+
if (!pA && $ && p > 0 && Rn.current) {
|
|
14072
14072
|
try {
|
|
14073
|
-
const M = $.startsWith("data:") ? $ : `data:image/jpeg;base64,${$}`, m = await fetch(M).then((
|
|
14073
|
+
const M = $.startsWith("data:") ? $ : `data:image/jpeg;base64,${$}`, m = await fetch(M).then((oA) => oA.blob()), CA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
|
|
14074
14074
|
await Rn.current({
|
|
14075
|
-
photoFile:
|
|
14075
|
+
photoFile: CA,
|
|
14076
14076
|
photoBase64: $,
|
|
14077
14077
|
height: p,
|
|
14078
14078
|
weight: G,
|
|
@@ -14085,14 +14085,14 @@ function XB({
|
|
|
14085
14085
|
}
|
|
14086
14086
|
return;
|
|
14087
14087
|
}
|
|
14088
|
-
I(null),
|
|
14089
|
-
const
|
|
14090
|
-
if (
|
|
14088
|
+
I(null), AA(!0), yA(pA), pA && (N(null), sf(null));
|
|
14089
|
+
const eA = t.photoBase64;
|
|
14090
|
+
if (eA)
|
|
14091
14091
|
try {
|
|
14092
|
-
const M =
|
|
14092
|
+
const M = eA.startsWith("data:") ? eA : `data:image/jpeg;base64,${eA}`;
|
|
14093
14093
|
fetch(M).then((m) => m.blob()).then((m) => {
|
|
14094
|
-
const
|
|
14095
|
-
RA(
|
|
14094
|
+
const CA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
|
|
14095
|
+
RA(CA), Xf.current = CA, vA && URL.revokeObjectURL(vA), N(URL.createObjectURL(CA));
|
|
14096
14096
|
}).catch(() => {
|
|
14097
14097
|
});
|
|
14098
14098
|
} catch {
|
|
@@ -14108,24 +14108,24 @@ function XB({
|
|
|
14108
14108
|
}).then((M) => {
|
|
14109
14109
|
M?.raw && I(M.raw), yA(!0);
|
|
14110
14110
|
}).catch(() => {
|
|
14111
|
-
}).finally(() =>
|
|
14111
|
+
}).finally(() => AA(!1));
|
|
14112
14112
|
}, [s, g, n, O, P, vA]), gg = EA(async () => {
|
|
14113
|
-
const t = L.find(($) => $.id ===
|
|
14113
|
+
const t = L.find(($) => $.id === cA);
|
|
14114
14114
|
if (!t) return;
|
|
14115
14115
|
const p = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0;
|
|
14116
14116
|
p > 0 && G > 0 && On(t);
|
|
14117
|
-
}, [L,
|
|
14117
|
+
}, [L, cA]), eg = EA(() => {
|
|
14118
14118
|
if (!gn) return;
|
|
14119
14119
|
const t = gn;
|
|
14120
14120
|
On(null), nP(t);
|
|
14121
14121
|
}, [gn, nP]), Bg = EA(() => {
|
|
14122
14122
|
On(null), tf((t) => t + 1), a("body-profile");
|
|
14123
|
-
}, []), og =
|
|
14123
|
+
}, []), og = aA(() => {
|
|
14124
14124
|
}), wg = EA(() => {
|
|
14125
14125
|
console.log("[ps-sdk] handleOpen fired — opening modal"), a("body-profile"), l?.();
|
|
14126
14126
|
}, [l]), Sf = EA(() => {
|
|
14127
|
-
a("idle"), RA(null), U(null), u(null), vA && URL.revokeObjectURL(vA),
|
|
14128
|
-
}, [
|
|
14127
|
+
a("idle"), RA(null), U(null), u(null), vA && URL.revokeObjectURL(vA), N(null), kA(null), BA(null), DA(null), I(null), AA(!1), _(null), W(!1), o(!1), Q.current = {}, FA("male"), yf.current = !1, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null), fA?.();
|
|
14128
|
+
}, [fA, vA]), vg = EA(() => {
|
|
14129
14129
|
if (j) {
|
|
14130
14130
|
U(null), Y.current && (a(Y.current), Y.current = null);
|
|
14131
14131
|
return;
|
|
@@ -14152,7 +14152,7 @@ function XB({
|
|
|
14152
14152
|
break;
|
|
14153
14153
|
case "profiles":
|
|
14154
14154
|
if (MA.current()) {
|
|
14155
|
-
|
|
14155
|
+
HA.current();
|
|
14156
14156
|
break;
|
|
14157
14157
|
}
|
|
14158
14158
|
a(Y.current || "body-profile"), Y.current = null;
|
|
@@ -14170,16 +14170,16 @@ function XB({
|
|
|
14170
14170
|
BA(F("Image must be under 10MB.")), a("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
|
|
14171
14171
|
return;
|
|
14172
14172
|
}
|
|
14173
|
-
RA(t),
|
|
14173
|
+
RA(t), Xf.current = t;
|
|
14174
14174
|
const p = URL.createObjectURL(t);
|
|
14175
|
-
|
|
14175
|
+
N(p), r?.(t), $A.current = null, Un(p).then((G) => {
|
|
14176
14176
|
$A.current = G;
|
|
14177
14177
|
}).catch(() => {
|
|
14178
14178
|
});
|
|
14179
14179
|
}, [r, v]), gP = EA(() => {
|
|
14180
|
-
RA(null), vA && URL.revokeObjectURL(vA),
|
|
14180
|
+
RA(null), vA && URL.revokeObjectURL(vA), N(null);
|
|
14181
14181
|
}, [vA]), en = EA(() => {
|
|
14182
|
-
|
|
14182
|
+
nA.current && (clearInterval(nA.current), nA.current = null), q.current?.(), q.current = null;
|
|
14183
14183
|
}, []), sn = EA((t) => {
|
|
14184
14184
|
if (t.status === "completed" && t.imageUrl) {
|
|
14185
14185
|
if (kA((p) => !p || p.startsWith("data:") || !t.imageUrl.startsWith("data:") ? t.imageUrl : p), !vf.current) {
|
|
@@ -14196,40 +14196,40 @@ function XB({
|
|
|
14196
14196
|
const p = t.error || F("Try-on generation failed");
|
|
14197
14197
|
BA(p), a("error"), v?.({ message: p });
|
|
14198
14198
|
}
|
|
14199
|
-
}, [k, v, en]), hf = pf(() =>
|
|
14200
|
-
if (!
|
|
14201
|
-
const p = t || Bf, G = qf(P),
|
|
14199
|
+
}, [k, v, en]), hf = pf(() => gA?.found && gA.requiredFields && gA.requiredFields.length > 0 ? gA.requiredFields : Z === "female" ? Gg : Yg, [gA, Z]), Bn = EA(async (t) => {
|
|
14200
|
+
if (!J.current) return;
|
|
14201
|
+
const p = t || Bf, G = qf(P), pA = Zf(), $ = Lf(g);
|
|
14202
14202
|
if ($ === "face" || $ === "head") {
|
|
14203
14203
|
const M = Q.current, m = (IA) => {
|
|
14204
14204
|
if (!IA) return;
|
|
14205
14205
|
const rf = parseFloat(IA);
|
|
14206
14206
|
return Number.isFinite(rf) && rf > 0 ? rf : void 0;
|
|
14207
|
-
},
|
|
14207
|
+
}, CA = M.sizingUnit || _A || ($ === "head" ? "cm" : "mm"), oA = (IA) => {
|
|
14208
14208
|
if (IA != null)
|
|
14209
|
-
return
|
|
14210
|
-
},
|
|
14211
|
-
bridgeWidth:
|
|
14212
|
-
templeLength:
|
|
14213
|
-
lensWidth:
|
|
14214
|
-
lensHeight:
|
|
14215
|
-
faceWidth:
|
|
14216
|
-
pd:
|
|
14209
|
+
return CA === "mm" ? IA : CA === "cm" ? IA * 10 : CA === "in" ? IA * 25.4 : IA;
|
|
14210
|
+
}, zA = {}, Cf = {
|
|
14211
|
+
bridgeWidth: oA(m(M.bridgeWidth)),
|
|
14212
|
+
templeLength: oA(m(M.templeLength) ?? m(M.armLength)),
|
|
14213
|
+
lensWidth: oA(m(M.lensWidth)),
|
|
14214
|
+
lensHeight: oA(m(M.lensHeight)),
|
|
14215
|
+
faceWidth: oA(m(M.faceWidth) ?? m(M.frameWidth)),
|
|
14216
|
+
pd: oA(m(M.pd)),
|
|
14217
14217
|
// Headwear — circumference usually typed in cm; keep as mm internally.
|
|
14218
|
-
headCircumference:
|
|
14219
|
-
headWidth:
|
|
14218
|
+
headCircumference: oA(m(M.headCircumference)),
|
|
14219
|
+
headWidth: oA(m(M.headWidth))
|
|
14220
14220
|
};
|
|
14221
|
-
for (const [IA, rf] of Object.entries(Cf)) typeof rf == "number" && (
|
|
14221
|
+
for (const [IA, rf] of Object.entries(Cf)) typeof rf == "number" && (zA[IA] = rf);
|
|
14222
14222
|
const Tf = {
|
|
14223
14223
|
product: { title: g, productId: e },
|
|
14224
|
-
sizeGuide:
|
|
14224
|
+
sizeGuide: gA?.found ? gA : { found: !1 },
|
|
14225
14225
|
sizingUnit: $ === "head" ? "cm" : "mm",
|
|
14226
14226
|
category: $,
|
|
14227
|
-
...Object.keys(
|
|
14227
|
+
...Object.keys(zA).length > 0 && { faceMeasurementsMm: zA, irisConfidence: 1 }
|
|
14228
14228
|
}, cf = new Promise((IA) => setTimeout(IA, 4500));
|
|
14229
14229
|
try {
|
|
14230
14230
|
const IA = await fetch(`${G}/api/v1/sizing/face-recommend`, {
|
|
14231
14231
|
method: "POST",
|
|
14232
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
14232
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${pA}` },
|
|
14233
14233
|
body: JSON.stringify(Tf)
|
|
14234
14234
|
});
|
|
14235
14235
|
if (IA.ok) {
|
|
@@ -14242,66 +14242,66 @@ function XB({
|
|
|
14242
14242
|
} catch (IA) {
|
|
14243
14243
|
console.error("[PS-SDK] face-recommend network error:", IA), await cf, BA(F("Unable to connect to sizing service. Please try again.")), a("error"), yA(!0);
|
|
14244
14244
|
} finally {
|
|
14245
|
-
|
|
14245
|
+
AA(!1);
|
|
14246
14246
|
}
|
|
14247
14247
|
return;
|
|
14248
14248
|
}
|
|
14249
|
-
const
|
|
14249
|
+
const eA = {
|
|
14250
14250
|
method: p,
|
|
14251
14251
|
locale: Qf,
|
|
14252
14252
|
product: { title: g, productId: s, description: "", variants: [] }
|
|
14253
14253
|
};
|
|
14254
|
-
if (
|
|
14254
|
+
if (gA?.found && (eA.sizeGuide = gA, gA.sections && (eA.sizeGuide = { ...gA, sections: gA.sections })), eA.sizingUnit = _A, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: gA?.found, hasHeaders: !!gA?.headers, hasRows: !!gA?.rows, headers: gA?.headers, rowCount: gA?.rows?.length, hasSections: !!gA?.sections, sectionNames: gA?.sections ? Object.keys(gA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", eA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", eA.sizeGuide && eA.sizeGuide.rows?.[0] ? Array.isArray(eA.sizeGuide.rows[0]) ? "array" : typeof eA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(eA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", p, "| sizingUnit:", _A, "| heightUnit:", mA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(Q.current)), console.log("[PS-SDK] dynamicFields:", hf.map((M) => `${M.key}(unit=${M.unit},req=${M.required})`).join(", ")), p === "exact") {
|
|
14255
14255
|
const M = { gender: Q.current.gender || "male", sizingUnit: _A }, m = /* @__PURE__ */ new Set();
|
|
14256
|
-
for (const
|
|
14257
|
-
|
|
14258
|
-
for (const
|
|
14259
|
-
Q.current[
|
|
14256
|
+
for (const CA of hf)
|
|
14257
|
+
CA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(CA.key) && m.add(CA.key);
|
|
14258
|
+
for (const CA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
|
|
14259
|
+
Q.current[CA] && m.add(CA);
|
|
14260
14260
|
console.log("[PS-SDK] numericKeys:", [...m].join(", "));
|
|
14261
|
-
for (const
|
|
14262
|
-
const
|
|
14263
|
-
if (!
|
|
14264
|
-
const
|
|
14265
|
-
isNaN(
|
|
14261
|
+
for (const CA of m) {
|
|
14262
|
+
const oA = Q.current[CA];
|
|
14263
|
+
if (!oA) continue;
|
|
14264
|
+
const zA = parseFloat(oA);
|
|
14265
|
+
isNaN(zA) || (M[CA] = zA);
|
|
14266
14266
|
}
|
|
14267
|
-
Q.current.shoeEU && (M.shoeEU = Q.current.shoeEU), Q.current.shoeUS && (M.shoeUS = Q.current.shoeUS), Q.current.shoeUK && (M.shoeUK = Q.current.shoeUK), Q.current.fitPreference && (M.fitPreference = Q.current.fitPreference),
|
|
14267
|
+
Q.current.shoeEU && (M.shoeEU = Q.current.shoeEU), Q.current.shoeUS && (M.shoeUS = Q.current.shoeUS), Q.current.shoeUK && (M.shoeUK = Q.current.shoeUK), Q.current.fitPreference && (M.fitPreference = Q.current.fitPreference), eA.measurements = M, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(M));
|
|
14268
14268
|
} else {
|
|
14269
14269
|
const M = parseFloat(Q.current.height || "0"), m = parseFloat(Q.current.weight || "0");
|
|
14270
14270
|
if (!M || !m) {
|
|
14271
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:", M, "qWeight:", m, "formRef:", JSON.stringify(Q.current)),
|
|
14271
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", M, "qWeight:", m, "formRef:", JSON.stringify(Q.current)), AA(!1);
|
|
14272
14272
|
return;
|
|
14273
14273
|
}
|
|
14274
|
-
const
|
|
14274
|
+
const CA = {
|
|
14275
14275
|
height: M,
|
|
14276
14276
|
weight: m,
|
|
14277
14277
|
heightUnit: Q.current.heightUnit || mA || "cm",
|
|
14278
14278
|
weightUnit: Q.current.weightUnit || y || "kg",
|
|
14279
14279
|
gender: Q.current.gender || "male"
|
|
14280
14280
|
};
|
|
14281
|
-
Q.current.age && (
|
|
14281
|
+
Q.current.age && (CA.age = parseInt(Q.current.age, 10)), Q.current.bodyType && (CA.bodyType = Q.current.bodyType), Q.current.chestProfile && (CA.chestProfile = Q.current.chestProfile), Q.current.midsectionProfile && (CA.midsectionProfile = Q.current.midsectionProfile), Q.current.hipProfile && (CA.hipProfile = Q.current.hipProfile), eA.quickEstimate = CA;
|
|
14282
14282
|
}
|
|
14283
14283
|
yA(!1);
|
|
14284
14284
|
try {
|
|
14285
14285
|
const M = await fetch(`${G}/api/v1/sizing/recommend`, {
|
|
14286
14286
|
method: "POST",
|
|
14287
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
14288
|
-
body: JSON.stringify(
|
|
14287
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${pA}` },
|
|
14288
|
+
body: JSON.stringify(eA)
|
|
14289
14289
|
});
|
|
14290
14290
|
if (M.ok) {
|
|
14291
14291
|
const m = await M.json();
|
|
14292
14292
|
console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(m)), I(m), k?.(m);
|
|
14293
|
-
const
|
|
14293
|
+
const CA = eA.measurements || {}, oA = eA.quickEstimate || {}, zA = p === "exact" ? CA : oA;
|
|
14294
14294
|
Pn(
|
|
14295
14295
|
{
|
|
14296
|
-
gender:
|
|
14297
|
-
height: Number(
|
|
14298
|
-
weight: Number(
|
|
14299
|
-
heightUnit:
|
|
14300
|
-
weightUnit:
|
|
14301
|
-
age:
|
|
14302
|
-
chestProfile:
|
|
14303
|
-
midsectionProfile:
|
|
14304
|
-
hipProfile:
|
|
14296
|
+
gender: zA.gender || "male",
|
|
14297
|
+
height: Number(zA.height || zA.heightCm || 0),
|
|
14298
|
+
weight: Number(zA.weight || zA.weightKg || 0),
|
|
14299
|
+
heightUnit: zA.heightUnit || "cm",
|
|
14300
|
+
weightUnit: zA.weightUnit || "kg",
|
|
14301
|
+
age: zA.age != null ? Number(zA.age) : void 0,
|
|
14302
|
+
chestProfile: zA.chestProfile,
|
|
14303
|
+
midsectionProfile: zA.midsectionProfile,
|
|
14304
|
+
hipProfile: zA.hipProfile
|
|
14305
14305
|
},
|
|
14306
14306
|
m
|
|
14307
14307
|
);
|
|
@@ -14312,18 +14312,18 @@ function XB({
|
|
|
14312
14312
|
} catch (M) {
|
|
14313
14313
|
console.error("[PS-SDK] Sizing recommend network error:", M), BA(F("Unable to connect to sizing service. Please try again.")), a("error"), yA(!0);
|
|
14314
14314
|
} finally {
|
|
14315
|
-
|
|
14315
|
+
AA(!1);
|
|
14316
14316
|
}
|
|
14317
|
-
}, [P, Bf, Qf, mA, y, _A,
|
|
14318
|
-
if (!
|
|
14317
|
+
}, [P, Bf, Qf, mA, y, _A, gA, g, hf, Pn]), ig = EA(async (t, p, G, pA, $, eA, M, m, CA, oA, zA) => {
|
|
14318
|
+
if (!J.current) {
|
|
14319
14319
|
const IA = F("SDK not configured. Please refresh and try again.");
|
|
14320
14320
|
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), BA(IA), a("error"), v?.({ message: IA, code: "SDK_NOT_CONFIGURED" });
|
|
14321
14321
|
return;
|
|
14322
14322
|
}
|
|
14323
14323
|
qf(P), Zf();
|
|
14324
14324
|
const Cf = /* @__PURE__ */ new Set(["weight", "weightKg", "height", "heightCm"]), Tf = /* @__PURE__ */ new Set();
|
|
14325
|
-
if (
|
|
14326
|
-
for (const IA of Object.values(
|
|
14325
|
+
if (gA?.sections) {
|
|
14326
|
+
for (const IA of Object.values(gA.sections))
|
|
14327
14327
|
if (IA.requiredFields)
|
|
14328
14328
|
for (const rf of IA.requiredFields)
|
|
14329
14329
|
rf.required && rf.unit === "cm" && !Cf.has(rf.key) && Tf.add(rf.key);
|
|
@@ -14331,46 +14331,46 @@ function XB({
|
|
|
14331
14331
|
for (const IA of hf)
|
|
14332
14332
|
IA.required && IA.unit === "cm" && !Cf.has(IA.key) && Tf.add(IA.key);
|
|
14333
14333
|
const cf = Array.from(Tf);
|
|
14334
|
-
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", hf.map((IA) => `${IA.key}(${IA.unit},req=${IA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: m, midsectionProfile:
|
|
14335
|
-
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), DA("quick"),
|
|
14334
|
+
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", hf.map((IA) => `${IA.key}(${IA.unit},req=${IA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: m, midsectionProfile: CA, hipProfile: oA }), cf.length === 0) {
|
|
14335
|
+
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), DA("quick"), AA(!0), a("size-result"), Bn("quick");
|
|
14336
14336
|
return;
|
|
14337
14337
|
}
|
|
14338
|
-
Q.current.height = String(t), Q.current.weight = String(p), Q.current.heightUnit = G, Q.current.weightUnit =
|
|
14339
|
-
}, [P, hf,
|
|
14338
|
+
Q.current.height = String(t), Q.current.weight = String(p), Q.current.heightUnit = G, Q.current.weightUnit = pA, Q.current.gender = $, eA && (Q.current.age = String(eA)), M && (Q.current.bodyType = M), m && (Q.current.chestProfile = m), CA && (Q.current.midsectionProfile = CA), oA && (Q.current.hipProfile = oA), I(null), kA(null), DA("quick"), AA(!0), a("size-result"), Bn("quick");
|
|
14339
|
+
}, [P, hf, gA, Bn, _A, y]), Kn = EA(async (t) => {
|
|
14340
14340
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
14341
|
-
hasApiRef: !!
|
|
14342
|
-
hasSseRef: !!
|
|
14341
|
+
hasApiRef: !!J.current,
|
|
14342
|
+
hasSseRef: !!dA.current,
|
|
14343
14343
|
apiUrl: P
|
|
14344
|
-
}), !
|
|
14345
|
-
const
|
|
14346
|
-
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), BA(
|
|
14344
|
+
}), !J.current || !dA.current) {
|
|
14345
|
+
const oA = F("SDK not configured. Please refresh and try again.");
|
|
14346
|
+
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), BA(oA), a("error"), v?.({ message: oA, code: "SDK_NOT_CONFIGURED" });
|
|
14347
14347
|
return;
|
|
14348
14348
|
}
|
|
14349
14349
|
const p = qf(P), G = Zf();
|
|
14350
|
-
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: p }), RA(t.photoFile),
|
|
14351
|
-
const
|
|
14352
|
-
|
|
14350
|
+
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: p }), RA(t.photoFile), Xf.current = t.photoFile;
|
|
14351
|
+
const pA = t.photoFile ? URL.createObjectURL(t.photoFile) : t.photoBase64.startsWith("data:") ? t.photoBase64 : `data:image/jpeg;base64,${t.photoBase64}`;
|
|
14352
|
+
N(pA), vf.current = !1, LA(!1), I(null), kA(null), AA(!0), yA(!1), a("size-result");
|
|
14353
14353
|
const $ = Lf(g);
|
|
14354
14354
|
if ($ === "face" || $ === "head") {
|
|
14355
14355
|
mf(null);
|
|
14356
|
-
const
|
|
14356
|
+
const oA = new Promise((zA) => setTimeout(zA, 4500));
|
|
14357
14357
|
try {
|
|
14358
|
-
const
|
|
14359
|
-
if (!
|
|
14360
|
-
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await
|
|
14358
|
+
const zA = await Rg(pA);
|
|
14359
|
+
if (!zA) {
|
|
14360
|
+
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await oA;
|
|
14361
14361
|
const cf = F($ === "head" ? "We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears." : "We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
|
|
14362
|
-
BA(cf), a("error"), v?.({ message: cf, code: "FACE_DETECTION_FAILED" }),
|
|
14362
|
+
BA(cf), a("error"), v?.({ message: cf, code: "FACE_DETECTION_FAILED" }), AA(!1);
|
|
14363
14363
|
return;
|
|
14364
14364
|
}
|
|
14365
|
-
|
|
14365
|
+
zA && mf(zA.landmarks);
|
|
14366
14366
|
const Cf = {
|
|
14367
14367
|
product: { title: g, productId: s },
|
|
14368
|
-
sizeGuide:
|
|
14368
|
+
sizeGuide: gA ?? { found: !1 },
|
|
14369
14369
|
sizingUnit: $ === "head" ? "cm" : "mm",
|
|
14370
14370
|
category: $,
|
|
14371
14371
|
bodyImage: t.photoBase64
|
|
14372
14372
|
};
|
|
14373
|
-
|
|
14373
|
+
zA && (Cf.faceMeasurementsMm = zA.measurementsMm, Cf.faceLandmarks = zA.landmarks, Cf.irisConfidence = zA.irisConfidence);
|
|
14374
14374
|
const Tf = await fetch(`${p}/api/v1/sizing/face-recommend`, {
|
|
14375
14375
|
method: "POST",
|
|
14376
14376
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
|
|
@@ -14378,7 +14378,7 @@ function XB({
|
|
|
14378
14378
|
});
|
|
14379
14379
|
if (Tf.ok) {
|
|
14380
14380
|
const cf = await Tf.json();
|
|
14381
|
-
await
|
|
14381
|
+
await oA, I(cf), k?.(cf), Pn(
|
|
14382
14382
|
{
|
|
14383
14383
|
gender: t.gender,
|
|
14384
14384
|
height: t.height,
|
|
@@ -14391,20 +14391,20 @@ function XB({
|
|
|
14391
14391
|
cf
|
|
14392
14392
|
);
|
|
14393
14393
|
} else
|
|
14394
|
-
await
|
|
14395
|
-
} catch (
|
|
14396
|
-
console.error("[ps-sdk] face-recommend failed:",
|
|
14394
|
+
await oA, yA(!0);
|
|
14395
|
+
} catch (zA) {
|
|
14396
|
+
console.error("[ps-sdk] face-recommend failed:", zA), await oA, yA(!0);
|
|
14397
14397
|
}
|
|
14398
|
-
|
|
14398
|
+
AA(!1);
|
|
14399
14399
|
return;
|
|
14400
14400
|
}
|
|
14401
|
-
$A.current = null, sf(null), Un(
|
|
14402
|
-
const
|
|
14403
|
-
|
|
14404
|
-
new Promise((
|
|
14401
|
+
$A.current = null, sf(null), Un(pA).then((oA) => ($A.current = oA, oA)).catch(() => null);
|
|
14402
|
+
const eA = $f(pA).then((oA) => (sf(oA), oA)).catch(() => null), M = 2500, m = await Promise.race([
|
|
14403
|
+
eA,
|
|
14404
|
+
new Promise((oA) => setTimeout(() => oA(null), M))
|
|
14405
14405
|
]);
|
|
14406
14406
|
m || console.log("[ps-sdk] landmarks not ready in", M, "ms — proceeding without them");
|
|
14407
|
-
const
|
|
14407
|
+
const CA = {
|
|
14408
14408
|
method: "photo",
|
|
14409
14409
|
locale: Qf,
|
|
14410
14410
|
sizingUnit: _A,
|
|
@@ -14424,16 +14424,16 @@ function XB({
|
|
|
14424
14424
|
...t.age && { age: t.age }
|
|
14425
14425
|
}
|
|
14426
14426
|
};
|
|
14427
|
-
|
|
14427
|
+
gA?.found && (CA.sizeGuide = gA);
|
|
14428
14428
|
try {
|
|
14429
|
-
const
|
|
14429
|
+
const oA = await fetch(`${p}/api/v1/sizing/recommend`, {
|
|
14430
14430
|
method: "POST",
|
|
14431
14431
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
|
|
14432
|
-
body: JSON.stringify(
|
|
14432
|
+
body: JSON.stringify(CA)
|
|
14433
14433
|
});
|
|
14434
|
-
if (
|
|
14435
|
-
const
|
|
14436
|
-
I(
|
|
14434
|
+
if (oA.ok) {
|
|
14435
|
+
const zA = await oA.json();
|
|
14436
|
+
I(zA), k?.(zA), Pn(
|
|
14437
14437
|
{
|
|
14438
14438
|
gender: t.gender,
|
|
14439
14439
|
height: t.height,
|
|
@@ -14443,153 +14443,161 @@ function XB({
|
|
|
14443
14443
|
age: t.age,
|
|
14444
14444
|
bodyImage: t.photoBase64
|
|
14445
14445
|
},
|
|
14446
|
-
|
|
14446
|
+
zA
|
|
14447
14447
|
);
|
|
14448
14448
|
} else
|
|
14449
14449
|
yA(!0);
|
|
14450
14450
|
} catch {
|
|
14451
14451
|
yA(!0);
|
|
14452
14452
|
}
|
|
14453
|
-
|
|
14454
|
-
}, [P, n, g, _A, y, Qf,
|
|
14453
|
+
AA(!1);
|
|
14454
|
+
}, [P, n, g, _A, y, Qf, gA, hf, Pn]);
|
|
14455
14455
|
Rn.current = Kn;
|
|
14456
14456
|
const eP = EA(async (t) => {
|
|
14457
|
-
const p = t ||
|
|
14458
|
-
if (!p || !
|
|
14459
|
-
const
|
|
14460
|
-
BA(
|
|
14457
|
+
const p = t || uA || Xf.current;
|
|
14458
|
+
if (!p || !J.current || !dA.current) {
|
|
14459
|
+
const eA = J.current ? F("Please upload a photo first.") : F("SDK not configured. Please provide an API key.");
|
|
14460
|
+
BA(eA), a("error"), v?.({ message: eA, code: "SDK_NOT_CONFIGURED" });
|
|
14461
14461
|
return;
|
|
14462
14462
|
}
|
|
14463
|
-
t && t !==
|
|
14464
|
-
const G = OP(Lf(g)),
|
|
14465
|
-
(t || !vA) &&
|
|
14466
|
-
$A.current =
|
|
14463
|
+
t && t !== uA && (RA(t), Xf.current = t), vf.current = !1, LA(!0);
|
|
14464
|
+
const G = OP(Lf(g)), pA = G === "apparel", $ = (t ? null : vA) || URL.createObjectURL(p);
|
|
14465
|
+
(t || !vA) && N($), $A.current = null, sf(null), pA && (Un($).then((eA) => {
|
|
14466
|
+
$A.current = eA;
|
|
14467
14467
|
}).catch(() => {
|
|
14468
|
-
}), $f($).then((
|
|
14469
|
-
sf(
|
|
14468
|
+
}), $f($).then((eA) => {
|
|
14469
|
+
sf(eA);
|
|
14470
14470
|
}).catch(() => {
|
|
14471
14471
|
}));
|
|
14472
14472
|
try {
|
|
14473
|
-
const
|
|
14474
|
-
let
|
|
14475
|
-
|
|
14476
|
-
const
|
|
14477
|
-
|
|
14473
|
+
const eA = await tn(p), M = jA.current, m = M?.matchDetails && M.matchDetails.length ? M.matchDetails : TA?.matchDetails || [];
|
|
14474
|
+
let CA;
|
|
14475
|
+
pA && m.length && (CA = aP(m, $A.current));
|
|
14476
|
+
const oA = await J.current.submitTryOn(
|
|
14477
|
+
eA,
|
|
14478
14478
|
n,
|
|
14479
|
-
|
|
14479
|
+
CA,
|
|
14480
14480
|
G ?? "apparel",
|
|
14481
14481
|
{
|
|
14482
14482
|
productId: s,
|
|
14483
14483
|
productTitle: g,
|
|
14484
|
-
silhouetteContext: jP(TA,
|
|
14484
|
+
silhouetteContext: jP(TA, gA, M?.displayLabel)
|
|
14485
14485
|
}
|
|
14486
14486
|
);
|
|
14487
|
-
b?.(
|
|
14488
|
-
let
|
|
14489
|
-
|
|
14487
|
+
b?.(oA.jobId), q.current = dA.current.onJob(oA.jobId, sn);
|
|
14488
|
+
let zA = 0;
|
|
14489
|
+
nA.current = setInterval(async () => {
|
|
14490
14490
|
if (vf.current) {
|
|
14491
|
-
|
|
14491
|
+
nA.current && clearInterval(nA.current), nA.current = null;
|
|
14492
14492
|
return;
|
|
14493
14493
|
}
|
|
14494
|
-
if (
|
|
14495
|
-
|
|
14494
|
+
if (zA++, zA > 60) {
|
|
14495
|
+
nA.current && clearInterval(nA.current), nA.current = null;
|
|
14496
14496
|
return;
|
|
14497
14497
|
}
|
|
14498
14498
|
try {
|
|
14499
|
-
const Cf = await
|
|
14500
|
-
(Cf.status === "completed" || Cf.status === "failed") && sn({ galleryId:
|
|
14499
|
+
const Cf = await J.current.getStatus(oA.jobId);
|
|
14500
|
+
(Cf.status === "completed" || Cf.status === "failed") && sn({ galleryId: oA.jobId, status: Cf.status, imageUrl: Cf.imageUrl, error: Cf.status === "failed" ? Cf.message : null, timestamp: Date.now() });
|
|
14501
14501
|
} catch {
|
|
14502
14502
|
}
|
|
14503
14503
|
}, 3e3);
|
|
14504
|
-
} catch (
|
|
14505
|
-
const M =
|
|
14504
|
+
} catch (eA) {
|
|
14505
|
+
const M = eA instanceof Error ? eA.message : F("Failed to start try-on"), m = eA instanceof sP ? eA.code : void 0;
|
|
14506
14506
|
BA(M), a("error"), v?.({ message: M, code: m });
|
|
14507
14507
|
}
|
|
14508
|
-
}, [
|
|
14509
|
-
|
|
14508
|
+
}, [uA, n, g, TA, b, v, sn]), Tn = EA(async (t, p) => {
|
|
14509
|
+
const G = uA || Xf.current;
|
|
14510
|
+
if (!G || !J.current || !dA.current) {
|
|
14511
|
+
console.warn("[ps-sdk:retry] skipping — no file/api/sse", {
|
|
14512
|
+
hasFile: !!G,
|
|
14513
|
+
hasApi: !!J.current,
|
|
14514
|
+
hasSse: !!dA.current
|
|
14515
|
+
});
|
|
14516
|
+
return;
|
|
14517
|
+
}
|
|
14510
14518
|
ef(!0);
|
|
14511
|
-
const
|
|
14512
|
-
if (
|
|
14513
|
-
const
|
|
14519
|
+
const pA = OP(Lf(g)), $ = pA === "apparel";
|
|
14520
|
+
if ($ && $A.current) {
|
|
14521
|
+
const eA = {
|
|
14514
14522
|
chest: "chest",
|
|
14515
14523
|
bust: "chest",
|
|
14516
14524
|
waist: "waist",
|
|
14517
14525
|
hips: "hips",
|
|
14518
14526
|
hip: "hips"
|
|
14519
14527
|
};
|
|
14520
|
-
for (const
|
|
14521
|
-
const
|
|
14522
|
-
if (
|
|
14523
|
-
const
|
|
14524
|
-
|
|
14528
|
+
for (const M of t) {
|
|
14529
|
+
const m = eA[M.area.toLowerCase()];
|
|
14530
|
+
if (m && $A.current[m]) {
|
|
14531
|
+
const CA = $A.current[m];
|
|
14532
|
+
M.y = Math.round(CA.y * 1e3) / 1e3, M.x1 = Math.round(CA.x1 * 1e3) / 1e3, M.x2 = Math.round(CA.x2 * 1e3) / 1e3;
|
|
14525
14533
|
}
|
|
14526
14534
|
}
|
|
14527
14535
|
}
|
|
14528
14536
|
try {
|
|
14529
|
-
vf.current = !1, q.current?.(),
|
|
14530
|
-
const
|
|
14531
|
-
|
|
14537
|
+
vf.current = !1, q.current?.(), nA.current && (clearInterval(nA.current), nA.current = null);
|
|
14538
|
+
const eA = await tn(G), M = $ ? t : void 0, m = await J.current.submitTryOn(
|
|
14539
|
+
eA,
|
|
14532
14540
|
n,
|
|
14533
|
-
|
|
14534
|
-
|
|
14541
|
+
M,
|
|
14542
|
+
pA ?? "apparel",
|
|
14535
14543
|
{
|
|
14536
14544
|
productId: s,
|
|
14537
14545
|
productTitle: g,
|
|
14538
|
-
silhouetteContext: jP(TA,
|
|
14546
|
+
silhouetteContext: jP(TA, gA, p)
|
|
14539
14547
|
}
|
|
14540
14548
|
);
|
|
14541
|
-
q.current =
|
|
14542
|
-
oA.status === "completed" && oA.imageUrl ? (kA(oA.imageUrl), ef(!1), vf.current = !0, q.current?.(), q.current = null,
|
|
14549
|
+
q.current = dA.current.onJob(m.jobId, (oA) => {
|
|
14550
|
+
oA.status === "completed" && oA.imageUrl ? (kA(oA.imageUrl), ef(!1), vf.current = !0, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null)) : oA.status === "failed" && (ef(!1), vf.current = !0, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null));
|
|
14543
14551
|
});
|
|
14544
|
-
let
|
|
14545
|
-
|
|
14552
|
+
let CA = 0;
|
|
14553
|
+
nA.current = setInterval(async () => {
|
|
14546
14554
|
if (vf.current) {
|
|
14547
|
-
|
|
14555
|
+
nA.current && clearInterval(nA.current), nA.current = null;
|
|
14548
14556
|
return;
|
|
14549
14557
|
}
|
|
14550
|
-
if (
|
|
14551
|
-
|
|
14558
|
+
if (CA++, CA > 60) {
|
|
14559
|
+
nA.current && clearInterval(nA.current), nA.current = null, ef(!1);
|
|
14552
14560
|
return;
|
|
14553
14561
|
}
|
|
14554
14562
|
try {
|
|
14555
|
-
const oA = await
|
|
14556
|
-
oA.status === "completed" && oA.imageUrl ? (vf.current || (vf.current = !0, kA(oA.imageUrl), ef(!1), q.current?.(), q.current = null),
|
|
14563
|
+
const oA = await J.current.getStatus(m.jobId);
|
|
14564
|
+
oA.status === "completed" && oA.imageUrl ? (vf.current || (vf.current = !0, kA(oA.imageUrl), ef(!1), q.current?.(), q.current = null), nA.current && (clearInterval(nA.current), nA.current = null)) : oA.status === "failed" && (vf.current = !0, ef(!1), nA.current && (clearInterval(nA.current), nA.current = null));
|
|
14557
14565
|
} catch {
|
|
14558
14566
|
}
|
|
14559
14567
|
}, 3e3);
|
|
14560
14568
|
} catch {
|
|
14561
14569
|
ef(!1);
|
|
14562
14570
|
}
|
|
14563
|
-
}, [
|
|
14571
|
+
}, [uA, n, g]), Dg = EA((t) => {
|
|
14564
14572
|
df(t);
|
|
14565
14573
|
const p = t.matchDetails || [];
|
|
14566
14574
|
if (!p.length) return;
|
|
14567
14575
|
const G = aP(p, $A.current);
|
|
14568
14576
|
Tn(G, t.displayLabel);
|
|
14569
14577
|
}, [Tn]), rg = EA(() => {
|
|
14570
|
-
if (
|
|
14571
|
-
if (
|
|
14578
|
+
if (PA)
|
|
14579
|
+
if (PA.startsWith("data:")) {
|
|
14572
14580
|
const t = document.createElement("a");
|
|
14573
|
-
t.href =
|
|
14581
|
+
t.href = PA, t.download = `primestyle-tryon-${Date.now()}.png`, t.click();
|
|
14574
14582
|
} else
|
|
14575
|
-
fetch(
|
|
14583
|
+
fetch(PA).then((t) => t.blob()).then((t) => {
|
|
14576
14584
|
const p = URL.createObjectURL(t), G = document.createElement("a");
|
|
14577
14585
|
G.href = p, G.download = `primestyle-tryon-${Date.now()}.png`, G.click(), setTimeout(() => URL.revokeObjectURL(p), 100);
|
|
14578
|
-
}).catch(() => window.open(
|
|
14579
|
-
}, [
|
|
14580
|
-
vf.current = !1, en(), RA(null), vA && URL.revokeObjectURL(vA),
|
|
14586
|
+
}).catch(() => window.open(PA, "_blank"));
|
|
14587
|
+
}, [PA]), Cg = EA(() => {
|
|
14588
|
+
vf.current = !1, en(), RA(null), vA && URL.revokeObjectURL(vA), N(null), kA(null), BA(null), DA(null), I(null), AA(!1), o(!1), a("body-profile");
|
|
14581
14589
|
}, [vA, en]), Hg = EA((t) => {
|
|
14582
|
-
const p = L.find((
|
|
14590
|
+
const p = L.find((pA) => pA.id === t);
|
|
14583
14591
|
if (!p) return;
|
|
14584
|
-
nf(t), V((
|
|
14592
|
+
nf(t), V((pA) => pA.map(($) => $.id === t ? { ...$, lastUsedAt: Date.now() } : $));
|
|
14585
14593
|
const G = { gender: p.gender || "male" };
|
|
14586
14594
|
if ((p.height ?? p.heightCm) && (G.height = String(p.height ?? p.heightCm)), (p.weight ?? p.weightKg) && (G.weight = String(p.weight ?? p.weightKg)), p.chest && (G.chest = String(p.chest)), p.bust && (G.bust = String(p.bust)), p.waist && (G.waist = String(p.waist)), p.hips && (G.hips = String(p.hips)), p.shoulderWidth && (G.shoulderWidth = String(p.shoulderWidth)), p.sleeveLength && (G.sleeveLength = String(p.sleeveLength)), p.inseam && (G.inseam = String(p.inseam)), p.neckCircumference && (G.neckCircumference = String(p.neckCircumference)), p.footLengthCm && (G.footLengthCm = String(p.footLengthCm)), p.shoeEU && (G.shoeEU = p.shoeEU), p.shoeUS && (G.shoeUS = p.shoeUS), p.shoeUK && (G.shoeUK = p.shoeUK), p.fitPreference && (G.fitPreference = p.fitPreference), p.customMeasurements)
|
|
14587
|
-
for (const [
|
|
14588
|
-
G[
|
|
14589
|
-
Q.current = G, FA(G.gender || "male"), p.country && af(p.country), p.sizingUnit && of(p.sizingUnit), p.heightUnit && E(p.heightUnit), p.weightUnit &&
|
|
14595
|
+
for (const [pA, $] of Object.entries(p.customMeasurements))
|
|
14596
|
+
G[pA] = String($);
|
|
14597
|
+
Q.current = G, FA(G.gender || "male"), p.country && af(p.country), p.sizingUnit && of(p.sizingUnit), p.heightUnit && E(p.heightUnit), p.weightUnit && QA(p.weightUnit), tf((pA) => pA + 1);
|
|
14590
14598
|
}, [L]);
|
|
14591
14599
|
og.current = Hg, EA((t, p) => {
|
|
14592
|
-
const G = (p ? null :
|
|
14600
|
+
const G = (p ? null : cA) || `p_${Date.now()}`, pA = {
|
|
14593
14601
|
id: G,
|
|
14594
14602
|
name: t,
|
|
14595
14603
|
gender: Q.current.gender || "male",
|
|
@@ -14632,49 +14640,49 @@ function XB({
|
|
|
14632
14640
|
"weight",
|
|
14633
14641
|
"heightFeet",
|
|
14634
14642
|
"heightInches"
|
|
14635
|
-
]),
|
|
14643
|
+
]), eA = {};
|
|
14636
14644
|
for (const [M, m] of Object.entries(Q.current))
|
|
14637
|
-
!$.has(M) && m && !isNaN(Number(m)) && (
|
|
14638
|
-
Object.keys(
|
|
14639
|
-
const m = M.findIndex((
|
|
14645
|
+
!$.has(M) && m && !isNaN(Number(m)) && (eA[M] = parseFloat(m));
|
|
14646
|
+
Object.keys(eA).length > 0 && (pA.customMeasurements = eA), V((M) => {
|
|
14647
|
+
const m = M.findIndex((CA) => CA.id === G);
|
|
14640
14648
|
if (m >= 0) {
|
|
14641
|
-
const
|
|
14642
|
-
return
|
|
14649
|
+
const CA = [...M];
|
|
14650
|
+
return CA[m] = pA, CA;
|
|
14643
14651
|
}
|
|
14644
|
-
return [...M,
|
|
14652
|
+
return [...M, pA].slice(-50);
|
|
14645
14653
|
}), nf(G), o(!0);
|
|
14646
|
-
}, [
|
|
14654
|
+
}, [cA, Qf, _A, mA, y]);
|
|
14647
14655
|
const BP = EA(() => {
|
|
14648
14656
|
const t = {
|
|
14649
14657
|
id: `h_${Date.now()}`,
|
|
14650
14658
|
productTitle: g,
|
|
14651
14659
|
productImage: n,
|
|
14652
|
-
resultImageUrl:
|
|
14660
|
+
resultImageUrl: PA || void 0,
|
|
14653
14661
|
recommendedSize: TA?.recommendedSize,
|
|
14654
14662
|
confidence: TA?.confidence,
|
|
14655
14663
|
reasoning: TA?.reasoning,
|
|
14656
14664
|
internationalSizes: TA?.internationalSizes,
|
|
14657
14665
|
matchDetails: TA?.matchDetails,
|
|
14658
14666
|
sizingResult: TA || void 0,
|
|
14659
|
-
sizeGuide:
|
|
14660
|
-
found:
|
|
14661
|
-
title:
|
|
14662
|
-
headers:
|
|
14663
|
-
rows:
|
|
14664
|
-
sections:
|
|
14665
|
-
sectionImages:
|
|
14667
|
+
sizeGuide: gA ? {
|
|
14668
|
+
found: gA.found,
|
|
14669
|
+
title: gA.title,
|
|
14670
|
+
headers: gA.headers,
|
|
14671
|
+
rows: gA.rows,
|
|
14672
|
+
sections: gA.sections,
|
|
14673
|
+
sectionImages: gA.sectionImages
|
|
14666
14674
|
} : void 0,
|
|
14667
14675
|
date: Date.now()
|
|
14668
14676
|
};
|
|
14669
|
-
if (
|
|
14670
|
-
const p = L.find((G) => G.id ===
|
|
14677
|
+
if (cA) {
|
|
14678
|
+
const p = L.find((G) => G.id === cA);
|
|
14671
14679
|
p && (t.profileName = p.name);
|
|
14672
14680
|
}
|
|
14673
14681
|
wf((p) => [t, ...p].slice(0, 50));
|
|
14674
|
-
}, [g, n,
|
|
14682
|
+
}, [g, n, PA, TA, gA, cA, L]), yf = aA(!1), Hn = aA(!1);
|
|
14675
14683
|
NA(() => {
|
|
14676
|
-
h === "size-result" && TA && !yf.current ? (yf.current = !0, Hn.current = !1, BP()) : h === "size-result" && TA &&
|
|
14677
|
-
}, [h, TA,
|
|
14684
|
+
h === "size-result" && TA && !yf.current ? (yf.current = !0, Hn.current = !1, BP()) : h === "size-result" && TA && PA && !Hn.current ? (Hn.current = !0, wf((t) => t.length === 0 ? t : [{ ...t[0], resultImageUrl: PA }, ...t.slice(1)])) : h === "result" && PA && !yf.current ? (yf.current = !0, BP()) : (h === "welcome" || h === "body-profile") && (yf.current = !1, Hn.current = !1);
|
|
14685
|
+
}, [h, TA, PA]);
|
|
14678
14686
|
const Qg = EA((t) => {
|
|
14679
14687
|
yf.current = !0, t.sizingResult ? I(t.sizingResult) : t.recommendedSize && I({
|
|
14680
14688
|
recommendedSize: t.recommendedSize,
|
|
@@ -14682,7 +14690,7 @@ function XB({
|
|
|
14682
14690
|
reasoning: t.reasoning || "",
|
|
14683
14691
|
internationalSizes: t.internationalSizes,
|
|
14684
14692
|
matchDetails: t.matchDetails
|
|
14685
|
-
}), t.sizeGuide && (Uf(t.sizeGuide), lA(!1)), kA(t.resultImageUrl || null),
|
|
14693
|
+
}), t.sizeGuide && (Uf(t.sizeGuide), lA(!1)), kA(t.resultImageUrl || null), AA(!1), LA(!1), Pf(null), U(null), a("size-result");
|
|
14686
14694
|
}, []), zg = EA((t, p) => {
|
|
14687
14695
|
Q.current[t] = p;
|
|
14688
14696
|
}, []);
|
|
@@ -14750,11 +14758,11 @@ function XB({
|
|
|
14750
14758
|
case "welcome":
|
|
14751
14759
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ve, { productImage: n, setView: a, t: F }) }, "v-welcome");
|
|
14752
14760
|
case "body-profile": {
|
|
14753
|
-
const t = Lf(g), p = { productImage: n, productTitle: g, formRef: Q, sizingUnit: _A, setSizingUnit: of, setSizingMethod: DA, setSizingLoading:
|
|
14761
|
+
const t = Lf(g), p = { productImage: n, productTitle: g, formRef: Q, sizingUnit: _A, setSizingUnit: of, setSizingMethod: DA, setSizingLoading: AA, setView: a, submitSizing: Bn, onSnapSubmit: Kn, onBack: Sf, sizeGuide: gA, t: F };
|
|
14754
14762
|
if (t === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(RB, { ...p }) }, "v-foot");
|
|
14755
14763
|
if (t === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(KB, { ...p }) }, "v-head");
|
|
14756
14764
|
if (t === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(bB, { ...p }) }, "v-face");
|
|
14757
|
-
const G = !!(
|
|
14765
|
+
const G = !!(gA?.requiredFields?.some((M) => M.key === "bust") || gA?.sections && Object.values(gA.sections).some((M) => M.requiredFields?.some((m) => m.key === "bust"))), pA = g.toLowerCase(), $ = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(pA);
|
|
14758
14766
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
14759
14767
|
MB,
|
|
14760
14768
|
{
|
|
@@ -14766,18 +14774,18 @@ function XB({
|
|
|
14766
14774
|
heightUnit: mA,
|
|
14767
14775
|
setHeightUnit: E,
|
|
14768
14776
|
weightUnit: y,
|
|
14769
|
-
setWeightUnit:
|
|
14777
|
+
setWeightUnit: QA,
|
|
14770
14778
|
sizingUnit: _A,
|
|
14771
14779
|
setSizingUnit: of,
|
|
14772
14780
|
hasActiveProfileWithMeasurements: (() => {
|
|
14773
|
-
const M = L.find((
|
|
14781
|
+
const M = L.find((oA) => oA.id === cA);
|
|
14774
14782
|
if (!M) return !1;
|
|
14775
|
-
const m = M.height ?? M.heightCm ?? 0,
|
|
14776
|
-
return m > 0 &&
|
|
14783
|
+
const m = M.height ?? M.heightCm ?? 0, CA = M.weight ?? M.weightKg ?? 0;
|
|
14784
|
+
return m > 0 && CA > 0;
|
|
14777
14785
|
})(),
|
|
14778
14786
|
onUseActiveProfile: gg,
|
|
14779
|
-
activeProfileName: L.find((m) => m.id ===
|
|
14780
|
-
activeProfile: L.find((M) => M.id ===
|
|
14787
|
+
activeProfileName: L.find((m) => m.id === cA)?.name || null,
|
|
14788
|
+
activeProfile: L.find((M) => M.id === cA) || null,
|
|
14781
14789
|
onStartFresh: () => {
|
|
14782
14790
|
nf(null), Q.current = {};
|
|
14783
14791
|
},
|
|
@@ -14800,7 +14808,7 @@ function XB({
|
|
|
14800
14808
|
onBack: Sf,
|
|
14801
14809
|
t: F
|
|
14802
14810
|
},
|
|
14803
|
-
`bp-${
|
|
14811
|
+
`bp-${cA || "anon"}`
|
|
14804
14812
|
) }, "v-bodyprofile");
|
|
14805
14813
|
}
|
|
14806
14814
|
case "estimation-review":
|
|
@@ -14820,7 +14828,7 @@ function XB({
|
|
|
14820
14828
|
setSizingUnit: of,
|
|
14821
14829
|
updateField: zg,
|
|
14822
14830
|
setSizingMethod: DA,
|
|
14823
|
-
setSizingLoading:
|
|
14831
|
+
setSizingLoading: AA,
|
|
14824
14832
|
setView: a,
|
|
14825
14833
|
submitSizing: Bn,
|
|
14826
14834
|
t: F
|
|
@@ -14831,10 +14839,10 @@ function XB({
|
|
|
14831
14839
|
Oe,
|
|
14832
14840
|
{
|
|
14833
14841
|
estimationDone: sA,
|
|
14834
|
-
sizingLoading:
|
|
14842
|
+
sizingLoading: XA,
|
|
14835
14843
|
sizingResult: TA,
|
|
14836
|
-
sizeGuide:
|
|
14837
|
-
resultImageUrl:
|
|
14844
|
+
sizeGuide: gA,
|
|
14845
|
+
resultImageUrl: PA,
|
|
14838
14846
|
productImage: n,
|
|
14839
14847
|
productTitle: g,
|
|
14840
14848
|
sizingUnit: _A,
|
|
@@ -14842,13 +14850,13 @@ function XB({
|
|
|
14842
14850
|
handleDownload: rg,
|
|
14843
14851
|
onRetryWithFit: Tn,
|
|
14844
14852
|
retryLoading: KA,
|
|
14845
|
-
selectedFile:
|
|
14853
|
+
selectedFile: uA,
|
|
14846
14854
|
previewUrl: vA,
|
|
14847
14855
|
handleFileSelect: PP,
|
|
14848
14856
|
handleRemovePreview: gP,
|
|
14849
14857
|
handleTryOnSubmit: eP,
|
|
14850
14858
|
tryOnProcessing: Of,
|
|
14851
|
-
bodyLandmarks:
|
|
14859
|
+
bodyLandmarks: UA,
|
|
14852
14860
|
faceLandmarks: Cn,
|
|
14853
14861
|
measurementType: Lf(g),
|
|
14854
14862
|
activeSection: hA,
|
|
@@ -14857,16 +14865,16 @@ function XB({
|
|
|
14857
14865
|
onPendingCustomSizeChange: df,
|
|
14858
14866
|
onRegenerateTryOn: Dg,
|
|
14859
14867
|
onResetTryOn: () => {
|
|
14860
|
-
RA(null), vA && URL.revokeObjectURL(vA),
|
|
14868
|
+
RA(null), vA && URL.revokeObjectURL(vA), N(null), kA(null);
|
|
14861
14869
|
},
|
|
14862
14870
|
onClose: Sf,
|
|
14863
14871
|
userHeightCm: (() => {
|
|
14864
|
-
const t = L.find(($) => $.id ===
|
|
14872
|
+
const t = L.find(($) => $.id === cA);
|
|
14865
14873
|
if (!t) return;
|
|
14866
14874
|
const p = t.height ?? t.heightCm;
|
|
14867
14875
|
if (!p || p <= 0) return;
|
|
14868
|
-
const G = t.heightUnit,
|
|
14869
|
-
return (G === "in" || G === "ft") &&
|
|
14876
|
+
const G = t.heightUnit, pA = TA?.unit || _A;
|
|
14877
|
+
return (G === "in" || G === "ft") && pA !== "in" ? Math.round(p * 2.54) : (!G || G === "cm") && pA === "in" ? Math.round(p / 2.54 * 10) / 10 : p;
|
|
14870
14878
|
})(),
|
|
14871
14879
|
t: F
|
|
14872
14880
|
}
|
|
@@ -14875,7 +14883,7 @@ function XB({
|
|
|
14875
14883
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
14876
14884
|
se,
|
|
14877
14885
|
{
|
|
14878
|
-
selectedFile:
|
|
14886
|
+
selectedFile: uA,
|
|
14879
14887
|
previewUrl: vA,
|
|
14880
14888
|
dragOver: OA,
|
|
14881
14889
|
setDragOver: gf,
|
|
@@ -14909,13 +14917,13 @@ function XB({
|
|
|
14909
14917
|
iB,
|
|
14910
14918
|
{
|
|
14911
14919
|
profiles: L,
|
|
14912
|
-
activeProfileId:
|
|
14920
|
+
activeProfileId: cA,
|
|
14913
14921
|
estimatingProfileIds: Af,
|
|
14914
14922
|
onSelectProfile: (t) => {
|
|
14915
14923
|
nf(t), a("body-profile");
|
|
14916
14924
|
},
|
|
14917
14925
|
onSaveProfileMeasurements: (t, p, G) => {
|
|
14918
|
-
Gn(t, p, G ?? L.find((
|
|
14926
|
+
Gn(t, p, G ?? L.find((pA) => pA.id === t)?.measurementsUnit ?? "cm"), V(Kf("profiles", []));
|
|
14919
14927
|
},
|
|
14920
14928
|
onSaveBraSize: (t, p, G) => {
|
|
14921
14929
|
hP(t, { bandSize: p, cupSize: G }), V(Kf("profiles", []));
|
|
@@ -14926,9 +14934,9 @@ function XB({
|
|
|
14926
14934
|
onPhotoPreview: (t) => {
|
|
14927
14935
|
if (t) {
|
|
14928
14936
|
const p = t.startsWith("data:") ? t : `data:image/jpeg;base64,${t}`;
|
|
14929
|
-
|
|
14937
|
+
N(p);
|
|
14930
14938
|
} else
|
|
14931
|
-
|
|
14939
|
+
N(null);
|
|
14932
14940
|
},
|
|
14933
14941
|
onEstimateFromPhoto: async (t) => {
|
|
14934
14942
|
try {
|
|
@@ -14956,12 +14964,12 @@ function XB({
|
|
|
14956
14964
|
lastUsedAt: Date.now()
|
|
14957
14965
|
}, G = [p, ...L];
|
|
14958
14966
|
lf("profiles", G), V(G), nf(p.id);
|
|
14959
|
-
const
|
|
14960
|
-
!(!!p.measurements && Object.keys(p.measurements).length > 0) && (m ||
|
|
14967
|
+
const pA = p.heightCm || p.height || 0, $ = p.weightKg || p.weight || 0, eA = p.sizingUnit === "in" ? "in" : "cm", M = p.sizingUnit === "in" ? "lbs" : "kg", m = p.photoBase64;
|
|
14968
|
+
!(!!p.measurements && Object.keys(p.measurements).length > 0) && (m || pA > 0 && $ > 0) && (Hf((zA) => new Set(zA).add(p.id)), (m ? $f(m).catch(() => null) : Promise.resolve(null)).then((zA) => Yn({
|
|
14961
14969
|
apiUrl: P,
|
|
14962
|
-
height:
|
|
14970
|
+
height: pA > 0 ? pA : void 0,
|
|
14963
14971
|
weight: $ > 0 ? $ : void 0,
|
|
14964
|
-
heightUnit:
|
|
14972
|
+
heightUnit: eA,
|
|
14965
14973
|
weightUnit: M,
|
|
14966
14974
|
gender: p.gender,
|
|
14967
14975
|
age: p.age,
|
|
@@ -14969,13 +14977,13 @@ function XB({
|
|
|
14969
14977
|
midsectionProfile: p.midsectionProfile,
|
|
14970
14978
|
hipProfile: p.hipProfile,
|
|
14971
14979
|
bodyImage: m,
|
|
14972
|
-
bodyLandmarks:
|
|
14973
|
-
})).then((
|
|
14974
|
-
if (
|
|
14975
|
-
if (Gn(p.id,
|
|
14980
|
+
bodyLandmarks: zA ?? void 0
|
|
14981
|
+
})).then((zA) => {
|
|
14982
|
+
if (zA) {
|
|
14983
|
+
if (Gn(p.id, zA.estimates, zA.unit), zA.userEstimates) {
|
|
14976
14984
|
const Cf = Kf("profiles", []), Tf = Cf.findIndex((cf) => cf.id === p.id);
|
|
14977
14985
|
if (Tf >= 0) {
|
|
14978
|
-
const cf = Cf[Tf], IA =
|
|
14986
|
+
const cf = Cf[Tf], IA = zA.userEstimates, rf = { ...cf };
|
|
14979
14987
|
IA.height && !(cf.height || cf.heightCm) && (rf.height = IA.height, rf.heightCm = IA.height, rf.heightUnit = "cm"), IA.weight && !(cf.weight || cf.weightKg) && (rf.weight = IA.weight, rf.weightKg = IA.weight, rf.weightUnit = "kg"), IA.age && !cf.age && (rf.age = IA.age), Cf[Tf] = rf, lf("profiles", Cf);
|
|
14980
14988
|
}
|
|
14981
14989
|
}
|
|
@@ -14983,14 +14991,14 @@ function XB({
|
|
|
14983
14991
|
}
|
|
14984
14992
|
}).catch(() => {
|
|
14985
14993
|
}).finally(() => {
|
|
14986
|
-
Hf((
|
|
14987
|
-
const Cf = new Set(
|
|
14994
|
+
Hf((zA) => {
|
|
14995
|
+
const Cf = new Set(zA);
|
|
14988
14996
|
return Cf.delete(p.id), Cf;
|
|
14989
14997
|
});
|
|
14990
14998
|
}));
|
|
14991
14999
|
},
|
|
14992
15000
|
onDeleteProfile: (t) => {
|
|
14993
|
-
V((p) => p.filter((G) => G.id !== t)),
|
|
15001
|
+
V((p) => p.filter((G) => G.id !== t)), cA === t && nf(null), lf("profiles", Kf("profiles", []).filter((p) => p.id !== t));
|
|
14994
15002
|
},
|
|
14995
15003
|
onRequestDelete: (t) => ff(t),
|
|
14996
15004
|
onClose: () => a("body-profile"),
|
|
@@ -15028,7 +15036,7 @@ function XB({
|
|
|
15028
15036
|
}
|
|
15029
15037
|
),
|
|
15030
15038
|
h !== "idle" && typeof document < "u" && Vn(
|
|
15031
|
-
/* @__PURE__ */ A("div", { className: Ef("ps-tryon-overlay", z.overlay), style: oP, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ f("div", { className: Ef(`ps-tryon-modal${h === "result" &&
|
|
15039
|
+
/* @__PURE__ */ A("div", { className: Ef("ps-tryon-overlay", z.overlay), style: oP, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ f("div", { className: Ef(`ps-tryon-modal${h === "result" && PA && TA || h === "size-result" || h === "estimation-review" || h === "body-profile" || h === "profiles" ? " ps-tryon-modal-wide" : ""}`, z.modal), onClick: (t) => t.stopPropagation(), children: [
|
|
15032
15040
|
/* @__PURE__ */ f("div", { className: Ef("ps-tryon-header ps-tryon-header-minimal", z.header), children: [
|
|
15033
15041
|
/* @__PURE__ */ A(Pe, { activeLocale: S, onSelect: K }),
|
|
15034
15042
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: F("Profiles"), onClick: () => {
|
|
@@ -15039,7 +15047,7 @@ function XB({
|
|
|
15039
15047
|
}, children: /* @__PURE__ */ A(Ng, {}) }),
|
|
15040
15048
|
/* @__PURE__ */ A("button", { onClick: Sf, className: Ef("ps-tryon-close", z.closeButton), children: /* @__PURE__ */ A(NP, {}) })
|
|
15041
15049
|
] }),
|
|
15042
|
-
h !== "body-profile" && h !== "processing" && !(h === "size-result" &&
|
|
15050
|
+
h !== "body-profile" && h !== "processing" && !(h === "size-result" && gA?.sections && Object.keys(gA.sections).length > 1) && /* @__PURE__ */ A(ne, { view: h, stepIndex: Pg }),
|
|
15043
15051
|
/* @__PURE__ */ f("div", { ref: zf, className: Ef("ps-tryon-body", z.body), style: { position: "relative", overflow: j ? "hidden" : void 0 }, children: [
|
|
15044
15052
|
tg && /* @__PURE__ */ f("button", { className: "ps-tryon-back-btn", onClick: vg, children: [
|
|
15045
15053
|
/* @__PURE__ */ f("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -15069,7 +15077,7 @@ function XB({
|
|
|
15069
15077
|
{
|
|
15070
15078
|
onConfirm: () => {
|
|
15071
15079
|
const t = WA, p = Kf("profiles", []).filter((G) => G.id !== t);
|
|
15072
|
-
lf("profiles", p), V(p),
|
|
15080
|
+
lf("profiles", p), V(p), cA === t && nf(null), ff(null);
|
|
15073
15081
|
},
|
|
15074
15082
|
onCancel: () => ff(null),
|
|
15075
15083
|
t: F
|
|
@@ -15093,7 +15101,7 @@ function XB({
|
|
|
15093
15101
|
profileDetail: R,
|
|
15094
15102
|
setProfileDetail: u,
|
|
15095
15103
|
setProfiles: V,
|
|
15096
|
-
activeProfileId:
|
|
15104
|
+
activeProfileId: cA,
|
|
15097
15105
|
setActiveProfileId: nf,
|
|
15098
15106
|
t: F
|
|
15099
15107
|
}
|