import{d as A,V as x,u as w,H as h,I as T,k as V,c as b,o as k,l as s,m as n,p as r,y as B,U as P,G as i,B as N,K as c,Y as U}from"./index-C_HOOOpe.js";import{_ as Y}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CzbBuGt2.js";import{u as q}from"./usePageTitle-DzYzWO1v.js";import{u as v}from"./usePrefectApi-sSXMpdgS.js";import"./mapper-CIsJmmgQ.js";import"./api-B9c0WAfg.js";const S=A({__name:"AutomationCreate",async setup(D){let e,u;q("Create Automation");const p=v(),m=x(),l=w(),_=[{text:"Automations",to:m.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 y(o){try{await p.automations.createAutomation(o),c(i.success.automationCreate),l.push(m.automations())}catch(t){console.error(t);const a=U(t,i.error.automationCreate);c(a,"error",{timeout:!1})}}return(o,t)=>{const a=V("p-layout-default");return k(),b(a,{class:"automation-create"},{header:s(()=>[n(r(B),{crumbs:_},{actions:s(()=>[n(r(P),{to:r(i).docs.automations},{default:s(()=>t[0]||(t[0]=[N(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[n(Y,{automation:r(g),onSubmit:y},null,8,["automation"])]),_:1})}}});export{S as default};
//# sourceMappingURL=AutomationCreate-CZtPQaXG.js.map
