import{d as j,T as B,M as F,a as J,c as n,j as L,R as M,ah as z,av as f,ak as G,b as r,e as c,w as a,f as i,o as p,h as u,u as e,aw as H,ax as R,H as O,p as g,ay as P,t as Q,n as U,az as Y,aA as Z,at as $,s as q,ab as E}from"./index-562c8470.js";import{u as K}from"./usePageTitle-ad3dbf10.js";const at=j({__name:"TaskRun",setup(W){const m=B(),k=F("taskRunId"),d=J(),b=n(()=>[{label:"Details",hidden:L.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=M("tab","Logs"),{tabs:w}=z(b,l),y=n(()=>k.value?[k.value]:null),T=f(d.taskRuns.getTaskRun,y,{interval:3e4}),t=n(()=>T.response),o=n(()=>{var s;return(s=t.value)==null?void 0:s.flowRunId}),h=n(()=>o.value?[o.value]:null),x=f(d.flowRuns.getFlowRun,h),_=n(()=>{var s;return(s=t.value)!=null&&s.taskInputs?JSON.stringify(t.value.taskInputs,void 0,2):"{}"});function I(){x.refresh(),m.push(E.flowRun(o.value))}const C=n(()=>{var s;return(s=t.value)==null?void 0:s.stateType});G(C);const D=n(()=>t.value?`Task Run: ${t.value.name}`:"Task Run");return K(D),(s,v)=>{const N=r("p-code-highlight"),S=r("p-tabs"),A=r("p-layout-well");return t.value?(p(),c(A,{key:0,class:"task-run"},{header:a(()=>[u(e(H),{"task-run-id":t.value.id,onDelete:I},null,8,["task-run-id"])]),well:a(()=>[u(e(R),{alternate:"","task-run":t.value},null,8,["task-run"])]),default:a(()=>[u(S,{selected:e(l),"onUpdate:selected":v[0]||(v[0]=V=>q(l)?l.value=V:null),tabs:e(w)},O({details:a(()=>[u(e(R),{"task-run":t.value},null,8,["task-run"])]),logs:a(()=>[u(e(Y),{"task-run":t.value},null,8,["task-run"])]),artifacts:a(()=>[t.value?(p(),c(e(Z),{key:0,"task-run":t.value},null,8,["task-run"])):i("",!0)]),"task-inputs":a(()=>[t.value?(p(),c(e($),{key:0,"text-to-copy":_.value},{default:a(()=>[u(N,{lang:"json",text:_.value,class:"task-run__inputs"},null,8,["text"])]),_:1},8,["text-to-copy"])):i("",!0)]),_:2},[t.value?{name:"task-inputs-heading",fn:a(()=>[g(" Task inputs "),u(e(P),{title:"Task Inputs"},{default:a(()=>[g(Q(e(U).info.taskInput),1)]),_:1})]),key:"0"}:void 0]),1032,["selected","tabs"])]),_:1})):i("",!0)}}});export{at as default};
