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