module.exports=[616775,a=>{"use strict";var b=a.i(254157),c=a.i(839769),d=a.i(995666),e=a.i(224504),f=a.i(175035),g=a.i(986990),h=a.i(18170),i=a.i(347421),j=a.i(778737),k=a.i(417132),l=a.i(303469),m=a.i(326647),n=a.i(247505);let o=n.EXECUTOR_ICON_MAP.local,p=[{type:"local",label:"Local",description:"Run agents directly in the repository folder."},{type:"worktree",label:"Worktree",description:"Create git worktrees for isolated agent sessions."},{type:"local_docker",label:"Docker",description:"Run Docker containers on this machine."},{type:"sprites",label:"Sprites.dev",description:"Run agents in Sprites.dev cloud sandboxes."}];function q({type:a}){let c=n.EXECUTOR_ICON_MAP[a]??o;return(0,b.jsx)("div",{className:"rounded-md bg-muted p-2",children:(0,b.jsx)(c,{className:"h-4 w-4"})})}function r({profile:a,onDelete:c}){let e=(0,d.useRouter)();return(0,b.jsx)(i.Card,{className:"group cursor-pointer transition-colors hover:bg-muted/50",onClick:()=>e.push(`/settings/executors/${a.id}`),children:(0,b.jsxs)(i.CardContent,{className:"flex items-center gap-3 p-4",children:[(0,b.jsx)(q,{type:a.executor_type}),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)("p",{className:"truncate font-medium",children:a.name})}),(0,b.jsx)(g.Badge,{variant:"outline",className:"shrink-0 text-xs",children:(0,n.getExecutorLabel)(a.executor_type)}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 cursor-pointer opacity-0 group-hover:opacity-100",onClick:b=>{b.stopPropagation(),c(a.id)},children:(0,b.jsx)(f.IconTrash,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})})}function s({execType:a,onClick:c}){return(0,b.jsx)(i.Card,{className:"cursor-pointer ring-primary/40 transition-colors hover:bg-muted/50",onClick:c,children:(0,b.jsxs)(i.CardContent,{className:"flex items-center gap-3 p-4",children:[(0,b.jsx)(q,{type:a.type}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"font-medium",children:a.label}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.description})]}),(0,b.jsx)(e.IconPlus,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})})}function t({profileName:a,open:c,onOpenChange:d,onDelete:e,deleting:f}){return(0,b.jsx)(k.Dialog,{open:c,onOpenChange:d,children:(0,b.jsxs)(k.DialogContent,{children:[(0,b.jsxs)(k.DialogHeader,{children:[(0,b.jsx)(k.DialogTitle,{children:"Delete Profile"}),(0,b.jsxs)(k.DialogDescription,{children:['Are you sure you want to delete "',a,'"? This action cannot be undone.']})]}),(0,b.jsxs)(k.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>d(!1),className:"cursor-pointer",children:"Cancel"}),(0,b.jsx)(h.Button,{variant:"destructive",onClick:e,disabled:f,className:"cursor-pointer",children:f?"Deleting...":"Delete"})]})]})})}function u(){let a,e=(0,d.useRouter)(),f=(a=(0,l.useAppStore)(a=>a.executors.items),(0,c.useMemo)(()=>a.flatMap(a=>(a.profiles??[]).map(b=>({...b,executor_type:a.type,executor_name:a.name,parent_executor_id:a.id}))),[a])),g=(0,l.useAppStore)(a=>a.executors.items),h=(0,l.useAppStore)(a=>a.setExecutors),[i,k]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1),q=i?f.find(a=>a.id===i):null,u=async()=>{if(q){o(!0);try{await (0,m.deleteExecutorProfile)(q.parent_executor_id,q.id),h(g.map(a=>a.id===q.parent_executor_id?{...a,profiles:(a.profiles??[]).filter(a=>a.id!==q.id)}:a)),k(null)}finally{o(!1)}}};return(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-2xl font-bold",children:"Executors"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Executor profiles define how and where agents run. Each profile configures an execution environment with scripts, environment variables, and MCP policies."})]}),(0,b.jsx)(j.Separator,{}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:"Create New Profile"}),(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map(a=>(0,b.jsx)(s,{execType:a,onClick:()=>e.push(`/settings/executors/new/${a.type}`)},a.type))})]}),f.length>0&&(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:"Profiles"}),(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:f.map(a=>(0,b.jsx)(r,{profile:a,onDelete:k},a.id))})]}),(0,b.jsx)(t,{profileName:q?.name,open:!!i,onOpenChange:()=>k(null),onDelete:u,deleting:n})]})}a.s(["default",()=>u])}];

//# sourceMappingURL=web_app_settings_executors_page_tsx_6046d1b2._.js.map