@primestyleai/tryon 5.10.110 → 5.10.112

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.
@@ -262,9 +262,9 @@ function tn(o, g, t) {
262
262
  const r = Mg(o.leftIrisRing, g, t), B = Mg(o.rightIrisRing, g, t), a = (r + B) / 2;
263
263
  let n = 1;
264
264
  a < 8 ? n = 0.3 : Math.abs(r - B) / a > 0.3 ? n = 0.5 : Math.abs(r - B) / a > 0.15 && (n = 0.8);
265
- const w = a > 0 ? Hg / a : 0, s = (v, M) => Math.hypot(
266
- (v.x - M.x) * g,
267
- (v.y - M.y) * t
265
+ const w = a > 0 ? Hg / a : 0, s = (E, M) => Math.hypot(
266
+ (E.x - M.x) * g,
267
+ (E.y - M.y) * t
268
268
  ) * w, l = s(o.leftIrisCenter, o.rightIrisCenter), D = s(o.leftInnerEye, o.rightInnerEye) / 1.6, m = s(o.leftTragus, o.rightTragus), P = s(o.leftTragus, o.leftOuterEye), x = s(o.rightTragus, o.rightOuterEye), L = (P + x) / 2, G = m * 1.07, d = Math.abs((o.forehead.z ?? 0) - (o.chin.z ?? 0)) * g * w, W = Math.max(170, Math.min(210, d || 190)), V = G / 2, i = W / 2, b = Math.PI * Math.sqrt(2 * (V * V + i * i));
269
269
  return {
270
270
  measurements: {
@@ -8949,9 +8949,9 @@ function jn({
8949
8949
  /* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: G("Here's what we estimated") }),
8950
8950
  /* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: G("Tap any value to adjust if needed") }),
8951
8951
  /* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: W.map((i) => {
8952
- const b = t[i.key], v = a.current[i.key] ? parseFloat(a.current[i.key]) : null, M = b || v;
8952
+ const b = t[i.key], E = a.current[i.key] ? parseFloat(a.current[i.key]) : null, M = b || E;
8953
8953
  if (!M) return null;
8954
- const z = !b && !!v;
8954
+ const z = !b && !!E;
8955
8955
  return a.current[i.key] || (a.current[i.key] = String(M)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ e("div", { className: "ps-tryon-sf-float-field", children: [
8956
8956
  /* @__PURE__ */ e("label", { className: "ps-tryon-sf-float-label", children: [
8957
8957
  G(i.label),
@@ -9141,15 +9141,15 @@ function kg({
9141
9141
  { title: l("MATCHING SIZE"), desc: l("Comparing your measurements to the garment's size guide."), viewfinderText: l("MATCHING SIZE") },
9142
9142
  { title: l("FINALIZING RESULT"), desc: l("Almost done — preparing your recommendation."), viewfinderText: l("FINALIZING") }
9143
9143
  ], [P, x] = Q({ w: 800, h: 1200 }), L = (b) => {
9144
- const v = b.currentTarget;
9145
- x({ w: v.naturalWidth || v.offsetWidth, h: v.naturalHeight || v.offsetHeight });
9144
+ const E = b.currentTarget;
9145
+ x({ w: E.naturalWidth || E.offsetWidth, h: E.naturalHeight || E.offsetHeight });
9146
9146
  }, G = 6e3, I = 1e3, d = hA(Date.now()), [W, V] = Q(0);
9147
9147
  kA(() => {
9148
- const b = (G - I) / Math.max(1, m.length - 1), v = setInterval(() => {
9148
+ const b = (G - I) / Math.max(1, m.length - 1), E = setInterval(() => {
9149
9149
  const M = Date.now() - d.current, z = Math.min(m.length - 1, Math.floor(M / b));
9150
- V((j) => j === z ? j : z), z >= m.length - 1 && clearInterval(v);
9150
+ V((j) => j === z ? j : z), z >= m.length - 1 && clearInterval(E);
9151
9151
  }, 100);
9152
- return () => clearInterval(v);
9152
+ return () => clearInterval(E);
9153
9153
  }, [m.length]), kA(() => {
9154
9154
  D && t && W === 0 && V(1);
9155
9155
  }, [t]);
@@ -9230,8 +9230,8 @@ function Ar({
9230
9230
  if (i.length > 0) {
9231
9231
  const b = i.filter(
9232
9232
  (M) => M.fit === "good" || M.fit === "a-bit-tight" || M.fit === "a-bit-loose"
9233
- ).length, v = Math.round(b / i.length * 100);
9234
- return Math.max(70, v);
9233
+ ).length, E = Math.round(b / i.length * 100);
9234
+ return Math.max(70, E);
9235
9235
  }
9236
9236
  return t?.confidence === "high" ? 96 : t?.confidence === "medium" ? 84 : 72;
9237
9237
  }, [t]), W = l || o, V = !!l;
@@ -9293,7 +9293,7 @@ function Ar({
9293
9293
  /* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: I("FIT MATCH") })
9294
9294
  ] }) }),
9295
9295
  /* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: i, secResult: b }) => {
9296
- const v = i.replace(/\s*[—–-]\s*.*/g, ""), M = b, z = a?.[i], j = !!z, wA = M.found === !1 ? I("No fit") : j ? z.displayLabel : M.size || b.recommendedSize, J = r?.sectionImages?.[i], ne = Zn(i), h = J || ne || null;
9296
+ const E = i.replace(/\s*[—–-]\s*.*/g, ""), M = b, z = a?.[i], j = !!z, wA = M.found === !1 ? I("No fit") : j ? z.displayLabel : M.size || b.recommendedSize, J = r?.sectionImages?.[i], ne = Zn(i), h = J || ne || null;
9297
9297
  return /* @__PURE__ */ e(
9298
9298
  "button",
9299
9299
  {
@@ -9302,7 +9302,7 @@ function Ar({
9302
9302
  onClick: () => n(i),
9303
9303
  children: [
9304
9304
  h && /* @__PURE__ */ A("img", { src: h, alt: "", className: "ps-msr-section-icon-lg" }),
9305
- /* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: v.toUpperCase() }),
9305
+ /* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: E.toUpperCase() }),
9306
9306
  /* @__PURE__ */ A("span", { className: "ps-msr-section-size", children: wA }),
9307
9307
  /* @__PURE__ */ A(
9308
9308
  "span",
@@ -9685,10 +9685,10 @@ function Mo({ lines: o, fitRows: g, show: t, imgWidth: r, imgHeight: B }) {
9685
9685
  if (!G || typeof G.x1 != "number" || typeof G.x2 != "number" || typeof G.y != "number") return null;
9686
9686
  const W = Math.abs(G.x2 - G.x1);
9687
9687
  if (f > 0 && W < f * 0.35 || W * w < 20) return null;
9688
- const V = G.x1 * w, i = G.x2 * w, b = G.y * s, v = i - V, M = v * 0.06, z = (V + i) / 2, j = g.find((Ae) => {
9688
+ const V = G.x1 * w, i = G.x2 * w, b = G.y * s, E = i - V, M = E * 0.06, z = (V + i) / 2, j = g.find((Ae) => {
9689
9689
  const MA = Ae.area.toLowerCase().trim();
9690
9690
  return !!(MA === L || L === "chest" && (MA.includes("bust") || MA.includes("chest")) || L === "waist" && MA.includes("waist") || L === "hips" && (MA.includes("hip") || MA === "hips"));
9691
- }), wA = j ? a(j.fit) : "#2154EF", J = d * 0.35, ne = `M ${V} ${b} Q ${z} ${b + M} ${i} ${b}`, h = v * 1.05, Ce = j ? j.fit === "good" ? "✓ Fit" : j.isLength ? j.fit.includes("short") || j.fit.includes("tight") ? "Short" : "Long" : j.fit.includes("tight") ? "Tight" : "Loose" : I, oA = Math.round(14 * x), O = Ce.length * oA * 0.62, T = w - i - 12 * x < O, _ = T ? V - 10 * x : i + 10 * x, pA = T ? "end" : "start", nA = T ? V : i, jA = T ? V - 6 * x : i + 6 * x;
9691
+ }), wA = j ? a(j.fit) : "#2154EF", J = d * 0.35, ne = `M ${V} ${b} Q ${z} ${b + M} ${i} ${b}`, h = E * 1.05, Ce = j ? j.fit === "good" ? "✓ Fit" : j.isLength ? j.fit.includes("short") || j.fit.includes("tight") ? "Short" : "Long" : j.fit.includes("tight") ? "Tight" : "Loose" : I, oA = Math.round(14 * x), O = Ce.length * oA * 0.62, T = w - i - 12 * x < O, _ = T ? V - 10 * x : i + 10 * x, pA = T ? "end" : "start", nA = T ? V : i, jA = T ? V - 6 * x : i + 6 * x;
9692
9692
  return /* @__PURE__ */ e("g", { children: [
9693
9693
  /* @__PURE__ */ A(
9694
9694
  "path",
@@ -9819,7 +9819,7 @@ function jo({
9819
9819
  backLabel: V,
9820
9820
  internationalSizes: i,
9821
9821
  continueLabel: b,
9822
- renderRaw: v = !1,
9822
+ renderRaw: E = !1,
9823
9823
  sectionFound: M,
9824
9824
  allSizes: z
9825
9825
  }) {
@@ -9909,7 +9909,7 @@ function jo({
9909
9909
  }
9910
9910
  return { range: _A, ...u };
9911
9911
  }, [g, uA, ee, B, iA]), ve = He(() => {
9912
- if (v)
9912
+ if (E)
9913
9913
  return (t?.matchDetails || []).map((YA) => {
9914
9914
  let xA = YA.chartRange, yA = YA.fit;
9915
9915
  if (de !== j) {
@@ -9984,9 +9984,9 @@ function jo({
9984
9984
  isLength: yA
9985
9985
  };
9986
9986
  });
9987
- }, [t, n, r, v, z, de]), De = ve.filter(
9987
+ }, [t, n, r, E, z, de]), De = ve.filter(
9988
9988
  (H) => H.fit === "good" || H.fit === "a-bit-tight" || H.fit === "a-bit-loose"
9989
- ).length, me = ve.length > 0 ? Math.round(De / ve.length * 100) : 0, XA = !v, DA = t, mA = DA?.size || j, F = (t?.matchDetails || []).find(
9989
+ ).length, me = ve.length > 0 ? Math.round(De / ve.length * 100) : 0, XA = !E, DA = t, mA = DA?.size || j, F = (t?.matchDetails || []).find(
9990
9990
  (H) => /inseam|length/i.test(H.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(H.measurement)
9991
9991
  ), lA = F ? (F.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", Qe = DA?.length || jA || lA, we = DA?.availableSizes || [], Oe = DA?.availableLengths || [], ZA = Ae || Qe, tA = we.length > 0 ? we : RA, re = (() => {
9992
9992
  if (tA.length <= 3) return tA;
@@ -10148,7 +10148,7 @@ function jo({
10148
10148
  /* @__PURE__ */ e("div", { className: "ps-msd-row-cells", children: [
10149
10149
  /* @__PURE__ */ e("div", { className: "ps-msd-row-cell", children: [
10150
10150
  /* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: s("USER") }),
10151
- /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: v ? S.rawUserValue || "" : isNaN(S.userNum) || S.userNum === 0 ? "" : `${O(S.userNum)} ${B}` })
10151
+ /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? S.rawUserValue || "" : isNaN(S.userNum) || S.userNum === 0 ? "" : `${O(S.userNum)} ${B}` })
10152
10152
  ] }),
10153
10153
  /* @__PURE__ */ e("div", { className: "ps-msd-row-cell ps-right", children: [
10154
10154
  /* @__PURE__ */ e("span", { className: "ps-msd-cell-label", children: [
@@ -10156,7 +10156,7 @@ function jo({
10156
10156
  " ",
10157
10157
  de
10158
10158
  ] }),
10159
- /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: v ? S.rawChartRange || "" : T(S.chartLabel) })
10159
+ /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? S.rawChartRange || "" : T(S.chartLabel) })
10160
10160
  ] })
10161
10161
  ] }),
10162
10162
  /* @__PURE__ */ e("div", { className: `ps-msd-row-badge ${ie}`, children: [
@@ -10381,8 +10381,8 @@ function jo({
10381
10381
  const EA = H.fit === "good" ? "#2154EF" : H.isLength ? H.fit.includes("short") || H.fit.includes("tight") ? "#dc2626" : "#d97706" : H.fit.includes("tight") ? "#dc2626" : "#d97706", S = H.fit === "good" ? "rgba(33,84,239,0.08)" : H.isLength ? H.fit.includes("short") || H.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : H.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
10382
10382
  return /* @__PURE__ */ e("tr", { style: { borderBottom: AA < ve.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
10383
10383
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: H.area }),
10384
- /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: v ? H.rawUserValue || "" : isNaN(H.userNum) || H.userNum === 0 ? "" : `${O(H.userNum)} ${B}` }),
10385
- /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: v ? H.rawChartRange || "" : T(H.chartLabel) }),
10384
+ /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? H.rawUserValue || "" : isNaN(H.userNum) || H.userNum === 0 ? "" : `${O(H.userNum)} ${B}` }),
10385
+ /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? H.rawChartRange || "" : T(H.chartLabel) }),
10386
10386
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: EA, background: S, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: H.isLength ? Og(H.fit, s) : sr(H.fit, s) }) })
10387
10387
  ] }, AA);
10388
10388
  }) })
@@ -10548,7 +10548,7 @@ function Br({
10548
10548
  faceLandmarks: V = null,
10549
10549
  measurementType: i = "body",
10550
10550
  estimationDone: b = !1,
10551
- activeSection: v,
10551
+ activeSection: E,
10552
10552
  setActiveSection: M,
10553
10553
  onResetTryOn: z,
10554
10554
  onClose: j,
@@ -10557,28 +10557,28 @@ function Br({
10557
10557
  onPendingCustomSizeChange: ne,
10558
10558
  t: h
10559
10559
  }) {
10560
- const Ce = (g?.unit || l || "").toString().toLowerCase(), oA = Ce === "mm" ? "mm" : Ce === "cm" ? "cm" : "in", O = h(oA === "mm" ? "mm" : l === "cm" ? "cm" : "in"), [GA, T] = Q({}), _ = at, pA = bA((E, y, K) => Re(E, y, K), []), nA = He(() => {
10560
+ const Ce = (g?.unit || l || "").toString().toLowerCase(), oA = Ce === "mm" ? "mm" : Ce === "cm" ? "cm" : "in", O = h(oA === "mm" ? "mm" : l === "cm" ? "cm" : "in"), [GA, T] = Q({}), _ = at, pA = bA((v, y, K) => Re(v, y, K), []), nA = He(() => {
10561
10561
  if (!t?.headers || !t?.rows) return -1;
10562
- const E = t.headers.findIndex((y) => /size|taglia|größe|taille/i.test(y.trim()));
10563
- if (E >= 0) return E;
10562
+ const v = t.headers.findIndex((y) => /size|taglia|größe|taille/i.test(y.trim()));
10563
+ if (v >= 0) return v;
10564
10564
  for (let y = 0; y < t.headers.length; y++) {
10565
10565
  const K = t.headers[y];
10566
10566
  if (t.rows.some((N) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(pA(N, y, K)))) return y;
10567
10567
  }
10568
10568
  return 0;
10569
10569
  }, [t, pA]), jA = t?.headers?.[nA] || h("Size");
10570
- He(() => nA < 0 || !t?.rows ? [] : t.rows.map((E) => pA(E, nA, jA)).filter(Boolean), [t, nA, jA, pA]);
10570
+ He(() => nA < 0 || !t?.rows ? [] : t.rows.map((v) => pA(v, nA, jA)).filter(Boolean), [t, nA, jA, pA]);
10571
10571
  const Ae = He(() => {
10572
10572
  if (!t?.headers || !t?.rows) return [];
10573
- const E = [];
10573
+ const v = [];
10574
10574
  for (let y = 0; y < t.headers.length; y++) {
10575
10575
  const K = (t.headers[y] || "").toLowerCase();
10576
10576
  if (/\(cm\)|centimeter/i.test(K)) {
10577
- E.push("cm");
10577
+ v.push("cm");
10578
10578
  continue;
10579
10579
  }
10580
10580
  if (/\(in\)|\(inch|inch/i.test(K)) {
10581
- E.push("in");
10581
+ v.push("in");
10582
10582
  continue;
10583
10583
  }
10584
10584
  let N = null;
@@ -10595,12 +10595,12 @@ function Br({
10595
10595
  }
10596
10596
  }
10597
10597
  }
10598
- E.push(N);
10598
+ v.push(N);
10599
10599
  }
10600
- return E;
10601
- }, [t, pA]), MA = bA((E, y) => {
10600
+ return v;
10601
+ }, [t, pA]), MA = bA((v, y) => {
10602
10602
  if (!t?.headers || !t?.rows || nA < 0) return null;
10603
- const K = E.toLowerCase().trim(), N = O === "cm" || O === "", cA = N ? "cm" : "in", X = [];
10603
+ const K = v.toLowerCase().trim(), N = O === "cm" || O === "", cA = N ? "cm" : "in", X = [];
10604
10604
  for (let p = 0; p < t.headers.length; p++) {
10605
10605
  const Z = (t.headers[p] || "").toLowerCase().trim();
10606
10606
  if (Z === K) {
@@ -10629,8 +10629,8 @@ function Br({
10629
10629
  return { range: fe, ...HA };
10630
10630
  }, [t, nA, jA, O, pA, _, Ae]), OA = g?.recommendedSize || "";
10631
10631
  He(() => g?.internationalSizes || {}, [g]);
10632
- const [he, uA] = Q("fit"), [ee, RA] = Q(null), [de, vA] = Q(!1), [TA, iA] = Q(!1), [Me, ve] = Q(!1), [De, me] = Q(null), [XA, DA] = Q(!1), [mA, F] = Q({ w: 800, h: 1200 }), lA = J ?? {}, Qe = bA((E) => {
10633
- const y = E.currentTarget;
10632
+ const [he, uA] = Q("fit"), [ee, RA] = Q(null), [de, vA] = Q(!1), [TA, iA] = Q(!1), [Me, ve] = Q(!1), [De, me] = Q(null), [XA, DA] = Q(!1), [mA, F] = Q({ w: 800, h: 1200 }), lA = J ?? {}, Qe = bA((v) => {
10633
+ const y = v.currentTarget;
10634
10634
  y.naturalWidth && y.naturalHeight && F({ w: y.naturalWidth, h: y.naturalHeight });
10635
10635
  }, []);
10636
10636
  kA(() => {
@@ -10638,8 +10638,8 @@ function Br({
10638
10638
  me(null), DA(!1);
10639
10639
  return;
10640
10640
  }
10641
- DA(!1), Wo(r).then((E) => {
10642
- me(E), DA(!0);
10641
+ DA(!1), Wo(r).then((v) => {
10642
+ me(v), DA(!0);
10643
10643
  }).catch(() => {
10644
10644
  DA(!0);
10645
10645
  });
@@ -10649,18 +10649,18 @@ function Br({
10649
10649
  const [re, LA] = Q(!1), [$A, H] = Q(null), [AA, EA] = Q(!1), S = hA(null), [IA, CA] = Q(null), [ie, Ee] = Q(!1);
10650
10650
  kA(() => {
10651
10651
  if ($A) {
10652
- const E = URL.createObjectURL($A);
10653
- return CA(E), () => URL.revokeObjectURL(E);
10652
+ const v = URL.createObjectURL($A);
10653
+ return CA(v), () => URL.revokeObjectURL(v);
10654
10654
  }
10655
10655
  CA(null);
10656
10656
  }, [$A]);
10657
10657
  const oe = ee || OA;
10658
10658
  He(() => {
10659
10659
  if (!g?.matchDetails?.length) return [];
10660
- const E = /* @__PURE__ */ new Set();
10660
+ const v = /* @__PURE__ */ new Set();
10661
10661
  return g.matchDetails.filter((K) => {
10662
10662
  const N = K.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
10663
- return E.has(N) ? !1 : (E.add(N), !0);
10663
+ return v.has(N) ? !1 : (v.add(N), !0);
10664
10664
  }).map((K) => {
10665
10665
  const N = _e(K.userValue);
10666
10666
  let cA = K.chartRange, X = K.fit;
@@ -10683,31 +10683,31 @@ function Br({
10683
10683
  });
10684
10684
  }, [g, oe, OA, MA]), He(() => {
10685
10685
  if (!t?.headers || !t?.rows || nA < 0) return null;
10686
- const E = t.rows.find((K) => pA(K, nA, jA) === oe);
10687
- if (!E) return null;
10686
+ const v = t.rows.find((K) => pA(K, nA, jA) === oe);
10687
+ if (!v) return null;
10688
10688
  const y = [];
10689
10689
  for (let K = 0; K < t.headers.length; K++) {
10690
10690
  const N = t.headers[K] || "";
10691
10691
  if (K === nA) continue;
10692
- const cA = pA(E, K, N);
10692
+ const cA = pA(v, K, N);
10693
10693
  cA && y.push({ header: N, value: cA });
10694
10694
  }
10695
10695
  return y;
10696
10696
  }, [t, nA, jA, oe, pA]);
10697
10697
  const NA = !!(t?.sections && Object.keys(t.sections).length > 1), _A = He(() => {
10698
- const E = {}, y = (K) => {
10698
+ const v = {}, y = (K) => {
10699
10699
  if (K)
10700
10700
  for (const N of K) {
10701
10701
  const cA = N.measurement.toLowerCase();
10702
- if (E[cA] == null) {
10702
+ if (v[cA] == null) {
10703
10703
  const X = _e(N.userValue);
10704
- X > 0 && (E[cA] = X);
10704
+ X > 0 && (v[cA] = X);
10705
10705
  }
10706
10706
  }
10707
10707
  };
10708
10708
  if (y(g?.matchDetails), g?.sections)
10709
10709
  for (const K of Object.values(g.sections)) y(K.matchDetails);
10710
- return wA && wA > 0 && E.height == null && (E.height = wA), g?.sections && Object.keys(g.sections).length > 0 ? Object.entries(g.sections).map(([K, N]) => {
10710
+ return wA && wA > 0 && v.height == null && (v.height = wA), g?.sections && Object.keys(g.sections).length > 0 ? Object.entries(g.sections).map(([K, N]) => {
10711
10711
  const cA = K.toLowerCase();
10712
10712
  let X = t?.sections?.[K];
10713
10713
  if (!X && t?.sections) {
@@ -10718,7 +10718,7 @@ function Br({
10718
10718
  JA && (X = JA[1]);
10719
10719
  }
10720
10720
  X || (X = { headers: [], rows: [], requiredFields: [] });
10721
- const FA = { ...E };
10721
+ const FA = { ...v };
10722
10722
  if (N.matchDetails)
10723
10723
  for (const JA of N.matchDetails) {
10724
10724
  const WA = _e(JA.userValue);
@@ -10726,7 +10726,7 @@ function Br({
10726
10726
  }
10727
10727
  return { name: K, section: X, secResult: N, userMeasurements: FA };
10728
10728
  }) : !NA || !t?.sections ? [] : Object.entries(t.sections).map(([K, N]) => {
10729
- const cA = g?.sections?.[K] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, X = { ...E };
10729
+ const cA = g?.sections?.[K] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, X = { ...v };
10730
10730
  if (cA.matchDetails)
10731
10731
  for (const FA of cA.matchDetails) {
10732
10732
  const JA = _e(FA.userValue);
@@ -10734,13 +10734,13 @@ function Br({
10734
10734
  }
10735
10735
  return { name: K, section: N, secResult: cA, userMeasurements: X };
10736
10736
  });
10737
- }, [NA, t, g, wA]), u = He(() => _A.filter((E) => !Lg(E.name)), [_A]), YA = He(() => _A.filter((E) => Lg(E.name)), [_A]), xA = bA((E, y) => {
10737
+ }, [NA, t, g, wA]), u = He(() => _A.filter((v) => !Lg(v.name)), [_A]), YA = He(() => _A.filter((v) => Lg(v.name)), [_A]), xA = bA((v, y) => {
10738
10738
  if (!y) return y;
10739
- let N = ig(E, YA)?.secResult?.recommendedSize?.trim() || "";
10740
- if (N || (N = _A.find((WA) => WA.name === E)?.secResult?.length?.trim() || ""), !N) return y;
10739
+ let N = ig(v, YA)?.secResult?.recommendedSize?.trim() || "";
10740
+ if (N || (N = _A.find((WA) => WA.name === v)?.secResult?.length?.trim() || ""), !N) return y;
10741
10741
  const cA = N.toLowerCase();
10742
10742
  if (/^\d/.test(N)) {
10743
- const WA = /pant|trouser|inseam/i.test(E) ? "Inseam" : "Length";
10743
+ const WA = /pant|trouser|inseam/i.test(v) ? "Inseam" : "Length";
10744
10744
  return `${y} / ${WA} ${N}`;
10745
10745
  }
10746
10746
  if (/^x(tra)?[- ]?long/.test(cA)) return /^\d/.test(y) ? `${y}XL` : `${y} / Extra Long`;
@@ -10752,13 +10752,13 @@ function Br({
10752
10752
  return `${y} / ${FA}`;
10753
10753
  }, [YA, _A]);
10754
10754
  He(() => {
10755
- const E = wA || 0;
10756
- if (!E) return "";
10755
+ const v = wA || 0;
10756
+ if (!v) return "";
10757
10757
  if (O === "in") {
10758
- const y = E / 2.54, K = Math.floor(y / 12), N = Math.round(y - K * 12);
10758
+ const y = v / 2.54, K = Math.floor(y / 12), N = Math.round(y - K * 12);
10759
10759
  return `${K}'${N}"`;
10760
10760
  }
10761
- return `${Math.round(E)} cm`;
10761
+ return `${Math.round(v)} cm`;
10762
10762
  }, [wA, O]);
10763
10763
  const yA = !!P, q = yA && o, ge = !yA && o, le = !!g, Pe = yA ? le && (!!r && !I) : le, BA = Go(), UA = i === "face" || i === "head";
10764
10764
  g?.found;
@@ -10824,11 +10824,11 @@ function Br({
10824
10824
  i === "face" || i === "head" ? V && /* @__PURE__ */ A(nr, { landmarks: V, imgWidth: mA.w, imgHeight: mA.h }) : W && /* @__PURE__ */ A(ir, { landmarks: W, imgWidth: mA.w, imgHeight: mA.h })
10825
10825
  ] }),
10826
10826
  (() => {
10827
- const E = i === "face" || i === "head";
10828
- return h(E ? i === "head" ? "Detecting head" : "Detecting face" : "Detecting body pose"), /* @__PURE__ */ A("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ A(
10827
+ const v = i === "face" || i === "head";
10828
+ return h(v ? i === "head" ? "Detecting head" : "Detecting face" : "Detecting body pose"), /* @__PURE__ */ A("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ A(
10829
10829
  rr,
10830
10830
  {
10831
- category: E ? i : "body",
10831
+ category: v ? i : "body",
10832
10832
  sizingDone: le,
10833
10833
  t: h
10834
10834
  }
@@ -10836,28 +10836,28 @@ function Br({
10836
10836
  })()
10837
10837
  ] }),
10838
10838
  (Pe || g && !q) && /* @__PURE__ */ e(eA, { children: [
10839
- NA ? v ? (
10839
+ NA ? E ? (
10840
10840
  /* ── Detail view for a single section ── */
10841
10841
  (() => {
10842
- const E = u.find((y) => y.name === v);
10843
- return E ? BA ? /* @__PURE__ */ e(eA, { children: [
10842
+ const v = u.find((y) => y.name === E);
10843
+ return v ? BA ? /* @__PURE__ */ e(eA, { children: [
10844
10844
  be && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: be }),
10845
10845
  /* @__PURE__ */ A(
10846
10846
  jo,
10847
10847
  {
10848
- sectionName: E.name,
10849
- section: E.section,
10850
- sectionResult: E.secResult,
10851
- sectionFound: E.secResult?.found,
10852
- userMeasurements: E.userMeasurements,
10848
+ sectionName: v.name,
10849
+ section: v.section,
10850
+ sectionResult: v.secResult,
10851
+ sectionFound: v.secResult?.found,
10852
+ userMeasurements: v.userMeasurements,
10853
10853
  unitLbl: O,
10854
10854
  chartUnit: oA,
10855
10855
  lengthEntry: (() => {
10856
- const y = ig(E.name, YA);
10857
- return y || E.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
10856
+ const y = ig(v.name, YA);
10857
+ return y || v.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
10858
10858
  })(),
10859
10859
  onBack: () => M(null),
10860
- internationalSizes: E.secResult?.internationalSizes,
10860
+ internationalSizes: v.secResult?.internationalSizes,
10861
10861
  productImage: r || B,
10862
10862
  productTitle: n,
10863
10863
  isMobile: !0,
@@ -10886,7 +10886,7 @@ function Br({
10886
10886
  }
10887
10887
  ) : null,
10888
10888
  t: h,
10889
- allSizes: g?.allSizes
10889
+ allSizes: v.secResult?.allSizes ?? g?.allSizes
10890
10890
  }
10891
10891
  )
10892
10892
  ] }) : /* @__PURE__ */ e("div", { className: "ps-tryon-v2", children: [
@@ -10896,24 +10896,24 @@ function Br({
10896
10896
  /* @__PURE__ */ A(
10897
10897
  jo,
10898
10898
  {
10899
- sectionName: E.name,
10900
- section: E.section,
10901
- sectionResult: E.secResult,
10902
- sectionFound: E.secResult?.found,
10903
- userMeasurements: E.userMeasurements,
10899
+ sectionName: v.name,
10900
+ section: v.section,
10901
+ sectionResult: v.secResult,
10902
+ sectionFound: v.secResult?.found,
10903
+ userMeasurements: v.userMeasurements,
10904
10904
  unitLbl: O,
10905
10905
  chartUnit: oA,
10906
10906
  lengthEntry: (() => {
10907
- const y = ig(E.name, YA);
10908
- return y || E.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
10907
+ const y = ig(v.name, YA);
10908
+ return y || v.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
10909
10909
  })(),
10910
10910
  onBack: () => M(null),
10911
- internationalSizes: E.secResult?.internationalSizes,
10911
+ internationalSizes: v.secResult?.internationalSizes,
10912
10912
  t: h,
10913
- allSizes: g?.allSizes
10913
+ allSizes: v.secResult?.allSizes ?? g?.allSizes
10914
10914
  }
10915
10915
  )
10916
- ] }, `detail-${v}`)
10916
+ ] }, `detail-${E}`)
10917
10917
  ] }) : null;
10918
10918
  })()
10919
10919
  ) : BA ? (
@@ -10925,12 +10925,12 @@ function Br({
10925
10925
  productTitle: n,
10926
10926
  sizingResult: g,
10927
10927
  sizeGuide: t,
10928
- sectionEntries: u.map(({ name: E, secResult: y }) => {
10928
+ sectionEntries: u.map(({ name: v, secResult: y }) => {
10929
10929
  const K = y?.size || y.recommendedSize || "";
10930
- return { name: E, secResult: { ...y, recommendedSize: xA(E, K) } };
10930
+ return { name: v, secResult: { ...y, recommendedSize: xA(v, K) } };
10931
10931
  }),
10932
10932
  pendingCustomSizes: lA,
10933
- onSelectSection: (E) => M(E),
10933
+ onSelectSection: (v) => M(v),
10934
10934
  onTryOn: () => {
10935
10935
  H(m || null), LA(!0);
10936
10936
  },
@@ -10949,12 +10949,12 @@ function Br({
10949
10949
  {
10950
10950
  lines: De,
10951
10951
  fitRows: (() => {
10952
- const E = [...g?.matchDetails || []];
10952
+ const v = [...g?.matchDetails || []];
10953
10953
  if (g?.sections)
10954
10954
  for (const K of Object.values(g.sections))
10955
- K.matchDetails && E.push(...K.matchDetails);
10955
+ K.matchDetails && v.push(...K.matchDetails);
10956
10956
  const y = /* @__PURE__ */ new Set();
10957
- return E.filter((K) => {
10957
+ return v.filter((K) => {
10958
10958
  const N = K.measurement.toLowerCase();
10959
10959
  return y.has(N) ? !1 : (y.add(N), !0);
10960
10960
  }).map((K) => ({ area: K.measurement, userNum: parseFloat(K.userValue) || 0, chartLabel: K.chartRange || "", fit: K.fit }));
@@ -10975,12 +10975,12 @@ function Br({
10975
10975
  I && /* @__PURE__ */ A(Yg, { tryOnStartedAt: d ?? null, t: h }),
10976
10976
  /* @__PURE__ */ A(Gg, { active: !!I }),
10977
10977
  r && !I && XA && De && /* @__PURE__ */ A(Mo, { lines: De, fitRows: (() => {
10978
- const E = [...g?.matchDetails || []];
10978
+ const v = [...g?.matchDetails || []];
10979
10979
  if (g?.sections)
10980
10980
  for (const K of Object.values(g.sections))
10981
- K.matchDetails && E.push(...K.matchDetails);
10981
+ K.matchDetails && v.push(...K.matchDetails);
10982
10982
  const y = /* @__PURE__ */ new Set();
10983
- return E.filter((K) => {
10983
+ return v.filter((K) => {
10984
10984
  const N = K.measurement.toLowerCase();
10985
10985
  return y.has(N) ? !1 : (y.add(N), !0);
10986
10986
  }).map((K) => ({ area: K.measurement, userNum: parseFloat(K.userValue) || 0, chartLabel: K.chartRange || "", fit: K.fit }));
@@ -11010,13 +11010,13 @@ function Br({
11010
11010
  /* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: h("Tap any section for detailed breakdown") }),
11011
11011
  be,
11012
11012
  /* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
11013
- /* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: u.map(({ name: E, secResult: y }, K) => {
11014
- const N = t?.sectionImages?.[E], cA = gr(E), X = K === u.length - 1 && u.length % 2 !== 0, FA = y, JA = lA[E], WA = !!JA, fe = WA ? JA.displayLabel : xA(E, FA.size || y.recommendedSize || "");
11015
- return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${X ? " ps-full" : ""}${WA ? " ps-overridden" : ""}`, onClick: () => M(E), style: { animationDelay: `${K * 0.07}s` }, children: [
11013
+ /* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: u.map(({ name: v, secResult: y }, K) => {
11014
+ const N = t?.sectionImages?.[v], cA = gr(v), X = K === u.length - 1 && u.length % 2 !== 0, FA = y, JA = lA[v], WA = !!JA, fe = WA ? JA.displayLabel : xA(v, FA.size || y.recommendedSize || "");
11015
+ return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${X ? " ps-full" : ""}${WA ? " ps-overridden" : ""}`, onClick: () => M(v), style: { animationDelay: `${K * 0.07}s` }, children: [
11016
11016
  /* @__PURE__ */ e("div", { className: "ps-tryon-sr-card-v2-text", children: [
11017
11017
  /* @__PURE__ */ e("span", { className: "ps-tryon-sr-card-v2-label", children: [
11018
11018
  cA && /* @__PURE__ */ A("img", { src: cA, alt: "", className: "ps-tryon-sr-card-v2-label-icon" }),
11019
- E.replace(/\s*[—–-]\s*.*/g, "")
11019
+ v.replace(/\s*[—–-]\s*.*/g, "")
11020
11020
  ] }),
11021
11021
  /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: FA.found === !1 ? h("No fit") : (() => {
11022
11022
  const HA = fe.indexOf(" / ");
@@ -11038,8 +11038,8 @@ function Br({
11038
11038
  /* @__PURE__ */ A("span", { "aria-hidden": "true", children: "›" })
11039
11039
  ] })
11040
11040
  ] }),
11041
- N && /* @__PURE__ */ A("img", { src: N, alt: E, className: "ps-tryon-sr-card-v2-img" })
11042
- ] }, E);
11041
+ N && /* @__PURE__ */ A("img", { src: N, alt: v, className: "ps-tryon-sr-card-v2-img" })
11042
+ ] }, v);
11043
11043
  }) }),
11044
11044
  /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
11045
11045
  /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () => f("body-profile"), type: "button", children: [
@@ -11091,7 +11091,7 @@ function Br({
11091
11091
  ) : (
11092
11092
  /* ── SINGLE-PIECE — rendered via SectionDetailView for visual parity with multi-garment ── */
11093
11093
  (() => {
11094
- const E = t?.found ? { headers: t.headers || [], rows: t.rows || [], requiredFields: t.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, y = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, K = {};
11094
+ const v = t?.found ? { headers: t.headers || [], rows: t.rows || [], requiredFields: t.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, y = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, K = {};
11095
11095
  if (g?.matchDetails)
11096
11096
  for (const X of g.matchDetails) K[X.measurement.toLowerCase()] = _e(X.userValue);
11097
11097
  const N = h("Your Fit"), cA = () => {
@@ -11103,7 +11103,7 @@ function Br({
11103
11103
  jo,
11104
11104
  {
11105
11105
  sectionName: N,
11106
- section: E,
11106
+ section: v,
11107
11107
  sectionResult: y,
11108
11108
  sectionFound: g?.found,
11109
11109
  userMeasurements: K,
@@ -11111,7 +11111,7 @@ function Br({
11111
11111
  chartUnit: oA,
11112
11112
  lengthEntry: null,
11113
11113
  onBack: () => {
11114
- r ? z?.() : f("body-profile");
11114
+ r && z?.(), f("body-profile");
11115
11115
  },
11116
11116
  backLabel: h("Back"),
11117
11117
  internationalSizes: g?.internationalSizes,
@@ -11162,20 +11162,22 @@ function Br({
11162
11162
  ] }),
11163
11163
  /* @__PURE__ */ e("div", { className: "ps-tryon-v2-panel", children: [
11164
11164
  be,
11165
- v === N ? (
11165
+ E === N ? (
11166
11166
  /* DETAIL VIEW — full size table, same as multi-garment */
11167
11167
  /* @__PURE__ */ A(
11168
11168
  jo,
11169
11169
  {
11170
11170
  sectionName: N,
11171
- section: E,
11171
+ section: v,
11172
11172
  sectionResult: y,
11173
11173
  sectionFound: g?.found,
11174
11174
  userMeasurements: K,
11175
11175
  unitLbl: O,
11176
11176
  chartUnit: oA,
11177
11177
  lengthEntry: null,
11178
- onBack: () => M(null),
11178
+ onBack: () => {
11179
+ r ? (z?.(), f("body-profile")) : M(null);
11180
+ },
11179
11181
  backLabel: h("Back"),
11180
11182
  internationalSizes: g?.internationalSizes,
11181
11183
  onTryOn: r || ye ? void 0 : cA,
@@ -11206,7 +11208,7 @@ function Br({
11206
11208
  {
11207
11209
  className: "ps-bp-back-btn",
11208
11210
  onClick: () => {
11209
- r ? z?.() : f("body-profile");
11211
+ r && z?.(), f("body-profile");
11210
11212
  },
11211
11213
  type: "button",
11212
11214
  children: [
@@ -11259,7 +11261,7 @@ function Br({
11259
11261
  {
11260
11262
  className: "ps-bp-back-btn",
11261
11263
  onClick: () => {
11262
- r ? z?.() : f("body-profile");
11264
+ r && z?.(), f("body-profile");
11263
11265
  },
11264
11266
  type: "button",
11265
11267
  children: [
@@ -11293,7 +11295,7 @@ function Br({
11293
11295
  ] })
11294
11296
  ] })
11295
11297
  )
11296
- ] }, `panel-single-${v ? "detail" : "card"}`)
11298
+ ] }, `panel-single-${E ? "detail" : "card"}`)
11297
11299
  ] });
11298
11300
  })()
11299
11301
  ),
@@ -11313,8 +11315,8 @@ function Br({
11313
11315
  type: "file",
11314
11316
  accept: "image/jpeg,image/png,image/webp",
11315
11317
  style: { display: "none" },
11316
- onChange: (E) => {
11317
- const y = E.target.files?.[0];
11318
+ onChange: (v) => {
11319
+ const y = v.target.files?.[0];
11318
11320
  y && H(y);
11319
11321
  }
11320
11322
  }
@@ -11411,13 +11413,13 @@ function Br({
11411
11413
  "div",
11412
11414
  {
11413
11415
  onClick: () => S.current?.click(),
11414
- onDragOver: (E) => {
11415
- E.preventDefault(), EA(!0);
11416
+ onDragOver: (v) => {
11417
+ v.preventDefault(), EA(!0);
11416
11418
  },
11417
11419
  onDragLeave: () => EA(!1),
11418
- onDrop: (E) => {
11419
- E.preventDefault(), EA(!1);
11420
- const y = E.dataTransfer.files[0];
11420
+ onDrop: (v) => {
11421
+ v.preventDefault(), EA(!1);
11422
+ const y = v.dataTransfer.files[0];
11421
11423
  y && H(y);
11422
11424
  },
11423
11425
  style: {
@@ -11450,8 +11452,8 @@ function Br({
11450
11452
  type: "file",
11451
11453
  accept: "image/jpeg,image/png,image/webp",
11452
11454
  style: { display: "none" },
11453
- onChange: (E) => {
11454
- const y = E.target.files?.[0];
11455
+ onChange: (v) => {
11456
+ const y = v.target.files?.[0];
11455
11457
  y && H(y);
11456
11458
  }
11457
11459
  }
@@ -11552,11 +11554,11 @@ function Br({
11552
11554
  /* @__PURE__ */ A("h4", { children: h("Full Size Chart") }),
11553
11555
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => vA(!1), children: "✕" })
11554
11556
  ] }),
11555
- /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([E, y]) => {
11556
- const N = g?.sections?.[E]?.recommendedSize || "", cA = y.headers.findIndex((JA) => /size|taglia|größe|taille|fit|length/i.test(JA.trim())), X = cA >= 0 ? cA : 0, FA = y.headers[X] || "Size";
11557
+ /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([v, y]) => {
11558
+ const N = g?.sections?.[v]?.recommendedSize || "", cA = y.headers.findIndex((JA) => /size|taglia|größe|taille|fit|length/i.test(JA.trim())), X = cA >= 0 ? cA : 0, FA = y.headers[X] || "Size";
11557
11559
  return /* @__PURE__ */ e("div", { className: "ps-tryon-chart-section", children: [
11558
11560
  /* @__PURE__ */ e("div", { className: "ps-tryon-chart-section-title", children: [
11559
- /* @__PURE__ */ A("span", { children: E }),
11561
+ /* @__PURE__ */ A("span", { children: v }),
11560
11562
  N && /* @__PURE__ */ e("span", { className: "ps-tryon-chart-section-rec", children: [
11561
11563
  h("Your size"),
11562
11564
  ": ",
@@ -11570,14 +11572,14 @@ function Br({
11570
11572
  return /* @__PURE__ */ A("tr", { className: HA ? "ps-active-row" : "", children: y.headers.map((ke, p) => /* @__PURE__ */ A("td", { className: p === X ? "ps-size-col" : "", children: Re(JA, p, ke) }, p)) }, WA);
11571
11573
  }) })
11572
11574
  ] }) })
11573
- ] }, E);
11575
+ ] }, v);
11574
11576
  }) : t.headers && t.rows ? (
11575
11577
  /* Single section fallback */
11576
11578
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ e("table", { className: "ps-tryon-sr-chart-table", children: [
11577
- /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((E, y) => /* @__PURE__ */ A("th", { className: y === nA ? "ps-size-col" : "", children: E }, y)) }) }),
11578
- /* @__PURE__ */ A("tbody", { children: t.rows.map((E, y) => {
11579
- const N = pA(E, nA, jA) === oe;
11580
- return /* @__PURE__ */ A("tr", { className: N ? "ps-active-row" : "", children: t.headers.map((cA, X) => /* @__PURE__ */ A("td", { className: X === nA ? "ps-size-col" : "", children: pA(E, X, cA) }, X)) }, y);
11579
+ /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((v, y) => /* @__PURE__ */ A("th", { className: y === nA ? "ps-size-col" : "", children: v }, y)) }) }),
11580
+ /* @__PURE__ */ A("tbody", { children: t.rows.map((v, y) => {
11581
+ const N = pA(v, nA, jA) === oe;
11582
+ return /* @__PURE__ */ A("tr", { className: N ? "ps-active-row" : "", children: t.headers.map((cA, X) => /* @__PURE__ */ A("td", { className: X === nA ? "ps-size-col" : "", children: pA(v, X, cA) }, X)) }, y);
11581
11583
  }) })
11582
11584
  ] }) })
11583
11585
  ) : null })
@@ -11657,22 +11659,22 @@ function zg({
11657
11659
  onClearPhoto: f,
11658
11660
  t: D
11659
11661
  }) {
11660
- const m = hA(null), P = hA(0), [x, L] = Q(!1), [G, I] = Q(!1), [d, W] = Q(""), [V, i] = Q(null), [b, v] = Q(null);
11662
+ const m = hA(null), P = hA(0), [x, L] = Q(!1), [G, I] = Q(!1), [d, W] = Q(""), [V, i] = Q(null), [b, E] = Q(null);
11661
11663
  kA(() => {
11662
- t || (i(null), v(null));
11664
+ t || (i(null), E(null));
11663
11665
  }, [t]);
11664
11666
  const M = async (O) => {
11665
11667
  if (!(a || G)) {
11666
- if (v(null), i(null), r && B !== !0) {
11667
- v(D("Please confirm that the person in the photo is 18 or older before uploading."));
11668
+ if (E(null), i(null), r && B !== !0) {
11669
+ E(D("Please confirm that the person in the photo is 18 or older before uploading."));
11668
11670
  return;
11669
11671
  }
11670
11672
  if (!O.type.startsWith("image/")) {
11671
- v(D("Please upload an image file"));
11673
+ E(D("Please upload an image file"));
11672
11674
  return;
11673
11675
  }
11674
11676
  if (O.size > 10 * 1024 * 1024) {
11675
- v(D("Image must be under 10MB"));
11677
+ E(D("Image must be under 10MB"));
11676
11678
  return;
11677
11679
  }
11678
11680
  if (o && g) {
@@ -11711,7 +11713,7 @@ function zg({
11711
11713
  const GA = O.target.files?.[0];
11712
11714
  GA && M(GA), m.current && (m.current.value = "");
11713
11715
  }, Ce = () => {
11714
- i(null), v(null), f?.();
11716
+ i(null), E(null), f?.();
11715
11717
  };
11716
11718
  return /* @__PURE__ */ e(
11717
11719
  "div",
@@ -12010,9 +12012,9 @@ function lr({
12010
12012
  ], W = (() => {
12011
12013
  const z = m("Pair this with neutral tones for a balanced look"), j = m("Layer with a fitted base for sharper silhouette"), wA = m("Cuff once for a relaxed everyday feel");
12012
12014
  return [z, j, wA];
12013
- })(), [V, i] = Q(0), [b, v] = Q(0);
12015
+ })(), [V, i] = Q(0), [b, E] = Q(0);
12014
12016
  kA(() => {
12015
- const z = setInterval(() => i((wA) => (wA + 1) % d.length), 4e3), j = setInterval(() => v((wA) => (wA + 1) % W.length), 5e3);
12017
+ const z = setInterval(() => i((wA) => (wA + 1) % d.length), 4e3), j = setInterval(() => E((wA) => (wA + 1) % W.length), 5e3);
12016
12018
  return () => {
12017
12019
  clearInterval(z), clearInterval(j);
12018
12020
  };
@@ -12262,7 +12264,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
12262
12264
  kA(() => {
12263
12265
  I.current && (I.current.scrollTop = 0);
12264
12266
  }, [w, l]);
12265
- const [d, W] = Q(""), [V, i] = Q("male"), [b, v] = Q("cm"), [M, z] = Q(""), [j, wA] = Q(""), [J, ne] = Q(""), [h, Ce] = Q(""), [oA, O] = Q(""), [GA, T] = Q(""), [_, pA] = Q(null), [nA, jA] = Q(!1), [Ae, MA] = Q(""), [OA, he] = Q(null), [uA, ee] = Q(null), [RA, de] = Q({ w: 800, h: 1200 }), [vA, TA] = Q(0), [iA, Me] = Q(!1), [ve, De] = Q(!1);
12267
+ const [d, W] = Q(""), [V, i] = Q("male"), [b, E] = Q("cm"), [M, z] = Q(""), [j, wA] = Q(""), [J, ne] = Q(""), [h, Ce] = Q(""), [oA, O] = Q(""), [GA, T] = Q(""), [_, pA] = Q(null), [nA, jA] = Q(!1), [Ae, MA] = Q(""), [OA, he] = Q(null), [uA, ee] = Q(null), [RA, de] = Q({ w: 800, h: 1200 }), [vA, TA] = Q(0), [iA, Me] = Q(!1), [ve, De] = Q(!1);
12266
12268
  kA(() => {
12267
12269
  if (D !== "calculating" || !_) return;
12268
12270
  let p = !1;
@@ -12326,13 +12328,13 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
12326
12328
  const p = parseInt(j, 10), Z = parseInt(J, 10);
12327
12329
  !isNaN(p) && p >= 0 && !isNaN(Z) && Z >= 0 && z(String(Math.round((p * 12 + Z) * 2.54)));
12328
12330
  }
12329
- v("cm");
12331
+ E("cm");
12330
12332
  }, UA = () => {
12331
12333
  if (b === "cm") {
12332
12334
  const p = parseFloat(M);
12333
12335
  !isNaN(p) && p > 0 && (wA(String(Math.floor(p / 2.54 / 12))), ne(String(Math.round(p / 2.54 % 12))));
12334
12336
  }
12335
- v("in");
12337
+ E("in");
12336
12338
  }, ye = () => {
12337
12339
  if (!d.trim())
12338
12340
  return T(n("Please enter a profile name")), !1;
@@ -12348,7 +12350,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
12348
12350
  return T(n("Please enter a valid height")), !1;
12349
12351
  const Z = parseFloat(h), PA = parseFloat(oA);
12350
12352
  return !Z || Z <= 0 ? (T(n("Please enter a valid weight")), !1) : !PA || PA <= 0 ? (T(n("Please enter a valid age")), !1) : (T(""), !0);
12351
- }, be = () => d.trim() ? (T(""), !0) : (T(n("Please enter a profile name")), !1), E = () => {
12353
+ }, be = () => d.trim() ? (T(""), !0) : (T(n("Please enter a profile name")), !1), v = () => {
12352
12354
  const p = b === "in" ? (parseInt(j, 10) || 0) * 12 + (parseInt(J, 10) || 0) : parseFloat(M);
12353
12355
  return {
12354
12356
  name: d.trim(),
@@ -12406,7 +12408,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
12406
12408
  return;
12407
12409
  }
12408
12410
  if (T(""), Pe) {
12409
- o(E());
12411
+ o(v());
12410
12412
  return;
12411
12413
  }
12412
12414
  f(ge[le + 1]);
@@ -12416,7 +12418,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
12416
12418
  const PA = ge.indexOf(p), ae = PA === se - 1;
12417
12419
  setTimeout(() => {
12418
12420
  if (ae) {
12419
- const qA = E();
12421
+ const qA = v();
12420
12422
  p === "chest" ? qA.chestProfile = Z : p === "stomach" ? qA.midsectionProfile = Z : (p === "seat" || p === "hips") && (qA.hipProfile = Z), o(qA);
12421
12423
  } else
12422
12424
  f(ge[PA + 1]);
@@ -13518,39 +13520,39 @@ function Sr({
13518
13520
  isEstimating: s = !1,
13519
13521
  t: l
13520
13522
  }) {
13521
- const f = o.gender === "female" ? Ur : Nr, D = o.measurements || {}, m = Object.keys(D).some((v) => D[v] != null), [P, x] = Q(o.measurementsUnit || "cm"), [L, G] = Q(() => {
13522
- const v = {};
13523
+ const f = o.gender === "female" ? Ur : Nr, D = o.measurements || {}, m = Object.keys(D).some((E) => D[E] != null), [P, x] = Q(o.measurementsUnit || "cm"), [L, G] = Q(() => {
13524
+ const E = {};
13523
13525
  return f.forEach((M) => {
13524
13526
  const z = D[M.key];
13525
- v[M.key] = z != null ? String(Math.round(z * 10) / 10) : "";
13526
- }), v;
13527
+ E[M.key] = z != null ? String(Math.round(z * 10) / 10) : "";
13528
+ }), E;
13527
13529
  });
13528
13530
  kA(() => {
13529
- G((v) => {
13530
- const M = { ...v };
13531
+ G((E) => {
13532
+ const M = { ...E };
13531
13533
  let z = !1;
13532
13534
  return f.forEach((j) => {
13533
13535
  const wA = D[j.key];
13534
- wA != null && !v[j.key] && (M[j.key] = String(Math.round(wA * 10) / 10), z = !0);
13535
- }), z ? M : v;
13536
+ wA != null && !E[j.key] && (M[j.key] = String(Math.round(wA * 10) / 10), z = !0);
13537
+ }), z ? M : E;
13536
13538
  });
13537
13539
  }, [o.measurements, o.id]);
13538
- const [I, d] = Q(o.bandSize || ""), [W, V] = Q(o.cupSize || ""), i = (v) => {
13539
- v !== P && (G((M) => {
13540
+ const [I, d] = Q(o.bandSize || ""), [W, V] = Q(o.cupSize || ""), i = (E) => {
13541
+ E !== P && (G((M) => {
13540
13542
  const z = {};
13541
13543
  for (const [j, wA] of Object.entries(M)) {
13542
13544
  const J = parseFloat(wA);
13543
- !isNaN(J) && J > 0 ? z[j] = String(v === "in" ? Math.round(J / 2.54 * 10) / 10 : Math.round(J * 2.54 * 10) / 10) : z[j] = wA;
13545
+ !isNaN(J) && J > 0 ? z[j] = String(E === "in" ? Math.round(J / 2.54 * 10) / 10 : Math.round(J * 2.54 * 10) / 10) : z[j] = wA;
13544
13546
  }
13545
13547
  return z;
13546
- }), x(v));
13548
+ }), x(E));
13547
13549
  }, b = () => {
13548
- const v = { ...o.measurements || {} };
13550
+ const E = { ...o.measurements || {} };
13549
13551
  for (const [M, z] of Object.entries(L)) {
13550
13552
  const j = parseFloat(z);
13551
- !isNaN(j) && j > 0 && (v[M] = j);
13553
+ !isNaN(j) && j > 0 && (E[M] = j);
13552
13554
  }
13553
- r(v, P), o.gender === "female" && w && (I || W) && w(I, W), n();
13555
+ r(E, P), o.gender === "female" && w && (I || W) && w(I, W), n();
13554
13556
  };
13555
13557
  return /* @__PURE__ */ e("div", { className: "ps-pmv-root", children: [
13556
13558
  /* @__PURE__ */ e("div", { className: "ps-pmv-hero", children: [
@@ -13586,11 +13588,11 @@ function Sr({
13586
13588
  ] })
13587
13589
  ] }) }),
13588
13590
  /* @__PURE__ */ e("div", { className: "ps-pmv-measure-list", children: [
13589
- f.map((v) => {
13590
- const M = D[v.key], z = s && M == null && !L[v.key];
13591
+ f.map((E) => {
13592
+ const M = D[E.key], z = s && M == null && !L[E.key];
13591
13593
  return /* @__PURE__ */ e("div", { className: `ps-pmv-measure-row${M == null ? " ps-loading" : ""}`, children: [
13592
- /* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: v.iconSrc, alt: "", "aria-hidden": "true" }) }),
13593
- /* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: l(v.label) }),
13594
+ /* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: E.iconSrc, alt: "", "aria-hidden": "true" }) }),
13595
+ /* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: l(E.label) }),
13594
13596
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: z ? /* @__PURE__ */ e("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
13595
13597
  /* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
13596
13598
  /* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: l("calculating...") })
@@ -13601,14 +13603,14 @@ function Sr({
13601
13603
  type: "number",
13602
13604
  step: "0.1",
13603
13605
  className: "ps-pmv-inline-input",
13604
- value: L[v.key] ?? "",
13606
+ value: L[E.key] ?? "",
13605
13607
  placeholder: "—",
13606
- onChange: (j) => G((wA) => ({ ...wA, [v.key]: j.target.value }))
13608
+ onChange: (j) => G((wA) => ({ ...wA, [E.key]: j.target.value }))
13607
13609
  }
13608
13610
  ),
13609
13611
  /* @__PURE__ */ A("span", { className: "ps-pmv-inline-unit", children: P })
13610
13612
  ] }) })
13611
- ] }, v.key);
13613
+ ] }, E.key);
13612
13614
  }),
13613
13615
  o.gender === "female" && /* @__PURE__ */ e(eA, { children: [
13614
13616
  /* @__PURE__ */ e("div", { className: "ps-pmv-measure-row", children: [
@@ -13619,10 +13621,10 @@ function Sr({
13619
13621
  {
13620
13622
  className: "ps-pmv-inline-select",
13621
13623
  value: I,
13622
- onChange: (v) => d(v.target.value),
13624
+ onChange: (E) => d(E.target.value),
13623
13625
  children: [
13624
13626
  /* @__PURE__ */ A("option", { value: "", children: "—" }),
13625
- Jr.map((v) => /* @__PURE__ */ A("option", { value: v, children: v }, v))
13627
+ Jr.map((E) => /* @__PURE__ */ A("option", { value: E, children: E }, E))
13626
13628
  ]
13627
13629
  }
13628
13630
  ) })
@@ -13635,10 +13637,10 @@ function Sr({
13635
13637
  {
13636
13638
  className: "ps-pmv-inline-select",
13637
13639
  value: W,
13638
- onChange: (v) => V(v.target.value),
13640
+ onChange: (E) => V(E.target.value),
13639
13641
  children: [
13640
13642
  /* @__PURE__ */ A("option", { value: "", children: "—" }),
13641
- Kr.map((v) => /* @__PURE__ */ A("option", { value: v, children: v }, v))
13643
+ Kr.map((E) => /* @__PURE__ */ A("option", { value: E, children: E }, E))
13642
13644
  ]
13643
13645
  }
13644
13646
  ) })
@@ -13837,9 +13839,9 @@ function Xr({
13837
13839
  let b = null;
13838
13840
  if (typeof window < "u")
13839
13841
  try {
13840
- const v = localStorage.getItem("primestyle_profiles");
13841
- if (v) {
13842
- const M = JSON.parse(v);
13842
+ const E = localStorage.getItem("primestyle_profiles");
13843
+ if (E) {
13844
+ const M = JSON.parse(E);
13843
13845
  M.length > 0 && (b = M[0].id ?? null);
13844
13846
  }
13845
13847
  } catch {
@@ -13921,7 +13923,7 @@ function Zr({
13921
13923
  activeProfileName: V,
13922
13924
  onStartFresh: i,
13923
13925
  hidePhotoOptions: b = !1,
13924
- error: v,
13926
+ error: E,
13925
13927
  t: M
13926
13928
  }) {
13927
13929
  const z = parseFloat(r) || 173, j = (parseFloat(a) || 5) * 12 + (parseFloat(w) || 8), wA = Math.floor(j / 12), J = j % 12, ne = parseFloat(l) || (g === "kg" ? 70 : 154), h = parseFloat(D) || 30, Ce = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, O = 120, GA = 220, T = 48, _ = 84, pA = 13, nA = 100, jA = (z - O) / (GA - O) * 100, Ae = (j - T) / (_ - T) * 100, MA = (ne - Ce) / (oA - Ce) * 100, OA = (h - pA) / (nA - pA) * 100, he = (iA) => {
@@ -14073,7 +14075,7 @@ function Zr({
14073
14075
  }
14074
14076
  )
14075
14077
  ] }),
14076
- v && /* @__PURE__ */ A("p", { className: "ps-bpm-error", children: v }),
14078
+ E && /* @__PURE__ */ A("p", { className: "ps-bpm-error", children: E }),
14077
14079
  /* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
14078
14080
  /* @__PURE__ */ e("div", { className: "ps-bpm-bottom", children: [
14079
14081
  /* @__PURE__ */ A(
@@ -14540,21 +14542,21 @@ function si({
14540
14542
  onBack: V,
14541
14543
  t: i
14542
14544
  }) {
14543
- const b = t ? ni : ti, [v, M] = Q("basics");
14544
- v === "photo" || b.indexOf(v);
14545
+ const b = t ? ni : ti, [E, M] = Q("basics");
14546
+ E === "photo" || b.indexOf(E);
14545
14547
  const z = Go(), j = gt(B), wA = W?.height, J = W?.weight, ne = W?.age, h = W?.heightUnit === "ft" ? "in" : W?.heightUnit, Ce = W?.weightUnit, oA = wA != null && h === "cm" ? String(Math.round(wA)) : wA != null && (h === "in" || h === "ft") ? String(Math.round(wA * 2.54)) : r.current.height || "", O = wA != null && (h === "in" || h === "ft") ? Math.round(wA) : wA != null && h === "cm" ? Math.round(wA / 2.54) : null, GA = O != null ? String(Math.floor(O / 12)) : r.current.heightFeet || "", T = O != null ? String(O % 12) : r.current.heightInches || "", _ = J != null ? String(Math.round(J)) : r.current.weight || "", pA = ne != null ? String(ne) : r.current.age || "", [nA, jA] = Q(oA), [Ae, MA] = Q(GA), [OA, he] = Q(T), [uA, ee] = Q(_), [RA, de] = Q(pA), [vA, TA] = Q(
14546
14548
  h || (a === "ft" ? "in" : a || (j ? "in" : "cm"))
14547
14549
  ), [iA, Me] = Q(
14548
14550
  Ce || w || (j ? "lbs" : "kg")
14549
- ), ve = vA === "in" || iA === "lbs", [De, me] = Q(null), [XA, DA] = Q(null), [mA, F] = Q(null), [lA, Qe] = Q(!1), [we, Oe] = Q(""), [ZA, tA] = Q(null), re = hA(null), [LA, $A] = Q(null), [H, AA] = Q(!1), [EA, S] = Q(!1), [IA, CA] = Q(() => O != null ? String(Math.round(O * 2.54)) : oA), [ie, Ee] = Q(null), [oe, NA] = Q(null), [_A, u] = Q(null), [YA, xA] = Q(null), [yA, q] = Q(""), [ge, le] = Q(null), [se, Pe] = Q(null), [BA, UA] = Q(() => ["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"), [ye, be] = Q(!1), [E, y] = Q(null), K = hA(null);
14551
+ ), ve = vA === "in" || iA === "lbs", [De, me] = Q(null), [XA, DA] = Q(null), [mA, F] = Q(null), [lA, Qe] = Q(!1), [we, Oe] = Q(""), [ZA, tA] = Q(null), re = hA(null), [LA, $A] = Q(null), [H, AA] = Q(!1), [EA, S] = Q(!1), [IA, CA] = Q(() => O != null ? String(Math.round(O * 2.54)) : oA), [ie, Ee] = Q(null), [oe, NA] = Q(null), [_A, u] = Q(null), [YA, xA] = Q(null), [yA, q] = Q(""), [ge, le] = Q(null), [se, Pe] = Q(null), [BA, UA] = Q(() => ["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"), [ye, be] = Q(!1), [v, y] = Q(null), K = hA(null);
14550
14552
  kA(() => {
14551
- if (!E) return;
14553
+ if (!v) return;
14552
14554
  const k = (dA) => {
14553
14555
  const Be = K.current;
14554
14556
  Be && !Be.contains(dA.target) && y(null);
14555
14557
  };
14556
14558
  return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
14557
- }, [E]);
14559
+ }, [v]);
14558
14560
  const N = eo[BA] || eo.US, [cA, X] = Q(""), FA = bA(async (k) => {
14559
14561
  const dA = k.target.files?.[0];
14560
14562
  if (!dA) return;
@@ -14654,30 +14656,30 @@ function si({
14654
14656
  } : {}
14655
14657
  });
14656
14658
  }, [mA, De, vA, iA, Ae, OA, nA, uA, RA, HA, t, ge, se, BA, x]), PA = bA(() => {
14657
- if (v === "basics") {
14659
+ if (E === "basics") {
14658
14660
  if (!WA()) return;
14659
14661
  M(ke("basics"));
14660
- } else if (v === "chest") {
14662
+ } else if (E === "chest") {
14661
14663
  if (!ie) return;
14662
14664
  M(ke("chest"));
14663
- } else if (v === "midsection") {
14665
+ } else if (E === "midsection") {
14664
14666
  if (!oe) return;
14665
14667
  M(ke("midsection"));
14666
- } else if (v === "seat") {
14668
+ } else if (E === "seat") {
14667
14669
  if (!YA) return;
14668
14670
  const k = ke("seat");
14669
14671
  k === "submit" ? p() : M(k);
14670
- } else if (v === "hips") {
14672
+ } else if (E === "hips") {
14671
14673
  if (!_A) return;
14672
14674
  const k = ke("hips");
14673
14675
  k === "submit" ? p() : M(k);
14674
- } else if (v === "bra") {
14676
+ } else if (E === "bra") {
14675
14677
  if (!ge || !se) {
14676
14678
  X(i("Please select both band and cup size"));
14677
14679
  return;
14678
14680
  }
14679
14681
  X(""), p();
14680
- } else if (v === "photo") {
14682
+ } else if (E === "photo") {
14681
14683
  if (!mA || !De) {
14682
14684
  if (L && G) {
14683
14685
  G();
@@ -14695,7 +14697,7 @@ function si({
14695
14697
  return;
14696
14698
  }
14697
14699
  Z();
14698
- } else if (v === "scan-details") {
14700
+ } else if (E === "scan-details") {
14699
14701
  const k = vA === "in" ? parseFloat(Ae) > 0 || parseFloat(OA) > 0 : parseFloat(nA) > 0, dA = parseFloat(uA) > 0;
14700
14702
  if (!k) {
14701
14703
  X(i("Please enter your height"));
@@ -14715,21 +14717,21 @@ function si({
14715
14717
  }
14716
14718
  X(""), Z();
14717
14719
  }
14718
- }, [v, b, WA, ie, oe, _A, YA, ge, se, vA, iA, nA, Ae, OA, uA, RA, mA, De, LA, z, t, HA, L, G, Z]), ae = (k) => {
14720
+ }, [E, b, WA, ie, oe, _A, YA, ge, se, vA, iA, nA, Ae, OA, uA, RA, mA, De, LA, z, t, HA, L, G, Z]), ae = (k) => {
14719
14721
  const dA = b.indexOf(k);
14720
14722
  return dA > 0 ? b[dA - 1] : null;
14721
14723
  }, qA = bA(() => {
14722
- if (X(""), v === "basics")
14724
+ if (X(""), E === "basics")
14723
14725
  V();
14724
- else if (v === "photo")
14726
+ else if (E === "photo")
14725
14727
  M("basics");
14726
- else if (v === "scan-details")
14728
+ else if (E === "scan-details")
14727
14729
  M("photo");
14728
14730
  else {
14729
- const k = ae(v);
14731
+ const k = ae(E);
14730
14732
  k ? M(k) : V();
14731
14733
  }
14732
- }, [v, b, V]), xe = v === "basics" || v === "scan-details" ? !0 : v === "chest" ? !!ie : v === "midsection" ? !!oe : v === "seat" ? !!YA : v === "hips" ? !!_A : v === "bra" ? !!(ge && se) : v === "photo", Ie = v === b[b.length - 1], Le = () => {
14734
+ }, [E, b, V]), xe = E === "basics" || E === "scan-details" ? !0 : E === "chest" ? !!ie : E === "midsection" ? !!oe : E === "seat" ? !!YA : E === "hips" ? !!_A : E === "bra" ? !!(ge && se) : E === "photo", Ie = E === b[b.length - 1], Le = () => {
14733
14735
  if (vA === "in") {
14734
14736
  const k = (parseFloat(Ae) || 0) * 12 + (parseFloat(OA) || 0);
14735
14737
  k > 0 && jA(String(Math.round(k * 2.54)));
@@ -14745,7 +14747,7 @@ function si({
14745
14747
  }
14746
14748
  iA === "kg" && uA && ee(String(Math.round(parseFloat(uA) * 2.205))), TA("in"), Me("lbs"), n("in"), s("lbs"), f?.("in");
14747
14749
  };
14748
- if (v === "scan-details" && z)
14750
+ if (E === "scan-details" && z)
14749
14751
  return /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
14750
14752
  /* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
14751
14753
  /* @__PURE__ */ A(
@@ -14806,8 +14808,8 @@ function si({
14806
14808
  {
14807
14809
  value: BA,
14808
14810
  options: Object.keys(eo),
14809
- isOpen: E === "region",
14810
- onToggle: () => y(E === "region" ? null : "region"),
14811
+ isOpen: v === "region",
14812
+ onToggle: () => y(v === "region" ? null : "region"),
14811
14813
  onSelect: (k) => {
14812
14814
  UA(k), le(null), Pe(null), y(null);
14813
14815
  }
@@ -14822,8 +14824,8 @@ function si({
14822
14824
  value: ge,
14823
14825
  options: eo[BA] || eo.US,
14824
14826
  placeholder: "—",
14825
- isOpen: E === "band",
14826
- onToggle: () => y(E === "band" ? null : "band"),
14827
+ isOpen: v === "band",
14828
+ onToggle: () => y(v === "band" ? null : "band"),
14827
14829
  onSelect: (k) => {
14828
14830
  le(k), y(null);
14829
14831
  }
@@ -14839,8 +14841,8 @@ function si({
14839
14841
  options: lo[BA] || lo.US,
14840
14842
  placeholder: "—",
14841
14843
  direction: "up",
14842
- isOpen: E === "cup",
14843
- onToggle: () => y(E === "cup" ? null : "cup"),
14844
+ isOpen: v === "cup",
14845
+ onToggle: () => y(v === "cup" ? null : "cup"),
14844
14846
  onSelect: (k) => {
14845
14847
  Pe(k), y(null);
14846
14848
  }
@@ -14865,7 +14867,7 @@ function si({
14865
14867
  )
14866
14868
  ] })
14867
14869
  ] });
14868
- if (v === "photo" || v === "scan-details") {
14870
+ if (E === "photo" || E === "scan-details") {
14869
14871
  const k = vA === "in" ? parseFloat(Ae) > 0 || parseFloat(OA) > 0 : parseFloat(nA) > 0, dA = parseFloat(uA) > 0, Be = !!XA, ue = [];
14870
14872
  lA && ue.push(i("Analyzing photo…")), !Be && !lA && ue.push(i("Upload a photo")), k || ue.push(i("Enter your height")), dA || ue.push(i("Enter your weight")), t && (!ge || !se) && ue.push(i("Enter your bra size"));
14871
14873
  const We = ue.length > 0, Ue = We ? ue[0] ?? i("Analyze My Size") : i("Analyze My Size");
@@ -15325,8 +15327,8 @@ function si({
15325
15327
  {
15326
15328
  value: BA,
15327
15329
  options: Object.keys(eo),
15328
- isOpen: E === "region",
15329
- onToggle: () => y(E === "region" ? null : "region"),
15330
+ isOpen: v === "region",
15331
+ onToggle: () => y(v === "region" ? null : "region"),
15330
15332
  onSelect: (sA) => {
15331
15333
  UA(sA), le(null), Pe(null), y(null);
15332
15334
  }
@@ -15341,8 +15343,8 @@ function si({
15341
15343
  value: ge,
15342
15344
  options: eo[BA] || eo.US,
15343
15345
  placeholder: "—",
15344
- isOpen: E === "band",
15345
- onToggle: () => y(E === "band" ? null : "band"),
15346
+ isOpen: v === "band",
15347
+ onToggle: () => y(v === "band" ? null : "band"),
15346
15348
  onSelect: (sA) => {
15347
15349
  le(sA), y(null);
15348
15350
  }
@@ -15358,8 +15360,8 @@ function si({
15358
15360
  options: lo[BA] || lo.US,
15359
15361
  placeholder: "—",
15360
15362
  direction: "up",
15361
- isOpen: E === "cup",
15362
- onToggle: () => y(E === "cup" ? null : "cup"),
15363
+ isOpen: v === "cup",
15364
+ onToggle: () => y(v === "cup" ? null : "cup"),
15363
15365
  onSelect: (sA) => {
15364
15366
  Pe(sA), y(null);
15365
15367
  }
@@ -15509,7 +15511,7 @@ function si({
15509
15511
  }
15510
15512
  ),
15511
15513
  /* @__PURE__ */ e("div", { className: "ps-bp-root", children: [
15512
- v === "basics" && (() => {
15514
+ E === "basics" && (() => {
15513
15515
  const k = () => {
15514
15516
  if (vA === "in") {
15515
15517
  const Be = (parseFloat(Ae) || 5) * 12 + (parseFloat(OA) || 8);
@@ -15612,7 +15614,7 @@ function si({
15612
15614
  cA && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: cA })
15613
15615
  ] }, "step-basics");
15614
15616
  })(),
15615
- v === "chest" && !t && (z ? /* @__PURE__ */ A(
15617
+ E === "chest" && !t && (z ? /* @__PURE__ */ A(
15616
15618
  To,
15617
15619
  {
15618
15620
  stepNumber: b.indexOf("chest") + 1,
@@ -15637,7 +15639,7 @@ function si({
15637
15639
  ] }),
15638
15640
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
15639
15641
  ] }, "step-chest")),
15640
- v === "midsection" && (z ? /* @__PURE__ */ A(
15642
+ E === "midsection" && (z ? /* @__PURE__ */ A(
15641
15643
  To,
15642
15644
  {
15643
15645
  stepNumber: b.indexOf("midsection") + 1,
@@ -15670,7 +15672,7 @@ function si({
15670
15672
  ] }) }),
15671
15673
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
15672
15674
  ] }, "step-midsection")),
15673
- v === "seat" && (z ? /* @__PURE__ */ A(
15675
+ E === "seat" && (z ? /* @__PURE__ */ A(
15674
15676
  To,
15675
15677
  {
15676
15678
  stepNumber: b.indexOf("seat") + 1,
@@ -15703,7 +15705,7 @@ function si({
15703
15705
  ] }) }),
15704
15706
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
15705
15707
  ] }, "step-seat")),
15706
- v === "hips" && t && (z ? /* @__PURE__ */ A(
15708
+ E === "hips" && t && (z ? /* @__PURE__ */ A(
15707
15709
  To,
15708
15710
  {
15709
15711
  stepNumber: b.indexOf("hips") + 1,
@@ -15728,7 +15730,7 @@ function si({
15728
15730
  ] }),
15729
15731
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
15730
15732
  ] }, "step-hips")),
15731
- v === "bra" && t && /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
15733
+ E === "bra" && t && /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
15732
15734
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: i("Select your bra size") }),
15733
15735
  /* @__PURE__ */ e("div", { className: "ps-bp-bra-section", children: [
15734
15736
  /* @__PURE__ */ e("div", { className: "ps-bp-bra-header", children: [
@@ -15801,10 +15803,10 @@ function si({
15801
15803
  ] }),
15802
15804
  cA && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: cA })
15803
15805
  ] }, "step-bra"),
15804
- !(z && v === "basics") && (() => {
15805
- const k = v === "basics" && L && !!G, dA = k ? G : PA, Be = Te(vA) ? ` (${Te(vA)})` : "", ue = k ? i("Find My Best Fit") + Be : Ie ? i("Find My Size") + Be : i("Next");
15806
+ !(z && E === "basics") && (() => {
15807
+ const k = E === "basics" && L && !!G, dA = k ? G : PA, Be = Te(vA) ? ` (${Te(vA)})` : "", ue = k ? i("Find My Best Fit") + Be : Ie ? i("Find My Size") + Be : i("Next");
15806
15808
  return /* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
15807
- v !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: qA, type: "button", children: [
15809
+ E !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: qA, type: "button", children: [
15808
15810
  /* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
15809
15811
  " ",
15810
15812
  i("Back")
@@ -15851,7 +15853,7 @@ function vg({
15851
15853
  apiKey: I,
15852
15854
  t: d
15853
15855
  }) {
15854
- const W = r === "close-up", V = Go(), [i, b] = Q("manual"), [v, M] = Q(() => {
15856
+ const W = r === "close-up", V = Go(), [i, b] = Q("manual"), [E, M] = Q(() => {
15855
15857
  const F = {};
15856
15858
  return g.forEach((lA) => {
15857
15859
  F[lA.key] = w.current[lA.key] || "";
@@ -15881,13 +15883,13 @@ function vg({
15881
15883
  }, TA = () => {
15882
15884
  const F = g[0];
15883
15885
  if (!F) return;
15884
- const lA = parseFloat(v[F.key] || "");
15886
+ const lA = parseFloat(E[F.key] || "");
15885
15887
  if (!lA || lA <= 0) {
15886
15888
  j(d("Please enter your ") + d(F.label).toLowerCase());
15887
15889
  return;
15888
15890
  }
15889
15891
  g.forEach((Qe) => {
15890
- const we = parseFloat(v[Qe.key] || "");
15892
+ const we = parseFloat(E[Qe.key] || "");
15891
15893
  we > 0 && (w.current[Qe.key] = String(we));
15892
15894
  }), w.current.gender = w.current.gender || "male", f("exact"), D(!0), m("size-result"), P("exact");
15893
15895
  }, iA = () => {
@@ -15949,7 +15951,7 @@ function vg({
15949
15951
  {
15950
15952
  type: "number",
15951
15953
  className: "ps-bpm-value-input",
15952
- value: v[F.key],
15954
+ value: E[F.key],
15953
15955
  onChange: (lA) => vA(F.key, lA.target.value),
15954
15956
  placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
15955
15957
  step: F.step ?? 0.5,
@@ -15990,7 +15992,7 @@ function vg({
15990
15992
  )
15991
15993
  ] })
15992
15994
  ] }) });
15993
- const ve = g.some((F) => (parseFloat(v[F.key] || "") || 0) > 0), De = !!h && OA === !0 && !_, XA = _ || !De && !ve, DA = _ ? d("Analyzing photo…") : De ? d("Analyze") : `${d("Find My Size")}${Te(s) ? ` (${Te(s)})` : ""}`, mA = De ? iA : TA;
15995
+ const ve = g.some((F) => (parseFloat(E[F.key] || "") || 0) > 0), De = !!h && OA === !0 && !_, XA = _ || !De && !ve, DA = _ ? d("Analyzing photo…") : De ? d("Analyze") : `${d("Find My Size")}${Te(s) ? ` (${Te(s)})` : ""}`, mA = De ? iA : TA;
15994
15996
  return i !== "photo" || B ? /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
15995
15997
  /* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: a, alt: n, className: "ps-bp-image-img" }) }),
15996
15998
  /* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
@@ -16013,7 +16015,7 @@ function vg({
16013
16015
  {
16014
16016
  type: "number",
16015
16017
  className: "ps-bp-inline-input",
16016
- value: v[F.key],
16018
+ value: E[F.key],
16017
16019
  onChange: (lA) => vA(F.key, lA.target.value),
16018
16020
  placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
16019
16021
  step: F.step ?? 0.5,
@@ -16371,7 +16373,7 @@ function vg({
16371
16373
  {
16372
16374
  type: "number",
16373
16375
  className: "ps-bp-inline-input",
16374
- value: v[F.key],
16376
+ value: E[F.key],
16375
16377
  onChange: (lA) => vA(F.key, lA.target.value),
16376
16378
  placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
16377
16379
  step: F.step ?? 0.5,
@@ -16712,7 +16714,7 @@ function hi({
16712
16714
  onUpload: V,
16713
16715
  onProcessing: i,
16714
16716
  onComplete: b,
16715
- onError: v,
16717
+ onError: E,
16716
16718
  sizeGuideData: M
16717
16719
  }) {
16718
16720
  const z = B || o, [j, wA] = Q(() => m || "");
@@ -16753,7 +16755,7 @@ function hi({
16753
16755
  const c = so(r);
16754
16756
  c === "foot" || c === "head" ? ie("cm") : c === "face" && ie("mm");
16755
16757
  }, [r]);
16756
- const u = hA({}), [YA, xA] = Q("male"), [yA, q] = Q(0), [ge, le] = Q(null), [se, Pe] = Q(!1), [BA, UA] = Q(() => Ne("profiles", [])), [ye, be] = Q(() => Ne("history", [])), [E, y] = Q(() => _g()), [K, N] = Q(() => /* @__PURE__ */ new Set()), [cA, X] = Q(null), FA = bA((c) => {
16758
+ const u = hA({}), [YA, xA] = Q("male"), [yA, q] = Q(0), [ge, le] = Q(null), [se, Pe] = Q(!1), [BA, UA] = Q(() => Ne("profiles", [])), [ye, be] = Q(() => Ne("history", [])), [v, y] = Q(() => _g()), [K, N] = Q(() => /* @__PURE__ */ new Set()), [cA, X] = Q(null), FA = bA((c) => {
16757
16759
  y(c), Dn(c);
16758
16760
  }, []), [JA, WA] = Q(!1), [fe, HA] = Q(null), [ke, p] = Q(null), Z = hA(null), PA = hA(() => !1), ae = hA(() => {
16759
16761
  }), qA = bA((c, C) => {
@@ -16864,7 +16866,7 @@ function hi({
16864
16866
  }
16865
16867
  }, [oA]), Io = bA(
16866
16868
  (c, C, U) => {
16867
- let $ = E, QA = BA.find((gA) => gA.id === $);
16869
+ let $ = v, QA = BA.find((gA) => gA.id === $);
16868
16870
  if (!QA) {
16869
16871
  const gA = {
16870
16872
  id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
@@ -16906,7 +16908,7 @@ function hi({
16906
16908
  }), UA(Ne("profiles", []));
16907
16909
  }
16908
16910
  },
16909
- [E, BA, s, o, r, z, FA]
16911
+ [v, BA, s, o, r, z, FA]
16910
16912
  ), eg = hA(null), [uo, og] = Q(null), Eg = bA(async (c) => {
16911
16913
  const C = c.height ?? c.heightCm ?? 0, U = c.weight ?? c.weightKg ?? 0, $ = !!c.measurements && Object.keys(c.measurements).length > 0, QA = c.photoBase64;
16912
16914
  if (!$ && QA && C > 0 && eg.current) {
@@ -16951,11 +16953,11 @@ function hi({
16951
16953
  }).catch(() => {
16952
16954
  }).finally(() => lA(!1));
16953
16955
  }, [z, r, o, M, s, _]), ht = bA(async () => {
16954
- const c = BA.find((QA) => QA.id === E);
16956
+ const c = BA.find((QA) => QA.id === v);
16955
16957
  if (!c) return;
16956
16958
  const C = c.height ?? c.heightCm ?? 0, U = c.weight ?? c.weightKg ?? 0;
16957
16959
  C > 0 && U > 0 && og(c);
16958
- }, [BA, E]), vt = bA(() => {
16960
+ }, [BA, v]), vt = bA(() => {
16959
16961
  if (!uo) return;
16960
16962
  const c = uo;
16961
16963
  og(null), Eg(c);
@@ -17007,11 +17009,11 @@ function hi({
17007
17009
  }
17008
17010
  }, [oA, fe, RA, ro]), Pt = oA !== "idle" && oA !== "processing" && oA !== "result" && oA !== "welcome" && oA !== "body-profile" && oA !== "size-result", gg = bA((c) => {
17009
17011
  if (!Nt(c)) {
17010
- MA(J("Please upload a JPEG, PNG, or WebP image.")), O("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
17012
+ MA(J("Please upload a JPEG, PNG, or WebP image.")), O("error"), E?.({ message: "Invalid file type", code: "INVALID_FILE" });
17011
17013
  return;
17012
17014
  }
17013
17015
  if (c.size > 10 * 1024 * 1024) {
17014
- MA(J("Image must be under 10MB.")), O("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
17016
+ MA(J("Image must be under 10MB.")), O("error"), E?.({ message: "File too large", code: "FILE_TOO_LARGE" });
17015
17017
  return;
17016
17018
  }
17017
17019
  T(c), ze.current = c, Oo.current = null;
@@ -17020,7 +17022,7 @@ function hi({
17020
17022
  ue.current = U;
17021
17023
  }).catch(() => {
17022
17024
  });
17023
- }, [V, v]), Ig = bA(() => {
17025
+ }, [V, E]), Ig = bA(() => {
17024
17026
  T(null), _ && URL.revokeObjectURL(_), pA(null);
17025
17027
  }, [_]), Bo = bA(() => {
17026
17028
  k.current && (clearInterval(k.current), k.current = null), Xe.current?.(), Xe.current = null;
@@ -17042,9 +17044,9 @@ function hi({
17042
17044
  } else if (c.status === "failed" && !dA.current) {
17043
17045
  dA.current = !0, Bo(), ZA(!1), ee(null);
17044
17046
  const C = c.error || J("Try-on generation failed");
17045
- MA(C), O("error"), v?.({ message: C });
17047
+ MA(C), O("error"), E?.({ message: C });
17046
17048
  }
17047
- }, [b, v, Bo]), Ao = He(() => tA?.found && tA.requiredFields && tA.requiredFields.length > 0 ? tA.requiredFields : YA === "female" ? pn : Cn, [tA, YA]), mo = bA(async (c) => {
17049
+ }, [b, E, Bo]), Ao = He(() => tA?.found && tA.requiredFields && tA.requiredFields.length > 0 ? tA.requiredFields : YA === "female" ? pn : Cn, [tA, YA]), mo = bA(async (c) => {
17048
17050
  if (!Ie.current) return;
17049
17051
  const C = c || me, U = je(s), $ = Se(), QA = so(r);
17050
17052
  if (QA === "face" || QA === "head") {
@@ -17171,7 +17173,7 @@ function hi({
17171
17173
  }, [s, me, EA, Ee, NA, CA, tA, r, Ao, Io]), bt = bA(async (c, C, U, $, QA, gA, Y, R, rA, KA, fA) => {
17172
17174
  if (!Ie.current) {
17173
17175
  const aA = J("SDK not configured. Please refresh and try again.");
17174
- console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), MA(aA), O("error"), v?.({ message: aA, code: "SDK_NOT_CONFIGURED" });
17176
+ console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), MA(aA), O("error"), E?.({ message: aA, code: "SDK_NOT_CONFIGURED" });
17175
17177
  return;
17176
17178
  }
17177
17179
  je(s), Se();
@@ -17197,7 +17199,7 @@ function hi({
17197
17199
  apiUrl: s
17198
17200
  }), !Ie.current || !Le.current) {
17199
17201
  const fA = J("SDK not configured. Please refresh and try again.");
17200
- console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), MA(fA), O("error"), v?.({ message: fA, code: "SDK_NOT_CONFIGURED" });
17202
+ console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), MA(fA), O("error"), E?.({ message: fA, code: "SDK_NOT_CONFIGURED" });
17201
17203
  return;
17202
17204
  }
17203
17205
  const C = je(s), U = Se();
@@ -17213,7 +17215,7 @@ function hi({
17213
17215
  if (!VA) {
17214
17216
  console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await fA;
17215
17217
  const aA = J(QA === "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.");
17216
- MA(aA), O("error"), v?.({ message: aA, code: "FACE_DETECTION_FAILED" }), lA(!1);
17218
+ MA(aA), O("error"), E?.({ message: aA, code: "FACE_DETECTION_FAILED" }), lA(!1);
17217
17219
  return;
17218
17220
  }
17219
17221
  VA && Ve(VA.landmarks);
@@ -17345,7 +17347,7 @@ function hi({
17345
17347
  const C = c || GA || ze.current;
17346
17348
  if (!C || !Ie.current || !Le.current) {
17347
17349
  const gA = Ie.current ? J("Please upload a photo first.") : J("SDK not configured. Please provide an API key.");
17348
- MA(gA), O("error"), v?.({ message: gA, code: "SDK_NOT_CONFIGURED" });
17350
+ MA(gA), O("error"), E?.({ message: gA, code: "SDK_NOT_CONFIGURED" });
17349
17351
  return;
17350
17352
  }
17351
17353
  c && c !== GA && (T(c), ze.current = c), dA.current = !1, ZA(!0), ee(Date.now());
@@ -17443,9 +17445,9 @@ function hi({
17443
17445
  }, 3e3);
17444
17446
  } catch (gA) {
17445
17447
  const Y = gA instanceof Error ? gA.message : J("Failed to start try-on"), R = gA instanceof Jg ? gA.code : void 0;
17446
- MA(Y), O("error"), v?.({ message: Y, code: R });
17448
+ MA(Y), O("error"), E?.({ message: Y, code: R });
17447
17449
  }
17448
- }, [GA, o, r, DA, i, v, tg]);
17450
+ }, [GA, o, r, DA, i, E, tg]);
17449
17451
  kA(() => {
17450
17452
  if (!DA) {
17451
17453
  Zo.current = !1;
@@ -17476,7 +17478,7 @@ function hi({
17476
17478
  u.current = U, xA(U.gender || "male"), C.country && S(C.country), C.sizingUnit && ie(C.sizingUnit), C.heightUnit && oe(C.heightUnit), C.weightUnit && _A(C.weightUnit), q(($) => $ + 1);
17477
17479
  }, [BA]);
17478
17480
  It.current = Mt, bA((c, C) => {
17479
- const U = (C ? null : E) || `p_${Date.now()}`, $ = {
17481
+ const U = (C ? null : v) || `p_${Date.now()}`, $ = {
17480
17482
  id: U,
17481
17483
  name: c,
17482
17484
  gender: u.current.gender || "male",
@@ -17530,7 +17532,7 @@ function hi({
17530
17532
  }
17531
17533
  return [...Y, $].slice(-50);
17532
17534
  }), FA(U), WA(!0);
17533
- }, [E, EA, CA, Ee, NA]);
17535
+ }, [v, EA, CA, Ee, NA]);
17534
17536
  const ug = bA(async () => {
17535
17537
  const c = `h_${Date.now()}`;
17536
17538
  let C = !1;
@@ -17570,15 +17572,15 @@ function hi({
17570
17572
  hasPhoto: C || void 0,
17571
17573
  selectedSizes: gA.length ? gA : void 0
17572
17574
  };
17573
- if (E) {
17574
- const R = BA.find((rA) => rA.id === E);
17575
+ if (v) {
17576
+ const R = BA.find((rA) => rA.id === v);
17575
17577
  R && (Y.profileName = R.name);
17576
17578
  }
17577
17579
  be((R) => {
17578
17580
  const rA = [Y, ...R].slice(0, 50), KA = new Set(rA.map((fA) => fA.id));
17579
17581
  return jt(KA), rA;
17580
17582
  });
17581
- }, [r, o, nA, DA, tA, E, BA, GA]), io = hA(!1), bo = hA(!1);
17583
+ }, [r, o, nA, DA, tA, v, BA, GA]), io = hA(!1), bo = hA(!1);
17582
17584
  kA(() => {
17583
17585
  if (oA === "size-result" && DA && !io.current)
17584
17586
  io.current = !0, bo.current = !1, ug().catch(() => {
@@ -17712,14 +17714,14 @@ function hi({
17712
17714
  apiUrl: je(s),
17713
17715
  apiKey: Se(),
17714
17716
  hasActiveProfileWithMeasurements: (() => {
17715
- const Y = BA.find((KA) => KA.id === E);
17717
+ const Y = BA.find((KA) => KA.id === v);
17716
17718
  if (!Y) return !1;
17717
17719
  const R = Y.height ?? Y.heightCm ?? 0, rA = Y.weight ?? Y.weightKg ?? 0;
17718
17720
  return R > 0 && rA > 0;
17719
17721
  })(),
17720
17722
  onUseActiveProfile: ht,
17721
- activeProfileName: BA.find((R) => R.id === E)?.name || null,
17722
- activeProfile: BA.find((Y) => Y.id === E) || null,
17723
+ activeProfileName: BA.find((R) => R.id === v)?.name || null,
17724
+ activeProfile: BA.find((Y) => Y.id === v) || null,
17723
17725
  onStartFresh: () => {
17724
17726
  FA(null), u.current = {};
17725
17727
  },
@@ -17742,7 +17744,7 @@ function hi({
17742
17744
  onBack: ro,
17743
17745
  t: J
17744
17746
  },
17745
- `bp-${E || "anon"}`
17747
+ `bp-${v || "anon"}`
17746
17748
  ) }, "v-bodyprofile");
17747
17749
  }
17748
17750
  case "estimation-review":
@@ -17802,7 +17804,7 @@ function hi({
17802
17804
  },
17803
17805
  onClose: ro,
17804
17806
  userHeightCm: (() => {
17805
- const c = BA.find((QA) => QA.id === E);
17807
+ const c = BA.find((QA) => QA.id === v);
17806
17808
  if (!c) return;
17807
17809
  const C = c.height ?? c.heightCm;
17808
17810
  if (!C || C <= 0) return;
@@ -17856,7 +17858,7 @@ function hi({
17856
17858
  Xr,
17857
17859
  {
17858
17860
  profiles: BA,
17859
- activeProfileId: E,
17861
+ activeProfileId: v,
17860
17862
  estimatingProfileIds: K,
17861
17863
  apiUrl: je(s),
17862
17864
  apiKey: Se(),
@@ -17939,7 +17941,7 @@ function hi({
17939
17941
  }));
17940
17942
  },
17941
17943
  onDeleteProfile: (c) => {
17942
- UA((C) => C.filter((U) => U.id !== c)), E === c && FA(null), oo("profiles", Ne("profiles", []).filter((C) => C.id !== c));
17944
+ UA((C) => C.filter((U) => U.id !== c)), v === c && FA(null), oo("profiles", Ne("profiles", []).filter((C) => C.id !== c));
17943
17945
  },
17944
17946
  onRequestDelete: (c) => X(c),
17945
17947
  onClose: () => O("body-profile"),
@@ -18044,7 +18046,7 @@ function hi({
18044
18046
  {
18045
18047
  onConfirm: () => {
18046
18048
  const c = cA, C = Ne("profiles", []).filter((U) => U.id !== c);
18047
- oo("profiles", C), UA(C), E === c && FA(null), X(null);
18049
+ oo("profiles", C), UA(C), v === c && FA(null), X(null);
18048
18050
  },
18049
18051
  onCancel: () => X(null),
18050
18052
  t: J
@@ -18068,7 +18070,7 @@ function hi({
18068
18070
  profileDetail: ke,
18069
18071
  setProfileDetail: p,
18070
18072
  setProfiles: UA,
18071
- activeProfileId: E,
18073
+ activeProfileId: v,
18072
18074
  setActiveProfileId: FA,
18073
18075
  t: J
18074
18076
  }