{"version":3,"file":"genericCarousel-7wUkX5dq.js","sources":["../../src/scripts/modules/genericCarousel.ts"],"sourcesContent":["import { Component } from '@verndale/core';\nimport Swiper from 'swiper';\nimport { A11y, Navigation, Pagination } from 'swiper/modules';\nimport 'swiper/css/bundle';\n\nclass GenericCarousel extends Component {\n swiperInstance: Swiper | undefined = undefined;\n\n setupDefaults() {\n this.dom = {\n $swiperContainer: this.el.querySelector('.swiper-container'),\n $swiperNext: this.el.querySelector('.btn-next-slide'),\n $swiperPrevious: this.el.querySelector('.btn-previous-slide'),\n $swiperScroll: this.el.querySelector('.generic-carousel__pagination-container')\n };\n\n this.initSlider();\n }\n\n initSlider() {\n if (this.dom.$swiperContainer) {\n const isGenericCard = this.el.classList.contains('generic-carousel--generic-card');\n const isMagazineCard = this.el.classList.contains('generic-carousel--magazine-card');\n\n this.swiperInstance = new Swiper(this.dom.$swiperContainer as HTMLElement, {\n modules: [Navigation, Pagination, A11y],\n keyboard: {\n enabled: false\n },\n breakpoints: {\n 320: {\n slidesPerView: 1,\n spaceBetween: 40\n },\n 768: {\n slidesPerView: isGenericCard ? 2.6 : isMagazineCard ? 4 : 3,\n spaceBetween: 40\n },\n 1440: {\n slidesPerView: isGenericCard ? 2.6 : isMagazineCard ? 4 : 3.1,\n spaceBetween: 40\n },\n 1620: {\n slidesPerView: isGenericCard ? 2.6 : isMagazineCard ? 4 : 3.5,\n spaceBetween: 40\n }\n },\n a11y: {\n enabled: true\n },\n // Navigation arrows\n navigation: {\n nextEl: this.dom.$swiperNext as HTMLElement,\n prevEl: this.dom.$swiperPrevious as HTMLElement\n },\n pagination: {\n el: this.dom.$swiperScroll as HTMLElement,\n type: 'progressbar'\n }\n });\n }\n }\n}\n\nexport default GenericCarousel;\n"],"names":["GenericCarousel","Component","__publicField","isGenericCard","isMagazineCard","Swiper","Navigation","Pagination","A11y"],"mappings":"4VAKA,MAAMA,UAAwBC,CAAU,CAAxC,kCACEC,EAAA,uBAEA,eAAgB,CACd,KAAK,IAAM,CACT,iBAAkB,KAAK,GAAG,cAA2B,mBAAmB,EACxE,YAAa,KAAK,GAAG,cAA2B,iBAAiB,EACjE,gBAAiB,KAAK,GAAG,cAA2B,qBAAqB,EACzE,cAAe,KAAK,GAAG,cAA2B,yCAAyC,CAAA,EAG7F,KAAK,WAAW,CAClB,CAEA,YAAa,CACP,GAAA,KAAK,IAAI,iBAAkB,CAC7B,MAAMC,EAAgB,KAAK,GAAG,UAAU,SAAS,gCAAgC,EAC3EC,EAAiB,KAAK,GAAG,UAAU,SAAS,iCAAiC,EAEnF,KAAK,eAAiB,IAAIC,EAAO,KAAK,IAAI,iBAAiC,CACzE,QAAS,CAACC,EAAYC,EAAYC,CAAI,EACtC,SAAU,CACR,QAAS,EACX,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,aAAc,EAChB,EACA,IAAK,CACH,cAAeL,EAAgB,IAAMC,EAAiB,EAAI,EAC1D,aAAc,EAChB,EACA,KAAM,CACJ,cAAeD,EAAgB,IAAMC,EAAiB,EAAI,IAC1D,aAAc,EAChB,EACA,KAAM,CACJ,cAAeD,EAAgB,IAAMC,EAAiB,EAAI,IAC1D,aAAc,EAChB,CACF,EACA,KAAM,CACJ,QAAS,EACX,EAEA,WAAY,CACV,OAAQ,KAAK,IAAI,YACjB,OAAQ,KAAK,IAAI,eACnB,EACA,WAAY,CACV,GAAI,KAAK,IAAI,cACb,KAAM,aACR,CAAA,CACD,CACH,CACF,CACF"}