@primestyleai/tryon 5.10.16 → 5.10.17

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { P as an, L as _P, b as Qg, a as AP, c as Hg, A as zg, S as cg, i as pg } from "../index-DcgOUANg.js";
3
- import { jsxs as P, jsx as A, Fragment as tA } from "react/jsx-runtime";
4
- import { useState as j, useRef as iA, useCallback as UA, useEffect as JA, useMemo as wf } from "react";
3
+ import { jsxs as P, jsx as A, Fragment as rA } from "react/jsx-runtime";
4
+ import { useState as j, useRef as tA, useCallback as UA, useEffect as JA, useMemo as vf } from "react";
5
5
  import { createPortal as lP } from "react-dom";
6
6
  const sP = 11, TP = 12, An = 13, fn = 14, Pn = 15, nn = 16, GP = 23, YP = 24, gn = 25, Bn = 26, en = 27, on = 28, wn = 0;
7
7
  let HP = null, BP = null;
@@ -6786,7 +6786,7 @@ function $g({ view: f, stepIndex: n }) {
6786
6786
  return f === "error" || f === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: sg }, (g, e) => e + 1).map((g) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${g < n ? " ps-done" : g === n ? " ps-active" : ""}` }, g)) });
6787
6787
  }
6788
6788
  function _g({ activeLocale: f, onSelect: n }) {
6789
- const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = UA(() => {
6789
+ const [g, e] = j(!1), B = tA(null), C = tA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = UA(() => {
6790
6790
  if (!B.current) return;
6791
6791
  const z = B.current.getBoundingClientRect();
6792
6792
  i({ top: z.bottom + 4, right: window.innerWidth - z.right });
@@ -6800,7 +6800,7 @@ function _g({ activeLocale: f, onSelect: n }) {
6800
6800
  return document.addEventListener("mousedown", z), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
6801
6801
  document.removeEventListener("mousedown", z), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
6802
6802
  };
6803
- }, [g, r]), /* @__PURE__ */ P(tA, { children: [
6803
+ }, [g, r]), /* @__PURE__ */ P(rA, { children: [
6804
6804
  /* @__PURE__ */ P(
6805
6805
  "button",
6806
6806
  {
@@ -7002,7 +7002,7 @@ function PB({
7002
7002
  /* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(r ? "New Profile" : f === "profiles" ? "My Profiles" : "History") }),
7003
7003
  f === "profiles" && !r && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => z(!0), children: "+" })
7004
7004
  ] }),
7005
- /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(tA, { children: [
7005
+ /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(rA, { children: [
7006
7006
  /* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
7007
7007
  "+ ",
7008
7008
  o("Create New Profile")
@@ -7020,7 +7020,7 @@ function PB({
7020
7020
  ] }),
7021
7021
  /* @__PURE__ */ A(mg, {})
7022
7022
  ] }, F.id))
7023
- ] }) : /* @__PURE__ */ A(tA, { children: B.length === 0 ? /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-empty", children: o("No history yet.") }) : /* @__PURE__ */ P(tA, { children: [
7023
+ ] }) : /* @__PURE__ */ A(rA, { children: B.length === 0 ? /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-empty", children: o("No history yet.") }) : /* @__PURE__ */ P(rA, { children: [
7024
7024
  B.map((F, h) => /* @__PURE__ */ P("div", { className: "ps-tryon-history-item ps-tryon-history-clickable", onClick: () => i(F), children: [
7025
7025
  /* @__PURE__ */ P("div", { className: "ps-tryon-history-images", children: [
7026
7026
  F.productImage && /* @__PURE__ */ A("img", { src: F.productImage, alt: "", className: "ps-tryon-history-thumb" }),
@@ -7401,7 +7401,7 @@ function CB({ landmarks: f, w: n, h: g }) {
7401
7401
  }
7402
7402
  const wP = 22, bP = 27, IP = 2 * Math.PI * bP;
7403
7403
  function iB({ t: f }) {
7404
- const n = iA(Date.now()), g = iA(null), e = iA(null), B = iA(null), C = iA(null);
7404
+ const n = tA(Date.now()), g = tA(null), e = tA(null), B = tA(null), C = tA(null);
7405
7405
  return JA(() => {
7406
7406
  n.current = Date.now();
7407
7407
  const D = setInterval(() => {
@@ -7540,7 +7540,7 @@ function HB({
7540
7540
  onImageLoad: W,
7541
7541
  t
7542
7542
  }) {
7543
- const k = wf(() => {
7543
+ const k = vf(() => {
7544
7544
  const I = [...g?.matchDetails || []];
7545
7545
  if (g?.sections)
7546
7546
  for (const O of Object.values(g.sections))
@@ -7684,7 +7684,7 @@ const zB = [
7684
7684
  ["rightKnee", "rightAnkle"]
7685
7685
  ], vP = 22, uP = 27, RP = 2 * Math.PI * uP;
7686
7686
  function kn({ t: f, isActive: n }) {
7687
- const g = iA(null), e = iA(null), B = iA(null), C = iA(null), D = iA(null);
7687
+ const g = tA(null), e = tA(null), B = tA(null), C = tA(null), D = tA(null);
7688
7688
  return JA(() => {
7689
7689
  if (!n) {
7690
7690
  g.current = null;
@@ -7921,8 +7921,8 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
7921
7921
  return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${i} ${o}`, preserveAspectRatio: "xMidYMid meet", children: D.map(({ key: T, line: F, label: h }, W) => {
7922
7922
  if (!F || typeof F.x1 != "number" || typeof F.x2 != "number" || typeof F.y != "number") return null;
7923
7923
  const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2, N = n.find((mA) => {
7924
- const dA = mA.area.toLowerCase().trim();
7925
- return !!(dA === T || T === "chest" && (dA.includes("bust") || dA.includes("chest")) || T === "waist" && dA.includes("waist") || T === "hips" && (dA.includes("hip") || dA === "hips"));
7924
+ const EA = mA.area.toLowerCase().trim();
7925
+ return !!(EA === T || T === "chest" && (EA.includes("bust") || EA.includes("chest")) || T === "waist" && EA.includes("waist") || T === "hips" && (EA.includes("hip") || EA === "hips"));
7926
7926
  }), K = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = N ? N.fit === "good" ? "✓ Fit" : N.isLength ? N.fit.includes("short") || N.fit.includes("tight") ? "Short" : "Long" : N.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * r), y = hA.length * l * 0.62, sA = i - k - 12 * r < y, V = sA ? t - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * r : k + 6 * r;
7927
7927
  return /* @__PURE__ */ P("g", { children: [
7928
7928
  /* @__PURE__ */ A(
@@ -8056,11 +8056,11 @@ function DP({
8056
8056
  renderRaw: N = !1,
8057
8057
  sectionFound: K
8058
8058
  }) {
8059
- const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, dA] = j(null), ZA = wf(() => {
8059
+ const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, EA] = j(null), ZA = vf(() => {
8060
8060
  if (!D) return [];
8061
8061
  const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0, H = a.headers[nA] || "Size", oA = a.rows.map((zA) => Uf(zA, nA, H)).filter(Boolean);
8062
8062
  return [...new Set(oA)];
8063
- }, [D]), Hf = wf(() => {
8063
+ }, [D]), Hf = vf(() => {
8064
8064
  if (!D) return {};
8065
8065
  const a = D.section, X = a.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
8066
8066
  if (X < 0) return {};
@@ -8072,7 +8072,7 @@ function DP({
8072
8072
  zA && YA && (H[String(zA).trim()] = String(YA).trim());
8073
8073
  }
8074
8074
  return H;
8075
- }, [D]), m = wf(() => {
8075
+ }, [D]), m = vf(() => {
8076
8076
  const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
8077
8077
  if (a >= 0) return a;
8078
8078
  for (let X = 0; X < n.headers.length; X++) {
@@ -8080,14 +8080,14 @@ function DP({
8080
8080
  if (n.rows.some((H) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(H, X, nA)))) return X;
8081
8081
  }
8082
8082
  return 0;
8083
- }, [n]), EA = n.headers[m] || "Size", TA = wf(() => {
8084
- const a = n.rows.map((X) => Uf(X, m, EA)).filter(Boolean);
8083
+ }, [n]), aA = n.headers[m] || "Size", TA = vf(() => {
8084
+ const a = n.rows.map((X) => Uf(X, m, aA)).filter(Boolean);
8085
8085
  return [...new Set(a)];
8086
- }, [n, m, EA]), bA = BA || E, VA = bA === E, kA = wf(() => {
8086
+ }, [n, m, aA]), bA = BA || E, VA = bA === E, kA = vf(() => {
8087
8087
  if (VA) return null;
8088
8088
  const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((H) => X.test(H.fit || ""));
8089
8089
  return o(nA ? "Not Recommended" : "Your Selection");
8090
- }, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = wf(() => {
8090
+ }, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = vf(() => {
8091
8091
  const a = [];
8092
8092
  for (let X = 0; X < n.headers.length; X++) {
8093
8093
  const nA = (n.headers[X] || "").toLowerCase();
@@ -8130,13 +8130,13 @@ function DP({
8130
8130
  if (zA.length === 0) return null;
8131
8131
  let YA = zA.find((AA) => SA[AA] === oA);
8132
8132
  YA == null && (YA = zA[0]);
8133
- const of = n.headers[YA], J = X.trim().toLowerCase();
8134
- let gA = n.rows.find((AA) => Uf(AA, m, EA) === X);
8135
- if (gA || (gA = n.rows.find((AA) => Uf(AA, m, EA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
8136
- const LA = Uf(AA, m, EA).trim().toLowerCase();
8133
+ const wf = n.headers[YA], J = X.trim().toLowerCase();
8134
+ let gA = n.rows.find((AA) => Uf(AA, m, aA) === X);
8135
+ if (gA || (gA = n.rows.find((AA) => Uf(AA, m, aA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
8136
+ const LA = Uf(AA, m, aA).trim().toLowerCase();
8137
8137
  return LA.startsWith(J) || J.startsWith(LA);
8138
8138
  })), !gA) return null;
8139
- const Bf = Uf(gA, YA, of);
8139
+ const Bf = Uf(gA, YA, wf);
8140
8140
  if (!Bf) return null;
8141
8141
  const FA = QP(Bf), OA = SA[YA];
8142
8142
  if (OA === "in" && H) {
@@ -8148,7 +8148,7 @@ function DP({
8148
8148
  return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
8149
8149
  }
8150
8150
  return { range: Bf, ...FA };
8151
- }, [n, m, EA, B, SA]), rA = wf(() => {
8151
+ }, [n, m, aA, B, SA]), iA = vf(() => {
8152
8152
  if (N)
8153
8153
  return (g?.matchDetails || []).map((gA) => ({
8154
8154
  area: gA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || gA.measurement,
@@ -8170,28 +8170,28 @@ function DP({
8170
8170
  });
8171
8171
  }
8172
8172
  if (!nA.length) return [];
8173
- const of = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
8173
+ const wf = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
8174
8174
  return nA.map((J) => {
8175
- if (of.has(J.measurement)) {
8175
+ if (wf.has(J.measurement)) {
8176
8176
  const U = e[J.measurement.toLowerCase()] || kf(J.userValue), R = mA || zA || J.chartRange;
8177
8177
  if (!D)
8178
8178
  return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
8179
- const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), aA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = aA >= 0 ? aA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
8179
+ const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), dA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = dA >= 0 ? dA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
8180
8180
  let ef = R, yA = "good";
8181
8181
  if ($A && NA >= 0) {
8182
8182
  const KA = Uf($A, NA, G.headers[NA]);
8183
8183
  if (KA) {
8184
8184
  ef = KA;
8185
- const { min: vf, max: M } = QP(KA);
8186
- if (vf > 0 && M > 0) {
8187
- const cA = M - vf, pA = cA > 0 ? cA * 0.5 : vf * 0.05 || 3, tf = Math.max((M || vf) * 5e-3, 0.25);
8188
- if (U >= vf - tf && U <= M + tf) yA = "good";
8189
- else if (U < vf) {
8190
- const Df = vf - U;
8191
- yA = Df > pA * 2 ? "too-tight" : Df > pA ? "tight" : "a-bit-tight";
8185
+ const { min: Df, max: M } = QP(KA);
8186
+ if (Df > 0 && M > 0) {
8187
+ const cA = M - Df, pA = cA > 0 ? cA * 0.5 : Df * 0.05 || 3, tf = Math.max((M || Df) * 5e-3, 0.25);
8188
+ if (U >= Df - tf && U <= M + tf) yA = "good";
8189
+ else if (U < Df) {
8190
+ const Cf = Df - U;
8191
+ yA = Cf > pA * 2 ? "too-tight" : Cf > pA ? "tight" : "a-bit-tight";
8192
8192
  } else {
8193
- const Df = U - M;
8194
- yA = Df > pA * 2 ? "too-loose" : Df > pA ? "loose" : "a-bit-loose";
8193
+ const Cf = U - M;
8194
+ yA = Cf > pA * 2 ? "too-loose" : Cf > pA ? "loose" : "a-bit-loose";
8195
8195
  }
8196
8196
  }
8197
8197
  }
@@ -8219,9 +8219,9 @@ function DP({
8219
8219
  }
8220
8220
  return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength: x };
8221
8221
  });
8222
- }, [g, D, e, bA, E, ff, mA, RA, N]), nf = rA.filter(
8222
+ }, [g, D, e, bA, E, ff, mA, RA, N]), nf = iA.filter(
8223
8223
  (a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
8224
- ).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
8224
+ ).length, xA = iA.length > 0 ? Math.round(nf / iA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
8225
8225
  (a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
8226
8226
  ), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf = eA?.length || RA || Of, Mf = eA?.availableSizes || [], gf = eA?.availableLengths || [], qA = mA || cf, GA = Mf.length > 0 ? Mf : TA, _ = (() => {
8227
8227
  if (GA.length <= 3) return GA;
@@ -8361,18 +8361,18 @@ function DP({
8361
8361
  ] }),
8362
8362
  /* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: o("Based on your measurements and the garment's tailoring chart.") })
8363
8363
  ] }),
8364
- K !== !1 && rA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
8364
+ K !== !1 && iA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
8365
8365
  /* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
8366
8366
  /* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
8367
- /* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((H, oA) => {
8368
- const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", of = X(H.area), J = String(oA + 1).padStart(2, "0");
8367
+ /* @__PURE__ */ A("div", { className: "ps-msd-rows", children: iA.map((H, oA) => {
8368
+ const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", wf = X(H.area), J = String(oA + 1).padStart(2, "0");
8369
8369
  return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
8370
8370
  /* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
8371
8371
  J,
8372
8372
  " ",
8373
8373
  H.area.toUpperCase()
8374
8374
  ] }),
8375
- of && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: of }),
8375
+ wf && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: wf }),
8376
8376
  /* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
8377
8377
  /* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
8378
8378
  /* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
@@ -8416,7 +8416,7 @@ function DP({
8416
8416
  {
8417
8417
  type: "button",
8418
8418
  className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
8419
- onClick: () => dA(H === cf ? null : H),
8419
+ onClick: () => EA(H === cf ? null : H),
8420
8420
  style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
8421
8421
  children: [
8422
8422
  /* @__PURE__ */ A("span", { children: H }),
@@ -8522,7 +8522,7 @@ function DP({
8522
8522
  /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: o("No matching size") }),
8523
8523
  /* @__PURE__ */ A("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.8vw 0 0.5vw", lineHeight: 1.4 }, children: o("We couldn't find a size that fits for this product.") }),
8524
8524
  /* @__PURE__ */ A("p", { style: { fontSize: "0.72vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
8525
- ] }) : /* @__PURE__ */ P(tA, { children: [
8525
+ ] }) : /* @__PURE__ */ P(rA, { children: [
8526
8526
  /* @__PURE__ */ A("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: VA ? o("Recommended Size") : kA ?? o("Your Selection") }),
8527
8527
  /* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.5vw", marginTop: "0.35vw", marginBottom: "0.4vw" }, children: [
8528
8528
  V.length > 1 && /* @__PURE__ */ P(
@@ -8586,16 +8586,16 @@ function DP({
8586
8586
  o("Match based on your silhouette profile")
8587
8587
  ] })
8588
8588
  ] }),
8589
- rA.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__ */ P("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
8589
+ iA.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__ */ P("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
8590
8590
  /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ P("tr", { children: [
8591
8591
  /* @__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: o("Measurement") }),
8592
8592
  /* @__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: o("Your Body") }),
8593
8593
  /* @__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: o("Garment Spec") }),
8594
8594
  /* @__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: o("Fit Result") })
8595
8595
  ] }) }),
8596
- /* @__PURE__ */ A("tbody", { children: rA.map((a, X) => {
8596
+ /* @__PURE__ */ A("tbody", { children: iA.map((a, X) => {
8597
8597
  const nA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
8598
- return /* @__PURE__ */ P("tr", { style: { borderBottom: X < rA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
8598
+ return /* @__PURE__ */ P("tr", { style: { borderBottom: X < iA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
8599
8599
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
8600
8600
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${XA(a.userNum)} ${B}` }),
8601
8601
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawChartRange || "—" : sA(a.chartLabel) }),
@@ -8644,7 +8644,7 @@ function DP({
8644
8644
  return /* @__PURE__ */ P(
8645
8645
  "button",
8646
8646
  {
8647
- onClick: () => dA(a === cf ? null : a),
8647
+ onClick: () => EA(a === cf ? null : a),
8648
8648
  style: {
8649
8649
  padding: "0.35vw 0.7vw",
8650
8650
  borderRadius: "0.35vw",
@@ -8769,7 +8769,7 @@ function EB({
8769
8769
  userHeightCm: BA,
8770
8770
  t: c
8771
8771
  }) {
8772
- const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA = wf(() => {
8772
+ const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA = vf(() => {
8773
8773
  if (!g?.headers || !g?.rows) return -1;
8774
8774
  const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
8775
8775
  if (U >= 0) return U;
@@ -8779,8 +8779,8 @@ function EB({
8779
8779
  }
8780
8780
  return 0;
8781
8781
  }, [g, s]), RA = g?.headers?.[PA] || c("Size");
8782
- wf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
8783
- const mA = wf(() => {
8782
+ vf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
8783
+ const mA = vf(() => {
8784
8784
  if (!g?.headers || !g?.rows) return [];
8785
8785
  const U = [];
8786
8786
  for (let R = 0; R < g.headers.length; R++) {
@@ -8794,8 +8794,8 @@ function EB({
8794
8794
  continue;
8795
8795
  }
8796
8796
  let S = null;
8797
- for (const aA of g.rows) {
8798
- const fA = String(s(aA, R, g.headers[R]) || "").trim();
8797
+ for (const dA of g.rows) {
8798
+ const fA = String(s(dA, R, g.headers[R]) || "").trim();
8799
8799
  if (fA) {
8800
8800
  if (/cm\b|centimeter/i.test(fA)) {
8801
8801
  S = "cm";
@@ -8810,9 +8810,9 @@ function EB({
8810
8810
  U.push(S);
8811
8811
  }
8812
8812
  return U;
8813
- }, [g, s]), dA = UA((U, R) => {
8813
+ }, [g, s]), EA = UA((U, R) => {
8814
8814
  if (!g?.headers || !g?.rows || PA < 0) return null;
8815
- const G = U.toLowerCase().trim(), S = y === "cm" || y === "", aA = S ? "cm" : "in", fA = [];
8815
+ const G = U.toLowerCase().trim(), S = y === "cm" || y === "", dA = S ? "cm" : "in", fA = [];
8816
8816
  for (let M = 0; M < g.headers.length; M++) {
8817
8817
  const cA = (g.headers[M] || "").toLowerCase().trim();
8818
8818
  if (cA === G) {
@@ -8823,25 +8823,25 @@ function EB({
8823
8823
  (pA === G || cA.includes(G) || G.includes(pA)) && fA.push(M);
8824
8824
  }
8825
8825
  if (fA.length === 0) return null;
8826
- let NA = fA.find((M) => mA[M] === aA);
8826
+ let NA = fA.find((M) => mA[M] === dA);
8827
8827
  NA == null && (NA = fA[0]);
8828
8828
  const $A = g.headers[NA], ef = g.rows.find((M) => s(M, PA, RA) === R);
8829
8829
  if (!ef) return null;
8830
8830
  const yA = s(ef, NA, $A);
8831
8831
  if (!yA) return null;
8832
- const KA = V(yA), vf = mA[NA];
8833
- if (vf === "in" && S) {
8832
+ const KA = V(yA), Df = mA[NA];
8833
+ if (Df === "in" && S) {
8834
8834
  const M = (cA) => +(cA * 2.54).toFixed(1);
8835
8835
  return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
8836
8836
  }
8837
- if (vf === "cm" && !S) {
8837
+ if (Df === "cm" && !S) {
8838
8838
  const M = (cA) => +(cA / 2.54).toFixed(1);
8839
8839
  return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
8840
8840
  }
8841
8841
  return { range: yA, ...KA };
8842
8842
  }, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
8843
- wf(() => n?.internationalSizes || {}, [n]);
8844
- const [Hf, m] = j("fit"), [EA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
8843
+ vf(() => n?.internationalSizes || {}, [n]);
8844
+ const [Hf, m] = j("fit"), [aA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [iA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
8845
8845
  const R = U.currentTarget;
8846
8846
  R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
8847
8847
  }, []);
@@ -8857,8 +8857,8 @@ function EB({
8857
8857
  });
8858
8858
  }, [e, t]);
8859
8859
  const [Of, cf] = j(!1), [Mf, gf] = j(!1);
8860
- iA(null);
8861
- const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA, H] = j(null), [oA, zA] = j(!1);
8860
+ tA(null);
8861
+ const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = tA(null), [nA, H] = j(null), [oA, zA] = j(!1);
8862
8862
  JA(() => {
8863
8863
  if (_) {
8864
8864
  const U = URL.createObjectURL(_);
@@ -8866,8 +8866,8 @@ function EB({
8866
8866
  }
8867
8867
  H(null);
8868
8868
  }, [_]);
8869
- const YA = EA || ZA;
8870
- wf(() => {
8869
+ const YA = aA || ZA;
8870
+ vf(() => {
8871
8871
  if (!n?.matchDetails?.length) return [];
8872
8872
  const U = /* @__PURE__ */ new Set();
8873
8873
  return n.matchDetails.filter((G) => {
@@ -8875,13 +8875,13 @@ function EB({
8875
8875
  return U.has(S) ? !1 : (U.add(S), !0);
8876
8876
  }).map((G) => {
8877
8877
  const S = kf(G.userValue);
8878
- let aA = G.chartRange, fA = G.fit;
8878
+ let dA = G.chartRange, fA = G.fit;
8879
8879
  if (YA !== ZA) {
8880
- const NA = dA(G.measurement, YA);
8880
+ const NA = EA(G.measurement, YA);
8881
8881
  if (NA && NA.min > 0) {
8882
- aA = kP(NA.range);
8883
- const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, vf = Math.max((ef || $A) * 5e-3, 0.25);
8884
- if (S >= $A - vf && S <= ef + vf) fA = "good";
8882
+ dA = kP(NA.range);
8883
+ const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, Df = Math.max((ef || $A) * 5e-3, 0.25);
8884
+ if (S >= $A - Df && S <= ef + Df) fA = "good";
8885
8885
  else if (S < $A) {
8886
8886
  const M = $A - S;
8887
8887
  fA = M > KA * 2 ? "too-loose" : M > KA ? "loose" : "a-bit-loose";
@@ -8891,9 +8891,9 @@ function EB({
8891
8891
  }
8892
8892
  }
8893
8893
  }
8894
- return { area: G.measurement, userNum: kf(G.userValue), chartLabel: aA, fit: fA };
8894
+ return { area: G.measurement, userNum: kf(G.userValue), chartLabel: dA, fit: fA };
8895
8895
  });
8896
- }, [n, YA, ZA, dA]), wf(() => {
8896
+ }, [n, YA, ZA, EA]), vf(() => {
8897
8897
  if (!g?.headers || !g?.rows || PA < 0) return null;
8898
8898
  const U = g.rows.find((G) => s(G, PA, RA) === YA);
8899
8899
  if (!U) return null;
@@ -8901,24 +8901,24 @@ function EB({
8901
8901
  for (let G = 0; G < g.headers.length; G++) {
8902
8902
  const S = g.headers[G] || "";
8903
8903
  if (G === PA) continue;
8904
- const aA = s(U, G, S);
8905
- aA && R.push({ header: S, value: aA });
8904
+ const dA = s(U, G, S);
8905
+ dA && R.push({ header: S, value: dA });
8906
8906
  }
8907
8907
  return R;
8908
8908
  }, [g, PA, RA, YA, s]);
8909
- const of = !!(g?.sections && Object.keys(g.sections).length > 1), J = wf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
8909
+ const wf = !!(g?.sections && Object.keys(g.sections).length > 1), J = vf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
8910
8910
  const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
8911
- (aA) => U.toLowerCase().includes(aA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
8911
+ (dA) => U.toLowerCase().includes(dA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
8912
8912
  ) || { headers: [], rows: [], requiredFields: [] }, S = {};
8913
8913
  if (R.matchDetails)
8914
- for (const aA of R.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
8914
+ for (const dA of R.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
8915
8915
  return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
8916
- }) : !of || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
8916
+ }) : !wf || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
8917
8917
  const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
8918
8918
  if (G.matchDetails)
8919
- for (const aA of G.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
8919
+ for (const dA of G.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
8920
8920
  return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: R, secResult: G, userMeasurements: S };
8921
- }), [of, g, n, BA]), gA = wf(() => J.filter((U) => !zn(U.name)), [J]), Bf = wf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
8921
+ }), [wf, g, n, BA]), gA = vf(() => J.filter((U) => !zn(U.name)), [J]), Bf = vf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
8922
8922
  n?.found;
8923
8923
  const QA = v === "foot";
8924
8924
  return console.log("[PS-SDK] SizeResultView render:", {
@@ -8989,8 +8989,8 @@ function EB({
8989
8989
  ) });
8990
8990
  })()
8991
8991
  ] }),
8992
- (lA || n && !OA) && /* @__PURE__ */ P(tA, { children: [
8993
- of ? O ? (
8992
+ (lA || n && !OA) && /* @__PURE__ */ P(rA, { children: [
8993
+ wf ? O ? (
8994
8994
  /* ── Detail view for a single section ── */
8995
8995
  (() => {
8996
8996
  const U = gA.find((R) => R.name === O);
@@ -9014,10 +9014,10 @@ function EB({
9014
9014
  showLines: kA,
9015
9015
  onToggleLines: q ? void 0 : () => vA(!kA),
9016
9016
  onImageLoad: _A,
9017
- overlayNode: e && xA && rA ? /* @__PURE__ */ A(
9017
+ overlayNode: e && xA && iA ? /* @__PURE__ */ A(
9018
9018
  $f,
9019
9019
  {
9020
- lines: rA,
9020
+ lines: iA,
9021
9021
  fitRows: (() => {
9022
9022
  const R = [...n?.matchDetails || []];
9023
9023
  if (n?.sections)
@@ -9025,8 +9025,8 @@ function EB({
9025
9025
  S.matchDetails && R.push(...S.matchDetails);
9026
9026
  const G = /* @__PURE__ */ new Set();
9027
9027
  return R.filter((S) => {
9028
- const aA = S.measurement.toLowerCase();
9029
- return G.has(aA) ? !1 : (G.add(aA), !0);
9028
+ const dA = S.measurement.toLowerCase();
9029
+ return G.has(dA) ? !1 : (G.add(dA), !0);
9030
9030
  }).map((S) => ({ area: S.measurement, userNum: parseFloat(S.userValue) || 0, chartLabel: S.chartRange || "", fit: S.fit }));
9031
9031
  })(),
9032
9032
  show: kA,
@@ -9080,10 +9080,10 @@ function EB({
9080
9080
  showLines: kA,
9081
9081
  onToggleLines: q ? void 0 : () => vA(!kA),
9082
9082
  onImageLoad: _A,
9083
- overlayNode: e && xA && rA ? /* @__PURE__ */ A(
9083
+ overlayNode: e && xA && iA ? /* @__PURE__ */ A(
9084
9084
  $f,
9085
9085
  {
9086
- lines: rA,
9086
+ lines: iA,
9087
9087
  fitRows: (() => {
9088
9088
  const U = [...n?.matchDetails || []];
9089
9089
  if (n?.sections)
@@ -9113,7 +9113,7 @@ function EB({
9113
9113
  /* @__PURE__ */ A("span", { children: c("Generating try-on...") }),
9114
9114
  /* @__PURE__ */ A(kn, { t: c, isActive: !0 })
9115
9115
  ] }),
9116
- e && !t && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (() => {
9116
+ e && !t && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (() => {
9117
9117
  const U = [...n?.matchDetails || []];
9118
9118
  if (n?.sections)
9119
9119
  for (const G of Object.values(n.sections))
@@ -9149,8 +9149,8 @@ function EB({
9149
9149
  /* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: c("Tap any section for detailed breakdown") }),
9150
9150
  /* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
9151
9151
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: gA.map(({ name: U, secResult: R }, G) => {
9152
- const S = g?.sectionImages?.[U], aA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
9153
- return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${aA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
9152
+ const S = g?.sectionImages?.[U], dA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
9153
+ return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${dA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
9154
9154
  /* @__PURE__ */ P("div", { className: "ps-tryon-sr-card-v2-text", children: [
9155
9155
  /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: U.replace(/\s*[—–-]\s*.*/g, "") }),
9156
9156
  /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: fA.found === !1 ? c("No fit") : fA.size || R.recommendedSize }),
@@ -9213,7 +9213,7 @@ function EB({
9213
9213
  const U = g?.found ? { headers: g.headers || [], rows: g.rows || [], requiredFields: g.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, R = { recommendedSize: n?.recommendedSize || "", matchDetails: n?.matchDetails || [] }, G = {};
9214
9214
  if (n?.matchDetails)
9215
9215
  for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
9216
- const S = c("Your Fit"), aA = () => {
9216
+ const S = c("Your Fit"), dA = () => {
9217
9217
  e || (uA(p || null), GA(!0));
9218
9218
  };
9219
9219
  return x ? /* @__PURE__ */ A(
@@ -9230,7 +9230,7 @@ function EB({
9230
9230
  onBack: e ? E || (() => i("body-profile")) : () => i("body-profile"),
9231
9231
  backLabel: c("Back"),
9232
9232
  internationalSizes: n?.internationalSizes,
9233
- onTryOn: e || QA ? void 0 : aA,
9233
+ onTryOn: e || QA ? void 0 : dA,
9234
9234
  continueLabel: e ? c("Continue Shopping") : void 0,
9235
9235
  tryOnProcessing: t,
9236
9236
  productImage: e || B,
@@ -9241,10 +9241,10 @@ function EB({
9241
9241
  showLines: kA,
9242
9242
  onToggleLines: q ? void 0 : () => vA(!kA),
9243
9243
  onImageLoad: _A,
9244
- overlayNode: e && xA && rA ? /* @__PURE__ */ A(
9244
+ overlayNode: e && xA && iA ? /* @__PURE__ */ A(
9245
9245
  $f,
9246
9246
  {
9247
- lines: rA,
9247
+ lines: iA,
9248
9248
  fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })),
9249
9249
  show: kA,
9250
9250
  imgWidth: eA.w,
@@ -9256,7 +9256,7 @@ function EB({
9256
9256
  ) : /* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
9257
9257
  /* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
9258
9258
  /* @__PURE__ */ A("img", { src: e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
9259
- e && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
9259
+ e && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
9260
9260
  e && !t && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
9261
9261
  !q && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: c(kA ? "Hide Fit" : "Show Fit") }),
9262
9262
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: o, children: c("Download") })
@@ -9276,7 +9276,7 @@ function EB({
9276
9276
  onBack: e ? E || (() => i("body-profile")) : () => i("body-profile"),
9277
9277
  backLabel: c("Back"),
9278
9278
  internationalSizes: n?.internationalSizes,
9279
- onTryOn: e || QA ? void 0 : aA,
9279
+ onTryOn: e || QA ? void 0 : dA,
9280
9280
  continueLabel: e ? c("Continue Shopping") : void 0,
9281
9281
  tryOnProcessing: t,
9282
9282
  t: c,
@@ -9308,7 +9308,7 @@ function EB({
9308
9308
  }
9309
9309
  }
9310
9310
  ),
9311
- /* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(tA, { children: [
9311
+ /* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(rA, { children: [
9312
9312
  /* @__PURE__ */ A("img", { src: nA, alt: c("Your photo"), className: "ps-pm-preview-img" }),
9313
9313
  /* @__PURE__ */ A(
9314
9314
  "button",
@@ -9344,15 +9344,15 @@ function EB({
9344
9344
  /* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ A("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }) }),
9345
9345
  /* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
9346
9346
  /* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: c("Checklist for accuracy") }),
9347
- /* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(tA, { children: [
9347
+ /* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
9348
9348
  /* @__PURE__ */ A("li", { children: c("Face the camera directly at eye level") }),
9349
9349
  /* @__PURE__ */ A("li", { children: c("Remove any glasses you're wearing") }),
9350
9350
  /* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
9351
- ] }) : v === "head" ? /* @__PURE__ */ P(tA, { children: [
9351
+ ] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
9352
9352
  /* @__PURE__ */ A("li", { children: c("Head and shoulders in frame") }),
9353
9353
  /* @__PURE__ */ A("li", { children: c("Leave space above your head") }),
9354
9354
  /* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
9355
- ] }) : /* @__PURE__ */ P(tA, { children: [
9355
+ ] }) : /* @__PURE__ */ P(rA, { children: [
9356
9356
  /* @__PURE__ */ A("li", { children: c("Form-fitting clothing is recommended") }),
9357
9357
  /* @__PURE__ */ A("li", { children: c("Standing 2-3 meters from camera") }),
9358
9358
  /* @__PURE__ */ A("li", { children: c("Neutral background with good lighting") })
@@ -9424,10 +9424,10 @@ function EB({
9424
9424
  },
9425
9425
  className: "ps-tryon-upload-hover",
9426
9426
  children: [
9427
- _ && nA ? /* @__PURE__ */ P(tA, { children: [
9427
+ _ && nA ? /* @__PURE__ */ P(rA, { children: [
9428
9428
  /* @__PURE__ */ A("img", { src: nA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
9429
9429
  /* @__PURE__ */ A("div", { className: "ps-tryon-upload-hover-overlay", style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.4)", opacity: 0, transition: "opacity 0.2s", borderRadius: "0.5vw" }, children: /* @__PURE__ */ A("span", { style: { color: "#fff", fontSize: "0.8vw", fontWeight: 600 }, children: c("Click to change photo") }) })
9430
- ] }) : /* @__PURE__ */ P(tA, { children: [
9430
+ ] }) : /* @__PURE__ */ P(rA, { children: [
9431
9431
  /* @__PURE__ */ A(zP, { size: 32 }),
9432
9432
  /* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: c("Upload your photo") }),
9433
9433
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: c(v === "face" ? "Click or drag a close-up face photo" : v === "head" ? "Click or drag a head-and-shoulders photo" : "Click or drag a full-body photo") })
@@ -9455,7 +9455,7 @@ function EB({
9455
9455
  /* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
9456
9456
  /* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: c("Do") })
9457
9457
  ] }),
9458
- /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(tA, { children: [
9458
+ /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
9459
9459
  c("Face the camera directly, centered in frame"),
9460
9460
  /* @__PURE__ */ A("br", {}),
9461
9461
  c("Use natural, even lighting (e.g. near a window)"),
@@ -9463,7 +9463,7 @@ function EB({
9463
9463
  c("Keep hair away from your face and ears"),
9464
9464
  /* @__PURE__ */ A("br", {}),
9465
9465
  c("Choose a plain, light background")
9466
- ] }) : v === "head" ? /* @__PURE__ */ P(tA, { children: [
9466
+ ] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
9467
9467
  c("Face the camera with head and shoulders in frame"),
9468
9468
  /* @__PURE__ */ A("br", {}),
9469
9469
  c("Leave some space above your head"),
@@ -9471,7 +9471,7 @@ function EB({
9471
9471
  c("Use natural, even lighting"),
9472
9472
  /* @__PURE__ */ A("br", {}),
9473
9473
  c("Choose a plain, light background")
9474
- ] }) : /* @__PURE__ */ P(tA, { children: [
9474
+ ] }) : /* @__PURE__ */ P(rA, { children: [
9475
9475
  c("Stand facing the camera with your full body in frame"),
9476
9476
  /* @__PURE__ */ A("br", {}),
9477
9477
  c("Use natural or even lighting"),
@@ -9486,7 +9486,7 @@ function EB({
9486
9486
  /* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
9487
9487
  /* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: c("Don't") })
9488
9488
  ] }),
9489
- /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(tA, { children: [
9489
+ /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
9490
9490
  c("Don't wear sunglasses or a hat in the photo"),
9491
9491
  /* @__PURE__ */ A("br", {}),
9492
9492
  c("Don't tilt or turn your head"),
@@ -9494,7 +9494,7 @@ function EB({
9494
9494
  c("Don't use strong backlighting or flash"),
9495
9495
  /* @__PURE__ */ A("br", {}),
9496
9496
  c("Don't apply filters or edits")
9497
- ] }) : v === "head" ? /* @__PURE__ */ P(tA, { children: [
9497
+ ] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
9498
9498
  c("Don't wear a hat in the photo"),
9499
9499
  /* @__PURE__ */ A("br", {}),
9500
9500
  c("Don't crop out the top of your head"),
@@ -9502,7 +9502,7 @@ function EB({
9502
9502
  c("Don't use strong backlighting or flash"),
9503
9503
  /* @__PURE__ */ A("br", {}),
9504
9504
  c("Don't apply filters or edits")
9505
- ] }) : /* @__PURE__ */ P(tA, { children: [
9505
+ ] }) : /* @__PURE__ */ P(rA, { children: [
9506
9506
  c("Don't wear loose or baggy clothing"),
9507
9507
  /* @__PURE__ */ A("br", {}),
9508
9508
  c("Don't sit, pose, or bend"),
@@ -9542,7 +9542,7 @@ function EB({
9542
9542
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
9543
9543
  ] }),
9544
9544
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: g.sections && Object.keys(g.sections).length > 1 ? Object.entries(g.sections).map(([U, R]) => {
9545
- const S = n?.sections?.[U]?.recommendedSize || "", aA = R.headers.findIndex(($A) => /size|taglia|größe|taille|fit|length/i.test($A.trim())), fA = aA >= 0 ? aA : 0, NA = R.headers[fA] || "Size";
9545
+ const S = n?.sections?.[U]?.recommendedSize || "", dA = R.headers.findIndex(($A) => /size|taglia|größe|taille|fit|length/i.test($A.trim())), fA = dA >= 0 ? dA : 0, NA = R.headers[fA] || "Size";
9546
9546
  return /* @__PURE__ */ P("div", { className: "ps-tryon-chart-section", children: [
9547
9547
  /* @__PURE__ */ P("div", { className: "ps-tryon-chart-section-title", children: [
9548
9548
  /* @__PURE__ */ A("span", { children: U }),
@@ -9556,7 +9556,7 @@ function EB({
9556
9556
  /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: R.headers.map(($A, ef) => /* @__PURE__ */ A("th", { className: ef === fA ? "ps-size-col" : "", children: $A }, ef)) }) }),
9557
9557
  /* @__PURE__ */ A("tbody", { children: R.rows.map(($A, ef) => {
9558
9558
  const KA = Uf($A, fA, NA) === S;
9559
- return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((vf, M) => /* @__PURE__ */ A("td", { className: M === fA ? "ps-size-col" : "", children: Uf($A, M, vf) }, M)) }, ef);
9559
+ return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((Df, M) => /* @__PURE__ */ A("td", { className: M === fA ? "ps-size-col" : "", children: Uf($A, M, Df) }, M)) }, ef);
9560
9560
  }) })
9561
9561
  ] }) })
9562
9562
  ] }, U);
@@ -9566,7 +9566,7 @@ function EB({
9566
9566
  /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: g.headers.map((U, R) => /* @__PURE__ */ A("th", { className: R === PA ? "ps-size-col" : "", children: U }, R)) }) }),
9567
9567
  /* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
9568
9568
  const S = s(U, PA, RA) === YA;
9569
- return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((aA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, aA) }, fA)) }, R);
9569
+ return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((dA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, dA) }, fA)) }, R);
9570
9570
  }) })
9571
9571
  ] }) })
9572
9572
  ) : null })
@@ -9586,7 +9586,7 @@ function aB({
9586
9586
  cn: o,
9587
9587
  t: r
9588
9588
  }) {
9589
- return /* @__PURE__ */ A(tA, { children: f && n ? /* @__PURE__ */ P(tA, { children: [
9589
+ return /* @__PURE__ */ A(rA, { children: f && n ? /* @__PURE__ */ P(rA, { children: [
9590
9590
  /* @__PURE__ */ P("div", { className: Qf("ps-tryon-preview", o.preview), children: [
9591
9591
  /* @__PURE__ */ A("div", { className: "ps-tryon-preview-blur", style: { backgroundImage: `url(${n})` } }),
9592
9592
  /* @__PURE__ */ A("img", { src: n, alt: r("Your photo"), className: o.previewImage }),
@@ -9660,7 +9660,7 @@ function dB({
9660
9660
  }, []);
9661
9661
  return /* @__PURE__ */ P("div", { className: "ps-tryon-processing", children: [
9662
9662
  /* @__PURE__ */ P("div", { className: "ps-tryon-processing-image-wrap", children: [
9663
- f && /* @__PURE__ */ P(tA, { children: [
9663
+ f && /* @__PURE__ */ P(rA, { children: [
9664
9664
  /* @__PURE__ */ A("div", { className: "ps-tryon-processing-blur", style: { backgroundImage: `url(${f})` } }),
9665
9665
  /* @__PURE__ */ A("img", { src: f, alt: o("Your photo"), className: "ps-tryon-processing-model" })
9666
9666
  ] }),
@@ -9783,11 +9783,11 @@ function CP({
9783
9783
  ] }, f);
9784
9784
  }
9785
9785
  function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B }) {
9786
- const [C, D] = j(null), [i, o] = j("identity"), [r, z] = j("name-photo"), [p, T] = j(!1), [F, h] = j(null), W = iA(null);
9786
+ const [C, D] = j(null), [i, o] = j("identity"), [r, z] = j("name-photo"), [p, T] = j(!1), [F, h] = j(null), W = tA(null);
9787
9787
  JA(() => {
9788
9788
  W.current && (W.current.scrollTop = 0);
9789
9789
  }, [C, i]);
9790
- const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, dA] = j(!1), ZA = iA(null), Hf = iA(null), [m, EA] = j(!1), [TA, bA] = j(null), VA = () => {
9790
+ const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, EA] = j(!1), ZA = tA(null), Hf = tA(null), [m, aA] = j(!1), [TA, bA] = j(null), VA = () => {
9791
9791
  TA === !0 && ZA.current?.click();
9792
9792
  }, kA = async (x) => {
9793
9793
  const q = x.target.files?.[0];
@@ -9804,19 +9804,19 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
9804
9804
  s(B("Image must be under 10MB"));
9805
9805
  return;
9806
9806
  }
9807
- dA(!0);
9807
+ EA(!0);
9808
9808
  try {
9809
9809
  const QA = await AP(q);
9810
9810
  RA(QA), g?.(QA), s("");
9811
9811
  } catch {
9812
9812
  s(B("Failed to process image"));
9813
9813
  } finally {
9814
- dA(!1);
9814
+ EA(!1);
9815
9815
  }
9816
9816
  }
9817
9817
  }, vA = () => {
9818
9818
  RA(null), g?.(null), ZA.current && (ZA.current.value = "");
9819
- }, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["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"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1, nA = () => {
9819
+ }, [SA, ff] = j(null), [iA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["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"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1, nA = () => {
9820
9820
  if (I === "in") {
9821
9821
  const x = parseInt(E, 10), q = parseInt(c, 10);
9822
9822
  !isNaN(x) && x >= 0 && !isNaN(q) && q >= 0 && K(String(Math.round((x * 12 + q) * 2.54)));
@@ -9857,12 +9857,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
9857
9857
  weight: parseFloat(l),
9858
9858
  age: parseFloat(XA),
9859
9859
  chestProfile: SA || void 0,
9860
- midsectionProfile: rA || void 0,
9860
+ midsectionProfile: iA || void 0,
9861
9861
  hipProfile: GA ? eA || void 0 : xA || void 0,
9862
9862
  bandSize: GA && _A || void 0,
9863
9863
  cupSize: GA && cf || void 0
9864
9864
  };
9865
- }, of = () => {
9865
+ }, wf = () => {
9866
9866
  const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), q = parseFloat(l), QA = parseFloat(XA);
9867
9867
  return {
9868
9868
  name: t.trim(),
@@ -9881,7 +9881,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
9881
9881
  s(B("Please pick an option"));
9882
9882
  return;
9883
9883
  }
9884
- if (i === "stomach" && !rA) {
9884
+ if (i === "stomach" && !iA) {
9885
9885
  s(B("Please pick an option"));
9886
9886
  return;
9887
9887
  }
@@ -9962,7 +9962,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
9962
9962
  T(!1);
9963
9963
  return;
9964
9964
  }
9965
- const x = of();
9965
+ const x = wf();
9966
9966
  F && (x.measurements = F, x.measurementsUnit = "cm"), f(x);
9967
9967
  }, AA = () => {
9968
9968
  if (s(""), r === "details") {
@@ -10186,9 +10186,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
10186
10186
  title: B("STOMACH PROFILE"),
10187
10187
  subtitle: B("Describe your mid-section silhouette"),
10188
10188
  children: [
10189
- /* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: rA === "flat", onSelect: () => gA("stomach", "flat") }),
10190
- /* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: rA === "average", onSelect: () => gA("stomach", "average") }),
10191
- /* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: rA === "round", onSelect: () => gA("stomach", "round") })
10189
+ /* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: iA === "flat", onSelect: () => gA("stomach", "flat") }),
10190
+ /* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: iA === "average", onSelect: () => gA("stomach", "average") }),
10191
+ /* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: iA === "round", onSelect: () => gA("stomach", "round") })
10192
10192
  ]
10193
10193
  }
10194
10194
  ),
@@ -10345,7 +10345,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
10345
10345
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
10346
10346
  /* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${m ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (x) => {
10347
10347
  k(x.target.value), s("");
10348
- }, onAnimationEnd: () => EA(!1) }) })
10348
+ }, onAnimationEnd: () => aA(!1) }) })
10349
10349
  ] }) }),
10350
10350
  /* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
10351
10351
  /* @__PURE__ */ A("div", { className: "ps-cpw-photo-guide-title", children: B("HOW TO TAKE A GOOD PHOTO") }),
@@ -10431,7 +10431,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
10431
10431
  /* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
10432
10432
  /* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Analyzing your body measurements...") }),
10433
10433
  /* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.75vw" }, children: B("Using AI to estimate chest, waist, hips, shoulders, and more") })
10434
- ] }) : F ? /* @__PURE__ */ P(tA, { children: [
10434
+ ] }) : F ? /* @__PURE__ */ P(rA, { children: [
10435
10435
  /* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.8vw", marginBottom: "1vw" }, children: [
10436
10436
  /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "var(--ps-accent)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", width: "28", height: "28", children: /* @__PURE__ */ A("polyline", { points: "20 6 9 17 4 12" }) }),
10437
10437
  /* @__PURE__ */ P("div", { children: [
@@ -10478,7 +10478,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
10478
10478
  className: "ps-cpw-next-btn",
10479
10479
  onClick: () => {
10480
10480
  if (!t.trim()) {
10481
- EA(!0), Hf.current?.focus();
10481
+ aA(!0), Hf.current?.focus();
10482
10482
  return;
10483
10483
  }
10484
10484
  OA();
@@ -10602,7 +10602,7 @@ function A8({
10602
10602
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: BA ? /* @__PURE__ */ P("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
10603
10603
  /* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
10604
10604
  /* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
10605
- ] }) : /* @__PURE__ */ P(tA, { children: [
10605
+ ] }) : /* @__PURE__ */ P(rA, { children: [
10606
10606
  /* @__PURE__ */ A(
10607
10607
  "input",
10608
10608
  {
@@ -10618,7 +10618,7 @@ function A8({
10618
10618
  ] }) })
10619
10619
  ] }, K.key);
10620
10620
  }),
10621
- f.gender === "female" && /* @__PURE__ */ P(tA, { children: [
10621
+ f.gender === "female" && /* @__PURE__ */ P(rA, { children: [
10622
10622
  /* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
10623
10623
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
10624
10624
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r("BAND") }),
@@ -10665,7 +10665,7 @@ function A8({
10665
10665
  type: "button",
10666
10666
  className: "ps-pmv-btn-primary",
10667
10667
  onClick: N,
10668
- children: T ? r("SAVE") : /* @__PURE__ */ P(tA, { children: [
10668
+ children: T ? r("SAVE") : /* @__PURE__ */ P(rA, { children: [
10669
10669
  /* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
10670
10670
  r("CALCULATING")
10671
10671
  ] })
@@ -10855,7 +10855,7 @@ function g8({
10855
10855
  onEstimate: z,
10856
10856
  t: T
10857
10857
  }
10858
- ) : /* @__PURE__ */ P(tA, { children: [
10858
+ ) : /* @__PURE__ */ P(rA, { children: [
10859
10859
  /* @__PURE__ */ P("div", { className: "ps-msp-header", children: [
10860
10860
  /* @__PURE__ */ A("h2", { className: "ps-msp-title", children: T("My Sizing Profiles") }),
10861
10861
  /* @__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.") })
@@ -10928,14 +10928,14 @@ function w8({
10928
10928
  error: K,
10929
10929
  t: E
10930
10930
  }) {
10931
- const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), XA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, dA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, EA = (y - sA) / (V - sA) * 100, TA = (XA - dA) / (ZA - dA) * 100, bA = (nf) => {
10931
+ const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), XA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, EA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, aA = (y - sA) / (V - sA) * 100, TA = (XA - EA) / (ZA - EA) * 100, bA = (nf) => {
10932
10932
  const xA = Math.max(RA, Math.min(mA, nf));
10933
10933
  D(String(Math.floor(xA / 12))), o(String(xA % 12));
10934
10934
  }, VA = () => {
10935
10935
  f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
10936
10936
  }, kA = () => {
10937
10937
  f === "in" ? bA(c - 1) : B(String(Math.max(s, BA - 1)));
10938
- }, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), rA = () => T(String(Math.max(dA, XA - 1)));
10938
+ }, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), iA = () => T(String(Math.max(EA, XA - 1)));
10939
10939
  return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
10940
10940
  /* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
10941
10941
  /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
@@ -10945,7 +10945,7 @@ function w8({
10945
10945
  E("Using"),
10946
10946
  " ",
10947
10947
  /* @__PURE__ */ A("strong", { children: I }),
10948
- O && /* @__PURE__ */ P(tA, { children: [
10948
+ O && /* @__PURE__ */ P(rA, { children: [
10949
10949
  " · ",
10950
10950
  /* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: O, children: E("start fresh") })
10951
10951
  ] })
@@ -11027,7 +11027,7 @@ function w8({
11027
11027
  step: 1,
11028
11028
  value: y,
11029
11029
  onChange: (nf) => z(nf.target.value),
11030
- style: { "--ps-pct": `${EA}%` }
11030
+ style: { "--ps-pct": `${aA}%` }
11031
11031
  }
11032
11032
  ),
11033
11033
  /* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: vA, "aria-label": E("Increase"), children: /* @__PURE__ */ A(KP, {}) })
@@ -11043,13 +11043,13 @@ function w8({
11043
11043
  ] })
11044
11044
  ] }),
11045
11045
  /* @__PURE__ */ P("div", { className: "ps-bpm-slider-row", children: [
11046
- /* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: rA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
11046
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: iA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
11047
11047
  /* @__PURE__ */ A(
11048
11048
  "input",
11049
11049
  {
11050
11050
  type: "range",
11051
11051
  className: "ps-bpm-slider",
11052
- min: dA,
11052
+ min: EA,
11053
11053
  max: ZA,
11054
11054
  step: 1,
11055
11055
  value: XA,
@@ -11061,7 +11061,7 @@ function w8({
11061
11061
  ] })
11062
11062
  ] })
11063
11063
  ] }),
11064
- !N && /* @__PURE__ */ P(tA, { children: [
11064
+ !N && /* @__PURE__ */ P(rA, { children: [
11065
11065
  /* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: E("or") }) }),
11066
11066
  /* @__PURE__ */ P(
11067
11067
  "button",
@@ -11133,7 +11133,7 @@ function Zn({
11133
11133
  onAgeConfirmedChange: z,
11134
11134
  t: p
11135
11135
  }) {
11136
- const T = D === "close-up", F = iA(null), h = !!f, W = !h && r !== !0;
11136
+ const T = D === "close-up", F = tA(null), h = !!f, W = !h && r !== !0;
11137
11137
  return /* @__PURE__ */ P("div", { className: "ps-pm-root", children: [
11138
11138
  /* @__PURE__ */ P("div", { className: "ps-pm-header", children: [
11139
11139
  /* @__PURE__ */ A("h2", { className: "ps-pm-title", children: p(T ? "Upload a face photo or selfie" : "Review your photo") }),
@@ -11149,7 +11149,7 @@ function Zn({
11149
11149
  style: { display: "none" }
11150
11150
  }
11151
11151
  ),
11152
- /* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(tA, { children: [
11152
+ /* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(rA, { children: [
11153
11153
  /* @__PURE__ */ A("img", { src: f, alt: p("Your photo"), className: "ps-pm-preview-img" }),
11154
11154
  /* @__PURE__ */ A(
11155
11155
  "button",
@@ -11161,7 +11161,7 @@ function Zn({
11161
11161
  children: /* @__PURE__ */ A(C8, {})
11162
11162
  }
11163
11163
  )
11164
- ] }) : /* @__PURE__ */ P(tA, { children: [
11164
+ ] }) : /* @__PURE__ */ P(rA, { children: [
11165
11165
  /* @__PURE__ */ P(
11166
11166
  "button",
11167
11167
  {
@@ -11205,11 +11205,11 @@ function Zn({
11205
11205
  /* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A(D8, {}) }),
11206
11206
  /* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
11207
11207
  /* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: p("Checklist for accuracy") }),
11208
- /* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(tA, { children: [
11208
+ /* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(rA, { children: [
11209
11209
  /* @__PURE__ */ A("li", { children: p("Face the camera directly at eye level") }),
11210
11210
  /* @__PURE__ */ A("li", { children: p("Keep hair away from face and ears") }),
11211
11211
  /* @__PURE__ */ A("li", { children: p("Good lighting, plain background") })
11212
- ] }) : /* @__PURE__ */ P(tA, { children: [
11212
+ ] }) : /* @__PURE__ */ P(rA, { children: [
11213
11213
  /* @__PURE__ */ A("li", { children: p("Form-fitting clothing is recommended") }),
11214
11214
  /* @__PURE__ */ A("li", { children: p("Standing 2-3 meters from camera") }),
11215
11215
  /* @__PURE__ */ A("li", { children: p("Neutral background with good lighting") })
@@ -11397,11 +11397,11 @@ function z8({
11397
11397
  }) {
11398
11398
  const I = g ? r8 : t8, [O, N] = j("basics");
11399
11399
  O === "photo" || I.indexOf(O);
11400
- const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, dA] = j(XA), [ZA, Hf] = j(V), [m, EA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
11400
+ const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, EA] = j(XA), [ZA, Hf] = j(V), [m, aA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
11401
11401
  l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
11402
- ), [ff, rA] = j(
11402
+ ), [ff, iA] = j(
11403
11403
  y || i || (E ? "lbs" : "kg")
11404
- ), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [of, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
11404
+ ), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = tA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [wf, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
11405
11405
  const cA = M.target.files?.[0];
11406
11406
  if (!cA) return;
11407
11407
  if (qA !== !0) {
@@ -11454,17 +11454,17 @@ function z8({
11454
11454
  } else
11455
11455
  M = parseFloat(mA);
11456
11456
  return { heightVal: M, weightVal: parseFloat(TA) };
11457
- }, aA = g ? "female" : "male", fA = (M) => {
11457
+ }, dA = g ? "female" : "male", fA = (M) => {
11458
11458
  const cA = I.indexOf(M);
11459
11459
  return cA < I.length - 1 ? I[cA + 1] : "submit";
11460
11460
  }, NA = () => {
11461
11461
  const { heightVal: M, weightVal: cA } = S();
11462
- e.current.height = String(M), e.current.weight = String(cA), e.current.gender = aA, VA && (e.current.age = VA), D(vA), o(ff), p({
11462
+ e.current.height = String(M), e.current.weight = String(cA), e.current.gender = dA, VA && (e.current.age = VA), D(vA), o(ff), p({
11463
11463
  height: M,
11464
11464
  weight: cA,
11465
11465
  heightUnit: vA,
11466
11466
  weightUnit: ff,
11467
- gender: aA,
11467
+ gender: dA,
11468
11468
  age: VA ? parseInt(VA, 10) : void 0,
11469
11469
  chestProfile: WA || void 0,
11470
11470
  midsectionProfile: X,
@@ -11513,10 +11513,10 @@ function z8({
11513
11513
  weight: 0,
11514
11514
  heightUnit: vA,
11515
11515
  weightUnit: ff,
11516
- gender: aA
11516
+ gender: dA
11517
11517
  });
11518
11518
  }
11519
- }, [O, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, aA, F, h]), ef = (M) => {
11519
+ }, [O, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, dA, F, h]), ef = (M) => {
11520
11520
  const cA = I.indexOf(M);
11521
11521
  return cA > 0 ? I[cA - 1] : null;
11522
11522
  }, yA = UA(() => {
@@ -11528,7 +11528,7 @@ function z8({
11528
11528
  const M = ef(O);
11529
11529
  M ? N(M) : u();
11530
11530
  }
11531
- }, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!H : O === "bra" ? !!(gA && FA) : O === "photo", vf = O === I[I.length - 1];
11531
+ }, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!H : O === "bra" ? !!(gA && FA) : O === "photo", Df = O === I[I.length - 1];
11532
11532
  return O === "photo" ? K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
11533
11533
  Zn,
11534
11534
  {
@@ -11573,12 +11573,12 @@ function z8({
11573
11573
  userSelect: !eA && qA !== !0 ? "none" : void 0
11574
11574
  },
11575
11575
  "aria-hidden": !eA && qA !== !0,
11576
- children: eA ? /* @__PURE__ */ P(tA, { children: [
11576
+ children: eA ? /* @__PURE__ */ P(rA, { children: [
11577
11577
  /* @__PURE__ */ A("img", { src: eA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
11578
11578
  /* @__PURE__ */ A("button", { onClick: (M) => {
11579
11579
  M.stopPropagation(), R();
11580
11580
  }, 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: "×" })
11581
- ] }) : /* @__PURE__ */ P(tA, { children: [
11581
+ ] }) : /* @__PURE__ */ P(rA, { children: [
11582
11582
  /* @__PURE__ */ A(zP, { size: 32 }),
11583
11583
  /* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: v("Upload your photo") }),
11584
11584
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: v("Click or drag a full-body photo") }),
@@ -11787,7 +11787,7 @@ function z8({
11787
11787
  ] })
11788
11788
  ] }),
11789
11789
  /* @__PURE__ */ A("input", { ref: gf, type: "file", accept: "image/*", onChange: U, style: { display: "none" } }),
11790
- K ? /* @__PURE__ */ P(tA, { children: [
11790
+ K ? /* @__PURE__ */ P(rA, { children: [
11791
11791
  /* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
11792
11792
  /* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
11793
11793
  /* @__PURE__ */ A(
@@ -11844,15 +11844,15 @@ function z8({
11844
11844
  const M = () => {
11845
11845
  if (vA === "in") {
11846
11846
  const pA = (parseFloat(ZA) || 5) * 12 + (parseFloat(m) || 8);
11847
- dA(String(Math.round(pA * 2.54)));
11847
+ EA(String(Math.round(pA * 2.54)));
11848
11848
  }
11849
- ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), rA("kg"), D("cm"), o("kg"), z?.("cm");
11849
+ ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), iA("kg"), D("cm"), o("kg"), z?.("cm");
11850
11850
  }, cA = () => {
11851
11851
  if (vA === "cm") {
11852
11852
  const pA = parseFloat(mA) || 173, tf = Math.round(pA / 2.54);
11853
- Hf(String(Math.floor(tf / 12))), EA(String(tf % 12));
11853
+ Hf(String(Math.floor(tf / 12))), aA(String(tf % 12));
11854
11854
  }
11855
- ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), rA("lbs"), D("in"), o("lbs"), z?.("in");
11855
+ ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), iA("lbs"), D("in"), o("lbs"), z?.("in");
11856
11856
  };
11857
11857
  return K ? /* @__PURE__ */ A(
11858
11858
  w8,
@@ -11861,11 +11861,11 @@ function z8({
11861
11861
  wUnit: ff,
11862
11862
  isImperialMode: nf,
11863
11863
  height: mA,
11864
- setHeight: dA,
11864
+ setHeight: EA,
11865
11865
  heightFeet: ZA,
11866
11866
  setHeightFeet: Hf,
11867
11867
  heightInches: m,
11868
- setHeightInches: EA,
11868
+ setHeightInches: aA,
11869
11869
  weight: TA,
11870
11870
  setWeight: bA,
11871
11871
  age: VA,
@@ -11890,7 +11890,7 @@ function z8({
11890
11890
  v("Using"),
11891
11891
  " ",
11892
11892
  /* @__PURE__ */ A("strong", { children: W }),
11893
- t && /* @__PURE__ */ P(tA, { children: [
11893
+ t && /* @__PURE__ */ P(rA, { children: [
11894
11894
  " · ",
11895
11895
  /* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: t, children: v("start fresh") })
11896
11896
  ] })
@@ -11905,10 +11905,10 @@ function z8({
11905
11905
  vA === "in" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
11906
11906
  /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (pA) => Hf(pA.target.value), min: 3, max: 8 }),
11907
11907
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
11908
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => EA(pA.target.value), min: 0, max: 11 }),
11908
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => aA(pA.target.value), min: 0, max: 11 }),
11909
11909
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
11910
11910
  ] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
11911
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => dA(pA.target.value), min: 100, max: 250 }),
11911
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => EA(pA.target.value), min: 100, max: 250 }),
11912
11912
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
11913
11913
  ] })
11914
11914
  ] }),
@@ -11958,7 +11958,7 @@ function z8({
11958
11958
  /* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () => J(v("A moderate, proportionate chest")), onLeave: () => J("") }),
11959
11959
  /* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () => J(v("A wider, more muscular chest")), onLeave: () => J("") })
11960
11960
  ] }),
11961
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
11961
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
11962
11962
  ] }, "step-chest")),
11963
11963
  O === "midsection" && (K ? /* @__PURE__ */ A(
11964
11964
  iP,
@@ -11982,16 +11982,16 @@ function z8({
11982
11982
  "step-midsection-mobile"
11983
11983
  ) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
11984
11984
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
11985
- /* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
11985
+ /* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
11986
11986
  /* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
11987
11987
  /* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
11988
11988
  /* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
11989
- ] }) : /* @__PURE__ */ P(tA, { children: [
11989
+ ] }) : /* @__PURE__ */ P(rA, { children: [
11990
11990
  /* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
11991
11991
  /* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
11992
11992
  /* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
11993
11993
  ] }) }),
11994
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
11994
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
11995
11995
  ] }, "step-midsection")),
11996
11996
  O === "seat" && (K ? /* @__PURE__ */ A(
11997
11997
  iP,
@@ -12015,16 +12015,16 @@ function z8({
12015
12015
  "step-seat-mobile"
12016
12016
  ) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
12017
12017
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
12018
- /* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
12018
+ /* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
12019
12019
  /* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
12020
12020
  /* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
12021
12021
  /* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
12022
- ] }) : /* @__PURE__ */ P(tA, { children: [
12022
+ ] }) : /* @__PURE__ */ P(rA, { children: [
12023
12023
  /* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
12024
12024
  /* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
12025
12025
  /* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
12026
12026
  ] }) }),
12027
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
12027
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
12028
12028
  ] }, "step-seat")),
12029
12029
  O === "hips" && g && (K ? /* @__PURE__ */ A(
12030
12030
  iP,
@@ -12049,7 +12049,7 @@ function z8({
12049
12049
  /* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () => J(v("Hips proportionate to shoulders")), onLeave: () => J("") }),
12050
12050
  /* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () => J(v("Hips wider than shoulders")), onLeave: () => J("") })
12051
12051
  ] }),
12052
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
12052
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
12053
12053
  ] }, "step-hips")),
12054
12054
  O === "bra" && g && /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
12055
12055
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
@@ -12125,7 +12125,7 @@ function z8({
12125
12125
  q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
12126
12126
  ] }, "step-bra"),
12127
12127
  !(K && O === "basics") && (() => {
12128
- const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : vf ? v("Find My Size") + pA : v("Next");
12128
+ const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : Df ? v("Find My Size") + pA : v("Next");
12129
12129
  return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
12130
12130
  O !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
12131
12131
  /* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
@@ -12174,28 +12174,28 @@ function SP({
12174
12174
  }) {
12175
12175
  const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O, N] = j(() => {
12176
12176
  const m = {};
12177
- return n.forEach((EA) => {
12178
- m[EA.key] = i.current[EA.key] || "";
12177
+ return n.forEach((aA) => {
12178
+ m[aA.key] = i.current[aA.key] || "";
12179
12179
  }), m;
12180
- }), [K, E] = j(""), BA = iA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
12181
- const EA = m.target.files?.[0];
12182
- if (!EA) return;
12183
- const TA = URL.createObjectURL(EA);
12184
- y(EA), hA(TA);
12180
+ }), [K, E] = j(""), BA = tA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
12181
+ const aA = m.target.files?.[0];
12182
+ if (!aA) return;
12183
+ const TA = URL.createObjectURL(aA);
12184
+ y(aA), hA(TA);
12185
12185
  try {
12186
- const bA = await AP(EA);
12186
+ const bA = await AP(aA);
12187
12187
  sA(bA);
12188
12188
  } catch {
12189
12189
  }
12190
12190
  }, []), RA = UA(() => {
12191
12191
  c && URL.revokeObjectURL(c), y(null), hA(null), sA(null);
12192
- }, [c]), mA = (m, EA) => {
12193
- N((TA) => ({ ...TA, [m]: EA })), E("");
12194
- }, dA = () => {
12192
+ }, [c]), mA = (m, aA) => {
12193
+ N((TA) => ({ ...TA, [m]: aA })), E("");
12194
+ }, EA = () => {
12195
12195
  const m = n[0];
12196
12196
  if (!m) return;
12197
- const EA = parseFloat(O[m.key] || "");
12198
- if (!EA || EA <= 0) {
12197
+ const aA = parseFloat(O[m.key] || "");
12198
+ if (!aA || aA <= 0) {
12199
12199
  E(t("Please enter your ") + t(m.label).toLowerCase());
12200
12200
  return;
12201
12201
  }
@@ -12260,7 +12260,7 @@ function SP({
12260
12260
  type: "number",
12261
12261
  className: "ps-bpm-value-input",
12262
12262
  value: O[m.key],
12263
- onChange: (EA) => mA(m.key, EA.target.value),
12263
+ onChange: (aA) => mA(m.key, aA.target.value),
12264
12264
  placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
12265
12265
  step: m.step ?? 0.5,
12266
12266
  min: m.min,
@@ -12273,7 +12273,7 @@ function SP({
12273
12273
  K && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: K })
12274
12274
  ] }),
12275
12275
  /* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
12276
- !B && /* @__PURE__ */ P(tA, { children: [
12276
+ !B && /* @__PURE__ */ P(rA, { children: [
12277
12277
  /* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: t("or") }) }),
12278
12278
  /* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => I("photo"), children: [
12279
12279
  /* @__PURE__ */ A(Un, {}),
@@ -12282,7 +12282,7 @@ function SP({
12282
12282
  ] })
12283
12283
  ] }),
12284
12284
  /* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
12285
- /* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick: dA, children: [
12285
+ /* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick: EA, children: [
12286
12286
  t("Find My Size"),
12287
12287
  xf(o) ? ` (${xf(o)})` : "",
12288
12288
  " ",
@@ -12328,12 +12328,12 @@ function SP({
12328
12328
  filter: !c && V !== !0 ? "blur(6px) saturate(0.7)" : void 0,
12329
12329
  pointerEvents: !c && V !== !0 ? "none" : void 0
12330
12330
  },
12331
- children: c ? /* @__PURE__ */ P(tA, { children: [
12331
+ children: c ? /* @__PURE__ */ P(rA, { children: [
12332
12332
  /* @__PURE__ */ A("img", { src: c, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
12333
12333
  /* @__PURE__ */ A("button", { onClick: (m) => {
12334
12334
  m.stopPropagation(), RA();
12335
12335
  }, 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: "×" })
12336
- ] }) : /* @__PURE__ */ P(tA, { children: [
12336
+ ] }) : /* @__PURE__ */ P(rA, { children: [
12337
12337
  /* @__PURE__ */ A(zP, { size: 32 }),
12338
12338
  /* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: t(k ? "Upload close-up photo" : "Upload your photo") }),
12339
12339
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: t(k ? "Click or drag a close-up face photo" : "Click or drag a full-body photo") }),
@@ -12484,7 +12484,7 @@ function SP({
12484
12484
  /* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
12485
12485
  /* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: t("Do") })
12486
12486
  ] }),
12487
- /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(tA, { children: [
12487
+ /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
12488
12488
  t("Face the camera directly, centered in frame"),
12489
12489
  /* @__PURE__ */ A("br", {}),
12490
12490
  t("Use natural, even lighting (e.g. near a window)"),
@@ -12494,7 +12494,7 @@ function SP({
12494
12494
  t("Choose a plain, light background"),
12495
12495
  /* @__PURE__ */ A("br", {}),
12496
12496
  t("Hold the camera at eye level")
12497
- ] }) : /* @__PURE__ */ P(tA, { children: [
12497
+ ] }) : /* @__PURE__ */ P(rA, { children: [
12498
12498
  t("Stand facing the camera with your full body in frame"),
12499
12499
  /* @__PURE__ */ A("br", {}),
12500
12500
  t("Use natural or even lighting (e.g. near a window)"),
@@ -12511,7 +12511,7 @@ function SP({
12511
12511
  /* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
12512
12512
  /* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: t("Don't") })
12513
12513
  ] }),
12514
- /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(tA, { children: [
12514
+ /* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
12515
12515
  t("Don't wear sunglasses or a hat in the photo"),
12516
12516
  /* @__PURE__ */ A("br", {}),
12517
12517
  t("Don't tilt or turn your head"),
@@ -12521,7 +12521,7 @@ function SP({
12521
12521
  t("Don't crop out your ears or top of head"),
12522
12522
  /* @__PURE__ */ A("br", {}),
12523
12523
  t("Don't apply filters or heavy edits")
12524
- ] }) : /* @__PURE__ */ P(tA, { children: [
12524
+ ] }) : /* @__PURE__ */ P(rA, { children: [
12525
12525
  t("Don't wear loose, baggy, or layered clothing"),
12526
12526
  /* @__PURE__ */ A("br", {}),
12527
12527
  t("Don't sit, pose, or bend your body"),
@@ -12595,7 +12595,7 @@ function SP({
12595
12595
  type: "number",
12596
12596
  className: "ps-bp-inline-input",
12597
12597
  value: O[m.key],
12598
- onChange: (EA) => mA(m.key, EA.target.value),
12598
+ onChange: (aA) => mA(m.key, aA.target.value),
12599
12599
  placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
12600
12600
  step: m.step ?? 0.5,
12601
12601
  min: m.min,
@@ -12613,7 +12613,7 @@ function SP({
12613
12613
  ] }),
12614
12614
  /* @__PURE__ */ P("div", { className: "ps-bp-nav", style: { marginTop: "auto" }, children: [
12615
12615
  /* @__PURE__ */ A("div", {}),
12616
- /* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick: dA, type: "button", children: [
12616
+ /* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick: EA, type: "button", children: [
12617
12617
  t("Find My Size"),
12618
12618
  xf(o) ? ` (${xf(o)})` : "",
12619
12619
  " ",
@@ -12803,21 +12803,21 @@ function R8({
12803
12803
  JA(() => {
12804
12804
  o !== void 0 && K(o);
12805
12805
  }, [o]);
12806
- const E = wf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
12806
+ const E = vf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
12807
12807
  JA(() => {
12808
12808
  hA(!0);
12809
12809
  }, []);
12810
- const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [m, EA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = iA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
12810
+ const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, EA] = j(null), [ZA, Hf] = j(!1), [m, aA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, iA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = tA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
12811
12811
  JA(() => {
12812
12812
  const w = Xf(n);
12813
12813
  w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
12814
12814
  }, [n]);
12815
- const H = iA({}), [oA, zA] = j("male"), [YA, of] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
12815
+ const H = tA({}), [oA, zA] = j("male"), [YA, wf] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
12816
12816
  x(w), Tg(w);
12817
- }, []), [S, aA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = iA(null), KA = iA(() => !1), vf = iA(() => {
12817
+ }, []), [S, dA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = tA(null), KA = tA(() => !1), Df = tA(() => {
12818
12818
  }), M = UA((w, Q) => {
12819
- KA.current = w, vf.current = Q;
12820
- }, []), cA = iA(null), pA = iA(null), tf = iA(null), Df = iA(null), IA = iA(null), pf = iA(!1), qn = iA(null), If = iA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = iA(null);
12819
+ KA.current = w, Df.current = Q;
12820
+ }, []), cA = tA(null), pA = tA(null), tf = tA(null), Cf = tA(null), IA = tA(null), pf = tA(!1), qn = tA(null), If = tA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = tA(null);
12821
12821
  JA(() => {
12822
12822
  try {
12823
12823
  const w = bf(), Q = uf(B);
@@ -12825,10 +12825,10 @@ function R8({
12825
12825
  } catch {
12826
12826
  }
12827
12827
  return () => {
12828
- Df.current?.(), tf.current?.disconnect(), IA.current && clearInterval(IA.current);
12828
+ Cf.current?.(), tf.current?.disconnect(), IA.current && clearInterval(IA.current);
12829
12829
  };
12830
12830
  }, [B]);
12831
- const cP = 22, nP = iA(0), mf = iA(null), Nf = iA(null), Sf = iA(null), Lf = iA(null), yf = iA(null), pP = iA(null), jP = iA(""), Tf = iA(null);
12831
+ const cP = 22, nP = tA(0), mf = tA(null), Nf = tA(null), Sf = tA(null), Lf = tA(null), yf = tA(null), pP = tA(null), jP = tA(""), Tf = tA(null);
12832
12832
  JA(() => {
12833
12833
  if (l === "processing") {
12834
12834
  if (Tf.current) return;
@@ -12906,7 +12906,7 @@ function R8({
12906
12906
  _A({ found: !1 });
12907
12907
  }).finally(() => cf(!1));
12908
12908
  }, [B, n, I]);
12909
- const $n = wf(() => {
12909
+ const $n = vf(() => {
12910
12910
  switch (l) {
12911
12911
  case "welcome":
12912
12912
  case "body-profile":
@@ -12975,7 +12975,7 @@ function R8({
12975
12975
  }
12976
12976
  },
12977
12977
  [lA, OA, B, f, n, O, G]
12978
- ), UP = iA(null), [qf, EP] = j(null), yP = UA(async (w) => {
12978
+ ), UP = tA(null), [qf, EP] = j(null), yP = UA(async (w) => {
12979
12979
  const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
12980
12980
  if (!wA && L && Q > 0 && UP.current) {
12981
12981
  try {
@@ -12994,7 +12994,7 @@ function R8({
12994
12994
  }
12995
12995
  return;
12996
12996
  }
12997
- SA(null), rA(!0), xA(wA), wA && (s(null), lf(null));
12997
+ SA(null), iA(!0), xA(wA), wA && (s(null), lf(null));
12998
12998
  const Z = w.photoBase64;
12999
12999
  if (Z)
13000
13000
  try {
@@ -13017,7 +13017,7 @@ function R8({
13017
13017
  }).then((d) => {
13018
13018
  d?.raw && SA(d.raw), xA(!0);
13019
13019
  }).catch(() => {
13020
- }).finally(() => rA(!1));
13020
+ }).finally(() => iA(!1));
13021
13021
  }, [O, n, f, I, B, V]), _n = UA(async () => {
13022
13022
  const w = OA.find((L) => L.id === lA);
13023
13023
  if (!w) return;
@@ -13028,12 +13028,12 @@ function R8({
13028
13028
  const w = qf;
13029
13029
  EP(null), yP(w);
13030
13030
  }, [qf, yP]), fg = UA(() => {
13031
- EP(null), of((w) => w + 1), y("body-profile");
13032
- }, []), Pg = iA(() => {
13031
+ EP(null), wf((w) => w + 1), y("body-profile");
13032
+ }, []), Pg = tA(() => {
13033
13033
  }), ng = UA(() => {
13034
13034
  console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
13035
13035
  }, [h]), Gf = UA(() => {
13036
- y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), gA(null), FA(!1), aA(!1), H.current = {}, zA("male"), Yf.current = !1, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
13036
+ y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), gA(null), FA(!1), dA(!1), H.current = {}, zA("male"), Yf.current = !1, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
13037
13037
  }, [W, V]), gg = UA(() => {
13038
13038
  if (fA) {
13039
13039
  NA(null), yA.current && (y(yA.current), yA.current = null);
@@ -13061,7 +13061,7 @@ function R8({
13061
13061
  break;
13062
13062
  case "profiles":
13063
13063
  if (KA.current()) {
13064
- vf.current();
13064
+ Df.current();
13065
13065
  break;
13066
13066
  }
13067
13067
  y(yA.current || "body-profile"), yA.current = null;
@@ -13072,11 +13072,11 @@ function R8({
13072
13072
  }
13073
13073
  }, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP = UA((w) => {
13074
13074
  if (!pg(w)) {
13075
- dA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
13075
+ EA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
13076
13076
  return;
13077
13077
  }
13078
13078
  if (w.size > 10 * 1024 * 1024) {
13079
- dA(E("Image must be under 10MB.")), y("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
13079
+ EA(E("Image must be under 10MB.")), y("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
13080
13080
  return;
13081
13081
  }
13082
13082
  sA(w), Jf.current = w;
@@ -13088,7 +13088,7 @@ function R8({
13088
13088
  }, [t, v]), qP = UA(() => {
13089
13089
  sA(null), V && URL.revokeObjectURL(V), s(null);
13090
13090
  }, [V]), Wf = UA(() => {
13091
- IA.current && (clearInterval(IA.current), IA.current = null), Df.current?.(), Df.current = null;
13091
+ IA.current && (clearInterval(IA.current), IA.current = null), Cf.current?.(), Cf.current = null;
13092
13092
  }, []), aP = UA((w) => {
13093
13093
  if (w.status === "completed" && w.imageUrl) {
13094
13094
  if (RA((Q) => !Q || Q.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : Q), !pf.current) {
@@ -13103,9 +13103,9 @@ function R8({
13103
13103
  } else if (w.status === "failed" && !pf.current) {
13104
13104
  pf.current = !0, Wf(), eA(!1);
13105
13105
  const Q = w.error || E("Try-on generation failed");
13106
- dA(Q), y("error"), v?.({ message: Q });
13106
+ EA(Q), y("error"), v?.({ message: Q });
13107
13107
  }
13108
- }, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
13108
+ }, [u, v, Wf]), Kf = vf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
13109
13109
  if (!pA.current) return;
13110
13110
  const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
13111
13111
  if (L === "face" || L === "head") {
@@ -13134,7 +13134,7 @@ function R8({
13134
13134
  sizingUnit: L === "head" ? "cm" : "mm",
13135
13135
  category: L,
13136
13136
  ...Object.keys(CA).length > 0 && { faceMeasurementsMm: CA, irisConfidence: 1 }
13137
- }, Cf = new Promise((jA) => setTimeout(jA, 4500));
13137
+ }, of = new Promise((jA) => setTimeout(jA, 4500));
13138
13138
  try {
13139
13139
  const jA = await fetch(`${Y}/api/v1/sizing/face-recommend`, {
13140
13140
  method: "POST",
@@ -13143,15 +13143,15 @@ function R8({
13143
13143
  });
13144
13144
  if (jA.ok) {
13145
13145
  const Af = await jA.json();
13146
- await Cf, SA(Af), u?.(Af);
13146
+ await of, SA(Af), u?.(Af);
13147
13147
  } else {
13148
13148
  const Af = await jA.text().catch(() => "");
13149
- console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await Cf, dA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
13149
+ console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await of, EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
13150
13150
  }
13151
13151
  } catch (jA) {
13152
- console.error("[PS-SDK] face-recommend network error:", jA), await Cf, dA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
13152
+ console.error("[PS-SDK] face-recommend network error:", jA), await of, EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
13153
13153
  } finally {
13154
- rA(!1);
13154
+ iA(!1);
13155
13155
  }
13156
13156
  return;
13157
13157
  }
@@ -13177,7 +13177,7 @@ function R8({
13177
13177
  } else {
13178
13178
  const d = parseFloat(H.current.height || "0"), b = parseFloat(H.current.weight || "0");
13179
13179
  if (!d || !b) {
13180
- console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), rA(!1);
13180
+ console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), iA(!1);
13181
13181
  return;
13182
13182
  }
13183
13183
  const HA = {
@@ -13216,17 +13216,17 @@ function R8({
13216
13216
  );
13217
13217
  } else {
13218
13218
  const b = await d.text().catch(() => "");
13219
- console.error("[PS-SDK] Sizing recommend failed:", d.status, b), dA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
13219
+ console.error("[PS-SDK] Sizing recommend failed:", d.status, b), EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
13220
13220
  }
13221
13221
  } catch (d) {
13222
- console.error("[PS-SDK] Sizing recommend network error:", d), dA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
13222
+ console.error("[PS-SDK] Sizing recommend network error:", d), EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
13223
13223
  } finally {
13224
- rA(!1);
13224
+ iA(!1);
13225
13225
  }
13226
13226
  }, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w, Q, Y, wA, L, Z, d, b, HA, DA, CA) => {
13227
13227
  if (!pA.current) {
13228
13228
  const jA = E("SDK not configured. Please refresh and try again.");
13229
- console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
13229
+ console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), EA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
13230
13230
  return;
13231
13231
  }
13232
13232
  uf(B), bf();
@@ -13239,12 +13239,12 @@ function R8({
13239
13239
  }
13240
13240
  for (const jA of Kf)
13241
13241
  jA.required && jA.unit === "cm" && !zf.has(jA.key) && df.add(jA.key);
13242
- const Cf = Array.from(df);
13243
- if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", Cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), Cf.length === 0) {
13244
- console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), rA(!0), y("size-result"), Vf("quick");
13242
+ const of = Array.from(df);
13243
+ if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", of), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), of.length === 0) {
13244
+ console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), iA(!0), y("size-result"), Vf("quick");
13245
13245
  return;
13246
13246
  }
13247
- H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), rA(!0), y("size-result"), Vf("quick");
13247
+ H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), iA(!0), y("size-result"), Vf("quick");
13248
13248
  }, [B, Kf, $, Vf, _, X]), dP = UA(async (w) => {
13249
13249
  if (console.log("[ps-sdk] handleSnapSubmit fired", {
13250
13250
  hasApiRef: !!pA.current,
@@ -13252,19 +13252,25 @@ function R8({
13252
13252
  apiUrl: B
13253
13253
  }), !pA.current || !tf.current) {
13254
13254
  const DA = E("SDK not configured. Please refresh and try again.");
13255
- console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), dA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
13255
+ console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), EA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
13256
13256
  return;
13257
13257
  }
13258
13258
  const Q = uf(B), Y = bf();
13259
13259
  console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: Q }), sA(w.photoFile), Jf.current = w.photoFile;
13260
13260
  const wA = w.photoFile ? URL.createObjectURL(w.photoFile) : w.photoBase64.startsWith("data:") ? w.photoBase64 : `data:image/jpeg;base64,${w.photoBase64}`;
13261
- s(wA), pf.current = !1, eA(!1), SA(null), RA(null), rA(!0), xA(!1), y("size-result");
13261
+ s(wA), pf.current = !1, eA(!1), SA(null), RA(null), iA(!0), xA(!1), y("size-result");
13262
13262
  const L = Xf(n);
13263
13263
  if (L === "face" || L === "head") {
13264
13264
  LP(null);
13265
13265
  const DA = new Promise((CA) => setTimeout(CA, 4500));
13266
13266
  try {
13267
13267
  const CA = await dg(wA);
13268
+ if (!CA) {
13269
+ console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await DA;
13270
+ const of = E(L === "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.");
13271
+ EA(of), y("error"), v?.({ message: of, code: "FACE_DETECTION_FAILED" }), iA(!1);
13272
+ return;
13273
+ }
13268
13274
  CA && LP(CA.landmarks);
13269
13275
  const zf = {
13270
13276
  product: { title: n, productId: O },
@@ -13280,8 +13286,8 @@ function R8({
13280
13286
  body: JSON.stringify(zf)
13281
13287
  });
13282
13288
  if (df.ok) {
13283
- const Cf = await df.json();
13284
- await DA, SA(Cf), u?.(Cf), Zf(
13289
+ const of = await df.json();
13290
+ await DA, SA(of), u?.(of), Zf(
13285
13291
  {
13286
13292
  gender: w.gender,
13287
13293
  height: w.height,
@@ -13291,14 +13297,14 @@ function R8({
13291
13297
  age: w.age,
13292
13298
  bodyImage: w.photoBase64
13293
13299
  },
13294
- Cf
13300
+ of
13295
13301
  );
13296
13302
  } else
13297
13303
  await DA, xA(!0);
13298
13304
  } catch (CA) {
13299
13305
  console.error("[ps-sdk] face-recommend failed:", CA), await DA, xA(!0);
13300
13306
  }
13301
- rA(!1);
13307
+ iA(!1);
13302
13308
  return;
13303
13309
  }
13304
13310
  If.current = null, lf(null), rP(wA).then((DA) => (If.current = DA, DA)).catch(() => null);
@@ -13353,14 +13359,14 @@ function R8({
13353
13359
  } catch {
13354
13360
  xA(!0);
13355
13361
  }
13356
- rA(!1);
13362
+ iA(!1);
13357
13363
  }, [B, f, n, _, X, gf, $, Kf, Zf]);
13358
13364
  UP.current = dP;
13359
13365
  const WP = UA(async (w) => {
13360
13366
  const Q = w || XA || Jf.current;
13361
13367
  if (!Q || !pA.current || !tf.current) {
13362
13368
  const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
13363
- dA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
13369
+ EA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
13364
13370
  return;
13365
13371
  }
13366
13372
  w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
@@ -13387,7 +13393,7 @@ function R8({
13387
13393
  silhouetteContext: Cn(vA, $)
13388
13394
  }
13389
13395
  );
13390
- k?.(b.jobId), Df.current = tf.current.onJob(b.jobId, aP);
13396
+ k?.(b.jobId), Cf.current = tf.current.onJob(b.jobId, aP);
13391
13397
  let HA = 0;
13392
13398
  IA.current = setInterval(async () => {
13393
13399
  if (pf.current) {
@@ -13406,11 +13412,11 @@ function R8({
13406
13412
  }, 3e3);
13407
13413
  } catch (Z) {
13408
13414
  const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
13409
- dA(d), y("error"), v?.({ message: d, code: b });
13415
+ EA(d), y("error"), v?.({ message: d, code: b });
13410
13416
  }
13411
13417
  }, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
13412
13418
  if (!XA || !pA.current || !tf.current) return;
13413
- EA(!0);
13419
+ aA(!0);
13414
13420
  const Q = En(Xf(n)), Y = Q === "apparel";
13415
13421
  if (Y && If.current) {
13416
13422
  const wA = {
@@ -13429,7 +13435,7 @@ function R8({
13429
13435
  }
13430
13436
  }
13431
13437
  try {
13432
- pf.current = !1, Df.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
13438
+ pf.current = !1, Cf.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
13433
13439
  const wA = await AP(XA), L = Y ? w : void 0, Z = await pA.current.submitTryOn(
13434
13440
  wA,
13435
13441
  f,
@@ -13441,8 +13447,8 @@ function R8({
13441
13447
  silhouetteContext: Cn(vA, $)
13442
13448
  }
13443
13449
  );
13444
- Df.current = tf.current.onJob(Z.jobId, (b) => {
13445
- b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
13450
+ Cf.current = tf.current.onJob(Z.jobId, (b) => {
13451
+ b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
13446
13452
  });
13447
13453
  let d = 0;
13448
13454
  IA.current = setInterval(async () => {
@@ -13451,17 +13457,17 @@ function R8({
13451
13457
  return;
13452
13458
  }
13453
13459
  if (d++, d > 60) {
13454
- IA.current && clearInterval(IA.current), IA.current = null, EA(!1);
13460
+ IA.current && clearInterval(IA.current), IA.current = null, aA(!1);
13455
13461
  return;
13456
13462
  }
13457
13463
  try {
13458
13464
  const b = await pA.current.getStatus(Z.jobId);
13459
- b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), EA(!1), Df.current?.(), Df.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, EA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
13465
+ b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), aA(!1), Cf.current?.(), Cf.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, aA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
13460
13466
  } catch {
13461
13467
  }
13462
13468
  }, 3e3);
13463
13469
  } catch {
13464
- EA(!1);
13470
+ aA(!1);
13465
13471
  }
13466
13472
  }, [XA, f, n]), wg = UA(() => {
13467
13473
  if (PA)
@@ -13474,7 +13480,7 @@ function R8({
13474
13480
  Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
13475
13481
  }).catch(() => window.open(PA, "_blank"));
13476
13482
  }, [PA]), vg = UA(() => {
13477
- pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), aA(!1), y("body-profile");
13483
+ pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), dA(!1), y("body-profile");
13478
13484
  }, [V, Wf]), Dg = UA((w) => {
13479
13485
  const Q = OA.find((wA) => wA.id === w);
13480
13486
  if (!Q) return;
@@ -13483,7 +13489,7 @@ function R8({
13483
13489
  if ((Q.height ?? Q.heightCm) && (Y.height = String(Q.height ?? Q.heightCm)), (Q.weight ?? Q.weightKg) && (Y.weight = String(Q.weight ?? Q.weightKg)), Q.chest && (Y.chest = String(Q.chest)), Q.bust && (Y.bust = String(Q.bust)), Q.waist && (Y.waist = String(Q.waist)), Q.hips && (Y.hips = String(Q.hips)), Q.shoulderWidth && (Y.shoulderWidth = String(Q.shoulderWidth)), Q.sleeveLength && (Y.sleeveLength = String(Q.sleeveLength)), Q.inseam && (Y.inseam = String(Q.inseam)), Q.neckCircumference && (Y.neckCircumference = String(Q.neckCircumference)), Q.footLengthCm && (Y.footLengthCm = String(Q.footLengthCm)), Q.shoeEU && (Y.shoeEU = Q.shoeEU), Q.shoeUS && (Y.shoeUS = Q.shoeUS), Q.shoeUK && (Y.shoeUK = Q.shoeUK), Q.fitPreference && (Y.fitPreference = Q.fitPreference), Q.customMeasurements)
13484
13490
  for (const [wA, L] of Object.entries(Q.customMeasurements))
13485
13491
  Y[wA] = String(L);
13486
- H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), of((wA) => wA + 1);
13492
+ H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), wf((wA) => wA + 1);
13487
13493
  }, [OA]);
13488
13494
  Pg.current = Dg, UA((w, Q) => {
13489
13495
  const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
@@ -13539,7 +13545,7 @@ function R8({
13539
13545
  return HA[b] = wA, HA;
13540
13546
  }
13541
13547
  return [...d, wA].slice(-50);
13542
- }), G(Y), aA(!0);
13548
+ }), G(Y), dA(!0);
13543
13549
  }, [lA, gf, _, WA, X]);
13544
13550
  const VP = UA(() => {
13545
13551
  const w = {
@@ -13568,7 +13574,7 @@ function R8({
13568
13574
  Q && (w.profileName = Q.name);
13569
13575
  }
13570
13576
  Pf((Q) => [w, ...Q].slice(0, 50));
13571
- }, [n, f, PA, vA, $, lA, OA]), Yf = iA(!1), gP = iA(!1);
13577
+ }, [n, f, PA, vA, $, lA, OA]), Yf = tA(!1), gP = tA(!1);
13572
13578
  JA(() => {
13573
13579
  l === "size-result" && vA && !Yf.current ? (Yf.current = !0, gP.current = !1, VP()) : l === "size-result" && vA && PA && !gP.current ? (gP.current = !0, Pf((w) => w.length === 0 ? w : [{ ...w[0], resultImageUrl: PA }, ...w.slice(1)])) : l === "result" && PA && !Yf.current ? (Yf.current = !0, VP()) : (l === "welcome" || l === "body-profile") && (Yf.current = !1, gP.current = !1);
13574
13580
  }, [l, vA, PA]);
@@ -13579,11 +13585,11 @@ function R8({
13579
13585
  reasoning: w.reasoning || "",
13580
13586
  internationalSizes: w.internationalSizes,
13581
13587
  matchDetails: w.matchDetails
13582
- }), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1), bA(null), NA(null), y("size-result");
13588
+ }), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), iA(!1), eA(!1), bA(null), NA(null), y("size-result");
13583
13589
  }, []), ig = UA((w, Q) => {
13584
13590
  H.current[w] = Q;
13585
13591
  }, []);
13586
- wf(() => {
13592
+ vf(() => {
13587
13593
  const Q = {
13588
13594
  US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
13589
13595
  UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
@@ -13647,7 +13653,7 @@ function R8({
13647
13653
  case "welcome":
13648
13654
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
13649
13655
  case "body-profile": {
13650
- const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
13656
+ const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: iA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
13651
13657
  if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
13652
13658
  if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
13653
13659
  if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
@@ -13712,12 +13718,12 @@ function R8({
13712
13718
  formRef: H,
13713
13719
  formGender: oA,
13714
13720
  formKey: YA,
13715
- setFormKey: of,
13721
+ setFormKey: wf,
13716
13722
  sizingUnit: _,
13717
13723
  setSizingUnit: uA,
13718
13724
  updateField: ig,
13719
13725
  setSizingMethod: kA,
13720
- setSizingLoading: rA,
13726
+ setSizingLoading: iA,
13721
13727
  setView: y,
13722
13728
  submitSizing: Vf,
13723
13729
  t: E
@@ -13867,10 +13873,10 @@ function R8({
13867
13873
  })).then((CA) => {
13868
13874
  if (CA) {
13869
13875
  if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
13870
- const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id === Q.id);
13876
+ const zf = af("profiles", []), df = zf.findIndex((of) => of.id === Q.id);
13871
13877
  if (df >= 0) {
13872
- const Cf = zf[df], jA = CA.userEstimates, Af = { ...Cf };
13873
- jA.height && !(Cf.height || Cf.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(Cf.weight || Cf.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !Cf.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
13878
+ const of = zf[df], jA = CA.userEstimates, Af = { ...of };
13879
+ jA.height && !(of.height || of.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(of.weight || of.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !of.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
13874
13880
  }
13875
13881
  }
13876
13882
  AA(af("profiles", []));