react-i18next 16.5.8 → 16.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/TransWithoutContext.d.ts +10 -3
- package/dist/amd/react-i18next.js +69 -19
- package/dist/amd/react-i18next.min.js +1 -1
- package/dist/commonjs/useTranslation.js +6 -2
- package/dist/es/package.json +1 -1
- package/dist/es/useTranslation.js +6 -2
- package/dist/umd/react-i18next.js +69 -19
- package/dist/umd/react-i18next.min.js +1 -1
- package/package.json +20 -20
- package/react-i18next.js +69 -19
- package/react-i18next.min.js +1 -1
- package/src/useTranslation.js +14 -2
|
@@ -143,8 +143,12 @@ const useTranslation = (ns, props = {}) => {
|
|
|
143
143
|
wrapperLangRef.current = lang;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const effectiveT = !ready && !useSuspense ? (...args) => {
|
|
147
|
+
(0, _utils.warnOnce)(i18n, 'USE_T_BEFORE_READY', 'useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.');
|
|
148
|
+
return t(...args);
|
|
149
|
+
} : t;
|
|
150
|
+
const arr = [effectiveT, i18nWrapper, ready];
|
|
151
|
+
arr.t = effectiveT;
|
|
148
152
|
arr.i18n = i18nWrapper;
|
|
149
153
|
arr.ready = ready;
|
|
150
154
|
return arr;
|
package/dist/es/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"16.
|
|
1
|
+
{"type":"module","version":"16.6.0"}
|
|
@@ -137,8 +137,12 @@ export const useTranslation = (ns, props = {}) => {
|
|
|
137
137
|
wrapperLangRef.current = lang;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const effectiveT = !ready && !useSuspense ? (...args) => {
|
|
141
|
+
warnOnce(i18n, 'USE_T_BEFORE_READY', 'useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.');
|
|
142
|
+
return t(...args);
|
|
143
|
+
} : t;
|
|
144
|
+
const arr = [effectiveT, i18nWrapper, ready];
|
|
145
|
+
arr.t = effectiveT;
|
|
142
146
|
arr.i18n = i18nWrapper;
|
|
143
147
|
arr.ready = ready;
|
|
144
148
|
return arr;
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
}
|
|
195
195
|
return current;
|
|
196
196
|
};
|
|
197
|
-
const getCleanedCode = code => code?.replace(
|
|
197
|
+
const getCleanedCode = code => code?.replace(/_/g, '-');
|
|
198
198
|
const consoleLogger = {
|
|
199
199
|
type: 'logger',
|
|
200
200
|
log(args) {
|
|
@@ -450,7 +450,16 @@
|
|
|
450
450
|
const {
|
|
451
451
|
[PATH_KEY]: path
|
|
452
452
|
} = selector(createProxy());
|
|
453
|
-
|
|
453
|
+
const keySeparator = opts?.keySeparator ?? '.';
|
|
454
|
+
const nsSeparator = opts?.nsSeparator ?? ':';
|
|
455
|
+
if (path.length > 1 && nsSeparator) {
|
|
456
|
+
const ns = opts?.ns;
|
|
457
|
+
const nsArray = Array.isArray(ns) ? ns : null;
|
|
458
|
+
if (nsArray && nsArray.length > 1 && nsArray.slice(1).includes(path[0])) {
|
|
459
|
+
return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return path.join(keySeparator);
|
|
454
463
|
}
|
|
455
464
|
const checkedLoadedFor = {};
|
|
456
465
|
const shouldHandleAsObject = res => !isString$1(res) && typeof res !== 'boolean' && typeof res !== 'number';
|
|
@@ -523,6 +532,10 @@
|
|
|
523
532
|
...opt
|
|
524
533
|
});
|
|
525
534
|
if (!Array.isArray(keys)) keys = [String(keys)];
|
|
535
|
+
keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {
|
|
536
|
+
...this.options,
|
|
537
|
+
...opt
|
|
538
|
+
}) : String(k));
|
|
526
539
|
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
|
|
527
540
|
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
528
541
|
const {
|
|
@@ -769,6 +782,10 @@
|
|
|
769
782
|
let usedLng;
|
|
770
783
|
let usedNS;
|
|
771
784
|
if (isString$1(keys)) keys = [keys];
|
|
785
|
+
if (Array.isArray(keys)) keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {
|
|
786
|
+
...this.options,
|
|
787
|
+
...opt
|
|
788
|
+
}) : k);
|
|
772
789
|
keys.forEach(k => {
|
|
773
790
|
if (this.isValidLookup(found)) return;
|
|
774
791
|
const extracted = this.extractFromKey(k, opt);
|
|
@@ -1007,9 +1024,6 @@
|
|
|
1007
1024
|
this.logger = baseLogger.create('pluralResolver');
|
|
1008
1025
|
this.pluralRulesCache = {};
|
|
1009
1026
|
}
|
|
1010
|
-
addRule(lng, obj) {
|
|
1011
|
-
this.rules[lng] = obj;
|
|
1012
|
-
}
|
|
1013
1027
|
clearCache() {
|
|
1014
1028
|
this.pluralRulesCache = {};
|
|
1015
1029
|
}
|
|
@@ -1029,7 +1043,7 @@
|
|
|
1029
1043
|
type
|
|
1030
1044
|
});
|
|
1031
1045
|
} catch (err) {
|
|
1032
|
-
if (
|
|
1046
|
+
if (typeof Intl === 'undefined') {
|
|
1033
1047
|
this.logger.error('No Intl support, please use an Intl polyfill!');
|
|
1034
1048
|
return dummyRule;
|
|
1035
1049
|
}
|
|
@@ -1209,13 +1223,13 @@
|
|
|
1209
1223
|
const handleHasOptions = (key, inheritedOptions) => {
|
|
1210
1224
|
const sep = this.nestingOptionsSeparator;
|
|
1211
1225
|
if (key.indexOf(sep) < 0) return key;
|
|
1212
|
-
const c = key.split(new RegExp(`${sep}[ ]*{`));
|
|
1226
|
+
const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));
|
|
1213
1227
|
let optionsString = `{${c[1]}`;
|
|
1214
1228
|
key = c[0];
|
|
1215
1229
|
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1216
1230
|
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1217
1231
|
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1218
|
-
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes
|
|
1232
|
+
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) {
|
|
1219
1233
|
optionsString = optionsString.replace(/'/g, '"');
|
|
1220
1234
|
}
|
|
1221
1235
|
try {
|
|
@@ -1693,6 +1707,23 @@
|
|
|
1693
1707
|
}
|
|
1694
1708
|
});
|
|
1695
1709
|
};
|
|
1710
|
+
const SUPPORT_NOTICE_KEY = '__i18next_supportNoticeShown';
|
|
1711
|
+
const getSupportNoticeShown = () => typeof globalThis !== 'undefined' && !!globalThis[SUPPORT_NOTICE_KEY];
|
|
1712
|
+
const setSupportNoticeShown = () => {
|
|
1713
|
+
if (typeof globalThis !== 'undefined') globalThis[SUPPORT_NOTICE_KEY] = true;
|
|
1714
|
+
};
|
|
1715
|
+
const usesLocize = inst => {
|
|
1716
|
+
if (inst?.modules?.backend?.name?.indexOf('Locize') > 0) return true;
|
|
1717
|
+
if (inst?.modules?.backend?.constructor?.name?.indexOf('Locize') > 0) return true;
|
|
1718
|
+
if (inst?.options?.backend?.backends) {
|
|
1719
|
+
if (inst.options.backend.backends.some(b => b?.name?.indexOf('Locize') > 0 || b?.constructor?.name?.indexOf('Locize') > 0)) return true;
|
|
1720
|
+
}
|
|
1721
|
+
if (inst?.options?.backend?.projectId) return true;
|
|
1722
|
+
if (inst?.options?.backend?.backendOptions) {
|
|
1723
|
+
if (inst.options.backend.backendOptions.some(b => b?.projectId)) return true;
|
|
1724
|
+
}
|
|
1725
|
+
return false;
|
|
1726
|
+
};
|
|
1696
1727
|
class I18n extends EventEmitter {
|
|
1697
1728
|
constructor(options = {}, callback) {
|
|
1698
1729
|
super();
|
|
@@ -1745,6 +1776,10 @@
|
|
|
1745
1776
|
if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
|
|
1746
1777
|
this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
|
|
1747
1778
|
}
|
|
1779
|
+
if (this.options.showSupportNotice !== false && !usesLocize(this) && !getSupportNoticeShown()) {
|
|
1780
|
+
if (typeof console !== 'undefined' && typeof console.info !== 'undefined') console.info('🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙');
|
|
1781
|
+
setSupportNoticeShown();
|
|
1782
|
+
}
|
|
1748
1783
|
const createClassOnDemand = ClassOrObject => {
|
|
1749
1784
|
if (!ClassOrObject) return null;
|
|
1750
1785
|
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
|
@@ -2005,21 +2040,20 @@
|
|
|
2005
2040
|
o.lngs = o.lngs || fixedT.lngs;
|
|
2006
2041
|
o.ns = o.ns || fixedT.ns;
|
|
2007
2042
|
if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2043
|
+
const selectorOpts = {
|
|
2044
|
+
...this.options,
|
|
2045
|
+
...o
|
|
2046
|
+
};
|
|
2047
|
+
if (typeof o.keyPrefix === 'function') o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts);
|
|
2008
2048
|
const keySeparator = this.options.keySeparator || '.';
|
|
2009
2049
|
let resultKey;
|
|
2010
2050
|
if (o.keyPrefix && Array.isArray(key)) {
|
|
2011
2051
|
resultKey = key.map(k => {
|
|
2012
|
-
if (typeof k === 'function') k = keysFromSelector(k,
|
|
2013
|
-
...this.options,
|
|
2014
|
-
...opts
|
|
2015
|
-
});
|
|
2052
|
+
if (typeof k === 'function') k = keysFromSelector(k, selectorOpts);
|
|
2016
2053
|
return `${o.keyPrefix}${keySeparator}${k}`;
|
|
2017
2054
|
});
|
|
2018
2055
|
} else {
|
|
2019
|
-
if (typeof key === 'function') key = keysFromSelector(key,
|
|
2020
|
-
...this.options,
|
|
2021
|
-
...opts
|
|
2022
|
-
});
|
|
2056
|
+
if (typeof key === 'function') key = keysFromSelector(key, selectorOpts);
|
|
2023
2057
|
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
|
|
2024
2058
|
}
|
|
2025
2059
|
return this.t(resultKey, o);
|
|
@@ -2160,7 +2194,19 @@
|
|
|
2160
2194
|
clone.store = new ResourceStore(clonedData, mergedOptions);
|
|
2161
2195
|
clone.services.resourceStore = clone.store;
|
|
2162
2196
|
}
|
|
2163
|
-
if (options.interpolation)
|
|
2197
|
+
if (options.interpolation) {
|
|
2198
|
+
const defOpts = get();
|
|
2199
|
+
const mergedInterpolation = {
|
|
2200
|
+
...defOpts.interpolation,
|
|
2201
|
+
...this.options.interpolation,
|
|
2202
|
+
...options.interpolation
|
|
2203
|
+
};
|
|
2204
|
+
const mergedForInterpolator = {
|
|
2205
|
+
...mergedOptions,
|
|
2206
|
+
interpolation: mergedInterpolation
|
|
2207
|
+
};
|
|
2208
|
+
clone.services.interpolator = new Interpolator(mergedForInterpolator);
|
|
2209
|
+
}
|
|
2164
2210
|
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2165
2211
|
clone.translator.on('*', (event, ...args) => {
|
|
2166
2212
|
clone.emit(event, ...args);
|
|
@@ -3601,8 +3647,12 @@
|
|
|
3601
3647
|
wrapperLangRef.current = lang;
|
|
3602
3648
|
}
|
|
3603
3649
|
}
|
|
3604
|
-
const
|
|
3605
|
-
|
|
3650
|
+
const effectiveT = !ready && !useSuspense ? (...args) => {
|
|
3651
|
+
warnOnce(i18n, 'USE_T_BEFORE_READY', 'useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.');
|
|
3652
|
+
return t(...args);
|
|
3653
|
+
} : t;
|
|
3654
|
+
const arr = [effectiveT, i18nWrapper, ready];
|
|
3655
|
+
arr.t = effectiveT;
|
|
3606
3656
|
arr.i18n = i18nWrapper;
|
|
3607
3657
|
arr.ready = ready;
|
|
3608
3658
|
return arr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactI18next={},e.React)}(this,(function(e,t){"use strict";const s=e=>"string"==typeof e,n=()=>{let e,t;const s=new Promise(((s,n)=>{e=s,t=n}));return s.resolve=e,s.reject=t,s},i=e=>null==e?"":""+e,o=/###/g,r=e=>e&&e.indexOf("###")>-1?e.replace(o,"."):e,a=e=>!e||s(e),l=(e,t,n)=>{const i=s(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(a(e))return{};const t=r(i[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return a(e)?{}:{obj:e,k:r(i[o])}},c=(e,t,s)=>{const{obj:n,k:i}=l(e,t,Object);if(void 0!==n||1===t.length)return void(n[i]=s);let o=t[t.length-1],r=t.slice(0,t.length-1),a=l(e,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=l(e,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=s},u=(e,t)=>{const{obj:s,k:n}=l(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n]},p=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?s(e[i])||e[i]instanceof String||s(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):p(e[i],t[i],n):e[i]=t[i]);return e},h=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const g=e=>s(e)?e.replace(/[&<>"'\/]/g,(e=>d[e])):e;const f=[" ",",","?","!",";"],m=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),y=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(s);let i=e;for(let e=0;e<n.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let r=e;r<n.length;++r)if(r!==e&&(o+=s),o+=n[r],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<n.length-1)continue;e+=r-e+1;break}i=t}return i},x=e=>e?.replace("_","-"),v={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class b{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||v,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,n,i){return i&&!this.debug?null:(s(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new b(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new b(this.logger,e)}}var S=new b;class O{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,s])=>{for(let n=0;n<s;n++)e(...t)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((([s,n])=>{for(let i=0;i<n;i++)s.apply(s,[e,...t])}))}}}class k extends O{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,i={}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):s(n)&&o?a.push(...n.split(o)):a.push(n)));const l=u(this.data,a);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!l&&r&&s(n)?y(this.data?.[e]?.[t],n,o):l}addResource(e,t,s,n,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=[e,t];s&&(r=r.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(r=e.split("."),n=t,t=r[1]),this.addNamespaces(t),c(this.data,r,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,n,i={silent:!1}){for(const i in n)(s(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,s,n,i,o={silent:!1,skipCopy:!1}){let r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),n=s,s=t,t=r[1]),this.addNamespaces(t);let a=u(this.data,r)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?p(a,s,i):a={...a,...s},c(this.data,r,a),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}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((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var N={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,n,i){return e.forEach((e=>{t=this.processors[e]?.process(t,s,n,i)??t})),t}};const w=Symbol("i18next/PATH_KEY");function L(e,t){const{[w]:s}=e(function(){const e=[],t=Object.create(null);let s;return t.get=(n,i)=>(s?.revoke?.(),i===w?e:(e.push(i),s=Proxy.revocable(n,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return s.join(t?.keySeparator??".")}const $={},E=e=>!s(e)&&"boolean"!=typeof e&&"number"!=typeof e;class R extends O{constructor(e,t={}){super(),((e,t,s)=>{e.forEach((e=>{t[e]&&(s[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=S.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const n=this.resolve(e,s);if(void 0===n?.res)return!1;const i=E(n.res);return!1!==s.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const r=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,s)=>{t=t||"",s=s||"";const n=f.filter((e=>t.indexOf(e)<0&&s.indexOf(e)<0));if(0===n.length)return!0;const i=m.getRegExp(`(${n.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(s);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,i));if(r&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:s(o)?[o]:o};const r=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),e=r.join(i)}return{key:e,namespaces:s(o)?[o]:o}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=L(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let u=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const p=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return h?o?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:a;const d=this.resolve(e,i);let g=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,y=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==i.count&&!s(i.count),b=R.hasDefaultValue(i),S=v?this.pluralResolver.getSuffix(p,i.count,i):"",O=i.ordinal&&v?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",k=v&&!i.ordinal&&0===i.count,N=k&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${O}`]||i.defaultValue;let w=g;x&&!g&&b&&(w=N);const $=E(w),C=Object.prototype.toString.apply(w);if(!(x&&w&&$&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||s(y)&&Array.isArray(w))if(x&&s(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,i,n));else{let t=!1,s=!1;!this.isValidLookup(g)&&b&&(t=!0,g=N),this.isValidLookup(g)||(s=!0,g=a);const o=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:g,l=b&&N!==g&&this.options.updateMissing;if(s||t||l){if(this.logger.log(l?"updateKey":"missingKey",p,c,a,l?N:g),r){const e=this.resolve(a,{...i,keySeparator:!1});e&&e.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 e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const s=(e,t,s)=>{const n=b&&s!==g?s:o;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,n,l,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,n,l,i),this.emit("missingKey",e,c,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,i);k&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{s([e],a+t,i[`defaultValue${t}`]||N)}))})):s(e,a,N))}g=this.extendTranslation(g,e,i,d,n),s&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${c}${u}${a}`),(s||t)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,t?g:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,w,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(i),d):e}if(r){const e=Array.isArray(w),t=e?[]:{},s=e?m:f;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const n=`${s}${r}${e}`;t[e]=b&&!g?this.translate(n,{...i,defaultValue:E(N)?N[e]:void 0,joinArrays:!1,ns:l}):this.translate(n,{...i,joinArrays:!1,ns:l}),t[e]===n&&(t[e]=w[e])}g=t}}return o?(d.res=g,d.usedParams=this.getUsedParamsDetails(i),d):g}extendTranslation(e,t,n,i,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=s(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=n.replace&&!s(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||i.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,a=s(r)?[r]:r;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=N.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,o,r,a;return s(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(e,t),c=l.key;i=c;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=void 0!==t.count&&!s(t.count),h=p&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(s(t.context)||"number"==typeof t.context)&&""!==t.context,g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach((e=>{this.isValidLookup(n)||(a=e,$[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||($[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${g.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!!!")),g.forEach((s=>{if(this.isValidLookup(n))return;r=s;const i=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,c,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&0===e.indexOf(o)&&i.push(c+e.replace(o,this.options.pluralSeparator)),i.push(c+e),h&&i.push(c+n)),d){const s=`${c}${this.options.contextSeparator||"_"}${t.context}`;i.push(s),p&&(t.ordinal&&0===e.indexOf(o)&&i.push(s+e.replace(o,this.options.pluralSeparator)),i.push(s+e),h&&i.push(s+n))}}let a;for(;a=i.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(s,e,a,t))})))}))})),{res:n,usedKey:i,exactUsedKey:o,usedLng:r,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!s(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,12)&&void 0!==e[s])return!0;return!1}}class C{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=S.create("languageUtils")}getScriptPartFromCode(e){if(!(e=x(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=x(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(s(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}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("languageOnly"===this.options.load||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((e=>{if(t)return;const s=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(s)||(t=s)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),s(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),i=[],o=e=>{e&&(this.isSupportedCode(e)?i.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return s(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):s(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{i.indexOf(e)<0&&o(this.formatLanguageCode(e))})),i}}const P={zero:0,one:1,two:2,few:3,many:4,other:5},j={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class I{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=S.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=x("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(s,{type:n})}catch(s){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),j;if(!e.match(/-|_/))return j;const n=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(n,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort(((e,t)=>P[e]-P[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const T=(e,t,n,i=".",o=!0)=>{let r=((e,t,s)=>{const n=u(e,s);return void 0!==n?n:u(t,s)})(e,t,n);return!r&&o&&s(n)&&(r=y(e,n,i),void 0===r&&(r=y(t,n,i))),r},A=e=>e.replace(/\$/g,"$$$$");class V{constructor(e={}){this.logger=S.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:x,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:g,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?h(i):o||"{{",this.suffix=r?h(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?h(p):d||h("$t("),this.nestingSuffix=f?h(f):m||h(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=x||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"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,n,o){let r,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const s=T(t,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,{...o,...t,interpolationkey:e}):s}const s=e.split(this.formatSeparator),i=s.shift().trim(),r=s.join(this.formatSeparator).trim();return this.format(T(t,c,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...o,...t,interpolationkey:i})};this.resetRegExp();const p=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>A(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?A(this.escape(e)):A(e)}].forEach((t=>{for(l=0;r=t.regex.exec(e);){const n=r[1].trim();if(a=u(n),void 0===a)if("function"==typeof p){const t=p(e,r,o);a=s(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))a="";else{if(h){a=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else s(a)||this.useRawValueToEscape||(a=i(a));const c=t.safeValue(a);if(e=e.replace(r[0],c),h?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,l++,l>=this.maxReplaces)break}})),e}nest(e,t,n={}){let o,r,a;const l=(e,t)=>{const s=this.nestingOptionsSeparator;if(e.indexOf(s)<0)return e;const n=e.split(new RegExp(`${s}[ ]*{`));let i=`{${n[1]}`;e=n[0],i=this.interpolate(i,a);const o=i.match(/'/g),r=i.match(/"/g);((o?.length??0)%2==0&&!r||r.length%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let c=[];a={...n},a=a.replace&&!s(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==u&&(c=o[1].slice(u).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),o[1]=o[1].slice(0,u)),r=t(l.call(this,o[1].trim(),a),a),r&&o[0]===e&&!s(r))return r;s(r)||(r=i(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),c.length&&(r=c.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const F=e=>{const t={};return(s,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const r=n+JSON.stringify(o);let a=t[r];return a||(a=e(x(n),i),t[r]=a),a(s)}},D=e=>(t,s,n)=>e(x(s),n)(t);class U{constructor(e={}){this.logger=S.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?F:D;this.formats={number:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)})),currency:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)})),datetime:s(((e,t)=>{const s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)})),relativetime:s(((e,t)=>{const s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")})),list:s(((e,t)=>{const s=new Intl.ListFormat(e,{...t});return e=>s.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=F(t)}format(e,t,s,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const s={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?s.currency||(s.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?s.range||(s.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();s[o]||(s[o]=i),"false"===i&&(s[o]=!1),"true"===i&&(s[o]=!0),isNaN(i)||(s[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:s}})(t);if(this.formats[i]){let t=e;try{const r=n?.formatParams?.[n.interpolationkey]||{},a=r.locale||r.lng||n.locale||n.lng||s;t=this.formats[i](e,a,{...o,...n,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class K extends O{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=S.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?.(s,n.backend,n)}queueLoad(e,t,s,n){const i={},o={},r={},a={};return e.forEach((e=>{let n=!0;t.forEach((t=>{const r=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,n=!1,void 0===o[r]&&(o[r]=!0),void 0===i[r]&&(i[r]=!0),void 0===a[t]&&(a[t]=!0)))})),n||(r[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,s){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&s&&this.store.addResourceBundle(i,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const r={};this.queue.forEach((s=>{((e,t,s,n)=>{const{obj:i,k:o}=l(e,t,Object);i[o]=i[o]||[],i[o].push(s)})(s.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(s,e),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((e=>{r[e]||(r[e]={});const t=s.loaded[e];t.length&&t.forEach((t=>{void 0===r[e][t]&&(r[e][t]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((e=>!e.done))}read(e,t,s,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,s,n+1,2*i,o)}),i):o(r,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const s=a(e,t);s&&"function"==typeof s.then?s.then((e=>r(null,e))).catch(r):r(null,s)}catch(e){r(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();s(e)&&(e=this.languageUtils.toResolveHierarchy(e)),s(t)&&(t=[t]);const o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,((s,o)=>{s&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,s),!s&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,s,o)}))}saveMissing(e,t,s,n,i,o={},r=(()=>{})){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=s&&""!==s){if(this.backend?.create){const a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,s,n,a):l(e,t,s,n),i&&"function"==typeof i.then?i.then((e=>r(null,e))).catch(r):r(null,i)}catch(e){r(e)}else l(e,t,s,n,r,a)}e&&e[0]&&this.store.addResource(e[0],t,s,n)}}else this.logger.warn(`did not save key "${s}" 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!!!")}}const _=()=>({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:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),s(e[1])&&(t.defaultValue=e[1]),s(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const s=e[3]||e[2];Object.keys(s).forEach((e=>{t[e]=s[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),M=e=>(s(e.ns)&&(e.ns=[e.ns]),s(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),s(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),z=()=>{};class H extends O{constructor(e={},t){var s;if(super(),this.options=M(e),this.services={},this.logger=S,this.modules={external:[]},s=this,Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach((e=>{"function"==typeof s[e]&&(s[e]=s[e].bind(s))})),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,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(s(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=_();this.options={...i,...this.options,...M(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?S.init(o(this.modules.logger),this.options):S.init(null,this.options),e=this.modules.formatter?this.modules.formatter:U;const t=new C(this.options);this.store=new k(this.options.resources,this.options);const s=this.services;s.logger=S,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new I(t,{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"),!e||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(s.formatter=o(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new V(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new K(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new R(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[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((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const r=n(),a=()=>{const e=(e,s)=>{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),r.resolve(s),t(e,s)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),r}loadResources(e,t=z){let n=t;const i=s(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(i)t(i);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,s){const i=n();return"function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=z),this.services.backendConnector.reload(e,t,(e=>{i.resolve(),s(e)})),i}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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&N.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;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=n();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(s,n)=>{n?this.isLanguageChangingTo===e&&(o(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,i.resolve(((...e)=>this.t(...e))),t&&t(s,((...e)=>this.t(...e)))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=s(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(s(t)?[t]:t);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,(e=>{r(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),i}getFixedT(e,t,n){const i=(e,t,...s)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const r=this.options.keySeparator||".";let a;return o.keyPrefix&&Array.isArray(e)?a=e.map((e=>("function"==typeof e&&(e=L(e,{...this.options,...t})),`${o.keyPrefix}${r}${e}`))):("function"==typeof e&&(e=L(e,{...this.options,...t})),a=o.keyPrefix?`${o.keyPrefix}${r}${e}`:e),this.t(a,o)};return s(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}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 s=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const o=(e,t)=>{const s=this.services.backendConnector.state[`${e}|${t}`];return-1===s||0===s||2===s};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(s,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(s,e)||n&&!o(i,e)))}loadNamespaces(e,t){const i=n();return this.options.ns?(s(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=n();s(e)&&(e=[e]);const o=this.options.preload||[],r=e.filter((e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return r.length?(this.options.preload=o.concat(r),this.loadResources((e=>{i.resolve(),t&&t(e)})),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 t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new C(_());return e.toLowerCase().indexOf("-latn")>1?"ltr":["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"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new H(e,t);return s.createInstance=H.createInstance,s}cloneInstance(e={},t=z){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new H(n);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((s,n)=>(s[n]={...e[t][n]},s)),e[t]),e)),{});i.store=new k(e,n),i.services.resourceStore=i.store}return e.interpolation&&(i.services.interpolator=new V(n)),i.translator=new R(i.services,n),i.translator.on("*",((e,...t)=>{i.emit(e,...t)})),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const B=H.createInstance();function q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}B.createInstance,B.dir,B.init,B.loadResources,B.reloadResources,B.use,B.changeLanguage,B.getFixedT,B.t,B.exists,B.setDefaultNamespace,B.hasLoadedNamespace,B.loadNamespaces,B.loadLanguages;var J=q({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),W=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Y(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},s=e.match(/<\/?([^\s]+?)[/\s>]/);if(s&&(t.name=s[1],(J[s[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("--\x3e");return{type:"comment",comment:-1!==n?e.slice(4,n):""}}for(var i=new RegExp(W),o=null;null!==(o=i.exec(e));)if(o[0].trim())if(o[1]){var r=o[1].trim(),a=[r,""];r.indexOf("=")>-1&&(a=r.split("=")),t.attrs[a[0]]=a[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}var Z=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,G=/^\s*$/,X=Object.create(null);var Q=function(e,t){t||(t={}),t.components||(t.components=X);var s,n=[],i=[],o=-1,r=!1;if(0!==e.indexOf("<")){var a=e.indexOf("<");n.push({type:"text",content:-1===a?e:e.substring(0,a)})}return e.replace(Z,(function(a,l){if(r){if(a!=="</"+s.name+">")return;r=!1}var c,u="/"!==a.charAt(1),p=a.startsWith("\x3c!--"),h=l+a.length,d=e.charAt(h);if(p){var g=Y(a);return o<0?(n.push(g),n):((c=i[o]).children.push(g),n)}if(u&&(o++,"tag"===(s=Y(a)).type&&t.components[s.name]&&(s.type="component",r=!0),s.voidElement||r||!d||"<"===d||s.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),0===o&&n.push(s),(c=i[o-1])&&c.children.push(s),i[o]=s),(!u||s.voidElement)&&(o>-1&&(s.voidElement||s.name===a.slice(2,-1))&&(o--,s=-1===o?n:i[o]),!r&&"<"!==d&&d)){c=-1===o?n:i[o].children;var f=e.indexOf("<",h),m=e.slice(h,-1===f?void 0:f);G.test(m)&&(m=" "),(f>-1&&o+c.length>=0||" "!==m)&&c.push({type:"text",content:m})}})),n};const ee=(e,t,s,n)=>{const i=[s,{code:t,...n||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);ae(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},te={},se=(e,t,s,n)=>{ae(s)&&te[s]||(ae(s)&&(te[s]=new Date),ee(e,t,s,n))},ne=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout((()=>{e.off("initialized",s)}),0),t()};e.on("initialized",s)}},ie=(e,t,s)=>{e.loadNamespaces(t,ne(e,s))},oe=(e,t,s,n)=>{if(ae(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ie(e,s,n);s.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,ne(e,n))},re=e=>e.displayName||e.name||(ae(e)&&e.length>0?e:"Unknown"),ae=e=>"string"==typeof e,le=e=>"object"==typeof e&&null!==e,ce=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ue={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},pe=e=>ue[e],he=e=>e.replace(ce,pe);let de={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:he,transDefaultProps:void 0};const ge=(e={})=>{de={...de,...e}},fe=()=>de;let me;const ye=e=>{me=e},xe=()=>me,ve=(e,t)=>{if(!e)return!1;const s=e.props?.children??e.children;return t?s.length>0:!!s},be=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?Se(t):t},Se=e=>Array.isArray(e)?e:[e],Oe=e=>{const s={};if(!e)return s;const n=e=>{Se(e).forEach((e=>{ae(e)||(ve(e)?n(be(e)):le(e)&&!t.isValidElement(e)&&Object.assign(s,e))}))};return n(e),s},ke=(e,s,n,i)=>{if(!e)return"";let o="";const r=Se(e),a=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return r.forEach(((e,r)=>{if(ae(e))o+=`${e}`;else if(t.isValidElement(e)){const{props:t,type:l}=e,c=Object.keys(t).length,u=a.indexOf(l)>-1,p=t.children;if(!p&&u&&!c)return void(o+=`<${l}/>`);if(!p&&(!u||c)||t.i18nIsDynamicList)return void(o+=`<${r}></${r}>`);if(u&&1===c&&ae(p))return void(o+=`<${l}>${p}</${l}>`);const h=ke(p,s,n,i);o+=`<${r}>${h}</${r}>`}else if(null!==e)if(le(e)){const{format:t,...s}=e,r=Object.keys(s);if(1===r.length){const e=t?`${r[0]}, ${t}`:r[0];return void(o+=`{{${e}}}`)}ee(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:e})}else ee(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:e});else ee(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i})})),o},Ne=(e,s,n,i,o,r,a)=>{if(""===n)return[];const l=o.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map((e=>`<${e}`)).join("|")).test(n);if(!(e||s||c||a))return[n];const u=s??{},p=e=>{Se(e).forEach((e=>{ae(e)||(ve(e)?p(be(e)):le(e)&&!t.isValidElement(e)&&Object.assign(u,e))}))};p(e);const h=((e,t=[],s={})=>{if(!e)return e;const n=[...t,...Object.keys(s)];let i="",o=0;for(;o<e.length;)if("<"===e[o]){let t=!1;const s=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(s){const e=s[1];(/^\d+$/.test(e)||n.includes(e))&&(t=!0,i+=s[0],o+=s[0].length)}if(!t){const s=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(s){const e=s[1];(/^\d+$/.test(e)||n.includes(e))&&(t=!0,i+=s[0],o+=s[0].length)}}t||(i+="<",o+=1)}else i+=e[o],o+=1;return i})(n,l,u),d=Q(`<0>${h}</0>`),g={...u,...r},f=(e,s,n)=>{const i=be(e),o=y(i,s.children,n);return(e=>Array.isArray(e)&&e.every(t.isValidElement))(i)&&0===o.length||e.props?.i18nIsDynamicList?i:o},m=(e,s,n,i,o)=>{e.dummy?(e.children=s,n.push(t.cloneElement(e,{key:i},o?void 0:s))):n.push(...t.Children.map([e],(e=>{const n="data-i18n-is-dynamic-list",r={key:i,[n]:void 0};return e&&e.props&&Object.keys(e.props).forEach((t=>{"ref"!==t&&"children"!==t&&"i18nIsDynamicList"!==t&&t!==n&&(r[t]=e.props[t])})),t.cloneElement(e,r,o?null:s)})))},y=(e,n,r)=>{const u=Se(e);return Se(n).reduce(((e,n,p)=>{const h=n.children?.[0]?.content&&i.services.interpolator.interpolate(n.children[0].content,g,i.language);if("tag"===n.type){let d=u[parseInt(n.name,10)];!d&&s&&(d=s[n.name]),1!==r.length||d||(d=r[0][n.name]),d||(d={});const x={...n.attrs};a&&Object.keys(x).forEach((e=>{const t=x[e];ae(t)&&(x[e]=he(t))}));const v=0!==Object.keys(x).length?((e,t)=>{const s={...t};return s.props={...t.props,...e.props},s})({props:x},d):d,b=t.isValidElement(v),S=b&&ve(n,!0)&&!n.voidElement,O=c&&le(v)&&v.dummy&&!b,k=le(s)&&Object.hasOwnProperty.call(s,n.name);if(ae(v)){const t=i.services.interpolator.interpolate(v,g,i.language);e.push(t)}else if(ve(v)||S){const t=f(v,n,r);m(v,t,e,p)}else if(O){const t=y(u,n.children,r);m(v,t,e,p)}else if(Number.isNaN(parseFloat(n.name)))if(k){const t=f(v,n,r);m(v,t,e,p,n.voidElement)}else if(o.transSupportBasicHtmlNodes&&l.indexOf(n.name)>-1)if(n.voidElement)e.push(t.createElement(n.name,{key:`${n.name}-${p}`}));else{const s=y(u,n.children,r);e.push(t.createElement(n.name,{key:`${n.name}-${p}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{const t=y(u,n.children,r);e.push(`<${n.name}>${t}</${n.name}>`)}else if(le(v)&&!b){const t=n.children[0]?h:null;t&&e.push(t)}else m(v,h,e,p,1!==n.children.length||!h)}else if("text"===n.type){const s=o.transWrapTextNodes,r="function"==typeof o.unescape?o.unescape:fe().unescape,l=a?r(i.services.interpolator.interpolate(n.content,g,i.language)):i.services.interpolator.interpolate(n.content,g,i.language);s?e.push(t.createElement(s,{key:`${n.name}-${p}`},l)):e.push(l)}return e}),[])},x=y([{dummy:!0,children:e||[]}],d,Se(e||[]));return be(x[0])},we=(e,s,n)=>{const i=e.key||s,o=t.cloneElement(e,{key:i});if(!o.props||!o.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return o;return t.createElement((function(){return t.createElement(t.Fragment,null,o)}),{key:i})},Le=(e,t,s,n)=>e?Array.isArray(e)?((e,t)=>e.map(((e,s)=>we(e,s,t))))(e,t):le(e)?((e,t)=>{const s={};return Object.keys(e).forEach((n=>{Object.assign(s,{[n]:we(e[n],n,t)})})),s})(e,t):(se(s,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null,$e=e=>!!le(e)&&(!Array.isArray(e)&&Object.keys(e).reduce(((e,t)=>e&&Number.isNaN(Number.parseFloat(t))),!0));function Ee({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r={},values:a,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const f=p||xe();if(!f)return se(f,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:i}),e;const m=h||f.t.bind(f)||(e=>e),y={...fe(),...f.options?.react};let x=u||m.ns||f.options?.defaultNS;x=ae(x)?[x]:x||["translation"];const{transDefaultProps:v}=y,b=v?.tOptions?{...v.tOptions,...r}:r,S=d??v?.shouldUnescape,O=v?.values?{...v.values,...a}:a,k=v?.components?{...v.components,...c}:c,N=ke(e,y,f,i),w=l||b?.defaultValue||N||y.transEmptyNodeValue||("function"==typeof i?L(i):i),{hashTransKey:$}=y,E=i||($?$(N||w):N||w);a=f.options?.interpolation?.defaultVariables?O&&Object.keys(O).length>0?{...O,...f.options.interpolation.defaultVariables}:{...f.options.interpolation.defaultVariables}:O;const R=Oe(e);R&&"number"==typeof R.count&&void 0===s&&(s=R.count);const C=a||void 0!==s&&!f.options?.interpolation?.alwaysFormat||!e?b.interpolation:{interpolation:{...b.interpolation,prefix:"#$?",suffix:"?$#"}},P={...b,context:o||b.context,count:s,...a,...C,defaultValue:w,ns:x};let j=E?m(E,P):w;j===E&&w&&(j=w);const I=Le(k,j,f,i);let T=I||e,A=null;$e(I)&&(A=I,T=e);const V=Ne(T,A,j,f,y,P,S),F=n??y.defaultTransParent;return F?t.createElement(F,g,V):V}const Re={type:"3rdParty",init(e){ge(e.options.react),ye(e)}},Ce=t.createContext();class Pe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const je=e=>async t=>({...await(e.getInitialProps?.(t))??{},...Ie()}),Ie=()=>{const e=xe();if(!e)return console.warn("react-i18next:: getInitialProps: You will need to pass in an i18next instance by using initReactI18next"),{};const t=e.reportNamespaces?.getUsedNamespaces()??[],s={},n={};return e.languages.forEach((s=>{n[s]={},t.forEach((t=>{n[s][t]=e.getResourceBundle(s,t)||{}}))})),s.initialI18nStore=n,s.initialLanguage=e.language,s};class Te extends Error{constructor(e,t,s){super(e),this.name="TranslationParserError",this.position=t,this.translationString=s,Error.captureStackTrace&&Error.captureStackTrace(this,Te)}}const Ae={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","¡":"¡","¿":"¿","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"ª","º":"º","¯":"¯","´":"´","¸":"¸","¹":"¹","²":"²","³":"³","¼":"¼","½":"½","¾":"¾","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"},Ve=new RegExp(Object.keys(Ae).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),Fe=(e,s=[])=>{if(!e)return[];const n=(e=>{const t=[];let s=0,n="";const i=()=>{n&&(t.push({type:"Text",value:n,position:s-n.length}),n="")};for(;s<e.length;){const o=e[s];if("<"===o){const r=e.slice(s).match(/^<(\d+)>/);if(r)i(),t.push({type:"TagOpen",value:r[0],position:s,tagNumber:parseInt(r[1],10)}),s+=r[0].length;else{const r=e.slice(s).match(/^<\/(\d+)>/);r?(i(),t.push({type:"TagClose",value:r[0],position:s,tagNumber:parseInt(r[1],10)}),s+=r[0].length):(n+=o,s+=1)}}else n+=o,s+=1}return i(),t})(e),i=[],o=[],r=new Set;if(n.forEach((n=>{switch(n.type){case"Text":{const e=n.value.replace(Ve,(e=>Ae[e])).replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&#x([0-9a-fA-F]+);/g,((e,t)=>String.fromCharCode(parseInt(t,16))));(o.length>0?o[o.length-1].children:i).push(e)}break;case"TagOpen":{const{tagNumber:e}=n,t=(()=>{if(0===o.length)return s;const e=o[o.length-1];return e.declaration.props?.children&&Array.isArray(e.declaration.props.children)?e.declaration.props.children:e.declarations})(),a=t[e];if(!a){r.add(e);const t=`<${e}>`;(o.length>0?o[o.length-1].children:i).push(t);break}o.push({tagNumber:e,children:[],position:n.position,declaration:a,declarations:t})}break;case"TagClose":{const{tagNumber:s}=n;if(r.has(s)){const e=`</${s}>`;(o.length>0?o[o.length-1].children:i).push(e),r.delete(s);break}if(0===o.length)throw new Te(`Unexpected closing tag </${s}> at position ${n.position}`,n.position,e);const a=o.pop();if(a.tagNumber!==s)throw new Te(`Mismatched tags: expected </${a.tagNumber}> but got </${s}> at position ${n.position}`,n.position,e);const l=((e,s,n)=>{const{type:i,props:o={}}=e;if(o.children&&Array.isArray(o.children)&&n){const{children:e,...n}=o;return t.createElement(i,n,...s)}return 0===s.length?t.createElement(i,o):1===s.length?t.createElement(i,o,s[0]):t.createElement(i,o,...s)})(a.declaration,a.children,a.declarations);(o.length>0?o[o.length-1].children:i).push(l)}}})),o.length>0){const t=o[o.length-1];throw new Te(`Unclosed tag <${t.tagNumber}> at position ${t.position}`,t.position,e)}return i};function De({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:r,t:a}){const l=r||xe();if(!l)return se(l,"NO_I18NEXT_INSTANCE","IcuTrans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:e}),t.createElement(t.Fragment,{},s);const c=a||l.t?.bind(l)||(e=>e);let u=i||c.ns||l.options?.defaultNS;u=ae(u)?[u]:u||["translation"];let p=o;l.options?.interpolation?.defaultVariables&&(p=o&&Object.keys(o).length>0?{...o,...l.options.interpolation.defaultVariables}:{...l.options.interpolation.defaultVariables});const h=c(e,{defaultValue:s,...p,ns:u});try{const e=Fe(h,n);return t.createElement(t.Fragment,{},...e)}catch(s){return ee(l,"ICU_TRANS_RENDER_ERROR",`IcuTrans component error for key "${e}": ${s.message}`,{i18nKey:e,error:s}),t.createElement(t.Fragment,{},h)}}function Ue({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:r,t:a}){const{i18n:l,defaultNS:c}=t.useContext(Ce)||{},u=r||l||xe(),p=a||u?.t.bind(u);return De({i18nKey:e,defaultTranslation:s,content:n,ns:i||p?.ns||c||u?.options?.defaultNS,values:o,i18n:u,t:a})}De.displayName="IcuTransWithoutContext",Ue.displayName="IcuTrans";var Ke={exports:{}},_e={},Me=t;var ze="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},He=Me.useState,Be=Me.useEffect,qe=Me.useLayoutEffect,Je=Me.useDebugValue;function We(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!ze(e,s)}catch(e){return!0}}var Ye="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),n=He({inst:{value:s,getSnapshot:t}}),i=n[0].inst,o=n[1];return qe((function(){i.value=s,i.getSnapshot=t,We(i)&&o({inst:i})}),[e,s,t]),Be((function(){return We(i)&&o({inst:i}),e((function(){We(i)&&o({inst:i})}))}),[e]),Je(s),s};_e.useSyncExternalStore=void 0!==Me.useSyncExternalStore?Me.useSyncExternalStore:Ye,Ke.exports=_e;var Ze=Ke.exports;const Ge={t:(e,t)=>{if(ae(t))return t;if(le(t)&&ae(t.defaultValue))return t.defaultValue;if("function"==typeof e)return"";if(Array.isArray(e)){const t=e[e.length-1];return"function"==typeof t?"":t}return e},ready:!1},Xe=()=>()=>{},Qe=(e,s={})=>{const{i18n:n}=s,{i18n:i,defaultNS:o}=t.useContext(Ce)||{},r=n||i||xe();r&&!r.reportNamespaces&&(r.reportNamespaces=new Pe),r||se(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=t.useMemo((()=>({...fe(),...r?.options?.react,...s})),[r,s]),{useSuspense:l,keyPrefix:c}=a,u=e||o||r?.options?.defaultNS,p=ae(u)?[u]:u||["translation"],h=t.useMemo((()=>p),p);r?.reportNamespaces?.addUsedNamespaces?.(h);const d=t.useRef(0),g=t.useCallback((e=>{if(!r)return Xe;const{bindI18n:t,bindI18nStore:s}=a,n=()=>{d.current+=1,e()};return t&&r.on(t,n),s&&r.store.on(s,n),()=>{t&&t.split(" ").forEach((e=>r.off(e,n))),s&&s.split(" ").forEach((e=>r.store.off(e,n)))}}),[r,a]),f=t.useRef(),m=t.useCallback((()=>{if(!r)return Ge;const e=!(!r.isInitialized&&!r.initializedStoreOnce)&&h.every((e=>((e,t,s={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:s.lng,precheck:(t,n)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(se(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,r,a))),t=s.lng||r.language,n=d.current,i=f.current;if(i&&i.ready===e&&i.lng===t&&i.keyPrefix===c&&i.revision===n)return i;const o={t:r.getFixedT(t,"fallback"===a.nsMode?h:h[0],c),ready:e,lng:t,keyPrefix:c,revision:n};return f.current=o,o}),[r,h,c,a,s.lng]),[y,x]=t.useState(0),{t:v,ready:b}=Ze.useSyncExternalStore(g,m,m);t.useEffect((()=>{if(r&&!b&&!l){const e=()=>x((e=>e+1));s.lng?oe(r,s.lng,h,e):ie(r,h,e)}}),[r,s.lng,h,b,l,y]);const S=r||{},O=t.useRef(null),k=t.useRef(),N=e=>{const t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;const s=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(s,"__original"))try{Object.defineProperty(s,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch(e){}return s},w=t.useMemo((()=>{const e=S,t=e?.language;let s=e;e&&(O.current&&O.current.__original===e?k.current!==t?(s=N(e),O.current=s,k.current=t):s=O.current:(s=N(e),O.current=s,k.current=t));const n=[v,s,b];return n.t=v,n.i18n=s,n.ready=b,n}),[v,S,b,S.resolvedLanguage,S.language,S.languages]);if(r&&l&&!b)throw new Promise((e=>{const t=()=>e();s.lng?oe(r,s.lng,h,t):ie(r,h,t)}));return w};const et=(e,s,n={})=>{const{i18n:i}=n,{i18n:o}=t.useContext(Ce)||{},r=i||o||xe();if(r){if(!r.options?.isClone){if(e&&!r.initializedStoreOnce){if(!r.services?.resourceStore)return void se(r,"I18N_NOT_INITIALIZED","useSSR: i18n instance was found but not initialized (services.resourceStore is missing). Make sure you call i18next.init() before using useSSR — e.g. at module level, not only in getStaticProps/getServerSideProps.");r.services.resourceStore.data=e,r.options.ns=Object.values(e).reduce(((e,t)=>(Object.keys(t).forEach((t=>{e.indexOf(t)<0&&e.push(t)})),e)),r.options.ns),r.initializedStoreOnce=!0,r.isInitialized=!0}s&&!r.initializedLanguageOnce&&(r.changeLanguage(s),r.initializedLanguageOnce=!0)}}else se(r,"NO_I18NEXT_INSTANCE","useSSR: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.")};e.I18nContext=Ce,e.I18nextProvider=function({i18n:e,defaultNS:s,children:n}){const i=t.useMemo((()=>({i18n:e,defaultNS:s})),[e,s]);return t.createElement(Ce.Provider,{value:i},n)},e.IcuTrans=Ue,e.IcuTransWithoutContext=De,e.Trans=function({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r={},values:a,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const{i18n:f,defaultNS:m}=t.useContext(Ce)||{},y=p||f||xe(),x=h||y?.t.bind(y);return Ee({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r,values:a,defaults:l,components:c,ns:u||x?.ns||m||y?.options?.defaultNS,i18n:y,t:h,shouldUnescape:d,...g})},e.TransWithoutContext=Ee,e.Translation=({ns:e,children:t,...s})=>{const[n,i,o]=Qe(e,s);return t(n,{i18n:i,lng:i?.language},o)},e.composeInitialProps=je,e.date=()=>"",e.getDefaults=fe,e.getI18n=xe,e.getInitialProps=Ie,e.initReactI18next=Re,e.nodesToString=ke,e.number=()=>"",e.plural=()=>"",e.select=()=>"",e.selectOrdinal=()=>"",e.setDefaults=ge,e.setI18n=ye,e.time=()=>"",e.useSSR=et,e.useTranslation=Qe,e.withSSR=()=>function(e){function s({initialI18nStore:s,initialLanguage:n,...i}){return et(s,n),t.createElement(e,{...i})}return s.getInitialProps=je(e),s.displayName=`withI18nextSSR(${re(e)})`,s.WrappedComponent=e,s},e.withTranslation=(e,s={})=>function(n){function i({forwardedRef:i,...o}){const[r,a,l]=Qe(e,{...o,keyPrefix:s.keyPrefix}),c={...o,t:r,i18n:a,tReady:l};return s.withRef&&i?c.ref=i:!s.withRef&&i&&(c.forwardedRef=i),t.createElement(n,c)}i.displayName=`withI18nextTranslation(${re(n)})`,i.WrappedComponent=n;return s.withRef?t.forwardRef(((e,s)=>t.createElement(i,Object.assign({},e,{forwardedRef:s})))):i}}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactI18next={},e.React)}(this,(function(e,t){"use strict";const s=e=>"string"==typeof e,n=()=>{let e,t;const s=new Promise(((s,n)=>{e=s,t=n}));return s.resolve=e,s.reject=t,s},i=e=>null==e?"":""+e,o=/###/g,r=e=>e&&e.indexOf("###")>-1?e.replace(o,"."):e,a=e=>!e||s(e),l=(e,t,n)=>{const i=s(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(a(e))return{};const t=r(i[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return a(e)?{}:{obj:e,k:r(i[o])}},c=(e,t,s)=>{const{obj:n,k:i}=l(e,t,Object);if(void 0!==n||1===t.length)return void(n[i]=s);let o=t[t.length-1],r=t.slice(0,t.length-1),a=l(e,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=l(e,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=s},u=(e,t)=>{const{obj:s,k:n}=l(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n]},p=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?s(e[i])||e[i]instanceof String||s(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):p(e[i],t[i],n):e[i]=t[i]);return e},h=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const g=e=>s(e)?e.replace(/[&<>"'\/]/g,(e=>d[e])):e;const f=[" ",",","?","!",";"],m=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),y=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(s);let i=e;for(let e=0;e<n.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let r=e;r<n.length;++r)if(r!==e&&(o+=s),o+=n[r],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<n.length-1)continue;e+=r-e+1;break}i=t}return i},x=e=>e?.replace(/_/g,"-"),b={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class v{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||b,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,n,i){return i&&!this.debug?null:(s(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new v(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new v(this.logger,e)}}var S=new v;class O{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,s])=>{for(let n=0;n<s;n++)e(...t)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((([s,n])=>{for(let i=0;i<n;i++)s.apply(s,[e,...t])}))}}}class k extends O{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,i={}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):s(n)&&o?a.push(...n.split(o)):a.push(n)));const l=u(this.data,a);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!l&&r&&s(n)?y(this.data?.[e]?.[t],n,o):l}addResource(e,t,s,n,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=[e,t];s&&(r=r.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(r=e.split("."),n=t,t=r[1]),this.addNamespaces(t),c(this.data,r,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,n,i={silent:!1}){for(const i in n)(s(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,s,n,i,o={silent:!1,skipCopy:!1}){let r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),n=s,s=t,t=r[1]),this.addNamespaces(t);let a=u(this.data,r)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?p(a,s,i):a={...a,...s},c(this.data,r,a),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}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((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var w={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,n,i){return e.forEach((e=>{t=this.processors[e]?.process(t,s,n,i)??t})),t}};const N=Symbol("i18next/PATH_KEY");function L(e,t){const{[N]:s}=e(function(){const e=[],t=Object.create(null);let s;return t.get=(n,i)=>(s?.revoke?.(),i===N?e:(e.push(i),s=Proxy.revocable(n,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),n=t?.keySeparator??".",i=t?.nsSeparator??":";if(s.length>1&&i){const e=t?.ns,o=Array.isArray(e)?e:null;if(o&&o.length>1&&o.slice(1).includes(s[0]))return`${s[0]}${i}${s.slice(1).join(n)}`}return s.join(n)}const $={},E=e=>!s(e)&&"boolean"!=typeof e&&"number"!=typeof e;class R extends O{constructor(e,t={}){super(),((e,t,s)=>{e.forEach((e=>{t[e]&&(s[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=S.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const n=this.resolve(e,s);if(void 0===n?.res)return!1;const i=E(n.res);return!1!==s.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const r=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,s)=>{t=t||"",s=s||"";const n=f.filter((e=>t.indexOf(e)<0&&s.indexOf(e)<0));if(0===n.length)return!0;const i=m.getRegExp(`(${n.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(s);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,i));if(r&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:s(o)?[o]:o};const r=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),e=r.join(i)}return{key:e,namespaces:s(o)?[o]:o}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=L(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map((e=>"function"==typeof e?L(e,{...this.options,...i}):String(e)));const o=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let u=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const p=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return h?o?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:a;const d=this.resolve(e,i);let g=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,y=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==i.count&&!s(i.count),v=R.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(p,i.count,i):"",O=i.ordinal&&b?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",k=b&&!i.ordinal&&0===i.count,w=k&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${O}`]||i.defaultValue;let N=g;x&&!g&&v&&(N=w);const $=E(N),C=Object.prototype.toString.apply(N);if(!(x&&N&&$&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||s(y)&&Array.isArray(N))if(x&&s(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,i,n));else{let t=!1,s=!1;!this.isValidLookup(g)&&v&&(t=!0,g=w),this.isValidLookup(g)||(s=!0,g=a);const o=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:g,l=v&&w!==g&&this.options.updateMissing;if(s||t||l){if(this.logger.log(l?"updateKey":"missingKey",p,c,a,l?w:g),r){const e=this.resolve(a,{...i,keySeparator:!1});e&&e.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 e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const s=(e,t,s)=>{const n=v&&s!==g?s:o;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,n,l,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,n,l,i),this.emit("missingKey",e,c,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,i);k&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{s([e],a+t,i[`defaultValue${t}`]||w)}))})):s(e,a,w))}g=this.extendTranslation(g,e,i,d,n),s&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${c}${u}${a}`),(s||t)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,t?g:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,N,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(i),d):e}if(r){const e=Array.isArray(N),t=e?[]:{},s=e?m:f;for(const e in N)if(Object.prototype.hasOwnProperty.call(N,e)){const n=`${s}${r}${e}`;t[e]=v&&!g?this.translate(n,{...i,defaultValue:E(w)?w[e]:void 0,joinArrays:!1,ns:l}):this.translate(n,{...i,joinArrays:!1,ns:l}),t[e]===n&&(t[e]=N[e])}g=t}}return o?(d.res=g,d.usedParams=this.getUsedParamsDetails(i),d):g}extendTranslation(e,t,n,i,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=s(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=n.replace&&!s(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||i.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,a=s(r)?[r]:r;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=w.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,o,r,a;return s(e)&&(e=[e]),Array.isArray(e)&&(e=e.map((e=>"function"==typeof e?L(e,{...this.options,...t}):e))),e.forEach((e=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(e,t),c=l.key;i=c;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=void 0!==t.count&&!s(t.count),h=p&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(s(t.context)||"number"==typeof t.context)&&""!==t.context,g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach((e=>{this.isValidLookup(n)||(a=e,$[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||($[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${g.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!!!")),g.forEach((s=>{if(this.isValidLookup(n))return;r=s;const i=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,c,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&0===e.indexOf(o)&&i.push(c+e.replace(o,this.options.pluralSeparator)),i.push(c+e),h&&i.push(c+n)),d){const s=`${c}${this.options.contextSeparator||"_"}${t.context}`;i.push(s),p&&(t.ordinal&&0===e.indexOf(o)&&i.push(s+e.replace(o,this.options.pluralSeparator)),i.push(s+e),h&&i.push(s+n))}}let a;for(;a=i.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(s,e,a,t))})))}))})),{res:n,usedKey:i,exactUsedKey:o,usedLng:r,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!s(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,12)&&void 0!==e[s])return!0;return!1}}class C{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=S.create("languageUtils")}getScriptPartFromCode(e){if(!(e=x(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=x(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(s(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}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("languageOnly"===this.options.load||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((e=>{if(t)return;const s=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(s)||(t=s)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),s(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),i=[],o=e=>{e&&(this.isSupportedCode(e)?i.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return s(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):s(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{i.indexOf(e)<0&&o(this.formatLanguageCode(e))})),i}}const P={zero:0,one:1,two:2,few:3,many:4,other:5},j={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class I{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=S.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=x("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(s,{type:n})}catch(s){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),j;if(!e.match(/-|_/))return j;const n=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(n,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort(((e,t)=>P[e]-P[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const T=(e,t,n,i=".",o=!0)=>{let r=((e,t,s)=>{const n=u(e,s);return void 0!==n?n:u(t,s)})(e,t,n);return!r&&o&&s(n)&&(r=y(e,n,i),void 0===r&&(r=y(t,n,i))),r},A=e=>e.replace(/\$/g,"$$$$");class V{constructor(e={}){this.logger=S.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:x,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:g,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?h(i):o||"{{",this.suffix=r?h(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?h(p):d||h("$t("),this.nestingSuffix=f?h(f):m||h(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=x||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"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,n,o){let r,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const s=T(t,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,{...o,...t,interpolationkey:e}):s}const s=e.split(this.formatSeparator),i=s.shift().trim(),r=s.join(this.formatSeparator).trim();return this.format(T(t,c,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...o,...t,interpolationkey:i})};this.resetRegExp();const p=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>A(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?A(this.escape(e)):A(e)}].forEach((t=>{for(l=0;r=t.regex.exec(e);){const n=r[1].trim();if(a=u(n),void 0===a)if("function"==typeof p){const t=p(e,r,o);a=s(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))a="";else{if(h){a=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else s(a)||this.useRawValueToEscape||(a=i(a));const c=t.safeValue(a);if(e=e.replace(r[0],c),h?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,l++,l>=this.maxReplaces)break}})),e}nest(e,t,n={}){let o,r,a;const l=(e,t)=>{const s=this.nestingOptionsSeparator;if(e.indexOf(s)<0)return e;const n=e.split(new RegExp(`${h(s)}[ ]*{`));let i=`{${n[1]}`;e=n[0],i=this.interpolate(i,a);const o=i.match(/'/g),r=i.match(/"/g);((o?.length??0)%2==0&&!r||(r?.length??0)%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let c=[];a={...n},a=a.replace&&!s(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==u&&(c=o[1].slice(u).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),o[1]=o[1].slice(0,u)),r=t(l.call(this,o[1].trim(),a),a),r&&o[0]===e&&!s(r))return r;s(r)||(r=i(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),c.length&&(r=c.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const F=e=>{const t={};return(s,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const r=n+JSON.stringify(o);let a=t[r];return a||(a=e(x(n),i),t[r]=a),a(s)}},D=e=>(t,s,n)=>e(x(s),n)(t);class U{constructor(e={}){this.logger=S.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?F:D;this.formats={number:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)})),currency:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)})),datetime:s(((e,t)=>{const s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)})),relativetime:s(((e,t)=>{const s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")})),list:s(((e,t)=>{const s=new Intl.ListFormat(e,{...t});return e=>s.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=F(t)}format(e,t,s,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const s={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?s.currency||(s.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?s.range||(s.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();s[o]||(s[o]=i),"false"===i&&(s[o]=!1),"true"===i&&(s[o]=!0),isNaN(i)||(s[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:s}})(t);if(this.formats[i]){let t=e;try{const r=n?.formatParams?.[n.interpolationkey]||{},a=r.locale||r.lng||n.locale||n.lng||s;t=this.formats[i](e,a,{...o,...n,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class _ extends O{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=S.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?.(s,n.backend,n)}queueLoad(e,t,s,n){const i={},o={},r={},a={};return e.forEach((e=>{let n=!0;t.forEach((t=>{const r=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,n=!1,void 0===o[r]&&(o[r]=!0),void 0===i[r]&&(i[r]=!0),void 0===a[t]&&(a[t]=!0)))})),n||(r[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,s){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&s&&this.store.addResourceBundle(i,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const r={};this.queue.forEach((s=>{((e,t,s,n)=>{const{obj:i,k:o}=l(e,t,Object);i[o]=i[o]||[],i[o].push(s)})(s.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(s,e),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((e=>{r[e]||(r[e]={});const t=s.loaded[e];t.length&&t.forEach((t=>{void 0===r[e][t]&&(r[e][t]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((e=>!e.done))}read(e,t,s,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,s,n+1,2*i,o)}),i):o(r,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const s=a(e,t);s&&"function"==typeof s.then?s.then((e=>r(null,e))).catch(r):r(null,s)}catch(e){r(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();s(e)&&(e=this.languageUtils.toResolveHierarchy(e)),s(t)&&(t=[t]);const o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,((s,o)=>{s&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,s),!s&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,s,o)}))}saveMissing(e,t,s,n,i,o={},r=(()=>{})){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=s&&""!==s){if(this.backend?.create){const a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,s,n,a):l(e,t,s,n),i&&"function"==typeof i.then?i.then((e=>r(null,e))).catch(r):r(null,i)}catch(e){r(e)}else l(e,t,s,n,r,a)}e&&e[0]&&this.store.addResource(e[0],t,s,n)}}else this.logger.warn(`did not save key "${s}" 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!!!")}}const K=()=>({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:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),s(e[1])&&(t.defaultValue=e[1]),s(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const s=e[3]||e[2];Object.keys(s).forEach((e=>{t[e]=s[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),z=e=>(s(e.ns)&&(e.ns=[e.ns]),s(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),s(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),M=()=>{},H="__i18next_supportNoticeShown";class B extends O{constructor(e={},t){var s;if(super(),this.options=z(e),this.services={},this.logger=S,this.modules={external:[]},s=this,Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach((e=>{"function"==typeof s[e]&&(s[e]=s[e].bind(s))})),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,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(s(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=K();var o;this.options={...i,...this.options,...z(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(o=this,o?.modules?.backend?.name?.indexOf("Locize")>0||o?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||o?.options?.backend?.backends&&o.options.backend.backends.some((e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0))||o?.options?.backend?.projectId||o?.options?.backend?.backendOptions&&o.options.backend.backendOptions.some((e=>e?.projectId)))||"undefined"!=typeof globalThis&&globalThis[H]||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[H]=!0));const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?S.init(r(this.modules.logger),this.options):S.init(null,this.options),e=this.modules.formatter?this.modules.formatter:U;const t=new C(this.options);this.store=new k(this.options.resources,this.options);const s=this.services;s.logger=S,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new I(t,{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"),!e||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(s.formatter=r(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new V(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new _(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new R(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=M),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[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((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const a=n(),l=()=>{const e=(e,s)=>{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(s),t(e,s)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,t=M){let n=t;const i=s(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(i)t(i);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,s){const i=n();return"function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=M),this.services.backendConnector.reload(e,t,(e=>{i.resolve(),s(e)})),i}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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&w.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;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=n();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(s,n)=>{n?this.isLanguageChangingTo===e&&(o(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,i.resolve(((...e)=>this.t(...e))),t&&t(s,((...e)=>this.t(...e)))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=s(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(s(t)?[t]:t);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,(e=>{r(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),i}getFixedT(e,t,n){const i=(e,t,...s)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const r={...this.options,...o};"function"==typeof o.keyPrefix&&(o.keyPrefix=L(o.keyPrefix,r));const a=this.options.keySeparator||".";let l;return o.keyPrefix&&Array.isArray(e)?l=e.map((e=>("function"==typeof e&&(e=L(e,r)),`${o.keyPrefix}${a}${e}`))):("function"==typeof e&&(e=L(e,r)),l=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(l,o)};return s(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}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 s=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const o=(e,t)=>{const s=this.services.backendConnector.state[`${e}|${t}`];return-1===s||0===s||2===s};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(s,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(s,e)||n&&!o(i,e)))}loadNamespaces(e,t){const i=n();return this.options.ns?(s(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=n();s(e)&&(e=[e]);const o=this.options.preload||[],r=e.filter((e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return r.length?(this.options.preload=o.concat(r),this.loadResources((e=>{i.resolve(),t&&t(e)})),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 t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new C(K());return e.toLowerCase().indexOf("-latn")>1?"ltr":["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"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new B(e,t);return s.createInstance=B.createInstance,s}cloneInstance(e={},t=M){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new B(n);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((s,n)=>(s[n]={...e[t][n]},s)),e[t]),e)),{});i.store=new k(e,n),i.services.resourceStore=i.store}if(e.interpolation){const t={...K().interpolation,...this.options.interpolation,...e.interpolation},s={...n,interpolation:t};i.services.interpolator=new V(s)}return i.translator=new R(i.services,n),i.translator.on("*",((e,...t)=>{i.emit(e,...t)})),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const q=B.createInstance();function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT,q.t,q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;var W=J({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Y=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Z(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},s=e.match(/<\/?([^\s]+?)[/\s>]/);if(s&&(t.name=s[1],(W[s[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("--\x3e");return{type:"comment",comment:-1!==n?e.slice(4,n):""}}for(var i=new RegExp(Y),o=null;null!==(o=i.exec(e));)if(o[0].trim())if(o[1]){var r=o[1].trim(),a=[r,""];r.indexOf("=")>-1&&(a=r.split("=")),t.attrs[a[0]]=a[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}var G=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,X=/^\s*$/,Q=Object.create(null);var ee=function(e,t){t||(t={}),t.components||(t.components=Q);var s,n=[],i=[],o=-1,r=!1;if(0!==e.indexOf("<")){var a=e.indexOf("<");n.push({type:"text",content:-1===a?e:e.substring(0,a)})}return e.replace(G,(function(a,l){if(r){if(a!=="</"+s.name+">")return;r=!1}var c,u="/"!==a.charAt(1),p=a.startsWith("\x3c!--"),h=l+a.length,d=e.charAt(h);if(p){var g=Z(a);return o<0?(n.push(g),n):((c=i[o]).children.push(g),n)}if(u&&(o++,"tag"===(s=Z(a)).type&&t.components[s.name]&&(s.type="component",r=!0),s.voidElement||r||!d||"<"===d||s.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),0===o&&n.push(s),(c=i[o-1])&&c.children.push(s),i[o]=s),(!u||s.voidElement)&&(o>-1&&(s.voidElement||s.name===a.slice(2,-1))&&(o--,s=-1===o?n:i[o]),!r&&"<"!==d&&d)){c=-1===o?n:i[o].children;var f=e.indexOf("<",h),m=e.slice(h,-1===f?void 0:f);X.test(m)&&(m=" "),(f>-1&&o+c.length>=0||" "!==m)&&c.push({type:"text",content:m})}})),n};const te=(e,t,s,n)=>{const i=[s,{code:t,...n||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);le(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},se={},ne=(e,t,s,n)=>{le(s)&&se[s]||(le(s)&&(se[s]=new Date),te(e,t,s,n))},ie=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout((()=>{e.off("initialized",s)}),0),t()};e.on("initialized",s)}},oe=(e,t,s)=>{e.loadNamespaces(t,ie(e,s))},re=(e,t,s,n)=>{if(le(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return oe(e,s,n);s.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,ie(e,n))},ae=e=>e.displayName||e.name||(le(e)&&e.length>0?e:"Unknown"),le=e=>"string"==typeof e,ce=e=>"object"==typeof e&&null!==e,ue=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},he=e=>pe[e],de=e=>e.replace(ue,he);let ge={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:de,transDefaultProps:void 0};const fe=(e={})=>{ge={...ge,...e}},me=()=>ge;let ye;const xe=e=>{ye=e},be=()=>ye,ve=(e,t)=>{if(!e)return!1;const s=e.props?.children??e.children;return t?s.length>0:!!s},Se=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?Oe(t):t},Oe=e=>Array.isArray(e)?e:[e],ke=e=>{const s={};if(!e)return s;const n=e=>{Oe(e).forEach((e=>{le(e)||(ve(e)?n(Se(e)):ce(e)&&!t.isValidElement(e)&&Object.assign(s,e))}))};return n(e),s},we=(e,s,n,i)=>{if(!e)return"";let o="";const r=Oe(e),a=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return r.forEach(((e,r)=>{if(le(e))o+=`${e}`;else if(t.isValidElement(e)){const{props:t,type:l}=e,c=Object.keys(t).length,u=a.indexOf(l)>-1,p=t.children;if(!p&&u&&!c)return void(o+=`<${l}/>`);if(!p&&(!u||c)||t.i18nIsDynamicList)return void(o+=`<${r}></${r}>`);if(u&&1===c&&le(p))return void(o+=`<${l}>${p}</${l}>`);const h=we(p,s,n,i);o+=`<${r}>${h}</${r}>`}else if(null!==e)if(ce(e)){const{format:t,...s}=e,r=Object.keys(s);if(1===r.length){const e=t?`${r[0]}, ${t}`:r[0];return void(o+=`{{${e}}}`)}te(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:e})}else te(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:e});else te(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i})})),o},Ne=(e,s,n,i,o,r,a)=>{if(""===n)return[];const l=o.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map((e=>`<${e}`)).join("|")).test(n);if(!(e||s||c||a))return[n];const u=s??{},p=e=>{Oe(e).forEach((e=>{le(e)||(ve(e)?p(Se(e)):ce(e)&&!t.isValidElement(e)&&Object.assign(u,e))}))};p(e);const h=((e,t=[],s={})=>{if(!e)return e;const n=[...t,...Object.keys(s)];let i="",o=0;for(;o<e.length;)if("<"===e[o]){let t=!1;const s=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(s){const e=s[1];(/^\d+$/.test(e)||n.includes(e))&&(t=!0,i+=s[0],o+=s[0].length)}if(!t){const s=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(s){const e=s[1];(/^\d+$/.test(e)||n.includes(e))&&(t=!0,i+=s[0],o+=s[0].length)}}t||(i+="<",o+=1)}else i+=e[o],o+=1;return i})(n,l,u),d=ee(`<0>${h}</0>`),g={...u,...r},f=(e,s,n)=>{const i=Se(e),o=y(i,s.children,n);return(e=>Array.isArray(e)&&e.every(t.isValidElement))(i)&&0===o.length||e.props?.i18nIsDynamicList?i:o},m=(e,s,n,i,o)=>{e.dummy?(e.children=s,n.push(t.cloneElement(e,{key:i},o?void 0:s))):n.push(...t.Children.map([e],(e=>{const n="data-i18n-is-dynamic-list",r={key:i,[n]:void 0};return e&&e.props&&Object.keys(e.props).forEach((t=>{"ref"!==t&&"children"!==t&&"i18nIsDynamicList"!==t&&t!==n&&(r[t]=e.props[t])})),t.cloneElement(e,r,o?null:s)})))},y=(e,n,r)=>{const u=Oe(e);return Oe(n).reduce(((e,n,p)=>{const h=n.children?.[0]?.content&&i.services.interpolator.interpolate(n.children[0].content,g,i.language);if("tag"===n.type){let d=u[parseInt(n.name,10)];!d&&s&&(d=s[n.name]),1!==r.length||d||(d=r[0][n.name]),d||(d={});const x={...n.attrs};a&&Object.keys(x).forEach((e=>{const t=x[e];le(t)&&(x[e]=de(t))}));const b=0!==Object.keys(x).length?((e,t)=>{const s={...t};return s.props={...t.props,...e.props},s})({props:x},d):d,v=t.isValidElement(b),S=v&&ve(n,!0)&&!n.voidElement,O=c&&ce(b)&&b.dummy&&!v,k=ce(s)&&Object.hasOwnProperty.call(s,n.name);if(le(b)){const t=i.services.interpolator.interpolate(b,g,i.language);e.push(t)}else if(ve(b)||S){const t=f(b,n,r);m(b,t,e,p)}else if(O){const t=y(u,n.children,r);m(b,t,e,p)}else if(Number.isNaN(parseFloat(n.name)))if(k){const t=f(b,n,r);m(b,t,e,p,n.voidElement)}else if(o.transSupportBasicHtmlNodes&&l.indexOf(n.name)>-1)if(n.voidElement)e.push(t.createElement(n.name,{key:`${n.name}-${p}`}));else{const s=y(u,n.children,r);e.push(t.createElement(n.name,{key:`${n.name}-${p}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{const t=y(u,n.children,r);e.push(`<${n.name}>${t}</${n.name}>`)}else if(ce(b)&&!v){const t=n.children[0]?h:null;t&&e.push(t)}else m(b,h,e,p,1!==n.children.length||!h)}else if("text"===n.type){const s=o.transWrapTextNodes,r="function"==typeof o.unescape?o.unescape:me().unescape,l=a?r(i.services.interpolator.interpolate(n.content,g,i.language)):i.services.interpolator.interpolate(n.content,g,i.language);s?e.push(t.createElement(s,{key:`${n.name}-${p}`},l)):e.push(l)}return e}),[])},x=y([{dummy:!0,children:e||[]}],d,Oe(e||[]));return Se(x[0])},Le=(e,s,n)=>{const i=e.key||s,o=t.cloneElement(e,{key:i});if(!o.props||!o.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return o;return t.createElement((function(){return t.createElement(t.Fragment,null,o)}),{key:i})},$e=(e,t,s,n)=>e?Array.isArray(e)?((e,t)=>e.map(((e,s)=>Le(e,s,t))))(e,t):ce(e)?((e,t)=>{const s={};return Object.keys(e).forEach((n=>{Object.assign(s,{[n]:Le(e[n],n,t)})})),s})(e,t):(ne(s,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null,Ee=e=>!!ce(e)&&(!Array.isArray(e)&&Object.keys(e).reduce(((e,t)=>e&&Number.isNaN(Number.parseFloat(t))),!0));function Re({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r={},values:a,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const f=p||be();if(!f)return ne(f,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:i}),e;const m=h||f.t.bind(f)||(e=>e),y={...me(),...f.options?.react};let x=u||m.ns||f.options?.defaultNS;x=le(x)?[x]:x||["translation"];const{transDefaultProps:b}=y,v=b?.tOptions?{...b.tOptions,...r}:r,S=d??b?.shouldUnescape,O=b?.values?{...b.values,...a}:a,k=b?.components?{...b.components,...c}:c,w=we(e,y,f,i),N=l||v?.defaultValue||w||y.transEmptyNodeValue||("function"==typeof i?L(i):i),{hashTransKey:$}=y,E=i||($?$(w||N):w||N);a=f.options?.interpolation?.defaultVariables?O&&Object.keys(O).length>0?{...O,...f.options.interpolation.defaultVariables}:{...f.options.interpolation.defaultVariables}:O;const R=ke(e);R&&"number"==typeof R.count&&void 0===s&&(s=R.count);const C=a||void 0!==s&&!f.options?.interpolation?.alwaysFormat||!e?v.interpolation:{interpolation:{...v.interpolation,prefix:"#$?",suffix:"?$#"}},P={...v,context:o||v.context,count:s,...a,...C,defaultValue:N,ns:x};let j=E?m(E,P):N;j===E&&N&&(j=N);const I=$e(k,j,f,i);let T=I||e,A=null;Ee(I)&&(A=I,T=e);const V=Ne(T,A,j,f,y,P,S),F=n??y.defaultTransParent;return F?t.createElement(F,g,V):V}const Ce={type:"3rdParty",init(e){fe(e.options.react),xe(e)}},Pe=t.createContext();class je{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ie=e=>async t=>({...await(e.getInitialProps?.(t))??{},...Te()}),Te=()=>{const e=be();if(!e)return console.warn("react-i18next:: getInitialProps: You will need to pass in an i18next instance by using initReactI18next"),{};const t=e.reportNamespaces?.getUsedNamespaces()??[],s={},n={};return e.languages.forEach((s=>{n[s]={},t.forEach((t=>{n[s][t]=e.getResourceBundle(s,t)||{}}))})),s.initialI18nStore=n,s.initialLanguage=e.language,s};class Ae extends Error{constructor(e,t,s){super(e),this.name="TranslationParserError",this.position=t,this.translationString=s,Error.captureStackTrace&&Error.captureStackTrace(this,Ae)}}const Ve={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","¡":"¡","¿":"¿","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"ª","º":"º","¯":"¯","´":"´","¸":"¸","¹":"¹","²":"²","³":"³","¼":"¼","½":"½","¾":"¾","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"},Fe=new RegExp(Object.keys(Ve).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),De=(e,s=[])=>{if(!e)return[];const n=(e=>{const t=[];let s=0,n="";const i=()=>{n&&(t.push({type:"Text",value:n,position:s-n.length}),n="")};for(;s<e.length;){const o=e[s];if("<"===o){const r=e.slice(s).match(/^<(\d+)>/);if(r)i(),t.push({type:"TagOpen",value:r[0],position:s,tagNumber:parseInt(r[1],10)}),s+=r[0].length;else{const r=e.slice(s).match(/^<\/(\d+)>/);r?(i(),t.push({type:"TagClose",value:r[0],position:s,tagNumber:parseInt(r[1],10)}),s+=r[0].length):(n+=o,s+=1)}}else n+=o,s+=1}return i(),t})(e),i=[],o=[],r=new Set;if(n.forEach((n=>{switch(n.type){case"Text":{const e=n.value.replace(Fe,(e=>Ve[e])).replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&#x([0-9a-fA-F]+);/g,((e,t)=>String.fromCharCode(parseInt(t,16))));(o.length>0?o[o.length-1].children:i).push(e)}break;case"TagOpen":{const{tagNumber:e}=n,t=(()=>{if(0===o.length)return s;const e=o[o.length-1];return e.declaration.props?.children&&Array.isArray(e.declaration.props.children)?e.declaration.props.children:e.declarations})(),a=t[e];if(!a){r.add(e);const t=`<${e}>`;(o.length>0?o[o.length-1].children:i).push(t);break}o.push({tagNumber:e,children:[],position:n.position,declaration:a,declarations:t})}break;case"TagClose":{const{tagNumber:s}=n;if(r.has(s)){const e=`</${s}>`;(o.length>0?o[o.length-1].children:i).push(e),r.delete(s);break}if(0===o.length)throw new Ae(`Unexpected closing tag </${s}> at position ${n.position}`,n.position,e);const a=o.pop();if(a.tagNumber!==s)throw new Ae(`Mismatched tags: expected </${a.tagNumber}> but got </${s}> at position ${n.position}`,n.position,e);const l=((e,s,n)=>{const{type:i,props:o={}}=e;if(o.children&&Array.isArray(o.children)&&n){const{children:e,...n}=o;return t.createElement(i,n,...s)}return 0===s.length?t.createElement(i,o):1===s.length?t.createElement(i,o,s[0]):t.createElement(i,o,...s)})(a.declaration,a.children,a.declarations);(o.length>0?o[o.length-1].children:i).push(l)}}})),o.length>0){const t=o[o.length-1];throw new Ae(`Unclosed tag <${t.tagNumber}> at position ${t.position}`,t.position,e)}return i};function Ue({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:r,t:a}){const l=r||be();if(!l)return ne(l,"NO_I18NEXT_INSTANCE","IcuTrans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:e}),t.createElement(t.Fragment,{},s);const c=a||l.t?.bind(l)||(e=>e);let u=i||c.ns||l.options?.defaultNS;u=le(u)?[u]:u||["translation"];let p=o;l.options?.interpolation?.defaultVariables&&(p=o&&Object.keys(o).length>0?{...o,...l.options.interpolation.defaultVariables}:{...l.options.interpolation.defaultVariables});const h=c(e,{defaultValue:s,...p,ns:u});try{const e=De(h,n);return t.createElement(t.Fragment,{},...e)}catch(s){return te(l,"ICU_TRANS_RENDER_ERROR",`IcuTrans component error for key "${e}": ${s.message}`,{i18nKey:e,error:s}),t.createElement(t.Fragment,{},h)}}function _e({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:r,t:a}){const{i18n:l,defaultNS:c}=t.useContext(Pe)||{},u=r||l||be(),p=a||u?.t.bind(u);return Ue({i18nKey:e,defaultTranslation:s,content:n,ns:i||p?.ns||c||u?.options?.defaultNS,values:o,i18n:u,t:a})}Ue.displayName="IcuTransWithoutContext",_e.displayName="IcuTrans";var Ke={exports:{}},ze={},Me=t;var He="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Be=Me.useState,qe=Me.useEffect,Je=Me.useLayoutEffect,We=Me.useDebugValue;function Ye(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!He(e,s)}catch(e){return!0}}var Ze="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),n=Be({inst:{value:s,getSnapshot:t}}),i=n[0].inst,o=n[1];return Je((function(){i.value=s,i.getSnapshot=t,Ye(i)&&o({inst:i})}),[e,s,t]),qe((function(){return Ye(i)&&o({inst:i}),e((function(){Ye(i)&&o({inst:i})}))}),[e]),We(s),s};ze.useSyncExternalStore=void 0!==Me.useSyncExternalStore?Me.useSyncExternalStore:Ze,Ke.exports=ze;var Ge=Ke.exports;const Xe={t:(e,t)=>{if(le(t))return t;if(ce(t)&&le(t.defaultValue))return t.defaultValue;if("function"==typeof e)return"";if(Array.isArray(e)){const t=e[e.length-1];return"function"==typeof t?"":t}return e},ready:!1},Qe=()=>()=>{},et=(e,s={})=>{const{i18n:n}=s,{i18n:i,defaultNS:o}=t.useContext(Pe)||{},r=n||i||be();r&&!r.reportNamespaces&&(r.reportNamespaces=new je),r||ne(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=t.useMemo((()=>({...me(),...r?.options?.react,...s})),[r,s]),{useSuspense:l,keyPrefix:c}=a,u=e||o||r?.options?.defaultNS,p=le(u)?[u]:u||["translation"],h=t.useMemo((()=>p),p);r?.reportNamespaces?.addUsedNamespaces?.(h);const d=t.useRef(0),g=t.useCallback((e=>{if(!r)return Qe;const{bindI18n:t,bindI18nStore:s}=a,n=()=>{d.current+=1,e()};return t&&r.on(t,n),s&&r.store.on(s,n),()=>{t&&t.split(" ").forEach((e=>r.off(e,n))),s&&s.split(" ").forEach((e=>r.store.off(e,n)))}}),[r,a]),f=t.useRef(),m=t.useCallback((()=>{if(!r)return Xe;const e=!(!r.isInitialized&&!r.initializedStoreOnce)&&h.every((e=>((e,t,s={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:s.lng,precheck:(t,n)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(ne(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,r,a))),t=s.lng||r.language,n=d.current,i=f.current;if(i&&i.ready===e&&i.lng===t&&i.keyPrefix===c&&i.revision===n)return i;const o={t:r.getFixedT(t,"fallback"===a.nsMode?h:h[0],c),ready:e,lng:t,keyPrefix:c,revision:n};return f.current=o,o}),[r,h,c,a,s.lng]),[y,x]=t.useState(0),{t:b,ready:v}=Ge.useSyncExternalStore(g,m,m);t.useEffect((()=>{if(r&&!v&&!l){const e=()=>x((e=>e+1));s.lng?re(r,s.lng,h,e):oe(r,h,e)}}),[r,s.lng,h,v,l,y]);const S=r||{},O=t.useRef(null),k=t.useRef(),w=e=>{const t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;const s=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(s,"__original"))try{Object.defineProperty(s,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch(e){}return s},N=t.useMemo((()=>{const e=S,t=e?.language;let s=e;e&&(O.current&&O.current.__original===e?k.current!==t?(s=w(e),O.current=s,k.current=t):s=O.current:(s=w(e),O.current=s,k.current=t));const n=v||l?b:(...e)=>(ne(r,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...e)),i=[n,s,v];return i.t=n,i.i18n=s,i.ready=v,i}),[b,S,v,S.resolvedLanguage,S.language,S.languages]);if(r&&l&&!v)throw new Promise((e=>{const t=()=>e();s.lng?re(r,s.lng,h,t):oe(r,h,t)}));return N};const tt=(e,s,n={})=>{const{i18n:i}=n,{i18n:o}=t.useContext(Pe)||{},r=i||o||be();if(r){if(!r.options?.isClone){if(e&&!r.initializedStoreOnce){if(!r.services?.resourceStore)return void ne(r,"I18N_NOT_INITIALIZED","useSSR: i18n instance was found but not initialized (services.resourceStore is missing). Make sure you call i18next.init() before using useSSR — e.g. at module level, not only in getStaticProps/getServerSideProps.");r.services.resourceStore.data=e,r.options.ns=Object.values(e).reduce(((e,t)=>(Object.keys(t).forEach((t=>{e.indexOf(t)<0&&e.push(t)})),e)),r.options.ns),r.initializedStoreOnce=!0,r.isInitialized=!0}s&&!r.initializedLanguageOnce&&(r.changeLanguage(s),r.initializedLanguageOnce=!0)}}else ne(r,"NO_I18NEXT_INSTANCE","useSSR: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.")};e.I18nContext=Pe,e.I18nextProvider=function({i18n:e,defaultNS:s,children:n}){const i=t.useMemo((()=>({i18n:e,defaultNS:s})),[e,s]);return t.createElement(Pe.Provider,{value:i},n)},e.IcuTrans=_e,e.IcuTransWithoutContext=Ue,e.Trans=function({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r={},values:a,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const{i18n:f,defaultNS:m}=t.useContext(Pe)||{},y=p||f||be(),x=h||y?.t.bind(y);return Re({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:r,values:a,defaults:l,components:c,ns:u||x?.ns||m||y?.options?.defaultNS,i18n:y,t:h,shouldUnescape:d,...g})},e.TransWithoutContext=Re,e.Translation=({ns:e,children:t,...s})=>{const[n,i,o]=et(e,s);return t(n,{i18n:i,lng:i?.language},o)},e.composeInitialProps=Ie,e.date=()=>"",e.getDefaults=me,e.getI18n=be,e.getInitialProps=Te,e.initReactI18next=Ce,e.nodesToString=we,e.number=()=>"",e.plural=()=>"",e.select=()=>"",e.selectOrdinal=()=>"",e.setDefaults=fe,e.setI18n=xe,e.time=()=>"",e.useSSR=tt,e.useTranslation=et,e.withSSR=()=>function(e){function s({initialI18nStore:s,initialLanguage:n,...i}){return tt(s,n),t.createElement(e,{...i})}return s.getInitialProps=Ie(e),s.displayName=`withI18nextSSR(${ae(e)})`,s.WrappedComponent=e,s},e.withTranslation=(e,s={})=>function(n){function i({forwardedRef:i,...o}){const[r,a,l]=et(e,{...o,keyPrefix:s.keyPrefix}),c={...o,t:r,i18n:a,tReady:l};return s.withRef&&i?c.ref=i:!s.withRef&&i&&(c.forwardedRef=i),t.createElement(n,c)}i.displayName=`withI18nextTranslation(${ae(n)})`,i.WrappedComponent=n;return s.withRef?t.forwardRef(((e,s)=>t.createElement(i,Object.assign({},e,{forwardedRef:s})))):i}}));
|