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