import{d as x,g as y,L as w,M as h,c as T,i as s,j as b,u as k,o as N,k as r,l as n,G as P,H as i,C as B,K as D,N as m,Y as K}from"./index-CibiDZQv.js";import{_ as L}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-q0wxvUSo.js";import{u as M}from"./usePageTitle-DYAZWMh1.js";import{u as V}from"./usePrefectApi-CxW5JR2S.js";const R=x({__name:"AutomationCreate",async setup(Y){let e,u;M("Create Automation");const l=V(),c=y(),_=k(),f=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:d}=w(),g=([e,u]=h(()=>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=K(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{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(()=>t[0]||(t[0]=[B(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(L,{automation:n(g),onSubmit:A},null,8,["automation"])]),_:1})}}});export{R as default};
//# sourceMappingURL=AutomationCreate-BHou1BYG.js.map
