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