import{$ as e,et as t}from"./runtime-core.esm-bundler-Babufkcf.js";var n=t(0),r=t(!1),i=t(Date.now()),a=new Set;function o(e){return a.add(e),()=>a.delete(e)}async function s(){if(!r.value){r.value=!0,n.value++;for(let e of a)try{await e()}catch{}i.value=Date.now(),setTimeout(()=>{r.value=!1},400)}}function c(){return{tick:e(n),busy:e(r),lastAt:e(i),refreshNow:s,onGlobalRefresh:o}}export{c as n,s as t};