import{n as e}from"./charts-edxfx4sh.js";import{n as t,r as n}from"./i18n-BuHCC44e.js";import{r}from"./brand-DvcIEWC4.js";var i=`velamq-lang`,a=`en`;function o(e){if(!e)return null;let t=e.trim().replace(/_/g,`-`).toLowerCase();if(!t)return null;if(t===`zh-tw`||t===`zh-hk`||t===`zh-mo`||t===`zh-hant`)return`zh-tw`;let[n]=t.split(`-`);return n===`zh`?`zh`:n===`en`?`en`:n===`ja`?`ja`:null}function s(e){return o(e)??a}function c(){if(typeof localStorage>`u`)return null;try{return localStorage.getItem(i)}catch{return null}}function l(){let e=o(c());if(e)return e;let t=[];typeof document<`u`&&t.push(document.documentElement.lang),typeof navigator<`u`&&(t.push(...navigator.languages),t.push(navigator.language));for(let e of t){let t=o(e);if(t)return t}return a}function u(e){typeof document>`u`||(document.documentElement.lang=d(e))}function d(e){switch(s(e)){case`zh`:return`zh-CN`;case`zh-tw`:return`zh-TW`;case`ja`:return`ja-JP`;default:return`en-US`}}async function f(t){return t===`zh`?(await e(async()=>{let{default:e}=await import(`./zh-2unWHAcj.js`);return{default:e}},[])).default:t===`zh-tw`?(await e(async()=>{let{default:e}=await import(`./zh-tw-BG_kTNQ0.js`);return{default:e}},[])).default:t===`ja`?(await e(async()=>{let{default:e}=await import(`./ja-Dn-xp25E.js`);return{default:e}},[])).default:(await e(async()=>{let{default:e}=await import(`./en-XwmpRtQ4.js`);return{default:e}},[])).default}var p=s(l()),m=new Set,h={en:{translation:await f(`en`)}};m.add(`en`),p!==`en`&&(h[p]={translation:await f(p)},m.add(p)),await n.use(t).init({resources:{...h},lng:p,fallbackLng:a,supportedLngs:[`en`,`zh`,`zh-tw`,`ja`],nonExplicitSupportedLngs:!0,load:`currentOnly`,lowerCaseLng:!0,cleanCode:!0,interpolation:{escapeValue:!1,defaultVariables:{productName:r.productName,productKey:r.key}},react:{useSuspense:!1}}),u(p);async function g(e){let t=s(e);m.has(t)||(n.addResourceBundle(t,`translation`,await f(t),!0,!0),m.add(t)),await n.changeLanguage(t)}n.on(`languageChanged`,e=>{let t=s(e);if(u(t),typeof localStorage<`u`)try{localStorage.setItem(i,t)}catch{}});var _=n;export{g as i,_ as n,s as r,d as t};