import{d as A,V as y,W as b,J as w,f as C,c as g,i as a,j as h,u as k,o as v,k as u,l as e,O as P,G as r,C as V,K as B,P as d,Z as E}from"./index-BBlvj0M_.js";import{_ as I}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CeS8t0eN.js";import{u as K}from"./usePageTitle-lBdMRcrQ.js";import{u as N}from"./usePrefectApi-Boduij1X.js";import"./mapper-DWfgs_2K.js";import"./api-D3LJrWSC.js";const D=A({__name:"AutomationEdit",async setup(O){let o,m;const i=N(),c=y(),_=k(),p=b("automationId"),s=([o,m]=w(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);K(`Edit Automation: ${s.name}`);const f=C(()=>[{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=E(t,r.error.automationUpdate);d(n,"error",{timeout:!1})}}return(l,t)=>{const n=h("p-layout-default");return v(),g(n,{class:"workspace-automation-create"},{header:a(()=>[u(e(B),{crumbs:f.value},{actions:a(()=>[u(e(P),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[V(" Documentation ")])),_:1},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(I,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{D as default};
//# sourceMappingURL=AutomationEdit-J3C4yJFP.js.map
