{"version":3,"file":"modal.js","sources":["../../../../../Flow.Showcase.Static.Bundler/Root/entrypoints/modal.ts"],"sourcesContent":["// @ts-nocheck\n\nconst modals = document.querySelectorAll('.modal');\nconst modalIds = [...modals].map(m => m.id);\n\n/* Закрытие модалки по \"Esc\" */\ndocument.addEventListener('keydown', function (event) {\n if (event.key === 'Escape') {\n closeModal();\n }\n});\n\n/* Закрытие модалки по Бэкдропу */\nmodals.forEach((modal) => {\n modal.addEventListener('click', function (event) {\n if (event.target === modal) {\n closeModal();\n }\n });\n});\n\nfunction closeModal() {\n window.location.hash = `#modal-closed`;\n}\n\nwindow.addEventListener(\"hashchange\", () => {\n let newHash = location.hash.slice(1);\n if (modalIds.includes(newHash)) {\n document.body.style.overflow = \"hidden\";\n } else {\n document.body.style.overflow = \"initial\";\n }\n });"],"names":["modals","modalIds","m","event","closeModal","modal","newHash"],"mappings":"AAEA,MAAMA,EAAS,SAAS,iBAAiB,QAAQ,EAC3CC,EAAW,CAAC,GAAGD,CAAM,EAAE,IAAIE,GAAKA,EAAE,EAAE,EAG1C,SAAS,iBAAiB,UAAW,SAAUC,EAAO,CAC9CA,EAAM,MAAQ,UACHC,EAAA,CAEnB,CAAC,EAGDJ,EAAO,QAASK,GAAU,CAChBA,EAAA,iBAAiB,QAAS,SAAUF,EAAO,CACzCA,EAAM,SAAWE,GACND,EAAA,CACf,CACH,CACL,CAAC,EAED,SAASA,GAAa,CAClB,OAAO,SAAS,KAAO,eAC3B,CAEA,OAAO,iBAAiB,aAAc,IAAM,CACxC,IAAIE,EAAU,SAAS,KAAK,MAAM,CAAC,EAC/BL,EAAS,SAASK,CAAO,EAClB,SAAA,KAAK,MAAM,SAAW,SAEtB,SAAA,KAAK,MAAM,SAAW,SAEnC,CAAC"}