1(()=>{const selector="[data-kuleana-mobile-carousel]",mobileQuery=window.matchMedia("(max-width: 749px)"),reduceMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)");let carouselCount=0;function buildArrow(direction,label,controls){const button=document.createElement("button");button.type="button",button.className=`kuleana-mobile-carousel-nav__button kuleana-mobile-carousel-nav__button--${direction}`,button.setAttribute("aria-label",`${direction==="previous"?"Previous":"Next"} ${label}`),button.setAttribute("aria-controls",controls);const points=direction==="previous"?"14 18 8 12 14 6":"10 6 16 12 10 18";return button.innerHTML=` 2 <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"> 3 <polyline points="${points}"></polyline> 4 </svg> 5 `,button}function initializeCarousel(carousel){if(!(carousel instanceof HTMLElement)||carousel.dataset.kuleanaCarouselReady==="true")return;carousel.dataset.kuleanaCarouselReady="true",carouselCount+=1,carousel.id||(carousel.id=`kuleana-mobile-carousel-${carouselCount}`);const label=carousel.dataset.carouselLabel||"item",navigation=document.createElement("div");navigation.className="kuleana-mobile-carousel-nav",navigation.setAttribute("aria-label",`${label.charAt(0).toUpperCase()}${label.slice(1)} carousel controls`);const previous=buildArrow("previous",label,carousel.id),next=buildArrow("next",label,carousel.id);navigation.append(previous,next),carousel.insertAdjacentElement("afterend",navigation);const getItems=()=>Array.from(carousel.children).filter(item=>item instanceof HTMLElement&&item.offsetWidth>0),getPositions=()=>{const carouselRect=carousel.getBoundingClientRect(),positions=getItems().map(item=>item.getBoundingClientRect().left-carouselRect.left+carousel.scrollLeft),firstPosition=positions[0]||0;return positions.map(position=>Math.max(0,position-firstPosition))},updateControls=()=>{const maxScroll=Math.max(0,carousel.scrollWidth-carousel.clientWidth),hasOverflow=mobileQuery.matches&&maxScroll>4;navigation.hidden=!hasOverflow,previous.disabled=!hasOverflow||carousel.scrollLeft<=4,next.disabled=!hasOverflow||carousel.scrollLeft>=maxScroll-4},move=direction=>{const positions=getPositions();if(positions.length<2)return;const current=carousel.scrollLeft;let target;direction==="next"?(target=positions.find(position=>position>current+8),target===void 0&&(target=positions[positions.length-1])):(target=positions.filter(position=>position<current-8).pop(),target===void 0&&(target=positions[0])),carousel.scrollTo({left:target,behavior:reduceMotionQuery.matches?"auto":"smooth"})};previous.addEventListener("click",()=>move("previous")),next.addEventListener("click",()=>move("next"));let frame;carousel.addEventListener("scroll",()=>{window.cancelAnimationFrame(frame),frame=window.requestAnimationFrame(updateControls)},{passive:!0}),"ResizeObserver"in window?new ResizeObserver(updateControls).observe(carousel):window.addEventListener("resize",updateControls,{passive:!0}),typeof mobileQuery.addEventListener=="function"&&mobileQuery.addEventListener("change",updateControls),updateControls()}function initializeWithin(root=document){root instanceof Element&&root.matches(selector)&&initializeCarousel(root),root.querySelectorAll?.(selector).forEach(initializeCarousel)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>initializeWithin()):initializeWithin(),document.addEventListener("shopify:section:load",event=>initializeWithin(event.target))})(); 6//# sourceMappingURL=/cdn/shop/t/6/assets/kuleana-mobile-carousel.js.map?v=36098954152303549641785331447
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.