@thefittingroom/shop-ui 5.0.30 → 5.0.32

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.
Files changed (2) hide show
  1. package/dist/index.js +619 -25
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14170,6 +14170,7 @@ async function addFittingRoomItem(productId, handle, isPdp) {
14170
14170
  colorwaySizeAssetId: null,
14171
14171
  addedAt: Date.now()
14172
14172
  });
14173
+ state.setLastAddEvent(productId);
14173
14174
  }
14174
14175
  async function syncCurrentProductSelection() {
14175
14176
  const {
@@ -19358,7 +19359,10 @@ const loading$1 = "Loading...";
19358
19359
  const add_to_fitting_room$1 = "Add to Fitting Room";
19359
19360
  const added_to_fitting_room$1 = "In Fitting Room";
19360
19361
  const view_fitting_room$1 = "Fitting Room";
19361
- const fitting_room$1 = { "title": "Fitting Room", "empty": "Your fitting room is empty.", "size_not_chosen": "Size not chosen — pick one before trying on.", "remove": "Remove", "ungrouped": "Other", "try_it_on": "Try it on", "view_product_details": "View product details", "hide_product_details": "Hide product details", "add_to_cart": "Add to cart", "recommended_sizes": "Recommended sizes", "shop_now": "Shop now", "sign_out": "Sign out", "clear_all": "Clear All", "try_it_tucked_in": "Try it tucked in", "try_it_untucked": "Try it untucked", "avatar_placeholder_empty": "Add clothes to try on by selecting items in the rails.", "avatar_placeholder_selected": "Avatar render will appear here once VTO is wired up.", "see_selected_items": "See Selected Items", "no_selection": "Nothing selected yet.", "tuck_in": "Tuck In", "untuck": "Untuck", "zoom_in": "Zoom In", "zoom_out": "Zoom Out", "vto_error": "Couldn't load the try-on. Please try again." };
19362
+ const first_visit_tooltip$1 = { "body": "See items added to your fitting room here", "dismiss": "Dismiss" };
19363
+ const first_add_tooltip$1 = { "body": "Add item to your fitting room here", "dismiss": "Dismiss" };
19364
+ const add_confirmation$1 = { "title": "Your Fitting Room", "added_header": "Added to your fitting room", "cta": "Go to your fitting room", "remove": "Remove from fitting room", "dismiss": "Dismiss" };
19365
+ const fitting_room$1 = { "title": "Fitting Room", "empty": "Your fitting room is empty.", "size_not_chosen": "Size not chosen — pick one before trying on.", "remove": "Remove", "ungrouped": "Other", "try_it_on": "Try it on", "view_product_details": "View product details", "hide_product_details": "Hide product details", "add_to_cart": "Add to cart", "recommended_sizes": "Recommended sizes", "shop_now": "Shop now", "sign_out": "Sign out", "clear_all": "Clear All", "try_it_tucked_in": "Try it tucked in", "try_it_untucked": "Try it untucked", "avatar_placeholder_empty": "Add clothes to try on by selecting items in the rails.", "avatar_placeholder_selected": "Avatar render will appear here once VTO is wired up.", "see_selected_items": "See Selected Items", "no_selection": "Nothing selected yet.", "toggle_selection": "Toggle try-on selection", "tuck_in": "Tuck In", "untuck": "Untuck", "zoom_in": "Zoom In", "zoom_out": "Zoom Out", "vto_error": "Couldn't load the try-on. Please try again." };
19362
19366
  const landing$1 = { "header": "Meet your mini me!", "description": "Loose on your waist but tight on your hips? We’ll show you.", "get_the_app": "Get the app", "already_have_account": "Already have an account?", "sign_in": "Sign in." };
19363
19367
  const en$1 = {
19364
19368
  try_it_on: try_it_on$1,
@@ -19367,6 +19371,9 @@ const en$1 = {
19367
19371
  add_to_fitting_room: add_to_fitting_room$1,
19368
19372
  added_to_fitting_room: added_to_fitting_room$1,
19369
19373
  view_fitting_room: view_fitting_room$1,
19374
+ first_visit_tooltip: first_visit_tooltip$1,
19375
+ first_add_tooltip: first_add_tooltip$1,
19376
+ add_confirmation: add_confirmation$1,
19370
19377
  fitting_room: fitting_room$1,
19371
19378
  landing: landing$1,
19372
19379
  "get-app": { "create_avatar": "Create your avatar" },
@@ -19382,7 +19389,10 @@ const loading = "Chargement...";
19382
19389
  const add_to_fitting_room = "Ajouter à la cabine d'essayage";
19383
19390
  const added_to_fitting_room = "Dans la cabine d'essayage";
19384
19391
  const view_fitting_room = "Cabine d'essayage";
19385
- const fitting_room = { "title": "Cabine d'essayage", "empty": "Votre cabine d'essayage est vide.", "size_not_chosen": "Taille non choisie — choisissez-en une avant l'essayage.", "remove": "Supprimer", "ungrouped": "Autres", "try_it_on": "Essayer", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit", "add_to_cart": "Ajouter au panier", "recommended_sizes": "Tailles recommandées", "shop_now": "Acheter", "sign_out": "Se déconnecter", "try_it_tucked_in": "Essayez-le rentré", "try_it_untucked": "Essayez-le non rentré", "avatar_placeholder_empty": "Ajoutez des vêtements à essayer en sélectionnant des articles.", "avatar_placeholder_selected": "L'avatar apparaîtra ici lorsque la VTO sera connectée.", "see_selected_items": "Voir la sélection", "no_selection": "Rien de sélectionné.", "tuck_in": "Rentrer", "untuck": "Sortir", "zoom_in": "Zoom +", "zoom_out": "Zoom −", "vto_error": "Impossible de charger l'essayage. Veuillez réessayer." };
19392
+ const first_visit_tooltip = { "body": "Voir les articles ajoutés à votre cabine d'essayage ici", "dismiss": "Fermer" };
19393
+ const first_add_tooltip = { "body": "Ajoutez un article à votre cabine d'essayage ici", "dismiss": "Fermer" };
19394
+ const add_confirmation = { "title": "Votre cabine d'essayage", "added_header": "Ajouté à votre cabine d'essayage", "cta": "Aller à votre cabine d'essayage", "remove": "Retirer de la cabine d'essayage", "dismiss": "Fermer" };
19395
+ const fitting_room = { "title": "Cabine d'essayage", "empty": "Votre cabine d'essayage est vide.", "size_not_chosen": "Taille non choisie — choisissez-en une avant l'essayage.", "remove": "Supprimer", "ungrouped": "Autres", "try_it_on": "Essayer", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit", "add_to_cart": "Ajouter au panier", "recommended_sizes": "Tailles recommandées", "shop_now": "Acheter", "sign_out": "Se déconnecter", "try_it_tucked_in": "Essayez-le rentré", "try_it_untucked": "Essayez-le non rentré", "avatar_placeholder_empty": "Ajoutez des vêtements à essayer en sélectionnant des articles.", "avatar_placeholder_selected": "L'avatar apparaîtra ici lorsque la VTO sera connectée.", "see_selected_items": "Voir la sélection", "no_selection": "Rien de sélectionné.", "toggle_selection": "Activer/désactiver la sélection", "tuck_in": "Rentrer", "untuck": "Sortir", "zoom_in": "Zoom +", "zoom_out": "Zoom −", "vto_error": "Impossible de charger l'essayage. Veuillez réessayer." };
19386
19396
  const landing = { "header": "Rencontrez votre mini-moi !", "description": "Lâche à la taille mais serré aux hanches ? Nous allons vous montrer.", "get_the_app": "Obtenez l'application", "already_have_account": "Vous avez déjà un compte ?", "sign_in": "Connectez-vous." };
19387
19397
  const fr = {
19388
19398
  try_it_on,
@@ -19391,6 +19401,9 @@ const fr = {
19391
19401
  add_to_fitting_room,
19392
19402
  added_to_fitting_room,
19393
19403
  view_fitting_room,
19404
+ first_visit_tooltip,
19405
+ first_add_tooltip,
19406
+ add_confirmation,
19394
19407
  fitting_room,
19395
19408
  landing,
19396
19409
  "get-app": { "create_avatar": "Créez votre avatar" },
@@ -19594,6 +19607,7 @@ const SvgLoadingCircle = (props) => /* @__PURE__ */ reactExports.createElement("
19594
19607
  const SvgIconSelectedItems = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 25, height: 25, viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M1.00024 18.125L12.4169 23.8333L23.8336 18.125M1.00024 12.4167L12.4169 18.125L23.8336 12.4167M12.4169 1L1.00024 6.70833L12.4169 12.4167L23.8336 6.70833L12.4169 1Z", stroke: "#1E1E1E", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }));
19595
19608
  const SvgTfrIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 12, height: 24, viewBox: "0 0 12 24", fill: "#21201F", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M11.9082 4.0752V19.8516L0.161133 22.8545V1.05859L11.9082 4.0752ZM9.31836 10.8525C8.96951 10.8525 8.68661 11.206 8.68652 11.6416C8.68652 12.0773 8.96946 12.4307 9.31836 12.4307C9.6671 12.4304 9.9502 12.0771 9.9502 11.6416C9.95011 11.2062 9.66705 10.8528 9.31836 10.8525Z" }));
19596
19609
  const SvgTfrName = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 1584, height: 245, viewBox: "0 0 1584 245", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M131.362 34.4131V210.725L0 244.291V0.708984L131.362 34.4131ZM110.354 110.164C106.453 110.164 103.29 114.111 103.29 118.979C103.29 123.848 106.453 127.795 110.354 127.795C114.256 127.795 117.419 123.848 117.419 118.979C117.419 114.111 114.256 110.164 110.354 110.164Z", fill: "#265A64" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M175.848 76.9219V60.8636H271.533V76.9219H232.957V184.5H214.363V76.9219H175.848ZM309.279 129.443V184.5H291.229V60.8636H309.038V106.865H310.185C312.358 101.875 315.678 97.9103 320.146 94.9723C324.613 92.0343 330.449 90.5653 337.653 90.5653C344.012 90.5653 349.566 91.8733 354.315 94.4893C359.104 97.1053 362.807 101.009 365.423 106.201C368.079 111.353 369.407 117.792 369.407 125.519V184.5H351.356V127.692C351.356 120.891 349.606 115.619 346.104 111.876C342.603 108.093 337.733 106.201 331.495 106.201C327.229 106.201 323.406 107.107 320.025 108.918C316.684 110.729 314.048 113.385 312.116 116.886C310.225 120.348 309.279 124.533 309.279 129.443ZM433.459 186.371C424.323 186.371 416.455 184.42 409.854 180.516C403.294 176.571 398.223 171.038 394.641 163.914C391.1 156.75 389.329 148.359 389.329 138.74C389.329 129.242 391.1 120.871 394.641 113.626C398.223 106.382 403.214 100.728 409.613 96.6626C416.052 92.5978 423.578 90.5653 432.191 90.5653C437.423 90.5653 442.494 91.4306 447.404 93.1612C452.314 94.8918 456.721 97.6084 460.625 101.311C464.529 105.014 467.608 109.823 469.861 115.739C472.115 121.615 473.242 128.759 473.242 137.17V143.57H399.531V130.047H455.554C455.554 125.298 454.588 121.092 452.656 117.43C450.724 113.727 448.008 110.809 444.506 108.676C441.045 106.543 436.98 105.477 432.312 105.477C427.241 105.477 422.814 106.724 419.031 109.219C415.288 111.674 412.39 114.894 410.337 118.879C408.325 122.823 407.319 127.109 407.319 131.737V142.302C407.319 148.5 408.406 153.772 410.579 158.119C412.792 162.465 415.871 165.786 419.815 168.08C423.759 170.333 428.368 171.46 433.64 171.46C437.061 171.46 440.18 170.977 442.997 170.011C445.814 169.005 448.249 167.516 450.302 165.544C452.354 163.572 453.924 161.137 455.011 158.239L472.095 161.318C470.727 166.349 468.272 170.756 464.73 174.539C461.229 178.282 456.822 181.2 451.509 183.293C446.237 185.345 440.22 186.371 433.459 186.371ZM539.709 184.5V60.8636H616.378V76.9219H558.363V114.592H610.884V130.59H558.363V184.5H539.709ZM637.869 184.5V91.7727H655.92V184.5H637.869ZM646.985 77.4652C643.846 77.4652 641.149 76.4188 638.896 74.326C636.682 72.1929 635.575 69.6574 635.575 66.7195C635.575 63.7412 636.682 61.2057 638.896 59.1129C641.149 56.9799 643.846 55.9133 646.985 55.9133C650.124 55.9133 652.801 56.9799 655.014 59.1129C657.268 61.2057 658.395 63.7412 658.395 66.7195C658.395 69.6574 657.268 72.1929 655.014 74.326C652.801 76.4188 650.124 77.4652 646.985 77.4652ZM723.488 91.7727V106.261H672.838V91.7727H723.488ZM686.421 69.5568H704.472V157.273C704.472 160.775 704.995 163.411 706.041 165.182C707.088 166.912 708.436 168.1 710.086 168.744C711.776 169.347 713.608 169.649 715.58 169.649C717.029 169.649 718.296 169.549 719.383 169.347C720.47 169.146 721.315 168.985 721.918 168.864L725.178 183.776C724.132 184.178 722.643 184.58 720.711 184.983C718.779 185.426 716.364 185.667 713.467 185.707C708.718 185.788 704.291 184.943 700.186 183.172C696.08 181.401 692.76 178.664 690.225 174.962C687.689 171.259 686.421 166.611 686.421 161.016V69.5568ZM786.74 91.7727V106.261H736.09V91.7727H786.74ZM749.673 69.5568H767.724V157.273C767.724 160.775 768.247 163.411 769.293 165.182C770.34 166.912 771.688 168.1 773.338 168.744C775.028 169.347 776.86 169.649 778.832 169.649C780.281 169.649 781.548 169.549 782.635 169.347C783.722 169.146 784.567 168.985 785.17 168.864L788.43 183.776C787.384 184.178 785.895 184.58 783.963 184.983C782.031 185.426 779.616 185.667 776.719 185.707C771.97 185.788 767.543 184.943 763.437 183.172C759.332 181.401 756.012 178.664 753.477 174.962C750.941 171.259 749.673 166.611 749.673 161.016V69.5568ZM806.707 184.5V91.7727H824.758V184.5H806.707ZM815.823 77.4652C812.684 77.4652 809.987 76.4188 807.733 74.326C805.52 72.1929 804.413 69.6574 804.413 66.7195C804.413 63.7412 805.52 61.2057 807.733 59.1129C809.987 56.9799 812.684 55.9133 815.823 55.9133C818.962 55.9133 821.639 56.9799 823.852 59.1129C826.106 61.2057 827.233 63.7412 827.233 66.7195C827.233 69.6574 826.106 72.1929 823.852 74.326C821.639 76.4188 818.962 77.4652 815.823 77.4652ZM867.092 129.443V184.5H849.041V91.7727H866.367V106.865H867.514C869.647 101.955 872.988 98.0109 877.535 95.0327C882.124 92.0544 887.899 90.5653 894.861 90.5653C901.18 90.5653 906.714 91.8935 911.463 94.5497C916.212 97.1657 919.895 101.07 922.511 106.261C925.127 111.453 926.435 117.872 926.435 125.519V184.5H908.384V127.692C908.384 120.971 906.633 115.719 903.132 111.936C899.631 108.113 894.821 106.201 888.704 106.201C884.518 106.201 880.795 107.107 877.535 108.918C874.316 110.729 871.76 113.385 869.869 116.886C868.017 120.348 867.092 124.533 867.092 129.443ZM989.521 221.205C982.156 221.205 975.817 220.239 970.504 218.307C965.232 216.375 960.926 213.819 957.585 210.64C954.245 207.46 951.749 203.979 950.099 200.196L965.614 193.797C966.701 195.568 968.15 197.439 969.961 199.411C971.812 201.424 974.307 203.134 977.447 204.543C980.626 205.951 984.711 206.656 989.702 206.656C996.544 206.656 1002.2 204.985 1006.67 201.645C1011.13 198.345 1013.37 193.072 1013.37 185.828V167.597H1012.22C1011.13 169.569 1009.56 171.762 1007.51 174.177C1005.5 176.592 1002.72 178.684 999.18 180.455C995.638 182.226 991.03 183.112 985.355 183.112C978.03 183.112 971.43 181.401 965.554 177.98C959.718 174.519 955.09 169.428 951.669 162.707C948.288 155.945 946.598 147.634 946.598 137.774C946.598 127.914 948.268 119.462 951.609 112.419C954.989 105.376 959.618 99.983 965.494 96.2401C971.37 92.4569 978.03 90.5653 985.476 90.5653C991.231 90.5653 995.879 91.5312 999.421 93.4631C1002.96 95.3546 1005.72 97.5682 1007.69 100.104C1009.7 102.639 1011.25 104.873 1012.34 106.805H1013.67V91.7727H1031.36V186.553C1031.36 194.521 1029.51 201.061 1025.8 206.173C1022.1 211.284 1017.09 215.067 1010.77 217.522C1004.49 219.977 997.409 221.205 989.521 221.205ZM989.339 168.14C994.531 168.14 998.918 166.933 1002.5 164.518C1006.12 162.063 1008.86 158.561 1010.71 154.013C1012.6 149.425 1013.55 143.932 1013.55 137.533C1013.55 131.295 1012.62 125.801 1010.77 121.052C1008.92 116.303 1006.2 112.6 1002.62 109.944C999.039 107.247 994.612 105.899 989.339 105.899C983.906 105.899 979.379 107.308 975.756 110.125C972.134 112.902 969.397 116.685 967.546 121.474C965.735 126.264 964.83 131.616 964.83 137.533C964.83 143.61 965.755 148.942 967.606 153.531C969.458 158.119 972.195 161.701 975.817 164.276C979.479 166.852 983.987 168.14 989.339 168.14ZM1102 184.5V60.8636H1146.07C1155.65 60.8636 1163.6 62.5137 1169.92 65.8139C1176.28 69.1141 1181.03 73.6821 1184.17 79.5178C1187.31 85.3132 1188.88 92.0142 1188.88 99.6207C1188.88 107.187 1187.29 113.848 1184.11 119.603C1180.97 125.318 1176.22 129.765 1169.86 132.945C1163.54 136.124 1155.59 137.714 1146.01 137.714H1112.63V121.656H1144.32C1150.36 121.656 1155.27 120.79 1159.05 119.06C1162.88 117.329 1165.67 114.814 1167.44 111.513C1169.21 108.213 1170.1 104.249 1170.1 99.6207C1170.1 94.9522 1169.19 90.9074 1167.38 87.4865C1165.61 84.0656 1162.82 81.4496 1158.99 79.6385C1155.21 77.7872 1150.24 76.8615 1144.08 76.8615H1120.66V184.5H1102ZM1163.04 128.719L1193.58 184.5H1172.33L1142.39 128.719H1163.04ZM1248.02 186.371C1239.33 186.371 1231.74 184.379 1225.26 180.395C1218.78 176.411 1213.75 170.836 1210.17 163.673C1206.59 156.509 1204.8 148.138 1204.8 138.559C1204.8 128.94 1206.59 120.529 1210.17 113.325C1213.75 106.12 1218.78 100.526 1225.26 96.5419C1231.74 92.5575 1239.33 90.5653 1248.02 90.5653C1256.72 90.5653 1264.3 92.5575 1270.78 96.5419C1277.26 100.526 1282.29 106.12 1285.87 113.325C1289.46 120.529 1291.25 128.94 1291.25 138.559C1291.25 148.138 1289.46 156.509 1285.87 163.673C1282.29 170.836 1277.26 176.411 1270.78 180.395C1264.3 184.379 1256.72 186.371 1248.02 186.371ZM1248.08 171.219C1253.72 171.219 1258.39 169.73 1262.09 166.751C1265.79 163.773 1268.53 159.809 1270.3 154.859C1272.11 149.908 1273.01 144.455 1273.01 138.499C1273.01 132.582 1272.11 127.149 1270.3 122.199C1268.53 117.208 1265.79 113.204 1262.09 110.185C1258.39 107.167 1253.72 105.658 1248.08 105.658C1242.41 105.658 1237.7 107.167 1233.96 110.185C1230.25 113.204 1227.5 117.208 1225.69 122.199C1223.91 127.149 1223.03 132.582 1223.03 138.499C1223.03 144.455 1223.91 149.908 1225.69 154.859C1227.5 159.809 1230.25 163.773 1233.96 166.751C1237.7 169.73 1242.41 171.219 1248.08 171.219ZM1350.45 186.371C1341.76 186.371 1334.17 184.379 1327.69 180.395C1321.21 176.411 1316.18 170.836 1312.6 163.673C1309.02 156.509 1307.23 148.138 1307.23 138.559C1307.23 128.94 1309.02 120.529 1312.6 113.325C1316.18 106.12 1321.21 100.526 1327.69 96.5419C1334.17 92.5575 1341.76 90.5653 1350.45 90.5653C1359.15 90.5653 1366.73 92.5575 1373.21 96.5419C1379.69 100.526 1384.72 106.12 1388.31 113.325C1391.89 120.529 1393.68 128.94 1393.68 138.559C1393.68 148.138 1391.89 156.509 1388.31 163.673C1384.72 170.836 1379.69 176.411 1373.21 180.395C1366.73 184.379 1359.15 186.371 1350.45 186.371ZM1350.51 171.219C1356.15 171.219 1360.82 169.73 1364.52 166.751C1368.22 163.773 1370.96 159.809 1372.73 154.859C1374.54 149.908 1375.45 144.455 1375.45 138.499C1375.45 132.582 1374.54 127.149 1372.73 122.199C1370.96 117.208 1368.22 113.204 1364.52 110.185C1360.82 107.167 1356.15 105.658 1350.51 105.658C1344.84 105.658 1340.13 107.167 1336.39 110.185C1332.68 113.204 1329.93 117.208 1328.12 122.199C1326.35 127.149 1325.46 132.582 1325.46 138.499C1325.46 144.455 1326.35 149.908 1328.12 154.859C1329.93 159.809 1332.68 163.773 1336.39 166.751C1340.13 169.73 1344.84 171.219 1350.51 171.219ZM1413.83 184.5V91.7727H1431.15V106.865H1432.3C1434.23 101.754 1437.39 97.7694 1441.78 94.9119C1446.16 92.0142 1451.42 90.5653 1457.53 90.5653C1463.73 90.5653 1468.92 92.0142 1473.11 94.9119C1477.33 97.8097 1480.45 101.794 1482.47 106.865H1483.43C1485.65 101.915 1489.17 97.9706 1494 95.0327C1498.83 92.0544 1504.58 90.5653 1511.26 90.5653C1519.67 90.5653 1526.54 93.2015 1531.85 98.4737C1537.2 103.746 1539.88 111.695 1539.88 122.32V184.5H1521.83V124.01C1521.83 117.732 1520.12 113.184 1516.7 110.366C1513.27 107.549 1509.19 106.141 1504.44 106.141C1498.56 106.141 1494 107.952 1490.74 111.574C1487.48 115.156 1485.85 119.764 1485.85 125.398V184.5H1467.86V122.863C1467.86 117.832 1466.29 113.787 1463.15 110.729C1460.01 107.67 1455.92 106.141 1450.89 106.141C1447.47 106.141 1444.31 107.046 1441.42 108.857C1438.56 110.628 1436.24 113.103 1434.47 116.283C1432.74 119.462 1431.88 123.145 1431.88 127.33V184.5H1413.83Z", fill: "#265A64" }));
19610
+ const SvgTrashIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M2.5 4H13.5", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M6 4V2.5C6 2.22386 6.22386 2 6.5 2H9.5C9.77614 2 10 2.22386 10 2.5V4", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M3.5 4V13C3.5 13.5523 3.94772 14 4.5 14H11.5C12.0523 14 12.5 13.5523 12.5 13V4", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M6.5 7V11", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M9.5 7V11", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }));
19597
19611
  const SvgIconTuck = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 18, height: 23, viewBox: "0 0 18 23", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M4.5 12.65V4.39875L1.60313 7.36L0 5.75L5.625 0L11.25 5.75L9.64687 7.36L6.75 4.39875V12.65H4.5ZM12.375 23L6.75 17.25L8.35313 15.64L11.25 18.6013V10.35H13.5V18.6013L16.3969 15.64L18 17.25L12.375 23Z", fill: "#21201F" }));
19598
19612
  const SvgIconZoom = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M19 19L14.65 14.65M9 6V12M6 9H12M17 9C17 13.4183 13.4183 17 9 17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1C13.4183 1 17 4.58172 17 9Z", stroke: "#1E1E1E", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }));
19599
19613
  let baseUrl$1;
@@ -41745,6 +41759,10 @@ async function loadFittingRoomData() {
41745
41759
  for (const item of items) {
41746
41760
  loadProductDataToStore(item.externalId);
41747
41761
  }
41762
+ await loadMerchantProductData(items);
41763
+ }
41764
+ async function loadMerchantProductData(items) {
41765
+ const state = useMainStore.getState();
41748
41766
  const {
41749
41767
  productLookup
41750
41768
  } = getStaticData();
@@ -42073,14 +42091,38 @@ function pairCompatible(a, b, group) {
42073
42091
  }
42074
42092
  return aIncl.includes(bName) || bIncl.includes(aName);
42075
42093
  }
42094
+ function getSameCategoryConflicts(item, selectedExternalIds, resolved) {
42095
+ if (!item.styleCategory) {
42096
+ return [];
42097
+ }
42098
+ const itemName = catName(item.styleCategory);
42099
+ const out = [];
42100
+ for (const sel of resolved.items) {
42101
+ if (sel.externalId === item.externalId) {
42102
+ continue;
42103
+ }
42104
+ if (!selectedExternalIds.has(sel.externalId)) {
42105
+ continue;
42106
+ }
42107
+ if (!sel.styleCategory) {
42108
+ continue;
42109
+ }
42110
+ if (catName(sel.styleCategory) === itemName) {
42111
+ out.push(sel.externalId);
42112
+ }
42113
+ }
42114
+ return out;
42115
+ }
42076
42116
  function computeAvailability(item, selectedExternalIds, resolved) {
42077
42117
  if (selectedExternalIds.has(item.externalId)) {
42078
42118
  return "selected";
42079
42119
  }
42080
- if (selectedExternalIds.size >= MAX_OUTFIT_ITEMS) {
42120
+ if (!item.styleCategory) {
42081
42121
  return "disabled";
42082
42122
  }
42083
- if (!item.styleCategory) {
42123
+ const sameCategoryEvictions = new Set(getSameCategoryConflicts(item, selectedExternalIds, resolved));
42124
+ const effectiveSize = selectedExternalIds.size - sameCategoryEvictions.size + 1;
42125
+ if (effectiveSize > MAX_OUTFIT_ITEMS) {
42084
42126
  return "disabled";
42085
42127
  }
42086
42128
  const itemCat = item.styleCategory;
@@ -42088,6 +42130,9 @@ function computeAvailability(item, selectedExternalIds, resolved) {
42088
42130
  if (!selectedExternalIds.has(sel.externalId)) {
42089
42131
  continue;
42090
42132
  }
42133
+ if (sameCategoryEvictions.has(sel.externalId)) {
42134
+ continue;
42135
+ }
42091
42136
  if (!sel.styleCategory) {
42092
42137
  continue;
42093
42138
  }
@@ -42305,7 +42350,14 @@ function AvatarControls({
42305
42350
  border: "none",
42306
42351
  backgroundColor: "transparent",
42307
42352
  cursor: "pointer",
42308
- fontSize: "14px"
42353
+ display: "flex",
42354
+ alignItems: "center",
42355
+ justifyContent: "center",
42356
+ padding: 0
42357
+ },
42358
+ popoverRemoveIcon: {
42359
+ width: "14px",
42360
+ height: "14px"
42309
42361
  }
42310
42362
  }));
42311
42363
  const seeExpanded = expanded || popoverOpen;
@@ -42327,7 +42379,7 @@ function AvatarControls({
42327
42379
  popoverOpen ? /* @__PURE__ */ jsx$1("div", { css: css2.popover, children: selectedItems.length === 0 ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.popoverLabel, children: t("fitting_room.no_selection") }) : selectedItems.map((item) => /* @__PURE__ */ jsxs("div", { css: css2.popoverRow, children: [
42328
42380
  item.merchantProduct?.imageUrl ? /* @__PURE__ */ jsx$1("img", { src: item.merchantProduct.imageUrl, css: css2.popoverThumb, alt: "" }) : /* @__PURE__ */ jsx$1("div", { css: css2.popoverThumb }),
42329
42381
  /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.popoverLabel, children: item.merchantProduct?.productName ?? item.externalId }),
42330
- /* @__PURE__ */ jsx$1("button", { css: css2.popoverRemove, onClick: () => onRemoveItem(item.externalId), "aria-label": "Remove", children: "×" })
42382
+ /* @__PURE__ */ jsx$1("button", { css: css2.popoverRemove, onClick: () => onRemoveItem(item.externalId), "aria-label": "Remove", children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.popoverRemoveIcon }) })
42331
42383
  ] }, item.externalId)) }) : null
42332
42384
  ] });
42333
42385
  return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, children: [
@@ -42680,6 +42732,71 @@ function Chevron({
42680
42732
  transform: `rotate(${ROTATION_DEG[direction]}deg)`
42681
42733
  }, children: /* @__PURE__ */ jsx$1("path", { d: "M6 9L12 15L18 9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
42682
42734
  }
42735
+ function CardCheckbox({
42736
+ state,
42737
+ onClick,
42738
+ ariaLabel
42739
+ }) {
42740
+ const css2 = useCss((theme) => ({
42741
+ base: {
42742
+ position: "absolute",
42743
+ top: "8px",
42744
+ left: "8px",
42745
+ width: "36px",
42746
+ height: "20px",
42747
+ borderRadius: "10px",
42748
+ border: "none",
42749
+ padding: 0,
42750
+ zIndex: 1,
42751
+ transition: "background-color 150ms ease-out"
42752
+ },
42753
+ unselected: {
42754
+ backgroundColor: "#D4D4D4",
42755
+ cursor: "pointer"
42756
+ },
42757
+ selected: {
42758
+ backgroundColor: theme.color_tfr_800,
42759
+ cursor: "pointer"
42760
+ },
42761
+ disabled: {
42762
+ backgroundColor: "#EAEAEA",
42763
+ cursor: "not-allowed",
42764
+ pointerEvents: "none"
42765
+ },
42766
+ thumb: {
42767
+ position: "absolute",
42768
+ top: "2px",
42769
+ width: "16px",
42770
+ height: "16px",
42771
+ borderRadius: "8px",
42772
+ backgroundColor: "#FFFFFF",
42773
+ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)",
42774
+ transition: "left 150ms ease-out"
42775
+ },
42776
+ thumbOff: {
42777
+ left: "2px"
42778
+ },
42779
+ thumbOn: {
42780
+ left: "18px"
42781
+ }
42782
+ }));
42783
+ const trackCss = state === "selected" ? css2.selected : state === "disabled" ? css2.disabled : css2.unselected;
42784
+ const thumbPosCss = state === "selected" ? css2.thumbOn : css2.thumbOff;
42785
+ const handleClick = (e) => {
42786
+ e.stopPropagation();
42787
+ if (state === "disabled" || !onClick) {
42788
+ return;
42789
+ }
42790
+ onClick();
42791
+ };
42792
+ return /* @__PURE__ */ jsx$1("button", { type: "button", css: /* @__PURE__ */ css$1({
42793
+ ...css2.base,
42794
+ ...trackCss
42795
+ }, "", ""), onClick: handleClick, "aria-pressed": state === "selected", "aria-disabled": state === "disabled", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx$1("span", { css: /* @__PURE__ */ css$1({
42796
+ ...css2.thumb,
42797
+ ...thumbPosCss
42798
+ }, "", "") }) });
42799
+ }
42683
42800
  function ColorSwatchRow({
42684
42801
  colors,
42685
42802
  selectedLabel,
@@ -42752,6 +42869,9 @@ function ProductCard({
42752
42869
  onRemove,
42753
42870
  onChangeColor
42754
42871
  }) {
42872
+ const {
42873
+ t
42874
+ } = useTranslation();
42755
42875
  const css2 = useCss((theme) => ({
42756
42876
  container: {
42757
42877
  position: "relative",
@@ -42760,13 +42880,14 @@ function ProductCard({
42760
42880
  display: "flex",
42761
42881
  flexDirection: "column",
42762
42882
  gap: "8px",
42763
- padding: "8px",
42764
- border: "1px solid transparent",
42883
+ padding: "12px 20px",
42884
+ border: "1.5px solid #E0E0E0",
42885
+ borderRadius: "8px",
42765
42886
  backgroundColor: "transparent",
42766
42887
  textAlign: "left"
42767
42888
  },
42768
42889
  containerSelected: {
42769
- border: `1px solid ${theme.color_fg_text}`
42890
+ borderColor: theme.color_tfr_800
42770
42891
  },
42771
42892
  containerDisabled: {
42772
42893
  opacity: 0.35
@@ -42807,8 +42928,8 @@ function ProductCard({
42807
42928
  },
42808
42929
  removeButton: {
42809
42930
  position: "absolute",
42810
- top: "4px",
42811
- right: "4px",
42931
+ top: "8px",
42932
+ right: "8px",
42812
42933
  width: "24px",
42813
42934
  height: "24px",
42814
42935
  borderRadius: "12px",
@@ -42822,8 +42943,8 @@ function ProductCard({
42822
42943
  zIndex: 1
42823
42944
  },
42824
42945
  removeIcon: {
42825
- width: "12px",
42826
- height: "12px"
42946
+ width: "14px",
42947
+ height: "14px"
42827
42948
  }
42828
42949
  }));
42829
42950
  const disabled = availability === "disabled";
@@ -42879,7 +43000,8 @@ function ProductCard({
42879
43000
  /* @__PURE__ */ jsx$1("button", { css: css2.removeButton, onClick: (e) => {
42880
43001
  e.stopPropagation();
42881
43002
  onRemove();
42882
- }, "aria-label": "Remove from fitting room", children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.removeIcon }) }),
43003
+ }, "aria-label": "Remove from fitting room", children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.removeIcon }) }),
43004
+ /* @__PURE__ */ jsx$1(CardCheckbox, { state: disabled ? "disabled" : selected ? "selected" : "unselected", onClick: handleClick, ariaLabel: t("fitting_room.toggle_selection") }),
42883
43005
  /* @__PURE__ */ jsxs(Button, { variant: "base", css: /* @__PURE__ */ css$1({
42884
43006
  ...css2.cardBody,
42885
43007
  ...disabled && css2.cardBodyDisabled
@@ -42896,7 +43018,8 @@ function CardRail({
42896
43018
  availabilityByExternalId,
42897
43019
  onSelectItem,
42898
43020
  onRemoveItem,
42899
- onChangeColor
43021
+ onChangeColor,
43022
+ sortSelectedFirst
42900
43023
  }) {
42901
43024
  const [collapsed, setCollapsed] = reactExports.useState(false);
42902
43025
  const scrollRef = reactExports.useRef(null);
@@ -42967,7 +43090,7 @@ function CardRail({
42967
43090
  horizontal: {
42968
43091
  display: "flex",
42969
43092
  flexDirection: "row",
42970
- gap: "8px",
43093
+ gap: "16px",
42971
43094
  overflowX: "auto",
42972
43095
  padding: "4px 0",
42973
43096
  // Native scrollbar hidden — the chevron handles are the affordance.
@@ -43000,7 +43123,12 @@ function CardRail({
43000
43123
  right: 0
43001
43124
  }
43002
43125
  }));
43003
- const cards = group.items.map((item) => /* @__PURE__ */ jsx$1(ProductCard, { item, availability: availabilityByExternalId[item.externalId] ?? "disabled", onClick: () => onSelectItem(item.externalId), onRemove: () => onRemoveItem(item.externalId), onChangeColor }, item.externalId));
43126
+ const orderedItems = sortSelectedFirst ? [...group.items].sort((a, b) => {
43127
+ const aSel = availabilityByExternalId[a.externalId] === "selected" ? 0 : 1;
43128
+ const bSel = availabilityByExternalId[b.externalId] === "selected" ? 0 : 1;
43129
+ return aSel - bSel;
43130
+ }) : group.items;
43131
+ const cards = orderedItems.map((item) => /* @__PURE__ */ jsx$1(ProductCard, { item, availability: availabilityByExternalId[item.externalId] ?? "disabled", onClick: () => onSelectItem(item.externalId), onRemove: () => onRemoveItem(item.externalId), onChangeColor }, item.externalId));
43004
43132
  return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
43005
43133
  /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.header, onClick: () => setCollapsed((c) => !c), children: [
43006
43134
  /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.headerLabel, children: group.group.label }),
@@ -43867,7 +43995,7 @@ function DesktopLayout$1({
43867
43995
  ...css2.utilityLink,
43868
43996
  ...css2.clearAllWrapper
43869
43997
  }, "", ""), onClick: onClearAll, children: /* @__PURE__ */ jsx$1(LinkT, { variant: "underline", css: css2.utilityText, t: "fitting_room.clear_all" }) }),
43870
- resolved.groups.map((group) => /* @__PURE__ */ jsx$1(CardRail, { group, availabilityByExternalId, onSelectItem, onRemoveItem, onChangeColor }, group.group.name)),
43998
+ resolved.groups.map((group) => /* @__PURE__ */ jsx$1(CardRail, { group, availabilityByExternalId, onSelectItem, onRemoveItem, onChangeColor, sortSelectedFirst: true }, group.group.name)),
43871
43999
  /* @__PURE__ */ jsxs("span", { css: /* @__PURE__ */ css$1({
43872
44000
  ...css2.utilityLink,
43873
44001
  ...css2.signOutWrapper
@@ -44531,6 +44659,12 @@ function FittingRoomOverlay({
44531
44659
  setOpenAccordionItemId(null);
44532
44660
  }
44533
44661
  } else {
44662
+ for (const evictedId of getSameCategoryConflicts(item, selectedExternalIds, resolved)) {
44663
+ nextSelected.delete(evictedId);
44664
+ if (openAccordionItemId === evictedId) {
44665
+ setOpenAccordionItemId(null);
44666
+ }
44667
+ }
44534
44668
  nextSelected.add(externalId);
44535
44669
  ensureSizeForItem(item);
44536
44670
  setLastAddedExternalId(externalId);
@@ -46649,7 +46783,124 @@ function Footer({
46649
46783
  /* @__PURE__ */ jsx$1(SvgTfrName, { css: css2.tfrIcon })
46650
46784
  ] });
46651
46785
  }
46786
+ const TOOLTIP_WIDTH = 240;
46787
+ const VIEWPORT_PADDING = 12;
46788
+ const ARROW_WIDTH$1 = 32;
46789
+ const ARROW_HEIGHT$1 = 16;
46790
+ const ARROW_GAP = 14;
46791
+ function FirstVisitTooltip({
46792
+ text,
46793
+ dismissAriaLabel,
46794
+ onDismiss,
46795
+ anchorRef
46796
+ }) {
46797
+ const [pos, setPos] = reactExports.useState(null);
46798
+ reactExports.useEffect(() => {
46799
+ const compute = () => {
46800
+ const anchor = anchorRef.current;
46801
+ if (!anchor) {
46802
+ return;
46803
+ }
46804
+ const rect = anchor.getBoundingClientRect();
46805
+ const iconCentre = rect.left + rect.width / 2;
46806
+ let left = iconCentre - TOOLTIP_WIDTH / 2;
46807
+ const maxLeft = window.innerWidth - TOOLTIP_WIDTH - VIEWPORT_PADDING;
46808
+ if (left > maxLeft) {
46809
+ left = maxLeft;
46810
+ }
46811
+ if (left < VIEWPORT_PADDING) {
46812
+ left = VIEWPORT_PADDING;
46813
+ }
46814
+ const top = rect.bottom + ARROW_GAP;
46815
+ const arrowLeftRaw = iconCentre - left - ARROW_WIDTH$1 / 2;
46816
+ const arrowLeftClamped = Math.max(8, Math.min(TOOLTIP_WIDTH - ARROW_WIDTH$1 - 8, arrowLeftRaw));
46817
+ setPos({
46818
+ left,
46819
+ top,
46820
+ arrowLeft: arrowLeftClamped
46821
+ });
46822
+ };
46823
+ compute();
46824
+ window.addEventListener("resize", compute);
46825
+ window.addEventListener("scroll", compute, true);
46826
+ return () => {
46827
+ window.removeEventListener("resize", compute);
46828
+ window.removeEventListener("scroll", compute, true);
46829
+ };
46830
+ }, [anchorRef]);
46831
+ const css2 = useCss((theme) => ({
46832
+ wrapper: {
46833
+ position: "fixed",
46834
+ width: `${TOOLTIP_WIDTH}px`,
46835
+ zIndex: 2147483645,
46836
+ fontFamily: theme.font_family
46837
+ },
46838
+ arrow: {
46839
+ position: "absolute",
46840
+ top: `-${ARROW_HEIGHT$1 - 1}px`,
46841
+ width: `${ARROW_WIDTH$1}px`,
46842
+ height: `${ARROW_HEIGHT$1}px`,
46843
+ color: theme.color_tfr_800,
46844
+ pointerEvents: "none"
46845
+ },
46846
+ body: {
46847
+ backgroundColor: "#FFFFFF",
46848
+ color: theme.color_tfr_800,
46849
+ border: `2px solid ${theme.color_tfr_800}`,
46850
+ padding: "6px 10px",
46851
+ borderRadius: "8px",
46852
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.18)",
46853
+ display: "flex",
46854
+ alignItems: "center",
46855
+ gap: 0
46856
+ },
46857
+ text: {
46858
+ flex: 1,
46859
+ fontSize: "13px",
46860
+ lineHeight: "1.4",
46861
+ color: theme.color_tfr_800,
46862
+ textAlign: "center"
46863
+ },
46864
+ closeBtn: {
46865
+ width: "20px",
46866
+ height: "20px",
46867
+ borderRadius: "10px",
46868
+ border: "none",
46869
+ backgroundColor: "transparent",
46870
+ color: theme.color_tfr_800,
46871
+ cursor: "pointer",
46872
+ padding: 0,
46873
+ display: "flex",
46874
+ alignItems: "center",
46875
+ justifyContent: "center",
46876
+ flex: "none"
46877
+ }
46878
+ }));
46879
+ if (!pos) {
46880
+ return null;
46881
+ }
46882
+ return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, style: {
46883
+ left: `${pos.left}px`,
46884
+ top: `${pos.top}px`
46885
+ }, role: "dialog", "aria-label": text, children: [
46886
+ /* @__PURE__ */ jsx$1("svg", { css: css2.arrow, style: {
46887
+ left: `${pos.arrowLeft}px`
46888
+ }, viewBox: `0 0 ${ARROW_WIDTH$1} ${ARROW_HEIGHT$1}`, xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx$1("polygon", { points: `0,${ARROW_HEIGHT$1} ${ARROW_WIDTH$1 / 2},0 ${ARROW_WIDTH$1},${ARROW_HEIGHT$1}`, fill: "currentColor" }) }),
46889
+ /* @__PURE__ */ jsxs("div", { css: css2.body, children: [
46890
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.text, children: text }),
46891
+ /* @__PURE__ */ jsx$1("button", { css: css2.closeBtn, onClick: onDismiss, "aria-label": dismissAriaLabel, children: /* @__PURE__ */ jsx$1("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx$1("path", { d: "M1 1L9 9M9 1L1 9", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) }) })
46892
+ ] })
46893
+ ] });
46894
+ }
46652
46895
  const logger$4 = getLogger("widgets/add-to-fitting-room-compact");
46896
+ const FIRST_ADD_KEY = "tfr:first-add-tooltip-seen:v1";
46897
+ const TOOLTIP_AUTO_DISMISS_MS$1 = 1e4;
46898
+ let firstAddTooltipClaimed = false;
46899
+ const pulse$1 = keyframes`
46900
+ 0% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0.6); }
46901
+ 70% { box-shadow: 0 0 0 10px rgba(38, 90, 100, 0); }
46902
+ 100% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0); }
46903
+ `;
46653
46904
  function AddToFittingRoomCompactWidget({
46654
46905
  attributes
46655
46906
  }) {
@@ -46665,7 +46916,60 @@ function AddToFittingRoomCompactWidget({
46665
46916
  const isPdp = productId != null && productId === currentProduct?.externalId;
46666
46917
  const productHandle = attrProductHandle || (isPdp ? currentProduct?.handle ?? null : null);
46667
46918
  const isInFittingRoom = useMainStore((state) => productId == null ? false : state.fittingRoom.some((item) => item.externalId === productId));
46919
+ const [showTooltip, setShowTooltip] = reactExports.useState(false);
46920
+ const wrapperRef = reactExports.useRef(null);
46921
+ const buttonRef = reactExports.useRef(null);
46922
+ reactExports.useEffect(() => {
46923
+ if (firstAddTooltipClaimed) {
46924
+ return;
46925
+ }
46926
+ try {
46927
+ if (window.localStorage.getItem(FIRST_ADD_KEY)) {
46928
+ return;
46929
+ }
46930
+ } catch (error) {
46931
+ logger$4.logWarn("Failed to read first-add tooltip flag", {
46932
+ error
46933
+ });
46934
+ return;
46935
+ }
46936
+ firstAddTooltipClaimed = true;
46937
+ setShowTooltip(true);
46938
+ }, []);
46939
+ const dismissTooltip = reactExports.useCallback(() => {
46940
+ setShowTooltip(false);
46941
+ try {
46942
+ window.localStorage.setItem(FIRST_ADD_KEY, "true");
46943
+ } catch (error) {
46944
+ logger$4.logWarn("Failed to write first-add tooltip flag", {
46945
+ error
46946
+ });
46947
+ }
46948
+ }, []);
46949
+ reactExports.useEffect(() => {
46950
+ if (!showTooltip) {
46951
+ return;
46952
+ }
46953
+ const timer = window.setTimeout(dismissTooltip, TOOLTIP_AUTO_DISMISS_MS$1);
46954
+ return () => window.clearTimeout(timer);
46955
+ }, [showTooltip, dismissTooltip]);
46956
+ reactExports.useEffect(() => {
46957
+ if (!showTooltip) {
46958
+ return;
46959
+ }
46960
+ const onDocClick = (e) => {
46961
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
46962
+ dismissTooltip();
46963
+ }
46964
+ };
46965
+ document.addEventListener("mousedown", onDocClick);
46966
+ return () => document.removeEventListener("mousedown", onDocClick);
46967
+ }, [showTooltip, dismissTooltip]);
46668
46968
  const css2 = useCss((theme) => ({
46969
+ wrapper: {
46970
+ position: "relative",
46971
+ display: "inline-block"
46972
+ },
46669
46973
  button: {
46670
46974
  display: "inline-flex",
46671
46975
  alignItems: "center",
@@ -46681,6 +46985,9 @@ function AddToFittingRoomCompactWidget({
46681
46985
  buttonAdded: {
46682
46986
  backgroundColor: theme.color_fg_text
46683
46987
  },
46988
+ buttonPulsing: {
46989
+ animation: `${pulse$1} 1.8s ease-out infinite`
46990
+ },
46684
46991
  icon: {
46685
46992
  width: "24px",
46686
46993
  height: "24px",
@@ -46694,6 +47001,9 @@ function AddToFittingRoomCompactWidget({
46694
47001
  return null;
46695
47002
  }
46696
47003
  const handleClick = () => {
47004
+ if (showTooltip) {
47005
+ dismissTooltip();
47006
+ }
46697
47007
  toggleFittingRoomItem(productId, productHandle, isPdp).catch((error) => {
46698
47008
  logger$4.logError("toggleFittingRoomItem failed", {
46699
47009
  error
@@ -46701,9 +47011,190 @@ function AddToFittingRoomCompactWidget({
46701
47011
  });
46702
47012
  };
46703
47013
  const ariaLabel = t(isInFittingRoom ? "added_to_fitting_room" : "add_to_fitting_room");
46704
- return /* @__PURE__ */ jsx$1("button", { type: "button", onClick: handleClick, css: [css2.button, isInFittingRoom && css2.buttonAdded, "", ""], "aria-label": ariaLabel, "aria-pressed": isInFittingRoom, children: /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: [css2.icon, isInFittingRoom && css2.iconAdded, "", ""] }) });
47014
+ return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, css: css2.wrapper, children: [
47015
+ /* @__PURE__ */ jsx$1("button", { ref: buttonRef, type: "button", onClick: handleClick, css: [css2.button, isInFittingRoom && css2.buttonAdded, showTooltip && css2.buttonPulsing, "", ""], "aria-label": ariaLabel, "aria-pressed": isInFittingRoom, children: /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: [css2.icon, isInFittingRoom && css2.iconAdded, "", ""] }) }),
47016
+ showTooltip ? /* @__PURE__ */ jsx$1(FirstVisitTooltip, { text: t("first_add_tooltip.body"), dismissAriaLabel: t("first_add_tooltip.dismiss"), onDismiss: dismissTooltip, anchorRef: buttonRef }) : null
47017
+ ] });
47018
+ }
47019
+ const ARROW_WIDTH = 32;
47020
+ const ARROW_HEIGHT = 16;
47021
+ const ARROW_RIGHT = 6;
47022
+ function AddConfirmationDrawer({
47023
+ onDismiss,
47024
+ onOpenOverlay,
47025
+ onInteract
47026
+ }) {
47027
+ const {
47028
+ t
47029
+ } = useTranslation();
47030
+ const fittingRoom = useMainStore((state) => state.fittingRoom);
47031
+ const merchantProductData = useMainStore((state) => state.merchantProductData);
47032
+ const removeFromFittingRoom = useMainStore((state) => state.removeFromFittingRoom);
47033
+ reactExports.useEffect(() => {
47034
+ void loadMerchantProductData(fittingRoom);
47035
+ }, [fittingRoom]);
47036
+ const css2 = useCss((theme) => ({
47037
+ wrapper: {
47038
+ position: "absolute",
47039
+ top: "100%",
47040
+ right: 0,
47041
+ marginTop: `${ARROW_HEIGHT}px`,
47042
+ width: "320px",
47043
+ zIndex: 2147483646,
47044
+ fontFamily: theme.font_family
47045
+ },
47046
+ arrow: {
47047
+ position: "absolute",
47048
+ top: `-${ARROW_HEIGHT - 1}px`,
47049
+ right: `${ARROW_RIGHT}px`,
47050
+ width: `${ARROW_WIDTH}px`,
47051
+ height: `${ARROW_HEIGHT}px`,
47052
+ color: theme.color_tfr_800,
47053
+ pointerEvents: "none"
47054
+ },
47055
+ drawer: {
47056
+ width: "100%",
47057
+ maxHeight: "480px",
47058
+ backgroundColor: "#FFFFFF",
47059
+ border: `3px solid ${theme.color_tfr_800}`,
47060
+ borderRadius: "8px",
47061
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.18)",
47062
+ display: "flex",
47063
+ flexDirection: "column",
47064
+ overflow: "hidden"
47065
+ },
47066
+ header: {
47067
+ position: "relative",
47068
+ padding: "12px 40px",
47069
+ borderBottom: `1px solid rgba(0, 0, 0, 0.1)`
47070
+ },
47071
+ title: {
47072
+ fontSize: "14px",
47073
+ fontWeight: "bold",
47074
+ textAlign: "center"
47075
+ },
47076
+ closeBtn: {
47077
+ position: "absolute",
47078
+ top: "8px",
47079
+ right: "8px",
47080
+ width: "24px",
47081
+ height: "24px",
47082
+ borderRadius: "12px",
47083
+ border: "none",
47084
+ backgroundColor: "transparent",
47085
+ color: theme.color_fg_text,
47086
+ cursor: "pointer",
47087
+ padding: 0,
47088
+ display: "flex",
47089
+ alignItems: "center",
47090
+ justifyContent: "center"
47091
+ },
47092
+ subheader: {
47093
+ padding: "10px 14px",
47094
+ fontSize: "12px",
47095
+ color: theme.color_fg_text,
47096
+ backgroundColor: "#F4F4F4",
47097
+ textAlign: "center"
47098
+ },
47099
+ list: {
47100
+ overflowY: "auto",
47101
+ flex: 1,
47102
+ display: "flex",
47103
+ flexDirection: "column"
47104
+ },
47105
+ item: {
47106
+ display: "flex",
47107
+ alignItems: "center",
47108
+ gap: "10px",
47109
+ padding: "10px 14px",
47110
+ borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
47111
+ },
47112
+ thumb: {
47113
+ width: "48px",
47114
+ height: "60px",
47115
+ backgroundColor: "#F4F4F4",
47116
+ flex: "none",
47117
+ objectFit: "cover"
47118
+ },
47119
+ itemBody: {
47120
+ flex: 1,
47121
+ display: "flex",
47122
+ flexDirection: "column",
47123
+ gap: "2px",
47124
+ minWidth: 0
47125
+ },
47126
+ itemName: {
47127
+ fontSize: "13px",
47128
+ lineHeight: "1.3",
47129
+ overflow: "hidden",
47130
+ textOverflow: "ellipsis",
47131
+ whiteSpace: "nowrap"
47132
+ },
47133
+ itemMeta: {
47134
+ fontSize: "12px",
47135
+ color: theme.color_fg_text,
47136
+ opacity: 0.7
47137
+ },
47138
+ removeBtn: {
47139
+ width: "32px",
47140
+ height: "32px",
47141
+ borderRadius: "16px",
47142
+ border: "none",
47143
+ backgroundColor: "transparent",
47144
+ cursor: "pointer",
47145
+ padding: 0,
47146
+ display: "flex",
47147
+ alignItems: "center",
47148
+ justifyContent: "center",
47149
+ flex: "none"
47150
+ },
47151
+ removeIcon: {
47152
+ width: "16px",
47153
+ height: "16px"
47154
+ },
47155
+ ctaWrapper: {
47156
+ padding: "12px 14px",
47157
+ borderTop: `1px solid rgba(0, 0, 0, 0.1)`
47158
+ }
47159
+ }));
47160
+ return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, role: "dialog", "aria-label": t("add_confirmation.title"), onMouseEnter: onInteract, onPointerDown: onInteract, onFocus: onInteract, children: [
47161
+ /* @__PURE__ */ jsx$1("svg", { css: css2.arrow, viewBox: `0 0 ${ARROW_WIDTH} ${ARROW_HEIGHT}`, xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx$1("polygon", { points: `0,${ARROW_HEIGHT} ${ARROW_WIDTH / 2},0 ${ARROW_WIDTH},${ARROW_HEIGHT}`, fill: "currentColor" }) }),
47162
+ /* @__PURE__ */ jsxs("div", { css: css2.drawer, children: [
47163
+ /* @__PURE__ */ jsxs("div", { css: css2.header, children: [
47164
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.title, children: t("add_confirmation.title") }),
47165
+ /* @__PURE__ */ jsx$1("button", { css: css2.closeBtn, onClick: onDismiss, "aria-label": t("add_confirmation.dismiss"), children: /* @__PURE__ */ jsx$1("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx$1("path", { d: "M1 1L9 9M9 1L1 9", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) }) })
47166
+ ] }),
47167
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.subheader, children: t("add_confirmation.added_header") }),
47168
+ /* @__PURE__ */ jsx$1("div", { css: css2.list, children: fittingRoom.map((item) => {
47169
+ const merchant = merchantProductData[item.externalId];
47170
+ const product = merchant && !("error" in merchant) ? merchant : null;
47171
+ const variant = product?.variants.find((v) => v.color === item.color && (!item.size || v.size === item.size)) ?? product?.variants.find((v) => v.color === item.color) ?? null;
47172
+ const imageUrl = variant?.imageUrl ?? product?.imageUrl ?? null;
47173
+ const name2 = product?.productName ?? item.externalId;
47174
+ const price = variant?.priceFormatted ?? product?.variants[0]?.priceFormatted ?? null;
47175
+ const metaParts = [item.color, price].filter(Boolean);
47176
+ return /* @__PURE__ */ jsxs("div", { css: css2.item, children: [
47177
+ imageUrl ? /* @__PURE__ */ jsx$1("img", { src: imageUrl, css: css2.thumb, alt: "" }) : /* @__PURE__ */ jsx$1("div", { css: css2.thumb }),
47178
+ /* @__PURE__ */ jsxs("div", { css: css2.itemBody, children: [
47179
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemName, children: name2 }),
47180
+ metaParts.length > 0 ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemMeta, children: metaParts.join(" · ") }) : null
47181
+ ] }),
47182
+ /* @__PURE__ */ jsx$1("button", { css: css2.removeBtn, onClick: () => removeFromFittingRoom(item.externalId), "aria-label": t("add_confirmation.remove"), children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.removeIcon }) })
47183
+ ] }, item.externalId);
47184
+ }) }),
47185
+ /* @__PURE__ */ jsx$1("div", { css: css2.ctaWrapper, children: /* @__PURE__ */ jsx$1(Button, { variant: "primary", onClick: onOpenOverlay, children: t("add_confirmation.cta") }) })
47186
+ ] })
47187
+ ] });
46705
47188
  }
46706
47189
  const logger$3 = getLogger("widgets/fitting-room-icon");
47190
+ const DRAWER_AUTO_DISMISS_MS = 6e3;
47191
+ const TOOLTIP_AUTO_DISMISS_MS = 1e4;
47192
+ const FIRST_VISIT_KEY = "tfr:first-visit-tooltip-seen:v1";
47193
+ const pulse = keyframes`
47194
+ 0% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0.6); }
47195
+ 70% { box-shadow: 0 0 0 10px rgba(38, 90, 100, 0); }
47196
+ 100% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0); }
47197
+ `;
46707
47198
  function FittingRoomIconWidget(_props) {
46708
47199
  const {
46709
47200
  t
@@ -46712,7 +47203,85 @@ function FittingRoomIconWidget(_props) {
46712
47203
  const isOpen = useMainStore((state) => state.activeOverlay === OverlayName.FITTING_ROOM);
46713
47204
  const openOverlay = useMainStore((state) => state.openOverlay);
46714
47205
  const closeOverlay = useMainStore((state) => state.closeOverlay);
47206
+ const lastAddEvent = useMainStore((state) => state.lastAddEvent);
47207
+ const [drawerOpen, setDrawerOpen] = reactExports.useState(false);
47208
+ const [showTooltip, setShowTooltip] = reactExports.useState(false);
47209
+ const wrapperRef = reactExports.useRef(null);
47210
+ const buttonRef = reactExports.useRef(null);
47211
+ const drawerAutoDismissTimerRef = reactExports.useRef(null);
47212
+ reactExports.useEffect(() => {
47213
+ try {
47214
+ if (!window.localStorage.getItem(FIRST_VISIT_KEY)) {
47215
+ setShowTooltip(true);
47216
+ }
47217
+ } catch (error) {
47218
+ logger$3.logWarn("Failed to read first-visit flag", {
47219
+ error
47220
+ });
47221
+ }
47222
+ }, []);
47223
+ const dismissTooltip = reactExports.useCallback(() => {
47224
+ setShowTooltip(false);
47225
+ try {
47226
+ window.localStorage.setItem(FIRST_VISIT_KEY, "true");
47227
+ } catch (error) {
47228
+ logger$3.logWarn("Failed to write first-visit flag", {
47229
+ error
47230
+ });
47231
+ }
47232
+ }, []);
47233
+ reactExports.useEffect(() => {
47234
+ if (!showTooltip) {
47235
+ return;
47236
+ }
47237
+ const timer = window.setTimeout(dismissTooltip, TOOLTIP_AUTO_DISMISS_MS);
47238
+ return () => window.clearTimeout(timer);
47239
+ }, [showTooltip, dismissTooltip]);
47240
+ const cancelDrawerAutoDismiss = reactExports.useCallback(() => {
47241
+ if (drawerAutoDismissTimerRef.current !== null) {
47242
+ window.clearTimeout(drawerAutoDismissTimerRef.current);
47243
+ drawerAutoDismissTimerRef.current = null;
47244
+ }
47245
+ }, []);
47246
+ reactExports.useEffect(() => {
47247
+ if (!lastAddEvent) {
47248
+ return;
47249
+ }
47250
+ setDrawerOpen(true);
47251
+ cancelDrawerAutoDismiss();
47252
+ drawerAutoDismissTimerRef.current = window.setTimeout(() => {
47253
+ setDrawerOpen(false);
47254
+ drawerAutoDismissTimerRef.current = null;
47255
+ }, DRAWER_AUTO_DISMISS_MS);
47256
+ return cancelDrawerAutoDismiss;
47257
+ }, [lastAddEvent, cancelDrawerAutoDismiss]);
47258
+ reactExports.useEffect(() => {
47259
+ if (!drawerOpen && !showTooltip) {
47260
+ return;
47261
+ }
47262
+ const onDocClick = (e) => {
47263
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
47264
+ if (drawerOpen) {
47265
+ setDrawerOpen(false);
47266
+ }
47267
+ if (showTooltip) {
47268
+ dismissTooltip();
47269
+ }
47270
+ }
47271
+ };
47272
+ document.addEventListener("mousedown", onDocClick);
47273
+ return () => document.removeEventListener("mousedown", onDocClick);
47274
+ }, [drawerOpen, showTooltip, dismissTooltip]);
47275
+ reactExports.useEffect(() => {
47276
+ if (drawerOpen && count === 0) {
47277
+ setDrawerOpen(false);
47278
+ }
47279
+ }, [drawerOpen, count]);
46715
47280
  const css2 = useCss((theme) => ({
47281
+ wrapper: {
47282
+ position: "relative",
47283
+ display: "inline-block"
47284
+ },
46716
47285
  button: {
46717
47286
  position: "relative",
46718
47287
  display: "inline-flex",
@@ -46726,6 +47295,10 @@ function FittingRoomIconWidget(_props) {
46726
47295
  cursor: "pointer",
46727
47296
  color: "inherit"
46728
47297
  },
47298
+ buttonPulsing: {
47299
+ borderRadius: "50%",
47300
+ animation: `${pulse} 1.8s ease-out infinite`
47301
+ },
46729
47302
  icon: {
46730
47303
  width: "24px",
46731
47304
  height: "24px",
@@ -46748,6 +47321,9 @@ function FittingRoomIconWidget(_props) {
46748
47321
  }
46749
47322
  }));
46750
47323
  const handleClick = () => {
47324
+ if (showTooltip) {
47325
+ dismissTooltip();
47326
+ }
46751
47327
  if (isOpen) {
46752
47328
  logger$3.logDebug("{{ts}} - Closing fitting room overlay", {
46753
47329
  count
@@ -46759,10 +47335,21 @@ function FittingRoomIconWidget(_props) {
46759
47335
  count
46760
47336
  });
46761
47337
  openOverlay(OverlayName.FITTING_ROOM);
47338
+ setDrawerOpen(false);
46762
47339
  };
46763
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleClick, css: css2.button, "aria-label": t("view_fitting_room"), children: [
46764
- /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: css2.icon }),
46765
- count > 0 && /* @__PURE__ */ jsx$1("span", { css: css2.badge, children: count })
47340
+ const handleOpenFromDrawer = () => {
47341
+ openOverlay(OverlayName.FITTING_ROOM);
47342
+ setDrawerOpen(false);
47343
+ };
47344
+ return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, css: css2.wrapper, children: [
47345
+ /* @__PURE__ */ jsxs("button", { ref: buttonRef, type: "button", onClick: handleClick, css: /* @__PURE__ */ css$1({
47346
+ ...css2.button,
47347
+ ...showTooltip && !drawerOpen ? css2.buttonPulsing : {}
47348
+ }, "", ""), "aria-label": t("view_fitting_room"), children: [
47349
+ /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: css2.icon }),
47350
+ count > 0 && /* @__PURE__ */ jsx$1("span", { css: css2.badge, children: count })
47351
+ ] }),
47352
+ drawerOpen ? /* @__PURE__ */ jsx$1(AddConfirmationDrawer, { onDismiss: () => setDrawerOpen(false), onOpenOverlay: handleOpenFromDrawer, onInteract: cancelDrawerAutoDismiss }) : showTooltip ? /* @__PURE__ */ jsx$1(FirstVisitTooltip, { text: t("first_visit_tooltip.body"), dismissAriaLabel: t("first_visit_tooltip.dismiss"), onDismiss: dismissTooltip, anchorRef: buttonRef }) : null
46766
47353
  ] });
46767
47354
  }
46768
47355
  const logger$2 = getLogger("widgets/fitting-room");
@@ -47146,6 +47733,13 @@ const useMainStore = create((set) => ({
47146
47733
  fittingRoom: []
47147
47734
  };
47148
47735
  }),
47736
+ lastAddEvent: null,
47737
+ setLastAddEvent: (externalId) => set({
47738
+ lastAddEvent: {
47739
+ externalId,
47740
+ at: Date.now()
47741
+ }
47742
+ }),
47149
47743
  // UI state:
47150
47744
  activeOverlay: null,
47151
47745
  activeOverlayProps: null,
@@ -47202,9 +47796,9 @@ const SHARED_CONFIG = {
47202
47796
  appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
47203
47797
  },
47204
47798
  build: {
47205
- version: `${"5.0.30"}`,
47206
- commitHash: `${"e4427c3"}`,
47207
- date: `${"2026-06-07T13:46:16.711Z"}`
47799
+ version: `${"5.0.32"}`,
47800
+ commitHash: `${"1e960c2"}`,
47801
+ date: `${"2026-06-28T19:41:53.726Z"}`
47208
47802
  }
47209
47803
  };
47210
47804
  const CONFIGS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thefittingroom/shop-ui",
3
- "version": "5.0.30",
3
+ "version": "5.0.32",
4
4
  "description": "the fitting room UI library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",