{"version":3,"file":"LightBox-BKK5bB24.js","sources":["../../ClientApp/src/js/components/LightBox.ts"],"sourcesContent":["const LightBox = () => {\r\n const lightBox = document.getElementById('js-lightbox');\r\n const closeBtn = document.getElementById('js-btn-close-lightbox');\r\n\r\n const lightBoxBtns =\r\n document.querySelectorAll('.js-lightbox-img');\r\n\r\n if (!lightBox) {\r\n console.warn(`Lightbox not found.`);\r\n return;\r\n }\r\n\r\n if (!lightBoxBtns) {\r\n console.warn('Lightbox Images not found.');\r\n return;\r\n }\r\n\r\n const lightBoxImg = lightBox.querySelector('img');\r\n\r\n if (!lightBoxImg) {\r\n console.warn('Lightbox Primary Image not found.');\r\n return;\r\n }\r\n\r\n const initLightbox = () => {\r\n lightBoxBtns.forEach(btn => {\r\n btn.addEventListener('click', () => {\r\n const _src = btn.dataset.src;\r\n if (_src) {\r\n lightBoxImg.src = _src;\r\n lightBox.classList.add('active');\r\n } \r\n });\r\n });\r\n };\r\n\r\n if (closeBtn) {\r\n // Close the lightbox when clicking the close button\r\n closeBtn.addEventListener('click', () => {\r\n lightBox.classList.remove('active');\r\n });\r\n }\r\n\r\n initLightbox();\r\n};\r\n\r\nexport default LightBox;\r\n"],"names":["LightBox","lightBox","closeBtn","lightBoxBtns","lightBoxImg","initLightbox","btn","_src"],"mappings":"AAAA,MAAMA,EAAW,IAAM,CACb,MAAAC,EAAW,SAAS,eAAe,aAAa,EAChDC,EAAW,SAAS,eAAe,uBAAuB,EAE1DC,EACF,SAAS,iBAA8B,kBAAkB,EAE7D,GAAI,CAACF,EAAU,CACX,QAAQ,KAAK,qBAAqB,EAClC,MACJ,CAEA,GAAI,CAACE,EAAc,CACf,QAAQ,KAAK,4BAA4B,EACzC,MACJ,CAEM,MAAAC,EAAcH,EAAS,cAAgC,KAAK,EAElE,GAAI,CAACG,EAAa,CACd,QAAQ,KAAK,mCAAmC,EAChD,MACJ,CAEA,MAAMC,EAAe,IAAM,CACvBF,EAAa,QAAeG,GAAA,CACpBA,EAAA,iBAAiB,QAAS,IAAM,CAC1B,MAAAC,EAAOD,EAAI,QAAQ,IACrBC,IACAH,EAAY,IAAMG,EACTN,EAAA,UAAU,IAAI,QAAQ,EACnC,CACH,CAAA,CACJ,CAAA,EAGDC,GAESA,EAAA,iBAAiB,QAAS,IAAM,CAC5BD,EAAA,UAAU,OAAO,QAAQ,CAAA,CACrC,EAGQI,GACjB"}