1const init=()=>{videoControlsInit(),globalClickListener(),window.resize(()=>{mobileAccordion()}),mobileAccordion(),a11yFixes(),menuUpdates(),closeAnnouncement(),scrollBehavior(),fastSimonWidgetUpdates(),judgeMeUpdates(),cardLinks(),breadcrumbUpdates(),searchButton()},a11yFixes=()=>{const links=document.querySelectorAll('a[target="_blank"]:not([aria-label*="new window"])');links&&links.forEach((link,ind)=>{link.setAttribute("aria-label",`${link.textContent.trim()} opens in a new window`)})},mobileAccordion=()=>{const isDesktop=window.screen.width>=750,specific=isDesktop?":not([open])":"[open]",mobileAccordions=document.querySelectorAll(`.mobile-accordion${specific}`);mobileAccordions.length&&mobileAccordions.forEach(el=>{isDesktop?el.setAttribute("open",""):el.removeAttribute("open")})},globalClickListener=()=>{document.body.addEventListener("click",function(e){const target=e.target;if(window.screen.width<800&&target.classList.contains("footer-block__heading")){const dropdownEl=target.closest(".footer-block-content");dropdownEl.classList.contains("open")?dropdownEl.classList.remove("open"):dropdownEl.classList.add("open")}readMore(target,e)})},readMore=(target,e)=>{if(target.classList.contains("read-more")&&(e.preventDefault(),target.closest(".read-more-container").classList.add("expanded")),target.classList.contains("read-more-btn")){e.preventDefault();const readMoreContainer=target.closest(".read-more-container");readMoreContainer.classList.contains("expanded")?readMoreContainer.classList.remove("expanded"):readMoreContainer.classList.add("expanded")}},videoControlsInit=()=>{let isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const videoToggles=[...document.querySelectorAll(".utility-btn")];if(videoToggles.length!==0){videoToggles.forEach(videoToggle=>{const video=videoToggle.parentElement.querySelector("video");video&&(videoToggle.addEventListener("click",function(e){e.preventDefault();const videoEl=this.parentElement.querySelector("video"),videoPlay=videoEl.paused||videoEl.ended;videoEl.controls=0,videoPlay?(videoEl.play(),videoEl.classList.add("keep-playing"),videoEl.parentElement.classList.add("playing"),videoToggle.setAttribute("aria-label","pause video"),videoToggle.classList.add("active")):(videoEl.pause(),videoEl.classList.remove("keep-playing"),videoEl.parentElement.classList.remove("playing"),videoToggle.setAttribute("aria-label","play video"),videoToggle.classList.remove("active"))}),video.classList.add("keep-playing"),isMobileDevice&&(video.pause(),video.classList.remove("keep-playing"),video.parentElement.classList.remove("playing"),videoToggle.setAttribute("aria-label","play video"),videoToggle.classList.remove("active")))});const videos=document.querySelectorAll("video"),observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{const videoEl=entry.target,isPlay=videoEl.paused&&videoEl.classList.contains("keep-playing");if(entry.intersectionRatio===0&&!videoEl.paused){videoEl.pause(),videoEl.parentElement.classList.remove("playing");let toggle=videoEl.parentElement.querySelector(".utility-btn");toggle.setAttribute("aria-label","play video"),toggle.classList.remove("active")}else if(isPlay){videoEl.play(),videoEl.parentElement.classList.add("playing");let toggle=videoEl.parentElement.querySelector(".utility-btn");toggle.setAttribute("aria-label","pause video"),toggle.classList.add("active")}})});videos.forEach(video=>{observer.observe(video)})}},menuUpdates=()=>{const list=document.querySelector(".header__submenu--large");if(!list)return;const detailsList=list.querySelectorAll("details");detailsList.forEach((detail,index)=>{const summary=detail.querySelector("summary");detail.addEventListener("toggle",function(){detail.open?(detailsList.forEach(otherDetail=>{if(otherDetail!==detail&&otherDetail.open){otherDetail.open=!1;const otherSummary=otherDetail.querySelector("summary");otherSummary&&otherSummary.setAttribute("aria-expanded","false")}}),summary&&summary.setAttribute("aria-expanded","true")):summary&&summary.setAttribute("aria-expanded","fal
1se")})})},closeAnnouncement=()=>{const utilityBar=document.querySelector(".utility-bar"),closeBtn=document.querySelector(".announcement-bar__button");!sessionStorage.getItem("utilityBarClosed")&&utilityBar&&utilityBar.classList.add("utility-bar--visible"),closeBtn?.addEventListener("click",function(){utilityBar.classList.remove("utility-bar--visible"),sessionStorage.setItem("utilityBarClosed","true")})},scrollBehavior=()=>{const header=document.querySelector(".header-wrapper");window.scrollY>0?header.classList.add("scrolled"):header.classList.remove("scrolled"),window.addEventListener("scroll",()=>{window.scrollY>0?header.classList.add("scrolled"):header.classList.remove("scrolled")})},fastSimonWidgetUpdates=()=>{const widgetHost=document.querySelector('[data-settings="FAST_UPSELL_CONFIG"]');if(document.querySelector('main[data-template="cart"]'))if(widgetHost&&widgetHost.shadowRoot){const style=document.createElement("style");style.textContent=` 2 .fs-recommendation-widget-title.fs-rec-widget-1th4y2o { 3 display: block; 4 -webkit-box-orient: unset; 5 -webkit-line-clamp: unset; 6 overflow: visible; 7 word-break: normal; 8 overflow-wrap: normal; 9 line-height: 1.3; 10 } 11 `,widgetHost.shadowRoot.appendChild(style)}else console.warn("Widget host not found or shadowRoot is closed.")},judgeMeUpdates=()=>{const pdpContainer=document.querySelector('main[data-template="product"]');if(pdpContainer){const observer=new MutationObserver(()=>{let unpatchedFound=!1;pdpContainer.querySelectorAll(".jdgm-rev__author-wrapper").forEach(el=>{el.hasAttribute("role")||(el.setAttribute("role","heading"),el.setAttribute("aria-level","3"),unpatchedFound=!0)}),pdpContainer.querySelectorAll(".jdgm-rev__icon").forEach(icon=>{icon.hasAttribute("aria-hidden")||(icon.setAttribute("aria-hidden","true"),unpatchedFound=!0)});const summaryStars=pdpContainer.querySelector(".jdgm-rev-widg__summary-stars");if(summaryStars){const label=summaryStars.getAttribute("aria-label");label&&!label.includes("out of 5 stars")&&(summaryStars.setAttribute("aria-label",label+" out of 5 stars"),unpatchedFound=!0)}unpatchedFound||observer.disconnect()});observer.observe(pdpContainer,{childList:!0,subtree:!0})}},cardLinks=()=>{const card=document.querySelector(".card-link__card"),cardLink=document.querySelector(".card-link__link");card.addEventListener("click",()=>{cardLink.click()})},breadcrumbUpdates=()=>{const path=window.location.pathname,isCollection=path.startsWith("/collections/");let lastCollection=null;try{lastCollection=JSON.parse(localStorage.getItem("lastCollection"))}catch{lastCollection=null}const lastVisitedUrl=localStorage.getItem("lastVisitedUrl");if(isCollection){const collectionUrl=path,collectionTitle=(document.querySelector(".image-text-banner__heading")?.textContent||"").trim(),breadcrumbList=document.querySelector(".breadcrumbs__item")?.parentElement;if(breadcrumbList&&lastCollection&&lastCollection.title&&lastCollection.url!==collectionUrl&&lastVisitedUrl===lastCollection.url){const li=document.createElement("li");li.className="breadcrumbs__item";const a=document.createElement("a");a.className="breadcrumbs__link",a.href=lastCollection.url,a.title=lastCollection.title,a.textContent=lastCollection.title,li.appendChild(a),breadcrumbList.insertBefore(li,breadcrumbList.lastElementChild)}collectionTitle?localStorage.setItem("lastCollection",JSON.stringify({url:collectionUrl,title:collectionTitle})):localStorage.removeItem("lastCollection")}else localStorage.removeItem("lastCollection");localStorage.setItem("lastVisitedUrl",path)};searchButton=()=>{const container=document.querySelector(".header__search-container"),toggleButton=container?.querySelector(".header__icon")||container?.querySelector("summary"),closeButton=container?.querySelector(".search-modal__close-button"),overlay=container?.querySelector(".modal-overlay");if(!toggleButton)return;const openModal=()=>{container.classList.add("open"),document.body.classList.add("overflow-hidden")},closeModal=()=>{container.classList.remove("open"),document.body.classList.remove("overflow-hidden")};toggleButton.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),openModal()}),closeButton&&closeButton.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),closeModal()}),overlay&&overlay.addEventListener("click",closeModal),document.addEventListener("keyup",event=>{event.code==="Escape"&&closeModal()})};class SeparatedList extends HTMLElement{constructor(){super();const that=this;window.resize(()=>{const items=that.querySelectorAll("li");
11items.forEach((item,itemIndex)=>{const previousItem=items[itemIndex-1],nextItem=items[itemIndex+1];item.classList.toggle("first-of-row",!previousItem||item.offsetTop!==previousItem.offsetTop),item.classList.toggle("last-of-row",!nextItem||item.offsetTop!==nextItem.offsetTop)})})}}customElements.define("separated-list",SeparatedList),setTimeout(()=>{const searchIcon=document.querySelector(".header__icon--search"),searchButton2=document.querySelector(".header__search .header__icon"),searchSummary=document.querySelector(".header__search summary"),desktopSearch=document.querySelector(".header__search--desktop");[searchIcon,searchButton2,searchSummary].forEach(element=>{element&&(element.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const container=document.querySelector(".header__search-container");container&&(container.classList.add("open"),document.body.classList.add("overflow-hidden"),setTimeout(()=>{const searchInput=container.querySelector('.fast-autocomplete, input[type="search"]');searchInput&&searchInput.focus()},100))}),element.addEventListener("touchend",e=>{e.preventDefault(),e.stopPropagation();const container=document.querySelector(".header__search-container");container&&(container.classList.add("open"),document.body.classList.add("overflow-hidden"),setTimeout(()=>{const searchInput=container.querySelector('.fast-autocomplete, input[type="search"]');searchInput&&searchInput.focus()},100))}))});const closeButton=document.querySelector(".search-modal__close-button");closeButton&&(console.log("\u2705 Adding close button listener"),closeButton.addEventListener("click",e=>{e.preventDefault();const container=document.querySelector(".header__search-container");container&&(container.classList.remove("open"),document.body.classList.remove("overflow-hidden"))}));const overlay=document.querySelector(".modal-overlay");overlay&&overlay.addEventListener("click",()=>{const container=document.querySelector(".header__search-container");container&&(container.classList.remove("open"),document.body.classList.remove("overflow-hidden"))})},2e3),window.onload=()=>{init()}; 12//# sourceMappingURL=/cdn/shop/t/63/assets/ae-global.js.map?v=161911858510456346351788458576
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.