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