import{M as S,a2 as l,P as h,a3 as b,i as D}from"./B2UyoCas.js";const w=()=>{var i;const{kapi:c}=S(),{addTimeToProcessedData:u,setCachedData:m}=l(),a=(i=h().companyDetails)==null?void 0:i.id;if(!a)throw new Error("No company ID found");const{data:n,status:p,error:d}=b(`availableSubscriptionSizes-${a}`,async()=>await c("Subscription").then(e=>e.getCompanySubscription(a)),{transform:e=>{const o=Object.entries(e.systems_new).map(([s,r])=>({id:r.id,name:s,sku:r.sku,systems_free:r.systems_free})),t=o.filter(s=>s.systems_free!==void 0&&s.systems_free>0),f=t.reduce((s,r)=>s+(r.systems_free||0),0);return u({total:o,available:t,qty:f},3e5)},getCachedData(e,o,t){if(!(t.cause==="refresh:manual"||t.cause==="refresh:hook"))return m(e)}}),y=D(()=>{var e;return((e=n.value)==null?void 0:e.qty)||0});return{data:n,status:p,projectsRemaining:y,error:d}};export{w as u};
