import{q as o}from"./@tanstack-CSxjHCME.js";import{o as n,s as i,F as c,p as u}from"./index-D2iSHVZq.js";async function l({workspaceId:e}){const a=n(u.workspaces.detail(e)),t=await fetch(a,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json"}});if(t.status===404&&i(),!t.ok){const r=await t.json().then(s=>Array.isArray(s.detail)?s.detail[1]:s.detail).catch(()=>`Error while fetching workspace ${e}`);throw new c({status:t.status,statusText:t.statusText,message:r})}return t.json()}const p={all:["workspaces"],workspaceDetail:e=>o({queryKey:[...p.all,e],queryFn:async()=>l({workspaceId:e})})};export{p as w};
