1"use strict";(self.webpackChunk_verndale_toolkit=self.webpackChunk_verndale_toolkit||[]).push([[4343],{4343(g,d,a){a.r(d),a.d(d,{default:()=>f});var l=a(27980),I=a.n(l),u=Object.defineProperty,v=(n,e,t)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,o=(n,e,t)=>(v(n,typeof e!="symbol"?e+"":e,t),t);class b extends l.Component{constructor(e){super(e),o(this,"dom"),o(this,"activeIndex",0),o(this,"resizeObserver",null),o(this,"boundOnScroll",null),o(this,"boundOnResize",null),this.init()}setupDefaults(){const e=this.el.querySelector(".container"),t=Array.from(this.el.querySelectorAll(".icon-banner-reskin__item")),i=this.el.querySelector("[data-icon-banner-pagination]");this.dom={track:e,items:t,pagination:i,dots:[]}}isMobile(){return window.innerWidth<768}buildPagination(){const{pagination:e,items:t}=this.dom;e&&(e.innerHTML="",this.dom.dots=[],t.forEach((i,r)=>{const s=document.createElement("button");s.type="button",s.className="icon-banner-reskin__pagination-dot",s.setAttribute("aria-label",`Go to slide ${r+1}`),s.addEventListener("click",()=>{this.scrollToIndex(r)}),e.appendChild(s),this.dom.dots.push(s)}),this.updatePagination())}getItemOffset(e){const{track:t,items:i}=this.dom;return!t||!i[e]?0:i[e].offsetLeft-t.offsetLeft}scrollToIndex(e){const{track:t}=this.dom;if(!t)return;const i=this.getItemOffset(e);t.scrollTo({left:i,behavior:"smooth"}),this.activeIndex=e,this.updatePagination()}getActiveIndex(){const{track:e,items:t}=this.dom;if(!e||!t.length)return 0;const i=e.scrollLeft+e.clientWidth/2;let r=0,s=Number.POSITIVE_INFINITY;return t.forEach((h,m)=>{const O=h.offsetLeft-e.offsetLeft+h.offsetWidth/2,c=Math.abs(i-O);c<s&&(s=c,r=m)}),r}updatePagination(){this.dom.dots.forEach((e,t)=>{const i=t===this.activeIndex;e.classList.toggle("is-active",i),e.setAttribute("aria-current",i?"true":"false")})}handleScroll(){if(!this.isMobile())return;const e=this.getActiveIndex();e!==this.activeIndex&&(this.activeIndex=e,this.updatePagination())}handleResize(){if(this.dom.track){if(!this.isMobile()){this.activeIndex=0,this.updatePagination();return}this.activeIndex=this.getActiveIndex(),this.updatePagination()}}addListeners(){const{track:e}=this.dom;e&&(this.boundOnScroll=this.handleScroll.bind(this),this.boundOnResize=this.handleResize.bind(this),e.addEventListener("scroll",this.boundOnScroll,{passive:!0}),window.addEventListener("resize",this.boundOnResize),"ResizeObserver"in window&&(this.resizeObserver=new ResizeObserver(()=>{this.handleResize()}),this.resizeObserver.observe(e)))}removeListeners(){const{track:e}=this.dom;e&&this.boundOnScroll&&e.removeEventListener("scroll",this.boundOnScroll),this.boundOnResize&&window.removeEventListener("resize",this.boundOnResize),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}init(){this.setupDefaults(),this.buildPagination(),this.addListeners(),this.handleResize()}destroy(){this.removeListeners()}}const f=b}}]); 2 3//# sourceMappingURL=4343.2384c317247ec5f5111b.js.map
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.