import{Hr as e,Rr as t,Yr as n,hr as r}from"./KXnyWfWg.js";import{b as i,x as a}from"./BPCoDq-Y.js";var o=n(!1),s=n(0),c=r(()=>s.value>0),l=!1,u=null,d=null;async function f(){let{hasAgent:e,hasFeature:t}=i();if(!e.value||!t(`profiles`)){s.value=0,o.value=!0;return}try{s.value=(await a().listProfiles()).filter(e=>e.type!==`merge`&&e.type!==`script`).length}catch{s.value=0}finally{o.value=!0}}function p(){if(l)return;l=!0;let{ready:n}=i();if(n.value){f();return}d=e(!0),d.run(()=>{u=t(n,e=>{e&&(u?.(),u=null,d?.stop(),d=null,f())})})}function m(){return p(),{ready:o,hasBaseProfile:c,baseProfileCount:s,refresh:f}}export{m as t};