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