{"version":3,"sources":["priory.infoSlider.js"],"names":["InfoSlider","[object Object]","el","this","scope","items","querySelector","images","querySelectorAll","prevButton","nextButton","slider","Slider","activeIndex","changeFunction","debounce","e","toggleImage","detail","index","bindEvents","addEventListener","setAttribute","classList","add","setTimeout","remove","ControlBinders","register"],"mappings":"AAAA,MAAMA,WACJC,YAAYC,GACVC,KAAKC,MAAQF,EACbC,KAAKE,MAAQH,EAAGI,cAAc,gBAC9BH,KAAKI,OAASL,EAAGM,iBAAiB,gBAClCL,KAAKM,WAAaP,EAAGI,cAAc,eACnCH,KAAKO,WAAaR,EAAGI,cAAc,eACnCH,KAAKQ,OAAS,IAAIC,OAAOT,KAAKC,MAAOD,KAAKE,MAAO,CAACF,KAAKM,WAAYN,KAAKO,YAAa,CAAC,EAAG,EAAG,EAAG,GAAI,GACnGP,KAAKU,YAAc,EACnBV,KAAKW,eAAiBC,SAASC,GAAKb,KAAKc,YAAYD,EAAEE,OAAOC,MAAQ,GAAI,KAC1EhB,KAAKiB,aAEPnB,aACEE,KAAKC,MAAMiB,iBAAiB,SAAUL,GAAKb,KAAKW,eAAeE,IAC3Db,KAAKM,YACPN,KAAKM,WAAWa,aAAa,WAAY,KAEvCnB,KAAKO,YACPP,KAAKO,WAAWY,aAAa,WAAY,KAG7CrB,YAAYY,GACVV,KAAKI,OAAOJ,KAAKU,aAAaU,UAAUC,IAAI,8CAC5CrB,KAAKI,OAAOM,GAAaU,UAAUC,IAAI,6CACvCC,WAAW,KACTtB,KAAKI,OAAOJ,KAAKU,aAAaU,UAAUG,OAAO,8CAC/CvB,KAAKI,OAAOJ,KAAKU,aAAaU,UAAUG,OAAO,6CAC/CvB,KAAKU,YAAcA,GAClB,MAGPc,eAAeC,SAAS,qBAAsB1B,GAAM,IAAIF,WAAWE","sourcesContent":["class InfoSlider{\r\n constructor(el) {\r\n this.scope = el;\r\n this.items = el.querySelector(\"[data-items]\");\r\n this.images = el.querySelectorAll(\"[data-image]\");\r\n this.prevButton = el.querySelector('[data-prev]');\r\n this.nextButton = el.querySelector('[data-next]');\r\n this.slider = new Slider(this.scope, this.items, [this.prevButton, this.nextButton], [1,1,1,1], 0);\r\n this.activeIndex = 0;\r\n this.changeFunction = debounce((e) => this.toggleImage(e.detail.index-1), 500);\r\n this.bindEvents();\r\n }\r\n\r\n bindEvents(){\r\n this.scope.addEventListener(\"change\", e=> this.changeFunction(e));\r\n \r\n if (this.prevButton) {\r\n this.prevButton.setAttribute(\"tabindex\", \"0\"); \r\n }\r\n \r\n if (this.nextButton) {\r\n this.nextButton.setAttribute(\"tabindex\", \"0\"); \r\n }\r\n }\r\n \r\n toggleImage(activeIndex){\r\n this.images[this.activeIndex].classList.add(\"info-teaser-slider__images__image--fadeout\");\r\n this.images[activeIndex].classList.add(\"info-teaser-slider__images__image--active\");\r\n setTimeout(()=>{\r\n this.images[this.activeIndex].classList.remove(\"info-teaser-slider__images__image--fadeout\");\r\n this.images[this.activeIndex].classList.remove(\"info-teaser-slider__images__image--active\");\r\n this.activeIndex = activeIndex;\r\n }, 800);\r\n }\r\n \r\n}\r\n\r\nControlBinders.register(`[data-info-slider]`, el => new InfoSlider(el));"],"file":"priory.infoSlider-min.js"}