(()=>{return(t,e)=>{class s{constructor(t="",e="",s="default"){this.type=s;this.message=t;this.title=e;this.duration=3e3;this.element=$(this.cardHtml)[0];document.querySelector(".toast-card-container").insertAdjacentElement("beforeend",this.element)}show(){this.element.classList.add("visible");this.element.querySelector(".toast-card-dismiss").addEventListener("click",()=>this.dismiss());if(this.duration){setTimeout(()=>this.dismiss(),this.duration)}}dismiss(){if(this.element.classList.contains("visible")){this.element.addEventListener("transitionend",()=>this.element.remove());this.element.classList.remove("visible")}}get cardHtml(){return`\n
\n
\n

${this.title}

\n
\n \n \n \n
\n
\n
${this.message}
\n
\n `}static get container(){return document.querySelector(".toast-card-container")}static createToastContainer(){if(!document.querySelector(".toast-card-container")){document.body.insertAdjacentHTML("beforeend",`
`)}}static internalShow(t,e,i,n){const a=new s(t,e,n);a.duration=i;a.show();return a}static show(t,e,s){return this.internalShow(t,e,s,"default")}static info(t,e,s){return this.internalShow(t,e,s,"info")}static success(t,e,s){return this.internalShow(t,e,s,"success")}static error(t,e,s){return this.internalShow(t,e,s,"error")}}e.applyStyle("toastStyle");s.createToastContainer();return{export:s}}})();