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