@thefittingroom/shop-ui 5.0.18 → 5.0.19

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 +2589 -853
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14054,7 +14054,7 @@ function applyFrameBaseUrl(url, baseUrl2) {
14054
14054
  return `${cleanBase}${url.startsWith("/") ? "" : "/"}${url}`;
14055
14055
  }
14056
14056
  const STORAGE_KEY = "tfr:fitting-room:v1";
14057
- const logger$c = getLogger("fitting-room");
14057
+ const logger$h = getLogger("fitting-room");
14058
14058
  function readAll() {
14059
14059
  try {
14060
14060
  const raw = window.localStorage.getItem(STORAGE_KEY);
@@ -14067,7 +14067,7 @@ function readAll() {
14067
14067
  }
14068
14068
  return parsed;
14069
14069
  } catch (error) {
14070
- logger$c.logWarn("Failed to read fitting room from localStorage", {
14070
+ logger$h.logWarn("Failed to read fitting room from localStorage", {
14071
14071
  error
14072
14072
  });
14073
14073
  return {};
@@ -14077,7 +14077,7 @@ function writeAll(all) {
14077
14077
  try {
14078
14078
  window.localStorage.setItem(STORAGE_KEY, JSON.stringify(all));
14079
14079
  } catch (error) {
14080
- logger$c.logWarn("Failed to write fitting room to localStorage", {
14080
+ logger$h.logWarn("Failed to write fitting room to localStorage", {
14081
14081
  error
14082
14082
  });
14083
14083
  }
@@ -14101,34 +14101,39 @@ function _init$7() {
14101
14101
  fittingRoom: items
14102
14102
  });
14103
14103
  }
14104
- async function toggleFittingRoomItem(productId, isPdp) {
14104
+ async function toggleFittingRoomItem(productId, handle, isPdp) {
14105
14105
  const state = useMainStore.getState();
14106
14106
  const isInFittingRoom = state.fittingRoom.some((item) => item.externalId === productId);
14107
14107
  if (isInFittingRoom) {
14108
- logger$c.logDebug("{{ts}} - Removing from fitting room", {
14108
+ logger$h.logDebug("{{ts}} - Removing from fitting room", {
14109
14109
  productId
14110
14110
  });
14111
14111
  state.removeFromFittingRoom(productId);
14112
14112
  return;
14113
14113
  }
14114
- logger$c.logDebug("{{ts}} - Adding to fitting room", {
14114
+ logger$h.logDebug("{{ts}} - Adding to fitting room", {
14115
14115
  productId,
14116
+ handle,
14116
14117
  isPdp
14117
14118
  });
14118
14119
  let size = null;
14119
14120
  let color = null;
14120
14121
  let colorwaySizeAssetId = null;
14122
+ let resolvedHandle = handle;
14121
14123
  if (isPdp) {
14122
14124
  const {
14123
14125
  currentProduct
14124
14126
  } = getStaticData();
14125
14127
  if (currentProduct) {
14128
+ if (!resolvedHandle) {
14129
+ resolvedHandle = currentProduct.handle;
14130
+ }
14126
14131
  try {
14127
14132
  const selection = await currentProduct.getSelectedOptions();
14128
14133
  size = selection.size || null;
14129
14134
  color = selection.color;
14130
14135
  } catch (error) {
14131
- logger$c.logWarn("Failed to read selected options from currentProduct", {
14136
+ logger$h.logWarn("Failed to read selected options from currentProduct", {
14132
14137
  error
14133
14138
  });
14134
14139
  }
@@ -14149,6 +14154,7 @@ async function toggleFittingRoomItem(productId, isPdp) {
14149
14154
  }
14150
14155
  state.addToFittingRoom({
14151
14156
  externalId: productId,
14157
+ handle: resolvedHandle,
14152
14158
  size,
14153
14159
  color,
14154
14160
  colorwaySizeAssetId,
@@ -19287,7 +19293,7 @@ const loading$1 = "Loading...";
19287
19293
  const add_to_fitting_room$1 = "Add to Fitting Room";
19288
19294
  const added_to_fitting_room$1 = "In Fitting Room";
19289
19295
  const view_fitting_room$1 = "Fitting Room";
19290
- 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" };
19296
+ 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", "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." };
19291
19297
  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." };
19292
19298
  const en$1 = {
19293
19299
  try_it_on: try_it_on$1,
@@ -19311,7 +19317,7 @@ const loading = "Chargement...";
19311
19317
  const add_to_fitting_room = "Ajouter à la cabine d'essayage";
19312
19318
  const added_to_fitting_room = "Dans la cabine d'essayage";
19313
19319
  const view_fitting_room = "Cabine d'essayage";
19314
- 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" };
19320
+ 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." };
19315
19321
  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." };
19316
19322
  const fr = {
19317
19323
  try_it_on,
@@ -19464,6 +19470,151 @@ function ButtonT({
19464
19470
  const translatedText = translate(t, vars);
19465
19471
  return /* @__PURE__ */ jsx$1(Button, { ...props, children: translatedText });
19466
19472
  }
19473
+ const Text = reactExports.forwardRef(({
19474
+ children,
19475
+ variant,
19476
+ css: css2,
19477
+ ...props
19478
+ }, ref) => {
19479
+ const variantCss = useVariantCss(variant, (theme) => ({
19480
+ base: {
19481
+ color: theme.color_fg_text,
19482
+ fontFamily: "sans-serif",
19483
+ fontSize: "14px"
19484
+ },
19485
+ brand: {
19486
+ color: theme.color_fg_text,
19487
+ fontFamily: theme.brand_font_family,
19488
+ fontSize: "14px"
19489
+ },
19490
+ error: {
19491
+ color: theme.color_danger,
19492
+ fontSize: "14px"
19493
+ }
19494
+ }));
19495
+ return /* @__PURE__ */ jsx$1("span", { ref, css: [variantCss, css2, "", ""], ...props, children });
19496
+ });
19497
+ Text.displayName = "Text";
19498
+ function TextT({
19499
+ t,
19500
+ vars,
19501
+ ...props
19502
+ }) {
19503
+ const {
19504
+ t: translate
19505
+ } = useTranslation();
19506
+ const translatedText = translate(t, vars);
19507
+ return /* @__PURE__ */ jsx$1(Text, { ...props, children: translatedText });
19508
+ }
19509
+ const SvgArrowBack = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M7.825 13L13.425 18.6L12 20L4 12L12 4L13.425 5.4L7.825 11H20V13H7.825Z", fill: "#1E1E1E" }));
19510
+ const AVATAR_BOTTOM_BACKGROUND_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAAHCAYAAACbWWcuAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kbtLw1AUxr+makUqCnYQcchQneyiIo61CkWoEGqFVh1MbvqCJg1Jiouj4Fpw8LFYdXBx1tXBVRAEHyD+AeKk6CIlnpsUWsR44HJ/fPd8h3PPAYRGhWlWVxzQdNtMJxNiNrcqhl4RQA8GAQzIzDLmJCkF3/i6p2yKuxiv5Z/3Z/SreYsBAZE4zgzTJt4gntm0Dc77xBFWklXic+IJkxokfuS64vEb56LLAq8ZMTPpeeIIsVjsYKWDWcnUiKeJo6qmU30h67HKeYuzVqmxVp/8h+G8vrLMdTqjSGIRS5AgQkENZVRgI0a3ToqFNL0nfPwjrl8il0KuMhg5FlCFBtn1g+/g92ytwtSkVymcALpfHOdjDAjtAs2643wfO07zBAg+A1d6219tALOfpNfbWvSI1roNXFy3NWUPuNwBhp8M2ZRdKUhHKBSA9zNaUw4YugX61ry5td5x+gBkaFapG+DgEBgvUu11n3/3ds7t35zW/H4AAbNyeaZGKRsAAAAGYktHRAAAADQAefP4P6sAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQfqAQYQDxGSDntlAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAABVZJREFUeNrtXNuW6yAINVn9/7+dzsO0ep6clcUR2FzMpK2+NTWKCMgGzNZaa2W11V6sWcQ2u2+mymhjSf9v21Zaa2yfyNgz+ZFBl9YP4YmHf0jfM/ieIdMZfI6sq/N/pg5t28bqTGvtv/89c9F19DE9a4vyJ7rXmbrd+dufdb5oejcak+MF9wzZ11G/4286Nv2NzqHJJuUPOv6IVu6dzj/6PyfPGfaotVb2fYfsNEe39r60XrSvZdzIf1QHjus/7g1Cp0aDxldJPqx28bgWz9x/0c6ijbNbWfNr47wavKNymMmrGXJp1RV6Ph71v7daa3k+n+X7+7tsC6Cv9gmg3eIonQnSzwwenAXYo2B3Br+492qtkENqAQeRPZEAgmefJJCXud+esTIAuvS+5NxbAboEKqmD2p/VWs1O3MiJyNoDTTa9gQVpXC54EbV9XnnzOlujIIEHoHvA10hPOJsVBY+WQOOZQEDbFwtQj8xnBf7W+SPgfGSHzgCviB23Aq7oGq4G1M+YOxIYvjpovzrmQG3ryL4efZHWWnk+n6XWWu73+wLoqy2QPhuYRMaRMkde8DU7K44c2GdnBr1ZchR8eACE5MCj9Hrf55xxJMMWlamjU22RE6sDMsoGSfzLykaMnFGUP5TmWfKNjp9dHTOjv6SHUcfPW2mBAm8UoHDBAbp2Kut0DG2uyLmi7YslOGMJnEV4jgZQsoE5Vz2h2USEPk/g0xN8ytAHzRbNpsNTMfAp4PPdQPpfypfkWx6B+7Zt5fF4lMfjsQD6ap8H0K2H15WyCJLTxJXMIUBtJnDPAHsUuKClmigQ18CU9be2Dg6wUqOuOS9RcI8cXFnyj+yPJziAOJWU51rQxSrTiKOeVXnC0YlUgsy4ihKtgrAGaGi2IUM+0P3l9npEowTouD5IplyzgTQ4pIH02QEV5NyyVrJ4QGVWJt0aEJhFRxbAsJbnRuiXkhAogBpdoYnwzVPhMotPUgDt3QC9JfMs6Xs0gG0JklpkGqGlV9hRP7CXuH99fZXbgnSrvVukzaOM0bEjCpuxZitAQDMLiBOkZTnR7AwHqI4ljFymgZtXCkRQ55ALVnDZDi3IMerH0aTth/W+qcWpnuHYSjKDRrKtsmKhFym5RLPZ1rVabAd6HxipSMgugczMKmsVRCNd8chHZI1HHksBw9E945H9kubR5Eq6ryzRYtEDTxbWE8SRdD/iQJ8h21ll5a/iW0Xf5wKJnoCQ5YpJVLZnAVCJJq168lMatSGoH3klPtFv33C+w/GMaa2tDPpqn6Hgkf+j/WfSzvVH15yVQZcyOhG+zSi1R7KKUp+Mu+daIGT0LMo/y955Djgkg46UmHv3XAIrx0Pdm0FH6PJkpLiP4nCVMRZeIXfwrWXNlqsJkWsD3LyIg5b18bPofVkJWEczYxbQgWTnND30VDB4bbn3Y1HWYKO3xH1WCb5Fh2Zcu5gB6DV5sQbwIzRoNsz70VDJz/nrINKVfXL07rbnI4ZccB29+oPKlaUv9T96Fn3btrLv+++zn5+fcr/fVwZ9tc9pklG+apwKAbjeO2feuSRwZZkjy0GWHGUr4JIy1RI40spTkQBGKeXXSI+AJHp/UqpekAAFXUOnBQEiXDCGO2DpejQAwd25RWWHy1BaPpyVrR9HPmtOA/ebyotWMdKf11qHvB05ypJse+8kIzZHcq49TjGSmbbIgcY/TvYk+Ue/DaGNZwERkbEtAFoLmCJVBWcC5Mjc0dJYDzi3+AFoX7RqEAHgaCWF9xse2hmPVkNlA9+zAPsrfD0/4gN77X7Ex6e+S9bHF+l4+77/nuW90uR2u5V/yJQ49anG7eoAAAAASUVORK5CYII=";
19511
+ const SvgCheckCircle = (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("g", { clipPath: "url(#clip0_4454_620)" }, /* @__PURE__ */ reactExports.createElement("path", { d: "M14.6666 7.38674V8.00007C14.6658 9.43769 14.2003 10.8365 13.3395 11.988C12.4787 13.1394 11.2688 13.9817 9.89016 14.3893C8.51154 14.797 7.03809 14.748 5.68957 14.2498C4.34104 13.7516 3.18969 12.8308 2.40723 11.6248C1.62476 10.4188 1.25311 8.99211 1.3477 7.55761C1.44229 6.12312 1.99806 4.75762 2.93211 3.66479C3.86615 2.57195 5.12844 1.81033 6.53071 1.4935C7.93298 1.17668 9.4001 1.32163 10.7133 1.90674M14.6666 2.66674L7.99992 9.34007L5.99992 7.34007", stroke: "#21201F", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), /* @__PURE__ */ reactExports.createElement("defs", null, /* @__PURE__ */ reactExports.createElement("clipPath", { id: "clip0_4454_620" }, /* @__PURE__ */ reactExports.createElement("rect", { width: 16, height: 16, fill: "white" }))));
19512
+ const SvgChevronLeft = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 48, height: 48, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("g", { opacity: 0.35 }, /* @__PURE__ */ reactExports.createElement("path", { d: "M30 36L18 24L30 12", stroke: "#1E1E1E", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" })));
19513
+ const SvgChevronRight = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 48, height: 48, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("g", { opacity: 0.35 }, /* @__PURE__ */ reactExports.createElement("path", { d: "M18 36L30 24L18 12", stroke: "#1E1E1E", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" })));
19514
+ const SvgCloseIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 15, height: 16, viewBox: "0 0 15 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.249026 1.13202C0.353455 1.02778 0.494976 0.969238 0.642526 0.969238C0.790076 0.969238 0.931598 1.02778 1.03603 1.13202L14.423 14.498C14.4747 14.5498 14.5157 14.6112 14.5436 14.6788C14.5716 14.7463 14.5859 14.8187 14.5859 14.8919C14.5858 14.965 14.5714 15.0374 14.5434 15.1049C14.5153 15.1725 14.4743 15.2338 14.4225 15.2855C14.3708 15.3372 14.3094 15.3782 14.2418 15.4061C14.1742 15.4341 14.1018 15.4484 14.0287 15.4484C13.9555 15.4483 13.8831 15.4339 13.8156 15.4058C13.7481 15.3778 13.6867 15.3368 13.635 15.285L0.250026 1.91802C0.198323 1.86646 0.157301 1.80521 0.129312 1.73777C0.101322 1.67034 0.0869141 1.59804 0.0869141 1.52502C0.0869141 1.45201 0.101322 1.37971 0.129312 1.31227C0.157301 1.24483 0.197323 1.18358 0.249026 1.13202Z", fill: "#21201F" }), /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.249003 15.285C0.197149 15.2335 0.156 15.1722 0.127922 15.1046C0.0998429 15.0371 0.0853882 14.9647 0.0853882 14.8916C0.0853882 14.8184 0.0998429 14.746 0.127922 14.6785C0.156 14.6109 0.197149 14.5496 0.249003 14.498L13.635 1.13205C13.7407 1.03479 13.8798 0.982096 14.0234 0.984975C14.167 0.987855 14.3039 1.04608 14.4056 1.1475C14.5073 1.24893 14.5658 1.3857 14.5691 1.52928C14.5723 1.67286 14.52 1.81214 14.423 1.91805L1.036 15.285C0.931574 15.3893 0.790052 15.4478 0.642502 15.4478C0.494952 15.4478 0.353431 15.3893 0.249003 15.285Z", fill: "#21201F" }));
19515
+ const SvgDragHandle = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 32, height: 4, viewBox: "0 0 32 4", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("rect", { width: 32, height: 4, rx: 2, fill: "black" }));
19516
+ const SvgFittingRoomIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 24, height: 24, viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M6.16963 1.44419C6.16963 1.16593 6.0591 0.89907 5.86234 0.702313C5.66558 0.505556 5.39872 0.39502 5.12047 0.39502C4.84221 0.39502 4.57535 0.505556 4.37859 0.702313C4.18184 0.89907 4.0713 1.16593 4.0713 1.44419C4.0713 2.31867 4.42277 3.01794 5.12047 3.54252H5.11627M5.11627 3.54252L9.29772 5.86537C9.46136 5.95625 9.59771 6.08925 9.69263 6.25058C9.78754 6.41191 9.83757 6.59569 9.83752 6.78287V7.2146C9.83752 7.49286 9.72698 7.75972 9.53023 7.95648C9.33347 8.15323 9.06661 8.26377 8.78835 8.26377H1.44419C1.16593 8.26377 0.89907 8.15323 0.702313 7.95648C0.505556 7.75972 0.39502 7.49286 0.39502 7.2146V6.78287C0.39497 6.59569 0.444998 6.41191 0.539913 6.25058C0.634829 6.08925 0.771177 5.95625 0.934816 5.86537L5.11627 3.54252Z", stroke: "currentColor", strokeWidth: 0.79, strokeLinecap: "round", strokeLinejoin: "round" }));
19517
+ const SvgInfoIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M6.75 9.15V6.75M6.75 4.35H6.756M12.75 6.75C12.75 10.0637 10.0637 12.75 6.75 12.75C3.43629 12.75 0.75 10.0637 0.75 6.75C0.75 3.43629 3.43629 0.75 6.75 0.75C10.0637 0.75 12.75 3.43629 12.75 6.75Z", stroke: "#757575", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
19518
+ const SvgLoadingCircle = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 108, height: 108, viewBox: "0 0 108 108", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M27.1325 75.9593C25.3424 77.0549 23.0032 76.4919 21.9077 74.7018L20.2636 72.0155L18.786 69.0476L17.5726 65.9622L16.6328 62.7828L15.9737 59.5336L15.6002 56.2393L15.5153 52.925L15.7196 49.6159L16.2115 46.3373L16.9485 43.2752C17.4396 41.2348 19.4918 39.9788 21.5322 40.4699C23.5726 40.961 24.8286 43.0132 24.3375 45.0536L23.6782 47.793L23.2847 50.4154L23.1213 53.0621L23.1893 55.713L23.4879 58.3479L24.0151 60.9467L24.7668 63.4897L25.7373 65.9574L26.9191 68.3312L28.39 70.7345C29.4855 72.5246 28.9225 74.8638 27.1325 75.9593Z", fill: "black" }), /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.542 81.0995C33.5444 79.2557 35.8518 78.5736 37.6955 79.5761L40.171 80.922L42.6022 81.9807L45.1164 82.8236L47.6945 83.4441L50.3169 83.8375L52.9636 84.0009L55.6145 83.933L58.2494 83.6343L60.8482 83.1071L63.3912 82.3554L65.8589 81.385L68.2327 80.2031L70.4945 78.8189L72.627 77.2428L74.6141 75.4868L76.4405 73.5643L78.0924 71.49L79.5573 69.2796L80.8239 66.9499L81.8827 64.5187L82.7255 62.0044L83.346 59.4264L83.7395 56.8039L83.9029 54.1572L83.8349 51.5064L83.5363 48.8715L83.0091 46.2727L82.2574 43.7297L81.2869 41.2619L80.1051 38.8882L78.7208 36.6263L77.1447 34.4938L75.3888 32.5068L73.4662 30.6803L71.392 29.0284L69.1815 27.5636L66.8518 26.297L64.4206 25.2382L61.9064 24.3954L59.3283 23.7749L56.7059 23.3814L54.0592 23.218L51.4083 23.2859L48.7734 23.5846L46.1747 24.1118L43.6316 24.8635L41.1639 25.834L38.7901 27.0158L36.5283 28.4001L34.3958 29.9762L32.4088 31.7321L30.4681 33.7749C29.0225 35.2964 26.6173 35.358 25.0958 33.9125C23.5743 32.467 23.5127 30.0618 24.9582 28.5403L27.1274 26.2569L29.6118 24.0615L32.278 22.0909L35.1058 20.3603L38.0737 18.8826L41.1591 17.6693L44.3385 16.7295L47.5877 16.0704L50.882 15.6969L54.1963 15.612L57.5054 15.8163L60.7841 16.3082L64.0074 17.084L67.1509 18.1378L70.1905 19.4615L73.1032 21.0451L75.8669 22.8766L78.4603 24.942L80.8639 27.2255L83.0594 29.7098L85.0299 32.376L86.7606 35.2039L88.2382 38.1718L89.4516 41.2571L90.3914 44.4365L91.0505 47.6857L91.424 50.98L91.5089 54.2943L91.3046 57.6034L90.8127 60.8821L90.0369 64.1055L88.9831 67.2489L87.6594 70.2886L86.0757 73.2013L84.2443 75.9649L82.1789 78.5584L79.8954 80.962L77.4111 83.1574L74.7448 85.128L71.917 86.8587L68.9491 88.3363L65.8637 89.5496L62.6843 90.4894L59.4351 91.1486L56.1408 91.522L52.8265 91.6069L49.5175 91.4026L46.2388 90.9107L43.0154 90.1349L39.872 89.0811L36.8323 87.7574L34.0653 86.253C32.2216 85.2506 31.5395 82.9432 32.542 81.0995Z", fill: "black", fillOpacity: 0.45 }));
19519
+ 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" }));
19520
+ 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" }));
19521
+ 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" }));
19522
+ 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" }));
19523
+ let baseUrl$1;
19524
+ function _init$5() {
19525
+ const {
19526
+ config
19527
+ } = getStaticData();
19528
+ baseUrl$1 = config.asset.baseUrl;
19529
+ }
19530
+ function getExternalAssetUrl(fileName) {
19531
+ return `${baseUrl$1}/${fileName}`;
19532
+ }
19533
+ function Loading({
19534
+ t = "loading"
19535
+ }) {
19536
+ const css2 = useCss((_theme) => {
19537
+ const spin = keyframes({
19538
+ from: {
19539
+ transform: "rotate(0deg)"
19540
+ },
19541
+ to: {
19542
+ transform: "rotate(360deg)"
19543
+ }
19544
+ });
19545
+ return {
19546
+ container: {
19547
+ display: "flex",
19548
+ flexDirection: "column",
19549
+ justifyContent: "center",
19550
+ alignItems: "center",
19551
+ height: "100%",
19552
+ gap: "4px"
19553
+ },
19554
+ icon: {
19555
+ width: "76px",
19556
+ height: "76px",
19557
+ animation: `${spin} 2s linear infinite`
19558
+ },
19559
+ text: {}
19560
+ };
19561
+ });
19562
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
19563
+ /* @__PURE__ */ jsx$1(SvgLoadingCircle, { css: css2.icon }),
19564
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.text, t })
19565
+ ] });
19566
+ }
19567
+ const Link = reactExports.forwardRef(({
19568
+ children,
19569
+ variant,
19570
+ css: css2,
19571
+ ...props
19572
+ }, ref) => {
19573
+ const variantCss = useVariantCss(variant, (theme) => ({
19574
+ base: {
19575
+ cursor: "pointer !important",
19576
+ color: theme.color_fg_text,
19577
+ fontFamily: theme.font_family,
19578
+ fontSize: "14px",
19579
+ textDecoration: "none"
19580
+ },
19581
+ brand: {
19582
+ cursor: "pointer !important",
19583
+ color: theme.color_fg_text,
19584
+ fontFamily: theme.brand_font_family,
19585
+ fontSize: "14px",
19586
+ textDecoration: theme.brand_link_text_decoration
19587
+ },
19588
+ underline: {
19589
+ cursor: "pointer !important",
19590
+ color: theme.color_fg_text,
19591
+ fontFamily: theme.font_family,
19592
+ fontSize: "14px",
19593
+ textDecoration: "underline"
19594
+ },
19595
+ semibold: {
19596
+ cursor: "pointer !important",
19597
+ color: theme.color_fg_text,
19598
+ fontFamily: theme.font_family,
19599
+ fontSize: "14px",
19600
+ fontWeight: 600,
19601
+ textDecoration: "none"
19602
+ }
19603
+ }));
19604
+ return /* @__PURE__ */ jsx$1("a", { ref, css: [variantCss, css2, "", ""], ...props, children });
19605
+ });
19606
+ Link.displayName = "Link";
19607
+ function LinkT({
19608
+ t,
19609
+ vars,
19610
+ ...props
19611
+ }) {
19612
+ const {
19613
+ t: translate
19614
+ } = useTranslation();
19615
+ const translatedText = translate(t, vars);
19616
+ return /* @__PURE__ */ jsx$1(Link, { ...props, children: translatedText });
19617
+ }
19467
19618
  var lib = { exports: {} };
19468
19619
  var Modal = {};
19469
19620
  var propTypes = { exports: {} };
@@ -20923,64 +21074,6 @@ function requireLib() {
20923
21074
  }
20924
21075
  var libExports = requireLib();
20925
21076
  const ModalBase = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
20926
- const Text = reactExports.forwardRef(({
20927
- children,
20928
- variant,
20929
- css: css2,
20930
- ...props
20931
- }, ref) => {
20932
- const variantCss = useVariantCss(variant, (theme) => ({
20933
- base: {
20934
- color: theme.color_fg_text,
20935
- fontFamily: "sans-serif",
20936
- fontSize: "14px"
20937
- },
20938
- brand: {
20939
- color: theme.color_fg_text,
20940
- fontFamily: theme.brand_font_family,
20941
- fontSize: "14px"
20942
- },
20943
- error: {
20944
- color: theme.color_danger,
20945
- fontSize: "14px"
20946
- }
20947
- }));
20948
- return /* @__PURE__ */ jsx$1("span", { ref, css: [variantCss, css2, "", ""], ...props, children });
20949
- });
20950
- Text.displayName = "Text";
20951
- function TextT({
20952
- t,
20953
- vars,
20954
- ...props
20955
- }) {
20956
- const {
20957
- t: translate
20958
- } = useTranslation();
20959
- const translatedText = translate(t, vars);
20960
- return /* @__PURE__ */ jsx$1(Text, { ...props, children: translatedText });
20961
- }
20962
- const SvgArrowBack = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M7.825 13L13.425 18.6L12 20L4 12L12 4L13.425 5.4L7.825 11H20V13H7.825Z", fill: "#1E1E1E" }));
20963
- const AVATAR_BOTTOM_BACKGROUND_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAAHCAYAAACbWWcuAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kbtLw1AUxr+makUqCnYQcchQneyiIo61CkWoEGqFVh1MbvqCJg1Jiouj4Fpw8LFYdXBx1tXBVRAEHyD+AeKk6CIlnpsUWsR44HJ/fPd8h3PPAYRGhWlWVxzQdNtMJxNiNrcqhl4RQA8GAQzIzDLmJCkF3/i6p2yKuxiv5Z/3Z/SreYsBAZE4zgzTJt4gntm0Dc77xBFWklXic+IJkxokfuS64vEb56LLAq8ZMTPpeeIIsVjsYKWDWcnUiKeJo6qmU30h67HKeYuzVqmxVp/8h+G8vrLMdTqjSGIRS5AgQkENZVRgI0a3ToqFNL0nfPwjrl8il0KuMhg5FlCFBtn1g+/g92ytwtSkVymcALpfHOdjDAjtAs2643wfO07zBAg+A1d6219tALOfpNfbWvSI1roNXFy3NWUPuNwBhp8M2ZRdKUhHKBSA9zNaUw4YugX61ry5td5x+gBkaFapG+DgEBgvUu11n3/3ds7t35zW/H4AAbNyeaZGKRsAAAAGYktHRAAAADQAefP4P6sAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQfqAQYQDxGSDntlAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAABVZJREFUeNrtXNuW6yAINVn9/7+dzsO0ep6clcUR2FzMpK2+NTWKCMgGzNZaa2W11V6sWcQ2u2+mymhjSf9v21Zaa2yfyNgz+ZFBl9YP4YmHf0jfM/ieIdMZfI6sq/N/pg5t28bqTGvtv/89c9F19DE9a4vyJ7rXmbrd+dufdb5oejcak+MF9wzZ11G/4286Nv2NzqHJJuUPOv6IVu6dzj/6PyfPGfaotVb2fYfsNEe39r60XrSvZdzIf1QHjus/7g1Cp0aDxldJPqx28bgWz9x/0c6ijbNbWfNr47wavKNymMmrGXJp1RV6Ph71v7daa3k+n+X7+7tsC6Cv9gmg3eIonQnSzwwenAXYo2B3Br+492qtkENqAQeRPZEAgmefJJCXud+esTIAuvS+5NxbAboEKqmD2p/VWs1O3MiJyNoDTTa9gQVpXC54EbV9XnnzOlujIIEHoHvA10hPOJsVBY+WQOOZQEDbFwtQj8xnBf7W+SPgfGSHzgCviB23Aq7oGq4G1M+YOxIYvjpovzrmQG3ryL4efZHWWnk+n6XWWu73+wLoqy2QPhuYRMaRMkde8DU7K44c2GdnBr1ZchR8eACE5MCj9Hrf55xxJMMWlamjU22RE6sDMsoGSfzLykaMnFGUP5TmWfKNjp9dHTOjv6SHUcfPW2mBAm8UoHDBAbp2Kut0DG2uyLmi7YslOGMJnEV4jgZQsoE5Vz2h2USEPk/g0xN8ytAHzRbNpsNTMfAp4PPdQPpfypfkWx6B+7Zt5fF4lMfjsQD6ap8H0K2H15WyCJLTxJXMIUBtJnDPAHsUuKClmigQ18CU9be2Dg6wUqOuOS9RcI8cXFnyj+yPJziAOJWU51rQxSrTiKOeVXnC0YlUgsy4ihKtgrAGaGi2IUM+0P3l9npEowTouD5IplyzgTQ4pIH02QEV5NyyVrJ4QGVWJt0aEJhFRxbAsJbnRuiXkhAogBpdoYnwzVPhMotPUgDt3QC9JfMs6Xs0gG0JklpkGqGlV9hRP7CXuH99fZXbgnSrvVukzaOM0bEjCpuxZitAQDMLiBOkZTnR7AwHqI4ljFymgZtXCkRQ55ALVnDZDi3IMerH0aTth/W+qcWpnuHYSjKDRrKtsmKhFym5RLPZ1rVabAd6HxipSMgugczMKmsVRCNd8chHZI1HHksBw9E945H9kubR5Eq6ryzRYtEDTxbWE8SRdD/iQJ8h21ll5a/iW0Xf5wKJnoCQ5YpJVLZnAVCJJq168lMatSGoH3klPtFv33C+w/GMaa2tDPpqn6Hgkf+j/WfSzvVH15yVQZcyOhG+zSi1R7KKUp+Mu+daIGT0LMo/y955Djgkg46UmHv3XAIrx0Pdm0FH6PJkpLiP4nCVMRZeIXfwrWXNlqsJkWsD3LyIg5b18bPofVkJWEczYxbQgWTnND30VDB4bbn3Y1HWYKO3xH1WCb5Fh2Zcu5gB6DV5sQbwIzRoNsz70VDJz/nrINKVfXL07rbnI4ZccB29+oPKlaUv9T96Fn3btrLv+++zn5+fcr/fVwZ9tc9pklG+apwKAbjeO2feuSRwZZkjy0GWHGUr4JIy1RI40spTkQBGKeXXSI+AJHp/UqpekAAFXUOnBQEiXDCGO2DpejQAwd25RWWHy1BaPpyVrR9HPmtOA/ebyotWMdKf11qHvB05ypJse+8kIzZHcq49TjGSmbbIgcY/TvYk+Ue/DaGNZwERkbEtAFoLmCJVBWcC5Mjc0dJYDzi3+AFoX7RqEAHgaCWF9xse2hmPVkNlA9+zAPsrfD0/4gN77X7Ex6e+S9bHF+l4+77/nuW90uR2u5V/yJQ49anG7eoAAAAASUVORK5CYII=";
20964
- const SvgCheckCircle = (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("g", { clipPath: "url(#clip0_4454_620)" }, /* @__PURE__ */ reactExports.createElement("path", { d: "M14.6666 7.38674V8.00007C14.6658 9.43769 14.2003 10.8365 13.3395 11.988C12.4787 13.1394 11.2688 13.9817 9.89016 14.3893C8.51154 14.797 7.03809 14.748 5.68957 14.2498C4.34104 13.7516 3.18969 12.8308 2.40723 11.6248C1.62476 10.4188 1.25311 8.99211 1.3477 7.55761C1.44229 6.12312 1.99806 4.75762 2.93211 3.66479C3.86615 2.57195 5.12844 1.81033 6.53071 1.4935C7.93298 1.17668 9.4001 1.32163 10.7133 1.90674M14.6666 2.66674L7.99992 9.34007L5.99992 7.34007", stroke: "#21201F", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), /* @__PURE__ */ reactExports.createElement("defs", null, /* @__PURE__ */ reactExports.createElement("clipPath", { id: "clip0_4454_620" }, /* @__PURE__ */ reactExports.createElement("rect", { width: 16, height: 16, fill: "white" }))));
20965
- const SvgChevronLeft = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 48, height: 48, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("g", { opacity: 0.35 }, /* @__PURE__ */ reactExports.createElement("path", { d: "M30 36L18 24L30 12", stroke: "#1E1E1E", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" })));
20966
- const SvgChevronRight = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 48, height: 48, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("g", { opacity: 0.35 }, /* @__PURE__ */ reactExports.createElement("path", { d: "M18 36L30 24L18 12", stroke: "#1E1E1E", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" })));
20967
- const SvgCloseIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 15, height: 16, viewBox: "0 0 15 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.249026 1.13202C0.353455 1.02778 0.494976 0.969238 0.642526 0.969238C0.790076 0.969238 0.931598 1.02778 1.03603 1.13202L14.423 14.498C14.4747 14.5498 14.5157 14.6112 14.5436 14.6788C14.5716 14.7463 14.5859 14.8187 14.5859 14.8919C14.5858 14.965 14.5714 15.0374 14.5434 15.1049C14.5153 15.1725 14.4743 15.2338 14.4225 15.2855C14.3708 15.3372 14.3094 15.3782 14.2418 15.4061C14.1742 15.4341 14.1018 15.4484 14.0287 15.4484C13.9555 15.4483 13.8831 15.4339 13.8156 15.4058C13.7481 15.3778 13.6867 15.3368 13.635 15.285L0.250026 1.91802C0.198323 1.86646 0.157301 1.80521 0.129312 1.73777C0.101322 1.67034 0.0869141 1.59804 0.0869141 1.52502C0.0869141 1.45201 0.101322 1.37971 0.129312 1.31227C0.157301 1.24483 0.197323 1.18358 0.249026 1.13202Z", fill: "#21201F" }), /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.249003 15.285C0.197149 15.2335 0.156 15.1722 0.127922 15.1046C0.0998429 15.0371 0.0853882 14.9647 0.0853882 14.8916C0.0853882 14.8184 0.0998429 14.746 0.127922 14.6785C0.156 14.6109 0.197149 14.5496 0.249003 14.498L13.635 1.13205C13.7407 1.03479 13.8798 0.982096 14.0234 0.984975C14.167 0.987855 14.3039 1.04608 14.4056 1.1475C14.5073 1.24893 14.5658 1.3857 14.5691 1.52928C14.5723 1.67286 14.52 1.81214 14.423 1.91805L1.036 15.285C0.931574 15.3893 0.790052 15.4478 0.642502 15.4478C0.494952 15.4478 0.353431 15.3893 0.249003 15.285Z", fill: "#21201F" }));
20968
- const SvgDragHandle = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 32, height: 4, viewBox: "0 0 32 4", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("rect", { width: 32, height: 4, rx: 2, fill: "black" }));
20969
- const SvgFittingRoomIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 24, height: 24, viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M6.16963 1.44419C6.16963 1.16593 6.0591 0.89907 5.86234 0.702313C5.66558 0.505556 5.39872 0.39502 5.12047 0.39502C4.84221 0.39502 4.57535 0.505556 4.37859 0.702313C4.18184 0.89907 4.0713 1.16593 4.0713 1.44419C4.0713 2.31867 4.42277 3.01794 5.12047 3.54252H5.11627M5.11627 3.54252L9.29772 5.86537C9.46136 5.95625 9.59771 6.08925 9.69263 6.25058C9.78754 6.41191 9.83757 6.59569 9.83752 6.78287V7.2146C9.83752 7.49286 9.72698 7.75972 9.53023 7.95648C9.33347 8.15323 9.06661 8.26377 8.78835 8.26377H1.44419C1.16593 8.26377 0.89907 8.15323 0.702313 7.95648C0.505556 7.75972 0.39502 7.49286 0.39502 7.2146V6.78287C0.39497 6.59569 0.444998 6.41191 0.539913 6.25058C0.634829 6.08925 0.771177 5.95625 0.934816 5.86537L5.11627 3.54252Z", stroke: "currentColor", strokeWidth: 0.79, strokeLinecap: "round", strokeLinejoin: "round" }));
20970
- const SvgInfoIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M6.75 9.15V6.75M6.75 4.35H6.756M12.75 6.75C12.75 10.0637 10.0637 12.75 6.75 12.75C3.43629 12.75 0.75 10.0637 0.75 6.75C0.75 3.43629 3.43629 0.75 6.75 0.75C10.0637 0.75 12.75 3.43629 12.75 6.75Z", stroke: "#757575", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
20971
- const SvgLoadingCircle = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 108, height: 108, viewBox: "0 0 108 108", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M27.1325 75.9593C25.3424 77.0549 23.0032 76.4919 21.9077 74.7018L20.2636 72.0155L18.786 69.0476L17.5726 65.9622L16.6328 62.7828L15.9737 59.5336L15.6002 56.2393L15.5153 52.925L15.7196 49.6159L16.2115 46.3373L16.9485 43.2752C17.4396 41.2348 19.4918 39.9788 21.5322 40.4699C23.5726 40.961 24.8286 43.0132 24.3375 45.0536L23.6782 47.793L23.2847 50.4154L23.1213 53.0621L23.1893 55.713L23.4879 58.3479L24.0151 60.9467L24.7668 63.4897L25.7373 65.9574L26.9191 68.3312L28.39 70.7345C29.4855 72.5246 28.9225 74.8638 27.1325 75.9593Z", fill: "black" }), /* @__PURE__ */ reactExports.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.542 81.0995C33.5444 79.2557 35.8518 78.5736 37.6955 79.5761L40.171 80.922L42.6022 81.9807L45.1164 82.8236L47.6945 83.4441L50.3169 83.8375L52.9636 84.0009L55.6145 83.933L58.2494 83.6343L60.8482 83.1071L63.3912 82.3554L65.8589 81.385L68.2327 80.2031L70.4945 78.8189L72.627 77.2428L74.6141 75.4868L76.4405 73.5643L78.0924 71.49L79.5573 69.2796L80.8239 66.9499L81.8827 64.5187L82.7255 62.0044L83.346 59.4264L83.7395 56.8039L83.9029 54.1572L83.8349 51.5064L83.5363 48.8715L83.0091 46.2727L82.2574 43.7297L81.2869 41.2619L80.1051 38.8882L78.7208 36.6263L77.1447 34.4938L75.3888 32.5068L73.4662 30.6803L71.392 29.0284L69.1815 27.5636L66.8518 26.297L64.4206 25.2382L61.9064 24.3954L59.3283 23.7749L56.7059 23.3814L54.0592 23.218L51.4083 23.2859L48.7734 23.5846L46.1747 24.1118L43.6316 24.8635L41.1639 25.834L38.7901 27.0158L36.5283 28.4001L34.3958 29.9762L32.4088 31.7321L30.4681 33.7749C29.0225 35.2964 26.6173 35.358 25.0958 33.9125C23.5743 32.467 23.5127 30.0618 24.9582 28.5403L27.1274 26.2569L29.6118 24.0615L32.278 22.0909L35.1058 20.3603L38.0737 18.8826L41.1591 17.6693L44.3385 16.7295L47.5877 16.0704L50.882 15.6969L54.1963 15.612L57.5054 15.8163L60.7841 16.3082L64.0074 17.084L67.1509 18.1378L70.1905 19.4615L73.1032 21.0451L75.8669 22.8766L78.4603 24.942L80.8639 27.2255L83.0594 29.7098L85.0299 32.376L86.7606 35.2039L88.2382 38.1718L89.4516 41.2571L90.3914 44.4365L91.0505 47.6857L91.424 50.98L91.5089 54.2943L91.3046 57.6034L90.8127 60.8821L90.0369 64.1055L88.9831 67.2489L87.6594 70.2886L86.0757 73.2013L84.2443 75.9649L82.1789 78.5584L79.8954 80.962L77.4111 83.1574L74.7448 85.128L71.917 86.8587L68.9491 88.3363L65.8637 89.5496L62.6843 90.4894L59.4351 91.1486L56.1408 91.522L52.8265 91.6069L49.5175 91.4026L46.2388 90.9107L43.0154 90.1349L39.872 89.0811L36.8323 87.7574L34.0653 86.253C32.2216 85.2506 31.5395 82.9432 32.542 81.0995Z", fill: "black", fillOpacity: 0.45 }));
20972
- 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" }));
20973
- 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" }));
20974
- let baseUrl$1;
20975
- function _init$5() {
20976
- const {
20977
- config
20978
- } = getStaticData();
20979
- baseUrl$1 = config.asset.baseUrl;
20980
- }
20981
- function getExternalAssetUrl(fileName) {
20982
- return `${baseUrl$1}/${fileName}`;
20983
- }
20984
21077
  function ModalFrame({
20985
21078
  isOpen,
20986
21079
  onRequestClose,
@@ -21141,175 +21234,6 @@ function SidecarModalFrame({
21141
21234
  };
21142
21235
  return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose, contentStyle: applyContentStyle, children });
21143
21236
  }
21144
- function measureTopOffset() {
21145
- const {
21146
- getOverlayTopOffset
21147
- } = getStaticData();
21148
- if (!getOverlayTopOffset) {
21149
- return 0;
21150
- }
21151
- try {
21152
- const offset = getOverlayTopOffset();
21153
- return Number.isFinite(offset) && offset > 0 ? offset : 0;
21154
- } catch {
21155
- return 0;
21156
- }
21157
- }
21158
- function FittingRoomOverlay() {
21159
- const {
21160
- t
21161
- } = useTranslation();
21162
- const fittingRoom = useMainStore((state) => state.fittingRoom);
21163
- const removeFromFittingRoom = useMainStore((state) => state.removeFromFittingRoom);
21164
- const closeOverlay = useMainStore((state) => state.closeOverlay);
21165
- const [topOffset, setTopOffset] = reactExports.useState(() => 0);
21166
- reactExports.useEffect(() => {
21167
- const savedScrollY = window.scrollY;
21168
- if (savedScrollY > 0) {
21169
- window.scrollTo(0, 0);
21170
- }
21171
- setTopOffset(measureTopOffset());
21172
- const onResize = () => setTopOffset(measureTopOffset());
21173
- window.addEventListener("resize", onResize);
21174
- return () => {
21175
- window.removeEventListener("resize", onResize);
21176
- if (savedScrollY > 0) {
21177
- window.scrollTo(0, savedScrollY);
21178
- }
21179
- };
21180
- }, []);
21181
- const css2 = useCss((theme) => ({
21182
- body: {
21183
- width: "100%",
21184
- height: "100%",
21185
- overflowY: "auto",
21186
- padding: "24px",
21187
- boxSizing: "border-box"
21188
- },
21189
- list: {
21190
- display: "flex",
21191
- flexDirection: "column",
21192
- gap: "12px",
21193
- width: "100%",
21194
- maxWidth: "760px",
21195
- margin: "0 auto"
21196
- },
21197
- item: {
21198
- display: "flex",
21199
- flexDirection: "column",
21200
- gap: "4px",
21201
- padding: "12px",
21202
- borderColor: theme.color_fg_text,
21203
- borderStyle: "solid",
21204
- borderWidth: "1px",
21205
- borderRadius: "8px"
21206
- },
21207
- itemHeader: {
21208
- display: "flex",
21209
- justifyContent: "space-between",
21210
- alignItems: "center",
21211
- gap: "8px"
21212
- },
21213
- itemId: {
21214
- fontWeight: "bold",
21215
- wordBreak: "break-all"
21216
- },
21217
- itemMeta: {
21218
- fontSize: "13px",
21219
- color: theme.color_fg_text
21220
- },
21221
- itemMissing: {
21222
- fontSize: "13px",
21223
- color: theme.color_danger
21224
- },
21225
- removeButton: {
21226
- fontSize: "13px",
21227
- textDecoration: "underline"
21228
- },
21229
- empty: {
21230
- marginTop: "48px",
21231
- textAlign: "center"
21232
- }
21233
- }));
21234
- const overlayStyle = {
21235
- top: `${topOffset}px`,
21236
- left: 0,
21237
- right: 0,
21238
- bottom: 0,
21239
- backgroundColor: "transparent"
21240
- };
21241
- const contentStyle = {
21242
- position: "absolute",
21243
- inset: 0,
21244
- margin: 0,
21245
- padding: 0,
21246
- border: "none",
21247
- borderRadius: 0,
21248
- backgroundColor: "#FFFFFF",
21249
- overflow: "hidden"
21250
- };
21251
- return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose: closeOverlay, overlayStyle, contentStyle, children: /* @__PURE__ */ jsx$1("div", { css: css2.body, children: fittingRoom.length === 0 ? /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.empty, t: "fitting_room.empty" }) : /* @__PURE__ */ jsx$1("div", { css: css2.list, children: fittingRoom.map((item) => {
21252
- const hasVariant = item.size != null;
21253
- return /* @__PURE__ */ jsxs("div", { css: css2.item, children: [
21254
- /* @__PURE__ */ jsxs("div", { css: css2.itemHeader, children: [
21255
- /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemId, children: item.externalId }),
21256
- /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.removeButton, onClick: () => removeFromFittingRoom(item.externalId), children: t("fitting_room.remove") })
21257
- ] }),
21258
- hasVariant ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemMeta, children: [item.size, item.color].filter(Boolean).join(" / ") }) : /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.itemMissing, t: "fitting_room.size_not_chosen" })
21259
- ] }, item.externalId);
21260
- }) }) }) });
21261
- }
21262
- const Link = reactExports.forwardRef(({
21263
- children,
21264
- variant,
21265
- css: css2,
21266
- ...props
21267
- }, ref) => {
21268
- const variantCss = useVariantCss(variant, (theme) => ({
21269
- base: {
21270
- cursor: "pointer !important",
21271
- color: theme.color_fg_text,
21272
- fontFamily: theme.font_family,
21273
- fontSize: "14px",
21274
- textDecoration: "none"
21275
- },
21276
- brand: {
21277
- cursor: "pointer !important",
21278
- color: theme.color_fg_text,
21279
- fontFamily: theme.brand_font_family,
21280
- fontSize: "14px",
21281
- textDecoration: theme.brand_link_text_decoration
21282
- },
21283
- underline: {
21284
- cursor: "pointer !important",
21285
- color: theme.color_fg_text,
21286
- fontFamily: theme.font_family,
21287
- fontSize: "14px",
21288
- textDecoration: "underline"
21289
- },
21290
- semibold: {
21291
- cursor: "pointer !important",
21292
- color: theme.color_fg_text,
21293
- fontFamily: theme.font_family,
21294
- fontSize: "14px",
21295
- fontWeight: 600,
21296
- textDecoration: "none"
21297
- }
21298
- }));
21299
- return /* @__PURE__ */ jsx$1("a", { ref, css: [variantCss, css2, "", ""], ...props, children });
21300
- });
21301
- Link.displayName = "Link";
21302
- function LinkT({
21303
- t,
21304
- vars,
21305
- ...props
21306
- }) {
21307
- const {
21308
- t: translate
21309
- } = useTranslation();
21310
- const translatedText = translate(t, vars);
21311
- return /* @__PURE__ */ jsx$1(Link, { ...props, children: translatedText });
21312
- }
21313
21237
  var dayjs_min$1 = { exports: {} };
21314
21238
  var dayjs_min = dayjs_min$1.exports;
21315
21239
  var hasRequiredDayjs_min;
@@ -23073,7 +22997,7 @@ function isVersionServiceProvider(provider) {
23073
22997
  }
23074
22998
  const name$q = "@firebase/app";
23075
22999
  const version$1$1 = "0.14.5";
23076
- const logger$b = new Logger3("@firebase/app");
23000
+ const logger$g = new Logger3("@firebase/app");
23077
23001
  const name$p = "@firebase/app-compat";
23078
23002
  const name$o = "@firebase/analytics-compat";
23079
23003
  const name$n = "@firebase/analytics";
@@ -23140,13 +23064,13 @@ function _addComponent(app, component) {
23140
23064
  try {
23141
23065
  app.container.addComponent(component);
23142
23066
  } catch (e) {
23143
- logger$b.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
23067
+ logger$g.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
23144
23068
  }
23145
23069
  }
23146
23070
  function _registerComponent(component) {
23147
23071
  const componentName = component.name;
23148
23072
  if (_components.has(componentName)) {
23149
- logger$b.debug(`There were multiple attempts to register component ${componentName}.`);
23073
+ logger$g.debug(`There were multiple attempts to register component ${componentName}.`);
23150
23074
  return false;
23151
23075
  }
23152
23076
  _components.set(componentName, component);
@@ -23355,7 +23279,7 @@ function registerVersion(libraryKeyOrName, version2, variant) {
23355
23279
  if (versionMismatch) {
23356
23280
  warning.push(`version name "${version2}" contains illegal characters (whitespace or "/")`);
23357
23281
  }
23358
- logger$b.warn(warning.join(" "));
23282
+ logger$g.warn(warning.join(" "));
23359
23283
  return;
23360
23284
  }
23361
23285
  _registerComponent(new Component(
@@ -23399,12 +23323,12 @@ async function readHeartbeatsFromIndexedDB(app) {
23399
23323
  return result;
23400
23324
  } catch (e) {
23401
23325
  if (e instanceof FirebaseError) {
23402
- logger$b.warn(e.message);
23326
+ logger$g.warn(e.message);
23403
23327
  } else {
23404
23328
  const idbGetError = ERROR_FACTORY.create("idb-get", {
23405
23329
  originalErrorMessage: e?.message
23406
23330
  });
23407
- logger$b.warn(idbGetError.message);
23331
+ logger$g.warn(idbGetError.message);
23408
23332
  }
23409
23333
  }
23410
23334
  }
@@ -23417,12 +23341,12 @@ async function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
23417
23341
  await tx.done;
23418
23342
  } catch (e) {
23419
23343
  if (e instanceof FirebaseError) {
23420
- logger$b.warn(e.message);
23344
+ logger$g.warn(e.message);
23421
23345
  } else {
23422
23346
  const idbGetError = ERROR_FACTORY.create("idb-set", {
23423
23347
  originalErrorMessage: e?.message
23424
23348
  });
23425
- logger$b.warn(idbGetError.message);
23349
+ logger$g.warn(idbGetError.message);
23426
23350
  }
23427
23351
  }
23428
23352
  }
@@ -23471,7 +23395,7 @@ class HeartbeatServiceImpl {
23471
23395
  }
23472
23396
  return this._storage.overwrite(this._heartbeatsCache);
23473
23397
  } catch (e) {
23474
- logger$b.warn(e);
23398
+ logger$g.warn(e);
23475
23399
  }
23476
23400
  }
23477
23401
  /**
@@ -23502,7 +23426,7 @@ class HeartbeatServiceImpl {
23502
23426
  }
23503
23427
  return headerString;
23504
23428
  } catch (e) {
23505
- logger$b.warn(e);
23429
+ logger$g.warn(e);
23506
23430
  return "";
23507
23431
  }
23508
23432
  }
@@ -41070,7 +40994,7 @@ const firebaseDateToDayjs = (date) => {
41070
40994
  return dayjs(date.seconds * 1e3);
41071
40995
  };
41072
40996
  const LOGIN_TRACKING_PERIOD_SECONDS = 1800;
41073
- const logger$a = getLogger("firebase");
40997
+ const logger$f = getLogger("firebase");
41074
40998
  let firebaseApp = null;
41075
40999
  class FirestoreManager {
41076
41000
  constructor(firestore) {
@@ -41210,7 +41134,7 @@ class AuthManager {
41210
41134
  this.listenToUserProfileUnsub = null;
41211
41135
  }
41212
41136
  if (authUser) {
41213
- logger$a.logDebug("User logged in:", {
41137
+ logger$f.logDebug("User logged in:", {
41214
41138
  uid: authUser.uid
41215
41139
  });
41216
41140
  this.listenToUserProfileUnsub = getFirestoreManager().listenToDoc("users", authUser.uid, (doc2) => {
@@ -41244,7 +41168,7 @@ class AuthManager {
41244
41168
  await firestore.mergeDocData("user_logging", userLoggingDocId, userLoggingData);
41245
41169
  }
41246
41170
  } catch (error) {
41247
- logger$a.logError("Error logging user login activity:", {
41171
+ logger$f.logError("Error logging user login activity:", {
41248
41172
  error
41249
41173
  });
41250
41174
  }
@@ -41292,130 +41216,2329 @@ async function _init$4() {
41292
41216
  authManager = new AuthManager(auth, brandId);
41293
41217
  }
41294
41218
  }
41295
- const CONTACT_US_LINK = "mailto:info@thefittingroom.tech?subject=Forgot%20Password%20Assistance";
41296
- const logger$9 = getLogger("forgot-password");
41297
- function ForgotPasswordOverlay({
41298
- returnToOverlay
41299
- }) {
41219
+ let baseUrl;
41220
+ let responseCache = {};
41221
+ function _init$3() {
41300
41222
  const {
41301
- t
41302
- } = useTranslation();
41303
- const closeOverlay = useMainStore((state) => state.closeOverlay);
41304
- const openOverlay = useMainStore((state) => state.openOverlay);
41305
- const emailInputRef = reactExports.useRef(null);
41306
- const [emailError, setEmailError] = reactExports.useState(null);
41307
- const [linkSent, setLinkSent] = reactExports.useState(false);
41308
- const css2 = useCss((theme) => ({
41309
- titleText: {
41310
- fontSize: "20px"
41311
- },
41312
- form: {
41313
- width: "100%",
41314
- display: "flex",
41315
- flexDirection: "column",
41316
- gap: "0"
41317
- },
41318
- input: {
41319
- width: "100%",
41320
- padding: "12px 16px",
41321
- border: "1px solid #767676",
41322
- borderRadius: "8px",
41323
- fontSize: "16px"
41324
- },
41325
- inputError: {
41326
- border: `1px solid ${theme.color_danger}`
41327
- },
41328
- descriptionContainer: {
41329
- marginTop: "48px",
41330
- textAlign: "center"
41331
- },
41332
- linkSentContainer: {
41333
- marginTop: "48px",
41334
- height: "48px",
41335
- padding: "8px 16px",
41336
- boxShadow: "0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"
41337
- },
41338
- linkSentText: {
41339
- color: theme.color_tfr_800
41340
- },
41341
- emailContainer: {
41342
- marginTop: "48px"
41343
- },
41344
- emailErrorContainer: {
41345
- marginTop: "4px",
41346
- height: "18px"
41347
- },
41348
- submitButtonContainer: {
41349
- marginTop: "64px"
41350
- },
41351
- contactContainer: {
41352
- marginTop: "32px"
41353
- }
41354
- }));
41355
- const handleSubmit = reactExports.useCallback((event) => {
41356
- async function resetUserPassword(email2) {
41357
- try {
41358
- const authManager2 = getAuthManager();
41359
- await authManager2.sendPasswordResetEmail(email2);
41360
- setLinkSent(true);
41361
- } catch (error) {
41362
- logger$9.logError("Error sending password reset email:", {
41363
- error
41364
- });
41365
- }
41366
- }
41367
- event.preventDefault();
41368
- const formEl = event.target;
41369
- const emailEl = formEl.elements.namedItem("email");
41370
- let emailError2 = null;
41371
- if (!emailEl.validity.valid) {
41372
- emailError2 = t("sign-in.invalid_email");
41223
+ config
41224
+ } = getStaticData();
41225
+ baseUrl = config.api.baseUrl;
41226
+ useMainStore.subscribe((state, prevState) => {
41227
+ if (state.userIsLoggedIn !== prevState.userIsLoggedIn) {
41228
+ clearApiCache();
41373
41229
  }
41374
- setEmailError(emailError2);
41375
- if (emailError2) {
41376
- emailEl.focus();
41377
- return;
41230
+ });
41231
+ }
41232
+ function clearApiCache() {
41233
+ responseCache = {};
41234
+ }
41235
+ async function execApiRequest(params) {
41236
+ const authManager2 = getAuthManager();
41237
+ const {
41238
+ useCache,
41239
+ useToken,
41240
+ method,
41241
+ endpoint,
41242
+ body
41243
+ } = params;
41244
+ const url = `${baseUrl}${endpoint}`;
41245
+ if (useCache && responseCache[url]) {
41246
+ return responseCache[url];
41247
+ }
41248
+ const options = {
41249
+ method,
41250
+ headers: {
41251
+ "Content-Type": "application/json"
41378
41252
  }
41379
- const email = emailEl.value;
41380
- resetUserPassword(email);
41381
- }, [t]);
41382
- const handleBackToSignInClick = reactExports.useCallback(() => {
41383
- openOverlay(OverlayName.SIGN_IN, {
41384
- returnToOverlay
41385
- });
41386
- }, [returnToOverlay, openOverlay]);
41387
- const handleContactUsClick = reactExports.useCallback(() => {
41388
- window.open(CONTACT_US_LINK, "_blank");
41389
- }, []);
41390
- const titleNode = /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.titleText, t: "forgot-password.title" });
41391
- let descriptionNode;
41392
- if (linkSent) {
41393
- descriptionNode = /* @__PURE__ */ jsx$1("div", { css: css2.linkSentContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.linkSentText, t: "forgot-password.link_sent" }) });
41253
+ };
41254
+ if (useToken) {
41255
+ const token2 = await authManager2.getAuthToken();
41256
+ options.headers = {
41257
+ ...options.headers,
41258
+ Authorization: `Bearer ${token2}`
41259
+ };
41260
+ }
41261
+ if (body) {
41262
+ options.body = JSON.stringify(body);
41263
+ }
41264
+ const response = await fetch(url, options);
41265
+ if (!response.ok) {
41266
+ throw new Error(`API request failed with status ${response.status}`);
41267
+ }
41268
+ let data;
41269
+ if (response.status === 204) {
41270
+ data = {
41271
+ noResponse: true
41272
+ };
41394
41273
  } else {
41395
- descriptionNode = /* @__PURE__ */ jsx$1("div", { css: css2.descriptionContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "forgot-password.description" }) });
41274
+ data = await response.json();
41396
41275
  }
41397
- return /* @__PURE__ */ jsx$1(ContentModal, { onRequestClose: closeOverlay, title: titleNode, onBackClick: handleBackToSignInClick, children: /* @__PURE__ */ jsxs("form", { css: css2.form, onSubmit: handleSubmit, children: [
41398
- descriptionNode,
41399
- /* @__PURE__ */ jsx$1("div", { css: css2.emailContainer, children: /* @__PURE__ */ jsx$1("input", { name: "email", type: "email", required: true, placeholder: t("sign-in.email"), ref: emailInputRef, css: [css2.input, emailError ? css2.inputError : null, "", ""] }) }),
41400
- /* @__PURE__ */ jsx$1("div", { css: css2.emailErrorContainer, children: emailError && /* @__PURE__ */ jsx$1(Text, { variant: "error", children: emailError }) }),
41401
- /* @__PURE__ */ jsx$1("div", { css: css2.submitButtonContainer, children: /* @__PURE__ */ jsx$1(ButtonT, { type: "submit", variant: "primary", t: "forgot-password.send_link" }) }),
41402
- /* @__PURE__ */ jsxs("div", { css: css2.contactContainer, children: [
41403
- /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "forgot-password.need_help" }),
41404
- " ",
41405
- /* @__PURE__ */ jsx$1(LinkT, { variant: "semibold", t: "forgot-password.contact_us", onClick: handleContactUsClick })
41406
- ] })
41407
- ] }) });
41276
+ if (useCache) {
41277
+ responseCache[url] = data;
41278
+ }
41279
+ return data;
41408
41280
  }
41409
- function PoweredByFooter() {
41410
- const css2 = useCss((_theme) => ({
41411
- footer: {
41412
- position: "absolute",
41413
- bottom: "16px",
41414
- marginLeft: "auto",
41415
- marginRight: "auto",
41416
- textAlign: "center",
41417
- display: "flex",
41418
- alignItems: "center",
41281
+ async function getSizeRecommendation(styleId) {
41282
+ return await execApiRequest({
41283
+ useCache: true,
41284
+ useToken: true,
41285
+ method: "GET",
41286
+ endpoint: `/v1/styles/${styleId}/recommendation`
41287
+ });
41288
+ }
41289
+ async function getStyleCategories() {
41290
+ return await execApiRequest({
41291
+ useCache: true,
41292
+ useToken: true,
41293
+ method: "GET",
41294
+ endpoint: "/v1/style-categories"
41295
+ });
41296
+ }
41297
+ async function getStyleCategoryGroups() {
41298
+ return await execApiRequest({
41299
+ useCache: true,
41300
+ useToken: true,
41301
+ method: "GET",
41302
+ endpoint: "/v1/style-category-groups"
41303
+ });
41304
+ }
41305
+ async function requestVto(items) {
41306
+ return await execApiRequest({
41307
+ useToken: true,
41308
+ method: "POST",
41309
+ endpoint: "/v1/vto-compositions",
41310
+ body: {
41311
+ items
41312
+ }
41313
+ });
41314
+ }
41315
+ const recordCache = {};
41316
+ async function getStyleByExternalId(brandId, externalId) {
41317
+ const cacheKey = `getStyleByExternalId/${brandId}/${externalId}`;
41318
+ if (recordCache[cacheKey]) {
41319
+ return recordCache[cacheKey];
41320
+ }
41321
+ const firestore = getFirestoreManager();
41322
+ const querySnapshot = await firestore.queryDocs("styles", [where("brand_id", "==", brandId), where("external_id", "==", externalId)]);
41323
+ if (querySnapshot.empty) {
41324
+ return null;
41325
+ }
41326
+ const record = querySnapshot.docs[0].data();
41327
+ recordCache[cacheKey] = record;
41328
+ return record;
41329
+ }
41330
+ const logger$e = getLogger("product");
41331
+ function _init$2() {
41332
+ useMainStore.subscribe((state, prevState) => {
41333
+ if (state.userHasAvatar && !prevState.userHasAvatar) {
41334
+ const {
41335
+ currentProduct
41336
+ } = getStaticData();
41337
+ if (currentProduct) {
41338
+ loadProductDataToStore(currentProduct.externalId);
41339
+ }
41340
+ }
41341
+ });
41342
+ }
41343
+ async function loadProductData(externalId) {
41344
+ const {
41345
+ brandId
41346
+ } = getStaticData();
41347
+ const style = await getStyleByExternalId(brandId, externalId);
41348
+ if (!style) {
41349
+ throw new Error(`Style not found for externalId: ${externalId}`);
41350
+ }
41351
+ const sizeFitRecommendation = await getSizeRecommendation(style.id);
41352
+ return {
41353
+ externalId,
41354
+ style,
41355
+ sizeFitRecommendation
41356
+ };
41357
+ }
41358
+ function loadProductDataToStore(externalId) {
41359
+ async function loadAndStore() {
41360
+ try {
41361
+ const productData2 = await loadProductData(externalId);
41362
+ useMainStore.getState().setProductData(productData2.externalId, productData2);
41363
+ logger$e.logDebug(`Loaded product data for externalId: ${externalId}`, {
41364
+ productData: productData2
41365
+ });
41366
+ } catch (error) {
41367
+ logger$e.logError(`Error loading product data for externalId: ${externalId}`, {
41368
+ error
41369
+ });
41370
+ }
41371
+ }
41372
+ const {
41373
+ userIsLoggedIn,
41374
+ userHasAvatar,
41375
+ productData
41376
+ } = useMainStore.getState();
41377
+ if (productData[externalId] || !userIsLoggedIn || userHasAvatar === false) {
41378
+ return;
41379
+ }
41380
+ loadAndStore();
41381
+ }
41382
+ const logger$d = getLogger("style-categories");
41383
+ let cached = null;
41384
+ let inflight = null;
41385
+ function buildIndex(categories, groups) {
41386
+ const categoryMap = /* @__PURE__ */ new Map();
41387
+ for (const c of categories) {
41388
+ categoryMap.set(String(c.name), c);
41389
+ }
41390
+ const groupMap = /* @__PURE__ */ new Map();
41391
+ for (const g of groups) {
41392
+ groupMap.set(g.name, g);
41393
+ }
41394
+ return {
41395
+ byName(name2) {
41396
+ return categoryMap.get(name2) ?? null;
41397
+ },
41398
+ groupByName(name2) {
41399
+ return groupMap.get(name2) ?? null;
41400
+ },
41401
+ groupForCategory(categoryName) {
41402
+ const cat = categoryMap.get(categoryName);
41403
+ if (!cat) {
41404
+ return null;
41405
+ }
41406
+ return groupMap.get(cat.group) ?? null;
41407
+ },
41408
+ groupsInOrder() {
41409
+ return [...groups].sort((a, b) => a.display_order - b.display_order);
41410
+ },
41411
+ raw: {
41412
+ categories,
41413
+ groups
41414
+ }
41415
+ };
41416
+ }
41417
+ async function loadStyleCategoryIndex() {
41418
+ if (cached) {
41419
+ return cached;
41420
+ }
41421
+ if (inflight) {
41422
+ return inflight;
41423
+ }
41424
+ inflight = (async () => {
41425
+ try {
41426
+ logger$d.logDebug("{{ts}} - Loading style-category index");
41427
+ const [categories, groups] = await Promise.all([getStyleCategories(), getStyleCategoryGroups()]);
41428
+ cached = buildIndex(categories, groups);
41429
+ return cached;
41430
+ } finally {
41431
+ inflight = null;
41432
+ }
41433
+ })();
41434
+ return inflight;
41435
+ }
41436
+ function peekStyleCategoryIndex() {
41437
+ return cached;
41438
+ }
41439
+ const logger$c = getLogger("fitting-room-data");
41440
+ async function loadFittingRoomData() {
41441
+ const state = useMainStore.getState();
41442
+ const items = state.fittingRoom;
41443
+ loadStyleCategoryIndex().catch((error) => {
41444
+ logger$c.logError("Failed to load style-category index", {
41445
+ error
41446
+ });
41447
+ });
41448
+ for (const item of items) {
41449
+ loadProductDataToStore(item.externalId);
41450
+ }
41451
+ const {
41452
+ productLookup
41453
+ } = getStaticData();
41454
+ if (!productLookup) {
41455
+ for (const item of items) {
41456
+ if (state.merchantProductData[item.externalId]) continue;
41457
+ state.setMerchantProductData(item.externalId, {
41458
+ error: new Error("No productLookup callback configured")
41459
+ });
41460
+ }
41461
+ return;
41462
+ }
41463
+ const itemsNeedingLookup = items.filter((item) => !state.merchantProductData[item.externalId]);
41464
+ const itemsWithHandle = itemsNeedingLookup.filter((item) => !!item.handle);
41465
+ const itemsWithoutHandle = itemsNeedingLookup.filter((item) => !item.handle);
41466
+ for (const item of itemsWithoutHandle) {
41467
+ state.setMerchantProductData(item.externalId, {
41468
+ error: new Error("Item has no handle (legacy localStorage entry — re-add to refresh)")
41469
+ });
41470
+ }
41471
+ if (itemsWithHandle.length === 0) {
41472
+ return;
41473
+ }
41474
+ const handles = itemsWithHandle.map((item) => item.handle);
41475
+ try {
41476
+ const products = await productLookup(handles);
41477
+ const byExternalId = /* @__PURE__ */ new Map();
41478
+ for (const p of products) {
41479
+ byExternalId.set(p.externalId, p);
41480
+ }
41481
+ for (const item of itemsWithHandle) {
41482
+ const product = byExternalId.get(item.externalId);
41483
+ if (product) {
41484
+ state.setMerchantProductData(item.externalId, product);
41485
+ } else {
41486
+ state.setMerchantProductData(item.externalId, {
41487
+ error: new Error(`Product not found in merchant lookup (handle: ${item.handle})`)
41488
+ });
41489
+ }
41490
+ }
41491
+ } catch (error) {
41492
+ logger$c.logError("productLookup batch failed", {
41493
+ error,
41494
+ handles
41495
+ });
41496
+ const wrapped = error instanceof Error ? error : new Error(String(error));
41497
+ for (const item of itemsWithHandle) {
41498
+ state.setMerchantProductData(item.externalId, {
41499
+ error: wrapped
41500
+ });
41501
+ }
41502
+ }
41503
+ }
41504
+ function isMerchantError(value) {
41505
+ return !!value && "error" in value;
41506
+ }
41507
+ function isLoadedError(value) {
41508
+ return !!value && "error" in value;
41509
+ }
41510
+ function resolveItem(item, merchantSlot, loadedSlot, index) {
41511
+ const merchantProduct = merchantSlot && !isMerchantError(merchantSlot) ? merchantSlot : null;
41512
+ const merchantError = merchantSlot && isMerchantError(merchantSlot) ? merchantSlot.error : null;
41513
+ const loadedProduct = loadedSlot && !isLoadedError(loadedSlot) ? loadedSlot : null;
41514
+ const loadedError = loadedSlot && isLoadedError(loadedSlot) ? loadedSlot.error : null;
41515
+ let styleCategory = null;
41516
+ let styleCategoryGroup = null;
41517
+ if (loadedProduct && index) {
41518
+ const categoryName = String(loadedProduct.style.style_category_name);
41519
+ styleCategory = index.byName(categoryName);
41520
+ styleCategoryGroup = index.groupForCategory(categoryName);
41521
+ }
41522
+ let needsResize = item.colorwaySizeAssetId == null;
41523
+ if (!needsResize && loadedProduct && item.colorwaySizeAssetId != null) {
41524
+ const found = loadedProduct.sizeFitRecommendation.available_sizes.some((sz) => sz.colorway_size_assets.some((csa) => csa.id === item.colorwaySizeAssetId));
41525
+ if (!found) {
41526
+ needsResize = true;
41527
+ logger$c.logDebug("csa no longer in size rec, marking needsResize", {
41528
+ externalId: item.externalId,
41529
+ csa: item.colorwaySizeAssetId
41530
+ });
41531
+ }
41532
+ if (!needsResize && item.size) {
41533
+ const sizeStillExists = loadedProduct.sizeFitRecommendation.available_sizes.some((sz) => getSizeLabelFromSize(sz) === item.size);
41534
+ if (!sizeStillExists) {
41535
+ needsResize = true;
41536
+ }
41537
+ }
41538
+ }
41539
+ const isReady = !!merchantProduct && !!loadedProduct && !!styleCategory && !needsResize;
41540
+ return {
41541
+ externalId: item.externalId,
41542
+ storage: item,
41543
+ merchantProduct,
41544
+ merchantError,
41545
+ loadedProduct,
41546
+ loadedError,
41547
+ styleCategory,
41548
+ styleCategoryGroup,
41549
+ isReady,
41550
+ needsResize
41551
+ };
41552
+ }
41553
+ function useResolvedFittingRoom() {
41554
+ const fittingRoom = useMainStore((state) => state.fittingRoom);
41555
+ const productData = useMainStore((state) => state.productData);
41556
+ const merchantProductData = useMainStore((state) => state.merchantProductData);
41557
+ const [index, setIndex] = reactExports.useState(() => peekStyleCategoryIndex());
41558
+ const [styleCategoryError, setStyleCategoryError] = reactExports.useState(null);
41559
+ reactExports.useEffect(() => {
41560
+ let cancelled = false;
41561
+ loadStyleCategoryIndex().then((idx) => {
41562
+ if (!cancelled) {
41563
+ setIndex(idx);
41564
+ setStyleCategoryError(null);
41565
+ }
41566
+ }).catch((error) => {
41567
+ if (!cancelled) {
41568
+ setStyleCategoryError(error instanceof Error ? error : new Error(String(error)));
41569
+ }
41570
+ });
41571
+ return () => {
41572
+ cancelled = true;
41573
+ };
41574
+ }, []);
41575
+ reactExports.useEffect(() => {
41576
+ loadFittingRoomData().catch((error) => {
41577
+ logger$c.logError("loadFittingRoomData failed", {
41578
+ error
41579
+ });
41580
+ });
41581
+ }, [fittingRoom]);
41582
+ return reactExports.useMemo(() => {
41583
+ const items = fittingRoom.map((item) => resolveItem(item, merchantProductData[item.externalId], productData[item.externalId], index));
41584
+ const isLoading = !index || items.some((i) => !i.merchantProduct && !i.merchantError || !i.loadedProduct && !i.loadedError);
41585
+ const groups = [];
41586
+ const ungrouped = [];
41587
+ if (index) {
41588
+ const groupBuckets = /* @__PURE__ */ new Map();
41589
+ for (const item of items) {
41590
+ if (item.styleCategoryGroup) {
41591
+ const key = item.styleCategoryGroup.name;
41592
+ let bucket = groupBuckets.get(key);
41593
+ if (!bucket) {
41594
+ bucket = [];
41595
+ groupBuckets.set(key, bucket);
41596
+ }
41597
+ bucket.push(item);
41598
+ } else {
41599
+ ungrouped.push(item);
41600
+ }
41601
+ }
41602
+ for (const group of index.groupsInOrder()) {
41603
+ const bucket = groupBuckets.get(group.name);
41604
+ if (bucket && bucket.length > 0) {
41605
+ groups.push({
41606
+ group,
41607
+ items: bucket
41608
+ });
41609
+ }
41610
+ }
41611
+ } else {
41612
+ ungrouped.push(...items);
41613
+ }
41614
+ return {
41615
+ items,
41616
+ groups,
41617
+ ungrouped,
41618
+ isLoading,
41619
+ styleCategoryError
41620
+ };
41621
+ }, [fittingRoom, productData, merchantProductData, index, styleCategoryError]);
41622
+ }
41623
+ function useMobileSheetSnap(initial = "collapsed") {
41624
+ const [snap, setSnap] = reactExports.useState(initial);
41625
+ const handleTouchStart = reactExports.useCallback((e) => {
41626
+ const startY = e.touches[0].clientY;
41627
+ const initialSnap = snap;
41628
+ const onTouchMove = (moveEvent) => {
41629
+ const deltaY = moveEvent.touches[0].clientY - startY;
41630
+ if (Math.abs(deltaY) < 30) return;
41631
+ if (deltaY > 0) {
41632
+ if (initialSnap === "full" || initialSnap === "expanded") {
41633
+ setSnap("collapsed");
41634
+ }
41635
+ } else {
41636
+ if (initialSnap === "collapsed") {
41637
+ setSnap("expanded");
41638
+ } else if (initialSnap === "expanded") {
41639
+ setSnap("full");
41640
+ }
41641
+ }
41642
+ document.removeEventListener("touchmove", onTouchMove);
41643
+ };
41644
+ document.addEventListener("touchmove", onTouchMove);
41645
+ const onTouchEnd = () => {
41646
+ document.removeEventListener("touchmove", onTouchMove);
41647
+ document.removeEventListener("touchend", onTouchEnd);
41648
+ };
41649
+ document.addEventListener("touchend", onTouchEnd);
41650
+ }, [snap]);
41651
+ return {
41652
+ snap,
41653
+ setSnap,
41654
+ handleTouchStart
41655
+ };
41656
+ }
41657
+ const MAX_OUTFIT_ITEMS = 4;
41658
+ function asStringList(value) {
41659
+ if (!Array.isArray(value)) return [];
41660
+ const out = [];
41661
+ for (const v of value) {
41662
+ if (typeof v === "string") out.push(v);
41663
+ else if (v != null) out.push(String(v));
41664
+ }
41665
+ return out;
41666
+ }
41667
+ function catName(c) {
41668
+ return String(c.name);
41669
+ }
41670
+ function pairCompatible(a, b, group) {
41671
+ const aName = catName(a);
41672
+ const bName = catName(b);
41673
+ const aIncl = asStringList(a.includes);
41674
+ const aExcl = asStringList(a.excludes);
41675
+ const bIncl = asStringList(b.includes);
41676
+ const bExcl = asStringList(b.excludes);
41677
+ if (aExcl.includes(bName) || bExcl.includes(aName)) {
41678
+ return false;
41679
+ }
41680
+ if (a.group !== b.group) {
41681
+ return true;
41682
+ }
41683
+ const sameGroupDefault = group?.same_group_default ?? "exclusive";
41684
+ if (sameGroupDefault === "compatible") {
41685
+ return true;
41686
+ }
41687
+ if (aName === bName) {
41688
+ return false;
41689
+ }
41690
+ return aIncl.includes(bName) || bIncl.includes(aName);
41691
+ }
41692
+ function computeAvailability(item, selectedExternalIds, resolved) {
41693
+ if (selectedExternalIds.has(item.externalId)) {
41694
+ return "selected";
41695
+ }
41696
+ if (selectedExternalIds.size >= MAX_OUTFIT_ITEMS) {
41697
+ return "disabled";
41698
+ }
41699
+ if (!item.styleCategory) {
41700
+ return "disabled";
41701
+ }
41702
+ const itemCat = item.styleCategory;
41703
+ for (const sel of resolved.items) {
41704
+ if (!selectedExternalIds.has(sel.externalId)) continue;
41705
+ if (!sel.styleCategory) continue;
41706
+ if (!pairCompatible(sel.styleCategory, itemCat, sel.styleCategoryGroup)) {
41707
+ return "disabled";
41708
+ }
41709
+ }
41710
+ return "available";
41711
+ }
41712
+ function makeOutfitItem(r, forceUntuck) {
41713
+ if (!r.styleCategory) return null;
41714
+ if (r.storage.colorwaySizeAssetId == null) return null;
41715
+ const tuckable = !!r.styleCategory.tuckable;
41716
+ const untucked = forceUntuck && tuckable;
41717
+ const layerOrder = untucked ? r.styleCategory.layer_order_untucked : r.styleCategory.layer_order;
41718
+ const outfitItem = {
41719
+ externalId: r.externalId,
41720
+ colorwaySizeAssetId: r.storage.colorwaySizeAssetId,
41721
+ ...untucked ? {
41722
+ untucked: true
41723
+ } : {}
41724
+ };
41725
+ return {
41726
+ outfitItem,
41727
+ layerOrder
41728
+ };
41729
+ }
41730
+ function buildOutfit(selectedExternalIds, resolved, forceUntuck, lastAddedExternalId) {
41731
+ const entries = [];
41732
+ let lastAddedResolved = null;
41733
+ for (const r of resolved.items) {
41734
+ if (!selectedExternalIds.has(r.externalId)) continue;
41735
+ if (r.externalId === lastAddedExternalId) lastAddedResolved = r;
41736
+ const entry = makeOutfitItem(r, forceUntuck);
41737
+ if (entry) entries.push(entry);
41738
+ }
41739
+ entries.sort((a, b) => a.layerOrder - b.layerOrder);
41740
+ const items = entries.slice(0, MAX_OUTFIT_ITEMS).map((e) => e.outfitItem);
41741
+ const alternates = buildAlternateOutfits(items, lastAddedResolved);
41742
+ return {
41743
+ items,
41744
+ alternates
41745
+ };
41746
+ }
41747
+ function buildAlternateOutfits(primary, lastAddedResolved) {
41748
+ if (!lastAddedResolved || !lastAddedResolved.loadedProduct) return [];
41749
+ const currentCsaId = lastAddedResolved.storage.colorwaySizeAssetId;
41750
+ if (currentCsaId == null) return [];
41751
+ if (!primary.some((i) => i.externalId === lastAddedResolved.externalId)) return [];
41752
+ const sizeRec = lastAddedResolved.loadedProduct.sizeFitRecommendation;
41753
+ let currentColorwayId = null;
41754
+ for (const sz of sizeRec.available_sizes) {
41755
+ const found = sz.colorway_size_assets.find((c) => c.id === currentCsaId);
41756
+ if (found) {
41757
+ currentColorwayId = found.colorway_id;
41758
+ break;
41759
+ }
41760
+ }
41761
+ const out = [];
41762
+ for (const sz of sizeRec.available_sizes) {
41763
+ const altCsa = sz.colorway_size_assets.find((c) => c.id !== currentCsaId && (currentColorwayId == null || c.colorway_id === currentColorwayId));
41764
+ if (!altCsa) continue;
41765
+ const alternate = primary.map((it) => it.externalId === lastAddedResolved.externalId ? {
41766
+ ...it,
41767
+ colorwaySizeAssetId: altCsa.id
41768
+ } : it);
41769
+ out.push(alternate);
41770
+ }
41771
+ return out;
41772
+ }
41773
+ function AvatarControls({
41774
+ selectedItems,
41775
+ hasTuckable,
41776
+ forceUntuck,
41777
+ zoomed,
41778
+ onToggleUntuck,
41779
+ onToggleZoom,
41780
+ onRemoveItem
41781
+ }) {
41782
+ const {
41783
+ t
41784
+ } = useTranslation();
41785
+ const [popoverOpen, setPopoverOpen] = reactExports.useState(false);
41786
+ const popoverWrapperRef = reactExports.useRef(null);
41787
+ reactExports.useEffect(() => {
41788
+ if (!popoverOpen) return;
41789
+ const onDocClick = (e) => {
41790
+ if (popoverWrapperRef.current && !popoverWrapperRef.current.contains(e.target)) {
41791
+ setPopoverOpen(false);
41792
+ }
41793
+ };
41794
+ document.addEventListener("mousedown", onDocClick);
41795
+ return () => document.removeEventListener("mousedown", onDocClick);
41796
+ }, [popoverOpen]);
41797
+ const handleTogglePopover = reactExports.useCallback(() => {
41798
+ setPopoverOpen((open) => !open);
41799
+ }, []);
41800
+ const css2 = useCss((theme) => ({
41801
+ wrapper: {
41802
+ position: "absolute",
41803
+ right: "16px",
41804
+ bottom: "16px",
41805
+ display: "flex",
41806
+ flexDirection: "column",
41807
+ gap: "8px",
41808
+ alignItems: "flex-end"
41809
+ },
41810
+ pill: {
41811
+ display: "inline-flex",
41812
+ alignItems: "center",
41813
+ gap: "8px",
41814
+ padding: "8px 16px",
41815
+ borderRadius: "24px",
41816
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
41817
+ border: `1px solid ${theme.color_fg_text}`,
41818
+ fontSize: "12px",
41819
+ fontWeight: "500",
41820
+ letterSpacing: "0.5px",
41821
+ textTransform: "uppercase",
41822
+ cursor: "pointer",
41823
+ userSelect: "none",
41824
+ WebkitUserSelect: "none"
41825
+ },
41826
+ pillIcon: {
41827
+ width: "14px",
41828
+ height: "14px",
41829
+ flex: "none"
41830
+ },
41831
+ popover: {
41832
+ position: "absolute",
41833
+ bottom: "calc(100% + 8px)",
41834
+ right: 0,
41835
+ width: "280px",
41836
+ maxHeight: "320px",
41837
+ overflowY: "auto",
41838
+ backgroundColor: "#FFFFFF",
41839
+ border: `1px solid ${theme.color_fg_text}`,
41840
+ borderRadius: "8px",
41841
+ padding: "8px",
41842
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)",
41843
+ display: "flex",
41844
+ flexDirection: "column",
41845
+ gap: "4px"
41846
+ },
41847
+ popoverRow: {
41848
+ display: "flex",
41849
+ alignItems: "center",
41850
+ gap: "8px",
41851
+ padding: "6px"
41852
+ },
41853
+ popoverThumb: {
41854
+ width: "40px",
41855
+ height: "52px",
41856
+ backgroundColor: "#F4F4F4",
41857
+ flex: "none",
41858
+ objectFit: "cover"
41859
+ },
41860
+ popoverLabel: {
41861
+ flex: 1,
41862
+ fontSize: "12px"
41863
+ },
41864
+ popoverRemove: {
41865
+ width: "24px",
41866
+ height: "24px",
41867
+ borderRadius: "12px",
41868
+ border: "none",
41869
+ backgroundColor: "transparent",
41870
+ cursor: "pointer",
41871
+ fontSize: "14px"
41872
+ }
41873
+ }));
41874
+ const seePill = /* @__PURE__ */ jsxs("div", { ref: popoverWrapperRef, style: {
41875
+ position: "relative"
41876
+ }, children: [
41877
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.pill, onClick: handleTogglePopover, children: [
41878
+ /* @__PURE__ */ jsx$1(SvgIconSelectedItems, { css: css2.pillIcon }),
41879
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", children: t("fitting_room.see_selected_items") })
41880
+ ] }),
41881
+ 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: [
41882
+ item.merchantProduct?.imageUrl ? /* @__PURE__ */ jsx$1("img", { src: item.merchantProduct.imageUrl, css: css2.popoverThumb, alt: "" }) : /* @__PURE__ */ jsx$1("div", { css: css2.popoverThumb }),
41883
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.popoverLabel, children: item.merchantProduct?.productName ?? item.externalId }),
41884
+ /* @__PURE__ */ jsx$1("button", { css: css2.popoverRemove, onClick: () => onRemoveItem(item.externalId), "aria-label": "Remove", children: "×" })
41885
+ ] }, item.externalId)) }) : null
41886
+ ] });
41887
+ return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, children: [
41888
+ seePill,
41889
+ hasTuckable ? /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.pill, onClick: onToggleUntuck, children: [
41890
+ /* @__PURE__ */ jsx$1(SvgInfoIcon, { css: css2.pillIcon }),
41891
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", children: t(forceUntuck ? "fitting_room.tuck_in" : "fitting_room.untuck") })
41892
+ ] }) : null,
41893
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.pill, onClick: onToggleZoom, children: [
41894
+ /* @__PURE__ */ jsx$1(SvgIconZoom, { css: css2.pillIcon }),
41895
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", children: t(zoomed ? "fitting_room.zoom_out" : "fitting_room.zoom_in") })
41896
+ ] })
41897
+ ] });
41898
+ }
41899
+ function AvatarFrameViewer({
41900
+ frameUrls,
41901
+ selectedFrameIndex,
41902
+ setSelectedFrameIndex,
41903
+ imageContainerStyle,
41904
+ imageStyle,
41905
+ loadingT = "vto-single.avatar_loading"
41906
+ }) {
41907
+ const css2 = useCss((_theme) => ({
41908
+ imageContainer: {
41909
+ position: "absolute"
41910
+ },
41911
+ image: {
41912
+ objectFit: "contain",
41913
+ cursor: "grab"
41914
+ },
41915
+ chevronLeftContainer: {
41916
+ position: "absolute",
41917
+ top: "50%",
41918
+ left: "0",
41919
+ transform: "translateY(-50%)",
41920
+ cursor: "pointer"
41921
+ },
41922
+ chevronRightContainer: {
41923
+ position: "absolute",
41924
+ top: "50%",
41925
+ right: "0",
41926
+ transform: "translateY(-50%)",
41927
+ cursor: "pointer"
41928
+ },
41929
+ chevronIcon: {
41930
+ width: "48px",
41931
+ height: "48px"
41932
+ }
41933
+ }));
41934
+ reactExports.useEffect(() => {
41935
+ if (!frameUrls || frameUrls.length === 0 || selectedFrameIndex != null) {
41936
+ return;
41937
+ }
41938
+ let currentFrameIndex = 0;
41939
+ setSelectedFrameIndex(currentFrameIndex);
41940
+ const intervalId = setInterval(() => {
41941
+ currentFrameIndex = (currentFrameIndex + 1) % frameUrls.length;
41942
+ setSelectedFrameIndex(currentFrameIndex);
41943
+ if (currentFrameIndex === 0) {
41944
+ clearInterval(intervalId);
41945
+ }
41946
+ }, 500);
41947
+ return () => clearInterval(intervalId);
41948
+ }, [frameUrls, selectedFrameIndex, setSelectedFrameIndex]);
41949
+ const rotateLeft = reactExports.useCallback(() => {
41950
+ setSelectedFrameIndex((prevIndex) => {
41951
+ if (prevIndex == null) return null;
41952
+ return prevIndex === 0 ? frameUrls ? frameUrls.length - 1 : 0 : prevIndex - 1;
41953
+ });
41954
+ }, [frameUrls, setSelectedFrameIndex]);
41955
+ const rotateRight = reactExports.useCallback(() => {
41956
+ setSelectedFrameIndex((prevIndex) => {
41957
+ if (prevIndex == null) return null;
41958
+ return prevIndex === (frameUrls ? frameUrls.length - 1 : 0) ? 0 : prevIndex + 1;
41959
+ });
41960
+ }, [frameUrls, setSelectedFrameIndex]);
41961
+ const handleImageMouseDrag = reactExports.useCallback((e) => {
41962
+ e.preventDefault();
41963
+ let startX = e.clientX;
41964
+ const onMouseMove = (moveEvent) => {
41965
+ const deltaX = moveEvent.clientX - startX;
41966
+ if (Math.abs(deltaX) >= 50) {
41967
+ if (deltaX > 0) rotateRight();
41968
+ else rotateLeft();
41969
+ startX = moveEvent.clientX;
41970
+ }
41971
+ };
41972
+ const onMouseUp = () => {
41973
+ window.removeEventListener("mousemove", onMouseMove);
41974
+ window.removeEventListener("mouseup", onMouseUp);
41975
+ };
41976
+ window.addEventListener("mousemove", onMouseMove);
41977
+ window.addEventListener("mouseup", onMouseUp);
41978
+ }, [rotateLeft, rotateRight]);
41979
+ const handleImageTouchDrag = reactExports.useCallback((e) => {
41980
+ e.preventDefault();
41981
+ let startX = e.touches[0].clientX;
41982
+ const onTouchMove = (moveEvent) => {
41983
+ const deltaX = moveEvent.touches[0].clientX - startX;
41984
+ if (Math.abs(deltaX) >= 50) {
41985
+ if (deltaX > 0) rotateRight();
41986
+ else rotateLeft();
41987
+ startX = moveEvent.touches[0].clientX;
41988
+ }
41989
+ };
41990
+ const onTouchEnd = () => {
41991
+ window.removeEventListener("touchmove", onTouchMove);
41992
+ window.removeEventListener("touchend", onTouchEnd);
41993
+ };
41994
+ window.addEventListener("touchmove", onTouchMove);
41995
+ window.addEventListener("touchend", onTouchEnd);
41996
+ }, [rotateLeft, rotateRight]);
41997
+ if (!frameUrls || selectedFrameIndex == null) {
41998
+ return /* @__PURE__ */ jsx$1(Loading, { t: loadingT });
41999
+ }
42000
+ return /* @__PURE__ */ jsxs("div", { css: css2.imageContainer, style: imageContainerStyle, children: [
42001
+ /* @__PURE__ */ jsx$1("img", { src: frameUrls[selectedFrameIndex], css: css2.image, style: imageStyle, onMouseDown: handleImageMouseDrag, onTouchStart: handleImageTouchDrag }),
42002
+ /* @__PURE__ */ jsx$1("div", { css: css2.chevronLeftContainer, onClick: rotateLeft, children: /* @__PURE__ */ jsx$1(SvgChevronLeft, { css: css2.chevronIcon }) }),
42003
+ /* @__PURE__ */ jsx$1("div", { css: css2.chevronRightContainer, onClick: rotateRight, children: /* @__PURE__ */ jsx$1(SvgChevronRight, { css: css2.chevronIcon }) })
42004
+ ] });
42005
+ }
42006
+ function AvatarPane({
42007
+ frameUrls,
42008
+ hasSelection,
42009
+ controls
42010
+ }) {
42011
+ const [selectedFrameIndex, setSelectedFrameIndex] = reactExports.useState(null);
42012
+ const css2 = useCss((theme) => ({
42013
+ container: {
42014
+ width: "100%",
42015
+ height: "100%",
42016
+ display: "flex",
42017
+ alignItems: "center",
42018
+ justifyContent: "center",
42019
+ backgroundColor: "#FAFAFA",
42020
+ color: theme.color_fg_text,
42021
+ fontSize: "14px",
42022
+ position: "relative"
42023
+ },
42024
+ placeholder: {
42025
+ padding: "32px",
42026
+ textAlign: "center"
42027
+ },
42028
+ frameSlot: {
42029
+ position: "relative",
42030
+ width: "100%",
42031
+ height: "100%"
42032
+ },
42033
+ frameContainer: {
42034
+ position: "absolute",
42035
+ inset: 0
42036
+ },
42037
+ frameImage: {
42038
+ width: "100%",
42039
+ height: "100%"
42040
+ }
42041
+ }));
42042
+ if (frameUrls && frameUrls.length > 0) {
42043
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42044
+ /* @__PURE__ */ jsx$1("div", { css: css2.frameSlot, children: /* @__PURE__ */ jsx$1(AvatarFrameViewer, { frameUrls, selectedFrameIndex, setSelectedFrameIndex, imageContainerStyle: css2.frameContainer, imageStyle: css2.frameImage, loadingT: "vto-single.avatar_loading" }) }),
42045
+ controls
42046
+ ] });
42047
+ }
42048
+ if (hasSelection) {
42049
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42050
+ /* @__PURE__ */ jsx$1(Loading, { t: "vto-single.avatar_loading" }),
42051
+ controls
42052
+ ] });
42053
+ }
42054
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42055
+ /* @__PURE__ */ jsx$1("div", { css: css2.placeholder, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "fitting_room.avatar_placeholder_empty" }) }),
42056
+ controls
42057
+ ] });
42058
+ }
42059
+ function ProductCard({
42060
+ item,
42061
+ availability,
42062
+ onClick,
42063
+ onRemove
42064
+ }) {
42065
+ const css2 = useCss((theme) => ({
42066
+ container: {
42067
+ position: "relative",
42068
+ width: "160px",
42069
+ flex: "none",
42070
+ display: "flex",
42071
+ flexDirection: "column",
42072
+ gap: "8px",
42073
+ padding: "8px",
42074
+ border: "1px solid transparent",
42075
+ backgroundColor: "transparent",
42076
+ textAlign: "left"
42077
+ },
42078
+ containerSelected: {
42079
+ border: `1px solid ${theme.color_fg_text}`
42080
+ },
42081
+ containerDisabled: {
42082
+ opacity: 0.35
42083
+ },
42084
+ cardBody: {
42085
+ width: "100%",
42086
+ display: "flex",
42087
+ flexDirection: "column",
42088
+ gap: "8px",
42089
+ background: "none",
42090
+ border: "none",
42091
+ padding: 0,
42092
+ textAlign: "left",
42093
+ cursor: "pointer",
42094
+ fontFamily: theme.font_family
42095
+ },
42096
+ cardBodyDisabled: {
42097
+ cursor: "not-allowed"
42098
+ },
42099
+ imageContainer: {
42100
+ width: "100%",
42101
+ aspectRatio: "3 / 4",
42102
+ backgroundColor: "#F4F4F4",
42103
+ overflow: "hidden"
42104
+ },
42105
+ image: {
42106
+ width: "100%",
42107
+ height: "100%",
42108
+ objectFit: "cover"
42109
+ },
42110
+ nameText: {
42111
+ fontSize: "13px",
42112
+ lineHeight: "1.3"
42113
+ },
42114
+ priceText: {
42115
+ fontSize: "12px",
42116
+ color: theme.color_fg_text
42117
+ },
42118
+ removeButton: {
42119
+ position: "absolute",
42120
+ top: "4px",
42121
+ right: "4px",
42122
+ width: "24px",
42123
+ height: "24px",
42124
+ borderRadius: "12px",
42125
+ border: "none",
42126
+ backgroundColor: "rgba(255, 255, 255, 0.85)",
42127
+ display: "flex",
42128
+ alignItems: "center",
42129
+ justifyContent: "center",
42130
+ cursor: "pointer",
42131
+ padding: 0,
42132
+ zIndex: 1
42133
+ },
42134
+ removeIcon: {
42135
+ width: "12px",
42136
+ height: "12px"
42137
+ }
42138
+ }));
42139
+ const disabled = availability === "disabled";
42140
+ const selected = availability === "selected";
42141
+ const handleClick = () => {
42142
+ if (disabled) return;
42143
+ onClick();
42144
+ };
42145
+ const name2 = item.merchantProduct?.productName ?? item.externalId;
42146
+ const imageUrl = item.merchantProduct?.imageUrl ?? null;
42147
+ const price = item.merchantProduct?.variants[0]?.priceFormatted ?? null;
42148
+ return /* @__PURE__ */ jsxs("div", { css: /* @__PURE__ */ css$1({
42149
+ ...css2.container,
42150
+ ...selected && css2.containerSelected,
42151
+ ...disabled && css2.containerDisabled
42152
+ }, "", ""), children: [
42153
+ /* @__PURE__ */ jsx$1("button", { css: css2.removeButton, onClick: (e) => {
42154
+ e.stopPropagation();
42155
+ onRemove();
42156
+ }, "aria-label": "Remove from fitting room", children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.removeIcon }) }),
42157
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: /* @__PURE__ */ css$1({
42158
+ ...css2.cardBody,
42159
+ ...disabled && css2.cardBodyDisabled
42160
+ }, "", ""), onClick: handleClick, disabled, children: [
42161
+ /* @__PURE__ */ jsx$1("div", { css: css2.imageContainer, children: imageUrl ? /* @__PURE__ */ jsx$1("img", { src: imageUrl, css: css2.image, alt: name2 }) : null }),
42162
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.nameText, children: name2 }),
42163
+ price ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.priceText, children: price }) : null
42164
+ ] })
42165
+ ] });
42166
+ }
42167
+ function CardRail({
42168
+ group,
42169
+ availabilityByExternalId,
42170
+ onSelectItem,
42171
+ onRemoveItem,
42172
+ layout
42173
+ }) {
42174
+ const [collapsed, setCollapsed] = reactExports.useState(false);
42175
+ const css2 = useCss((theme) => ({
42176
+ container: {
42177
+ display: "flex",
42178
+ flexDirection: "column",
42179
+ gap: "8px"
42180
+ },
42181
+ header: {
42182
+ display: "flex",
42183
+ alignItems: "center",
42184
+ justifyContent: "space-between",
42185
+ padding: "8px 0",
42186
+ borderBottom: `1px solid ${theme.color_fg_text}`
42187
+ },
42188
+ headerLabel: {
42189
+ fontSize: "12px",
42190
+ fontWeight: "600",
42191
+ letterSpacing: "0.5px",
42192
+ textTransform: "uppercase"
42193
+ },
42194
+ chevron: {
42195
+ fontSize: "12px"
42196
+ },
42197
+ horizontal: {
42198
+ display: "flex",
42199
+ flexDirection: "row",
42200
+ gap: "8px",
42201
+ overflowX: "auto",
42202
+ padding: "4px 0"
42203
+ },
42204
+ grid: {
42205
+ display: "grid",
42206
+ gridTemplateColumns: "repeat(2, 1fr)",
42207
+ gap: "8px",
42208
+ padding: "4px 0"
42209
+ }
42210
+ }));
42211
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42212
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.header, onClick: () => setCollapsed((c) => !c), children: [
42213
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.headerLabel, children: group.group.label }),
42214
+ /* @__PURE__ */ jsx$1("span", { css: css2.chevron, children: collapsed ? "⌄" : "⌃" })
42215
+ ] }),
42216
+ collapsed ? null : /* @__PURE__ */ jsx$1("div", { css: layout === "horizontal" ? css2.horizontal : css2.grid, children: group.items.map((item) => /* @__PURE__ */ jsx$1(ProductCard, { item, availability: availabilityByExternalId[item.externalId] ?? "disabled", onClick: () => onSelectItem(item.externalId), onRemove: () => onRemoveItem(item.externalId) }, item.externalId)) })
42217
+ ] });
42218
+ }
42219
+ function AddToCartButton({
42220
+ onClick
42221
+ }) {
42222
+ return /* @__PURE__ */ jsx$1(ButtonT, { variant: "brand", t: "vto-single.add_to_cart", onClick });
42223
+ }
42224
+ function ItemFitDetails({
42225
+ loadedProductData,
42226
+ selectedSizeLabel
42227
+ }) {
42228
+ const {
42229
+ t
42230
+ } = useTranslation();
42231
+ const css2 = useCss((_theme) => ({
42232
+ container: {
42233
+ width: "100%"
42234
+ },
42235
+ line: {
42236
+ display: "flex",
42237
+ justifyContent: "space-between",
42238
+ alignItems: "center",
42239
+ gap: "8px",
42240
+ marginTop: "4px",
42241
+ borderTop: "1px solid rgb(33, 32, 31)",
42242
+ paddingTop: "4px"
42243
+ },
42244
+ firstLine: {
42245
+ borderTop: "none",
42246
+ marginTop: "0px",
42247
+ paddingTop: "0px"
42248
+ },
42249
+ detailCell: {
42250
+ display: "flex",
42251
+ alignItems: "center",
42252
+ gap: "6px"
42253
+ }
42254
+ }));
42255
+ const fitLineNodeList = reactExports.useMemo(() => {
42256
+ const selectedSizeRecord = loadedProductData.sizes.find((s) => s.sizeLabel === selectedSizeLabel);
42257
+ if (!selectedSizeRecord) {
42258
+ return null;
42259
+ }
42260
+ return selectedSizeRecord.fit.measurement_location_fits.map((mlf, index) => {
42261
+ const locationLabel = t(`size-rec.measurementLocation.${mlf.measurement_location}`) || mlf.measurement_location;
42262
+ const fit = mlf.fit;
42263
+ const fitLabel = t(`size-rec.fit.${fit}`) || fit;
42264
+ return /* @__PURE__ */ jsxs("div", { css: [css2.line, index === 0 && css2.firstLine, "", ""], children: [
42265
+ /* @__PURE__ */ jsx$1("div", { css: css2.detailCell, children: locationLabel }),
42266
+ /* @__PURE__ */ jsx$1("div", { css: css2.detailCell, children: fit === "perfect_fit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
42267
+ /* @__PURE__ */ jsx$1(SvgCheckCircle, {}),
42268
+ " ",
42269
+ fitLabel
42270
+ ] }) : fitLabel })
42271
+ ] }, index);
42272
+ });
42273
+ }, [loadedProductData, selectedSizeLabel]);
42274
+ return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: fitLineNodeList });
42275
+ }
42276
+ function ItemFitText({
42277
+ loadedProductData,
42278
+ textCss
42279
+ }) {
42280
+ const {
42281
+ t
42282
+ } = useTranslation();
42283
+ return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: textCss, t: "size-rec.item_fit", vars: {
42284
+ fit: t(`size-rec.fitClassification.${loadedProductData.fitClassification}`) || loadedProductData.fitClassification
42285
+ } });
42286
+ }
42287
+ function SizeSelector({
42288
+ loadedProductData,
42289
+ selectedSizeLabel,
42290
+ onChangeSize
42291
+ }) {
42292
+ const css2 = useCss((_theme) => ({
42293
+ container: {
42294
+ display: "flex",
42295
+ alignItems: "center",
42296
+ gap: "12px"
42297
+ },
42298
+ button: {
42299
+ width: "54px",
42300
+ height: "44px",
42301
+ border: "1px solid rgba(33, 32, 31, 0.2)",
42302
+ padding: "9px 5px"
42303
+ },
42304
+ selectedButton: {
42305
+ border: "1px solid rgb(33, 32, 31)",
42306
+ cursor: "default"
42307
+ }
42308
+ }));
42309
+ const sizeSelectorNodeList = reactExports.useMemo(() => loadedProductData.sizes.map((sizeRecord) => {
42310
+ const isSelected = sizeRecord.sizeLabel === selectedSizeLabel;
42311
+ return /* @__PURE__ */ jsx$1(Button, { variant: "base", css: /* @__PURE__ */ css$1({
42312
+ ...css2.button,
42313
+ ...isSelected && css2.selectedButton
42314
+ }, "", ""), onClick: () => {
42315
+ if (isSelected) {
42316
+ return;
42317
+ }
42318
+ onChangeSize(sizeRecord.sizeLabel);
42319
+ }, children: sizeRecord.sizeLabel }, sizeRecord.sizeLabel);
42320
+ }), [loadedProductData.sizes, selectedSizeLabel, onChangeSize]);
42321
+ return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: sizeSelectorNodeList });
42322
+ }
42323
+ const logger$b = getLogger("overlays/fitting-room/product-data");
42324
+ function buildVtoProductDataFromResolved(item) {
42325
+ const {
42326
+ merchantProduct,
42327
+ loadedProduct
42328
+ } = item;
42329
+ if (!merchantProduct || !loadedProduct) return null;
42330
+ const sizeRec = loadedProduct.sizeFitRecommendation;
42331
+ const recommendedSizeId = sizeRec.recommended_size.id || null;
42332
+ const recommendedSizeLabel = getSizeLabelFromSize(sizeRec.recommended_size);
42333
+ if (recommendedSizeId == null || !recommendedSizeLabel) {
42334
+ logger$b.logWarn("Missing recommended size for item", {
42335
+ externalId: item.externalId
42336
+ });
42337
+ return null;
42338
+ }
42339
+ const sizes = [];
42340
+ for (const sizeRecord of sizeRec.available_sizes) {
42341
+ const sizeLabel = getSizeLabelFromSize(sizeRecord);
42342
+ if (!sizeLabel) continue;
42343
+ const fit = sizeRec.fits.find((f) => f.size_id === sizeRecord.id);
42344
+ if (!fit) continue;
42345
+ const colors = [];
42346
+ for (const csa of sizeRecord.colorway_size_assets) {
42347
+ const variant = merchantProduct.variants.find((v) => v.sku === csa.sku);
42348
+ if (!variant) continue;
42349
+ colors.push({
42350
+ colorwaySizeAssetId: csa.id,
42351
+ colorLabel: variant.color || null,
42352
+ sku: csa.sku,
42353
+ priceFormatted: variant.priceFormatted
42354
+ });
42355
+ }
42356
+ if (colors.length === 0) continue;
42357
+ sizes.push({
42358
+ sizeId: sizeRecord.id,
42359
+ sizeLabel,
42360
+ isRecommended: sizeRecord.id === recommendedSizeId,
42361
+ fit,
42362
+ colors
42363
+ });
42364
+ }
42365
+ if (sizes.length === 0) return null;
42366
+ return {
42367
+ productName: merchantProduct.productName,
42368
+ productDescriptionHtml: merchantProduct.productDescriptionHtml,
42369
+ fitClassification: sizeRec.fit_classification,
42370
+ recommendedSizeId,
42371
+ recommendedSizeLabel,
42372
+ sizes,
42373
+ styleCategoryLabel: item.styleCategory?.label_singular ?? loadedProduct.style.style_category_label ?? null
42374
+ };
42375
+ }
42376
+ function findRecommendedColorSize(data, preferredColor) {
42377
+ const recommended = data.sizes.find((s) => s.isRecommended);
42378
+ if (!recommended || recommended.colors.length === 0) return null;
42379
+ return recommended.colors.find((c) => c.colorLabel === preferredColor) ?? recommended.colors[0];
42380
+ }
42381
+ function findCsaByLabel(data, sizeLabel, preferredColor) {
42382
+ const sizeRecord = data.sizes.find((s) => s.sizeLabel === sizeLabel);
42383
+ if (!sizeRecord || sizeRecord.colors.length === 0) return null;
42384
+ return sizeRecord.colors.find((c) => c.colorLabel === preferredColor) ?? sizeRecord.colors[0];
42385
+ }
42386
+ function DetailAccordionItem({
42387
+ item,
42388
+ isOpen,
42389
+ platform,
42390
+ forceUntuck,
42391
+ detailMode,
42392
+ isMobileQuickRow,
42393
+ onToggleOpen,
42394
+ onChangeDetailMode,
42395
+ onChangeSize,
42396
+ onAddToCart,
42397
+ onToggleUntuck
42398
+ }) {
42399
+ const productData = reactExports.useMemo(() => buildVtoProductDataFromResolved(item), [item]);
42400
+ const selectedSizeLabel = reactExports.useMemo(() => {
42401
+ if (!productData) return null;
42402
+ const csaId = item.storage.colorwaySizeAssetId;
42403
+ if (csaId == null) return null;
42404
+ for (const sizeRec of productData.sizes) {
42405
+ if (sizeRec.colors.some((c) => c.colorwaySizeAssetId === csaId)) {
42406
+ return sizeRec.sizeLabel;
42407
+ }
42408
+ }
42409
+ return null;
42410
+ }, [productData, item.storage.colorwaySizeAssetId]);
42411
+ const currentPrice = reactExports.useMemo(() => {
42412
+ if (!productData) return null;
42413
+ const csaId = item.storage.colorwaySizeAssetId;
42414
+ if (csaId == null) return null;
42415
+ for (const sizeRec of productData.sizes) {
42416
+ const c = sizeRec.colors.find((c2) => c2.colorwaySizeAssetId === csaId);
42417
+ if (c) return c.priceFormatted;
42418
+ }
42419
+ return null;
42420
+ }, [productData, item.storage.colorwaySizeAssetId]);
42421
+ const categoryLabel = item.styleCategory?.label_singular ?? item.styleCategory?.label ?? "";
42422
+ const productName = item.merchantProduct?.productName ?? item.externalId;
42423
+ const tuckable = !!item.styleCategory?.tuckable;
42424
+ if (platform === "desktop") {
42425
+ return /* @__PURE__ */ jsx$1(DesktopAccordionItem, { isOpen, categoryLabel, productData, currentPrice, selectedSizeLabel, onToggleOpen, onChangeSize, onAddToCart });
42426
+ }
42427
+ return /* @__PURE__ */ jsx$1(MobileAccordionItem, { isOpen, categoryLabel, productName, productData, selectedSizeLabel, currentPrice, detailMode, isMobileQuickRow, tuckable, forceUntuck, onToggleOpen, onChangeDetailMode, onChangeSize, onAddToCart, onToggleUntuck });
42428
+ }
42429
+ function DesktopAccordionItem({
42430
+ isOpen,
42431
+ categoryLabel,
42432
+ productData,
42433
+ currentPrice,
42434
+ selectedSizeLabel,
42435
+ onToggleOpen,
42436
+ onChangeSize,
42437
+ onAddToCart
42438
+ }) {
42439
+ const css2 = useCss((theme) => ({
42440
+ container: {
42441
+ display: "flex",
42442
+ flexDirection: "column",
42443
+ borderBottom: `1px solid ${theme.color_fg_text}`
42444
+ },
42445
+ header: {
42446
+ display: "flex",
42447
+ alignItems: "center",
42448
+ justifyContent: "space-between",
42449
+ padding: "14px 4px",
42450
+ width: "100%",
42451
+ gap: "8px"
42452
+ },
42453
+ categoryLabel: {
42454
+ fontSize: "12px",
42455
+ fontWeight: "600",
42456
+ letterSpacing: "0.5px",
42457
+ textTransform: "uppercase"
42458
+ },
42459
+ chevron: {
42460
+ fontSize: "12px"
42461
+ },
42462
+ body: {
42463
+ display: "flex",
42464
+ flexDirection: "column",
42465
+ alignItems: "center",
42466
+ gap: "12px",
42467
+ padding: "8px 16px 24px 16px",
42468
+ textAlign: "center"
42469
+ },
42470
+ productName: {
42471
+ fontSize: "22px",
42472
+ lineHeight: "1.2"
42473
+ },
42474
+ price: {
42475
+ fontSize: "15px"
42476
+ },
42477
+ sizeBox: {
42478
+ width: "100%",
42479
+ maxWidth: "320px",
42480
+ border: `1px solid ${theme.color_fg_text}`,
42481
+ padding: "20px 24px",
42482
+ display: "flex",
42483
+ flexDirection: "column",
42484
+ alignItems: "center",
42485
+ gap: "12px",
42486
+ marginTop: "8px"
42487
+ },
42488
+ recommendedSize: {
42489
+ fontSize: "13px",
42490
+ fontWeight: "600"
42491
+ },
42492
+ selectPrompt: {
42493
+ fontSize: "12px"
42494
+ },
42495
+ fitText: {
42496
+ fontSize: "12px"
42497
+ },
42498
+ fitDetails: {
42499
+ width: "100%"
42500
+ },
42501
+ sizeRow: {
42502
+ display: "flex",
42503
+ gap: "8px",
42504
+ alignItems: "center",
42505
+ justifyContent: "center"
42506
+ },
42507
+ cartContainer: {
42508
+ width: "100%",
42509
+ maxWidth: "320px",
42510
+ marginTop: "16px"
42511
+ },
42512
+ description: {
42513
+ fontSize: "12px",
42514
+ lineHeight: "1.5",
42515
+ textAlign: "left",
42516
+ marginTop: "8px"
42517
+ }
42518
+ }));
42519
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42520
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.header, onClick: onToggleOpen, children: [
42521
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.categoryLabel, children: categoryLabel }),
42522
+ /* @__PURE__ */ jsx$1("span", { css: css2.chevron, children: isOpen ? "⌃" : "⌄" })
42523
+ ] }),
42524
+ !isOpen ? null : /* @__PURE__ */ jsx$1("div", { css: css2.body, children: productData ? /* @__PURE__ */ jsxs(Fragment, { children: [
42525
+ /* @__PURE__ */ jsx$1(Text, { variant: "brand", css: css2.productName, children: productData.productName }),
42526
+ currentPrice ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.price, children: currentPrice }) : null,
42527
+ /* @__PURE__ */ jsxs("div", { css: css2.sizeBox, children: [
42528
+ /* @__PURE__ */ jsxs(Text, { variant: "base", css: css2.recommendedSize, children: [
42529
+ "Recommended Size: ",
42530
+ productData.recommendedSizeLabel
42531
+ ] }),
42532
+ /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData: productData, textCss: css2.fitText }),
42533
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.selectPrompt, t: "size-rec.select_size" }),
42534
+ /* @__PURE__ */ jsx$1("div", { css: css2.sizeRow, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData: productData, selectedSizeLabel, onChangeSize }) }),
42535
+ /* @__PURE__ */ jsx$1("div", { css: css2.fitDetails, children: /* @__PURE__ */ jsx$1(ItemFitDetails, { loadedProductData: productData, selectedSizeLabel }) })
42536
+ ] }),
42537
+ /* @__PURE__ */ jsx$1("div", { css: css2.cartContainer, children: /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }) }),
42538
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.description, children: /* @__PURE__ */ jsx$1("span", { dangerouslySetInnerHTML: {
42539
+ __html: productData.productDescriptionHtml
42540
+ } }) })
42541
+ ] }) : /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "loading" }) })
42542
+ ] });
42543
+ }
42544
+ function MobileAccordionItem({
42545
+ isOpen,
42546
+ categoryLabel,
42547
+ productName,
42548
+ productData,
42549
+ selectedSizeLabel,
42550
+ currentPrice,
42551
+ detailMode,
42552
+ isMobileQuickRow,
42553
+ tuckable,
42554
+ forceUntuck,
42555
+ onToggleOpen,
42556
+ onChangeDetailMode,
42557
+ onChangeSize,
42558
+ onAddToCart,
42559
+ onToggleUntuck
42560
+ }) {
42561
+ const {
42562
+ t
42563
+ } = useTranslation();
42564
+ const css2 = useCss((theme) => ({
42565
+ container: {
42566
+ display: "flex",
42567
+ flexDirection: "column",
42568
+ borderBottom: `1px solid ${theme.color_fg_text}`
42569
+ },
42570
+ header: {
42571
+ display: "flex",
42572
+ alignItems: "center",
42573
+ justifyContent: "space-between",
42574
+ padding: "12px 0",
42575
+ width: "100%",
42576
+ gap: "8px"
42577
+ },
42578
+ headerLabel: {
42579
+ display: "flex",
42580
+ gap: "8px",
42581
+ alignItems: "baseline"
42582
+ },
42583
+ categoryLabel: {
42584
+ fontSize: "12px",
42585
+ fontWeight: "600",
42586
+ letterSpacing: "0.5px",
42587
+ textTransform: "uppercase"
42588
+ },
42589
+ productName: {
42590
+ fontSize: "12px",
42591
+ color: theme.color_fg_text
42592
+ },
42593
+ chevron: {
42594
+ fontSize: "12px"
42595
+ },
42596
+ body: {
42597
+ display: "flex",
42598
+ flexDirection: "column",
42599
+ gap: "16px",
42600
+ padding: "4px 0 16px 0"
42601
+ },
42602
+ quickRow: {
42603
+ display: "flex",
42604
+ alignItems: "center",
42605
+ gap: "12px",
42606
+ padding: "8px 0"
42607
+ },
42608
+ sizeRow: {
42609
+ display: "flex",
42610
+ gap: "8px",
42611
+ alignItems: "center"
42612
+ },
42613
+ fitDetailsContainer: {
42614
+ width: "min(100%, 220px)"
42615
+ },
42616
+ buttonContainer: {
42617
+ width: "100%",
42618
+ maxWidth: "375px"
42619
+ },
42620
+ detailsLink: {
42621
+ fontSize: "13px",
42622
+ textDecoration: "underline",
42623
+ textTransform: "uppercase",
42624
+ letterSpacing: "0.5px",
42625
+ cursor: "pointer"
42626
+ },
42627
+ expandedBlock: {
42628
+ display: "flex",
42629
+ flexDirection: "column",
42630
+ gap: "8px",
42631
+ marginTop: "8px"
42632
+ },
42633
+ expandedTitle: {
42634
+ fontSize: "18px",
42635
+ fontWeight: "500"
42636
+ },
42637
+ expandedPrice: {
42638
+ fontSize: "14px"
42639
+ },
42640
+ expandedDescription: {
42641
+ fontSize: "12px"
42642
+ },
42643
+ tuckButton: {
42644
+ width: "100%",
42645
+ maxWidth: "375px",
42646
+ padding: "12px 16px",
42647
+ borderRadius: "24px",
42648
+ backgroundColor: "#FFFFFF",
42649
+ color: theme.color_fg_text,
42650
+ border: `1px solid ${theme.color_fg_text}`,
42651
+ fontSize: "13px",
42652
+ fontWeight: "500",
42653
+ letterSpacing: "0.5px",
42654
+ textTransform: "uppercase",
42655
+ cursor: "pointer"
42656
+ }
42657
+ }));
42658
+ const handleViewDetailsClick = reactExports.useCallback(() => {
42659
+ onChangeDetailMode(detailMode === "compact" ? "expanded" : "compact");
42660
+ }, [detailMode, onChangeDetailMode]);
42661
+ const tuckLabelKey = forceUntuck ? "fitting_room.try_it_tucked_in" : "fitting_room.try_it_untucked";
42662
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42663
+ /* @__PURE__ */ jsxs(Button, { variant: "base", css: css2.header, onClick: onToggleOpen, children: [
42664
+ /* @__PURE__ */ jsxs("div", { css: css2.headerLabel, children: [
42665
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.categoryLabel, children: categoryLabel }),
42666
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.productName, children: productName })
42667
+ ] }),
42668
+ /* @__PURE__ */ jsx$1("span", { css: css2.chevron, children: isOpen ? "⌃" : "⌄" })
42669
+ ] }),
42670
+ !isOpen ? null : isMobileQuickRow ? /* @__PURE__ */ jsx$1("div", { css: css2.quickRow, children: productData ? /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData: productData, selectedSizeLabel, onChangeSize }) : null }) : /* @__PURE__ */ jsx$1("div", { css: css2.body, children: productData ? /* @__PURE__ */ jsxs(Fragment, { children: [
42671
+ /* @__PURE__ */ jsx$1("div", { css: css2.sizeRow, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData: productData, selectedSizeLabel, onChangeSize }) }),
42672
+ /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData: productData }),
42673
+ /* @__PURE__ */ jsx$1("div", { css: css2.fitDetailsContainer, children: /* @__PURE__ */ jsx$1(ItemFitDetails, { loadedProductData: productData, selectedSizeLabel }) }),
42674
+ /* @__PURE__ */ jsx$1("div", { css: css2.buttonContainer, children: /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }) }),
42675
+ /* @__PURE__ */ jsx$1(LinkT, { variant: "base", css: css2.detailsLink, t: detailMode === "compact" ? "fitting_room.view_product_details" : "fitting_room.hide_product_details", onClick: handleViewDetailsClick }),
42676
+ detailMode === "expanded" ? /* @__PURE__ */ jsxs("div", { css: css2.expandedBlock, children: [
42677
+ /* @__PURE__ */ jsx$1(Text, { variant: "brand", css: css2.expandedTitle, children: productData.productName }),
42678
+ currentPrice ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.expandedPrice, children: currentPrice }) : null,
42679
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.expandedDescription, children: /* @__PURE__ */ jsx$1("span", { dangerouslySetInnerHTML: {
42680
+ __html: productData.productDescriptionHtml
42681
+ } }) }),
42682
+ tuckable ? /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.tuckButton, onClick: onToggleUntuck, children: t(tuckLabelKey) }) : null
42683
+ ] }) : null
42684
+ ] }) : /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "loading" }) })
42685
+ ] });
42686
+ }
42687
+ function DetailAccordion({
42688
+ items,
42689
+ openItemExternalId,
42690
+ platform,
42691
+ detailMode,
42692
+ isMobileQuickRow,
42693
+ forceUntuck,
42694
+ onOpenItem,
42695
+ onChangeDetailMode,
42696
+ onChangeSize,
42697
+ onAddToCart,
42698
+ onToggleUntuck
42699
+ }) {
42700
+ const css2 = useCss((_theme) => ({
42701
+ container: {
42702
+ display: "flex",
42703
+ flexDirection: "column"
42704
+ }
42705
+ }));
42706
+ return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: items.map((item) => {
42707
+ const isOpen = openItemExternalId === item.externalId;
42708
+ return /* @__PURE__ */ jsx$1(DetailAccordionItem, { item, isOpen, platform, detailMode, isMobileQuickRow, forceUntuck, onToggleOpen: () => onOpenItem(isOpen ? null : item.externalId), onChangeDetailMode, onChangeSize: (label) => onChangeSize(item.externalId, label), onAddToCart: () => onAddToCart(item.externalId), onToggleUntuck }, item.externalId);
42709
+ }) });
42710
+ }
42711
+ const AVATAR_ASPECT_RATIO = 2 / 3;
42712
+ const CONTAINER_PADDING_PX = 16;
42713
+ const AVATAR_MIN_WIDTH_PX = 240;
42714
+ const AVATAR_MAX_WIDTH_PX = 560;
42715
+ const DETAILS_MIN_WIDTH_PX = 350;
42716
+ const DETAILS_FR = 2;
42717
+ const CARDS_FR = 3;
42718
+ function DesktopLayout$1({
42719
+ resolved,
42720
+ selectedItems,
42721
+ availabilityByExternalId,
42722
+ openAccordionItemId,
42723
+ detailMode,
42724
+ forceUntuck,
42725
+ zoomed,
42726
+ frameUrls,
42727
+ onSelectItem,
42728
+ onRemoveItem,
42729
+ onOpenAccordionItem,
42730
+ onChangeDetailMode,
42731
+ onChangeSize,
42732
+ onAddToCart,
42733
+ onToggleUntuck,
42734
+ onToggleZoom,
42735
+ onSignOut
42736
+ }) {
42737
+ const hasSelection = selectedItems.length > 0;
42738
+ const hasTuckable = selectedItems.some((i) => i.styleCategory?.tuckable);
42739
+ const containerRef = reactExports.useRef(null);
42740
+ const [avatarWidth, setAvatarWidth] = reactExports.useState(AVATAR_MIN_WIDTH_PX);
42741
+ reactExports.useLayoutEffect(() => {
42742
+ const el = containerRef.current;
42743
+ if (!el) return;
42744
+ const observer = new ResizeObserver(() => {
42745
+ const availableHeightPx = el.clientHeight - CONTAINER_PADDING_PX * 2;
42746
+ if (availableHeightPx <= 0) return;
42747
+ const target = Math.floor(availableHeightPx * AVATAR_ASPECT_RATIO);
42748
+ setAvatarWidth(Math.min(AVATAR_MAX_WIDTH_PX, Math.max(AVATAR_MIN_WIDTH_PX, target)));
42749
+ });
42750
+ observer.observe(el);
42751
+ return () => observer.disconnect();
42752
+ }, []);
42753
+ const gridTemplateColumns = zoomed ? "1fr" : hasSelection ? `${avatarWidth}px minmax(${DETAILS_MIN_WIDTH_PX}px, ${DETAILS_FR}fr) ${CARDS_FR}fr` : `${avatarWidth}px 1fr`;
42754
+ const css2 = useCss((_theme) => ({
42755
+ container: {
42756
+ display: "grid",
42757
+ gap: "16px",
42758
+ width: "100%",
42759
+ height: "100%",
42760
+ padding: `${CONTAINER_PADDING_PX}px`,
42761
+ boxSizing: "border-box",
42762
+ overflow: "hidden"
42763
+ },
42764
+ avatarColumn: {
42765
+ minWidth: 0,
42766
+ minHeight: 0
42767
+ },
42768
+ detailColumn: {
42769
+ minWidth: 0,
42770
+ minHeight: 0,
42771
+ overflowY: "auto",
42772
+ padding: "0 8px"
42773
+ },
42774
+ railsColumn: {
42775
+ minWidth: 0,
42776
+ minHeight: 0,
42777
+ overflowY: "auto",
42778
+ display: "flex",
42779
+ flexDirection: "column",
42780
+ gap: "24px",
42781
+ padding: "0 8px"
42782
+ },
42783
+ railsHeader: {
42784
+ display: "flex",
42785
+ justifyContent: "flex-end",
42786
+ paddingBottom: "4px"
42787
+ },
42788
+ signOut: {
42789
+ fontSize: "12px",
42790
+ letterSpacing: "0.3px"
42791
+ }
42792
+ }));
42793
+ const controls = hasSelection ? /* @__PURE__ */ jsx$1(AvatarControls, { selectedItems, hasTuckable, forceUntuck, zoomed, onToggleUntuck, onToggleZoom, onRemoveItem }) : null;
42794
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, css: css2.container, style: {
42795
+ gridTemplateColumns
42796
+ }, children: [
42797
+ /* @__PURE__ */ jsx$1("div", { css: css2.avatarColumn, children: /* @__PURE__ */ jsx$1(AvatarPane, { hasSelection, frameUrls, controls }) }),
42798
+ !zoomed && hasSelection ? /* @__PURE__ */ jsx$1("div", { css: css2.detailColumn, children: /* @__PURE__ */ jsx$1(DetailAccordion, { items: selectedItems, openItemExternalId: openAccordionItemId, platform: "desktop", detailMode, isMobileQuickRow: false, forceUntuck, onOpenItem: onOpenAccordionItem, onChangeDetailMode, onChangeSize, onAddToCart, onToggleUntuck }) }) : null,
42799
+ !zoomed ? /* @__PURE__ */ jsxs("div", { css: css2.railsColumn, children: [
42800
+ /* @__PURE__ */ jsx$1("div", { css: css2.railsHeader, children: /* @__PURE__ */ jsx$1(LinkT, { variant: "underline", css: css2.signOut, t: "fitting_room.sign_out", onClick: onSignOut }) }),
42801
+ resolved.groups.map((group) => /* @__PURE__ */ jsx$1(CardRail, { group, availabilityByExternalId, onSelectItem, onRemoveItem, layout: "horizontal" }, group.group.name))
42802
+ ] }) : null
42803
+ ] });
42804
+ }
42805
+ function MobileLayout$1({
42806
+ mode,
42807
+ resolved,
42808
+ selectedItems,
42809
+ availabilityByExternalId,
42810
+ openAccordionItemId,
42811
+ detailMode,
42812
+ forceUntuck,
42813
+ frameUrls,
42814
+ sheetSnap,
42815
+ sheetTouchStart,
42816
+ onSelectItem,
42817
+ onRemoveItem,
42818
+ onTryItOn,
42819
+ onBackToBrowse,
42820
+ onOpenAccordionItem,
42821
+ onChangeDetailMode,
42822
+ onChangeSize,
42823
+ onAddToCart,
42824
+ onToggleUntuck
42825
+ }) {
42826
+ if (mode === "browse") {
42827
+ return /* @__PURE__ */ jsx$1(BrowseView, { resolved, availabilityByExternalId, selectedCount: selectedItems.length, onSelectItem, onRemoveItem, onTryItOn });
42828
+ }
42829
+ return /* @__PURE__ */ jsx$1(TryOnView, { selectedItems, openAccordionItemId, detailMode, forceUntuck, frameUrls, sheetSnap, sheetTouchStart, onBackToBrowse, onOpenAccordionItem, onChangeDetailMode, onChangeSize, onAddToCart, onToggleUntuck });
42830
+ }
42831
+ function BrowseView({
42832
+ resolved,
42833
+ availabilityByExternalId,
42834
+ selectedCount,
42835
+ onSelectItem,
42836
+ onRemoveItem,
42837
+ onTryItOn
42838
+ }) {
42839
+ const css2 = useCss((_theme) => ({
42840
+ container: {
42841
+ display: "flex",
42842
+ flexDirection: "column",
42843
+ height: "100%",
42844
+ width: "100%"
42845
+ },
42846
+ railsArea: {
42847
+ flex: 1,
42848
+ overflowY: "auto",
42849
+ padding: "16px",
42850
+ display: "flex",
42851
+ flexDirection: "column",
42852
+ gap: "24px"
42853
+ },
42854
+ bottomBar: {
42855
+ flex: "none",
42856
+ padding: "16px",
42857
+ borderTop: "1px solid rgba(0, 0, 0, 0.1)",
42858
+ backgroundColor: "#FFFFFF"
42859
+ }
42860
+ }));
42861
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42862
+ /* @__PURE__ */ jsx$1("div", { css: css2.railsArea, children: resolved.groups.map((group) => /* @__PURE__ */ jsx$1(CardRail, { group, availabilityByExternalId, onSelectItem, onRemoveItem, layout: "grid" }, group.group.name)) }),
42863
+ /* @__PURE__ */ jsx$1("div", { css: css2.bottomBar, children: /* @__PURE__ */ jsx$1(ButtonT, { variant: "brand", t: "fitting_room.try_it_on", onClick: onTryItOn, disabled: selectedCount === 0 }) })
42864
+ ] });
42865
+ }
42866
+ function TryOnView({
42867
+ selectedItems,
42868
+ openAccordionItemId,
42869
+ detailMode,
42870
+ forceUntuck,
42871
+ frameUrls,
42872
+ sheetSnap,
42873
+ sheetTouchStart,
42874
+ onBackToBrowse,
42875
+ onOpenAccordionItem,
42876
+ onChangeDetailMode,
42877
+ onChangeSize,
42878
+ onAddToCart,
42879
+ onToggleUntuck
42880
+ }) {
42881
+ const innerRef = reactExports.useRef(null);
42882
+ const [sheetStyle, setSheetStyle] = reactExports.useState({});
42883
+ const isMobileQuickRow = sheetSnap === "expanded" && openAccordionItemId == null;
42884
+ reactExports.useEffect(() => {
42885
+ function refresh() {
42886
+ const el = innerRef.current;
42887
+ if (!el) return;
42888
+ const maxHeightPx = Number(window.getComputedStyle(el.parentElement).getPropertyValue("max-height").replace("px", ""));
42889
+ const heightPx = Math.min(el.clientHeight, maxHeightPx || el.clientHeight);
42890
+ setSheetStyle({
42891
+ height: `${heightPx}px`
42892
+ });
42893
+ }
42894
+ setSheetStyle({});
42895
+ const timeoutId = setTimeout(refresh, 50);
42896
+ return () => clearTimeout(timeoutId);
42897
+ }, [sheetSnap, openAccordionItemId, detailMode]);
42898
+ const css2 = useCss((_theme) => ({
42899
+ container: {
42900
+ width: "100%",
42901
+ height: "100%",
42902
+ position: "relative"
42903
+ },
42904
+ backButton: {
42905
+ position: "absolute",
42906
+ top: "12px",
42907
+ left: "10px",
42908
+ width: "30px",
42909
+ height: "30px",
42910
+ border: "none",
42911
+ borderRadius: "15px",
42912
+ backgroundColor: "rgba(255, 255, 255, 0.85)",
42913
+ display: "flex",
42914
+ alignItems: "center",
42915
+ justifyContent: "center",
42916
+ zIndex: 2
42917
+ },
42918
+ backArrow: {
42919
+ fontSize: "18px",
42920
+ lineHeight: "1"
42921
+ },
42922
+ sheetOuter: {
42923
+ position: "absolute",
42924
+ left: 0,
42925
+ right: 0,
42926
+ bottom: 0,
42927
+ maxHeight: "85vh",
42928
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
42929
+ borderTopLeftRadius: "28px",
42930
+ borderTopRightRadius: "28px",
42931
+ borderTop: "1px solid rgba(0, 0, 0, 0.1)",
42932
+ transition: "height 0.4s",
42933
+ overflow: "hidden"
42934
+ },
42935
+ sheetInner: {
42936
+ width: "100%",
42937
+ padding: "12px 16px 16px 16px",
42938
+ display: "flex",
42939
+ flexDirection: "column",
42940
+ alignItems: "stretch",
42941
+ gap: "8px"
42942
+ },
42943
+ sheetHandleRow: {
42944
+ display: "flex",
42945
+ flexDirection: "column",
42946
+ alignItems: "center",
42947
+ paddingBottom: "8px"
42948
+ },
42949
+ sheetTitle: {
42950
+ fontSize: "12px",
42951
+ fontWeight: "600",
42952
+ textTransform: "uppercase",
42953
+ letterSpacing: "0.5px",
42954
+ marginTop: "8px"
42955
+ },
42956
+ sheetContent: {
42957
+ overflowY: "auto"
42958
+ }
42959
+ }));
42960
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42961
+ /* @__PURE__ */ jsx$1(AvatarPane, { hasSelection: selectedItems.length > 0, frameUrls }),
42962
+ /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.backButton, onClick: onBackToBrowse, "aria-label": "Back to browse", children: /* @__PURE__ */ jsx$1("span", { css: css2.backArrow, children: "←" }) }),
42963
+ /* @__PURE__ */ jsx$1("div", { css: css2.sheetOuter, style: sheetStyle, children: /* @__PURE__ */ jsxs("div", { ref: innerRef, css: css2.sheetInner, style: sheetStyle, children: [
42964
+ /* @__PURE__ */ jsxs("div", { css: css2.sheetHandleRow, onTouchStart: sheetTouchStart, children: [
42965
+ /* @__PURE__ */ jsx$1(SvgDragHandle, {}),
42966
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.sheetTitle, children: "RECOMMENDED SIZES" })
42967
+ ] }),
42968
+ sheetSnap === "collapsed" ? null : /* @__PURE__ */ jsx$1("div", { css: css2.sheetContent, children: /* @__PURE__ */ jsx$1(DetailAccordion, { items: selectedItems, openItemExternalId: openAccordionItemId, platform: "mobile", detailMode, isMobileQuickRow, forceUntuck, onOpenItem: onOpenAccordionItem, onChangeDetailMode, onChangeSize, onAddToCart, onToggleUntuck }) })
42969
+ ] }) })
42970
+ ] });
42971
+ }
42972
+ const logger$a = getLogger("overlays/fitting-room/use-vto-subscriptions");
42973
+ const NON_PRIORITY_REQUEST_DELAY_MS = 500;
42974
+ function outfitKey(items) {
42975
+ return items.map((i) => `${i.colorway_size_asset_id}:${i.untucked ? 1 : 0}`).sort().join("|");
42976
+ }
42977
+ function useVtoSubscriptions() {
42978
+ const compositionTokensRef = reactExports.useRef(/* @__PURE__ */ new Map());
42979
+ const subscriptionsRef = reactExports.useRef(/* @__PURE__ */ new Map());
42980
+ const [vtoDocsByToken, setVtoDocsByToken] = reactExports.useState({});
42981
+ const lastPriorityTimeRef = reactExports.useRef(null);
42982
+ const [lastError, setLastError] = reactExports.useState(null);
42983
+ const clearError = reactExports.useCallback(() => setLastError(null), []);
42984
+ const subscribe = reactExports.useCallback((token2, key) => {
42985
+ if (subscriptionsRef.current.has(token2)) return;
42986
+ const uid = getAuthManager().getAuthUser()?.uid;
42987
+ if (!uid) {
42988
+ logger$a.logWarn("subscribe skipped: no uid", {
42989
+ token: token2,
42990
+ key
42991
+ });
42992
+ return;
42993
+ }
42994
+ const unsub = getFirestoreManager().listenToSubDoc("users", uid, "vto_compositions", token2, (data) => {
42995
+ if (data?.frames?.length) {
42996
+ logger$a.logDebug("VTO frames ready", {
42997
+ key,
42998
+ token: token2,
42999
+ count: data.frames.length
43000
+ });
43001
+ }
43002
+ if (data?.error) {
43003
+ setLastError(new Error(data.error));
43004
+ }
43005
+ setVtoDocsByToken((prev2) => ({
43006
+ ...prev2,
43007
+ [token2]: data ?? {}
43008
+ }));
43009
+ });
43010
+ subscriptionsRef.current.set(token2, unsub);
43011
+ }, []);
43012
+ const request = reactExports.useCallback((items, priority) => {
43013
+ if (items.length === 0) return;
43014
+ const key = outfitKey(items);
43015
+ if (compositionTokensRef.current.has(key)) return;
43016
+ const exec = () => {
43017
+ compositionTokensRef.current.set(key, "");
43018
+ logger$a.logDebug("Requesting VTO composition", {
43019
+ key,
43020
+ items,
43021
+ priority
43022
+ });
43023
+ requestVto(items).then((resp) => {
43024
+ compositionTokensRef.current.set(key, resp.token);
43025
+ subscribe(resp.token, key);
43026
+ }).catch((error) => {
43027
+ logger$a.logError("VTO request failed", {
43028
+ error,
43029
+ items,
43030
+ key
43031
+ });
43032
+ compositionTokensRef.current.delete(key);
43033
+ setLastError(error instanceof Error ? error : new Error(String(error)));
43034
+ });
43035
+ };
43036
+ if (priority) {
43037
+ lastPriorityTimeRef.current = Date.now();
43038
+ exec();
43039
+ return;
43040
+ }
43041
+ const last = lastPriorityTimeRef.current;
43042
+ let delay = 0;
43043
+ if (last) {
43044
+ const now = Date.now();
43045
+ const minNext = last + NON_PRIORITY_REQUEST_DELAY_MS;
43046
+ if (now < minNext) delay = minNext - now;
43047
+ }
43048
+ if (delay > 0) {
43049
+ setTimeout(exec, delay);
43050
+ } else {
43051
+ exec();
43052
+ }
43053
+ }, [subscribe]);
43054
+ reactExports.useEffect(() => {
43055
+ return () => {
43056
+ subscriptionsRef.current.forEach((unsub) => {
43057
+ try {
43058
+ unsub();
43059
+ } catch (e) {
43060
+ logger$a.logError("Error unsubscribing", {
43061
+ error: e
43062
+ });
43063
+ }
43064
+ });
43065
+ subscriptionsRef.current.clear();
43066
+ };
43067
+ }, []);
43068
+ const framesForOutfit = reactExports.useCallback((items) => {
43069
+ if (items.length === 0) return null;
43070
+ const key = outfitKey(items);
43071
+ const token2 = compositionTokensRef.current.get(key);
43072
+ if (!token2) return null;
43073
+ const doc2 = vtoDocsByToken[token2];
43074
+ if (!doc2?.frames?.length) return null;
43075
+ const baseUrl2 = getStaticData().config.frames.baseUrl;
43076
+ return doc2.frames.map((u) => applyFrameBaseUrl(u, baseUrl2));
43077
+ }, [vtoDocsByToken]);
43078
+ return {
43079
+ request,
43080
+ framesForOutfit,
43081
+ lastError,
43082
+ clearError
43083
+ };
43084
+ }
43085
+ function toWireItems(items) {
43086
+ return items.map((i) => ({
43087
+ colorway_size_asset_id: i.colorwaySizeAssetId,
43088
+ ...i.untucked ? {
43089
+ untucked: true
43090
+ } : {}
43091
+ }));
43092
+ }
43093
+ const logger$9 = getLogger("overlays/fitting-room");
43094
+ function measureTopOffset() {
43095
+ const {
43096
+ getOverlayTopOffset
43097
+ } = getStaticData();
43098
+ if (!getOverlayTopOffset) return 0;
43099
+ try {
43100
+ const offset = getOverlayTopOffset();
43101
+ return Number.isFinite(offset) && offset > 0 ? offset : 0;
43102
+ } catch {
43103
+ return 0;
43104
+ }
43105
+ }
43106
+ function FittingRoomOverlay() {
43107
+ const deviceLayout = useMainStore((state) => state.deviceLayout);
43108
+ const userIsLoggedIn = useMainStore((state) => state.userIsLoggedIn);
43109
+ const userHasAvatar = useMainStore((state) => state.userHasAvatar);
43110
+ const userProfile = useMainStore((state) => state.userProfile);
43111
+ const closeOverlay = useMainStore((state) => state.closeOverlay);
43112
+ const openOverlay = useMainStore((state) => state.openOverlay);
43113
+ const updateFittingRoomItem = useMainStore((state) => state.updateFittingRoomItem);
43114
+ const resolved = useResolvedFittingRoom();
43115
+ const [topOffset, setTopOffset] = reactExports.useState(0);
43116
+ const [selectedExternalIds, setSelectedExternalIds] = reactExports.useState(() => /* @__PURE__ */ new Set());
43117
+ const [openAccordionItemId, setOpenAccordionItemId] = reactExports.useState(null);
43118
+ const [detailMode, setDetailMode] = reactExports.useState("compact");
43119
+ const [forceUntuck, setForceUntuck] = reactExports.useState(false);
43120
+ const [lastAddedExternalId, setLastAddedExternalId] = reactExports.useState(null);
43121
+ const [mobileMode, setMobileMode] = reactExports.useState("browse");
43122
+ const [zoomed, setZoomed] = reactExports.useState(false);
43123
+ const {
43124
+ snap: sheetSnap,
43125
+ setSnap: setSheetSnap,
43126
+ handleTouchStart: sheetTouchStart
43127
+ } = useMobileSheetSnap("collapsed");
43128
+ const isMobileLayout = deviceLayout === DeviceLayout.MOBILE_PORTRAIT || deviceLayout === DeviceLayout.TABLET_PORTRAIT;
43129
+ const {
43130
+ request: requestVtoComposition,
43131
+ framesForOutfit,
43132
+ lastError: vtoError,
43133
+ clearError: clearVtoError
43134
+ } = useVtoSubscriptions();
43135
+ reactExports.useEffect(() => {
43136
+ const savedScrollY = window.scrollY;
43137
+ if (savedScrollY > 0) window.scrollTo(0, 0);
43138
+ setTopOffset(measureTopOffset());
43139
+ const onResize = () => setTopOffset(measureTopOffset());
43140
+ window.addEventListener("resize", onResize);
43141
+ return () => {
43142
+ window.removeEventListener("resize", onResize);
43143
+ if (savedScrollY > 0) window.scrollTo(0, savedScrollY);
43144
+ };
43145
+ }, []);
43146
+ const selectedItems = reactExports.useMemo(() => resolved.items.filter((item) => selectedExternalIds.has(item.externalId)), [resolved.items, selectedExternalIds]);
43147
+ const availabilityByExternalId = reactExports.useMemo(() => {
43148
+ const out = {};
43149
+ for (const item of resolved.items) {
43150
+ out[item.externalId] = computeAvailability(item, selectedExternalIds, resolved);
43151
+ }
43152
+ return out;
43153
+ }, [resolved, selectedExternalIds]);
43154
+ const ensureSizeForItem = reactExports.useCallback((item) => {
43155
+ if (item.storage.colorwaySizeAssetId != null) return;
43156
+ const productData = buildVtoProductDataFromResolved(item);
43157
+ if (!productData) return;
43158
+ const csa = findRecommendedColorSize(productData, item.storage.color);
43159
+ if (!csa) return;
43160
+ const sizeRec = item.loadedProduct?.sizeFitRecommendation;
43161
+ const sizeLabel = sizeRec ? getSizeLabelFromSize(sizeRec.recommended_size) : productData.recommendedSizeLabel;
43162
+ updateFittingRoomItem(item.externalId, {
43163
+ colorwaySizeAssetId: csa.colorwaySizeAssetId,
43164
+ size: sizeLabel,
43165
+ color: csa.colorLabel
43166
+ });
43167
+ logger$9.logDebug("Auto-picked recommended size", {
43168
+ externalId: item.externalId,
43169
+ sizeLabel,
43170
+ csaId: csa.colorwaySizeAssetId
43171
+ });
43172
+ }, [updateFittingRoomItem]);
43173
+ const handleSelectItem = reactExports.useCallback((externalId) => {
43174
+ const item = resolved.items.find((i) => i.externalId === externalId);
43175
+ if (!item) return;
43176
+ const isSelected = selectedExternalIds.has(externalId);
43177
+ const nextSelected = new Set(selectedExternalIds);
43178
+ if (isSelected) {
43179
+ nextSelected.delete(externalId);
43180
+ if (openAccordionItemId === externalId) setOpenAccordionItemId(null);
43181
+ } else {
43182
+ nextSelected.add(externalId);
43183
+ ensureSizeForItem(item);
43184
+ setLastAddedExternalId(externalId);
43185
+ if (!isMobileLayout) {
43186
+ setOpenAccordionItemId(externalId);
43187
+ setDetailMode("compact");
43188
+ }
43189
+ }
43190
+ setSelectedExternalIds(nextSelected);
43191
+ }, [resolved, selectedExternalIds, openAccordionItemId, isMobileLayout, ensureSizeForItem]);
43192
+ const handleChangeSize = reactExports.useCallback((externalId, sizeLabel) => {
43193
+ const item = resolved.items.find((i) => i.externalId === externalId);
43194
+ if (!item) return;
43195
+ const productData = buildVtoProductDataFromResolved(item);
43196
+ if (!productData) return;
43197
+ const csa = findCsaByLabel(productData, sizeLabel, item.storage.color);
43198
+ if (!csa) return;
43199
+ updateFittingRoomItem(externalId, {
43200
+ colorwaySizeAssetId: csa.colorwaySizeAssetId,
43201
+ size: sizeLabel,
43202
+ color: csa.colorLabel
43203
+ });
43204
+ }, [resolved.items, updateFittingRoomItem]);
43205
+ const handleAddToCart = reactExports.useCallback(async (externalId) => {
43206
+ const {
43207
+ addToCart
43208
+ } = getStaticData();
43209
+ if (!addToCart) {
43210
+ logger$9.logWarn("No addToCart callback configured; skipping", {
43211
+ externalId
43212
+ });
43213
+ return;
43214
+ }
43215
+ const item = resolved.items.find((i) => i.externalId === externalId);
43216
+ if (!item || !item.storage.size || !item.storage.color) {
43217
+ logger$9.logWarn("Cannot add to cart: missing size or color", {
43218
+ externalId,
43219
+ size: item?.storage.size,
43220
+ color: item?.storage.color
43221
+ });
43222
+ return;
43223
+ }
43224
+ try {
43225
+ await addToCart(externalId, {
43226
+ size: item.storage.size,
43227
+ color: item.storage.color
43228
+ });
43229
+ closeOverlay();
43230
+ } catch (error) {
43231
+ logger$9.logError("addToCart failed", {
43232
+ error,
43233
+ externalId
43234
+ });
43235
+ }
43236
+ }, [resolved.items, closeOverlay]);
43237
+ const handleToggleUntuck = reactExports.useCallback(() => {
43238
+ setForceUntuck((prev2) => !prev2);
43239
+ }, []);
43240
+ const handleToggleZoom = reactExports.useCallback(() => {
43241
+ setZoomed((prev2) => !prev2);
43242
+ }, []);
43243
+ const handleRemoveItem = reactExports.useCallback((externalId) => {
43244
+ setSelectedExternalIds((prev2) => {
43245
+ if (!prev2.has(externalId)) return prev2;
43246
+ const next2 = new Set(prev2);
43247
+ next2.delete(externalId);
43248
+ return next2;
43249
+ });
43250
+ if (openAccordionItemId === externalId) setOpenAccordionItemId(null);
43251
+ }, [openAccordionItemId]);
43252
+ const handleTryItOn = reactExports.useCallback(() => {
43253
+ setMobileMode("try-on");
43254
+ setSheetSnap("collapsed");
43255
+ }, [setSheetSnap]);
43256
+ const handleBackToBrowse = reactExports.useCallback(() => {
43257
+ setMobileMode("browse");
43258
+ }, []);
43259
+ reactExports.useEffect(() => {
43260
+ if (isMobileLayout) return;
43261
+ if (openAccordionItemId && selectedExternalIds.has(openAccordionItemId)) return;
43262
+ if (selectedItems.length === 0) {
43263
+ if (openAccordionItemId !== null) setOpenAccordionItemId(null);
43264
+ return;
43265
+ }
43266
+ let mostRecent = null;
43267
+ for (const item of selectedItems) {
43268
+ if (!mostRecent || item.storage.addedAt > mostRecent.storage.addedAt) {
43269
+ mostRecent = item;
43270
+ }
43271
+ }
43272
+ if (mostRecent) setOpenAccordionItemId(mostRecent.externalId);
43273
+ }, [isMobileLayout, openAccordionItemId, selectedExternalIds, selectedItems]);
43274
+ const outfit = reactExports.useMemo(() => buildOutfit(selectedExternalIds, resolved, forceUntuck, lastAddedExternalId), [selectedExternalIds, resolved, forceUntuck, lastAddedExternalId]);
43275
+ reactExports.useEffect(() => {
43276
+ if (!userIsLoggedIn || !userHasAvatar) return;
43277
+ if (outfit.items.length === 0) return;
43278
+ requestVtoComposition(toWireItems(outfit.items), true);
43279
+ if (getStaticData().config.features.vtoPrefetch) {
43280
+ for (const alt of outfit.alternates) {
43281
+ requestVtoComposition(toWireItems(alt), false);
43282
+ }
43283
+ }
43284
+ }, [userIsLoggedIn, userHasAvatar, outfit, requestVtoComposition]);
43285
+ const frameUrls = reactExports.useMemo(() => {
43286
+ if (outfit.items.length === 0) {
43287
+ const bareFrames = userProfile?.avatar_frames;
43288
+ if (!bareFrames || bareFrames.length === 0) return null;
43289
+ const baseUrl2 = getStaticData().config.frames.baseUrl;
43290
+ return bareFrames.map((u) => applyFrameBaseUrl(u, baseUrl2));
43291
+ }
43292
+ return framesForOutfit(toWireItems(outfit.items));
43293
+ }, [outfit, framesForOutfit, userProfile]);
43294
+ reactExports.useEffect(() => {
43295
+ if (!userIsLoggedIn) {
43296
+ openOverlay(OverlayName.LANDING, {
43297
+ returnToOverlay: OverlayName.FITTING_ROOM
43298
+ });
43299
+ return;
43300
+ }
43301
+ if (userHasAvatar === false) {
43302
+ openOverlay(OverlayName.GET_APP, {
43303
+ returnToOverlay: OverlayName.FITTING_ROOM,
43304
+ noAvatar: true
43305
+ });
43306
+ }
43307
+ }, [userIsLoggedIn, userHasAvatar, openOverlay]);
43308
+ const handleSignOut = reactExports.useCallback(() => {
43309
+ closeOverlay();
43310
+ const authManager2 = getAuthManager();
43311
+ authManager2.logout().catch((error) => {
43312
+ logger$9.logError("Error during logout", {
43313
+ error
43314
+ });
43315
+ });
43316
+ }, [closeOverlay]);
43317
+ const handleShopNow = reactExports.useCallback(() => {
43318
+ closeOverlay();
43319
+ }, [closeOverlay]);
43320
+ const css2 = useCss((theme) => ({
43321
+ body: {
43322
+ width: "100%",
43323
+ height: "100%",
43324
+ overflow: "hidden",
43325
+ boxSizing: "border-box",
43326
+ backgroundColor: "#FFFFFF"
43327
+ },
43328
+ empty: {
43329
+ display: "flex",
43330
+ width: "100%",
43331
+ height: "100%",
43332
+ alignItems: "center",
43333
+ justifyContent: "center",
43334
+ padding: "32px"
43335
+ },
43336
+ emptyCard: {
43337
+ display: "flex",
43338
+ flexDirection: "column",
43339
+ alignItems: "center",
43340
+ gap: "16px",
43341
+ maxWidth: "420px",
43342
+ textAlign: "center"
43343
+ },
43344
+ emptyTitle: {
43345
+ fontSize: "24px"
43346
+ },
43347
+ emptyTagline: {
43348
+ fontSize: "14px",
43349
+ color: theme.color_fg_text
43350
+ },
43351
+ emptyShopNow: {
43352
+ width: "min(100%, 240px)",
43353
+ marginTop: "8px"
43354
+ },
43355
+ emptySignOut: {
43356
+ fontSize: "13px",
43357
+ textDecoration: "underline",
43358
+ marginTop: "8px"
43359
+ },
43360
+ snackbar: {
43361
+ position: "absolute",
43362
+ left: "50%",
43363
+ bottom: "24px",
43364
+ transform: "translateX(-50%)",
43365
+ padding: "12px 20px",
43366
+ borderRadius: "24px",
43367
+ backgroundColor: theme.color_fg_text,
43368
+ color: "#FFFFFF",
43369
+ fontSize: "13px",
43370
+ display: "flex",
43371
+ alignItems: "center",
43372
+ gap: "12px",
43373
+ zIndex: 10,
43374
+ maxWidth: "calc(100% - 32px)"
43375
+ },
43376
+ snackbarDismiss: {
43377
+ background: "none",
43378
+ border: "none",
43379
+ color: "#FFFFFF",
43380
+ fontSize: "16px",
43381
+ cursor: "pointer"
43382
+ }
43383
+ }));
43384
+ const overlayStyle = {
43385
+ top: `${topOffset}px`,
43386
+ left: 0,
43387
+ right: 0,
43388
+ bottom: 0,
43389
+ backgroundColor: "transparent"
43390
+ };
43391
+ const contentStyle = {
43392
+ position: "absolute",
43393
+ inset: 0,
43394
+ margin: 0,
43395
+ padding: 0,
43396
+ border: "none",
43397
+ borderRadius: 0,
43398
+ backgroundColor: "#FFFFFF",
43399
+ overflow: "hidden"
43400
+ };
43401
+ const authResolved = userIsLoggedIn && userHasAvatar === true;
43402
+ if (!authResolved) {
43403
+ return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose: closeOverlay, overlayStyle, contentStyle, children: /* @__PURE__ */ jsx$1(Loading, {}) });
43404
+ }
43405
+ return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose: closeOverlay, overlayStyle, contentStyle, children: /* @__PURE__ */ jsxs("div", { css: css2.body, children: [
43406
+ resolved.items.length === 0 ? /* @__PURE__ */ jsx$1("div", { css: css2.empty, children: /* @__PURE__ */ jsxs("div", { css: css2.emptyCard, children: [
43407
+ /* @__PURE__ */ jsx$1(TextT, { variant: "brand", css: css2.emptyTitle, t: "fitting_room.title" }),
43408
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.emptyTagline, t: "landing.description" }),
43409
+ /* @__PURE__ */ jsx$1("div", { css: css2.emptyShopNow, children: /* @__PURE__ */ jsx$1(ButtonT, { variant: "primary", t: "fitting_room.shop_now", onClick: handleShopNow }) }),
43410
+ userIsLoggedIn ? /* @__PURE__ */ jsx$1(LinkT, { variant: "underline", css: css2.emptySignOut, t: "fitting_room.sign_out", onClick: handleSignOut }) : null
43411
+ ] }) }) : isMobileLayout ? /* @__PURE__ */ jsx$1(MobileLayout$1, { mode: mobileMode, resolved, selectedItems, availabilityByExternalId, openAccordionItemId, detailMode, forceUntuck, frameUrls, sheetSnap, sheetTouchStart, onSelectItem: handleSelectItem, onRemoveItem: handleRemoveItem, onTryItOn: handleTryItOn, onBackToBrowse: handleBackToBrowse, onOpenAccordionItem: setOpenAccordionItemId, onChangeDetailMode: setDetailMode, onChangeSize: handleChangeSize, onAddToCart: handleAddToCart, onToggleUntuck: handleToggleUntuck }) : /* @__PURE__ */ jsx$1(DesktopLayout$1, { resolved, selectedItems, availabilityByExternalId, openAccordionItemId, detailMode, forceUntuck, zoomed, frameUrls, onSelectItem: handleSelectItem, onRemoveItem: handleRemoveItem, onOpenAccordionItem: setOpenAccordionItemId, onChangeDetailMode: setDetailMode, onChangeSize: handleChangeSize, onAddToCart: handleAddToCart, onToggleUntuck: handleToggleUntuck, onToggleZoom: handleToggleZoom, onSignOut: handleSignOut }),
43412
+ vtoError ? /* @__PURE__ */ jsxs("div", { css: css2.snackbar, children: [
43413
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "fitting_room.vto_error" }),
43414
+ /* @__PURE__ */ jsx$1("button", { css: css2.snackbarDismiss, onClick: clearVtoError, "aria-label": "Dismiss", children: "×" })
43415
+ ] }) : null
43416
+ ] }) });
43417
+ }
43418
+ const CONTACT_US_LINK = "mailto:info@thefittingroom.tech?subject=Forgot%20Password%20Assistance";
43419
+ const logger$8 = getLogger("forgot-password");
43420
+ function ForgotPasswordOverlay({
43421
+ returnToOverlay
43422
+ }) {
43423
+ const {
43424
+ t
43425
+ } = useTranslation();
43426
+ const closeOverlay = useMainStore((state) => state.closeOverlay);
43427
+ const openOverlay = useMainStore((state) => state.openOverlay);
43428
+ const emailInputRef = reactExports.useRef(null);
43429
+ const [emailError, setEmailError] = reactExports.useState(null);
43430
+ const [linkSent, setLinkSent] = reactExports.useState(false);
43431
+ const css2 = useCss((theme) => ({
43432
+ titleText: {
43433
+ fontSize: "20px"
43434
+ },
43435
+ form: {
43436
+ width: "100%",
43437
+ display: "flex",
43438
+ flexDirection: "column",
43439
+ gap: "0"
43440
+ },
43441
+ input: {
43442
+ width: "100%",
43443
+ padding: "12px 16px",
43444
+ border: "1px solid #767676",
43445
+ borderRadius: "8px",
43446
+ fontSize: "16px"
43447
+ },
43448
+ inputError: {
43449
+ border: `1px solid ${theme.color_danger}`
43450
+ },
43451
+ descriptionContainer: {
43452
+ marginTop: "48px",
43453
+ textAlign: "center"
43454
+ },
43455
+ linkSentContainer: {
43456
+ marginTop: "48px",
43457
+ height: "48px",
43458
+ padding: "8px 16px",
43459
+ boxShadow: "0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"
43460
+ },
43461
+ linkSentText: {
43462
+ color: theme.color_tfr_800
43463
+ },
43464
+ emailContainer: {
43465
+ marginTop: "48px"
43466
+ },
43467
+ emailErrorContainer: {
43468
+ marginTop: "4px",
43469
+ height: "18px"
43470
+ },
43471
+ submitButtonContainer: {
43472
+ marginTop: "64px"
43473
+ },
43474
+ contactContainer: {
43475
+ marginTop: "32px"
43476
+ }
43477
+ }));
43478
+ const handleSubmit = reactExports.useCallback((event) => {
43479
+ async function resetUserPassword(email2) {
43480
+ try {
43481
+ const authManager2 = getAuthManager();
43482
+ await authManager2.sendPasswordResetEmail(email2);
43483
+ setLinkSent(true);
43484
+ } catch (error) {
43485
+ logger$8.logError("Error sending password reset email:", {
43486
+ error
43487
+ });
43488
+ }
43489
+ }
43490
+ event.preventDefault();
43491
+ const formEl = event.target;
43492
+ const emailEl = formEl.elements.namedItem("email");
43493
+ let emailError2 = null;
43494
+ if (!emailEl.validity.valid) {
43495
+ emailError2 = t("sign-in.invalid_email");
43496
+ }
43497
+ setEmailError(emailError2);
43498
+ if (emailError2) {
43499
+ emailEl.focus();
43500
+ return;
43501
+ }
43502
+ const email = emailEl.value;
43503
+ resetUserPassword(email);
43504
+ }, [t]);
43505
+ const handleBackToSignInClick = reactExports.useCallback(() => {
43506
+ openOverlay(OverlayName.SIGN_IN, {
43507
+ returnToOverlay
43508
+ });
43509
+ }, [returnToOverlay, openOverlay]);
43510
+ const handleContactUsClick = reactExports.useCallback(() => {
43511
+ window.open(CONTACT_US_LINK, "_blank");
43512
+ }, []);
43513
+ const titleNode = /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.titleText, t: "forgot-password.title" });
43514
+ let descriptionNode;
43515
+ if (linkSent) {
43516
+ descriptionNode = /* @__PURE__ */ jsx$1("div", { css: css2.linkSentContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.linkSentText, t: "forgot-password.link_sent" }) });
43517
+ } else {
43518
+ descriptionNode = /* @__PURE__ */ jsx$1("div", { css: css2.descriptionContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "forgot-password.description" }) });
43519
+ }
43520
+ return /* @__PURE__ */ jsx$1(ContentModal, { onRequestClose: closeOverlay, title: titleNode, onBackClick: handleBackToSignInClick, children: /* @__PURE__ */ jsxs("form", { css: css2.form, onSubmit: handleSubmit, children: [
43521
+ descriptionNode,
43522
+ /* @__PURE__ */ jsx$1("div", { css: css2.emailContainer, children: /* @__PURE__ */ jsx$1("input", { name: "email", type: "email", required: true, placeholder: t("sign-in.email"), ref: emailInputRef, css: [css2.input, emailError ? css2.inputError : null, "", ""] }) }),
43523
+ /* @__PURE__ */ jsx$1("div", { css: css2.emailErrorContainer, children: emailError && /* @__PURE__ */ jsx$1(Text, { variant: "error", children: emailError }) }),
43524
+ /* @__PURE__ */ jsx$1("div", { css: css2.submitButtonContainer, children: /* @__PURE__ */ jsx$1(ButtonT, { type: "submit", variant: "primary", t: "forgot-password.send_link" }) }),
43525
+ /* @__PURE__ */ jsxs("div", { css: css2.contactContainer, children: [
43526
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "forgot-password.need_help" }),
43527
+ " ",
43528
+ /* @__PURE__ */ jsx$1(LinkT, { variant: "semibold", t: "forgot-password.contact_us", onClick: handleContactUsClick })
43529
+ ] })
43530
+ ] }) });
43531
+ }
43532
+ function PoweredByFooter() {
43533
+ const css2 = useCss((_theme) => ({
43534
+ footer: {
43535
+ position: "absolute",
43536
+ bottom: "16px",
43537
+ marginLeft: "auto",
43538
+ marginRight: "auto",
43539
+ textAlign: "center",
43540
+ display: "flex",
43541
+ alignItems: "center",
41419
43542
  gap: "2px",
41420
43543
  paddingTop: "24px",
41421
43544
  fontSize: "12px"
@@ -41578,7 +43701,7 @@ function TfrTitle() {
41578
43701
  }));
41579
43702
  return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: /* @__PURE__ */ jsx$1(SvgTfrName, { css: css2.nameIcon }) });
41580
43703
  }
41581
- const logger$8 = getLogger("sign-in");
43704
+ const logger$7 = getLogger("sign-in");
41582
43705
  function SignInOverlay({
41583
43706
  returnToOverlay
41584
43707
  }) {
@@ -41652,7 +43775,7 @@ function SignInOverlay({
41652
43775
  closeOverlay();
41653
43776
  }
41654
43777
  } catch (error) {
41655
- logger$8.logError("Login failed:", {
43778
+ logger$7.logError("Login failed:", {
41656
43779
  error
41657
43780
  });
41658
43781
  setEmailError(" ");
@@ -41965,240 +44088,59 @@ function FitChart({
41965
44088
  /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsxs("div", { children: [
41966
44089
  /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.loose" }) }),
41967
44090
  /* @__PURE__ */ jsx$1("div", { css: [css2.scaleFitLabelContainer, css2.scaleFitLabelRightContainer, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.oversized" }) })
41968
- ] }) })
41969
- ] }),
41970
- /* @__PURE__ */ jsxs("div", { css: css2.scaleLineRow, children: [
41971
- /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41972
- /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " }),
41973
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " })
41974
- ] }),
41975
- /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41976
- /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " }),
41977
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " })
41978
- ] }),
41979
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }) }),
41980
- /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41981
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }),
41982
- /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " })
41983
- ] }),
41984
- /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41985
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " }),
41986
- /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " })
41987
- ] })
41988
- ] }),
41989
- /* @__PURE__ */ jsxs("div", { css: css2.scaleCategoryLabelRow, children: [
41990
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelLeft, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelPoorFitText, t: "fit-chart.fit.poor_fit" }) }) }),
41991
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelCenter, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelGoodFitText, t: "fit-chart.fit.acceptable_fit" }) }) }),
41992
- /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelRight, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelPoorFitText, t: "fit-chart.fit.poor_fit" }) }) })
41993
- ] })
41994
- ] }),
41995
- /* @__PURE__ */ jsx$1("div", { css: css2.chartTitleContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartTitleText, t: "fit-chart.measurement_points" }) }),
41996
- /* @__PURE__ */ jsxs("div", { css: css2.chartContainer, children: [
41997
- /* @__PURE__ */ jsx$1("img", { src: getExternalAssetUrl("fit-chart-outline.png"), alt: "Fit Chart", css: css2.chartImage }),
41998
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine1, "", ""], children: " " }),
41999
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine2, "", ""], children: " " }),
42000
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine3, "", ""], children: " " }),
42001
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine4, "", ""], children: " " }),
42002
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine5, "", ""], children: " " }),
42003
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6a, "", ""], children: " " }),
42004
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6b, "", ""], children: " " }),
42005
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel1, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.bust" }) }),
42006
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel2, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.waist" }) }),
42007
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel3, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.pant_waist" }) }),
42008
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel4, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.high_hip" }) }),
42009
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel5, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.low_hip" }) }),
42010
- /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel6, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.thigh" }) })
42011
- ] })
42012
- ] })
42013
- ] });
42014
- }
42015
- function Loading({
42016
- t = "loading"
42017
- }) {
42018
- const css2 = useCss((_theme) => {
42019
- const spin = keyframes({
42020
- from: {
42021
- transform: "rotate(0deg)"
42022
- },
42023
- to: {
42024
- transform: "rotate(360deg)"
42025
- }
42026
- });
42027
- return {
42028
- container: {
42029
- display: "flex",
42030
- flexDirection: "column",
42031
- justifyContent: "center",
42032
- alignItems: "center",
42033
- height: "100%",
42034
- gap: "4px"
42035
- },
42036
- icon: {
42037
- width: "76px",
42038
- height: "76px",
42039
- animation: `${spin} 2s linear infinite`
42040
- },
42041
- text: {}
42042
- };
42043
- });
42044
- return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42045
- /* @__PURE__ */ jsx$1(SvgLoadingCircle, { css: css2.icon }),
42046
- /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.text, t })
42047
- ] });
42048
- }
42049
- let baseUrl;
42050
- let responseCache = {};
42051
- function _init$3() {
42052
- const {
42053
- config
42054
- } = getStaticData();
42055
- baseUrl = config.api.baseUrl;
42056
- useMainStore.subscribe((state, prevState) => {
42057
- if (state.userIsLoggedIn !== prevState.userIsLoggedIn) {
42058
- clearApiCache();
42059
- }
42060
- });
42061
- }
42062
- function clearApiCache() {
42063
- responseCache = {};
42064
- }
42065
- async function execApiRequest(params) {
42066
- const authManager2 = getAuthManager();
42067
- const {
42068
- useCache,
42069
- useToken,
42070
- method,
42071
- endpoint,
42072
- body
42073
- } = params;
42074
- const url = `${baseUrl}${endpoint}`;
42075
- if (useCache && responseCache[url]) {
42076
- return responseCache[url];
42077
- }
42078
- const options = {
42079
- method,
42080
- headers: {
42081
- "Content-Type": "application/json"
42082
- }
42083
- };
42084
- if (useToken) {
42085
- const token2 = await authManager2.getAuthToken();
42086
- options.headers = {
42087
- ...options.headers,
42088
- Authorization: `Bearer ${token2}`
42089
- };
42090
- }
42091
- if (body) {
42092
- options.body = JSON.stringify(body);
42093
- }
42094
- const response = await fetch(url, options);
42095
- if (!response.ok) {
42096
- throw new Error(`API request failed with status ${response.status}`);
42097
- }
42098
- let data;
42099
- if (response.status === 204) {
42100
- data = {
42101
- noResponse: true
42102
- };
42103
- } else {
42104
- data = await response.json();
42105
- }
42106
- if (useCache) {
42107
- responseCache[url] = data;
42108
- }
42109
- return data;
42110
- }
42111
- async function getSizeRecommendation(styleId) {
42112
- return await execApiRequest({
42113
- useCache: true,
42114
- useToken: true,
42115
- method: "GET",
42116
- endpoint: `/v1/styles/${styleId}/recommendation`
42117
- });
42118
- }
42119
- async function requestVto(items) {
42120
- return await execApiRequest({
42121
- useToken: true,
42122
- method: "POST",
42123
- endpoint: "/v1/vto-compositions",
42124
- body: {
42125
- items
42126
- }
42127
- });
42128
- }
42129
- const recordCache = {};
42130
- async function getStyleByExternalId(brandId, externalId) {
42131
- const cacheKey = `getStyleByExternalId/${brandId}/${externalId}`;
42132
- if (recordCache[cacheKey]) {
42133
- return recordCache[cacheKey];
42134
- }
42135
- const firestore = getFirestoreManager();
42136
- const querySnapshot = await firestore.queryDocs("styles", [where("brand_id", "==", brandId), where("external_id", "==", externalId)]);
42137
- if (querySnapshot.empty) {
42138
- return null;
42139
- }
42140
- const record = querySnapshot.docs[0].data();
42141
- recordCache[cacheKey] = record;
42142
- return record;
42143
- }
42144
- const logger$7 = getLogger("product");
42145
- function _init$2() {
42146
- useMainStore.subscribe((state, prevState) => {
42147
- if (state.userHasAvatar && !prevState.userHasAvatar) {
42148
- const {
42149
- currentProduct
42150
- } = getStaticData();
42151
- if (currentProduct) {
42152
- loadProductDataToStore(currentProduct.externalId);
42153
- }
42154
- }
42155
- });
42156
- }
42157
- async function loadProductData(externalId) {
42158
- const {
42159
- brandId
42160
- } = getStaticData();
42161
- const style = await getStyleByExternalId(brandId, externalId);
42162
- if (!style) {
42163
- throw new Error(`Style not found for externalId: ${externalId}`);
42164
- }
42165
- const sizeFitRecommendation = await getSizeRecommendation(style.id);
42166
- return {
42167
- externalId,
42168
- style,
42169
- sizeFitRecommendation
42170
- };
42171
- }
42172
- function loadProductDataToStore(externalId) {
42173
- async function loadAndStore() {
42174
- try {
42175
- const productData2 = await loadProductData(externalId);
42176
- useMainStore.getState().setProductData(productData2.externalId, productData2);
42177
- logger$7.logDebug(`Loaded product data for externalId: ${externalId}`, {
42178
- productData: productData2
42179
- });
42180
- } catch (error) {
42181
- logger$7.logError(`Error loading product data for externalId: ${externalId}`, {
42182
- error
42183
- });
42184
- }
42185
- }
42186
- const {
42187
- userIsLoggedIn,
42188
- userHasAvatar,
42189
- productData
42190
- } = useMainStore.getState();
42191
- if (productData[externalId] || !userIsLoggedIn || userHasAvatar === false) {
42192
- return;
42193
- }
42194
- loadAndStore();
44091
+ ] }) })
44092
+ ] }),
44093
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleLineRow, children: [
44094
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
44095
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " }),
44096
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " })
44097
+ ] }),
44098
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
44099
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " }),
44100
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " })
44101
+ ] }),
44102
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }) }),
44103
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
44104
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }),
44105
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " })
44106
+ ] }),
44107
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
44108
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " }),
44109
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " })
44110
+ ] })
44111
+ ] }),
44112
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleCategoryLabelRow, children: [
44113
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelLeft, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelPoorFitText, t: "fit-chart.fit.poor_fit" }) }) }),
44114
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelCenter, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelGoodFitText, t: "fit-chart.fit.acceptable_fit" }) }) }),
44115
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleCategoryLabelRight, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleCategoryLabelPoorFitText, t: "fit-chart.fit.poor_fit" }) }) })
44116
+ ] })
44117
+ ] }),
44118
+ /* @__PURE__ */ jsx$1("div", { css: css2.chartTitleContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartTitleText, t: "fit-chart.measurement_points" }) }),
44119
+ /* @__PURE__ */ jsxs("div", { css: css2.chartContainer, children: [
44120
+ /* @__PURE__ */ jsx$1("img", { src: getExternalAssetUrl("fit-chart-outline.png"), alt: "Fit Chart", css: css2.chartImage }),
44121
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine1, "", ""], children: " " }),
44122
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine2, "", ""], children: " " }),
44123
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine3, "", ""], children: " " }),
44124
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine4, "", ""], children: " " }),
44125
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine5, "", ""], children: " " }),
44126
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6a, "", ""], children: " " }),
44127
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6b, "", ""], children: " " }),
44128
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel1, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.bust" }) }),
44129
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel2, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.waist" }) }),
44130
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel3, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.pant_waist" }) }),
44131
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel4, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.high_hip" }) }),
44132
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel5, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.low_hip" }) }),
44133
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel6, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.thigh" }) })
44134
+ ] })
44135
+ ] })
44136
+ ] });
42195
44137
  }
42196
44138
  const NON_PRIORITY_VTO_REQUEST_DELAY_MS = 500;
42197
44139
  const AVATAR_IMAGE_ASPECT_RATIO = 2 / 3;
42198
44140
  const AVATAR_GUTTER_HEIGHT_PX = 100;
42199
44141
  const CONTENT_AREA_WIDTH_PX = 550;
42200
44142
  const logger$6 = getLogger("overlays/vto-single");
42201
- function compositionKey(csaId, tucked) {
44143
+ function compositionKey(csaId, untucked) {
42202
44144
  return `${csaId}:${0}`;
42203
44145
  }
42204
44146
  function VtoSingleOverlay() {
@@ -42402,7 +44344,7 @@ function VtoSingleOverlay() {
42402
44344
  compositionTokensRef.current.set(key, "");
42403
44345
  requestVto([{
42404
44346
  colorway_size_asset_id: csaId,
42405
- tucked: false
44347
+ untucked: false
42406
44348
  }]).then((resp) => {
42407
44349
  compositionTokensRef.current.set(key, resp.token);
42408
44350
  subscribeToCompositionToken(resp.token, sizeColorRecord.sku);
@@ -42480,6 +44422,9 @@ function VtoSingleOverlay() {
42480
44422
  }
42481
44423
  }, [requestVto$1, selectedColorSizeRecord]);
42482
44424
  reactExports.useEffect(() => {
44425
+ if (!getStaticData().config.features.vtoPrefetch) {
44426
+ return;
44427
+ }
42483
44428
  if (!vtoProductData) {
42484
44429
  return;
42485
44430
  }
@@ -42613,7 +44558,11 @@ function MobileLayout({
42613
44558
  onAddToCart,
42614
44559
  onSignOut
42615
44560
  }) {
42616
- const [contentView, setContentView] = reactExports.useState("collapsed");
44561
+ const {
44562
+ snap: contentView,
44563
+ setSnap: setContentView,
44564
+ handleTouchStart: handleBottomFrameTouchStart
44565
+ } = useMobileSheetSnap("collapsed");
42617
44566
  const bottomFrameInnerRef = reactExports.useRef(null);
42618
44567
  const [bottomFrameOuterStyle, setBottomFrameOuterStyle] = reactExports.useState({});
42619
44568
  const [bottomFrameInnerStyle, setBottomFrameInnerStyle] = reactExports.useState({});
@@ -42711,33 +44660,6 @@ function MobileLayout({
42711
44660
  setBottomFrameInnerStyle({});
42712
44661
  setTimeout(refreshBottomFrameStyle, 50);
42713
44662
  }, [contentView]);
42714
- const handleBottomFrameTouchStart = reactExports.useCallback((e) => {
42715
- let startY = e.touches[0].clientY;
42716
- const initialContentView = contentView;
42717
- const onTouchMove = (moveEvent) => {
42718
- const deltaY = moveEvent.touches[0].clientY - startY;
42719
- if (Math.abs(deltaY) >= 30) {
42720
- if (deltaY > 0) {
42721
- if (initialContentView === "full" || initialContentView === "expanded") {
42722
- setContentView("collapsed");
42723
- }
42724
- } else {
42725
- if (initialContentView === "collapsed") {
42726
- setContentView("expanded");
42727
- } else if (initialContentView === "expanded") {
42728
- setContentView("full");
42729
- }
42730
- }
42731
- document.removeEventListener("touchmove", onTouchMove);
42732
- }
42733
- };
42734
- document.addEventListener("touchmove", onTouchMove);
42735
- const onTouchEnd = () => {
42736
- document.removeEventListener("touchmove", onTouchMove);
42737
- document.removeEventListener("touchend", onTouchEnd);
42738
- };
42739
- document.addEventListener("touchend", onTouchEnd);
42740
- }, [contentView]);
42741
44663
  let aboveContentNode = null;
42742
44664
  if (contentView === "expanded" || contentView === "full") {
42743
44665
  aboveContentNode = /* @__PURE__ */ jsx$1(ProductSummaryRow, { loadedProductData });
@@ -43086,31 +45008,6 @@ function Avatar({
43086
45008
  flex: "none",
43087
45009
  height: "100%"
43088
45010
  },
43089
- imageContainer: {
43090
- position: "absolute"
43091
- },
43092
- image: {
43093
- objectFit: "contain",
43094
- cursor: "grab"
43095
- },
43096
- chevronLeftContainer: {
43097
- position: "absolute",
43098
- top: "50%",
43099
- left: "0",
43100
- transform: "translateY(-50%)",
43101
- cursor: "pointer"
43102
- },
43103
- chevronRightContainer: {
43104
- position: "absolute",
43105
- top: "50%",
43106
- right: "0",
43107
- transform: "translateY(-50%)",
43108
- cursor: "pointer"
43109
- },
43110
- chevronIcon: {
43111
- width: "48px",
43112
- height: "48px"
43113
- },
43114
45011
  bottomContainer: {
43115
45012
  position: "absolute",
43116
45013
  bottom: "1px",
@@ -43221,94 +45118,14 @@ function Avatar({
43221
45118
  window.removeEventListener("resize", refreshLayoutData);
43222
45119
  };
43223
45120
  }, [isMobileLayout]);
43224
- reactExports.useEffect(() => {
43225
- if (frameUrls && frameUrls.length > 0 && selectedFrameIndex == null) {
43226
- let currentFrameIndex = 0;
43227
- setSelectedFrameIndex(currentFrameIndex);
43228
- const intervalId = setInterval(() => {
43229
- currentFrameIndex = (currentFrameIndex + 1) % frameUrls.length;
43230
- setSelectedFrameIndex(currentFrameIndex);
43231
- if (currentFrameIndex === 0) {
43232
- clearInterval(intervalId);
43233
- }
43234
- }, 500);
43235
- }
43236
- }, [frameUrls, selectedFrameIndex]);
43237
- const rotateLeft = reactExports.useCallback(() => {
43238
- setSelectedFrameIndex((prevIndex) => {
43239
- if (prevIndex == null) {
43240
- return null;
43241
- }
43242
- return prevIndex === 0 ? frameUrls ? frameUrls.length - 1 : 0 : prevIndex - 1;
43243
- });
43244
- }, [frameUrls]);
43245
- const rotateRight = reactExports.useCallback(() => {
43246
- setSelectedFrameIndex((prevIndex) => {
43247
- if (prevIndex == null) {
43248
- return null;
43249
- }
43250
- return prevIndex === (frameUrls ? frameUrls.length - 1 : 0) ? 0 : prevIndex + 1;
43251
- });
43252
- }, [frameUrls]);
43253
- const handleImageMouseDrag = reactExports.useCallback((e) => {
43254
- e.preventDefault();
43255
- let startX = e.clientX;
43256
- const onMouseMove = (moveEvent) => {
43257
- const deltaX = moveEvent.clientX - startX;
43258
- if (Math.abs(deltaX) >= 50) {
43259
- if (deltaX > 0) {
43260
- rotateRight();
43261
- } else {
43262
- rotateLeft();
43263
- }
43264
- startX = moveEvent.clientX;
43265
- }
43266
- };
43267
- const onMouseUp = () => {
43268
- window.removeEventListener("mousemove", onMouseMove);
43269
- window.removeEventListener("mouseup", onMouseUp);
43270
- };
43271
- window.addEventListener("mousemove", onMouseMove);
43272
- window.addEventListener("mouseup", onMouseUp);
43273
- }, [rotateLeft, rotateRight]);
43274
- const handleImageTouchDrag = reactExports.useCallback((e) => {
43275
- e.preventDefault();
43276
- let startX = e.touches[0].clientX;
43277
- const onTouchMove = (moveEvent) => {
43278
- const deltaX = moveEvent.touches[0].clientX - startX;
43279
- if (Math.abs(deltaX) >= 50) {
43280
- if (deltaX > 0) {
43281
- rotateRight();
43282
- } else {
43283
- rotateLeft();
43284
- }
43285
- startX = moveEvent.touches[0].clientX;
43286
- }
43287
- };
43288
- const onTouchEnd = () => {
43289
- window.removeEventListener("touchmove", onTouchMove);
43290
- window.removeEventListener("touchend", onTouchEnd);
43291
- };
43292
- window.addEventListener("touchmove", onTouchMove);
43293
- window.addEventListener("touchend", onTouchEnd);
43294
- }, [rotateLeft, rotateRight]);
43295
- let contentNode;
43296
- if (frameUrls && selectedFrameIndex != null) {
43297
- contentNode = /* @__PURE__ */ jsxs(Fragment, { children: [
43298
- /* @__PURE__ */ jsxs("div", { css: css2.imageContainer, style: layoutData.imageContainerStyle, children: [
43299
- /* @__PURE__ */ jsx$1("img", { src: frameUrls[selectedFrameIndex], css: css2.image, style: layoutData.imageStyle, onMouseDown: handleImageMouseDrag, onTouchStart: handleImageTouchDrag }),
43300
- /* @__PURE__ */ jsx$1("div", { css: css2.chevronLeftContainer, onClick: rotateLeft, children: /* @__PURE__ */ jsx$1(SvgChevronLeft, { css: css2.chevronIcon }) }),
43301
- /* @__PURE__ */ jsx$1("div", { css: css2.chevronRightContainer, onClick: rotateRight, children: /* @__PURE__ */ jsx$1(SvgChevronRight, { css: css2.chevronIcon }) })
43302
- ] }),
43303
- /* @__PURE__ */ jsx$1("div", { css: css2.bottomContainer, style: layoutData.bottomContainerStyle, children: isMobileLayout ? /* @__PURE__ */ jsx$1(Fragment, { children: " " }) : /* @__PURE__ */ jsxs(Fragment, { children: [
43304
- /* @__PURE__ */ jsx$1("input", { type: "range", min: 0, max: frameUrls.length - 1, step: 1, value: selectedFrameIndex, onChange: (e) => setSelectedFrameIndex(Number(e.target.value)), css: css2.sliderInput }),
43305
- /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "vto-single.slide_to_rotate", css: css2.sliderText })
43306
- ] }) })
43307
- ] });
43308
- } else {
43309
- contentNode = /* @__PURE__ */ jsx$1(Loading, { t: "vto-single.avatar_loading" });
43310
- }
43311
- return /* @__PURE__ */ jsx$1("div", { css: css2.topContainer, style: layoutData.topContainerStyle, children: contentNode });
45121
+ const isReady = !!frameUrls && selectedFrameIndex != null;
45122
+ return /* @__PURE__ */ jsxs("div", { css: css2.topContainer, style: layoutData.topContainerStyle, children: [
45123
+ /* @__PURE__ */ jsx$1(AvatarFrameViewer, { frameUrls, selectedFrameIndex, setSelectedFrameIndex, imageContainerStyle: layoutData.imageContainerStyle, imageStyle: layoutData.imageStyle, loadingT: "vto-single.avatar_loading" }),
45124
+ isReady ? /* @__PURE__ */ jsx$1("div", { css: css2.bottomContainer, style: layoutData.bottomContainerStyle, children: isMobileLayout ? /* @__PURE__ */ jsx$1(Fragment, { children: " " }) : /* @__PURE__ */ jsxs(Fragment, { children: [
45125
+ /* @__PURE__ */ jsx$1("input", { type: "range", min: 0, max: frameUrls.length - 1, step: 1, value: selectedFrameIndex, onChange: (e) => setSelectedFrameIndex(Number(e.target.value)), css: css2.sliderInput }),
45126
+ /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "vto-single.slide_to_rotate", css: css2.sliderText })
45127
+ ] }) }) : null
45128
+ ] });
43312
45129
  }
43313
45130
  function ProductSummaryRow({
43314
45131
  loadedProductData
@@ -43365,42 +45182,6 @@ function ColorSelector({
43365
45182
  /* @__PURE__ */ jsx$1("select", { value: selectedColorLabel ?? "", onChange: handleColorSelectChange, css: css2.colorSelect, children: availableColorLabels.map((colorLabel) => /* @__PURE__ */ jsx$1("option", { value: colorLabel, children: colorLabel }, colorLabel)) })
43366
45183
  ] }) });
43367
45184
  }
43368
- function SizeSelector({
43369
- loadedProductData,
43370
- selectedSizeLabel,
43371
- onChangeSize
43372
- }) {
43373
- const css2 = useCss((_theme) => ({
43374
- container: {
43375
- display: "flex",
43376
- alignItems: "center",
43377
- gap: "12px"
43378
- },
43379
- button: {
43380
- width: "54px",
43381
- height: "44px",
43382
- border: "1px solid rgba(33, 32, 31, 0.2)",
43383
- padding: "9px 5px"
43384
- },
43385
- selectedButton: {
43386
- border: "1px solid rgb(33, 32, 31)",
43387
- cursor: "default"
43388
- }
43389
- }));
43390
- const sizeSelectorNodeList = reactExports.useMemo(() => loadedProductData.sizes.map((sizeRecord) => {
43391
- const isSelected = sizeRecord.sizeLabel === selectedSizeLabel;
43392
- return /* @__PURE__ */ jsx$1(Button, { variant: "base", css: /* @__PURE__ */ css$1({
43393
- ...css2.button,
43394
- ...isSelected && css2.selectedButton
43395
- }, "", ""), onClick: () => {
43396
- if (isSelected) {
43397
- return;
43398
- }
43399
- onChangeSize(sizeRecord.sizeLabel);
43400
- }, children: sizeRecord.sizeLabel }, sizeRecord.sizeLabel);
43401
- }), [loadedProductData.sizes, selectedSizeLabel, onChangeSize]);
43402
- return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: sizeSelectorNodeList });
43403
- }
43404
45185
  function RecommendedSizeText({
43405
45186
  loadedProductData,
43406
45187
  textCss
@@ -43409,74 +45190,6 @@ function RecommendedSizeText({
43409
45190
  size: loadedProductData.recommendedSizeLabel
43410
45191
  } });
43411
45192
  }
43412
- function ItemFitText({
43413
- loadedProductData,
43414
- textCss
43415
- }) {
43416
- const {
43417
- t
43418
- } = useTranslation();
43419
- return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: textCss, t: "size-rec.item_fit", vars: {
43420
- fit: t(`size-rec.fitClassification.${loadedProductData.fitClassification}`) || loadedProductData.fitClassification
43421
- } });
43422
- }
43423
- function ItemFitDetails({
43424
- loadedProductData,
43425
- selectedSizeLabel
43426
- }) {
43427
- const {
43428
- t
43429
- } = useTranslation();
43430
- const css2 = useCss((_theme) => ({
43431
- container: {
43432
- width: "100%"
43433
- },
43434
- line: {
43435
- display: "flex",
43436
- justifyContent: "space-between",
43437
- alignItems: "center",
43438
- gap: "8px",
43439
- marginTop: "4px",
43440
- borderTop: "1px solid rgb(33, 32, 31)",
43441
- paddingTop: "4px"
43442
- },
43443
- firstLine: {
43444
- borderTop: "none",
43445
- marginTop: "0px",
43446
- paddingTop: "0px"
43447
- },
43448
- detailCell: {
43449
- display: "flex",
43450
- alignItems: "center",
43451
- gap: "6px"
43452
- }
43453
- }));
43454
- const fitLineNodeList = reactExports.useMemo(() => {
43455
- const selectedSizeRecord = loadedProductData.sizes.find((s) => s.sizeLabel === selectedSizeLabel);
43456
- if (!selectedSizeRecord) {
43457
- return null;
43458
- }
43459
- return selectedSizeRecord.fit.measurement_location_fits.map((mlf, index) => {
43460
- const locationLabel = t(`size-rec.measurementLocation.${mlf.measurement_location}`) || mlf.measurement_location;
43461
- const fit = mlf.fit;
43462
- const fitLabel = t(`size-rec.fit.${fit}`) || fit;
43463
- return /* @__PURE__ */ jsxs("div", { css: [css2.line, index === 0 && css2.firstLine, "", ""], children: [
43464
- /* @__PURE__ */ jsx$1("div", { css: css2.detailCell, children: locationLabel }),
43465
- /* @__PURE__ */ jsx$1("div", { css: css2.detailCell, children: fit === "perfect_fit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
43466
- /* @__PURE__ */ jsx$1(SvgCheckCircle, {}),
43467
- " ",
43468
- fitLabel
43469
- ] }) : fitLabel })
43470
- ] }, index);
43471
- });
43472
- }, [loadedProductData, selectedSizeLabel]);
43473
- return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: fitLineNodeList });
43474
- }
43475
- function AddToCartButton({
43476
- onClick
43477
- }) {
43478
- return /* @__PURE__ */ jsx$1(ButtonT, { variant: "brand", t: "vto-single.add_to_cart", onClick });
43479
- }
43480
45193
  function ProductDescriptionText({
43481
45194
  loadedProductData
43482
45195
  }) {
@@ -43527,8 +45240,10 @@ function AddToFittingRoomCompactWidget({
43527
45240
  currentProduct
43528
45241
  } = getStaticData();
43529
45242
  const attrProductId = attributes["product-id"];
45243
+ const attrProductHandle = attributes["product-handle"];
43530
45244
  const productId = attrProductId || currentProduct?.externalId || null;
43531
45245
  const isPdp = productId != null && productId === currentProduct?.externalId;
45246
+ const productHandle = attrProductHandle || (isPdp ? currentProduct?.handle ?? null : null);
43532
45247
  const isInFittingRoom = useMainStore((state) => productId == null ? false : state.fittingRoom.some((item) => item.externalId === productId));
43533
45248
  const css2 = useCss((theme) => ({
43534
45249
  button: {
@@ -43559,7 +45274,7 @@ function AddToFittingRoomCompactWidget({
43559
45274
  return null;
43560
45275
  }
43561
45276
  const handleClick = () => {
43562
- toggleFittingRoomItem(productId, isPdp).catch((error) => {
45277
+ toggleFittingRoomItem(productId, productHandle, isPdp).catch((error) => {
43563
45278
  logger$5.logError("toggleFittingRoomItem failed", {
43564
45279
  error
43565
45280
  });
@@ -43576,8 +45291,10 @@ function AddToFittingRoomWidget({
43576
45291
  currentProduct
43577
45292
  } = getStaticData();
43578
45293
  const attrProductId = attributes["product-id"];
45294
+ const attrProductHandle = attributes["product-handle"];
43579
45295
  const productId = attrProductId || currentProduct?.externalId || null;
43580
45296
  const isPdp = productId != null && productId === currentProduct?.externalId;
45297
+ const productHandle = attrProductHandle || (isPdp ? currentProduct?.handle ?? null : null);
43581
45298
  const isInFittingRoom = useMainStore((state) => productId == null ? false : state.fittingRoom.some((item) => item.externalId === productId));
43582
45299
  const css2 = useCss((theme) => ({
43583
45300
  button: {
@@ -43611,7 +45328,7 @@ function AddToFittingRoomWidget({
43611
45328
  return null;
43612
45329
  }
43613
45330
  const handleClick = () => {
43614
- toggleFittingRoomItem(productId, isPdp).catch((error) => {
45331
+ toggleFittingRoomItem(productId, productHandle, isPdp).catch((error) => {
43615
45332
  logger$4.logError("toggleFittingRoomItem failed", {
43616
45333
  error
43617
45334
  });
@@ -43989,6 +45706,14 @@ const useMainStore = create((set) => ({
43989
45706
  [externalId]: data
43990
45707
  }
43991
45708
  })),
45709
+ // Merchant-supplied product data:
45710
+ merchantProductData: {},
45711
+ setMerchantProductData: (externalId, data) => set((prevState) => ({
45712
+ merchantProductData: {
45713
+ ...prevState.merchantProductData,
45714
+ [externalId]: data
45715
+ }
45716
+ })),
43992
45717
  // Fitting room:
43993
45718
  fittingRoom: [],
43994
45719
  addToFittingRoom: (item) => set((prevState) => {
@@ -44077,9 +45802,9 @@ const SHARED_CONFIG = {
44077
45802
  appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
44078
45803
  },
44079
45804
  build: {
44080
- version: `${"5.0.18"}`,
44081
- commitHash: `${"4cc3c8d"}`,
44082
- date: `${"2026-05-10T18:45:37.502Z"}`
45805
+ version: `${"5.0.19"}`,
45806
+ commitHash: `${"46d41c2"}`,
45807
+ date: `${"2026-05-15T19:28:45.079Z"}`
44083
45808
  }
44084
45809
  };
44085
45810
  const CONFIGS = {
@@ -44105,6 +45830,9 @@ const CONFIGS = {
44105
45830
  frames: {
44106
45831
  baseUrl: "https://assets.dev.thefittingroom.xyz"
44107
45832
  },
45833
+ features: {
45834
+ vtoPrefetch: false
45835
+ },
44108
45836
  ...SHARED_CONFIG
44109
45837
  },
44110
45838
  [
@@ -44129,6 +45857,9 @@ const CONFIGS = {
44129
45857
  frames: {
44130
45858
  baseUrl: "https://assets.p.thefittingroom.xyz"
44131
45859
  },
45860
+ features: {
45861
+ vtoPrefetch: false
45862
+ },
44132
45863
  ...SHARED_CONFIG
44133
45864
  },
44134
45865
  [
@@ -44145,13 +45876,16 @@ const CONFIGS = {
44145
45876
  measurementId: "G-B7GDQ1Y9LL"
44146
45877
  },
44147
45878
  api: {
44148
- baseUrl: "http://localhost:8080"
45879
+ baseUrl: "https://minecraftbadapple.com/api"
44149
45880
  },
44150
45881
  asset: {
44151
- baseUrl: "http://localhost:9000/tfr-assets-dev/shop-sdk/assets/v5"
45882
+ baseUrl: "http://minecraftbadapple.com/s3/tfr-assets-dev/shop-sdk/assets/v5"
44152
45883
  },
44153
45884
  frames: {
44154
- baseUrl: "http://localhost:9000/tfr-assets-dev"
45885
+ baseUrl: "http://minecraftbadapple.com/s3/tfr-assets-dev"
45886
+ },
45887
+ features: {
45888
+ vtoPrefetch: false
44155
45889
  },
44156
45890
  ...SHARED_CONFIG
44157
45891
  }
@@ -44181,7 +45915,8 @@ async function init(initParams) {
44181
45915
  theme = null,
44182
45916
  debug,
44183
45917
  productLookup,
44184
- getOverlayTopOffset
45918
+ getOverlayTopOffset,
45919
+ addToCart
44185
45920
  } = initParams;
44186
45921
  if (!brandId || typeof brandId !== "number" || isNaN(brandId) || brandId <= 0) {
44187
45922
  throw new Error(`Invalid brandId "${brandId}"`);
@@ -44206,7 +45941,8 @@ async function init(initParams) {
44206
45941
  environment,
44207
45942
  config,
44208
45943
  productLookup: productLookup ?? null,
44209
- getOverlayTopOffset: getOverlayTopOffset ?? null
45944
+ getOverlayTopOffset: getOverlayTopOffset ?? null,
45945
+ addToCart: addToCart ?? null
44210
45946
  });
44211
45947
  _init$7();
44212
45948
  _init$5();