import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{i as n,r}from"./api-z_dXWY_S.js";import{a as i,i as a,n as o}from"./remoteConfig-BXkMU0oz.js";async function refreshRemoteConfig(e={}){let{useAuth:t=!0}=e;try{let e=t?await r.fetchApi(`/features`,{cache:`no-store`}):await fetch(`/api/features`,{cache:`no-store`});if(e.ok){let n=await e.json();window.__CONFIG__=n,a.value=n,i.value=t?`authenticated`:`anonymous`;return}console.warn(`Failed to load remote config:`,e.statusText),(e.status===401||e.status===403)&&(window.__CONFIG__={},a.value={},i.value=`error`)}catch(e){console.error(`Failed to fetch remote config:`,e),window.__CONFIG__={},a.value={},i.value=`error`}}var s=t((()=>{n(),o()}));export{refreshRemoteConfig as n,s as t};
//# sourceMappingURL=refreshRemoteConfig-BEXmhsvN.js.map