{"version":3,"file":"toastNotification-BSqQT20C.js","sources":["../../src/scripts/helpers/toastNotification.ts"],"sourcesContent":["import toastTemplate from '../../html/components/toast-notification.hbs';\nimport ToastNotification from '../modules/toastNotification';\nimport loaderTemplate from '../../html/components/loader.hbs';\n\nexport const ExecuteToastNotification = (\n data: { [key: string]: unknown },\n button?: HTMLButtonElement\n) => {\n const oldToast = document.querySelector('.toast-notification') as HTMLElement;\n const svgLoader = loaderTemplate({}, { viewMode: 'docs' });\n\n if (oldToast) {\n oldToast.remove();\n }\n\n button?.insertAdjacentHTML('beforeend', svgLoader);\n\n const compiledToast = toastTemplate(\n {\n success: data.success,\n title: data.title,\n message: data.message\n },\n { viewMode: 'docs' }\n );\n\n document.body.insertAdjacentHTML('beforeend', compiledToast);\n\n if (compiledToast) {\n const toast = document.querySelector('.toast-notification') as HTMLElement;\n new ToastNotification(toast);\n }\n};\n"],"names":["ExecuteToastNotification","data","button","oldToast","svgLoader","loaderTemplate","compiledToast","toastTemplate","toast","ToastNotification"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;oGAIa,MAAAA,EAA2B,CACtCC,EACAC,IACG,CACG,MAAAC,EAAW,SAAS,cAAc,qBAAqB,EACvDC,EAAYC,EAAe,CAAA,EAAI,CAAE,SAAU,OAAQ,EAErDF,GACFA,EAAS,OAAO,EAGVD,GAAA,MAAAA,EAAA,mBAAmB,YAAaE,GAExC,MAAME,EAAgBC,EACpB,CACE,QAASN,EAAK,QACd,MAAOA,EAAK,MACZ,QAASA,EAAK,OAChB,EACA,CAAE,SAAU,MAAO,CACrB,EAIA,GAFS,SAAA,KAAK,mBAAmB,YAAaK,CAAa,EAEvDA,EAAe,CACX,MAAAE,EAAQ,SAAS,cAAc,qBAAqB,EAC1D,IAAIC,EAAkBD,CAAK,CAAA,CAE/B"}