import{r as o,j as n}from"./@radix-DP6vWzyx.js";import{Q as i,F as d,l as u,m}from"./index-QQb7wQEC.js";import{b as l}from"./@tanstack-BUCbhJyH.js";const p=o.forwardRef(({className:e,...a},t)=>n.jsx("label",{ref:t,...a,className:i("flex w-full items-center gap-2 space-x-2 rounded-md border border-theme-border-moderate p-4 font-semibold transition-shadow duration-150 hover:cursor-pointer hover:shadow-sm data-[state=selected]:border-theme-surface-strong",e)}));p.displayName="RadioItemLabel";const f=o.forwardRef(({className:e,type:a,...t},r)=>n.jsx("input",{type:"radio",ref:r,...t,className:i("h-3 w-3 border !border-theme-border-bold text-theme-surface-primary focus:ring-2 focus:ring-theme-surface-strong",e)}));f.displayName="RadioItem";async function h({workspaceId:e,payload:a}){const t=u(m.workspaces.stacks(e)),r=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!r.ok){const c=await r.json().then(s=>Array.isArray(s.detail)?s.detail[1]:s.detail).catch(()=>"Error while creating new stack");throw new d({status:r.status,statusText:r.statusText,message:c})}return r.json()}function x(e){return l({...e,mutationFn:async({workspaceId:a,payload:t})=>h({workspaceId:a,payload:t})})}export{p as R,f as a,x as u};
