@primestyleai/tryon 5.6.13 → 5.6.15
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
CHANGED
|
@@ -3337,7 +3337,8 @@ const STYLES = `
|
|
|
3337
3337
|
object-fit: contain; display: block;
|
|
3338
3338
|
}
|
|
3339
3339
|
.ps-pm-preview-empty {
|
|
3340
|
-
display: flex; flex-direction: column;
|
|
3340
|
+
display: flex; flex-direction: column;
|
|
3341
|
+
align-items: center; justify-content: center;
|
|
3341
3342
|
gap: 6px; padding: 24px;
|
|
3342
3343
|
background: none; border: none;
|
|
3343
3344
|
color: var(--ps-text-muted); cursor: pointer;
|
|
@@ -3621,16 +3622,53 @@ const STYLES = `
|
|
|
3621
3622
|
}
|
|
3622
3623
|
.ps-msr-product-img-wrap {
|
|
3623
3624
|
position: relative; flex-shrink: 0;
|
|
3624
|
-
width:
|
|
3625
|
+
width: 100%; max-width: 360px; height: 420px;
|
|
3625
3626
|
border-radius: 12px; overflow: hidden;
|
|
3626
3627
|
background: var(--ps-bg-secondary);
|
|
3627
3628
|
display: flex; align-items: center; justify-content: center;
|
|
3628
3629
|
}
|
|
3630
|
+
/* When showing the try-on result, give it a touch more presence */
|
|
3631
|
+
.ps-msr-product-img-wrap.ps-tryon {
|
|
3632
|
+
background: #0F0F10;
|
|
3633
|
+
}
|
|
3629
3634
|
.ps-msr-product-img {
|
|
3630
3635
|
max-width: 100%; max-height: 100%;
|
|
3631
3636
|
width: auto; height: 100%;
|
|
3632
3637
|
object-fit: contain; display: block;
|
|
3633
3638
|
}
|
|
3639
|
+
/* Show-Fit / mediapipe overlay toggle pill — bottom-left of try-on hero */
|
|
3640
|
+
.ps-msr-fit-toggle {
|
|
3641
|
+
position: absolute; bottom: 10px; left: 10px;
|
|
3642
|
+
display: flex; align-items: center; gap: 6px;
|
|
3643
|
+
padding: 8px 12px;
|
|
3644
|
+
background: rgba(255,255,255,0.92);
|
|
3645
|
+
color: var(--ps-text-primary);
|
|
3646
|
+
border: none; border-radius: 999px;
|
|
3647
|
+
font-family: inherit; font-size: 11px; font-weight: 700;
|
|
3648
|
+
letter-spacing: 0.04em;
|
|
3649
|
+
cursor: pointer;
|
|
3650
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
|
|
3651
|
+
backdrop-filter: blur(6px);
|
|
3652
|
+
-webkit-backdrop-filter: blur(6px);
|
|
3653
|
+
z-index: 2;
|
|
3654
|
+
}
|
|
3655
|
+
.ps-msr-fit-toggle:active { transform: scale(0.97); }
|
|
3656
|
+
.ps-msr-fit-toggle[aria-pressed="true"] {
|
|
3657
|
+
background: var(--ps-accent); color: #FFFFFF;
|
|
3658
|
+
}
|
|
3659
|
+
/* Bottom action row when try-on finished — Try Again + Continue Shopping */
|
|
3660
|
+
.ps-msr-bottom-row {
|
|
3661
|
+
display: flex; gap: 10px; align-items: stretch;
|
|
3662
|
+
}
|
|
3663
|
+
.ps-msr-bottom-row .ps-msr-tryon-cta { flex: 1; }
|
|
3664
|
+
.ps-msr-tryon-cta.ps-secondary {
|
|
3665
|
+
background: transparent;
|
|
3666
|
+
color: var(--ps-text-primary);
|
|
3667
|
+
border: 1.5px solid var(--ps-border-color);
|
|
3668
|
+
}
|
|
3669
|
+
.ps-msr-tryon-cta.ps-secondary:active {
|
|
3670
|
+
background: var(--ps-bg-secondary);
|
|
3671
|
+
}
|
|
3634
3672
|
.ps-msr-bookmark {
|
|
3635
3673
|
position: absolute; top: 10px; right: 10px;
|
|
3636
3674
|
width: 30px; height: 30px; border-radius: 7px;
|
|
@@ -4793,9 +4831,9 @@ const STYLES = `
|
|
|
4793
4831
|
.ps-pmv-actions-right { flex-wrap: wrap; }
|
|
4794
4832
|
}
|
|
4795
4833
|
|
|
4796
|
-
/* Big product image */
|
|
4834
|
+
/* Big product / try-on image */
|
|
4797
4835
|
.ps-msd-image {
|
|
4798
|
-
width: 100%; height:
|
|
4836
|
+
width: 100%; height: 420px;
|
|
4799
4837
|
border-radius: 12px; overflow: hidden;
|
|
4800
4838
|
background: var(--ps-bg-secondary);
|
|
4801
4839
|
display: flex; align-items: center; justify-content: center;
|
|
@@ -6186,6 +6224,14 @@ function CameraIcon() {
|
|
|
6186
6224
|
function BookmarkIcon() {
|
|
6187
6225
|
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
6226
|
}
|
|
6227
|
+
function FitLinesIcon() {
|
|
6228
|
+
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: [
|
|
6229
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
6230
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
6231
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "9", r: "2" }),
|
|
6232
|
+
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "15", r: "2" })
|
|
6233
|
+
] });
|
|
6234
|
+
}
|
|
6189
6235
|
function MultiSectionMobile({
|
|
6190
6236
|
productImage,
|
|
6191
6237
|
productTitle,
|
|
@@ -6195,6 +6241,14 @@ function MultiSectionMobile({
|
|
|
6195
6241
|
onSelectSection,
|
|
6196
6242
|
onTryOn,
|
|
6197
6243
|
tryOnProcessing,
|
|
6244
|
+
resultImageUrl,
|
|
6245
|
+
tryOnDone,
|
|
6246
|
+
onTryAgain,
|
|
6247
|
+
onClose,
|
|
6248
|
+
overlayNode,
|
|
6249
|
+
showLines,
|
|
6250
|
+
onToggleLines,
|
|
6251
|
+
onImageLoad,
|
|
6198
6252
|
t
|
|
6199
6253
|
}) {
|
|
6200
6254
|
const matchPct = useMemo(() => {
|
|
@@ -6215,13 +6269,37 @@ function MultiSectionMobile({
|
|
|
6215
6269
|
if (sizingResult?.confidence === "medium") return 84;
|
|
6216
6270
|
return 72;
|
|
6217
6271
|
}, [sizingResult]);
|
|
6272
|
+
const heroImage = resultImageUrl || productImage;
|
|
6273
|
+
const showingTryOn = !!resultImageUrl;
|
|
6218
6274
|
return /* @__PURE__ */ jsxs("div", { className: "ps-msr-root", children: [
|
|
6219
6275
|
/* @__PURE__ */ jsxs("div", { className: "ps-msr-scroll", children: [
|
|
6220
6276
|
/* @__PURE__ */ jsx("div", { className: "ps-msr-eyebrow", children: t("Sizing Profile") }),
|
|
6221
6277
|
/* @__PURE__ */ jsxs("div", { className: "ps-msr-product", children: [
|
|
6222
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
6223
|
-
/* @__PURE__ */ jsx(
|
|
6224
|
-
|
|
6278
|
+
/* @__PURE__ */ jsxs("div", { className: `ps-msr-product-img-wrap${showingTryOn ? " ps-tryon" : ""}`, children: [
|
|
6279
|
+
/* @__PURE__ */ jsx(
|
|
6280
|
+
"img",
|
|
6281
|
+
{
|
|
6282
|
+
src: heroImage,
|
|
6283
|
+
alt: productTitle,
|
|
6284
|
+
className: "ps-msr-product-img",
|
|
6285
|
+
onLoad: onImageLoad
|
|
6286
|
+
}
|
|
6287
|
+
),
|
|
6288
|
+
showLines && overlayNode,
|
|
6289
|
+
!showingTryOn && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-msr-bookmark", "aria-label": t("Save"), children: /* @__PURE__ */ jsx(BookmarkIcon, {}) }),
|
|
6290
|
+
showingTryOn && onToggleLines && /* @__PURE__ */ jsxs(
|
|
6291
|
+
"button",
|
|
6292
|
+
{
|
|
6293
|
+
type: "button",
|
|
6294
|
+
className: "ps-msr-fit-toggle",
|
|
6295
|
+
onClick: onToggleLines,
|
|
6296
|
+
"aria-pressed": !!showLines,
|
|
6297
|
+
children: [
|
|
6298
|
+
/* @__PURE__ */ jsx(FitLinesIcon, {}),
|
|
6299
|
+
showLines ? t("Hide Fit") : t("Show Fit")
|
|
6300
|
+
]
|
|
6301
|
+
}
|
|
6302
|
+
)
|
|
6225
6303
|
] }),
|
|
6226
6304
|
/* @__PURE__ */ jsx("h2", { className: "ps-msr-product-name", children: productTitle })
|
|
6227
6305
|
] }),
|
|
@@ -6270,7 +6348,26 @@ function MultiSectionMobile({
|
|
|
6270
6348
|
);
|
|
6271
6349
|
}) })
|
|
6272
6350
|
] }),
|
|
6273
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msr-bottom", children: /* @__PURE__ */ jsxs(
|
|
6351
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msr-bottom", children: tryOnDone ? /* @__PURE__ */ jsxs("div", { className: "ps-msr-bottom-row", children: [
|
|
6352
|
+
/* @__PURE__ */ jsx(
|
|
6353
|
+
"button",
|
|
6354
|
+
{
|
|
6355
|
+
type: "button",
|
|
6356
|
+
className: "ps-msr-tryon-cta ps-secondary",
|
|
6357
|
+
onClick: onTryAgain,
|
|
6358
|
+
children: t("Try Again")
|
|
6359
|
+
}
|
|
6360
|
+
),
|
|
6361
|
+
/* @__PURE__ */ jsx(
|
|
6362
|
+
"button",
|
|
6363
|
+
{
|
|
6364
|
+
type: "button",
|
|
6365
|
+
className: "ps-msr-tryon-cta",
|
|
6366
|
+
onClick: onClose,
|
|
6367
|
+
children: t("Continue Shopping")
|
|
6368
|
+
}
|
|
6369
|
+
)
|
|
6370
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
6274
6371
|
"button",
|
|
6275
6372
|
{
|
|
6276
6373
|
type: "button",
|
|
@@ -6498,7 +6595,12 @@ function SectionDetailView({
|
|
|
6498
6595
|
t,
|
|
6499
6596
|
productImage,
|
|
6500
6597
|
productTitle,
|
|
6501
|
-
isMobile: isMobileProp
|
|
6598
|
+
isMobile: isMobileProp,
|
|
6599
|
+
isTryOnImage,
|
|
6600
|
+
showLines,
|
|
6601
|
+
onToggleLines,
|
|
6602
|
+
overlayNode,
|
|
6603
|
+
onImageLoad
|
|
6502
6604
|
}) {
|
|
6503
6605
|
const recSize = sectionResult?.recommendedSize || "";
|
|
6504
6606
|
const [selectedSize, setSelectedSize] = useState(null);
|
|
@@ -6706,7 +6808,36 @@ function SectionDetailView({
|
|
|
6706
6808
|
] }),
|
|
6707
6809
|
/* @__PURE__ */ jsx("span", { className: "ps-msd-topbar-spacer" })
|
|
6708
6810
|
] }),
|
|
6709
|
-
productImage && /* @__PURE__ */
|
|
6811
|
+
productImage && /* @__PURE__ */ jsxs("div", { className: `ps-msd-image${isTryOnImage ? " ps-tryon" : ""}`, children: [
|
|
6812
|
+
/* @__PURE__ */ jsx(
|
|
6813
|
+
"img",
|
|
6814
|
+
{
|
|
6815
|
+
src: productImage,
|
|
6816
|
+
alt: productTitle || "",
|
|
6817
|
+
className: "ps-msd-image-img",
|
|
6818
|
+
onLoad: onImageLoad
|
|
6819
|
+
}
|
|
6820
|
+
),
|
|
6821
|
+
showLines && overlayNode,
|
|
6822
|
+
isTryOnImage && onToggleLines && /* @__PURE__ */ jsxs(
|
|
6823
|
+
"button",
|
|
6824
|
+
{
|
|
6825
|
+
type: "button",
|
|
6826
|
+
className: "ps-msr-fit-toggle",
|
|
6827
|
+
onClick: onToggleLines,
|
|
6828
|
+
"aria-pressed": !!showLines,
|
|
6829
|
+
children: [
|
|
6830
|
+
/* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6831
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
6832
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
6833
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "9", r: "2" }),
|
|
6834
|
+
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "15", r: "2" })
|
|
6835
|
+
] }),
|
|
6836
|
+
showLines ? t("Hide Fit") : t("Show Fit")
|
|
6837
|
+
]
|
|
6838
|
+
}
|
|
6839
|
+
)
|
|
6840
|
+
] }),
|
|
6710
6841
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card", children: [
|
|
6711
6842
|
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: displaySize === backendSize ? t("RECOMMENDED SIZE") : t("TRYING SIZE") }),
|
|
6712
6843
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card-size-row", children: [
|
|
@@ -6964,6 +7095,8 @@ function SizeResultView({
|
|
|
6964
7095
|
estimationDone = false,
|
|
6965
7096
|
activeSection,
|
|
6966
7097
|
setActiveSection,
|
|
7098
|
+
onResetTryOn,
|
|
7099
|
+
onClose,
|
|
6967
7100
|
t
|
|
6968
7101
|
}) {
|
|
6969
7102
|
const unitLbl = sizingUnit === "cm" ? t("cm") : t("in");
|
|
@@ -7253,6 +7386,34 @@ function SizeResultView({
|
|
|
7253
7386
|
productImage: resultImageUrl || productImage,
|
|
7254
7387
|
productTitle,
|
|
7255
7388
|
isMobile: true,
|
|
7389
|
+
isTryOnImage: !!resultImageUrl,
|
|
7390
|
+
showLines,
|
|
7391
|
+
onToggleLines: () => setShowLines(!showLines),
|
|
7392
|
+
onImageLoad: handleImgLoad,
|
|
7393
|
+
overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsx(
|
|
7394
|
+
MeasurementOverlay,
|
|
7395
|
+
{
|
|
7396
|
+
lines: poseLines,
|
|
7397
|
+
fitRows: (() => {
|
|
7398
|
+
const all = [...sizingResult?.matchDetails || []];
|
|
7399
|
+
if (sizingResult?.sections) {
|
|
7400
|
+
for (const sec of Object.values(sizingResult.sections)) {
|
|
7401
|
+
if (sec.matchDetails) all.push(...sec.matchDetails);
|
|
7402
|
+
}
|
|
7403
|
+
}
|
|
7404
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7405
|
+
return all.filter((m) => {
|
|
7406
|
+
const k = m.measurement.toLowerCase();
|
|
7407
|
+
if (seen.has(k)) return false;
|
|
7408
|
+
seen.add(k);
|
|
7409
|
+
return true;
|
|
7410
|
+
}).map((m) => ({ area: m.measurement, userNum: parseFloat(m.userValue) || 0, chartLabel: m.chartRange || "", fit: m.fit }));
|
|
7411
|
+
})(),
|
|
7412
|
+
show: showLines,
|
|
7413
|
+
imgWidth: imgDims.w,
|
|
7414
|
+
imgHeight: imgDims.h
|
|
7415
|
+
}
|
|
7416
|
+
) : null,
|
|
7256
7417
|
t
|
|
7257
7418
|
}
|
|
7258
7419
|
);
|
|
@@ -7290,6 +7451,41 @@ function SizeResultView({
|
|
|
7290
7451
|
setShowPhotoGuide(true);
|
|
7291
7452
|
},
|
|
7292
7453
|
tryOnProcessing,
|
|
7454
|
+
resultImageUrl,
|
|
7455
|
+
tryOnDone: !!resultImageUrl && !tryOnProcessing,
|
|
7456
|
+
onTryAgain: () => {
|
|
7457
|
+
onResetTryOn?.();
|
|
7458
|
+
setGuideFile(null);
|
|
7459
|
+
setShowPhotoGuide(true);
|
|
7460
|
+
},
|
|
7461
|
+
onClose,
|
|
7462
|
+
showLines,
|
|
7463
|
+
onToggleLines: () => setShowLines(!showLines),
|
|
7464
|
+
onImageLoad: handleImgLoad,
|
|
7465
|
+
overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsx(
|
|
7466
|
+
MeasurementOverlay,
|
|
7467
|
+
{
|
|
7468
|
+
lines: poseLines,
|
|
7469
|
+
fitRows: (() => {
|
|
7470
|
+
const all = [...sizingResult?.matchDetails || []];
|
|
7471
|
+
if (sizingResult?.sections) {
|
|
7472
|
+
for (const sec of Object.values(sizingResult.sections)) {
|
|
7473
|
+
if (sec.matchDetails) all.push(...sec.matchDetails);
|
|
7474
|
+
}
|
|
7475
|
+
}
|
|
7476
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7477
|
+
return all.filter((m) => {
|
|
7478
|
+
const k = m.measurement.toLowerCase();
|
|
7479
|
+
if (seen.has(k)) return false;
|
|
7480
|
+
seen.add(k);
|
|
7481
|
+
return true;
|
|
7482
|
+
}).map((m) => ({ area: m.measurement, userNum: parseFloat(m.userValue) || 0, chartLabel: m.chartRange || "", fit: m.fit }));
|
|
7483
|
+
})(),
|
|
7484
|
+
show: showLines,
|
|
7485
|
+
imgWidth: imgDims.w,
|
|
7486
|
+
imgHeight: imgDims.h
|
|
7487
|
+
}
|
|
7488
|
+
) : null,
|
|
7293
7489
|
t
|
|
7294
7490
|
}
|
|
7295
7491
|
)
|
|
@@ -7551,7 +7747,112 @@ function SizeResultView({
|
|
|
7551
7747
|
] })
|
|
7552
7748
|
] })
|
|
7553
7749
|
),
|
|
7554
|
-
showPhotoGuide && /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-chart-overlay", children:
|
|
7750
|
+
showPhotoGuide && /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-chart-overlay", children: isMobile ? (
|
|
7751
|
+
/* ── Mobile: same layout as the AI-sizing photo step
|
|
7752
|
+
(PhotoStepMobile) — title + subtitle, large preview,
|
|
7753
|
+
checklist card, primary CTA + RETAKE secondary. ── */
|
|
7754
|
+
/* @__PURE__ */ jsx("div", { className: "ps-bp-wrapper", style: { padding: "16px 16px 0", background: "var(--ps-bg-primary)" }, children: /* @__PURE__ */ jsxs("div", { className: "ps-pm-root", children: [
|
|
7755
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pm-header", children: [
|
|
7756
|
+
/* @__PURE__ */ jsx("h2", { className: "ps-pm-title", children: t("Review your photo") }),
|
|
7757
|
+
/* @__PURE__ */ jsx("p", { className: "ps-pm-subtitle", children: t("Ensure your full body is visible for the most accurate virtual try-on.") })
|
|
7758
|
+
] }),
|
|
7759
|
+
/* @__PURE__ */ jsx(
|
|
7760
|
+
"input",
|
|
7761
|
+
{
|
|
7762
|
+
ref: guideInputRef,
|
|
7763
|
+
type: "file",
|
|
7764
|
+
accept: "image/jpeg,image/png,image/webp",
|
|
7765
|
+
style: { display: "none" },
|
|
7766
|
+
onChange: (e) => {
|
|
7767
|
+
const f = e.target.files?.[0];
|
|
7768
|
+
if (f) setGuideFile(f);
|
|
7769
|
+
}
|
|
7770
|
+
}
|
|
7771
|
+
),
|
|
7772
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pm-preview", children: guideFile && guidePreviewUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7773
|
+
/* @__PURE__ */ jsx("img", { src: guidePreviewUrl, alt: t("Your photo"), className: "ps-pm-preview-img" }),
|
|
7774
|
+
/* @__PURE__ */ jsx(
|
|
7775
|
+
"button",
|
|
7776
|
+
{
|
|
7777
|
+
type: "button",
|
|
7778
|
+
className: "ps-pm-preview-remove",
|
|
7779
|
+
onClick: () => setGuideFile(null),
|
|
7780
|
+
"aria-label": t("Remove photo"),
|
|
7781
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
7782
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
7783
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
7784
|
+
] })
|
|
7785
|
+
}
|
|
7786
|
+
)
|
|
7787
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
7788
|
+
"button",
|
|
7789
|
+
{
|
|
7790
|
+
type: "button",
|
|
7791
|
+
className: "ps-pm-preview-empty",
|
|
7792
|
+
onClick: () => guideInputRef.current?.click(),
|
|
7793
|
+
children: [
|
|
7794
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "32", height: "32", children: [
|
|
7795
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
7796
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
|
|
7797
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
|
|
7798
|
+
] }),
|
|
7799
|
+
/* @__PURE__ */ jsx("span", { className: "ps-pm-preview-empty-title", children: t("Tap to upload") }),
|
|
7800
|
+
/* @__PURE__ */ jsx("span", { className: "ps-pm-preview-empty-hint", children: t("JPEG, PNG up to 10MB") })
|
|
7801
|
+
]
|
|
7802
|
+
}
|
|
7803
|
+
) }),
|
|
7804
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pm-checklist", children: [
|
|
7805
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }) }),
|
|
7806
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pm-checklist-body", children: [
|
|
7807
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pm-checklist-title", children: t("Checklist for accuracy") }),
|
|
7808
|
+
/* @__PURE__ */ jsxs("ul", { className: "ps-pm-checklist-items", children: [
|
|
7809
|
+
/* @__PURE__ */ jsx("li", { children: t("Form-fitting clothing is recommended") }),
|
|
7810
|
+
/* @__PURE__ */ jsx("li", { children: t("Standing 2-3 meters from camera") }),
|
|
7811
|
+
/* @__PURE__ */ jsx("li", { children: t("Neutral background with good lighting") })
|
|
7812
|
+
] })
|
|
7813
|
+
] })
|
|
7814
|
+
] }),
|
|
7815
|
+
/* @__PURE__ */ jsx("div", { className: "ps-bpm-spacer" }),
|
|
7816
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-bpm-bottom", children: [
|
|
7817
|
+
/* @__PURE__ */ jsx(
|
|
7818
|
+
"button",
|
|
7819
|
+
{
|
|
7820
|
+
type: "button",
|
|
7821
|
+
className: "ps-pm-primary-btn",
|
|
7822
|
+
disabled: !guideFile,
|
|
7823
|
+
onClick: () => {
|
|
7824
|
+
if (!guideFile) return;
|
|
7825
|
+
handleFileSelect(guideFile);
|
|
7826
|
+
handleTryOnSubmit();
|
|
7827
|
+
setShowPhotoGuide(false);
|
|
7828
|
+
setGuideFile(null);
|
|
7829
|
+
},
|
|
7830
|
+
children: t("START TRY-ON")
|
|
7831
|
+
}
|
|
7832
|
+
),
|
|
7833
|
+
guideFile ? /* @__PURE__ */ jsx(
|
|
7834
|
+
"button",
|
|
7835
|
+
{
|
|
7836
|
+
type: "button",
|
|
7837
|
+
className: "ps-pm-secondary-btn",
|
|
7838
|
+
onClick: () => guideInputRef.current?.click(),
|
|
7839
|
+
children: t("RETAKE PHOTO")
|
|
7840
|
+
}
|
|
7841
|
+
) : /* @__PURE__ */ jsx(
|
|
7842
|
+
"button",
|
|
7843
|
+
{
|
|
7844
|
+
type: "button",
|
|
7845
|
+
className: "ps-pm-secondary-btn",
|
|
7846
|
+
onClick: () => {
|
|
7847
|
+
setShowPhotoGuide(false);
|
|
7848
|
+
setGuideFile(null);
|
|
7849
|
+
},
|
|
7850
|
+
children: t("BACK")
|
|
7851
|
+
}
|
|
7852
|
+
)
|
|
7853
|
+
] })
|
|
7854
|
+
] }) })
|
|
7855
|
+
) : /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "1.5vw", width: "100%", height: "100%", background: "var(--ps-bg-primary)", borderRadius: "0.8vw", overflow: "hidden" }, children: [
|
|
7555
7856
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "1.2vw", flex: 1, alignItems: "stretch", minHeight: 0, overflow: "hidden" }, children: [
|
|
7556
7857
|
/* @__PURE__ */ jsxs(
|
|
7557
7858
|
"div",
|
|
@@ -8470,25 +8771,6 @@ function CreateProfileCard({ onClick, t }) {
|
|
|
8470
8771
|
/* @__PURE__ */ jsx("div", { className: "ps-msp-create-sub", children: t("ADD MEASUREMENTS & PHOTO") })
|
|
8471
8772
|
] });
|
|
8472
8773
|
}
|
|
8473
|
-
function SizeHistoryCard({ entry, profileName, t }) {
|
|
8474
|
-
const date = new Date(entry.savedAt).toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
8475
|
-
return /* @__PURE__ */ jsxs("div", { className: "ps-msp-history-card", children: [
|
|
8476
|
-
entry.productImage && /* @__PURE__ */ jsx("div", { className: "ps-msp-history-thumb", children: /* @__PURE__ */ jsx("img", { src: entry.productImage, alt: entry.productTitle }) }),
|
|
8477
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-info", children: [
|
|
8478
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msp-history-name", children: entry.productTitle }),
|
|
8479
|
-
profileName && /* @__PURE__ */ jsx("div", { className: "ps-msp-history-profile", children: profileName }),
|
|
8480
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-meta", children: [
|
|
8481
|
-
/* @__PURE__ */ jsx(ClockIcon, { size: 11 }),
|
|
8482
|
-
" ",
|
|
8483
|
-
date
|
|
8484
|
-
] })
|
|
8485
|
-
] }),
|
|
8486
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-history-size", children: [
|
|
8487
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msp-history-size-label", children: t("SIZE") }),
|
|
8488
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msp-history-size-value", children: entry.recommendedSize })
|
|
8489
|
-
] })
|
|
8490
|
-
] });
|
|
8491
|
-
}
|
|
8492
8774
|
function MySizingProfilesView({
|
|
8493
8775
|
profiles,
|
|
8494
8776
|
activeProfileId,
|
|
@@ -8503,15 +8785,6 @@ function MySizingProfilesView({
|
|
|
8503
8785
|
const [creating, setCreating] = useState(false);
|
|
8504
8786
|
const [viewingId, setViewingId] = useState(null);
|
|
8505
8787
|
const viewingProfile = viewingId ? profiles.find((p) => p.id === viewingId) || null : null;
|
|
8506
|
-
const allHistory = useMemo(() => {
|
|
8507
|
-
const items = [];
|
|
8508
|
-
for (const p of profiles) {
|
|
8509
|
-
for (const h of p.sizeHistory || []) {
|
|
8510
|
-
items.push({ entry: h, profileName: p.name });
|
|
8511
|
-
}
|
|
8512
|
-
}
|
|
8513
|
-
return items.sort((a, b) => b.entry.savedAt - a.entry.savedAt).slice(0, 12);
|
|
8514
|
-
}, [profiles]);
|
|
8515
8788
|
const handleSaveNewProfile = (data) => {
|
|
8516
8789
|
onSaveNewProfile(data);
|
|
8517
8790
|
setCreating(false);
|
|
@@ -8582,10 +8855,6 @@ function MySizingProfilesView({
|
|
|
8582
8855
|
},
|
|
8583
8856
|
p.id
|
|
8584
8857
|
))
|
|
8585
|
-
] }),
|
|
8586
|
-
allHistory.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ps-msp-history-section", children: [
|
|
8587
|
-
/* @__PURE__ */ jsx("h3", { className: "ps-msp-history-title", children: t("Recent Size Calculations") }),
|
|
8588
|
-
/* @__PURE__ */ jsx("div", { className: "ps-msp-history-list", children: allHistory.map(({ entry, profileName }) => /* @__PURE__ */ jsx(SizeHistoryCard, { entry, profileName, t }, `${entry.productId}-${entry.savedAt}`)) })
|
|
8589
8858
|
] })
|
|
8590
8859
|
] }) }) });
|
|
8591
8860
|
}
|
|
@@ -10960,6 +11229,13 @@ function PrimeStyleTryonInner({
|
|
|
10960
11229
|
bodyLandmarks,
|
|
10961
11230
|
activeSection,
|
|
10962
11231
|
setActiveSection,
|
|
11232
|
+
onResetTryOn: () => {
|
|
11233
|
+
setSelectedFile(null);
|
|
11234
|
+
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
|
11235
|
+
setPreviewUrl(null);
|
|
11236
|
+
setResultImageUrl(null);
|
|
11237
|
+
},
|
|
11238
|
+
onClose: handleClose,
|
|
10963
11239
|
t
|
|
10964
11240
|
}
|
|
10965
11241
|
) }, "v-sizeresult");
|