{ "version": 3, "sources": ["../../assets/scripts/store/features/photoswipe/events.ts"], "sourcesContent": ["export function initializePhotoswipe() {\r\n const galleries = document.querySelectorAll('[data-action=\"photoswipe\"]');\r\n if (galleries.length < 1) return;\r\n\r\n import('photoswipe/lightbox')\r\n .then(({ default: PhotoSwipeLightbox }) => {\r\n galleries.forEach(element => {\r\n const lightbox = new PhotoSwipeLightbox({\r\n gallery: element,\r\n children: 'a',\r\n pswpModule: () => import('photoswipe'),\r\n });\r\n\r\n // Pridame gulicky na zobrazenie kde sa nachadzame\r\n lightbox.on('uiRegister', () => {\r\n lightbox.pswp.ui.registerElement({\r\n name: 'bulletsIndicator',\r\n className: 'pswp__bullets-indicator',\r\n appendTo: 'wrapper',\r\n onInit: (el: HTMLElement, pswp: any) => {\r\n const bullets: HTMLElement[] = [];\r\n let bullet;\r\n let prevIndex = -1;\r\n\r\n for (let i = 0; i < pswp.getNumItems(); i++) {\r\n bullet = document.createElement('div');\r\n bullet.className = 'pswp__bullet';\r\n bullet.onclick = e => {\r\n pswp.goTo(bullets.indexOf(e.target as HTMLElement));\r\n };\r\n el.appendChild(bullet);\r\n bullets.push(bullet);\r\n }\r\n\r\n pswp.on('change', () => {\r\n if (prevIndex >= 0) {\r\n bullets[prevIndex].classList.remove('pswp__bullet--active');\r\n }\r\n bullets[pswp.currIndex].classList.add('pswp__bullet--active');\r\n prevIndex = pswp.currIndex;\r\n });\r\n },\r\n });\r\n });\r\n\r\n lightbox.init();\r\n });\r\n\r\n const singles = document.querySelectorAll('[data-action=\"photoswipe-single\"]');\r\n singles.forEach(element => {\r\n const lightbox = new PhotoSwipeLightbox({\r\n gallery: element,\r\n pswpModule: () => import('photoswipe'),\r\n });\r\n\r\n lightbox.init();\r\n });\r\n })\r\n .catch(err => console.log(err));\r\n}\r\n"], "mappings": ";;;AAAO,SAAS,uBAAuB;AACrC,QAAM,YAAY,SAAS,iBAA8B,4BAA4B;AACrF,MAAI,UAAU,SAAS,EAAG;AAE1B,SAAO,uC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