import{d as h,V as b,g as i,o as s,c as m,f as o,h as t,m as l,i as e,y as A,n as v,T as N,x as U,q as d,a as C,k as P,z as $,v as z,F as k,_ as E,t as F,e as y,A as S,B as j,C as q,j as w,D as I,E as L}from"./index-BOEdKJ1D.js";import{u as x}from"./usePageTitle-BkurcLK2.js";import{u as G}from"./usePrefectApi-aFITTZzH.js";const H={class:"automation-card__header"},J={class:"automation-card__header-actions"},K={key:0,class:"automation-card__description"},M=l("span",{class:"automation-card__label"},"Trigger",-1),Q={class:"automation-card__label"},R=h({__name:"AutomationCard",props:{automation:{}},emits:["update"],setup(V,{emit:_}){const c=_,p=b();return(a,n)=>{const f=i("p-link"),u=i("p-content"),g=i("p-card");return s(),m(g,{class:"automation-card"},{default:o(()=>[t(u,null,{default:o(()=>[t(u,{secondary:""},{default:o(()=>[l("div",H,[t(f,{class:"automation-card__name",to:e(p).automation(a.automation.id)},{default:o(()=>[A(v(a.automation.name),1)]),_:1},8,["to"]),l("div",J,[t(e(N),{automation:a.automation,onUpdate:n[0]||(n[0]=r=>c("update"))},null,8,["automation"]),t(e(U),{automation:a.automation,onDelete:n[1]||(n[1]=r=>c("update"))},null,8,["automation"])])]),a.automation.description?(s(),d("p",K,v(a.automation.description),1)):C("",!0)]),_:1}),t(u,{secondary:""},{default:o(()=>[M,t(e(P),{trigger:a.automation.trigger},null,8,["trigger"])]),_:1}),t(u,{secondary:""},{default:o(()=>[l("span",Q,v(e($)("Action",a.automation.actions.length)),1),(s(!0),d(k,null,z(a.automation.actions,r=>(s(),m(g,{key:r.id},{default:o(()=>[t(e(E),{action:r},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})}}}),Z=h({__name:"Automations",setup(V){const _=b();x("Automations");const c=[{text:"Automations"}],p=G(),a=F(p.automations.getAutomations),n=y(()=>a.response??[]),f=y(()=>a.executed),u=y(()=>n.value.length===0);return(g,r)=>{const B=i("p-button"),O=i("p-virtual-scroller"),T=i("p-layout-default");return s(),m(T,{class:"automations"},{header:o(()=>[t(e(w),{crumbs:c},S({"after-crumbs":o(()=>[t(B,{size:"sm",icon:"PlusIcon",to:e(_).automationCreate()},null,8,["to"])]),_:2},[u.value?void 0:{name:"actions",fn:o(()=>[t(e(j),{to:e(q).docs.automations},{default:o(()=>[A(" Documentation ")]),_:1},8,["to"])]),key:"0"}]),1024)]),default:o(()=>[f.value?(s(),d(k,{key:0},[u.value?(s(),m(e(I),{key:0})):(s(),d(k,{key:1},[t(e(L),{count:n.value.length,label:"automation"},null,8,["count"]),t(O,{items:n.value,class:"automations-list"},{default:o(({item:D})=>[t(R,{automation:D,onUpdate:e(a).refresh},null,8,["automation","onUpdate"])]),_:1},8,["items"])],64))],64)):C("",!0)]),_:1})}}});export{Z as default};
//# sourceMappingURL=Automations-xsiQt8Ua.js.map
