import{d as F,ae as m,e as i,o as t,q as E,m as g,h as d,i as l,bm as $,c as o,bn as q,a as r,bo as D,bp as z,bq as A,ay as J,W as L,br as O,am as Q,bs as W,bt as G,bu as X,bv as Y,f as u,g as k,u as H,ah as h,bw as K,bx as M,by as Z,bz as ee,bA as le,bB as ae,bC as se,bD as te,bE as x,a5 as ne,bl as T,bF as oe}from"./index-BOEdKJ1D.js";import{u as ue}from"./usePageTitle-BkurcLK2.js";const re={class:"flow-run-graphs__graph-panel-container"},ie={class:"flow-run-graphs__graphs"},fe={class:"flow-run-graphs__panel p-background"},pe=F({__name:"FlowRunGraphs",props:{flowRun:{}},setup(U){const v=m(),f=m(!1),e=m(null),w=i(()=>{var p,a;return{root:{"flow-run-graphs--fullscreen":f.value,"flow-run-graphs--show-panel":((p=e.value)==null?void 0:p.kind)==="task-run"||((a=e.value)==null?void 0:a.kind)==="flow-run"}}});return(p,a)=>{var b,_,c;return t(),E("div",{class:J(["flow-run-graphs",w.value.root])},[g("div",re,[g("div",ie,[d(l($),{fullscreen:f.value,"onUpdate:fullscreen":a[0]||(a[0]=s=>f.value=s),viewport:v.value,"onUpdate:viewport":a[1]||(a[1]=s=>v.value=s),selected:e.value,"onUpdate:selected":a[2]||(a[2]=s=>e.value=s),"flow-run":p.flowRun,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),g("div",fe,[((b=e.value)==null?void 0:b.kind)==="task-run"||((_=e.value)==null?void 0:_.kind)==="flow-run"?(t(),o(l(q),{key:0,selection:e.value,"onUpdate:selection":a[3]||(a[3]=s=>e.value=s),floating:f.value},null,8,["selection","floating"])):r("",!0)])]),e.value&&e.value.kind==="artifacts"?(t(),o(l(D),{key:0,selection:e.value,"onUpdate:selection":a[4]||(a[4]=s=>e.value=s)},null,8,["selection"])):r("",!0),((c=e.value)==null?void 0:c.kind)==="state"?(t(),o(l(z),{key:1,selection:e.value,"onUpdate:selection":a[5]||(a[5]=s=>e.value=s)},null,8,["selection"])):r("",!0),d(l(A),{selection:e.value,"onUpdate:selection":a[6]||(a[6]=s=>e.value=s)},null,8,["selection"])],2)}}}),ve=F({__name:"FlowRun",setup(U){const v=H(),f=L("flowRunId"),{flowRun:e,subscription:w}=O(f,{interval:5e3}),p=i(()=>{var n;return h(((n=e.value)==null?void 0:n.parameters)??{})}),a=i(()=>{var n;return(n=e.value)!=null&&n.stateType?K(e.value.stateType):!0}),b=i(()=>{var n;return h(((n=e.value)==null?void 0:n.jobVariables)??{})}),_=i(()=>[{label:"Logs"},{label:"Task Runs",hidden:a.value},{label:"Subflow Runs",hidden:a.value},{label:"Results",hidden:a.value},{label:"Artifacts",hidden:a.value},{label:"Details"},{label:"Parameters"},{label:"Job Variables"}]),c=Q("tab","Logs"),{tabs:s}=W(_,c),S=i(()=>[f.value]),{filter:j}=G({flowRuns:{parentFlowRunId:S}});function B(){v.push(T.runs())}const C=i(()=>{var n;return(n=e.value)==null?void 0:n.stateType});X(C);const I=i(()=>e.value?`Flow Run: ${e.value.name}`:"Flow Run");return ue(I),Y(()=>{w.error&&oe(w.error).isInRange("clientError")&&v.replace(T[404]())}),(n,y)=>{const R=k("p-code-highlight"),V=k("p-tabs"),N=k("p-layout-default");return t(),o(N,{class:"flow-run"},{header:u(()=>[l(e)?(t(),o(l(M),{key:0,"flow-run-id":l(e).id,onDelete:B},null,8,["flow-run-id"])):r("",!0)]),default:u(()=>[l(e)&&!a.value?(t(),o(pe,{key:0,"flow-run":l(e)},null,8,["flow-run"])):r("",!0),d(V,{selected:l(c),"onUpdate:selected":y[0]||(y[0]=P=>ne(c)?c.value=P:null),tabs:l(s)},{details:u(()=>[l(e)?(t(),o(l(Z),{key:0,"flow-run":l(e)},null,8,["flow-run"])):r("",!0)]),logs:u(()=>[l(e)?(t(),o(l(ee),{key:0,"flow-run":l(e)},null,8,["flow-run"])):r("",!0)]),results:u(()=>[l(e)?(t(),o(l(le),{key:0,"flow-run":l(e)},null,8,["flow-run"])):r("",!0)]),artifacts:u(()=>[l(e)?(t(),o(l(ae),{key:0,"flow-run":l(e)},null,8,["flow-run"])):r("",!0)]),"task-runs":u(()=>[l(e)?(t(),o(l(se),{key:0,"flow-run-id":l(e).id},null,8,["flow-run-id"])):r("",!0)]),"subflow-runs":u(()=>[d(l(te),{filter:l(j)},null,8,["filter"])]),parameters:u(()=>[l(e)?(t(),o(l(x),{key:0,"text-to-copy":p.value},{default:u(()=>[d(R,{lang:"json",text:p.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):r("",!0)]),"job-variables":u(()=>[l(e)?(t(),o(l(x),{key:0,"text-to-copy":b.value},{default:u(()=>[d(R,{lang:"json",text:b.value,class:"flow-run__job-variables"},null,8,["text"])]),_:1},8,["text-to-copy"])):r("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{ve as default};
//# sourceMappingURL=FlowRun-C9kj5uA2.js.map
