@primestyleai/tryon 5.10.176 → 5.10.178

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.
@@ -9530,6 +9530,25 @@ class ApiClient {
9530
9530
  }
9531
9531
  return res.json();
9532
9532
  }
9533
+ async submitTryOnFeedback(input) {
9534
+ const res = await fetch(`${this.baseUrl}/api/v1/tryon/feedback`, {
9535
+ method: "POST",
9536
+ headers: this.headers,
9537
+ body: JSON.stringify({
9538
+ ...input,
9539
+ sessionId: getOrCreateSessionId(),
9540
+ deviceHint: getDeviceHint()
9541
+ })
9542
+ });
9543
+ if (!res.ok) {
9544
+ const data = await res.json().catch(() => ({}));
9545
+ throw new PrimeStyleError(
9546
+ data.message || "Failed to submit try-on feedback",
9547
+ "API_ERROR"
9548
+ );
9549
+ }
9550
+ return res.json();
9551
+ }
9533
9552
  getStreamUrl() {
9534
9553
  const streamUrl = `${this.baseUrl}/api/v1/tryon/stream`;
9535
9554
  return this.apiKey ? `${streamUrl}?key=${encodeURIComponent(this.apiKey)}` : streamUrl;
@@ -10533,6 +10552,24 @@ function logSizeShown(input) {
10533
10552
  fromCache: input.fromCache
10534
10553
  });
10535
10554
  }
10555
+ function logTryOnFeedback(input) {
10556
+ void post("/events/tryon-feedback", {
10557
+ sessionId: getOrCreateSessionId(),
10558
+ deviceHint: getDeviceHint(),
10559
+ jobId: input.jobId,
10560
+ historyEntryId: input.historyEntryId,
10561
+ rating: input.rating,
10562
+ note: input.note,
10563
+ productId: input.productId,
10564
+ productTitle: input.productTitle,
10565
+ productUrl: input.productUrl,
10566
+ recommendedSize: input.recommendedSize,
10567
+ profileLoggedIn: input.profileLoggedIn,
10568
+ profileId: input.profileId,
10569
+ profileName: input.profileName,
10570
+ profileAccessToken: input.profileAccessToken
10571
+ });
10572
+ }
10536
10573
  const ATTR_KEY = "ps_session";
10537
10574
  const PROXY_BASE = "/apps/primestyle";
10538
10575
  const CART_ADD_ENDPOINTS = ["/cart/add.js", "/cart/add"];
@@ -12084,9 +12121,22 @@ const STYLES$1 = `
12084
12121
 
12085
12122
  /* ═══════════ V2 Redesign — Editorial luxury ═══════════ */
12086
12123
  .ps-tryon-v2 {
12087
- display: flex; gap: 1.2vw; flex: 1; min-height: 0;
12124
+ display: flex; align-items: stretch; gap: 1.2vw; flex: 1 1 auto; min-height: 0;
12088
12125
  height: 100%; overflow: hidden;
12089
12126
  }
12127
+ .ps-tryon-v2-media-stack {
12128
+ flex: 0 0 43%;
12129
+ min-width: 0;
12130
+ min-height: 0;
12131
+ display: flex;
12132
+ flex-direction: column;
12133
+ gap: 0.45vw;
12134
+ }
12135
+ .ps-tryon-v2-media-stack .ps-tryon-v2-bg {
12136
+ flex: 1 1 auto;
12137
+ width: 100%;
12138
+ min-height: 0;
12139
+ }
12090
12140
 
12091
12141
  /* Left image column — proper contained display.
12092
12142
  No background — the product/try-on image sits directly on the modal
@@ -12112,12 +12162,43 @@ const STYLES$1 = `
12112
12162
 
12113
12163
  /* Right form panel */
12114
12164
  .ps-tryon-v2-panel {
12115
- flex: 1; min-width: 0;
12165
+ flex: 1 1 0; min-width: 0; min-height: 0;
12116
12166
  display: flex; flex-direction: column;
12117
12167
  padding: 0.2vw 0;
12118
12168
  justify-content: center;
12119
12169
  animation: ps-v2-fade 0.18s ease-out forwards;
12120
12170
  }
12171
+ .ps-tryon-v2-result-panel {
12172
+ align-self: stretch;
12173
+ height: 100%;
12174
+ justify-content: flex-start;
12175
+ gap: 0.55vw;
12176
+ padding-bottom: clamp(8px, 0.72vw, 14px);
12177
+ }
12178
+ .ps-tryon-v2-result-panel .ps-tryon-v2-sep {
12179
+ margin-bottom: 0;
12180
+ }
12181
+ .ps-tryon-v2-result-panel .ps-tryon-sr-cards-v2 {
12182
+ flex: 0 0 auto;
12183
+ min-height: 0;
12184
+ }
12185
+ .ps-tryon-v2-result-panel .ps-tryon-photo-strip {
12186
+ flex: 0 1 auto;
12187
+ min-height: 0;
12188
+ }
12189
+ .ps-tryon-v2-result-panel .ps-tryon-sr-card-v2 {
12190
+ min-height: 10.5vw;
12191
+ }
12192
+ .ps-tryon-v2-result-actions {
12193
+ display: flex;
12194
+ align-items: center;
12195
+ justify-content: space-between;
12196
+ margin-top: auto;
12197
+ padding-top: clamp(8px, 0.65vw, 12px);
12198
+ padding-bottom: 0;
12199
+ gap: 0.5vw;
12200
+ flex-shrink: 0;
12201
+ }
12121
12202
  @keyframes ps-v2-fade {
12122
12203
  0% { opacity: 0; }
12123
12204
  100% { opacity: 1; }
@@ -14253,10 +14334,20 @@ const STYLES$1 = `
14253
14334
  stroke: var(--ps-accent);
14254
14335
  transform: translateY(-1px);
14255
14336
  }
14337
+ .ps-tryon-feedback-star:disabled {
14338
+ cursor: default;
14339
+ }
14340
+ .ps-tryon-feedback-form {
14341
+ display: grid;
14342
+ grid-template-columns: minmax(0, 1fr) auto;
14343
+ gap: 6px;
14344
+ align-items: end;
14345
+ }
14256
14346
  .ps-tryon-feedback-note {
14257
14347
  width: 100%;
14258
14348
  min-width: 0;
14259
- height: clamp(26px, 1.55vw, 32px);
14349
+ min-height: clamp(30px, 1.75vw, 36px);
14350
+ max-height: 78px;
14260
14351
  border: 1px solid #e6eaf2;
14261
14352
  border-radius: clamp(6px, 0.36vw, 8px);
14262
14353
  background: rgba(248, 250, 252, 0.88);
@@ -14264,9 +14355,12 @@ const STYLES$1 = `
14264
14355
  font-family: inherit;
14265
14356
  font-size: clamp(10px, 0.58vw, 12px);
14266
14357
  font-weight: 600;
14267
- padding: 0 clamp(8px, 0.5vw, 10px);
14358
+ line-height: 1.35;
14359
+ padding: clamp(7px, 0.42vw, 9px) clamp(8px, 0.5vw, 10px);
14268
14360
  outline: none;
14269
14361
  box-sizing: border-box;
14362
+ resize: none;
14363
+ overflow-y: auto;
14270
14364
  }
14271
14365
  .ps-tryon-feedback-note::placeholder {
14272
14366
  color: #94a3b8;
@@ -14276,6 +14370,67 @@ const STYLES$1 = `
14276
14370
  border-color: rgba(33,84,239,0.45);
14277
14371
  box-shadow: 0 0 0 3px rgba(33,84,239,0.1);
14278
14372
  }
14373
+ .ps-tryon-feedback-note:disabled {
14374
+ color: #64748b;
14375
+ background: rgba(248, 250, 252, 0.62);
14376
+ cursor: default;
14377
+ }
14378
+ .ps-tryon-feedback-submit {
14379
+ min-height: clamp(30px, 1.75vw, 36px);
14380
+ padding: 0 clamp(9px, 0.55vw, 12px);
14381
+ border: 0;
14382
+ border-radius: clamp(6px, 0.36vw, 8px);
14383
+ background: var(--ps-accent);
14384
+ color: #fff;
14385
+ font-family: inherit;
14386
+ font-size: clamp(10px, 0.56vw, 12px);
14387
+ font-weight: 800;
14388
+ cursor: pointer;
14389
+ white-space: nowrap;
14390
+ }
14391
+ .ps-tryon-feedback-submit:disabled {
14392
+ opacity: 0.48;
14393
+ cursor: default;
14394
+ }
14395
+ .ps-tryon-feedback-status {
14396
+ color: #dc2626;
14397
+ font-size: clamp(10px, 0.56vw, 12px);
14398
+ font-weight: 700;
14399
+ line-height: 1.2;
14400
+ }
14401
+ .ps-result-image-action-bar {
14402
+ width: 100%;
14403
+ display: flex;
14404
+ align-items: center;
14405
+ justify-content: flex-start;
14406
+ gap: clamp(6px, 0.38vw, 9px);
14407
+ flex-wrap: wrap;
14408
+ }
14409
+ .ps-result-image-action {
14410
+ display: inline-flex;
14411
+ align-items: center;
14412
+ justify-content: center;
14413
+ gap: clamp(5px, 0.32vw, 7px);
14414
+ min-height: clamp(30px, 1.75vw, 36px);
14415
+ padding: 0 clamp(10px, 0.65vw, 14px);
14416
+ border-radius: clamp(7px, 0.42vw, 9px);
14417
+ border: 1px solid rgba(226, 232, 240, 0.92);
14418
+ background: #fff;
14419
+ color: var(--ps-text-primary);
14420
+ box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
14421
+ font-family: inherit;
14422
+ font-size: clamp(10px, 0.58vw, 12px);
14423
+ font-weight: 800;
14424
+ cursor: pointer;
14425
+ white-space: nowrap;
14426
+ }
14427
+ .ps-result-image-action:hover {
14428
+ border-color: rgba(33,84,239,0.34);
14429
+ color: var(--ps-accent);
14430
+ }
14431
+ .ps-result-image-action svg {
14432
+ flex: 0 0 auto;
14433
+ }
14279
14434
  .ps-tryon-sr-glass-btn {
14280
14435
  background: rgba(255,255,255,0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
14281
14436
  border: 1px solid var(--ps-border-color); border-radius: 0.45vw;
@@ -14571,6 +14726,16 @@ const STYLES$1 = `
14571
14726
  box-sizing: border-box;
14572
14727
  }
14573
14728
  .ps-tryon-drawer-open { transform: translateX(0); }
14729
+ .ps-tryon-history-drawer {
14730
+ inset: 0;
14731
+ height: 100%;
14732
+ min-height: 0;
14733
+ padding: 1.04vw 1.25vw;
14734
+ border-radius: 0;
14735
+ transform: translateY(100%);
14736
+ box-shadow: none;
14737
+ }
14738
+ .ps-tryon-history-drawer.ps-tryon-drawer-open { transform: translateY(0); }
14574
14739
  .ps-tryon-drawer-header { display: flex; align-items: center; gap: 0.52vw; padding-bottom: 0.73vw; margin-bottom: 0.73vw; border-bottom: 1px solid var(--ps-border-color); }
14575
14740
  .ps-tryon-drawer-back {
14576
14741
  width: 1.67vw; height: 1.67vw; display: flex; align-items: center; justify-content: center;
@@ -14586,6 +14751,15 @@ const STYLES$1 = `
14586
14751
  font-family: inherit; transition: all 0.2s; flex-shrink: 0; line-height: 1;
14587
14752
  }
14588
14753
  .ps-tryon-drawer-add-btn:hover { border-color: var(--ps-accent); background: rgba(33,84,239,0.1); }
14754
+ .ps-tryon-drawer-close {
14755
+ width: 1.67vw; height: 1.67vw; display: flex; align-items: center; justify-content: center;
14756
+ border: 1.5px solid var(--ps-border-color); border-radius: 0.52vw; background: transparent;
14757
+ cursor: pointer; color: var(--ps-text-secondary); transition: all 0.2s; flex-shrink: 0;
14758
+ }
14759
+ .ps-tryon-drawer-close svg {
14760
+ width: 0.85vw; height: 0.85vw; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round;
14761
+ }
14762
+ .ps-tryon-drawer-close:hover { border-color: var(--ps-accent); color: var(--ps-accent); }
14589
14763
  .ps-tryon-drawer-list { display: flex; flex-direction: column; gap: 0.52vw; max-width: 100%; overflow-x: hidden; }
14590
14764
  .ps-tryon-drawer-empty { text-align: center; padding: 1.67vw 0.83vw; color: var(--ps-text-muted); font-size: 0.73vw; }
14591
14765
 
@@ -14653,6 +14827,101 @@ const STYLES$1 = `
14653
14827
  background: rgba(33,84,239,0.12); border: 1px solid rgba(33,84,239,0.25);
14654
14828
  border-radius: 0.25vw; padding: 0.1vw 0.35vw; margin-top: 0.25vw;
14655
14829
  }
14830
+ .ps-tryon-history-gallery {
14831
+ display: grid;
14832
+ grid-template-columns: repeat(5, minmax(0, 1fr));
14833
+ gap: 0.72vw;
14834
+ }
14835
+ .ps-tryon-history-card {
14836
+ position: relative;
14837
+ min-width: 0;
14838
+ }
14839
+ .ps-tryon-history-card-main {
14840
+ width: 100%;
14841
+ min-width: 0;
14842
+ display: flex;
14843
+ flex-direction: column;
14844
+ gap: 0.34vw;
14845
+ padding: 0;
14846
+ border: 0;
14847
+ background: transparent;
14848
+ color: inherit;
14849
+ font-family: inherit;
14850
+ text-align: left;
14851
+ cursor: pointer;
14852
+ }
14853
+ .ps-tryon-history-card-media {
14854
+ position: relative;
14855
+ width: 100%;
14856
+ aspect-ratio: 3 / 4;
14857
+ border-radius: 0.72vw;
14858
+ overflow: hidden;
14859
+ background: #f4f5f7;
14860
+ border: 1px solid rgba(226, 232, 240, 0.86);
14861
+ box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
14862
+ }
14863
+ .ps-tryon-history-card-img,
14864
+ .ps-tryon-history-card-placeholder {
14865
+ width: 100%;
14866
+ height: 100%;
14867
+ object-fit: cover;
14868
+ object-position: center top;
14869
+ display: block;
14870
+ }
14871
+ .ps-tryon-history-card-placeholder {
14872
+ background: linear-gradient(135deg, rgba(241,245,249,1), rgba(226,232,240,0.7));
14873
+ }
14874
+ .ps-tryon-history-card-product {
14875
+ position: absolute;
14876
+ right: 0.42vw;
14877
+ bottom: 0.42vw;
14878
+ width: 28%;
14879
+ aspect-ratio: 1 / 1;
14880
+ border-radius: 0.42vw;
14881
+ object-fit: cover;
14882
+ background: #fff;
14883
+ border: 1px solid rgba(226, 232, 240, 0.92);
14884
+ box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
14885
+ }
14886
+ .ps-tryon-history-card-title {
14887
+ color: var(--ps-text-primary);
14888
+ font-size: 0.66vw;
14889
+ font-weight: 750;
14890
+ line-height: 1.25;
14891
+ overflow: hidden;
14892
+ text-overflow: ellipsis;
14893
+ white-space: nowrap;
14894
+ }
14895
+ .ps-tryon-history-card-meta,
14896
+ .ps-tryon-history-card-sections {
14897
+ color: var(--ps-text-muted);
14898
+ font-size: 0.54vw;
14899
+ font-weight: 600;
14900
+ line-height: 1.2;
14901
+ overflow: hidden;
14902
+ text-overflow: ellipsis;
14903
+ white-space: nowrap;
14904
+ }
14905
+ .ps-tryon-history-card-size {
14906
+ align-self: flex-start;
14907
+ color: var(--ps-accent);
14908
+ background: rgba(33,84,239,0.1);
14909
+ border: 1px solid rgba(33,84,239,0.2);
14910
+ border-radius: 999px;
14911
+ padding: 0.14vw 0.45vw;
14912
+ font-size: 0.52vw;
14913
+ font-weight: 800;
14914
+ }
14915
+ .ps-tryon-history-delete.ps-card-delete {
14916
+ position: absolute;
14917
+ top: 0.42vw;
14918
+ right: 0.42vw;
14919
+ width: 1.5vw;
14920
+ height: 1.5vw;
14921
+ border-radius: 999px;
14922
+ background: rgba(255,255,255,0.9);
14923
+ box-shadow: 0 8px 18px rgba(15,23,42,0.12);
14924
+ }
14656
14925
 
14657
14926
  /* Quiz view */
14658
14927
  .ps-tryon-quiz-progress { display: flex; gap: 0.4vw; margin-bottom: 1vw; }
@@ -14740,6 +15009,12 @@ const STYLES$1 = `
14740
15009
  ────────────────────────────────────────────────────────────────── */
14741
15010
  @media (max-width: 768px) {
14742
15011
  .ps-tryon-drawer { padding: 16px 14px; }
15012
+ .ps-tryon-history-drawer {
15013
+ height: 100%;
15014
+ min-height: 0;
15015
+ padding: 16px 14px;
15016
+ border-radius: 0;
15017
+ }
14743
15018
  .ps-tryon-drawer-header { gap: 10px; padding-bottom: 12px; margin-bottom: 12px; }
14744
15019
  .ps-tryon-drawer-back {
14745
15020
  width: 36px; height: 36px; border-radius: 8px;
@@ -14749,6 +15024,10 @@ const STYLES$1 = `
14749
15024
  .ps-tryon-drawer-add-btn {
14750
15025
  width: 32px; height: 32px; border-radius: 8px; font-size: 20px;
14751
15026
  }
15027
+ .ps-tryon-drawer-close {
15028
+ width: 36px; height: 36px; border-radius: 8px;
15029
+ }
15030
+ .ps-tryon-drawer-close svg { width: 18px; height: 18px; }
14752
15031
  .ps-tryon-drawer-list { gap: 10px; }
14753
15032
  .ps-tryon-drawer-empty { padding: 32px 16px; font-size: 14px; }
14754
15033
 
@@ -14800,6 +15079,36 @@ const STYLES$1 = `
14800
15079
  width: 32px; height: 32px; border-radius: 6px;
14801
15080
  }
14802
15081
  .ps-tryon-history-delete svg { width: 16px; height: 16px; }
15082
+ .ps-tryon-history-gallery {
15083
+ grid-template-columns: repeat(2, minmax(0, 1fr));
15084
+ gap: 12px;
15085
+ }
15086
+ .ps-tryon-history-card-media {
15087
+ border-radius: 12px;
15088
+ }
15089
+ .ps-tryon-history-card-product {
15090
+ right: 7px;
15091
+ bottom: 7px;
15092
+ border-radius: 8px;
15093
+ }
15094
+ .ps-tryon-history-card-title {
15095
+ font-size: 13px;
15096
+ }
15097
+ .ps-tryon-history-card-meta,
15098
+ .ps-tryon-history-card-sections {
15099
+ font-size: 11px;
15100
+ }
15101
+ .ps-tryon-history-card-size {
15102
+ padding: 3px 8px;
15103
+ font-size: 10px;
15104
+ }
15105
+ .ps-tryon-history-delete.ps-card-delete {
15106
+ top: 7px;
15107
+ right: 7px;
15108
+ width: 30px;
15109
+ height: 30px;
15110
+ border-radius: 999px;
15111
+ }
14803
15112
  }
14804
15113
 
14805
15114
  /* Profile detail modal — portaled to body, sits ABOVE the main modal
@@ -15835,9 +16144,15 @@ const STYLES$1 = `
15835
16144
  margin: 0; text-align: center;
15836
16145
  font-size: 13px; color: var(--ps-text-muted);
15837
16146
  }
15838
- .ps-bp-scan-details-center .ps-bp-system-toggle { align-self: center; }
16147
+ .ps-bp-scan-details-center .ps-bp-system-toggle {
16148
+ align-self: center;
16149
+ }
16150
+ .ps-bp-scan-details-center:not(.ps-shoe-scan-details) .ps-bp-system-toggle {
16151
+ margin-top: clamp(34px, 7vh, 78px) !important;
16152
+ margin-bottom: clamp(10px, 2.4vh, 28px) !important;
16153
+ }
15839
16154
  .ps-bp-scan-details-center .ps-bp-inline-fields {
15840
- max-width: 360px; width: 100%; margin: 4px auto 0;
16155
+ max-width: 360px; width: 100%; margin: 0 auto;
15841
16156
  }
15842
16157
  .ps-shoe-scan-details {
15843
16158
  justify-content: flex-start !important;
@@ -17344,10 +17659,32 @@ const STYLES$1 = `
17344
17659
  .ps-tryon-feedback-title { font-size: 11px; }
17345
17660
  .ps-tryon-feedback-star { width: 18px; height: 18px; }
17346
17661
  .ps-tryon-feedback-note {
17347
- height: 30px;
17662
+ min-height: 34px;
17663
+ max-height: 86px;
17664
+ border-radius: 8px;
17665
+ font-size: 11px;
17666
+ }
17667
+ .ps-tryon-feedback-form {
17668
+ gap: 6px;
17669
+ }
17670
+ .ps-tryon-feedback-submit {
17671
+ min-height: 34px;
17672
+ padding: 0 10px;
17348
17673
  border-radius: 8px;
17349
17674
  font-size: 11px;
17350
17675
  }
17676
+ .ps-result-image-action-bar {
17677
+ max-width: 360px;
17678
+ justify-content: flex-start;
17679
+ gap: 7px;
17680
+ }
17681
+ .ps-result-image-action {
17682
+ min-height: 34px;
17683
+ padding: 0 11px;
17684
+ border-radius: 10px;
17685
+ font-size: 11px;
17686
+ box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
17687
+ }
17351
17688
  }
17352
17689
  .ps-msr-product-img-wrap {
17353
17690
  position: relative; flex-shrink: 0;
@@ -17390,7 +17727,7 @@ const STYLES$1 = `
17390
17727
  .ps-msr-feedback-slot {
17391
17728
  position: absolute;
17392
17729
  left: 10px;
17393
- bottom: 54px;
17730
+ bottom: 10px;
17394
17731
  z-index: 3;
17395
17732
  }
17396
17733
  .ps-msr-media-btn {
@@ -17700,7 +18037,7 @@ const STYLES$1 = `
17700
18037
  flex: 1; min-height: 0;
17701
18038
  overflow-y: auto; -webkit-overflow-scrolling: touch;
17702
18039
  display: flex; flex-direction: column;
17703
- gap: 18px; padding: 8px 16px 32px;
18040
+ gap: 18px; padding: 8px 16px 18px;
17704
18041
  }
17705
18042
  /* Topbar: back arrow + section name in uppercase */
17706
18043
  .ps-msd-topbar {
@@ -19691,6 +20028,55 @@ const STYLES$1 = `
19691
20028
  object-fit: contain; display: block;
19692
20029
  }
19693
20030
 
20031
+ .ps-msd-actions {
20032
+ position: sticky;
20033
+ bottom: -1px;
20034
+ z-index: 5;
20035
+ display: flex;
20036
+ align-items: center;
20037
+ gap: 10px;
20038
+ flex-shrink: 0;
20039
+ margin: auto -16px -18px;
20040
+ padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
20041
+ background: rgba(255,255,255,0.96);
20042
+ border-top: 1px solid var(--ps-border-subtle);
20043
+ backdrop-filter: blur(10px);
20044
+ -webkit-backdrop-filter: blur(10px);
20045
+ }
20046
+ .ps-msd-action-back {
20047
+ flex: 0 0 auto;
20048
+ font-size: 13px !important;
20049
+ padding: 10px 6px !important;
20050
+ }
20051
+ .ps-msd-primary-cta {
20052
+ flex: 1 1 0;
20053
+ min-width: 0;
20054
+ display: flex;
20055
+ align-items: center;
20056
+ justify-content: center;
20057
+ gap: 6px;
20058
+ padding: 12px 16px;
20059
+ border: 0;
20060
+ border-radius: 10px;
20061
+ background: var(--ps-accent);
20062
+ color: #fff;
20063
+ font-family: inherit;
20064
+ font-size: 14px;
20065
+ font-weight: 700;
20066
+ cursor: pointer;
20067
+ white-space: nowrap;
20068
+ }
20069
+ .ps-msd-primary-cta.ps-compact {
20070
+ flex: 0 0 auto;
20071
+ min-width: 88px;
20072
+ padding: 10px 14px;
20073
+ font-size: 13px;
20074
+ }
20075
+ .ps-msd-primary-cta:disabled {
20076
+ opacity: 0.6;
20077
+ cursor: default;
20078
+ }
20079
+
19694
20080
  /* RECOMMENDED SIZE card */
19695
20081
  .ps-msd-card {
19696
20082
  background: var(--ps-bg-primary);
@@ -20984,7 +21370,7 @@ function ProfileEditView({
20984
21370
  ] })
20985
21371
  ] });
20986
21372
  }
20987
- function HistoryResultThumb({ entry }) {
21373
+ function HistoryResultThumb({ entry, className = "ps-tryon-history-result-img" }) {
20988
21374
  const [blobUrl, setBlobUrl] = reactExports.useState(null);
20989
21375
  reactExports.useEffect(() => {
20990
21376
  let alive = true;
@@ -21003,7 +21389,7 @@ function HistoryResultThumb({ entry }) {
21003
21389
  }, [entry.id, entry.hasResult, entry.resultImageUrl]);
21004
21390
  const src = entry.resultImageUrl || blobUrl;
21005
21391
  if (!src) return null;
21006
- return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src, alt: "", className: "ps-tryon-history-result-img" });
21392
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src, alt: "", className });
21007
21393
  }
21008
21394
  function DrawerPanel({
21009
21395
  drawer,
@@ -21028,14 +21414,15 @@ function DrawerPanel({
21028
21414
  setProfiles((prev) => [newProfile, ...prev]);
21029
21415
  setCreatingProfile(false);
21030
21416
  };
21031
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-drawer${drawer ? " ps-tryon-drawer-open" : ""}`, children: [
21417
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-drawer${drawer ? " ps-tryon-drawer-open" : ""}${drawer === "history" ? " ps-tryon-history-drawer" : ""}`, children: [
21032
21418
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-drawer-header", children: [
21033
21419
  /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-drawer-back", onClick: () => {
21034
21420
  setCreatingProfile(false);
21035
21421
  setDrawer(null);
21036
21422
  }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeftIcon, {}) }),
21037
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-drawer-title", children: creatingProfile ? t2("New Profile") : drawer === "profiles" ? t2("My Profiles") : t2("History") }),
21038
- drawer === "profiles" && !creatingProfile && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-drawer-add-btn", onClick: () => setCreatingProfile(true), children: "+" })
21423
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-drawer-title", children: creatingProfile ? t2("New Profile") : drawer === "profiles" ? t2("My Profiles") : t2("Your try-on history") }),
21424
+ drawer === "profiles" && !creatingProfile && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-drawer-add-btn", onClick: () => setCreatingProfile(true), children: "+" }),
21425
+ drawer === "history" && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-drawer-close", onClick: () => setDrawer(null), "aria-label": t2("Close"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M6 6l12 12M18 6L6 18" }) }) })
21039
21426
  ] }),
21040
21427
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-drawer-list", children: drawer === "profiles" && creatingProfile ? /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileEditView, { onSave: handleCreateProfile, onCancel: () => setCreatingProfile(false), t: t2 }) : drawer === "profiles" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
21041
21428
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-drawer-create", onClick: () => setCreatingProfile(true), children: [
@@ -21057,33 +21444,25 @@ function DrawerPanel({
21057
21444
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRightIcon, {})
21058
21445
  ] }, p2.id))
21059
21446
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: history.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-drawer-empty", children: t2("No history yet.") }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
21060
- history.map((entry, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-item ps-tryon-history-clickable", onClick: () => restoreHistory(entry), children: [
21061
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-images", children: [
21062
- entry.productImage && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: entry.productImage, alt: "", className: "ps-tryon-history-thumb" }),
21063
- /* @__PURE__ */ jsxRuntimeExports.jsx(HistoryResultThumb, { entry })
21064
- ] }),
21065
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-info", children: [
21066
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-history-product", children: entry.productTitle || t2("Product") }),
21067
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-meta", children: [
21447
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-history-gallery", children: history.map((entry, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-card", children: [
21448
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-tryon-history-card-main", onClick: () => restoreHistory(entry), children: [
21449
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-card-media", children: [
21450
+ entry.resultImageUrl || entry.hasResult ? /* @__PURE__ */ jsxRuntimeExports.jsx(HistoryResultThumb, { entry, className: "ps-tryon-history-card-img" }) : entry.productImage ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: entry.productImage, alt: "", className: "ps-tryon-history-card-img" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-history-card-placeholder" }),
21451
+ entry.productImage && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: entry.productImage, alt: "", className: "ps-tryon-history-card-product" })
21452
+ ] }),
21453
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-card-title", children: entry.productTitle || t2("Product") }),
21454
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-history-card-meta", children: [
21068
21455
  entry.profileName ? `${entry.profileName} · ` : "",
21069
21456
  new Date(entry.date).toLocaleDateString()
21070
21457
  ] }),
21071
- entry.recommendedSize && !isMultiSection(entry) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-history-sizing", children: [
21072
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-size-badge", children: entry.recommendedSize }),
21073
- entry.reasoning && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-sizing-reason", children: entry.reasoning })
21074
- ] }),
21075
- isMultiSection(entry) && entry.sizingResult?.sections && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-history-sections", children: Object.entries(entry.sizingResult.sections).map(([name, sec]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-history-section-chip", children: [
21076
- name,
21077
- ": ",
21078
- sec.recommendedSize
21079
- ] }, name)) }),
21080
- (entry.resultImageUrl || entry.hasResult) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-tryon-badge", children: t2("Try-on") })
21458
+ entry.recommendedSize && !isMultiSection(entry) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-card-size", children: entry.recommendedSize }),
21459
+ isMultiSection(entry) && entry.sizingResult?.sections && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-history-card-sections", children: Object.entries(entry.sizingResult.sections).slice(0, 3).map(([name, sec]) => `${name}: ${sec.recommendedSize}`).join(" / ") })
21081
21460
  ] }),
21082
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-history-delete", onClick: (e) => {
21461
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-history-delete ps-card-delete", onClick: (e) => {
21083
21462
  e.stopPropagation();
21084
21463
  setHistory((prev) => prev.filter((_, i) => i !== idx));
21085
- }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, {}) })
21086
- ] }, entry.id)),
21464
+ }, "aria-label": t2("Delete"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, {}) })
21465
+ ] }, entry.id)) }),
21087
21466
  /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-drawer-clear", onClick: () => setHistory([]), children: t2("Clear All") })
21088
21467
  ] }) }) })
21089
21468
  ] });
@@ -21735,29 +22114,6 @@ function CameraIcon() {
21735
22114
  /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "13", r: "4" })
21736
22115
  ] });
21737
22116
  }
21738
- function FitLinesIcon() {
21739
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
21740
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
21741
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
21742
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "7", cy: "9", r: "2" }),
21743
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "17", cy: "15", r: "2" })
21744
- ] });
21745
- }
21746
- function FullSizeIcon() {
21747
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
21748
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
21749
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 3h3a2 2 0 0 1 2 2v3" }),
21750
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
21751
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
21752
- ] });
21753
- }
21754
- function DownloadIcon() {
21755
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
21756
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
21757
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M7 10l5 5 5-5" }),
21758
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 15V3" })
21759
- ] });
21760
- }
21761
22117
  function MultiSectionMobile({
21762
22118
  productImage,
21763
22119
  productTitle,
@@ -21778,6 +22134,8 @@ function MultiSectionMobile({
21778
22134
  onToggleLines,
21779
22135
  onOpenImage,
21780
22136
  onDownload,
22137
+ imageActionBar,
22138
+ feedbackSlot,
21781
22139
  onImageLoad,
21782
22140
  profileCompletionCta,
21783
22141
  t: t2
@@ -21788,6 +22146,7 @@ function MultiSectionMobile({
21788
22146
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-scroll", children: [
21789
22147
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-eyebrow", children: t2("Sizing Profile") }),
21790
22148
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-product", children: [
22149
+ showingTryOn && imageActionBar,
21791
22150
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-msr-product-img-wrap${showingTryOn ? " ps-tryon" : ""}`, children: [
21792
22151
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21793
22152
  "img",
@@ -21802,29 +22161,7 @@ function MultiSectionMobile({
21802
22161
  ),
21803
22162
  showLines && overlayNode,
21804
22163
  tryOnProcessing && tryOnStartedAt != null && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt, t: t2 }),
21805
- showingTryOn && onToggleLines && /* @__PURE__ */ jsxRuntimeExports.jsxs(
21806
- "button",
21807
- {
21808
- type: "button",
21809
- className: "ps-msr-fit-toggle",
21810
- onClick: onToggleLines,
21811
- "aria-pressed": !!showLines,
21812
- children: [
21813
- /* @__PURE__ */ jsxRuntimeExports.jsx(FitLinesIcon, {}),
21814
- showLines ? t2("Hide Fit") : t2("Show Fit")
21815
- ]
21816
- }
21817
- ),
21818
- showingTryOn && (onOpenImage || onDownload) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-media-actions", children: [
21819
- onOpenImage && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-msr-media-btn", onClick: onOpenImage, children: [
21820
- /* @__PURE__ */ jsxRuntimeExports.jsx(FullSizeIcon, {}),
21821
- t2("Full Size")
21822
- ] }),
21823
- onDownload && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-msr-media-btn", onClick: onDownload, children: [
21824
- /* @__PURE__ */ jsxRuntimeExports.jsx(DownloadIcon, {}),
21825
- t2("Download")
21826
- ] })
21827
- ] })
22164
+ showingTryOn && feedbackSlot
21828
22165
  ] }),
21829
22166
  /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "ps-msr-product-name", children: productTitle })
21830
22167
  ] }),
@@ -22035,10 +22372,36 @@ function ProfileCompletionCta({
22035
22372
  }
22036
22373
  );
22037
22374
  }
22038
- function TryOnExperienceFeedback({ t: t2, isMobile }) {
22375
+ function TryOnExperienceFeedback({
22376
+ t: t2,
22377
+ isMobile,
22378
+ onSubmit
22379
+ }) {
22039
22380
  const [rating, setRating] = reactExports.useState(0);
22040
22381
  const [note, setNote] = reactExports.useState("");
22041
22382
  const [expanded, setExpanded] = reactExports.useState(false);
22383
+ const [status, setStatus] = reactExports.useState("idle");
22384
+ const noteRef = reactExports.useRef(null);
22385
+ const canEdit = status !== "submitting" && status !== "sent";
22386
+ const canSubmit = (rating > 0 || note.trim().length > 0) && canEdit;
22387
+ const resizeNote = reactExports.useCallback((node) => {
22388
+ if (!node) return;
22389
+ node.style.height = "auto";
22390
+ node.style.height = `${Math.min(node.scrollHeight, isMobile ? 86 : 78)}px`;
22391
+ }, [isMobile]);
22392
+ reactExports.useEffect(() => {
22393
+ resizeNote(noteRef.current);
22394
+ }, [note, resizeNote]);
22395
+ const submitFeedback = reactExports.useCallback(async () => {
22396
+ if (!canSubmit) return;
22397
+ setStatus("submitting");
22398
+ try {
22399
+ await onSubmit?.({ rating: rating || void 0, note: note.trim() || void 0 });
22400
+ setStatus("sent");
22401
+ } catch {
22402
+ setStatus("error");
22403
+ }
22404
+ }, [canSubmit, note, onSubmit, rating]);
22042
22405
  if (!expanded) {
22043
22406
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
22044
22407
  "button",
@@ -22072,7 +22435,12 @@ function TryOnExperienceFeedback({ t: t2, isMobile }) {
22072
22435
  {
22073
22436
  type: "button",
22074
22437
  className: `ps-tryon-feedback-star${value <= rating ? " is-active" : ""}`,
22075
- onClick: () => setRating(value),
22438
+ onClick: () => {
22439
+ if (!canEdit) return;
22440
+ setRating(value);
22441
+ setStatus("idle");
22442
+ },
22443
+ disabled: !canEdit,
22076
22444
  role: "radio",
22077
22445
  "aria-checked": rating === value,
22078
22446
  "aria-label": `${value} ${t2("stars")}`,
@@ -22081,16 +22449,76 @@ function TryOnExperienceFeedback({ t: t2, isMobile }) {
22081
22449
  value
22082
22450
  )) })
22083
22451
  ] }),
22084
- /* @__PURE__ */ jsxRuntimeExports.jsx(
22085
- "input",
22086
- {
22087
- className: "ps-tryon-feedback-note",
22088
- value: note,
22089
- onChange: (event) => setNote(event.target.value),
22090
- placeholder: t2("Optional note"),
22091
- maxLength: 120
22092
- }
22093
- )
22452
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-feedback-form", children: [
22453
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
22454
+ "textarea",
22455
+ {
22456
+ ref: noteRef,
22457
+ className: "ps-tryon-feedback-note",
22458
+ value: note,
22459
+ onChange: (event) => {
22460
+ if (!canEdit) return;
22461
+ setNote(event.target.value);
22462
+ setStatus("idle");
22463
+ resizeNote(event.currentTarget);
22464
+ },
22465
+ disabled: !canEdit,
22466
+ placeholder: t2("Optional note"),
22467
+ maxLength: 1e3,
22468
+ rows: 1
22469
+ }
22470
+ ),
22471
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
22472
+ "button",
22473
+ {
22474
+ type: "button",
22475
+ className: "ps-tryon-feedback-submit",
22476
+ onClick: submitFeedback,
22477
+ disabled: !canSubmit,
22478
+ "aria-label": t2("Send feedback"),
22479
+ children: status === "submitting" ? t2("Sending") : status === "sent" ? t2("Sent") : t2("Send")
22480
+ }
22481
+ )
22482
+ ] }),
22483
+ status === "error" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-feedback-status", children: t2("Couldn't send. Try again.") })
22484
+ ] });
22485
+ }
22486
+ function ResultImageActionBar({
22487
+ showLines,
22488
+ canShowFit,
22489
+ onToggleFit,
22490
+ onOpenImage,
22491
+ onDownload,
22492
+ t: t2
22493
+ }) {
22494
+ if (!canShowFit && !onOpenImage && !onDownload) return null;
22495
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-result-image-action-bar", children: [
22496
+ canShowFit && onToggleFit && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-result-image-action", onClick: onToggleFit, children: [
22497
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
22498
+ /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
22499
+ /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
22500
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "7", cy: "9", r: "2" }),
22501
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "17", cy: "15", r: "2" })
22502
+ ] }),
22503
+ showLines ? t2("Hide Fit") : t2("Show Fit")
22504
+ ] }),
22505
+ onOpenImage && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-result-image-action", onClick: onOpenImage, children: [
22506
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
22507
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
22508
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 3h3a2 2 0 0 1 2 2v3" }),
22509
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
22510
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
22511
+ ] }),
22512
+ t2("Full Size")
22513
+ ] }),
22514
+ onDownload && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-result-image-action", onClick: onDownload, children: [
22515
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
22516
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
22517
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M7 10l5 5 5-5" }),
22518
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 15V3" })
22519
+ ] }),
22520
+ t2("Download")
22521
+ ] })
22094
22522
  ] });
22095
22523
  }
22096
22524
  function garmentIconForSection(name) {
@@ -22617,12 +23045,14 @@ function SectionDetailView({
22617
23045
  onImageLoad,
22618
23046
  onOpenImage,
22619
23047
  onDownload,
23048
+ onFeedbackSubmit,
22620
23049
  onTryOn,
22621
23050
  tryOnProcessing,
22622
23051
  tryOnStartedAt,
22623
23052
  backLabel,
22624
23053
  internationalSizes,
22625
23054
  continueLabel,
23055
+ onContinue,
22626
23056
  renderRaw = false,
22627
23057
  sectionFound,
22628
23058
  allSizes,
@@ -22899,14 +23329,19 @@ function SectionDetailView({
22899
23329
  });
22900
23330
  return isFootwear ? rows.filter((row) => isFootLengthMeasurement(row.area)) : rows;
22901
23331
  }, [sectionResult, lengthEntry, userMeasurements, renderRaw, allSizes, displaySize, selectedLength, isFootwear]);
23332
+ const activeFitKeyRef = reactExports.useRef("");
22902
23333
  reactExports.useEffect(() => {
22903
23334
  if (!onActiveFitChange) return;
22904
- onActiveFitChange(fitRows.map((r2) => ({
23335
+ const nextRows = fitRows.map((r2) => ({
22905
23336
  area: r2.area,
22906
23337
  userNum: r2.userNum ?? 0,
22907
23338
  chartLabel: r2.chartLabel ?? "",
22908
23339
  fit: r2.fit ?? "good"
22909
- })));
23340
+ }));
23341
+ const nextKey = JSON.stringify(nextRows);
23342
+ if (activeFitKeyRef.current === nextKey) return;
23343
+ activeFitKeyRef.current = nextKey;
23344
+ onActiveFitChange(nextRows);
22910
23345
  }, [fitRows, onActiveFitChange]);
22911
23346
  const allowsLengthDisplay = !renderRaw && !isFootwear;
22912
23347
  const secAny = sectionResult;
@@ -23048,62 +23483,38 @@ function SectionDetailView({
23048
23483
  ] }),
23049
23484
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-msd-topbar-spacer" })
23050
23485
  ] }),
23051
- productImage && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-msd-image${isTryOnImage ? " ps-tryon" : ""}`, children: [
23052
- /* @__PURE__ */ jsxRuntimeExports.jsx(
23053
- "img",
23054
- {
23055
- src: productImage,
23056
- alt: productTitle || "",
23057
- className: "ps-msd-image-img",
23058
- onLoad: onImageLoad,
23059
- onClick: isTryOnImage && onOpenImage ? onOpenImage : void 0,
23060
- style: isTryOnImage && onOpenImage ? { cursor: "zoom-in" } : void 0
23061
- }
23062
- ),
23063
- showLines && (renderOverlayWithFit ? renderOverlayWithFit(fitRows.map((r2) => ({
23064
- area: r2.area,
23065
- userNum: r2.userNum ?? 0,
23066
- chartLabel: r2.chartLabel ?? "",
23067
- fit: r2.fit ?? "good"
23068
- }))) : overlayNode),
23069
- tryOnProcessing && tryOnStartedAt != null && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt, t: t2 }),
23070
- isTryOnImage && !isFootwear && onToggleLines && /* @__PURE__ */ jsxRuntimeExports.jsxs(
23071
- "button",
23486
+ productImage && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
23487
+ isTryOnImage && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(
23488
+ ResultImageActionBar,
23072
23489
  {
23073
- type: "button",
23074
- className: "ps-msr-fit-toggle",
23075
- onClick: onToggleLines,
23076
- "aria-pressed": !!showLines,
23077
- children: [
23078
- /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
23079
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
23080
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
23081
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "7", cy: "9", r: "2" }),
23082
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "17", cy: "15", r: "2" })
23083
- ] }),
23084
- showLines ? t2("Hide Fit") : t2("Show Fit")
23085
- ]
23490
+ showLines: !!showLines,
23491
+ canShowFit: !isFootwear && !!onToggleLines,
23492
+ onToggleFit: onToggleLines,
23493
+ onOpenImage,
23494
+ onDownload,
23495
+ t: t2
23086
23496
  }
23087
23497
  ),
23088
- isTryOnImage && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-feedback-slot", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, isMobile: true }) }),
23089
- isTryOnImage && (onOpenImage || onDownload) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-media-actions", children: [
23090
- onOpenImage && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-msr-media-btn", onClick: onOpenImage, children: [
23091
- /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
23092
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
23093
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 3h3a2 2 0 0 1 2 2v3" }),
23094
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
23095
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
23096
- ] }),
23097
- t2("Full Size")
23098
- ] }),
23099
- onDownload && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-msr-media-btn", onClick: onDownload, children: [
23100
- /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
23101
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
23102
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M7 10l5 5 5-5" }),
23103
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 15V3" })
23104
- ] }),
23105
- t2("Download")
23106
- ] })
23498
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-msd-image${isTryOnImage ? " ps-tryon" : ""}`, children: [
23499
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23500
+ "img",
23501
+ {
23502
+ src: productImage,
23503
+ alt: productTitle || "",
23504
+ className: "ps-msd-image-img",
23505
+ onLoad: onImageLoad,
23506
+ onClick: isTryOnImage && onOpenImage ? onOpenImage : void 0,
23507
+ style: isTryOnImage && onOpenImage ? { cursor: "zoom-in" } : void 0
23508
+ }
23509
+ ),
23510
+ showLines && (renderOverlayWithFit ? renderOverlayWithFit(fitRows.map((r2) => ({
23511
+ area: r2.area,
23512
+ userNum: r2.userNum ?? 0,
23513
+ chartLabel: r2.chartLabel ?? "",
23514
+ fit: r2.fit ?? "good"
23515
+ }))) : overlayNode),
23516
+ tryOnProcessing && tryOnStartedAt != null && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt, t: t2 }),
23517
+ isTryOnImage && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-feedback-slot", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, isMobile: true, onSubmit: onFeedbackSubmit }) })
23107
23518
  ] })
23108
23519
  ] }),
23109
23520
  false,
@@ -23268,14 +23679,13 @@ function SectionDetailView({
23268
23679
  t2("based on your measurements and the garment's tailoring chart.")
23269
23680
  ] }) }),
23270
23681
  profileCompletionCta && /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, isMobile: true, t: t2 }),
23271
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: 10, padding: "12px 0 4px", flexShrink: 0, alignItems: "center" }, children: [
23682
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msd-actions", children: [
23272
23683
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
23273
23684
  "button",
23274
23685
  {
23275
23686
  type: "button",
23276
- className: "ps-bp-back-btn",
23687
+ className: "ps-bp-back-btn ps-msd-action-back",
23277
23688
  onClick: onBack,
23278
- style: { fontSize: 13, padding: "10px 6px", flexShrink: 0 },
23279
23689
  children: [
23280
23690
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
23281
23691
  " ",
@@ -23289,25 +23699,7 @@ function SectionDetailView({
23289
23699
  type: "button",
23290
23700
  onClick: onTryOn,
23291
23701
  disabled: tryOnProcessing,
23292
- style: {
23293
- flex: "1 1 0",
23294
- minWidth: 0,
23295
- padding: "12px 16px",
23296
- borderRadius: 10,
23297
- background: "var(--ps-accent)",
23298
- color: "white",
23299
- border: "none",
23300
- fontSize: 14,
23301
- fontWeight: 700,
23302
- fontFamily: "inherit",
23303
- cursor: tryOnProcessing ? "default" : "pointer",
23304
- opacity: tryOnProcessing ? 0.6 : 1,
23305
- display: "flex",
23306
- alignItems: "center",
23307
- justifyContent: "center",
23308
- gap: 6,
23309
- whiteSpace: "nowrap"
23310
- },
23702
+ className: "ps-msd-primary-cta",
23311
23703
  children: [
23312
23704
  /* @__PURE__ */ jsxRuntimeExports.jsx(CameraIcon$1, { size: 14 }),
23313
23705
  tryOnProcessing ? `${t2("Generating try-on…")}${tryOnElapsedS > 0 ? ` ${tryOnElapsedS}s` : ""}` : t2("Try It On")
@@ -23318,24 +23710,7 @@ function SectionDetailView({
23318
23710
  {
23319
23711
  type: "button",
23320
23712
  onClick: onBack,
23321
- style: {
23322
- flex: isCompactMobileContinue ? "0 0 auto" : "1 1 0",
23323
- minWidth: isCompactMobileContinue ? 88 : 0,
23324
- padding: isCompactMobileContinue ? "10px 14px" : "12px 16px",
23325
- borderRadius: 10,
23326
- background: "var(--ps-accent)",
23327
- color: "white",
23328
- border: "none",
23329
- fontSize: isCompactMobileContinue ? 13 : 14,
23330
- fontWeight: 700,
23331
- fontFamily: "inherit",
23332
- cursor: "pointer",
23333
- display: "flex",
23334
- alignItems: "center",
23335
- justifyContent: "center",
23336
- gap: 6,
23337
- whiteSpace: "nowrap"
23338
- },
23713
+ className: `ps-msd-primary-cta${isCompactMobileContinue ? " ps-compact" : ""}`,
23339
23714
  children: [
23340
23715
  continueLabel || t2("Continue"),
23341
23716
  " →"
@@ -23558,7 +23933,7 @@ function SectionDetailView({
23558
23933
  ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
23559
23934
  "button",
23560
23935
  {
23561
- onClick: onBack,
23936
+ onClick: continueLabel ? onContinue || onBack : onBack,
23562
23937
  style: {
23563
23938
  padding: "0.45vw 1.2vw",
23564
23939
  borderRadius: "0.4vw",
@@ -23594,11 +23969,14 @@ function SizeResultView({
23594
23969
  productImages,
23595
23970
  productCarouselItems,
23596
23971
  productTitle,
23972
+ productUrl,
23597
23973
  productMaterial,
23598
23974
  productDescription,
23599
23975
  sizingUnit,
23600
23976
  setView,
23601
23977
  handleDownload,
23978
+ onContinueShopping,
23979
+ onTryOnFeedbackSubmit,
23602
23980
  selectedFile,
23603
23981
  previewUrl,
23604
23982
  handleFileSelect,
@@ -24117,6 +24495,7 @@ function SizeResultView({
24117
24495
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24118
24496
  })(),
24119
24497
  onBack: () => setActiveSection(null),
24498
+ onContinue: onContinueShopping || onClose,
24120
24499
  internationalSizes: entry.secResult?.internationalSizes,
24121
24500
  productImage: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24122
24501
  productTitle,
@@ -24128,6 +24507,7 @@ function SizeResultView({
24128
24507
  onToggleLines: suppressFitOverlayActions ? void 0 : () => setShowLines(!showLines),
24129
24508
  onOpenImage: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0,
24130
24509
  onDownload: resultImageUrl && !tryOnProcessing ? handleDownload : void 0,
24510
+ onFeedbackSubmit: onTryOnFeedbackSubmit,
24131
24511
  onImageLoad: handleImgLoad,
24132
24512
  overlayNode: tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
24133
24513
  /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
@@ -24166,20 +24546,34 @@ function SizeResultView({
24166
24546
  ] });
24167
24547
  }
24168
24548
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2", children: [
24169
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24170
- /* @__PURE__ */ jsxRuntimeExports.jsx(
24171
- "img",
24549
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-media-stack", children: [
24550
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(
24551
+ ResultImageActionBar,
24172
24552
  {
24173
- src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24174
- alt: productTitle,
24175
- className: "ps-tryon-v2-bg-img",
24176
- onLoad: handleImgLoad,
24177
- style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24178
- onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24553
+ showLines: !!showLines,
24554
+ canShowFit: !suppressFitOverlayActions,
24555
+ onToggleFit: () => setShowLines(!showLines),
24556
+ onOpenImage: () => setZoomImageUrl(resultImageUrl),
24557
+ onDownload: handleDownload,
24558
+ t: t2
24179
24559
  }
24180
24560
  ),
24181
- tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24182
- /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing })
24561
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24562
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24563
+ "img",
24564
+ {
24565
+ src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24566
+ alt: productTitle,
24567
+ className: "ps-tryon-v2-bg-img",
24568
+ onLoad: handleImgLoad,
24569
+ style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24570
+ onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24571
+ }
24572
+ ),
24573
+ tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24574
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing }),
24575
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-img-actions", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, onSubmit: onTryOnFeedbackSubmit }) })
24576
+ ] })
24183
24577
  ] }),
24184
24578
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-panel", children: [
24185
24579
  mismatchNotice,
@@ -24201,9 +24595,11 @@ function SizeResultView({
24201
24595
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24202
24596
  })(),
24203
24597
  onBack: () => setActiveSection(null),
24598
+ onContinue: onContinueShopping || onClose,
24204
24599
  internationalSizes: entry.secResult?.internationalSizes,
24205
24600
  tryOnProcessing,
24206
24601
  tryOnStartedAt,
24602
+ onFeedbackSubmit: onTryOnFeedbackSubmit,
24207
24603
  t: t2,
24208
24604
  isFootwear: measurementType === "foot",
24209
24605
  userGender: shoeUserGender,
@@ -24242,11 +24638,23 @@ function SizeResultView({
24242
24638
  setGuideFile(selectedFile || null);
24243
24639
  setShowPhotoGuide(true);
24244
24640
  },
24245
- onClose,
24641
+ onClose: onContinueShopping || onClose,
24246
24642
  showLines,
24247
24643
  onToggleLines: suppressFitOverlayActions ? void 0 : () => setShowLines(!showLines),
24248
24644
  onOpenImage: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0,
24249
24645
  onDownload: resultImageUrl && !tryOnProcessing ? handleDownload : void 0,
24646
+ imageActionBar: resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsx(
24647
+ ResultImageActionBar,
24648
+ {
24649
+ showLines: !!showLines,
24650
+ canShowFit: !suppressFitOverlayActions,
24651
+ onToggleFit: () => setShowLines(!showLines),
24652
+ onOpenImage: () => setZoomImageUrl(resultImageUrl),
24653
+ onDownload: handleDownload,
24654
+ t: t2
24655
+ }
24656
+ ) : null,
24657
+ feedbackSlot: resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-feedback-slot", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, isMobile: true, onSubmit: onTryOnFeedbackSubmit }) }) : null,
24250
24658
  onImageLoad: handleImgLoad,
24251
24659
  profileCompletionCta: profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, isMobile: true, t: t2 }) : null,
24252
24660
  overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -24279,60 +24687,55 @@ function SizeResultView({
24279
24687
  ) : (
24280
24688
  /* ── Desktop section picker: split layout — image left, image cards right ── */
24281
24689
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2", children: [
24282
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24283
- /* @__PURE__ */ jsxRuntimeExports.jsx(
24284
- "img",
24690
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-media-stack", children: [
24691
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(
24692
+ ResultImageActionBar,
24285
24693
  {
24286
- src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24287
- alt: productTitle,
24288
- className: "ps-tryon-v2-bg-img",
24289
- onLoad: handleImgLoad,
24290
- style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24291
- onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24694
+ showLines: !!showLines,
24695
+ canShowFit: !suppressFitOverlayActions,
24696
+ onToggleFit: () => setShowLines(!showLines),
24697
+ onOpenImage: () => setZoomImageUrl(resultImageUrl),
24698
+ onDownload: handleDownload,
24699
+ t: t2
24292
24700
  }
24293
24701
  ),
24294
- tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24295
- /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing }),
24296
- resultImageUrl && !tryOnProcessing && poseReady && poseLines && /* @__PURE__ */ jsxRuntimeExports.jsx(MeasurementOverlay, { lines: poseLines, fitRows: (() => {
24297
- const all = [...sizingResult?.matchDetails || []];
24298
- if (sizingResult?.sections) {
24299
- for (const sec of Object.values(sizingResult.sections)) {
24300
- if (sec.matchDetails) all.push(...sec.matchDetails);
24702
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24703
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24704
+ "img",
24705
+ {
24706
+ src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24707
+ alt: productTitle,
24708
+ className: "ps-tryon-v2-bg-img",
24709
+ onLoad: handleImgLoad,
24710
+ style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24711
+ onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24301
24712
  }
24302
- }
24303
- const seen = /* @__PURE__ */ new Set();
24304
- return all.filter((m2) => {
24305
- const k2 = m2.measurement.toLowerCase();
24306
- if (seen.has(k2)) return false;
24307
- seen.add(k2);
24308
- return true;
24309
- }).map((m2) => ({ area: m2.measurement, userNum: parseFloat(m2.userValue) || 0, chartLabel: m2.chartRange || "", fit: m2.fit }));
24310
- })(), show: showLines, imgWidth: imgDims.w, imgHeight: imgDims.h }),
24311
- resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-img-actions", children: [
24312
- /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2 }),
24313
- !suppressFitOverlayActions && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-sr-glass-btn", onClick: () => setShowLines(!showLines), children: [
24314
- /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
24315
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
24316
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
24317
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "7", cy: "9", r: "2" }),
24318
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "17", cy: "15", r: "2" })
24319
- ] }),
24320
- showLines ? t2("Hide Fit") : t2("Show Fit")
24321
- ] }),
24322
- suppressFitOverlayActions && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-sr-glass-btn", onClick: () => setZoomImageUrl(resultImageUrl), children: t2("Full Size") }),
24323
- /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-sr-glass-btn", onClick: handleDownload, children: [
24324
- /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
24325
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
24326
- /* @__PURE__ */ jsxRuntimeExports.jsx("polyline", { points: "7 10 12 15 17 10" }),
24327
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
24328
- ] }),
24329
- t2("Download")
24330
- ] })
24713
+ ),
24714
+ tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24715
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing }),
24716
+ resultImageUrl && !tryOnProcessing && poseReady && poseLines && /* @__PURE__ */ jsxRuntimeExports.jsx(MeasurementOverlay, { lines: poseLines, fitRows: (() => {
24717
+ const all = [...sizingResult?.matchDetails || []];
24718
+ if (sizingResult?.sections) {
24719
+ for (const sec of Object.values(sizingResult.sections)) {
24720
+ if (sec.matchDetails) all.push(...sec.matchDetails);
24721
+ }
24722
+ }
24723
+ const seen = /* @__PURE__ */ new Set();
24724
+ return all.filter((m2) => {
24725
+ const k2 = m2.measurement.toLowerCase();
24726
+ if (seen.has(k2)) return false;
24727
+ seen.add(k2);
24728
+ return true;
24729
+ }).map((m2) => ({ area: m2.measurement, userNum: parseFloat(m2.userValue) || 0, chartLabel: m2.chartRange || "", fit: m2.fit }));
24730
+ })(), show: showLines, imgWidth: imgDims.w, imgHeight: imgDims.h }),
24731
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-img-actions", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, onSubmit: onTryOnFeedbackSubmit }) })
24331
24732
  ] })
24332
24733
  ] }),
24333
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-panel", children: [
24334
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: t2("Your Perfect Fit") }),
24335
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: t2("Tap any section for detailed breakdown") }),
24734
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-panel ps-tryon-v2-result-panel", children: [
24735
+ 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: [
24736
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: t2("Your Perfect Fit") }),
24737
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: t2("Tap any section for detailed breakdown") })
24738
+ ] }),
24336
24739
  mismatchNotice,
24337
24740
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }),
24338
24741
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: sectionEntries.map(({ name, secResult }, idx) => {
@@ -24373,8 +24776,7 @@ function SizeResultView({
24373
24776
  sectionImg && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: sectionImg, alt: name, className: "ps-tryon-sr-card-v2-img" })
24374
24777
  ] }, name);
24375
24778
  }) }),
24376
- profileCompletionCta && /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, t: t2 }),
24377
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
24779
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-actions", children: [
24378
24780
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-bp-back-btn", onClick: () => setView("body-profile"), type: "button", children: [
24379
24781
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
24380
24782
  " ",
@@ -24385,7 +24787,7 @@ function SizeResultView({
24385
24787
  {
24386
24788
  className: "ps-tryon-v2-cta",
24387
24789
  style: { marginTop: 0 },
24388
- onClick: onClose,
24790
+ onClick: onContinueShopping || onClose,
24389
24791
  children: [
24390
24792
  t2("Continue Shopping"),
24391
24793
  " →"
@@ -24396,7 +24798,7 @@ function SizeResultView({
24396
24798
  {
24397
24799
  className: "ps-tryon-v2-cta",
24398
24800
  style: { marginTop: 0 },
24399
- onClick: onClose,
24801
+ onClick: onContinueShopping || onClose,
24400
24802
  children: [
24401
24803
  t2("Continue Shopping"),
24402
24804
  " →"
@@ -24466,6 +24868,7 @@ function SizeResultView({
24466
24868
  if (resultImageUrl) onResetTryOn?.();
24467
24869
  setView("body-profile");
24468
24870
  },
24871
+ onContinue: onContinueShopping || onClose,
24469
24872
  backLabel: t2("Back"),
24470
24873
  internationalSizes: singleInternationalSizes,
24471
24874
  onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
@@ -24486,6 +24889,7 @@ function SizeResultView({
24486
24889
  onToggleLines: suppressFitOverlayActions ? void 0 : () => setShowLines(!showLines),
24487
24890
  onOpenImage: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0,
24488
24891
  onDownload: resultImageUrl && !tryOnProcessing ? handleDownload : void 0,
24892
+ onFeedbackSubmit: onTryOnFeedbackSubmit,
24489
24893
  onImageLoad: handleImgLoad,
24490
24894
  overlayNode: resultImageUrl && poseReady && poseLines ? /* @__PURE__ */ jsxRuntimeExports.jsx(
24491
24895
  MeasurementOverlay,
@@ -24503,38 +24907,46 @@ function SizeResultView({
24503
24907
  ] });
24504
24908
  }
24505
24909
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2", children: [
24506
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24507
- /* @__PURE__ */ jsxRuntimeExports.jsx(
24508
- "img",
24910
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-media-stack", children: [
24911
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(
24912
+ ResultImageActionBar,
24509
24913
  {
24510
- src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24511
- alt: productTitle,
24512
- className: "ps-tryon-v2-bg-img",
24513
- onLoad: handleImgLoad,
24514
- style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24515
- onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24516
- }
24517
- ),
24518
- tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24519
- /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing }),
24520
- resultImageUrl && !tryOnProcessing && poseReady && poseLines && /* @__PURE__ */ jsxRuntimeExports.jsx(
24521
- MeasurementOverlay,
24522
- {
24523
- lines: poseLines,
24524
- fitRows: activeFitRows.length > 0 ? activeFitRows : (sizingResult?.matchDetails || []).map((m2) => ({ area: m2.measurement, userNum: parseFloat(m2.userValue) || 0, chartLabel: m2.chartRange || "", fit: m2.fit })),
24525
- show: showLines,
24526
- imgWidth: imgDims.w,
24527
- imgHeight: imgDims.h
24914
+ showLines: !!showLines,
24915
+ canShowFit: !suppressFitOverlayActions,
24916
+ onToggleFit: () => setShowLines(!showLines),
24917
+ onOpenImage: () => setZoomImageUrl(resultImageUrl),
24918
+ onDownload: handleDownload,
24919
+ t: t2
24528
24920
  }
24529
24921
  ),
24530
- resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-img-actions", children: [
24531
- /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2 }),
24532
- !suppressFitOverlayActions && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-sr-glass-btn", onClick: () => setShowLines(!showLines), children: showLines ? t2("Hide Fit") : t2("Show Fit") }),
24533
- suppressFitOverlayActions && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-sr-glass-btn", onClick: () => setZoomImageUrl(resultImageUrl), children: t2("Full Size") }),
24534
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ps-tryon-sr-glass-btn", onClick: handleDownload, children: t2("Download") })
24922
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
24923
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24924
+ "img",
24925
+ {
24926
+ src: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24927
+ alt: productTitle,
24928
+ className: "ps-tryon-v2-bg-img",
24929
+ onLoad: handleImgLoad,
24930
+ style: resultImageUrl && !tryOnProcessing ? { cursor: "zoom-in" } : void 0,
24931
+ onClick: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0
24932
+ }
24933
+ ),
24934
+ tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnGenerationBadge, { tryOnStartedAt: tryOnStartedAt ?? null, t: t2 }),
24935
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RegenScanOverlay, { active: !!tryOnProcessing }),
24936
+ resultImageUrl && !tryOnProcessing && poseReady && poseLines && /* @__PURE__ */ jsxRuntimeExports.jsx(
24937
+ MeasurementOverlay,
24938
+ {
24939
+ lines: poseLines,
24940
+ fitRows: activeFitRows.length > 0 ? activeFitRows : (sizingResult?.matchDetails || []).map((m2) => ({ area: m2.measurement, userNum: parseFloat(m2.userValue) || 0, chartLabel: m2.chartRange || "", fit: m2.fit })),
24941
+ show: showLines,
24942
+ imgWidth: imgDims.w,
24943
+ imgHeight: imgDims.h
24944
+ }
24945
+ ),
24946
+ resultImageUrl && !tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-img-actions", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TryOnExperienceFeedback, { t: t2, onSubmit: onTryOnFeedbackSubmit }) })
24535
24947
  ] })
24536
24948
  ] }),
24537
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-panel", children: [
24949
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-v2-panel${activeSection ? "" : " ps-tryon-v2-result-panel"}`, children: [
24538
24950
  mismatchNotice,
24539
24951
  activeSection === sectionName ? (
24540
24952
  /* DETAIL VIEW — full size table, same as multi-garment */
@@ -24557,12 +24969,14 @@ function SizeResultView({
24557
24969
  setActiveSection(null);
24558
24970
  }
24559
24971
  },
24972
+ onContinue: onContinueShopping || onClose,
24560
24973
  backLabel: t2("Back"),
24561
24974
  internationalSizes: singleInternationalSizes,
24562
24975
  onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
24563
24976
  continueLabel: resultImageUrl ? t2("Continue Shopping") : void 0,
24564
24977
  tryOnProcessing,
24565
24978
  tryOnStartedAt,
24979
+ onFeedbackSubmit: onTryOnFeedbackSubmit,
24566
24980
  t: t2,
24567
24981
  renderRaw: isAccessory,
24568
24982
  isFootwear: measurementType === "foot",
@@ -24610,7 +25024,7 @@ function SizeResultView({
24610
25024
  }
24611
25025
  ) }),
24612
25026
  hasCarousel && /* @__PURE__ */ jsxRuntimeExports.jsx(ProductPhotoCarouselCard, { items: carouselItems.length > 0 ? carouselItems : void 0, photos: productImages, productTitle, t: t2 }),
24613
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
25027
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-actions", children: [
24614
25028
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
24615
25029
  "button",
24616
25030
  {
@@ -24627,10 +25041,10 @@ function SizeResultView({
24627
25041
  ]
24628
25042
  }
24629
25043
  ),
24630
- resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onClose, children: [
25044
+ resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
24631
25045
  t2("Continue Shopping"),
24632
25046
  " →"
24633
- ] }) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onClose, children: [
25047
+ ] }) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
24634
25048
  t2("Continue Shopping"),
24635
25049
  " →"
24636
25050
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -31693,6 +32107,13 @@ if (typeof document !== "undefined") {
31693
32107
  }
31694
32108
  }
31695
32109
  const PROFILE_COMPLETION_DRAFT_KEY = "profile_completion_draft";
32110
+ const TRYON_FEEDBACK_SUBMITTED_KEY = "tryon_feedback_submitted";
32111
+ function buildTryOnFeedbackKey(input) {
32112
+ if (input.jobId) return `job:${input.jobId}`;
32113
+ if (input.historyEntryId) return `history:${input.historyEntryId}`;
32114
+ if (input.resultImageUrl) return `result:${input.resultImageUrl.slice(0, 180)}`;
32115
+ return `fallback:${input.productId || input.productTitle || "product"}:${input.recommendedSize || "size"}`;
32116
+ }
31696
32117
  function positiveNumber(value) {
31697
32118
  const n2 = typeof value === "number" ? value : parseFloat(String(value ?? ""));
31698
32119
  return Number.isFinite(n2) && n2 > 0 ? n2 : void 0;
@@ -31776,6 +32197,7 @@ function PrimeStyleTryonInner({
31776
32197
  productCarouselItems,
31777
32198
  garmentReferenceImage,
31778
32199
  productTitle = "Product",
32200
+ productUrl,
31779
32201
  productId,
31780
32202
  productCategory,
31781
32203
  productGender,
@@ -31828,6 +32250,17 @@ function PrimeStyleTryonInner({
31828
32250
  }, [productTagsKey]);
31829
32251
  const effectiveProductImages = stableProductImages.length > 0 ? stableProductImages : void 0;
31830
32252
  const effectiveProductCarouselItems = stableProductCarouselItems.length > 0 ? stableProductCarouselItems : void 0;
32253
+ const effectiveProductUrl = reactExports.useMemo(() => {
32254
+ const source = productUrl?.trim();
32255
+ if (source) {
32256
+ try {
32257
+ return typeof window !== "undefined" ? new URL(source, window.location.origin).href : source;
32258
+ } catch {
32259
+ return source;
32260
+ }
32261
+ }
32262
+ return typeof window !== "undefined" ? window.location.href : void 0;
32263
+ }, [productUrl]);
31831
32264
  const resolvedProductFitType = reactExports.useMemo(
31832
32265
  () => detectProductFitType({
31833
32266
  productFitType,
@@ -32005,12 +32438,15 @@ function PrimeStyleTryonInner({
32005
32438
  const [profileAuthLoadingProvider, setProfileAuthLoadingProvider] = reactExports.useState(null);
32006
32439
  const [history, setHistory] = reactExports.useState(() => lsGet("history", []).map(normalizeHistoryEntry));
32007
32440
  const currentHistoryEntryIdRef = reactExports.useRef(null);
32441
+ const currentTryOnJobIdRef = reactExports.useRef(null);
32442
+ const submittedFeedbackKeysRef = reactExports.useRef(new Set(lsGet(TRYON_FEEDBACK_SUBMITTED_KEY, [])));
32008
32443
  const [mobileMenuOpen, setMobileMenuOpen] = reactExports.useState(false);
32009
32444
  const mobileMenuBtnRef = reactExports.useRef(null);
32010
32445
  const [restoredProductImage, setRestoredProductImage] = reactExports.useState(null);
32011
32446
  const [restoredProductImages, setRestoredProductImages] = reactExports.useState(null);
32012
32447
  const [restoredProductCarouselItems, setRestoredProductCarouselItems] = reactExports.useState(null);
32013
32448
  const [restoredProductTitle, setRestoredProductTitle] = reactExports.useState(null);
32449
+ const [restoredProductUrl, setRestoredProductUrl] = reactExports.useState(null);
32014
32450
  const [activeProfileId, setActiveProfileIdState] = reactExports.useState(() => getActiveProfileId());
32015
32451
  const [estimatingProfileIds, setEstimatingProfileIds] = reactExports.useState(() => /* @__PURE__ */ new Set());
32016
32452
  const [deleteConfirmId, setDeleteConfirmId] = reactExports.useState(null);
@@ -32528,6 +32964,13 @@ function PrimeStyleTryonInner({
32528
32964
  setSizingResult(null);
32529
32965
  setResultImageUrl(null);
32530
32966
  currentHistoryEntryIdRef.current = null;
32967
+ currentTryOnJobIdRef.current = null;
32968
+ setRestoredProductImage(null);
32969
+ setRestoredProductImages(null);
32970
+ setRestoredProductCarouselItems(null);
32971
+ setRestoredProductTitle(null);
32972
+ setRestoredProductUrl(null);
32973
+ setRestoredProductUrl(null);
32531
32974
  setSizingLoading(true);
32532
32975
  setEstimationDone(hasStored);
32533
32976
  if (hasStored) {
@@ -32615,12 +33058,18 @@ function PrimeStyleTryonInner({
32615
33058
  setProfileSaved(false);
32616
33059
  formRef.current = {};
32617
33060
  setFormGender("male");
33061
+ setRestoredProductImage(null);
33062
+ setRestoredProductImages(null);
33063
+ setRestoredProductCarouselItems(null);
33064
+ setRestoredProductTitle(null);
33065
+ setRestoredProductUrl(null);
32618
33066
  if (!tryOnInFlight) {
32619
33067
  setResultImageUrl(null);
32620
33068
  setSizingResult(null);
32621
33069
  historySavedRef.current = false;
32622
33070
  historyTryonSavedRef.current = false;
32623
33071
  currentHistoryEntryIdRef.current = null;
33072
+ currentTryOnJobIdRef.current = null;
32624
33073
  unsubRef.current?.();
32625
33074
  unsubRef.current = null;
32626
33075
  if (pollingRef.current) {
@@ -32725,6 +33174,7 @@ function PrimeStyleTryonInner({
32725
33174
  return;
32726
33175
  }
32727
33176
  if (update.status === "completed" && update.imageUrl) {
33177
+ currentTryOnJobIdRef.current = update.galleryId;
32728
33178
  if (shouldUseShopifyCartAttribution(apiUrl)) {
32729
33179
  setLastCompletedProduct(effectiveProductId ?? null, productTitle || null);
32730
33180
  }
@@ -33033,10 +33483,12 @@ function PrimeStyleTryonInner({
33033
33483
  setSizingResult(null);
33034
33484
  setResultImageUrl(null);
33035
33485
  currentHistoryEntryIdRef.current = null;
33486
+ currentTryOnJobIdRef.current = null;
33036
33487
  setRestoredProductImage(null);
33037
33488
  setRestoredProductImages(null);
33038
33489
  setRestoredProductCarouselItems(null);
33039
33490
  setRestoredProductTitle(null);
33491
+ setRestoredProductUrl(null);
33040
33492
  if (previewUrl) URL.revokeObjectURL(previewUrl);
33041
33493
  setSelectedFile(null);
33042
33494
  selectedFileRef.current = null;
@@ -33102,6 +33554,7 @@ function PrimeStyleTryonInner({
33102
33554
  historySavedRef.current = false;
33103
33555
  historyTryonSavedRef.current = false;
33104
33556
  currentHistoryEntryIdRef.current = null;
33557
+ currentTryOnJobIdRef.current = null;
33105
33558
  setSizingLoading(true);
33106
33559
  setEstimationDone(false);
33107
33560
  setView("size-result");
@@ -33332,6 +33785,7 @@ function PrimeStyleTryonInner({
33332
33785
  selectedFileRef.current = overrideFile;
33333
33786
  }
33334
33787
  completedRef.current = false;
33788
+ currentTryOnJobIdRef.current = null;
33335
33789
  setTryOnProcessing(true);
33336
33790
  setTryOnStartedAt(Date.now());
33337
33791
  const vtoCategory = measurementTypeToVtoCategory(measurementType, resolvedProductFitType);
@@ -33469,6 +33923,7 @@ function PrimeStyleTryonInner({
33469
33923
  modelImageId: modelImageIdRef.current ?? void 0
33470
33924
  }
33471
33925
  );
33926
+ currentTryOnJobIdRef.current = response.jobId;
33472
33927
  if (response.modelImageId) modelImageIdRef.current = response.modelImageId;
33473
33928
  onProcessing?.(response.jobId);
33474
33929
  const usePollingOnly = shouldUseShopifyCartAttribution(apiUrl);
@@ -33539,6 +33994,59 @@ function PrimeStyleTryonInner({
33539
33994
  }).catch(() => window.open(resultImageUrl, "_blank"));
33540
33995
  }
33541
33996
  }, [resultImageUrl]);
33997
+ const handleContinueShopping = reactExports.useCallback(() => {
33998
+ const historyUrl = restoredProductUrl || "";
33999
+ if (historyUrl && typeof window !== "undefined") {
34000
+ try {
34001
+ window.open(new URL(historyUrl, window.location.origin).href, "_blank", "noopener,noreferrer");
34002
+ } catch {
34003
+ window.open(historyUrl, "_blank", "noopener,noreferrer");
34004
+ }
34005
+ }
34006
+ handleClose();
34007
+ }, [handleClose, restoredProductUrl]);
34008
+ const handleTryOnFeedbackSubmit = reactExports.useCallback(async ({ rating, note }) => {
34009
+ const profileLoggedIn = Boolean(profileSession);
34010
+ const activeProfile = profileLoggedIn ? profiles.find((profile) => profile.id === activeProfileId) : null;
34011
+ const jobId = currentTryOnJobIdRef.current ?? void 0;
34012
+ const historyEntryId = currentHistoryEntryIdRef.current ?? void 0;
34013
+ const feedbackKey = buildTryOnFeedbackKey({
34014
+ jobId,
34015
+ historyEntryId,
34016
+ resultImageUrl,
34017
+ productId: effectiveProductId,
34018
+ productTitle: restoredProductTitle || productTitle,
34019
+ recommendedSize: sizingResult?.recommendedSize
34020
+ });
34021
+ if (submittedFeedbackKeysRef.current.has(feedbackKey)) return;
34022
+ submittedFeedbackKeysRef.current.add(feedbackKey);
34023
+ lsSet(TRYON_FEEDBACK_SUBMITTED_KEY, Array.from(submittedFeedbackKeysRef.current).slice(-80));
34024
+ const payload = {
34025
+ jobId,
34026
+ historyEntryId,
34027
+ rating,
34028
+ note: note?.trim() || void 0,
34029
+ productId: effectiveProductId,
34030
+ productTitle: restoredProductTitle || productTitle,
34031
+ productUrl: restoredProductUrl || effectiveProductUrl,
34032
+ recommendedSize: sizingResult?.recommendedSize,
34033
+ profileLoggedIn,
34034
+ profileId: activeProfile?.id,
34035
+ profileName: activeProfile?.name,
34036
+ profileAccessToken: profileSession?.accessToken
34037
+ };
34038
+ if (shouldUseShopifyCartAttribution(apiUrl)) {
34039
+ logTryOnFeedback(payload);
34040
+ return;
34041
+ }
34042
+ try {
34043
+ await apiRef.current?.submitTryOnFeedback(payload);
34044
+ } catch (error) {
34045
+ submittedFeedbackKeysRef.current.delete(feedbackKey);
34046
+ lsSet(TRYON_FEEDBACK_SUBMITTED_KEY, Array.from(submittedFeedbackKeysRef.current).slice(-80));
34047
+ throw error;
34048
+ }
34049
+ }, [activeProfileId, apiUrl, effectiveProductId, effectiveProductUrl, productTitle, profileSession, profiles, restoredProductTitle, restoredProductUrl, resultImageUrl, sizingResult?.recommendedSize]);
33542
34050
  const handleRetry = reactExports.useCallback(() => {
33543
34051
  completedRef.current = false;
33544
34052
  cleanupJob();
@@ -33549,6 +34057,12 @@ function PrimeStyleTryonInner({
33549
34057
  historySavedRef.current = false;
33550
34058
  historyTryonSavedRef.current = false;
33551
34059
  currentHistoryEntryIdRef.current = null;
34060
+ currentTryOnJobIdRef.current = null;
34061
+ setRestoredProductImage(null);
34062
+ setRestoredProductImages(null);
34063
+ setRestoredProductCarouselItems(null);
34064
+ setRestoredProductTitle(null);
34065
+ setRestoredProductUrl(null);
33552
34066
  setErrorMessage(null);
33553
34067
  setSizingMethod(null);
33554
34068
  setSizingResult(null);
@@ -33685,6 +34199,8 @@ function PrimeStyleTryonInner({
33685
34199
  id: id2,
33686
34200
  productId,
33687
34201
  productTitle,
34202
+ productUrl: effectiveProductUrl,
34203
+ jobId: currentTryOnJobIdRef.current ?? void 0,
33688
34204
  productImage,
33689
34205
  productImages: effectiveProductImages?.slice(0, 12),
33690
34206
  productCarouselItems: effectiveProductCarouselItems?.slice(0, 12),
@@ -33719,7 +34235,7 @@ function PrimeStyleTryonInner({
33719
34235
  return next;
33720
34236
  });
33721
34237
  return id2;
33722
- }, [productId, productTitle, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile]);
34238
+ }, [productId, productTitle, effectiveProductUrl, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile]);
33723
34239
  const persistHistoryResult = reactExports.useCallback((entryId, imageUrl, cleanupWhenIdle) => {
33724
34240
  void (async () => {
33725
34241
  const durableResultUrl = durableHistoryImageUrl(imageUrl);
@@ -33737,6 +34253,7 @@ function PrimeStyleTryonInner({
33737
34253
  if (entry.id !== entryId) return entry;
33738
34254
  return {
33739
34255
  ...entry,
34256
+ ...currentTryOnJobIdRef.current ? { jobId: currentTryOnJobIdRef.current } : {},
33740
34257
  ...durableResultUrl ? { resultImageUrl: durableResultUrl } : {},
33741
34258
  ...storedResult ? { hasResult: true } : {}
33742
34259
  };
@@ -33792,6 +34309,7 @@ function PrimeStyleTryonInner({
33792
34309
  if (idx < 0) return prev;
33793
34310
  const updated = {
33794
34311
  ...prev[idx],
34312
+ ...currentTryOnJobIdRef.current ? { jobId: currentTryOnJobIdRef.current } : {},
33795
34313
  ...durableResultUrl ? { resultImageUrl: durableResultUrl } : {},
33796
34314
  hasResult: true,
33797
34315
  ...selectedSizes.length ? { selectedSizes } : {}
@@ -33809,6 +34327,7 @@ function PrimeStyleTryonInner({
33809
34327
  historySavedRef.current = false;
33810
34328
  historyTryonSavedRef.current = false;
33811
34329
  currentHistoryEntryIdRef.current = null;
34330
+ currentTryOnJobIdRef.current = null;
33812
34331
  }
33813
34332
  }, [view, sizingResult, resultImageUrl]);
33814
34333
  const restoreHistory = reactExports.useCallback((entry) => {
@@ -33819,6 +34338,7 @@ function PrimeStyleTryonInner({
33819
34338
  historySavedRef.current = true;
33820
34339
  historyTryonSavedRef.current = !!entry.resultImageUrl || !!entry.hasResult;
33821
34340
  currentHistoryEntryIdRef.current = entry.id;
34341
+ currentTryOnJobIdRef.current = entry.jobId || null;
33822
34342
  autoTryOnFiredRef.current = true;
33823
34343
  const isCurrentProductEntry = entry.productId && productId ? entry.productId === productId : !!entry.productTitle && entry.productTitle === productTitle;
33824
34344
  setRestoredProductImage(entry.productImage || null);
@@ -33829,6 +34349,7 @@ function PrimeStyleTryonInner({
33829
34349
  entry.productCarouselItems?.length ? entry.productCarouselItems : isCurrentProductEntry && effectiveProductCarouselItems?.length ? effectiveProductCarouselItems : null
33830
34350
  );
33831
34351
  setRestoredProductTitle(entry.productTitle || null);
34352
+ setRestoredProductUrl(entry.productUrl || null);
33832
34353
  if (entry.sizingResult) {
33833
34354
  setSizingResult(entry.sizingResult);
33834
34355
  } else if (entry.recommendedSize) {
@@ -34066,11 +34587,14 @@ function PrimeStyleTryonInner({
34066
34587
  productImages: restoredProductImages || (restoredProductImage ? [restoredProductImage] : effectiveProductImages),
34067
34588
  productCarouselItems: restoredProductCarouselItems || (restoredProductImage ? void 0 : effectiveProductCarouselItems),
34068
34589
  productTitle: restoredProductTitle || productTitle,
34590
+ productUrl: restoredProductUrl || effectiveProductUrl,
34069
34591
  productMaterial,
34070
34592
  productDescription,
34071
34593
  sizingUnit,
34072
34594
  setView,
34073
34595
  handleDownload,
34596
+ onContinueShopping: handleContinueShopping,
34597
+ onTryOnFeedbackSubmit: handleTryOnFeedbackSubmit,
34074
34598
  selectedFile,
34075
34599
  previewUrl,
34076
34600
  handleFileSelect,
@@ -35012,6 +35536,15 @@ function parseJsonAttr(raw, fallback) {
35012
35536
  return fallback;
35013
35537
  }
35014
35538
  }
35539
+ function resolveProductUrl(raw) {
35540
+ const source = raw || (typeof window !== "undefined" ? window.location.href : "");
35541
+ if (!source) return void 0;
35542
+ try {
35543
+ return new URL(source, window.location.origin).href;
35544
+ } catch {
35545
+ return source;
35546
+ }
35547
+ }
35015
35548
  function buildPropsFromDataAttrs(data) {
35016
35549
  const props = {
35017
35550
  apiUrl: data.proxyUrl || data.apiUrl || "",
@@ -35021,6 +35554,7 @@ function buildPropsFromDataAttrs(data) {
35021
35554
  apiKey: data.apiKey,
35022
35555
  productId: data.productId,
35023
35556
  productTitle: data.productTitle,
35557
+ productUrl: resolveProductUrl(data.productUrl),
35024
35558
  productImage: data.productImage,
35025
35559
  productCarouselItems: parseJsonAttr(data.productCarouselItems, void 0),
35026
35560
  productDescription: data.productDescription,