import{cR as d,cS as h,u as l,G as i,z as c,q as r}from"./index-BGoV7aa6.js";import{d as p}from"./images-CvhzZeaL.js";import{f as g,b as S,d as q}from"./storage-volumes-BT7spW4Z.js";const F=async(s,e,o)=>{const a=[];return(await y(s,e,o)).forEach(t=>{if(t.content_type==="iso"){const u=p(t);a.push(u)}}),a},y=async(s,e,o)=>e?g(s,o):w(s,o),w=async(s,e)=>{const o=[],a=await d(e);return(await Promise.allSettled(a.map(async t=>S(t.name,s,e)))).forEach((t,u)=>{if(t.status==="fulfilled"){const m=a[u],V=t.value.map(f=>({...f,pool:m.name}));o.push(...V)}else throw new Error("Failed to load iso images")}),o},A=async(s,e,o)=>{const a=[];return(await y(s,e,o)).forEach(t=>{const m=["filesystem","block"].includes(t.content_type);t.type==="custom"&&m&&!h(t)&&a.push(t)}),a},I=s=>{const{isFineGrained:e}=l(),{hasStorageVolumesAll:o}=i();return c({queryKey:[r.volumes,s],queryFn:async()=>y(s,o,e)})},b=s=>{const{isFineGrained:e}=l(),{hasStorageVolumesAll:o}=i();return c({queryKey:[r.isoVolumes,s],queryFn:async()=>F(s,o,e)})},G=(s,e)=>{const{isFineGrained:o}=l(),{hasStorageVolumesAll:a}=i();return c({queryKey:[r.customVolumes,s],queryFn:async()=>A(s,a,o),...e})},L=(s,e,o,a,n)=>{const{isFineGrained:t}=l();return c({queryKey:[r.storage,s,e,o,a,n],queryFn:async()=>q(s,e,o,a,n??null,t)})};export{G as a,I as b,L as c,b as u};
