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