import{q as $}from"./vendor-react-DfNOgXDS.js";const p=i=>typeof i=="string",J=()=>{let i,e;const t=new Promise((s,n)=>{i=s,e=n});return t.resolve=i,t.reject=e,t},xe=i=>i==null?"":String(i),tt=(i,e,t)=>{i.forEach(s=>{e[s]&&(t[s]=e[s])})},st=/###/g,we=i=>i&&i.includes("###")?i.replace(st,"."):i,be=i=>!i||p(i),X=(i,e,t)=>{const s=p(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(be(i))return{};const r=we(s[n]);!i[r]&&t&&(i[r]=new t),Object.prototype.hasOwnProperty.call(i,r)?i=i[r]:i={},++n}return be(i)?{}:{obj:i,k:we(s[n])}},Le=(i,e,t)=>{const{obj:s,k:n}=X(i,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let r=e[e.length-1],o=e.slice(0,e.length-1),a=X(i,o,Object);for(;a.obj===void 0&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=X(i,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=t},nt=(i,e,t,s)=>{const{obj:n,k:r}=X(i,e,Object);n[r]=n[r]||[],n[r].push(t)},se=(i,e)=>{const{obj:t,k:s}=X(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},it=(i,e,t)=>{const s=se(i,t);return s!==void 0?s:se(e,t)},Ve=(i,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in i?p(i[s])||i[s]instanceof String||p(e[s])||e[s]instanceof String?t&&(i[s]=e[s]):Ve(i[s],e[s],t):i[s]=e[s]);return i},A=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),rt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},ot=i=>p(i)?i.replace(/[&<>"'\/]/g,e=>rt[e]):i;class at{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const 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}}const lt=[" ",",","?","!",";"],ut=new at(20),ct=(i,e,t)=>{e=e||"",t=t||"";const s=lt.filter(o=>!e.includes(o)&&!t.includes(o));if(s.length===0)return!0;const n=ut.getRegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let r=!n.test(i);if(!r){const o=i.indexOf(t);o>0&&!n.test(i.substring(0,o))&&(r=!0)}return r},fe=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const s=e.split(t);let n=i;for(let r=0;r<s.length;){if(!n||typeof n!="object")return;let o,a="";for(let u=r;u<s.length;++u)if(u!==r&&(a+=t),a+=s[u],o=n[a],o!==void 0){if(["string","number","boolean"].includes(typeof o)&&u<s.length-1)continue;r+=u-r+1;break}n=o}return n},G=i=>i==null?void 0:i.replace(/_/g,"-"),ft={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){var t,s;(s=(t=console==null?void 0:console[i])==null?void 0:t.apply)==null||s.call(t,console,e)}};class ne{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ft,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,s,n){return n&&!this.debug?null:(e=e.map(r=>p(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),p(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ne(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ne(this.logger,e)}}var I=new ne;class oe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n(e,...t)})}}class ve extends oe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||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,s,n={}){var l,c;const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,o=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.includes(".")?a=e.split("."):(a=[e,t],s&&(Array.isArray(s)?a.push(...s):p(s)&&r?a.push(...s.split(r)):a.push(s)));const u=se(this.data,a);return!u&&!t&&!s&&e.includes(".")&&(e=a[0],t=a[1],s=a.slice(2).join(".")),u||!o||!p(s)?u:fe((c=(l=this.data)==null?void 0:l[e])==null?void 0:c[t],s,r)}addResource(e,t,s,n,r={silent:!1}){const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.includes(".")&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),Le(this.data,a,n),r.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const r in s)(p(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,r,o={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),n=s,s=t,t=a[1]),this.addNamespaces(t);let u=se(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Ve(u,s,r):u={...u,...s},Le(this.data,a,u),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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var Me={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,s,n){return i.forEach(r=>{var o;e=((o=this.processors[r])==null?void 0:o.process(e,t,s,n))??e}),e}};const Ke=Symbol("i18next/PATH_KEY");function dt(){const i=[],e=Object.create(null);let t;return e.get=(s,n)=>{var r;return(r=t==null?void 0:t.revoke)==null||r.call(t),n===Ke?i:(i.push(n),t=Proxy.revocable(s,e),t.proxy)},Proxy.revocable(Object.create(null),e).proxy}function z(i,e){const{[Ke]:t}=i(dt()),s=(e==null?void 0:e.keySeparator)??".",n=(e==null?void 0:e.nsSeparator)??":",r=(e==null?void 0:e.enableSelector)==="strict";if(t.length>1&&n){const o=e==null?void 0:e.ns,a=r?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(a&&(r?a:a.length>1?a.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(s)}`}return t.join(s)}const ae=i=>!p(i)&&typeof i!="boolean"&&typeof i!="number";class ie extends oe{constructor(e,t={}){super(),tt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=I.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if((n==null?void 0:n.res)===void 0)return!1;const r=ae(n.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=s&&e.includes(s),a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ct(e,s,n);if(o&&!a){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:p(r)?[r]:r};const l=e.split(s);(s!==n||s===n&&this.options.ns.includes(l[0]))&&(r=l.shift()),e=l.join(n)}return{key:e,namespaces:p(r)?[r]:r}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=z(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(m=>typeof m=="function"?z(m,{...this.options,...n}):String(m));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],n),l=u[u.length-1];let c=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?r?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;const g=this.resolve(e,n);let d=g==null?void 0:g.res;const y=(g==null?void 0:g.usedKey)||a,v=(g==null?void 0:g.exactUsedKey)||a,F=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject,w=n.count!==void 0&&!p(n.count),k=ie.hasDefaultValue(n),D=w?this.pluralResolver.getSuffix(f,n.count,n):"",T=n.ordinal&&w?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",U=w&&!n.ordinal&&n.count===0,R=U&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${D}`]||n[`defaultValue${T}`]||n.defaultValue;let b=d;P&&!d&&k&&(b=R);const Q=ae(b),x=Object.prototype.toString.apply(b);if(P&&b&&Q&&!F.includes(x)&&!(p(C)&&Array.isArray(b))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const m=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,b,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}if(o){const m=Array.isArray(b),S=m?[]:{},O=m?v:y;for(const L in b)if(Object.prototype.hasOwnProperty.call(b,L)){const N=`${O}${o}${L}`;k&&!d?S[L]=this.translate(N,{...n,defaultValue:ae(R)?R[L]:void 0,joinArrays:!1,ns:u}):S[L]=this.translate(N,{...n,joinArrays:!1,ns:u}),S[L]===N&&(S[L]=b[L])}d=S}}else if(P&&p(C)&&Array.isArray(d))d=d.join(C),d&&(d=this.extendTranslation(d,e,n,s));else{let m=!1,S=!1;!this.isValidLookup(d)&&k&&(m=!0,d=R),this.isValidLookup(d)||(S=!0,d=a);const L=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:d,N=k&&R!==d&&this.options.updateMissing;if(S||m||N){if(this.logger.log(N?"updateKey":"missingKey",f,l,w&&!N?`${a}${this.pluralResolver.getSuffix(f,n.count,n)}`:a,N?R:d),o){const j=this.resolve(a,{...n,keySeparator:!1});j&&j.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 H=[];const Z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Z&&Z[0])for(let j=0;j<Z.length;j++)H.push(Z[j]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const me=(j,V,W)=>{var Se;const ye=k&&W!==d?W:L;this.options.missingKeyHandler?this.options.missingKeyHandler(j,l,V,ye,N,n):(Se=this.backendConnector)!=null&&Se.saveMissing&&this.backendConnector.saveMissing(j,l,V,ye,N,n),this.emit("missingKey",j,l,V,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?H.forEach(j=>{const V=this.pluralResolver.getSuffixes(j,n);U&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!V.includes(`${this.options.pluralSeparator}zero`)&&V.push(`${this.options.pluralSeparator}zero`),V.forEach(W=>{me([j],a+W,n[`defaultValue${W}`]||R)})}):me(H,a,R))}d=this.extendTranslation(d,e,n,g,s),S&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${l}${c}${a}`),(S||m)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,m?d:void 0,n))}return r?(g.res=d,g.usedParams=this.getUsedParamsDetails(n),g):d}extendTranslation(e,t,s,n,r){var u,l;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=p(e)&&(((l=s==null?void 0:s.interpolation)==null?void 0:l.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const g=e.match(this.interpolator.nestingRegexp);f=g&&g.length}let h=s.replace&&!p(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,s.lng||this.language||n.usedLng,s),c){const g=e.match(this.interpolator.nestingRegexp),d=g&&g.length;f<d&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>(r==null?void 0:r[0])===g[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${t[0]}`),null):this.translate(...g,t),s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,a=p(o)?[o]:o;return e!=null&&(a!=null&&a.length)&&s.applyPostProcessor!==!1&&(e=Me.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,r,o,a;return p(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(u=>typeof u=="function"?z(u,{...this.options,...t}):u)),e.forEach(u=>{if(this.isValidLookup(s))return;const l=this.extractFromKey(u,t),c=l.key;n=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=t.count!==void 0&&!p(t.count),g=h&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(p(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(v=>{var F,C;this.isValidLookup(s)||(a=v,!this.checkedLoadedFor[`${y[0]}-${v}`]&&((F=this.utils)!=null&&F.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(a))&&(this.checkedLoadedFor[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${n}" for languages "${y.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!!!")),y.forEach(P=>{var D;if(this.isValidLookup(s))return;o=P;const w=[c];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(w,c,P,v,t);else{let T;h&&(T=this.pluralResolver.getSuffix(P,t.count,t));const U=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&T.startsWith(R)&&w.push(c+T.replace(R,this.options.pluralSeparator)),w.push(c+T),g&&w.push(c+U)),d){const b=`${c}${this.options.contextSeparator||"_"}${t.context}`;w.push(b),h&&(t.ordinal&&T.startsWith(R)&&w.push(b+T.replace(R,this.options.pluralSeparator)),w.push(b+T),g&&w.push(b+U))}}let k;for(;k=w.pop();)this.isValidLookup(s)||(r=k,s=this.getResource(P,v,k,t))}))})}),{res:s,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){var r;return(r=this.i18nFormat)!=null&&r.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"],s=e.replace&&!p(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class Oe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=I.create("languageUtils")}getScriptPartFromCode(e){if(e=G(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=G(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(p(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(o=>o===r?!0:!o.includes("-")&&!r.includes("-")?!1:!!(o.includes("-")&&!r.includes("-")&&o.slice(0,o.indexOf("-"))===r||o.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),p(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=o=>{o&&(this.isSupportedCode(o)?n.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return p(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):p(e)&&r(this.formatLanguageCode(e)),s.forEach(o=>{n.includes(o)||r(this.formatLanguageCode(o))}),n}}const Ce={zero:0,one:1,two:2,few:3,many:4,other:5},Pe={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ht{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=I.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=G(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(s,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Pe;if(!e.match(/-|_/))return Pe;const u=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(u,t)}return this.pluralRulesCache[r]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,r)=>Ce[n]-Ce[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}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 Re=(i,e,t,s=".",n=!0)=>{let r=it(i,e,t);return!r&&n&&p(t)&&(r=fe(i,t,s),r===void 0&&(r=fe(e,t,s))),r},le=i=>i.replace(/\$/g,"$$$$");class $e{constructor(e={}){var t;this.logger=I.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:g,nestingSuffix:d,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:F,alwaysFormat:C}=e.interpolation;this.escape=t!==void 0?t:ot,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?A(r):o||"{{",this.suffix=a?A(a):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f?A(f):"-",this.unescapeSuffix=this.unescapePrefix?"":c?A(c):"",this.nestingPrefix=h?A(h):g||A("$t("),this.nestingSuffix=d?A(d):y||A(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=F||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>(t==null?void 0:t.source)===s?(t.lastIndex=0,t):new RegExp(s,"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,s,n){var g;let r,o,a;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=d=>{if(!d.includes(this.formatSeparator)){const C=Re(t,u,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,{...n,...t,interpolationkey:d}):C}const y=d.split(this.formatSeparator),v=y.shift().trim(),F=y.join(this.formatSeparator).trim();return this.format(Re(t,u,v,this.options.keySeparator,this.options.ignoreJSONStructure),F,s,{...n,...t,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const c=(n==null?void 0:n.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((g=n==null?void 0:n.interpolation)==null?void 0:g.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>le(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?le(this.escape(d)):le(d)}].forEach(d=>{for(a=0;r=d.regex.exec(e);){const y=r[1].trim();if(o=l(y),o===void 0)if(typeof c=="function"){const F=c(e,r,n);o=p(F)?F:""}else if(n&&Object.prototype.hasOwnProperty.call(n,y))o="";else if(f){o=r[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!p(o)&&!this.useRawValueToEscape&&(o=xe(o));const v=d.safeValue(o);if(e=e.replace(r[0],v),f?(d.regex.lastIndex+=o.length,d.regex.lastIndex-=r[0].length):d.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,r,o;const a=(u,l)=>{const c=this.nestingOptionsSeparator;if(!u.includes(c))return u;const f=u.split(new RegExp(`${A(c)}[ ]*{`));let h=`{${f[1]}`;u=f[0],h=this.interpolate(h,o);const g=h.match(/'/g),d=h.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!d||((d==null?void 0:d.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),l&&(o={...l,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${u}${c}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,u};for(;n=this.nestingRegexp.exec(e);){let u=[];o={...s},o=o.replace&&!p(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(l!==-1&&(u=n[1].slice(l).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!p(r))return r;p(r)||(r=xe(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u.length&&(r=u.reduce((c,f)=>this.format(c,f,s.lng,{...s,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const gt=i=>{let e=i.toLowerCase().trim();const t={};if(i.includes("(")){const s=i.split("(");e=s[0].toLowerCase().trim();const n=s[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(o=>{if(o){const[a,...u]=o.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();t[c]||(t[c]=l),l==="false"&&(t[c]=!1),l==="true"&&(t[c]=!0),isNaN(l)||(t[c]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},ke=i=>{const e={};return(t,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=e[o];return a||(a=i(G(s),n),e[o]=a),a(t)}},pt=i=>(e,t,s)=>i(G(t),s)(e);class mt{constructor(e={}){this.logger=I.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?ke:pt;this.formats={number:s((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:s((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:s((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:s((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:s((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ke(t)}format(e,t,s,n={}){if(!t||e==null)return e;const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(a=>a.includes(")"))){const a=r.findIndex(u=>u.includes(")"));r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,u)=>{var f;const{formatName:l,formatOptions:c}=gt(u);if(this.formats[l]){let h=a;try{const g=((f=n==null?void 0:n.formatParams)==null?void 0:f[n.interpolationkey])||{},d=g.locale||g.lng||n.locale||n.lng||s;h=this.formats[l](a,d,{...c,...n,...g})}catch(g){this.logger.warn(g)}return h}else this.logger.warn(`there was no format function for ${l}`);return a},e)}}const yt=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class St extends oe{constructor(e,t,s,n={}){var r,o;super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=I.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=[],(o=(r=this.backend)==null?void 0:r.init)==null||o.call(r,s,n.backend,n)}queueLoad(e,t,s,n){const r={},o={},a={},u={};return e.forEach(l=>{let c=!0;t.forEach(f=>{const h=`${l}|${f}`;!s.reload&&this.store.hasResourceBundle(l,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,c=!1,o[h]===void 0&&(o[h]=!0),r[h]===void 0&&(r[h]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(a[l]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(e,t,s){const n=e.split("|"),r=n[0],o=n[1];t&&this.emit("failedLoading",r,o,t),!t&&s&&this.store.addResourceBundle(r,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const a={};this.queue.forEach(u=>{nt(u.loaded,[r],o),yt(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{a[l]||(a[l]={});const c=u.loaded[l];c.length&&c.forEach(f=>{a[l][f]===void 0&&(a[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(u=>!u.done)}read(e,t,s,n=0,r=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:r,callback:o});return}this.readingCalls++;const a=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,s,n+1,r*2,o)},r);return}o(l,c)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const l=u(e,t);l&&typeof l.then=="function"?l.then(c=>a(null,c)).catch(a):a(null,l)}catch(l){a(l)}return}return u(e,t,a)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();p(e)&&(e=this.languageUtils.toResolveHierarchy(e)),p(t)&&(t=[t]);const r=this.queueLoad(e,t,s,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(o=>{this.loadOne(o)})}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],r=s[1];this.read(n,r,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,a),this.loaded(e,o,a)})}saveMissing(e,t,s,n,r,o={},a=()=>{}){var u,l,c,f,h;if((l=(u=this.services)==null?void 0:u.utils)!=null&&l.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(t))){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!!!");return}if(!(s==null||s==="")){if((h=this.backend)!=null&&h.create){const g={...o,isUpdate:r},d=this.backend.create.bind(this.backend);if(d.length<6)try{let y;d.length===5?y=d(e,t,s,n,g):y=d(e,t,s,n),y&&typeof y.then=="function"?y.then(v=>a(null,v)).catch(a):a(null,y)}catch(y){a(y)}else d(e,t,s,n,a,g)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const ue=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),p(i[1])&&(e.defaultValue=i[1]),p(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ne=i=>(p(i.ns)&&(i.ns=[i.ns]),p(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),p(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&!i.supportedLngs.includes("cimode")&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i),ee=()=>{},xt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class Y extends oe{constructor(e={},t){if(super(),this.options=Ne(e),this.services={},this.logger=I,this.modules={external:[]},xt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(p(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=ue();this.options={...s,...this.options,...Ne(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const n=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?I.init(n(this.modules.logger),this.options):I.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=mt;const c=new Oe(this.options);this.store=new ve(this.options.resources,this.options);const f=this.services;f.logger=I,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new ht(c,{prepend:this.options.pluralSeparator}),l&&(f.formatter=n(l),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new $e(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new St(n(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...g)=>{this.emit(h,...g)}),this.modules.languageDetector&&(f.languageDetector=n(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=n(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ie(this.services,this.options),this.translator.on("*",(h,...g)=>{this.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ee),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...c)=>this.store[l](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...c)=>(this.store[l](...c),this)});const a=J(),u=()=>{const l=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(f),t(c,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),a}loadResources(e,t=ee){var r,o;let s=t;const n=p(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((n==null?void 0:n.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const a=[],u=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&(a.includes(f)||a.push(f))})};n?u(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>u(c)),(o=(r=this.options.preload)==null?void 0:r.forEach)==null||o.call(r,l=>u(l)),this.services.backendConnector.load(a,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(l)})}else s(null)}reloadResources(e,t,s){const n=J();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ee),this.services.backendConnector.reload(e,t,r=>{n.resolve(),s(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Me.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=J();this.emit("languageChanging",e);const n=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},r=(a,u)=>{u?this.isLanguageChangingTo===e&&(n(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve((...l)=>this.t(...l)),t&&t(a,(...l)=>this.t(...l))},o=a=>{var c,f;!e&&!a&&this.services.languageDetector&&(a=[]);const u=p(a)?a:a&&a[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(p(a)?[a]:a);l&&(this.language||n(l),this.translator.language||this.translator.changeLanguage(l),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,l)),this.loadResources(l,h=>{r(h,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,t,s,n){const r=n==null?void 0:n.scopeNs,o=(a,u,...l)=>{let c;typeof u!="object"?c=this.options.overloadTranslationOptionHandler([a,u].concat(l)):c={...u},c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs;const f=c.ns!==void 0&&c.ns!==null;c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||s||o.keyPrefix);const h={...this.options,...c};Array.isArray(r)&&!f&&(h.ns=r),typeof c.keyPrefix=="function"&&(c.keyPrefix=z(c.keyPrefix,h));const g=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(a)?d=a.map(y=>(typeof y=="function"&&(y=z(y,h)),`${c.keyPrefix}${g}${y}`)):(typeof a=="function"&&(a=z(a,h)),d=c.keyPrefix?`${c.keyPrefix}${g}${a}`:a),this.t(d,c)};return p(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=s,o}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.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:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,u)=>{const l=this.services.backendConnector.state[`${a}|${u}`];return l===-1||l===0||l===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!n||o(r,e)))}loadNamespaces(e,t){const s=J();return this.options.ns?(p(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=J();p(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(o=>!n.includes(o)&&this.services.languageUtils.isSupportedCode(o));return r.length?(this.options.preload=n.concat(r),this.loadResources(o=>{s.resolve(),t&&t(o)}),s):(t&&t(),Promise.resolve())}dir(e){var n,r;if(e||(e=this.resolvedLanguage||(((n=this.languages)==null?void 0:n.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((r=this.services)==null?void 0:r.languageUtils)||new Oe(ue());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new Y(e,t);return s.createInstance=Y.createInstance,s}cloneInstance(e={},t=ee){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new Y(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const a=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),u[l]),u),{});r.store=new ve(a,n),r.services.resourceStore=r.store}if(e.interpolation){const u={...ue().interpolation,...this.options.interpolation,...e.interpolation},l={...n,interpolation:u};r.services.interpolator=new $e(l)}return r.translator=new ie(r.services,n),r.translator.on("*",(a,...u)=>{r.emit(a,...u)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const E=Y.createInstance();E.createInstance;E.dir;E.init;E.loadResources;E.reloadResources;E.use;E.changeLanguage;E.getFixedT;E.t;E.exists;E.setDefaultNamespace;E.hasLoadedNamespace;E.loadNamespaces;E.loadLanguages;const wt=(i,e,t,s)=>{var r,o,a,u;const n=[t,{code:e,...s||{}}];if((o=(r=i==null?void 0:i.services)==null?void 0:r.logger)!=null&&o.forward)return i.services.logger.forward(n,"warn","react-i18next::",!0);K(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(u=(a=i==null?void 0:i.services)==null?void 0:a.logger)!=null&&u.warn?i.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Ee={},de=(i,e,t,s)=>{K(t)&&Ee[t]||(K(t)&&(Ee[t]=new Date),wt(i,e,t,s))},_e=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},he=(i,e,t)=>{i.loadNamespaces(e,_e(i,t))},Fe=(i,e,t,s)=>{if(K(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return he(i,t,s);t.forEach(n=>{i.options.ns.indexOf(n)<0&&i.options.ns.push(n)}),i.loadLanguages(e,_e(i,s))},bt=(i,e,t={})=>!e.languages||!e.languages.length?(de(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,i))return!1}}),K=i=>typeof i=="string",Lt=i=>typeof i=="object"&&i!==null,vt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ot={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"В©","©":"В©","®":"В®","®":"В®","…":"…","…":"…","/":"/","/":"/"},Ct=i=>Ot[i],Pt=i=>i.replace(vt,Ct);let ge={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Pt,transDefaultProps:void 0};const Rt=(i={})=>{ge={...ge,...i}},$t=()=>ge;let qe;const kt=i=>{qe=i},Nt=()=>qe,ws={type:"3rdParty",init(i){Rt(i.options.react),kt(i)}},ze=$.createContext();class Et{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Be={exports:{}},We={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var B=$;function Ft(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var jt=typeof Object.is=="function"?Object.is:Ft,Tt=B.useState,It=B.useEffect,At=B.useLayoutEffect,Dt=B.useDebugValue;function Ut(i,e){var t=e(),s=Tt({inst:{value:t,getSnapshot:e}}),n=s[0].inst,r=s[1];return At(function(){n.value=t,n.getSnapshot=e,ce(n)&&r({inst:n})},[i,t,e]),It(function(){return ce(n)&&r({inst:n}),i(function(){ce(n)&&r({inst:n})})},[i]),Dt(t),t}function ce(i){var e=i.getSnapshot;i=i.value;try{var t=e();return!jt(i,t)}catch{return!0}}function Ht(i,e){return e()}var Vt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ht:Ut;We.useSyncExternalStore=B.useSyncExternalStore!==void 0?B.useSyncExternalStore:Vt;Be.exports=We;var Mt=Be.exports;const Kt=(i,e)=>{if(K(e))return e;if(Lt(e)&&K(e.defaultValue))return e.defaultValue;if(typeof i=="function")return"";if(Array.isArray(i)){const t=i[i.length-1];return typeof t=="function"?"":t}return i},_t={t:Kt,ready:!1},qt=()=>()=>{},bs=(i,e={})=>{var R,b,Q;const{i18n:t}=e,{i18n:s,defaultNS:n}=$.useContext(ze)||{},r=t||s||Nt();r&&!r.reportNamespaces&&(r.reportNamespaces=new Et),r||de(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=$.useMemo(()=>{var x;return{...$t(),...(x=r==null?void 0:r.options)==null?void 0:x.react,...e}},[r,e]),{useSuspense:a,keyPrefix:u}=o,l=n||((R=r==null?void 0:r.options)==null?void 0:R.defaultNS),c=K(l)?[l]:l||["translation"],f=$.useMemo(()=>c,c);(Q=(b=r==null?void 0:r.reportNamespaces)==null?void 0:b.addUsedNamespaces)==null||Q.call(b,f);const h=$.useRef(0),g=$.useCallback(x=>{if(!r)return qt;const{bindI18n:m,bindI18nStore:S}=o,O=()=>{h.current+=1,x()};return m&&r.on(m,O),S&&r.store.on(S,O),()=>{m&&m.split(" ").forEach(L=>r.off(L,O)),S&&S.split(" ").forEach(L=>r.store.off(L,O))}},[r,o]),d=$.useRef(),y=$.useCallback(()=>{if(!r)return _t;const x=!!(r.isInitialized||r.initializedStoreOnce)&&f.every(H=>bt(H,r,o)),m=e.lng||r.language,S=h.current,O=d.current;if(O&&O.ready===x&&O.lng===m&&O.keyPrefix===u&&O.revision===S)return O;const N={t:r.getFixedT(m,o.nsMode==="fallback"?f:f[0],u,{scopeNs:f}),ready:x,lng:m,keyPrefix:u,revision:S};return d.current=N,N},[r,f,u,o,e.lng]),[v,F]=$.useState(0),{t:C,ready:P}=Mt.useSyncExternalStore(g,y,y);$.useEffect(()=>{if(r&&!P&&!a){const x=()=>F(m=>m+1);e.lng?Fe(r,e.lng,f,x):he(r,f,x)}},[r,e.lng,f,P,a,v]);const w=r||{},k=$.useRef(null),D=$.useRef(),T=x=>{const m=Object.getOwnPropertyDescriptors(x);m.__original&&delete m.__original;const S=Object.create(Object.getPrototypeOf(x),m);if(!Object.prototype.hasOwnProperty.call(S,"__original"))try{Object.defineProperty(S,"__original",{value:x,writable:!1,enumerable:!1,configurable:!1})}catch{}return S},U=$.useMemo(()=>{const x=w,m=x==null?void 0:x.language;let S=x;x&&(k.current&&k.current.__original===x?D.current!==m?(S=T(x),k.current=S,D.current=m):S=k.current:(S=T(x),k.current=S,D.current=m));const O=!P&&!a?(...N)=>(de(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."),C(...N)):C,L=[O,S,P];return L.t=O,L.i18n=S,L.ready=P,L},[C,w,P,w.resolvedLanguage,w.language,w.languages]);if(r&&a&&!P)throw new Promise(x=>{const m=()=>x();e.lng?Fe(r,e.lng,f,m):he(r,f,m)});return U};function Ls({i18n:i,defaultNS:e,children:t}){const s=$.useMemo(()=>({i18n:i,defaultNS:e}),[i,e]);return $.createElement(ze.Provider,{value:s},t)}const Je=["__proto__","constructor","prototype"];function Xe(i){return!(typeof i!="string"||i.length===0||i.length>128||Je.indexOf(i)>-1||i.indexOf("..")>-1||i.indexOf("\\")>-1||/[?#%\s@]/.test(i)||/[\x00-\x1F\x7F]/.test(i))}function Ye(i){return!(!Xe(i)||i.indexOf("/")>-1)}function zt(i){return Xe(i)}const Bt={lng:Ye,ns:zt};function te(i){return typeof i!="string"?i:i.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function Wt(i){if(typeof i!="string"||i.length===0)return i;try{const e=new URL(i);return e.username||e.password?(e.username="",e.password="",e.toString()):i}catch{return i.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function Ge(){return typeof XMLHttpRequest=="function"||typeof XMLHttpRequest=="object"}function Jt(i){return!!i&&typeof i.then=="function"}function Xt(i){return Jt(i)?i:Promise.resolve(i)}const Yt=/\{\{(.+?)\}\}/g;function je(i,e){let t=!1;const s=i.replace(Yt,(n,r)=>{const o=r.trim();if(Je.indexOf(o)>-1)return n;const a=e[o];if(a==null)return n;const u=Bt[o]||Ye,l=String(a).split("+");for(const c of l)if(!u(c))return t=!0,n;return l.join("+")});return t?null:s}const M=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:void 0;let re;typeof fetch=="function"?re=fetch:M&&typeof M.fetch=="function"&&(re=M.fetch);const Te=Ge()&&M?M.XMLHttpRequest:void 0,Gt=typeof ActiveXObject=="function"&&M?M.ActiveXObject:void 0,Qe=["__proto__","constructor","prototype"],pe=(i,e)=>{if(e&&typeof e=="object"){let t="";for(const s of Object.keys(e))Qe.indexOf(s)>-1||(t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e[s]));if(!t)return i;i=i+(i.indexOf("?")!==-1?"&":"?")+t.slice(1)}return i},Ie=(i,e,t,s)=>{const n=r=>{if(!r.ok)return t(r.statusText||"Error",{status:r.status});r.text().then(o=>{t(null,{status:r.status,data:o})}).catch(t)};if(s){const r=s(i,e);if(r instanceof Promise){r.then(n).catch(t);return}}typeof fetch=="function"?fetch(i,e).then(n).catch(t):re(i,e).then(n).catch(t)},Qt=(i,e,t,s)=>{i.queryStringParams&&(e=pe(e,i.queryStringParams));const n={...typeof i.customHeaders=="function"?i.customHeaders():i.customHeaders};typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(n["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),t&&(n["Content-Type"]="application/json");const r=typeof i.requestOptions=="function"?i.requestOptions(t):i.requestOptions,o={method:t?"POST":"GET",body:t?i.stringify(t):void 0,headers:n,...i._omitFetchOptions?{}:r},a=typeof i.alternateFetch=="function"&&i.alternateFetch.length>=1?i.alternateFetch:void 0;try{Ie(e,o,s,a)}catch(u){if(!r||Object.keys(r).length===0||!u.message||u.message.indexOf("not implemented")<0)return s(u);try{Object.keys(r).forEach(l=>{delete o[l]}),Ie(e,o,s,a),i._omitFetchOptions=!0}catch(l){s(l)}}},Zt=(i,e,t,s)=>{t&&typeof t=="object"&&(t=pe("",t).slice(1)),i.queryStringParams&&(e=pe(e,i.queryStringParams));try{const n=Te?new Te:new Gt("MSXML2.XMLHTTP.3.0");n.open(t?"POST":"GET",e,1),i.crossDomain||n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.withCredentials=!!i.withCredentials,t&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.overrideMimeType&&n.overrideMimeType("application/json");let r=i.customHeaders;if(r=typeof r=="function"?r():r,r)for(const o of Object.keys(r))Qe.indexOf(o)>-1||n.setRequestHeader(o,r[o]);n.onreadystatechange=()=>{n.readyState>3&&s(n.status>=400?n.statusText:null,{status:n.status,data:n.responseText})},n.send(t)}catch(n){console&&console.log(n)}},es=(i,e,t,s)=>{if(typeof t=="function"&&(s=t,t=void 0),s=s||(()=>{}),re&&e.indexOf("file:")!==0)return Qt(i,e,t,s);if(Ge()||typeof ActiveXObject=="function")return Zt(i,e,t,s);s(new Error("No fetch and no xhr implementation found!"))},ts=()=>({loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:i=>JSON.parse(i),stringify:JSON.stringify,parsePayload:(i,e,t)=>({[e]:t||""}),parseLoadPayload:(i,e)=>{},request:es,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}});var ss=class{constructor(i,e={},t={}){this.services=i,this.options=e,this.allOptions=t,this.type="backend",this.init(i,e,t)}init(i,e={},t={}){if(this.services=i,this.options={...ts(),...this.options||{},...e},this.allOptions=t,this.services&&this.options.reloadInterval){const s=setInterval(()=>this.reload(),this.options.reloadInterval);typeof s=="object"&&typeof s.unref=="function"&&s.unref()}}readMulti(i,e,t){this._readAny(i,i,e,e,t)}read(i,e,t){this._readAny([i],i,[e],e,t)}_readAny(i,e,t,s,n){let r=this.options.loadPath;typeof this.options.loadPath=="function"&&(r=this.options.loadPath(i,t)),r=Xt(r),r.then(o=>{if(!o)return n(null,{});const a=je(o,{lng:i.join("+"),ns:t.join("+")});if(a==null){const u=i.map(te).join(", "),l=t.map(te).join(", ");return n(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+u+"] namespaces=["+l+"]"),!1)}this.loadUrl(a,n,e,s)})}loadUrl(i,e,t,s){const n=typeof t=="string"?[t]:t,r=typeof s=="string"?[s]:s,o=this.options.parseLoadPayload(n,r),a=te(Wt(i));this.options.request(this.options,i,o,(u,l)=>{if(l&&(l.status>=500&&l.status<600||!l.status))return e("failed loading "+a+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return e("failed loading "+a+"; status code: "+l.status,!1);if(!l&&u&&u.message){const h=u.message.toLowerCase();if(["failed","fetch","network","load"].find(g=>h.indexOf(g)>-1))return e("failed loading "+a+": "+te(u.message),!0)}if(u)return e(u,!1);let c,f;try{typeof l.data=="string"?c=this.options.parse(l.data,t,s):c=l.data}catch{f="failed parsing "+a+" to json"}if(f)return e(f,!1);e(null,c)})}create(i,e,t,s,n){if(!this.options.addPath)return;typeof i=="string"&&(i=[i]);const r=this.options.parsePayload(e,t,s);let o=0;const a=[],u=[];i.forEach(l=>{let c=this.options.addPath;typeof this.options.addPath=="function"&&(c=this.options.addPath(l,e));const f=je(c,{lng:l,ns:e});if(f==null){o+=1,n&&o===i.length&&n(a,u);return}this.options.request(this.options,f,r,(h,g)=>{o+=1,a.push(h),u.push(g),o===i.length&&typeof n=="function"&&n(a,u)})})}reload(){const{backendConnector:i,languageUtils:e,logger:t}=this.services,s=i.language;if(s&&s.toLowerCase()==="cimode")return;const n=[],r=o=>{e.toResolveHierarchy(o).forEach(a=>{n.indexOf(a)<0&&n.push(a)})};r(s),this.allOptions.preload&&this.allOptions.preload.forEach(o=>r(o)),n.forEach(o=>{this.allOptions.ns.forEach(a=>{i.read(o,a,"read",null,null,(u,l)=>{u&&t.warn(`loading namespace ${a} for language ${o} failed`,u),!u&&l&&t.log(`loaded namespace ${a} for language ${o}`,l),i.loaded(`${o}|${a}`,u,l)})})})}};ss.type="backend";const{slice:ns,forEach:is}=[];function rs(i){return is.call(ns.call(arguments,1),e=>{if(e)for(const t in e)i[t]===void 0&&(i[t]=e[t])}),i}function os(i){return typeof i!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(i))}const Ae=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,as=function(i,e){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(e);let r=`${i}=${n}`;if(s.maxAge>0){const o=s.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(o)}`}if(s.domain){if(!Ae.test(s.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${s.domain}`}if(s.path){if(!Ae.test(s.path))throw new TypeError("option path is invalid");r+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");r+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(r+="; HttpOnly"),s.secure&&(r+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(r+="; Partitioned"),r},De={create(i,e,t,s){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+t*60*1e3)),s&&(n.domain=s),document.cookie=as(i,e,n)},read(i){const e=`${i}=`,t=document.cookie.split(";");for(let s=0;s<t.length;s++){let n=t[s];for(;n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return n.substring(e.length,n.length)}return null},remove(i,e){this.create(i,"",-1,e)}};var ls={name:"cookie",lookup(i){let{lookupCookie:e}=i;if(e&&typeof document<"u")return De.read(e)||void 0},cacheUserLanguage(i,e){let{lookupCookie:t,cookieMinutes:s,cookieDomain:n,cookieOptions:r}=e;t&&typeof document<"u"&&De.create(t,i,s,n,r)}},us={name:"querystring",lookup(i){var s;let{lookupQuerystring:e}=i,t;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&((s=window.location.hash)==null?void 0:s.indexOf("?"))>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const o=n.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(t=o[a].substring(u+1))}}return t}},cs={name:"hash",lookup(i){var n;let{lookupHash:e,lookupFromHashIndex:t}=i,s;if(typeof window<"u"){const{hash:r}=window.location;if(r&&r.length>2){const o=r.substring(1);if(e){const a=o.split("&");for(let u=0;u<a.length;u++){const l=a[u].indexOf("=");l>0&&a[u].substring(0,l)===e&&(s=a[u].substring(l+1))}}if(s)return s;if(!s&&t>-1){const a=r.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(n=a[typeof t=="number"?t:0])==null?void 0:n.replace("/",""):void 0}}}return s}};let _=null;const Ue=()=>{if(_!==null)return _;try{if(_=typeof window<"u"&&window.localStorage!==null,!_)return!1;const i="i18next.translate.boo";window.localStorage.setItem(i,"foo"),window.localStorage.removeItem(i)}catch{_=!1}return _};var fs={name:"localStorage",lookup(i){let{lookupLocalStorage:e}=i;if(e&&Ue())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupLocalStorage:t}=e;t&&Ue()&&window.localStorage.setItem(t,i)}};let q=null;const He=()=>{if(q!==null)return q;try{if(q=typeof window<"u"&&window.sessionStorage!==null,!q)return!1;const i="i18next.translate.boo";window.sessionStorage.setItem(i,"foo"),window.sessionStorage.removeItem(i)}catch{q=!1}return q};var ds={name:"sessionStorage",lookup(i){let{lookupSessionStorage:e}=i;if(e&&He())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupSessionStorage:t}=e;t&&He()&&window.sessionStorage.setItem(t,i)}},hs={name:"navigator",lookup(i){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:s,language:n}=navigator;if(t)for(let r=0;r<t.length;r++)e.push(t[r]);s&&e.push(s),n&&e.push(n)}return e.length>0?e:void 0}},gs={name:"htmlTag",lookup(i){let{htmlTag:e}=i,t;const s=e||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(t=s.getAttribute("lang")),t}},ps={name:"path",lookup(i){var n;let{lookupFromPathIndex:e}=i;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(n=t[typeof e=="number"?e:0])==null?void 0:n.replace("/",""):void 0}},ms={name:"subdomain",lookup(i){var n,r;let{lookupFromSubdomainIndex:e}=i;const t=typeof e=="number"?e+1:1,s=typeof window<"u"&&((r=(n=window.location)==null?void 0:n.hostname)==null?void 0:r.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(s)return s[t]}};let Ze=!1;try{document.cookie,Ze=!0}catch{}const et=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ze||et.splice(1,1);const ys=()=>({order:et,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:i=>i});class Ss{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=rs(t,this.options||{},ys()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=n=>n.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(ls),this.addDetector(us),this.addDetector(fs),this.addDetector(ds),this.addDetector(hs),this.addDetector(gs),this.addDetector(ps),this.addDetector(ms),this.addDetector(cs)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(s=>{if(this.detectors[s]){let n=this.detectors[s].lookup(this.options);n&&typeof n=="string"&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(s=>s!=null&&!os(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(e,this.options)}))}}Ss.type="languageDetector";export{ss as B,Ls as I,Ss as a,E as b,ws as i,Mt as s,bs as u};