import{aa as s,ab as c}from"./_applist-tangy-colts-beg-36.js";import{aR as r,_ as n}from"./main-tangy-colts-beg.js";import{s as h}from"./machine.-tangy-colts-beg-869.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,o){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,o),o)}};const l=async()=>r("pro_get_all_donation_form",void 0,void 0,"GET");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,o){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,o),o)}};const i=async t=>{t.setComponent("donation-form-id",e=>{e.loading=!0});const{data:o,status:a}=await l();if(a==="error"){t.setComponent("donation-form-id",e=>{t.util.isSelectComponent(e)&&(e.status=a,e.loading=!1,e.invalidMessage=o)}),console.error("Failed to fetch donation-form");return}t.setComponent("donation-form-id",e=>{t.util.isSelectComponent(e)&&(e.options=o,e.loading=!1,e.status=void 0)})};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,o){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,o),o)}};const g=s(({helpers:t})=>({actions:{ON_MACHINE_LOAD:async({$:o})=>{h(o,[{db:"donationFormId",id:"donation-form-id"}]),await i(o)},REFETCH_DONATION_FORMS:async({$:o})=>i(o),SELECT_DONATION_FORM:async({$:o,e:a})=>{o.setThisComponent(e=>{e.value=a}),o.setDb({donationFormId:a})}},states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"donation-form-id",label:n("Donation-forms"),onChange:"SELECT_DONATION_FORM",onRefetch:"REFETCH_DONATION_FORMS",options:[],placeholder:n("Select a donation-form"),render:!0,value:void 0},{componentName:t.componentName.hookListener,fieldType:"config",id:"hook-listener",label:n("Listen Hook"),render:({$:o})=>{var a;return c((a=o.getComponent("donation-form-id"))==null?void 0:a.value)}}]}}));export{g as default};
