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