const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-ponyfill-5OLMznK4.js","assets/mantine-PZICIGS6.js"])))=>i.map(i=>d[i]); const Je="modulepreload",We=function(s){return"/"+s},pe={},Qe=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){let l=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");n=l(t.map(u=>{if(u=We(u),u in pe)return;pe[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Je,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((d,p)=>{h.addEventListener("load",d),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};var ie={};const g=s=>typeof s=="string",q=()=>{let s,e;const t=new Promise((i,n)=>{s=i,e=n});return t.resolve=s,t.reject=e,t},ge=s=>s==null?"":""+s,Ye=(s,e,t)=>{s.forEach(i=>{e[i]&&(t[i]=e[i])})},Ge=/###/g,me=s=>s&&s.indexOf("###")>-1?s.replace(Ge,"."):s,ye=s=>!s||g(s),z=(s,e,t)=>{const i=g(e)?e.split("."):e;let n=0;for(;n{const{obj:i,k:n}=z(s,e,Object);if(i!==void 0||e.length===1){i[n]=t;return}let r=e[e.length-1],o=e.slice(0,e.length-1),a=z(s,o,Object);for(;a.obj===void 0&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=z(s,o,Object),a?.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=t},Ze=(s,e,t,i)=>{const{obj:n,k:r}=z(s,e,Object);n[r]=n[r]||[],n[r].push(t)},Y=(s,e)=>{const{obj:t,k:i}=z(s,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},et=(s,e,t)=>{const i=Y(s,t);return i!==void 0?i:Y(e,t)},Ae=(s,e,t)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in s?g(s[i])||s[i]instanceof String||g(e[i])||e[i]instanceof String?t&&(s[i]=e[i]):Ae(s[i],e[i],t):s[i]=e[i]);return s},F=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var tt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const it=s=>g(s)?s.replace(/[&<>"'\/]/g,e=>tt[e]):s;class nt{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const st=[" ",",","?","!",";"],rt=new nt(20),ot=(s,e,t)=>{e=e||"",t=t||"";const i=st.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(i.length===0)return!0;const n=rt.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let r=!n.test(s);if(!r){const o=s.indexOf(t);o>0&&!n.test(s.substring(0,o))&&(r=!0)}return r},ae=(s,e,t=".")=>{if(!s)return;if(s[e])return Object.prototype.hasOwnProperty.call(s,e)?s[e]:void 0;const i=e.split(t);let n=s;for(let r=0;r-1&&ls?.replace(/_/g,"-"),at={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,e){console?.[s]?.apply?.(console,e)}};class G{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||at,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,n){return n&&!this.debug?null:(g(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new G(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new G(this.logger,e)}}var k=new G;class te{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const n=this.observers[i].get(t)||0;this.observers[i].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(t,1)}getResource(e,t,i,n={}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,o=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],i&&(Array.isArray(i)?a.push(...i):g(i)&&r?a.push(...i.split(r)):a.push(i)));const l=Y(this.data,a);return!l&&!t&&!i&&e.indexOf(".")>-1&&(e=a[0],t=a[1],i=a.slice(2).join(".")),l||!o||!g(i)?l:ae(this.data?.[e]?.[t],i,r)}addResource(e,t,i,n,r={silent:!1}){const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=[e,t];i&&(a=a.concat(o?i.split(o):i)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),ve(this.data,a,n),r.silent||this.emit("added",e,t,i,n)}addResources(e,t,i,n={silent:!1}){for(const r in i)(g(i[r])||Array.isArray(i[r]))&&this.addResource(e,t,r,i[r],{silent:!0});n.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,n,r,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=i,i=t,t=a[1]),this.addNamespaces(t);let l=Y(this.data,a)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),n?Ae(l,i,r):l={...l,...i},ve(this.data,a,l),o.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var Ue={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,e,t,i,n){return s.forEach(r=>{e=this.processors[r]?.process(e,t,i,n)??e}),e}};const He=Symbol("i18next/PATH_KEY");function lt(){const s=[],e=Object.create(null);let t;return e.get=(i,n)=>(t?.revoke?.(),n===He?s:(s.push(n),t=Proxy.revocable(i,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function K(s,e){const{[He]:t}=s(lt()),i=e?.keySeparator??".",n=e?.nsSeparator??":";if(t.length>1&&n){const r=e?.ns,o=Array.isArray(r)?r:null;if(o&&o.length>1&&o.slice(1).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(i)}`}return t.join(i)}const be={},ne=s=>!g(s)&&typeof s!="boolean"&&typeof s!="number";class Z extends te{constructor(e,t={}){super(),Ye(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=k.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const i={...t};if(e==null)return!1;const n=this.resolve(e,i);if(n?.res===void 0)return!1;const r=ne(n.res);return!(i.returnObjects===!1&&r)}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=i&&e.indexOf(i)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ot(e,i,n);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:g(r)?[r]:r};const u=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:g(r)?[r]:r}}translate(e,t,i){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=K(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(x=>typeof x=="function"?K(x,{...this.options,...n}):String(x));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let c=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return h?r?{res:`${u}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a;const d=this.resolve(e,n);let p=d?.res;const m=d?.usedKey||a,y=d?.exactUsedKey||a,w=["[object Number]","[object Function]","[object RegExp]"],v=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,O=n.count!==void 0&&!g(n.count),$=Z.hasDefaultValue(n),D=O?this.pluralResolver.getSuffix(f,n.count,n):"",A=n.ordinal&&O?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",fe=O&&!n.ordinal&&n.count===0,j=fe&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${D}`]||n[`defaultValue${A}`]||n.defaultValue;let P=p;N&&!p&&$&&(P=j);const Be=ne(P),Xe=Object.prototype.toString.apply(P);if(N&&P&&Be&&w.indexOf(Xe)<0&&!(g(v)&&Array.isArray(P))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,P,{...n,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(d.res=x,d.usedParams=this.getUsedParamsDetails(n),d):x}if(o){const x=Array.isArray(P),L=x?[]:{},ce=x?y:m;for(const C in P)if(Object.prototype.hasOwnProperty.call(P,C)){const R=`${ce}${o}${C}`;$&&!p?L[C]=this.translate(R,{...n,defaultValue:ne(j)?j[C]:void 0,joinArrays:!1,ns:l}):L[C]=this.translate(R,{...n,joinArrays:!1,ns:l}),L[C]===R&&(L[C]=P[C])}p=L}}else if(N&&g(v)&&Array.isArray(p))p=p.join(v),p&&(p=this.extendTranslation(p,e,n,i));else{let x=!1,L=!1;!this.isValidLookup(p)&&$&&(x=!0,p=j),this.isValidLookup(p)||(L=!0,p=a);const C=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:p,R=$&&j!==p&&this.options.updateMissing;if(L||x||R){if(this.logger.log(R?"updateKey":"missingKey",f,u,a,R?j:p),o){const S=this.resolve(a,{...n,keySeparator:!1});S&&S.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let V=[];const W=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&W&&W[0])for(let S=0;S{const de=$&&_!==p?_:C;this.options.missingKeyHandler?this.options.missingKeyHandler(S,u,T,de,R,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(S,u,T,de,R,n),this.emit("missingKey",S,u,T,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?V.forEach(S=>{const T=this.pluralResolver.getSuffixes(S,n);fe&&n[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(_=>{he([S],a+_,n[`defaultValue${_}`]||j)})}):he(V,a,j))}p=this.extendTranslation(p,e,n,d,i),L&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${u}${c}${a}`),(L||x)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${a}`:a,x?p:void 0,n))}return r?(d.res=p,d.usedParams=this.getUsedParamsDetails(n),d):p}extendTranslation(e,t,i,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const l=g(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let c=i.replace&&!g(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,i.lng||this.language||n.usedLng,i),l){const f=e.match(this.interpolator.nestingRegexp),h=f&&f.length;ur?.[0]===f[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):this.translate(...f,t),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,a=g(o)?[o]:o;return e!=null&&a?.length&&i.applyPostProcessor!==!1&&(e=Ue.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,t={}){let i,n,r,o,a;return g(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?K(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(l,t),c=u.key;n=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=t.count!==void 0&&!g(t.count),d=h&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(y=>{this.isValidLookup(i)||(a=y,!be[`${m[0]}-${y}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(be[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${n}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(w=>{if(this.isValidLookup(i))return;o=w;const v=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(v,c,w,y,t);else{let O;h&&(O=this.pluralResolver.getSuffix(w,t.count,t));const $=`${this.options.pluralSeparator}zero`,D=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&O.indexOf(D)===0&&v.push(c+O.replace(D,this.options.pluralSeparator)),v.push(c+O),d&&v.push(c+$)),p){const A=`${c}${this.options.contextSeparator||"_"}${t.context}`;v.push(A),h&&(t.ordinal&&O.indexOf(D)===0&&v.push(A+O.replace(D,this.options.pluralSeparator)),v.push(A+O),d&&v.push(A+$))}}let N;for(;N=v.pop();)this.isValidLookup(i)||(r=N,i=this.getResource(w,y,N,t))}))})}),{res:i,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!g(e.replace);let n=i?e.replace:e;if(i&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}}class Se{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=k.create("languageUtils")}getScriptPartFromCode(e){if(e=X(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=X(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const n=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const n=this.getScriptPartFromCode(i);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(i);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(o=>{if(o===r)return o;if(!(o.indexOf("-")<0&&r.indexOf("-")<0)&&(o.indexOf("-")>0&&r.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===r||o.indexOf(r)===0&&r.length>1))return o})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=o=>{o&&(this.isSupportedCode(o)?n.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):g(e)&&r(this.formatLanguageCode(e)),i.forEach(o=>{n.indexOf(o)<0&&r(this.formatLanguageCode(o))}),n}}const Oe={zero:0,one:1,two:2,few:3,many:4,other:5},we={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ut{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=k.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const i=X(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(i,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),we;if(!e.match(/-|_/))return we;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,t)}return this.pluralRulesCache[r]=o,o}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((n,r)=>Oe[n]-Oe[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,i={}){const n=this.getRule(e,i);return n?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}}const Le=(s,e,t,i=".",n=!0)=>{let r=et(s,e,t);return!r&&n&&g(t)&&(r=ae(s,t,i),r===void 0&&(r=ae(e,t,i))),r},se=s=>s.replace(/\$/g,"$$$$");class Pe{constructor(e={}){this.logger=k.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:n,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:d,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:w,alwaysFormat:v}=e.interpolation;this.escape=t!==void 0?t:it,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?F(r):o||"{{",this.suffix=a?F(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?F(h):d||F("$t("),this.nestingSuffix=p?F(p):m||F(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=w||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,i,n){let r,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=d=>{if(d.indexOf(this.formatSeparator)<0){const w=Le(t,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...n,...t,interpolationkey:d}):w}const p=d.split(this.formatSeparator),m=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(Le(t,l,m,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...n,...t,interpolationkey:m})};this.resetRegExp();const c=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>se(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?se(this.escape(d)):se(d)}].forEach(d=>{for(a=0;r=d.regex.exec(e);){const p=r[1].trim();if(o=u(p),o===void 0)if(typeof c=="function"){const y=c(e,r,n);o=g(y)?y:""}else if(n&&Object.prototype.hasOwnProperty.call(n,p))o="";else if(f){o=r[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),o="";else!g(o)&&!this.useRawValueToEscape&&(o=ge(o));const m=d.safeValue(o);if(e=e.replace(r[0],m),f?(d.regex.lastIndex+=o.length,d.regex.lastIndex-=r[0].length):d.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,i={}){let n,r,o;const a=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const f=l.split(new RegExp(`${F(c)}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,o);const d=h.match(/'/g),p=h.match(/"/g);((d?.length??0)%2===0&&!p||(p?.length??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];o={...i},o=o.replace&&!g(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!g(r))return r;g(r)||(r=ge(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((c,f)=>this.format(c,f,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const ft=s=>{let e=s.toLowerCase().trim();const t={};if(s.indexOf("(")>-1){const i=s.split("(");e=i[0].toLowerCase().trim();const n=i[1].substring(0,i[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();t[c]||(t[c]=u),u==="false"&&(t[c]=!1),u==="true"&&(t[c]=!0),isNaN(u)||(t[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},Ce=s=>{const e={};return(t,i,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const o=i+JSON.stringify(r);let a=e[o];return a||(a=s(X(i),n),e[o]=a),a(t)}},ct=s=>(e,t,i)=>s(X(t),i)(e);class ht{constructor(e={}){this.logger=k.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const i=t.cacheInBuiltFormats?Ce:ct;this.formats={number:i((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:i((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:i((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:i((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:i((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ce(t)}format(e,t,i,n={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(a=>a.indexOf(")")>-1)){const a=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,l)=>{const{formatName:u,formatOptions:c}=ft(l);if(this.formats[u]){let f=a;try{const h=n?.formatParams?.[n.interpolationkey]||{},d=h.locale||h.lng||n.locale||n.lng||i;f=this.formats[u](a,d,{...c,...n,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const dt=(s,e)=>{s.pending[e]!==void 0&&(delete s.pending[e],s.pendingCount--)};class pt extends te{constructor(e,t,i,n={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=n,this.logger=k.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,n.backend,n)}queueLoad(e,t,i,n){const r={},o={},a={},l={};return e.forEach(u=>{let c=!0;t.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,c=!1,o[h]===void 0&&(o[h]=!0),r[h]===void 0&&(r[h]=!0),l[f]===void 0&&(l[f]=!0)))}),c||(a[u]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,i){const n=e.split("|"),r=n[0],o=n[1];t&&this.emit("failedLoading",r,o,t),!t&&i&&this.store.addResourceBundle(r,o,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const a={};this.queue.forEach(l=>{Ze(l.loaded,[r],o),dt(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,i,n=0,r=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:r,callback:o});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&n{this.read.call(this,e,t,i,n+1,r*2,o)},r);return}o(u,c)},l=this.backend[i].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,t,a)}prepareLoading(e,t,i={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const r=this.queueLoad(e,t,i,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){const i=e.split("|"),n=i[0],r=i[1];this.read(n,r,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,a),this.loaded(e,o,a)})}saveMissing(e,t,i,n,r,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const l={...o,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,t,i,n,l):c=u(e,t,i,n),c&&typeof c.then=="function"?c.then(f=>a(null,f)).catch(a):a(null,c)}catch(c){a(c)}else u(e,t,i,n,a,l)}!e||!e[0]||this.store.addResource(e[0],t,i,n)}}}const re=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let e={};if(typeof s[1]=="object"&&(e=s[1]),g(s[1])&&(e.defaultValue=s[1]),g(s[2])&&(e.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const t=s[3]||s[2];Object.keys(t).forEach(i=>{e[i]=t[i]})}return e},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ke=s=>(g(s.ns)&&(s.ns=[s.ns]),g(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),g(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs?.indexOf?.("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s),Q=()=>{},gt=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(t=>{typeof s[t]=="function"&&(s[t]=s[t].bind(s))})},Ke="__i18next_supportNoticeShown",mt=()=>!!(typeof globalThis<"u"&&globalThis[Ke]||typeof process<"u"&&ie&&ie.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&ie),yt=()=>{typeof globalThis<"u"&&(globalThis[Ke]=!0)},vt=s=>!!(s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some(e=>e?.projectId));class B extends te{constructor(e={},t){if(super(),this.options=ke(e),this.services={},this.logger=k,this.modules={external:[]},gt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(g(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=re();this.options={...i,...this.options,...ke(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!vt(this)&&!mt()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),yt());const n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?k.init(n(this.modules.logger),this.options):k.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ht;const c=new Se(this.options);this.store=new xe(this.options.resources,this.options);const f=this.services;f.logger=k,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new ut(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=n(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Pe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new pt(n(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(f.languageDetector=n(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=n(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Z(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Q),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const a=q(),l=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(f),t(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,t=Q){let i=t;const n=g(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const r=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};n?o(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload?.forEach?.(a=>o(a)),this.services.backendConnector.load(r,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(a)})}else i(null)}reloadResources(e,t,i){const n=q();return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=Q),this.services.backendConnector.reload(e,t,r=>{n.resolve(),i(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Ue.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const i=q();this.emit("languageChanging",e);const n=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},r=(a,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),t&&t(a,(...u)=>this.t(...u))},o=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const l=g(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(g(a)?[a]:a);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,c=>{r(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,t,i){const n=(r,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([r,o].concat(a)):l={...o},l.lng=l.lng||n.lng,l.lngs=l.lngs||n.lngs,l.ns=l.ns||n.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||i||n.keyPrefix);const u={...this.options,...l};typeof l.keyPrefix=="function"&&(l.keyPrefix=K(l.keyPrefix,u));const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(r)?f=r.map(h=>(typeof h=="function"&&(h=K(h,u)),`${l.keyPrefix}${c}${h}`)):(typeof r=="function"&&(r=K(r,u)),f=l.keyPrefix?`${l.keyPrefix}${c}${r}`:r),this.t(f,l)};return g(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=i,n}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,e)&&(!n||o(r,e)))}loadNamespaces(e,t){const i=q();return this.options.ns?(g(e)&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{i.resolve(),t&&t(n)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=q();g(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(o=>n.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return r.length?(this.options.preload=n.concat(r),this.loadResources(o=>{i.resolve(),t&&t(o)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const n=new Intl.Locale(e);if(n&&n.getTextInfo){const r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new Se(re());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const i=new B(e,t);return i.createInstance=B.createInstance,i}cloneInstance(e={},t=Q){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new B(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i){const a=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,f)=>(c[f]={...l[u][f]},c),l[u]),l),{});r.store=new xe(a,n),r.services.resourceStore=r.store}if(e.interpolation){const l={...re().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new Pe(u)}return r.translator=new Z(r.services,n),r.translator.on("*",(a,...l)=>{r.emit(a,...l)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const b=B.createInstance();b.createInstance;b.dir;b.init;b.loadResources;b.reloadResources;b.use;b.changeLanguage;b.getFixedT;const Wt=b.t;b.exists;b.setDefaultNamespace;b.hasLoadedNamespace;b.loadNamespaces;b.loadLanguages;const{slice:xt,forEach:bt}=[];function St(s){return bt.call(xt.call(arguments,1),e=>{if(e)for(const t in e)s[t]===void 0&&(s[t]=e[t])}),s}function Ot(s){return typeof s!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(s))}const Re=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wt=function(s,e){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(e);let r=`${s}=${n}`;if(i.maxAge>0){const o=i.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(o)}`}if(i.domain){if(!Re.test(i.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${i.domain}`}if(i.path){if(!Re.test(i.path))throw new TypeError("option path is invalid");r+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");r+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(r+="; HttpOnly"),i.secure&&(r+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(r+="; Partitioned"),r},$e={create(s,e,t,i){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+t*60*1e3)),i&&(n.domain=i),document.cookie=wt(s,e,n)},read(s){const e=`${s}=`,t=document.cookie.split(";");for(let i=0;i-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const r=i.substring(1).split("&");for(let o=0;o0&&r[o].substring(0,a)===e&&(t=r[o].substring(a+1))}}return t}},Ct={name:"hash",lookup(s){let{lookupHash:e,lookupFromHashIndex:t}=s,i;if(typeof window<"u"){const{hash:n}=window.location;if(n&&n.length>2){const r=n.substring(1);if(e){const o=r.split("&");for(let a=0;a0&&o[a].substring(0,l)===e&&(i=o[a].substring(l+1))}}if(i)return i;if(!i&&t>-1){const o=n.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return i}};let U=null;const je=()=>{if(U!==null)return U;try{if(U=typeof window<"u"&&window.localStorage!==null,!U)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{U=!1}return U};var kt={name:"localStorage",lookup(s){let{lookupLocalStorage:e}=s;if(e&&je())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(s,e){let{lookupLocalStorage:t}=e;t&&je()&&window.localStorage.setItem(t,s)}};let H=null;const Ee=()=>{if(H!==null)return H;try{if(H=typeof window<"u"&&window.sessionStorage!==null,!H)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{H=!1}return H};var Rt={name:"sessionStorage",lookup(s){let{lookupSessionStorage:e}=s;if(e&&Ee())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(s,e){let{lookupSessionStorage:t}=e;t&&Ee()&&window.sessionStorage.setItem(t,s)}},$t={name:"navigator",lookup(s){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:i,language:n}=navigator;if(t)for(let r=0;r0?e:void 0}},jt={name:"htmlTag",lookup(s){let{htmlTag:e}=s,t;const i=e||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(t=i.getAttribute("lang")),t}},Et={name:"path",lookup(s){let{lookupFromPathIndex:e}=s;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof e=="number"?e:0]?.replace("/",""):void 0}},Nt={name:"subdomain",lookup(s){let{lookupFromSubdomainIndex:e}=s;const t=typeof e=="number"?e+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[t]}};let Me=!1;try{document.cookie,Me=!0}catch{}const Ve=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Me||Ve.splice(1,1);const Tt=()=>({order:Ve,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class Ft{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=St(t,this.options||{},Tt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=n=>n.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Lt),this.addDetector(Pt),this.addDetector(kt),this.addDetector(Rt),this.addDetector($t),this.addDetector(jt),this.addDetector(Et),this.addDetector(Nt),this.addDetector(Ct)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(i=>{if(this.detectors[i]){let n=this.detectors[i].lookup(this.options);n&&typeof n=="string"&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(i=>i!=null&&!Ot(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(e,this.options)}))}}Ft.type="languageDetector";function le(s){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(s)}function _e(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":le(XMLHttpRequest))==="object"}function It(s){return!!s&&typeof s.then=="function"}function Dt(s){return It(s)?s:Promise.resolve(s)}function Ne(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function Te(s){for(var e=1;eimport("./browser-ponyfill-5OLMznK4.js").then(s=>s.b),__vite__mapDeps([0,1])).then(function(s){E=s.default}).catch(function(){})}catch{}var ue=function(e,t){if(t&&I(t)==="object"){var i="";for(var n in t)i+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!i)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+i.slice(1)}return e},Fe=function(e,t,i,n){var r=function(l){if(!l.ok)return i(l.statusText||"Error",{status:l.status});l.text().then(function(u){i(null,{status:l.status,data:u})}).catch(i)};if(n){var o=n(e,t);if(o instanceof Promise){o.then(r).catch(i);return}}typeof fetch=="function"?fetch(e,t).then(r).catch(i):E(e,t).then(r).catch(i)},Ie=!1,Kt=function(e,t,i,n){e.queryStringParams&&(t=ue(t,e.queryStringParams));var r=Te({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(r["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),i&&(r["Content-Type"]="application/json");var o=typeof e.requestOptions=="function"?e.requestOptions(i):e.requestOptions,a=Te({method:i?"POST":"GET",body:i?e.stringify(i):void 0,headers:r},Ie?{}:o),l=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Fe(t,a,n,l)}catch(u){if(!o||Object.keys(o).length===0||!u.message||u.message.indexOf("not implemented")<0)return n(u);try{Object.keys(o).forEach(function(c){delete a[c]}),Fe(t,a,n,l),Ie=!0}catch(c){n(c)}}},Mt=function(e,t,i,n){i&&I(i)==="object"&&(i=ue("",i).slice(1)),e.queryStringParams&&(t=ue(t,e.queryStringParams));try{var r=J?new J:new ee("MSXML2.XMLHTTP.3.0");r.open(i?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,i&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var o=e.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)r.setRequestHeader(a,o[a]);r.onreadystatechange=function(){r.readyState>3&&n(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(i)}catch(l){console&&console.log(l)}},Vt=function(e,t,i,n){if(typeof i=="function"&&(n=i,i=void 0),n=n||function(){},E&&t.indexOf("file:")!==0)return Kt(e,t,i,n);if(_e()||typeof ActiveXObject=="function")return Mt(e,t,i,n);n(new Error("No fetch and no xhr implementation found!"))};function M(s){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(s)}function De(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function oe(s){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_t(this,s),this.services=e,this.options=t,this.allOptions=i,this.type="backend",this.init(e,t,i)}return zt(s,[{key:"init",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=t,this.options=oe(oe(oe({},Xt()),this.options||{}),n),this.allOptions=r,this.services&&this.options.reloadInterval){var o=setInterval(function(){return i.reload()},this.options.reloadInterval);M(o)==="object"&&typeof o.unref=="function"&&o.unref()}}},{key:"readMulti",value:function(t,i,n){this._readAny(t,t,i,i,n)}},{key:"read",value:function(t,i,n){this._readAny([t],t,[i],i,n)}},{key:"_readAny",value:function(t,i,n,r,o){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(t,n)),l=Dt(l),l.then(function(u){if(!u)return o(null,{});var c=a.services.interpolator.interpolate(u,{lng:t.join("+"),ns:n.join("+")});a.loadUrl(c,o,i,r)})}},{key:"loadUrl",value:function(t,i,n,r){var o=this,a=typeof n=="string"?[n]:n,l=typeof r=="string"?[r]:r,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,t,u,function(c,f){if(f&&(f.status>=500&&f.status<600||!f.status))return i("failed loading "+t+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return i("failed loading "+t+"; status code: "+f.status,!1);if(!f&&c&&c.message){var h=c.message.toLowerCase(),d=["failed","fetch","network","load"].find(function(y){return h.indexOf(y)>-1});if(d)return i("failed loading "+t+": "+c.message,!0)}if(c)return i(c,!1);var p,m;try{typeof f.data=="string"?p=o.options.parse(f.data,n,r):p=f.data}catch{m="failed parsing "+t+" to json"}if(m)return i(m,!1);i(null,p)})}},{key:"create",value:function(t,i,n,r,o){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var l=this.options.parsePayload(i,n,r),u=0,c=[],f=[];t.forEach(function(h){var d=a.options.addPath;typeof a.options.addPath=="function"&&(d=a.options.addPath(h,i));var p=a.services.interpolator.interpolate(d,{lng:h,ns:i});a.options.request(a.options,p,l,function(m,y){u+=1,c.push(m),f.push(y),u===t.length&&typeof o=="function"&&o(c,f)})})}}},{key:"reload",value:function(){var t=this,i=this.services,n=i.backendConnector,r=i.languageUtils,o=i.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(f){var h=r.toResolveHierarchy(f);h.forEach(function(d){l.indexOf(d)<0&&l.push(d)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){t.allOptions.ns.forEach(function(f){n.read(c,f,"read",null,null,function(h,d){h&&o.warn("loading namespace ".concat(f," for language ").concat(c," failed"),h),!h&&d&&o.log("loaded namespace ".concat(f," for language ").concat(c),d),n.loaded("".concat(c,"|").concat(f),h,d)})})})}}}])})();Jt.type="backend";export{Ft as B,Qe as _,Jt as a,b as i,K as k,Wt as t};