1import{l as O,r}from"#entry";const d=1,_=1e6,a={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let S=0;function c(){return S=(S+1)%Number.MAX_VALUE,S.toString()}const n=new Map;function i(t){if(n.has(t))return;const s=setTimeout(()=>{n.delete(t),T({type:a.REMOVE_TOAST,toastId:t})},_);n.set(t,s)}const e=r({toasts:[]});function T(t){switch(t.type){case a.ADD_TOAST:e.value.toasts=[t.toast,...e.value.toasts].slice(0,d);break;case a.UPDATE_TOAST:e.value.toasts=e.value.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s);break;case a.DISMISS_TOAST:{const{toastId:s}=t;s?i(s):e.value.toasts.forEach(o=>{i(o.id)}),e.value.toasts=e.value.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o);break}case a.REMOVE_TOAST:t.toastId===void 0?e.value.toasts=[]:e.value.toasts=e.value.toasts.filter(s=>s.id!==t.toastId);break}}function E(){return{toasts:O(()=>e.value.toasts),toast:l,dismiss:t=>T({type:a.DISMISS_TOAST,toastId:t})}}function l(t){const s=c(),o=u=>T({type:a.UPDATE_TOAST,toast:{...u,id:s}}),A=()=>T({type:a.DISMISS_TOAST,toastId:s});return T({type:a.ADD_TOAST,toast:{...t,id:s,open:!0,duration:t.duration||3e3,onOpenChange:u=>{u||A()}}}),{id:s,dismiss:A,update:o}}export{l as t,E as u}; 2//# sourceMappingURL=B5WxzZSt.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.