!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).toastify={})}(this,function(e){"use strict";class t{container;position;constructor(e,t){this.container=document.createElement("div");const s=t?`${t} `:"";this.container.className=`${s}noap-toastify-container noap-toastify-${e}`,this.position=e,document.body.appendChild(this.container)}get element(){return this.container}get containerPosition(){return this.position}}class s{static getCloseIcon(){return'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"></path></svg>'}static getToastIcon(e){return{success:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#22c55e"/><path d="M10 17l4 4 8-8" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',error:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#ef4444"/><path d="M20 12L12 20M12 12l8 8" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',info:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#3b82f6"/><path d="M16 10v2m0 4v6" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/><circle cx="16" cy="8" r="1.5" fill="#fff"/></svg>',warning:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#f59e42"/><path d="M16 10v8" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/><circle cx="16" cy="22" r="1.5" fill="#fff"/></svg>',default:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#a3a3a3"/><path d="M16 8a6 6 0 0 1 6 6v3.764c0 .414.168.812.468 1.104l1.064 1.03A2 2 0 0 1 23 23H9a2 2 0 0 1-1.532-3.102l1.064-1.03A1.5 1.5 0 0 0 9 17.764V14a6 6 0 0 1 6-6Zm0 18a3 3 0 0 0 3-3h-6a3 3 0 0 0 3 3Z" fill="#fff"/></svg>',light:'<svg aria-hidden="true" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="16" cy="16" r="16" fill="#fff"/><path d="M16 8a6 6 0 0 1 6 6v3.764c0 .414.168.812.468 1.104l1.064 1.03A2 2 0 0 1 23 23H9a2 2 0 0 1-1.532-3.102l1.064-1.03A1.5 1.5 0 0 0 9 17.764V14a6 6 0 0 1 6-6Zm0 18a3 3 0 0 0 3-3h-6a3 3 0 0 0 3 3Z" fill="#222"/></svg>'}[e]??""}}class i{static create(e,t,o,n,a,r){const{title:c,message:l,type:d}=n,u=e.element,h=e.containerPosition,f=document.createElement("div"),p=a.animationType||"fade",m=i.getAnimationSuffix(p,h);f.className=`noap-toastify-toast noap-toastify-${a.direction} noap-toastify-anim-${p}${m}`,f.classList.add(`noap-toastify-${d}`),a.tapToDismiss&&(f.classList.add("noap-toastify-tap-hover"),f.addEventListener("click",()=>{f.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(f)&&(u.removeChild(f),r())},500)}));const w=document.createElement("div");w.className="noap-toastify-wrapper";const v=document.createElement("div");v.className="noap-toastify-title",v.innerText=c;const g=document.createElement("div");g.className="noap-toastify-message",a.isHtml?g.innerHTML=l:g.innerText=l;const y=s.getToastIcon(d);if(a.showIcons&&y){const e=document.createElement("div");e.className=`noap-toastify-icon ${d}`,e.innerHTML=y,f.appendChild(e)}let T=null,x=null,b=null;const $=a.progressBarDuration?a.progressBarDuration:100,k=a.progressBarDirection||"decrease";let O="increase"===k?0:100;if(a.withProgressBar&&(T=document.createElement("div"),T.className="noap-toastify-progress-bar",T.style.width=("increase"===k?0:100)+"%",f.appendChild(T),x=window.setInterval(()=>{"increase"===k?O+=1:O-=1,T.style.width=`${O}%`,("increase"===k&&O>=100||"decrease"===k&&O<=0)&&(clearInterval(x),f.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(f)&&(u.removeChild(f),r())},500))},0===$?100:$),f.addEventListener("mouseenter",()=>{x&&(f.classList.add("noap-toastify-hovering"),clearInterval(x),x=null)}),f.addEventListener("mouseleave",()=>{f.classList.remove("noap-toastify-hovering"),x||(x=window.setInterval(()=>{"increase"===k?O+=1:O-=1,T.style.width=`${O}%`,("increase"===k&&O>=100||"decrease"===k&&O<=0)&&(clearInterval(x),f.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(f)&&(u.removeChild(f),r())},500))},0===$?100:$))})),!a.withProgressBar&&a.duration>0){const e=()=>{b=window.setTimeout(()=>{f.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(f)&&(u.removeChild(f),r())},500)},a.duration)},t=()=>{b&&(clearTimeout(b),b=null)};f.addEventListener("mouseenter",()=>{t()}),f.addEventListener("mouseleave",()=>{e()}),e()}if(c&&w.appendChild(v),w.appendChild(g),f.appendChild(w),a.closeButton){const e=document.createElement("button");e.className="noap-toastify-close",e.innerHTML=s.getCloseIcon(),e.onclick=()=>{f.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(f)&&(u.removeChild(f),r())},200)},f.appendChild(e)}if(o?u.insertBefore(f,u.firstChild):u.appendChild(f),u.children.length>t)for(const e of Array.from(u.children)){const t=e;if(!t.classList.contains("noap-toastify-hovering")){t.classList.add(`noap-toastify-anim-${p}-out${m}`),setTimeout(()=>{u.contains(t)&&u.removeChild(t)},500);break}}}static getAnimationSuffix(e,t){if("slide"!==e)return"";switch(t){case"top-left":case"bottom-left":return"-left";case"bottom-center":case"bottom-center-full":return"-bottom";case"top-center":case"top-center-full":return"-top";case"center":return"-center";default:return""}}}class o{activeToasts=0;container;maxToasts;newestOnTop;queue=[];constructor(e,t,s){this.container=e,this.maxToasts=t,this.newestOnTop=s}enqueue(e,t,s,o=Object.create(Object.prototype)){this.activeToasts<this.maxToasts?(i.create(this.container,this.maxToasts,this.newestOnTop,{title:e,message:t,type:s},o,()=>{this.activeToasts--,this.processQueue()}),this.activeToasts++):this.queue.push({title:e,message:t,type:s,options:o,create:n=>{i.create(this.container,this.maxToasts,this.newestOnTop,{title:e,message:t,type:s},o,n)}})}processQueue(){if(this.activeToasts<this.maxToasts&&this.queue.length>0){this.queue.shift().create(()=>{this.activeToasts--,this.processQueue()}),this.activeToasts++}}}e.ToastifyManager=class{options;toastifyQueue;constructor(e,{maxToasts:s,customClasses:i,newestOnTop:n,...a}=Object.create(Object.prototype)){if("undefined"==typeof document)throw new Error("document is not available. Toastify can only be used in a browser environment.");this.options={duration:3e3,isHtml:!1,withProgressBar:!1,progressBarDuration:100,closeButton:!1,showIcons:!0,direction:"ltr",animationType:"fade",tapToDismiss:!1,progressBarDirection:"decrease",...a};const r=new t(e,i);this.toastifyQueue=new o(r,s??5,n)}default(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"default",{...this.options,...s})}error(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"error",{...this.options,...s})}info(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"info",{...this.options,...s})}light(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"light",{...this.options,...s})}success(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"success",{...this.options,...s})}warning(e,t,s=Object.create(Object.prototype)){this.toastifyQueue.enqueue(e,t,"warning",{...this.options,...s})}}});