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