import{d as w,p as l,h as c,R as p,g as h,t as C}from"./common-vendor-L1U_8ehK.js";const r=h({notifications:[],showNotification:()=>{},removeNotification:()=>{}}),E=({children:f})=>{const[u,s]=w([]),a=l(0),n=c(o=>{s(i=>i.filter(t=>t.id!==o))},[]),N=c((o,i="info",t=5e3)=>{a.current+=1;const e=a.current,m={id:e,message:o,type:i,timestamp:Date.now()};s(d=>[...d,m]);const v=new CustomEvent("prorank-show-toast",{detail:{message:o,type:i,options:{duration:t}}});return window.dispatchEvent(v),t>0&&setTimeout(()=>{n(e)},t),e},[n]);return p.createElement(r.Provider,{value:{notifications:u,showNotification:N,removeNotification:n}},f)},R=()=>C(r);export{E as N,R as u};
