import{b as i,i as m}from"./useflows-BpG3C9m1.js";import{s as r,e as s}from"./main-few-lands-burn.js";import{s as l}from"./machine.-BRuqPpdF.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const c=async()=>r("contact-form-7/get-forms"),a=async t=>{t.setComponent("form-id",o=>{o.loading=!0});const{data:e,status:n}=await c();if(n==="error"){t.setComponent("form-id",o=>{t.util.isSelectComponent(o)&&(o.status=n,o.loading=!1,o.invalidMessage=e)});return}t.setComponent("form-id",o=>{t.util.isSelectComponent(o)&&(o.options=e,o.loading=!1,o.status=void 0)})},C=i(({helpers:t})=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"form-id",label:s("Forms"),onChange:"SELECT_FORM",onRefetch:"REFETCH_FORMS",optionFilterProp:"label",options:[],placeholder:s("Select a form"),render:!0,showSearch:!0,value:void 0},{componentName:t.componentName.hookListener,fieldType:"config",id:"hook-listener",label:s("Listen Hook"),render:"IF_FORM_SELECTED"}]},actions:{IF_FORM_SELECTED:({$:e})=>m(e.getComponent("form-id")?.value),ON_MACHINE_LOAD:async({$:e})=>{l(e,[{db:"formId",id:"form-id"}]),await a(e)},REFETCH_FORMS:async({$:e})=>{await a(e)},SELECT_FORM:async({$:e,e:n})=>{e.setThisComponent(o=>{o.value=n}),e.setDb({formId:n})}}}));export{C as default};
