import{d as y,h as A,L as h,M as w,c as T,k as s,l as b,i as k,o as N,m as r,n,H as P,I as i,D as B,Z as D,N as m,O}from"./index-CgvuCQfr.js";import{_ as V}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-1YzVMnrp.js";import{u as Z}from"./usePageTitle-DVT0B9Gy.js";import{u as v}from"./usePrefectApi-BpSnfZdy.js";const M=y({__name:"AutomationCreate",async setup(E){let e,u;Z("Create Automation");const _=v(),c=A(),l=k(),f=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:d}=h(),g=([e,u]=w(()=>C()),e=await e,u(),e);async function C(){const t={},[o,a]=await Promise.all([d(),p()]);return o&&(t.trigger=o),a&&(t.actions=a),t}async function x(t){try{await _.automations.createAutomation(t),m(i.success.automationCreate),l.push(c.automations())}catch(o){console.error(o);const a=O(o,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(t,o)=>{const a=b("p-layout-default");return N(),T(a,{class:"automation-create"},{header:s(()=>[r(n(D),{crumbs:f},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>[B(" Documentation ")]),_:1},8,["to"])]),_:1})]),default:s(()=>[r(V,{automation:n(g),onSubmit:x},null,8,["automation"])]),_:1})}}});export{M as default};
//# sourceMappingURL=AutomationCreate-CrW7Em2G.js.map
