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