import{d as A,h as y,W as b,J as h,i as w,c as C,j as a,k as g,u as k,o as v,l as u,m as e,E,G as r,B,K as W,L as d,Y as I}from"./index-DgpKcZLs.js";import{_ as K}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-BMsfeKUI.js";import{u as N}from"./usePageTitle-CgS480GG.js";import{u as P}from"./usePrefectApi-IV1ENcLN.js";const j=A({__name:"AutomationEdit",async setup(T){let o,m;const i=P(),c=y(),_=k(),p=b("automationId"),s=([o,m]=h(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);N(`Edit Automation: ${s.name}`);const f=w(()=>[{text:"Automations",to:c.automations()},{text:s.name}]);async function x(l){try{await i.automations.updateAutomation(p.value,l),d(r.success.automationUpdate),_.push(c.automations())}catch(t){console.error(t);const n=I(t,r.error.automationUpdate);d(n,"error",{timeout:!1})}}return(l,t)=>{const n=g("p-layout-default");return v(),C(n,{class:"workspace-automation-create"},{header:a(()=>[u(e(W),{crumbs:f.value},{actions:a(()=>[u(e(E),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[B(" Documentation ")])),_:1},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(K,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{j as default};
//# sourceMappingURL=AutomationEdit-8I-RixxF.js.map
