import{d as A,u as N,c as n,a as P,U as V,V as B,e as E,r as p,o as l,f as a,w as o,g as e,W as T,h as f,X as w,k as _,Y as U,Z as W,$ as z,a0 as I,B as O,t as X,C as Y}from"./index.c3b9a55d.js";import{u as Z}from"./useRouteParam.b592fab0.js";import{u as d}from"./useSubscriptionWithDependencies.3dc092ce.js";const j=z(" No runs from the last 7 days "),K=A({__name:"Flow",setup(q){const r=Z("id"),y=N(),b=n(()=>{const s=["Deployments","Runs"];return Y.xl||s.unshift("Details"),s}),v={interval:3e5},R=P(V.getFlow,[r.value],v),t=n(()=>R.response),F=B({flows:[r.value]}),c=n(()=>r.value?[F.value]:null),i=d(I.getDeployments,c),h=n(()=>{var s;return(s=i.response)!=null?s:[]}),g=d(O.getFlowRuns,c),m=n(()=>{var s;return(s=g.response)!=null?s:[]});function k(){y.push(X.flows())}const D=n(()=>t.value?`Flow: ${t.value.name}`:"Flow");return E(D),(s,u)=>{const $=p("PEmptyResults"),x=p("p-tabs"),C=p("p-layout-well");return l(),a(C,{class:"flow"},{header:o(()=>[e(t)?(l(),a(e(T),{key:0,flow:e(t),onDelete:k},null,8,["flow"])):f("",!0)]),well:o(()=>[e(t)?(l(),a(e(w),{key:0,flow:e(t)},null,8,["flow"])):f("",!0)]),default:o(()=>[_(x,{tabs:e(b)},{details:o(()=>[e(t)?(l(),a(e(w),{key:0,flow:e(t)},null,8,["flow"])):f("",!0)]),deployments:o(()=>[_(e(U),{deployments:e(h),onUpdate:u[0]||(u[0]=S=>e(i).refresh()),onDelete:u[1]||(u[1]=S=>e(i).refresh())},null,8,["deployments"])]),runs:o(()=>[e(m).length?(l(),a(e(W),{key:0,"flow-runs":e(m),disabled:"",selected:[]},null,8,["flow-runs"])):(l(),a($,{key:1},{message:o(()=>[j]),_:1}))]),_:1},8,["tabs"])]),_:1})}}});export{K as default};
