(false);\n const [contactusModalOpen, setContactusModalOpen] = useState(false);\n const [similarModalOpen, setSimilarModalOpen] = useState(false);\n const [promotionInfo, setPromotionInfo] = useState();\n const [campaignActive, setCampaingActive] = useState(false);\n const [hasFreeExpressShipping, setHasFreeExpressShipping] = useState(false);\n const [loginOpen, setLoginOpen] = useState(false);\n const [similarFloatingVisible, setSimilarFloatingVisible] = useState(true);\n const [visibilityFloatingModule, setVisibilityFloatingModule] = useState(false);\n const [enableSimilarButton, setEnableSimilarButton] = useState(false);\n const [similarProductsTiles, setSimilarProductsTiles] = useState(null);\n const floatingShowTimer = useRef();\n const isGrenoble = (_c = current === null || current === void 0 ? void 0 : current.collections) === null || _c === void 0 ? void 0 : _c.grenoble;\n const isGenius = ((_d = current === null || current === void 0 ? void 0 : current.collections) === null || _d === void 0 ? void 0 : _d.genius) && !isGrenoble;\n const isPreorder = (_e = current === null || current === void 0 ? void 0 : current.availability) === null || _e === void 0 ? void 0 : _e.preorder;\n const isMobile = currentBreakpoint < parseInt(window.mqObj.md.toString());\n const isPreOrderOrExclusive = ((_h = (_g = (_f = current === null || current === void 0 ? void 0 : current.variationAttributes) === null || _f === void 0 ? void 0 : _f.find((va) => va.id == 'color')) === null || _g === void 0 ? void 0 : _g.values) === null || _h === void 0 ? void 0 : _h.some((va) => va.preorderable)) || (current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive);\n const colourVariations = useMemo(() => {\n let colors;\n colors = getColorVariations(current).map((value) => {\n return Object.assign(Object.assign({}, value), { groupPid: (current === null || current === void 0 ? void 0 : current.masterId) + value.id });\n });\n if (inLook) {\n // non è possibile selezionare altri colori nel look\n colors = colors.filter((value) => value.selected);\n }\n return colors;\n }, [current, inLook]);\n const [currentSize, setCurrentSize] = useState();\n const [currentColor, setCurrentColor] = useState();\n const [sizeSelectorError, setSizeSelectorError] = useState(false);\n const sizeVariations = useMemo(() => {\n let sizeVariations = getSizeVariations(current);\n if (sizeVariations.length == 1) {\n setCurrentSize(sizeVariations[0]);\n }\n else if (sizeVariations.find((el) => el.displayValue == (variantSizeObj === null || variantSizeObj === void 0 ? void 0 : variantSizeObj.size))) {\n setCurrentSize(sizeVariations.find((el) => el.displayValue == variantSizeObj.size));\n }\n else if (!sizeVariations.find((el) => el.id == (currentSize === null || currentSize === void 0 ? void 0 : currentSize.id))) {\n setCurrentSize(undefined);\n }\n // console.info('nascondo il messaggio di errore');\n setSizeSelectorError(false);\n return sizeVariations;\n }, [current]);\n const isOutOfStock = useMemo(() => {\n var _a;\n return (_a = current === null || current === void 0 ? void 0 : current.availability) === null || _a === void 0 ? void 0 : _a.isOutOfStock;\n }, [current]);\n const showReserveInBoutiqueButton = useMemo(() => !window.noboutiqueavailability &&\n !(current === null || current === void 0 ? void 0 : current.isOnlineExclusive) &&\n ((current === null || current === void 0 ? void 0 : current.notShoppable) || isOutOfStock || (current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive)) &&\n (!(current === null || current === void 0 ? void 0 : current.isComingSoonAutomatic) || (current === null || current === void 0 ? void 0 : current.forceSoldOut)), [currentSize, current]);\n const showReserveInBoutiqueLink = useMemo(() => {\n var _a;\n return !window.unshoppable &&\n !window.noboutiqueavailability &&\n !window.isClothing &&\n !showReserveInBoutiqueButton &&\n !inLook &&\n !(current === null || current === void 0 ? void 0 : current.isOnlineExclusive) &&\n !(current === null || current === void 0 ? void 0 : current.isComingSoon) &&\n !(current === null || current === void 0 ? void 0 : current.isMbm) &&\n !((_a = current === null || current === void 0 ? void 0 : current.availability) === null || _a === void 0 ? void 0 : _a.preorder);\n }, [showReserveInBoutiqueButton, current]);\n const expressCheckoutAvailable = useMemo(() => {\n var _a, _b, _c;\n return (window.expressCheckoutPDP &&\n !window.isClothing &&\n !window.unshoppable &&\n !(current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive) &&\n !isOutOfStock &&\n (current === null || current === void 0 ? void 0 : current.isComingSoon) != 2 &&\n !(current === null || current === void 0 ? void 0 : current.notShoppable) &&\n !(current === null || current === void 0 ? void 0 : current.isMbm) &&\n (((_a = current === null || current === void 0 ? void 0 : current.price) === null || _a === void 0 ? void 0 : _a.type) || ((_c = (_b = current === null || current === void 0 ? void 0 : current.price) === null || _b === void 0 ? void 0 : _b.sales) === null || _c === void 0 ? void 0 : _c.value)) &&\n !inLook);\n }, [current, currentSize]);\n useEffect(() => {\n if (currentColor && currentSize) {\n onSizeSelection(currentSize.id);\n }\n }, [currentColor]);\n useEffect(() => {\n const colorSelected = getColorVariations(current).find((v) => v.selected);\n if (colorSelected) {\n setCurrentColor(colorSelected);\n if (colorChanged) {\n colorChanged = false;\n analytics.colorSelection(colorSelected === null || colorSelected === void 0 ? void 0 : colorSelected.value, current === null || current === void 0 ? void 0 : current.masterId, props.tileType);\n }\n }\n setContactusModalOpen(false);\n setSimilarModalOpen(false);\n setVisibilityFloatingModule(false);\n checkSimilarRecommender();\n }, [current]);\n useEffect(() => {\n floatingVisibility();\n }, [props.isScrolled]);\n // Quicker reaction compared to listening to 'current'\n useEffect(() => {\n setVisibilityFloatingModule(false);\n setEnableSimilarButton(false);\n setSimilarProductsTiles(null);\n clearTimeout(floatingShowTimer.current);\n }, [pid]);\n useEffect(() => {\n if (current) {\n let wrapperContainer = document.querySelector('.product-selection');\n let heightTarget = `calc(100vh - ${(wrapperContainer === null || wrapperContainer === void 0 ? void 0 : wrapperContainer.offsetHeight) / 10}rem`;\n let productSelection = document.querySelector('.product-selection');\n productSelection.style.top = heightTarget;\n }\n window.gbotNormalizer();\n }, [current]);\n useEffect(() => {\n api.getPromotionInfo().then((data) => {\n var _a, _b;\n setPromotionInfo(data);\n if ((_a = data.activeCampaigns) === null || _a === void 0 ? void 0 : _a.includes(window.promoFreeExpressShippingNewMembers)) {\n setCampaingActive(true);\n }\n if ((_b = data.customerGroups) === null || _b === void 0 ? void 0 : _b.includes(freeExpressShippingCustomerGroup)) {\n setHasFreeExpressShipping(true);\n }\n });\n }, []);\n const floatingVisibility = () => {\n const floatingCookieOnClose = cookie.load('sfcc_floatingSimilarClosed');\n const showFloatingModuleCondition = currentBreakpoint < 1024 || window.appmode;\n if (showFloatingModuleCondition && !floatingCookieOnClose && window.scrollY > 0) {\n floatingShowTimer.current = setTimeout(() => {\n setVisibilityFloatingModule(true);\n setSimilarTiles();\n }, 5000);\n }\n };\n useEffect(() => {\n var _a, _b;\n if (currentSize && ((_b = (_a = current.variationAttributes[1]) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.length) > 1) {\n analytics.productDetailChange(current, currentSize);\n }\n }, [currentSize]);\n const changeColor = (colorVariation) => {\n if (!colorVariation) {\n return;\n }\n if (!inLook) {\n colorChanged = true;\n history.push(colorVariation.route);\n if (props.setPlayButtonVideo) {\n props.setPlayButtonVideo();\n }\n }\n };\n const changeFormat = (formatVariation) => {\n changeSize(formatVariation);\n window.location.href = formatVariation.url;\n };\n const triggerSizeSelectionOpen = () => {\n customEventBus.emit('size-selector:open', {});\n };\n const changeSize = (variation) => {\n setCurrentSize(variation);\n // qui non va cambiato il prodotto, va solo salvata la taglia selezionata che serve per l'add to cart\n if ((current === null || current === void 0 ? void 0 : current.price.type) === 'range') {\n // prezzo diverso per taglia\n api.variantPrice(`${current === null || current === void 0 ? void 0 : current.masterId}${currentColor.id}${variation.id}`).then((data) => {\n const priceData = data && Object.keys(data).length ? data : undefined;\n setVariantPrice(priceData);\n });\n }\n };\n const onSizeSelection = (size) => {\n if (size) {\n let sizeVariation = sizeVariations.find((s) => s.id == size);\n if (sizeVariation) {\n changeSize(sizeVariation);\n }\n }\n };\n const shippingDisclaimer = () => {\n return (React.createElement(\"div\", { className: \"product-selection__shipping-disclaimer\" },\n React.createElement(\"p\", { className: \"shipping-disclaimer__title\" }, t('expressshippingfree.title')),\n React.createElement(\"div\", { className: \"shipping-disclaimer_description\" },\n React.createElement(\"span\", null,\n t('expressshippingfree.description'),\n \" \"),\n (promotionInfo === null || promotionInfo === void 0 ? void 0 : promotionInfo.guest) && (React.createElement(LoginModal, { incontext: \"membersonly\", modalStatus: loginOpen, reloadPage: true, updateStatus: (status) => setLoginOpen(status), linkText: t('expressshippingfree.loginbutton'), customClass: \"button--link-button\" })))));\n };\n const lineIcons = () => {\n var _a, _b;\n return (React.createElement(React.Fragment, null,\n isGrenoble && React.createElement(\"span\", { className: \"icon--grenoble\" }),\n isGenius && React.createElement(\"span\", { className: \"icon--genius\" }),\n (current === null || current === void 0 ? void 0 : current.isMbm) && ((_a = current === null || current === void 0 ? void 0 : current.mbm) === null || _a === void 0 ? void 0 : _a.label) && React.createElement(\"img\", { src: (_b = current === null || current === void 0 ? void 0 : current.mbm) === null || _b === void 0 ? void 0 : _b.label, alt: t('mbm.title'), className: \"mbm-label\" })));\n };\n const lineIconsContainer = (className) => {\n var _a, _b, _c, _d;\n const breadcrumbs = (current === null || current === void 0 ? void 0 : current.breadcrumbs) || [];\n return (React.createElement(\"div\", { className: className },\n React.createElement(\"div\", { className: \"product-selection__line-name\" }, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 1 ? (React.createElement(React.Fragment, null, breadcrumbs.slice(1, breadcrumbs.length).map((e) => (React.createElement(\"a\", { className: !inLook ? 'in-pdp' : '', key: e === null || e === void 0 ? void 0 : e.categoryId, href: e.url }, e.htmlValue))))) : (React.createElement(\"a\", { className: !inLook ? 'in-pdp' : '', key: (_a = breadcrumbs[0]) === null || _a === void 0 ? void 0 : _a.categoryId, href: (_b = breadcrumbs[0]) === null || _b === void 0 ? void 0 : _b.url }, (_c = breadcrumbs[0]) === null || _c === void 0 ? void 0 : _c.htmlValue))),\n !inLook && (React.createElement(\"div\", { className: \"product-selection__line-labels\", id: \"product-info-heading\" },\n React.createElement(ProductLabels, { product: current, inLook: inLook, href: (_d = breadcrumbs[0]) === null || _d === void 0 ? void 0 : _d.url })))));\n };\n const sendAnalytics = () => {\n var _a, _b, _c;\n if ((_c = (_b = (_a = current.variationAttributes) === null || _a === void 0 ? void 0 : _a.find((va) => va.id == 'color')) === null || _b === void 0 ? void 0 : _b.values.find((va) => va.selected)) === null || _c === void 0 ? void 0 : _c.preorderable) {\n analytics.preorder(current === null || current === void 0 ? void 0 : current.masterId);\n analytics.preorderDetail(current, currentSize, variantPrice || (current === null || current === void 0 ? void 0 : current.price));\n }\n else {\n analytics.addToBag(current, currentSize, variantPrice || (current === null || current === void 0 ? void 0 : current.price));\n }\n };\n const sizeError = useMemo(() => {\n if (sizeSelectorError && !currentSize) {\n return t('label.pleaseselectasize');\n }\n }, [sizeSelectorError, currentSize, current === null || current === void 0 ? void 0 : current.availability]);\n // const isOutOfStock = useMemo(() => {\n // if (\n // (currentSize?.ATS < 1 || isOutOfStock) &&\n // !current?.isBoutiqueExclusive &&\n // !currentSize?.isOnlineExclusive &&\n // (current?.isComingSoon !== 2 || current?.forceSoldOut)\n // ) {\n // return (\n // \n // \n // {t(\n // colourVariations.find((colour) => {\n // if (colour.selectable) {\n // return true;\n // }\n // return false;\n // })\n // ? 'label.itemoutofstocksize'\n // : 'label.outofstocksizeandcolour'\n // )}\n // \n //
\n // );\n // }\n // }, [sizeSelectorError, currentSize, current?.availability]);\n const checkSimilarRecommender = () => {\n var _a, _b;\n if (showSimilarProducts) {\n const similarProductConfig = (_a = current === null || current === void 0 ? void 0 : current.limitedAvailabilityConfig) === null || _a === void 0 ? void 0 : _a.similarProductConfig;\n const usingRecommender = similarProductConfig === null || similarProductConfig === void 0 ? void 0 : similarProductConfig.useRecommender;\n const isManualConfig = (_b = similarProductConfig === null || similarProductConfig === void 0 ? void 0 : similarProductConfig.productIdList) === null || _b === void 0 ? void 0 : _b.length;\n if (usingRecommender && !isManualConfig) {\n setSimilarTiles();\n }\n else {\n setEnableSimilarButton(true);\n }\n }\n };\n const setSimilarTiles = async () => {\n return getSimilarProductsTiles().then((data) => {\n setSimilarProductsTiles(data);\n setEnableSimilarButton((data === null || data === void 0 ? void 0 : data.length) > 0);\n return data;\n });\n };\n const getSimilarProductsTiles = async () => {\n return new Promise((resolve, reject) => {\n if (similarProductsTiles === null || similarProductsTiles === void 0 ? void 0 : similarProductsTiles.length) {\n return resolve(similarProductsTiles);\n }\n else if (!similarProductsTiles) {\n // We only fetch if it's null, we don't ask again if we already got an empty array\n return fetchSimilarProductsTiles().then((data) => {\n resolve(data);\n });\n }\n });\n };\n const fetchSimilarProductsTiles = async () => {\n return getSimilarProducts(current)\n .then((data) => {\n return data;\n })\n .catch(() => {\n return [];\n });\n };\n const openSimilarModal = () => {\n setSimilarTiles().then((data) => {\n setSimilarModalOpen(true);\n analytics.productImpressionsRecommended(data, 'pdp');\n analytics.seeSimilarProducts(current === null || current === void 0 ? void 0 : current.masterId);\n });\n };\n const showSimilarProducts = useMemo(() => {\n var _a;\n const isPreorderOrBoutiqueExclusive = (current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive) || isPreorder;\n if ((!(current === null || current === void 0 ? void 0 : current.hasLimitedAvailability) && !(current === null || current === void 0 ? void 0 : current.isComingSoon)) || isPreorderOrBoutiqueExclusive) {\n return false;\n }\n const limitedAvailabilityConfig = current === null || current === void 0 ? void 0 : current.limitedAvailabilityConfig;\n const similarProductConfig = limitedAvailabilityConfig === null || limitedAvailabilityConfig === void 0 ? void 0 : limitedAvailabilityConfig.similarProductConfig;\n const hasSimilarProducts = (similarProductConfig === null || similarProductConfig === void 0 ? void 0 : similarProductConfig.useRecommender) ? similarProductConfig.recommenderId : (_a = similarProductConfig === null || similarProductConfig === void 0 ? void 0 : similarProductConfig.productIdList) === null || _a === void 0 ? void 0 : _a.length;\n return (limitedAvailabilityConfig === null || limitedAvailabilityConfig === void 0 ? void 0 : limitedAvailabilityConfig.showSimilarProducts) && !!hasSimilarProducts;\n }, [current, isPreorder]);\n const showSimilarProductsFloating = useMemo(() => {\n return showSimilarProducts && similarFloatingVisible;\n }, [showSimilarProducts, similarFloatingVisible]);\n const showSimilarProductsInline = useMemo(() => {\n return showSimilarProducts && !isOutOfStock;\n }, [showSimilarProducts, isOutOfStock]);\n // const showNotifyMobile = useMemo(() => {\n // if (currentBreakpoint >= window.mqObj.md) {\n // return false; // not mobile\n // }\n // if (!current?.price?.type && !current?.price?.sales?.value) {\n // return false; // no price\n // }\n // return (currentSize && !currentSize?.selectable) || isOutOfStock || current?.notShoppable;\n // }, [currentBreakpoint, current, currentSize]);\n const productSelectionBody = () => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n if (!current) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"product-selection__top-half\" },\n React.createElement(\"div\", { className: \"product-selection__heading--placeholder\" },\n React.createElement(\"div\", { className: \"product-selection__heading\" },\n (!inLook || (current === null || current === void 0 ? void 0 : current.unlock)) && lineIconsContainer('product-selection__line'),\n React.createElement(\"div\", { className: \"product-selection__name-price\" },\n React.createElement(\"h1\", { className: \"product-selection__name-price__name\" }, current === null || current === void 0 ? void 0 : current.productName),\n React.createElement(\"span\", { className: classNames(current.isGiftCard ? 'd-md-block d-none' : '', 'product-selection__name-price__price') }, (current === null || current === void 0 ? void 0 : current.isGiftCard) ? React.createElement(ProductPrice, { basePrice: ((_b = (_a = current === null || current === void 0 ? void 0 : current.gcLimits) === null || _a === void 0 ? void 0 : _a.minValue) === null || _b === void 0 ? void 0 : _b.formattedValue) || '' }) : React.createElement(ProductPrice, { price: variantPrice || (current === null || current === void 0 ? void 0 : current.price) })),\n currentBreakpoint < window.mqObj.md && currentColor && !(current === null || current === void 0 ? void 0 : current.isMbm) && !(props === null || props === void 0 ? void 0 : props.currentLook) && (React.createElement(ProductWishlistToggle, { modifierClass: \"--mobile\", color: \"black\", productSize: currentSize, productColor: currentColor, product: current, section: \"pdp\" }))))),\n React.createElement(\"div\", { className: \"product-selection__description\" },\n React.createElement(\"p\", null, (current === null || current === void 0 ? void 0 : current.longDescription) || (current === null || current === void 0 ? void 0 : current.shortDescription)),\n current.additionalShortDescription && React.createElement(\"p\", { dangerouslySetInnerHTML: { __html: current.additionalShortDescription }, className: \"mt-16\" })),\n current.isGiftCard && (React.createElement(\"div\", { className: \"gc-havecard\" },\n t('gc.haveacard'),\n \" \",\n React.createElement(\"button\", { onClick: () => props.openBalance() }, t('gc.checkbalance')))),\n ((_c = current === null || current === void 0 ? void 0 : current.availability) === null || _c === void 0 ? void 0 : _c.preorder) && ((_d = current === null || current === void 0 ? void 0 : current.availability) === null || _d === void 0 ? void 0 : _d.inStockDate) && (React.createElement(\"div\", { className: \"product-selection__preorder mt-12\", dangerouslySetInnerHTML: { __html: t('product.shippingby', { 0: (_e = current === null || current === void 0 ? void 0 : current.availability) === null || _e === void 0 ? void 0 : _e.inStockDate }) } })),\n React.createElement(\"button\", { \"aria-haspopup\": \"dialog\", onClick: () => {\n analytics.detailsAndCare('', currentColor === null || currentColor === void 0 ? void 0 : currentColor.productId);\n props.setDetailsOpen(true);\n }, className: classNames('link-anchor', { 'no-margin-bottom': (current === null || current === void 0 ? void 0 : current.isMbm) && ((_f = current.mbm) === null || _f === void 0 ? void 0 : _f.icons) }) }, current.isGiftCard ? t('gc.howitworks') : t('anchor.description')),\n current.isGiftCard && (React.createElement(\"div\", { className: \"gc-icons\" },\n React.createElement(\"div\", null,\n React.createElement(\"div\", { className: \"gc-icon-amount\" }),\n React.createElement(\"p\", null, t('gc.chooseamount'))),\n React.createElement(\"div\", null,\n React.createElement(\"div\", { className: \"gc-icon-onlinestore\" }),\n React.createElement(\"p\", null, t('gc.onlineandstore'))),\n React.createElement(\"div\", null,\n React.createElement(\"div\", { className: \"gc-icon-deliverydate\" }),\n React.createElement(\"p\", null, t('gc.deliverydate'))),\n React.createElement(\"div\", null,\n React.createElement(\"div\", { className: (current === null || current === void 0 ? void 0 : current.gcConfigValidity) ? `gc-icon-validity--${current === null || current === void 0 ? void 0 : current.gcConfigValidity}` : 'gc-icon-validity--unlimited' }),\n React.createElement(\"p\", null, (current === null || current === void 0 ? void 0 : current.gcConfigValidity) ? t('gc.useforyears', `Use it for ${current === null || current === void 0 ? void 0 : current.gcConfigValidity} years`, { 0: current === null || current === void 0 ? void 0 : current.gcConfigValidity }) : t('gc.useforunlimited'))))),\n (current === null || current === void 0 ? void 0 : current.isMbm) && ((_g = current.mbm) === null || _g === void 0 ? void 0 : _g.icons) && React.createElement(MbmIcons, { icons: (_h = current === null || current === void 0 ? void 0 : current.mbm) === null || _h === void 0 ? void 0 : _h.icons })),\n React.createElement(\"div\", { className: \"product-selection__bottom-half\" },\n !(current === null || current === void 0 ? void 0 : current.isMbm) && !current.isGiftCard && (React.createElement(\"div\", { className: classNames('product-selection__wrapper', { 'on-pdp': !inLook }) },\n React.createElement(React.Fragment, null,\n React.createElement(ProductSelectionColorExpandedLinks, { variationValues: colourVariations, current: current, currentId: currentColor === null || currentColor === void 0 ? void 0 : currentColor.id, onChangeVariation: (colorVariation) => {\n changeColor(colorVariation);\n }, productUuid: current.masterId, inverted: props.inverted, isBoutiqueExclusive: current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive }),\n React.createElement(ProductSelectionSizesExpanded, { contactformurl: props === null || props === void 0 ? void 0 : props.contactformurl, variationValues: sizeVariations, current: current, currentId: currentSize === null || currentSize === void 0 ? void 0 : currentSize.id, currentSize: currentSize, onChangeVariation: (sizeVariation) => {\n if (sizeVariation.isParfum) {\n changeFormat(sizeVariation);\n }\n else {\n changeSize(sizeVariation);\n analytics.selectedSize(sizeVariation === null || sizeVariation === void 0 ? void 0 : sizeVariation.displayValue, current === null || current === void 0 ? void 0 : current.masterId);\n }\n }, error: sizeError, trackOpenSize: () => analytics.openSize(current === null || current === void 0 ? void 0 : current.masterId), onSizeSelection: onSizeSelection, setSizeguideOpen: props === null || props === void 0 ? void 0 : props.setSizeguideOpen, openSimilarModal: openSimilarModal, similarProductsTiles: similarProductsTiles, sizeguideOpen: props === null || props === void 0 ? void 0 : props.sizeguideOpen, inverted: props.inverted, showSizeFit: true, comboBox: true }),\n React.createElement(\"div\", { id: \"size-selector-combobox-container\" }),\n showSimilarProductsInline && ((similarProductsTiles === null || similarProductsTiles === void 0 ? void 0 : similarProductsTiles.length) > 0 || enableSimilarButton) && (React.createElement(ShowSimilarProductInline, { enabled: enableSimilarButton, setSimilarModalOpen: openSimilarModal })),\n visibilityFloatingModule && showSimilarProductsFloating && (similarProductsTiles === null || similarProductsTiles === void 0 ? void 0 : similarProductsTiles.length) > 0 && (React.createElement(ShowSimilarProductFloating, { product: current, onFloatingClose: () => {\n setSimilarFloatingVisible(false);\n cookie.save('sfcc_floatingSimilarClosed', 'true', { path: '/', maxAge: 1800 });\n }, similarProductsTiles: similarProductsTiles })),\n (similarProductsTiles === null || similarProductsTiles === void 0 ? void 0 : similarProductsTiles.length) > 0 && (React.createElement(SimilarProductsDrawer, { similarModalOpen: similarModalOpen, setSimilarModalOpen: setSimilarModalOpen, product: current, similarProductsTiles: similarProductsTiles }))))),\n React.createElement(React.Fragment, null,\n React.createElement(\"div\", { ref: productButtonRef, className: classNames('product-selection__ctas', { 'is-mbm': current === null || current === void 0 ? void 0 : current.isMbm }, { 'last-cta': expressCheckoutAvailable && (((current === null || current === void 0 ? void 0 : current.unlock) && window.loggedin) || !current.unlock) }) },\n React.createElement(ProductButton, { inPDP: props.inPDP, current: current, currentSize: currentSize, currentColor: currentColor, colourVariations: colourVariations, sizeVariations: sizeVariations, triggerOpenSize: triggerSizeSelectionOpen, trackAddToBag: sendAnalytics, showReserveInBoutiqueButton: showReserveInBoutiqueButton, inShopTheLook: props.shopTheLook, inverted: props.inverted }),\n currentColor && !(current === null || current === void 0 ? void 0 : current.isMbm) && !(props === null || props === void 0 ? void 0 : props.currentLook) && (React.createElement(ProductWishlistToggle, { color: \"black\", productSize: currentSize, productColor: currentColor, product: current, section: \"pdp\" }))),\n current.isGiftCard && (React.createElement(\"div\", { className: \"d-flex gc-return-info\" },\n React.createElement(\"p\", null, t('gc.notreturnable')),\n React.createElement(\"a\", { href: current.giftCardTermsURL || 'https://www.moncler.com' }, t('gc.learnmore')))),\n expressCheckoutAvailable && (((current === null || current === void 0 ? void 0 : current.unlock) && window.loggedin) || !current.unlock) && (React.createElement(\"div\", { className: \"product-selection__ctas express-payments\" },\n React.createElement(Suspense, { fallback: React.createElement(React.Fragment, null) },\n React.createElement(ExpressPaymentsModal, { currentId: current.id, size: currentSize, triggerOpenSize: triggerSizeSelectionOpen, checkouturl: props.checkouturl }))))),\n (current === null || current === void 0 ? void 0 : current.isMbm) && !isOutOfStock && React.createElement(MbmShippingDelivery, { onPDP: true, faqLink: (_j = current === null || current === void 0 ? void 0 : current.mbm) === null || _j === void 0 ? void 0 : _j.returnFaq }),\n (current === null || current === void 0 ? void 0 : current.isMbm) && isOutOfStock && (React.createElement(React.Fragment, null,\n React.createElement(MbmOOSBox, { onClick: () => {\n analytics.notifyMe(current === null || current === void 0 ? void 0 : current.id, 'pdp', true);\n setMbmNotify(true);\n } }),\n React.createElement(MbmNotifyMeModal, { isOpen: mbmNotify, onRequestClose: () => setMbmNotify(false), imgs: current === null || current === void 0 ? void 0 : current.imgs, editLink: (_k = current === null || current === void 0 ? void 0 : current.mbm) === null || _k === void 0 ? void 0 : _k.toConfigurator, productId: current.id }))),\n React.createElement(\"div\", { className: classNames('product-selection__actions-shipping', { 'on-pdp': !inLook }, !promotionInfo || !campaignActive || (window.loggedin && !hasFreeExpressShipping) ? '' : 'shipping-disclaimer-active') },\n !current.isGiftCard &&\n (!promotionInfo || !campaignActive || (window.loggedin && !hasFreeExpressShipping) ? (React.createElement(React.Fragment, null, !window.unshoppable &&\n !(current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive) &&\n (!currentSize || (currentSize === null || currentSize === void 0 ? void 0 : currentSize.selectable)) &&\n !isOutOfStock &&\n (current === null || current === void 0 ? void 0 : current.isComingSoon) != 2 &&\n !(current === null || current === void 0 ? void 0 : current.notShoppable) &&\n (((_l = current === null || current === void 0 ? void 0 : current.price) === null || _l === void 0 ? void 0 : _l.type) || ((_o = (_m = current === null || current === void 0 ? void 0 : current.price) === null || _m === void 0 ? void 0 : _m.sales) === null || _o === void 0 ? void 0 : _o.value)) && (React.createElement(\"div\", { className: \"product-selection__shipping\" },\n React.createElement(\"p\", null,\n \" \",\n !(current === null || current === void 0 ? void 0 : current.isMbm) ? t('product.freeshipping') : t('product.mbmshipping')))))) : (React.createElement(React.Fragment, null, !(current === null || current === void 0 ? void 0 : current.isComingSoon) && !isPreOrderOrExclusive && shippingDisclaimer()))),\n !window.unshoppable &&\n ((!(current === null || current === void 0 ? void 0 : current.isBoutiqueExclusive) &&\n (!currentSize || (currentSize === null || currentSize === void 0 ? void 0 : currentSize.selectable)) &&\n !isOutOfStock &&\n (current === null || current === void 0 ? void 0 : current.isComingSoon) != 2 &&\n !(current === null || current === void 0 ? void 0 : current.notShoppable) &&\n (((_p = current === null || current === void 0 ? void 0 : current.price) === null || _p === void 0 ? void 0 : _p.type) || ((_r = (_q = current === null || current === void 0 ? void 0 : current.price) === null || _q === void 0 ? void 0 : _q.sales) === null || _r === void 0 ? void 0 : _r.value))) ||\n (current === null || current === void 0 ? void 0 : current.isMbm)) &&\n props.shippingAndReturns &&\n !(current === null || current === void 0 ? void 0 : current.isGiftCard) && (React.createElement(\"div\", { className: \"wrapper-cta\" },\n React.createElement(\"button\", { type: \"button\", className: \"button--link button--arrow-right product-selection__actions-shipping__contact-us\", onClick: () => {\n props.setShippingOpen(true);\n analytics.shippingAndReturnsLabel('', (current === null || current === void 0 ? void 0 : current.id) || (current === null || current === void 0 ? void 0 : current.masterId));\n }, \"aria-haspopup\": \"dialog\" }, t('label.shippingandreturns')))),\n (current === null || current === void 0 ? void 0 : current.isMbm) && (React.createElement(\"div\", null,\n React.createElement(BookAnAppointmentMbm, { modalimage: props === null || props === void 0 ? void 0 : props.mbmBaa, product: current }))),\n !current.isGiftCard && showReserveInBoutiqueLink && (React.createElement(\"div\", { className: \"wrapper-cta\" },\n React.createElement(ProductReserveInBoutique, { product: current, size: currentSize, color: currentColor, sizeVariations: sizeVariations, colourVariations: colourVariations }))),\n inLook && (React.createElement(\"div\", { className: \"wrapper-cta\" },\n React.createElement(\"a\", { href: props.currentLook.productUrl, className: \"button button--link button--arrow-right\" }, t('product.showMore')))),\n React.createElement(\"div\", { className: \"wrapper-cta\" },\n React.createElement(\"button\", { type: \"button\", className: classNames('button--link button--arrow-right product-selection__actions-shipping__contact-us', { button: inLook }), onClick: () => {\n setContactusModalOpen(true);\n analytics.contactUsLabel((current === null || current === void 0 ? void 0 : current.id) || (current === null || current === void 0 ? void 0 : current.masterId));\n }, \"aria-haspopup\": \"dialog\" }, t('label.contactus')))),\n (current === null || current === void 0 ? void 0 : current.hasNft) && (current === null || current === void 0 ? void 0 : current.nftContentAsset) && React.createElement(NFTInfoBox, { nftContentAsset: current === null || current === void 0 ? void 0 : current.nftContentAsset }))));\n };\n if (!inLook) {\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n // hide\n // console.info('hide');\n setShowSticky(false);\n }\n else {\n // show\n // console.info('show');\n setShowSticky(true);\n }\n });\n };\n const observer = useRef(new IntersectionObserver(callback, { threshold: 0 })).current;\n // intersection observer on stickyTray\n useEffect(() => {\n if (currentBreakpoint < window.mqObj.md) {\n setTimeout(() => {\n if (productButtonRef) {\n observer.observe(productButtonRef.current);\n return () => observer.disconnect();\n }\n }, 1000);\n }\n else {\n observer.observe(productSectionRef.current);\n return () => observer.disconnect();\n }\n }, [currentBreakpoint, window.mqObj, productButtonRef]);\n }\n const [selectionWrapperRef, inView] = useInView({\n triggerOnce: true,\n });\n // ANCHOR - Use Mutation Observable\n const onResize = useCallback((target) => {\n var _a;\n // Handle the resize event\n let productSelectionContent = document.querySelector('.product-selection-content');\n const headerHeight = (_a = document.querySelector('header')) === null || _a === void 0 ? void 0 : _a.offsetHeight;\n let heightContainer = window.innerHeight - headerHeight;\n if (productSelectionContent.offsetHeight <= heightContainer) {\n productSelectionContent.classList.add('center-alignment');\n }\n else {\n productSelectionContent.classList.remove('center-alignment');\n }\n let heightTarget = `calc(100vh - ${(target === null || target === void 0 ? void 0 : target.offsetHeight) / 10}rem`;\n let productSelection = document.querySelector('.product-selection');\n productSelection.style.top = heightTarget;\n }, [props.imageLoaded]);\n const containerRef = useResizeObserver(onResize, 300);\n /**\n * Renders the content of the modal\n */\n const renderDetails = () => {\n return (React.createElement(\"div\", { className: \"contact-us\" },\n !window.isClothing && (React.createElement(\"div\", { className: \"contact-us__desc\" },\n React.createElement(\"div\", { className: \"row justify-center\" },\n React.createElement(\"h2\", { className: \"col-12 primary-m\" }, t('label.contactus')),\n React.createElement(\"p\", { className: \"col-12 mt-16\" }, t('contactus.description'))))),\n React.createElement(\"div\", { className: classNames('contact-details contact-details--enhanced', { 'clothing-contact-details': window.isClothing }) },\n React.createElement(ContactDetailsEnhanced, { fullWidth: true, drawer: true, showEmailCta: true }))));\n };\n return (React.createElement(React.Fragment, null,\n !inLook && props.imageLoaded && (React.createElement(ProductStickyTray, { show: showSticky, current: current, currentColor: currentColor, changeColor: changeColor, currentSize: currentSize, changeSize: changeSize, colourVariations: colourVariations, sizeVariations: sizeVariations, sizeSelectorError: sizeSelectorError, updateSizeSelectorError: (e) => setSizeSelectorError(e), variantPrice: variantPrice, trackAddToBag: sendAnalytics, showReserveInBoutiqueButton: showReserveInBoutiqueButton, setSizeguideOpen: props === null || props === void 0 ? void 0 : props.setSizeguideOpen, checkouturl: props.checkouturl })),\n React.createElement(\"div\", { ref: selectionWrapperRef, className: classNames('product-selection', { container: !inLook, landing: !current || !inView || !props.imageLoaded }) },\n React.createElement(\"div\", { className: \"product-selection-content\", ref: containerRef }, inLook ? (productSelectionBody()) : (React.createElement(\"div\", { ref: productSectionRef, className: \"row justify-center align-middle\" },\n React.createElement(\"div\", { className: \"col-md-12 col-sm-8 col-12 wrapper-body-detail mq-large-case-width mq-large-case-height\" }, productSelectionBody()))))),\n React.createElement(Drawers, { contentLabel: t('label.contactus'), isOpen: contactusModalOpen, role: \"dialog\", onRequestClose: () => {\n if (location.search.includes('openVTO'))\n analytics.vtoPdpClose();\n setContactusModalOpen(false);\n } }, renderDetails())));\n};\nProductSelection.defaultProps = {\n imageLoaded: true,\n};\nexport default ProductSelection;\n","import StoreInfoBox from '@components/storelocator/StoreInfoBox';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nconst ProductBoutiqueStore = (props) => {\n const { t } = useTranslation();\n const handlePress = (e) => {\n e.preventDefault();\n props.onReservePress();\n document.querySelector('.product-reserve__main').classList.add('zoom-product');\n window.loggedin && document.querySelector('.product-reserve__detail').classList.add('zoom-product');\n };\n return (React.createElement(\"div\", { className: \"product-reserve-store\" },\n React.createElement(\"div\", { className: \"product-reserve-store__content\" },\n React.createElement(\"div\", { className: \"product-reserve-store__content__name\" },\n React.createElement(\"span\", null,\n props.index,\n \". \",\n props.store.name),\n props.store.distance && React.createElement(\"span\", { className: \"store-distance\" }, props.store.distance)),\n React.createElement(StoreInfoBox, { store: props.store }),\n window.country === 'RU' && React.createElement(\"p\", { className: \"tax-disclaimer\" }, t('store.clickAndReserve.taxdisclaimer')),\n React.createElement(\"button\", { onClick: handlePress, className: \"button button--secondary button--reserve\" },\n React.createElement(\"span\", null, t('button.reserveitem'))))));\n};\nexport default ProductBoutiqueStore;\n","import React from 'react';\nimport { useTranslation } from 'react-i18next';\nconst GeoOptions = {\n enableHighAccuracy: false,\n timeout: 5000,\n maximumAge: 0,\n};\nconst ProductBoutiqueStoresLine = (props) => {\n const { t } = useTranslation();\n const successLocalization = (pos) => {\n let crd = pos.coords;\n console.log('Your current position is:');\n console.log(`Latitude : ${crd.latitude}`);\n console.log(`Longitude: ${crd.longitude}`);\n console.log(`More or less ${crd.accuracy} meters.`);\n props.setGeo({ lat: pos.coords.latitude, lng: pos.coords.longitude });\n };\n const errorLocalization = (err) => {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n };\n return (React.createElement(\"div\", { className: \"product-reserve__detail__line\" },\n React.createElement(\"span\", null, t('storelocator.nboutiques', { 0: props.storescount })),\n React.createElement(\"button\", { type: \"button\", className: \"use-location\", onClick: () => {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(successLocalization, errorLocalization, GeoOptions);\n }\n else {\n console.warn('Geolocation is not supported by this browser.');\n }\n } }, t('storelocator.usemylocation'))));\n};\nexport default ProductBoutiqueStoresLine;\n","import React, { useEffect, useState } from 'react';\nimport api from '@common/utils/api';\nimport ProductBoutiqueStore from './ProductBoutiqueStore';\nimport ProductBoutiqueStoresLine from './ProductBoutiqueStoresLine';\nconst ProductBoutiqueTabCountry = (props) => {\n const [stores, setStores] = useState([]);\n const [loading, setLoading] = useState(true);\n const [geo, setGeo] = useState();\n useEffect(() => {\n if (!props.pid) {\n setStores([]);\n setLoading(false);\n }\n else {\n setLoading(true);\n api.checkBoutiqueAvailability(props.pid, props.country, false, geo).then((data) => {\n if (data) {\n setStores(data.stores);\n setLoading(false);\n }\n else {\n setLoading(false);\n }\n });\n }\n }, [props.pid, props.country, geo]);\n if (loading && (stores === null || stores === void 0 ? void 0 : stores.length) == 0) {\n return React.createElement(React.Fragment, null);\n }\n if (props.pid && (stores === null || stores === void 0 ? void 0 : stores.length) == 0) {\n return props.noResults;\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(ProductBoutiqueStoresLine, { storescount: stores.length, setGeo: (e) => setGeo(e) }),\n stores.map((fs, idx) => (React.createElement(ProductBoutiqueStore, { key: fs.ID, index: idx + 1, store: fs, onReservePress: () => props.onStoreSelect(fs) })))));\n};\nexport default ProductBoutiqueTabCountry;\n","import Accordion from '@ui/accordion/Accordion';\nimport AccordionItem from '@ui/accordion/AccordionItem';\nimport React from 'react';\nimport api from '@common/utils/api';\nimport ProductBoutiqueStore from './ProductBoutiqueStore';\nconst ProductBoutiqueTabEurope = (props) => {\n const [countries, setCountries] = React.useState([]);\n const [loading, setLoading] = React.useState(true);\n React.useEffect(() => {\n if (!props.pid) {\n setCountries([]);\n setLoading(false);\n }\n else {\n setLoading(true);\n api.checkBoutiqueAvailability(props.pid, props.country, true).then((data) => {\n let countrygroups = new Map();\n if (data) {\n data.stores.forEach((s) => {\n if (s.countryCode) {\n let cg = countrygroups.get(s.countryCode.value);\n if (!cg) {\n countrygroups.set(s.countryCode.value, {\n label: s.countryCode.displayValue,\n stores: [s],\n });\n }\n else {\n cg.stores.push(s);\n }\n }\n });\n setCountries(Array.from(countrygroups.values()).sort((a, b) => {\n return a.label.localeCompare(b.label);\n }));\n setLoading(false);\n }\n else {\n setLoading(false);\n }\n });\n }\n }, [props.pid, props.country]);\n if (loading) {\n return React.createElement(React.Fragment, null);\n }\n if (countries.length == 0) {\n return props.noResults;\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(Accordion, null, countries.map((c) => {\n var _a;\n return (React.createElement(AccordionItem, { key: c.label, title: React.createElement(\"span\", null,\n c.label,\n React.createElement(\"sup\", null, (_a = c.stores) === null || _a === void 0 ? void 0 : _a.length)), accordionId: c.label }, c.stores.map((fs, idx) => (React.createElement(ProductBoutiqueStore, { key: fs.ID, index: idx + 1, store: fs, onReservePress: () => props.onStoreSelect(fs) })))));\n }))));\n};\nexport default ProductBoutiqueTabEurope;\n","import BookAnAppointmentDateSelection from '@moncler/components/appointments/BookAnAppointmentDateSelection';\nimport BookAnAppointmentReasonMessage from '@moncler/components/appointments/BookAnAppointmentReasonMessage';\nimport ErrorBox from '@components/common/ErrorBox';\nimport ErrorModal from '@components/error/ErrorModal';\nimport ProductAddToBag from '@moncler/components/product/ProductActionAddToBag';\nimport ProductSelectionFormats from '@moncler/components/product/ProductSelectionFormats';\nimport StoreAddress from '@components/storelocator/StoreAddress';\nimport Button from '@ui/button/Button';\nimport DwFormField from '@ui/formfield/DwFormField';\nimport DwFormFieldPhoneWithPrefix from '@ui/formfield/DwFormFieldPhoneWithPrefix';\nimport ModalDialog from '@ui/modal/ModalDialog';\nimport addressutils from '@utils/addressutils';\nimport analytics from '@utils/analytics';\nimport api from '@utils/api';\nimport { BAA } from '@utils/constants';\nimport formutils from '@utils/formutils';\nimport { getColorVariations, getProductMasterId, getSizeVariations } from '@utils/product';\nimport useBreakpoint from '@utils/useBreakpoint';\nimport createDecorator from 'final-form-focus';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Form } from 'react-final-form';\nimport { useTranslation } from 'react-i18next';\nimport { Tab, TabList, TabPanel, Tabs } from 'react-tabs';\nimport ProductImage from '../product/ProductImage';\nimport ProductSelectionColorExpanded from '../product/ProductSelectionColorExpanded';\nimport ProductSelectionSizesExpanded from '../product/ProductSelectionSizesExpanded';\nimport ProductBoutiqueSelected from './ProductBoutiqueSelected';\nimport ProductBoutiqueTabCountry from '@components/reserve/ProductBoutiqueTabCountry';\nimport ProductBoutiqueTabEurope from '@components/reserve/ProductBoutiqueTabEurope';\nimport LoginOrRegisterColumn from '@components/login/LoginOrRegisterColumn';\nimport useInnerWidth from '@utils/useInnerWidth';\nimport classNames from 'classnames';\nimport { debounce } from '@common/utils/functions';\nimport DigitalFlagshipSmallPromoCard from '../experience/DigitalFlagshipSmallPromoCard';\nconst focusOnError = createDecorator();\nconst ProductBoutiqueModal = (props) => {\n var _a, _b, _c, _d;\n const { t } = useTranslation();\n const currentBreakpoint = useBreakpoint();\n const [product, setProduct] = useState(props.product);\n const [currentColor, setCurrentColor] = useState();\n const [currentSize, setCurrentSize] = useState();\n const [loggedIn, setLoggedIn] = useState(window.loggedin);\n const [currentStore, setCurrentStore] = useState();\n const [requestSent, setRequestSent] = useState();\n const [formdef, setFormdef] = useState();\n const [initialValues, setInitialValues] = useState();\n const [countries, setCountries] = useState([]);\n const [errors, setErrors] = useState([]);\n const [days, setDays] = useState({});\n const [localizedProductPrice, setLocalizedProductPrice] = useState('');\n const [collections, setCollections] = useState([]);\n const [errorMessage, setErrorMessage] = useState();\n const [clickAndReserveEnabled, setClickAndReserveEnabled] = useState(false);\n const [loginEmail, setLoginEmail] = useState();\n const [firstName, setFirstName] = useState();\n const [lastName, setLastName] = useState();\n const [phone, setPhone] = useState();\n const [phonePrefix, setPhonePrefix] = useState();\n const [isDesktop, setIsDesktop] = useState(false);\n const currentWidth = useInnerWidth();\n const reserveDetailRef = useRef();\n useEffect(() => {\n if (props.isOpen) {\n api.getBoutiqueCountries().then((data) => {\n setCountries(data);\n });\n }\n }, [props.isOpen]);\n useEffect(() => {\n if (currentBreakpoint >= window.mqObj.md) {\n setIsDesktop(true);\n }\n else {\n setIsDesktop(false);\n }\n }, [currentBreakpoint]);\n useEffect(() => {\n let width = document.querySelector('.store-details');\n if (width || requestSent) {\n let emailInput = document.querySelector('.email');\n if (emailInput) {\n emailInput.style.width = width.offsetWidth + 'px';\n }\n }\n }, [currentWidth, requestSent]);\n useEffect(() => {\n var _a;\n if (isDesktop && reserveDetailRef) {\n // @ts-ignore\n (_a = reserveDetailRef === null || reserveDetailRef === void 0 ? void 0 : reserveDetailRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ top: 0, behavior: 'smooth' });\n }\n }, [currentStore, reserveDetailRef]);\n // update internal product to avoid errors\n useEffect(() => {\n var _a;\n setProduct(props.product);\n if ((_a = props.product) === null || _a === void 0 ? void 0 : _a.isParfum) {\n setCurrentColor(getColorVariations(props.product)[0]);\n setCurrentSize(getSizeVariations(props.product)[0]);\n }\n }, [props.product]);\n // non renderizzare la modale all'apertura della pagina, non fare chiamate se non aperta\n const firstRender = useRef(true);\n useEffect(() => {\n if (props.isOpen && firstRender.current) {\n firstRender.current = false;\n api.getClickAndReserveConfig().then((data) => {\n if (data.limitOrdersEnabled) {\n setClickAndReserveEnabled(true);\n }\n });\n }\n if (props.isOpen && loggedIn) {\n getForm();\n }\n }, [props.isOpen, loggedIn]);\n const getForm = () => {\n let val = {};\n api.getForm('reserve', val).then((data) => {\n setFirstName(data.firstname.htmlValue);\n setLastName(data.lastname.htmlValue);\n setPhone(data.phone.htmlValue);\n setPhonePrefix(data.phonePrefix.htmlValue);\n setLoginEmail(data.email.htmlValue);\n val.applicationorigin = window.appmode ? 'app' : 'web';\n setInitialValues(val);\n setFormdef(data);\n if (!loggedIn) {\n setLoggedIn(true);\n }\n });\n };\n const productSelected = useMemo(() => {\n var _a, _b, _c;\n if (product === null || product === void 0 ? void 0 : product.isParfum) {\n return (_c = (_b = (_a = product.parfumAttributes) === null || _a === void 0 ? void 0 : _a.productFamily) === null || _b === void 0 ? void 0 : _b.find((parfumFormat) => parfumFormat.groupId === product.id)) === null || _c === void 0 ? void 0 : _c.id;\n }\n if (currentColor !== undefined && currentSize !== undefined) {\n return `${currentColor.productId}${currentSize.id}`;\n }\n return;\n }, [product, currentColor, currentSize]);\n const resetOnClose = useCallback(() => {\n props.onRequestClose();\n setTimeout(() => {\n setRequestSent(undefined);\n setCurrentStore(undefined);\n }, 1000);\n }, [props.onRequestClose]);\n const noResults = useMemo(() => {\n return (React.createElement(\"div\", { className: \"product-reserve__detail__text\", role: \"alert\", \"aria-live\": \"polite\" }, (currentSize === null || currentSize === void 0 ? void 0 : currentSize.selectable) && !(product === null || product === void 0 ? void 0 : product.isBoutiqueExclusive) && !(product === null || product === void 0 ? void 0 : product.notShoppable) ? (React.createElement(React.Fragment, null,\n React.createElement(\"p\", null, t('findinboutique.notavailableinboutique')),\n React.createElement(ProductAddToBag, { product: product, size: currentSize, pushAnalytics: () => {\n // analytics.quickShopAddToBag(product.masterId, product.type);\n analytics.quickShopAddToBagDetails(product, currentSize.value);\n }, callback: resetOnClose, updateErrorMessage: (msg) => setErrorMessage(msg) }),\n React.createElement(ErrorModal, { message: errorMessage, onClose: () => setErrorMessage(undefined) }))) : (React.createElement(React.Fragment, null,\n React.createElement(\"p\", null, t('findinboutique.notavailable')),\n React.createElement(Button, { type: \"button\", onClick: () => props.onRequestClose() }, t('button.backtoshopping'))))));\n }, [currentSize, product, errorMessage]);\n useEffect(() => {\n // Update the current size when it changes from outside.\n if (props === null || props === void 0 ? void 0 : props.size) {\n if (product) {\n let sizeVariation = getSizeVariations(product).find((s) => s.id == props.size.id);\n setCurrentSize(sizeVariation);\n }\n else {\n setCurrentSize(props.size);\n }\n }\n }, [props === null || props === void 0 ? void 0 : props.size]);\n useEffect(() => {\n // Update the current color when it changes from outside.\n if (props === null || props === void 0 ? void 0 : props.color) {\n setCurrentColor(props.color);\n }\n }, [props === null || props === void 0 ? void 0 : props.color]);\n const prefillValues = (values) => {\n values.productid = `${currentColor.productId}${currentSize.id}`;\n values.storeid = currentStore.ID;\n };\n useEffect(() => {\n var _a, _b, _c;\n if (currentStore) {\n analytics.reserveInBoutiqueOverlay(product.id, currentSize.id);\n }\n if (currentStore && ((_a = currentStore === null || currentStore === void 0 ? void 0 : currentStore.storeServices) === null || _a === void 0 ? void 0 : _a.bookAnAppointment)) {\n api.bookAnAppointmentSlots(currentStore === null || currentStore === void 0 ? void 0 : currentStore.ID, undefined, true).then((data) => {\n setDays(data.days);\n });\n api.bookAnAppointmentCollections(currentStore === null || currentStore === void 0 ? void 0 : currentStore.ID).then((data) => {\n setCollections(data);\n });\n }\n else {\n setDays({});\n }\n if (!currentStore) {\n try {\n (_c = (_b = document === null || document === void 0 ? void 0 : document.querySelector('.product-reserve__detail')) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.remove('zoom-product');\n }\n catch (error) {\n console.log(error);\n }\n }\n }, [currentStore]);\n const validate = async (values) => {\n if (window.loggedin) {\n values.privacyFlag = true;\n }\n prefillValues(values);\n return await formutils.validateForm(values, formdef, 'reserve');\n };\n const onSubmit = async (values) => {\n setErrors([]);\n let err = await validate(values);\n if (err && Object.keys(err).length > 0) {\n return err;\n }\n return await api\n .reserveInBoutique(values, formdef)\n .then((data) => {\n var _a, _b, _c;\n let errors = {};\n if (!data || data.error || ((_a = data.error) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n setErrors(((_b = data.error) === null || _b === void 0 ? void 0 : _b.length) > 0 ? data.error : data.serverErrors.slice(0, 1));\n console.error(((_c = data.error) === null || _c === void 0 ? void 0 : _c.length) > 0 ? data.error : data.serverErrors);\n return;\n }\n if (!formutils.checkValidationAfterSubmit(data, errors)) {\n return errors;\n }\n setLocalizedProductPrice(data.localizedPrice);\n props.mode === 'find' ? analytics.findInBoutiqueSubmit(product.id) : analytics.reserveInBoutiqueSubmit(product.id, currentSize.id, product.analyticsAttributes.dimension14);\n setRequestSent(values);\n })\n .catch((e) => console.error(e));\n };\n const setSizeCallback = (val) => {\n setCurrentSize(val);\n props.mode === 'find' ? analytics.findInBoutiqueSelectedSize(val.displayValue, product.masterId) : analytics.reserveInBoutiqueSelectedSize(val.displayValue, product.masterId);\n };\n const setColorCallback = (colorVariation) => {\n if (!colorVariation) {\n return;\n }\n setCurrentColor(colorVariation);\n api.getProductTile(getProductMasterId(product) + colorVariation.id).then((data) => {\n if (!!data) {\n setProduct(data);\n let sizeVariation = getSizeVariations(data).find((s) => s.id == currentSize.id);\n setCurrentSize(sizeVariation);\n }\n });\n };\n const updateParfumProduct = (selectedItem) => {\n if (!selectedItem) {\n return;\n }\n api.getProductTile(selectedItem.groupId).then((data) => {\n if (!!data) {\n setProduct(data);\n setCurrentColor(getColorVariations(data)[0]);\n let selectedSize = getSizeVariations(data)[0];\n setCurrentSize(selectedSize);\n props.mode === 'find'\n ? analytics.findInBoutiqueSelectedSize(selectedSize.displayValue, product.masterId)\n : analytics.reserveInBoutiqueSelectedSize(selectedSize.displayValue, product.masterId);\n }\n });\n };\n const storeChooser = useCallback(() => {\n var _a, _b;\n return countries.length > 0 ? (React.createElement(Tabs, { className: \"tabs tabs--fluid tabs--capitalize\" },\n React.createElement(TabList, { className: \"container react-tabs__tab-list\" },\n countries.find((c) => c.selected) && React.createElement(Tab, null, countries.find((c) => c.selected).label),\n window.site === 'MonclerEU' && React.createElement(Tab, null, t('label.europe'))),\n countries.find((c) => c.selected) && (React.createElement(TabPanel, null, productSelected ? (React.createElement(ProductBoutiqueTabCountry, { pid: productSelected, country: (_a = countries.find((c) => c.selected)) === null || _a === void 0 ? void 0 : _a.value, noResults: noResults, onStoreSelect: setCurrentStore })) : (React.createElement(\"div\", { className: \"product-reserve__detail__text\" },\n React.createElement(\"p\", null, t('findinboutique.selectsize')))))),\n window.site === 'MonclerEU' && (React.createElement(TabPanel, null, productSelected ? (React.createElement(ProductBoutiqueTabEurope, { pid: productSelected, country: (_b = countries.find((c) => c.selected)) === null || _b === void 0 ? void 0 : _b.value, noResults: noResults, onStoreSelect: setCurrentStore })) : (React.createElement(\"div\", { className: \"product-reserve__detail__text\" },\n React.createElement(\"p\", null, t('findinboutique.selectsize')))))))) : (React.createElement(React.Fragment, null));\n }, [productSelected, countries, errorMessage, noResults]);\n const info = (React.createElement(\"div\", { className: \"product-reserve-review\" },\n React.createElement(\"p\", { className: \"bold mb-4 primary-s\" }, product === null || product === void 0 ? void 0 : product.productName),\n (product === null || product === void 0 ? void 0 : product.isParfum) ? (React.createElement(\"p\", { className: \"option-product__size\" },\n t('label.format'),\n \" \", (_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.parfumAttributes) === null || _a === void 0 ? void 0 : _a.productFamily) === null || _b === void 0 ? void 0 : _b.find((el) => el.groupId == product.id)) === null || _c === void 0 ? void 0 :\n _c.format)) : (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"mb-4 wrapper-color\" },\n t('findinboutique.color', { color: currentColor === null || currentColor === void 0 ? void 0 : currentColor.displayValue }),\n (currentColor === null || currentColor === void 0 ? void 0 : currentColor.swatchColor) && (React.createElement(\"span\", { style: {\n background: currentColor === null || currentColor === void 0 ? void 0 : currentColor.swatchColor,\n height: '7px',\n width: '7px',\n } }))),\n React.createElement(\"p\", null, t('findinboutique.size', { size: currentSize === null || currentSize === void 0 ? void 0 : currentSize.displayValue }))))));\n const review = useCallback(() => {\n var _a, _b, _c, _d;\n return (React.createElement(\"div\", { className: \"product-reserve__detail__reserve-review\" },\n React.createElement(\"h2\", { className: \"primary-m\", role: \"alert\" }, t('notifyme.thankyou', { title: formutils.labelByValue(requestSent.title, formdef.title), name: requestSent.firstname, surname: requestSent === null || requestSent === void 0 ? void 0 : requestSent.lastname })),\n React.createElement(\"p\", { className: \"mt-12\" }, t('findinboutique.confirmation')),\n React.createElement(\"div\", { className: \"product-reserve__detail__review\" },\n !isDesktop && React.createElement(\"div\", { className: \"product-reserve__detail__review-divider\" }),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-grid\" },\n !isDesktop && (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"product-reserve__detail__review-product\" },\n React.createElement(\"p\", { className: \"primary-xxs-u mb-4\" }, product === null || product === void 0 ? void 0 : product.productName),\n (product === null || product === void 0 ? void 0 : product.isParfum) ? (React.createElement(\"p\", { className: \"option-product__size\" },\n t('label.format'),\n \" \", (_b = (_a = product === null || product === void 0 ? void 0 : product.parfumAttributes) === null || _a === void 0 ? void 0 : _a.productFamily) === null || _b === void 0 ? void 0 :\n _b.find((el) => el.groupId == product.id).format)) : (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"mb-4 wrapper-color\" },\n t('findinboutique.color', { color: currentColor === null || currentColor === void 0 ? void 0 : currentColor.displayValue }),\n (currentColor === null || currentColor === void 0 ? void 0 : currentColor.swatchColor) && (React.createElement(\"span\", { style: {\n background: currentColor === null || currentColor === void 0 ? void 0 : currentColor.swatchColor,\n height: '7px',\n width: '7px',\n border: '1px solid',\n } }))),\n React.createElement(\"p\", null, t('findinboutique.size', { size: currentSize.displayValue }))))))),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-divider\" }),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-store\" },\n React.createElement(\"p\", { className: \"product-reserve__detail__review-header primary-xs\" }, t('findinboutique.storeinfo')),\n React.createElement(StoreAddress, { store: currentStore, showphone: true, showmail: true })),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-customer\" },\n React.createElement(\"p\", { className: \"product-reserve__detail__review-header primary-xs\" }, t('findinboutique.customerinfo')),\n React.createElement(\"p\", null,\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" }, addressutils.salutation(requestSent.firstname, requestSent.lastname, formutils.labelByValue(requestSent === null || requestSent === void 0 ? void 0 : requestSent.title, formdef === null || formdef === void 0 ? void 0 : formdef.title))),\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" }, requestSent.email),\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" },\n requestSent.phonePrefix,\n \" \",\n requestSent.phone)),\n (requestSent === null || requestSent === void 0 ? void 0 : requestSent.message) && (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"product-reserve__detail__review-header primary-xs boutique-message\" }, t('findinboutique.message')),\n React.createElement(\"p\", null,\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" }, requestSent.message)))))),\n currentStore.interactiveStoreModule && (React.createElement(\"div\", { className: \"digital-flaship-promocard\" },\n React.createElement(DigitalFlagshipSmallPromoCard, { store: currentStore }))),\n requestSent.bookanappointment && (requestSent === null || requestSent === void 0 ? void 0 : requestSent.date) && (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"product-reserve__detail__review-divider booked-appointment\" }),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-store\" },\n React.createElement(\"p\", { className: \"product-reserve__detail__review-header primary-xs\" }, t('bookanappointment.appointmentdetails')),\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" },\n t('label.date'),\n \": \", requestSent === null || requestSent === void 0 ? void 0 :\n requestSent.date),\n React.createElement(\"span\", { className: \"product-reserve__detail__review-content\" },\n t('label.hour'),\n \": \", (_d = (_c = days[requestSent === null || requestSent === void 0 ? void 0 : requestSent.date]) === null || _c === void 0 ? void 0 : _c.find((p) => (p === null || p === void 0 ? void 0 : p.value) == requestSent.hour)) === null || _d === void 0 ? void 0 :\n _d.label))))),\n React.createElement(\"div\", { className: \"product-reserve__detail__review-divider booked-appointment\" }),\n React.createElement(Button, { type: \"button\", onClick: () => props.onRequestClose() }, t('button.backtoshopping'))));\n }, [product, requestSent]);\n const toogleChecked = (e) => {\n const checked = e.currentTarget.checked;\n if (!checked) {\n document.querySelector('.wrapper-bookanappointment').classList.add('d-none');\n }\n else {\n document.querySelector('.wrapper-bookanappointment').classList.remove('d-none');\n }\n };\n const reserveForm = useCallback(() => {\n var _a;\n return (React.createElement(\"div\", null,\n React.createElement(ProductBoutiqueSelected, { store: currentStore, onArrowBack: () => setCurrentStore(null), withBorder: true }),\n React.createElement(\"div\", { className: \"product-reserve__detail__form\" },\n React.createElement(Form, { initialValues: initialValues, onSubmit: onSubmit, validate: validate, decorators: [focusOnError], mutators: {\n global: formutils.globalMutator,\n resetHours: (args, state, utils) => {\n utils.changeValue(state, 'hour', () => null);\n },\n }, render: ({ handleSubmit, form, submitting, pristine, values }) => {\n var _a;\n return (React.createElement(\"form\", { onSubmit: handleSubmit },\n React.createElement(\"fieldset\", { className: \"fieldset--plain\" },\n React.createElement(\"div\", { className: \"ReserveForm\" },\n React.createElement(\"div\", { className: \"wrapper-info mt-16\" },\n React.createElement(\"div\", { className: \"row mb-20\" },\n React.createElement(\"span\", { className: \"primary-xs-u col-12 mb-8\" }, t('profile.namesurname')),\n React.createElement(\"span\", { className: \"bold col-12\" },\n firstName,\n \" \",\n lastName)),\n React.createElement(\"div\", { className: \"row mb-20\" },\n React.createElement(\"span\", { className: \"primary-xs-u col-12 mb-8\" }, t('profile.email')),\n React.createElement(\"span\", { className: \"bold col-12\" }, loginEmail)),\n phone && (React.createElement(\"div\", { className: \"row mb-20\" },\n React.createElement(\"span\", { className: \"primary-xs-u col-12 mb-8\" }, t('profile.phonenumber')),\n React.createElement(\"span\", { className: \"bold col-12\" },\n phonePrefix,\n \" \",\n phone))),\n !phone && (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"mb-12\" },\n React.createElement(\"span\", null, t('profile.additionalinfo'))),\n React.createElement(DwFormFieldPhoneWithPrefix, { def: formdef, uniqueLabel: t('profile.phonenumber') })))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col-12\" },\n React.createElement(DwFormField, { def: formdef, name: \"message\", type: \"textarea\" }))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col-12\" },\n React.createElement(DwFormField, { def: formdef, name: \"applicationorigin\", value: values.applicationorigin, hiddenLabel: true, className: \"visually-hidden\" }))),\n ((_a = currentStore === null || currentStore === void 0 ? void 0 : currentStore.storeServices) === null || _a === void 0 ? void 0 : _a.bookAnAppointment) && Object.keys(days).length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"bold primary-xxs\" }, t('bookanappointment.text')),\n React.createElement(\"div\", { className: \"checkbox\" },\n React.createElement(\"div\", { className: \"checkbox__field\" },\n React.createElement(\"input\", { type: \"checkbox\", id: \"bookanappointment\", defaultChecked: false, onChange: (e) => {\n toogleChecked(e);\n form.mutators.global({ bookanappointment: e.currentTarget.checked });\n } }),\n React.createElement(\"label\", { htmlFor: \"bookanappointment\" }, t('bookanappointment.checkbox')))),\n React.createElement(\"div\", { className: \"wrapper-bookanappointment mt-20 d-none\" },\n React.createElement(BookAnAppointmentDateSelection, { formdef: formdef, days: days, values: values, form: form }),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: values.reason == BAA.REASONS.DISCOVERCOLLECTION ? 'col-lg-6' : 'col-12' },\n React.createElement(DwFormField, { requiredLabel: true, def: formdef, name: \"reason\", type: \"select\" })),\n values.reason == BAA.REASONS.DISCOVERCOLLECTION && (collections === null || collections === void 0 ? void 0 : collections.length) > 0 && (React.createElement(\"div\", { className: \"col-12 col-lg-6\" },\n React.createElement(DwFormField, { def: formdef, name: \"collectionCode\", type: \"select\", options: [{ value: '', label: t('label.select') }].concat(collections) || [] })))),\n React.createElement(BookAnAppointmentReasonMessage, { formdef: formdef, values: values }),\n React.createElement(\"div\", { className: \"appointments-mandatoryField mb-20\" }, t('label.mandatoryfields')))))),\n React.createElement(\"div\", { className: \"disclaimer\" }, t('findinboutique.disclaimer'))),\n React.createElement(\"div\", { className: \"product-reserve__detail__form__submit\" },\n React.createElement(Button, { type: \"submit\", disabled: submitting, cls: ['button--primary'] }, t('button.reserveitem')))));\n } }),\n React.createElement(ErrorBox, { errors: errors }),\n React.createElement(\"p\", { className: \"product-reserve__detail__form__note\" },\n React.createElement(\"small\", { className: \"note\", dangerouslySetInnerHTML: { __html: t('notifyme.termsandconditions', { 0: (_a = document.getElementById('hidden-cookieurl')) === null || _a === void 0 ? void 0 : _a.href }) } })))));\n }, [currentStore, formdef, days, collections, errors]);\n // TODO rimuovere questa roba inutile\n const onSizeSelection = (size) => {\n console.info('size: ' + size);\n /* if (size) {\n let sizeVariation: models.VariationValue = sizeVariations.find((s) => s.id == size);\n if (sizeVariation) {\n changeSize(sizeVariation);\n }\n } */\n };\n const content = () => {\n if (!currentStore) {\n // step 0\n return storeChooser();\n }\n else if (requestSent && loggedIn) {\n // step 2\n if (currentBreakpoint < window.mqObj['md']) {\n return (React.createElement(ModalDialog, { isOpen: true, className: \"reserve-form-modal\", onRequestClose: resetOnClose, contentLabel: t('product.reserveinboutique') }, review()));\n }\n return review();\n }\n else if (loggedIn) {\n return reserveForm();\n }\n else {\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"divider\" }),\n React.createElement(LoginOrRegisterColumn, { privacypolicy: props.privacypolicy, updateLoggeedStatus: () => getForm(), updateLoggedin: () => getForm(), forgotpasswordform: props.forgotpasswordform, closeModal: () => props.onRequestClose, reloadComponent: true, reloadPage: true, reloadRegisterComponent: true, pageContext: \"clickandreserve\" })));\n }\n };\n // if (!props.isOpen) {\n // return <>>;\n // }\n const sizeVariations = useMemo(() => {\n let sizeVariations = getSizeVariations(product);\n if (sizeVariations.length == 1) {\n setCurrentSize(sizeVariations[0]);\n }\n else if (!sizeVariations.find((el) => el.id == (currentSize === null || currentSize === void 0 ? void 0 : currentSize.id))) {\n setCurrentSize(undefined);\n }\n return sizeVariations;\n }, [product]);\n const handleResize = debounce((entries) => {\n const el = entries[0].target;\n const scrollbarWidth = el.offsetWidth - el.clientWidth;\n const modal = document.getElementById('reserveinboutique');\n if (modal) {\n modal.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);\n }\n }, 200);\n const observer = new ResizeObserver(handleResize);\n return (React.createElement(ModalDialog, { hideHeader: true, noPadding: true, closeInvertedSm: !window.enableColorBackgroundStillLife, isOpen: props.isOpen, className: classNames('reserveinboutique', { 'white-bg': window.enableColorBackgroundStillLife }), onRequestClose: () => {\n resetOnClose();\n observer.unobserve(reserveDetailRef === null || reserveDetailRef === void 0 ? void 0 : reserveDetailRef.current);\n }, contentLabel: props.title, id: \"reserveinboutique\", onAfterOpen: () => {\n if (reserveDetailRef.current) {\n observer.observe(reserveDetailRef.current);\n }\n } },\n React.createElement(\"div\", { className: \"product-reserve\" },\n React.createElement(\"div\", { className: classNames('product-reserve__main', { 'zoom-product': currentStore }, { 'is-login': !loggedIn }) },\n React.createElement(\"h1\", { className: \"dialog__title d-md-none\" }, props.title),\n !requestSent && React.createElement(\"p\", { className: \"product-reserve__main__name\" }, product === null || product === void 0 ? void 0 : product.productName),\n React.createElement(ProductImage, { img: product === null || product === void 0 ? void 0 : product.imgs, type: \"F\" }),\n !requestSent && (React.createElement(\"div\", { className: \"product-reserve__main__wrapper\" }, (product === null || product === void 0 ? void 0 : product.isParfum) ? (React.createElement(ProductSelectionFormats, { productFormats: (_d = product.parfumAttributes) === null || _d === void 0 ? void 0 : _d.productFamily, currentId: product.id, onChangeFormat: updateParfumProduct, className: props.product.imageBackground !== 'white' ? 'inverted' : '', alwaysAvailable: true, inReserve: true })) : (React.createElement(React.Fragment, null,\n React.createElement(ProductSelectionColorExpanded, { currentId: currentColor === null || currentColor === void 0 ? void 0 : currentColor.id, variationValues: props.colourVariations, onChangeVariation: setColorCallback, className: classNames('bottom-divider', { inverted: !window.enableColorBackgroundStillLife }), hideOnlineExclusive: true, alwaysAvailable: true }),\n React.createElement(ProductSelectionSizesExpanded, { current: product, currentId: currentSize === null || currentSize === void 0 ? void 0 : currentSize.id, variationValues: sizeVariations, onChangeVariation: setSizeCallback, className: window.enableColorBackgroundStillLife ? '' : 'inverted', onSizeSelection: onSizeSelection, trackOpenSize: () => (props.mode === 'find' ? analytics.findInBoutiqueOpenSize(product === null || product === void 0 ? void 0 : product.masterId) : analytics.reserveInBoutiqueOpenSize(product.masterId)), hideSizeGuide: true, alwaysAvailable: true, showSizeFit: true }))))),\n info),\n React.createElement(\"div\", { className: \"product-reserve__detail\", ref: reserveDetailRef },\n React.createElement(\"h1\", { className: \"dialog__title\" }, props.title),\n clickAndReserveEnabled && (!window.loggedin || !currentStore) && React.createElement(\"p\", { className: \"dialog_subtitle\" }, t('findinboutique.introduction')),\n \" \",\n React.createElement(React.Fragment, null, content())))));\n};\nexport default ProductBoutiqueModal;\n"],"names":["props","type","uuid","assetid","content","el","useRef","useEffect","_a","current","outerHTML","text","ref","to","from","productId","children","className","ariaLabel","ariaHidden","tabIndex","product","trackingAction","originalUuid","rest","__rest","dispatch","history","location","pathname","state","linkProps","Object","assign","mergedState","transition","direction","productUuid","viewport","scrollY","onClick","event","stopPropagation","payload","newLocation","window","search","replace","router","useContext","navigator","userAgent","indexOf","id","route","thumbStartIndex","index","onClickAction","_b","noClickTracking","pageType","sessionStorage","setItem","length","toString","analytics","actionList","linktype","scrollTo","currentTarget","closest","recommender","isTechnicalPage","region","toLowerCase","analyticsSuffix","analyticsAttributes","dimension38","isShelf","query","URLSearchParams","get","VTOcode","href","productUrl","t","store","hidename","phone","hasDOSService","email","target","rel","storeHours","map","sh","key","day","hasInStoreServices","storeServices","clickAndReserve","clickFromStore","pickUpInStore","returnInStore","exchangeInStore","distantSale","bookAnAppointment","GarmentKit","personalizationRoom","liveBoutique","videoRef","thronComponent","setThronComponent","useState","changeContent","thronID","options","onPauseCallback","onPlayCallback","onCompleteCallback","onInitCallback","onTimeUpdate","loopTimes","newThronComponent","thronMobileID","muted","autoplay","loop","lockBitrate","noskin","sessionId","Selector","selectorRef","buttonRef","menuRef","open","setOpen","hovering","setHovering","focusList","setFocusList","currentBreakpoint","currentValue","currentItem","forceCloseOnChange","selectorButton","setButtonWidth","enableOnlyOneLeftLabel","mqObj","sm","classList","add","dynamicWidth","innerWidth","style","width","remove","addEventListener","removeEventListener","_c","trackOpen","menuHeight","offsetHeight","height","focus","removeAttribute","enableOutofstockClass","useMemo","enabled","enableOutofstockLabel","swatchable","selectable","stockStatus","onMouseEnterHandler","disableHover","onMouseLeaveHandler","selectorId","onMouseEnter","onMouseLeave","onClickExtraAction","expanded","disabled","selectedLabel","hideValue","itemType","displayValue","variation","hideUnselectedLabel","unselectedLabel","error","ease","duration","initial","opacity","animate","exit","role","onBlur","e","parentNode","childNodes","contains","selectLabel","onFocus","defaultProps","SelectorItem","CLASSNAME","isDisabled","isBoutiqueExclusive","selected","isInverted","value","name","label","onChange","onSelect","item","relatedTarget","parentElement","isNotAvailableSelectable","checked","htmlFor","isOutOfStock","isQuickBuy","isSizeInStickyTray","variationGroupId","getTimezoneOffset","loc","destinationOffset","Intl","DateTimeFormat","timeZone","timeZoneName","formatToParts","Date","filter","isNegativeDestination","includes","destinationTimeParts","split","destinationNumericOffset","Number","userOffset","isNegativeUser","userTimeParts","userNumericOffset","printToUserTimezone","ISOdate","format","forceISO","timezones","userTz","resolvedOptions","actualTimezone","tzDate","setMinutes","getMinutes","formatter","dateStyle","timeStyle","language","country","toUpperCase","editISODate","ISODate","edits","date","hours","setHours","getHours","minutes","seconds","setSeconds","getSeconds","milliseconds","setMilliseconds","getMilliseconds","toISOString","imageutils","transform","url","size","alt","quality","lower","fullurl","params","push","imgQuality","imagequality","avifsupported","webpsupported","i","join","hires","this","HIRES","large","LG","medium","MD","small","SM","extraSmall","XS","aspectratio","MO","ST","Math","round","XXS","tranitionDomReady","delay","getDefferedTransition","order","thumbnail","deferredTransition","getVariationValues","attributeId","variationAttributes","find","values","getColorVariations","getSizeVariations","getProductMasterId","masterId","colorActiveId","getColorVariationActive","getProductAvailability","productAvailability","availability","inStockDate","lowStock","preorder","getSizeAvailability","isPreorder","ATS","getSimilarProducts","Promise","resolve","reject","thisProduct","similarProductsSession","getItem","locale","similarProductsSessionJSON","JSON","parse","limitedAvailabilityConfig","showSimilarProducts","similarProductConfig","productIdList","then","data","availableProducts","p","stringify","useRecommender","cancelTokenSource","anchors","recommenderId","rec","products","currentInnerWidth","setCurrentInnerWidth","documentWidth","visualViewport","getInitialInnerWidth","handleResize","currentIw","getCurrentInnerWidth","AutoplayHelper","constructor","swiperRef","setIsAutoplayActive","isAutoplayActive","setIsLocked","on","swiper","wrapperEl","transitionDuration","swipeTiming","setAutoplay","realignPausedCarousel","originalTransform","previousIndex","realIndex","activeIndex","originalTransformValues","parseInt","originalDestTranslate","floor","normalizedTranslate","abs","normalizedSnapGrid","snapGrid","val","originalDestIndex","translate","pauseCarousel","running","stop","animating","getComputedStyle","setTimeout","getTranslate","leftmostSlide","slides","leftmostSlideBounds","getBoundingClientRect","x","left","playCarousel","start","handlePauseButton","afterContainer","beforeContainer","swiperConf","withArrows","darkMode","useTranslation","autoplayHelper","setAutoplayHelper","isLocked","container","useBreakpoint","update","handleArrowHide","playClass","pauseClass","pauseButton","arrowClassName","renderBeforeContainer","slidePrev","slideNext","onMouseMove","eTargetClassList","mousewheel","disable","enable","pageX","percentage","offsetWidth","handleArrowShow","Suspense","fallback","onSwiper","onScroll","onTouchStart","onTouchEnd","slideReset","onResize","renderAfterContainer","fullWidth","isClothing","title","description","hideCountrySelector","showEmailCta","handlerAnalyticsOnClickCta","hiddenColours","variationValues","swatchLenght","linkRefs","radioGroupId","handleLinkSelect","onChangeVariation","isVariationOutOfStock","isComingSoon","currentId","preventDefault","tileType","onKeyDown","nextIndex","prevIndex","handleKeyDown","showColorName","colorName","ColorSwatch","stroke","ProductColours","setSwatchLength","noPDPLink","tileColorSwatch","lg","compressColorSwatch","ProductLink","productName","notShoppable","noRedux","selectedLook","setSelectedLook","showLook","pid","productSlide","ProductImage","img","imgs","sizes","onAfterInit","swipr","spaceBetween","slidesPerView","grabCursor","freeMode","onSlideChange","currentLook","contactformurl","shopTheLook","inverted","isMobile","_d","_e","_f","_g","tileRef","tileInfo","sbl","containerRef","productObject","hoverDifferent","introCards","isCarouselVersion","withCarousel","swatchChange","isMouseOver","setIsMouseOver","isOver","setIsOver","setProduct","status","navigation","setStatus","setNavigation","updateNavigation","handleEnter","handleExit","handleTileNavigation","setOriginalUuid","firstColorId","setFirstColorId","currentSize","setCurrentSize","currentColor","setCurrentColor","showColorSwatch","setShowColorSwatch","forceOpenSizeSelector","setForceOpenSizeSelector","isDesktop","setIsDesktop","showAddToBagMessage","setShowAddToBagMessage","shopByLookHeight","setShopByLookHeight","lookProductInfoHeight","setLookProductInfoHeight","variantPrice","setVariantPrice","openShopByLook","setOpenShopByLook","shopByLookNotify","setShopByLookNotify","loginOpen","setLoginOpen","VariationColors","v","selectedColor","colorSwatchLenght","colorVariations","componentUuid","document","querySelector","isobject","insertAdjacentHTML","einsteinutils","category","sortingrule","timeoutId","isLookCarousel","clearTimeout","undefined","sizeVariations","sizeUpdated","colourVariations","groupPid","showWishlistBtn","isMbm","hideWishlistBtn","isNotNativeInput","element","tagName","triggerClick","click","justAddedMessage","colorSelection","ProductSelectionColorLink","colorVariation","endsWith","baseId","api","changeColor","productInfo","hasAnimation","startAnimation","lookinfo","position","hidelabels","showonlyname","hideprice","isGiftCard","ProductPrice","basePrice","gcLimits","minValue","formattedValue","price","noSwatch","ProductLabels","showSizeSelection","ProductSelectionSizes","sizeVariation","changeSize","Heading","headingLevel","disableFocus","unlock","isWhiteBg","forceWhiteBg","imageBackground","enableColorBackgroundStillLife","forceStillLifeImage","paddingBottom","DwMarker","lookProducts","n","documentElement","scrollBehavior","scrollTop","bottom","handleShopByLook","customImage","src","ProductTileCarousel","genderImageSorted","isSimplified","hideCarouselPagination","tiletype","noRollover","animatedImage","collections","keys","k","collectionName","lookCarouselLabel","ModalDialog","hideHeader","noPadding","closeInvertedSm","isOpen","onRequestClose","ProductNotifyMeModal","color","inWishlist","visibility","ProductWishlistToggle","productSize","productColor","section","LoginModal","reloadPage","incontext","modalStatus","updateStatus","focusOnError","formdef","onSubmit","initialValues","validate","buttonText","showSizeSelector","setError","isParfum","parfumAttributes","productFamily","termsAndConditions","isApp","appmode","cookieUrl","getElementById","sizeSelection","useCallback","unshoppable","decorators","render","handleSubmit","form","submitting","pristine","def","autocomplete","idSuffix","cls","dangerouslySetInnerHTML","__html","refinementColor","backgroundColor","swatchColor","backgroundImage","swatchImg","onMoveToBag","errors","setErrors","amountErrors","setAmountErrors","setFormdef","setInitialValues","selectedAmount","setSelectedAmount","customVisible","setCustomVisible","messageVisible","setMessageVisible","messageLength","setMessageLength","dateVisible","setDateVisible","maxDelayedDate","setMaxDelayedDate","selectedDate","setSelectedDate","i18n","amountRef","intlNumberFormater","NumberFormat","regexRemoveMask","deliveryTimeRangeOptions","Array","_","baseTime","toLocaleTimeString","hour","minute","startTime","toLocaleLowerCase","endTime","now","selectedDateFormatted","timeOffset","toDateString","unshift","singleItemValue","sales","amount","gcConfigurations","am","number","giftCardAttributes","message","isDelayed","sendDate","deliveryDate","selectedOption","htmlValue","option","changeDelayDate","currentDate","getTime","currentTime","delayedDate","delayedTime","includeMessage","receiverEmail","recipientEmail","receiverEmailVerification","receiverName","recipientName","yourMessage","async","delayedErrors","parseFloat","maxValue","isInteger","setDate","getDate","gcMaxDelayDate","closeModal","overlayClassName","urls","isAddToBag","action","actualDate","actualDateConversion","giftCard","gcAmount","gcEmail","gcName","gcMessage","gcDate","gcUUID","UUID","gcPID","card","batch","change","formatted","altLabel","requiredLabel","maxLength","textPrefix","gcCurrency","isValidNumber","isNaN","slice","icon","preventPaste","groupClassName","hiddenLabel","fieldType","minDate","getFullYear","getMonth","maxDate","scrollIntoView","block","giftCardPurchase","setGiftCardPurchase","quickShopTimeout","addToBag","onAddStart","console","log","triggerOpenSize","updateErrorMessage","updateErrorTitle","quantityTotal","header","firstRefine","removeProperty","fromMinicart","wrapper","isSearchTile","fromAddToBag","pushAnalytics","callback","btnModifiers","noModifiers","btnClass","secondary","loggedin","loginUrl","inPDP","inShopTheLook","ariaHaspopup","va","preorderable","showOverlay","setShowOverlay","customClasses","onOpenModal","inQuickShop","triggerCloseOnly","onCloseModal","fromReserve","zoomTimerId","zoomRef","imgRef","isDragging","setIsDragging","zoomPos","setZoomPos","y","scale","onUpdate","setProperty","activateIndex","querySelectorAll","forEach","scaling","some","media","ProductVideo","inZoomModal","scaleTo","innerHeight","maxZoom","minZoom","onDragStart","onDragEnd","dragging","loading","swiperInstance","setSwiperInstance","thumbsSwiper","setThumbsSwiper","setActiveIndex","setProductUrl","isBeginning","setIsBeginning","isEnd","setIsEnd","sizeThumbsMap","sizeMainMap","md","paginationMessage","variationColor","selectedValue","prodUrl","updateProgressThumb","contentLabel","onAfterClose","scrollHeight","showPDPLink","keyboard","nextEl","prevEl","forceToAxis","thresholdDelta","allowTouchMove","effect","initialSlide","speed","thumbs","loopPreventsSlide","isZoom","onTransitionStart","onTransitionEnd","watchOverflow","watchSlidesProgress","modules","end","sticky","slideToClickedSlide","centerInsufficientSlides","threshold","slideTo","isThumb","registerAnimatedImage","unregisterAnimatedImage","defaultSizes","image","_h","_j","imageoldsuffix","imagenewsuffix","u","lowResImg","hiResImage","multipleSrc","srcs","sz","multipleSrcAvif","lazyPosterImg","lazyLowRes","altText","seoIndex","imageElement","lazyload","lazyDisabled","srcSet","onlyImage","onImageClick","hideIcon","lightIcon","showBoutiqueExclusive","showOnlineExclusive","isOnlineExclusive","showComingSoon","forceSoldOut","showPreorder","selectedVariantPreorderable","renderLabel","availabilityLabel","isLimited","showLimitedAvailabilityLabel","comingSoonLabel","boutiqueExclusiveLabel","manualLabel","overlayLabel","onlineExclusiveLabel","availabilityLabelAggregator","businessLabelAggregator","simplifiedPLPLabel","isLimitedEdition","grenoble","genius","scarcityProduct","earlyaccess","private","inLook","isMonclerCurators","comunicationTag","trim","productTag","currentInnerHeight","setCurrentInnerHeight","documentHeight","getInitialInnerHeight","getCurrentInnerHeight","currentHeight","requestSent","setRequestSent","fullproductid","setFullproductid","classHeight","setClassHeight","isFullyOutOfStock","sizeAttributes","attr","every","firstRender","prefillValues","productid","formutils","err","thankYou","SimilarProductCarousel","labelVisible","breakpoints","NotifyForm","ContactDetailsCore","hidePrefix","ErrorBox","min","defaultChecked","ProductSelectionColorExpanded","variationValue","hideOnlineExclusive","alwaysAvailable","boutiqueAvailability","ProductSelectionFormats","currentFormat","selectedProduct","productFormats","parfumFormat","available","inBag","groupId","onChangeFormat","inReserve","SelectorPopup","selectorBtnInfo","mobilePopup","isInline","vv","trackOpenSize","SelectorRadio","optionRef","c","onClickHandler","HTMLtarget","selectorItem","focusedOption","toggleModal","focusOption","extraLabel","showNotifyMe","ProductActionNotifyMe","onNotifyOpen","showSimilarProductsOOS","openSimilarModal","openModal","setOpenModal","currentProduct","countrySizes","setCountrySizes","monclerSizes","setMonclerSizes","useChartTable","sizeChart","setBottom","setScrollTop","scrollBarHeight","setScrollBarHeight","longestSizeChars","setLongestSizeChars","setIsMobile","setFocusedOption","notifyOpen","setNotifyOpen","scrollableBox","onSizeOpen","setModalOffset","hasLimitedAvailability","isManualConfig","hasProductTiles","similarProductsTiles","fittingCaption","fitting","sizeAndFit1","sizeLabel","monclerSizeIndex","rawValues","countrySize","convertedSize","isSuggestedSize","suggestedSize","isSizeDisabled","variationsLength","limitedAvailabilityDepth","hasLimitedAvailabilityDepth","hasSizeLimitedAvailability","selectorContainers","buttonContainers","buttonContainer","selectorContainer","marginTop","dir","itemList","pf","parfumLinkToSelectorItem","parfumLink","SizesBlock","scrollValue","scrollableElement","scrollableLength","clientHeight","scrollTrackHeight","scrollingDelta","bouncingBar","max","calculateScrollTop","closeModalOnClickOutside","body","buttonInHeader","subjsx","showSizeFit","createPortal","focusTrapOptions","allowOutsideClick","active","setSuggestedSize","setSizeChart","showOutofstockLabel","currentVariation","selectorHeader","selectSizeError","showSizeChart","hideSizeGuide","SizeGuide","master","onSizeguideSelection","onSizeSelection","onSizeSuggestion","suggestedsize","setSizeguideOpen","sizeguideOpen","hideBodyMeasurements","comboBox","SelectorSize","swiperModules","allowTransform","setAllowTransform","inView","triggerOnce","rootMargin","paginationWrapper","lazy","loadInSlide","lazyLoadSwiperSlides","slideNum","imagesLength","createImageAttrs","imageIndex","onSliderFirstMove","loadOnTransitionStart","a11y","slideRole","itemRoleDescriptionMessage","slideLabelMessage","prevSlideMessage","nextSlideMessage","pagination","clickable","resistance","resistanceRatio","centeredSlides","onBeforeSlideChangeStart","bullets","bullet","setAttribute","outherCarousel","exlude","activeBullet","setActiveBullet","isGenderImageSorted","carouselId","as","entry","isIntersecting","intersectionRatio","offsetLeft","PlpTilesCSS","ProductTileCarouselCSS","ProductTileCarouselSwiper","pdpVideoRef","onPause","currentButton","ariaPressed","play","pause","videoElement","currentElement","pauseElement","findElementWithPauseAttribute","playsInline","autoPlay","tronID","lockBitrateProductVideos","inGallery","errorMessage","setErrorMessage","wishlistIds","updateFunction","updatedStatus","updateWishlistStatus","items","inPublicWishlist","modifierClass","success","errorMsg","catch","res","whileTap","d","fill","onClose","carouselWrapper","setSimilarProductsTiles","shouldEnabledCarousel","visibleSlidesIndexes","setVisibleSlidesIndexes","carouselEnabled","setCarouselEnabled","carouselArrows","floatingModule","setShowFloatingModal","setExpanded","wrapperTag","disabledClass","sp","tag","disableQuickShop","gsap","ScrollTrigger","ScrollToPlugin","imageSizes","breakpoint","observer","IntersectionObserver","entries","wrapperButtonVideo","boundingClientRect","observe","disconnect","mediaUrl","ProductImageButton","clicked","total","heroGalleryImage","setSwiper","pressed","setPressed","containerBullets","isTablet","wrapperBullets","openVto","touchRatio","longSwipesRatio","edgeSwipeDetection","followFinger","onActiveIndexChange","nextSlide","pauseVideo","isPressed","getAttribute","look","lookImage","lookImageHeight","setLookImageHeight","setSize","useLayoutEffect","updateSize","useWindowSize","hideLookImage","ProductTile","autoplayConfig","disableOnInteraction","recommenderName","setRecommenderName","setTitle","setProducts","loaded","setLoaded","hasMinSlides","recommenderCallback","slot","sort","txt","createElement","innerHTML","displayMessage","pdpClass","productList","cancel","loopedSlidesActive","AutoplayCarousel","devmode","icons","faqLink","onPDP","ProductBoutiqueModal","mode","ContentAsset","nftContentAsset","setSimilarModalOpen","visible","setVisible","showFloatingModal","floatingModuleMargin","setFloatingModuleMargin","numberProductImgVisible","floatingImagesLoaded","handleFloatingVisibility","toggle","stickyBarOpen","onFloatingClose","drawerHead","subtitle","Drawers","similarModalOpen","hasBackdrop","isSticky","onlyButton","Button","longDescription","shortDescription","suggest","setSuggets","refillId","buttonStyleInverted","fromKeyboard","showReserveInBoutiqueButton","trackAddToBag","afterAdd","errorLabel","setErrorLabel","addToBagAvailable","mbm","toConfigurator","cookie","ErrorModal","suggestedProducts","msg","stickyPDP","isComingSoonAutomatic","ExpressPaymentsModal","show","sizeSelectorError","updateSizeSelectorError","openTray","setOpenTray","stickyBar","timerShow","info","triggerSizeSelectionOpen","expressCheckoutAvailable","expressCheckoutPDP","noexpresscheckout","checkouturl","parentSelector","ProductSelectionSizesExpanded","timeOut","ResizeObserver","SelectorColorLink","forwardRef","displayName","ProductSelectionColorExpandedLinks","linksRef","colorChanged","ProductSelection","variantSizeObj","useInnerWidth","productSectionRef","productButtonRef","showSticky","setShowSticky","mbmNotify","setMbmNotify","contactusModalOpen","setContactusModalOpen","promotionInfo","setPromotionInfo","campaignActive","setCampaingActive","hasFreeExpressShipping","setHasFreeExpressShipping","similarFloatingVisible","setSimilarFloatingVisible","visibilityFloatingModule","setVisibilityFloatingModule","enableSimilarButton","setEnableSimilarButton","floatingShowTimer","isGrenoble","isPreOrderOrExclusive","colors","setSizeSelectorError","noboutiqueavailability","showReserveInBoutiqueLink","colorSelected","checkSimilarRecommender","floatingVisibility","isScrolled","wrapperContainer","heightTarget","top","gbotNormalizer","activeCampaigns","promoFreeExpressShippingNewMembers","customerGroups","floatingCookieOnClose","setSimilarTiles","setPlayButtonVideo","priceData","s","sendAnalytics","sizeError","usingRecommender","getSimilarProductsTiles","fetchSimilarProductsTiles","isPreorderOrBoutiqueExclusive","hasSimilarProducts","showSimilarProductsFloating","showSimilarProductsInline","productSelectionBody","_k","_l","_m","_o","_p","_q","_r","breadcrumbs","categoryId","lineIconsContainer","additionalShortDescription","openBalance","setDetailsOpen","gcConfigValidity","formatVariation","path","maxAge","giftCardTermsURL","returnFaq","MbmNotifyMeModal","editLink","guest","linkText","customClass","shippingAndReturns","setShippingOpen","BookAnAppointmentMbm","modalimage","mbmBaa","button","hasNft","selectionWrapperRef","productSelectionContent","headerHeight","heightContainer","imageLoaded","landing","ContactDetailsEnhanced","drawer","distance","StoreInfoBox","onReservePress","GeoOptions","enableHighAccuracy","timeout","maximumAge","successLocalization","pos","crd","coords","latitude","longitude","accuracy","setGeo","lat","lng","errorLocalization","warn","code","storescount","geolocation","getCurrentPosition","stores","setStores","setLoading","geo","noResults","fs","idx","ID","onStoreSelect","countries","setCountries","countrygroups","Map","countryCode","cg","set","a","b","localeCompare","Accordion","AccordionItem","accordionId","loggedIn","setLoggedIn","currentStore","setCurrentStore","days","setDays","localizedProductPrice","setLocalizedProductPrice","setCollections","clickAndReserveEnabled","setClickAndReserveEnabled","loginEmail","setLoginEmail","firstName","setFirstName","lastName","setLastName","setPhone","phonePrefix","setPhonePrefix","currentWidth","reserveDetailRef","emailInput","behavior","limitOrdersEnabled","getForm","firstname","lastname","applicationorigin","productSelected","resetOnClose","privacyFlag","storeid","serverErrors","localizedPrice","dimension14","storeChooser","site","background","review","surname","border","StoreAddress","showphone","showmail","addressutils","interactiveStoreModule","DigitalFlagshipSmallPromoCard","bookanappointment","reserveForm","ProductBoutiqueSelected","onArrowBack","withBorder","mutators","global","resetHours","args","utils","changeValue","DwFormFieldPhoneWithPrefix","uniqueLabel","DwFormField","toogleChecked","BookAnAppointmentDateSelection","reason","concat","BookAnAppointmentReasonMessage","scrollbarWidth","clientWidth","modal","unobserve","onAfterOpen","selectedItem","selectedSize","LoginOrRegisterColumn","privacypolicy","updateLoggeedStatus","updateLoggedin","forgotpasswordform","reloadComponent","reloadRegisterComponent","pageContext"],"sourceRoot":""}