import{aR as s}from"./main-tangy-colts-beg.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 c=async()=>s("pro_get_all_surecart_product",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 r=async t=>{t.setComponent("product-id",e=>{e.loading=!0});const{data:o,status:a}=await c();if(a==="error"){t.setComponent("product-id",e=>{t.util.isSelectComponent(e)&&(e.status=a,e.loading=!1,e.invalidMessage=o)}),console.error("Failed to fetch product");return}t.setComponent("product-id",e=>{t.util.isSelectComponent(e)&&(e.options=o,e.loading=!1,e.status=void 0)})};export{r as f};
