@primestyleai/tryon 5.6.14 → 5.6.16
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 +270 -42
- package/dist/react/styles.d.ts +1 -1
- package/dist/react/views/BasicsStepMobile.d.ts +6 -1
- package/dist/react/views/BodyProfileView.d.ts +7 -1
- package/dist/react/views/MultiSectionMobile.d.ts +20 -1
- package/dist/react/views/SizeResultView.d.ts +5 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -3080,6 +3080,33 @@ const STYLES = `
|
|
|
3080
3080
|
to { opacity: 1; }
|
|
3081
3081
|
}
|
|
3082
3082
|
|
|
3083
|
+
/* Active profile loaded banner — shows on basics step when a profile is selected */
|
|
3084
|
+
.ps-bp-profile-loaded {
|
|
3085
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
3086
|
+
gap: 12px;
|
|
3087
|
+
padding: 10px 14px;
|
|
3088
|
+
background: var(--ps-bg-secondary);
|
|
3089
|
+
border: 1px solid var(--ps-border-subtle);
|
|
3090
|
+
border-radius: 10px;
|
|
3091
|
+
margin-bottom: 4px;
|
|
3092
|
+
}
|
|
3093
|
+
.ps-bp-profile-loaded-label {
|
|
3094
|
+
font-size: 12px; color: var(--ps-text-secondary);
|
|
3095
|
+
letter-spacing: 0.02em;
|
|
3096
|
+
}
|
|
3097
|
+
.ps-bp-profile-loaded-label strong {
|
|
3098
|
+
color: var(--ps-text-primary); font-weight: 700;
|
|
3099
|
+
}
|
|
3100
|
+
.ps-bp-profile-loaded-link {
|
|
3101
|
+
background: none; border: none;
|
|
3102
|
+
color: var(--ps-accent);
|
|
3103
|
+
font-family: inherit; font-size: 12px; font-weight: 700;
|
|
3104
|
+
text-decoration: underline; text-underline-offset: 2px;
|
|
3105
|
+
cursor: pointer; padding: 0;
|
|
3106
|
+
white-space: nowrap;
|
|
3107
|
+
}
|
|
3108
|
+
.ps-bp-profile-loaded-link:hover { opacity: 0.85; }
|
|
3109
|
+
|
|
3083
3110
|
/* Typography */
|
|
3084
3111
|
.ps-bp-title {
|
|
3085
3112
|
font-size: 1.25vw; font-weight: 700; color: var(--ps-text-primary);
|
|
@@ -3337,7 +3364,8 @@ const STYLES = `
|
|
|
3337
3364
|
object-fit: contain; display: block;
|
|
3338
3365
|
}
|
|
3339
3366
|
.ps-pm-preview-empty {
|
|
3340
|
-
display: flex; flex-direction: column;
|
|
3367
|
+
display: flex; flex-direction: column;
|
|
3368
|
+
align-items: center; justify-content: center;
|
|
3341
3369
|
gap: 6px; padding: 24px;
|
|
3342
3370
|
background: none; border: none;
|
|
3343
3371
|
color: var(--ps-text-muted); cursor: pointer;
|
|
@@ -3621,16 +3649,53 @@ const STYLES = `
|
|
|
3621
3649
|
}
|
|
3622
3650
|
.ps-msr-product-img-wrap {
|
|
3623
3651
|
position: relative; flex-shrink: 0;
|
|
3624
|
-
width:
|
|
3652
|
+
width: 100%; max-width: 360px; height: 420px;
|
|
3625
3653
|
border-radius: 12px; overflow: hidden;
|
|
3626
3654
|
background: var(--ps-bg-secondary);
|
|
3627
3655
|
display: flex; align-items: center; justify-content: center;
|
|
3628
3656
|
}
|
|
3657
|
+
/* When showing the try-on result, give it a touch more presence */
|
|
3658
|
+
.ps-msr-product-img-wrap.ps-tryon {
|
|
3659
|
+
background: #0F0F10;
|
|
3660
|
+
}
|
|
3629
3661
|
.ps-msr-product-img {
|
|
3630
3662
|
max-width: 100%; max-height: 100%;
|
|
3631
3663
|
width: auto; height: 100%;
|
|
3632
3664
|
object-fit: contain; display: block;
|
|
3633
3665
|
}
|
|
3666
|
+
/* Show-Fit / mediapipe overlay toggle pill — bottom-left of try-on hero */
|
|
3667
|
+
.ps-msr-fit-toggle {
|
|
3668
|
+
position: absolute; bottom: 10px; left: 10px;
|
|
3669
|
+
display: flex; align-items: center; gap: 6px;
|
|
3670
|
+
padding: 8px 12px;
|
|
3671
|
+
background: rgba(255,255,255,0.92);
|
|
3672
|
+
color: var(--ps-text-primary);
|
|
3673
|
+
border: none; border-radius: 999px;
|
|
3674
|
+
font-family: inherit; font-size: 11px; font-weight: 700;
|
|
3675
|
+
letter-spacing: 0.04em;
|
|
3676
|
+
cursor: pointer;
|
|
3677
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
|
|
3678
|
+
backdrop-filter: blur(6px);
|
|
3679
|
+
-webkit-backdrop-filter: blur(6px);
|
|
3680
|
+
z-index: 2;
|
|
3681
|
+
}
|
|
3682
|
+
.ps-msr-fit-toggle:active { transform: scale(0.97); }
|
|
3683
|
+
.ps-msr-fit-toggle[aria-pressed="true"] {
|
|
3684
|
+
background: var(--ps-accent); color: #FFFFFF;
|
|
3685
|
+
}
|
|
3686
|
+
/* Bottom action row when try-on finished — Try Again + Continue Shopping */
|
|
3687
|
+
.ps-msr-bottom-row {
|
|
3688
|
+
display: flex; gap: 10px; align-items: stretch;
|
|
3689
|
+
}
|
|
3690
|
+
.ps-msr-bottom-row .ps-msr-tryon-cta { flex: 1; }
|
|
3691
|
+
.ps-msr-tryon-cta.ps-secondary {
|
|
3692
|
+
background: transparent;
|
|
3693
|
+
color: var(--ps-text-primary);
|
|
3694
|
+
border: 1.5px solid var(--ps-border-color);
|
|
3695
|
+
}
|
|
3696
|
+
.ps-msr-tryon-cta.ps-secondary:active {
|
|
3697
|
+
background: var(--ps-bg-secondary);
|
|
3698
|
+
}
|
|
3634
3699
|
.ps-msr-bookmark {
|
|
3635
3700
|
position: absolute; top: 10px; right: 10px;
|
|
3636
3701
|
width: 30px; height: 30px; border-radius: 7px;
|
|
@@ -4793,9 +4858,9 @@ const STYLES = `
|
|
|
4793
4858
|
.ps-pmv-actions-right { flex-wrap: wrap; }
|
|
4794
4859
|
}
|
|
4795
4860
|
|
|
4796
|
-
/* Big product image */
|
|
4861
|
+
/* Big product / try-on image */
|
|
4797
4862
|
.ps-msd-image {
|
|
4798
|
-
width: 100%; height:
|
|
4863
|
+
width: 100%; height: 420px;
|
|
4799
4864
|
border-radius: 12px; overflow: hidden;
|
|
4800
4865
|
background: var(--ps-bg-secondary);
|
|
4801
4866
|
display: flex; align-items: center; justify-content: center;
|
|
@@ -6186,6 +6251,14 @@ function CameraIcon() {
|
|
|
6186
6251
|
function BookmarkIcon() {
|
|
6187
6252
|
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ jsx("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) });
|
|
6188
6253
|
}
|
|
6254
|
+
function FitLinesIcon() {
|
|
6255
|
+
return /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6256
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
6257
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
6258
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "9", r: "2" }),
|
|
6259
|
+
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "15", r: "2" })
|
|
6260
|
+
] });
|
|
6261
|
+
}
|
|
6189
6262
|
function MultiSectionMobile({
|
|
6190
6263
|
productImage,
|
|
6191
6264
|
productTitle,
|
|
@@ -6195,6 +6268,14 @@ function MultiSectionMobile({
|
|
|
6195
6268
|
onSelectSection,
|
|
6196
6269
|
onTryOn,
|
|
6197
6270
|
tryOnProcessing,
|
|
6271
|
+
resultImageUrl,
|
|
6272
|
+
tryOnDone,
|
|
6273
|
+
onTryAgain,
|
|
6274
|
+
onClose,
|
|
6275
|
+
overlayNode,
|
|
6276
|
+
showLines,
|
|
6277
|
+
onToggleLines,
|
|
6278
|
+
onImageLoad,
|
|
6198
6279
|
t
|
|
6199
6280
|
}) {
|
|
6200
6281
|
const matchPct = useMemo(() => {
|
|
@@ -6215,13 +6296,37 @@ function MultiSectionMobile({
|
|
|
6215
6296
|
if (sizingResult?.confidence === "medium") return 84;
|
|
6216
6297
|
return 72;
|
|
6217
6298
|
}, [sizingResult]);
|
|
6299
|
+
const heroImage = resultImageUrl || productImage;
|
|
6300
|
+
const showingTryOn = !!resultImageUrl;
|
|
6218
6301
|
return /* @__PURE__ */ jsxs("div", { className: "ps-msr-root", children: [
|
|
6219
6302
|
/* @__PURE__ */ jsxs("div", { className: "ps-msr-scroll", children: [
|
|
6220
6303
|
/* @__PURE__ */ jsx("div", { className: "ps-msr-eyebrow", children: t("Sizing Profile") }),
|
|
6221
6304
|
/* @__PURE__ */ jsxs("div", { className: "ps-msr-product", children: [
|
|
6222
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
6223
|
-
/* @__PURE__ */ jsx(
|
|
6224
|
-
|
|
6305
|
+
/* @__PURE__ */ jsxs("div", { className: `ps-msr-product-img-wrap${showingTryOn ? " ps-tryon" : ""}`, children: [
|
|
6306
|
+
/* @__PURE__ */ jsx(
|
|
6307
|
+
"img",
|
|
6308
|
+
{
|
|
6309
|
+
src: heroImage,
|
|
6310
|
+
alt: productTitle,
|
|
6311
|
+
className: "ps-msr-product-img",
|
|
6312
|
+
onLoad: onImageLoad
|
|
6313
|
+
}
|
|
6314
|
+
),
|
|
6315
|
+
showLines && overlayNode,
|
|
6316
|
+
!showingTryOn && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-msr-bookmark", "aria-label": t("Save"), children: /* @__PURE__ */ jsx(BookmarkIcon, {}) }),
|
|
6317
|
+
showingTryOn && onToggleLines && /* @__PURE__ */ jsxs(
|
|
6318
|
+
"button",
|
|
6319
|
+
{
|
|
6320
|
+
type: "button",
|
|
6321
|
+
className: "ps-msr-fit-toggle",
|
|
6322
|
+
onClick: onToggleLines,
|
|
6323
|
+
"aria-pressed": !!showLines,
|
|
6324
|
+
children: [
|
|
6325
|
+
/* @__PURE__ */ jsx(FitLinesIcon, {}),
|
|
6326
|
+
showLines ? t("Hide Fit") : t("Show Fit")
|
|
6327
|
+
]
|
|
6328
|
+
}
|
|
6329
|
+
)
|
|
6225
6330
|
] }),
|
|
6226
6331
|
/* @__PURE__ */ jsx("h2", { className: "ps-msr-product-name", children: productTitle })
|
|
6227
6332
|
] }),
|
|
@@ -6270,7 +6375,26 @@ function MultiSectionMobile({
|
|
|
6270
6375
|
);
|
|
6271
6376
|
}) })
|
|
6272
6377
|
] }),
|
|
6273
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msr-bottom", children: /* @__PURE__ */ jsxs(
|
|
6378
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msr-bottom", children: tryOnDone ? /* @__PURE__ */ jsxs("div", { className: "ps-msr-bottom-row", children: [
|
|
6379
|
+
/* @__PURE__ */ jsx(
|
|
6380
|
+
"button",
|
|
6381
|
+
{
|
|
6382
|
+
type: "button",
|
|
6383
|
+
className: "ps-msr-tryon-cta ps-secondary",
|
|
6384
|
+
onClick: onTryAgain,
|
|
6385
|
+
children: t("Try Again")
|
|
6386
|
+
}
|
|
6387
|
+
),
|
|
6388
|
+
/* @__PURE__ */ jsx(
|
|
6389
|
+
"button",
|
|
6390
|
+
{
|
|
6391
|
+
type: "button",
|
|
6392
|
+
className: "ps-msr-tryon-cta",
|
|
6393
|
+
onClick: onClose,
|
|
6394
|
+
children: t("Continue Shopping")
|
|
6395
|
+
}
|
|
6396
|
+
)
|
|
6397
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
6274
6398
|
"button",
|
|
6275
6399
|
{
|
|
6276
6400
|
type: "button",
|
|
@@ -6498,7 +6622,12 @@ function SectionDetailView({
|
|
|
6498
6622
|
t,
|
|
6499
6623
|
productImage,
|
|
6500
6624
|
productTitle,
|
|
6501
|
-
isMobile: isMobileProp
|
|
6625
|
+
isMobile: isMobileProp,
|
|
6626
|
+
isTryOnImage,
|
|
6627
|
+
showLines,
|
|
6628
|
+
onToggleLines,
|
|
6629
|
+
overlayNode,
|
|
6630
|
+
onImageLoad
|
|
6502
6631
|
}) {
|
|
6503
6632
|
const recSize = sectionResult?.recommendedSize || "";
|
|
6504
6633
|
const [selectedSize, setSelectedSize] = useState(null);
|
|
@@ -6706,7 +6835,36 @@ function SectionDetailView({
|
|
|
6706
6835
|
] }),
|
|
6707
6836
|
/* @__PURE__ */ jsx("span", { className: "ps-msd-topbar-spacer" })
|
|
6708
6837
|
] }),
|
|
6709
|
-
productImage && /* @__PURE__ */
|
|
6838
|
+
productImage && /* @__PURE__ */ jsxs("div", { className: `ps-msd-image${isTryOnImage ? " ps-tryon" : ""}`, children: [
|
|
6839
|
+
/* @__PURE__ */ jsx(
|
|
6840
|
+
"img",
|
|
6841
|
+
{
|
|
6842
|
+
src: productImage,
|
|
6843
|
+
alt: productTitle || "",
|
|
6844
|
+
className: "ps-msd-image-img",
|
|
6845
|
+
onLoad: onImageLoad
|
|
6846
|
+
}
|
|
6847
|
+
),
|
|
6848
|
+
showLines && overlayNode,
|
|
6849
|
+
isTryOnImage && onToggleLines && /* @__PURE__ */ jsxs(
|
|
6850
|
+
"button",
|
|
6851
|
+
{
|
|
6852
|
+
type: "button",
|
|
6853
|
+
className: "ps-msr-fit-toggle",
|
|
6854
|
+
onClick: onToggleLines,
|
|
6855
|
+
"aria-pressed": !!showLines,
|
|
6856
|
+
children: [
|
|
6857
|
+
/* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6858
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
6859
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
6860
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "9", r: "2" }),
|
|
6861
|
+
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "15", r: "2" })
|
|
6862
|
+
] }),
|
|
6863
|
+
showLines ? t("Hide Fit") : t("Show Fit")
|
|
6864
|
+
]
|
|
6865
|
+
}
|
|
6866
|
+
)
|
|
6867
|
+
] }),
|
|
6710
6868
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card", children: [
|
|
6711
6869
|
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: displaySize === backendSize ? t("RECOMMENDED SIZE") : t("TRYING SIZE") }),
|
|
6712
6870
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card-size-row", children: [
|
|
@@ -6964,6 +7122,8 @@ function SizeResultView({
|
|
|
6964
7122
|
estimationDone = false,
|
|
6965
7123
|
activeSection,
|
|
6966
7124
|
setActiveSection,
|
|
7125
|
+
onResetTryOn,
|
|
7126
|
+
onClose,
|
|
6967
7127
|
t
|
|
6968
7128
|
}) {
|
|
6969
7129
|
const unitLbl = sizingUnit === "cm" ? t("cm") : t("in");
|
|
@@ -7253,6 +7413,34 @@ function SizeResultView({
|
|
|
7253
7413
|
productImage: resultImageUrl || productImage,
|
|
7254
7414
|
productTitle,
|
|
7255
7415
|
isMobile: true,
|
|
7416
|
+
isTryOnImage: !!resultImageUrl,
|
|
7417
|
+
showLines,
|
|
7418
|
+
onToggleLines: () => setShowLines(!showLines),
|
|
7419
|
+
onImageLoad: handleImgLoad,
|
|
7420
|
+
overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsx(
|
|
7421
|
+
MeasurementOverlay,
|
|
7422
|
+
{
|
|
7423
|
+
lines: poseLines,
|
|
7424
|
+
fitRows: (() => {
|
|
7425
|
+
const all = [...sizingResult?.matchDetails || []];
|
|
7426
|
+
if (sizingResult?.sections) {
|
|
7427
|
+
for (const sec of Object.values(sizingResult.sections)) {
|
|
7428
|
+
if (sec.matchDetails) all.push(...sec.matchDetails);
|
|
7429
|
+
}
|
|
7430
|
+
}
|
|
7431
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7432
|
+
return all.filter((m) => {
|
|
7433
|
+
const k = m.measurement.toLowerCase();
|
|
7434
|
+
if (seen.has(k)) return false;
|
|
7435
|
+
seen.add(k);
|
|
7436
|
+
return true;
|
|
7437
|
+
}).map((m) => ({ area: m.measurement, userNum: parseFloat(m.userValue) || 0, chartLabel: m.chartRange || "", fit: m.fit }));
|
|
7438
|
+
})(),
|
|
7439
|
+
show: showLines,
|
|
7440
|
+
imgWidth: imgDims.w,
|
|
7441
|
+
imgHeight: imgDims.h
|
|
7442
|
+
}
|
|
7443
|
+
) : null,
|
|
7256
7444
|
t
|
|
7257
7445
|
}
|
|
7258
7446
|
);
|
|
@@ -7290,6 +7478,41 @@ function SizeResultView({
|
|
|
7290
7478
|
setShowPhotoGuide(true);
|
|
7291
7479
|
},
|
|
7292
7480
|
tryOnProcessing,
|
|
7481
|
+
resultImageUrl,
|
|
7482
|
+
tryOnDone: !!resultImageUrl && !tryOnProcessing,
|
|
7483
|
+
onTryAgain: () => {
|
|
7484
|
+
onResetTryOn?.();
|
|
7485
|
+
setGuideFile(null);
|
|
7486
|
+
setShowPhotoGuide(true);
|
|
7487
|
+
},
|
|
7488
|
+
onClose,
|
|
7489
|
+
showLines,
|
|
7490
|
+
onToggleLines: () => setShowLines(!showLines),
|
|
7491
|
+
onImageLoad: handleImgLoad,
|
|
7492
|
+
overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsx(
|
|
7493
|
+
MeasurementOverlay,
|
|
7494
|
+
{
|
|
7495
|
+
lines: poseLines,
|
|
7496
|
+
fitRows: (() => {
|
|
7497
|
+
const all = [...sizingResult?.matchDetails || []];
|
|
7498
|
+
if (sizingResult?.sections) {
|
|
7499
|
+
for (const sec of Object.values(sizingResult.sections)) {
|
|
7500
|
+
if (sec.matchDetails) all.push(...sec.matchDetails);
|
|
7501
|
+
}
|
|
7502
|
+
}
|
|
7503
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7504
|
+
return all.filter((m) => {
|
|
7505
|
+
const k = m.measurement.toLowerCase();
|
|
7506
|
+
if (seen.has(k)) return false;
|
|
7507
|
+
seen.add(k);
|
|
7508
|
+
return true;
|
|
7509
|
+
}).map((m) => ({ area: m.measurement, userNum: parseFloat(m.userValue) || 0, chartLabel: m.chartRange || "", fit: m.fit }));
|
|
7510
|
+
})(),
|
|
7511
|
+
show: showLines,
|
|
7512
|
+
imgWidth: imgDims.w,
|
|
7513
|
+
imgHeight: imgDims.h
|
|
7514
|
+
}
|
|
7515
|
+
) : null,
|
|
7293
7516
|
t
|
|
7294
7517
|
}
|
|
7295
7518
|
)
|
|
@@ -8575,25 +8798,6 @@ function CreateProfileCard({ onClick, t }) {
|
|
|
8575
8798
|
/* @__PURE__ */ jsx("div", { className: "ps-msp-create-sub", children: t("ADD MEASUREMENTS & PHOTO") })
|
|
8576
8799
|
] });
|
|
8577
8800
|
}
|
|
8578
|
-
function SizeHistoryCard({ entry, profileName, t }) {
|
|
8579
|
-
const date = new Date(entry.savedAt).toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
8580
|
-
return /* @__PURE__ */ jsxs("div", { className: "ps-msp-history-card", children: [
|
|
8581
|
-
entry.productImage && /* @__PURE__ */ jsx("div", { className: "ps-msp-history-thumb", children: /* @__PURE__ */ jsx("img", { src: entry.productImage, alt: entry.productTitle }) }),
|
|
8582
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-info", children: [
|
|
8583
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msp-history-name", children: entry.productTitle }),
|
|
8584
|
-
profileName && /* @__PURE__ */ jsx("div", { className: "ps-msp-history-profile", children: profileName }),
|
|
8585
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-meta", children: [
|
|
8586
|
-
/* @__PURE__ */ jsx(ClockIcon, { size: 11 }),
|
|
8587
|
-
" ",
|
|
8588
|
-
date
|
|
8589
|
-
] })
|
|
8590
|
-
] }),
|
|
8591
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-size", children: [
|
|
8592
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msp-history-size-label", children: t("SIZE") }),
|
|
8593
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msp-history-size-value", children: entry.recommendedSize })
|
|
8594
|
-
] })
|
|
8595
|
-
] });
|
|
8596
|
-
}
|
|
8597
8801
|
function MySizingProfilesView({
|
|
8598
8802
|
profiles,
|
|
8599
8803
|
activeProfileId,
|
|
@@ -8608,15 +8812,6 @@ function MySizingProfilesView({
|
|
|
8608
8812
|
const [creating, setCreating] = useState(false);
|
|
8609
8813
|
const [viewingId, setViewingId] = useState(null);
|
|
8610
8814
|
const viewingProfile = viewingId ? profiles.find((p) => p.id === viewingId) || null : null;
|
|
8611
|
-
const allHistory = useMemo(() => {
|
|
8612
|
-
const items = [];
|
|
8613
|
-
for (const p of profiles) {
|
|
8614
|
-
for (const h of p.sizeHistory || []) {
|
|
8615
|
-
items.push({ entry: h, profileName: p.name });
|
|
8616
|
-
}
|
|
8617
|
-
}
|
|
8618
|
-
return items.sort((a, b) => b.entry.savedAt - a.entry.savedAt).slice(0, 12);
|
|
8619
|
-
}, [profiles]);
|
|
8620
8815
|
const handleSaveNewProfile = (data) => {
|
|
8621
8816
|
onSaveNewProfile(data);
|
|
8622
8817
|
setCreating(false);
|
|
@@ -8687,10 +8882,6 @@ function MySizingProfilesView({
|
|
|
8687
8882
|
},
|
|
8688
8883
|
p.id
|
|
8689
8884
|
))
|
|
8690
|
-
] }),
|
|
8691
|
-
allHistory.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ps-msp-history-section", children: [
|
|
8692
|
-
/* @__PURE__ */ jsx("h3", { className: "ps-msp-history-title", children: t("Recent Size Calculations") }),
|
|
8693
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msp-history-list", children: allHistory.map(({ entry, profileName }) => /* @__PURE__ */ jsx(SizeHistoryCard, { entry, profileName, t }, `${entry.productId}-${entry.savedAt}`)) })
|
|
8694
8885
|
] })
|
|
8695
8886
|
] }) }) });
|
|
8696
8887
|
}
|
|
@@ -8739,6 +8930,8 @@ function BasicsStepMobile({
|
|
|
8739
8930
|
onNext,
|
|
8740
8931
|
canProceed,
|
|
8741
8932
|
fastPathLabel,
|
|
8933
|
+
activeProfileName,
|
|
8934
|
+
onStartFresh,
|
|
8742
8935
|
error,
|
|
8743
8936
|
t
|
|
8744
8937
|
}) {
|
|
@@ -8775,6 +8968,14 @@ function BasicsStepMobile({
|
|
|
8775
8968
|
const incAge = () => setAge(String(Math.min(ageMax, ageNum + 1)));
|
|
8776
8969
|
const decAge = () => setAge(String(Math.max(ageMin, ageNum - 1)));
|
|
8777
8970
|
return /* @__PURE__ */ jsxs("div", { className: "ps-bpm-root", children: [
|
|
8971
|
+
activeProfileName && /* @__PURE__ */ jsxs("div", { className: "ps-bp-profile-loaded", children: [
|
|
8972
|
+
/* @__PURE__ */ jsxs("span", { className: "ps-bp-profile-loaded-label", children: [
|
|
8973
|
+
t("Profile loaded"),
|
|
8974
|
+
": ",
|
|
8975
|
+
/* @__PURE__ */ jsx("strong", { children: activeProfileName })
|
|
8976
|
+
] }),
|
|
8977
|
+
onStartFresh && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-bp-profile-loaded-link", onClick: onStartFresh, children: t("Start fresh AI sizing") })
|
|
8978
|
+
] }),
|
|
8778
8979
|
/* @__PURE__ */ jsxs("div", { className: "ps-bpm-header", children: [
|
|
8779
8980
|
/* @__PURE__ */ jsx("h2", { className: "ps-bpm-title", children: t("Let's find your best fit") }),
|
|
8780
8981
|
/* @__PURE__ */ jsx("p", { className: "ps-bpm-subtitle", children: t("Enter your details for a bespoke size recommendation") })
|
|
@@ -9187,6 +9388,8 @@ function BodyProfileView({
|
|
|
9187
9388
|
onSnapSubmit,
|
|
9188
9389
|
hasActiveProfileWithMeasurements = false,
|
|
9189
9390
|
onUseActiveProfile,
|
|
9391
|
+
activeProfileName,
|
|
9392
|
+
onStartFresh,
|
|
9190
9393
|
onBack,
|
|
9191
9394
|
t
|
|
9192
9395
|
}) {
|
|
@@ -9601,6 +9804,8 @@ function BodyProfileView({
|
|
|
9601
9804
|
onNext: hasActiveProfileWithMeasurements && onUseActiveProfile ? onUseActiveProfile : handleNext,
|
|
9602
9805
|
canProceed: true,
|
|
9603
9806
|
fastPathLabel: hasActiveProfileWithMeasurements ? t("Find My Best Fit") : void 0,
|
|
9807
|
+
activeProfileName: hasActiveProfileWithMeasurements ? activeProfileName : null,
|
|
9808
|
+
onStartFresh,
|
|
9604
9809
|
error,
|
|
9605
9810
|
t
|
|
9606
9811
|
},
|
|
@@ -9608,6 +9813,14 @@ function BodyProfileView({
|
|
|
9608
9813
|
);
|
|
9609
9814
|
}
|
|
9610
9815
|
return /* @__PURE__ */ jsxs("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
9816
|
+
hasActiveProfileWithMeasurements && activeProfileName && /* @__PURE__ */ jsxs("div", { className: "ps-bp-profile-loaded", children: [
|
|
9817
|
+
/* @__PURE__ */ jsxs("span", { className: "ps-bp-profile-loaded-label", children: [
|
|
9818
|
+
t("Profile loaded"),
|
|
9819
|
+
": ",
|
|
9820
|
+
/* @__PURE__ */ jsx("strong", { children: activeProfileName })
|
|
9821
|
+
] }),
|
|
9822
|
+
onStartFresh && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-bp-profile-loaded-link", onClick: onStartFresh, children: t("Start fresh AI sizing") })
|
|
9823
|
+
] }),
|
|
9611
9824
|
/* @__PURE__ */ jsx("h2", { className: "ps-bp-title", children: t("Let's find your best fit") }),
|
|
9612
9825
|
/* @__PURE__ */ jsxs("div", { className: "ps-bp-system-toggle", children: [
|
|
9613
9826
|
/* @__PURE__ */ jsx("button", { className: `ps-bp-system-btn${!isImperialMode ? " ps-bp-system-active" : ""}`, onClick: switchToMetric, type: "button", children: t("Metric") }),
|
|
@@ -10993,6 +11206,14 @@ function PrimeStyleTryonInner({
|
|
|
10993
11206
|
return !!(p && p.measurements && Object.keys(p.measurements).length > 0);
|
|
10994
11207
|
})(),
|
|
10995
11208
|
onUseActiveProfile: handleUseActiveProfile,
|
|
11209
|
+
activeProfileName: (() => {
|
|
11210
|
+
const p = profiles.find((x) => x.id === activeProfileId);
|
|
11211
|
+
return p?.name || null;
|
|
11212
|
+
})(),
|
|
11213
|
+
onStartFresh: () => {
|
|
11214
|
+
setActiveProfileId$1(null);
|
|
11215
|
+
formRef.current = {};
|
|
11216
|
+
},
|
|
10996
11217
|
onComplete: (data) => {
|
|
10997
11218
|
formRef.current.gender = data.gender;
|
|
10998
11219
|
if (data.bandSize) formRef.current.bandSize = data.bandSize;
|
|
@@ -11065,6 +11286,13 @@ function PrimeStyleTryonInner({
|
|
|
11065
11286
|
bodyLandmarks,
|
|
11066
11287
|
activeSection,
|
|
11067
11288
|
setActiveSection,
|
|
11289
|
+
onResetTryOn: () => {
|
|
11290
|
+
setSelectedFile(null);
|
|
11291
|
+
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
|
11292
|
+
setPreviewUrl(null);
|
|
11293
|
+
setResultImageUrl(null);
|
|
11294
|
+
},
|
|
11295
|
+
onClose: handleClose,
|
|
11068
11296
|
t
|
|
11069
11297
|
}
|
|
11070
11298
|
) }, "v-sizeresult");
|