import{d as D,B as C,W as I,b as L,e as n,c as _,g as e,a as N,h as s,u as R,o as l,j as a,k as o,D as T,l as V,K as w,m as d,M as F,t as K,n as M,p as P,x as U,F as W,R as j}from"./index-Bp1Bhxow.js";import{u as E}from"./usePageTitle-CccNdtFw.js";import{u as S}from"./usePrefectApi-CTi5F9jI.js";const $={class:"automation-card__label"},J=D({__name:"Automation",setup(q){const c=C(),f=R(),v=S(),g=I("automationId"),i=L(v.automations.getAutomation,[g]),t=n(()=>i.response),y=n(()=>{var u;return((u=t.value)==null?void 0:u.name)??""}),b=n(()=>[{text:"Automations",to:c.automations()},{text:y.value}]),k=n(()=>t.value?`Automation: ${t.value.name}`:"Automation");E(k);function A(){f.push(c.automations())}return(u,m)=>{const h=s("p-key-value"),r=s("p-content"),x=s("p-card"),B=s("p-layout-default");return t.value?(l(),_(B,{key:0,class:"automation"},{header:e(()=>[a(o(w),{crumbs:b.value},{actions:e(()=>[a(o(T),{automation:t.value,onUpdate:o(i).refresh},null,8,["automation","onUpdate"]),a(o(V),{automation:t.value,onDelete:A},null,8,["automation"])]),_:1},8,["crumbs"])]),default:e(()=>[a(r,null,{default:e(()=>[a(h,{label:"Description",value:t.value.description},null,8,["value"]),a(r,{secondary:""},{default:e(()=>[m[0]||(m[0]=d("span",{class:"automation-card__label"},"Trigger",-1)),a(o(F),{trigger:t.value.trigger},null,8,["trigger"])]),_:1}),a(r,{secondary:""},{default:e(()=>[d("span",$,K(o(M)("Action",t.value.actions.length)),1),(l(!0),P(W,null,U(t.value.actions,p=>(l(),_(x,{key:p.id},{default:e(()=>[a(o(j),{action:p},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):N("",!0)}}});export{J as default};
//# sourceMappingURL=Automation-Dd9ADhcg.js.map
