import { html } from "sigpro"; let container = null; export const toast = (msg, type = "alert-success", ms = 3500) => { if (!container || !container.isConnected) { container = document.createElement("div"); container.className = "fixed top-0 right-0 z-9999 p-6 flex flex-col gap-4 pointer-events-none items-end"; document.body.appendChild(container); } const close = (n) => { if (!n || n._c) return; n._c = 1; Object.assign(n.style, { transform: "translateX(100%)", opacity: 0 }); setTimeout(() => { Object.assign(n.style, { maxHeight: "0px", marginBottom: "-1rem", marginTop: "0px", padding: "0px" }); }, 100); n.addEventListener("transitionend", (e) => { if (["max-height", "opacity"].includes(e.propertyName)) { n.remove(); if (!container.hasChildNodes()) (container.remove(), (container = null)); } }); }; const el = html`