import{d as T,ae as g,b as f,o,p as A,k,g as v,h as e,aY as $,c as u,aZ as L,a as i,a_ as W,a$ as z,b0 as G,b1 as J,b2 as K,W as Q,b3 as X,b4 as Y,am as Z,b5 as q,b6 as M,b7 as ee,b8 as le,e as r,f as y,u as ae,b9 as se,ah as te,ba as ne,bb as oe,bc as ue,bd as re,be as ie,bf as fe,bg as ce,bh as de,bi as I,a5 as pe,aX as F,bj as ve}from"./index-BjFilUfY.js";import{u as we}from"./usePageTitle-J4-vayug.js";const be={class:"flow-run-graphs__graph-panel-container"},_e={class:"flow-run-graphs__graphs"},me={class:"flow-run-graphs__panel p-background"},ge=T({__name:"FlowRunGraphs",props:{flowRun:{}},setup(U){const b=g(),d=g(!1),a=g(null),l=f(()=>{var p,s;return{root:{"flow-run-graphs--fullscreen":d.value,"flow-run-graphs--show-panel":((p=a.value)==null?void 0:p.kind)==="task-run"||((s=a.value)==null?void 0:s.kind)==="flow-run"}}});return(p,s)=>{var _,c,w;return o(),A("div",{class:J(["flow-run-graphs",l.value.root])},[k("div",be,[k("div",_e,[v(e($),{fullscreen:d.value,"onUpdate:fullscreen":s[0]||(s[0]=n=>d.value=n),viewport:b.value,"onUpdate:viewport":s[1]||(s[1]=n=>b.value=n),selected:a.value,"onUpdate:selected":s[2]||(s[2]=n=>a.value=n),"flow-run":p.flowRun,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),k("div",me,[((_=a.value)==null?void 0:_.kind)==="task-run"||((c=a.value)==null?void 0:c.kind)==="flow-run"?(o(),u(e(L),{key:0,selection:a.value,"onUpdate:selection":s[3]||(s[3]=n=>a.value=n),floating:d.value},null,8,["selection","floating"])):i("",!0)])]),a.value&&a.value.kind==="artifacts"?(o(),u(e(W),{key:0,selection:a.value,"onUpdate:selection":s[4]||(s[4]=n=>a.value=n)},null,8,["selection"])):i("",!0),((w=a.value)==null?void 0:w.kind)==="state"?(o(),u(e(z),{key:1,selection:a.value,"onUpdate:selection":s[5]||(s[5]=n=>a.value=n)},null,8,["selection"])):i("",!0),v(e(G),{selection:a.value,"onUpdate:selection":s[6]||(s[6]=n=>a.value=n)},null,8,["selection"])],2)}}}),Re=T({__name:"FlowRun",setup(U){const b=K(),d=ae(),a=Q("flowRunId"),{flowRun:l,subscription:p}=X(a,{interval:5e3}),s=f(()=>{var t;return(t=l.value)==null?void 0:t.deploymentId}),{deployment:_}=Y(s),c=f(()=>{var t;return(t=l.value)!=null&&t.stateType?se(l.value.stateType):!0}),w=f(()=>{var t;return te(((t=l.value)==null?void 0:t.jobVariables)??{})}),n=f(()=>[{label:"Logs"},{label:"Task Runs",hidden:c.value},{label:"Subflow Runs",hidden:c.value},{label:"Results",hidden:c.value},{label:"Artifacts",hidden:c.value},{label:"Details"},{label:"Parameters"},{label:"Job Variables",hidden:!b.access.flowRunInfraOverrides}]),m=Z("tab","Logs"),{tabs:j}=q(n,m),C=f(()=>{var t;return((t=l.value)==null?void 0:t.parameters)??{}}),B=f(()=>{var t;return((t=_.value)==null?void 0:t.parameterOpenApiSchema)??{}}),R=f(()=>ne(C.value,B.value)),S=f(()=>[a.value]),{filter:V}=M({flowRuns:{parentFlowRunId:S}});function D(){d.push(F.flowRuns())}const E=f(()=>{var t;return(t=l.value)==null?void 0:t.stateType});ee(E);const P=f(()=>l.value?`Flow Run: ${l.value.name}`:"Flow Run");return we(P),le(()=>{p.error&&ve(p.error).isInRange("clientError")&&d.replace(F[404]())}),(t,h)=>{const x=y("p-code-highlight"),H=y("p-tabs"),N=y("p-layout-default");return o(),u(N,{class:"flow-run"},{header:r(()=>[e(l)?(o(),u(e(oe),{key:0,"flow-run-id":e(l).id,onDelete:D},null,8,["flow-run-id"])):i("",!0)]),default:r(()=>[e(l)&&!c.value?(o(),u(ge,{key:0,"flow-run":e(l)},null,8,["flow-run"])):i("",!0),v(H,{selected:e(m),"onUpdate:selected":h[0]||(h[0]=O=>pe(m)?m.value=O:null),tabs:e(j)},{details:r(()=>[e(l)?(o(),u(e(ue),{key:0,"flow-run":e(l)},null,8,["flow-run"])):i("",!0)]),logs:r(()=>[e(l)?(o(),u(e(re),{key:0,"flow-run":e(l)},null,8,["flow-run"])):i("",!0)]),results:r(()=>[e(l)?(o(),u(e(ie),{key:0,"flow-run":e(l)},null,8,["flow-run"])):i("",!0)]),artifacts:r(()=>[e(l)?(o(),u(e(fe),{key:0,"flow-run":e(l)},null,8,["flow-run"])):i("",!0)]),"task-runs":r(()=>[e(l)?(o(),u(e(ce),{key:0,"flow-run-id":e(l).id},null,8,["flow-run-id"])):i("",!0)]),"subflow-runs":r(()=>[v(e(de),{filter:e(V)},null,8,["filter"])]),parameters:r(()=>[e(l)?(o(),u(e(I),{key:0,"text-to-copy":R.value},{default:r(()=>[v(x,{lang:"json",text:R.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):i("",!0)]),"job-variables":r(()=>[e(l)?(o(),u(e(I),{key:0,"text-to-copy":w.value},{default:r(()=>[v(x,{lang:"json",text:w.value,class:"flow-run__job-variables"},null,8,["text"])]),_:1},8,["text-to-copy"])):i("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{Re as default};
//# sourceMappingURL=FlowRun-CtFkjWkP.js.map
