@primestyleai/tryon 5.10.188 → 5.10.189

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.
@@ -275,7 +275,7 @@ var scheduler_production_min = {};
275
275
  * This source code is licensed under the MIT license found in the
276
276
  * LICENSE file in the root directory of this source tree.
277
277
  */
278
- (function(exports$1) {
278
+ (function(exports) {
279
279
  function f2(a, b) {
280
280
  var c = a.length;
281
281
  a.push(b);
@@ -308,12 +308,12 @@ var scheduler_production_min = {};
308
308
  }
309
309
  if ("object" === typeof performance && "function" === typeof performance.now) {
310
310
  var l2 = performance;
311
- exports$1.unstable_now = function() {
311
+ exports.unstable_now = function() {
312
312
  return l2.now();
313
313
  };
314
314
  } else {
315
315
  var p2 = Date, q2 = p2.now();
316
- exports$1.unstable_now = function() {
316
+ exports.unstable_now = function() {
317
317
  return p2.now() - q2;
318
318
  };
319
319
  }
@@ -349,7 +349,7 @@ var scheduler_production_min = {};
349
349
  v2.callback = null;
350
350
  y2 = v2.priorityLevel;
351
351
  var e = d(v2.expirationTime <= b);
352
- b = exports$1.unstable_now();
352
+ b = exports.unstable_now();
353
353
  "function" === typeof e ? v2.callback = e : v2 === h(r2) && k2(r2);
354
354
  G2(b);
355
355
  } else k2(r2);
@@ -368,11 +368,11 @@ var scheduler_production_min = {};
368
368
  }
369
369
  var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1;
370
370
  function M2() {
371
- return exports$1.unstable_now() - Q2 < P2 ? false : true;
371
+ return exports.unstable_now() - Q2 < P2 ? false : true;
372
372
  }
373
373
  function R2() {
374
374
  if (null !== O2) {
375
- var a = exports$1.unstable_now();
375
+ var a = exports.unstable_now();
376
376
  Q2 = a;
377
377
  var b = true;
378
378
  try {
@@ -401,31 +401,31 @@ var scheduler_production_min = {};
401
401
  }
402
402
  function K2(a, b) {
403
403
  L2 = D2(function() {
404
- a(exports$1.unstable_now());
404
+ a(exports.unstable_now());
405
405
  }, b);
406
406
  }
407
- exports$1.unstable_IdlePriority = 5;
408
- exports$1.unstable_ImmediatePriority = 1;
409
- exports$1.unstable_LowPriority = 4;
410
- exports$1.unstable_NormalPriority = 3;
411
- exports$1.unstable_Profiling = null;
412
- exports$1.unstable_UserBlockingPriority = 2;
413
- exports$1.unstable_cancelCallback = function(a) {
407
+ exports.unstable_IdlePriority = 5;
408
+ exports.unstable_ImmediatePriority = 1;
409
+ exports.unstable_LowPriority = 4;
410
+ exports.unstable_NormalPriority = 3;
411
+ exports.unstable_Profiling = null;
412
+ exports.unstable_UserBlockingPriority = 2;
413
+ exports.unstable_cancelCallback = function(a) {
414
414
  a.callback = null;
415
415
  };
416
- exports$1.unstable_continueExecution = function() {
416
+ exports.unstable_continueExecution = function() {
417
417
  A2 || z2 || (A2 = true, I2(J2));
418
418
  };
419
- exports$1.unstable_forceFrameRate = function(a) {
419
+ exports.unstable_forceFrameRate = function(a) {
420
420
  0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5;
421
421
  };
422
- exports$1.unstable_getCurrentPriorityLevel = function() {
422
+ exports.unstable_getCurrentPriorityLevel = function() {
423
423
  return y2;
424
424
  };
425
- exports$1.unstable_getFirstCallbackNode = function() {
425
+ exports.unstable_getFirstCallbackNode = function() {
426
426
  return h(r2);
427
427
  };
428
- exports$1.unstable_next = function(a) {
428
+ exports.unstable_next = function(a) {
429
429
  switch (y2) {
430
430
  case 1:
431
431
  case 2:
@@ -443,11 +443,11 @@ var scheduler_production_min = {};
443
443
  y2 = c;
444
444
  }
445
445
  };
446
- exports$1.unstable_pauseExecution = function() {
446
+ exports.unstable_pauseExecution = function() {
447
447
  };
448
- exports$1.unstable_requestPaint = function() {
448
+ exports.unstable_requestPaint = function() {
449
449
  };
450
- exports$1.unstable_runWithPriority = function(a, b) {
450
+ exports.unstable_runWithPriority = function(a, b) {
451
451
  switch (a) {
452
452
  case 1:
453
453
  case 2:
@@ -466,8 +466,8 @@ var scheduler_production_min = {};
466
466
  y2 = c;
467
467
  }
468
468
  };
469
- exports$1.unstable_scheduleCallback = function(a, b, c) {
470
- var d = exports$1.unstable_now();
469
+ exports.unstable_scheduleCallback = function(a, b, c) {
470
+ var d = exports.unstable_now();
471
471
  "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
472
472
  switch (a) {
473
473
  case 1:
@@ -490,8 +490,8 @@ var scheduler_production_min = {};
490
490
  c > d ? (a.sortIndex = c, f2(t2, a), null === h(r2) && a === h(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c - d))) : (a.sortIndex = e, f2(r2, a), A2 || z2 || (A2 = true, I2(J2)));
491
491
  return a;
492
492
  };
493
- exports$1.unstable_shouldYield = M2;
494
- exports$1.unstable_wrapCallback = function(a) {
493
+ exports.unstable_shouldYield = M2;
494
+ exports.unstable_wrapCallback = function(a) {
495
495
  var b = y2;
496
496
  return function() {
497
497
  var c = y2;
@@ -7119,8 +7119,6 @@ const es = {
7119
7119
  "Loose": "Holgado",
7120
7120
  "Short": "Corto",
7121
7121
  "Long": "Largo",
7122
- "Perfect": "Perfecto",
7123
- "Perfect fit": "Ajuste perfecto",
7124
7122
  "✓ Fit": "✓ Ajuste",
7125
7123
  "too short": "demasiado corto",
7126
7124
  "too long": "demasiado largo",
@@ -7377,8 +7375,6 @@ const fr = {
7377
7375
  "Loose": "Lâche",
7378
7376
  "Short": "Court",
7379
7377
  "Long": "Long",
7380
- "Perfect": "Parfait",
7381
- "Perfect fit": "Ajustement parfait",
7382
7378
  "✓ Fit": "✓ Ajusté",
7383
7379
  "too short": "trop court",
7384
7380
  "too long": "trop long",
@@ -7635,8 +7631,6 @@ const de = {
7635
7631
  "Loose": "Locker",
7636
7632
  "Short": "Kurz",
7637
7633
  "Long": "Lang",
7638
- "Perfect": "Perfekt",
7639
- "Perfect fit": "Perfekte Passform",
7640
7634
  "✓ Fit": "✓ Passt",
7641
7635
  "too short": "zu kurz",
7642
7636
  "too long": "zu lang",
@@ -7893,8 +7887,6 @@ const it = {
7893
7887
  "Loose": "Largo",
7894
7888
  "Short": "Corto",
7895
7889
  "Long": "Lungo",
7896
- "Perfect": "Perfetto",
7897
- "Perfect fit": "Vestibilità perfetta",
7898
7890
  "✓ Fit": "✓ Adatto",
7899
7891
  "too short": "troppo corto",
7900
7892
  "too long": "troppo lungo",
@@ -8151,8 +8143,6 @@ const pt$1 = {
8151
8143
  "Loose": "Folgado",
8152
8144
  "Short": "Curto",
8153
8145
  "Long": "Longo",
8154
- "Perfect": "Perfeito",
8155
- "Perfect fit": "Caimento perfeito",
8156
8146
  "✓ Fit": "✓ Caimento",
8157
8147
  "too short": "muito curto",
8158
8148
  "too long": "muito longo",
@@ -8409,8 +8399,6 @@ const ja = {
8409
8399
  "Loose": "ゆるい",
8410
8400
  "Short": "短い",
8411
8401
  "Long": "長い",
8412
- "Perfect": "ぴったり",
8413
- "Perfect fit": "ぴったりフィット",
8414
8402
  "✓ Fit": "✓ フィット",
8415
8403
  "too short": "短すぎる",
8416
8404
  "too long": "長すぎる",
@@ -8667,8 +8655,6 @@ const zh = {
8667
8655
  "Loose": "松",
8668
8656
  "Short": "短",
8669
8657
  "Long": "长",
8670
- "Perfect": "完美",
8671
- "Perfect fit": "完美合身",
8672
8658
  "✓ Fit": "✓ 合身",
8673
8659
  "too short": "太短",
8674
8660
  "too long": "太长",
@@ -8925,8 +8911,6 @@ const ko = {
8925
8911
  "Loose": "헐렁한",
8926
8912
  "Short": "짧은",
8927
8913
  "Long": "긴",
8928
- "Perfect": "완벽",
8929
- "Perfect fit": "완벽한 핏",
8930
8914
  "✓ Fit": "✓ 적합",
8931
8915
  "too short": "너무 짧음",
8932
8916
  "too long": "너무 김",
@@ -9183,8 +9167,6 @@ const ar = {
9183
9167
  "Loose": "فضفاض",
9184
9168
  "Short": "قصير",
9185
9169
  "Long": "طويل",
9186
- "Perfect": "مثالي",
9187
- "Perfect fit": "مقاس مثالي",
9188
9170
  "✓ Fit": "✓ مناسب",
9189
9171
  "too short": "قصير جداً",
9190
9172
  "too long": "طويل جداً",
@@ -9481,11 +9463,13 @@ class ApiClient {
9481
9463
  if (context?.productTags?.length) body.productTags = context.productTags;
9482
9464
  if (context?.productDescription) body.productDescription = context.productDescription;
9483
9465
  if (context?.productMaterial) body.productMaterial = context.productMaterial;
9466
+ if (context?.garmentDetailImage && context.garmentDetailImage !== garmentImage) body.garmentDetailImage = context.garmentDetailImage;
9484
9467
  if (context?.silhouetteContext) body.silhouetteContext = context.silhouetteContext;
9485
9468
  if (context?.editFromPrevious) body.editFromPrevious = true;
9486
9469
  console.log("[ps-sdk:api] POST /api/v1/tryon payload", {
9487
9470
  modelImageBytes: modelImage.length,
9488
9471
  garmentImageBytes: garmentImage.length,
9472
+ garmentDetailImageSet: !!body.garmentDetailImage,
9489
9473
  category: category || "apparel",
9490
9474
  fitInfo: fitInfo?.map((f2) => ({
9491
9475
  area: f2.area,
@@ -10960,6 +10944,13 @@ const SESSION_KEY = "primestyle_profile_session";
10960
10944
  const AUTH_MESSAGE_TYPE = "PRIMESTYLE_SDK_AUTH";
10961
10945
  const POPUP_TIMEOUT_MS = 12e4;
10962
10946
  const POLL_INTERVAL_MS = 900;
10947
+ function emitProfileAuthChange(reason) {
10948
+ if (typeof window === "undefined") return;
10949
+ try {
10950
+ window.dispatchEvent(new CustomEvent(PS_STORAGE_CHANGE_EVENT, { detail: { reason } }));
10951
+ } catch {
10952
+ }
10953
+ }
10963
10954
  function isTrustedAuthOrigin(eventOrigin, expectedOrigin) {
10964
10955
  if (eventOrigin === expectedOrigin) return true;
10965
10956
  try {
@@ -11012,6 +11003,7 @@ function setStoredProfileSession(session) {
11012
11003
  if (!storage) return;
11013
11004
  try {
11014
11005
  storage.setItem(SESSION_KEY, JSON.stringify(session));
11006
+ emitProfileAuthChange("profile-auth-set");
11015
11007
  } catch {
11016
11008
  }
11017
11009
  }
@@ -11020,6 +11012,7 @@ function clearStoredProfileSession() {
11020
11012
  if (!storage) return;
11021
11013
  try {
11022
11014
  storage.removeItem(SESSION_KEY);
11015
+ emitProfileAuthChange("profile-auth-clear");
11023
11016
  } catch {
11024
11017
  }
11025
11018
  }
@@ -12312,8 +12305,9 @@ const STYLES = `
12312
12305
  align-self: stretch;
12313
12306
  height: 100%;
12314
12307
  justify-content: flex-start;
12315
- gap: 0.55vw;
12316
- padding-bottom: clamp(8px, 0.72vw, 14px);
12308
+ gap: clamp(8px, 0.48vw, 12px);
12309
+ padding-bottom: clamp(4px, 0.35vw, 8px);
12310
+ overflow: hidden;
12317
12311
  }
12318
12312
  .ps-tryon-v2-result-panel .ps-tryon-v2-sep {
12319
12313
  margin-bottom: 0;
@@ -12323,16 +12317,17 @@ const STYLES = `
12323
12317
  min-height: 0;
12324
12318
  }
12325
12319
  .ps-tryon-v2-result-panel .ps-tryon-photo-strip {
12326
- flex: 0 0 auto;
12320
+ flex: 1 1 auto;
12327
12321
  min-height: 0;
12328
- margin-top: clamp(10px, 0.75vw, 14px);
12329
- margin-bottom: clamp(8px, 0.7vw, 12px);
12322
+ margin-top: clamp(18px, 1.25vw, 26px);
12323
+ margin-bottom: clamp(4px, 0.35vw, 8px);
12324
+ overflow: hidden;
12330
12325
  }
12331
12326
  .ps-tryon-v2-result-panel .ps-tryon-sr-card-v2 {
12332
- min-height: clamp(140px, 10.5vw, 165px);
12327
+ min-height: clamp(118px, 8.6vw, 142px);
12333
12328
  }
12334
12329
  .ps-tryon-v2-result-panel .ps-tryon-sr-card-v2.ps-full {
12335
- min-height: clamp(140px, 10.5vw, 165px);
12330
+ min-height: clamp(118px, 8.6vw, 142px);
12336
12331
  }
12337
12332
  .ps-tryon-v2-result-panel .ps-tryon-photo-strip-cell {
12338
12333
  aspect-ratio: 1 / 1;
@@ -12343,10 +12338,33 @@ const STYLES = `
12343
12338
  align-items: center;
12344
12339
  justify-content: space-between;
12345
12340
  margin-top: auto;
12346
- padding-top: clamp(8px, 0.65vw, 12px);
12347
- padding-bottom: 0;
12341
+ padding-top: clamp(6px, 0.45vw, 10px);
12342
+ padding-bottom: clamp(2px, 0.25vw, 6px);
12348
12343
  gap: 0.5vw;
12349
12344
  flex-shrink: 0;
12345
+ width: 100%;
12346
+ min-height: clamp(42px, 3.1vw, 52px);
12347
+ box-sizing: border-box;
12348
+ border-top: 1px solid rgba(15,23,42,0.06);
12349
+ }
12350
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-action-group {
12351
+ flex: 0 1 min(26vw, 390px);
12352
+ min-width: 0;
12353
+ max-width: min(100%, 390px);
12354
+ margin-left: auto;
12355
+ }
12356
+ .ps-tryon-v2-result-actions .ps-tryon-v2-cta {
12357
+ flex: 1 1 0;
12358
+ min-width: 0;
12359
+ min-height: clamp(38px, 2.55vw, 44px);
12360
+ padding: 0 clamp(10px, 0.75vw, 14px);
12361
+ }
12362
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-cta {
12363
+ flex: 0 1 min(18vw, 240px);
12364
+ margin-left: auto;
12365
+ }
12366
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-action-group .ps-tryon-v2-cta {
12367
+ flex: 1 1 0;
12350
12368
  }
12351
12369
  @keyframes ps-v2-fade {
12352
12370
  0% { opacity: 0; }
@@ -12490,12 +12508,12 @@ const STYLES = `
12490
12508
 
12491
12509
  /* CTA button */
12492
12510
  .ps-tryon-v2-cta {
12493
- margin-top: 0.8vw; padding: 0.65vw 1.5vw;
12494
- width: auto; min-width: 12vw; display: flex; align-items: center; justify-content: center; gap: 0.4vw;
12511
+ margin-top: 0.8vw; padding: 0.55vw 1.05vw;
12512
+ width: auto; min-width: 9.2vw; min-height: 2.35vw; display: flex; align-items: center; justify-content: center; gap: 0.35vw;
12495
12513
  background: var(--ps-accent); color: #fff;
12496
- border: none; border-radius: 0.35vw;
12497
- font-size: 0.72vw; font-weight: 700; font-family: inherit;
12498
- letter-spacing: 0.12em; text-transform: uppercase;
12514
+ border: none; border-radius: 0.42vw;
12515
+ font-size: clamp(10px, 0.64vw, 12px); font-weight: 750; font-family: inherit;
12516
+ letter-spacing: 0.07em; text-transform: uppercase;
12499
12517
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12500
12518
  flex-shrink: 0;
12501
12519
  }
@@ -12506,6 +12524,98 @@ const STYLES = `
12506
12524
  transform: translateY(-1px);
12507
12525
  }
12508
12526
  .ps-tryon-v2-cta svg { width: 0.8vw; height: 0.8vw; stroke: currentColor; }
12527
+ .ps-tryon-v2-action-group {
12528
+ display: flex;
12529
+ align-items: center;
12530
+ justify-content: flex-end;
12531
+ gap: clamp(8px, 0.55vw, 12px);
12532
+ min-width: 0;
12533
+ }
12534
+ .ps-tryon-v2-action-group-history {
12535
+ flex: 0 0 auto !important;
12536
+ width: auto !important;
12537
+ max-width: none !important;
12538
+ }
12539
+ .ps-tryon-v2-cta-compact,
12540
+ .ps-tryon-v2-history-product-cta {
12541
+ flex: 0 0 auto !important;
12542
+ width: auto !important;
12543
+ min-width: 0 !important;
12544
+ min-height: clamp(34px, 2.25vw, 40px) !important;
12545
+ padding: 0 clamp(10px, 0.75vw, 14px) !important;
12546
+ letter-spacing: 0.03em;
12547
+ text-transform: none;
12548
+ font-weight: 750;
12549
+ }
12550
+ .ps-tryon-v2-history-product-cta {
12551
+ justify-content: center;
12552
+ }
12553
+ .ps-tryon-v2-add-bag-cta svg,
12554
+ .ps-tryon-v2-history-product-cta svg {
12555
+ flex: 0 0 auto;
12556
+ width: clamp(16px, 1vw, 18px);
12557
+ height: clamp(16px, 1vw, 18px);
12558
+ stroke-width: 2.1;
12559
+ }
12560
+ .ps-tryon-v2-add-bag-cta.is-added {
12561
+ background: #16a34a;
12562
+ color: #fff;
12563
+ }
12564
+ .ps-tryon-v2-add-bag-cta.is-added:disabled {
12565
+ opacity: 1;
12566
+ cursor: default;
12567
+ }
12568
+ .ps-tryon-v2-add-bag-cta.is-added svg {
12569
+ animation: ps-added-check 0.42s cubic-bezier(0.16, 1, 0.3, 1);
12570
+ }
12571
+ @keyframes ps-added-check {
12572
+ 0% { transform: scale(0.45); opacity: 0; }
12573
+ 55% { transform: scale(1.18); opacity: 1; }
12574
+ 100% { transform: scale(1); opacity: 1; }
12575
+ }
12576
+ .ps-tryon-v2-cta-secondary {
12577
+ background: #FFFFFF;
12578
+ color: var(--ps-accent);
12579
+ border: 1px solid rgba(33,84,239,0.38);
12580
+ box-shadow: none;
12581
+ }
12582
+ .ps-tryon-v2-cta-secondary:hover {
12583
+ background: rgba(33,84,239,0.06);
12584
+ color: var(--ps-accent);
12585
+ border-color: var(--ps-accent);
12586
+ box-shadow: 0 0.25vw 1vw rgba(33,84,239,0.12);
12587
+ }
12588
+ @media (max-width: 768px) {
12589
+ .ps-tryon-v2-action-group {
12590
+ width: 100%;
12591
+ gap: 8px;
12592
+ }
12593
+ .ps-tryon-v2-action-group-history {
12594
+ width: auto !important;
12595
+ margin-left: auto;
12596
+ }
12597
+ .ps-tryon-v2-action-group .ps-tryon-v2-cta,
12598
+ .ps-msr-commerce-row > .ps-tryon-v2-cta {
12599
+ flex: 1 1 0;
12600
+ min-width: 0;
12601
+ padding: 11px 12px;
12602
+ border-radius: 10px;
12603
+ font-size: 11px;
12604
+ letter-spacing: 0.08em;
12605
+ white-space: nowrap;
12606
+ }
12607
+ .ps-tryon-v2-action-group-history .ps-tryon-v2-cta {
12608
+ flex: 0 0 auto !important;
12609
+ width: auto !important;
12610
+ padding: 10px 12px !important;
12611
+ letter-spacing: 0.02em;
12612
+ }
12613
+ .ps-tryon-v2-add-bag-cta svg,
12614
+ .ps-tryon-v2-history-product-cta svg {
12615
+ width: 17px;
12616
+ height: 17px;
12617
+ }
12618
+ }
12509
12619
 
12510
12620
  /* ── Size result card rows (split layout) ── */
12511
12621
  .ps-tryon-sr-cards-stack {
@@ -12588,39 +12698,132 @@ const STYLES = `
12588
12698
  flex: 1 1 45%; max-width: 49%;
12589
12699
  display: flex; flex-direction: column; align-items: center; justify-content: center;
12590
12700
  text-align: center;
12591
- background: rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.06);
12592
- border-radius: 0.6vw; padding: 1vw 0.5vw;
12701
+ background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFF 100%);
12702
+ border: 1px solid rgba(15,23,42,0.08);
12703
+ border-radius: clamp(12px, 0.72vw, 14px); padding: clamp(14px, 0.82vw, 18px);
12593
12704
  cursor: pointer; font-family: inherit;
12594
12705
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12595
12706
  animation: ps-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
12596
12707
  opacity: 0; overflow: hidden; position: relative;
12597
12708
  min-height: 7vw;
12598
12709
  }
12599
- .ps-tryon-sr-card-v2.ps-full { flex: 1 1 100%; max-width: 100%; min-height: 5vw; padding: 0.8vw; }
12710
+ .ps-tryon-sr-card-v2::after {
12711
+ content: "";
12712
+ position: absolute;
12713
+ inset: 0;
12714
+ border-radius: inherit;
12715
+ pointer-events: none;
12716
+ background: radial-gradient(circle at 50% 0%, rgba(33,84,239,0.08), transparent 38%);
12717
+ opacity: 0.6;
12718
+ }
12719
+ .ps-tryon-sr-card-v2.ps-full { flex: 1 1 100%; max-width: 100%; min-height: 5vw; padding: clamp(14px, 0.82vw, 18px); }
12720
+ .ps-tryon-sr-card-v2.ps-summary-card {
12721
+ align-items: stretch;
12722
+ justify-content: center;
12723
+ text-align: left;
12724
+ min-height: clamp(112px, 7.4vw, 132px);
12725
+ padding: clamp(18px, 1.12vw, 24px) clamp(20px, 1.3vw, 28px);
12726
+ }
12600
12727
  .ps-tryon-sr-card-v2:hover {
12601
12728
  border-color: var(--ps-accent);
12602
- background: rgba(33,84,239,0.06);
12729
+ background: linear-gradient(180deg, #FFFFFF 0%, rgba(33,84,239,0.045) 100%);
12603
12730
  transform: translateY(-2px);
12604
- box-shadow: 0 0.4vw 1.5vw rgba(0,0,0,0.08);
12731
+ box-shadow: 0 0.45vw 1.4vw rgba(15,23,42,0.08);
12605
12732
  }
12606
12733
  .ps-tryon-sr-card-v2-text {
12607
- display: flex; flex-direction: column; align-items: center; gap: 0.15vw; z-index: 1;
12734
+ display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 0.22vw, 7px); z-index: 1;
12735
+ }
12736
+ .ps-summary-card-layout {
12737
+ width: 100%;
12738
+ display: grid;
12739
+ grid-template-columns: minmax(0, 1fr) auto;
12740
+ grid-template-areas: "copy action";
12741
+ align-items: center;
12742
+ column-gap: clamp(18px, 1.25vw, 28px);
12743
+ row-gap: 0;
12744
+ }
12745
+ .ps-summary-card-copy {
12746
+ grid-area: copy;
12747
+ display: flex;
12748
+ flex-direction: column;
12749
+ align-items: flex-start;
12750
+ justify-content: center;
12751
+ min-width: 0;
12752
+ gap: clamp(8px, 0.48vw, 12px);
12753
+ }
12754
+ .ps-tryon-sr-card-v2-heading {
12755
+ grid-area: heading;
12756
+ display: flex;
12757
+ align-items: center;
12758
+ gap: clamp(8px, 0.55vw, 12px);
12759
+ min-width: 0;
12760
+ }
12761
+ .ps-tryon-sr-card-v2-main {
12762
+ display: flex;
12763
+ align-items: center;
12764
+ justify-content: flex-start;
12765
+ gap: clamp(9px, 0.6vw, 14px);
12766
+ min-width: 0;
12767
+ }
12768
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12769
+ grid-area: action;
12770
+ margin-top: 0;
12771
+ white-space: nowrap;
12772
+ }
12773
+ .ps-tryon-sr-card-v2-summary-title {
12774
+ font-size: clamp(11px, 0.66vw, 12px);
12775
+ font-weight: 760;
12776
+ color: rgba(15,23,42,0.56);
12777
+ letter-spacing: 0.06em;
12778
+ text-transform: uppercase;
12779
+ line-height: 1.2;
12780
+ margin-bottom: clamp(2px, 0.08vw, 4px);
12781
+ }
12782
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-summary-title {
12783
+ margin-bottom: 0;
12784
+ white-space: nowrap;
12785
+ color: rgba(15,23,42,0.58);
12786
+ font-size: clamp(11px, 0.66vw, 12px);
12787
+ font-weight: 780;
12788
+ letter-spacing: 0.12em;
12789
+ text-transform: uppercase;
12790
+ }
12791
+ .ps-tryon-sr-card-v2-summary-subtitle {
12792
+ font-size: clamp(10px, 0.56vw, 11px);
12793
+ font-weight: 400;
12794
+ color: rgba(0,0,0,0.32);
12795
+ letter-spacing: 0.02em;
12796
+ line-height: 1.25;
12797
+ text-transform: none;
12798
+ margin-bottom: 0.35vw;
12608
12799
  }
12609
12800
  .ps-tryon-sr-card-v2-label {
12610
- font-size: 0.65vw; font-weight: 600; color: var(--ps-text-secondary);
12611
- text-transform: uppercase; letter-spacing: 0.1em;
12801
+ font-size: clamp(10px, 0.56vw, 11px); font-weight: 650; color: rgba(15,23,42,0.58);
12802
+ text-transform: uppercase; letter-spacing: 0.08em;
12612
12803
  display: inline-flex; align-items: center; gap: 0.5vw;
12613
12804
  }
12805
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-label {
12806
+ min-width: 0;
12807
+ overflow: hidden;
12808
+ text-overflow: ellipsis;
12809
+ white-space: nowrap;
12810
+ }
12614
12811
  .ps-tryon-sr-card-v2-label-icon {
12615
12812
  width: 4.8vw; height: 4.8vw; object-fit: contain;
12616
12813
  opacity: 1;
12617
12814
  }
12618
12815
  .ps-tryon-sr-card-v2-value {
12619
- font-size: 2.2vw; font-weight: 200; color: var(--ps-text-primary);
12816
+ font-size: clamp(30px, 2.18vw, 38px); font-weight: 260; color: var(--ps-text-primary);
12620
12817
  line-height: 1; letter-spacing: -0.02em;
12621
12818
  overflow-wrap: anywhere;
12622
12819
  }
12623
- .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: 1.8vw; }
12820
+ .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: clamp(30px, 2vw, 36px); }
12821
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12822
+ flex: 0 1 auto;
12823
+ font-size: clamp(38px, 2.55vw, 48px);
12824
+ min-width: 0;
12825
+ text-align: left;
12826
+ }
12624
12827
  /* Long combined labels ("MISSY 12 / Standard", "PLUS 16W / Extra Length")
12625
12828
  overflow the card at 2vw. Drop to ~1.3vw whenever the label is more
12626
12829
  than ~12 chars so the whole thing fits on one line. */
@@ -12639,13 +12842,19 @@ const STYLES = `
12639
12842
  }
12640
12843
  .ps-tryon-sr-card-v2-rec-pill {
12641
12844
  align-self: center;
12642
- font-size: 0.55vw; font-weight: 700; color: var(--ps-accent);
12643
- text-transform: uppercase; letter-spacing: 0.08em;
12845
+ font-size: clamp(9px, 0.52vw, 10px); font-weight: 780; color: var(--ps-accent);
12846
+ text-transform: uppercase; letter-spacing: 0.07em;
12644
12847
  background: rgba(33, 84, 239, 0.10);
12645
12848
  border: 1px solid rgba(33, 84, 239, 0.18);
12646
12849
  border-radius: 2vw;
12647
- padding: 0.18vw 0.6vw;
12648
- margin-top: 0.3vw;
12850
+ padding: clamp(3px, 0.18vw, 4px) clamp(9px, 0.58vw, 12px);
12851
+ margin-top: clamp(2px, 0.12vw, 4px);
12852
+ }
12853
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-rec-pill {
12854
+ align-self: center;
12855
+ margin-top: 0;
12856
+ white-space: nowrap;
12857
+ background: #fff;
12649
12858
  }
12650
12859
  .ps-tryon-sr-card-v2-rec-pill.is-overridden {
12651
12860
  color: #b45309;
@@ -12654,10 +12863,10 @@ const STYLES = `
12654
12863
  }
12655
12864
  .ps-tryon-sr-card-v2-view {
12656
12865
  align-self: center;
12657
- margin-top: 0.4vw;
12658
- font-size: 0.62vw; font-weight: 600;
12866
+ margin-top: clamp(2px, 0.18vw, 5px);
12867
+ font-size: clamp(10px, 0.58vw, 11px); font-weight: 700;
12659
12868
  color: var(--ps-accent);
12660
- text-transform: uppercase; letter-spacing: 0.06em;
12869
+ text-transform: none; letter-spacing: 0.02em;
12661
12870
  display: inline-flex; align-items: center; justify-content: center; gap: 0.2vw;
12662
12871
  transition: gap 0.2s ease;
12663
12872
  }
@@ -12668,6 +12877,60 @@ const STYLES = `
12668
12877
  font-size: 0.85vw; line-height: 1; color: var(--ps-accent);
12669
12878
  transform: translateY(-0.05vw);
12670
12879
  }
12880
+ .ps-tryon-sr-card-v2-open-pill {
12881
+ margin-top: clamp(4px, 0.26vw, 7px);
12882
+ display: inline-flex;
12883
+ align-items: center;
12884
+ justify-content: center;
12885
+ gap: clamp(4px, 0.25vw, 6px);
12886
+ min-height: clamp(26px, 1.65vw, 32px);
12887
+ padding: 0 clamp(10px, 0.68vw, 14px);
12888
+ border-radius: 999px;
12889
+ background: #fff;
12890
+ border: 1px solid rgba(33,84,239,0.22);
12891
+ color: var(--ps-accent);
12892
+ font-size: clamp(10px, 0.58vw, 11px);
12893
+ font-weight: 760;
12894
+ letter-spacing: 0.01em;
12895
+ box-shadow: 0 0.18vw 0.8vw rgba(33,84,239,0.08);
12896
+ transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
12897
+ }
12898
+ .ps-tryon-sr-card-v2-open-pill > span[aria-hidden="true"] {
12899
+ font-size: clamp(14px, 0.85vw, 16px);
12900
+ line-height: 1;
12901
+ transform: translateY(-0.03vw);
12902
+ }
12903
+ .ps-tryon-sr-card-v2:hover .ps-tryon-sr-card-v2-open-pill {
12904
+ transform: translateY(-1px);
12905
+ border-color: rgba(33,84,239,0.45);
12906
+ box-shadow: 0 0.24vw 1vw rgba(33,84,239,0.13);
12907
+ }
12908
+ @media (max-width: 768px) {
12909
+ .ps-tryon-sr-card-v2.ps-summary-card {
12910
+ min-height: 104px;
12911
+ padding: 16px;
12912
+ }
12913
+ .ps-summary-card-layout {
12914
+ grid-template-columns: minmax(0, 1fr);
12915
+ grid-template-areas:
12916
+ "copy"
12917
+ "action";
12918
+ row-gap: 12px;
12919
+ align-items: stretch;
12920
+ }
12921
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-main {
12922
+ width: 100%;
12923
+ justify-content: space-between;
12924
+ gap: 12px;
12925
+ }
12926
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12927
+ font-size: 34px;
12928
+ }
12929
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12930
+ width: 100%;
12931
+ min-height: 38px;
12932
+ }
12933
+ }
12671
12934
  .ps-tryon-sr-card-v2-img { display: none; }
12672
12935
  .ps-tryon-sr-card-v2-icon {
12673
12936
  position: absolute; bottom: 0.35vw; right: 0.45vw;
@@ -16656,6 +16919,87 @@ const STYLES = `
16656
16919
  }
16657
16920
  .ps-bp-image-remove:hover { background: rgba(0,0,0,0.8); }
16658
16921
 
16922
+ .ps-bp-photo-help-chip {
16923
+ position: absolute;
16924
+ top: clamp(8px, 0.65vw, 12px);
16925
+ left: clamp(8px, 0.65vw, 12px);
16926
+ z-index: 3;
16927
+ display: inline-flex;
16928
+ align-items: center;
16929
+ gap: clamp(5px, 0.35vw, 7px);
16930
+ max-width: calc(100% - clamp(58px, 4.2vw, 78px));
16931
+ padding: clamp(5px, 0.38vw, 7px) clamp(8px, 0.62vw, 12px);
16932
+ border: 1px solid rgba(33, 84, 239, 0.22);
16933
+ border-radius: 999px;
16934
+ background: rgba(255, 255, 255, 0.92);
16935
+ color: var(--ps-accent);
16936
+ box-shadow: 0 8px 20px -16px rgba(17, 24, 39, 0.35);
16937
+ backdrop-filter: blur(8px);
16938
+ -webkit-backdrop-filter: blur(8px);
16939
+ font-family: inherit;
16940
+ font-size: clamp(10px, 0.6vw, 12px);
16941
+ font-weight: 800;
16942
+ letter-spacing: 0.04em;
16943
+ line-height: 1;
16944
+ white-space: nowrap;
16945
+ cursor: pointer;
16946
+ transition: background 0.15s, color 0.15s, border-color 0.15s;
16947
+ }
16948
+ .ps-bp-photo-help-chip.ps-active {
16949
+ background: var(--ps-accent);
16950
+ border-color: var(--ps-accent);
16951
+ color: #FFFFFF;
16952
+ }
16953
+ .ps-bp-photo-help-chip-mark {
16954
+ display: inline-flex;
16955
+ align-items: center;
16956
+ justify-content: center;
16957
+ width: clamp(14px, 0.9vw, 16px);
16958
+ height: clamp(14px, 0.9vw, 16px);
16959
+ flex: 0 0 auto;
16960
+ border-radius: 999px;
16961
+ background: var(--ps-accent);
16962
+ color: #FFFFFF;
16963
+ font-size: clamp(10px, 0.58vw, 11px);
16964
+ font-weight: 900;
16965
+ }
16966
+ .ps-bp-photo-help-chip.ps-active .ps-bp-photo-help-chip-mark {
16967
+ background: #FFFFFF;
16968
+ color: var(--ps-accent);
16969
+ }
16970
+
16971
+ .ps-bp-photo-details-head {
16972
+ display: flex;
16973
+ align-items: center;
16974
+ justify-content: space-between;
16975
+ gap: clamp(10px, 0.8vw, 16px);
16976
+ padding: 0 0 clamp(5px, 0.35vw, 8px);
16977
+ border-bottom: 1px solid var(--ps-border-subtle);
16978
+ }
16979
+ .ps-bp-photo-details-head h3 {
16980
+ margin: 0;
16981
+ color: var(--ps-text-primary);
16982
+ font-size: clamp(13px, 0.82vw, 16px);
16983
+ font-weight: 800;
16984
+ letter-spacing: 0.01em;
16985
+ line-height: 1.1;
16986
+ }
16987
+ .ps-bp-photo-details-head-simple {
16988
+ padding-bottom: clamp(8px, 0.55vw, 12px);
16989
+ }
16990
+ .ps-bp-photo-details-head-simple h3 {
16991
+ font-size: clamp(14px, 0.9vw, 17px);
16992
+ }
16993
+ .ps-bp-system-toggle-compact {
16994
+ margin: 0;
16995
+ gap: clamp(12px, 0.85vw, 18px);
16996
+ flex-shrink: 0;
16997
+ }
16998
+ .ps-bp-system-toggle-compact .ps-bp-system-btn {
16999
+ font-size: clamp(11px, 0.66vw, 13px);
17000
+ padding: 0 0 3px;
17001
+ }
17002
+
16659
17003
  .ps-bp-root {
16660
17004
  flex: 1; min-width: 0;
16661
17005
  display: flex; flex-direction: column; gap: 0.6vw; padding: 0.2vw 0.5vw 0.3vw 0;
@@ -16708,10 +17052,10 @@ const STYLES = `
16708
17052
  display: flex;
16709
17053
  align-items: center;
16710
17054
  justify-content: space-between;
16711
- gap: clamp(10px, 0.9vw, 18px);
16712
- width: min(100%, 520px);
16713
- margin: 0 auto clamp(10px, 0.9vw, 18px);
16714
- padding: clamp(10px, 0.85vw, 16px) clamp(12px, 1vw, 20px);
17055
+ gap: clamp(8px, 0.65vw, 14px);
17056
+ width: min(100%, 500px);
17057
+ margin: 0 auto clamp(7px, 0.55vw, 12px);
17058
+ padding: clamp(7px, 0.55vw, 11px) clamp(10px, 0.8vw, 16px);
16715
17059
  border: 1px solid rgba(33, 84, 239, 0.18);
16716
17060
  border-radius: clamp(8px, 0.7vw, 12px);
16717
17061
  background: linear-gradient(135deg, rgba(33, 84, 239, 0.08), rgba(255, 255, 255, 0.96));
@@ -16720,7 +17064,7 @@ const STYLES = `
16720
17064
  .ps-bp-profile-card-copy {
16721
17065
  display: flex;
16722
17066
  flex-direction: column;
16723
- gap: clamp(2px, 0.18vw, 4px);
17067
+ gap: clamp(1px, 0.12vw, 3px);
16724
17068
  min-width: 0;
16725
17069
  }
16726
17070
  .ps-bp-profile-card-eyebrow {
@@ -16731,7 +17075,7 @@ const STYLES = `
16731
17075
  color: var(--ps-accent);
16732
17076
  }
16733
17077
  .ps-bp-profile-card-copy strong {
16734
- font-size: clamp(13px, 0.95vw, 17px);
17078
+ font-size: clamp(12px, 0.85vw, 15px);
16735
17079
  line-height: 1.1;
16736
17080
  color: var(--ps-text-primary);
16737
17081
  overflow: hidden;
@@ -16739,8 +17083,8 @@ const STYLES = `
16739
17083
  white-space: nowrap;
16740
17084
  }
16741
17085
  .ps-bp-profile-card-copy span:last-child {
16742
- font-size: clamp(10px, 0.68vw, 12px);
16743
- line-height: 1.35;
17086
+ font-size: clamp(9px, 0.58vw, 11px);
17087
+ line-height: 1.25;
16744
17088
  color: var(--ps-text-secondary);
16745
17089
  }
16746
17090
  .ps-bp-profile-card-action {
@@ -16749,7 +17093,7 @@ const STYLES = `
16749
17093
  background: #FFFFFF;
16750
17094
  color: var(--ps-accent);
16751
17095
  border-radius: 999px;
16752
- padding: clamp(7px, 0.55vw, 10px) clamp(10px, 0.8vw, 16px);
17096
+ padding: clamp(6px, 0.45vw, 8px) clamp(9px, 0.7vw, 14px);
16753
17097
  font-family: inherit;
16754
17098
  font-size: clamp(9px, 0.62vw, 11px);
16755
17099
  font-weight: 800;
@@ -16763,6 +17107,39 @@ const STYLES = `
16763
17107
  background: rgba(33, 84, 239, 0.06);
16764
17108
  }
16765
17109
  .ps-bp-profile-card-action:active { transform: scale(0.98); }
17110
+ .ps-bp-profile-card-compact {
17111
+ margin: 0 auto clamp(3px, 0.32vw, 6px);
17112
+ padding: clamp(4px, 0.34vw, 6px) clamp(8px, 0.62vw, 12px);
17113
+ border-radius: clamp(7px, 0.55vw, 10px);
17114
+ box-shadow: none;
17115
+ }
17116
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy {
17117
+ display: grid;
17118
+ grid-template-columns: auto minmax(0, 1fr);
17119
+ align-items: baseline;
17120
+ gap: 2px clamp(6px, 0.45vw, 9px);
17121
+ }
17122
+ .ps-bp-profile-card-compact .ps-bp-profile-card-eyebrow {
17123
+ grid-column: 1 / -1;
17124
+ font-size: clamp(7px, 0.46vw, 9px);
17125
+ letter-spacing: 0.16em;
17126
+ line-height: 1;
17127
+ }
17128
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy strong {
17129
+ font-size: clamp(11px, 0.72vw, 13px);
17130
+ line-height: 1.05;
17131
+ }
17132
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy span:last-child {
17133
+ font-size: clamp(8px, 0.5vw, 10px);
17134
+ line-height: 1.1;
17135
+ overflow: hidden;
17136
+ text-overflow: ellipsis;
17137
+ white-space: nowrap;
17138
+ }
17139
+ .ps-bp-profile-card-compact .ps-bp-profile-card-action {
17140
+ padding: clamp(4px, 0.3vw, 6px) clamp(7px, 0.55vw, 11px);
17141
+ font-size: clamp(8px, 0.52vw, 10px);
17142
+ }
16766
17143
 
16767
17144
  /* Typography */
16768
17145
  .ps-bp-title {
@@ -17978,6 +18355,16 @@ const STYLES = `
17978
18355
  .ps-msr-bottom-row {
17979
18356
  display: flex; gap: 8px; align-items: stretch; justify-content: flex-end;
17980
18357
  }
18358
+ .ps-msr-bottom-row.ps-msr-commerce-row {
18359
+ width: 100%;
18360
+ }
18361
+ .ps-msr-commerce-row .ps-tryon-v2-action-group {
18362
+ width: 100%;
18363
+ }
18364
+ .ps-msr-commerce-row .ps-tryon-v2-cta {
18365
+ flex: 1 1 0;
18366
+ min-width: 0;
18367
+ }
17981
18368
  .ps-msr-bottom-row .ps-msr-tryon-cta {
17982
18369
  flex: 0 0 auto; min-width: 94px; width: auto;
17983
18370
  padding: 11px 14px; font-size: 12px;
@@ -20408,6 +20795,14 @@ const STYLES = `
20408
20795
  opacity: 0.6;
20409
20796
  cursor: default;
20410
20797
  }
20798
+ .ps-msd-result-action-group {
20799
+ flex: 1 1 0;
20800
+ justify-content: flex-end;
20801
+ }
20802
+ .ps-msd-result-action-group .ps-tryon-v2-cta {
20803
+ flex: 1 1 0;
20804
+ min-width: 0;
20805
+ }
20411
20806
 
20412
20807
  /* RECOMMENDED SIZE card */
20413
20808
  .ps-msd-card {
@@ -20684,6 +21079,14 @@ const STYLES = `
20684
21079
  display: flex; flex-direction: column; gap: 0.6vw;
20685
21080
  z-index: 5;
20686
21081
  }
21082
+ .ps-bp-photo-help-upload {
21083
+ top: clamp(46px, 3.2vw, 58px);
21084
+ left: clamp(12px, 0.85vw, 16px);
21085
+ right: auto;
21086
+ width: min(360px, calc(100% - clamp(24px, 1.7vw, 32px)));
21087
+ max-height: calc(100% - clamp(64px, 4.5vw, 82px));
21088
+ overflow-y: auto;
21089
+ }
20687
21090
  .ps-bp-photo-help-handle { display: none; }
20688
21091
  .ps-bp-photo-help-header { display: flex; align-items: center; justify-content: space-between; }
20689
21092
  .ps-bp-photo-help-title { font-size: 0.8vw; font-weight: 700; color: var(--ps-text-primary); }
@@ -21435,6 +21838,21 @@ function UserIcon({ size = 16 }) {
21435
21838
  /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "7", r: "4" })
21436
21839
  ] });
21437
21840
  }
21841
+ function ShoppingBagIcon({ size = 16 }) {
21842
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21843
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M6 7h12l-1 14H7L6 7Z" }),
21844
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9 7a3 3 0 0 1 6 0" }),
21845
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 12v5" }),
21846
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9.5 14.5h5" })
21847
+ ] });
21848
+ }
21849
+ function ExternalLinkIcon({ size = 16 }) {
21850
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21851
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 3h7v7" }),
21852
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M10 14 21 3" }),
21853
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" })
21854
+ ] });
21855
+ }
21438
21856
  function ClockIcon({ size = 16 }) {
21439
21857
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21440
21858
  /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }),
@@ -22461,6 +22879,7 @@ function MultiSectionMobile({
22461
22879
  tryOnDone,
22462
22880
  onTryAgain,
22463
22881
  onClose,
22882
+ resultActionNode,
22464
22883
  overlayNode,
22465
22884
  showLines,
22466
22885
  onToggleLines,
@@ -22536,7 +22955,7 @@ function MultiSectionMobile({
22536
22955
  }) }),
22537
22956
  profileCompletionCta
22538
22957
  ] }),
22539
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom", children: tryOnDone ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-bottom-row", children: [
22958
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom", children: resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom-row ps-msr-commerce-row", children: resultActionNode }) : tryOnDone ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-bottom-row", children: [
22540
22959
  /* @__PURE__ */ jsxRuntimeExports.jsx(
22541
22960
  "button",
22542
22961
  {
@@ -22640,7 +23059,7 @@ function ProfileCompletionCta({
22640
23059
  border: "1px solid rgba(33, 84, 239, 0.16)",
22641
23060
  background: "linear-gradient(135deg, #FFFFFF 0%, rgba(33,84,239,0.055) 100%)",
22642
23061
  borderRadius: isMobile ? 12 : "0.7vw",
22643
- padding: isMobile ? "13px 14px" : isHeader ? "0.7vw 0.9vw" : "0.58vw 0.75vw",
23062
+ padding: isMobile ? "13px 14px" : isHeader ? "clamp(8px, 0.55vw, 10px) clamp(10px, 0.7vw, 14px)" : "0.5vw 0.7vw",
22644
23063
  marginTop: isMobile ? 12 : isHeader ? 0 : "0.48vw",
22645
23064
  cursor: "pointer",
22646
23065
  fontFamily: "inherit",
@@ -22649,18 +23068,18 @@ function ProfileCompletionCta({
22649
23068
  flexDirection: isMobile ? "column" : "row",
22650
23069
  alignItems: isMobile ? "stretch" : "center",
22651
23070
  justifyContent: "space-between",
22652
- gap: isMobile ? 10 : isHeader ? "0.85vw" : "0.8vw",
23071
+ gap: isMobile ? 10 : isHeader ? "0.62vw" : "0.7vw",
22653
23072
  boxShadow: "0 12px 28px -22px rgba(33,84,239,0.52)"
22654
23073
  },
22655
23074
  children: [
22656
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { display: "flex", alignItems: "center", gap: isMobile ? 10 : isHeader ? "0.65vw" : "0.6vw", minWidth: 0, width: isMobile || isHeader ? "100%" : "auto" }, children: [
23075
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { display: "flex", alignItems: "center", gap: isMobile ? 10 : isHeader ? "0.5vw" : "0.6vw", minWidth: 0, width: isMobile || isHeader ? "100%" : "auto" }, children: [
22657
23076
  /* @__PURE__ */ jsxRuntimeExports.jsx(
22658
23077
  "span",
22659
23078
  {
22660
23079
  "aria-hidden": "true",
22661
23080
  style: {
22662
- width: isMobile ? 32 : isHeader ? "1.9vw" : "1.65vw",
22663
- height: isMobile ? 32 : isHeader ? "1.9vw" : "1.65vw",
23081
+ width: isMobile ? 32 : isHeader ? "clamp(26px, 1.65vw, 30px)" : "1.55vw",
23082
+ height: isMobile ? 32 : isHeader ? "clamp(26px, 1.65vw, 30px)" : "1.55vw",
22664
23083
  borderRadius: "50%",
22665
23084
  background: "var(--ps-accent)",
22666
23085
  color: "#fff",
@@ -22669,12 +23088,12 @@ function ProfileCompletionCta({
22669
23088
  justifyContent: "center",
22670
23089
  flexShrink: 0
22671
23090
  },
22672
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(SparkleIcon, { size: isMobile ? 16 : isHeader ? 16 : 14 })
23091
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(UserIcon, { size: isMobile ? 16 : isHeader ? 16 : 14 })
22673
23092
  }
22674
23093
  ),
22675
23094
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { minWidth: 0 }, children: [
22676
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-primary)", fontSize: isMobile ? 14 : isHeader ? "0.78vw" : "0.68vw", fontWeight: 800, lineHeight: 1.2 }, children: title }),
22677
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-secondary)", fontSize: isMobile ? 12 : isHeader ? "0.58vw" : "0.56vw", lineHeight: 1.32, marginTop: isMobile ? 3 : "0.12vw" }, children: body })
23095
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-primary)", fontSize: isMobile ? 14 : isHeader ? "clamp(12px, 0.72vw, 14px)" : "0.68vw", fontWeight: 800, lineHeight: 1.15 }, children: title }),
23096
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-secondary)", fontSize: isMobile ? 12 : isHeader ? "clamp(10px, 0.52vw, 11px)" : "0.56vw", lineHeight: 1.22, marginTop: isMobile ? 3 : "0.1vw" }, children: body })
22678
23097
  ] })
22679
23098
  ] }),
22680
23099
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -22686,7 +23105,7 @@ function ProfileCompletionCta({
22686
23105
  border: isMobile ? "1px solid rgba(33,84,239,0.14)" : 0,
22687
23106
  borderRadius: isMobile ? 999 : 0,
22688
23107
  padding: isMobile ? "7px 10px" : 0,
22689
- fontSize: isMobile ? 12 : isHeader ? "0.64vw" : "0.62vw",
23108
+ fontSize: isMobile ? 12 : isHeader ? "clamp(10px, 0.56vw, 11px)" : "0.62vw",
22690
23109
  fontWeight: 800,
22691
23110
  whiteSpace: "nowrap",
22692
23111
  flexShrink: 0,
@@ -23385,6 +23804,7 @@ function SectionDetailView({
23385
23804
  internationalSizes,
23386
23805
  continueLabel,
23387
23806
  onContinue,
23807
+ resultActionNode,
23388
23808
  renderRaw = false,
23389
23809
  sectionFound,
23390
23810
  allSizes,
@@ -24037,7 +24457,7 @@ function SectionDetailView({
24037
24457
  tryOnProcessing ? `${t2("Generating try-on…")}${tryOnElapsedS > 0 ? ` ${tryOnElapsedS}s` : ""}` : t2("Try It On")
24038
24458
  ]
24039
24459
  }
24040
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24460
+ ) : resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group ps-msd-result-action-group", children: resultActionNode }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24041
24461
  "button",
24042
24462
  {
24043
24463
  type: "button",
@@ -24262,7 +24682,7 @@ function SectionDetailView({
24262
24682
  tryOnProcessing ? `${t2("Generating try-on…")}${tryOnElapsedS > 0 ? ` ${tryOnElapsedS}s` : ""}` : t2("Try It On")
24263
24683
  ]
24264
24684
  }
24265
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24685
+ ) : resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group", children: resultActionNode }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24266
24686
  "button",
24267
24687
  {
24268
24688
  onClick: continueLabel ? onContinue || onBack : onBack,
@@ -24308,6 +24728,12 @@ function SizeResultView({
24308
24728
  setView,
24309
24729
  handleDownload,
24310
24730
  onContinueShopping,
24731
+ isHistoryResult = false,
24732
+ onBackToProductPage,
24733
+ onAddToBag,
24734
+ addToBagLabel,
24735
+ continueShoppingLabel,
24736
+ backToProductPageLabel,
24311
24737
  onTryOnFeedbackSubmit,
24312
24738
  selectedFile,
24313
24739
  previewUrl,
@@ -24339,6 +24765,101 @@ function SizeResultView({
24339
24765
  const shoeUserGender = normalizeShoeGender(sizingResult?.userGender || sizingResult?.detectedGender) || void 0;
24340
24766
  const [editVals, setEditVals] = reactExports.useState({});
24341
24767
  const pRange = pRangeFn;
24768
+ const resolvedContinueShoppingLabel = continueShoppingLabel?.trim() || t2("Continue Shopping");
24769
+ const resolvedAddToBagLabel = addToBagLabel?.trim() || t2("Add to Bag");
24770
+ const resolvedBackToProductPageLabel = backToProductPageLabel?.trim() || t2("Back to product");
24771
+ const handleContinueAction = onContinueShopping || onClose;
24772
+ const handleBackToProductPageAction = onBackToProductPage || handleContinueAction;
24773
+ const canAddToBag = !!onAddToBag && !isHistoryResult && !!sizingResult && sizingResult.found !== false;
24774
+ const [addToBagState, setAddToBagState] = reactExports.useState("idle");
24775
+ reactExports.useEffect(() => {
24776
+ if (addToBagState !== "added") return;
24777
+ const timer = window.setTimeout(() => setAddToBagState("idle"), 1500);
24778
+ return () => window.clearTimeout(timer);
24779
+ }, [addToBagState]);
24780
+ const handleAddToBagClick = reactExports.useCallback(async () => {
24781
+ if (!onAddToBag || addToBagState !== "idle") return;
24782
+ setAddToBagState("adding");
24783
+ try {
24784
+ await onAddToBag();
24785
+ setAddToBagState("added");
24786
+ } catch {
24787
+ setAddToBagState("idle");
24788
+ }
24789
+ }, [addToBagState, onAddToBag]);
24790
+ const renderShoppingCta = reactExports.useCallback((options) => {
24791
+ if (isHistoryResult && handleBackToProductPageAction) {
24792
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group ps-tryon-v2-action-group-history", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
24793
+ "button",
24794
+ {
24795
+ className: "ps-tryon-v2-cta ps-tryon-v2-cta-secondary ps-tryon-v2-cta-compact ps-tryon-v2-history-product-cta",
24796
+ style: { marginTop: 0 },
24797
+ onClick: handleBackToProductPageAction,
24798
+ type: "button",
24799
+ children: [
24800
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ExternalLinkIcon, { size: 13 }),
24801
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: resolvedBackToProductPageLabel })
24802
+ ]
24803
+ }
24804
+ ) });
24805
+ }
24806
+ const allowAddToBag = options?.allowAddToBag !== false;
24807
+ if (allowAddToBag && canAddToBag) {
24808
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-action-group", children: [
24809
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
24810
+ "button",
24811
+ {
24812
+ className: "ps-tryon-v2-cta ps-tryon-v2-cta-secondary",
24813
+ style: { marginTop: 0 },
24814
+ onClick: handleContinueAction,
24815
+ type: "button",
24816
+ children: [
24817
+ resolvedContinueShoppingLabel,
24818
+ " →"
24819
+ ]
24820
+ }
24821
+ ),
24822
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
24823
+ "button",
24824
+ {
24825
+ className: `ps-tryon-v2-cta ps-tryon-v2-add-bag-cta${addToBagState === "added" ? " is-added" : ""}`,
24826
+ style: { marginTop: 0 },
24827
+ onClick: handleAddToBagClick,
24828
+ type: "button",
24829
+ disabled: addToBagState !== "idle",
24830
+ children: [
24831
+ addToBagState === "added" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIcon$1, { size: 16 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShoppingBagIcon, { size: 17 }),
24832
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: addToBagState === "added" ? t2("Added to bag") : addToBagState === "adding" ? t2("Adding...") : resolvedAddToBagLabel })
24833
+ ]
24834
+ }
24835
+ )
24836
+ ] });
24837
+ }
24838
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
24839
+ "button",
24840
+ {
24841
+ className: "ps-tryon-v2-cta",
24842
+ style: { marginTop: 0 },
24843
+ onClick: handleContinueAction,
24844
+ type: "button",
24845
+ children: [
24846
+ resolvedContinueShoppingLabel,
24847
+ " →"
24848
+ ]
24849
+ }
24850
+ );
24851
+ }, [
24852
+ canAddToBag,
24853
+ addToBagState,
24854
+ handleBackToProductPageAction,
24855
+ handleAddToBagClick,
24856
+ handleContinueAction,
24857
+ isHistoryResult,
24858
+ resolvedAddToBagLabel,
24859
+ resolvedBackToProductPageLabel,
24860
+ resolvedContinueShoppingLabel,
24861
+ t2
24862
+ ]);
24342
24863
  const cellVal = reactExports.useCallback((row, colIdx, header) => {
24343
24864
  return cellValFn(row, colIdx, header);
24344
24865
  }, []);
@@ -24827,7 +25348,8 @@ function SizeResultView({
24827
25348
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24828
25349
  })(),
24829
25350
  onBack: () => setActiveSection(null),
24830
- onContinue: onContinueShopping || onClose,
25351
+ onContinue: handleContinueAction,
25352
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
24831
25353
  internationalSizes: entry.secResult?.internationalSizes,
24832
25354
  productImage: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24833
25355
  productTitle,
@@ -24927,7 +25449,8 @@ function SizeResultView({
24927
25449
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24928
25450
  })(),
24929
25451
  onBack: () => setActiveSection(null),
24930
- onContinue: onContinueShopping || onClose,
25452
+ onContinue: handleContinueAction,
25453
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
24931
25454
  internationalSizes: entry.secResult?.internationalSizes,
24932
25455
  tryOnProcessing,
24933
25456
  tryOnStartedAt,
@@ -24970,7 +25493,8 @@ function SizeResultView({
24970
25493
  setGuideFile(selectedFile || null);
24971
25494
  setShowPhotoGuide(true);
24972
25495
  },
24973
- onClose: onContinueShopping || onClose,
25496
+ onClose: handleContinueAction,
25497
+ resultActionNode: canAddToBag || isHistoryResult ? renderShoppingCta() : void 0,
24974
25498
  showLines,
24975
25499
  onToggleLines: suppressFitOverlayActions ? void 0 : () => setShowLines(!showLines),
24976
25500
  onOpenImage: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0,
@@ -25114,29 +25638,7 @@ function SizeResultView({
25114
25638
  " ",
25115
25639
  t2("Back")
25116
25640
  ] }),
25117
- resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
25118
- "button",
25119
- {
25120
- className: "ps-tryon-v2-cta",
25121
- style: { marginTop: 0 },
25122
- onClick: onContinueShopping || onClose,
25123
- children: [
25124
- t2("Continue Shopping"),
25125
- " →"
25126
- ]
25127
- }
25128
- ) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
25129
- "button",
25130
- {
25131
- className: "ps-tryon-v2-cta",
25132
- style: { marginTop: 0 },
25133
- onClick: onContinueShopping || onClose,
25134
- children: [
25135
- t2("Continue Shopping"),
25136
- " →"
25137
- ]
25138
- }
25139
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25641
+ canAddToBag || isHistoryResult || resultImageUrl && !tryOnProcessing || vtoExcluded ? renderShoppingCta() : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25140
25642
  "button",
25141
25643
  {
25142
25644
  className: "ps-tryon-v2-cta",
@@ -25200,11 +25702,12 @@ function SizeResultView({
25200
25702
  if (resultImageUrl) onResetTryOn?.();
25201
25703
  setView("body-profile");
25202
25704
  },
25203
- onContinue: onContinueShopping || onClose,
25705
+ onContinue: handleContinueAction,
25204
25706
  backLabel: t2("Back"),
25205
25707
  internationalSizes: singleInternationalSizes,
25206
- onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25207
- continueLabel: resultImageUrl ? t2("Done") : void 0,
25708
+ onTryOn: canAddToBag || isHistoryResult || resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25709
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
25710
+ continueLabel: resultImageUrl ? resolvedContinueShoppingLabel : void 0,
25208
25711
  tryOnProcessing,
25209
25712
  tryOnStartedAt,
25210
25713
  productImage: resultImageUrl || productImage,
@@ -25294,18 +25797,14 @@ function SizeResultView({
25294
25797
  chartUnit: resultUnit,
25295
25798
  lengthEntry: null,
25296
25799
  onBack: () => {
25297
- if (resultImageUrl) {
25298
- onResetTryOn?.();
25299
- setView("body-profile");
25300
- } else {
25301
- setActiveSection(null);
25302
- }
25800
+ setActiveSection(null);
25303
25801
  },
25304
- onContinue: onContinueShopping || onClose,
25802
+ onContinue: handleContinueAction,
25305
25803
  backLabel: t2("Back"),
25306
25804
  internationalSizes: singleInternationalSizes,
25307
- onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25308
- continueLabel: resultImageUrl ? t2("Continue Shopping") : void 0,
25805
+ onTryOn: canAddToBag || isHistoryResult || resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25806
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
25807
+ continueLabel: resultImageUrl ? resolvedContinueShoppingLabel : void 0,
25309
25808
  tryOnProcessing,
25310
25809
  tryOnStartedAt,
25311
25810
  onFeedbackSubmit: onTryOnFeedbackSubmit,
@@ -25321,35 +25820,35 @@ function SizeResultView({
25321
25820
  ) : (
25322
25821
  /* CARD VIEW — clickable summary card + gallery strip */
25323
25822
  /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
25324
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-copy", children: [
25325
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: guideOnlyResult ? t2("Product Size Guide") : t2("Your Size Recommendation") }),
25326
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: guideOnlyResult ? t2("Tap the card to view product measurements") : t2("Tap the card for detailed breakdown") })
25327
- ] }) }),
25328
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }),
25823
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) }) : null,
25824
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }) : null,
25329
25825
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
25330
25826
  "button",
25331
25827
  {
25332
- className: `ps-tryon-sr-card-v2 ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25828
+ className: `ps-tryon-sr-card-v2 ps-summary-card ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25333
25829
  onClick: () => setActiveSection(sectionName),
25334
25830
  type: "button",
25335
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text", children: [
25336
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-label", children: sectionName }),
25337
- (() => {
25338
- const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "—");
25339
- const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25340
- const isLong = labelText.length > 12;
25341
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText });
25342
- })(),
25343
- /* @__PURE__ */ jsxRuntimeExports.jsx(
25344
- "span",
25345
- {
25346
- className: `ps-tryon-sr-card-v2-rec-pill${pendingCustomSizes[sectionName] ? " is-overridden" : ""}`,
25347
- children: guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED")
25348
- }
25349
- ),
25350
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-view", children: [
25351
- t2("VIEW DETAILS"),
25352
- " ",
25831
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text ps-summary-card-layout", children: [
25832
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-summary-card-copy", children: [
25833
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-summary-title", children: guideOnlyResult ? t2("Product Size Guide") : t2("Recommended size") }),
25834
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-main", children: [
25835
+ (() => {
25836
+ const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "—");
25837
+ const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25838
+ const isLong = labelText.length > 12;
25839
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText });
25840
+ })(),
25841
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
25842
+ "span",
25843
+ {
25844
+ className: `ps-tryon-sr-card-v2-rec-pill${pendingCustomSizes[sectionName] ? " is-overridden" : ""}`,
25845
+ children: guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED")
25846
+ }
25847
+ )
25848
+ ] })
25849
+ ] }),
25850
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-open-pill", children: [
25851
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: guideOnlyResult ? t2("View chart") : t2("View measurements") }),
25353
25852
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "›" })
25354
25853
  ] })
25355
25854
  ] })
@@ -25373,13 +25872,7 @@ function SizeResultView({
25373
25872
  ]
25374
25873
  }
25375
25874
  ),
25376
- resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
25377
- t2("Continue Shopping"),
25378
- " →"
25379
- ] }) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
25380
- t2("Continue Shopping"),
25381
- " →"
25382
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25875
+ canAddToBag || isHistoryResult || resultImageUrl && !tryOnProcessing || vtoExcluded ? renderShoppingCta() : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25383
25876
  "button",
25384
25877
  {
25385
25878
  className: "ps-tryon-v2-cta",
@@ -26491,6 +26984,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26491
26984
  const seededHeight = draftHeightParts(initialDraft, seededUnit);
26492
26985
  const seededGender = initialDraft?.gender === "female" ? "female" : "male";
26493
26986
  const seededPhotoRef = reactExports.useRef(initialDraft?.photoBase64 || initialDraft?.photoUrl || null);
26987
+ const seededMeasurements = initialDraft?.measurements && Object.keys(initialDraft.measurements).length > 0 ? initialDraft.measurements : null;
26494
26988
  const [mode, setMode] = reactExports.useState(initialMode ?? null);
26495
26989
  const [manualStep, setManualStep] = reactExports.useState("identity");
26496
26990
  const [imageStep, setImageStep] = reactExports.useState("name-photo");
@@ -26710,6 +27204,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26710
27204
  bandSize: isWomen ? bandSize || void 0 : void 0,
26711
27205
  cupSize: isWomen ? cupSize || void 0 : void 0,
26712
27206
  ...isWomen && bandSize && cupSize ? { braSizeRegion } : {},
27207
+ ...initialDraft?.measurements ? { measurements: initialDraft.measurements, measurementsUnit: initialDraft.measurementsUnit || "cm" } : {},
26713
27208
  ...initialDraft?.customMeasurements ? { customMeasurements: initialDraft.customMeasurements } : {}
26714
27209
  };
26715
27210
  };
@@ -26729,6 +27224,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26729
27224
  ...isWomen && bandSize ? { bandSize } : {},
26730
27225
  ...isWomen && cupSize ? { cupSize } : {},
26731
27226
  ...isWomen && bandSize && cupSize ? { braSizeRegion } : {},
27227
+ ...initialDraft?.measurements ? { measurements: initialDraft.measurements, measurementsUnit: initialDraft.measurementsUnit || "cm" } : {},
26732
27228
  ...initialDraft?.customMeasurements ? { customMeasurements: initialDraft.customMeasurements } : {},
26733
27229
  photoBase64: photoBase64 || void 0
26734
27230
  };
@@ -26801,13 +27297,14 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26801
27297
  setError(t2("Please upload a photo"));
26802
27298
  return;
26803
27299
  }
26804
- if (unit === "in") {
27300
+ const canUseSeededMeasurements = directAnalysisFlow && !!seededMeasurements;
27301
+ if (!canUseSeededMeasurements && unit === "in") {
26805
27302
  const ft = parseFloat(heightFt);
26806
27303
  if (!ft || ft < 3 || ft > 8) {
26807
27304
  setError(t2("Please enter a valid height"));
26808
27305
  return;
26809
27306
  }
26810
- } else {
27307
+ } else if (!canUseSeededMeasurements) {
26811
27308
  const cm = parseFloat(heightVal);
26812
27309
  if (!cm || cm < 100 || cm > 250) {
26813
27310
  setError(t2("Please enter a valid height"));
@@ -26815,7 +27312,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26815
27312
  }
26816
27313
  }
26817
27314
  const w2 = parseFloat(weightVal);
26818
- if (!w2 || w2 <= 0) {
27315
+ if (!canUseSeededMeasurements && (!w2 || w2 <= 0)) {
26819
27316
  setError(t2("Please enter a valid weight"));
26820
27317
  return;
26821
27318
  }
@@ -26829,8 +27326,8 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26829
27326
  setEstimating(true);
26830
27327
  const MIN_HOLD_MS = 6e3;
26831
27328
  const minHold = new Promise((r2) => setTimeout(r2, MIN_HOLD_MS));
26832
- let liveEstimates = null;
26833
- if (onEstimate && photoBase64) {
27329
+ let liveEstimates = seededMeasurements;
27330
+ if (!canUseSeededMeasurements && onEstimate && photoBase64) {
26834
27331
  const heightRaw = unit === "in" ? (parseInt(heightFt, 10) || 0) * 12 + (parseInt(heightInch, 10) || 0) : parseFloat(heightVal);
26835
27332
  try {
26836
27333
  const result = await onEstimate({
@@ -26875,7 +27372,8 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26875
27372
  if (mode !== "image" || imageStep !== "name-photo") return;
26876
27373
  const hasHeight = unit === "in" ? parseFloat(heightFt) > 0 || parseFloat(heightInch) > 0 : parseFloat(heightVal) > 0;
26877
27374
  const hasWeight = parseFloat(weightVal) > 0;
26878
- if (!photoBase64 || !name.trim() || !hasHeight || !hasWeight) return;
27375
+ const canUseSeededMeasurements = directAnalysisFlow && !!seededMeasurements;
27376
+ if (!photoBase64 || !name.trim() || !canUseSeededMeasurements && (!hasHeight || !hasWeight)) return;
26879
27377
  directAutoStartedRef.current = true;
26880
27378
  void advanceImage();
26881
27379
  }, [directAnalysisFlow, mode, imageStep, photoBase64, name, heightFt, heightInch, heightVal, weightVal, unit]);
@@ -28844,6 +29342,7 @@ function PhotoStepMobile({
28844
29342
  photoStatus,
28845
29343
  photoRejection,
28846
29344
  onClearRejection,
29345
+ photoHelpSlot,
28847
29346
  bodyContextSlot,
28848
29347
  hideTabs = false,
28849
29348
  t: t2
@@ -28868,6 +29367,7 @@ function PhotoStepMobile({
28868
29367
  }
28869
29368
  ),
28870
29369
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-pm-preview${compactAgeGate ? " ps-pm-preview-tall" : ""}`, children: [
29370
+ !hasPhoto && photoHelpSlot,
28871
29371
  hasPhoto ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
28872
29372
  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: photoPreview, alt: t2("Your photo"), className: "ps-pm-preview-img" }),
28873
29373
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -29424,6 +29924,7 @@ function BodyProfileView({
29424
29924
  basicOnly = false,
29425
29925
  initialStep,
29426
29926
  simplePhotoOnly = false,
29927
+ simpleAccessoryLayout = false,
29427
29928
  simpleQuestionMode = "heightWeight",
29428
29929
  formRef,
29429
29930
  sizingCountry,
@@ -29588,6 +30089,7 @@ function BodyProfileView({
29588
30089
  setPhotoProcessing(true);
29589
30090
  setPhotoStatus(t2("Analyzing photo…"));
29590
30091
  setPhotoFile(file);
30092
+ setPhotoHelpOpen(false);
29591
30093
  const previewUrl = URL.createObjectURL(file);
29592
30094
  setPhotoPreview(previewUrl);
29593
30095
  try {
@@ -30214,6 +30716,7 @@ function BodyProfileView({
30214
30716
  }
30215
30717
  const analyzeDisabled = analyzeMissing.length > 0;
30216
30718
  const analyzeLabel = analyzeDisabled ? analyzeMissing[0] ?? t2("Analyze My Size") : t2("Analyze My Size");
30719
+ const compactHeightWeightAccessory = simplePhotoOnly && simpleAccessoryLayout && !isShoeReferenceMode;
30217
30720
  if (isMobile) {
30218
30721
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-wrapper", children: [
30219
30722
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-scan-progress", children: [
@@ -30231,19 +30734,6 @@ function BodyProfileView({
30231
30734
  ] }),
30232
30735
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-scan-progress-spacer", "aria-hidden": "true" })
30233
30736
  ] }),
30234
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-scan-help-row", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30235
- "button",
30236
- {
30237
- type: "button",
30238
- onClick: () => setPhotoHelpOpen((v2) => !v2),
30239
- "aria-label": t2("How to take a good photo"),
30240
- className: `ps-pm-help-pill ps-bp-scan-help-pill${photoHelpOpen ? " ps-active" : ""}`,
30241
- children: [
30242
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-pm-help-pill-q", "aria-hidden": "true", children: "?" }),
30243
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30244
- ]
30245
- }
30246
- ) }),
30247
30737
  /* @__PURE__ */ jsxRuntimeExports.jsx(
30248
30738
  PhotoStepMobile,
30249
30739
  {
@@ -30268,11 +30758,27 @@ function BodyProfileView({
30268
30758
  photoStatus,
30269
30759
  photoRejection,
30270
30760
  onClearRejection: () => setPhotoRejection(null),
30761
+ photoHelpSlot: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30762
+ "button",
30763
+ {
30764
+ type: "button",
30765
+ onClick: (e) => {
30766
+ e.stopPropagation();
30767
+ setPhotoHelpOpen((v2) => !v2);
30768
+ },
30769
+ "aria-label": t2("How to take a good photo"),
30770
+ className: `ps-bp-photo-help-chip${photoHelpOpen ? " ps-active" : ""}`,
30771
+ children: [
30772
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-chip-mark", "aria-hidden": "true", children: "?" }),
30773
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30774
+ ]
30775
+ }
30776
+ ),
30271
30777
  hideTabs: simplePhotoOnly,
30272
30778
  t: t2
30273
30779
  }
30274
30780
  ),
30275
- photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30781
+ !photoPreview && photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30276
30782
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-backdrop", onClick: () => setPhotoHelpOpen(false), "aria-hidden": "true" }),
30277
30783
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { role: "dialog", "aria-label": t2("How to take the best photo"), className: "ps-bp-photo-help", children: [
30278
30784
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
@@ -30332,7 +30838,7 @@ function BodyProfileView({
30332
30838
  ] });
30333
30839
  }
30334
30840
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-wrapper", children: [
30335
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: "1.2vw", padding: "1.5vw", width: "100%", height: "100%", minHeight: "20vw", alignItems: "stretch", position: "relative" }, children: [
30841
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: "1.2vw", padding: "1.5vw", width: "100%", flex: "1 1 auto", minHeight: 0, alignItems: "stretch", position: "relative", overflow: "hidden" }, children: [
30336
30842
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, position: "relative", display: "flex", flexDirection: "column", gap: "0.7vw" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30337
30843
  "div",
30338
30844
  {
@@ -30390,6 +30896,95 @@ function BodyProfileView({
30390
30896
  overflow: "hidden"
30391
30897
  },
30392
30898
  children: [
30899
+ !photoPreview && /* @__PURE__ */ jsxRuntimeExports.jsxs(
30900
+ "button",
30901
+ {
30902
+ type: "button",
30903
+ onClick: (e) => {
30904
+ e.stopPropagation();
30905
+ setPhotoHelpOpen((v2) => !v2);
30906
+ },
30907
+ "aria-label": t2("How to take a good photo"),
30908
+ title: t2("How to take a good photo"),
30909
+ className: `ps-bp-photo-help-chip${photoHelpOpen ? " ps-active" : ""}`,
30910
+ children: [
30911
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-chip-mark", "aria-hidden": "true", children: "?" }),
30912
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30913
+ ]
30914
+ }
30915
+ ),
30916
+ !photoPreview && photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(
30917
+ "div",
30918
+ {
30919
+ role: "dialog",
30920
+ "aria-label": t2("How to take the best photo"),
30921
+ className: "ps-bp-photo-help ps-bp-photo-help-upload",
30922
+ onClick: (e) => e.stopPropagation(),
30923
+ children: [
30924
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
30925
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-header", children: [
30926
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-title", children: t2("How to take the best photo") }),
30927
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
30928
+ "button",
30929
+ {
30930
+ type: "button",
30931
+ onClick: () => setPhotoHelpOpen(false),
30932
+ "aria-label": t2("Close"),
30933
+ className: "ps-bp-photo-help-close",
30934
+ children: "×"
30935
+ }
30936
+ )
30937
+ ] }),
30938
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-do", children: [
30939
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30940
+ "✓ ",
30941
+ t2("Do")
30942
+ ] }),
30943
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30944
+ t2("Stand facing the camera with your full body in frame"),
30945
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30946
+ t2("Hold the phone at WAIST height (not eye level)"),
30947
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30948
+ t2("Stand with your HEELS against a wall for best accuracy"),
30949
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30950
+ t2("Use natural or even lighting (e.g. near a window)"),
30951
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30952
+ t2("Wear fitted, simple clothing (e.g. neutral colors)"),
30953
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30954
+ t2("Choose a plain background (a light wall is ideal)"),
30955
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30956
+ t2("Stand straight and still, arms relaxed by your sides")
30957
+ ] })
30958
+ ] }),
30959
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-dont", children: [
30960
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30961
+ "✗ ",
30962
+ t2("Don't")
30963
+ ] }),
30964
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30965
+ t2("Don't wear loose, baggy, or layered clothing"),
30966
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30967
+ t2("Don't sit, pose, or bend your body"),
30968
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30969
+ t2("Don't use strong backlighting"),
30970
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30971
+ t2("Don't take mirror photos or selfies"),
30972
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30973
+ t2("Don't apply filters, effects, or edits")
30974
+ ] })
30975
+ ] }),
30976
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-tip", children: [
30977
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
30978
+ "💡 ",
30979
+ t2("Quick Tip"),
30980
+ ":"
30981
+ ] }),
30982
+ " ",
30983
+ t2("The simpler your photo is, the more accurate your virtual try-on results will be.")
30984
+ ] })
30985
+ ]
30986
+ }
30987
+ ),
30393
30988
  photoProcessing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-overlay", onClick: (e) => e.stopPropagation(), children: [
30394
30989
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-overlay-spinner", "aria-hidden": "true" }),
30395
30990
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-overlay-label", children: photoStatus || t2("Analyzing photo…") })
@@ -30608,64 +31203,24 @@ function BodyProfileView({
30608
31203
  background: "linear-gradient(to bottom, transparent 0%, var(--ps-border-subtle) 18%, var(--ps-border-subtle) 82%, transparent 100%)",
30609
31204
  flexShrink: 0
30610
31205
  } }),
30611
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "flex-start", position: "relative", gap: "0.8vw" }, children: isShoeReferenceMode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-shoe-ref-desktop", children: renderShoeReferenceFields() }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30612
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
30613
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "0.6vw" }, children: [
30614
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { style: { margin: 0, fontSize: "1vw", fontWeight: 700, color: "var(--ps-text-primary)" }, children: t2("Body details") }),
30615
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
30616
- "button",
30617
- {
30618
- type: "button",
30619
- onClick: () => setPhotoHelpOpen((v2) => !v2),
30620
- "aria-label": t2("How to take a good photo"),
30621
- title: t2("How to take a good photo"),
30622
- style: {
30623
- display: "inline-flex",
30624
- alignItems: "center",
30625
- gap: "0.35vw",
30626
- padding: "0.4vw 0.7vw",
30627
- background: photoHelpOpen ? "var(--ps-accent)" : "transparent",
30628
- color: photoHelpOpen ? "#FFFFFF" : "var(--ps-accent)",
30629
- border: `1.5px solid var(--ps-accent)`,
30630
- borderRadius: "999px",
30631
- cursor: "pointer",
30632
- fontFamily: "inherit",
30633
- fontSize: "0.58vw",
30634
- fontWeight: 700,
30635
- letterSpacing: "0.04em",
30636
- whiteSpace: "nowrap",
30637
- transition: "background 0.15s, color 0.15s",
30638
- flexShrink: 0
30639
- },
30640
- children: [
30641
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
30642
- display: "inline-flex",
30643
- alignItems: "center",
30644
- justifyContent: "center",
30645
- width: "0.95vw",
30646
- height: "0.95vw",
30647
- minWidth: "14px",
30648
- minHeight: "14px",
30649
- borderRadius: "50%",
30650
- background: photoHelpOpen ? "#FFFFFF" : "var(--ps-accent)",
30651
- color: photoHelpOpen ? "var(--ps-accent)" : "#FFFFFF",
30652
- fontSize: "0.65vw",
30653
- fontWeight: 700,
30654
- lineHeight: 1
30655
- }, "aria-hidden": "true", children: "?" }),
30656
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30657
- ]
30658
- }
30659
- )
30660
- ] }),
30661
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { margin: "0.2vw 0 0", fontSize: "0.65vw", color: "var(--ps-text-muted)" }, children: t2("These calibrate the AI — all required.") })
30662
- ] }),
30663
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center", marginTop: "1.2vw" }, children: [
30664
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${!isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToMetric, type: "button", children: t2("Metric") }),
30665
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToImperial, type: "button", children: t2("Imperial") })
31206
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
31207
+ flex: compactHeightWeightAccessory ? "0 1 min(34vw, 360px)" : 1,
31208
+ display: "flex",
31209
+ flexDirection: "column",
31210
+ justifyContent: compactHeightWeightAccessory ? "center" : "flex-start",
31211
+ position: "relative",
31212
+ gap: compactHeightWeightAccessory ? "1.1vw" : "0.8vw",
31213
+ minWidth: compactHeightWeightAccessory ? "280px" : void 0
31214
+ }, children: isShoeReferenceMode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-shoe-ref-desktop", children: renderShoeReferenceFields() }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
31215
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-bp-photo-details-head${compactHeightWeightAccessory ? " ps-bp-photo-details-head-simple" : ""}`, children: [
31216
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: t2("Body details") }),
31217
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-system-toggle ps-bp-system-toggle-compact", children: [
31218
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${!isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToMetric, type: "button", children: t2("Metric") }),
31219
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToImperial, type: "button", children: t2("Imperial") })
31220
+ ] })
30666
31221
  ] }),
30667
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: [
30668
- activeProfileName && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card", children: [
31222
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: compactHeightWeightAccessory ? "0.35vw" : "0.15vw", marginBottom: 0, minHeight: 0 }, children: [
31223
+ activeProfileName && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card ps-bp-profile-card-compact", children: [
30669
31224
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card-copy", children: [
30670
31225
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-profile-card-eyebrow", children: t2("Active Profile") }),
30671
31226
  /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: activeProfileName }),
@@ -30749,87 +31304,6 @@ function BodyProfileView({
30749
31304
  ] })
30750
31305
  ] })
30751
31306
  ] })
30752
- ] }),
30753
- photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30754
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30755
- "div",
30756
- {
30757
- className: "ps-bp-photo-help-backdrop",
30758
- onClick: () => setPhotoHelpOpen(false),
30759
- "aria-hidden": "true"
30760
- }
30761
- ),
30762
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
30763
- "div",
30764
- {
30765
- role: "dialog",
30766
- "aria-label": t2("How to take the best photo"),
30767
- className: "ps-bp-photo-help",
30768
- children: [
30769
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
30770
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-header", children: [
30771
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-title", children: t2("How to take the best photo") }),
30772
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30773
- "button",
30774
- {
30775
- type: "button",
30776
- onClick: () => setPhotoHelpOpen(false),
30777
- "aria-label": t2("Close"),
30778
- className: "ps-bp-photo-help-close",
30779
- children: "×"
30780
- }
30781
- )
30782
- ] }),
30783
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-do", children: [
30784
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30785
- "✓ ",
30786
- t2("Do")
30787
- ] }),
30788
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30789
- t2("Stand facing the camera with your full body in frame"),
30790
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30791
- t2("Hold the phone at WAIST height (not eye level)"),
30792
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30793
- t2("Stand with your HEELS against a wall for best accuracy"),
30794
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30795
- t2("Use natural or even lighting (e.g. near a window)"),
30796
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30797
- t2("Wear fitted, simple clothing (e.g. neutral colors)"),
30798
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30799
- t2("Choose a plain background (a light wall is ideal)"),
30800
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30801
- t2("Stand straight and still, arms relaxed by your sides")
30802
- ] })
30803
- ] }),
30804
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-dont", children: [
30805
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30806
- "✗ ",
30807
- t2("Don't")
30808
- ] }),
30809
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30810
- t2("Don't wear loose, baggy, or layered clothing"),
30811
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30812
- t2("Don't sit, pose, or bend your body"),
30813
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30814
- t2("Don't use strong backlighting"),
30815
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30816
- t2("Don't take mirror photos or selfies"),
30817
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30818
- t2("Don't apply filters, effects, or edits")
30819
- ] })
30820
- ] }),
30821
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-tip", children: [
30822
- /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
30823
- "💡 ",
30824
- t2("Quick Tip"),
30825
- ":"
30826
- ] }),
30827
- " ",
30828
- t2("The simpler your photo is, the more accurate your virtual try-on results will be.")
30829
- ] })
30830
- ]
30831
- }
30832
- )
30833
31307
  ] })
30834
31308
  ] }) })
30835
31309
  ] }),
@@ -32506,6 +32980,31 @@ function validMidsectionProfile(value) {
32506
32980
  function validHipProfile(value) {
32507
32981
  return value === "narrow" || value === "average" || value === "full" ? value : void 0;
32508
32982
  }
32983
+ async function profilePhotoFromFile(file) {
32984
+ try {
32985
+ return await compressImage(file, { maxDimension: 1280, quality: 0.92 });
32986
+ } catch {
32987
+ return new Promise((resolve) => {
32988
+ try {
32989
+ const reader = new FileReader();
32990
+ reader.onload = () => resolve(typeof reader.result === "string" ? reader.result : null);
32991
+ reader.onerror = () => resolve(null);
32992
+ reader.readAsDataURL(file);
32993
+ } catch {
32994
+ resolve(null);
32995
+ }
32996
+ });
32997
+ }
32998
+ }
32999
+ function cleanProfileMeasurements(value) {
33000
+ if (!value || typeof value !== "object") return void 0;
33001
+ const measurements = {};
33002
+ for (const [key, raw] of Object.entries(value)) {
33003
+ const n2 = positiveNumber(raw);
33004
+ if (n2 != null) measurements[key] = n2;
33005
+ }
33006
+ return Object.keys(measurements).length > 0 ? measurements : void 0;
33007
+ }
32509
33008
  function durableHistoryImageUrl(url) {
32510
33009
  if (!url) return void 0;
32511
33010
  const clean = url.trim();
@@ -32596,6 +33095,7 @@ function PrimeStyleTryonInner({
32596
33095
  productImages,
32597
33096
  productCarouselItems,
32598
33097
  garmentReferenceImage,
33098
+ garmentDetailImage,
32599
33099
  productTitle = "Product",
32600
33100
  productUrl,
32601
33101
  productId,
@@ -32627,6 +33127,10 @@ function PrimeStyleTryonInner({
32627
33127
  onProcessing,
32628
33128
  onComplete,
32629
33129
  onError,
33130
+ onAddToBag,
33131
+ addToBagLabel,
33132
+ continueShoppingLabel,
33133
+ backToProductPageLabel,
32630
33134
  sizeGuideData,
32631
33135
  initialView,
32632
33136
  initialBodyProfileStep
@@ -32837,7 +33341,9 @@ function PrimeStyleTryonInner({
32837
33341
  const [profileSession, setProfileSession] = reactExports.useState(() => getStoredProfileSession());
32838
33342
  const profileSessionRef = reactExports.useRef(profileSession);
32839
33343
  const suppressNextProfilePersistRef = reactExports.useRef(false);
32840
- const [profileCompletionDraft, setProfileCompletionDraft] = reactExports.useState(() => getStoredProfileSession() ? null : lsGet(PROFILE_COMPLETION_DRAFT_KEY, null));
33344
+ const [profileCompletionDraft, setProfileCompletionDraft] = reactExports.useState(
33345
+ () => lsGet(PROFILE_COMPLETION_DRAFT_KEY, null)
33346
+ );
32841
33347
  const [profileAuthError, setProfileAuthError] = reactExports.useState(null);
32842
33348
  const [profileAuthLoadingProvider, setProfileAuthLoadingProvider] = reactExports.useState(null);
32843
33349
  const [history, setHistory] = reactExports.useState(() => lsGet("history", []).map(normalizeHistoryEntry));
@@ -32851,6 +33357,7 @@ function PrimeStyleTryonInner({
32851
33357
  const [restoredProductCarouselItems, setRestoredProductCarouselItems] = reactExports.useState(null);
32852
33358
  const [restoredProductTitle, setRestoredProductTitle] = reactExports.useState(null);
32853
33359
  const [restoredProductUrl, setRestoredProductUrl] = reactExports.useState(null);
33360
+ const [restoredHistoryEntryId, setRestoredHistoryEntryId] = reactExports.useState(null);
32854
33361
  const [activeProfileId, setActiveProfileIdState] = reactExports.useState(() => getActiveProfileId());
32855
33362
  const [estimatingProfileIds, setEstimatingProfileIds] = reactExports.useState(() => /* @__PURE__ */ new Set());
32856
33363
  const [deleteConfirmId, setDeleteConfirmId] = reactExports.useState(null);
@@ -32879,25 +33386,35 @@ function PrimeStyleTryonInner({
32879
33386
  lsRemove(PROFILE_COMPLETION_DRAFT_KEY);
32880
33387
  setProfileCompletionDraft(null);
32881
33388
  }, []);
32882
- const handleCompleteProfileFromResult = reactExports.useCallback(() => {
33389
+ const buildProfileCompletionDraft = reactExports.useCallback((photoBase64) => {
32883
33390
  const f2 = formRef.current || {};
32884
33391
  const active = profiles.find((p2) => p2.id === activeProfileId) || null;
32885
33392
  const gender = f2.gender === "female" || active?.gender === "female" ? "female" : "male";
32886
- const profilePhoto = f2.photoBase64 || f2.bodyImage || active?.photoBase64 || active?.photoUrl;
32887
- const normalizedProfilePhoto = profilePhoto ? normalizeProfilePhotoSource(profilePhoto) : null;
32888
33393
  const customMeasurements = {};
32889
33394
  const wristCircumference = positiveNumber(f2.wristCircumference);
32890
33395
  if (wristCircumference != null) customMeasurements.wristCircumference = wristCircumference;
32891
- const draft = {
33396
+ const resultMeasurements = cleanProfileMeasurements(sizingResult?.estimates);
33397
+ const resultMeasurementsUnit = sizingResult?.estimatesUnit === "in" ? "in" : "cm";
33398
+ const formHeight = positiveNumber(f2.height);
33399
+ const activeHeight = positiveNumber(active?.height ?? active?.heightCm);
33400
+ const estimateHeight = positiveNumber(resultMeasurements?.height);
33401
+ const formWeight = positiveNumber(f2.weight);
33402
+ const activeWeight = positiveNumber(active?.weight ?? active?.weightKg);
33403
+ const estimateWeight = positiveNumber(resultMeasurements?.weight);
33404
+ const height = formHeight ?? activeHeight ?? estimateHeight;
33405
+ const weight = formWeight ?? activeWeight ?? estimateWeight;
33406
+ const heightUnitForDraft = formHeight != null ? f2.heightUnit || active?.heightUnit || heightUnit : activeHeight != null ? active?.heightUnit || heightUnit : estimateHeight != null ? resultMeasurementsUnit : f2.heightUnit || active?.heightUnit || heightUnit;
33407
+ const weightUnitForDraft = formWeight != null ? f2.weightUnit || active?.weightUnit || weightUnit : activeWeight != null ? active?.weightUnit || weightUnit : estimateWeight != null ? resultMeasurementsUnit : f2.weightUnit || active?.weightUnit || weightUnit;
33408
+ return {
32892
33409
  source: "size-result",
32893
33410
  createdAt: Date.now(),
32894
33411
  productId: effectiveProductId,
32895
33412
  productTitle,
32896
33413
  gender,
32897
- height: positiveNumber(f2.height) ?? positiveNumber(active?.height ?? active?.heightCm),
32898
- weight: positiveNumber(f2.weight) ?? positiveNumber(active?.weight ?? active?.weightKg),
32899
- heightUnit: f2.heightUnit || active?.heightUnit || heightUnit,
32900
- weightUnit: f2.weightUnit || active?.weightUnit || weightUnit,
33414
+ ...height != null ? { height } : {},
33415
+ ...weight != null ? { weight } : {},
33416
+ heightUnit: heightUnitForDraft,
33417
+ weightUnit: weightUnitForDraft,
32901
33418
  sizingUnit: active?.sizingUnit || sizingUnit,
32902
33419
  age: positiveNumber(f2.age) ?? positiveNumber(active?.age),
32903
33420
  chestProfile: validChestProfile(f2.chestProfile || active?.chestProfile),
@@ -32906,15 +33423,23 @@ function PrimeStyleTryonInner({
32906
33423
  bandSize: f2.bandSize || active?.bandSize,
32907
33424
  cupSize: f2.cupSize || active?.cupSize,
32908
33425
  braSizeRegion: f2.braSizeRegion || active?.braSizeRegion || "US",
32909
- ...normalizedProfilePhoto ? { photoBase64: normalizedProfilePhoto } : {},
33426
+ ...photoBase64 ? { photoBase64 } : {},
33427
+ ...resultMeasurements ? { measurements: resultMeasurements, measurementsUnit: resultMeasurementsUnit } : {},
32910
33428
  ...Object.keys(customMeasurements).length > 0 ? { customMeasurements } : {}
32911
33429
  };
32912
- if (profileSessionRef.current) lsRemove(PROFILE_COMPLETION_DRAFT_KEY);
32913
- else lsSet(PROFILE_COMPLETION_DRAFT_KEY, draft);
33430
+ }, [activeProfileId, effectiveProductId, heightUnit, productTitle, profiles, sizingResult, sizingUnit, weightUnit]);
33431
+ const handleCompleteProfileFromResult = reactExports.useCallback(async () => {
33432
+ const f2 = formRef.current || {};
33433
+ const active = profiles.find((p2) => p2.id === activeProfileId) || null;
33434
+ const file = selectedFile || selectedFileRef.current;
33435
+ const profilePhoto = f2.photoBase64 || f2.bodyImage || (file ? await profilePhotoFromFile(file) : null) || active?.photoBase64 || active?.photoUrl;
33436
+ const normalizedProfilePhoto = profilePhoto ? normalizeProfilePhotoSource(profilePhoto) : null;
33437
+ const draft = buildProfileCompletionDraft(normalizedProfilePhoto);
33438
+ lsSet(PROFILE_COMPLETION_DRAFT_KEY, draft);
32914
33439
  setProfileCompletionDraft(draft);
32915
33440
  setProfileAuthError(null);
32916
33441
  setView("profiles");
32917
- }, [activeProfileId, effectiveProductId, heightUnit, productTitle, profiles, sizingUnit, weightUnit]);
33442
+ }, [activeProfileId, buildProfileCompletionDraft, profiles, selectedFile]);
32918
33443
  const applyProfileStore = reactExports.useCallback((nextProfiles, nextActiveProfileId, persistLocal = !profileSessionRef.current) => {
32919
33444
  if (persistLocal) saveProfiles(nextProfiles);
32920
33445
  setProfiles(nextProfiles);
@@ -32949,6 +33474,9 @@ function PrimeStyleTryonInner({
32949
33474
  profileSessionRef.current = session;
32950
33475
  setProfileSession(session);
32951
33476
  await hydrateProfileStore(session, profiles, activeProfileId);
33477
+ setProfileCompletionDraft(
33478
+ (current) => current ?? lsGet(PROFILE_COMPLETION_DRAFT_KEY, null)
33479
+ );
32952
33480
  } catch (error) {
32953
33481
  setProfileAuthError(error instanceof Error ? error.message : t2("Social login failed. Please try again."));
32954
33482
  } finally {
@@ -32993,6 +33521,7 @@ function PrimeStyleTryonInner({
32993
33521
  const modelImageIdRef = reactExports.useRef(null);
32994
33522
  const autoTryOnFiredRef = reactExports.useRef(false);
32995
33523
  const bestGarmentImageRef = reactExports.useRef(null);
33524
+ const bestGarmentDetailImageRef = reactExports.useRef(null);
32996
33525
  reactExports.useEffect(() => {
32997
33526
  try {
32998
33527
  const key = getApiKey();
@@ -33032,6 +33561,7 @@ function PrimeStyleTryonInner({
33032
33561
  productTitle
33033
33562
  });
33034
33563
  bestGarmentImageRef.current = null;
33564
+ bestGarmentDetailImageRef.current = garmentDetailImage || null;
33035
33565
  if (garmentReferenceImage) {
33036
33566
  bestGarmentImageRef.current = garmentReferenceImage;
33037
33567
  console.log(`[ps-sdk:pick] #${fireN} early-return — using prop override`);
@@ -33057,8 +33587,9 @@ function PrimeStyleTryonInner({
33057
33587
  signal: ctrl.signal
33058
33588
  }).then((r2) => r2.ok ? r2.json() : null).then((j) => {
33059
33589
  if (j?.bestUrl) {
33060
- bestGarmentImageRef.current = j.bestUrl;
33061
- console.log(`[ps-sdk:pick] #${fireN} OK in ${Date.now() - t0}ms → ${j.bestUrl}`);
33590
+ bestGarmentImageRef.current = j.modelUrl || j.bestUrl;
33591
+ bestGarmentDetailImageRef.current = garmentDetailImage || j.detailUrl || null;
33592
+ console.log(`[ps-sdk:pick] #${fireN} ← OK in ${Date.now() - t0}ms → worn=${bestGarmentImageRef.current} detail=${bestGarmentDetailImageRef.current || "none"}`);
33062
33593
  } else {
33063
33594
  console.log(`[ps-sdk:pick] #${fireN} ← no bestUrl in response (${Date.now() - t0}ms)`);
33064
33595
  }
@@ -33069,7 +33600,7 @@ function PrimeStyleTryonInner({
33069
33600
  ctrl.abort();
33070
33601
  console.log(`[ps-sdk:pick] #${fireN} cleanup — aborted in-flight fetch`);
33071
33602
  };
33072
- }, [effectiveProductImages, garmentReferenceImage, apiUrl, productTitle, toBackendFetchableImageUrl]);
33603
+ }, [effectiveProductImages, garmentReferenceImage, garmentDetailImage, apiUrl, productTitle, toBackendFetchableImageUrl]);
33073
33604
  function summarizeSizeGuideForGender(value) {
33074
33605
  if (!value || typeof value !== "object") return void 0;
33075
33606
  const obj = value;
@@ -33474,6 +34005,7 @@ function PrimeStyleTryonInner({
33474
34005
  setRestoredProductCarouselItems(null);
33475
34006
  setRestoredProductTitle(null);
33476
34007
  setRestoredProductUrl(null);
34008
+ setRestoredHistoryEntryId(null);
33477
34009
  setRestoredProductUrl(null);
33478
34010
  setSizingLoading(true);
33479
34011
  setEstimationDone(hasStored);
@@ -33570,6 +34102,7 @@ function PrimeStyleTryonInner({
33570
34102
  setRestoredProductCarouselItems(null);
33571
34103
  setRestoredProductTitle(null);
33572
34104
  setRestoredProductUrl(null);
34105
+ setRestoredHistoryEntryId(null);
33573
34106
  if (!tryOnInFlight) {
33574
34107
  setResultImageUrl(null);
33575
34108
  setSizingResult(null);
@@ -34025,6 +34558,7 @@ function PrimeStyleTryonInner({
34025
34558
  setRestoredProductCarouselItems(null);
34026
34559
  setRestoredProductTitle(null);
34027
34560
  setRestoredProductUrl(null);
34561
+ setRestoredHistoryEntryId(null);
34028
34562
  if (previewUrl) URL.revokeObjectURL(previewUrl);
34029
34563
  setSelectedFile(null);
34030
34564
  selectedFileRef.current = null;
@@ -34086,6 +34620,7 @@ function PrimeStyleTryonInner({
34086
34620
  setRestoredProductImages(null);
34087
34621
  setRestoredProductCarouselItems(null);
34088
34622
  setRestoredProductTitle(null);
34623
+ setRestoredHistoryEntryId(null);
34089
34624
  completedRef.current = false;
34090
34625
  modelImageIdRef.current = null;
34091
34626
  noFitFoundRef.current = false;
@@ -34104,6 +34639,7 @@ function PrimeStyleTryonInner({
34104
34639
  if (measurementType === "face" || measurementType === "head") {
34105
34640
  setFaceLandmarks(null);
34106
34641
  const minVisible2 = new Promise((r2) => setTimeout(r2, 4500));
34642
+ let landmarksVisibleMin = null;
34107
34643
  try {
34108
34644
  const faceResult = await detectFaceMeasurements(objUrl);
34109
34645
  if (!faceResult) {
@@ -34116,7 +34652,10 @@ function PrimeStyleTryonInner({
34116
34652
  setSizingLoading(false);
34117
34653
  return;
34118
34654
  }
34119
- if (faceResult) setFaceLandmarks(faceResult.landmarks);
34655
+ if (faceResult) {
34656
+ setFaceLandmarks(faceResult.landmarks);
34657
+ landmarksVisibleMin = new Promise((r2) => setTimeout(r2, 1200));
34658
+ }
34120
34659
  const facePayload = {
34121
34660
  product: productContext,
34122
34661
  sizeGuide: sizeGuide ?? { found: false },
@@ -34145,7 +34684,7 @@ function PrimeStyleTryonInner({
34145
34684
  if (recRes.ok) {
34146
34685
  const recData = await recRes.json();
34147
34686
  if (recData?.found === false) {
34148
- await minVisible2;
34687
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34149
34688
  setNoSizeReason(recData?.reasoning === "NO_SIZE_CHART" ? "no-chart" : "no-match");
34150
34689
  setView("no-chart");
34151
34690
  setEstimationDone(true);
@@ -34169,7 +34708,7 @@ function PrimeStyleTryonInner({
34169
34708
  { skipBodyEstimate: true }
34170
34709
  );
34171
34710
  } else {
34172
- await minVisible2;
34711
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34173
34712
  const errBody = await recRes.text().catch(() => "");
34174
34713
  console.error("[ps-sdk] face-recommend failed:", recRes.status, errBody);
34175
34714
  setErrorMessage(t2("Unable to get size recommendation. Please try manual measurements."));
@@ -34180,14 +34719,14 @@ function PrimeStyleTryonInner({
34180
34719
  }
34181
34720
  } catch (err) {
34182
34721
  console.error("[ps-sdk] face-recommend failed:", err);
34183
- await minVisible2;
34722
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34184
34723
  setErrorMessage(t2("Unable to get size recommendation. Please try manual measurements."));
34185
34724
  setEstimationDone(true);
34186
34725
  setSizingLoading(false);
34187
34726
  setView("error");
34188
34727
  return;
34189
34728
  }
34190
- await minVisible2;
34729
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34191
34730
  setSizingLoading(false);
34192
34731
  return;
34193
34732
  }
@@ -34432,6 +34971,7 @@ function PrimeStyleTryonInner({
34432
34971
  }
34433
34972
  console.log("[ps-sdk:tryon] fitInfo built", { count: fitInfo?.length || 0, areas: fitInfo?.map((f2) => `${f2.area}(${f2.fit})`) });
34434
34973
  let garmentImage = productImage;
34974
+ let detailImage = garmentDetailImage || bestGarmentDetailImageRef.current || null;
34435
34975
  if (garmentReferenceImage) {
34436
34976
  garmentImage = garmentReferenceImage;
34437
34977
  } else if (bestGarmentImageRef.current) {
@@ -34444,6 +34984,9 @@ function PrimeStyleTryonInner({
34444
34984
  garmentImage = best;
34445
34985
  }
34446
34986
  }
34987
+ if (!detailImage && effectiveProductImages?.length) {
34988
+ detailImage = effectiveProductImages.find((img) => img && img !== garmentImage) || null;
34989
+ }
34447
34990
  const response = await apiRef.current.submitTryOn(
34448
34991
  modelImage,
34449
34992
  garmentImage,
@@ -34459,6 +35002,7 @@ function PrimeStyleTryonInner({
34459
35002
  productTags: productTagsList,
34460
35003
  productDescription,
34461
35004
  productMaterial,
35005
+ ...detailImage && detailImage !== garmentImage ? { garmentDetailImage: detailImage } : {},
34462
35006
  silhouetteContext: buildSilhouetteContext(
34463
35007
  sizingResult,
34464
35008
  sizeGuide,
@@ -34522,7 +35066,7 @@ function PrimeStyleTryonInner({
34522
35066
  setView("error");
34523
35067
  onError?.({ message, code });
34524
35068
  }
34525
- }, [selectedFile, productImage, effectiveProductImages, garmentReferenceImage, productTitle, productCategory, productSubcategory, resolvedProductFitType, productType, productTagsList, productDescription, productMaterial, measurementType, sizingResult, sizeGuide, apiUrl, onProcessing, onError, handleVtoUpdate]);
35069
+ }, [selectedFile, productImage, effectiveProductImages, garmentReferenceImage, garmentDetailImage, productTitle, productCategory, productSubcategory, resolvedProductFitType, productType, productTagsList, productDescription, productMaterial, measurementType, sizingResult, sizeGuide, apiUrl, onProcessing, onError, handleVtoUpdate]);
34526
35070
  reactExports.useEffect(() => {
34527
35071
  if (view !== "size-result") {
34528
35072
  autoTryOnFiredRef.current = false;
@@ -34555,17 +35099,86 @@ function PrimeStyleTryonInner({
34555
35099
  }).catch(() => window.open(resultImageUrl, "_blank"));
34556
35100
  }
34557
35101
  }, [resultImageUrl]);
34558
- const handleContinueShopping = reactExports.useCallback(() => {
34559
- const historyUrl = restoredProductUrl || "";
34560
- if (historyUrl && typeof window !== "undefined") {
35102
+ const openProductPageUrl = reactExports.useCallback((url) => {
35103
+ if (url && typeof window !== "undefined") {
34561
35104
  try {
34562
- window.open(new URL(historyUrl, window.location.origin).href, "_blank", "noopener,noreferrer");
35105
+ window.open(new URL(url, window.location.origin).href, "_blank", "noopener,noreferrer");
34563
35106
  } catch {
34564
- window.open(historyUrl, "_blank", "noopener,noreferrer");
35107
+ window.open(url, "_blank", "noopener,noreferrer");
34565
35108
  }
34566
35109
  }
35110
+ }, []);
35111
+ const handleContinueShopping = reactExports.useCallback(() => {
35112
+ handleClose();
35113
+ }, [handleClose]);
35114
+ const handleBackToProductPage = reactExports.useCallback(() => {
35115
+ const targetUrl = restoredProductUrl || effectiveProductUrl || "";
35116
+ if (targetUrl) {
35117
+ openProductPageUrl(targetUrl);
35118
+ return;
35119
+ }
34567
35120
  handleClose();
34568
- }, [handleClose, restoredProductUrl]);
35121
+ }, [effectiveProductUrl, handleClose, openProductPageUrl, restoredProductUrl]);
35122
+ const buildAddToBagSelectedSizes = reactExports.useCallback(() => {
35123
+ const overrides = Object.values(pendingCustomSizesRef.current);
35124
+ if (overrides.length) {
35125
+ return overrides.map((override) => ({
35126
+ sectionName: override.sectionName,
35127
+ selectedSize: override.selectedSize,
35128
+ selectedLength: override.selectedLength,
35129
+ displayLabel: override.displayLabel,
35130
+ isOverride: true
35131
+ }));
35132
+ }
35133
+ const sections = sizingResult?.sections;
35134
+ if (sections && typeof sections === "object") {
35135
+ const selected = Object.entries(sections).map(([sectionName, sectionResult]) => {
35136
+ const result = sectionResult;
35137
+ const selectedSize = result.size || result.recommendedSize || "";
35138
+ if (!selectedSize) return null;
35139
+ const displayLabel = [selectedSize, result.length].filter(Boolean).join(" / ");
35140
+ return {
35141
+ sectionName,
35142
+ selectedSize,
35143
+ selectedLength: result.length,
35144
+ displayLabel,
35145
+ isOverride: false
35146
+ };
35147
+ }).filter(Boolean);
35148
+ return selected.length ? selected : void 0;
35149
+ }
35150
+ const recommendedSize = sizingResult?.recommendedSize || "";
35151
+ if (!recommendedSize) return void 0;
35152
+ return [{
35153
+ sectionName: "Your Fit",
35154
+ selectedSize: recommendedSize,
35155
+ displayLabel: recommendedSize,
35156
+ isOverride: false
35157
+ }];
35158
+ }, [sizingResult]);
35159
+ const handleAddToBag = reactExports.useCallback(async () => {
35160
+ if (!onAddToBag || !sizingResult) return;
35161
+ await onAddToBag({
35162
+ productId,
35163
+ productTitle: restoredProductTitle || productTitle,
35164
+ productUrl: restoredProductUrl || effectiveProductUrl,
35165
+ recommendedSize: sizingResult.recommendedSize,
35166
+ sizingResult,
35167
+ resultImageUrl: resultImageUrlRef.current || resultImageUrl,
35168
+ historyEntryId: currentHistoryEntryIdRef.current ?? void 0,
35169
+ selectedSizes: buildAddToBagSelectedSizes()
35170
+ });
35171
+ }, [
35172
+ buildAddToBagSelectedSizes,
35173
+ effectiveProductUrl,
35174
+ onAddToBag,
35175
+ productId,
35176
+ productTitle,
35177
+ restoredProductTitle,
35178
+ restoredProductUrl,
35179
+ resultImageUrl,
35180
+ sizingResult
35181
+ ]);
34569
35182
  const handleTryOnFeedbackSubmit = reactExports.useCallback(async ({ rating, note }) => {
34570
35183
  const profileLoggedIn = Boolean(profileSession);
34571
35184
  const activeProfile = profileLoggedIn ? profiles.find((profile) => profile.id === activeProfileId) : null;
@@ -34624,6 +35237,7 @@ function PrimeStyleTryonInner({
34624
35237
  setRestoredProductCarouselItems(null);
34625
35238
  setRestoredProductTitle(null);
34626
35239
  setRestoredProductUrl(null);
35240
+ setRestoredHistoryEntryId(null);
34627
35241
  setErrorMessage(null);
34628
35242
  setSizingMethod(null);
34629
35243
  setSizingResult(null);
@@ -34756,6 +35370,7 @@ function PrimeStyleTryonInner({
34756
35370
  }));
34757
35371
  const latestResultImageUrl = resultImageUrlRef.current;
34758
35372
  const durableResultUrl = durableHistoryImageUrl(latestResultImageUrl);
35373
+ const profileDraftSnapshot = buildProfileCompletionDraft(null);
34759
35374
  const entry = {
34760
35375
  id: id2,
34761
35376
  productId,
@@ -34780,6 +35395,7 @@ function PrimeStyleTryonInner({
34780
35395
  sections: sizeGuide.sections,
34781
35396
  sectionImages: sizeGuide.sectionImages
34782
35397
  } : void 0,
35398
+ profileCompletionDraft: profileDraftSnapshot,
34783
35399
  date: Date.now(),
34784
35400
  hasPhoto: hasPhoto || void 0,
34785
35401
  hasResult: latestResultImageUrl ? true : void 0,
@@ -34796,7 +35412,7 @@ function PrimeStyleTryonInner({
34796
35412
  return next;
34797
35413
  });
34798
35414
  return id2;
34799
- }, [productId, productTitle, effectiveProductUrl, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile]);
35415
+ }, [productId, productTitle, effectiveProductUrl, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile, buildProfileCompletionDraft]);
34800
35416
  const persistHistoryResult = reactExports.useCallback((entryId, imageUrl, cleanupWhenIdle) => {
34801
35417
  void (async () => {
34802
35418
  const durableResultUrl = durableHistoryImageUrl(imageUrl);
@@ -34911,6 +35527,33 @@ function PrimeStyleTryonInner({
34911
35527
  );
34912
35528
  setRestoredProductTitle(entry.productTitle || null);
34913
35529
  setRestoredProductUrl(entry.productUrl || null);
35530
+ setRestoredHistoryEntryId(entry.id);
35531
+ if (entry.profileCompletionDraft) {
35532
+ const draft = entry.profileCompletionDraft;
35533
+ const restoredForm = { ...formRef.current };
35534
+ if (draft.gender) restoredForm.gender = draft.gender;
35535
+ if (draft.height != null) restoredForm.height = String(draft.height);
35536
+ if (draft.weight != null) restoredForm.weight = String(draft.weight);
35537
+ if (draft.heightUnit) restoredForm.heightUnit = String(draft.heightUnit);
35538
+ if (draft.weightUnit) restoredForm.weightUnit = String(draft.weightUnit);
35539
+ if (draft.age != null) restoredForm.age = String(draft.age);
35540
+ if (draft.chestProfile) restoredForm.chestProfile = draft.chestProfile;
35541
+ if (draft.midsectionProfile) restoredForm.midsectionProfile = draft.midsectionProfile;
35542
+ if (draft.hipProfile) restoredForm.hipProfile = draft.hipProfile;
35543
+ if (draft.bandSize) restoredForm.bandSize = draft.bandSize;
35544
+ if (draft.cupSize) restoredForm.cupSize = draft.cupSize;
35545
+ if (draft.braSizeRegion) restoredForm.braSizeRegion = draft.braSizeRegion;
35546
+ if (draft.customMeasurements) {
35547
+ for (const [key, value] of Object.entries(draft.customMeasurements)) {
35548
+ restoredForm[key] = String(value);
35549
+ }
35550
+ }
35551
+ formRef.current = restoredForm;
35552
+ setFormGender(restoredForm.gender || "male");
35553
+ if (draft.heightUnit) setHeightUnit(String(draft.heightUnit));
35554
+ if (draft.weightUnit) setWeightUnit(String(draft.weightUnit));
35555
+ if (draft.sizingUnit) setSizingUnit(String(draft.sizingUnit));
35556
+ }
34914
35557
  if (entry.sizingResult) {
34915
35558
  setSizingResult(entry.sizingResult);
34916
35559
  } else if (entry.recommendedSize) {
@@ -35068,6 +35711,7 @@ function PrimeStyleTryonInner({
35068
35711
  basicOnly: false,
35069
35712
  initialStep: bodyProfileInitialStep === "basics" ? "basics" : void 0,
35070
35713
  simplePhotoOnly,
35714
+ simpleAccessoryLayout: measurementType === "body-basic",
35071
35715
  simpleQuestionMode: measurementType === "foot" ? "shoeReference" : "heightWeight",
35072
35716
  formRef,
35073
35717
  sizingCountry,
@@ -35170,6 +35814,12 @@ function PrimeStyleTryonInner({
35170
35814
  setView,
35171
35815
  handleDownload,
35172
35816
  onContinueShopping: handleContinueShopping,
35817
+ isHistoryResult: !!restoredHistoryEntryId,
35818
+ onBackToProductPage: handleBackToProductPage,
35819
+ onAddToBag: onAddToBag ? handleAddToBag : void 0,
35820
+ addToBagLabel,
35821
+ continueShoppingLabel,
35822
+ backToProductPageLabel,
35173
35823
  onTryOnFeedbackSubmit: handleTryOnFeedbackSubmit,
35174
35824
  selectedFile,
35175
35825
  previewUrl,