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