import{d as A,V as y,u as b,W as w,J as g,i as h,j as k,c as v,o as C,k as a,l as u,n as e,z as V,G as B,H as r,B as j,K as l,L as E}from"./index-lpMZ-Mxi.js";import{_ as G}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-ChEYeTnG.js";import{u as I}from"./usePageTitle-lR93gd3J.js";import{u as J}from"./usePrefectApi-CBeGf8KN.js";import"./mapper-8sYMZlVA.js";import"./api-D7Xm_t3K.js";const z=A({__name:"AutomationEdit",async setup(N){let o,m;const i=J(),c=y(),d=b(),p=w("automationId"),s=([o,m]=g(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);I(`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,_),l(r.success.automationUpdate),d.push(c.automations())}catch(t){console.error(t);const n=E(t,r.error.automationUpdate);l(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(B),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[j(" Documentation ")])),_:1,__:[0]},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(G,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{z as default};
//# sourceMappingURL=AutomationEdit-BWZx8IaI.js.map
