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