@thefittingroom/shop-ui 5.0.4 → 5.0.7

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 +845 -108
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19034,8 +19034,9 @@ const en$1 = {
19034
19034
  "get-app": { "create_avatar": "Create your avatar" },
19035
19035
  "sign-in": { "email": "Email", "password": "Password", "forgot_password": "Forgot password?", "sign_in": "Sign in", "no_account": "Don’t have an account?", "download_app": "Download the app.", "invalid_email": "Please enter a valid email address.", "missing_password": "Please enter your password.", "login_failed": "Incorrect email or password." },
19036
19036
  "forgot-password": { "title": "Forgot password", "description": "We’ll send you an email with a link to reset your password.", "send_link": "Send link", "link_sent": "Link sent! Please check your email.", "need_help": "Need help?", "contact_us": "Contact us." },
19037
- "vto-single": { "avatar_loading": "Finding your perfect fit...", "slide_to_rotate": "Slide to rotate", "sign_out": "Sign out", "color_label": "Color:", "add_to_cart": "Add to cart" },
19038
- "size-rec": { "recommended_size": "Recommended Size: {{size}}", "item_fit": "This item is {{fit}}", "select_size": "Select a size to see how it fits", "fitClassification": { "form_fitting": "Form Fitting", "slim_fit": "Slim Fit", "regular_fit": "Regular Fit", "relaxed_fit": "Relaxed Fit", "oversized_fit": "Oversized Fit" }, "measurementLocation": { "neck_base": "Neck", "across_shoulder": "Shoulders", "cb_neck_to_wrist": "Neck to Wrist", "sleeve_length_from_shoulder_point": "Sleeve", "bust": "Bust", "waist": "Waist", "low_waist": "Low Waist", "low_hip": "Low Hip", "high_hip": "High Hip", "thigh": "Thigh", "inseam": "Inseam", "hsp_to_low_hip": "HSP to Low Hip", "hsp_to_crotch": "HSP to Crotch", "low_hip_bottoms": "Low Hip (Bottoms)", "high_hip_bottoms": "High Hip (Bottoms)" }, "fit": { "too_tight": "Too Tight", "tight": "Tight", "slightly_tight": "Slightly Tight", "perfect_fit": "Perfect Fit", "slightly_loose": "Slightly Loose", "loose": "Loose", "oversized": "Oversized", "too_short": "Too Short", "short": "Short", "slightly_short": "Slightly Short", "slightly_long": "Slightly Long", "long": "Long", "too_long": "Too Long" } }
19037
+ "vto-single": { "avatar_loading": "Finding your perfect fit...", "slide_to_rotate": "Slide to rotate", "sign_out": "Sign out", "color_label": "Color:", "add_to_cart": "Add to cart", "view_product_details": "View product details", "hide_product_details": "Hide product details" },
19038
+ "size-rec": { "recommended_size": "Recommended Size: {{size}}", "item_fit": "This item is {{fit}}", "select_size": "Select a size to see how it fits", "fitClassification": { "form_fitting": "Form Fitting", "slim_fit": "Slim Fit", "regular_fit": "Regular Fit", "relaxed_fit": "Relaxed Fit", "oversized_fit": "Oversized Fit" }, "measurementLocation": { "neck_base": "Neck", "across_shoulder": "Shoulders", "cb_neck_to_wrist": "Neck to Wrist", "sleeve_length_from_shoulder_point": "Sleeve", "bust": "Bust", "waist": "Waist", "low_waist": "Low Waist", "high_hip": "High Hip", "low_hip": "Low Hip", "thigh": "Thigh", "inseam": "Inseam", "hsp_to_low_hip": "HSP to Low Hip", "hsp_to_crotch": "HSP to Crotch", "low_hip_bottoms": "Low Hip (Bottoms)", "high_hip_bottoms": "High Hip (Bottoms)" }, "fit": { "too_tight": "Too Tight", "tight": "Tight", "slightly_tight": "Slightly Tight", "perfect_fit": "Perfect Fit", "slightly_loose": "Slightly Loose", "loose": "Loose", "oversized": "Oversized", "too_short": "Too Short", "short": "Short", "slightly_short": "Slightly Short", "slightly_long": "Slightly Long", "long": "Long", "too_long": "Too Long" } },
19039
+ "fit-chart": { "fit_scale": "Fit Scale", "fit": { "poor_fit": "Poor Fit", "acceptable_fit": "Acceptable Fit", "too_tight": "Too Tight", "tight": "Tight or More Fitted", "slightly_tight": "Slightly Tight or Fitted", "perfect_fit": "Perfect Fit", "slightly_loose": "Slightly Loose or Less Fitted", "loose": "Loose or Not Fitted", "oversized": "Oversized" }, "measurement_points": "Measurement Points", "point": { "bust": "Chest/Bust", "waist": "Natural Waist", "pant_waist": "Pant Waist", "high_hip": "High Hip", "low_hip": "Low Hip", "thigh": "Thigh" } }
19039
19040
  };
19040
19041
  const try_it_on = "Essayez-le";
19041
19042
  const powered_by = "Alimenté par";
@@ -19049,8 +19050,9 @@ const fr = {
19049
19050
  "get-app": { "create_avatar": "Créez votre avatar" },
19050
19051
  "sign-in": { "email": "Email", "password": "Mot de passe", "forgot_password": "Mot de passe oublié ?", "sign_in": "Se connecter", "no_account": "Vous n'avez pas de compte ?", "download_app": "Téléchargez l'application.", "invalid_email": "Veuillez entrer une adresse e-mail valide.", "missing_password": "Veuillez entrer votre mot de passe.", "login_failed": "Email ou mot de passe incorrect." },
19051
19052
  "forgot-password": { "title": "Mot de passe oublié", "description": "Nous vous enverrons un e-mail avec un lien pour réinitialiser votre mot de passe.", "send_link": "Envoyer le lien", "link_sent": "Lien envoyé ! Veuillez vérifier votre e-mail.", "need_help": "Besoin d'aide ?", "contact_us": "Contactez-nous." },
19052
- "vto-single": { "avatar_loading": "Trouver votre ajustement parfait...", "slide_to_rotate": "Faites glisser pour faire pivoter", "sign_out": "Se déconnecter", "color_label": "Couleur :", "add_to_cart": "Ajouter au panier" },
19053
- "size-rec": { "recommended_size": "Taille recommandée : {{size}}", "item_fit": "Cet article est {{fit}}", "select_size": "Sélectionnez une taille pour voir comment elle s'adapte", "fitClassification": { "form_fitting": "Ajusté", "slim_fit": "Coupe slim", "regular_fit": "Coupe régulière", "relaxed_fit": "Coupe décontractée", "oversized_fit": "Coupe oversize" }, "measurementLocation": { "neck_base": "Cou", "across_shoulder": "Épaules", "cb_neck_to_wrist": "Cou jusqu'au poignet", "sleeve_length_from_shoulder_point": "Manche", "bust": "Buste", "waist": "Taille", "low_waist": "Bas de la taille", "low_hip": "Bas des hanches", "high_hip": "Haut des hanches", "thigh": "Cuisse", "inseam": "Entrejambe", "hsp_to_low_hip": "HSP au bas des hanches", "hsp_to_crotch": "HSP à l'entrejambe", "low_hip_bottoms": "Bas des hanches (bas)", "high_hip_bottoms": "Haut des hanches (bas)" }, "fit": { "too_tight": "Trop serré", "tight": "Serré", "slightly_tight": "Légèrement serré", "perfect_fit": "Parfait", "slightly_loose": "Légèrement ample", "loose": "Ample", "oversized": "Oversize", "too_short": "Trop court", "short": "Court", "slightly_short": "Légèrement court", "slightly_long": "Légèrement long", "long": "Long", "too_long": "Trop long" } }
19053
+ "vto-single": { "avatar_loading": "Trouver votre ajustement parfait...", "slide_to_rotate": "Faites glisser pour faire pivoter", "sign_out": "Se déconnecter", "color_label": "Couleur :", "add_to_cart": "Ajouter au panier", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit" },
19054
+ "size-rec": { "recommended_size": "Taille recommandée : {{size}}", "item_fit": "Cet article est {{fit}}", "select_size": "Sélectionnez une taille pour voir comment elle s'adapte", "fitClassification": { "form_fitting": "Ajusté", "slim_fit": "Coupe slim", "regular_fit": "Coupe régulière", "relaxed_fit": "Coupe décontractée", "oversized_fit": "Coupe oversize" }, "measurementLocation": { "neck_base": "Cou", "across_shoulder": "Épaules", "cb_neck_to_wrist": "Cou jusqu'au poignet", "sleeve_length_from_shoulder_point": "Manche", "bust": "Buste", "waist": "Taille", "low_waist": "Bas de la taille", "high_hip": "Haut des hanches", "low_hip": "Bas des hanches", "thigh": "Cuisse", "inseam": "Entrejambe", "hsp_to_low_hip": "HSP au bas des hanches", "hsp_to_crotch": "HSP à l'entrejambe", "low_hip_bottoms": "Bas des hanches (bas)", "high_hip_bottoms": "Haut des hanches (bas)" }, "fit": { "too_tight": "Trop serré", "tight": "Serré", "slightly_tight": "Légèrement serré", "perfect_fit": "Parfait", "slightly_loose": "Légèrement ample", "loose": "Ample", "oversized": "Oversize", "too_short": "Trop court", "short": "Court", "slightly_short": "Légèrement court", "slightly_long": "Légèrement long", "long": "Long", "too_long": "Trop long" } },
19055
+ "fit-chart": { "fit_scale": "Échelle d'ajustement", "fit": { "poor_fit": "Mauvais ajustement", "acceptable_fit": "Ajustement acceptable", "too_tight": "Trop serré", "tight": "Serré ou plus ajusté", "slightly_tight": "Légèrement serré ou ajusté", "perfect_fit": "Parfait", "slightly_loose": "Légèrement ample ou moins ajusté", "loose": "Ample ou non ajusté", "oversized": "Oversize" }, "measurement_points": "Points de mesure", "point": { "bust": "Poitrine/Buste", "waist": "Taille naturelle", "pant_waist": "Taille du pantalon", "high_hip": "Haut des hanches", "low_hip": "Bas des hanches", "thigh": "Cuisse" } }
19054
19056
  };
19055
19057
  instance.use(initReactI18next).init({
19056
19058
  lng: "en",
@@ -19116,6 +19118,9 @@ function _init$6(initThemeData) {
19116
19118
  Object.assign(themeData, initThemeData);
19117
19119
  }
19118
19120
  }
19121
+ function getThemeData() {
19122
+ return themeData;
19123
+ }
19119
19124
  function useCss(callback) {
19120
19125
  return reactExports.useMemo(() => callback(themeData), []);
19121
19126
  }
@@ -20736,6 +20741,7 @@ const SvgCheckCircle = (props) => /* @__PURE__ */ reactExports.createElement("sv
20736
20741
  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" })));
20737
20742
  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" })));
20738
20743
  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" }));
20744
+ 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" }));
20739
20745
  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" }));
20740
20746
  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 }));
20741
20747
  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" }));
@@ -20873,6 +20879,7 @@ function ModalTitlebar({
20873
20879
  ] });
20874
20880
  }
20875
20881
  function SidecarModalFrame({
20882
+ contentStyle,
20876
20883
  onRequestClose,
20877
20884
  children
20878
20885
  }) {
@@ -20896,11 +20903,16 @@ function SidecarModalFrame({
20896
20903
  height: "100vh",
20897
20904
  margin: 0,
20898
20905
  padding: 0,
20906
+ overflow: "hidden",
20899
20907
  border: "none",
20900
20908
  backgroundColor: "#FFFFFF"
20901
20909
  }
20902
20910
  }));
20903
- return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose, contentStyle: isMobileLayout ? css2.frameContentFullScreen : css2.frameContentBase, children });
20911
+ const applyContentStyle = {
20912
+ ...isMobileLayout ? css2.frameContentFullScreen : css2.frameContentBase,
20913
+ ...contentStyle
20914
+ };
20915
+ return /* @__PURE__ */ jsx$1(ModalFrame, { isOpen: true, onRequestClose, contentStyle: applyContentStyle, children });
20904
20916
  }
20905
20917
  var dayjs_min$1 = { exports: {} };
20906
20918
  var dayjs_min = dayjs_min$1.exports;
@@ -41389,6 +41401,302 @@ function SignInOverlay({
41389
41401
  ] })
41390
41402
  ] }) });
41391
41403
  }
41404
+ function FitChart({
41405
+ onRequestClose
41406
+ }) {
41407
+ const scrollToRef = reactExports.useRef(null);
41408
+ const css2 = useCss((_theme) => ({
41409
+ frame: {
41410
+ position: "relative",
41411
+ width: "100%",
41412
+ border: "1px solid rgba(33, 32, 31, 0.2)",
41413
+ borderRadius: "12px"
41414
+ },
41415
+ closeButton: {
41416
+ position: "absolute",
41417
+ top: "16px",
41418
+ right: "16px"
41419
+ },
41420
+ closeIcon: {
41421
+ width: "12px",
41422
+ height: "12px"
41423
+ },
41424
+ contentContainer: {
41425
+ width: "100%",
41426
+ display: "flex",
41427
+ flexDirection: "column",
41428
+ justifyContent: "center",
41429
+ alignItems: "center",
41430
+ padding: "16px 16px 0 16px"
41431
+ },
41432
+ titleContainer: {},
41433
+ titleText: {
41434
+ fontSize: "24px",
41435
+ fontWeight: "bold",
41436
+ color: "#209da7"
41437
+ },
41438
+ scaleContainer: {
41439
+ position: "relative",
41440
+ width: "95%",
41441
+ marginTop: "16px",
41442
+ marginLeft: "auto",
41443
+ marginRight: "auto"
41444
+ },
41445
+ scaleSegment: {
41446
+ position: "relative",
41447
+ width: "100%",
41448
+ display: "flex",
41449
+ alignItems: "center"
41450
+ },
41451
+ scaleFitLabelRow: {
41452
+ display: "flex",
41453
+ justifyContent: "space-between"
41454
+ },
41455
+ scaleFitLabelContainer: {
41456
+ width: "100%",
41457
+ lineHeight: "11px",
41458
+ textAlign: "center"
41459
+ },
41460
+ scaleFitLabelPoorFitText: {
41461
+ fontSize: "8px",
41462
+ fontWeight: "500"
41463
+ },
41464
+ scaleFitLabelGoodFitText: {
41465
+ fontSize: "8px",
41466
+ fontWeight: "500",
41467
+ color: "#209da7"
41468
+ },
41469
+ scaleFitLabelLeftContainer: {
41470
+ marginTop: "4px",
41471
+ position: "relative",
41472
+ left: "-28px"
41473
+ },
41474
+ scaleFitLabelRightContainer: {
41475
+ marginTop: "4px",
41476
+ position: "relative",
41477
+ right: "-28px"
41478
+ },
41479
+ scaleLineRow: {
41480
+ marginTop: "8px",
41481
+ display: "flex",
41482
+ justifyContent: "space-between"
41483
+ },
41484
+ scalePointPoorFit: {
41485
+ width: "12px",
41486
+ height: "12px",
41487
+ borderRadius: "6px",
41488
+ backgroundColor: "black"
41489
+ },
41490
+ scalePointGoodFit: {
41491
+ width: "12px",
41492
+ height: "12px",
41493
+ borderRadius: "6px",
41494
+ backgroundColor: "#209da7"
41495
+ },
41496
+ scaleLinePoorFit: {
41497
+ width: "100%",
41498
+ height: "2px",
41499
+ backgroundColor: "black"
41500
+ },
41501
+ scaleLineGoodFit: {
41502
+ width: "100%",
41503
+ height: "2px",
41504
+ backgroundColor: "#209da7"
41505
+ },
41506
+ scaleCategoryLabelRow: {
41507
+ display: "flex",
41508
+ justifyContent: "space-between"
41509
+ },
41510
+ scaleCategoryLabelLeft: {
41511
+ width: "100%",
41512
+ paddingLeft: "16px",
41513
+ textAlign: "left"
41514
+ },
41515
+ scaleCategoryLabelCenter: {
41516
+ width: "100%",
41517
+ textAlign: "center"
41518
+ },
41519
+ scaleCategoryLabelRight: {
41520
+ width: "100%",
41521
+ paddingRight: "16px",
41522
+ textAlign: "right"
41523
+ },
41524
+ scaleCategoryLabelPoorFitText: {
41525
+ fontSize: "12px",
41526
+ fontWeight: "500"
41527
+ },
41528
+ scaleCategoryLabelGoodFitText: {
41529
+ fontSize: "12px",
41530
+ fontWeight: "500",
41531
+ color: "#209da7"
41532
+ },
41533
+ chartTitleContainer: {
41534
+ marginTop: "24px",
41535
+ textAlign: "center"
41536
+ },
41537
+ chartTitleText: {
41538
+ fontSize: "20px",
41539
+ fontWeight: "bold",
41540
+ color: "#7d7d7d"
41541
+ },
41542
+ chartContainer: {
41543
+ position: "relative",
41544
+ width: "300px",
41545
+ height: "310px"
41546
+ },
41547
+ chartImage: {
41548
+ display: "block",
41549
+ position: "absolute",
41550
+ top: "0",
41551
+ left: "80px",
41552
+ width: "135px",
41553
+ height: "300px",
41554
+ objectFit: "none"
41555
+ },
41556
+ chartLineBase: {
41557
+ position: "absolute",
41558
+ height: "1px",
41559
+ backgroundColor: "black"
41560
+ },
41561
+ chartLine1: {
41562
+ top: "142px",
41563
+ left: "112px",
41564
+ width: "72px"
41565
+ },
41566
+ chartLine2: {
41567
+ top: "173px",
41568
+ left: "117px",
41569
+ width: "60px"
41570
+ },
41571
+ chartLine3: {
41572
+ top: "193px",
41573
+ left: "114px",
41574
+ width: "67px"
41575
+ },
41576
+ chartLine4: {
41577
+ top: "210px",
41578
+ left: "102px",
41579
+ width: "90px"
41580
+ },
41581
+ chartLine5: {
41582
+ top: "243px",
41583
+ left: "97px",
41584
+ width: "101px"
41585
+ },
41586
+ chartLine6a: {
41587
+ top: "272px",
41588
+ left: "100px",
41589
+ width: "44px"
41590
+ },
41591
+ chartLine6b: {
41592
+ top: "272px",
41593
+ left: "150px",
41594
+ width: "44px"
41595
+ },
41596
+ chartLabelText: {
41597
+ fontSize: "12px"
41598
+ },
41599
+ chartLabelBase: {
41600
+ lineHeight: "20px",
41601
+ position: "absolute",
41602
+ borderBottom: "1px solid black",
41603
+ textAlign: "center"
41604
+ },
41605
+ chartLabel1: {
41606
+ top: "120px",
41607
+ left: "209px"
41608
+ },
41609
+ chartLabel2: {
41610
+ top: "151px",
41611
+ left: "207px"
41612
+ },
41613
+ chartLabel3: {
41614
+ top: "171px",
41615
+ left: "20px"
41616
+ },
41617
+ chartLabel4: {
41618
+ top: "188px",
41619
+ left: "213px"
41620
+ },
41621
+ chartLabel5: {
41622
+ top: "221px",
41623
+ left: "215px"
41624
+ },
41625
+ chartLabel6: {
41626
+ top: "250px",
41627
+ left: "44px"
41628
+ }
41629
+ }));
41630
+ reactExports.useEffect(() => {
41631
+ if (scrollToRef.current) {
41632
+ scrollToRef.current.scrollIntoView({
41633
+ behavior: "smooth"
41634
+ });
41635
+ }
41636
+ }, []);
41637
+ return /* @__PURE__ */ jsxs("div", { ref: scrollToRef, css: css2.frame, children: [
41638
+ /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.closeButton, onClick: onRequestClose, children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.closeIcon }) }),
41639
+ /* @__PURE__ */ jsxs("div", { css: css2.contentContainer, children: [
41640
+ /* @__PURE__ */ jsx$1("div", { css: css2.titleContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.titleText, t: "fit-chart.fit_scale" }) }),
41641
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleContainer, children: [
41642
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleFitLabelRow, children: [
41643
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsxs("div", { children: [
41644
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.tight" }) }),
41645
+ /* @__PURE__ */ jsx$1("div", { css: [css2.scaleFitLabelContainer, css2.scaleFitLabelLeftContainer, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.too_tight" }) })
41646
+ ] }) }),
41647
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelGoodFitText, t: "fit-chart.fit.slightly_tight" }) }) }),
41648
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelGoodFitText, t: "fit-chart.fit.perfect_fit" }) }) }),
41649
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelGoodFitText, t: "fit-chart.fit.slightly_loose" }) }) }),
41650
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsxs("div", { children: [
41651
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleFitLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.loose" }) }),
41652
+ /* @__PURE__ */ jsx$1("div", { css: [css2.scaleFitLabelContainer, css2.scaleFitLabelRightContainer, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.scaleFitLabelPoorFitText, t: "fit-chart.fit.oversized" }) })
41653
+ ] }) })
41654
+ ] }),
41655
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleLineRow, children: [
41656
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41657
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " }),
41658
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " })
41659
+ ] }),
41660
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41661
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " }),
41662
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " })
41663
+ ] }),
41664
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleSegment, children: /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }) }),
41665
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41666
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLineGoodFit, children: " " }),
41667
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointGoodFit, children: " " })
41668
+ ] }),
41669
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleSegment, children: [
41670
+ /* @__PURE__ */ jsx$1("div", { css: css2.scaleLinePoorFit, children: " " }),
41671
+ /* @__PURE__ */ jsx$1("div", { css: css2.scalePointPoorFit, children: " " })
41672
+ ] })
41673
+ ] }),
41674
+ /* @__PURE__ */ jsxs("div", { css: css2.scaleCategoryLabelRow, children: [
41675
+ /* @__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" }) }) }),
41676
+ /* @__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" }) }) }),
41677
+ /* @__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" }) }) })
41678
+ ] })
41679
+ ] }),
41680
+ /* @__PURE__ */ jsx$1("div", { css: css2.chartTitleContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartTitleText, t: "fit-chart.measurement_points" }) }),
41681
+ /* @__PURE__ */ jsxs("div", { css: css2.chartContainer, children: [
41682
+ /* @__PURE__ */ jsx$1("img", { src: getExternalAssetUrl("fit-chart-outline.png"), alt: "Fit Chart", css: css2.chartImage }),
41683
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine1, "", ""], children: " " }),
41684
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine2, "", ""], children: " " }),
41685
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine3, "", ""], children: " " }),
41686
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine4, "", ""], children: " " }),
41687
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine5, "", ""], children: " " }),
41688
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6a, "", ""], children: " " }),
41689
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLineBase, css2.chartLine6b, "", ""], children: " " }),
41690
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel1, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.bust" }) }),
41691
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel2, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.waist" }) }),
41692
+ /* @__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" }) }),
41693
+ /* @__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" }) }),
41694
+ /* @__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" }) }),
41695
+ /* @__PURE__ */ jsx$1("div", { css: [css2.chartLabelBase, css2.chartLabel6, "", ""], children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.chartLabelText, t: "fit-chart.point.thigh" }) })
41696
+ ] })
41697
+ ] })
41698
+ ] });
41699
+ }
41392
41700
  function Loading({
41393
41701
  t = "loading"
41394
41702
  }) {
@@ -41523,8 +41831,22 @@ async function getStyleByExternalId(brandId, externalId) {
41523
41831
  recordCache[cacheKey] = record;
41524
41832
  return record;
41525
41833
  }
41834
+ async function getStyleGarmentCategoryById(styleGarmentCategoryId) {
41835
+ const cacheKey = `getStyleGarmentCategoryById/${styleGarmentCategoryId}`;
41836
+ if (recordCache[cacheKey]) {
41837
+ return recordCache[cacheKey];
41838
+ }
41839
+ const firestore = getFirestoreManager();
41840
+ const record = await firestore.getDocData("style_garment_categories", styleGarmentCategoryId.toString());
41841
+ if (!record) {
41842
+ return null;
41843
+ }
41844
+ recordCache[cacheKey] = record;
41845
+ return record;
41846
+ }
41526
41847
  const AVATAR_IMAGE_ASPECT_RATIO = 2 / 3;
41527
- const AVATAR_DESKTOP_BOTTOM_CONTAINER_HEIGHT_PX = 100;
41848
+ const AVATAR_GUTTER_HEIGHT_PX = 100;
41849
+ const CONTENT_AREA_WIDTH_PX = 550;
41528
41850
  const logger$1 = getLogger("vto-single");
41529
41851
  function VtoSingleOverlay() {
41530
41852
  const {
@@ -41539,6 +41861,7 @@ function VtoSingleOverlay() {
41539
41861
  const [loadedProductData, setLoadedProductData] = reactExports.useState(null);
41540
41862
  const [selectedSizeLabel, setSelectedSizeLabel] = reactExports.useState(null);
41541
41863
  const [selectedColorLabel, setSelectedColorLabel] = reactExports.useState(null);
41864
+ const [modalStyle, setModalStyle] = reactExports.useState({});
41542
41865
  reactExports.useEffect(() => {
41543
41866
  if (!userIsLoggedIn) {
41544
41867
  openOverlay(OverlayName.LANDING, {
@@ -41573,6 +41896,8 @@ function VtoSingleOverlay() {
41573
41896
  logger$1.logError("Style not found for externalId:", currentProduct.externalId);
41574
41897
  return;
41575
41898
  }
41899
+ const styleGarmentCategoryRec = await getStyleGarmentCategoryById(styleRec.style_garment_category_id);
41900
+ const styleCategoryLabel = styleGarmentCategoryRec?.style_category_label ?? null;
41576
41901
  const sizeRecommendationRecord = await getSizeRecommendation(styleRec.id);
41577
41902
  let productData;
41578
41903
  const recommendedSizeLabel = getSizeLabelFromSize(sizeRecommendationRecord.recommended_size) ?? "(unknown)";
@@ -41619,7 +41944,8 @@ function VtoSingleOverlay() {
41619
41944
  fitClassification,
41620
41945
  recommendedSizeId,
41621
41946
  recommendedSizeLabel,
41622
- sizes
41947
+ sizes,
41948
+ styleCategoryLabel
41623
41949
  };
41624
41950
  }
41625
41951
  let recommendedColorLabel;
@@ -41729,21 +42055,26 @@ function VtoSingleOverlay() {
41729
42055
  } else {
41730
42056
  Layout = DesktopLayout;
41731
42057
  }
41732
- return /* @__PURE__ */ jsx$1(SidecarModalFrame, { onRequestClose: closeOverlay, children: /* @__PURE__ */ jsx$1(Layout, { loadedProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, frameUrls, onClose: closeOverlay, onChangeColor: setSelectedColorLabel, onChangeSize: setSelectedSizeLabel, onAddToCart: handleAddToCartClick, onSignOut: handleSignOutClick }) });
42058
+ return /* @__PURE__ */ jsx$1(SidecarModalFrame, { onRequestClose: closeOverlay, contentStyle: modalStyle, children: /* @__PURE__ */ jsx$1(Layout, { loadedProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, frameUrls, setModalStyle, onClose: closeOverlay, onChangeColor: setSelectedColorLabel, onChangeSize: setSelectedSizeLabel, onAddToCart: handleAddToCartClick, onSignOut: handleSignOutClick }) });
41733
42059
  }
41734
42060
  function MobileLayout({
41735
- // loadedProductData,
41736
- // selectedColorSizeRecord,
41737
- // availableColorLabels,
41738
- // selectedColorLabel,
41739
- // selectedSizeLabel,
42061
+ loadedProductData,
42062
+ selectedColorSizeRecord,
42063
+ availableColorLabels,
42064
+ selectedColorLabel,
42065
+ selectedSizeLabel,
41740
42066
  frameUrls,
41741
- onClose
41742
- // onChangeColor,
41743
- // onChangeSize,
41744
- // onAddToCart,
41745
- // onSignOut,
42067
+ setModalStyle,
42068
+ onClose,
42069
+ onChangeColor,
42070
+ onChangeSize,
42071
+ onAddToCart,
42072
+ onSignOut
41746
42073
  }) {
42074
+ const [contentView, setContentView] = reactExports.useState("collapsed");
42075
+ const bottomFrameInnerRef = reactExports.useRef(null);
42076
+ const [bottomFrameOuterStyle, setBottomFrameOuterStyle] = reactExports.useState({});
42077
+ const [bottomFrameInnerStyle, setBottomFrameInnerStyle] = reactExports.useState({});
41747
42078
  const css2 = useCss((_theme) => ({
41748
42079
  mainContainer: {
41749
42080
  width: "100%",
@@ -41751,7 +42082,7 @@ function MobileLayout({
41751
42082
  },
41752
42083
  closeButton: {
41753
42084
  position: "absolute",
41754
- top: "10px",
42085
+ top: "12px",
41755
42086
  right: "10px",
41756
42087
  width: "30px",
41757
42088
  height: "30px",
@@ -41765,11 +42096,326 @@ function MobileLayout({
41765
42096
  closeIcon: {
41766
42097
  width: "16px",
41767
42098
  height: "16px"
42099
+ },
42100
+ bottomFrameOuter: {
42101
+ position: "absolute",
42102
+ width: "calc(100% - 16px)",
42103
+ maxWidth: `${CONTENT_AREA_WIDTH_PX}px`,
42104
+ bottom: "0",
42105
+ maxHeight: "95vh",
42106
+ left: "50%",
42107
+ transform: "translateX(-50%)",
42108
+ backgroundColor: "rgba(255, 255, 255, 0.9)",
42109
+ borderTopLeftRadius: "28px",
42110
+ borderTopRightRadius: "28px",
42111
+ borderTop: "1px solid rgba(0, 0, 0, 0.1)",
42112
+ borderLeft: "1px solid rgba(0, 0, 0, 0.1)",
42113
+ borderRight: "1px solid rgba(0, 0, 0, 0.1)",
42114
+ margin: "0",
42115
+ padding: "0",
42116
+ transition: "height 0.5s"
42117
+ },
42118
+ bottomFrameInner: {
42119
+ width: "100%",
42120
+ padding: "16px 8px 0 8px",
42121
+ display: "flex",
42122
+ flexDirection: "column",
42123
+ alignItems: "center"
42124
+ },
42125
+ headerContainer: {
42126
+ width: "100%",
42127
+ flex: "none",
42128
+ display: "flex",
42129
+ flexDirection: "column",
42130
+ alignItems: "center"
42131
+ },
42132
+ dragHandleIcon: {
42133
+ width: "32px",
42134
+ height: "4px"
42135
+ },
42136
+ recommendedSizeContainer: {
42137
+ marginTop: "10px",
42138
+ marginBottom: "14px"
42139
+ },
42140
+ recommendedSizeText: {
42141
+ textTransform: "uppercase",
42142
+ fontWeight: "600"
42143
+ },
42144
+ contentContainer: {
42145
+ flexGrow: 1,
42146
+ width: "100%",
42147
+ display: "flex",
42148
+ flexDirection: "column",
42149
+ alignItems: "center",
42150
+ padding: "0 16px 16px 16px",
42151
+ backgroundColor: "#FFFFFF",
42152
+ overflowY: "auto"
42153
+ },
42154
+ sizeSelectorContainer: {},
42155
+ colorSelectorContainer: {
42156
+ marginTop: "16px"
42157
+ },
42158
+ itemFitTextContainer: {
42159
+ marginTop: "8px"
42160
+ },
42161
+ itemFitText: {},
42162
+ itemFitDetailsContainer: {
42163
+ marginTop: "8px",
42164
+ width: "70%"
42165
+ },
42166
+ buttonContainer: {
42167
+ marginTop: "16px",
42168
+ width: "100%"
42169
+ },
42170
+ productNameContainer: {
42171
+ marginTop: "16px"
42172
+ },
42173
+ productNameText: {},
42174
+ priceContainer: {},
42175
+ priceText: {},
42176
+ productDescriptionContainer: {
42177
+ marginTop: "8px"
42178
+ },
42179
+ footerContainer: {
42180
+ marginTop: "24px"
41768
42181
  }
41769
42182
  }));
42183
+ reactExports.useEffect(() => {
42184
+ function refreshBottomFrameStyle() {
42185
+ const bottomFrameInnerEl = bottomFrameInnerRef.current;
42186
+ if (!bottomFrameInnerEl) {
42187
+ return;
42188
+ }
42189
+ const maxHeightPx = Number(window.getComputedStyle(bottomFrameInnerEl.parentElement).getPropertyValue("max-height").replace("px", ""));
42190
+ const heightPx = Math.min(bottomFrameInnerEl.clientHeight, maxHeightPx);
42191
+ const bottomFrameStyle = {
42192
+ height: `${heightPx}px`
42193
+ };
42194
+ setBottomFrameOuterStyle(bottomFrameStyle);
42195
+ setBottomFrameInnerStyle(bottomFrameStyle);
42196
+ }
42197
+ setBottomFrameInnerStyle({});
42198
+ setTimeout(refreshBottomFrameStyle, 50);
42199
+ }, [contentView]);
42200
+ const handleBottomFrameTouchStart = reactExports.useCallback((e) => {
42201
+ let startY = e.touches[0].clientY;
42202
+ const initialContentView = contentView;
42203
+ const onTouchMove = (moveEvent) => {
42204
+ const deltaY = moveEvent.touches[0].clientY - startY;
42205
+ if (Math.abs(deltaY) >= 30) {
42206
+ if (deltaY > 0) {
42207
+ if (initialContentView === "full" || initialContentView === "expanded") {
42208
+ setContentView("collapsed");
42209
+ }
42210
+ } else {
42211
+ if (initialContentView === "collapsed") {
42212
+ setContentView("expanded");
42213
+ } else if (initialContentView === "expanded") {
42214
+ setContentView("full");
42215
+ }
42216
+ }
42217
+ document.removeEventListener("touchmove", onTouchMove);
42218
+ }
42219
+ };
42220
+ document.addEventListener("touchmove", onTouchMove);
42221
+ const onTouchEnd = () => {
42222
+ document.removeEventListener("touchmove", onTouchMove);
42223
+ document.removeEventListener("touchend", onTouchEnd);
42224
+ };
42225
+ document.addEventListener("touchend", onTouchEnd);
42226
+ }, [contentView]);
42227
+ let aboveContentNode = null;
42228
+ if (contentView === "expanded" || contentView === "full") {
42229
+ aboveContentNode = /* @__PURE__ */ jsx$1(ProductSummaryRow, { loadedProductData });
42230
+ }
42231
+ let Content;
42232
+ switch (contentView) {
42233
+ case "collapsed":
42234
+ Content = MobileContentCollapsed;
42235
+ break;
42236
+ case "expanded":
42237
+ Content = MobileContentExpanded;
42238
+ break;
42239
+ case "full":
42240
+ Content = MobileContentFull;
42241
+ break;
42242
+ }
41770
42243
  return /* @__PURE__ */ jsxs("div", { css: css2.mainContainer, children: [
41771
- /* @__PURE__ */ jsx$1(Avatar, { frameUrls }),
41772
- /* @__PURE__ */ jsx$1("button", { onClick: onClose, "aria-label": "Close modal", css: css2.closeButton, children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.closeIcon }) })
42244
+ /* @__PURE__ */ jsx$1(Avatar, { frameUrls, setModalStyle }),
42245
+ /* @__PURE__ */ jsx$1("button", { onClick: onClose, "aria-label": "Close modal", css: css2.closeButton, children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.closeIcon }) }),
42246
+ /* @__PURE__ */ jsx$1("div", { css: css2.bottomFrameOuter, style: bottomFrameOuterStyle, children: /* @__PURE__ */ jsxs("div", { ref: bottomFrameInnerRef, css: css2.bottomFrameInner, style: bottomFrameInnerStyle, children: [
42247
+ /* @__PURE__ */ jsxs("div", { css: css2.headerContainer, onTouchStart: handleBottomFrameTouchStart, children: [
42248
+ /* @__PURE__ */ jsx$1(SvgDragHandle, { css: css2.dragHandleIcon }),
42249
+ /* @__PURE__ */ jsx$1("div", { css: css2.recommendedSizeContainer, children: /* @__PURE__ */ jsx$1(RecommendedSizeText, { loadedProductData, textCss: css2.recommendedSizeText }) })
42250
+ ] }),
42251
+ aboveContentNode,
42252
+ /* @__PURE__ */ jsx$1("div", { css: css2.contentContainer, children: /* @__PURE__ */ jsx$1(Content, { loadedProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, onChangeContentView: setContentView, onChangeColor, onChangeSize, onAddToCart, onSignOut }) })
42253
+ ] }) })
42254
+ ] });
42255
+ }
42256
+ function MobileContentCollapsed({
42257
+ loadedProductData,
42258
+ selectedSizeLabel,
42259
+ onChangeSize
42260
+ }) {
42261
+ const css2 = useCss((_theme) => ({
42262
+ selectSizeLabelContainer: {
42263
+ marginTop: "8px"
42264
+ },
42265
+ selectSizeLabelText: {},
42266
+ sizeSelectorContainer: {
42267
+ marginTop: "8px"
42268
+ }
42269
+ }));
42270
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
42271
+ /* @__PURE__ */ jsx$1("div", { css: css2.selectSizeLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.selectSizeLabelText, t: "size-rec.select_size" }) }),
42272
+ /* @__PURE__ */ jsx$1("div", { css: css2.sizeSelectorContainer, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData, selectedSizeLabel, onChangeSize }) })
42273
+ ] });
42274
+ }
42275
+ function MobileContentExpanded({
42276
+ loadedProductData,
42277
+ selectedSizeLabel,
42278
+ onChangeContentView,
42279
+ onChangeSize,
42280
+ onAddToCart
42281
+ }) {
42282
+ const css2 = useCss((_theme) => ({
42283
+ selectSizeLabelContainer: {
42284
+ marginTop: "8px"
42285
+ },
42286
+ selectSizeLabelText: {},
42287
+ sizeSelectorContainer: {
42288
+ marginTop: "8px"
42289
+ },
42290
+ itemFitTextContainer: {
42291
+ marginTop: "8px"
42292
+ },
42293
+ itemFitText: {},
42294
+ itemFitDetailsContainer: {
42295
+ marginTop: "8px",
42296
+ width: "70%"
42297
+ },
42298
+ buttonContainer: {
42299
+ marginTop: "24px",
42300
+ width: "100%"
42301
+ },
42302
+ productDetailsContainer: {
42303
+ marginTop: "24px",
42304
+ marginBottom: "16px"
42305
+ },
42306
+ productDetailsText: {
42307
+ textDecoration: "underline",
42308
+ textTransform: "uppercase",
42309
+ cursor: "pointer"
42310
+ }
42311
+ }));
42312
+ const handleProductDetailsClick = reactExports.useCallback(() => {
42313
+ onChangeContentView("full");
42314
+ }, [onChangeContentView]);
42315
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
42316
+ /* @__PURE__ */ jsx$1("div", { css: css2.selectSizeLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.selectSizeLabelText, t: "size-rec.select_size" }) }),
42317
+ /* @__PURE__ */ jsx$1("div", { css: css2.sizeSelectorContainer, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData, selectedSizeLabel, onChangeSize }) }),
42318
+ /* @__PURE__ */ jsx$1("div", { css: css2.itemFitTextContainer, children: /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData }) }),
42319
+ /* @__PURE__ */ jsx$1("div", { css: css2.itemFitDetailsContainer, children: /* @__PURE__ */ jsx$1(ItemFitDetails, { loadedProductData, selectedSizeLabel }) }),
42320
+ /* @__PURE__ */ jsx$1("div", { css: css2.buttonContainer, children: /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }) }),
42321
+ /* @__PURE__ */ jsx$1("div", { css: css2.productDetailsContainer, children: /* @__PURE__ */ jsx$1(LinkT, { variant: "base", css: css2.productDetailsText, t: "vto-single.view_product_details", onClick: handleProductDetailsClick }) })
42322
+ ] });
42323
+ }
42324
+ function MobileContentFull({
42325
+ loadedProductData,
42326
+ selectedColorSizeRecord,
42327
+ availableColorLabels,
42328
+ selectedColorLabel,
42329
+ selectedSizeLabel,
42330
+ onChangeContentView,
42331
+ onChangeColor,
42332
+ onChangeSize,
42333
+ onAddToCart,
42334
+ onSignOut
42335
+ }) {
42336
+ const [fitChartOpen, setFitChartOpen] = reactExports.useState(false);
42337
+ const css2 = useCss((_theme) => ({
42338
+ sizeRecommendationFrame: {
42339
+ marginTop: "16px",
42340
+ display: "flex",
42341
+ flexDirection: "column",
42342
+ border: "1px solid rgba(33, 32, 31, 0.2)",
42343
+ padding: "16px 56px",
42344
+ justifyContent: "center",
42345
+ alignItems: "center"
42346
+ },
42347
+ selectSizeLabelContainer: {},
42348
+ selectSizeLabelText: {},
42349
+ sizeSelectorContainer: {
42350
+ marginTop: "16px"
42351
+ },
42352
+ colorSelectorContainer: {
42353
+ marginTop: "16px"
42354
+ },
42355
+ itemFitTextContainer: {
42356
+ marginTop: "8px"
42357
+ },
42358
+ fitChartButton: {},
42359
+ itemFitText: {},
42360
+ itemFitDetailsContainer: {
42361
+ marginTop: "8px",
42362
+ width: "100%"
42363
+ },
42364
+ fitChartContainer: {
42365
+ marginTop: "16px"
42366
+ },
42367
+ buttonContainer: {
42368
+ marginTop: "16px",
42369
+ width: "100%"
42370
+ },
42371
+ productDetailsContainer: {
42372
+ marginTop: "24px",
42373
+ marginBottom: "16px"
42374
+ },
42375
+ productDetailsText: {
42376
+ textDecoration: "underline",
42377
+ textTransform: "uppercase",
42378
+ cursor: "pointer"
42379
+ },
42380
+ priceContainer: {},
42381
+ priceText: {},
42382
+ productDescriptionContainer: {
42383
+ marginTop: "8px"
42384
+ },
42385
+ footerContainer: {
42386
+ marginTop: "48px"
42387
+ }
42388
+ }));
42389
+ const handleProductDetailsClick = reactExports.useCallback(() => {
42390
+ onChangeContentView("expanded");
42391
+ }, [onChangeContentView]);
42392
+ const handleFitChartOpen = reactExports.useCallback(() => {
42393
+ setFitChartOpen(true);
42394
+ }, []);
42395
+ const handleFitChartClose = reactExports.useCallback(() => {
42396
+ setFitChartOpen(false);
42397
+ }, []);
42398
+ let fitChartNode = null;
42399
+ if (fitChartOpen) {
42400
+ fitChartNode = /* @__PURE__ */ jsx$1("div", { css: css2.fitChartContainer, children: /* @__PURE__ */ jsx$1(FitChart, { onRequestClose: handleFitChartClose }) });
42401
+ }
42402
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
42403
+ /* @__PURE__ */ jsxs("div", { css: css2.sizeRecommendationFrame, children: [
42404
+ /* @__PURE__ */ jsx$1("div", { css: css2.selectSizeLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.selectSizeLabelText, t: "size-rec.select_size" }) }),
42405
+ /* @__PURE__ */ jsx$1("div", { css: css2.sizeSelectorContainer, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData, selectedSizeLabel, onChangeSize }) }),
42406
+ /* @__PURE__ */ jsxs("div", { css: css2.itemFitTextContainer, children: [
42407
+ /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.fitChartButton, onClick: handleFitChartOpen, children: /* @__PURE__ */ jsx$1(SvgInfoIcon, {}) }),
42408
+ /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData, textCss: css2.itemFitText })
42409
+ ] }),
42410
+ /* @__PURE__ */ jsx$1("div", { css: css2.itemFitDetailsContainer, children: /* @__PURE__ */ jsx$1(ItemFitDetails, { loadedProductData, selectedSizeLabel }) })
42411
+ ] }),
42412
+ fitChartNode,
42413
+ /* @__PURE__ */ jsx$1("div", { css: css2.colorSelectorContainer, children: /* @__PURE__ */ jsx$1(ColorSelector, { availableColorLabels, selectedColorLabel, onChangeColor }) }),
42414
+ /* @__PURE__ */ jsx$1("div", { css: css2.buttonContainer, children: /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }) }),
42415
+ /* @__PURE__ */ jsx$1("div", { css: css2.productDetailsContainer, children: /* @__PURE__ */ jsx$1(LinkT, { variant: "base", css: css2.productDetailsText, t: "vto-single.hide_product_details", onClick: handleProductDetailsClick }) }),
42416
+ /* @__PURE__ */ jsx$1("div", { css: css2.priceContainer, children: /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.priceText, children: selectedColorSizeRecord.priceFormatted }) }),
42417
+ /* @__PURE__ */ jsx$1("div", { css: css2.productDescriptionContainer, children: /* @__PURE__ */ jsx$1(ProductDescriptionText, { loadedProductData }) }),
42418
+ /* @__PURE__ */ jsx$1("div", { css: css2.footerContainer, children: /* @__PURE__ */ jsx$1(Footer, { onSignOutClick: onSignOut }) })
41773
42419
  ] });
41774
42420
  }
41775
42421
  function DesktopLayout({
@@ -41779,6 +42425,7 @@ function DesktopLayout({
41779
42425
  selectedColorLabel,
41780
42426
  selectedSizeLabel,
41781
42427
  frameUrls,
42428
+ setModalStyle,
41782
42429
  onClose,
41783
42430
  onChangeColor,
41784
42431
  onChangeSize,
@@ -41788,10 +42435,13 @@ function DesktopLayout({
41788
42435
  const {
41789
42436
  t
41790
42437
  } = useTranslation();
42438
+ const [fitChartOpen, setFitChartOpen] = reactExports.useState(false);
41791
42439
  const css2 = useCss((_theme) => ({
41792
42440
  mainContainer: {
41793
42441
  display: "flex",
41794
- height: "100%"
42442
+ height: "100%",
42443
+ position: "relative",
42444
+ top: "-1px"
41795
42445
  },
41796
42446
  rightContainer: {
41797
42447
  flexGrow: 1,
@@ -41820,7 +42470,7 @@ function DesktopLayout({
41820
42470
  colorContainer: {
41821
42471
  marginTop: "16px"
41822
42472
  },
41823
- sizeRecommendationContainer: {
42473
+ sizeRecommendationFrame: {
41824
42474
  marginTop: "16px",
41825
42475
  display: "flex",
41826
42476
  flexDirection: "column",
@@ -41838,6 +42488,7 @@ function DesktopLayout({
41838
42488
  recommendedSizeText: {
41839
42489
  fontWeight: "600"
41840
42490
  },
42491
+ fitChartButton: {},
41841
42492
  itemFitContainer: {
41842
42493
  marginTop: "8px",
41843
42494
  lineHeight: "normal"
@@ -41854,6 +42505,9 @@ function DesktopLayout({
41854
42505
  marginTop: "24px",
41855
42506
  width: "100%"
41856
42507
  },
42508
+ fitChartContainer: {
42509
+ marginTop: "16px"
42510
+ },
41857
42511
  buttonContainer: {
41858
42512
  marginTop: "24px"
41859
42513
  },
@@ -41861,24 +42515,35 @@ function DesktopLayout({
41861
42515
  marginTop: "32px"
41862
42516
  }
41863
42517
  }));
42518
+ const handleFitChartOpen = reactExports.useCallback(() => {
42519
+ setFitChartOpen(true);
42520
+ }, []);
42521
+ const handleFitChartClose = reactExports.useCallback(() => {
42522
+ setFitChartOpen(false);
42523
+ }, []);
42524
+ let fitChartNode = null;
42525
+ if (fitChartOpen) {
42526
+ fitChartNode = /* @__PURE__ */ jsx$1("div", { css: css2.fitChartContainer, children: /* @__PURE__ */ jsx$1(FitChart, { onRequestClose: handleFitChartClose }) });
42527
+ }
41864
42528
  return /* @__PURE__ */ jsxs("div", { css: css2.mainContainer, children: [
41865
- /* @__PURE__ */ jsx$1(Avatar, { frameUrls }),
42529
+ /* @__PURE__ */ jsx$1(Avatar, { frameUrls, setModalStyle }),
41866
42530
  /* @__PURE__ */ jsxs("div", { css: css2.rightContainer, children: [
41867
42531
  /* @__PURE__ */ jsx$1(ModalTitlebar, { title: t("try_it_on"), onCloseClick: onClose }),
41868
42532
  /* @__PURE__ */ jsxs("div", { css: css2.contentContainer, children: [
41869
42533
  /* @__PURE__ */ jsx$1("div", { css: css2.productNameContainer, children: /* @__PURE__ */ jsx$1(Text, { variant: "brand", css: css2.productNameText, children: loadedProductData.productName }) }),
41870
42534
  /* @__PURE__ */ jsx$1("div", { css: css2.priceContainer, children: /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.priceText, children: selectedColorSizeRecord.priceFormatted }) }),
41871
42535
  /* @__PURE__ */ jsx$1("div", { css: css2.colorContainer, children: /* @__PURE__ */ jsx$1(ColorSelector, { availableColorLabels, selectedColorLabel, onChangeColor }) }),
41872
- /* @__PURE__ */ jsxs("div", { css: css2.sizeRecommendationContainer, children: [
42536
+ /* @__PURE__ */ jsxs("div", { css: css2.sizeRecommendationFrame, children: [
41873
42537
  /* @__PURE__ */ jsxs("div", { css: css2.recommendedSizeContainer, children: [
41874
- /* @__PURE__ */ jsx$1(SvgInfoIcon, {}),
41875
- /* @__PURE__ */ jsx$1(RecommendedSizeText, { loadedProductData, css: css2.recommendedSizeText })
42538
+ /* @__PURE__ */ jsx$1(Button, { variant: "base", css: css2.fitChartButton, onClick: handleFitChartOpen, children: /* @__PURE__ */ jsx$1(SvgInfoIcon, {}) }),
42539
+ /* @__PURE__ */ jsx$1(RecommendedSizeText, { loadedProductData, textCss: css2.recommendedSizeText })
41876
42540
  ] }),
41877
- /* @__PURE__ */ jsx$1("div", { css: css2.itemFitContainer, children: /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData, css: css2.itemFitText }) }),
42541
+ /* @__PURE__ */ jsx$1("div", { css: css2.itemFitContainer, children: /* @__PURE__ */ jsx$1(ItemFitText, { loadedProductData, textCss: css2.itemFitText }) }),
41878
42542
  /* @__PURE__ */ jsx$1("div", { css: css2.selectSizeLabelContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.selectSizeLabelText, t: "size-rec.select_size" }) }),
41879
42543
  /* @__PURE__ */ jsx$1("div", { css: css2.sizeSelectorContainer, children: /* @__PURE__ */ jsx$1(SizeSelector, { loadedProductData, selectedSizeLabel, onChangeSize }) }),
41880
42544
  /* @__PURE__ */ jsx$1("div", { css: css2.itemFitDetailsContainer, children: /* @__PURE__ */ jsx$1(ItemFitDetails, { loadedProductData, selectedSizeLabel }) })
41881
42545
  ] }),
42546
+ fitChartNode,
41882
42547
  /* @__PURE__ */ jsx$1("div", { css: css2.buttonContainer, children: /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }) }),
41883
42548
  /* @__PURE__ */ jsx$1("div", { css: css2.descriptionContainer, children: /* @__PURE__ */ jsx$1(ProductDescriptionText, { loadedProductData }) })
41884
42549
  ] }),
@@ -41887,15 +42552,17 @@ function DesktopLayout({
41887
42552
  ] });
41888
42553
  }
41889
42554
  function Avatar({
41890
- frameUrls
42555
+ frameUrls,
42556
+ setModalStyle
41891
42557
  }) {
41892
42558
  const deviceLayout = useMainStore((state) => state.deviceLayout);
41893
42559
  const isMobileLayout = deviceLayout === DeviceLayout.MOBILE_PORTRAIT || deviceLayout === DeviceLayout.TABLET_PORTRAIT;
41894
- const [containerSize, setContainerSize] = reactExports.useState({
41895
- width: window.innerWidth,
41896
- height: window.innerHeight
42560
+ const [layoutData, setLayoutData] = reactExports.useState({
42561
+ topContainerStyle: {},
42562
+ imageContainerStyle: {},
42563
+ imageStyle: {},
42564
+ bottomContainerStyle: {}
41897
42565
  });
41898
- const topContainerRef = reactExports.useRef(null);
41899
42566
  const [selectedFrameIndex, setSelectedFrameIndex] = reactExports.useState(null);
41900
42567
  const css2 = useCss((theme) => ({
41901
42568
  topContainer: {
@@ -41929,7 +42596,7 @@ function Avatar({
41929
42596
  },
41930
42597
  bottomContainer: {
41931
42598
  position: "absolute",
41932
- bottom: "0",
42599
+ bottom: "1px",
41933
42600
  height: "50px",
41934
42601
  display: "flex",
41935
42602
  flexDirection: "column",
@@ -41950,23 +42617,93 @@ function Avatar({
41950
42617
  }
41951
42618
  }));
41952
42619
  reactExports.useEffect(() => {
41953
- const handleResize = () => {
41954
- const containerEl = topContainerRef.current;
41955
- const size = containerEl ? {
41956
- width: containerEl.clientWidth,
41957
- height: containerEl.clientHeight
41958
- } : {
41959
- width: window.innerWidth,
41960
- height: window.innerHeight
42620
+ function refreshLayoutData() {
42621
+ let imageSize;
42622
+ let bottomContainerStyle;
42623
+ let modalStyle;
42624
+ if (isMobileLayout) {
42625
+ const screenWidthPx = window.innerWidth;
42626
+ const screenHeightPx = window.innerHeight;
42627
+ let imageWidthPx = screenWidthPx;
42628
+ let imageHeightPx = Math.floor(imageWidthPx / AVATAR_IMAGE_ASPECT_RATIO);
42629
+ let bottomContainerHeightPx = screenHeightPx - imageHeightPx;
42630
+ let modalWidthPx = null;
42631
+ if (bottomContainerHeightPx < AVATAR_GUTTER_HEIGHT_PX) {
42632
+ bottomContainerHeightPx = AVATAR_GUTTER_HEIGHT_PX;
42633
+ imageHeightPx = screenHeightPx - bottomContainerHeightPx;
42634
+ imageWidthPx = Math.floor(imageHeightPx * AVATAR_IMAGE_ASPECT_RATIO);
42635
+ modalWidthPx = imageWidthPx;
42636
+ }
42637
+ imageSize = {
42638
+ width: imageWidthPx,
42639
+ height: imageHeightPx
42640
+ };
42641
+ bottomContainerStyle = {
42642
+ width: imageWidthPx,
42643
+ height: bottomContainerHeightPx
42644
+ };
42645
+ if (modalWidthPx != null) {
42646
+ const theme = getThemeData();
42647
+ modalStyle = {
42648
+ width: modalWidthPx + "px",
42649
+ left: "50%",
42650
+ transform: "translateX(-50%)",
42651
+ borderTopColor: theme.color_tfr_800,
42652
+ borderTopStyle: "solid",
42653
+ borderTopWidth: "1px",
42654
+ borderRightColor: theme.color_tfr_800,
42655
+ borderRightStyle: "solid",
42656
+ borderRightWidth: "1px",
42657
+ borderLeftColor: theme.color_tfr_800,
42658
+ borderLeftStyle: "solid",
42659
+ borderLeftWidth: "1px"
42660
+ };
42661
+ } else {
42662
+ modalStyle = {};
42663
+ }
42664
+ } else {
42665
+ const screenHeightPx = window.innerHeight;
42666
+ const bottomContainerHeightPx = AVATAR_GUTTER_HEIGHT_PX;
42667
+ const imageHeightPx = screenHeightPx - bottomContainerHeightPx;
42668
+ const imageWidthPx = Math.floor(imageHeightPx * AVATAR_IMAGE_ASPECT_RATIO);
42669
+ const modalWidthPx = imageWidthPx + CONTENT_AREA_WIDTH_PX;
42670
+ imageSize = {
42671
+ width: imageWidthPx,
42672
+ height: imageHeightPx
42673
+ };
42674
+ bottomContainerStyle = {
42675
+ width: imageWidthPx,
42676
+ height: bottomContainerHeightPx
42677
+ };
42678
+ modalStyle = {
42679
+ width: `min(${modalWidthPx}px, 100vw)`
42680
+ };
42681
+ }
42682
+ const topContainerStyle = {
42683
+ width: imageSize.width + "px"
41961
42684
  };
41962
- setContainerSize(size);
41963
- };
41964
- handleResize();
41965
- window.addEventListener("resize", handleResize);
42685
+ const imageContainerStyle = {
42686
+ width: imageSize.width + "px",
42687
+ height: imageSize.height + "px"
42688
+ };
42689
+ const imageStyle = {
42690
+ width: imageSize.width + "px",
42691
+ height: imageSize.height + "px"
42692
+ };
42693
+ setLayoutData({
42694
+ topContainerStyle,
42695
+ imageContainerStyle,
42696
+ imageStyle,
42697
+ bottomContainerStyle
42698
+ });
42699
+ setModalStyle(modalStyle);
42700
+ }
42701
+ refreshLayoutData();
42702
+ window.addEventListener("resize", refreshLayoutData);
41966
42703
  return () => {
41967
- window.removeEventListener("resize", handleResize);
42704
+ window.removeEventListener("resize", refreshLayoutData);
41968
42705
  };
41969
- }, []);
42706
+ }, [isMobileLayout]);
41970
42707
  reactExports.useEffect(() => {
41971
42708
  if (frameUrls && frameUrls.length > 0 && selectedFrameIndex == null) {
41972
42709
  let currentFrameIndex = 0;
@@ -41977,45 +42714,9 @@ function Avatar({
41977
42714
  if (currentFrameIndex === 0) {
41978
42715
  clearInterval(intervalId);
41979
42716
  }
41980
- }, 200);
42717
+ }, 500);
41981
42718
  }
41982
42719
  }, [frameUrls, selectedFrameIndex]);
41983
- const {
41984
- imageSize,
41985
- bottomContainerSize
41986
- } = reactExports.useMemo(() => {
41987
- let imageSize2;
41988
- let bottomContainerSize2;
41989
- if (isMobileLayout) {
41990
- const imageWidthPx = containerSize.width;
41991
- const imageHeightPx = Math.floor(imageWidthPx / AVATAR_IMAGE_ASPECT_RATIO);
41992
- const bottomContainerHeightPx = containerSize.height - imageHeightPx;
41993
- imageSize2 = {
41994
- width: imageWidthPx,
41995
- height: imageHeightPx
41996
- };
41997
- bottomContainerSize2 = {
41998
- width: imageWidthPx,
41999
- height: bottomContainerHeightPx
42000
- };
42001
- } else {
42002
- const imageHeightPx = containerSize.height - AVATAR_DESKTOP_BOTTOM_CONTAINER_HEIGHT_PX;
42003
- const imageWidthPx = Math.floor(imageHeightPx * AVATAR_IMAGE_ASPECT_RATIO);
42004
- const bottomContainerHeightPx = AVATAR_DESKTOP_BOTTOM_CONTAINER_HEIGHT_PX;
42005
- imageSize2 = {
42006
- width: imageWidthPx,
42007
- height: imageHeightPx
42008
- };
42009
- bottomContainerSize2 = {
42010
- width: imageWidthPx,
42011
- height: bottomContainerHeightPx
42012
- };
42013
- }
42014
- return {
42015
- imageSize: imageSize2,
42016
- bottomContainerSize: bottomContainerSize2
42017
- };
42018
- }, [isMobileLayout, containerSize]);
42019
42720
  const rotateLeft = reactExports.useCallback(() => {
42020
42721
  setSelectedFrameIndex((prevIndex) => {
42021
42722
  if (prevIndex == null) {
@@ -42032,7 +42733,7 @@ function Avatar({
42032
42733
  return prevIndex === (frameUrls ? frameUrls.length - 1 : 0) ? 0 : prevIndex + 1;
42033
42734
  });
42034
42735
  }, [frameUrls]);
42035
- const handleImageDrag = reactExports.useCallback((e) => {
42736
+ const handleImageMouseDrag = reactExports.useCallback((e) => {
42036
42737
  e.preventDefault();
42037
42738
  let startX = e.clientX;
42038
42739
  const onMouseMove = (moveEvent) => {
@@ -42053,24 +42754,36 @@ function Avatar({
42053
42754
  window.addEventListener("mousemove", onMouseMove);
42054
42755
  window.addEventListener("mouseup", onMouseUp);
42055
42756
  }, [rotateLeft, rotateRight]);
42757
+ const handleImageTouchDrag = reactExports.useCallback((e) => {
42758
+ e.preventDefault();
42759
+ let startX = e.touches[0].clientX;
42760
+ const onTouchMove = (moveEvent) => {
42761
+ const deltaX = moveEvent.touches[0].clientX - startX;
42762
+ if (Math.abs(deltaX) >= 50) {
42763
+ if (deltaX > 0) {
42764
+ rotateRight();
42765
+ } else {
42766
+ rotateLeft();
42767
+ }
42768
+ startX = moveEvent.touches[0].clientX;
42769
+ }
42770
+ };
42771
+ const onTouchEnd = () => {
42772
+ window.removeEventListener("touchmove", onTouchMove);
42773
+ window.removeEventListener("touchend", onTouchEnd);
42774
+ };
42775
+ window.addEventListener("touchmove", onTouchMove);
42776
+ window.addEventListener("touchend", onTouchEnd);
42777
+ }, [rotateLeft, rotateRight]);
42056
42778
  let contentNode;
42057
42779
  if (frameUrls && selectedFrameIndex != null) {
42058
42780
  contentNode = /* @__PURE__ */ jsxs(Fragment, { children: [
42059
- /* @__PURE__ */ jsxs("div", { css: css2.imageContainer, style: {
42060
- width: imageSize.width + "px",
42061
- height: imageSize.height + "px"
42062
- }, children: [
42063
- /* @__PURE__ */ jsx$1("img", { src: frameUrls[selectedFrameIndex], css: css2.image, style: {
42064
- width: imageSize.width + "px",
42065
- height: imageSize.height + "px"
42066
- }, onMouseDown: handleImageDrag }),
42781
+ /* @__PURE__ */ jsxs("div", { css: css2.imageContainer, style: layoutData.imageContainerStyle, children: [
42782
+ /* @__PURE__ */ jsx$1("img", { src: frameUrls[selectedFrameIndex], css: css2.image, style: layoutData.imageStyle, onMouseDown: handleImageMouseDrag, onTouchStart: handleImageTouchDrag }),
42067
42783
  /* @__PURE__ */ jsx$1("div", { css: css2.chevronLeftContainer, onClick: rotateLeft, children: /* @__PURE__ */ jsx$1(SvgChevronLeft, { css: css2.chevronIcon }) }),
42068
42784
  /* @__PURE__ */ jsx$1("div", { css: css2.chevronRightContainer, onClick: rotateRight, children: /* @__PURE__ */ jsx$1(SvgChevronRight, { css: css2.chevronIcon }) })
42069
42785
  ] }),
42070
- /* @__PURE__ */ jsx$1("div", { css: css2.bottomContainer, style: {
42071
- width: bottomContainerSize.width + "px",
42072
- height: bottomContainerSize.height + "px"
42073
- }, children: isMobileLayout ? /* @__PURE__ */ jsx$1(Fragment, { children: " " }) : /* @__PURE__ */ jsxs(Fragment, { children: [
42786
+ /* @__PURE__ */ jsx$1("div", { css: css2.bottomContainer, style: layoutData.bottomContainerStyle, children: isMobileLayout ? /* @__PURE__ */ jsx$1(Fragment, { children: " " }) : /* @__PURE__ */ jsxs(Fragment, { children: [
42074
42787
  /* @__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 }),
42075
42788
  /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "vto-single.slide_to_rotate", css: css2.sliderText })
42076
42789
  ] }) })
@@ -42078,9 +42791,33 @@ function Avatar({
42078
42791
  } else {
42079
42792
  contentNode = /* @__PURE__ */ jsx$1(Loading, { t: "vto-single.avatar_loading" });
42080
42793
  }
42081
- return /* @__PURE__ */ jsx$1("div", { ref: topContainerRef, css: css2.topContainer, style: {
42082
- width: imageSize.width + "px"
42083
- }, children: contentNode });
42794
+ return /* @__PURE__ */ jsx$1("div", { css: css2.topContainer, style: layoutData.topContainerStyle, children: contentNode });
42795
+ }
42796
+ function ProductSummaryRow({
42797
+ loadedProductData
42798
+ }) {
42799
+ const css2 = useCss((_theme) => ({
42800
+ container: {
42801
+ width: "100%",
42802
+ padding: "4px 16px",
42803
+ display: "flex",
42804
+ alignItems: "center",
42805
+ gap: "8px",
42806
+ backgroundColor: "#F8F8F8"
42807
+ },
42808
+ labelContainer: {},
42809
+ labelText: {
42810
+ color: "#1A1A1A"
42811
+ },
42812
+ nameContainer: {},
42813
+ nameText: {
42814
+ color: "#9F9F9F"
42815
+ }
42816
+ }));
42817
+ return /* @__PURE__ */ jsxs("div", { css: css2.container, children: [
42818
+ /* @__PURE__ */ jsx$1("div", { css: css2.labelContainer, children: /* @__PURE__ */ jsx$1(Text, { variant: "brand", css: css2.labelText, children: loadedProductData.styleCategoryLabel }) }),
42819
+ /* @__PURE__ */ jsx$1("div", { css: css2.nameContainer, children: /* @__PURE__ */ jsx$1(Text, { variant: "brand", css: css2.nameText, children: loadedProductData.productName }) })
42820
+ ] });
42084
42821
  }
42085
42822
  function ColorSelector({
42086
42823
  availableColorLabels,
@@ -42149,20 +42886,20 @@ function SizeSelector({
42149
42886
  }
42150
42887
  function RecommendedSizeText({
42151
42888
  loadedProductData,
42152
- css: css2
42889
+ textCss
42153
42890
  }) {
42154
- return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2, t: "size-rec.recommended_size", vars: {
42891
+ return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: textCss, t: "size-rec.recommended_size", vars: {
42155
42892
  size: loadedProductData.recommendedSizeLabel
42156
42893
  } });
42157
42894
  }
42158
42895
  function ItemFitText({
42159
42896
  loadedProductData,
42160
- css: css2
42897
+ textCss
42161
42898
  }) {
42162
42899
  const {
42163
42900
  t
42164
42901
  } = useTranslation();
42165
- return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2, t: "size-rec.item_fit", vars: {
42902
+ return /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: textCss, t: "size-rec.item_fit", vars: {
42166
42903
  fit: t(`size-rec.fitClassification.${loadedProductData.fitClassification}`) || loadedProductData.fitClassification
42167
42904
  } });
42168
42905
  }
@@ -42559,9 +43296,9 @@ const SHARED_CONFIG = {
42559
43296
  appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
42560
43297
  },
42561
43298
  build: {
42562
- version: `${"5.0.4"}`,
42563
- commitHash: `${"ab04059"}`,
42564
- date: `${"2026-01-07T14:09:55.391Z"}`
43299
+ version: `${"5.0.7"}`,
43300
+ commitHash: `${"4a18721"}`,
43301
+ date: `${"2026-01-18T21:52:48.635Z"}`
42565
43302
  }
42566
43303
  };
42567
43304
  const CONFIGS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thefittingroom/shop-ui",
3
- "version": "5.0.4",
3
+ "version": "5.0.7",
4
4
  "description": "the fitting room UI library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",