import{aR as i}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const a=async()=>i("pro_wpforo/get/forums",void 0,void 0,"GET"),n=async()=>i("pro_wpforo/get/topics",void 0,void 0,"GET"),c=async()=>i("pro_wpforo/get/users",void 0,void 0,"GET");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const l=async o=>{o.setComponent("forum-id",t=>{t.loading=!0});const{data:e,status:s}=await a();if(s==="error"){o.setComponent("forum-id",t=>{o.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch forum");return}o.setComponent("forum-id",t=>{o.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})},u=async o=>{o.setComponent("topic-id",t=>{t.loading=!0});const{data:e,status:s}=await n();if(s==="error"){o.setComponent("topic-id",t=>{o.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch topic");return}o.setComponent("topic-id",t=>{o.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})},d=async o=>{o.setComponent("user-id",t=>{t.loading=!0});const{data:e,status:s}=await c();if(s==="error"){o.setComponent("user-id",t=>{o.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch user");return}o.setComponent("user-id",t=>{o.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})};export{d as a,l as b,u as f};
