import{a as I}from"./chunk-PWF76NCM.js";import{a as E}from"./chunk-7PK6Q4UU.js";import{A as _,C as f,E as g,F as b,G as k,H as n,I as t,K as v,L as u,M as d,N as i,O as l,R as C,da as h,fa as D,ja as S,k as m,la as y,m as c,n as x,t as r,w}from"./chunk-O7TQGEFF.js";var T=(a,o)=>o.id;function N(a,o){if(a&1&&(n(0,"div",9)(1,"span",11),i(2),t(),n(3,"span")(4,"span",12),i(5),t()(),n(6,"span",13),i(7),t(),n(8,"span",14),i(9),t()()),a&2){let e=o.$implicit,s=d(2);r(2),l(e.id),r(2),f("ngClass",s.typeBadge(e.type)),r(),l(e.type),r(2),l(e.dependsOn.length?e.dependsOn.join(", "):"\u2014"),r(2),l(e.when||"\u2014")}}function V(a,o){if(a&1){let e=v();n(0,"div",0)(1,"div",1)(2,"div")(3,"h1",2),i(4),t(),n(5,"p",3),i(6),t(),n(7,"p",4),i(8),t()(),n(9,"button",5),u("click",function(){c(e);let p=d();return x(p.showRunDialog=!0)}),i(10,"Run Workflow \u25B6"),t()(),n(11,"div",6)(12,"h3",7),i(13,"DAG Nodes"),t(),n(14,"div",8)(15,"span"),i(16,"Node"),t(),n(17,"span"),i(18,"Type"),t(),n(19,"span"),i(20,"Depends On"),t(),n(21,"span"),i(22,"Condition"),t()(),b(23,N,10,5,"div",9,T),t()(),n(25,"app-run-dialog",10),u("run",function(p){c(e);let W=d();return x(W.onStartRun(p))})("closed",function(){c(e);let p=d();return x(p.showRunDialog=!1)}),t()}if(a&2){let e=d();r(4),l(e.workflow.name),r(2),C(" ",e.workflow.nodeCount," nodes \u2022 provider: ",e.workflow.defaultProvider," \u2022 model: ",e.workflow.defaultModel," "),r(2),l(e.workflow.description),r(15),k(e.workflow.nodes),r(2),f("visible",e.showRunDialog)("workflowName",e.workflow.name)}}var R=class a{route=m(S);api=m(E);router=m(y);workflow;showRunDialog=!1;ngOnInit(){let o=this.route.snapshot.paramMap.get("name");this.api.getWorkflow(o).subscribe(e=>this.workflow=e)}onStartRun(o){this.showRunDialog=!1,this.api.startRun(this.workflow.name,o).subscribe(e=>{this.router.navigate(["/runs",e.runId])})}typeBadge(o){switch(o){case"prompt":return"bg-purple-500/10 text-purple-400";case"bash":return"bg-amber-500/10 text-amber-400";case"command":return"bg-cyan-500/10 text-cyan-400";default:return"bg-slate-700 text-slate-400"}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=w({type:a,selectors:[["app-workflow-detail"]],decls:1,vars:1,consts:[[1,"max-w-4xl","mx-auto"],[1,"flex","items-start","mb-6"],[1,"text-2xl","font-bold","text-slate-100"],[1,"text-sm","text-slate-500","mt-1"],[1,"text-sm","text-slate-400","mt-2"],[1,"ml-auto","bg-blue-600","text-white","px-5","py-2","rounded-lg","hover:bg-blue-500","text-sm",3,"click"],[1,"bg-slate-800","rounded-lg","border","border-slate-700","p-4"],[1,"text-xs","font-semibold","text-slate-500","uppercase","tracking-wider","mb-3"],[1,"grid","grid-cols-[1.5fr_0.8fr_2fr_1.5fr]","text-xs","text-slate-500","pb-2","border-b","border-slate-700"],[1,"grid","grid-cols-[1.5fr_0.8fr_2fr_1.5fr]","py-2","text-sm","border-b","border-slate-800/50","items-center"],[3,"run","closed","visible","workflowName"],[1,"text-slate-100"],[1,"text-xs","px-1.5","py-0.5","rounded",3,"ngClass"],[1,"font-mono","text-xs","text-slate-400"],[1,"font-mono","text-xs","text-amber-400"]],template:function(e,s){e&1&&_(0,V,26,7),e&2&&g(s.workflow?0:-1)},dependencies:[D,h,I],encapsulation:2})};export{R as WorkflowDetailComponent};
