1(function(){const removeHighlight=(blocks,isButton=!1)=>{blocks.forEach(block=>{isButton?(block.classList.remove("button--primary"),block.classList.add("button--secondary")):block.classList.remove("highlight--item")})},returnActiveItem=(target,wrapper,isButton=!1)=>{if(!target||!wrapper)return;const blockType=isButton?".store-locations__tab":".store-locations__image";return wrapper.querySelector(`${blockType}[data-block-identifier="${target}"]`)},highlightTab=tab=>{tab&&(tab?.classList.contains("button--primary")||(tab?.classList.remove("button--secondary"),tab?.classList.add("button--primary")))},addHighlight=(target,wrapper,isButton=!1)=>{if(isButton){const activeItem=returnActiveItem(target,wrapper,isButton);if(!activeItem)return;highlightTab(activeItem)}else{const activeItem=returnActiveItem(target,wrapper);if(!activeItem)return;activeItem.classList.add("highlight--item")}},highlightElementsOnClick=(target,wrapper,section)=>{if(!section||!target||!wrapper)return;const locationsList=wrapper.querySelector(".store-locations__locations-outer"),tabsPanel=wrapper.querySelector(".store-locations__tabs");if(!locationsList)return;const locationNameToShow=wrapper.querySelector(`.store-locations__group[data-group-name="${target}"]`);if(locationNameToShow){const pageHeader=document.querySelector("sticky-header.header-wrapper");let headerRevealTimeout=null;new ResizeObserver(entries=>{entries.forEach(entry=>{const tabsPanelHeight=tabsPanel?.clientHeight??0;if(document.documentElement.clientWidth>=990){const offset=tabsPanelHeight?locationNameToShow.offsetTop-tabsPanelHeight:locationNameToShow.offsetTop;locationsList.scrollTo({top:offset,behavior:"smooth"})}else{pageHeader&&(headerRevealTimeout&&clearTimeout(headerRevealTimeout),pageHeader.preventReveal=!0);const elementRect=locationNameToShow.getBoundingClientRect(),offset=window.scrollY+elementRect.top-tabsPanelHeight;window.scrollTo({top:offset,behavior:"smooth"}),pageHeader&&(headerRevealTimeout=setTimeout(()=>{pageHeader.preventReveal=!1},3e3))}})}).observe(section)}const locationsToShow=wrapper.querySelectorAll(`.store-locations__location[data-group-name="${target}"]`);if(!locationsToShow?.length>0)return;const firstLocation=locationsToShow[0],mediaIdentifier=firstLocation.dataset.blockId;firstLocation.classList.add("highlight--item"),addHighlight(mediaIdentifier,wrapper)},setActiveTabOnScroll=(wrapper,tabs)=>{if(!wrapper||!tabs)return;const groupWrappers=wrapper.querySelectorAll(".store-locations__group-wrapper");if(!groupWrappers.length)return;const observer=new IntersectionObserver(entries=>{const visible=entries.filter(entry=>entry.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible.length){const groupName=visible[0].target.dataset.groupName;removeHighlight(tabs,!0);const activeTab=wrapper.querySelector(`.store-locations__tab[data-block-identifier="${groupName}"]`);activeTab&&highlightTab(activeTab)}},{root:null,threshold:.1,rootMargin:"-20% 0px -70% 0px"});groupWrappers.forEach(el=>observer.observe(el))},initScrollStyles=section=>{if(!section||!section.classList.contains("store-locations-section"))return;const locationsWrapper=section.querySelector(".store-locations__wrapper");if(!locationsWrapper)return;const tabsPanel=section.querySelector(".store-locations__tabs"),locationsListWrapper=section.querySelector(".store-locations__locations-outer"),locationsList=section.querySelector(".store-locations__list");if(!tabsPanel)return;section.style.setProperty("--tabs-height",`${tabsPanel.offsetHeight}px`),new ResizeObserver(entries=>{entries.forEach(entry=>{if(window.innerWidth<990)locationsListWrapper.style.height="unset",locationsList.style.paddingTop="0px";else{const tabsPanelHeight=tabsPanel.offsetHeight,wrapperHeight=locationsWrapper.offsetHeight-tabsPanelHeight;locationsListWrapper.style.height=`${wrapperHeight}px`,locationsList.style.paddingTop=`${tabsPanelHeight}px`}})}).observe(section)},initStoreLocations=section=>{if(!section||!section.classList.contains("store-locations-section"))return;const locationsWrapper=section.querySelector(".store-locations__wrapper");if(!locationsWrapper)return;const blocksCollection=locationsWrapper.querySelectorAll(".store-locations__location"),tabsCollection=locationsWrapper.querySelectorAll(".store-locations__tab"),mediaCollection=locationsWrapper.querySelectorAll(".store-locations__image");if(!blocksCollection?.length>0||!mediaCollection?.length>0||(blocksCollection.forEach(block=>{block.addEventListener("mouseenter",e=>{removeHighlight(blocksCollection),removeHighlight(mediaCollection),tabsCollection?.length>0&&removeHighlight(tabsCollection,!0);const target=e.target.closest(".store-locations__location");target.classList.add("highlight--item");const targetBlockId=target.dataset.blockId,targetGroupName=target.dataset.groupName;addHighlight(targetBlockId,locationsWrapper),tabsCollection?.length>0&&addHighlight(targetGroupName,locationsWrapper,!0)})}),!tabsCollection?.length>0))return;tabsCollection.forEach(tab=>{tab.addEventListener("click",e=>{removeHighlight(blocksCollection),removeHighlight(mediaCollection),removeHighlight(tabsCollection,!0);const target=e.target.closest(".store-locations__tab"),targetGroupName=target.dataset.blockIdentifier;highlightTab(target),highlightElementsOnClick(targetGroupName,locationsWrapper,section)})});const mobileObserver=new ResizeObserver(entries=>
1{entries.forEach(entry=>{document.documentElement.clientWidth<990?(removeHighlight(blocksCollection),setActiveTabOnScroll(locationsWrapper,tabsCollection)):mobileObserver.disconnect()})});mobileObserver.observe(section)};initScrollStyles(document.currentScript.parentElement),initStoreLocations(document.currentScript.parentElement),document.addEventListener("shopify:section:load",function(event){initScrollStyles(event.target),initStoreLocations(event.target)})})(); 2//# sourceMappingURL=/cdn/shop/t/2/assets/store-locations.js.map?v=8382666789421548271774620162
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.