PageSourceSearch

https://doto.com.mx/cdn/shop/t/56/assets/doto-product-carousel.js?v=75000085378785739401787152908

js doto.com.mx collected 2026-10-01 16:30:57 UTC 5,333 bytes, 2 lines download raw bytes

1class DotoProductCarousel{constructor(root){this.root=root,this.track=root.querySelector("[data-carousel-track]"),this.cards=Array.from(root.querySelectorAll("[data-carousel-card]")),this.dotsRoot=root.querySelector("[data-carousel-dots]"),this.prev=root.querySelector("[data-carousel-prev]"),this.next=root.querySelector("[data-carousel-next]"),this.autoplay=root.dataset.autoplay==="true",this.pauseHover=root.dataset.pauseHover==="true",this.delay=(parseInt(root.dataset.autoplaySpeed||"5",10)||5)*1e3,this.timer=null,this.scrollRaf=null,!(!this.track||this.cards.length===0)&&(this.onScroll=this.onScroll.bind(this),this.onResize=this.onResize.bind(this),this.onPrev=()=>this.scrollPages(-1),this.onNext=()=>this.scrollPages(1),this.onMouseEnter=()=>this.stop(),this.onMouseLeave=()=>this.start(),this.onInteraction=()=>{this.stop(),window.clearTimeout(this.resumeTimer),this.resumeTimer=window.setTimeout(()=>this.start(),Math.max(this.delay,2500))},this.bind(),this.refresh(),this.start())}bind(){this.track.addEventListener("scroll",this.onScroll,{passive:!0}),this.track.addEventListener("pointerdown",this.onInteraction,{passive:!0}),this.track.addEventListener("touchstart",this.onInteraction,{passive:!0}),this.prev?.addEventListener("click",this.onPrev),this.next?.addEventListener("click",this.onNext),window.addEventListener("resize",this.onResize,{passive:!0}),this.pauseHover&&(this.root.addEventListener("mouseenter",this.onMouseEnter),this.root.addEventListener("mouseleave",this.onMouseLeave))}get pageSize(){if(!this.cards[0])return this.track.clientWidth;const card=this.cards[0],styles=getComputedStyle(this.track),gap=parseFloat(styles.columnGap||styles.gap||"0")||0,width=card.getBoundingClientRect().width+gap,visible=Math.max(1,Math.round(this.track.clientWidth/width));return width*visible}get pages(){return Math.max(1,Math.ceil(this.track.scrollWidth/this.track.clientWidth))}get currentPage(){if(this.pages<=1)return 0;const max=Math.max(1,this.track.scrollWidth-this.track.clientWidth);return Math.min(this.pages-1,Math.round(this.track.scrollLeft/max*(this.pages-1)))}refresh(){this.buildDots(),this.updateControls()}buildDots(){if(this.dotsRoot){this.dotsRoot.innerHTML="";for(let i=0;i<this.pages;i+=1){const dot=document.createElement("button");dot.type="button",dot.className="#doto-product-carousel-dot",dot.setAttribute("aria-label",`Ir a p\xE1gina ${i+1}`),dot.addEventListener("click",()=>{const max=Math.max(0,this.track.scrollWidth-this.track.clientWidth),left=this.pages<=1?0:max*i/(this.pages-1);this.track.scrollTo({left,behavior:"smooth"}),this.onInteraction()}),this.dotsRoot.appendChild(dot)}this.updateDots()}}updateDots(){this.dotsRoot&&Array.from(this.dotsRoot.children).forEach((dot,index)=>{const active=index===this.currentPage;dot.classList.toggle("@active",active),dot.setAttribute("aria-current",active?"true":"false")})}updateControls(){const max=this.track.scrollWidth-this.track.clientWidth;this.prev&&(this.prev.disabled=this.track.scrollLeft<=2),this.next&&(this.next.disabled=this.track.scrollLeft>=max-2),this.updateDots()}onScroll(){this.scrollRaf||(this.scrollRaf=requestAnimationFrame(()=>{this.scrollRaf=null,this.updateControls()}))}onResize(){window.clearTimeout(this.resizeTimer),this.resizeTimer=window.setTimeout(()=>this.refresh(),120)}scrollPages(direction){this.track.scrollBy({left:this.pageSize*direction,behavior:"smooth"}),this.onInteraction()}advance(){const max=this.track.scrollWidth-this.track.clientWidth;max<=2||(this.track.scrollLeft>=max-4?this.track.scrollTo({left:0,behavior:"smooth"}):this.track.scrollBy({left:this.pageSize,behavior:"smooth"}))}start(){this.stop(),!(!this.autoplay||window.matchMedia("(prefers-reduced-motion: reduce)").matches)&&(this.timer=window.setInterval(()=>this.advance(),this.delay))}stop(){this.timer&&window.clearInterval(this.timer),this.timer=null}destroy(){this.stop(),window.clearTimeout(this.resumeTimer),window.clearTimeout(this.resizeTimer),this.scrollRaf&&cancelAnimationFrame(this.scrollRaf),this.track?.removeEventListener("scroll",this.onScroll),this.track?.removeEventListener("pointerdown",this.onInteraction),this.track?.removeEventListener("touchstart",this.onInteraction),this.prev?.removeEventListener("click",this.onPrev),this.next?.removeEventListener("click",this.onNext),window.removeEventListener("resize",this.onResize),this.root.removeEventListener("mouseenter",this.onMouseEnter),this.root.removeEventListener("mouseleave",this.onMouseLeave)}}const dotoProductCarouselInstances=new Map;function initDotoProductCarousel(root){!root||dotoProductCarouselInstances.has(root)||dotoProductCarouselInstances.set(root,new DotoProductCarousel(root))}function destroyDotoProductCarousel(root){dotoProductCarouselInstances.get(root)?.destroy(),dotoProductCarouselInstances.delete(root)}
1document.querySelectorAll("[data-doto-product-carousel]").forEach(initDotoProductCarousel),document.addEventListener("shopify:section:load",event=>{event.target.querySelectorAll?.("[data-doto-product-carousel]").forEach(initDotoProductCarousel)}),document.addEventListener("shopify:section:unload",event=>{event.target.querySelectorAll?.("[data-doto-product-carousel]").forEach(destroyDotoProductCarousel)});
2//# sourceMappingURL=/cdn/shop/t/56/assets/doto-product-carousel.js.map?v=75000085378785739401787152908

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.