import{En as e,Fi as t,Tn as n,Wi as r,mi as i,zi as a}from"./CzLxtfx3.js";var o=r(!1),s=r(0),c=i(()=>s.value>0),l=!1,u=null,d=null;async function f(){let{hasAgent:t,hasFeature:r}=n();if(!t.value||!r(`profiles`)){s.value=0,o.value=!0;return}try{s.value=(await e().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:e}=n();if(e.value){f();return}d=a(!0),d.run(()=>{u=t(e,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};