import{d as A,g as h,K as y,L as w,c as T,j as s,k as b,h as k,o as N,l as r,m as n,G as P,H as i,C as B,Z as K,M as m,N as V}from"./index-CcVNxLw9.js";import{_ as Z}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-SJOZNKnZ.js";import{u as j}from"./usePageTitle-B0-KYjWV.js";import{u as v}from"./usePrefectApi-CGjYI0IK.js";const M=A({__name:"AutomationCreate",async setup(D){let e,u;j("Create Automation");const _=v(),c=h(),l=k(),f=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:g}=y(),d=([e,u]=w(()=>C()),e=await e,u(),e);async function C(){const t={},[o,a]=await Promise.all([g(),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=V(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(K),{crumbs:f},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>[B(" Documentation ")]),_:1},8,["to"])]),_:1})]),default:s(()=>[r(Z,{automation:n(d),onSubmit:x},null,8,["automation"])]),_:1})}}});export{M as default};
//# sourceMappingURL=AutomationCreate-jTmQJ-_t.js.map
