1const loadCollection=async()=>{const productList=document.querySelector(".collection .product-list");productList&&(productList.style.opacity=".2");const data=await(await fetch(window.location.href)).text(),newDocument=new DOMParser().parseFromString(data,"text/html");document.querySelector(".collection")?.replaceWith(newDocument.querySelector(".collection")),document.querySelectorAll("#offcanvas-filters .collapse-inner").forEach(collapse=>{const collapseId=collapse.closest(".collapse").getAttribute("id");collapse.replaceWith(newDocument.querySelector(`#offcanvas-filters #${collapseId} .collapse-inner`))}),document.querySelector("#offcanvas-filters .offcanvas-footer")?.replaceWith(newDocument.querySelector("#offcanvas-filters .offcanvas-footer")),document.querySelector("#offcanvas-filters .btn-filters-clear-all")?.replaceWith(newDocument.querySelector("#offcanvas-filters .btn-filters-clear-all")),document.querySelector('#offcanvas-filters [name="sort_by"]')?.replaceWith(newDocument.querySelector('#offcanvas-filters [name="sort_by"]')),document.querySelectorAll('.collection [data-bs-toggle="popover"]').forEach(el=>bootstrap.Popover.getOrCreateInstance(el));const customEvent=new CustomEvent("updated.ecomify.collection");window.dispatchEvent(customEvent),document.querySelector("[data-scroll-into-view]").scrollIntoView()};window.onChangeCollectionFilter=async(input,event)=>{const form=input.closest("form"),params=new URLSearchParams(new FormData(form)),url=`${window.location.pathname}?${params.toString()}`;window.history.replaceState({},"",url),await loadCollection()};const initCollectionFiltersPriceChange=()=>{document.querySelectorAll(".filter-price-group input").forEach(input=>{input.addEventListener("input",window.debounce(async event=>{const form=input.closest("form"),params=new URLSearchParams(new FormData(form)),url=`${window.location.pathname}?${params.toString()}`;window.history.replaceState({},"",url),await loadCollection()},750))})};initCollectionFiltersPriceChange(),window.addEventListener("updated.ecomify.collection",initCollectionFiltersPriceChange),window.onClickFiltersViewMore=(btn,event)=>{btn.closest(".collapse").querySelectorAll(".form-check").forEach(elem=>{elem.removeAttribute("hidden")}),btn.remove()},window.onClickClearAllFilters=async(btn,event)=>{const form=btn.closest("form"),params=new URLSearchParams;params.set("sort_by",form.querySelector('[name="sort_by"]').value);const url=`${window.location.pathname}?${params.toString()}`;window.history.replaceState({},"",url),await loadCollection()};const initPriceFilterSlider=()=>{document.querySelectorAll(".filter-price-group-slider").forEach(sli
1der=>{const minValueField=slider.closest("form").querySelector('[name="filter.v.price.gte"]'),maxValueField=slider.closest("form").querySelector('[name="filter.v.price.lte"]');slider&&slider.noUiSlider&&slider.noUiSlider.destroy(),noUiSlider.create(slider,{start:[Number(slider.dataset.minValue),Number(slider.dataset.maxValue)],connect:!0,range:{min:Number(slider.dataset.rangeMin),max:Number(slider.dataset.rangeMax)}}),slider.noUiSlider.on("update",function(values){minValueField.value=values[0],maxValueField.value=values[1]}),slider.noUiSlider.on("change",function(){const event=new Event("input");minValueField.dispatchEvent(event),maxValueField.dispatchEvent(event)})})};initPriceFilterSlider(),window.addEventListener("updated.ecomify.collection",initPriceFilterSlider),window.onChangeCollectionSortBy=value=>{const params=new URLSearchParams(window.location.search);params.set("sort_by",value);const url=`${window.location.pathname}?${params.toString()}`;window.history.replaceState({},"",url),loadCollection()},window.onClickCollectionLoadMore=async(btn,event)=>{event.preventDefault(),btn.style.width=`${btn.offsetWidth+2}px`,btn.style.height=`${btn.offsetHeight+2}px`,btn.innerHTML=` 2 <div class="spinner-border spinner-border-sm mx-auto" role="status" style="width: 1.2rem; height: 1.2rem"> 3 <span class="visually-hidden">Loading...</span> 4 </div> 5 `,window.history.replaceState({},"",btn.dataset.nextUrl);const data=await(await fetch(window.location.href)).text(),newDocument=new DOMParser().parseFromString(data,"text/html");document.querySelector(".collection .product-list").insertAdjacentHTML("beforeend",newDocument.querySelector(".collection .product-list").innerHTML),document.querySelector("#collection-pagination").replaceWith(newDocument.querySelector("#collection-pagination")),document.querySelectorAll('.collection [data-bs-toggle="popover"]').forEach(el=>bootstrap.Popover.getOrCreateInstance(el));const customEvent=new CustomEvent("updated.ecomify.collection");window.dispatchEvent(customEvent)},window.onClickCollectionLoadPrevious=async(btn,event)=>{event.preventDefault(),btn.style.width=`${btn.offsetWidth+2}px`,btn.style.height=`${btn.offsetHeight+2}px`,btn.innerHTML=` 6 <div class="spinner-border spinner-border-sm mx-auto" role="status" style="width: 1.2rem; height: 1.2rem"> 7 <span class="visually-hidden">Loading...</span> 8 </div> 9 `,window.history.replaceState({},"",btn.dataset.previousUrl);const data=await(await fetch(window.location.href)).text(),newDocument=new DOMParser().parseFromString(data,"text/html");document.querySelector(".collection .product-list").insertAdjacentHTML("afterbegin",newDocument.querySelector(".collection .product-list").innerHTML),document.querySelector("#btn-load-previous")?.replaceWith(newDocument.querySelector("#btn-load-previous")),document.querySelectorAll('.collection [data-bs-toggle="popover"]').forEach(el=>bootstrap.Popover.getOrCreateInstance(el));const customEvent=new CustomEvent("updated.ecomify.collection");window.dispatchEvent(customEvent)};const initPaginationObserver=()=>{const pagination=document.querySelector("#collection-pagination");if(!pagination)return;new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){const btn=pagination.querySelector(".btn-load-more");btn&&btn.dataset.paginationTrigger==="scroll"&&btn.click()}})},{threshold:0,rootMargin:"0px 0px -100px 0px"}).observe(pagination)};initPaginationObserver(),window.addEventListener("updated.ecomify.collection",initPaginationObserver);const fixedFiltersOnScroll=()=>{const filters=document.querySelector(".collection .collection-filters-form");if(!filters)return;const navbarHeight=document.querySelector('[id*="__navbar"].sticky-top')?.clientHeight||0,announcementBarHeight=document.querySelector('[id*="__announcement-bar"].sticky-top')?.clientHeight||0;filters.style.top=`${navbarHeight+announcementBarHeight+5}px`,filters.style.height=`calc(100vh - ${navbarHeight+announcementBarHeight+20}px)`};fixedFiltersOnScroll(),window.addEventListener("updated.ecomify.collection",()=>setTimeout(()=>{fixedFiltersOnScroll()},1e3));const handleScrollTopButton=()=>{const btn=document.querySelector("#btn-collection-scroll-top"),productList=document.querySelector(".collection .product-list");if(!btn||!productList)return;const top=productList.getBoundingClientRect().top;document.addEventListener("scroll",window.throttle(()=>{window.scrollY>top?btn.classList.add("btn-show"):btn.classList.remove("btn-show")},200))};handleScrollTopButton(),window.addEventListener("updated.ecomify.collection",handleScrollTopButton),window.showAllSwatchesWithinProductItem=(btn,event)=>{btn.closest(".color-swatches").querySelectorAll("li").forEach(elem=>{elem.removeAttribute("hidden")}),btn.remove()};
9const initCollectinBanner=()=>{const productList=document.querySelector(".collection .product-list");productList&&document.querySelectorAll(".collection-banner").forEach(banner=>{productList.querySelectorAll(".product-item").forEach((item,index)=>{index===Number(banner.dataset.inject-1)&&item.insertAdjacentElement("beforebegin",banner)})})};initCollectinBanner(),document.addEventListener("shopify:section:load",e=>{e.target.querySelector(".collection-banner")&&(document.querySelectorAll(".collection .product-list .collection-banner").forEach(banner=>{banner.remove()}),initCollectinBanner())}); 10//# sourceMappingURL=/cdn/shop/t/35/assets/collection.js.map?v=62447558981962021775108815
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.