import{d as y,h as m,g as o,o as u,m as L,J as R,n as d,u as a,ag as V,ah as q,ai as z,U as D,M,aj as $,ak as G,al as H,I as J,am as O,an as K,ao as Q,ap as W,aq as X,c as r,j as n,l as _,a2 as Y,ar as Z,a as f,as as ee,at as ae,au as le,av as se,aw as te,ax as ne,ay as oe,A as ue,af as h,az as re}from"./index-bJiZR03d.js";import{u as fe}from"./usePageTitle-wT6f1BZv.js";const pe={class:"flow-run-graphs__graphs"},ce={class:"flow-run-graphs__panel p-background"},de=y({__name:"FlowRunGraphs",props:{flowRun:{}},setup(k){const c=m(),p=m(!1),e=m(null),i=o(()=>({root:{"flow-run-graphs--fullscreen":p.value,"flow-run-graphs--show-panel":!!e.value}}));return(v,t)=>(u(),L("div",{class:z(["flow-run-graphs",i.value.root])},[R("div",pe,[d(a(V),{fullscreen:p.value,"onUpdate:fullscreen":t[0]||(t[0]=s=>p.value=s),viewport:c.value,"onUpdate:viewport":t[1]||(t[1]=s=>c.value=s),selected:e.value,"onUpdate:selected":t[2]||(t[2]=s=>e.value=s),"flow-run":v.flowRun,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),R("div",ce,[d(a(q),{node:e.value,"onUpdate:node":t[3]||(t[3]=s=>e.value=s),floating:p.value},null,8,["node","floating"])])],2))}}),ve=y({__name:"FlowRun",setup(k){const c=Y(),p=D("flowRunId");M();const{flowRun:e,subscription:i}=$(p,{interval:5e3}),v=o(()=>{var l;return(l=e.value)==null?void 0:l.deploymentId}),{deployment:t}=G(v),s=o(()=>{var l;return(l=e.value)!=null&&l.stateType?H(e.value.stateType):!0}),x=o(()=>[{label:"Logs"},{label:"Task Runs",hidden:s.value},{label:"Subflow Runs",hidden:s.value},{label:"Results",hidden:s.value},{label:"Artifacts",hidden:s.value},{label:"Details"},{label:"Parameters"}]),w=J("tab","Logs"),{tabs:T}=O(x,w),I=o(()=>{var l;return((l=e.value)==null?void 0:l.parameters)??{}}),F=o(()=>{var l;return((l=t.value)==null?void 0:l.parameterOpenApiSchema)??{}}),b=o(()=>K(I.value,F.value)),S=o(()=>[p.value]),{filter:U}=Q({flowRuns:{parentFlowRunId:S}});function A(){c.push(h.flowRuns())}const B=o(()=>{var l;return(l=e.value)==null?void 0:l.stateType});W(B);const C=o(()=>e.value?`Flow Run: ${e.value.name}`:"Flow Run");return fe(C),X(()=>{i.error&&re(i.error).isInRange("clientError")&&c.replace(h[404]())}),(l,g)=>{const j=_("p-code-highlight"),E=_("p-tabs"),N=_("p-layout-default");return u(),r(N,{class:"flow-run"},{header:n(()=>[a(e)?(u(),r(a(Z),{key:0,"flow-run-id":a(e).id,onDelete:A},null,8,["flow-run-id"])):f("",!0)]),default:n(()=>[a(e)&&!s.value?(u(),r(de,{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0),d(E,{selected:a(w),"onUpdate:selected":g[0]||(g[0]=P=>ue(w)?w.value=P:null),tabs:a(T)},{details:n(()=>[a(e)?(u(),r(a(ee),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),logs:n(()=>[a(e)?(u(),r(a(ae),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),results:n(()=>[a(e)?(u(),r(a(le),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),artifacts:n(()=>[a(e)?(u(),r(a(se),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),"task-runs":n(()=>[a(e)?(u(),r(a(te),{key:0,"flow-run-id":a(e).id},null,8,["flow-run-id"])):f("",!0)]),"subflow-runs":n(()=>[d(a(ne),{filter:a(U)},null,8,["filter"])]),parameters:n(()=>[a(e)?(u(),r(a(oe),{key:0,"text-to-copy":b.value},{default:n(()=>[d(j,{lang:"json",text:b.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):f("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{ve as default};
