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