1class CSlider{constructor(t,e){if(this.options={arrowKeys:!0,autoplay:!1,autoplaySpeed:6e3,buttons:!0,buttonTextNext:'<svg width="50" height="50" viewBox="0 0 100 100"><path fill="none" stroke="#000" stroke-width="8" d="M28.52 5l44.986 45.006L28.494 95"/></svg>',buttonTextPrev:'<svg width="50" height="50" viewBox="0 0 100 100"><path fill="none" stroke="#000" stroke-width="8" d="M71.48 95L26.494 49.994 71.506 5" /></svg>',buttonWrapperNext:t,buttonWrapperPrev:t,dots:!1,dotsWrapper:t,fixedHeight:!0,moveOnClick:!0,moveOnDots:!1,multiplier:4,pauseOnHover:!0,singleMode:!1,startPosition:0,swipeNavigation:!0,transitionSpeed:600,vertical:!1,waitForMedia:!1,wheelNavigation:!1,beforeMove(){},afterMove(){},afterTransition(){},afterResize(){},onReady(){}},Object.assign(this.options,e),!0===this.options.vertical&&!1!==e.wheelNavigation&&(this.options.wheelNavigation=!0),this.resizeDebounce=this.options.transitionSpeed+100,this.frame=document.querySelector(t),this._originalFrame=this.frame.cloneNode(!0),this._originalLength=this.frame.children.length,this._currentOriginalIndex=this.options.startPosition-1,!this.frame)return void console.error("CSlider initialization error: Target element not found");if(this._originalLength<2)return void console.error("CSlider initialization error: Needs at least 2 slides");if(this.frame.style.setProperty("--csl-transition-speed",`${this.options.transitionSpeed}ms`),this.frame.classList.add("csl-frame",!0===this.options.vertical?"csl-vertical":"csl-horizontal",!0===this.options.fixedHeight?"csl-height-fixed":"csl-height-auto",!0===this.options.swipeNavigation?"csl-swipe":"csl-no-swipe"),!0===this.options.swipeNavigation)for(const t of this.frame.querySelectorAll("img"))t.setAttribute("draggable","false");this.track=document.createElement("div"),this.track.classList.add("csl-track");let s=0;for(const t of this.frame.children)t.classList.add("csl-item"),t.setAttribute("data-csl-oindex",s),t.style.setProperty("--csl-oindex",s),s++;for(;this.frame.firstChild;)this.track.appendChild(this.frame.firstChild);this.frame.appendChild(this.track);const i=()=>{this.slides=this.frame.querySelectorAll(".csl-item");let t=getComputedStyle(this.frame,null);!0===this.options.vertical?this.frameInnerSize=Math.round(this.frame.offsetHeight-parseInt(t.paddingTop)-parseInt(t.paddingBottom)-parseInt(t.borderTopWidth)-parseInt(t.borderBottomWidth)):this.frameInnerSize=Math.round(this.frame.offsetWidth-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-parseInt(t.borderLeftWidth)-parseInt(t.borderRightWidth));for(let t of this.slides){t.style.removeProperty("--csl-size");const e=!0===this.options.vertical?t.offsetHeight:t.offsetWidth;t.style.setProperty("--csl-size",`${!0===this.options.singleMode?this.frameInnerSize:e}px`)}this.track.classList.add("csl-sized"),requestAnimationFrame((()=>{this.trackSize=!0===this.options.vertical?this.track.offsetHeight:this.track.offsetWidth;let t=this.track.innerHTML;if(this.trackSize>0){const s="number"==typeof e.multiplier?Math.max(e.multiplier,1):4;for(this.oldTrackSize=this.trackSize;this.trackSize<this.frameInnerSize*s;)if(this.track.insertAdjacentHTML("beforeend",t),this.trackSize=!0===this.options.vertical?this.track.offsetHeight:this.track.offsetWidth,this.oldTrackSize===this.trackSize){console.warn("Error duplicating slides: Track size did not change after insertion. Duplication aborted.");break}this.slides=this.frame.querySelectorAll(".csl-item")}n()}))},r=(t,e)=>{0!==t.button||this.swiping||this.slideTo(e)},n=()=>{!0===this.options.moveOnClick&&(this.frame.classList.add("csl-focus"),this.slides.forEach(((t,e)=>{t.removeEventListener("click",(t=>r.bind(this,t,e)())),t.addEventListener("click",(t=>r.bind(this,t,e)()))})))},o=()=>{this._currentIndex=this.options.startPosition,this._currentSlide=this.slides[this._currentIndex],this._currentSlide.classList.add("csl-current")},a=()=>{this.currentOrder=[];for(let t=0;t<this.slides.length;t++)this.currentOrder.push(t)};this.getCurrentOrder=()=>{let t=this._currentIndex-Math.floor((this.slides.length-1)/2);t<0&&(t+=this.slides.length);let e=0;for(;this.currentOrder[0]!=t&&!(++e>this.currentOrder.length);)this.currentOrder.push(this.currentOrder.shift());this.currentOrder.forEach(((t,e)=>{const s=Math.floor(this.slides.length/-2)+e+1;this.slides[t].setAttribute("data-csl-order",e),this.slides[t].style.setProperty("--csl-order",e),this.slides[t].setAttribute("data-csl-relative",s),this.slides[t].style.setProperty("--csl-relative",s)}))};const l=()=>{if(this.frame.classList.add("notrans"),i(),requestAnimationFrame((()=>{o(),a(),this.getCurrentOrder(),this.slideTo(this.options.startPosition,"init"),requestAnimationFrame((()=>{this.frame.classList.remove("notrans"),!0===this.options.autoplay&&this.autoplayStart()}))})),!0===this.options.buttons){(()=>{const t=document.querySelector(this.options.buttonWrapperPrev);if(t){const e=document.createElement("button");e.classList.add("csl-button","csl-button-prev"),e.setAttribute("aria-label","Previous slide"),!0===this.options.arrowKeys&&e.setAttribute("tabindex","-1"),e.innerHTML=this.options.buttonTextPrev,this.prevButton=t.appendChild(e),e.addEventListener("click",(()=>{this.prev()}))}else console.warn("Previous button wrapper element not found. Button will not be created.");const e=document.querySelector(this.options.buttonWrapperNext);if(e){const t=document.createElement("button");t.classList.add("csl-button","csl-button-next"),t.setAttribute("aria-label","Next slide"),!0===this.options.arrowKeys&&t.setAttribute("tabindex","-1"),t.innerHTML=this.options.buttonTextNext,this.nextButton=e.appendChild(t),t.addEventListener("click",(()=>{this.next()}))}else console.warn("Next button wrapper element not found. Button will not be created.")})()}if(!0===this.options.dots){(()=>
1{const t=document.querySelector(this.options.dotsWrapper);if(t){const e=document.createElement("div");e.classList.add("csl-dots"),this.dots=t.appendChild(e);for(let t=0;t<this.originalLength;t++){const s=this.options.moveOnDots?"button":"span",i=document.createElement(s);i.classList.add("csl-dot"),e.appendChild(i),!0===this.options.moveOnDots&&i.addEventListener("click",(()=>{this.slideTo(t)}))}}else console.warn("Dots wrapper element not found. Dots will not be created.")})()}if(!0===this.options.arrowKeys){this.frame.setAttribute("tabindex","0");let t=!1;const s=s=>{t||s.key!==(!0===e.vertical?"ArrowUp":"ArrowLeft")?t||s.key!==(!0===e.vertical?"ArrowDown":"ArrowRight")||(this.next(),t=!0):(this.prev(),t=!0),window.onkeyup=()=>{t=!1}};this.frame.addEventListener("keydown",s)}if(!0===this.options.wheelNavigation){let t=!1;const e=e=>{if(e.preventDefault(),!t){t=!0;(this.options.vertical?e.deltaY:e.deltaX)<0?this.prev():this.next(),setTimeout((()=>{t=!1}),100)}};this.frame.addEventListener("wheel",e)}this.resizer=()=>{let t;clearTimeout(t),t=setTimeout((()=>{this.frame.classList.add("notrans"),i(),requestAnimationFrame((()=>{a(),this.getCurrentOrder(),this.slideTo(this._currentIndex,"resize"),requestAnimationFrame((()=>{n(),this.frame.classList.remove("notrans")}))}))}),this.resizeDebounce)},window.addEventListener("resize",this.resizer)};if(!0===this.options.waitForMedia){const t=this.frame.querySelectorAll("img");t.length>0?Promise.allSettled([...t].map((t=>new Promise(((e,s)=>{t.complete&&e(),t.onload=()=>{e()},t.onerror=()=>{s()}}))))).then((()=>{l()})):l()}else l();if(!0===this.options.swipeNavigation){const t=(t="mouse")=>{const e={start:"mouse"===t?"mousedown":"touchstart",move:"mouse"===t?"mousemove":"touchmove",end:"mouse"===t?"mouseup":"touchend",cancel:"mouse"===t?"mouseleave":"touchcancel"};return s=>{if("mouse"===t&&0!==s.button)return;!0===this.options.autoplay&&clearTimeout(this.autoPlayTimeout);const i="mouse"===t?{x:s.clientX,y:s.clientY}:{x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY},r=[...this.slides];this.frame.classList.add("notrans");let n=!0===this.options.vertical?i.y:i.x,o=n;const a=e=>{const s="mouse"===t?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};let i=!1;if(!i){for(let t of r){const e=parseInt(window.getComputedStyle(t).getPropertyValue("--csl-translate"));t.style.setProperty("--csl-translate",e+(!0===this.options.vertical?s.y:s.x)-n+"px")}i=!0,this.swiping=!0,n=!0===this.options.vertical?s.y:s.x,setTimeout((()=>{i=!1}),10)}},l=s=>{const i="mouse"===t?{x:s.clientX,y:s.clientY}:{x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};let n=!0===this.options.vertical?i.y:i.x;if(this.frame.classList.remove("notrans"),document.removeEventListener("mouseup",l),Math.abs(o-n)<30)return this.slideTo(this._currentIndex),this.track?.removeEventListener(e.move,a),document.removeEventListener(e.end,l),this.track?.removeEventListener(e.cancel,l),void(this.swiping=!1);const h=this.frame.getBoundingClientRect(),c=!0===this.options.vertical?h.y+h.height/2:h.x+h.width/2;let d=[];for(let t of r){const e=t.getBoundingClientRect(),s=!0===this.options.vertical?e.y+e.height/2:e.x+e.width/2;d.push(Math.abs(c-s))}const u=d.indexOf(Math.min(...d)),p=r.indexOf(r[u]);this._currentIndex===p?o-n>0?this.next():this.prev():this.slideTo(p,"swipe"),this.track?.removeEventListener(e.move,a),document.removeEventListener(e.end,l),this.track?.removeEventListener(e.cancel,l),requestAnimationFrame((()=>this.swiping=!1))};this.track.addEventListener(e.move,a),document.addEventListener(e.end,l),this.track.addEventListener(e.cancel,l)}};this.track.addEventListener("mousedown",t("mouse")),this.track.addEventListener("touchstart",t("touch"))}!0===this.options.pauseOnHover&&(this.frame.addEventListener("mouseenter",(()=>{this.autoplayPaused=!0})),this.frame.addEventListener("mouseleave",(()=>{this.autoplayPaused=!1}))),this.setActiveDot=()=>{if(!0===this.options.dots){const t=document.querySelectorAll(this.options.dotsWrapper+" .csl-dot");for(let e of t)e.classList.remove("csl-current");t[this._currentOriginalIndex].classList.add("csl-current")}}}slideTo(t,e){if(!this.slides[t])return;!0===this.options.autoplay&&(clearTimeout(this.autoPlayTimeout),this.autoPlayTimeout=setTimeout((()=>{clearTimeout(this.autoPlayTimeout),this.autoplayPaused?this.frame.addEventListener("mouseleave",(()=>{this.next()}),{once:!0}):this.next()}),Math.max(this.options.autoplaySpeed,this.options.transitionSpeed))),e||this.options.beforeMove();const s=this.currentOrder.indexOf(this._currentIndex)-this.currentOrder.indexOf(t);if(s<0)for(let t=0;t<Math.abs(s);t++)this.slides[this.currentOrder[t]].style.setProperty("--csl-transition-speed","0ms");else for(let t=this.currentOrder.length-1;t>=this.currentOrder.length-s;t--)this.slides[this.currentOrder[t]].style.setProperty("--csl-transition-speed","0ms");this._currentSlide=this.slides[t];const i=!0===this.options.vertical?this._currentSlide.offsetTop-this.frameInnerSize/2+this._currentSlide.offsetHeight/2:this._currentSlide.offsetLeft-this.frameInnerSize/2+this._currentSlide.offsetWidth/2,r=t+Math.floor(this.slides.length/2),n=t
1+1-Math.ceil(this.slides.length/2);this._currentSlide.addEventListener("transitionend",(()=>{this.options.afterTransition()}),{once:!0}),this.slides.forEach(((e,s)=>{e.classList.remove("csl-next","csl-prev","csl-adjacent"),n>s?(e.style.setProperty("--csl-translate",-1*(i-this.trackSize)+"px"),e.classList.add("csl-swapped-ltr")):r<s?(e.style.setProperty("--csl-translate",-1*(i+this.trackSize)+"px"),e.classList.add("csl-swapped-rtl")):(e.style.setProperty("--csl-translate",-1*i+"px"),e.classList.remove("csl-swapped-rtl","csl-swapped-ltr")),s>t&&s<=r||s<n?(e.classList.remove("csl-before"),e.classList.add("csl-after")):(s<t&&s>=n||s>r)&&(e.classList.remove("csl-after"),e.classList.add("csl-before")),requestAnimationFrame((()=>{requestAnimationFrame((()=>{e.style.removeProperty("--csl-transition-speed")}))}))}));let o=t+1>=this.slides.length?0:t+1,a=t-1<0?this.slides.length-1:t-1;this.slides[o].classList.add("csl-next","csl-adjacent"),this.slides[a].classList.add("csl-prev","csl-adjacent"),this.slides[this._currentIndex].classList.remove("csl-current"),this._currentSlide.classList.remove("csl-after","csl-before"),this._currentSlide.classList.add("csl-current"),this._currentIndex=t,this._currentOriginalIndex=t%this._originalLength,this.getCurrentOrder(),this.setActiveDot(),e||this.options.afterMove(),"init"===e&&(console.log("CSlider ready!"),this.options.onReady()),"resize"===e&&this.options.afterResize()}prev(){this.slideTo(this._currentIndex-1<0?this.slides.length-1:this._currentIndex-1)}next(){this.slideTo(this._currentIndex+1>this.slides.length-1?0:this._currentIndex+1)}autoplayStart(){this.options.autoplay=!0,this.slideTo(this._currentIndex)}autoplayStop(){this.options.autoplay=!1,clearTimeout(this.autoPlayTimeout)}get currentSlide(){return this.slides[this._currentIndex]}get currentIndex(){return this._currentIndex}get originalLength(){return this._originalLength}destroy(){this.nextButton.remove(),this.prevButton.remove(),this.frame.insertAdjacentElement("beforebegin",this._originalFrame),this.frame.remove(),window.removeEventListener("resize",this.resizer)}}
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.