import{d as x,V as y,u as w,H as h,I as T,j as V,c as b,o as k,k as s,l as r,n,z as B,U as P,G as i,B as N,J as m,K as U}from"./index-DHPxdPUs.js";import{_ as j}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-DPZoJWoc.js";import{u as q}from"./usePageTitle-N_Vwn3MG.js";import{u as v}from"./usePrefectApi-73S4sE5q.js";import"./mapper-BEWLxiBI.js";import"./api-Br1VH0Tb.js";const K=x({__name:"AutomationCreate",async setup(z){let e,u;q("Create Automation");const p=v(),c=y(),l=w(),_=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:f,getTrigger:d}=h(),g=([e,u]=T(()=>C()),e=await e,u(),e);async function C(){const o={},[t,a]=await Promise.all([d(),f()]);return t&&(o.trigger=t),a&&(o.actions=a),o}async function A(o){try{await p.automations.createAutomation(o),m(i.success.automationCreate),l.push(c.automations())}catch(t){console.error(t);const a=U(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{const a=V("p-layout-default");return k(),b(a,{class:"automation-create"},{header:s(()=>[r(n(B),{crumbs:_},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>t[0]||(t[0]=[N(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(j,{automation:n(g),onSubmit:A},null,8,["automation"])]),_:1})}}});export{K as default};
//# sourceMappingURL=AutomationCreate-DLIJB_2r.js.map
