import{d as x,h as y,Q as h,J as w,c as T,j as s,k as b,u as k,o as B,l as r,m as n,E as P,G as i,B as E,K,L as m,Y as N}from"./index-DgpKcZLs.js";import{_ as Q}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-BMsfeKUI.js";import{u as V}from"./usePageTitle-CgS480GG.js";import{u as Y}from"./usePrefectApi-IV1ENcLN.js";const L=x({__name:"AutomationCreate",async setup(j){let e,u;V("Create Automation");const l=Y(),c=y(),_=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 o={},[t,a]=await Promise.all([d(),p()]);return t&&(o.trigger=t),a&&(o.actions=a),o}async function A(o){try{await l.automations.createAutomation(o),m(i.success.automationCreate),_.push(c.automations())}catch(t){console.error(t);const a=N(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{const a=b("p-layout-default");return B(),T(a,{class:"automation-create"},{header:s(()=>[r(n(K),{crumbs:f},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>t[0]||(t[0]=[E(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(Q,{automation:n(g),onSubmit:A},null,8,["automation"])]),_:1})}}});export{L as default};
//# sourceMappingURL=AutomationCreate-DfIhqE05.js.map
