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