1(function(){function initScrollVideoPlay(){const sections=document.querySelectorAll(".banner-video-section");if(!sections.length)return;const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{const video=entry.target.querySelector("video");video&&(entry.isIntersecting&&entry.intersectionRatio>=.5?(video.muted=!0,video.play().catch(()=>{})):video.pause())})},{root:null,threshold:.5});sections.forEach(section=>observer.observe(section))}document.addEventListener("DOMContentLoaded",initScrollVideoPlay),document.addEventListener("shopify:section:load",initScrollVideoPlay),document.addEventListener("collections-loaded",initScrollVideoPlay)})();function isFilterActive(){const params=new URLSearchParams(window.location.search);for(const key of params.keys())if(key.startsWith("filter.")||key==="sort_by")return!0;return!1}function toggleFilterClassByURL(){const grid=document.querySelector("#product-grid");grid&&(isFilterActive()?grid.classList.add("active_filter"):grid.classList.remove("active_filter"))}document.addEventListener("DOMContentLoaded",toggleFilterClassByURL),document.addEventListener("facet:updated",toggleFilterClassByURL),$(document).ready(function(){if(document.querySelector(".splide_
11")&&new Splide(".splide_1",{start:1,autoWidth:!0,perMove:3,gap:8,type:"loop",drag:"free",snap:!1,interval:3e3,arrows:!0,pagination:!0,rewind:!0,rewindByDrag:!0,lazyLoad:!0,breakpoints:{768:{autoWidth:!0,snap:!0}}}).mount(),document.querySelector(".video-splide")){let handleVideos2=function(splide){isMobileOrTablet()&&splide.root.querySelectorAll(".splide__slide").forEach(slide=>{const video=slide.querySelector("video");if(!video)return;slide.classList.contains("is-active")&&slide.classList.contains("is-visible")?(video.muted=!0,video.playsInline=!0,video.paused&&video.play().catch(()=>{})):(video.pause(),video.currentTime=0)})};var handleVideos=handleVideos2;const video_splide=new Splide(".video-splide",{start:1,autoWidth:!0,perMove:1,gap:8,type:"loop",drag:"free",snap:!1,interval:3e3,arrows:!0,pagination:!0,rewind:!0,rewindByDrag:!0,lazyLoad:!0,breakpoints:{768:{autoWidth:!0,snap:!0}}});video_splide.mount();const isMobileOrTablet=()=>window.matchMedia("(max-width: 1024px)").matches;video_splide.on("dragging",function(){video_splide.root.querySelectorAll("video").forEach(video=>{video.pause()})}),video_splide.on("dragged moved",function(){isMobileOrTablet()&&setTimeout(function(){video_splide.root.querySelectorAll(".splide__slide").forEach(sli
1de=>{const video=slide.querySelector("video");if(!video)return;slide.classList.contains("is-active")&&slide.classList.contains("is-visible")?(video.muted=!0,video.playsInline=!0,video.play().catch(()=>{})):(video.pause(),video.currentTime=0)})},1e3)}),video_splide.on("mounted",()=>{handleVideos2(video_splide)}),video_splide.on("moved",()=>{handleVideos2(video_splide)}),window.addEventListener("resize",()=>{isMobileOrTablet()?handleVideos2(video_splide):video_splide.root.querySelectorAll("video").forEach(video=>{video.pause(),video.currentTime=0})}),window.addEventListener("load",()=>{isMobileOrTablet()?handleVideos2(video_splide):video_splide.root.querySelectorAll("video").forEach(video=>{video.pause(),video.currentTime=0})})}$(document).on("click",".main_chat_button .chat-message-icon",function(e){e.preventDefault(),$(this).parents(".main_chat_button").addClass("active_message_icon")}),$(document).on("click",".main_chat_button .chat-close-icon",function(e){e.preventDefault(),$(this).parents(".main_chat_button").removeClass("active_message_icon")});var swiper=new Swiper(".thumbnail_list",{slidesPerView:1,spaceBetween:48,scrollbar:{draggable:!0,el:".swiper-scrollbar"},breakpoints:{500:{slidesPerView:2},700:{slidesPerView:3},1200:{slidesPerView:4},1600:{slidesPerView:5}}}),swiper=new Swiper(".scroll-block",{slidesPerView:5,spaceBetween:0,freeMode:!1,loop:!0,loopedSlides:4,loopAdditionalSlides:3,centeredSlides:!1,slideToClickedSlide:!1,watchSlidesProgress:!0,watchSlidesVisibility:!0,scrollbar:{el:".block_scrollbar.swiper-scrollbar",draggable:!0,dragSize:"auto"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{0:{slidesPerView:"auto",loopedSlides:2},768:{slidesPerView:"auto",loopedSlides:3},1024:{slidesPerView:"auto",loopedSlides:4}},on:{init:function(){this.update()},slideChange:function(){}}}),swiper=new Swiper(".scroll-block-video",{slidesPerView:"auto",spaceBetween:0,freeMode:!1,loop:!0,loopedSlides:4,loopAdditionalSlides:3,centeredSlides:!1,slideToClickedSlide:!1,watchSlidesProgress:!0,watchSlidesVisibility:!0,scrollbar:{el:".block_scrollbar.swiper-scrollbar",draggable:!0,dragSize:"auto"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{0:{slidesPerView:"auto",loopedSlides:2},768:{slidesPerView:"auto",loopedSlides:3},1024:{slidesPerView:"auto",loopedSlides:4}},on:{init:function(){this.update()},slideChange:function(){}}}),swiper=new Swiper(".quick-add-modal__toggle .product__media-list",{slidesPerView:1,spaceBetween:24,scrollbar:{draggable:!0},breakpoints:{650:{slidesPerView:2},1040:{spaceBetween:48,slidesPerView:3}}}),swiper=new Swiper(".travel-spray-product-carousel",{slidesPerView:1,spaceBetween:24,scrollbar:{draggable:!0,el:".travel-spray_scrollbar.swiper-scrollbar"},breakpoints:{650:{slidesPerView:2},1040:{spaceBetween:48,slidesPerView:3}}}),swiper=new Swiper(".travel-spray-product-carousel-popup",{slidesPerView:1,spaceBetween:24,scrollbar:{draggable:!0,el:".travel-spray-product-carousel-popup .travel-spray_scrollbar.swiper-scrollbar"},breakpoints:{650:{slidesPerView:2},1040:{spaceBetween:24,slidesPerView:3}}});window.addEventListener("resize",function(event){$(".mobile_media_gallery .main_media_gallery").slick("refresh"),$(".mobile_media_gallery .thumbnail_media_gallery").slick("refresh")}),$(".mobile_media_gallery .main_media_gallery").slick({slidesToShow:1,slidesToScroll:1,dots:!1,arrows:!1,fade:!0,asNavFor:".mobile_media_gallery .thumbnail_media_gallery"}),$(".mobile_media_gallery .thumbnail_media_gallery").slick({slidesToShow:3,slidesToScroll:1,asNavFor:".mobile_media_gallery .main_media_gallery",dots:!1,arrows:!1,centerMode:!0,focusOnSelect:!0,responsive:[{breakpoint:480,settings:{slidesToScroll:1,slidesToShow:2}}]}),$(".banner-carousel .banner-slider .banner-slide").length>1&&$(".banner-carousel .banner-slider").slick({dots:!0,infinite:!0,speed:400,slidesToShow:1,arrows:!1,slidesToScroll:1,adaptiveHeight:!0}),$(".banner-slider .image_video").slick({infinite:!1,slidesToShow:1,slidesToScroll:1,arrows:!1,dots:!1,autoplay:!0,autoplaySpeed:8e3,asNavFor:".banner-slider .banner_details"}),$(".banner-slider .banner_details").slick({infinite:!1,slidesToShow:1,slidesToScroll:1,arrows:!1,dots:!0,fade:!0,autoplay:!0,autoplaySpeed:8e3,cssEase:"linear",asNavFor:".banner-slider .image_video",focusOnSelect:!0}),$(".feature-product-slider").slick({infinite:!0,slidesToShow:4,slidesToScroll:1,arrows:!1,dots:!1,variableWidth:!0,responsive:[{breakpoint:1199,settings:{centerMode:!0,centerPadding:"60px",slidesToScroll:1,slidesToShow:4}},{breakpoint:1200,settings:{centerMode:!0,centerPadding:"60px",slidesToScroll:1,slidesToShow:3}},{breakpoint:768,settings:{centerMode:!0,centerPadding:"60px",slidesToScroll:1,slidesToShow:2}},{breakpoint:480,settings:{centerMode:!0,centerPadding:"60px",slidesToScroll:1,slidesToShow:1}}]}),$(".center-product-slider").slick({infinite:!0,centerMode:!0,centerPadding:"60px",slidesToShow:4,arrows:!1,dots:!1,responsive:[{breakpoint:1200,settings:{slidesToShow:3}},{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:480,settings:{slidesToShow:1}}]}),setTimeout(function(){$(".fragrance-grid-list-scroll").slick({infinite:!0,speed:300,slidesToShow:1,centerMode:!0,variableWidth:!0,arrows:!1}
1)},2e3),$(".product-slider").slick({infinite:!1,slidesToShow:4,slidesToScroll:1,arrows:!0,dots:!1,responsive:[{breakpoint:1200,settings:{slidesToScroll:1,slidesToShow:3}},{breakpoint:768,settings:{slidesToScroll:1,slidesToShow:2}}]}),$(".video-slider-sec .video-row").slick({infinite:!1,slidesToShow:2,slidesToScroll:1,arrows:!0,dots:!1,responsive:[{breakpoint:768,settings:{slidesToScroll:1,slidesToShow:1}}]}),$(".reviews-slider").slick({infinite:!0,slidesToShow:1,slidesToScroll:1,arrows:!0,dots:!1}),$(".image-slider").slick({infinite:!0,slidesToShow:1,slidesToScroll:1,arrows:!0,dots:!1})}),$(".search__input").keyup(function(){$(this).val().length===0?($(".search__button").hide(),$(".search_text_val").show()):($(".search__button").show(),$(".search_text_val").hide())}),$(".main_mega_menu button.mega_menu_sub").hover(function(){var mega_menu_handle=$(this).data("handle");console.log(mega_menu_handle),$(".sub_mega_menu").removeClass("active"),$(".single_menu li").removeClass("active"),$("#"+mega_menu_handle).addClass("active"),$(this).parent().addClass("active")}),$(".tab-container .tab_content").hide(),$(".tab-container .tab_content:first").show(),$(".tab-container").each(function(k,v){$(v).find(".tab_content:first").show()}),$(".tab_drawer_heading").click(function(){var parent=$(this).parents(".tab-container");$(parent).find(".tab_content").hide();var d_activeTab=$(this).attr("rel");$(parent).find("#"+d_activeTab).fadeIn(),$(parent).find(".tab_drawer_heading").removeClass("d_active"),$(this).addClass("d_active"),$(parent).find("ul.tabs li").removeClass("active"),$(parent).find("ul.tabs li[rel^='"+d_activeTab+"']").addClass("active")}),$("ul.tabs li").last().addClass("tab_last"),$(document).ready(function(){$(".sm_open").on("click",function(){var modal=$(this).attr("data-modal"),modaloverlaycolor=$(this).attr("data-overlay"),modaleffect=$(this).attr("data-effect"),modalheader=$(this).attr("data-header"),modalheadertype=$(this).attr("data-header-type"),modalcontent=$(this).attr("data-content"),modaliconside=$(this).attr("data-icons"),modalwrappercolor=$(this).attr("data-wrapper-color");$("#"+modal).addClass(modaloverlaycolor),$("#"+modal+" .sm_content").addClass(modaleffect),$("#"+modal+" .sm_content .sm_header").html(modalheader),$("#"+modal+" .sm_content .sm_header").addClass(modalheadertype),$("#"+modal+" .sm_content .sm_area_all").html(modalcontent),$("#"+modal+" .sm_icon_menu").addClass(modaliconside),$("#"+modal+" .sm_content").addClass(modalwrappercolor),$("#"+modal).fadeIn().css("display","flex"),setTimeout(function(){$("#"+modal+" .sm_content").addClass("show")},400)}),$(".sm_close").on("click",function(){var $modal=$(this).parents(".slim_modal");closeModal($modal)}),$(".slim_modal").on("click",function(e){if(e.target===this){var $modal=$(this);closeModal($modal)}});function closeModal($modal){$modal.find(".sm_content").removeClass("show"),setTimeout(function(){$modal.removeClass("red green tan none"),$modal.find(".sm_content").removeClass("red green tan"),$modal.find(".sm_icon_menu").removeClass("is_right is_left"),$modal.find(".sm_header").removeClass("detached"),$modal.fadeOut()},400)}$(document).on("click",".announcement-bar .close_button",function(){createCookie("announcement-bar-popup","closed",1),$(".announcement-bar-section").hide()}),readCookie("announcement-bar-popup")=="closed"&&$(".announcement-bar-section").hide()});function createCookie(name,value,days){var expires;if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toGMTString()}else expires="";document.cookie=encodeURIComponent(name)+"="+encodeURIComponent(value)+expires+"; path=/"}function readCookie(name){for(var nameEQ=encodeURIComponent(name)+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)===0)return decodeURIComponent(c.substring(nameEQ.length,c.length))}return null}$(document).ready(function(){$(".tab").click(function(){$(".tab-contains").removeClass("tab-active"),$(".tab-contains[data-id='"+$(this).attr("data-id")+"']").addClass("tab-active"),$(".tab").removeClass("active"),$(this).addClass("active")})}),$(window).scroll(function(){var scroll=$(window).scrollTop(),windowHeight=$("#shopify-section-text-image-animation").height();if(windowHeight!=null){var InnerHight=$("#shopify-section-text-image-animation").offset().top+150,overviewScrollTop=InnerHight-$(window).scrollTop();windowHeight>overviewScrollTop?$(".text-image-animation .flex-box.aos-init").addClass("animation-start"):$(".text-image-animation .flex-box.aos-init").removeClass("animation-start")}}),document.addEventListener("DOMContentLoaded",function(){function getUTMParameters(){const params=new URLSearchParams(window.location.search),utmParam
1s2={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content"].forEach(key=>{params.has(key)&&(utmParams2[key]=params.get(key))}),utmParams2}function appendUTMToLink(link,utmParams2){if(!link||Object.keys(utmParams2).length===0)return;const url=new URL(link.href,window.location.origin);for(const[key,value]of Object.entries(utmParams2))url.searchParams.set(key,value);link.href=url.toString()}function persistUTMInURL(utmParams2){if(Object.keys(utmParams2).length>0){const currentUrl=new URL(window.location.href);for(const[key,value]of Object.entries(utmParams2))currentUrl.searchParams.set(key,value);window.history.replaceState({},document.title,currentUrl.toString())}}function updateLinks(utmParams2){document.querySelectorAll('a[href^="/"], a[href^="'+window.location.origin+'"]').forEach(link=>appendUTMToLink(link,utmParams2))}function updateCartDrawerLink(utmParams2){const cartDrawerLink=document.querySelector('a[href="/cart"]');appendUTMToLink(cartDrawerLink,utmParams2)}function updateBackToShoppingButton(utmParams2){const backToShoppingButton=document.querySelector('a.button_custom[href="/collections/all-fragrances"]');appendUTMToLink(backToShoppingButton,utmParams2)}function observeCartUpdates(utmParams2){const cartDrawer=document.querySelector("#CartDrawer");if(!cartDrawer)return;new MutationObserver(()=>{updateCartDrawerLink(utmParams2),updateBackToShoppingButton(utmParams2)}).observe(cartDrawer,{childList:!0,subtree:!0})}const utmParams=getUTMParameters();persistUTMInURL(utmParams),updateLinks(utmParams),updateCartDrawerLink(utmParams),updateBackToShoppingButton(utmParams),observeCartUpdates(utmParams)}),document.addEventListener("DOMContentLoaded",()=>{const TARGET_SELECTORS=["div.loaded.default.homepage-promotion-wide","div.loaded.default.homepage-promotion-box"];function applyStylesInRoot(root){let appliedCount=0;return TARGET_SELECTORS.forEach(sel=>{root.querySelectorAll(sel).forEach(el=>{el.style.setProperty("display","block","important"),el.style.setProperty("margin","auto","important"),appliedCount+=1,console.log(`Styles applied to ${sel}`)})}),appliedCount}function observeShadowRoot(shadowRoot){if(applyStylesInRoot(shadowRoot)>0)return;const shadowObserver=new MutationObserver(()=>{applyStylesInRoot(shadowRoot)>0&&shadowObserver.disconnect()});shadowObserver.observe(shadowRoot,{childList:!0,subtree:!0})}function handlePlacement(el){if(el)if(el.shadowRoot)observeShadowRoot(el.shadowRoot);else{const ro=new MutationObserver(()=>{el.shadowRoot&&(ro.disconnect(),observeShadowRoot(el.shadowRoot))});ro.observe(el,{childList:!0,subtree:!0})}}document.querySelectorAll("klarna-placement").forEach(handlePlacement),new MutationObserver(muts=>{muts.forEach(m=>{m.addedNodes.forEach(node=>{node.nodeType===1&&(node.matches&&node.matches("klarna-placement")&&handlePlacement(node),node.querySelectorAll?.("klarna-placement").forEach(handlePlacement))})})}).observe(document.body,{childList:!0,subtree:!0})}),document.addEventListener("DOMContentLoaded",function(){const playBtn=document.querySelector(".video-play-button"),videoContainer=document.querySelector("#videoPopupplay"),videoPlayBox=document.querySelector(".video_play_box"),mainVideo=videoContainer?videoContainer.querySelector("video"):null;if(!playBtn||!videoContainer){console.warn("Play button or video container not found");return}playBtn.addEventListener("click",function(){videoContainer.classList.remove("hidden"),videoPlayBox.classList.add("hidden"),mainVideo&&mainVideo.play()}),mainVideo&&mainVideo.addEventListener("pause",function(){console.log("Video paused"),videoContainer.classList.add("hidden"),videoPlayBox.classList.remove("hidden")})}),document.addEventListener("DOMContentLoaded",function(){const mplayBtn=document.querySelector(".mvideo-play-button"),mvideoContainer=document.querySelector("#mvideoPopupplay"),mvideoPlayBox=document.querySelector(".mvideo_play_box"),mobmainVideo=mvideoContainer?mvideoContainer.querySelector("video"):null;if(!mplayBtn||!mvideoContainer){console.warn("Play button or video container not found");return}mplayBtn.addEventListener("click",function(){mvideoContainer.classList.remove("hidden"),mvideoPlayBox.classList.add("hidden"),mobmainVideo&&mobmainVideo.play()}),mobmainVideo&&mobmainVideo.addEventListener("pause",function(){console.log("Video paused"),mvideoContainer.classList.add("hidden"),mvideoPlayBox.classList.remove("hidden")})}),document.addEventListener("DOMContentLoaded",()=>
1{document.querySelectorAll("details.mega-menu").forEach(details=>{let hoverTimeout;details.addEventListener("mouseenter",()=>{clearTimeout(hoverTimeout),details.setAttribute("open","")}),details.addEventListener("mouseleave",()=>{hoverTimeout=setTimeout(()=>{details.removeAttribute("open")},150)})})});let newQuickViewaBtns=document.querySelectorAll(".js-pro-cart-button");newQuickViewaBtns.forEach(newQuickViewaBtn=>{newQuickViewaBtn.addEventListener("click",e=>{e.target.closest(".card--standard").querySelector(".quick-add").querySelector(".quick-add__submit").click()})});let productTitleBtns=document.querySelectorAll(".js-open-qiock-view");productTitleBtns.forEach(btn=>{btn.addEventListener("click",function(e){e.preventDefault();let productCard=this.closest(".product-card-wrapper");if(productCard){let cartButton=productCard.querySelector(".js-pro-cart-button");cartButton&&cartButton.click()}})}),document.addEventListener("DOMContentLoaded",()=>{const truncate=document.querySelectorAll(".description-truncate"),full=document.querySelectorAll(".description-full"),buttons=document.querySelectorAll(".read-more-btn");!truncate.length>0||!full.length>0||!buttons.length>0||buttons.forEach(button=>{button.addEventListener("click",e=>{const expanded=button.getAttribute("aria-expanded")==="true";e.target.closest(".product-main-description").querySelector(".description-truncate").classList.toggle("hidden",!expanded),e.target.closest(".product-main-description").querySelector(".description-full").classList.toggle("hidden",expanded),button.textContent=expanded?"Read more":"Read less",button.setAttribute("aria-expanded",String(!expanded))})})}),document.addEventListener("DOMContentLoaded",function(){const warning=document.querySelectorAll(".cart-warning");document.querySelectorAll(".close-btn").forEach(closeBtn=>{closeBtn.addEventListener("click",function(e){e.target.closest(".cart-warning").style.display="none"})})}),document.addEventListener("DOMContentLoaded",function(){const heroSection=document.querySelector(".collection-hero-text");if(!heroSection)return;const body=document.body;new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?body.classList.remove("sticky-filter"):body.classList.add("sticky-filter")})},{root:null,threshold:0}).observe(heroSection)}),document.addEventListener("mouseover",e=>{const wrapper=e.target.closest(".js-video-sec");if(console.log(wrapper),!wrapper)return;const video=wrapper.querySelector("video");console.log(video),video&&video.paused&&video.play()}),document.addEventListener("mouseout",e=>{const wrapper=e.target.closest(".js-video-sec");if(!wrapper)return;const video=wrapper.querySelector("video");video&&!video.paused&&video.pause().catch(()=>{})}),document.addEventListener("DOMContentLoaded",function(){const openerSelector=".product__modal-opener";function initModalGallery(){const $main=$(".main_banner_media"),$thumbs=$(".thumbnail_media_gallery");!$main.length||!$thumbs.length||($thumbs.hasClass("slick-initialized")||$thumbs.slick({slidesToShow:3,slidesToScroll:1,asNavFor:".main_banner_media",vertical:!0,verticalSwiping:!0,dots:!1,arrows:!1,centerMode:!1,focusOnSelect:!0,responsive:[{breakpoint:1024,settings:{slidesToShow:3,vertical:!1,verticalSwiping:!1}}]}),$main.hasClass("slick-initialized")||$main.slick({slidesToShow:1,slidesToScroll:1,arrows:!1,draggable:!1,swipe:!1,touchMove:!1,fade:!1,asNavFor:".thumbnail_media_gallery"}),setTimeout(()=>{$thumbs.slick("setPosition"),$main.slick("setPosition")},50))}document.addEventListener("click",function(e){e.target.closest(openerSelector)&&(console.log("openerSelector ",openerSelector),initModalGallery())})}),document.addEventListener("click",function(e){const zoomIn=e.target.closest(".zoom_dialog_button.zoom_in"),zoomOut=e.target.closest(".zoom_dialog_button.zoom_out");if(!zoomIn&&!zoomOut)return;const target=document.querySelector(".main_banner_media .slick-slide.slick-current.slick-active");if(!target){console.warn("Zoom target image not found");return}let zoom=parseFloat(target.dataset.zoom||1);zoomIn&&(zoom=Math.min(2,zoom+.1)),zoomOut&&(zoom=Math.max(1,zoom-.1)),zoomInOut(target,zoom);const zoomedPercentage=Math.round(zoom*100)-100,showZoomedNum=document.querySelector(".zoomed_value");showZoomedNum.innerHTML=zoomedPercentage,document.querySelectorAll(".thumbnail_media_gallery .slick-arrow").forEach(navArrow=>
1{navArrow.addEventListener("click",function(){showZoomedNum.innerHTML=0,zoomInOut(target,1)})}),document.querySelectorAll(".thumbnail_media_gallery img.global-media-settings").forEach(thumbImg=>{thumbImg.addEventListener("click",function(){showZoomedNum.innerHTML=0,zoomInOut(target,1)})});function zoomInOut(target2,zoom2){target2.style.transform=`scale(${zoom2})`,target2.style.transformOrigin="center center",target2.dataset.zoom=zoom2}}),(function(){if(!window.shopifyCartData||!window.shippingConfig){console.error("Shipping configuration not loaded");return}const{rates,countryGroups}=window.shippingConfig;let{cartTotal,currency,currencySymbol}=window.shopifyCartData;const currencySymbolMap={USD:"$",EUR:"\u20AC",GBP:"\xA3",SAR:"\u0631.\u0633",AED:"\u062F.\u0625"};function getCurrencyFromCookie(){try{const cookies=document.cookie.split(";");for(let c of cookies){const[name,value]=c.trim().split("=");if(name==="cart_currency"){const cookieCurrency2=decodeURIComponent(value).trim();if(cookieCurrency2)return{currency:cookieCurrency2,symbol:currencySymbolMap[cookieCurrency2]||cookieCurrency2}}}}catch(e){console.error("Currency cookie parse error",e)}return null}const cookieCurrency=getCurrencyFromCookie();cookieCurrency&&(currency=cookieCurrency.currency,currencySymbol=cookieCurrency.symbol);let globalSelectedCountry=null;function parseLocalizationCookie(rawValue){try{const decoded=decodeURIComponent(rawValue);if(decoded.startsWith("{")){const parsed=JSON.parse(decoded);if(parsed&&parsed.country)return parsed.country}if(/^[A-Z]{2}$/.test(decoded))return decoded}catch(e){console.error("Localization parse error",e)}return null}function buildCountryCodeMapping(){const mapping={},allMappings={AE:"Saudi Arabia",SA:"Saudi Arabia",BH:"Bahrain",IQ:"Iraq",KW:"Kuwait",OM:"Oman",QA:"Qatar",GB:"UK",US:"USA",AT:"Austria",BE:"Belgium",BG:"Bulgaria",HR:"Croatia",CZ:"Czechia",DE:"Germany",DK:"Denmark",EE:"Estonia",FR:"France",GR:"Greece",HU:"Hungary",IT:"Italy",LV:"Latvia",LT:"Lithuania",LU:"Luxembourg",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SK:"Slovakia",SI:"Slovenia",ES:"Spain",SE:"Sweden",AU:"Australia",CA:"Canada",CY
1:"Cyprus",FI:"Finland",HK:"Hong Kong",IE:"Ireland",IL:"Israel",JP:"Japan",JE:"Jersey",KE:"Kenya",MY:"Malaysia",MT:"Malta",NZ:"New Zealand",NO:"Norway",PK:"Pakistan",SG:"Singapore",ZA:"South Africa",KR:"South Korea",CH:"Switzerland"},allCountries=[...countryGroups.freeShipping||[],...countryGroups.arabCountries||[],...countryGroups.otherCountries||[]];return Object.keys(allMappings).forEach(code=>{const countryName=allMappings[code];allCountries.some(c=>c.trim().toLowerCase()===countryName.toLowerCase())&&(mapping[code]=countryName)}),mapping}const countryCodeMapping=buildCountryCodeMapping();function getCountryType(country){const normalized=country.trim().toLowerCase();return countryGroups.freeShipping&&countryGroups.freeShipping.some(c=>c.trim().toLowerCase()===normalized)?"freeShipping":countryGroups.arabCountries&&countryGroups.arabCountries.some(c=>c.trim().toLowerCase()===normalized)?"arabCountry":(countryGroups.otherCountries&&countryGroups.otherCountries.some(c=>c.trim().toLowerCase()===normalized),"otherCountry")}function isValidCountry(country){return[...countryGroups.freeShipping||[],...countryGroups.arabCountries||[],...countryGroups.otherCountries||[]].some(c=>c.trim().toLowerCase()===country.trim().toLowerCase())}function saveToLocalStorage(country){try{localStorage.setItem("selectedCountry",country),localStorage.setItem("selectedCountryType",getCountryType(country)),localStorage.setItem("selectedCountryTimestamp",Date.now().toString())}catch(e){console.error(e)}}function getFromLocalStorage(){try{const country=localStorage.getItem("selectedCountry");if(country&&isValidCountry(country))return{country}}catch{}return{country:null}}function clearLocalStorage(){localStorage.removeItem("selectedCountry"),localStorage.removeItem("selectedCountryType"),localStorage.removeItem("selectedCountryTimestamp")}function checkLocalizationCookie(){try{const cookies=document.cookie.split(";"),allCountries=[...countryGroups.freeShipping||[],...countryGroups.arabCountries||[],...countryGroups.otherCountries||[]];for(let c of cookies){const[name,value]=c.trim().split("=");if(name==="localization"){const code=parseLocalizationCookie(value);if(!code)return null;if(countryCodeMapping[code])return countryCodeMapping[code];const directMatch=allCountries.find(c2=>c2.toLowerCase()===code.toLowerCase());return directMatch||(countryGroups.otherCountries&&countryGroups.otherCountries.length>0?countryGroups.otherCountries[0]:null)}}}catch(e){console.error(e)}return null}function resolveCountryFromLocalization(){try{const cookies=document.cookie.split(";");for(let c of cookies){const[name,value]=c.trim().split("=");if(name==="localization"){const code=parseLocalizationCookie(value);if(!code)return countryGroups.otherCountries&&countryGroups.otherCountries.length>0?countryGroups.otherCountries[0]:null;if(countryCodeMapping[code])return countryCodeMapping[code];if(countryGroups.otherCountries&&countryGroups.otherCountries.length>0)return countryGroups.otherCountries[0]}}}catch(e){console.error("Localization resolve error",e)}return countryGroups.otherCountries&&countryGroups.otherCountries.length>0?countryGroups.otherCountries[0]:null}globalSelectedCountry||(globalSelectedCountry=resolveCountryFromLocalization(),globalSelectedCountry&&saveToLocalStorage(globalSelectedCountry));function formatMoney(amount){try{return new Intl.NumberFormat("en-US",{style:"currency",currency,minimumFractionDigits:2}).format(amount)}catch{return`${currencySymbol}${amount.toFixed(2)}`}}function getShippingMessage(country){const type=getCountryType(country),total=parseFloat(cartTotal)||0,icon=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 2 <path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#25A249" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 3 </svg> 4 `;if(type==="freeShipping")return{type:"free",message:"Free shipping available!",icon,progressPercentage:100,currentAmount:0,targetAmount:0};if(type==="arabCountry"){if(total>=rates.arabMinCart)return{type:"free",message:"Free shipping unlocked!",icon,progressPercentage:100,currentAmount:total,targetAmount:rates.arabMinCart};const progressPercentage2=total/rates.arabMinCart*100;return{type:"paid",message:`You're ${formatMoney(rates.arabMinCart-total)} away from FREE shipping!`,progressPercentage:progressPercentage2,currentAmount:total,targetAmount:rates.arabMinCart}}if(total>=rates.otherMinCart)return{type:"free",message:"Free shipping unlocked!",icon,progressPercentage:100,currentAmount:total,targetAmount:rates.otherMinCart};const progressPercentage=total/rates.otherMinCart*100;return{type:"paid",message:`You're ${formatMoney(rates.otherMinCart-total)} away from FREE shipping!`,progressPercentage,currentAmount:total,targetAmount:rates.otherMinCart}}function showShippingMessageGlobal(country){document.querySelectorAll(".shipping-notification").forEach(e
4=>e.remove());const info=getShippingMessage(country);document.querySelectorAll(".region-disclosure").forEach(dropdown=>{const msg=document.createElement("div"),freeShippingClass=info.type==="free"?" free-shipping-unlock":"";msg.className=`shipping-notification shipping-notification--${info.type} shipping-notification__text${freeShippingClass}`;let progressBarHTML="";info.type==="paid"&&(progressBarHTML=` 5 <div class="shipping-progress-bar" style="width: 100%; height: 8px; background-color: #F7EFE5; border-radius: 4px; margin-top: 8px; overflow: hidden;"> 6 <div class="shipping-progress-fill" style="width: ${info.progressPercentage}%; height: 100%; display:block; background-color: #705938; border-radius: 4px; transition: width 0.3s ease;"></div> 7 </div> 8 `),msg.innerHTML=` 9 <div class="shipping-notification__content">${info.icon||""}${info.message}</div> 10 ${progressBarHTML} 11 `,dropdown.parentNode.insertBefore(msg,dropdown)})}class CountryDropdown{constructor(el,index){this.element=el,this.index=index,this.trigger=el.querySelector(".region-disclosure__trigger"),this.wrapper=el.querySelector(".region-disclosure__wrapper"),this.regionLinks=el.querySelectorAll(".region-disclosure__link"),this.selectedText=el.querySelector(".region-selected-text"),this.init()}clearAllSelections(){this.regionLinks.forEach(link=>{link.classList.remove("region-selected"),link.removeAttribute("aria-current"),link.querySelectorAll("svg, .checkmark, .visibility-hidden").forEach(el=>el.classList.add("visibility-hidden"))})}markSelectedCountry(country){this.clearAllSelections(),this.selectedText.textContent=country,this.regionLinks.forEach(link=>{link.dataset.region?.toLowerCase()===country.toLowerCase()&&(link.classList.add("region-selected"),link.setAttribute("aria-current","true"),link.querySelectorAll("svg, .checkmark, .visibility-hidden").forEach(el=>el.classList.remove("visibility-hidden")))})}updateSelectedCountry(country){globalSelectedCountry!==country&&(globalSelectedCountry=country,saveToLocalStorage(country),updateAllDropdowns(country),showShippingMessageGlobal(country))}init(){globalSelectedCountry&&(this.markSelectedCountry(globalSelectedCountry),showShippingMessageGlobal(globalSelectedCountry)),this.trigger.addEventListener("click",e=>{e.preventDefault(),closeAllDropdowns(this.index),this.wrapper.hidden=!this.wrapper.hidden}),this.regionLinks.forEach(link=>{link.addEventListener("click",e=>{e.preventDefault(),this.updateSelectedCountry(link.dataset.region),this.wrapper.hidden=!0})});const stored=getFromLocalStorage().country||checkLocalizationCookie();stored&&isValidCountry(stored)&&(globalSelectedCountry=stored,this.markSelectedCountry(stored),showShippingMessageGlobal(stored))}}let dropdownInstances=[];function updateAllDropdowns(country){dropdownInstances.forEach(d=>d.markSelectedCountry(country))}document.addEventListener("click",function(e){dropdownInstances.forEach(dropdown=>{dropdown.element.contains(e.target)||(dropdown.wrapper.hidden=!0)})});function closeAllDropdowns(except=-1){dropdownInstances.forEach((d,i)=>{i!==except&&(d.wrapper.hidden=!0)})}function initializeAllDropdowns(){dropdownInstances=[],document.querySelectorAll(".region-disclosure").forEach((el,i)=>{dropdownInstances.push(new CountryDropdown(el,i))})}document.addEventListener("DOMContentLoaded",()=>{initializeAllDropdowns()})})(); 12//# sourceMappingURL=/cdn/shop/t/25/assets/custom.js.map?v=183261553665459653971779686060
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.