@primestyleai/tryon 5.10.141 → 5.10.142
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 +178 -178
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +8 -8
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -9323,7 +9323,7 @@ function Ug({
|
|
|
9323
9323
|
], [I, u] = f({ w: 800, h: 1200 }), M = (s) => {
|
|
9324
9324
|
const m = s.currentTarget;
|
|
9325
9325
|
u({ w: m.naturalWidth || m.offsetWidth, h: m.naturalHeight || m.offsetHeight });
|
|
9326
|
-
}, L =
|
|
9326
|
+
}, L = 2e3, G = 400, v = QA(Date.now()), [l, R] = f(0);
|
|
9327
9327
|
xA(() => {
|
|
9328
9328
|
const s = (L - G) / Math.max(1, C.length - 1), m = setInterval(() => {
|
|
9329
9329
|
const E = Date.now() - v.current, F = Math.min(C.length - 1, Math.floor(E / s));
|
|
@@ -9860,7 +9860,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9860
9860
|
const V = G.x1 * w, s = G.x2 * w, m = G.y * r, E = s - V, F = E * 0.06, O = (V + s) / 2, T = g.find((VA) => {
|
|
9861
9861
|
const HA = VA.area.toLowerCase().trim();
|
|
9862
9862
|
return !!(HA === L || L === "chest" && (HA.includes("bust") || HA.includes("chest")) || L === "waist" && HA.includes("waist") || L === "hips" && (HA.includes("hip") || HA === "hips"));
|
|
9863
|
-
}), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${m} Q ${O} ${m + F} ${s} ${m}`, LA = E * 1.05, h = T ? T.fit === "good" ? "✓ Fit" : T.isLength ? T.fit.includes("short") || T.fit.includes("tight") ? "Short" : "Long" : T.fit.includes("tight") ? "Tight" : "Loose" : v,
|
|
9863
|
+
}), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${m} Q ${O} ${m + F} ${s} ${m}`, LA = E * 1.05, h = T ? T.fit === "good" ? "✓ Fit" : T.isLength ? T.fit.includes("short") || T.fit.includes("tight") ? "Short" : "Long" : T.fit.includes("tight") ? "Tight" : "Loose" : v, oA = Math.max(14, Math.round(22 * M)), N = h.length * oA * 0.62, S = w - s - 12 * M < N, nA = S ? V - 10 * M : s + 10 * M, MA = S ? "end" : "start", iA = S ? V : s, YA = S ? V - 6 * M : s + 6 * M;
|
|
9864
9864
|
return /* @__PURE__ */ e("g", { children: [
|
|
9865
9865
|
/* @__PURE__ */ A(
|
|
9866
9866
|
"path",
|
|
@@ -9915,7 +9915,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9915
9915
|
x: nA,
|
|
9916
9916
|
y: m + 1 * M,
|
|
9917
9917
|
fill: aA,
|
|
9918
|
-
fontSize:
|
|
9918
|
+
fontSize: oA,
|
|
9919
9919
|
fontWeight: "700",
|
|
9920
9920
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
9921
9921
|
dominantBaseline: "middle",
|
|
@@ -9995,34 +9995,34 @@ function _o({
|
|
|
9995
9995
|
sectionFound: F,
|
|
9996
9996
|
allSizes: O
|
|
9997
9997
|
}) {
|
|
9998
|
-
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in",
|
|
9999
|
-
const
|
|
10000
|
-
return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(
|
|
9998
|
+
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in", oA = c || h, N = (y) => Ct(y, oA, h), vA = (y) => li(y, oA, h), S = (y) => {
|
|
9999
|
+
const gA = vA(y);
|
|
10000
|
+
return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(gA.trim()) ? `${gA} ${a}` : gA;
|
|
10001
10001
|
}, nA = s ? Object.keys(s) : [], [MA, iA] = f(null), YA = n?.secResult?.recommendedSize || "", [VA, HA] = f(null), pe = He(() => {
|
|
10002
10002
|
if (!n) return [];
|
|
10003
|
-
const y = n.section,
|
|
10003
|
+
const y = n.section, gA = y.headers.findIndex((qA) => /size|taglia|größe|taille/i.test(qA.trim())), CA = gA >= 0 ? gA : 0, J = y.headers[CA] || "Size", fA = y.rows.map((qA) => Te(qA, CA, J)).filter(Boolean);
|
|
10004
10004
|
return [...new Set(fA)];
|
|
10005
10005
|
}, [n]), _A = He(() => ({}), []), yA = He(() => {
|
|
10006
|
-
const y = g.headers.findIndex((
|
|
10006
|
+
const y = g.headers.findIndex((gA) => /size|taglia|größe|taille/i.test(gA.trim()));
|
|
10007
10007
|
if (y >= 0) return y;
|
|
10008
|
-
for (let
|
|
10009
|
-
const CA = g.headers[
|
|
10010
|
-
if (g.rows.some((J) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Te(J,
|
|
10008
|
+
for (let gA = 0; gA < g.headers.length; gA++) {
|
|
10009
|
+
const CA = g.headers[gA];
|
|
10010
|
+
if (g.rows.some((J) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Te(J, gA, CA)))) return gA;
|
|
10011
10011
|
}
|
|
10012
10012
|
return 0;
|
|
10013
10013
|
}, [g]), oe = g.headers[yA] || "Size", SA = He(() => {
|
|
10014
|
-
const y = g.rows.map((
|
|
10014
|
+
const y = g.rows.map((gA) => Te(gA, yA, oe)).filter(Boolean);
|
|
10015
10015
|
return [...new Set(y)];
|
|
10016
10016
|
}, [g, yA, oe]), Ce = aA || T, mA = Ce === T;
|
|
10017
10017
|
He(() => {
|
|
10018
10018
|
if (mA) return null;
|
|
10019
|
-
const y = t?.matchDetails ?? [],
|
|
10019
|
+
const y = t?.matchDetails ?? [], gA = /tight|loose|large|small|very/i, CA = y.some((J) => gA.test(J.fit || ""));
|
|
10020
10020
|
return r(CA ? "Not Recommended" : "Your Selection");
|
|
10021
10021
|
}, [mA, t, r]);
|
|
10022
10022
|
const Ie = MA && mA && s && s[MA] ? s[MA] : Ce, Z = He(() => {
|
|
10023
10023
|
const y = [];
|
|
10024
|
-
for (let
|
|
10025
|
-
const CA = (g.headers[
|
|
10024
|
+
for (let gA = 0; gA < g.headers.length; gA++) {
|
|
10025
|
+
const CA = (g.headers[gA] || "").toLowerCase();
|
|
10026
10026
|
if (/\(cm\)|centimeter/i.test(CA)) {
|
|
10027
10027
|
y.push("cm");
|
|
10028
10028
|
continue;
|
|
@@ -10033,7 +10033,7 @@ function _o({
|
|
|
10033
10033
|
}
|
|
10034
10034
|
let J = null;
|
|
10035
10035
|
for (const fA of g.rows) {
|
|
10036
|
-
const qA = String(Te(fA,
|
|
10036
|
+
const qA = String(Te(fA, gA, g.headers[gA]) || "").trim();
|
|
10037
10037
|
if (qA) {
|
|
10038
10038
|
if (/cm\b|centimeter/i.test(qA)) {
|
|
10039
10039
|
J = "cm";
|
|
@@ -10048,7 +10048,7 @@ function _o({
|
|
|
10048
10048
|
y.push(J);
|
|
10049
10049
|
}
|
|
10050
10050
|
return y;
|
|
10051
|
-
}, [g]), me = bA((y,
|
|
10051
|
+
}, [g]), me = bA((y, gA) => {
|
|
10052
10052
|
const CA = y.toLowerCase().trim(), J = a === "cm" || a === "", fA = J ? "cm" : "in", qA = [];
|
|
10053
10053
|
for (let q = 0; q < g.headers.length; q++) {
|
|
10054
10054
|
const kA = (g.headers[q] || "").toLowerCase().trim();
|
|
@@ -10062,8 +10062,8 @@ function _o({
|
|
|
10062
10062
|
if (qA.length === 0) return null;
|
|
10063
10063
|
let TA = qA.find((q) => Z[q] === fA);
|
|
10064
10064
|
TA == null && (TA = qA[0]);
|
|
10065
|
-
const ve = g.headers[TA], GA =
|
|
10066
|
-
let OA = g.rows.find((q) => Te(q, yA, oe) ===
|
|
10065
|
+
const ve = g.headers[TA], GA = gA.trim().toLowerCase();
|
|
10066
|
+
let OA = g.rows.find((q) => Te(q, yA, oe) === gA);
|
|
10067
10067
|
if (OA || (OA = g.rows.find((q) => Te(q, yA, oe).trim().toLowerCase() === GA)), OA || (OA = g.rows.find((q) => {
|
|
10068
10068
|
const kA = Te(q, yA, oe).trim().toLowerCase();
|
|
10069
10069
|
return kA.startsWith(GA) || GA.startsWith(kA);
|
|
@@ -10113,7 +10113,7 @@ function _o({
|
|
|
10113
10113
|
isLength: !1
|
|
10114
10114
|
};
|
|
10115
10115
|
});
|
|
10116
|
-
const y = t?.matchDetails || [],
|
|
10116
|
+
const y = t?.matchDetails || [], gA = n?.secResult?.matchDetails || [], CA = /* @__PURE__ */ new Set(), J = [...y, ...gA].filter((P) => {
|
|
10117
10117
|
const q = String(P?.measurement ?? "").toLowerCase().trim();
|
|
10118
10118
|
return !q || CA.has(q) ? !1 : (CA.add(q), !0);
|
|
10119
10119
|
}), fA = t?.length || "", qA = (t?.availableLengths?.length || 0) > 0, TA = YA || fA, ve = !!(n || qA), GA = J.some((P) => P.measurement.toLowerCase() === "height"), OA = !!n?.section?.headers?.some((P) => /height|altezza|estatura|\(cm\)/i.test(P));
|
|
@@ -10135,7 +10135,7 @@ function _o({
|
|
|
10135
10135
|
});
|
|
10136
10136
|
}
|
|
10137
10137
|
if (!J.length) return [];
|
|
10138
|
-
const ie = new Set(
|
|
10138
|
+
const ie = new Set(gA.map((P) => P.measurement));
|
|
10139
10139
|
ve && ie.add("Height");
|
|
10140
10140
|
const XA = VA || TA;
|
|
10141
10141
|
return J.map((P) => {
|
|
@@ -10160,23 +10160,23 @@ function _o({
|
|
|
10160
10160
|
});
|
|
10161
10161
|
}, [t, n, i, E, O, Ce, VA]), Ye = fe.filter(
|
|
10162
10162
|
(y) => y.fit === "good" || y.fit === "a-bit-tight" || y.fit === "a-bit-loose"
|
|
10163
|
-
).length, ne = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, de = !E,
|
|
10163
|
+
).length, ne = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, de = !E, dA = t, ge = dA?.size || T, jA = (t?.matchDetails || []).find(
|
|
10164
10164
|
(y) => /inseam|length/i.test(y.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(y.measurement)
|
|
10165
|
-
), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA =
|
|
10165
|
+
), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA = dA?.length || YA || H, he = dA?.availableSizes || [], Oe = dA?.availableLengths || [], JA = VA || zA, ke = O ? Object.keys(O) : [], De = ke.length > 0 ? ke : he.length > 0 ? he : SA, BA = (() => {
|
|
10166
10166
|
if (De.length <= 3) return De;
|
|
10167
10167
|
const y = De.indexOf(T);
|
|
10168
10168
|
if (y < 0) return De.slice(0, 3);
|
|
10169
|
-
const
|
|
10170
|
-
return De.slice(
|
|
10169
|
+
const gA = Math.max(0, Math.min(De.length - 3, y - 1));
|
|
10170
|
+
return De.slice(gA, gA + 3);
|
|
10171
10171
|
})(), RA = Oe.length > 0 ? Oe : pe, FA = (() => {
|
|
10172
10172
|
if (RA.length <= 3) return RA;
|
|
10173
10173
|
const y = RA.indexOf(zA);
|
|
10174
10174
|
if (y < 0) return RA.slice(0, 3);
|
|
10175
|
-
const
|
|
10176
|
-
return RA.slice(
|
|
10175
|
+
const gA = Math.max(0, Math.min(RA.length - 3, y - 1));
|
|
10176
|
+
return RA.slice(gA, gA + 3);
|
|
10177
10177
|
})();
|
|
10178
10178
|
if (C) {
|
|
10179
|
-
const y = o.replace(/\s*[—–-]\s*.*/g, ""),
|
|
10179
|
+
const y = o.replace(/\s*[—–-]\s*.*/g, ""), gA = (J) => {
|
|
10180
10180
|
const fA = J.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10181
10181
|
return fA.includes("chest") || fA.includes("bust") ? r("Full circumference at the widest point.") : fA.includes("waist") ? r("Circumference at the natural waistline.") : fA.includes("hip") ? r("Circumference at the fullest point.") : fA.includes("shoulder") ? r("Shoulder edge to shoulder edge.") : fA.includes("sleeve") || fA.includes("arm") ? r("Shoulder seam to cuff edge.") : fA.includes("neck") || fA.includes("collar") ? r("Around the base of the neck.") : fA.includes("inseam") || fA.includes("inside leg") ? r("Inner leg seam length.") : fA.includes("thigh") ? r("Circumference around the upper leg.") : fA.includes("length") || fA.includes("height") ? r("Top to bottom length.") : "";
|
|
10182
10182
|
}, CA = (J, fA) => fA && J === "good" ? r("EDITORIAL LENGTH") : J === "good" ? r("PERFECT TENSION") : J === "a-bit-tight" ? r("SLIGHTLY TIGHT") : J === "a-bit-loose" ? r("SLIGHT EASE") : J.includes("tight") ? r("TIGHT") : J.includes("loose") ? r("LOOSE") : r("FIT");
|
|
@@ -10312,7 +10312,7 @@ function _o({
|
|
|
10312
10312
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: r("MEASUREMENT BLUEPRINT") }),
|
|
10313
10313
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
10314
10314
|
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fe.map((J, fA) => {
|
|
10315
|
-
const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve =
|
|
10315
|
+
const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve = gA(J.area), GA = String(fA + 1).padStart(2, "0");
|
|
10316
10316
|
return /* @__PURE__ */ e("div", { className: "ps-msd-row", children: [
|
|
10317
10317
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-num", children: [
|
|
10318
10318
|
GA,
|
|
@@ -10526,7 +10526,7 @@ function _o({
|
|
|
10526
10526
|
return /* @__PURE__ */ A("span", { style: { fontSize: y ? "1.6vw" : "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: Ie });
|
|
10527
10527
|
})(),
|
|
10528
10528
|
JA && !Ie.includes(" / ") && (() => {
|
|
10529
|
-
const y = /^\d+(\.\d+)?$/.test(String(JA).trim()),
|
|
10529
|
+
const y = /^\d+(\.\d+)?$/.test(String(JA).trim()), gA = (o || "").toLowerCase(), CA = y ? /pant|trouser|inseam/.test(gA) ? r("Inseam") : r("Length") : null;
|
|
10530
10530
|
return /* @__PURE__ */ e("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
|
|
10531
10531
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
|
|
10532
10532
|
CA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: CA }),
|
|
@@ -10558,14 +10558,14 @@ function _o({
|
|
|
10558
10558
|
/* @__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: r("Garment Spec") }),
|
|
10559
10559
|
/* @__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: r("Fit Result") })
|
|
10560
10560
|
] }) }),
|
|
10561
|
-
/* @__PURE__ */ A("tbody", { children: fe.map((y,
|
|
10561
|
+
/* @__PURE__ */ A("tbody", { children: fe.map((y, gA) => {
|
|
10562
10562
|
const CA = y.fit === "good" ? "#2154EF" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "#dc2626" : "#d97706" : y.fit.includes("tight") ? "#dc2626" : "#d97706", J = y.fit === "good" ? "rgba(33,84,239,0.08)" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
10563
|
-
return /* @__PURE__ */ e("tr", { style: { borderBottom:
|
|
10563
|
+
return /* @__PURE__ */ e("tr", { style: { borderBottom: gA < fe.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
10564
10564
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: y.area }),
|
|
10565
10565
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawUserValue || "" : isNaN(y.userNum) || y.userNum === 0 ? "" : `${N(y.userNum)} ${a}` }),
|
|
10566
10566
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawChartRange || "" : S(y.chartLabel) }),
|
|
10567
10567
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: CA, background: J, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: y.isLength ? Jg(y.fit, r) : wi(y.fit, r) }) })
|
|
10568
|
-
] },
|
|
10568
|
+
] }, gA);
|
|
10569
10569
|
}) })
|
|
10570
10570
|
] }) }),
|
|
10571
10571
|
BA.length > 1 && /* @__PURE__ */ e("div", { style: { marginBottom: "0.8vw" }, children: [
|
|
@@ -10577,7 +10577,7 @@ function _o({
|
|
|
10577
10577
|
r("Size")
|
|
10578
10578
|
] }),
|
|
10579
10579
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: BA.map((y) => {
|
|
10580
|
-
const
|
|
10580
|
+
const gA = y === Ce;
|
|
10581
10581
|
return /* @__PURE__ */ A(
|
|
10582
10582
|
"button",
|
|
10583
10583
|
{
|
|
@@ -10587,9 +10587,9 @@ function _o({
|
|
|
10587
10587
|
borderRadius: "0.35vw",
|
|
10588
10588
|
fontSize: "0.7vw",
|
|
10589
10589
|
fontWeight: 600,
|
|
10590
|
-
border:
|
|
10591
|
-
background:
|
|
10592
|
-
color:
|
|
10590
|
+
border: gA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
|
|
10591
|
+
background: gA ? "var(--ps-accent)" : "transparent",
|
|
10592
|
+
color: gA ? "white" : "var(--ps-text-primary)",
|
|
10593
10593
|
cursor: "pointer",
|
|
10594
10594
|
transition: "all 0.2s",
|
|
10595
10595
|
fontFamily: "inherit",
|
|
@@ -10605,7 +10605,7 @@ function _o({
|
|
|
10605
10605
|
FA.length > 0 && /* @__PURE__ */ e("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
|
|
10606
10606
|
/* @__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: r("Length Adjustment") }),
|
|
10607
10607
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: FA.map((y) => {
|
|
10608
|
-
const
|
|
10608
|
+
const gA = String(JA ?? "").trim() === String(y ?? "").trim(), CA = _A[String(y).trim()];
|
|
10609
10609
|
return /* @__PURE__ */ e(
|
|
10610
10610
|
"button",
|
|
10611
10611
|
{
|
|
@@ -10615,9 +10615,9 @@ function _o({
|
|
|
10615
10615
|
borderRadius: "0.35vw",
|
|
10616
10616
|
fontSize: "0.7vw",
|
|
10617
10617
|
fontWeight: 600,
|
|
10618
|
-
border:
|
|
10619
|
-
background:
|
|
10620
|
-
color:
|
|
10618
|
+
border: gA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
|
|
10619
|
+
background: gA ? "var(--ps-accent)" : "transparent",
|
|
10620
|
+
color: gA ? "white" : "var(--ps-text-primary)",
|
|
10621
10621
|
cursor: "pointer",
|
|
10622
10622
|
transition: "all 0.2s",
|
|
10623
10623
|
fontFamily: "inherit",
|
|
@@ -10739,7 +10739,7 @@ function pi({
|
|
|
10739
10739
|
tryOnAvailable: LA = !0,
|
|
10740
10740
|
t: h
|
|
10741
10741
|
}) {
|
|
10742
|
-
const
|
|
10742
|
+
const oA = (g?.unit || p || "").toString().toLowerCase(), N = oA === "mm" ? "mm" : oA === "cm" ? "cm" : "in", vA = h(N === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, nA] = f({}), MA = dt, iA = bA((x, b, k) => Te(x, b, k), []), YA = He(() => {
|
|
10743
10743
|
if (!t?.headers || !t?.rows) return -1;
|
|
10744
10744
|
const x = t.headers.findIndex((b) => /size|taglia|größe|taille/i.test(b.trim()));
|
|
10745
10745
|
if (x >= 0) return x;
|
|
@@ -10811,7 +10811,7 @@ function pi({
|
|
|
10811
10811
|
return { range: Ee, ...KA };
|
|
10812
10812
|
}, [t, YA, VA, vA, iA, MA, HA]), _A = g?.recommendedSize || "";
|
|
10813
10813
|
He(() => g?.internationalSizes || {}, [g]);
|
|
10814
|
-
const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [
|
|
10814
|
+
const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [dA, ge] = f(!1), [jA, H] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = bA((x) => {
|
|
10815
10815
|
const b = x.currentTarget;
|
|
10816
10816
|
b.naturalWidth && b.naturalHeight && H({ w: b.naturalWidth, h: b.naturalHeight });
|
|
10817
10817
|
}, []);
|
|
@@ -10828,7 +10828,7 @@ function pi({
|
|
|
10828
10828
|
}, [i, v]);
|
|
10829
10829
|
const [Oe, JA] = f(!1), [ke, De] = f(!1);
|
|
10830
10830
|
QA(null);
|
|
10831
|
-
const [BA, RA] = f(!1), [FA, y] = f(null), [
|
|
10831
|
+
const [BA, RA] = f(!1), [FA, y] = f(null), [gA, CA] = f(!1), J = QA(null), [fA, qA] = f(null), [TA, ve] = f(!1);
|
|
10832
10832
|
xA(() => {
|
|
10833
10833
|
if (FA) {
|
|
10834
10834
|
const x = URL.createObjectURL(FA);
|
|
@@ -11052,7 +11052,7 @@ function pi({
|
|
|
11052
11052
|
overlayNode: v ? /* @__PURE__ */ e(_, { children: [
|
|
11053
11053
|
/* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
|
|
11054
11054
|
/* @__PURE__ */ A($o, { active: !0 })
|
|
11055
|
-
] }) : i &&
|
|
11055
|
+
] }) : i && dA && ne ? /* @__PURE__ */ A(
|
|
11056
11056
|
zo,
|
|
11057
11057
|
{
|
|
11058
11058
|
lines: ne,
|
|
@@ -11146,7 +11146,7 @@ function pi({
|
|
|
11146
11146
|
showLines: Z,
|
|
11147
11147
|
onToggleLines: PA ? void 0 : () => me(!Z),
|
|
11148
11148
|
onImageLoad: he,
|
|
11149
|
-
overlayNode: i &&
|
|
11149
|
+
overlayNode: i && dA && ne ? /* @__PURE__ */ A(
|
|
11150
11150
|
zo,
|
|
11151
11151
|
{
|
|
11152
11152
|
lines: ne,
|
|
@@ -11176,7 +11176,7 @@ function pi({
|
|
|
11176
11176
|
/* @__PURE__ */ A("img", { src: v && u ? u : i || a, alt: n, className: "ps-tryon-v2-bg-img", onLoad: he }),
|
|
11177
11177
|
v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
|
|
11178
11178
|
/* @__PURE__ */ A($o, { active: !!v }),
|
|
11179
|
-
i && !v &&
|
|
11179
|
+
i && !v && dA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (() => {
|
|
11180
11180
|
const x = [...g?.matchDetails || []];
|
|
11181
11181
|
if (g?.sections)
|
|
11182
11182
|
for (const k of Object.values(g.sections))
|
|
@@ -11330,7 +11330,7 @@ function pi({
|
|
|
11330
11330
|
showLines: Z,
|
|
11331
11331
|
onToggleLines: PA ? void 0 : () => me(!Z),
|
|
11332
11332
|
onImageLoad: he,
|
|
11333
|
-
overlayNode: i &&
|
|
11333
|
+
overlayNode: i && dA && ne ? /* @__PURE__ */ A(
|
|
11334
11334
|
zo,
|
|
11335
11335
|
{
|
|
11336
11336
|
lines: ne,
|
|
@@ -11356,7 +11356,7 @@ function pi({
|
|
|
11356
11356
|
),
|
|
11357
11357
|
v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
|
|
11358
11358
|
/* @__PURE__ */ A($o, { active: !!v }),
|
|
11359
|
-
i && !v &&
|
|
11359
|
+
i && !v && dA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (g?.matchDetails || []).map(($) => ({ area: $.measurement, userNum: parseFloat($.userValue) || 0, chartLabel: $.chartRange || "", fit: $.fit })), show: Z, imgWidth: jA.w, imgHeight: jA.h }),
|
|
11360
11360
|
i && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
11361
11361
|
!PA && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => me(!Z), children: h(Z ? "Hide Fit" : "Show Fit") }),
|
|
11362
11362
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: C, children: h("Download") })
|
|
@@ -12469,7 +12469,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12469
12469
|
xA(() => {
|
|
12470
12470
|
v.current && (v.current.scrollTop = 0);
|
|
12471
12471
|
}, [w, p]);
|
|
12472
|
-
const [l, R] = f(""), [V, s] = f("male"), [m, E] = f("cm"), [F, O] = f(""), [T, aA] = f(""), [X, UA] = f(""), [LA, h] = f(""), [
|
|
12472
|
+
const [l, R] = f(""), [V, s] = f("male"), [m, E] = f("cm"), [F, O] = f(""), [T, aA] = f(""), [X, UA] = f(""), [LA, h] = f(""), [oA, N] = f(""), [vA, S] = f(""), [nA, MA] = f(null), [iA, YA] = f(!1), [VA, HA] = f(""), [pe, _A] = f(null), [yA, oe] = f(null), [SA, Ce] = f({ w: 800, h: 1200 }), [mA, Ie] = f(0), [Z, me] = f(!1), [fe, Ye] = f(!1);
|
|
12473
12473
|
xA(() => {
|
|
12474
12474
|
if (C !== "calculating" || !nA) return;
|
|
12475
12475
|
let D = !1;
|
|
@@ -12484,7 +12484,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12484
12484
|
const D = setInterval(() => Ie((W) => W + 1), 1500);
|
|
12485
12485
|
return () => clearInterval(D);
|
|
12486
12486
|
}, [C, u]);
|
|
12487
|
-
const ne = QA(null), de = QA(null), [
|
|
12487
|
+
const ne = QA(null), de = QA(null), [dA, ge] = f(!1), [jA, H] = f(null), zA = () => {
|
|
12488
12488
|
jA === !0 && ne.current?.click();
|
|
12489
12489
|
}, he = async (D) => {
|
|
12490
12490
|
const W = D.target.files?.[0];
|
|
@@ -12519,7 +12519,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12519
12519
|
}
|
|
12520
12520
|
}, Oe = () => {
|
|
12521
12521
|
MA(null), a?.(null), ne.current && (ne.current.value = "");
|
|
12522
|
-
}, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y,
|
|
12522
|
+
}, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y, gA] = f(null), [CA, J] = f(null), [fA, qA] = f(null), [TA, ve] = f("US"), [GA, OA] = f(null), ie = QA(null);
|
|
12523
12523
|
xA(() => {
|
|
12524
12524
|
if (!GA) return;
|
|
12525
12525
|
const D = (W) => {
|
|
@@ -12556,10 +12556,10 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12556
12556
|
const W = parseFloat(LA);
|
|
12557
12557
|
if (!W || W <= 0)
|
|
12558
12558
|
return S(n("Please enter a valid weight")), !1;
|
|
12559
|
-
const hA = parseFloat(
|
|
12559
|
+
const hA = parseFloat(oA);
|
|
12560
12560
|
return !hA || hA <= 0 ? (S(n("Please enter a valid age")), !1) : q && (!CA || !fA) ? (S(n("Please select your bra band and cup size")), !1) : (S(""), !0);
|
|
12561
12561
|
}, se = () => l.trim() ? (S(""), !0) : (S(n("Please enter a profile name")), !1), Pe = () => {
|
|
12562
|
-
const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(
|
|
12562
|
+
const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(oA);
|
|
12563
12563
|
return {
|
|
12564
12564
|
name: l.trim(),
|
|
12565
12565
|
gender: V,
|
|
@@ -12578,7 +12578,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12578
12578
|
cupSize: q && fA || void 0
|
|
12579
12579
|
};
|
|
12580
12580
|
}, x = () => {
|
|
12581
|
-
const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(LA), hA = parseFloat(
|
|
12581
|
+
const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(LA), hA = parseFloat(oA);
|
|
12582
12582
|
return {
|
|
12583
12583
|
name: l.trim(),
|
|
12584
12584
|
gender: V,
|
|
@@ -12622,7 +12622,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12622
12622
|
Q(Qe[cA + 1]);
|
|
12623
12623
|
}
|
|
12624
12624
|
}, k = (D, W) => {
|
|
12625
|
-
S(""), D === "chest" ? ke(W) : D === "stomach" ? BA(W) : D === "seat" ? FA(W) : D === "hips" &&
|
|
12625
|
+
S(""), D === "chest" ? ke(W) : D === "stomach" ? BA(W) : D === "seat" ? FA(W) : D === "hips" && gA(W);
|
|
12626
12626
|
const hA = Qe.indexOf(D), uA = hA === ae - 1;
|
|
12627
12627
|
setTimeout(() => {
|
|
12628
12628
|
if (uA) {
|
|
@@ -12667,7 +12667,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12667
12667
|
return;
|
|
12668
12668
|
}
|
|
12669
12669
|
if (S(""), I("calculating"), M(!0), c && nA) {
|
|
12670
|
-
const hA = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), uA = parseFloat(
|
|
12670
|
+
const hA = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), uA = parseFloat(oA);
|
|
12671
12671
|
try {
|
|
12672
12672
|
const ee = await c({
|
|
12673
12673
|
photoBase64: nA,
|
|
@@ -12880,7 +12880,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12880
12880
|
type: "number",
|
|
12881
12881
|
inputMode: "numeric",
|
|
12882
12882
|
className: "ps-bp-inline-input",
|
|
12883
|
-
value:
|
|
12883
|
+
value: oA,
|
|
12884
12884
|
placeholder: n("e.g. 30"),
|
|
12885
12885
|
onChange: (D) => {
|
|
12886
12886
|
N(D.target.value), S("");
|
|
@@ -13362,7 +13362,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13362
13362
|
/* @__PURE__ */ A("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ e("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
13363
13363
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13364
13364
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("NAME") }),
|
|
13365
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: de, type: "text", className: `ps-bp-inline-input${
|
|
13365
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: de, type: "text", className: `ps-bp-inline-input${dA ? " ps-cpw-shake" : ""}`, value: l, placeholder: n("e.g. My Photo Profile"), onChange: (D) => {
|
|
13366
13366
|
R(D.target.value), S("");
|
|
13367
13367
|
}, onAnimationEnd: () => ge(!1) }) })
|
|
13368
13368
|
] }),
|
|
@@ -13596,7 +13596,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13596
13596
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13597
13597
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("AGE") }),
|
|
13598
13598
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13599
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
13599
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: oA, placeholder: n("e.g. 30"), onChange: (D) => {
|
|
13600
13600
|
N(D.target.value), S("");
|
|
13601
13601
|
} }),
|
|
13602
13602
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: n("years") })
|
|
@@ -14242,14 +14242,14 @@ function gr({
|
|
|
14242
14242
|
error: E,
|
|
14243
14243
|
t: F
|
|
14244
14244
|
}) {
|
|
14245
|
-
const O = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), LA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66,
|
|
14245
|
+
const O = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), LA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, N = 120, vA = 220, S = 48, nA = 84, MA = 13, iA = 100, YA = (O - N) / (vA - N) * 100, VA = (T - S) / (nA - S) * 100, HA = (UA - h) / (oA - h) * 100, pe = (LA - MA) / (iA - MA) * 100, _A = (Z) => {
|
|
14246
14246
|
const me = Math.max(S, Math.min(nA, Z));
|
|
14247
14247
|
n(String(Math.floor(me / 12))), r(String(me % 12));
|
|
14248
14248
|
}, yA = () => {
|
|
14249
14249
|
o === "in" ? _A(T + 1) : a(String(Math.min(vA, O + 1)));
|
|
14250
14250
|
}, oe = () => {
|
|
14251
14251
|
o === "in" ? _A(T - 1) : a(String(Math.max(N, O - 1)));
|
|
14252
|
-
}, SA = () => Q(String(Math.min(
|
|
14252
|
+
}, SA = () => Q(String(Math.min(oA, UA + 1))), Ce = () => Q(String(Math.max(h, UA - 1))), mA = () => I(String(Math.min(iA, LA + 1))), Ie = () => I(String(Math.max(MA, LA - 1)));
|
|
14253
14253
|
return /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
|
|
14254
14254
|
/* @__PURE__ */ e("div", { className: "ps-bpm-header", children: [
|
|
14255
14255
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
|
|
@@ -14337,7 +14337,7 @@ function gr({
|
|
|
14337
14337
|
type: "range",
|
|
14338
14338
|
className: "ps-bpm-slider",
|
|
14339
14339
|
min: h,
|
|
14340
|
-
max:
|
|
14340
|
+
max: oA,
|
|
14341
14341
|
step: 1,
|
|
14342
14342
|
value: UA,
|
|
14343
14343
|
onChange: (Z) => Q(Z.target.value),
|
|
@@ -14860,71 +14860,71 @@ function pr({
|
|
|
14860
14860
|
}) {
|
|
14861
14861
|
const m = t ? cr : Br, [E, F] = f("photo");
|
|
14862
14862
|
E === "photo" || m.indexOf(E);
|
|
14863
|
-
const O = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, LA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit,
|
|
14863
|
+
const O = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, LA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, oA = aA != null && LA === "cm" ? String(Math.round(aA)) : aA != null && (LA === "in" || LA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", N = aA != null && (LA === "in" || LA === "ft") ? Math.round(aA) : aA != null && LA === "cm" ? Math.round(aA / 2.54) : null, vA = N != null ? String(Math.floor(N / 12)) : i.current.heightFeet || "", S = N != null ? String(N % 12) : i.current.heightInches || "", nA = X != null ? String(Math.round(X)) : i.current.weight || "", MA = UA != null ? String(UA) : i.current.age || "", [iA, YA] = f(oA), [VA, HA] = f(vA), [pe, _A] = f(S), [yA, oe] = f(nA), [SA, Ce] = f(MA), [mA, Ie] = f(
|
|
14864
14864
|
LA || (c === "ft" ? "in" : c || (T ? "in" : "cm"))
|
|
14865
14865
|
), [Z, me] = f(
|
|
14866
14866
|
h || w || (T ? "lbs" : "kg")
|
|
14867
|
-
), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de,
|
|
14867
|
+
), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de, dA] = f(null), [ge, jA] = f(null), [H, zA] = f(!1), [he, Oe] = f(""), [JA, ke] = f(null), [De, BA] = f(!1), RA = QA(null), [FA, y] = f(null), [gA, CA] = f(!1), [J, fA] = f(!1), [qA, TA] = f(() => N != null ? String(Math.round(N * 2.54)) : oA), [ve, GA] = f(null), [OA, ie] = f(null), [XA, P] = f(null), [q, kA] = f(null), [Qe, cA] = f(""), [ae, xe] = f(null), [re, Ae] = f(null), [PA, se] = f(() => ["US", "UK", "AU"].includes(a) ? a === "AU" ? "UK" : a : ["FR", "ES"].includes(a) ? "FR" : ["IT"].includes(a) ? "IT" : ["JP", "CN", "KR"].includes(a) ? "JP" : "EU"), [Pe, x] = f(!1), [b, k] = f(null), K = QA(null);
|
|
14868
14868
|
xA(() => {
|
|
14869
14869
|
if (!b) return;
|
|
14870
|
-
const U = (
|
|
14870
|
+
const U = (pA) => {
|
|
14871
14871
|
const le = K.current;
|
|
14872
|
-
le && !le.contains(
|
|
14872
|
+
le && !le.contains(pA.target) && k(null);
|
|
14873
14873
|
};
|
|
14874
14874
|
return document.addEventListener("mousedown", U), () => document.removeEventListener("mousedown", U);
|
|
14875
14875
|
}, [b]);
|
|
14876
14876
|
const EA = go[PA] || go.US, [$, lA] = f(""), IA = bA(async (U) => {
|
|
14877
|
-
const
|
|
14878
|
-
if (!
|
|
14877
|
+
const pA = U.target.files?.[0];
|
|
14878
|
+
if (!pA) return;
|
|
14879
14879
|
if (FA !== !0) {
|
|
14880
14880
|
lA(s("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
14881
14881
|
return;
|
|
14882
14882
|
}
|
|
14883
|
-
if (!
|
|
14883
|
+
if (!pA.type.startsWith("image/")) {
|
|
14884
14884
|
lA(s("Please upload an image file"));
|
|
14885
14885
|
return;
|
|
14886
14886
|
}
|
|
14887
|
-
if (
|
|
14887
|
+
if (pA.size > 10 * 1024 * 1024) {
|
|
14888
14888
|
lA(s("Image must be under 10MB"));
|
|
14889
14889
|
return;
|
|
14890
14890
|
}
|
|
14891
|
-
lA(""), zA(!0), Oe(s("Analyzing photo…")), ne(
|
|
14892
|
-
const le = URL.createObjectURL(
|
|
14893
|
-
|
|
14891
|
+
lA(""), zA(!0), Oe(s("Analyzing photo…")), ne(pA);
|
|
14892
|
+
const le = URL.createObjectURL(pA);
|
|
14893
|
+
dA(le);
|
|
14894
14894
|
try {
|
|
14895
|
-
const be = C && I ? tg(
|
|
14895
|
+
const be = C && I ? tg(pA, C, I) : Promise.resolve({ isAdult: !0, confidence: "low" }), eo = uo(pA, { maxDimension: 1024, quality: 0.85 }), Ve = await be;
|
|
14896
14896
|
if (!Ve.isAdult) {
|
|
14897
14897
|
const qe = Ve.reasoning?.trim() || s("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
14898
|
-
ke(qe),
|
|
14898
|
+
ke(qe), dA(null), ne(null);
|
|
14899
14899
|
return;
|
|
14900
14900
|
}
|
|
14901
14901
|
const eA = await eo;
|
|
14902
14902
|
jA(eA), ke(null);
|
|
14903
14903
|
} catch {
|
|
14904
|
-
lA(s("Failed to process image")),
|
|
14904
|
+
lA(s("Failed to process image")), dA(null);
|
|
14905
14905
|
} finally {
|
|
14906
14906
|
zA(!1), Oe("");
|
|
14907
14907
|
}
|
|
14908
14908
|
}, [s, FA]), Be = QA(null), Ee = bA(() => {
|
|
14909
|
-
de && !De && URL.revokeObjectURL(de), ne(null),
|
|
14909
|
+
de && !De && URL.revokeObjectURL(de), ne(null), dA(null), jA(null), BA(!1), RA.current && (RA.current.value = "");
|
|
14910
14910
|
}, [de, De]), KA = bA(() => {
|
|
14911
14911
|
Ee(), YA(""), HA(""), _A(""), oe(""), Ce(""), xe(null), Ae(null), l?.();
|
|
14912
14912
|
}, [Ee, l]);
|
|
14913
14913
|
xA(() => {
|
|
14914
|
-
const U = R?.photoBase64,
|
|
14915
|
-
!U || !
|
|
14914
|
+
const U = R?.photoBase64, pA = R?.id ?? null;
|
|
14915
|
+
!U || !pA || Be.current !== pA && (Be.current = pA, jA(U), dA(U), BA(!0), y(!0));
|
|
14916
14916
|
}, [R]), xA(() => {
|
|
14917
14917
|
const U = R?.age;
|
|
14918
14918
|
U != null && U > 0 && !SA && Ce(String(Math.round(U)));
|
|
14919
14919
|
}, [R, SA]);
|
|
14920
14920
|
const D = bA(() => {
|
|
14921
14921
|
if (mA === "in") {
|
|
14922
|
-
const
|
|
14923
|
-
if (!
|
|
14922
|
+
const pA = parseFloat(VA);
|
|
14923
|
+
if (!pA || pA < 3 || pA > 8)
|
|
14924
14924
|
return lA(s("Please enter a valid height")), !1;
|
|
14925
14925
|
} else {
|
|
14926
|
-
const
|
|
14927
|
-
if (!
|
|
14926
|
+
const pA = parseFloat(iA);
|
|
14927
|
+
if (!pA || pA < 100 || pA > 250)
|
|
14928
14928
|
return lA(s("Please enter a valid height (100-250 cm)")), !1;
|
|
14929
14929
|
}
|
|
14930
14930
|
const U = parseFloat(yA);
|
|
@@ -14937,19 +14937,19 @@ function pr({
|
|
|
14937
14937
|
}, [mA, Z, iA, VA, yA, s]), W = () => {
|
|
14938
14938
|
let U;
|
|
14939
14939
|
if (mA === "in") {
|
|
14940
|
-
const
|
|
14941
|
-
U =
|
|
14940
|
+
const pA = parseFloat(VA) || 0, le = parseFloat(pe) || 0;
|
|
14941
|
+
U = pA * 12 + le;
|
|
14942
14942
|
} else
|
|
14943
14943
|
U = parseFloat(iA);
|
|
14944
14944
|
return { heightVal: U, weightVal: parseFloat(yA) };
|
|
14945
14945
|
}, hA = t ? "female" : "male", uA = (U) => {
|
|
14946
|
-
const
|
|
14947
|
-
return
|
|
14946
|
+
const pA = m.indexOf(U);
|
|
14947
|
+
return pA < m.length - 1 ? m[pA + 1] : "submit";
|
|
14948
14948
|
}, ee = () => {
|
|
14949
|
-
const { heightVal: U, weightVal:
|
|
14950
|
-
i.current.height = String(U), i.current.weight = String(
|
|
14949
|
+
const { heightVal: U, weightVal: pA } = W();
|
|
14950
|
+
i.current.height = String(U), i.current.weight = String(pA), i.current.gender = hA, SA && (i.current.age = SA), n(mA), r(Z), u({
|
|
14951
14951
|
height: U,
|
|
14952
|
-
weight:
|
|
14952
|
+
weight: pA,
|
|
14953
14953
|
heightUnit: mA,
|
|
14954
14954
|
weightUnit: Z,
|
|
14955
14955
|
gender: hA,
|
|
@@ -14963,12 +14963,12 @@ function pr({
|
|
|
14963
14963
|
});
|
|
14964
14964
|
}, ue = bA(() => {
|
|
14965
14965
|
if (!ge || !Ye) return;
|
|
14966
|
-
const U = mA === "in" ? (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0) : parseFloat(iA) || 0,
|
|
14966
|
+
const U = mA === "in" ? (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0) : parseFloat(iA) || 0, pA = parseFloat(yA) || 0, le = parseFloat(SA) || void 0;
|
|
14967
14967
|
M({
|
|
14968
14968
|
photoFile: Ye,
|
|
14969
14969
|
photoBase64: ge,
|
|
14970
14970
|
height: U,
|
|
14971
|
-
weight:
|
|
14971
|
+
weight: pA,
|
|
14972
14972
|
heightUnit: mA,
|
|
14973
14973
|
weightUnit: Z,
|
|
14974
14974
|
gender: hA,
|
|
@@ -15024,12 +15024,12 @@ function pr({
|
|
|
15024
15024
|
}
|
|
15025
15025
|
ue();
|
|
15026
15026
|
} else if (E === "scan-details") {
|
|
15027
|
-
const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0,
|
|
15027
|
+
const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0;
|
|
15028
15028
|
if (!U) {
|
|
15029
15029
|
lA(s("Please enter your height"));
|
|
15030
15030
|
return;
|
|
15031
15031
|
}
|
|
15032
|
-
if (!
|
|
15032
|
+
if (!pA) {
|
|
15033
15033
|
lA(s("Please enter your weight"));
|
|
15034
15034
|
return;
|
|
15035
15035
|
}
|
|
@@ -15044,8 +15044,8 @@ function pr({
|
|
|
15044
15044
|
lA(""), ue();
|
|
15045
15045
|
}
|
|
15046
15046
|
}, [E, m, D, ve, OA, XA, q, ae, re, mA, Z, iA, VA, pe, yA, SA, ge, Ye, FA, O, t, hA, L, G, ue]), io = (U) => {
|
|
15047
|
-
const
|
|
15048
|
-
return
|
|
15047
|
+
const pA = m.indexOf(U);
|
|
15048
|
+
return pA > 0 ? m[pA - 1] : null;
|
|
15049
15049
|
}, ze = bA(() => {
|
|
15050
15050
|
if (lA(""), E === "basics")
|
|
15051
15051
|
V();
|
|
@@ -15067,8 +15067,8 @@ function pr({
|
|
|
15067
15067
|
if (mA === "cm") {
|
|
15068
15068
|
const U = parseFloat(iA);
|
|
15069
15069
|
if (U > 0) {
|
|
15070
|
-
const
|
|
15071
|
-
HA(String(Math.floor(
|
|
15070
|
+
const pA = Math.round(U / 2.54);
|
|
15071
|
+
HA(String(Math.floor(pA / 12))), _A(String(pA % 12));
|
|
15072
15072
|
}
|
|
15073
15073
|
}
|
|
15074
15074
|
Z === "kg" && yA && oe(String(Math.round(parseFloat(yA) * 2.205))), Ie("in"), me("lbs"), n("in"), r("lbs"), Q?.("in");
|
|
@@ -15194,8 +15194,8 @@ function pr({
|
|
|
15194
15194
|
] })
|
|
15195
15195
|
] });
|
|
15196
15196
|
if (E === "photo" || E === "scan-details") {
|
|
15197
|
-
const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0,
|
|
15198
|
-
H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")), U || be.push(s("Enter your height")),
|
|
15197
|
+
const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0, le = !!de, be = [];
|
|
15198
|
+
H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")), U || be.push(s("Enter your height")), pA || be.push(s("Enter your weight")), t && (!ae || !re) && be.push(s("Enter your bra size"));
|
|
15199
15199
|
const eo = be.length > 0, Ve = eo ? be[0] ?? s("Analyze My Size") : s("Analyze My Size");
|
|
15200
15200
|
return O ? /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
|
|
15201
15201
|
/* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
|
|
@@ -15219,7 +15219,7 @@ function pr({
|
|
|
15219
15219
|
type: "button",
|
|
15220
15220
|
onClick: () => CA((eA) => !eA),
|
|
15221
15221
|
"aria-label": s("How to take a good photo"),
|
|
15222
|
-
className: `ps-pm-help-pill ps-bp-scan-help-pill${
|
|
15222
|
+
className: `ps-pm-help-pill ps-bp-scan-help-pill${gA ? " ps-active" : ""}`,
|
|
15223
15223
|
children: [
|
|
15224
15224
|
/* @__PURE__ */ A("span", { className: "ps-pm-help-pill-q", "aria-hidden": "true", children: "?" }),
|
|
15225
15225
|
/* @__PURE__ */ A("span", { children: s("How to take a good photo") })
|
|
@@ -15250,7 +15250,7 @@ function pr({
|
|
|
15250
15250
|
t: s
|
|
15251
15251
|
}
|
|
15252
15252
|
),
|
|
15253
|
-
|
|
15253
|
+
gA && /* @__PURE__ */ e(_, { children: [
|
|
15254
15254
|
/* @__PURE__ */ A("div", { className: "ps-bp-photo-help-backdrop", onClick: () => CA(!1), "aria-hidden": "true" }),
|
|
15255
15255
|
/* @__PURE__ */ e("div", { role: "dialog", "aria-label": s("How to take the best photo"), className: "ps-bp-photo-help", children: [
|
|
15256
15256
|
/* @__PURE__ */ A("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
|
|
@@ -15585,8 +15585,8 @@ function pr({
|
|
|
15585
15585
|
alignItems: "center",
|
|
15586
15586
|
gap: "0.35vw",
|
|
15587
15587
|
padding: "0.4vw 0.7vw",
|
|
15588
|
-
background:
|
|
15589
|
-
color:
|
|
15588
|
+
background: gA ? "var(--ps-accent)" : "transparent",
|
|
15589
|
+
color: gA ? "#FFFFFF" : "var(--ps-accent)",
|
|
15590
15590
|
border: "1.5px solid var(--ps-accent)",
|
|
15591
15591
|
borderRadius: "999px",
|
|
15592
15592
|
cursor: "pointer",
|
|
@@ -15608,8 +15608,8 @@ function pr({
|
|
|
15608
15608
|
minWidth: "14px",
|
|
15609
15609
|
minHeight: "14px",
|
|
15610
15610
|
borderRadius: "50%",
|
|
15611
|
-
background:
|
|
15612
|
-
color:
|
|
15611
|
+
background: gA ? "#FFFFFF" : "var(--ps-accent)",
|
|
15612
|
+
color: gA ? "var(--ps-accent)" : "#FFFFFF",
|
|
15613
15613
|
fontSize: "0.65vw",
|
|
15614
15614
|
fontWeight: 700,
|
|
15615
15615
|
lineHeight: 1
|
|
@@ -15712,7 +15712,7 @@ function pr({
|
|
|
15712
15712
|
] })
|
|
15713
15713
|
] })
|
|
15714
15714
|
] }),
|
|
15715
|
-
|
|
15715
|
+
gA && /* @__PURE__ */ e(_, { children: [
|
|
15716
15716
|
/* @__PURE__ */ A(
|
|
15717
15717
|
"div",
|
|
15718
15718
|
{
|
|
@@ -15875,7 +15875,7 @@ function pr({
|
|
|
15875
15875
|
YA(String(Math.round(le * 2.54)));
|
|
15876
15876
|
}
|
|
15877
15877
|
Z === "lbs" && yA && oe(String(Math.round(parseFloat(yA) / 2.205))), Ie("cm"), me("kg"), n("cm"), r("kg"), Q?.("cm");
|
|
15878
|
-
},
|
|
15878
|
+
}, pA = () => {
|
|
15879
15879
|
if (mA === "cm") {
|
|
15880
15880
|
const le = parseFloat(iA) || 173, be = Math.round(le / 2.54);
|
|
15881
15881
|
HA(String(Math.floor(be / 12))), _A(String(be % 12));
|
|
@@ -15899,7 +15899,7 @@ function pr({
|
|
|
15899
15899
|
age: SA,
|
|
15900
15900
|
setAge: Ce,
|
|
15901
15901
|
switchToMetric: U,
|
|
15902
|
-
switchToImperial:
|
|
15902
|
+
switchToImperial: pA,
|
|
15903
15903
|
onUploadPhoto: () => F("photo"),
|
|
15904
15904
|
onSwitchToScan: () => F("photo"),
|
|
15905
15905
|
hidePhotoOptions: L,
|
|
@@ -15925,7 +15925,7 @@ function pr({
|
|
|
15925
15925
|
] }),
|
|
15926
15926
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", children: [
|
|
15927
15927
|
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? "" : " ps-bp-system-active"}`, onClick: U, type: "button", children: s("Metric") }),
|
|
15928
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? " ps-bp-system-active" : ""}`, onClick:
|
|
15928
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? " ps-bp-system-active" : ""}`, onClick: pA, type: "button", children: s("Imperial") })
|
|
15929
15929
|
] }),
|
|
15930
15930
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
|
|
15931
15931
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -16161,7 +16161,7 @@ function pr({
|
|
|
16161
16161
|
$ && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: $ })
|
|
16162
16162
|
] }, "step-bra"),
|
|
16163
16163
|
!(O && E === "basics") && (() => {
|
|
16164
|
-
const U = E === "basics" && L && !!G,
|
|
16164
|
+
const U = E === "basics" && L && !!G, pA = U ? G : Me, le = Xe(mA) ? ` (${Xe(mA)})` : "", be = U ? s("Find My Best Fit") + le : Ao ? s("Find My Size") + le : s("Next");
|
|
16165
16165
|
return /* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
|
|
16166
16166
|
E !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: ze, type: "button", children: [
|
|
16167
16167
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -16172,7 +16172,7 @@ function pr({
|
|
|
16172
16172
|
"button",
|
|
16173
16173
|
{
|
|
16174
16174
|
className: `ps-bp-next-btn${!U && !We ? " ps-bp-btn-disabled" : ""}`,
|
|
16175
|
-
onClick:
|
|
16175
|
+
onClick: pA,
|
|
16176
16176
|
disabled: !U && !We,
|
|
16177
16177
|
type: "button",
|
|
16178
16178
|
children: be
|
|
@@ -16218,16 +16218,16 @@ function xg({
|
|
|
16218
16218
|
}), O = t ?? [
|
|
16219
16219
|
{ label: l("Centimeters"), value: "cm" },
|
|
16220
16220
|
{ label: l("Inches"), value: "in" }
|
|
16221
|
-
], [T, aA] = f(""), X = QA(null), [UA, LA] = f(null), [h,
|
|
16221
|
+
], [T, aA] = f(""), X = QA(null), [UA, LA] = f(null), [h, oA] = f(null), [N, vA] = f(null), [S, nA] = f(!1), [MA, iA] = f(!1), [YA, VA] = f(""), [HA, pe] = f(null), [_A, yA] = f(null), [oe, SA] = f(!1), Ce = bA(async (H) => {
|
|
16222
16222
|
const zA = H.target.files?.[0];
|
|
16223
16223
|
if (!zA) return;
|
|
16224
16224
|
const he = URL.createObjectURL(zA);
|
|
16225
|
-
|
|
16225
|
+
oA(zA), LA(he), iA(!0), VA("Analyzing photo…");
|
|
16226
16226
|
try {
|
|
16227
16227
|
const Oe = G && v ? tg(zA, G, v) : Promise.resolve({ isAdult: !0, confidence: "low" }), JA = uo(zA, R ? { maxDimension: 1536, quality: 0.85 } : {}), ke = await Oe;
|
|
16228
16228
|
if (!ke.isAdult) {
|
|
16229
16229
|
const BA = ke.reasoning?.trim() || l("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
16230
|
-
pe(BA),
|
|
16230
|
+
pe(BA), oA(null), LA(null);
|
|
16231
16231
|
return;
|
|
16232
16232
|
}
|
|
16233
16233
|
const De = await JA;
|
|
@@ -16237,7 +16237,7 @@ function xg({
|
|
|
16237
16237
|
iA(!1), VA("");
|
|
16238
16238
|
}
|
|
16239
16239
|
}, [R, G, v, l]), mA = bA(() => {
|
|
16240
|
-
UA && URL.revokeObjectURL(UA),
|
|
16240
|
+
UA && URL.revokeObjectURL(UA), oA(null), LA(null), vA(null);
|
|
16241
16241
|
}, [UA]), Ie = (H, zA) => {
|
|
16242
16242
|
F((he) => ({ ...he, [H]: zA })), aA("");
|
|
16243
16243
|
}, Z = () => {
|
|
@@ -16352,7 +16352,7 @@ function xg({
|
|
|
16352
16352
|
)
|
|
16353
16353
|
] })
|
|
16354
16354
|
] }) });
|
|
16355
|
-
const Ye = g.some((H) => (parseFloat(E[H.key] || "") || 0) > 0), ne = !!h && _A === !0 && !MA,
|
|
16355
|
+
const Ye = g.some((H) => (parseFloat(E[H.key] || "") || 0) > 0), ne = !!h && _A === !0 && !MA, dA = MA || !ne && !Ye, ge = MA ? l("Analyzing photo…") : ne ? l("Analyze") : `${l("Find My Size")}${Xe(r) ? ` (${Xe(r)})` : ""}`, jA = ne ? me : Z;
|
|
16356
16356
|
return s !== "photo" || a ? /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
|
|
16357
16357
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: c, alt: n, className: "ps-bp-image-img" }) }),
|
|
16358
16358
|
/* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
@@ -16874,9 +16874,9 @@ function xg({
|
|
|
16874
16874
|
/* @__PURE__ */ e(
|
|
16875
16875
|
"button",
|
|
16876
16876
|
{
|
|
16877
|
-
className: `ps-bp-next-btn${
|
|
16877
|
+
className: `ps-bp-next-btn${dA ? " ps-bp-btn-disabled" : ""}`,
|
|
16878
16878
|
onClick: jA,
|
|
16879
|
-
disabled:
|
|
16879
|
+
disabled: dA,
|
|
16880
16880
|
type: "button",
|
|
16881
16881
|
children: [
|
|
16882
16882
|
ge,
|
|
@@ -17097,7 +17097,7 @@ function br({
|
|
|
17097
17097
|
xA(() => {
|
|
17098
17098
|
h(!0);
|
|
17099
17099
|
}, []);
|
|
17100
|
-
const [
|
|
17100
|
+
const [oA, N] = f("idle"), [vA, S] = f(null), [nA, MA] = f(null), [iA, YA] = f(null), [VA, HA] = f(null), [pe, _A] = f(!1), [yA, oe] = f(null), [SA, Ce] = f(null), [mA, Ie] = f({}), Z = QA({});
|
|
17101
17101
|
xA(() => {
|
|
17102
17102
|
Z.current = mA;
|
|
17103
17103
|
}, [mA]);
|
|
@@ -17108,21 +17108,21 @@ function br({
|
|
|
17108
17108
|
return d === null ? delete rA[B] : rA[B] = { ...d, sectionName: B }, Z.current = rA, rA;
|
|
17109
17109
|
});
|
|
17110
17110
|
}, []);
|
|
17111
|
-
const [ne, de] = f(null), [
|
|
17111
|
+
const [ne, de] = f(null), [dA, ge] = f(null), [jA, H] = f(!1), [zA, he] = f(!1);
|
|
17112
17112
|
xA(() => {
|
|
17113
|
-
|
|
17114
|
-
recommendedSize:
|
|
17113
|
+
dA?.recommendedSize && (console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
|
|
17114
|
+
recommendedSize: dA.recommendedSize
|
|
17115
17115
|
}), Ie({}));
|
|
17116
|
-
}, [
|
|
17116
|
+
}, [dA?.recommendedSize]);
|
|
17117
17117
|
const [Oe, JA] = f(!1), [ke, De] = f(!1), [BA, RA] = f(null), FA = QA(!1);
|
|
17118
17118
|
xA(() => {
|
|
17119
|
-
me.current =
|
|
17120
|
-
}, [
|
|
17119
|
+
me.current = dA;
|
|
17120
|
+
}, [dA]), xA(() => {
|
|
17121
17121
|
fe.current = BA;
|
|
17122
17122
|
}, [BA]), xA(() => {
|
|
17123
17123
|
Ye.current = iA;
|
|
17124
17124
|
}, [iA]);
|
|
17125
|
-
const [y,
|
|
17125
|
+
const [y, gA] = f(!1), CA = QA(!1), [J, fA] = f(Pn), qA = at(J), [TA, ve] = f(qA ? "in" : "cm"), [GA, OA] = f(qA ? "in" : "cm"), [ie, XA] = f(qA ? "lbs" : "kg");
|
|
17126
17126
|
xA(() => {
|
|
17127
17127
|
const B = wo(i);
|
|
17128
17128
|
B === "foot" || B === "head" ? ve("cm") : B === "face" && ve("mm");
|
|
@@ -17132,7 +17132,7 @@ function br({
|
|
|
17132
17132
|
}, []), [Be, Ee] = f(!1), [KA, D] = f(null), [W, hA] = f(null), uA = QA(null), ee = QA(() => !1), ue = QA(() => {
|
|
17133
17133
|
}), Me = bA((B, d) => {
|
|
17134
17134
|
ee.current = B, ue.current = d;
|
|
17135
|
-
}, []), io = QA(null), ze = QA(null), We = QA(null), Ao = QA(null), ye = QA(null), Je = QA(!1), U = QA(null),
|
|
17135
|
+
}, []), io = QA(null), ze = QA(null), We = QA(null), Ao = QA(null), ye = QA(null), Je = QA(!1), U = QA(null), pA = QA(null), [le, be] = f(null), [eo, Ve] = f(null), eA = QA(null), qe = QA(null), ro = QA(!1), mo = QA(null);
|
|
17136
17136
|
xA(() => {
|
|
17137
17137
|
try {
|
|
17138
17138
|
const B = Re(), d = je(r);
|
|
@@ -17161,7 +17161,7 @@ function br({
|
|
|
17161
17161
|
}, [g, t, r, i]);
|
|
17162
17162
|
const ng = 22, Ro = QA(0), Po = QA(null), bo = QA(null), xo = QA(null), Ho = QA(null), Mo = QA(null), ig = QA(null), rg = QA(""), so = QA(null);
|
|
17163
17163
|
xA(() => {
|
|
17164
|
-
if (
|
|
17164
|
+
if (oA === "processing") {
|
|
17165
17165
|
if (so.current) return;
|
|
17166
17166
|
Ro.current = 0, ig.current = Date.now(), rg.current = "";
|
|
17167
17167
|
const B = [
|
|
@@ -17199,16 +17199,16 @@ function br({
|
|
|
17199
17199
|
};
|
|
17200
17200
|
} else
|
|
17201
17201
|
so.current && (clearInterval(so.current), so.current = null), ig.current = null;
|
|
17202
|
-
}, [
|
|
17202
|
+
}, [oA, X]), xA(() => () => {
|
|
17203
17203
|
nA && URL.revokeObjectURL(nA);
|
|
17204
17204
|
}, [nA]), xA(() => {
|
|
17205
|
-
if (
|
|
17205
|
+
if (oA !== "idle") {
|
|
17206
17206
|
const B = window.scrollY, d = document.body.style.overflow, z = document.body.style.overscrollBehavior;
|
|
17207
17207
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
17208
17208
|
document.body.style.overflow = d, document.body.style.overscrollBehavior = z, window.scrollTo(0, B);
|
|
17209
17209
|
};
|
|
17210
17210
|
}
|
|
17211
|
-
}, [
|
|
17211
|
+
}, [oA]), xA(() => {
|
|
17212
17212
|
lo("profiles", PA);
|
|
17213
17213
|
}, [PA]), xA(() => {
|
|
17214
17214
|
lo("history", Pe);
|
|
@@ -17225,7 +17225,7 @@ function br({
|
|
|
17225
17225
|
RA({ found: !1 });
|
|
17226
17226
|
return;
|
|
17227
17227
|
}
|
|
17228
|
-
|
|
17228
|
+
gA(!0);
|
|
17229
17229
|
const B = je(r), d = Re();
|
|
17230
17230
|
fetch(`${B}/api/v1/sizing/sizeguide`, {
|
|
17231
17231
|
method: "POST",
|
|
@@ -17235,10 +17235,10 @@ function br({
|
|
|
17235
17235
|
RA(z || { found: !1 });
|
|
17236
17236
|
}).catch(() => {
|
|
17237
17237
|
RA({ found: !1 });
|
|
17238
|
-
}).finally(() =>
|
|
17238
|
+
}).finally(() => gA(!1));
|
|
17239
17239
|
}, [r, i, F]);
|
|
17240
17240
|
const mt = He(() => {
|
|
17241
|
-
switch (
|
|
17241
|
+
switch (oA) {
|
|
17242
17242
|
case "welcome":
|
|
17243
17243
|
case "body-profile":
|
|
17244
17244
|
return 1;
|
|
@@ -17252,7 +17252,7 @@ function br({
|
|
|
17252
17252
|
default:
|
|
17253
17253
|
return 1;
|
|
17254
17254
|
}
|
|
17255
|
-
}, [
|
|
17255
|
+
}, [oA]), yo = bA(
|
|
17256
17256
|
(B, d, z) => {
|
|
17257
17257
|
let rA = b, tA = PA.find((AA) => AA.id === rA);
|
|
17258
17258
|
if (!tA) {
|
|
@@ -17361,7 +17361,7 @@ function br({
|
|
|
17361
17361
|
D(null), uA.current && (N(uA.current), uA.current = null);
|
|
17362
17362
|
return;
|
|
17363
17363
|
}
|
|
17364
|
-
switch (
|
|
17364
|
+
switch (oA) {
|
|
17365
17365
|
case "body-profile":
|
|
17366
17366
|
ao();
|
|
17367
17367
|
break;
|
|
@@ -17395,7 +17395,7 @@ function br({
|
|
|
17395
17395
|
ao();
|
|
17396
17396
|
break;
|
|
17397
17397
|
}
|
|
17398
|
-
}, [
|
|
17398
|
+
}, [oA, KA, SA, ao]), Ft = oA !== "idle" && oA !== "processing" && oA !== "result" && oA !== "welcome" && oA !== "body-profile" && oA !== "size-result", ag = bA((B) => {
|
|
17399
17399
|
if (!Rt(B)) {
|
|
17400
17400
|
HA(X("Please upload a JPEG, PNG, or WebP image.")), N("error"), E?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
17401
17401
|
return;
|
|
@@ -17406,8 +17406,8 @@ function br({
|
|
|
17406
17406
|
}
|
|
17407
17407
|
S(B), eA.current = B, qe.current = null;
|
|
17408
17408
|
const d = URL.createObjectURL(B);
|
|
17409
|
-
MA(d), V?.(B),
|
|
17410
|
-
|
|
17409
|
+
MA(d), V?.(B), pA.current = null, og(d).then((z) => {
|
|
17410
|
+
pA.current = z;
|
|
17411
17411
|
}).catch(() => {
|
|
17412
17412
|
});
|
|
17413
17413
|
}, [V, E]), Mg = bA(() => {
|
|
@@ -17643,7 +17643,7 @@ function br({
|
|
|
17643
17643
|
H(!1);
|
|
17644
17644
|
return;
|
|
17645
17645
|
}
|
|
17646
|
-
|
|
17646
|
+
pA.current = null, be(null), og(rA).then((DA) => (pA.current = DA, DA)).catch(() => null);
|
|
17647
17647
|
const AA = po(rA).then((DA) => (be(DA), DA)).catch(() => null), Y = 8e3, j = await Promise.race([
|
|
17648
17648
|
AA,
|
|
17649
17649
|
new Promise((DA) => setTimeout(() => DA(null), Y))
|
|
@@ -17695,7 +17695,7 @@ function br({
|
|
|
17695
17695
|
const DA = sA.bodyLandmarks, te = DA ? Object.keys(DA).filter(($A) => $A !== "imageWidth" && $A !== "imageHeight" && DA[$A]).length : 0;
|
|
17696
17696
|
console.log(`[ps-sdk:debug] payload → bodyLandmarks=${!!DA}(${te} joints)`);
|
|
17697
17697
|
}
|
|
17698
|
-
const ZA = new Promise((DA) => setTimeout(DA,
|
|
17698
|
+
const ZA = new Promise((DA) => setTimeout(DA, 2e3));
|
|
17699
17699
|
try {
|
|
17700
17700
|
const DA = Date.now(), te = JSON.stringify(sA).length;
|
|
17701
17701
|
console.log(`[ps-sdk:T] ▶ POST /sizing/recommend payload=${Math.round(te / 1024)}KB bodyImage=${!!sA.bodyImage} landmarks=${!!sA.bodyLandmarks}`);
|
|
@@ -17740,8 +17740,8 @@ function br({
|
|
|
17740
17740
|
}
|
|
17741
17741
|
B && B !== vA && (S(B), eA.current = B), Je.current = !1, De(!0), oe(Date.now());
|
|
17742
17742
|
const z = Pr(wo(i)), rA = z === "apparel", tA = (B ? null : nA) || URL.createObjectURL(d);
|
|
17743
|
-
(B || !nA) && MA(tA), rA && (!
|
|
17744
|
-
|
|
17743
|
+
(B || !nA) && MA(tA), rA && (!pA.current || !le) && (pA.current = null, be(null), og(tA).then((AA) => {
|
|
17744
|
+
pA.current = AA;
|
|
17745
17745
|
}).catch(() => {
|
|
17746
17746
|
}), po(tA).then((AA) => {
|
|
17747
17747
|
be(AA);
|
|
@@ -17772,7 +17772,7 @@ function br({
|
|
|
17772
17772
|
});
|
|
17773
17773
|
const $A = () => {
|
|
17774
17774
|
const NA = /* @__PURE__ */ new Set(), Ne = [];
|
|
17775
|
-
console.log("[ps-sdk:flatten] sizingResult keys:", Object.keys(
|
|
17775
|
+
console.log("[ps-sdk:flatten] sizingResult keys:", Object.keys(dA || {})), console.log("[ps-sdk:flatten] root matchDetails:", (dA?.matchDetails || []).map((Ue) => Ue.measurement)), console.log("[ps-sdk:flatten] sections:", dA?.sections ? Object.keys(dA.sections) : "none");
|
|
17776
17776
|
const co = (Ue, Qo, Xo) => {
|
|
17777
17777
|
if (Ue) {
|
|
17778
17778
|
console.log(`[ps-sdk:flatten] ${Qo} →`, Ue.map((Wo) => Wo.measurement));
|
|
@@ -17782,15 +17782,15 @@ function br({
|
|
|
17782
17782
|
}
|
|
17783
17783
|
}
|
|
17784
17784
|
};
|
|
17785
|
-
if (co(
|
|
17786
|
-
for (const [Ue, Qo] of Object.entries(
|
|
17785
|
+
if (co(dA?.matchDetails, "root", void 0), dA?.sections)
|
|
17786
|
+
for (const [Ue, Qo] of Object.entries(dA.sections))
|
|
17787
17787
|
co(Qo?.matchDetails, `section:${Ue}`, Ue);
|
|
17788
17788
|
return console.log("[ps-sdk:flatten] final unique:", Ne.map((Ue) => Ue.measurement)), Ne;
|
|
17789
17789
|
}, ce = te?.matchDetails && te.matchDetails.length ? te.matchDetails : $A();
|
|
17790
17790
|
let wA;
|
|
17791
17791
|
if (rA && ce.length) {
|
|
17792
|
-
const NA = (
|
|
17793
|
-
wA = Qn(ce,
|
|
17792
|
+
const NA = (dA?.unit || TA || "in").toString().toLowerCase(), Ne = NA === "cm" ? "cm" : NA === "mm" ? "mm" : "in";
|
|
17793
|
+
wA = Qn(ce, pA.current, Ne);
|
|
17794
17794
|
}
|
|
17795
17795
|
console.log("[ps-sdk:tryon] fitInfo built", { count: wA?.length || 0, areas: wA?.map((NA) => `${NA.area}(${NA.fit})`) });
|
|
17796
17796
|
let we = o;
|
|
@@ -17813,7 +17813,7 @@ function br({
|
|
|
17813
17813
|
productDescription: c,
|
|
17814
17814
|
productMaterial: n,
|
|
17815
17815
|
silhouetteContext: fn(
|
|
17816
|
-
|
|
17816
|
+
dA,
|
|
17817
17817
|
BA,
|
|
17818
17818
|
te?.displayLabel,
|
|
17819
17819
|
(() => {
|
|
@@ -17857,14 +17857,14 @@ function br({
|
|
|
17857
17857
|
const Y = AA instanceof Error ? AA.message : X("Failed to start try-on"), j = AA instanceof Tg ? AA.code : void 0;
|
|
17858
17858
|
HA(Y), N("error"), E?.({ message: Y, code: j });
|
|
17859
17859
|
}
|
|
17860
|
-
}, [vA, o, i,
|
|
17860
|
+
}, [vA, o, i, dA, s, E, Bg]);
|
|
17861
17861
|
xA(() => {
|
|
17862
|
-
if (
|
|
17862
|
+
if (oA !== "size-result") {
|
|
17863
17863
|
ro.current = !1;
|
|
17864
17864
|
return;
|
|
17865
17865
|
}
|
|
17866
|
-
|
|
17867
|
-
}, [
|
|
17866
|
+
FA.current || ro.current || ke || iA || !(vA || eA.current) || (ro.current = !0, Yo());
|
|
17867
|
+
}, [oA, vA, ke, iA, Yo]);
|
|
17868
17868
|
const Yt = bA(() => {
|
|
17869
17869
|
if (iA)
|
|
17870
17870
|
if (iA.startsWith("data:")) {
|
|
@@ -17953,7 +17953,7 @@ function br({
|
|
|
17953
17953
|
d = await Xg(B, sA);
|
|
17954
17954
|
} catch {
|
|
17955
17955
|
}
|
|
17956
|
-
const rA = Z.current, tA =
|
|
17956
|
+
const rA = Z.current, tA = dA?.recommendedSize ?? "", AA = Object.values(rA).map((j) => ({
|
|
17957
17957
|
sectionName: j.sectionName,
|
|
17958
17958
|
selectedSize: j.selectedSize,
|
|
17959
17959
|
selectedLength: j.selectedLength,
|
|
@@ -17964,12 +17964,12 @@ function br({
|
|
|
17964
17964
|
productTitle: i,
|
|
17965
17965
|
productImage: o,
|
|
17966
17966
|
resultImageUrl: iA || void 0,
|
|
17967
|
-
recommendedSize:
|
|
17968
|
-
confidence:
|
|
17969
|
-
reasoning:
|
|
17970
|
-
internationalSizes:
|
|
17971
|
-
matchDetails:
|
|
17972
|
-
sizingResult:
|
|
17967
|
+
recommendedSize: dA?.recommendedSize,
|
|
17968
|
+
confidence: dA?.confidence,
|
|
17969
|
+
reasoning: dA?.reasoning,
|
|
17970
|
+
internationalSizes: dA?.internationalSizes,
|
|
17971
|
+
matchDetails: dA?.matchDetails,
|
|
17972
|
+
sizingResult: dA || void 0,
|
|
17973
17973
|
sizeGuide: BA ? {
|
|
17974
17974
|
found: BA.found,
|
|
17975
17975
|
title: BA.title,
|
|
@@ -17990,14 +17990,14 @@ function br({
|
|
|
17990
17990
|
const sA = [Y, ...j].slice(0, 50), ZA = new Set(sA.map((DA) => DA.id));
|
|
17991
17991
|
return qt(ZA), sA;
|
|
17992
17992
|
});
|
|
17993
|
-
}, [i, o, iA,
|
|
17993
|
+
}, [i, o, iA, dA, BA, b, PA, vA]), Bo = QA(!1), Go = QA(!1);
|
|
17994
17994
|
xA(() => {
|
|
17995
|
-
if (
|
|
17995
|
+
if (oA === "size-result" && dA && !Bo.current)
|
|
17996
17996
|
Bo.current = !0, Go.current = !1, yg().catch(() => {
|
|
17997
17997
|
});
|
|
17998
|
-
else if (
|
|
17998
|
+
else if (oA === "size-result" && dA && iA && !Go.current) {
|
|
17999
17999
|
Go.current = !0;
|
|
18000
|
-
const B = Z.current, d =
|
|
18000
|
+
const B = Z.current, d = dA?.recommendedSize ?? "", z = Object.values(B).map((tA) => ({
|
|
18001
18001
|
sectionName: tA.sectionName,
|
|
18002
18002
|
selectedSize: tA.selectedSize,
|
|
18003
18003
|
selectedLength: tA.selectedLength,
|
|
@@ -18022,9 +18022,9 @@ function br({
|
|
|
18022
18022
|
}
|
|
18023
18023
|
})();
|
|
18024
18024
|
}
|
|
18025
|
-
} else
|
|
18026
|
-
})) : (
|
|
18027
|
-
}, [
|
|
18025
|
+
} else oA === "result" && iA && !Bo.current ? (Bo.current = !0, yg().catch(() => {
|
|
18026
|
+
})) : (oA === "welcome" || oA === "body-profile") && (Bo.current = !1, Go.current = !1);
|
|
18027
|
+
}, [oA, dA, iA]);
|
|
18028
18028
|
const Ot = bA((B) => {
|
|
18029
18029
|
if (Bo.current = !0, Go.current = !!B.resultImageUrl, ro.current = !0, B.sizingResult ? ge(B.sizingResult) : B.recommendedSize && ge({
|
|
18030
18030
|
recommendedSize: B.recommendedSize,
|
|
@@ -18032,7 +18032,7 @@ function br({
|
|
|
18032
18032
|
reasoning: B.reasoning || "",
|
|
18033
18033
|
internationalSizes: B.internationalSizes,
|
|
18034
18034
|
matchDetails: B.matchDetails
|
|
18035
|
-
}), B.sizeGuide && (RA(B.sizeGuide),
|
|
18035
|
+
}), B.sizeGuide && (RA(B.sizeGuide), gA(!1)), YA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((d) => {
|
|
18036
18036
|
if (!d) return;
|
|
18037
18037
|
const z = URL.createObjectURL(d);
|
|
18038
18038
|
YA(z);
|
|
@@ -18115,7 +18115,7 @@ function br({
|
|
|
18115
18115
|
"--ps-logo-height": M.logoHeight
|
|
18116
18116
|
}, Fg = Object.fromEntries(Object.entries(Nt).filter(([, B]) => B !== void 0));
|
|
18117
18117
|
function Ut() {
|
|
18118
|
-
switch (
|
|
18118
|
+
switch (oA) {
|
|
18119
18119
|
case "welcome":
|
|
18120
18120
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Vn, { productImage: o, setView: N, t: X }) }, "v-welcome");
|
|
18121
18121
|
case "body-profile": {
|
|
@@ -18205,7 +18205,7 @@ function br({
|
|
|
18205
18205
|
{
|
|
18206
18206
|
estimationDone: Oe,
|
|
18207
18207
|
sizingLoading: jA,
|
|
18208
|
-
sizingResult:
|
|
18208
|
+
sizingResult: dA,
|
|
18209
18209
|
sizeGuide: BA,
|
|
18210
18210
|
resultImageUrl: iA,
|
|
18211
18211
|
productImage: o,
|
|
@@ -18238,7 +18238,7 @@ function br({
|
|
|
18238
18238
|
if (!B) return;
|
|
18239
18239
|
const d = B.height ?? B.heightCm;
|
|
18240
18240
|
if (!d || d <= 0) return;
|
|
18241
|
-
const z = B.heightUnit, rA =
|
|
18241
|
+
const z = B.heightUnit, rA = dA?.unit || TA;
|
|
18242
18242
|
return (z === "in" || z === "ft") && rA !== "in" ? Math.round(d * 2.54) : (!z || z === "cm") && rA === "in" ? Math.round(d / 2.54 * 10) / 10 : d;
|
|
18243
18243
|
})(),
|
|
18244
18244
|
t: X
|
|
@@ -18434,19 +18434,19 @@ function br({
|
|
|
18434
18434
|
]
|
|
18435
18435
|
}
|
|
18436
18436
|
),
|
|
18437
|
-
|
|
18438
|
-
/* @__PURE__ */ A("div", { className: Le("ps-tryon-overlay", L.overlay), style: Fg, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ e("div", { className: Le(`ps-tryon-modal${
|
|
18437
|
+
oA !== "idle" && typeof document < "u" && vg(
|
|
18438
|
+
/* @__PURE__ */ A("div", { className: Le("ps-tryon-overlay", L.overlay), style: Fg, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ e("div", { className: Le(`ps-tryon-modal${oA === "result" && iA && dA || oA === "size-result" || oA === "estimation-review" || oA === "body-profile" || oA === "profiles" || oA === "no-chart" || oA === "photo-guide" ? " ps-tryon-modal-wide" : ""}`, L.modal), onClick: (B) => B.stopPropagation(), children: [
|
|
18439
18439
|
/* @__PURE__ */ e("div", { className: Le("ps-tryon-header ps-tryon-header-minimal", L.header), children: [
|
|
18440
18440
|
/* @__PURE__ */ A(Sn, { activeLocale: T, onSelect: aA }),
|
|
18441
18441
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("Profiles"), onClick: () => {
|
|
18442
|
-
KA && D(null),
|
|
18442
|
+
KA && D(null), oA === "profiles" ? (N(uA.current || "body-profile"), uA.current = null) : (uA.current = oA, N("profiles"));
|
|
18443
18443
|
}, children: /* @__PURE__ */ A(Pg, {}) }),
|
|
18444
18444
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("History"), onClick: () => {
|
|
18445
|
-
|
|
18445
|
+
oA === "profiles" && (N(uA.current || "body-profile"), uA.current = null), KA === "history" ? D(null) : (uA.current = uA.current || oA, D("history"));
|
|
18446
18446
|
}, children: /* @__PURE__ */ A(Ln, {}) }),
|
|
18447
18447
|
/* @__PURE__ */ A("button", { onClick: ao, className: Le("ps-tryon-close", L.closeButton), children: /* @__PURE__ */ A(Bt, {}) })
|
|
18448
18448
|
] }),
|
|
18449
|
-
|
|
18449
|
+
oA !== "body-profile" && oA !== "processing" && !(oA === "size-result" && BA?.sections && Object.keys(BA.sections).length > 1) && /* @__PURE__ */ A(Kn, { view: oA, stepIndex: mt }),
|
|
18450
18450
|
/* @__PURE__ */ e("div", { ref: U, className: Le("ps-tryon-body", L.body), style: { position: "relative", overflow: KA ? "hidden" : void 0 }, children: [
|
|
18451
18451
|
Ft && /* @__PURE__ */ e("button", { className: "ps-tryon-back-btn", onClick: yt, children: [
|
|
18452
18452
|
/* @__PURE__ */ e("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|