@primestyleai/tryon 5.10.137 → 5.10.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +455 -386
- package/dist/react/index.js.map +1 -1
- package/dist/react/styles.d.ts +1 -1
- package/dist/storefront/primestyle-tryon.js +69 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -96,9 +96,9 @@ async function eg(o) {
|
|
|
96
96
|
const g = await At(o), t = og.detect(g);
|
|
97
97
|
if (!t?.landmarks?.length || t.landmarks[0].length < 25)
|
|
98
98
|
return null;
|
|
99
|
-
const i = t.landmarks[0], a = i[Vg], c = i[qg], n = i[Zg], w = i[$g], r = (a.y + c.y) / 2, p = (n.y + w.y) / 2, Q = p - r,
|
|
99
|
+
const i = t.landmarks[0], a = i[Vg], c = i[qg], n = i[Zg], w = i[$g], r = (a.y + c.y) / 2, p = (n.y + w.y) / 2, Q = p - r, C = r + Q * 0.28, u = Math.abs(c.x - a.x), m = Math.min(a.x, c.x) - u * 0.05, y = Math.max(a.x, c.x) + u * 0.05, L = Math.abs(w.x - n.x), G = Math.min(n.x, w.x) - L * 0.15, v = Math.max(n.x, w.x) + L * 0.15, l = C + (p - C) * 0.55, R = u * 0.85, q = (a.x + c.x + n.x + w.x) / 4, s = q - R / 2, P = q + R / 2;
|
|
100
100
|
return {
|
|
101
|
-
chest: { y:
|
|
101
|
+
chest: { y: C, x1: m, x2: y },
|
|
102
102
|
waist: { y: l, x1: s, x2: P },
|
|
103
103
|
hips: { y: p, x1: G, x2: v }
|
|
104
104
|
};
|
|
@@ -153,8 +153,8 @@ async function po(o) {
|
|
|
153
153
|
nose: r(nn),
|
|
154
154
|
imageWidth: i,
|
|
155
155
|
imageHeight: a
|
|
156
|
-
}, Q = (y) => !!y && typeof y == "object" && typeof y.x == "number" && typeof y.y == "number",
|
|
157
|
-
console.groupCollapsed(`[PS-SDK:MediaPipe] ✓ ${
|
|
156
|
+
}, Q = (y) => !!y && typeof y == "object" && typeof y.x == "number" && typeof y.y == "number", C = Object.values(p).filter(Q).length, u = n.some((y) => typeof y.z == "number"), m = !!w;
|
|
157
|
+
console.groupCollapsed(`[PS-SDK:MediaPipe] ✓ ${C} joints detected @ ${p.imageWidth}×${p.imageHeight}px (z=${u ? "yes" : "no"}, worldLandmarks=${m ? "yes" : "no"})`);
|
|
158
158
|
for (const [y, L] of Object.entries(p)) {
|
|
159
159
|
if (!Q(L)) continue;
|
|
160
160
|
const G = L, v = typeof G.z == "number" ? `, z=${G.z.toFixed(3)}` : "", l = typeof G.visibility == "number" ? `, vis=${G.visibility.toFixed(2)}` : "";
|
|
@@ -275,12 +275,12 @@ function cn(o, g, t) {
|
|
|
275
275
|
const w = c > 0 ? Lg / c : 0, r = (E, F) => Math.hypot(
|
|
276
276
|
(E.x - F.x) * g,
|
|
277
277
|
(E.y - F.y) * t
|
|
278
|
-
) * w, p = r(o.leftIrisCenter, o.rightIrisCenter),
|
|
278
|
+
) * w, p = r(o.leftIrisCenter, o.rightIrisCenter), C = r(o.leftInnerEye, o.rightInnerEye) / 1.6, u = r(o.leftTragus, o.rightTragus), m = r(o.leftTragus, o.leftOuterEye), y = r(o.rightTragus, o.rightOuterEye), L = (m + y) / 2, G = u * 1.07, l = Math.abs((o.forehead.z ?? 0) - (o.chin.z ?? 0)) * g * w, R = Math.max(170, Math.min(210, l || 190)), q = G / 2, s = R / 2, P = Math.PI * Math.sqrt(2 * (q * q + s * s));
|
|
279
279
|
return {
|
|
280
280
|
measurements: {
|
|
281
281
|
irisDiameter: Lg,
|
|
282
282
|
pd: Ze(p),
|
|
283
|
-
bridgeWidth: Ze(
|
|
283
|
+
bridgeWidth: Ze(C),
|
|
284
284
|
faceWidth: Ze(u),
|
|
285
285
|
templeLengthLeft: Ze(m),
|
|
286
286
|
templeLengthRight: Ze(y),
|
|
@@ -314,8 +314,8 @@ async function wn(o) {
|
|
|
314
314
|
if (!Q)
|
|
315
315
|
return null;
|
|
316
316
|
console.log("[PS-SDK:FaceDetect] step 4/4 — computing measurements");
|
|
317
|
-
const { measurements:
|
|
318
|
-
return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: u, measurements:
|
|
317
|
+
const { measurements: C, irisConfidence: u } = cn(Q, i, a);
|
|
318
|
+
return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: u, measurements: C }), { landmarks: Q, measurementsMm: C, irisConfidence: u, imageWidth: i, imageHeight: a };
|
|
319
319
|
} catch (t) {
|
|
320
320
|
return console.error("[PS-SDK:FaceDetect] detectFaceMeasurements FAILED:", t), null;
|
|
321
321
|
}
|
|
@@ -328,7 +328,7 @@ function pn(o) {
|
|
|
328
328
|
const g = parseFloat(o.replace(/[^\d.]/g, ""));
|
|
329
329
|
return isNaN(g) ? 0 : g;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function dn(o, g, t) {
|
|
332
332
|
const { min: i, max: a } = ln(g);
|
|
333
333
|
if (i === 0 && a === 0) return "good";
|
|
334
334
|
const c = a - i, n = c > 0 ? c * 0.5 : i * 0.05 || 3, w = t === "cm" ? 2.54 : t === "mm" ? 25.4 : 1;
|
|
@@ -340,7 +340,7 @@ function Cn(o, g, t) {
|
|
|
340
340
|
const r = o - a;
|
|
341
341
|
return r > n * 2 ? "too-tight" : r > n ? "tight" : "a-bit-tight";
|
|
342
342
|
}
|
|
343
|
-
const
|
|
343
|
+
const Cn = {
|
|
344
344
|
chest: "chest",
|
|
345
345
|
bust: "chest",
|
|
346
346
|
waist: "waist",
|
|
@@ -353,7 +353,7 @@ const dn = {
|
|
|
353
353
|
]);
|
|
354
354
|
function Qn(o, g, t) {
|
|
355
355
|
return o.filter((i) => !Dn.has(i.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim())).map((i) => {
|
|
356
|
-
const a = pn(i.userValue), c =
|
|
356
|
+
const a = pn(i.userValue), c = dn(a, i.chartRange, t), n = {
|
|
357
357
|
area: i.measurement,
|
|
358
358
|
section: i.section || void 0,
|
|
359
359
|
fit: c,
|
|
@@ -361,7 +361,7 @@ function Qn(o, g, t) {
|
|
|
361
361
|
garmentRange: i.chartRange || void 0
|
|
362
362
|
};
|
|
363
363
|
if (g) {
|
|
364
|
-
const w =
|
|
364
|
+
const w = Cn[i.measurement.toLowerCase()];
|
|
365
365
|
if (w && g[w]) {
|
|
366
366
|
const r = g[w];
|
|
367
367
|
n.y = Math.round(r.y * 1e3) / 1e3, n.x1 = Math.round(r.x1 * 1e3) / 1e3, n.x2 = Math.round(r.x2 * 1e3) / 1e3;
|
|
@@ -377,15 +377,15 @@ function fn(o, g, t, i, a) {
|
|
|
377
377
|
const n = /* @__PURE__ */ new Set(), w = [], r = (p) => {
|
|
378
378
|
if (p)
|
|
379
379
|
for (const Q of p) {
|
|
380
|
-
const
|
|
381
|
-
n.has(
|
|
380
|
+
const C = Q.measurement.toLowerCase();
|
|
381
|
+
n.has(C) || (n.add(C), Q.userValue && w.push(`${Q.measurement} ${Q.userValue}`));
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
if (r(o?.matchDetails), o?.sections)
|
|
385
385
|
for (const p of Object.values(o.sections)) r(p.matchDetails);
|
|
386
386
|
if (w.length && (c.userMeasurementsText = w.join(", ")), g?.headers?.length && g.rows?.length) {
|
|
387
387
|
const p = g.headers, Q = g.rows.slice(0, 20).map(
|
|
388
|
-
(
|
|
388
|
+
(C) => p.map((u, m) => `${u} ${C[m] ?? "—"}`).join(", ")
|
|
389
389
|
);
|
|
390
390
|
c.sizeChartSummary = Q.join(" | ");
|
|
391
391
|
}
|
|
@@ -522,7 +522,7 @@ function Hn() {
|
|
|
522
522
|
return No ? Date.now() - No.storedAt > bn ? (No = null, null) : No : null;
|
|
523
523
|
}
|
|
524
524
|
async function st(o) {
|
|
525
|
-
const g = (...
|
|
525
|
+
const g = (...C) => console.log("[ps-sdk:recommend]", ...C), t = o.profile ?? un();
|
|
526
526
|
if (!t)
|
|
527
527
|
return g("no active profile — returning null"), null;
|
|
528
528
|
if (g("start", {
|
|
@@ -532,30 +532,30 @@ async function st(o) {
|
|
|
532
532
|
hasMeasurements: !!t.measurements && Object.keys(t.measurements || {}).length,
|
|
533
533
|
measurementsCount: Object.keys(t.measurements || {}).length
|
|
534
534
|
}), !o.skipCache) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
g("cache HIT", { recommendedSize:
|
|
538
|
-
const u =
|
|
539
|
-
recommendedSize:
|
|
540
|
-
confidence:
|
|
535
|
+
const C = mn(t, o.productId);
|
|
536
|
+
if (C) {
|
|
537
|
+
g("cache HIT", { recommendedSize: C.recommendedSize, hasSectionsFull: !!C.sectionsFull });
|
|
538
|
+
const u = C.sectionsFull ? {
|
|
539
|
+
recommendedSize: C.recommendedSize,
|
|
540
|
+
confidence: C.confidence || "high",
|
|
541
541
|
reasoning: "",
|
|
542
|
-
recommendedLength:
|
|
542
|
+
recommendedLength: C.recommendedLength,
|
|
543
543
|
sections: Object.fromEntries(
|
|
544
|
-
Object.entries(
|
|
544
|
+
Object.entries(C.sectionsFull).map(([m, y]) => [
|
|
545
545
|
m,
|
|
546
546
|
{ ...y, matchDetails: [] }
|
|
547
547
|
])
|
|
548
548
|
)
|
|
549
549
|
} : {
|
|
550
|
-
recommendedSize:
|
|
551
|
-
confidence:
|
|
550
|
+
recommendedSize: C.recommendedSize,
|
|
551
|
+
confidence: C.confidence || "high",
|
|
552
552
|
reasoning: "",
|
|
553
|
-
recommendedLength:
|
|
553
|
+
recommendedLength: C.recommendedLength
|
|
554
554
|
};
|
|
555
555
|
return {
|
|
556
|
-
recommendedSize:
|
|
557
|
-
confidence:
|
|
558
|
-
sections:
|
|
556
|
+
recommendedSize: C.recommendedSize,
|
|
557
|
+
confidence: C.confidence,
|
|
558
|
+
sections: C.sections,
|
|
559
559
|
profileId: t.id,
|
|
560
560
|
fromCache: !0,
|
|
561
561
|
raw: u
|
|
@@ -566,8 +566,8 @@ async function st(o) {
|
|
|
566
566
|
let i;
|
|
567
567
|
try {
|
|
568
568
|
i = o.apiKey ?? Re();
|
|
569
|
-
} catch (
|
|
570
|
-
return g("no api key — aborting",
|
|
569
|
+
} catch (C) {
|
|
570
|
+
return g("no api key — aborting", C), null;
|
|
571
571
|
}
|
|
572
572
|
const a = (o.apiUrl ?? je()).replace(/\/+$/, "");
|
|
573
573
|
if (!i)
|
|
@@ -575,7 +575,7 @@ async function st(o) {
|
|
|
575
575
|
let c = null;
|
|
576
576
|
if (o.sizeGuideData != null)
|
|
577
577
|
try {
|
|
578
|
-
const
|
|
578
|
+
const C = await fetch(`${a}/api/v1/sizing/sizeguide`, {
|
|
579
579
|
method: "POST",
|
|
580
580
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${i}` },
|
|
581
581
|
body: JSON.stringify({
|
|
@@ -583,9 +583,9 @@ async function st(o) {
|
|
|
583
583
|
sizeGuideRaw: o.sizeGuideData
|
|
584
584
|
})
|
|
585
585
|
});
|
|
586
|
-
|
|
587
|
-
} catch (
|
|
588
|
-
g("sizeguide threw",
|
|
586
|
+
C.ok ? (c = await C.json(), g("sizeguide OK", { found: c?.found, sectionCount: Object.keys(c?.sections || {}).length })) : g("sizeguide FAILED", C.status, C.statusText);
|
|
587
|
+
} catch (C) {
|
|
588
|
+
g("sizeguide threw", C);
|
|
589
589
|
}
|
|
590
590
|
else
|
|
591
591
|
g("no sizeGuideData provided");
|
|
@@ -594,8 +594,8 @@ async function st(o) {
|
|
|
594
594
|
sizingUnit: t.measurementsUnit || "cm"
|
|
595
595
|
};
|
|
596
596
|
if (t.measurements)
|
|
597
|
-
for (const [
|
|
598
|
-
u != null && (n[
|
|
597
|
+
for (const [C, u] of Object.entries(t.measurements))
|
|
598
|
+
u != null && (n[C] = u);
|
|
599
599
|
t.height != null && (n.height = t.height), t.weight != null && (n.weight = t.weight), t.heightUnit && (n.heightUnit = t.heightUnit), t.weightUnit && (n.weightUnit = t.weightUnit), t.age && (n.age = t.age), t.chestProfile && (n.chestProfile = t.chestProfile), t.midsectionProfile && (n.midsectionProfile = t.midsectionProfile), t.hipProfile && (n.hipProfile = t.hipProfile);
|
|
600
600
|
const w = {
|
|
601
601
|
method: "exact",
|
|
@@ -605,38 +605,38 @@ async function st(o) {
|
|
|
605
605
|
measurements: n
|
|
606
606
|
};
|
|
607
607
|
if (t.gender === "female" && t.bandSize && t.cupSize) {
|
|
608
|
-
const
|
|
608
|
+
const C = t.braRegion ?? t.braSizeRegion ?? "US";
|
|
609
609
|
w.braSize = {
|
|
610
610
|
band: parseFloat(String(t.bandSize)),
|
|
611
611
|
cup: String(t.cupSize),
|
|
612
|
-
region:
|
|
612
|
+
region: C
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
615
|
t.knownMeasurements && (w.knownMeasurements = t.knownMeasurements), c && c.found && (w.sizeGuide = c), g("calling /sizing/recommend", { measurements: Object.keys(n), hasSizeGuide: !!w.sizeGuide });
|
|
616
616
|
let r = null;
|
|
617
617
|
try {
|
|
618
|
-
const
|
|
618
|
+
const C = await fetch(`${a}/api/v1/sizing/recommend`, {
|
|
619
619
|
method: "POST",
|
|
620
620
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${i}` },
|
|
621
621
|
body: JSON.stringify(w)
|
|
622
622
|
});
|
|
623
|
-
if (!
|
|
624
|
-
return g("recommend FAILED",
|
|
625
|
-
r = await
|
|
623
|
+
if (!C.ok)
|
|
624
|
+
return g("recommend FAILED", C.status, C.statusText), null;
|
|
625
|
+
r = await C.json(), g("recommend OK", {
|
|
626
626
|
recommendedSize: r?.recommendedSize,
|
|
627
627
|
sectionKeys: r?.sections ? Object.keys(r.sections) : null,
|
|
628
628
|
sections: r?.sections
|
|
629
629
|
});
|
|
630
|
-
} catch (
|
|
631
|
-
return g("recommend threw",
|
|
630
|
+
} catch (C) {
|
|
631
|
+
return g("recommend threw", C), null;
|
|
632
632
|
}
|
|
633
633
|
if (!r || !r.recommendedSize)
|
|
634
634
|
return g("recommend returned no recommendedSize — bailing"), null;
|
|
635
635
|
const p = r.sections ? Object.fromEntries(
|
|
636
|
-
Object.entries(r.sections).map(([
|
|
636
|
+
Object.entries(r.sections).map(([C, u]) => [C, u.recommendedSize])
|
|
637
637
|
) : void 0, Q = r.sections ? Object.fromEntries(
|
|
638
|
-
Object.entries(r.sections).map(([
|
|
639
|
-
|
|
638
|
+
Object.entries(r.sections).map(([C, u]) => [
|
|
639
|
+
C,
|
|
640
640
|
{
|
|
641
641
|
recommendedSize: u.recommendedSize,
|
|
642
642
|
// Backend may include these on merged Jacket/Pants entries
|
|
@@ -3710,6 +3710,75 @@ const kn = `
|
|
|
3710
3710
|
}
|
|
3711
3711
|
.ps-tryon-drawer-clear:hover { color: var(--ps-error-color); }
|
|
3712
3712
|
|
|
3713
|
+
/* ──────────────────────────────────────────────────────────────────
|
|
3714
|
+
Mobile sizing for the My Profiles / History drawer. Desktop uses vw
|
|
3715
|
+
units which collapse to 1–4 px on a 375 px phone. Override every
|
|
3716
|
+
rule with px-based values so the list is actually readable.
|
|
3717
|
+
────────────────────────────────────────────────────────────────── */
|
|
3718
|
+
@media (max-width: 768px) {
|
|
3719
|
+
.ps-tryon-drawer { padding: 16px 14px; }
|
|
3720
|
+
.ps-tryon-drawer-header { gap: 10px; padding-bottom: 12px; margin-bottom: 12px; }
|
|
3721
|
+
.ps-tryon-drawer-back {
|
|
3722
|
+
width: 36px; height: 36px; border-radius: 8px;
|
|
3723
|
+
}
|
|
3724
|
+
.ps-tryon-drawer-back svg { width: 18px; height: 18px; }
|
|
3725
|
+
.ps-tryon-drawer-title { font-size: 17px; font-weight: 600; }
|
|
3726
|
+
.ps-tryon-drawer-add-btn {
|
|
3727
|
+
width: 32px; height: 32px; border-radius: 8px; font-size: 20px;
|
|
3728
|
+
}
|
|
3729
|
+
.ps-tryon-drawer-list { gap: 10px; }
|
|
3730
|
+
.ps-tryon-drawer-empty { padding: 32px 16px; font-size: 14px; }
|
|
3731
|
+
|
|
3732
|
+
.ps-tryon-drawer-create {
|
|
3733
|
+
padding: 14px;
|
|
3734
|
+
border-radius: 10px;
|
|
3735
|
+
font-size: 14px;
|
|
3736
|
+
gap: 6px;
|
|
3737
|
+
margin-bottom: 4px;
|
|
3738
|
+
}
|
|
3739
|
+
.ps-tryon-drawer-clear {
|
|
3740
|
+
font-size: 13px; padding: 12px 0; margin-top: 6px;
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
.ps-tryon-profile-item {
|
|
3744
|
+
gap: 12px; padding: 14px; border-radius: 12px;
|
|
3745
|
+
}
|
|
3746
|
+
.ps-tryon-profile-avatar {
|
|
3747
|
+
width: 44px; height: 44px;
|
|
3748
|
+
}
|
|
3749
|
+
.ps-tryon-profile-avatar svg { width: 22px; height: 22px; }
|
|
3750
|
+
.ps-tryon-profile-name { font-size: 15px; }
|
|
3751
|
+
.ps-tryon-profile-detail { font-size: 12px; margin-top: 3px; }
|
|
3752
|
+
.ps-tryon-profile-item > svg:last-child { width: 18px; height: 18px; }
|
|
3753
|
+
|
|
3754
|
+
.ps-tryon-history-item {
|
|
3755
|
+
gap: 12px; padding: 12px; border-radius: 12px;
|
|
3756
|
+
}
|
|
3757
|
+
.ps-tryon-history-images { gap: 6px; }
|
|
3758
|
+
.ps-tryon-history-thumb,
|
|
3759
|
+
.ps-tryon-history-result-img {
|
|
3760
|
+
width: 64px; height: 80px; border-radius: 8px;
|
|
3761
|
+
}
|
|
3762
|
+
.ps-tryon-history-product { font-size: 14px; line-height: 1.3; }
|
|
3763
|
+
.ps-tryon-history-meta { font-size: 11px; margin-top: 4px; }
|
|
3764
|
+
.ps-tryon-history-sizing { gap: 8px; margin-top: 6px; }
|
|
3765
|
+
.ps-tryon-history-sizing-reason { font-size: 11px; }
|
|
3766
|
+
.ps-tryon-history-size-badge {
|
|
3767
|
+
min-width: 32px; height: 32px; padding: 0 10px; font-size: 12px;
|
|
3768
|
+
}
|
|
3769
|
+
.ps-tryon-history-sections { gap: 6px; margin-top: 6px; }
|
|
3770
|
+
.ps-tryon-history-section-chip {
|
|
3771
|
+
font-size: 11px; padding: 3px 8px; border-radius: 6px;
|
|
3772
|
+
}
|
|
3773
|
+
.ps-tryon-history-tryon-badge {
|
|
3774
|
+
font-size: 10px; padding: 2px 7px; border-radius: 5px; margin-top: 6px;
|
|
3775
|
+
}
|
|
3776
|
+
.ps-tryon-history-delete {
|
|
3777
|
+
width: 32px; height: 32px; border-radius: 6px;
|
|
3778
|
+
}
|
|
3779
|
+
.ps-tryon-history-delete svg { width: 16px; height: 16px; }
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3713
3782
|
/* Profile detail modal — portaled to body, sits ABOVE the main modal
|
|
3714
3783
|
overlay (which has z-index 2147483647). Equal z-index + later DOM
|
|
3715
3784
|
order means this stacks on top. Same trick as the language dropdown. */
|
|
@@ -8633,8 +8702,8 @@ function Sn({ activeLocale: o, onSelect: g }) {
|
|
|
8633
8702
|
return HA(() => {
|
|
8634
8703
|
if (!t) return;
|
|
8635
8704
|
p();
|
|
8636
|
-
const Q = (
|
|
8637
|
-
a.current?.contains(
|
|
8705
|
+
const Q = (C) => {
|
|
8706
|
+
a.current?.contains(C.target) || c.current?.contains(C.target) || i(!1);
|
|
8638
8707
|
};
|
|
8639
8708
|
return document.addEventListener("mousedown", Q), window.addEventListener("resize", p), window.addEventListener("scroll", p, !0), () => {
|
|
8640
8709
|
document.removeEventListener("mousedown", Q), window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0);
|
|
@@ -8704,7 +8773,7 @@ function ct({
|
|
|
8704
8773
|
onCancel: t,
|
|
8705
8774
|
t: i
|
|
8706
8775
|
}) {
|
|
8707
|
-
const [a, c] = f(o?.name || ""), [n, w] = f(o?.gender || "male"), [r, p] = f(o?.sizingUnit || "cm"), [Q,
|
|
8776
|
+
const [a, c] = f(o?.name || ""), [n, w] = f(o?.gender || "male"), [r, p] = f(o?.sizingUnit || "cm"), [Q, C] = f(() => {
|
|
8708
8777
|
if (!o) return {};
|
|
8709
8778
|
const G = {};
|
|
8710
8779
|
for (const v of ["heightCm", "weightKg", "age"]) {
|
|
@@ -8800,7 +8869,7 @@ function ct({
|
|
|
8800
8869
|
placeholder: " ",
|
|
8801
8870
|
value: Q[G.key] || "",
|
|
8802
8871
|
onChange: (v) => {
|
|
8803
|
-
|
|
8872
|
+
C((l) => ({ ...l, [G.key]: v.target.value })), y("");
|
|
8804
8873
|
}
|
|
8805
8874
|
}
|
|
8806
8875
|
)
|
|
@@ -8825,7 +8894,7 @@ function Tn({
|
|
|
8825
8894
|
}) {
|
|
8826
8895
|
const [p, Q] = f(!1);
|
|
8827
8896
|
if (!o) return null;
|
|
8828
|
-
const
|
|
8897
|
+
const C = (m) => !!(m.sizeGuide?.sections && Object.keys(m.sizeGuide.sections).length > 1), u = (m) => {
|
|
8829
8898
|
const y = {
|
|
8830
8899
|
...m,
|
|
8831
8900
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
@@ -8871,11 +8940,11 @@ function Tn({
|
|
|
8871
8940
|
m.profileName ? `${m.profileName} · ` : "",
|
|
8872
8941
|
new Date(m.date).toLocaleDateString()
|
|
8873
8942
|
] }),
|
|
8874
|
-
m.recommendedSize && !
|
|
8943
|
+
m.recommendedSize && !C(m) && /* @__PURE__ */ e("div", { className: "ps-tryon-history-sizing", children: [
|
|
8875
8944
|
/* @__PURE__ */ A("span", { className: "ps-tryon-history-size-badge", children: m.recommendedSize }),
|
|
8876
8945
|
m.reasoning && /* @__PURE__ */ A("span", { className: "ps-tryon-history-sizing-reason", children: m.reasoning })
|
|
8877
8946
|
] }),
|
|
8878
|
-
|
|
8947
|
+
C(m) && m.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(m.sizingResult.sections).map(([L, G]) => /* @__PURE__ */ e("span", { className: "ps-tryon-history-section-chip", children: [
|
|
8879
8948
|
L,
|
|
8880
8949
|
": ",
|
|
8881
8950
|
G.recommendedSize
|
|
@@ -8953,15 +9022,15 @@ function Wn({
|
|
|
8953
9022
|
onEdit: t,
|
|
8954
9023
|
t: i
|
|
8955
9024
|
}) {
|
|
8956
|
-
const a = o.heightUnit === "in" || o.heightUnit === "ft" ? "in" : "cm", c = o.weightUnit === "lbs" ? "lbs" : "kg", n = Xe(a), w = (
|
|
8957
|
-
if (!
|
|
9025
|
+
const a = o.heightUnit === "in" || o.heightUnit === "ft" ? "in" : "cm", c = o.weightUnit === "lbs" ? "lbs" : "kg", n = Xe(a), w = (C) => {
|
|
9026
|
+
if (!C) return "—";
|
|
8958
9027
|
if (a === "in") {
|
|
8959
|
-
const u = Math.floor(
|
|
9028
|
+
const u = Math.floor(C / 12), m = Math.round(C % 12);
|
|
8960
9029
|
return `${u}'${m}"`;
|
|
8961
9030
|
}
|
|
8962
|
-
return `${Math.round(
|
|
8963
|
-
}, r = (
|
|
8964
|
-
return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: t, children: /* @__PURE__ */ e("div", { className: "ps-confirm-modal", onClick: (
|
|
9031
|
+
return `${Math.round(C)} cm`;
|
|
9032
|
+
}, r = (C) => C ? `${Math.round(C)} ${c}` : "—", p = o.height ?? o.heightCm, Q = o.weight ?? o.weightKg;
|
|
9033
|
+
return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: t, children: /* @__PURE__ */ e("div", { className: "ps-confirm-modal", onClick: (C) => C.stopPropagation(), children: [
|
|
8965
9034
|
/* @__PURE__ */ A(
|
|
8966
9035
|
"button",
|
|
8967
9036
|
{
|
|
@@ -9065,7 +9134,7 @@ function qn({
|
|
|
9065
9134
|
setSizingUnit: r,
|
|
9066
9135
|
formKey: p,
|
|
9067
9136
|
setFormKey: Q,
|
|
9068
|
-
updateField:
|
|
9137
|
+
updateField: C,
|
|
9069
9138
|
setSizingMethod: u,
|
|
9070
9139
|
setSizingLoading: m,
|
|
9071
9140
|
setView: y,
|
|
@@ -9105,7 +9174,7 @@ function qn({
|
|
|
9105
9174
|
placeholder: " ",
|
|
9106
9175
|
className: "ps-tryon-sf-input",
|
|
9107
9176
|
defaultValue: F,
|
|
9108
|
-
onInput: (T) =>
|
|
9177
|
+
onInput: (T) => C(s.key, T.target.value)
|
|
9109
9178
|
}
|
|
9110
9179
|
)
|
|
9111
9180
|
] }) }, s.key);
|
|
@@ -9231,7 +9300,7 @@ function Ug({
|
|
|
9231
9300
|
// hidden during analysis and the prop is kept on the type for callers.
|
|
9232
9301
|
t: r
|
|
9233
9302
|
}) {
|
|
9234
|
-
const p = o || g || "", Q = !!o,
|
|
9303
|
+
const p = o || g || "", Q = !!o, C = Q ? [
|
|
9235
9304
|
{ title: r("DETECTING POSE"), desc: r("Identifying body landmarks from your photo."), viewfinderText: r("DETECTING POSE") },
|
|
9236
9305
|
{ title: r("SCANNING FRAME"), desc: r("Our AI is mapping your proportions to calculate the perfect fit."), viewfinderText: r("SCANNING FRAME") },
|
|
9237
9306
|
{ title: r("ANALYZING BODY"), desc: r("Measuring shoulders, chest, waist and hips."), viewfinderText: r("ANALYZING") },
|
|
@@ -9247,15 +9316,15 @@ function Ug({
|
|
|
9247
9316
|
m({ w: P.naturalWidth || P.offsetWidth, h: P.naturalHeight || P.offsetHeight });
|
|
9248
9317
|
}, L = 6e3, G = 1e3, v = QA(Date.now()), [l, R] = f(0);
|
|
9249
9318
|
HA(() => {
|
|
9250
|
-
const s = (L - G) / Math.max(1,
|
|
9251
|
-
const E = Date.now() - v.current, F = Math.min(
|
|
9252
|
-
R((z) => z === F ? z : F), F >=
|
|
9319
|
+
const s = (L - G) / Math.max(1, C.length - 1), P = setInterval(() => {
|
|
9320
|
+
const E = Date.now() - v.current, F = Math.min(C.length - 1, Math.floor(E / s));
|
|
9321
|
+
R((z) => z === F ? z : F), F >= C.length - 1 && clearInterval(P);
|
|
9253
9322
|
}, 100);
|
|
9254
9323
|
return () => clearInterval(P);
|
|
9255
|
-
}, [
|
|
9324
|
+
}, [C.length]), HA(() => {
|
|
9256
9325
|
Q && t && l === 0 && R(1);
|
|
9257
9326
|
}, [t]);
|
|
9258
|
-
const q =
|
|
9327
|
+
const q = C[l] ?? C[0];
|
|
9259
9328
|
return /* @__PURE__ */ e("div", { className: "ps-msc-root", children: [
|
|
9260
9329
|
/* @__PURE__ */ e("div", { className: "ps-msc-viewfinder", children: [
|
|
9261
9330
|
p && /* @__PURE__ */ A(
|
|
@@ -9284,8 +9353,8 @@ function Io({
|
|
|
9284
9353
|
const [, t] = f(0);
|
|
9285
9354
|
if (HA(() => {
|
|
9286
9355
|
if (o == null) return;
|
|
9287
|
-
const
|
|
9288
|
-
return () => clearInterval(
|
|
9356
|
+
const C = setInterval(() => t((u) => u + 1), 200);
|
|
9357
|
+
return () => clearInterval(C);
|
|
9289
9358
|
}, [o]), o == null) return null;
|
|
9290
9359
|
const i = (Date.now() - o) / 1e3, a = Math.min(95, i / qo * 100), c = Math.round(a), n = Math.max(0, qo - Math.floor(i)), w = i >= qo ? g("almost done") : `~${n}s ${g("left")}`, r = [
|
|
9291
9360
|
g("Preparing your image"),
|
|
@@ -9391,7 +9460,7 @@ function ti({
|
|
|
9391
9460
|
tryOnProcessing: r,
|
|
9392
9461
|
tryOnStartedAt: p,
|
|
9393
9462
|
resultImageUrl: Q,
|
|
9394
|
-
tryOnDone:
|
|
9463
|
+
tryOnDone: C,
|
|
9395
9464
|
onTryAgain: u,
|
|
9396
9465
|
onClose: m,
|
|
9397
9466
|
overlayNode: y,
|
|
@@ -9503,7 +9572,7 @@ function ti({
|
|
|
9503
9572
|
);
|
|
9504
9573
|
}) })
|
|
9505
9574
|
] }),
|
|
9506
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children:
|
|
9575
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children: C ? /* @__PURE__ */ e("div", { className: "ps-msr-bottom-row", children: [
|
|
9507
9576
|
/* @__PURE__ */ A(
|
|
9508
9577
|
"button",
|
|
9509
9578
|
{
|
|
@@ -9650,12 +9719,12 @@ function ai({
|
|
|
9650
9719
|
}),
|
|
9651
9720
|
(() => {
|
|
9652
9721
|
const r = Math.max(1, Math.abs(o.rightOuterEye.x - o.leftOuterEye.x) * i) * 0.04, p = r * 0.55;
|
|
9653
|
-
return c.map(({ key: Q, p:
|
|
9722
|
+
return c.map(({ key: Q, p: C }, u) => /* @__PURE__ */ e("g", { children: [
|
|
9654
9723
|
/* @__PURE__ */ A(
|
|
9655
9724
|
"circle",
|
|
9656
9725
|
{
|
|
9657
|
-
cx:
|
|
9658
|
-
cy:
|
|
9726
|
+
cx: C.x * i,
|
|
9727
|
+
cy: C.y * a,
|
|
9659
9728
|
r,
|
|
9660
9729
|
fill: "rgba(100,210,255,0.22)",
|
|
9661
9730
|
opacity: "0",
|
|
@@ -9665,8 +9734,8 @@ function ai({
|
|
|
9665
9734
|
/* @__PURE__ */ A(
|
|
9666
9735
|
"circle",
|
|
9667
9736
|
{
|
|
9668
|
-
cx:
|
|
9669
|
-
cy:
|
|
9737
|
+
cx: C.x * i,
|
|
9738
|
+
cy: C.y * a,
|
|
9670
9739
|
r: p,
|
|
9671
9740
|
fill: "rgba(100,210,255,0.95)",
|
|
9672
9741
|
opacity: "0",
|
|
@@ -9703,11 +9772,11 @@ function Bi({
|
|
|
9703
9772
|
{ title: t("FINALIZING RESULT"), desc: t("Almost done — preparing your recommendation.") }
|
|
9704
9773
|
], a = 6e3, c = 1e3, n = QA(Date.now()), [w, r] = f(0);
|
|
9705
9774
|
HA(() => {
|
|
9706
|
-
const Q = (a - c) / Math.max(1, i.length - 1),
|
|
9775
|
+
const Q = (a - c) / Math.max(1, i.length - 1), C = setInterval(() => {
|
|
9707
9776
|
const u = Date.now() - n.current, m = Math.min(i.length - 1, Math.floor(u / Q));
|
|
9708
|
-
r((y) => y === m ? y : m), m >= i.length - 1 && clearInterval(
|
|
9777
|
+
r((y) => y === m ? y : m), m >= i.length - 1 && clearInterval(C);
|
|
9709
9778
|
}, 100);
|
|
9710
|
-
return () => clearInterval(
|
|
9779
|
+
return () => clearInterval(C);
|
|
9711
9780
|
}, [i.length]);
|
|
9712
9781
|
const p = i[w] ?? i[0];
|
|
9713
9782
|
return /* @__PURE__ */ A("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ e("div", { className: "ps-msc-stage-slot", children: [
|
|
@@ -9718,8 +9787,8 @@ function Bi({
|
|
|
9718
9787
|
function ci({ landmarks: o, imgWidth: g, imgHeight: t }) {
|
|
9719
9788
|
const i = g, a = t, c = o.leftShoulder, n = o.rightShoulder, w = c && n && typeof c.x == "number" && typeof n.x == "number" ? Math.max(1, Math.abs(c.x - n.x) * i) : i * 0.1, r = w * 0.07, p = w * 0.035, Q = w * 0.025;
|
|
9720
9789
|
return /* @__PURE__ */ e("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${i} ${a}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
9721
|
-
si.map(([
|
|
9722
|
-
const y = o[
|
|
9790
|
+
si.map(([C, u], m) => {
|
|
9791
|
+
const y = o[C], L = o[u];
|
|
9723
9792
|
return !y || !L || typeof y != "object" || typeof L != "object" || typeof y.x != "number" || typeof y.y != "number" || typeof L.x != "number" || typeof L.y != "number" ? null : /* @__PURE__ */ A(
|
|
9724
9793
|
"line",
|
|
9725
9794
|
{
|
|
@@ -9736,7 +9805,7 @@ function ci({ landmarks: o, imgWidth: g, imgHeight: t }) {
|
|
|
9736
9805
|
`l-${m}`
|
|
9737
9806
|
);
|
|
9738
9807
|
}),
|
|
9739
|
-
Object.entries(o).filter(([,
|
|
9808
|
+
Object.entries(o).filter(([, C]) => C && typeof C == "object" && typeof C.x == "number" && typeof C.y == "number").map(([C, u], m) => /* @__PURE__ */ e("g", { children: [
|
|
9740
9809
|
/* @__PURE__ */ A(
|
|
9741
9810
|
"circle",
|
|
9742
9811
|
{
|
|
@@ -9759,7 +9828,7 @@ function ci({ landmarks: o, imgWidth: g, imgHeight: t }) {
|
|
|
9759
9828
|
style: { animation: `ps-pose-fade 0.3s ease ${m * 0.04}s forwards` }
|
|
9760
9829
|
}
|
|
9761
9830
|
)
|
|
9762
|
-
] },
|
|
9831
|
+
] }, C))
|
|
9763
9832
|
] });
|
|
9764
9833
|
}
|
|
9765
9834
|
function Zo({ active: o }) {
|
|
@@ -9774,7 +9843,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9774
9843
|
{ key: "chest", line: o.chest, label: "Chest" },
|
|
9775
9844
|
{ key: "waist", line: o.waist, label: "Waist" },
|
|
9776
9845
|
{ key: "hips", line: o.hips, label: "Hips" }
|
|
9777
|
-
], w = i, r = a, p = n.map((L) => L.line && typeof L.line.x1 == "number" && typeof L.line.x2 == "number" ? Math.abs(L.line.x2 - L.line.x1) : 0).filter((L) => L > 0), Q = p.length ? Math.max(...p) : 0.2,
|
|
9846
|
+
], w = i, r = a, p = n.map((L) => L.line && typeof L.line.x1 == "number" && typeof L.line.x2 == "number" ? Math.abs(L.line.x2 - L.line.x1) : 0).filter((L) => L > 0), Q = p.length ? Math.max(...p) : 0.2, C = Math.max(1, Q * w), u = C * 0.018, m = C * 0.025, y = C / 400;
|
|
9778
9847
|
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${w} ${r}`, preserveAspectRatio: "xMidYMid meet", children: n.map(({ key: L, line: G, label: v }, l) => {
|
|
9779
9848
|
if (!G || typeof G.x1 != "number" || typeof G.x2 != "number" || typeof G.y != "number") return null;
|
|
9780
9849
|
const R = Math.abs(G.x2 - G.x1);
|
|
@@ -9857,7 +9926,7 @@ const fg = (o) => {
|
|
|
9857
9926
|
if (o == null) return 0;
|
|
9858
9927
|
const g = parseFloat(o.replace(/[^\d.]/g, ""));
|
|
9859
9928
|
return isNaN(g) ? 0 : g;
|
|
9860
|
-
},
|
|
9929
|
+
}, dt = (o) => {
|
|
9861
9930
|
if (o == null) return { min: 0, max: 0 };
|
|
9862
9931
|
const g = o.replace(/[^\d.\-\u2013]/g, " ").trim().split(/[\s\-\u2013]+/).filter(Boolean).map(Number).filter((t) => !isNaN(t));
|
|
9863
9932
|
return g.length ? { min: Math.min(...g), max: Math.max(...g) } : { min: 0, max: 0 };
|
|
@@ -9873,12 +9942,12 @@ const fg = (o) => {
|
|
|
9873
9942
|
}
|
|
9874
9943
|
return "";
|
|
9875
9944
|
}, wi = (o, g) => g(o === "good" ? "perfect fit" : o === "too-tight" ? "too tight" : o === "tight" ? "tight" : o === "a-bit-tight" ? "a bit tight" : o === "too-loose" ? "too loose" : o === "loose" ? "loose" : "a bit loose"), Jg = (o, g) => g(o === "good" ? "perfect fit" : o === "too-short" || o === "too-tight" ? "too short" : o === "short" || o === "tight" ? "short" : o === "a-bit-short" || o === "a-bit-tight" ? "a bit short" : o === "too-long" || o === "too-loose" ? "too long" : o === "long" || o === "loose" ? "long" : "a bit long");
|
|
9876
|
-
function
|
|
9945
|
+
function Ct(o, g, t) {
|
|
9877
9946
|
return g === t || !o || isNaN(o) || g === "mm" || t === "mm" ? o : g === "cm" ? Math.round(o / 2.54 * 10) / 10 : Math.round(o * 2.54 * 10) / 10;
|
|
9878
9947
|
}
|
|
9879
9948
|
function li(o, g, t) {
|
|
9880
9949
|
if (g === t || g === "mm" || t === "mm") return o;
|
|
9881
|
-
const i = (c) =>
|
|
9950
|
+
const i = (c) => Ct(c, g, t), a = o.match(/^(\d+\.?\d*)\s*[-–]\s*(\d+\.?\d*)$/);
|
|
9882
9951
|
return a ? `${i(parseFloat(a[1]))}-${i(parseFloat(a[2]))}` : /^\d+\.?\d*$/.test(o.trim()) ? String(i(parseFloat(o))) : o;
|
|
9883
9952
|
}
|
|
9884
9953
|
const Kg = (o) => /length|lunghezza|longueur|länge|largo/i.test(o);
|
|
@@ -9901,7 +9970,7 @@ function $o({
|
|
|
9901
9970
|
t: r,
|
|
9902
9971
|
productImage: p,
|
|
9903
9972
|
productTitle: Q,
|
|
9904
|
-
isMobile:
|
|
9973
|
+
isMobile: C,
|
|
9905
9974
|
isTryOnImage: u,
|
|
9906
9975
|
showLines: m,
|
|
9907
9976
|
onToggleLines: y,
|
|
@@ -9917,7 +9986,7 @@ function $o({
|
|
|
9917
9986
|
sectionFound: F,
|
|
9918
9987
|
allSizes: z
|
|
9919
9988
|
}) {
|
|
9920
|
-
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), OA = a.toLowerCase(), h = OA.includes("mm") ? "mm" : OA.includes("cm") ? "cm" : "in", oA = c || h, N = (b) =>
|
|
9989
|
+
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), OA = a.toLowerCase(), h = OA.includes("mm") ? "mm" : OA.includes("cm") ? "cm" : "in", oA = c || h, N = (b) => Ct(b, oA, h), vA = (b) => li(b, oA, h), S = (b) => {
|
|
9921
9990
|
const V = vA(b);
|
|
9922
9991
|
return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(V.trim()) ? `${V} ${a}` : V;
|
|
9923
9992
|
}, tA = s ? Object.keys(s) : [], [yA, nA] = f(null), kA = n?.secResult?.recommendedSize || "", [WA, MA] = f(null), le = He(() => {
|
|
@@ -9935,13 +10004,13 @@ function $o({
|
|
|
9935
10004
|
}, [g]), ee = g.headers[FA] || "Size", jA = He(() => {
|
|
9936
10005
|
const b = g.rows.map((V) => Te(V, FA, ee)).filter(Boolean);
|
|
9937
10006
|
return [...new Set(b)];
|
|
9938
|
-
}, [g, FA, ee]),
|
|
10007
|
+
}, [g, FA, ee]), de = aA || T, PA = de === T;
|
|
9939
10008
|
He(() => {
|
|
9940
10009
|
if (PA) return null;
|
|
9941
10010
|
const b = t?.matchDetails ?? [], V = /tight|loose|large|small|very/i, GA = b.some((J) => V.test(J.fit || ""));
|
|
9942
10011
|
return r(GA ? "Not Recommended" : "Your Selection");
|
|
9943
10012
|
}, [PA, t, r]);
|
|
9944
|
-
const ue = yA && PA && s && s[yA] ? s[yA] :
|
|
10013
|
+
const ue = yA && PA && s && s[yA] ? s[yA] : de, Z = He(() => {
|
|
9945
10014
|
const b = [];
|
|
9946
10015
|
for (let V = 0; V < g.headers.length; V++) {
|
|
9947
10016
|
const GA = (g.headers[V] || "").toLowerCase();
|
|
@@ -9984,20 +10053,20 @@ function $o({
|
|
|
9984
10053
|
if (LA.length === 0) return null;
|
|
9985
10054
|
let Ee = LA.find((I) => Z[I] === cA);
|
|
9986
10055
|
Ee == null && (Ee = LA[0]);
|
|
9987
|
-
const ne = g.headers[Ee],
|
|
10056
|
+
const ne = g.headers[Ee], Ce = V.trim().toLowerCase();
|
|
9988
10057
|
let YA = g.rows.find((I) => Te(I, FA, ee) === V);
|
|
9989
|
-
if (YA || (YA = g.rows.find((I) => Te(I, FA, ee).trim().toLowerCase() ===
|
|
10058
|
+
if (YA || (YA = g.rows.find((I) => Te(I, FA, ee).trim().toLowerCase() === Ce)), YA || (YA = g.rows.find((I) => {
|
|
9990
10059
|
const hA = Te(I, FA, ee).trim().toLowerCase();
|
|
9991
|
-
return hA.startsWith(
|
|
10060
|
+
return hA.startsWith(Ce) || Ce.startsWith(hA);
|
|
9992
10061
|
})), !YA) return null;
|
|
9993
10062
|
const KA = Te(YA, Ee, ne);
|
|
9994
10063
|
if (!KA) return null;
|
|
9995
|
-
const bA =
|
|
9996
|
-
if (
|
|
10064
|
+
const bA = dt(KA), dA = Z[Ee];
|
|
10065
|
+
if (dA === "in" && J) {
|
|
9997
10066
|
const I = (hA) => +(hA * 2.54).toFixed(1);
|
|
9998
10067
|
return { range: String(I(bA.min)) + (bA.min !== bA.max ? "–" + String(I(bA.max)) : ""), min: I(bA.min), max: I(bA.max) };
|
|
9999
10068
|
}
|
|
10000
|
-
if (
|
|
10069
|
+
if (dA === "cm" && !J) {
|
|
10001
10070
|
const I = (hA) => +(hA / 2.54).toFixed(1);
|
|
10002
10071
|
return { range: String(I(bA.min)) + (bA.min !== bA.max ? "–" + String(I(bA.max)) : ""), min: I(bA.min), max: I(bA.max) };
|
|
10003
10072
|
}
|
|
@@ -10006,11 +10075,11 @@ function $o({
|
|
|
10006
10075
|
if (E)
|
|
10007
10076
|
return (t?.matchDetails || []).map((I) => {
|
|
10008
10077
|
let hA = I.chartRange, TA = I.fit;
|
|
10009
|
-
if (
|
|
10010
|
-
const De = Pe(I.measurement,
|
|
10078
|
+
if (de !== T) {
|
|
10079
|
+
const De = Pe(I.measurement, de);
|
|
10011
10080
|
if (De && (De.min > 0 || De.max > 0)) {
|
|
10012
|
-
const
|
|
10013
|
-
hA = De.range + (
|
|
10081
|
+
const CA = (I.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
|
|
10082
|
+
hA = De.range + (CA ? ` ${CA.trim()}` : "");
|
|
10014
10083
|
const _A = _e(I.userValue);
|
|
10015
10084
|
if (_A > 0) {
|
|
10016
10085
|
const xe = De.min, re = De.max, ie = re - xe, EA = ie > 0 ? ie * 0.5 : xe * 0.05 || 3, ce = Math.max((re || xe) * 5e-3, 0.25);
|
|
@@ -10035,52 +10104,52 @@ function $o({
|
|
|
10035
10104
|
isLength: !1
|
|
10036
10105
|
};
|
|
10037
10106
|
});
|
|
10038
|
-
const b = t?.matchDetails || [], V = n?.secResult?.matchDetails || [], GA = /* @__PURE__ */ new Set(), J = [...b, ...V].filter((
|
|
10039
|
-
const I = String(
|
|
10107
|
+
const b = t?.matchDetails || [], V = n?.secResult?.matchDetails || [], GA = /* @__PURE__ */ new Set(), J = [...b, ...V].filter((dA) => {
|
|
10108
|
+
const I = String(dA?.measurement ?? "").toLowerCase().trim();
|
|
10040
10109
|
return !I || GA.has(I) ? !1 : (GA.add(I), !0);
|
|
10041
|
-
}), cA = t?.length || "", LA = (t?.availableLengths?.length || 0) > 0, Ee = kA || cA, ne = !!(n || LA),
|
|
10042
|
-
if (n && YA && !
|
|
10043
|
-
const
|
|
10110
|
+
}), cA = t?.length || "", LA = (t?.availableLengths?.length || 0) > 0, Ee = kA || cA, ne = !!(n || LA), Ce = J.some((dA) => dA.measurement.toLowerCase() === "height"), YA = !!n?.section?.headers?.some((dA) => /height|altezza|estatura|\(cm\)/i.test(dA));
|
|
10111
|
+
if (n && YA && !Ce) {
|
|
10112
|
+
const dA = i.height || 0;
|
|
10044
10113
|
J.push({
|
|
10045
10114
|
measurement: "Height",
|
|
10046
|
-
userValue:
|
|
10115
|
+
userValue: dA ? String(dA) : "",
|
|
10047
10116
|
chartRange: Ee || "",
|
|
10048
10117
|
fit: "good"
|
|
10049
10118
|
});
|
|
10050
|
-
} else if (LA && !n && !
|
|
10051
|
-
const
|
|
10119
|
+
} else if (LA && !n && !Ce) {
|
|
10120
|
+
const dA = i.height || 0;
|
|
10052
10121
|
J.push({
|
|
10053
10122
|
measurement: "Height",
|
|
10054
|
-
userValue:
|
|
10123
|
+
userValue: dA ? String(dA) : "",
|
|
10055
10124
|
chartRange: "",
|
|
10056
10125
|
fit: "good"
|
|
10057
10126
|
});
|
|
10058
10127
|
}
|
|
10059
10128
|
if (!J.length) return [];
|
|
10060
|
-
const KA = new Set(V.map((
|
|
10129
|
+
const KA = new Set(V.map((dA) => dA.measurement));
|
|
10061
10130
|
ne && KA.add("Height");
|
|
10062
10131
|
const bA = WA || Ee;
|
|
10063
|
-
return J.map((
|
|
10064
|
-
if (KA.has(
|
|
10065
|
-
const xe = i[
|
|
10132
|
+
return J.map((dA) => {
|
|
10133
|
+
if (KA.has(dA.measurement)) {
|
|
10134
|
+
const xe = i[dA.measurement.toLowerCase()] || _e(dA.userValue), re = n?.secResult?.allSizes, ie = bA ? re?.[bA]?.[dA.measurement] : void 0, EA = bA ? z?.[bA]?.[dA.measurement] : void 0, ce = z?.[de]?.[dA.measurement], Qe = ie ?? EA ?? ce, H = Qe?.chartRange ?? dA.chartRange, x = Qe?.fit ?? dA.fit ?? "good";
|
|
10066
10135
|
return {
|
|
10067
|
-
area:
|
|
10136
|
+
area: dA.measurement,
|
|
10068
10137
|
userNum: xe,
|
|
10069
10138
|
chartLabel: fg(H),
|
|
10070
10139
|
fit: x,
|
|
10071
10140
|
isLength: !0
|
|
10072
10141
|
};
|
|
10073
10142
|
}
|
|
10074
|
-
const I = i[
|
|
10143
|
+
const I = i[dA.measurement.toLowerCase()] || _e(dA.userValue), hA = dA.measurement.toLowerCase(), TA = /length|inseam|sleeve|hem|rise/.test(hA), De = z?.[de]?.[dA.measurement], CA = De?.chartRange ?? dA.chartRange, _A = De?.fit ?? dA.fit ?? "good";
|
|
10075
10144
|
return {
|
|
10076
|
-
area:
|
|
10145
|
+
area: dA.measurement,
|
|
10077
10146
|
userNum: I,
|
|
10078
|
-
chartLabel: fg(
|
|
10147
|
+
chartLabel: fg(CA),
|
|
10079
10148
|
fit: _A,
|
|
10080
10149
|
isLength: TA
|
|
10081
10150
|
};
|
|
10082
10151
|
});
|
|
10083
|
-
}, [t, n, i, E, z,
|
|
10152
|
+
}, [t, n, i, E, z, de, WA]), Ye = fe.filter(
|
|
10084
10153
|
(b) => b.fit === "good" || b.fit === "a-bit-tight" || b.fit === "a-bit-loose"
|
|
10085
10154
|
).length, te = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, pe = !E, lA = t, oe = lA?.size || T, RA = (t?.matchDetails || []).find(
|
|
10086
10155
|
(b) => /inseam|length/i.test(b.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(b.measurement)
|
|
@@ -10097,7 +10166,7 @@ function $o({
|
|
|
10097
10166
|
const V = Math.max(0, Math.min(rA.length - 3, b - 1));
|
|
10098
10167
|
return rA.slice(V, V + 3);
|
|
10099
10168
|
})();
|
|
10100
|
-
if (
|
|
10169
|
+
if (C) {
|
|
10101
10170
|
const b = o.replace(/\s*[—–-]\s*.*/g, ""), V = (J) => {
|
|
10102
10171
|
const cA = J.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10103
10172
|
return cA.includes("chest") || cA.includes("bust") ? r("Full circumference at the widest point.") : cA.includes("waist") ? r("Circumference at the natural waistline.") : cA.includes("hip") ? r("Circumference at the fullest point.") : cA.includes("shoulder") ? r("Shoulder edge to shoulder edge.") : cA.includes("sleeve") || cA.includes("arm") ? r("Shoulder seam to cuff edge.") : cA.includes("neck") || cA.includes("collar") ? r("Around the base of the neck.") : cA.includes("inseam") || cA.includes("inside leg") ? r("Inner leg seam length.") : cA.includes("thigh") ? r("Circumference around the upper leg.") : cA.includes("length") || cA.includes("height") ? r("Top to bottom length.") : "";
|
|
@@ -10168,8 +10237,8 @@ function $o({
|
|
|
10168
10237
|
"span",
|
|
10169
10238
|
{
|
|
10170
10239
|
className: "ps-msd-card-eyebrow",
|
|
10171
|
-
style:
|
|
10172
|
-
children: r(
|
|
10240
|
+
style: de !== oe ? { color: "#b45309", fontWeight: 700 } : void 0,
|
|
10241
|
+
children: r(de === oe ? "RECOMMENDED SIZE" : "YOUR CHOICE · NOT RECOMMENDED")
|
|
10173
10242
|
}
|
|
10174
10243
|
),
|
|
10175
10244
|
/* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
@@ -10234,10 +10303,10 @@ function $o({
|
|
|
10234
10303
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: r("MEASUREMENT BLUEPRINT") }),
|
|
10235
10304
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
10236
10305
|
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fe.map((J, cA) => {
|
|
10237
|
-
const LA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), Ee = J.fit === "good" ? "ps-good" : LA ? "ps-tight" : "ps-loose", ne = V(J.area),
|
|
10306
|
+
const LA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), Ee = J.fit === "good" ? "ps-good" : LA ? "ps-tight" : "ps-loose", ne = V(J.area), Ce = String(cA + 1).padStart(2, "0");
|
|
10238
10307
|
return /* @__PURE__ */ e("div", { className: "ps-msd-row", children: [
|
|
10239
10308
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-num", children: [
|
|
10240
|
-
|
|
10309
|
+
Ce,
|
|
10241
10310
|
" ",
|
|
10242
10311
|
J.area.toUpperCase()
|
|
10243
10312
|
] }),
|
|
@@ -10251,7 +10320,7 @@ function $o({
|
|
|
10251
10320
|
/* @__PURE__ */ e("span", { className: "ps-msd-cell-label", children: [
|
|
10252
10321
|
r("SIZE"),
|
|
10253
10322
|
" ",
|
|
10254
|
-
|
|
10323
|
+
de
|
|
10255
10324
|
] }),
|
|
10256
10325
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? J.rawChartRange || "" : S(J.chartLabel) })
|
|
10257
10326
|
] })
|
|
@@ -10269,7 +10338,7 @@ function $o({
|
|
|
10269
10338
|
"button",
|
|
10270
10339
|
{
|
|
10271
10340
|
type: "button",
|
|
10272
|
-
className: `ps-msd-size-pill${J ===
|
|
10341
|
+
className: `ps-msd-size-pill${J === de ? " ps-active" : ""}`,
|
|
10273
10342
|
onClick: () => X(J === T ? null : J),
|
|
10274
10343
|
children: J
|
|
10275
10344
|
},
|
|
@@ -10499,7 +10568,7 @@ function $o({
|
|
|
10499
10568
|
r("Size")
|
|
10500
10569
|
] }),
|
|
10501
10570
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: ve.map((b) => {
|
|
10502
|
-
const V = b ===
|
|
10571
|
+
const V = b === de;
|
|
10503
10572
|
return /* @__PURE__ */ A(
|
|
10504
10573
|
"button",
|
|
10505
10574
|
{
|
|
@@ -10639,7 +10708,7 @@ function pi({
|
|
|
10639
10708
|
productDescription: r,
|
|
10640
10709
|
sizingUnit: p,
|
|
10641
10710
|
setView: Q,
|
|
10642
|
-
handleDownload:
|
|
10711
|
+
handleDownload: C,
|
|
10643
10712
|
selectedFile: u,
|
|
10644
10713
|
previewUrl: m,
|
|
10645
10714
|
handleFileSelect: y,
|
|
@@ -10661,7 +10730,7 @@ function pi({
|
|
|
10661
10730
|
tryOnAvailable: OA = !0,
|
|
10662
10731
|
t: h
|
|
10663
10732
|
}) {
|
|
10664
|
-
const oA = (g?.unit || p || "").toString().toLowerCase(), N = oA === "mm" ? "mm" : oA === "cm" ? "cm" : "in", vA = h(N === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, tA] = f({}), yA =
|
|
10733
|
+
const oA = (g?.unit || p || "").toString().toLowerCase(), N = oA === "mm" ? "mm" : oA === "cm" ? "cm" : "in", vA = h(N === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, tA] = f({}), yA = dt, nA = xA((H, x, Y) => Te(H, x, Y), []), kA = He(() => {
|
|
10665
10734
|
if (!t?.headers || !t?.rows) return -1;
|
|
10666
10735
|
const H = t.headers.findIndex((x) => /size|taglia|größe|taille/i.test(x.trim()));
|
|
10667
10736
|
if (H >= 0) return H;
|
|
@@ -10733,7 +10802,7 @@ function pi({
|
|
|
10733
10802
|
return { range: Ie, ...SA };
|
|
10734
10803
|
}, [t, kA, WA, vA, nA, yA, MA]), ZA = g?.recommendedSize || "";
|
|
10735
10804
|
He(() => g?.internationalSizes || {}, [g]);
|
|
10736
|
-
const [FA, ee] = f("fit"), [jA,
|
|
10805
|
+
const [FA, ee] = f("fit"), [jA, de] = f(null), [PA, ue] = f(!1), [Z, Pe] = f(!1), [fe, Ye] = f(!1), [te, pe] = f(null), [lA, oe] = f(!1), [RA, M] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = xA((H) => {
|
|
10737
10806
|
const x = H.currentTarget;
|
|
10738
10807
|
x.naturalWidth && x.naturalHeight && M({ w: x.naturalWidth, h: x.naturalHeight });
|
|
10739
10808
|
}, []);
|
|
@@ -10750,7 +10819,7 @@ function pi({
|
|
|
10750
10819
|
}, [i, v]);
|
|
10751
10820
|
const [Oe, JA] = f(!1), [Me, ve] = f(!1);
|
|
10752
10821
|
QA(null);
|
|
10753
|
-
const [rA, $A] = f(!1), [b, V] = f(null), [GA, J] = f(!1), cA = QA(null), [LA, Ee] = f(null), [ne,
|
|
10822
|
+
const [rA, $A] = f(!1), [b, V] = f(null), [GA, J] = f(!1), cA = QA(null), [LA, Ee] = f(null), [ne, Ce] = f(!1);
|
|
10754
10823
|
HA(() => {
|
|
10755
10824
|
if (b) {
|
|
10756
10825
|
const H = URL.createObjectURL(b);
|
|
@@ -10838,7 +10907,7 @@ function pi({
|
|
|
10838
10907
|
}
|
|
10839
10908
|
return { name: Y, section: K, secResult: IA, userMeasurements: $ };
|
|
10840
10909
|
});
|
|
10841
|
-
}, [KA, t, g, aA]),
|
|
10910
|
+
}, [KA, t, g, aA]), dA = He(() => bA.filter((H) => !Kg(H.name)), [bA]), I = He(() => bA.filter((H) => Kg(H.name)), [bA]), hA = xA((H, x) => {
|
|
10842
10911
|
if (!x) return x;
|
|
10843
10912
|
let K = pg(H, I)?.secResult?.recommendedSize?.trim() || "";
|
|
10844
10913
|
if (K || (K = bA.find((se) => se.name === H)?.secResult?.length?.trim() || ""), !K) return x;
|
|
@@ -10864,7 +10933,7 @@ function pi({
|
|
|
10864
10933
|
}
|
|
10865
10934
|
return `${Math.round(H)} cm`;
|
|
10866
10935
|
}, [aA, vA]);
|
|
10867
|
-
const TA = !!m, De = TA && o,
|
|
10936
|
+
const TA = !!m, De = TA && o, CA = !TA && o, _A = !!g, re = TA ? _A && (!!i && !v) : _A, ie = jo(), EA = s === "face" || s === "head";
|
|
10868
10937
|
g?.found;
|
|
10869
10938
|
const ce = s === "foot" || !OA, Qe = g?.mismatchDetected ? /* @__PURE__ */ e("div", { style: {
|
|
10870
10939
|
margin: ie ? "8px 0 0" : "0.4vw 0 0",
|
|
@@ -10884,7 +10953,7 @@ function pi({
|
|
|
10884
10953
|
/* @__PURE__ */ A("div", { style: { fontSize: ie ? "12px" : "0.62vw", lineHeight: 1.45, color: "var(--ps-text-secondary)" }, children: h("We noticed your entered details didn't match your photo. To give you accurate sizing, we measured your body directly from the photo.") })
|
|
10885
10954
|
] }) : null;
|
|
10886
10955
|
return /* @__PURE__ */ e("div", { className: "ps-tryon-sr", children: [
|
|
10887
|
-
ie &&
|
|
10956
|
+
ie && CA && /* @__PURE__ */ A(
|
|
10888
10957
|
Ug,
|
|
10889
10958
|
{
|
|
10890
10959
|
productImage: a,
|
|
@@ -10894,7 +10963,7 @@ function pi({
|
|
|
10894
10963
|
t: h
|
|
10895
10964
|
}
|
|
10896
10965
|
),
|
|
10897
|
-
!ie &&
|
|
10966
|
+
!ie && CA && /* @__PURE__ */ e("div", { className: "ps-tryon-sr-split", children: [
|
|
10898
10967
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-img-col", children: /* @__PURE__ */ A("img", { src: a, alt: n, className: "ps-tryon-sr-product-img" }) }),
|
|
10899
10968
|
/* @__PURE__ */ e("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "0.8vw" }, children: [
|
|
10900
10969
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
@@ -10943,7 +11012,7 @@ function pi({
|
|
|
10943
11012
|
KA ? E ? (
|
|
10944
11013
|
/* ── Detail view for a single section ── */
|
|
10945
11014
|
(() => {
|
|
10946
|
-
const H =
|
|
11015
|
+
const H = dA.find((x) => x.name === E);
|
|
10947
11016
|
return H ? ie ? /* @__PURE__ */ e(_, { children: [
|
|
10948
11017
|
Qe && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: Qe }),
|
|
10949
11018
|
/* @__PURE__ */ A(
|
|
@@ -11048,7 +11117,7 @@ function pi({
|
|
|
11048
11117
|
productTitle: n,
|
|
11049
11118
|
sizingResult: g,
|
|
11050
11119
|
sizeGuide: t,
|
|
11051
|
-
sectionEntries:
|
|
11120
|
+
sectionEntries: dA.map(({ name: H, secResult: x }) => {
|
|
11052
11121
|
const Y = x?.size || x.recommendedSize || "";
|
|
11053
11122
|
return { name: H, secResult: { ...x, recommendedSize: hA(H, Y) } };
|
|
11054
11123
|
}),
|
|
@@ -11119,7 +11188,7 @@ function pi({
|
|
|
11119
11188
|
] }),
|
|
11120
11189
|
h(Z ? "Hide Fit" : "Show Fit")
|
|
11121
11190
|
] }),
|
|
11122
|
-
/* @__PURE__ */ e("button", { className: "ps-tryon-sr-glass-btn", onClick:
|
|
11191
|
+
/* @__PURE__ */ e("button", { className: "ps-tryon-sr-glass-btn", onClick: C, children: [
|
|
11123
11192
|
/* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
|
|
11124
11193
|
/* @__PURE__ */ A("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
11125
11194
|
/* @__PURE__ */ A("polyline", { points: "7 10 12 15 17 10" }),
|
|
@@ -11134,8 +11203,8 @@ function pi({
|
|
|
11134
11203
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: h("Tap any section for detailed breakdown") }),
|
|
11135
11204
|
Qe,
|
|
11136
11205
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
11137
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children:
|
|
11138
|
-
const K = t?.sectionImages?.[H], IA = ri(H), $ = Y ===
|
|
11206
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: dA.map(({ name: H, secResult: x }, Y) => {
|
|
11207
|
+
const K = t?.sectionImages?.[H], IA = ri(H), $ = Y === dA.length - 1 && dA.length % 2 !== 0, wA = x, uA = zA[H], se = !!uA, Ie = se ? uA.displayLabel : hA(H, wA.size || x.recommendedSize || "");
|
|
11139
11208
|
return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${$ ? " ps-full" : ""}${se ? " ps-overridden" : ""}`, onClick: () => F(H), style: { animationDelay: `${Y * 0.07}s` }, children: [
|
|
11140
11209
|
/* @__PURE__ */ e("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
11141
11210
|
/* @__PURE__ */ e("span", { className: "ps-tryon-sr-card-v2-label", children: [
|
|
@@ -11281,7 +11350,7 @@ function pi({
|
|
|
11281
11350
|
i && !v && lA && te && /* @__PURE__ */ A(zo, { lines: te, fitRows: (g?.matchDetails || []).map(($) => ({ area: $.measurement, userNum: parseFloat($.userValue) || 0, chartLabel: $.chartRange || "", fit: $.fit })), show: Z, imgWidth: RA.w, imgHeight: RA.h }),
|
|
11282
11351
|
i && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
11283
11352
|
!EA && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => Pe(!Z), children: h(Z ? "Hide Fit" : "Show Fit") }),
|
|
11284
|
-
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick:
|
|
11353
|
+
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: C, children: h("Download") })
|
|
11285
11354
|
] })
|
|
11286
11355
|
] }),
|
|
11287
11356
|
/* @__PURE__ */ e("div", { className: "ps-tryon-v2-panel", children: [
|
|
@@ -11714,7 +11783,7 @@ function pi({
|
|
|
11714
11783
|
] })
|
|
11715
11784
|
] });
|
|
11716
11785
|
}
|
|
11717
|
-
function
|
|
11786
|
+
function di({
|
|
11718
11787
|
selectedFile: o,
|
|
11719
11788
|
previewUrl: g,
|
|
11720
11789
|
dragOver: t,
|
|
@@ -11748,8 +11817,8 @@ function Ci({
|
|
|
11748
11817
|
onDragLeave: () => i(!1),
|
|
11749
11818
|
onDrop: (Q) => {
|
|
11750
11819
|
Q.preventDefault(), i(!1);
|
|
11751
|
-
const
|
|
11752
|
-
|
|
11820
|
+
const C = Q.dataTransfer?.files?.[0];
|
|
11821
|
+
C && c(C);
|
|
11753
11822
|
},
|
|
11754
11823
|
children: [
|
|
11755
11824
|
/* @__PURE__ */ A(
|
|
@@ -11760,8 +11829,8 @@ function Ci({
|
|
|
11760
11829
|
accept: "image/jpeg,image/png,image/webp",
|
|
11761
11830
|
style: { display: "none" },
|
|
11762
11831
|
onChange: (Q) => {
|
|
11763
|
-
const
|
|
11764
|
-
|
|
11832
|
+
const C = Q.target.files?.[0];
|
|
11833
|
+
C && c(C);
|
|
11765
11834
|
}
|
|
11766
11835
|
}
|
|
11767
11836
|
),
|
|
@@ -11784,7 +11853,7 @@ function Sg({
|
|
|
11784
11853
|
variant: r = "block",
|
|
11785
11854
|
onPhotoAccepted: p,
|
|
11786
11855
|
onClearPhoto: Q,
|
|
11787
|
-
t:
|
|
11856
|
+
t: C
|
|
11788
11857
|
}) {
|
|
11789
11858
|
const u = QA(null), m = QA(0), [y, L] = f(!1), [G, v] = f(!1), [l, R] = f(""), [q, s] = f(null), [P, E] = f(null);
|
|
11790
11859
|
HA(() => {
|
|
@@ -11793,23 +11862,23 @@ function Sg({
|
|
|
11793
11862
|
const F = async (N) => {
|
|
11794
11863
|
if (!(c || G)) {
|
|
11795
11864
|
if (E(null), s(null), i && a !== !0) {
|
|
11796
|
-
E(
|
|
11865
|
+
E(C("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
11797
11866
|
return;
|
|
11798
11867
|
}
|
|
11799
11868
|
if (!N.type.startsWith("image/")) {
|
|
11800
|
-
E(
|
|
11869
|
+
E(C("Please upload an image file"));
|
|
11801
11870
|
return;
|
|
11802
11871
|
}
|
|
11803
11872
|
if (N.size > 10 * 1024 * 1024) {
|
|
11804
|
-
E(
|
|
11873
|
+
E(C("Image must be under 10MB"));
|
|
11805
11874
|
return;
|
|
11806
11875
|
}
|
|
11807
11876
|
if (o && g) {
|
|
11808
|
-
v(!0), R(
|
|
11877
|
+
v(!0), R(C("Analyzing photo…"));
|
|
11809
11878
|
try {
|
|
11810
11879
|
const vA = await gg(N, o, g);
|
|
11811
11880
|
if (!vA.isAdult) {
|
|
11812
|
-
const S = vA.reasoning?.trim() ||
|
|
11881
|
+
const S = vA.reasoning?.trim() || C("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
11813
11882
|
s(S), v(!1), R("");
|
|
11814
11883
|
return;
|
|
11815
11884
|
}
|
|
@@ -11863,8 +11932,8 @@ function Sg({
|
|
|
11863
11932
|
}
|
|
11864
11933
|
),
|
|
11865
11934
|
t && !q && /* @__PURE__ */ e(_, { children: [
|
|
11866
|
-
/* @__PURE__ */ A("img", { src: t, alt:
|
|
11867
|
-
/* @__PURE__ */ A("div", { className: "ps-photo-zone-hover-overlay", onClick: z, title:
|
|
11935
|
+
/* @__PURE__ */ A("img", { src: t, alt: C("Your photo"), className: "ps-photo-zone-img" }),
|
|
11936
|
+
/* @__PURE__ */ A("div", { className: "ps-photo-zone-hover-overlay", onClick: z, title: C("Click to change photo"), children: /* @__PURE__ */ A("span", { children: C("Click to change photo") }) }),
|
|
11868
11937
|
Q && /* @__PURE__ */ A(
|
|
11869
11938
|
"button",
|
|
11870
11939
|
{
|
|
@@ -11873,7 +11942,7 @@ function Sg({
|
|
|
11873
11942
|
onClick: (N) => {
|
|
11874
11943
|
N.stopPropagation(), h();
|
|
11875
11944
|
},
|
|
11876
|
-
"aria-label":
|
|
11945
|
+
"aria-label": C("Remove photo"),
|
|
11877
11946
|
children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
11878
11947
|
/* @__PURE__ */ A("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
11879
11948
|
/* @__PURE__ */ A("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
@@ -11883,9 +11952,9 @@ function Sg({
|
|
|
11883
11952
|
] }),
|
|
11884
11953
|
!t && !q && !G && /* @__PURE__ */ e("div", { className: "ps-photo-zone-empty", children: [
|
|
11885
11954
|
/* @__PURE__ */ A(So, { size: 32 }),
|
|
11886
|
-
/* @__PURE__ */ A("span", { className: "ps-photo-zone-title", children: w ||
|
|
11955
|
+
/* @__PURE__ */ A("span", { className: "ps-photo-zone-title", children: w || C("Upload your photo") }),
|
|
11887
11956
|
n && /* @__PURE__ */ A("span", { className: "ps-photo-zone-hint", children: n }),
|
|
11888
|
-
/* @__PURE__ */ A("span", { className: "ps-photo-zone-hint", children:
|
|
11957
|
+
/* @__PURE__ */ A("span", { className: "ps-photo-zone-hint", children: C("JPEG, PNG up to 10MB · click or drop") })
|
|
11889
11958
|
] }),
|
|
11890
11959
|
G && /* @__PURE__ */ e("div", { className: "ps-photo-zone-processing", children: [
|
|
11891
11960
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-spinner" }),
|
|
@@ -11893,7 +11962,7 @@ function Sg({
|
|
|
11893
11962
|
] }),
|
|
11894
11963
|
q && /* @__PURE__ */ e("div", { className: "ps-photo-zone-rejection", onClick: (N) => N.stopPropagation(), children: [
|
|
11895
11964
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-icon", "aria-hidden": "true", children: "!" }),
|
|
11896
|
-
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-title", children:
|
|
11965
|
+
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-title", children: C("Different photo needed") }),
|
|
11897
11966
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-msg", children: q }),
|
|
11898
11967
|
/* @__PURE__ */ A(
|
|
11899
11968
|
"button",
|
|
@@ -11903,7 +11972,7 @@ function Sg({
|
|
|
11903
11972
|
onClick: () => {
|
|
11904
11973
|
s(null), u.current?.click();
|
|
11905
11974
|
},
|
|
11906
|
-
children:
|
|
11975
|
+
children: C("Choose another photo")
|
|
11907
11976
|
}
|
|
11908
11977
|
)
|
|
11909
11978
|
] }),
|
|
@@ -11912,7 +11981,7 @@ function Sg({
|
|
|
11912
11981
|
}
|
|
11913
11982
|
);
|
|
11914
11983
|
}
|
|
11915
|
-
function
|
|
11984
|
+
function Ci({
|
|
11916
11985
|
measurementType: o = "body",
|
|
11917
11986
|
apiUrl: g,
|
|
11918
11987
|
apiKey: t,
|
|
@@ -11929,7 +11998,7 @@ function di({
|
|
|
11929
11998
|
const u = URL.createObjectURL(w);
|
|
11930
11999
|
return Q(u), () => URL.revokeObjectURL(u);
|
|
11931
12000
|
}, [w]);
|
|
11932
|
-
const
|
|
12001
|
+
const C = () => {
|
|
11933
12002
|
w && a(w);
|
|
11934
12003
|
};
|
|
11935
12004
|
return n ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", style: { padding: "16px 16px 0", background: "var(--ps-bg-primary)" }, children: /* @__PURE__ */ e("div", { className: "ps-pm-root", children: [
|
|
@@ -11977,7 +12046,7 @@ function di({
|
|
|
11977
12046
|
type: "button",
|
|
11978
12047
|
className: "ps-pm-primary-btn",
|
|
11979
12048
|
disabled: !w,
|
|
11980
|
-
onClick:
|
|
12049
|
+
onClick: C,
|
|
11981
12050
|
children: c("START TRY-ON")
|
|
11982
12051
|
}
|
|
11983
12052
|
),
|
|
@@ -12094,7 +12163,7 @@ function di({
|
|
|
12094
12163
|
" ",
|
|
12095
12164
|
c("Back")
|
|
12096
12165
|
] }),
|
|
12097
|
-
/* @__PURE__ */ e("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, disabled: !w, onClick:
|
|
12166
|
+
/* @__PURE__ */ e("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, disabled: !w, onClick: C, children: [
|
|
12098
12167
|
/* @__PURE__ */ A(to, { size: 14 }),
|
|
12099
12168
|
" ",
|
|
12100
12169
|
c("Start Try-On")
|
|
@@ -12102,7 +12171,7 @@ function di({
|
|
|
12102
12171
|
] })
|
|
12103
12172
|
] });
|
|
12104
12173
|
}
|
|
12105
|
-
const hg = 38,
|
|
12174
|
+
const hg = 38, dg = 2 * Math.PI * hg;
|
|
12106
12175
|
function Di({
|
|
12107
12176
|
previewUrl: o,
|
|
12108
12177
|
progressRef: g,
|
|
@@ -12115,7 +12184,7 @@ function Di({
|
|
|
12115
12184
|
productMaterial: r,
|
|
12116
12185
|
productDescription: p,
|
|
12117
12186
|
onCancel: Q,
|
|
12118
|
-
cn:
|
|
12187
|
+
cn: C,
|
|
12119
12188
|
t: u
|
|
12120
12189
|
}) {
|
|
12121
12190
|
const m = xA((z) => {
|
|
@@ -12128,7 +12197,7 @@ function Di({
|
|
|
12128
12197
|
c.current = z;
|
|
12129
12198
|
}, []), v = xA((z) => {
|
|
12130
12199
|
if (n.current = z, z) {
|
|
12131
|
-
const T =
|
|
12200
|
+
const T = dg * (1 - Math.round(g.current) / 100);
|
|
12132
12201
|
z.style.strokeDashoffset = String(T);
|
|
12133
12202
|
}
|
|
12134
12203
|
}, []), l = [
|
|
@@ -12176,8 +12245,8 @@ function Di({
|
|
|
12176
12245
|
cy: "48",
|
|
12177
12246
|
r: hg,
|
|
12178
12247
|
className: "ps-tryon-progress-ring-fill",
|
|
12179
|
-
strokeDasharray:
|
|
12180
|
-
strokeDashoffset:
|
|
12248
|
+
strokeDasharray: dg,
|
|
12249
|
+
strokeDashoffset: dg
|
|
12181
12250
|
}
|
|
12182
12251
|
)
|
|
12183
12252
|
] }),
|
|
@@ -12387,13 +12456,13 @@ function _o({
|
|
|
12387
12456
|
] }, o);
|
|
12388
12457
|
}
|
|
12389
12458
|
function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, onEstimate: c, t: n }) {
|
|
12390
|
-
const [w, r] = f(null), [p, Q] = f("identity"), [
|
|
12459
|
+
const [w, r] = f(null), [p, Q] = f("identity"), [C, u] = f("name-photo"), [m, y] = f(!1), [L, G] = f(null), v = QA(null);
|
|
12391
12460
|
HA(() => {
|
|
12392
12461
|
v.current && (v.current.scrollTop = 0);
|
|
12393
12462
|
}, [w, p]);
|
|
12394
|
-
const [l, R] = f(""), [q, s] = f("male"), [P, E] = f("cm"), [F, z] = f(""), [T, aA] = f(""), [X, UA] = f(""), [OA, h] = f(""), [oA, N] = f(""), [vA, S] = f(""), [tA, yA] = f(null), [nA, kA] = f(!1), [WA, MA] = f(""), [le, ZA] = f(null), [FA, ee] = f(null), [jA,
|
|
12463
|
+
const [l, R] = f(""), [q, s] = f("male"), [P, E] = f("cm"), [F, z] = f(""), [T, aA] = f(""), [X, UA] = f(""), [OA, h] = f(""), [oA, N] = f(""), [vA, S] = f(""), [tA, yA] = f(null), [nA, kA] = f(!1), [WA, MA] = f(""), [le, ZA] = f(null), [FA, ee] = f(null), [jA, de] = f({ w: 800, h: 1200 }), [PA, ue] = f(0), [Z, Pe] = f(!1), [fe, Ye] = f(!1);
|
|
12395
12464
|
HA(() => {
|
|
12396
|
-
if (
|
|
12465
|
+
if (C !== "calculating" || !tA) return;
|
|
12397
12466
|
let D = !1;
|
|
12398
12467
|
return po(tA).then((W) => {
|
|
12399
12468
|
!D && W && ee(W);
|
|
@@ -12401,11 +12470,11 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12401
12470
|
}), () => {
|
|
12402
12471
|
D = !0;
|
|
12403
12472
|
};
|
|
12404
|
-
}, [
|
|
12405
|
-
if (
|
|
12473
|
+
}, [C, tA]), HA(() => {
|
|
12474
|
+
if (C !== "calculating" || !m) return;
|
|
12406
12475
|
const D = setInterval(() => ue((W) => W + 1), 1500);
|
|
12407
12476
|
return () => clearInterval(D);
|
|
12408
|
-
}, [
|
|
12477
|
+
}, [C, m]);
|
|
12409
12478
|
const te = QA(null), pe = QA(null), [lA, oe] = f(!1), [RA, M] = f(null), zA = () => {
|
|
12410
12479
|
RA === !0 && te.current?.click();
|
|
12411
12480
|
}, he = async (D) => {
|
|
@@ -12441,7 +12510,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12441
12510
|
}
|
|
12442
12511
|
}, Oe = () => {
|
|
12443
12512
|
yA(null), a?.(null), te.current && (te.current.value = "");
|
|
12444
|
-
}, [JA, Me] = f(null), [ve, rA] = f(null), [$A, b] = f(null), [V, GA] = f(null), [J, cA] = f(null), [LA, Ee] = f(null), [ne,
|
|
12513
|
+
}, [JA, Me] = f(null), [ve, rA] = f(null), [$A, b] = f(null), [V, GA] = f(null), [J, cA] = f(null), [LA, Ee] = f(null), [ne, Ce] = f("US"), [YA, KA] = f(null), bA = QA(null);
|
|
12445
12514
|
HA(() => {
|
|
12446
12515
|
if (!YA) return;
|
|
12447
12516
|
const D = (W) => {
|
|
@@ -12450,7 +12519,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12450
12519
|
};
|
|
12451
12520
|
return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
|
|
12452
12521
|
}, [YA]);
|
|
12453
|
-
const
|
|
12522
|
+
const dA = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], I = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], hA = q === "female", TA = hA ? XA.female : XA.male, De = hA ? ["identity", "stomach", "seat", "hips"] : ["identity", "chest", "stomach", "seat"], CA = De.indexOf(p), _A = De.length, xe = CA === _A - 1, re = () => {
|
|
12454
12523
|
if (P === "in") {
|
|
12455
12524
|
const D = parseInt(T, 10), W = parseInt(X, 10);
|
|
12456
12525
|
!isNaN(D) && D >= 0 && !isNaN(W) && W >= 0 && z(String(Math.round((D * 12 + W) * 2.54)));
|
|
@@ -12541,7 +12610,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12541
12610
|
o(Qe());
|
|
12542
12611
|
return;
|
|
12543
12612
|
}
|
|
12544
|
-
Q(De[
|
|
12613
|
+
Q(De[CA + 1]);
|
|
12545
12614
|
}
|
|
12546
12615
|
}, Y = (D, W) => {
|
|
12547
12616
|
S(""), D === "chest" ? Me(W) : D === "stomach" ? rA(W) : D === "seat" ? b(W) : D === "hips" && GA(W);
|
|
@@ -12558,9 +12627,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12558
12627
|
r(null);
|
|
12559
12628
|
return;
|
|
12560
12629
|
}
|
|
12561
|
-
Q(De[Math.max(0,
|
|
12630
|
+
Q(De[Math.max(0, CA - 1)]);
|
|
12562
12631
|
}, IA = w === "manual" && (p === "chest" || p === "stomach" || p === "seat" || p === "hips"), $ = async () => {
|
|
12563
|
-
if (
|
|
12632
|
+
if (C === "name-photo") {
|
|
12564
12633
|
if (!ce()) return;
|
|
12565
12634
|
if (!tA) {
|
|
12566
12635
|
S(n("Please upload a photo"));
|
|
@@ -12607,18 +12676,18 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12607
12676
|
y(!1);
|
|
12608
12677
|
return;
|
|
12609
12678
|
}
|
|
12610
|
-
if (
|
|
12679
|
+
if (C === "details") {
|
|
12611
12680
|
u("calculating");
|
|
12612
12681
|
return;
|
|
12613
12682
|
}
|
|
12614
12683
|
const D = H();
|
|
12615
12684
|
L && (D.measurements = L, D.measurementsUnit = "cm"), o(D);
|
|
12616
12685
|
}, wA = () => {
|
|
12617
|
-
if (S(""),
|
|
12686
|
+
if (S(""), C === "details") {
|
|
12618
12687
|
u("name-photo");
|
|
12619
12688
|
return;
|
|
12620
12689
|
}
|
|
12621
|
-
if (
|
|
12690
|
+
if (C === "calculating" && !m) {
|
|
12622
12691
|
u("name-photo");
|
|
12623
12692
|
return;
|
|
12624
12693
|
}
|
|
@@ -12638,17 +12707,17 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12638
12707
|
hips: n("Hips"),
|
|
12639
12708
|
bra: n("Bra")
|
|
12640
12709
|
};
|
|
12641
|
-
return `${String(
|
|
12710
|
+
return `${String(CA + 1).padStart(2, "0")} · ${D[p]}`;
|
|
12642
12711
|
}
|
|
12643
12712
|
return n("Analyze by photo");
|
|
12644
12713
|
})(), Ie = (() => {
|
|
12645
12714
|
if (w == null) return 0;
|
|
12646
|
-
if (w === "manual") return Math.round((
|
|
12715
|
+
if (w === "manual") return Math.round((CA + 1) / _A * 100);
|
|
12647
12716
|
let D = 0;
|
|
12648
12717
|
return l.trim() && (D += 50), tA && (D += 50), D;
|
|
12649
12718
|
})();
|
|
12650
|
-
return /* @__PURE__ */ e("div", { className: `ps-cpw-root${w === "image" &&
|
|
12651
|
-
!(w === "image" &&
|
|
12719
|
+
return /* @__PURE__ */ e("div", { className: `ps-cpw-root${w === "image" && C === "name-photo" ? " ps-cpw-hide-global-back" : ""}`, children: [
|
|
12720
|
+
!(w === "image" && C === "name-photo") && /* @__PURE__ */ e("div", { className: "ps-cpw-step-head", children: [
|
|
12652
12721
|
/* @__PURE__ */ A("h2", { className: "ps-cpw-step-title", children: se }),
|
|
12653
12722
|
w != null && /* @__PURE__ */ A("div", { className: "ps-cpw-progress", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-track", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-fill", style: { width: `${Ie}%` } }) }) })
|
|
12654
12723
|
] }),
|
|
@@ -12823,7 +12892,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12823
12892
|
isOpen: YA === "region",
|
|
12824
12893
|
onToggle: () => KA(YA === "region" ? null : "region"),
|
|
12825
12894
|
onSelect: (D) => {
|
|
12826
|
-
|
|
12895
|
+
Ce(D), cA(null), Ee(null), KA(null), S("");
|
|
12827
12896
|
}
|
|
12828
12897
|
}
|
|
12829
12898
|
) })
|
|
@@ -12934,7 +13003,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12934
13003
|
},
|
|
12935
13004
|
children: [
|
|
12936
13005
|
/* @__PURE__ */ A("option", { value: "", children: n("Select") }),
|
|
12937
|
-
|
|
13006
|
+
dA.map((D) => /* @__PURE__ */ A("option", { value: D, children: D }, D))
|
|
12938
13007
|
]
|
|
12939
13008
|
}
|
|
12940
13009
|
)
|
|
@@ -12959,7 +13028,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12959
13028
|
] })
|
|
12960
13029
|
] }, "bra"),
|
|
12961
13030
|
w === "manual" && vA && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: vA }),
|
|
12962
|
-
w === "image" &&
|
|
13031
|
+
w === "image" && C === "name-photo" && /* @__PURE__ */ e("div", { className: "ps-cpw-fade-in ps-cpw-photo-step", style: { display: "flex", gap: "1.2vw", padding: "0.6vw 1vw", width: "100%", height: "100%", minHeight: "20vw", alignItems: "stretch", position: "relative" }, children: [
|
|
12963
13032
|
/* @__PURE__ */ A(
|
|
12964
13033
|
"input",
|
|
12965
13034
|
{
|
|
@@ -13355,7 +13424,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13355
13424
|
isOpen: YA === "region",
|
|
13356
13425
|
onToggle: () => KA(YA === "region" ? null : "region"),
|
|
13357
13426
|
onSelect: (D) => {
|
|
13358
|
-
|
|
13427
|
+
Ce(D), cA(null), Ee(null), KA(null);
|
|
13359
13428
|
}
|
|
13360
13429
|
}
|
|
13361
13430
|
) })
|
|
@@ -13478,7 +13547,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13478
13547
|
vA && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: vA })
|
|
13479
13548
|
] })
|
|
13480
13549
|
] }, "image-photo"),
|
|
13481
|
-
w === "image" &&
|
|
13550
|
+
w === "image" && C === "details" && /* @__PURE__ */ e("div", { className: "ps-cpw-fade-in", style: { padding: "1vw 1.5vw" }, children: [
|
|
13482
13551
|
/* @__PURE__ */ e("div", { className: "ps-cpw-section-head", children: [
|
|
13483
13552
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-title", children: n("Your measurements") }),
|
|
13484
13553
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: n("Enter your details for accurate body estimation") })
|
|
@@ -13527,7 +13596,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13527
13596
|
] }),
|
|
13528
13597
|
vA && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: vA })
|
|
13529
13598
|
] }, "image-details"),
|
|
13530
|
-
w === "image" &&
|
|
13599
|
+
w === "image" && C === "calculating" && (() => {
|
|
13531
13600
|
const D = [
|
|
13532
13601
|
{ title: n("DETECTING POSE"), desc: n("Identifying body landmarks from your photo.") },
|
|
13533
13602
|
{ title: n("SCANNING FRAME"), desc: n("Mapping your proportions to calculate the perfect fit.") },
|
|
@@ -13569,7 +13638,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13569
13638
|
style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain", display: "block" },
|
|
13570
13639
|
onLoad: (mA) => {
|
|
13571
13640
|
const Ae = mA.currentTarget;
|
|
13572
|
-
|
|
13641
|
+
de({
|
|
13573
13642
|
w: Ae.naturalWidth || Ae.offsetWidth || 800,
|
|
13574
13643
|
h: Ae.naturalHeight || Ae.offsetHeight || 1200
|
|
13575
13644
|
});
|
|
@@ -13659,7 +13728,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13659
13728
|
/* @__PURE__ */ e("div", { className: "ps-cpw-footer", children: [
|
|
13660
13729
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: uA, children: w == null ? n("Cancel") : `← ${n("Back")}` }),
|
|
13661
13730
|
w === "manual" && !IA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: x, children: n(xe ? "CALCULATE MY FIT" : "Continue") }),
|
|
13662
|
-
w === "image" &&
|
|
13731
|
+
w === "image" && C === "name-photo" && (() => {
|
|
13663
13732
|
const D = P === "in" ? parseFloat(T) > 0 || parseFloat(X) > 0 : parseFloat(F) > 0, W = parseFloat(OA) > 0, fA = !!l.trim(), mA = !!tA, Ae = nA, me = n(Ae ? "Analyzing photo…" : mA ? fA ? D ? W ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), ye = Ae || !mA || !fA || !D || !W;
|
|
13664
13733
|
return /* @__PURE__ */ A(
|
|
13665
13734
|
"button",
|
|
@@ -13679,9 +13748,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13679
13748
|
}
|
|
13680
13749
|
);
|
|
13681
13750
|
})(),
|
|
13682
|
-
w === "image" &&
|
|
13683
|
-
w === "image" &&
|
|
13684
|
-
w === "image" &&
|
|
13751
|
+
w === "image" && C === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: $, children: n("Calculate My Body Parts") }),
|
|
13752
|
+
w === "image" && C === "calculating" && !m && L && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: $, children: n("Save Profile") }),
|
|
13753
|
+
w === "image" && C === "calculating" && !m && !L && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
13685
13754
|
u("details"), S("");
|
|
13686
13755
|
}, children: n("Try Again") })
|
|
13687
13756
|
] })
|
|
@@ -13718,10 +13787,10 @@ function Xi({
|
|
|
13718
13787
|
isEstimating: r = !1,
|
|
13719
13788
|
t: p
|
|
13720
13789
|
}) {
|
|
13721
|
-
const Q = o.gender === "female" ? ji : Si,
|
|
13790
|
+
const Q = o.gender === "female" ? ji : Si, C = o.measurements || {}, u = Object.keys(C).some((E) => C[E] != null), [m, y] = f(o.measurementsUnit || "cm"), [L, G] = f(() => {
|
|
13722
13791
|
const E = {};
|
|
13723
13792
|
return Q.forEach((F) => {
|
|
13724
|
-
const z =
|
|
13793
|
+
const z = C[F.key];
|
|
13725
13794
|
E[F.key] = z != null ? String(Math.round(z * 10) / 10) : "";
|
|
13726
13795
|
}), E;
|
|
13727
13796
|
});
|
|
@@ -13730,7 +13799,7 @@ function Xi({
|
|
|
13730
13799
|
const F = { ...E };
|
|
13731
13800
|
let z = !1;
|
|
13732
13801
|
return Q.forEach((T) => {
|
|
13733
|
-
const aA =
|
|
13802
|
+
const aA = C[T.key];
|
|
13734
13803
|
aA != null && !E[T.key] && (F[T.key] = String(Math.round(aA * 10) / 10), z = !0);
|
|
13735
13804
|
}), z ? F : E;
|
|
13736
13805
|
});
|
|
@@ -13787,7 +13856,7 @@ function Xi({
|
|
|
13787
13856
|
] }) }),
|
|
13788
13857
|
/* @__PURE__ */ e("div", { className: "ps-pmv-measure-list", children: [
|
|
13789
13858
|
Q.map((E) => {
|
|
13790
|
-
const F =
|
|
13859
|
+
const F = C[E.key], z = r && F == null && !L[E.key];
|
|
13791
13860
|
return /* @__PURE__ */ e("div", { className: `ps-pmv-measure-row${F == null ? " ps-loading" : ""}`, children: [
|
|
13792
13861
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: E.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
13793
13862
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: p(E.label) }),
|
|
@@ -13898,8 +13967,8 @@ function Vi({
|
|
|
13898
13967
|
const Q = o.height ?? o.heightCm;
|
|
13899
13968
|
if (!Q) return null;
|
|
13900
13969
|
if (o.heightUnit === "in" || o.heightUnit === "ft") {
|
|
13901
|
-
const
|
|
13902
|
-
return `${
|
|
13970
|
+
const C = Math.floor(Q / 12), u = Math.round(Q % 12);
|
|
13971
|
+
return `${C}'${u}"`;
|
|
13903
13972
|
}
|
|
13904
13973
|
return `${Math.round(Q)} cm`;
|
|
13905
13974
|
})(), r = (() => {
|
|
@@ -13990,7 +14059,7 @@ function Zi({
|
|
|
13990
14059
|
onClose: r,
|
|
13991
14060
|
apiUrl: p,
|
|
13992
14061
|
apiKey: Q,
|
|
13993
|
-
onPhotoPreview:
|
|
14062
|
+
onPhotoPreview: C,
|
|
13994
14063
|
onEstimateFromPhoto: u,
|
|
13995
14064
|
estimatingProfileIds: m,
|
|
13996
14065
|
t: y,
|
|
@@ -14047,7 +14116,7 @@ function Zi({
|
|
|
14047
14116
|
v(!1), P && R(P);
|
|
14048
14117
|
},
|
|
14049
14118
|
onCancel: () => v(!1),
|
|
14050
|
-
onPhotoPreview:
|
|
14119
|
+
onPhotoPreview: C,
|
|
14051
14120
|
onEstimate: u,
|
|
14052
14121
|
t: y
|
|
14053
14122
|
}
|
|
@@ -14128,7 +14197,7 @@ function er({ size: o = 16 }) {
|
|
|
14128
14197
|
function or() {
|
|
14129
14198
|
return /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ A("polyline", { points: "9 18 15 12 9 6" }) });
|
|
14130
14199
|
}
|
|
14131
|
-
function
|
|
14200
|
+
function Cg() {
|
|
14132
14201
|
return /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", width: "14", height: "14", children: /* @__PURE__ */ A("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
14133
14202
|
}
|
|
14134
14203
|
function Dg() {
|
|
@@ -14149,7 +14218,7 @@ function gr({
|
|
|
14149
14218
|
setHeightInches: r,
|
|
14150
14219
|
weight: p,
|
|
14151
14220
|
setWeight: Q,
|
|
14152
|
-
age:
|
|
14221
|
+
age: C,
|
|
14153
14222
|
setAge: u,
|
|
14154
14223
|
switchToMetric: m,
|
|
14155
14224
|
switchToImperial: y,
|
|
@@ -14164,14 +14233,14 @@ function gr({
|
|
|
14164
14233
|
error: E,
|
|
14165
14234
|
t: F
|
|
14166
14235
|
}) {
|
|
14167
|
-
const z = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), OA = parseFloat(
|
|
14236
|
+
const z = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), OA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, N = 120, vA = 220, S = 48, tA = 84, yA = 13, nA = 100, kA = (z - N) / (vA - N) * 100, WA = (T - S) / (tA - S) * 100, MA = (UA - h) / (oA - h) * 100, le = (OA - yA) / (nA - yA) * 100, ZA = (Z) => {
|
|
14168
14237
|
const Pe = Math.max(S, Math.min(tA, Z));
|
|
14169
14238
|
n(String(Math.floor(Pe / 12))), r(String(Pe % 12));
|
|
14170
14239
|
}, FA = () => {
|
|
14171
14240
|
o === "in" ? ZA(T + 1) : a(String(Math.min(vA, z + 1)));
|
|
14172
14241
|
}, ee = () => {
|
|
14173
14242
|
o === "in" ? ZA(T - 1) : a(String(Math.max(N, z - 1)));
|
|
14174
|
-
}, jA = () => Q(String(Math.min(oA, UA + 1))),
|
|
14243
|
+
}, jA = () => Q(String(Math.min(oA, UA + 1))), de = () => Q(String(Math.max(h, UA - 1))), PA = () => u(String(Math.min(nA, OA + 1))), ue = () => u(String(Math.max(yA, OA - 1)));
|
|
14175
14244
|
return /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
|
|
14176
14245
|
/* @__PURE__ */ e("div", { className: "ps-bpm-header", children: [
|
|
14177
14246
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
|
|
@@ -14213,7 +14282,7 @@ function gr({
|
|
|
14213
14282
|
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: o === "in" ? `${aA}ft ${X}in` : `${Math.round(z)} cm` })
|
|
14214
14283
|
] }),
|
|
14215
14284
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14216
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: ee, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(
|
|
14285
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: ee, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14217
14286
|
o === "in" ? /* @__PURE__ */ A(
|
|
14218
14287
|
"input",
|
|
14219
14288
|
{
|
|
@@ -14252,7 +14321,7 @@ function gr({
|
|
|
14252
14321
|
] })
|
|
14253
14322
|
] }),
|
|
14254
14323
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14255
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
14324
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: de, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14256
14325
|
/* @__PURE__ */ A(
|
|
14257
14326
|
"input",
|
|
14258
14327
|
{
|
|
@@ -14279,7 +14348,7 @@ function gr({
|
|
|
14279
14348
|
] })
|
|
14280
14349
|
] }),
|
|
14281
14350
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14282
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: ue, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(
|
|
14351
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: ue, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14283
14352
|
/* @__PURE__ */ A(
|
|
14284
14353
|
"input",
|
|
14285
14354
|
{
|
|
@@ -14376,7 +14445,7 @@ function ut({
|
|
|
14376
14445
|
onPhotoStepHeightChange: r,
|
|
14377
14446
|
ageConfirmed: p,
|
|
14378
14447
|
onAgeConfirmedChange: Q,
|
|
14379
|
-
primaryLabel:
|
|
14448
|
+
primaryLabel: C,
|
|
14380
14449
|
compactAgeGate: u = !1,
|
|
14381
14450
|
photoProcessing: m = !1,
|
|
14382
14451
|
photoStatus: y,
|
|
@@ -14573,7 +14642,7 @@ function ut({
|
|
|
14573
14642
|
className: "ps-pm-primary-btn",
|
|
14574
14643
|
onClick: i,
|
|
14575
14644
|
disabled: !q || p !== !0,
|
|
14576
|
-
children:
|
|
14645
|
+
children: C ?? v("ANALYZE MY SIZE")
|
|
14577
14646
|
}
|
|
14578
14647
|
),
|
|
14579
14648
|
q && /* @__PURE__ */ A(
|
|
@@ -14768,7 +14837,7 @@ function pr({
|
|
|
14768
14837
|
setWeightUnit: r,
|
|
14769
14838
|
sizingUnit: p,
|
|
14770
14839
|
setSizingUnit: Q,
|
|
14771
|
-
apiUrl:
|
|
14840
|
+
apiUrl: C,
|
|
14772
14841
|
apiKey: u,
|
|
14773
14842
|
onComplete: m,
|
|
14774
14843
|
onSnapSubmit: y,
|
|
@@ -14782,11 +14851,11 @@ function pr({
|
|
|
14782
14851
|
}) {
|
|
14783
14852
|
const P = t ? cr : Br, [E, F] = f("photo");
|
|
14784
14853
|
E === "photo" || P.indexOf(E);
|
|
14785
|
-
const z = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, OA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, oA = aA != null && OA === "cm" ? String(Math.round(aA)) : aA != null && (OA === "in" || OA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", N = aA != null && (OA === "in" || OA === "ft") ? Math.round(aA) : aA != null && OA === "cm" ? Math.round(aA / 2.54) : null, vA = N != null ? String(Math.floor(N / 12)) : i.current.heightFeet || "", S = N != null ? String(N % 12) : i.current.heightInches || "", tA = X != null ? String(Math.round(X)) : i.current.weight || "", yA = UA != null ? String(UA) : i.current.age || "", [nA, kA] = f(oA), [WA, MA] = f(vA), [le, ZA] = f(S), [FA, ee] = f(tA), [jA,
|
|
14854
|
+
const z = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, OA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, oA = aA != null && OA === "cm" ? String(Math.round(aA)) : aA != null && (OA === "in" || OA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", N = aA != null && (OA === "in" || OA === "ft") ? Math.round(aA) : aA != null && OA === "cm" ? Math.round(aA / 2.54) : null, vA = N != null ? String(Math.floor(N / 12)) : i.current.heightFeet || "", S = N != null ? String(N % 12) : i.current.heightInches || "", tA = X != null ? String(Math.round(X)) : i.current.weight || "", yA = UA != null ? String(UA) : i.current.age || "", [nA, kA] = f(oA), [WA, MA] = f(vA), [le, ZA] = f(S), [FA, ee] = f(tA), [jA, de] = f(yA), [PA, ue] = f(
|
|
14786
14855
|
OA || (c === "ft" ? "in" : c || (T ? "in" : "cm"))
|
|
14787
14856
|
), [Z, Pe] = f(
|
|
14788
14857
|
h || w || (T ? "lbs" : "kg")
|
|
14789
|
-
), fe = PA === "in" || Z === "lbs", [Ye, te] = f(null), [pe, lA] = f(null), [oe, RA] = f(null), [M, zA] = f(!1), [he, Oe] = f(""), [JA, Me] = f(null), [ve, rA] = f(!1), $A = QA(null), [b, V] = f(null), [GA, J] = f(!1), [cA, LA] = f(!1), [Ee, ne] = f(() => N != null ? String(Math.round(N * 2.54)) : oA), [
|
|
14858
|
+
), fe = PA === "in" || Z === "lbs", [Ye, te] = f(null), [pe, lA] = f(null), [oe, RA] = f(null), [M, zA] = f(!1), [he, Oe] = f(""), [JA, Me] = f(null), [ve, rA] = f(!1), $A = QA(null), [b, V] = f(null), [GA, J] = f(!1), [cA, LA] = f(!1), [Ee, ne] = f(() => N != null ? String(Math.round(N * 2.54)) : oA), [Ce, YA] = f(null), [KA, bA] = f(null), [dA, I] = f(null), [hA, TA] = f(null), [De, CA] = f(""), [_A, xe] = f(null), [re, ie] = f(null), [EA, ce] = f(() => ["US", "UK", "AU"].includes(a) ? a === "AU" ? "UK" : a : ["FR", "ES"].includes(a) ? "FR" : ["IT"].includes(a) ? "IT" : ["JP", "CN", "KR"].includes(a) ? "JP" : "EU"), [Qe, H] = f(!1), [x, Y] = f(null), K = QA(null);
|
|
14790
14859
|
HA(() => {
|
|
14791
14860
|
if (!x) return;
|
|
14792
14861
|
const U = (pA) => {
|
|
@@ -14814,7 +14883,7 @@ function pr({
|
|
|
14814
14883
|
const we = URL.createObjectURL(pA);
|
|
14815
14884
|
lA(we);
|
|
14816
14885
|
try {
|
|
14817
|
-
const be =
|
|
14886
|
+
const be = C && u ? gg(pA, C, u) : Promise.resolve({ isAdult: !0, confidence: "low" }), eo = uo(pA, { maxDimension: 1024, quality: 0.85 }), Ve = await be;
|
|
14818
14887
|
if (!Ve.isAdult) {
|
|
14819
14888
|
const qe = Ve.reasoning?.trim() || s("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
14820
14889
|
Me(qe), lA(null), te(null);
|
|
@@ -14830,14 +14899,14 @@ function pr({
|
|
|
14830
14899
|
}, [s, b]), se = QA(null), Ie = xA(() => {
|
|
14831
14900
|
pe && !ve && URL.revokeObjectURL(pe), te(null), lA(null), RA(null), rA(!1), $A.current && ($A.current.value = "");
|
|
14832
14901
|
}, [pe, ve]), SA = xA(() => {
|
|
14833
|
-
Ie(), kA(""), MA(""), ZA(""), ee(""),
|
|
14902
|
+
Ie(), kA(""), MA(""), ZA(""), ee(""), de(""), xe(null), ie(null), l?.();
|
|
14834
14903
|
}, [Ie, l]);
|
|
14835
14904
|
HA(() => {
|
|
14836
14905
|
const U = R?.photoBase64, pA = R?.id ?? null;
|
|
14837
14906
|
!U || !pA || se.current !== pA && (se.current = pA, RA(U), lA(U), rA(!0), V(!0));
|
|
14838
14907
|
}, [R]), HA(() => {
|
|
14839
14908
|
const U = R?.age;
|
|
14840
|
-
U != null && U > 0 && !jA &&
|
|
14909
|
+
U != null && U > 0 && !jA && de(String(Math.round(U)));
|
|
14841
14910
|
}, [R, jA]);
|
|
14842
14911
|
const D = xA(() => {
|
|
14843
14912
|
if (PA === "in") {
|
|
@@ -14876,9 +14945,9 @@ function pr({
|
|
|
14876
14945
|
weightUnit: Z,
|
|
14877
14946
|
gender: fA,
|
|
14878
14947
|
age: jA ? parseInt(jA, 10) : void 0,
|
|
14879
|
-
chestProfile:
|
|
14948
|
+
chestProfile: Ce || void 0,
|
|
14880
14949
|
midsectionProfile: KA,
|
|
14881
|
-
hipProfile:
|
|
14950
|
+
hipProfile: dA,
|
|
14882
14951
|
bodyImage: oe || void 0,
|
|
14883
14952
|
bandSize: _A || void 0,
|
|
14884
14953
|
cupSize: re || void 0
|
|
@@ -14908,7 +14977,7 @@ function pr({
|
|
|
14908
14977
|
if (!D()) return;
|
|
14909
14978
|
F(mA("basics"));
|
|
14910
14979
|
} else if (E === "chest") {
|
|
14911
|
-
if (!
|
|
14980
|
+
if (!Ce) return;
|
|
14912
14981
|
F(mA("chest"));
|
|
14913
14982
|
} else if (E === "midsection") {
|
|
14914
14983
|
if (!KA) return;
|
|
@@ -14918,7 +14987,7 @@ function pr({
|
|
|
14918
14987
|
const U = mA("seat");
|
|
14919
14988
|
U === "submit" ? Ae() : F(U);
|
|
14920
14989
|
} else if (E === "hips") {
|
|
14921
|
-
if (!
|
|
14990
|
+
if (!dA) return;
|
|
14922
14991
|
const U = mA("hips");
|
|
14923
14992
|
U === "submit" ? Ae() : F(U);
|
|
14924
14993
|
} else if (E === "bra") {
|
|
@@ -14965,7 +15034,7 @@ function pr({
|
|
|
14965
15034
|
}
|
|
14966
15035
|
wA(""), me();
|
|
14967
15036
|
}
|
|
14968
|
-
}, [E, P, D,
|
|
15037
|
+
}, [E, P, D, Ce, KA, dA, hA, _A, re, PA, Z, nA, WA, le, FA, jA, oe, Ye, b, z, t, fA, L, G, me]), io = (U) => {
|
|
14969
15038
|
const pA = P.indexOf(U);
|
|
14970
15039
|
return pA > 0 ? P[pA - 1] : null;
|
|
14971
15040
|
}, ze = xA(() => {
|
|
@@ -14979,7 +15048,7 @@ function pr({
|
|
|
14979
15048
|
const U = io(E);
|
|
14980
15049
|
U ? F(U) : q();
|
|
14981
15050
|
}
|
|
14982
|
-
}, [E, P, q]), We = E === "basics" || E === "scan-details" ? !0 : E === "chest" ? !!
|
|
15051
|
+
}, [E, P, q]), We = E === "basics" || E === "scan-details" ? !0 : E === "chest" ? !!Ce : E === "midsection" ? !!KA : E === "seat" ? !!hA : E === "hips" ? !!dA : E === "bra" ? !!(_A && re) : E === "photo", Ao = E === P[P.length - 1], Fe = () => {
|
|
14983
15052
|
if (PA === "in") {
|
|
14984
15053
|
const U = (parseFloat(WA) || 0) * 12 + (parseFloat(le) || 0);
|
|
14985
15054
|
U > 0 && kA(String(Math.round(U * 2.54)));
|
|
@@ -15819,7 +15888,7 @@ function pr({
|
|
|
15819
15888
|
weight: FA,
|
|
15820
15889
|
setWeight: ee,
|
|
15821
15890
|
age: jA,
|
|
15822
|
-
setAge:
|
|
15891
|
+
setAge: de,
|
|
15823
15892
|
switchToMetric: U,
|
|
15824
15893
|
switchToImperial: pA,
|
|
15825
15894
|
onUploadPhoto: () => F("photo"),
|
|
@@ -15872,7 +15941,7 @@ function pr({
|
|
|
15872
15941
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
15873
15942
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: s("AGE") }),
|
|
15874
15943
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
15875
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: jA, onChange: (we) =>
|
|
15944
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: jA, onChange: (we) => de(we.target.value), min: 13, max: 100 }),
|
|
15876
15945
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: s("years") })
|
|
15877
15946
|
] })
|
|
15878
15947
|
] })
|
|
@@ -15904,7 +15973,7 @@ function pr({
|
|
|
15904
15973
|
{ value: "average", label: s("Average"), img: XA.male.chest.average },
|
|
15905
15974
|
{ value: "broad", label: s("Broad"), img: XA.male.chest.broad }
|
|
15906
15975
|
],
|
|
15907
|
-
selected:
|
|
15976
|
+
selected: Ce,
|
|
15908
15977
|
onSelect: (U) => YA(U),
|
|
15909
15978
|
t: s
|
|
15910
15979
|
},
|
|
@@ -15912,9 +15981,9 @@ function pr({
|
|
|
15912
15981
|
) : /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
15913
15982
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: s("Which best describes your chest?") }),
|
|
15914
15983
|
/* @__PURE__ */ e("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
15915
|
-
/* @__PURE__ */ A(ke, { img: XA.male.chest.narrow, label: s("Narrow"), selected:
|
|
15916
|
-
/* @__PURE__ */ A(ke, { img: XA.male.chest.average, label: s("Average"), selected:
|
|
15917
|
-
/* @__PURE__ */ A(ke, { img: XA.male.chest.broad, label: s("Broad"), selected:
|
|
15984
|
+
/* @__PURE__ */ A(ke, { img: XA.male.chest.narrow, label: s("Narrow"), selected: Ce === "narrow", onSelect: () => YA("narrow"), onHover: () => CA(s("A slimmer, narrower chest build")), onLeave: () => CA("") }),
|
|
15985
|
+
/* @__PURE__ */ A(ke, { img: XA.male.chest.average, label: s("Average"), selected: Ce === "average", onSelect: () => YA("average"), onHover: () => CA(s("A moderate, proportionate chest")), onLeave: () => CA("") }),
|
|
15986
|
+
/* @__PURE__ */ A(ke, { img: XA.male.chest.broad, label: s("Broad"), selected: Ce === "broad", onSelect: () => YA("broad"), onHover: () => CA(s("A wider, more muscular chest")), onLeave: () => CA("") })
|
|
15918
15987
|
] }),
|
|
15919
15988
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: De || " " })
|
|
15920
15989
|
] }, "step-chest")),
|
|
@@ -15941,13 +16010,13 @@ function pr({
|
|
|
15941
16010
|
) : /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
15942
16011
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: s("Which best describes your midsection?") }),
|
|
15943
16012
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: t ? /* @__PURE__ */ e(_, { children: [
|
|
15944
|
-
/* @__PURE__ */ A(ke, { img: XA.female.stomach.flat, label: s("Flat"), selected: KA === "flat", onSelect: () => bA("flat"), onHover: () =>
|
|
15945
|
-
/* @__PURE__ */ A(ke, { img: XA.female.stomach.average, label: s("Average"), selected: KA === "average", onSelect: () => bA("average"), onHover: () =>
|
|
15946
|
-
/* @__PURE__ */ A(ke, { img: XA.female.stomach.round, label: s("Full"), selected: KA === "round", onSelect: () => bA("round"), onHover: () =>
|
|
16013
|
+
/* @__PURE__ */ A(ke, { img: XA.female.stomach.flat, label: s("Flat"), selected: KA === "flat", onSelect: () => bA("flat"), onHover: () => CA(s("A flatter midsection with minimal protrusion")), onLeave: () => CA("") }),
|
|
16014
|
+
/* @__PURE__ */ A(ke, { img: XA.female.stomach.average, label: s("Average"), selected: KA === "average", onSelect: () => bA("average"), onHover: () => CA(s("A moderate, natural midsection shape")), onLeave: () => CA("") }),
|
|
16015
|
+
/* @__PURE__ */ A(ke, { img: XA.female.stomach.round, label: s("Full"), selected: KA === "round", onSelect: () => bA("round"), onHover: () => CA(s("A fuller, more rounded midsection")), onLeave: () => CA("") })
|
|
15947
16016
|
] }) : /* @__PURE__ */ e(_, { children: [
|
|
15948
|
-
/* @__PURE__ */ A(ke, { img: XA.male.stomach.flat, label: s("Flat"), selected: KA === "flat", onSelect: () => bA("flat"), onHover: () =>
|
|
15949
|
-
/* @__PURE__ */ A(ke, { img: XA.male.stomach.average, label: s("Average"), selected: KA === "average", onSelect: () => bA("average"), onHover: () =>
|
|
15950
|
-
/* @__PURE__ */ A(ke, { img: XA.male.stomach.round, label: s("Full"), selected: KA === "round", onSelect: () => bA("round"), onHover: () =>
|
|
16017
|
+
/* @__PURE__ */ A(ke, { img: XA.male.stomach.flat, label: s("Flat"), selected: KA === "flat", onSelect: () => bA("flat"), onHover: () => CA(s("A flatter midsection with minimal protrusion")), onLeave: () => CA("") }),
|
|
16018
|
+
/* @__PURE__ */ A(ke, { img: XA.male.stomach.average, label: s("Average"), selected: KA === "average", onSelect: () => bA("average"), onHover: () => CA(s("A moderate, natural midsection shape")), onLeave: () => CA("") }),
|
|
16019
|
+
/* @__PURE__ */ A(ke, { img: XA.male.stomach.round, label: s("Full"), selected: KA === "round", onSelect: () => bA("round"), onHover: () => CA(s("A fuller, more rounded midsection")), onLeave: () => CA("") })
|
|
15951
16020
|
] }) }),
|
|
15952
16021
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: De || " " })
|
|
15953
16022
|
] }, "step-midsection")),
|
|
@@ -15974,13 +16043,13 @@ function pr({
|
|
|
15974
16043
|
) : /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
15975
16044
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: s("Which best describes your seat?") }),
|
|
15976
16045
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: t ? /* @__PURE__ */ e(_, { children: [
|
|
15977
|
-
/* @__PURE__ */ A(ke, { img: XA.female.seat.narrow, label: s("Flat"), selected: hA === "narrow", onSelect: () => TA("narrow"), onHover: () =>
|
|
15978
|
-
/* @__PURE__ */ A(ke, { img: XA.female.seat.average, label: s("Average"), selected: hA === "average", onSelect: () => TA("average"), onHover: () =>
|
|
15979
|
-
/* @__PURE__ */ A(ke, { img: XA.female.seat.full, label: s("Full"), selected: hA === "full", onSelect: () => TA("full"), onHover: () =>
|
|
16046
|
+
/* @__PURE__ */ A(ke, { img: XA.female.seat.narrow, label: s("Flat"), selected: hA === "narrow", onSelect: () => TA("narrow"), onHover: () => CA(s("A flatter backside with less projection")), onLeave: () => CA("") }),
|
|
16047
|
+
/* @__PURE__ */ A(ke, { img: XA.female.seat.average, label: s("Average"), selected: hA === "average", onSelect: () => TA("average"), onHover: () => CA(s("A moderate, natural backside shape")), onLeave: () => CA("") }),
|
|
16048
|
+
/* @__PURE__ */ A(ke, { img: XA.female.seat.full, label: s("Full"), selected: hA === "full", onSelect: () => TA("full"), onHover: () => CA(s("A fuller, more rounded backside")), onLeave: () => CA("") })
|
|
15980
16049
|
] }) : /* @__PURE__ */ e(_, { children: [
|
|
15981
|
-
/* @__PURE__ */ A(ke, { img: XA.male.seat.narrow, label: s("Flat"), selected: hA === "narrow", onSelect: () => TA("narrow"), onHover: () =>
|
|
15982
|
-
/* @__PURE__ */ A(ke, { img: XA.male.seat.average, label: s("Average"), selected: hA === "average", onSelect: () => TA("average"), onHover: () =>
|
|
15983
|
-
/* @__PURE__ */ A(ke, { img: XA.male.seat.full, label: s("Full"), selected: hA === "full", onSelect: () => TA("full"), onHover: () =>
|
|
16050
|
+
/* @__PURE__ */ A(ke, { img: XA.male.seat.narrow, label: s("Flat"), selected: hA === "narrow", onSelect: () => TA("narrow"), onHover: () => CA(s("A flatter backside with less projection")), onLeave: () => CA("") }),
|
|
16051
|
+
/* @__PURE__ */ A(ke, { img: XA.male.seat.average, label: s("Average"), selected: hA === "average", onSelect: () => TA("average"), onHover: () => CA(s("A moderate, natural backside shape")), onLeave: () => CA("") }),
|
|
16052
|
+
/* @__PURE__ */ A(ke, { img: XA.male.seat.full, label: s("Full"), selected: hA === "full", onSelect: () => TA("full"), onHover: () => CA(s("A fuller, more rounded backside")), onLeave: () => CA("") })
|
|
15984
16053
|
] }) }),
|
|
15985
16054
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: De || " " })
|
|
15986
16055
|
] }, "step-seat")),
|
|
@@ -15995,7 +16064,7 @@ function pr({
|
|
|
15995
16064
|
{ value: "average", label: s("Average"), img: XA.female.hips.average },
|
|
15996
16065
|
{ value: "full", label: s("Curvy"), img: XA.female.hips.full }
|
|
15997
16066
|
],
|
|
15998
|
-
selected:
|
|
16067
|
+
selected: dA,
|
|
15999
16068
|
onSelect: (U) => I(U),
|
|
16000
16069
|
t: s
|
|
16001
16070
|
},
|
|
@@ -16003,9 +16072,9 @@ function pr({
|
|
|
16003
16072
|
) : /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
16004
16073
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: s("Which best describes your hips?") }),
|
|
16005
16074
|
/* @__PURE__ */ e("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
16006
|
-
/* @__PURE__ */ A(ke, { img: XA.female.hips.narrow, label: s("Narrow"), selected:
|
|
16007
|
-
/* @__PURE__ */ A(ke, { img: XA.female.hips.average, label: s("Average"), selected:
|
|
16008
|
-
/* @__PURE__ */ A(ke, { img: XA.female.hips.full, label: s("Curvy"), selected:
|
|
16075
|
+
/* @__PURE__ */ A(ke, { img: XA.female.hips.narrow, label: s("Narrow"), selected: dA === "narrow", onSelect: () => I("narrow"), onHover: () => CA(s("Hips closer to shoulder width")), onLeave: () => CA("") }),
|
|
16076
|
+
/* @__PURE__ */ A(ke, { img: XA.female.hips.average, label: s("Average"), selected: dA === "average", onSelect: () => I("average"), onHover: () => CA(s("Hips proportionate to shoulders")), onLeave: () => CA("") }),
|
|
16077
|
+
/* @__PURE__ */ A(ke, { img: XA.female.hips.full, label: s("Curvy"), selected: dA === "full", onSelect: () => I("full"), onHover: () => CA(s("Hips wider than shoulders")), onLeave: () => CA("") })
|
|
16009
16078
|
] }),
|
|
16010
16079
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: De || " " })
|
|
16011
16080
|
] }, "step-hips")),
|
|
@@ -16123,7 +16192,7 @@ function xg({
|
|
|
16123
16192
|
sizingUnit: r,
|
|
16124
16193
|
setSizingUnit: p,
|
|
16125
16194
|
setSizingMethod: Q,
|
|
16126
|
-
setSizingLoading:
|
|
16195
|
+
setSizingLoading: C,
|
|
16127
16196
|
setView: u,
|
|
16128
16197
|
submitSizing: m,
|
|
16129
16198
|
onSnapSubmit: y,
|
|
@@ -16140,7 +16209,7 @@ function xg({
|
|
|
16140
16209
|
}), z = t ?? [
|
|
16141
16210
|
{ label: l("Centimeters"), value: "cm" },
|
|
16142
16211
|
{ label: l("Inches"), value: "in" }
|
|
16143
|
-
], [T, aA] = f(""), X = QA(null), [UA, OA] = f(null), [h, oA] = f(null), [N, vA] = f(null), [S, tA] = f(!1), [yA, nA] = f(!1), [kA, WA] = f(""), [MA, le] = f(null), [ZA, FA] = f(null), [ee, jA] = f(!1),
|
|
16212
|
+
], [T, aA] = f(""), X = QA(null), [UA, OA] = f(null), [h, oA] = f(null), [N, vA] = f(null), [S, tA] = f(!1), [yA, nA] = f(!1), [kA, WA] = f(""), [MA, le] = f(null), [ZA, FA] = f(null), [ee, jA] = f(!1), de = xA(async (M) => {
|
|
16144
16213
|
const zA = M.target.files?.[0];
|
|
16145
16214
|
if (!zA) return;
|
|
16146
16215
|
const he = URL.createObjectURL(zA);
|
|
@@ -16173,7 +16242,7 @@ function xg({
|
|
|
16173
16242
|
g.forEach((he) => {
|
|
16174
16243
|
const Oe = parseFloat(E[he.key] || "");
|
|
16175
16244
|
Oe > 0 && (w.current[he.key] = String(Oe));
|
|
16176
|
-
}), w.current.gender = w.current.gender || "male", Q("exact"),
|
|
16245
|
+
}), w.current.gender = w.current.gender || "male", Q("exact"), C(!0), u("size-result"), m("exact");
|
|
16177
16246
|
}, Pe = () => {
|
|
16178
16247
|
if (ZA !== !0) {
|
|
16179
16248
|
aA(l("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
@@ -16198,7 +16267,7 @@ function xg({
|
|
|
16198
16267
|
ut,
|
|
16199
16268
|
{
|
|
16200
16269
|
photoPreview: UA,
|
|
16201
|
-
handlePhotoSelect:
|
|
16270
|
+
handlePhotoSelect: de,
|
|
16202
16271
|
handleRemovePhoto: PA,
|
|
16203
16272
|
onAnalyze: Pe,
|
|
16204
16273
|
onSwitchToManual: () => P("manual"),
|
|
@@ -16785,7 +16854,7 @@ function xg({
|
|
|
16785
16854
|
)
|
|
16786
16855
|
] })
|
|
16787
16856
|
] }),
|
|
16788
|
-
/* @__PURE__ */ A("input", { ref: X, type: "file", accept: "image/*", style: { display: "none" }, onChange:
|
|
16857
|
+
/* @__PURE__ */ A("input", { ref: X, type: "file", accept: "image/*", style: { display: "none" }, onChange: de }),
|
|
16789
16858
|
T && /* @__PURE__ */ A("p", { className: "ps-bp-error", style: { padding: "0 1.5vw" }, children: T }),
|
|
16790
16859
|
/* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
|
|
16791
16860
|
/* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () => P("manual"), type: "button", children: [
|
|
@@ -16810,7 +16879,7 @@ function xg({
|
|
|
16810
16879
|
] })
|
|
16811
16880
|
] }) }) });
|
|
16812
16881
|
}
|
|
16813
|
-
function
|
|
16882
|
+
function dr(o) {
|
|
16814
16883
|
return [
|
|
16815
16884
|
{
|
|
16816
16885
|
key: "footLengthCm",
|
|
@@ -16823,11 +16892,11 @@ function Cr(o) {
|
|
|
16823
16892
|
}
|
|
16824
16893
|
];
|
|
16825
16894
|
}
|
|
16826
|
-
function
|
|
16827
|
-
const t =
|
|
16895
|
+
function Cr(o, g) {
|
|
16896
|
+
const t = dr(g), i = o?.requiredFields;
|
|
16828
16897
|
if (!i || i.length === 0) return t;
|
|
16829
16898
|
const a = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]), c = (w, r) => {
|
|
16830
|
-
const p = t.find((
|
|
16899
|
+
const p = t.find((C) => C.key === w);
|
|
16831
16900
|
return p ? p.placeholder : /foot|length/i.test(w) || /foot|length/i.test(r) ? t[0].placeholder : { cm: "", in: "" };
|
|
16832
16901
|
}, n = i.filter((w) => !a.has(w.key) && w.unit !== "size").map((w) => {
|
|
16833
16902
|
const r = c(w.key, w.label || "");
|
|
@@ -16845,7 +16914,7 @@ function dr(o, g) {
|
|
|
16845
16914
|
return n.length > 0 ? n : t;
|
|
16846
16915
|
}
|
|
16847
16916
|
function Dr(o) {
|
|
16848
|
-
const { sizeGuide: g, t, ...i } = o, a =
|
|
16917
|
+
const { sizeGuide: g, t, ...i } = o, a = Cr(g, t);
|
|
16849
16918
|
return /* @__PURE__ */ A(
|
|
16850
16919
|
xg,
|
|
16851
16920
|
{
|
|
@@ -16996,7 +17065,7 @@ function br({
|
|
|
16996
17065
|
apiUrl: r,
|
|
16997
17066
|
showPoweredBy: p = !0,
|
|
16998
17067
|
showIcon: Q = !0,
|
|
16999
|
-
buttonIcon:
|
|
17068
|
+
buttonIcon: C,
|
|
17000
17069
|
locale: u,
|
|
17001
17070
|
buttonStyles: m = {},
|
|
17002
17071
|
modalStyles: y = {},
|
|
@@ -17019,15 +17088,15 @@ function br({
|
|
|
17019
17088
|
HA(() => {
|
|
17020
17089
|
h(!0);
|
|
17021
17090
|
}, []);
|
|
17022
|
-
const [oA, N] = f("idle"), [vA, S] = f(null), [tA, yA] = f(null), [nA, kA] = f(null), [WA, MA] = f(null), [le, ZA] = f(!1), [FA, ee] = f(null), [jA,
|
|
17091
|
+
const [oA, N] = f("idle"), [vA, S] = f(null), [tA, yA] = f(null), [nA, kA] = f(null), [WA, MA] = f(null), [le, ZA] = f(!1), [FA, ee] = f(null), [jA, de] = f(null), [PA, ue] = f({}), Z = QA({});
|
|
17023
17092
|
HA(() => {
|
|
17024
17093
|
Z.current = PA;
|
|
17025
17094
|
}, [PA]);
|
|
17026
17095
|
const Pe = QA(null), fe = QA(null), Ye = QA(null);
|
|
17027
|
-
xA((B,
|
|
17096
|
+
xA((B, d) => {
|
|
17028
17097
|
ue((O) => {
|
|
17029
17098
|
const iA = { ...O };
|
|
17030
|
-
return
|
|
17099
|
+
return d === null ? delete iA[B] : iA[B] = { ...d, sectionName: B }, Z.current = iA, iA;
|
|
17031
17100
|
});
|
|
17032
17101
|
}, []);
|
|
17033
17102
|
const [te, pe] = f(null), [lA, oe] = f(null), [RA, M] = f(!1), [zA, he] = f(!1);
|
|
@@ -17044,21 +17113,21 @@ function br({
|
|
|
17044
17113
|
}, [rA]), HA(() => {
|
|
17045
17114
|
Ye.current = nA;
|
|
17046
17115
|
}, [nA]);
|
|
17047
|
-
const [V, GA] = f(!1), J = QA(!1), [cA, LA] = f(Pn), Ee = at(cA), [ne,
|
|
17116
|
+
const [V, GA] = f(!1), J = QA(!1), [cA, LA] = f(Pn), Ee = at(cA), [ne, Ce] = f(Ee ? "in" : "cm"), [YA, KA] = f(Ee ? "in" : "cm"), [bA, dA] = f(Ee ? "lbs" : "kg");
|
|
17048
17117
|
HA(() => {
|
|
17049
17118
|
const B = wo(i);
|
|
17050
|
-
B === "foot" || B === "head" ?
|
|
17119
|
+
B === "foot" || B === "head" ? Ce("cm") : B === "face" && Ce("mm");
|
|
17051
17120
|
}, [i]);
|
|
17052
|
-
const I = QA({}), [hA, TA] = f("male"), [De,
|
|
17121
|
+
const I = QA({}), [hA, TA] = f("male"), [De, CA] = f(0), [_A, xe] = f(null), [re, ie] = f(!1), [EA, ce] = f(() => Ke("profiles", [])), [Qe, H] = f(() => Ke("history", [])), [x, Y] = f(() => nt()), [K, IA] = f(() => /* @__PURE__ */ new Set()), [$, wA] = f(null), uA = xA((B) => {
|
|
17053
17122
|
Y(B), In(B);
|
|
17054
17123
|
}, []), [se, Ie] = f(!1), [SA, D] = f(null), [W, fA] = f(null), mA = QA(null), Ae = QA(() => !1), me = QA(() => {
|
|
17055
|
-
}), ye = xA((B,
|
|
17056
|
-
Ae.current = B, me.current =
|
|
17124
|
+
}), ye = xA((B, d) => {
|
|
17125
|
+
Ae.current = B, me.current = d;
|
|
17057
17126
|
}, []), io = QA(null), ze = QA(null), We = QA(null), Ao = QA(null), Fe = QA(null), Je = QA(!1), U = QA(null), pA = QA(null), [we, be] = f(null), [eo, Ve] = f(null), eA = QA(null), qe = QA(null), ro = QA(!1), mo = QA(null);
|
|
17058
17127
|
HA(() => {
|
|
17059
17128
|
try {
|
|
17060
|
-
const B = Re(),
|
|
17061
|
-
ze.current = new St(B,
|
|
17129
|
+
const B = Re(), d = je(r);
|
|
17130
|
+
ze.current = new St(B, d), We.current = new jt(ze.current.getStreamUrl());
|
|
17062
17131
|
} catch {
|
|
17063
17132
|
}
|
|
17064
17133
|
return () => {
|
|
@@ -17070,16 +17139,16 @@ function br({
|
|
|
17070
17139
|
return;
|
|
17071
17140
|
}
|
|
17072
17141
|
if (!g || g.length < 2) return;
|
|
17073
|
-
const B = je(r),
|
|
17142
|
+
const B = je(r), d = new AbortController();
|
|
17074
17143
|
return fetch(`${B}/api/catalog/pick-best-garment-image`, {
|
|
17075
17144
|
method: "POST",
|
|
17076
17145
|
headers: { "Content-Type": "application/json" },
|
|
17077
17146
|
body: JSON.stringify({ images: g, productTitle: i }),
|
|
17078
|
-
signal:
|
|
17147
|
+
signal: d.signal
|
|
17079
17148
|
}).then((O) => O.ok ? O.json() : null).then((O) => {
|
|
17080
17149
|
O?.bestUrl && (mo.current = O.bestUrl, console.log(`[ps-sdk] pre-picked garment reference: ${O.bestUrl}`));
|
|
17081
17150
|
}).catch(() => {
|
|
17082
|
-
}), () =>
|
|
17151
|
+
}), () => d.abort();
|
|
17083
17152
|
}, [g, t, r, i]);
|
|
17084
17153
|
const tg = 22, Ro = QA(0), Po = QA(null), bo = QA(null), xo = QA(null), Ho = QA(null), Mo = QA(null), ng = QA(null), ig = QA(""), so = QA(null);
|
|
17085
17154
|
HA(() => {
|
|
@@ -17093,14 +17162,14 @@ function br({
|
|
|
17093
17162
|
{ at: 50, text: X("Generating virtual try-on...") },
|
|
17094
17163
|
{ at: 75, text: X("Refining details...") },
|
|
17095
17164
|
{ at: 90, text: X("Almost there...") }
|
|
17096
|
-
],
|
|
17165
|
+
], d = 2 * Math.PI * 38;
|
|
17097
17166
|
return so.current = setInterval(() => {
|
|
17098
17167
|
if (Je.current) return;
|
|
17099
17168
|
const O = ng.current || Date.now(), iA = (Date.now() - O) / 1e3, gA = Math.min(95, iA / tg * 100);
|
|
17100
17169
|
Ro.current = gA;
|
|
17101
17170
|
const AA = Math.round(gA);
|
|
17102
17171
|
if (Po.current && (Po.current.style.width = `${AA}%`), bo.current && (bo.current.textContent = `${AA}%`), Mo.current) {
|
|
17103
|
-
const k =
|
|
17172
|
+
const k = d * (1 - gA / 100);
|
|
17104
17173
|
Mo.current.style.strokeDashoffset = String(k);
|
|
17105
17174
|
}
|
|
17106
17175
|
if (Ho.current) {
|
|
@@ -17125,9 +17194,9 @@ function br({
|
|
|
17125
17194
|
tA && URL.revokeObjectURL(tA);
|
|
17126
17195
|
}, [tA]), HA(() => {
|
|
17127
17196
|
if (oA !== "idle") {
|
|
17128
|
-
const B = window.scrollY,
|
|
17197
|
+
const B = window.scrollY, d = document.body.style.overflow, O = document.body.style.overscrollBehavior;
|
|
17129
17198
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
17130
|
-
document.body.style.overflow =
|
|
17199
|
+
document.body.style.overflow = d, document.body.style.overscrollBehavior = O, window.scrollTo(0, B);
|
|
17131
17200
|
};
|
|
17132
17201
|
}
|
|
17133
17202
|
}, [oA]), HA(() => {
|
|
@@ -17148,10 +17217,10 @@ function br({
|
|
|
17148
17217
|
return;
|
|
17149
17218
|
}
|
|
17150
17219
|
GA(!0);
|
|
17151
|
-
const B = je(r),
|
|
17220
|
+
const B = je(r), d = Re();
|
|
17152
17221
|
fetch(`${B}/api/v1/sizing/sizeguide`, {
|
|
17153
17222
|
method: "POST",
|
|
17154
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
17223
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${d}` },
|
|
17155
17224
|
body: JSON.stringify({ product: { title: i, productId: z }, sizeGuideRaw: F })
|
|
17156
17225
|
}).then((O) => O.ok ? O.json() : null).then((O) => {
|
|
17157
17226
|
$A(O || { found: !1 });
|
|
@@ -17175,7 +17244,7 @@ function br({
|
|
|
17175
17244
|
return 1;
|
|
17176
17245
|
}
|
|
17177
17246
|
}, [oA]), yo = xA(
|
|
17178
|
-
(B,
|
|
17247
|
+
(B, d, O) => {
|
|
17179
17248
|
let iA = x, gA = EA.find((AA) => AA.id === iA);
|
|
17180
17249
|
if (!gA) {
|
|
17181
17250
|
const AA = {
|
|
@@ -17199,20 +17268,20 @@ function br({
|
|
|
17199
17268
|
}
|
|
17200
17269
|
if (O?.skipBodyEstimate)
|
|
17201
17270
|
console.log("[ps-sdk:persist] skipping body estimates — face/head flow (no body context)");
|
|
17202
|
-
else if (iA &&
|
|
17203
|
-
const AA =
|
|
17271
|
+
else if (iA && d?.estimates) {
|
|
17272
|
+
const AA = d.estimates, k = d.estimatesUnit || "cm";
|
|
17204
17273
|
wg(iA, AA, k), ce(Ke("profiles", []));
|
|
17205
17274
|
}
|
|
17206
|
-
if (JA(!0),
|
|
17207
|
-
const AA =
|
|
17208
|
-
Object.entries(
|
|
17275
|
+
if (JA(!0), d?.recommendedSize && iA) {
|
|
17276
|
+
const AA = d.sections ? Object.fromEntries(
|
|
17277
|
+
Object.entries(d.sections).map(([k, j]) => [k, j.recommendedSize])
|
|
17209
17278
|
) : void 0;
|
|
17210
17279
|
rt(iA, {
|
|
17211
17280
|
productId: z,
|
|
17212
17281
|
productTitle: i,
|
|
17213
17282
|
productImage: o,
|
|
17214
|
-
recommendedSize:
|
|
17215
|
-
confidence:
|
|
17283
|
+
recommendedSize: d.recommendedSize,
|
|
17284
|
+
confidence: d.confidence,
|
|
17216
17285
|
sections: AA,
|
|
17217
17286
|
savedAt: Date.now()
|
|
17218
17287
|
}), ce(Ke("profiles", []));
|
|
@@ -17220,14 +17289,14 @@ function br({
|
|
|
17220
17289
|
},
|
|
17221
17290
|
[x, EA, r, o, i, z, uA]
|
|
17222
17291
|
), rg = QA(null), [Fo, sg] = f(null), Hg = xA(async (B) => {
|
|
17223
|
-
const
|
|
17224
|
-
if (!iA && gA &&
|
|
17292
|
+
const d = B.height ?? B.heightCm ?? 0, O = B.weight ?? B.weightKg ?? 0, iA = !!B.measurements && Object.keys(B.measurements).length > 0, gA = B.photoBase64;
|
|
17293
|
+
if (!iA && gA && d > 0 && rg.current) {
|
|
17225
17294
|
try {
|
|
17226
17295
|
const k = gA.startsWith("data:") ? gA : `data:image/jpeg;base64,${gA}`, j = await fetch(k).then((VA) => VA.blob()), sA = new File([j], "profile-photo.jpg", { type: j.type || "image/jpeg" });
|
|
17227
17296
|
await rg.current({
|
|
17228
17297
|
photoFile: sA,
|
|
17229
17298
|
photoBase64: gA,
|
|
17230
|
-
height:
|
|
17299
|
+
height: d,
|
|
17231
17300
|
weight: O,
|
|
17232
17301
|
heightUnit: B.heightUnit || "cm",
|
|
17233
17302
|
weightUnit: B.weightUnit || "kg",
|
|
@@ -17265,14 +17334,14 @@ function br({
|
|
|
17265
17334
|
}, [z, i, o, F, r, tA]), Pt = xA(async () => {
|
|
17266
17335
|
const B = EA.find((gA) => gA.id === x);
|
|
17267
17336
|
if (!B) return;
|
|
17268
|
-
const
|
|
17269
|
-
|
|
17337
|
+
const d = B.height ?? B.heightCm ?? 0, O = B.weight ?? B.weightKg ?? 0;
|
|
17338
|
+
d > 0 && O > 0 && sg(B);
|
|
17270
17339
|
}, [EA, x]), bt = xA(() => {
|
|
17271
17340
|
if (!Fo) return;
|
|
17272
17341
|
const B = Fo;
|
|
17273
17342
|
sg(null), Hg(B);
|
|
17274
17343
|
}, [Fo, Hg]), xt = xA(() => {
|
|
17275
|
-
sg(null),
|
|
17344
|
+
sg(null), CA((B) => B + 1), N("body-profile");
|
|
17276
17345
|
}, []), Ht = QA(() => {
|
|
17277
17346
|
}), Mt = xA(() => {
|
|
17278
17347
|
console.log("[ps-sdk] handleOpen fired — opening modal"), N("body-profile"), l?.();
|
|
@@ -17292,7 +17361,7 @@ function br({
|
|
|
17292
17361
|
break;
|
|
17293
17362
|
case "size-result":
|
|
17294
17363
|
if (jA) {
|
|
17295
|
-
|
|
17364
|
+
de(null);
|
|
17296
17365
|
break;
|
|
17297
17366
|
}
|
|
17298
17367
|
N("body-profile");
|
|
@@ -17327,8 +17396,8 @@ function br({
|
|
|
17327
17396
|
return;
|
|
17328
17397
|
}
|
|
17329
17398
|
S(B), eA.current = B, qe.current = null;
|
|
17330
|
-
const
|
|
17331
|
-
yA(
|
|
17399
|
+
const d = URL.createObjectURL(B);
|
|
17400
|
+
yA(d), q?.(B), pA.current = null, eg(d).then((O) => {
|
|
17332
17401
|
pA.current = O;
|
|
17333
17402
|
}).catch(() => {
|
|
17334
17403
|
});
|
|
@@ -17342,23 +17411,23 @@ function br({
|
|
|
17342
17411
|
return;
|
|
17343
17412
|
}
|
|
17344
17413
|
if (B.status === "completed" && B.imageUrl) {
|
|
17345
|
-
if (kA((
|
|
17414
|
+
if (kA((d) => !d || d.startsWith("data:") || !B.imageUrl.startsWith("data:") ? B.imageUrl : d), !Je.current) {
|
|
17346
17415
|
if (Je.current = !0, Ro.current = 100, Po.current && (Po.current.style.width = "100%"), bo.current && (bo.current.textContent = "100%"), Mo.current && (Mo.current.style.strokeDashoffset = "0"), Ho.current && (Ho.current.textContent = X("Done")), xo.current) {
|
|
17347
|
-
const
|
|
17348
|
-
|
|
17349
|
-
|
|
17416
|
+
const d = xo.current;
|
|
17417
|
+
d.style.opacity = "0", setTimeout(() => {
|
|
17418
|
+
d.textContent = X("Complete!"), d.style.opacity = "1";
|
|
17350
17419
|
}, 180);
|
|
17351
17420
|
}
|
|
17352
17421
|
Co(), ve(!1), ee(null), P?.({ jobId: B.galleryId, imageUrl: B.imageUrl });
|
|
17353
17422
|
}
|
|
17354
17423
|
} else if (B.status === "failed" && !Je.current) {
|
|
17355
17424
|
Je.current = !0, Co(), ve(!1), ee(null);
|
|
17356
|
-
const
|
|
17357
|
-
MA(
|
|
17425
|
+
const d = B.error || X("Try-on generation failed");
|
|
17426
|
+
MA(d), N("error"), E?.({ message: d });
|
|
17358
17427
|
}
|
|
17359
17428
|
}, [P, E, Co]), oo = He(() => rA?.found && rA.requiredFields && rA.requiredFields.length > 0 ? rA.requiredFields : hA === "female" ? hn : vn, [rA, hA]), ko = xA(async (B) => {
|
|
17360
17429
|
if (!ze.current) return;
|
|
17361
|
-
const
|
|
17430
|
+
const d = B || te, O = je(r), iA = Re(), gA = wo(i);
|
|
17362
17431
|
if (gA === "face" || gA === "head") {
|
|
17363
17432
|
const k = I.current, j = (BA) => {
|
|
17364
17433
|
if (!BA) return;
|
|
@@ -17407,11 +17476,11 @@ function br({
|
|
|
17407
17476
|
return;
|
|
17408
17477
|
}
|
|
17409
17478
|
const AA = {
|
|
17410
|
-
method:
|
|
17479
|
+
method: d,
|
|
17411
17480
|
locale: cA,
|
|
17412
17481
|
product: { title: i, productId: z, description: "", variants: [] }
|
|
17413
17482
|
};
|
|
17414
|
-
if (rA?.found && (AA.sizeGuide = rA, rA.sections && (AA.sizeGuide = { ...rA, sections: rA.sections })), AA.sizingUnit = ne, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: rA?.found, hasHeaders: !!rA?.headers, hasRows: !!rA?.rows, headers: rA?.headers, rowCount: rA?.rows?.length, hasSections: !!rA?.sections, sectionNames: rA?.sections ? Object.keys(rA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", AA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", AA.sizeGuide && AA.sizeGuide.rows?.[0] ? Array.isArray(AA.sizeGuide.rows[0]) ? "array" : typeof AA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(AA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:",
|
|
17483
|
+
if (rA?.found && (AA.sizeGuide = rA, rA.sections && (AA.sizeGuide = { ...rA, sections: rA.sections })), AA.sizingUnit = ne, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: rA?.found, hasHeaders: !!rA?.headers, hasRows: !!rA?.rows, headers: rA?.headers, rowCount: rA?.rows?.length, hasSections: !!rA?.sections, sectionNames: rA?.sections ? Object.keys(rA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", AA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", AA.sizeGuide && AA.sizeGuide.rows?.[0] ? Array.isArray(AA.sizeGuide.rows[0]) ? "array" : typeof AA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(AA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", d, "| sizingUnit:", ne, "| heightUnit:", YA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(I.current)), console.log("[PS-SDK] dynamicFields:", oo.map((k) => `${k.key}(unit=${k.unit},req=${k.required})`).join(", ")), d === "exact") {
|
|
17415
17484
|
const k = { gender: I.current.gender || "male", sizingUnit: ne }, j = /* @__PURE__ */ new Set();
|
|
17416
17485
|
for (const sA of oo)
|
|
17417
17486
|
sA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(sA.key) && j.add(sA.key);
|
|
@@ -17456,7 +17525,7 @@ function br({
|
|
|
17456
17525
|
return;
|
|
17457
17526
|
}
|
|
17458
17527
|
oe(VA), P?.(VA);
|
|
17459
|
-
const DA = AA.measurements || {}, ge = AA.quickEstimate || {}, qA =
|
|
17528
|
+
const DA = AA.measurements || {}, ge = AA.quickEstimate || {}, qA = d === "exact" ? DA : ge;
|
|
17460
17529
|
yo(
|
|
17461
17530
|
{
|
|
17462
17531
|
gender: qA.gender || "male",
|
|
@@ -17480,7 +17549,7 @@ function br({
|
|
|
17480
17549
|
} finally {
|
|
17481
17550
|
M(!1);
|
|
17482
17551
|
}
|
|
17483
|
-
}, [r, te, cA, YA, bA, ne, rA, i, oo, yo]), kt = xA(async (B,
|
|
17552
|
+
}, [r, te, cA, YA, bA, ne, rA, i, oo, yo]), kt = xA(async (B, d, O, iA, gA, AA, k, j, sA, VA, DA) => {
|
|
17484
17553
|
if (!ze.current) {
|
|
17485
17554
|
const BA = X("SDK not configured. Please refresh and try again.");
|
|
17486
17555
|
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), MA(BA), N("error"), E?.({ message: BA, code: "SDK_NOT_CONFIGURED" });
|
|
@@ -17501,7 +17570,7 @@ function br({
|
|
|
17501
17570
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), tA && URL.revokeObjectURL(tA), S(null), eA.current = null, yA(null), be(null), Ve(null), pe("quick"), M(!0), N("size-result"), ko("quick");
|
|
17502
17571
|
return;
|
|
17503
17572
|
}
|
|
17504
|
-
I.current.height = String(B), I.current.weight = String(
|
|
17573
|
+
I.current.height = String(B), I.current.weight = String(d), I.current.heightUnit = O, I.current.weightUnit = iA, I.current.gender = gA, AA && (I.current.age = String(AA)), k && (I.current.bodyType = k), j && (I.current.chestProfile = j), sA && (I.current.midsectionProfile = sA), VA && (I.current.hipProfile = VA), oe(null), kA(null), tA && URL.revokeObjectURL(tA), S(null), eA.current = null, yA(null), be(null), Ve(null), pe("quick"), M(!0), N("size-result"), ko("quick");
|
|
17505
17574
|
}, [r, oo, rA, ko, ne, bA, tA]), cg = xA(async (B) => {
|
|
17506
17575
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
17507
17576
|
hasApiRef: !!ze.current,
|
|
@@ -17512,8 +17581,8 @@ function br({
|
|
|
17512
17581
|
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), MA(DA), N("error"), E?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
17513
17582
|
return;
|
|
17514
17583
|
}
|
|
17515
|
-
const
|
|
17516
|
-
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl:
|
|
17584
|
+
const d = je(r), O = Re();
|
|
17585
|
+
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: d }), S(B.photoFile), eA.current = B.photoFile;
|
|
17517
17586
|
const iA = B.photoFile ? URL.createObjectURL(B.photoFile) : B.photoBase64.startsWith("data:") ? B.photoBase64 : `data:image/jpeg;base64,${B.photoBase64}`;
|
|
17518
17587
|
yA(iA), Je.current = !1, qe.current = null, b.current = !1, ve(!1), ee(null), oe(null), kA(null), M(!0), JA(!1), N("size-result");
|
|
17519
17588
|
const gA = wo(i);
|
|
@@ -17537,7 +17606,7 @@ function br({
|
|
|
17537
17606
|
bodyImage: B.photoBase64
|
|
17538
17607
|
};
|
|
17539
17608
|
ge && (qA.faceMeasurementsMm = ge.measurementsMm, qA.faceLandmarks = ge.landmarks, qA.irisConfidence = ge.irisConfidence);
|
|
17540
|
-
const ae = await fetch(`${
|
|
17609
|
+
const ae = await fetch(`${d}/api/v1/sizing/face-recommend`, {
|
|
17541
17610
|
method: "POST",
|
|
17542
17611
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${O}` },
|
|
17543
17612
|
body: JSON.stringify(qA)
|
|
@@ -17621,7 +17690,7 @@ function br({
|
|
|
17621
17690
|
try {
|
|
17622
17691
|
const DA = Date.now(), ge = JSON.stringify(sA).length;
|
|
17623
17692
|
console.log(`[ps-sdk:T] ▶ POST /sizing/recommend payload=${Math.round(ge / 1024)}KB bodyImage=${!!sA.bodyImage} landmarks=${!!sA.bodyLandmarks}`);
|
|
17624
|
-
const qA = await fetch(`${
|
|
17693
|
+
const qA = await fetch(`${d}/api/v1/sizing/recommend`, {
|
|
17625
17694
|
method: "POST",
|
|
17626
17695
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${O}` },
|
|
17627
17696
|
body: JSON.stringify(sA)
|
|
@@ -17654,14 +17723,14 @@ function br({
|
|
|
17654
17723
|
}, [r, o, i, ne, bA, cA, rA, oo, yo]);
|
|
17655
17724
|
rg.current = cg;
|
|
17656
17725
|
const Yo = xA(async (B) => {
|
|
17657
|
-
const
|
|
17658
|
-
if (!
|
|
17726
|
+
const d = B || vA || eA.current;
|
|
17727
|
+
if (!d || !ze.current || !We.current) {
|
|
17659
17728
|
const AA = ze.current ? X("Please upload a photo first.") : X("SDK not configured. Please provide an API key.");
|
|
17660
17729
|
MA(AA), N("error"), E?.({ message: AA, code: "SDK_NOT_CONFIGURED" });
|
|
17661
17730
|
return;
|
|
17662
17731
|
}
|
|
17663
17732
|
B && B !== vA && (S(B), eA.current = B), Je.current = !1, ve(!0), ee(Date.now());
|
|
17664
|
-
const O = Pr(wo(i)), iA = O === "apparel", gA = (B ? null : tA) || URL.createObjectURL(
|
|
17733
|
+
const O = Pr(wo(i)), iA = O === "apparel", gA = (B ? null : tA) || URL.createObjectURL(d);
|
|
17665
17734
|
(B || !tA) && yA(gA), iA && (!pA.current || !we) && (pA.current = null, be(null), eg(gA).then((AA) => {
|
|
17666
17735
|
pA.current = AA;
|
|
17667
17736
|
}).catch(() => {
|
|
@@ -17670,7 +17739,7 @@ function br({
|
|
|
17670
17739
|
}).catch(() => {
|
|
17671
17740
|
}));
|
|
17672
17741
|
try {
|
|
17673
|
-
const AA = await uo(
|
|
17742
|
+
const AA = await uo(d, iA ? { maxDimension: 1024, quality: 0.85 } : {}), k = Z.current, j = Object.keys(k), sA = j.length > 0, VA = sA ? (() => {
|
|
17674
17743
|
const NA = /* @__PURE__ */ new Set(), Ne = [];
|
|
17675
17744
|
for (const co of j) {
|
|
17676
17745
|
const Ue = k[co]?.matchDetails || [];
|
|
@@ -17794,23 +17863,23 @@ function br({
|
|
|
17794
17863
|
B.href = nA, B.download = `primestyle-tryon-${Date.now()}.png`, B.click();
|
|
17795
17864
|
} else
|
|
17796
17865
|
fetch(nA).then((B) => B.blob()).then((B) => {
|
|
17797
|
-
const
|
|
17798
|
-
O.href =
|
|
17866
|
+
const d = URL.createObjectURL(B), O = document.createElement("a");
|
|
17867
|
+
O.href = d, O.download = `primestyle-tryon-${Date.now()}.png`, O.click(), setTimeout(() => URL.revokeObjectURL(d), 100);
|
|
17799
17868
|
}).catch(() => window.open(nA, "_blank"));
|
|
17800
17869
|
}, [nA]), Gt = xA(() => {
|
|
17801
17870
|
Je.current = !1, Co(), S(null), tA && URL.revokeObjectURL(tA), yA(null), kA(null), MA(null), pe(null), oe(null), M(!1), Ie(!1), N("body-profile");
|
|
17802
17871
|
}, [tA, Co]), Lt = xA((B) => {
|
|
17803
|
-
const
|
|
17804
|
-
if (!
|
|
17872
|
+
const d = EA.find((iA) => iA.id === B);
|
|
17873
|
+
if (!d) return;
|
|
17805
17874
|
uA(B), ce((iA) => iA.map((gA) => gA.id === B ? { ...gA, lastUsedAt: Date.now() } : gA));
|
|
17806
|
-
const O = { gender:
|
|
17807
|
-
if ((
|
|
17808
|
-
for (const [iA, gA] of Object.entries(
|
|
17875
|
+
const O = { gender: d.gender || "male" };
|
|
17876
|
+
if ((d.height ?? d.heightCm) && (O.height = String(d.height ?? d.heightCm)), (d.weight ?? d.weightKg) && (O.weight = String(d.weight ?? d.weightKg)), d.chest && (O.chest = String(d.chest)), d.bust && (O.bust = String(d.bust)), d.waist && (O.waist = String(d.waist)), d.hips && (O.hips = String(d.hips)), d.shoulderWidth && (O.shoulderWidth = String(d.shoulderWidth)), d.sleeveLength && (O.sleeveLength = String(d.sleeveLength)), d.inseam && (O.inseam = String(d.inseam)), d.neckCircumference && (O.neckCircumference = String(d.neckCircumference)), d.footLengthCm && (O.footLengthCm = String(d.footLengthCm)), d.shoeEU && (O.shoeEU = d.shoeEU), d.shoeUS && (O.shoeUS = d.shoeUS), d.shoeUK && (O.shoeUK = d.shoeUK), d.fitPreference && (O.fitPreference = d.fitPreference), d.customMeasurements)
|
|
17877
|
+
for (const [iA, gA] of Object.entries(d.customMeasurements))
|
|
17809
17878
|
O[iA] = String(gA);
|
|
17810
|
-
I.current = O, TA(O.gender || "male"),
|
|
17879
|
+
I.current = O, TA(O.gender || "male"), d.country && LA(d.country), d.sizingUnit && Ce(d.sizingUnit), d.heightUnit && KA(d.heightUnit), d.weightUnit && dA(d.weightUnit), CA((iA) => iA + 1);
|
|
17811
17880
|
}, [EA]);
|
|
17812
|
-
Ht.current = Lt, xA((B,
|
|
17813
|
-
const O = (
|
|
17881
|
+
Ht.current = Lt, xA((B, d) => {
|
|
17882
|
+
const O = (d ? null : x) || `p_${Date.now()}`, iA = {
|
|
17814
17883
|
id: O,
|
|
17815
17884
|
name: B,
|
|
17816
17885
|
gender: I.current.gender || "male",
|
|
@@ -17867,12 +17936,12 @@ function br({
|
|
|
17867
17936
|
}, [x, cA, ne, YA, bA]);
|
|
17868
17937
|
const yg = xA(async () => {
|
|
17869
17938
|
const B = `h_${Date.now()}`;
|
|
17870
|
-
let
|
|
17939
|
+
let d = !1;
|
|
17871
17940
|
const O = vA || eA.current;
|
|
17872
17941
|
if (O)
|
|
17873
17942
|
try {
|
|
17874
17943
|
const j = await uo(O, { maxDimension: 768, quality: 0.7 }), sA = await (await fetch(j)).blob();
|
|
17875
|
-
|
|
17944
|
+
d = await Xg(B, sA);
|
|
17876
17945
|
} catch {
|
|
17877
17946
|
}
|
|
17878
17947
|
const iA = Z.current, gA = lA?.recommendedSize ?? "", AA = Object.values(iA).map((j) => ({
|
|
@@ -17901,7 +17970,7 @@ function br({
|
|
|
17901
17970
|
sectionImages: rA.sectionImages
|
|
17902
17971
|
} : void 0,
|
|
17903
17972
|
date: Date.now(),
|
|
17904
|
-
hasPhoto:
|
|
17973
|
+
hasPhoto: d || void 0,
|
|
17905
17974
|
selectedSizes: AA.length ? AA : void 0
|
|
17906
17975
|
};
|
|
17907
17976
|
if (x) {
|
|
@@ -17919,12 +17988,12 @@ function br({
|
|
|
17919
17988
|
});
|
|
17920
17989
|
else if (oA === "size-result" && lA && nA && !Go.current) {
|
|
17921
17990
|
Go.current = !0;
|
|
17922
|
-
const B = Z.current,
|
|
17991
|
+
const B = Z.current, d = lA?.recommendedSize ?? "", O = Object.values(B).map((gA) => ({
|
|
17923
17992
|
sectionName: gA.sectionName,
|
|
17924
17993
|
selectedSize: gA.selectedSize,
|
|
17925
17994
|
selectedLength: gA.selectedLength,
|
|
17926
17995
|
displayLabel: gA.displayLabel,
|
|
17927
|
-
isOverride: !!
|
|
17996
|
+
isOverride: !!d && gA.selectedSize !== d
|
|
17928
17997
|
}));
|
|
17929
17998
|
let iA = null;
|
|
17930
17999
|
if (H((gA) => gA.length === 0 ? gA : (iA = gA[0].id, [{
|
|
@@ -17954,36 +18023,36 @@ function br({
|
|
|
17954
18023
|
reasoning: B.reasoning || "",
|
|
17955
18024
|
internationalSizes: B.internationalSizes,
|
|
17956
18025
|
matchDetails: B.matchDetails
|
|
17957
|
-
}), B.sizeGuide && ($A(B.sizeGuide), GA(!1)), kA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((
|
|
17958
|
-
if (!
|
|
17959
|
-
const O = URL.createObjectURL(
|
|
18026
|
+
}), B.sizeGuide && ($A(B.sizeGuide), GA(!1)), kA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((d) => {
|
|
18027
|
+
if (!d) return;
|
|
18028
|
+
const O = URL.createObjectURL(d);
|
|
17960
18029
|
kA(O);
|
|
17961
|
-
}), B.hasPhoto && Wg(B.id).then((
|
|
17962
|
-
if (!
|
|
17963
|
-
const O = new File([
|
|
18030
|
+
}), B.hasPhoto && Wg(B.id).then((d) => {
|
|
18031
|
+
if (!d) return;
|
|
18032
|
+
const O = new File([d], `history-photo-${B.id}.jpg`, { type: d.type || "image/jpeg" });
|
|
17964
18033
|
S(O), eA.current = O;
|
|
17965
18034
|
}), B.selectedSizes && B.selectedSizes.length) {
|
|
17966
|
-
const
|
|
18035
|
+
const d = {};
|
|
17967
18036
|
for (const O of B.selectedSizes)
|
|
17968
|
-
|
|
18037
|
+
d[O.sectionName] = {
|
|
17969
18038
|
sectionName: O.sectionName,
|
|
17970
18039
|
selectedSize: O.selectedSize,
|
|
17971
18040
|
selectedLength: O.selectedLength,
|
|
17972
18041
|
displayLabel: O.displayLabel
|
|
17973
18042
|
};
|
|
17974
|
-
ue(
|
|
18043
|
+
ue(d), Z.current = d;
|
|
17975
18044
|
}
|
|
17976
|
-
M(!1), ve(!1), ee(null),
|
|
17977
|
-
}, []), zt = xA((B,
|
|
17978
|
-
I.current[B] =
|
|
18045
|
+
M(!1), ve(!1), ee(null), de(null), D(null), N("size-result");
|
|
18046
|
+
}, []), zt = xA((B, d) => {
|
|
18047
|
+
I.current[B] = d;
|
|
17979
18048
|
}, []);
|
|
17980
18049
|
He(() => {
|
|
17981
|
-
const
|
|
18050
|
+
const d = {
|
|
17982
18051
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
17983
18052
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
17984
18053
|
AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
|
|
17985
18054
|
}[cA] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
|
|
17986
|
-
return { key:
|
|
18055
|
+
return { key: d.key, label: X(d.labelKey), ph: d.ph };
|
|
17987
18056
|
}, [cA, X]);
|
|
17988
18057
|
const Nt = {
|
|
17989
18058
|
"--ps-btn-bg": m.backgroundColor,
|
|
@@ -18041,10 +18110,10 @@ function br({
|
|
|
18041
18110
|
case "welcome":
|
|
18042
18111
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Vn, { productImage: o, setView: N, t: X }) }, "v-welcome");
|
|
18043
18112
|
case "body-profile": {
|
|
18044
|
-
const B = wo(i),
|
|
18045
|
-
if (B === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Dr, { ...
|
|
18046
|
-
if (B === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(hr, { ...
|
|
18047
|
-
if (B === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ur, { ...
|
|
18113
|
+
const B = wo(i), d = { productImage: o, productTitle: i, formRef: I, sizingUnit: ne, setSizingUnit: Ce, setSizingMethod: pe, setSizingLoading: M, setView: N, submitSizing: ko, onSnapSubmit: cg, onBack: ao, apiUrl: je(r), apiKey: Re(), sizeGuide: rA, t: X };
|
|
18114
|
+
if (B === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Dr, { ...d }) }, "v-foot");
|
|
18115
|
+
if (B === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(hr, { ...d }) }, "v-head");
|
|
18116
|
+
if (B === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ur, { ...d }) }, "v-face");
|
|
18048
18117
|
const O = !!(rA?.requiredFields?.some((k) => k.key === "bust") || rA?.sections && Object.values(rA.sections).some((k) => k.requiredFields?.some((j) => j.key === "bust"))), iA = i.toLowerCase(), gA = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(iA);
|
|
18049
18118
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
18050
18119
|
pr,
|
|
@@ -18057,9 +18126,9 @@ function br({
|
|
|
18057
18126
|
heightUnit: YA,
|
|
18058
18127
|
setHeightUnit: KA,
|
|
18059
18128
|
weightUnit: bA,
|
|
18060
|
-
setWeightUnit:
|
|
18129
|
+
setWeightUnit: dA,
|
|
18061
18130
|
sizingUnit: ne,
|
|
18062
|
-
setSizingUnit:
|
|
18131
|
+
setSizingUnit: Ce,
|
|
18063
18132
|
apiUrl: je(r),
|
|
18064
18133
|
apiKey: Re(),
|
|
18065
18134
|
hasActiveProfileWithMeasurements: (() => {
|
|
@@ -18110,9 +18179,9 @@ function br({
|
|
|
18110
18179
|
formRef: I,
|
|
18111
18180
|
formGender: hA,
|
|
18112
18181
|
formKey: De,
|
|
18113
|
-
setFormKey:
|
|
18182
|
+
setFormKey: CA,
|
|
18114
18183
|
sizingUnit: ne,
|
|
18115
|
-
setSizingUnit:
|
|
18184
|
+
setSizingUnit: Ce,
|
|
18116
18185
|
updateField: zt,
|
|
18117
18186
|
setSizingMethod: pe,
|
|
18118
18187
|
setSizingLoading: M,
|
|
@@ -18150,7 +18219,7 @@ function br({
|
|
|
18150
18219
|
faceLandmarks: eo,
|
|
18151
18220
|
measurementType: wo(i),
|
|
18152
18221
|
activeSection: jA,
|
|
18153
|
-
setActiveSection:
|
|
18222
|
+
setActiveSection: de,
|
|
18154
18223
|
onResetTryOn: () => {
|
|
18155
18224
|
S(null), tA && URL.revokeObjectURL(tA), yA(null), kA(null);
|
|
18156
18225
|
},
|
|
@@ -18158,17 +18227,17 @@ function br({
|
|
|
18158
18227
|
userHeightCm: (() => {
|
|
18159
18228
|
const B = EA.find((gA) => gA.id === x);
|
|
18160
18229
|
if (!B) return;
|
|
18161
|
-
const
|
|
18162
|
-
if (!
|
|
18230
|
+
const d = B.height ?? B.heightCm;
|
|
18231
|
+
if (!d || d <= 0) return;
|
|
18163
18232
|
const O = B.heightUnit, iA = lA?.unit || ne;
|
|
18164
|
-
return (O === "in" || O === "ft") && iA !== "in" ? Math.round(
|
|
18233
|
+
return (O === "in" || O === "ft") && iA !== "in" ? Math.round(d * 2.54) : (!O || O === "cm") && iA === "in" ? Math.round(d / 2.54 * 10) / 10 : d;
|
|
18165
18234
|
})(),
|
|
18166
18235
|
t: X
|
|
18167
18236
|
}
|
|
18168
18237
|
) }, "v-sizeresult");
|
|
18169
18238
|
case "upload":
|
|
18170
18239
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
18171
|
-
|
|
18240
|
+
di,
|
|
18172
18241
|
{
|
|
18173
18242
|
selectedFile: vA,
|
|
18174
18243
|
previewUrl: tA,
|
|
@@ -18217,25 +18286,25 @@ function br({
|
|
|
18217
18286
|
onSelectProfile: (B) => {
|
|
18218
18287
|
uA(B), N("body-profile");
|
|
18219
18288
|
},
|
|
18220
|
-
onSaveProfileMeasurements: (B,
|
|
18221
|
-
wg(B,
|
|
18289
|
+
onSaveProfileMeasurements: (B, d, O) => {
|
|
18290
|
+
wg(B, d, O ?? EA.find((iA) => iA.id === B)?.measurementsUnit ?? "cm"), ce(Ke("profiles", []));
|
|
18222
18291
|
},
|
|
18223
|
-
onSaveBraSize: (B,
|
|
18224
|
-
it(B, { bandSize:
|
|
18292
|
+
onSaveBraSize: (B, d, O) => {
|
|
18293
|
+
it(B, { bandSize: d, cupSize: O }), ce(Ke("profiles", []));
|
|
18225
18294
|
},
|
|
18226
18295
|
onEditProfile: (B) => {
|
|
18227
18296
|
fA(B);
|
|
18228
18297
|
},
|
|
18229
18298
|
onPhotoPreview: (B) => {
|
|
18230
18299
|
if (B) {
|
|
18231
|
-
const
|
|
18232
|
-
yA(
|
|
18300
|
+
const d = B.startsWith("data:") ? B : `data:image/jpeg;base64,${B}`;
|
|
18301
|
+
yA(d);
|
|
18233
18302
|
} else
|
|
18234
18303
|
yA(null);
|
|
18235
18304
|
},
|
|
18236
18305
|
onEstimateFromPhoto: async (B) => {
|
|
18237
18306
|
try {
|
|
18238
|
-
const
|
|
18307
|
+
const d = await po(B.photoBase64).catch(() => null), O = await zg({
|
|
18239
18308
|
apiUrl: r,
|
|
18240
18309
|
height: B.height > 0 ? B.height : void 0,
|
|
18241
18310
|
weight: B.weight > 0 ? B.weight : void 0,
|
|
@@ -18244,7 +18313,7 @@ function br({
|
|
|
18244
18313
|
gender: B.gender,
|
|
18245
18314
|
age: B.age,
|
|
18246
18315
|
bodyImage: B.photoBase64,
|
|
18247
|
-
bodyLandmarks:
|
|
18316
|
+
bodyLandmarks: d ?? void 0
|
|
18248
18317
|
});
|
|
18249
18318
|
return O ? { estimates: O.estimates, unit: O.unit } : null;
|
|
18250
18319
|
} catch {
|
|
@@ -18252,31 +18321,31 @@ function br({
|
|
|
18252
18321
|
}
|
|
18253
18322
|
},
|
|
18254
18323
|
onSaveNewProfile: async (B) => {
|
|
18255
|
-
const
|
|
18324
|
+
const d = {
|
|
18256
18325
|
...B,
|
|
18257
18326
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
18258
18327
|
createdAt: Date.now(),
|
|
18259
18328
|
lastUsedAt: Date.now()
|
|
18260
|
-
}, O = [
|
|
18261
|
-
mg(O), ce(O), uA(
|
|
18262
|
-
const iA =
|
|
18263
|
-
!(!!
|
|
18329
|
+
}, O = [d, ...EA];
|
|
18330
|
+
mg(O), ce(O), uA(d.id);
|
|
18331
|
+
const iA = d.heightCm || d.height || 0, gA = d.weightKg || d.weight || 0, AA = d.sizingUnit === "in" ? "in" : "cm", k = d.sizingUnit === "in" ? "lbs" : "kg", j = d.photoBase64;
|
|
18332
|
+
!(!!d.measurements && Object.keys(d.measurements).length > 0) && (j || iA > 0 && gA > 0) && (IA((DA) => new Set(DA).add(d.id)), (j ? po(j).catch(() => null) : Promise.resolve(null)).then((DA) => zg({
|
|
18264
18333
|
apiUrl: r,
|
|
18265
18334
|
height: iA > 0 ? iA : void 0,
|
|
18266
18335
|
weight: gA > 0 ? gA : void 0,
|
|
18267
18336
|
heightUnit: AA,
|
|
18268
18337
|
weightUnit: k,
|
|
18269
|
-
gender:
|
|
18270
|
-
age:
|
|
18271
|
-
chestProfile:
|
|
18272
|
-
midsectionProfile:
|
|
18273
|
-
hipProfile:
|
|
18338
|
+
gender: d.gender,
|
|
18339
|
+
age: d.age,
|
|
18340
|
+
chestProfile: d.chestProfile,
|
|
18341
|
+
midsectionProfile: d.midsectionProfile,
|
|
18342
|
+
hipProfile: d.hipProfile,
|
|
18274
18343
|
bodyImage: j,
|
|
18275
18344
|
bodyLandmarks: DA ?? void 0
|
|
18276
18345
|
})).then((DA) => {
|
|
18277
18346
|
if (DA) {
|
|
18278
|
-
if (wg(
|
|
18279
|
-
const ge = Ke("profiles", []), qA = ge.findIndex((ae) => ae.id ===
|
|
18347
|
+
if (wg(d.id, DA.estimates, DA.unit), DA.userEstimates) {
|
|
18348
|
+
const ge = Ke("profiles", []), qA = ge.findIndex((ae) => ae.id === d.id);
|
|
18280
18349
|
if (qA >= 0) {
|
|
18281
18350
|
const ae = ge[qA], BA = DA.userEstimates, Be = { ...ae };
|
|
18282
18351
|
BA.height && !(ae.height || ae.heightCm) && (Be.height = BA.height, Be.heightCm = BA.height, Be.heightUnit = "cm"), BA.weight && !(ae.weight || ae.weightKg) && (Be.weight = BA.weight, Be.weightKg = BA.weight, Be.weightUnit = "kg"), BA.age && !ae.age && (Be.age = BA.age), ge[qA] = Be, lo("profiles", ge);
|
|
@@ -18288,12 +18357,12 @@ function br({
|
|
|
18288
18357
|
}).finally(() => {
|
|
18289
18358
|
IA((DA) => {
|
|
18290
18359
|
const ge = new Set(DA);
|
|
18291
|
-
return ge.delete(
|
|
18360
|
+
return ge.delete(d.id), ge;
|
|
18292
18361
|
});
|
|
18293
18362
|
}));
|
|
18294
18363
|
},
|
|
18295
18364
|
onDeleteProfile: (B) => {
|
|
18296
|
-
ce((
|
|
18365
|
+
ce((d) => d.filter((O) => O.id !== B)), x === B && uA(null), lo("profiles", Ke("profiles", []).filter((d) => d.id !== B));
|
|
18297
18366
|
},
|
|
18298
18367
|
onRequestDelete: (B) => wA(B),
|
|
18299
18368
|
onClose: () => N("body-profile"),
|
|
@@ -18325,7 +18394,7 @@ function br({
|
|
|
18325
18394
|
) }, "v-nochart");
|
|
18326
18395
|
case "photo-guide":
|
|
18327
18396
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
18328
|
-
|
|
18397
|
+
Ci,
|
|
18329
18398
|
{
|
|
18330
18399
|
measurementType: wo(i),
|
|
18331
18400
|
apiUrl: je(r),
|
|
@@ -18351,7 +18420,7 @@ function br({
|
|
|
18351
18420
|
className: Le("ps-tryon-btn", L.button),
|
|
18352
18421
|
type: "button",
|
|
18353
18422
|
children: [
|
|
18354
|
-
Q !== !1 && (
|
|
18423
|
+
Q !== !1 && (C || /* @__PURE__ */ A(to, {})),
|
|
18355
18424
|
/* @__PURE__ */ A("span", { children: UA })
|
|
18356
18425
|
]
|
|
18357
18426
|
}
|
|
@@ -18397,8 +18466,8 @@ function br({
|
|
|
18397
18466
|
Wi,
|
|
18398
18467
|
{
|
|
18399
18468
|
onConfirm: () => {
|
|
18400
|
-
const B = $,
|
|
18401
|
-
lo("profiles",
|
|
18469
|
+
const B = $, d = Ke("profiles", []).filter((O) => O.id !== B);
|
|
18470
|
+
lo("profiles", d), ce(d), x === B && uA(null), wA(null);
|
|
18402
18471
|
},
|
|
18403
18472
|
onCancel: () => wA(null),
|
|
18404
18473
|
t: X
|