@spscommerce/i18n 7.17.13 → 7.19.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.
@@ -0,0 +1,2 @@
1
+ (function(V,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(V=typeof globalThis<"u"?globalThis:V||self,C(V.I18n={},V.react))})(this,function(V,C){"use strict";function yt(i,t){for(var n=0;n<t.length;n++){const e=t[n];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in i)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(i,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function D(i){return D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(i)}function bt(i,t){if(D(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t||"default");if(D(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function Ce(i){var t=bt(i,"string");return D(t)=="symbol"?t:String(t)}function ie(i,t,n){return t=Ce(t),t in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}function I(i){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},e=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&e.push.apply(e,Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.forEach(function(r){ie(i,r,n[r])})}return i}function B(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Ne(i,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,Ce(e.key),e)}}function H(i,t,n){return t&&Ne(i.prototype,t),n&&Ne(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}function J(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function ee(i,t){if(t&&(D(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J(i)}function Q(i){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(i)}function ye(i,t){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},ye(i,t)}function ae(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),t&&ye(i,t)}var wt={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},St=function(){function i(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,i),this.init(t,n)}return H(i,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=n||wt,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,e,r,a){return a&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(r).concat(this.prefix," ").concat(n[0])),this.logger[e](n))}},{key:"create",value:function(n){return new i(this.logger,I({},{prefix:"".concat(this.prefix,":").concat(n,":")},this.options))}}]),i}(),$=new St,W=function(){function i(){B(this,i),this.observers={}}return H(i,[{key:"on",value:function(n,e){var r=this;return n.split(" ").forEach(function(a){r.observers[a]=r.observers[a]||[],r.observers[a].push(e)}),this}},{key:"off",value:function(n,e){if(!!this.observers[n]){if(!e){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(r){return r!==e})}}},{key:"emit",value:function(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];if(this.observers[n]){var o=[].concat(this.observers[n]);o.forEach(function(u){u.apply(void 0,r)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[n].concat(r))})}}}]),i}();function te(){var i,t,n=new Promise(function(e,r){i=e,t=r});return n.resolve=i,n.reject=t,n}function Te(i){return i==null?"":""+i}function Ot(i,t,n){i.forEach(function(e){t[e]&&(n[e]=t[e])})}function be(i,t,n){function e(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function r(){return!i||typeof i=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(r())return{};var o=e(a.shift());!i[o]&&n&&(i[o]=new n),Object.prototype.hasOwnProperty.call(i,o)?i=i[o]:i={}}return r()?{}:{obj:i,k:e(a.shift())}}function Ae(i,t,n){var e=be(i,t,Object),r=e.obj,a=e.k;r[a]=n}function xt(i,t,n,e){var r=be(i,t,Object),a=r.obj,o=r.k;a[o]=a[o]||[],e&&(a[o]=a[o].concat(n)),e||a[o].push(n)}function oe(i,t){var n=be(i,t),e=n.obj,r=n.k;if(!!e)return e[r]}function Fe(i,t,n){var e=oe(i,n);return e!==void 0?e:oe(t,n)}function _e(i,t,n){for(var e in t)e!=="__proto__"&&e!=="constructor"&&(e in i?typeof i[e]=="string"||i[e]instanceof String||typeof t[e]=="string"||t[e]instanceof String?n&&(i[e]=t[e]):_e(i[e],t[e],n):i[e]=t[e]);return i}function G(i){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var kt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Lt(i){return typeof i=="string"?i.replace(/[&<>"'\/]/g,function(t){return kt[t]}):i}var se=typeof window<"u"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Pt=function(i){ae(t,i);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return B(this,t),e=ee(this,Q(t).call(this)),se&&W.call(J(e)),e.data=n||{},e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e}return H(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function(e,r,a){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=[e,r];return a&&typeof a!="string"&&(u=u.concat(a)),a&&typeof a=="string"&&(u=u.concat(s?a.split(s):a)),e.indexOf(".")>-1&&(u=e.split(".")),oe(this.data,u)}},{key:"addResource",value:function(e,r,a,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var f=[e,r];a&&(f=f.concat(u?a.split(u):a)),e.indexOf(".")>-1&&(f=e.split("."),o=r,r=f[1]),this.addNamespaces(r),Ae(this.data,f,o),s.silent||this.emit("added",e,r,a,o)}},{key:"addResources",value:function(e,r,a){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var s in a)(typeof a[s]=="string"||Object.prototype.toString.apply(a[s])==="[object Array]")&&this.addResource(e,r,s,a[s],{silent:!0});o.silent||this.emit("added",e,r,a)}},{key:"addResourceBundle",value:function(e,r,a,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[e,r];e.indexOf(".")>-1&&(f=e.split("."),o=a,a=r,r=f[1]),this.addNamespaces(r);var c=oe(this.data,f)||{};o?_e(c,a,s):c=I({},c,a),Ae(this.data,f,c),u.silent||this.emit("added",e,r,a)}},{key:"removeResourceBundle",value:function(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}},{key:"hasResourceBundle",value:function(e,r){return this.getResource(e,r)!==void 0}},{key:"getResourceBundle",value:function(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?I({},{},this.getResource(e,r)):this.getResource(e,r)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(W),De={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,e,r,a){var o=this;return t.forEach(function(s){o.processors[s]&&(n=o.processors[s].process(n,e,r,a))}),n}},Ie={},Ue=function(i){ae(t,i);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B(this,t),e=ee(this,Q(t).call(this)),se&&W.call(J(e)),Ot(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,J(e)),e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=$.create("translator"),e}return H(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},a=this.resolve(e,r);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(e,r){var a=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS;if(a&&e.indexOf(a)>-1){var u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:s};var f=e.split(a);(a!==o||a===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),e=f.join(o)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}},{key:"translate",value:function(e,r,a){var o=this;if(D(r)!=="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);var s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],r),f=u.key,c=u.namespaces,p=c[c.length-1],v=r.lng||this.language,m=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var d=r.nsSeparator||this.options.nsSeparator;return p+d+f}return f}var y=this.resolve(e,r),h=y&&y.res,b=y&&y.usedKey||f,S=y&&y.exactUsedKey||f,O=Object.prototype.toString.apply(h),A=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,j=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(w&&h&&j&&A.indexOf(O)<0&&!(typeof k=="string"&&O==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,h,r):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(s){var R=O==="[object Array]",N=R?[]:{},P=R?S:b;for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)){var X="".concat(P).concat(s).concat(E);N[E]=this.translate(X,I({},r,{joinArrays:!1,ns:c})),N[E]===X&&(N[E]=h[E])}h=N}}else if(w&&typeof k=="string"&&O==="[object Array]")h=h.join(k),h&&(h=this.extendTranslation(h,e,r,a));else{var M=!1,l=!1,g=r.count!==void 0&&typeof r.count!="string",x=t.hasDefaultValue(r),F=g?this.pluralResolver.getSuffix(v,r.count):"",T=r["defaultValue".concat(F)]||r.defaultValue;!this.isValidLookup(h)&&x&&(M=!0,h=T),this.isValidLookup(h)||(l=!0,h=f);var L=x&&T!==h&&this.options.updateMissing;if(l||M||L){if(this.logger.log(L?"updateKey":"missingKey",v,p,f,L?T:h),s){var K=this.resolve(f,I({},r,{keySeparator:!1}));K&&K.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.")}var U=[],q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(var Y=0;Y<q.length;Y++)U.push(q[Y]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(r.lng||this.language):U.push(r.lng||this.language);var vt=function(Z,Re,mt){o.options.missingKeyHandler?o.options.missingKeyHandler(Z,p,Re,L?mt:h,L,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(Z,p,Re,L?mt:h,L,r),o.emit("missingKey",Z,p,Re,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?U.forEach(function(je){o.pluralResolver.getSuffixes(je).forEach(function(Z){vt([je],f+Z,r["defaultValue".concat(Z)]||T)})}):vt(U,f,T))}h=this.extendTranslation(h,e,r,y,a),l&&h===f&&this.options.appendNamespaceToMissingKey&&(h="".concat(p,":").concat(f)),l&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,r,a,o,s){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,a,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init(I({},a,{interpolation:I({},this.options.interpolation,a.interpolation)}));var f=a.interpolation&&a.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,c;if(f){var p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}var v=a.replace&&typeof a.replace!="string"?a.replace:a;if(this.options.interpolation.defaultVariables&&(v=I({},this.options.interpolation.defaultVariables,v)),e=this.interpolator.interpolate(e,v,a.lng||this.language,a),f){var m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;c<d&&(a.nest=!1)}a.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var b=arguments.length,S=new Array(b),O=0;O<b;O++)S[O]=arguments[O];return s&&s[0]===S[0]&&!a.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(r[0])),null):u.translate.apply(u,S.concat([r]))},a)),a.interpolation&&this.interpolator.reset()}var y=a.postProcess||this.options.postProcess,h=typeof y=="string"?[y]:y;return e!=null&&h&&h.length&&a.applyPostProcessor!==!1&&(e=De.handle(h,e,r,this.options&&this.options.postProcessPassResolved?I({i18nResolved:o},a):a,this)),e}},{key:"resolve",value:function(e){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,s,u,f,c;return typeof e=="string"&&(e=[e]),e.forEach(function(p){if(!r.isValidLookup(o)){var v=r.extractFromKey(p,a),m=v.key;s=m;var d=v.namespaces;r.options.fallbackNS&&(d=d.concat(r.options.fallbackNS));var y=a.count!==void 0&&typeof a.count!="string",h=a.context!==void 0&&typeof a.context=="string"&&a.context!=="",b=a.lngs?a.lngs:r.languageUtils.toResolveHierarchy(a.lng||r.language,a.fallbackLng);d.forEach(function(S){r.isValidLookup(o)||(c=S,!Ie["".concat(b[0],"-").concat(S)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(c)&&(Ie["".concat(b[0],"-").concat(S)]=!0,r.logger.warn('key "'.concat(s,'" for languages "').concat(b.join(", "),`" won't get resolved as namespace "`).concat(c,'" 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!!!")),b.forEach(function(O){if(!r.isValidLookup(o)){f=O;var A=m,k=[A];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(k,m,O,S,a);else{var w;y&&(w=r.pluralResolver.getSuffix(O,a.count)),y&&h&&k.push(A+w),h&&k.push(A+="".concat(r.options.contextSeparator).concat(a.context)),y&&k.push(A+=w)}for(var j;j=k.pop();)r.isValidLookup(o)||(u=j,o=r.getResource(O,S,j,a))}}))})}}),{res:o,usedKey:s,exactUsedKey:u,usedLng:f,usedNS:c}}},{key:"isValidLookup",value:function(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}},{key:"getResource",value:function(e,r,a){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,a,o):this.resourceStore.getResource(e,r,a,o)}}],[{key:"hasDefaultValue",value:function(e){var r="defaultValue";for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&r===a.substring(0,r.length)&&e[a]!==void 0)return!0;return!1}}]),t}(W);function we(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Et=function(){function i(t){B(this,i),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}return H(i,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var e=n.split("-");return e.length===2||(e.pop(),e[e.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(e.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var e=n.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],r=n.split("-");return this.options.lowerCaseLng?r=r.map(function(a){return a.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=we(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=we(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=we(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isWhitelisted",value:function(n){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(n)}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var e=this;if(!n)return null;var r;return n.forEach(function(a){if(!r){var o=e.formatLanguageCode(a);(!e.options.supportedLngs||e.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&n.forEach(function(a){if(!r){var o=e.getLanguagePartFromCode(a);if(e.isSupportedCode(o))return r=o;r=e.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(n,e){if(!n)return[];if(typeof n=="function"&&(n=n(e)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!e)return n.default||[];var r=n[e];return r||(r=n[this.getScriptPartFromCode(e)]),r||(r=n[this.formatLanguageCode(e)]),r||(r=n[this.getLanguagePartFromCode(e)]),r||(r=n.default),r||[]}},{key:"toResolveHierarchy",value:function(n,e){var r=this,a=this.getFallbackCodes(e||this.options.fallbackLng||[],n),o=[],s=function(f){!f||(r.isSupportedCode(f)?o.push(f):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(f)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),a.forEach(function(u){o.indexOf(u)<0&&s(r.formatLanguageCode(u))}),o}}]),i}(),jt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Rt={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};function Ct(){var i={};return jt.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:Rt[t.fc]}})}),i}var Nt=function(){function i(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,i),this.languageUtils=t,this.options=n,this.logger=$.create("pluralResolver"),this.rules=Ct()}return H(i,[{key:"addRule",value:function(n,e){this.rules[n]=e}},{key:"getRule",value:function(n){return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var e=this.getRule(n);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,e){return this.getSuffixes(n).map(function(r){return e+r})}},{key:"getSuffixes",value:function(n){var e=this,r=this.getRule(n);return r?r.numbers.map(function(a){return e.getSuffix(n,a)}):[]}},{key:"getSuffix",value:function(n,e){var r=this,a=this.getRule(n);if(a){var o=a.noAbs?a.plurals(e):a.plurals(Math.abs(e)),s=a.numbers[o];this.options.simplifyPluralSuffix&&a.numbers.length===2&&a.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var u=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&a.numbers.length===2&&a.numbers[0]===1?u():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(n)),""}}]),i}(),Tt=function(){function i(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};B(this,i),this.logger=$.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return H(i,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var e=n.interpolation;this.escape=e.escape!==void 0?e.escape:Lt,this.escapeValue=e.escapeValue!==void 0?e.escapeValue:!0,this.useRawValueToEscape=e.useRawValueToEscape!==void 0?e.useRawValueToEscape:!1,this.prefix=e.prefix?G(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?G(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?G(e.nestingPrefix):e.nestingPrefixEscaped||G("$t("),this.nestingSuffix=e.nestingSuffix?G(e.nestingSuffix):e.nestingSuffixEscaped||G(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=e.alwaysFormat!==void 0?e.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(n,e,r,a){var o=this,s,u,f,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(h){return h.replace(/\$/g,"$$$$")}var v=function(b){if(b.indexOf(o.formatSeparator)<0){var S=Fe(e,c,b);return o.alwaysFormat?o.format(S,void 0,r):S}var O=b.split(o.formatSeparator),A=O.shift().trim(),k=O.join(o.formatSeparator).trim();return o.format(Fe(e,c,A),k,r,a)};this.resetRegExp();var m=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,d=a&&a.interpolation&&a.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(b){return p(b)}},{regex:this.regexp,safeValue:function(b){return o.escapeValue?p(o.escape(b)):p(b)}}];return y.forEach(function(h){for(f=0;s=h.regex.exec(n);){if(u=v(s[1].trim()),u===void 0)if(typeof m=="function"){var b=m(n,s,a);u=typeof b=="string"?b:""}else if(d){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(n)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Te(u));if(n=n.replace(s[0],h.safeValue(u)),h.regex.lastIndex=0,f++,f>=o.maxReplaces)break}}),n}},{key:"nest",value:function(n,e){var r=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=I({},a);u.applyPostProcessor=!1,delete u.defaultValue;function f(m,d){var y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;var h=m.split(new RegExp("".concat(y,"[ ]*{"))),b="{".concat(h[1]);m=h[0],b=this.interpolate(b,u),b=b.replace(/'/g,'"');try{u=JSON.parse(b),d&&(u=I({},d,u))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),S),"".concat(m).concat(y).concat(b)}return delete u.defaultValue,m}for(;o=this.nestingRegexp.exec(n);){var c=[],p=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o[1])){var v=o[1].split(this.formatSeparator).map(function(m){return m.trim()});o[1]=v.shift(),c=v,p=!0}if(s=e(f.call(this,o[1].trim(),u),u),s&&o[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=Te(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(n)),s=""),p&&(s=c.reduce(function(m,d){return r.format(m,d,a.lng,a)},s.trim())),n=n.replace(o[0],s),this.regexp.lastIndex=0}return n}}]),i}();function At(i,t){for(var n=i.indexOf(t);n!==-1;)i.splice(n,1),n=i.indexOf(t)}var Ft=function(i){ae(t,i);function t(n,e,r){var a,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return B(this,t),a=ee(this,Q(t).call(this)),se&&W.call(J(a)),a.backend=n,a.store=e,a.services=r,a.languageUtils=r.languageUtils,a.options=o,a.logger=$.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(r,o.backend,o),a}return H(t,[{key:"queueLoad",value:function(e,r,a,o){var s=this,u=[],f=[],c=[],p=[];return e.forEach(function(v){var m=!0;r.forEach(function(d){var y="".concat(v,"|").concat(d);!a.reload&&s.store.hasResourceBundle(v,d)?s.state[y]=2:s.state[y]<0||(s.state[y]===1?f.indexOf(y)<0&&f.push(y):(s.state[y]=1,m=!1,f.indexOf(y)<0&&f.push(y),u.indexOf(y)<0&&u.push(y),p.indexOf(d)<0&&p.push(d)))}),m||c.push(v)}),(u.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:o}),{toLoad:u,pending:f,toLoadLanguages:c,toLoadNamespaces:p}}},{key:"loaded",value:function(e,r,a){var o=e.split("|"),s=o[0],u=o[1];r&&this.emit("failedLoading",s,u,r),a&&this.store.addResourceBundle(s,u,a),this.state[e]=r?-1:2;var f={};this.queue.forEach(function(c){xt(c.loaded,[s],u),At(c.pending,e),r&&c.errors.push(r),c.pending.length===0&&!c.done&&(Object.keys(c.loaded).forEach(function(p){f[p]||(f[p]=[]),c.loaded[p].length&&c.loaded[p].forEach(function(v){f[p].indexOf(v)<0&&f[p].push(v)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(e,r,a){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[a](e,r,function(c,p){if(c&&p&&s<5){setTimeout(function(){o.read.call(o,e,r,a,s+1,u*2,f)},u);return}f(c,p)}):f(null,{})}},{key:"prepareLoading",value:function(e,r){var a=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);var u=this.queueLoad(e,r,o,s);if(!u.toLoad.length)return u.pending.length||s(),null;u.toLoad.forEach(function(f){a.loadOne(f)})}},{key:"load",value:function(e,r,a){this.prepareLoading(e,r,{},a)}},{key:"reload",value:function(e,r,a){this.prepareLoading(e,r,{reload:!0},a)}},{key:"loadOne",value:function(e){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=e.split("|"),s=o[0],u=o[1];this.read(s,u,"read",void 0,void 0,function(f,c){f&&r.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(s," failed"),f),!f&&c&&r.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(s),c),r.loaded(e,f,c)})}},{key:"saveMissing",value:function(e,r,a,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(r,'" 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}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(e,r,a,o,null,I({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],r,a,o))}}]),t}(W);function _t(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(D(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),D(t[2])==="object"||D(t[3])==="object"){var e=t[3]||t[2];Object.keys(e).forEach(function(r){n[r]=e[r]})}return n},interpolation:{escapeValue:!0,format:function(t,n,e,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Be(i){return typeof i.ns=="string"&&(i.ns=[i.ns]),typeof i.fallbackLng=="string"&&(i.fallbackLng=[i.fallbackLng]),typeof i.fallbackNS=="string"&&(i.fallbackNS=[i.fallbackNS]),i.whitelist&&(i.whitelist&&i.whitelist.indexOf("cimode")<0&&(i.whitelist=i.whitelist.concat(["cimode"])),i.supportedLngs=i.whitelist),i.nonExplicitWhitelist&&(i.nonExplicitSupportedLngs=i.nonExplicitWhitelist),i.supportedLngs&&i.supportedLngs.indexOf("cimode")<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i}function ue(){}var Dt=function(i){ae(t,i);function t(){var n,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(B(this,t),n=ee(this,Q(t).call(this)),se&&W.call(J(n)),n.options=Be(e),n.services={},n.logger=$,n.modules={external:[]},r&&!n.isInitialized&&!e.isClone){if(!n.options.initImmediate)return n.init(e,r),ee(n,J(n));setTimeout(function(){n.init(e,r)},0)}return n}return H(t,[{key:"init",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(a=r,r={}),r.whitelist&&!r.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),r.nonExplicitWhitelist&&!r.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=I({},_t(),this.options,Be(r)),this.format=this.options.interpolation.format,a||(a=ue);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?$.init(o(this.modules.logger),this.options):$.init(null,this.options);var s=new Et(this.options);this.store=new Pt(this.options.resources,this.options);var u=this.services;u.logger=$,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Nt(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new Tt(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Ft(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Ue(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.external.forEach(function(d){d.init&&d.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments),e}});var v=te(),m=function(){var y=function(b,S){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),v.resolve(S),a(b,S)};if(e.languages&&e.options.compatibilityAPI!=="v1"&&!e.isInitialized)return y(null,e.t.bind(e));e.changeLanguage(e.options.lng,y)};return this.options.resources||!this.options.initImmediate?m():setTimeout(m,0),v}},{key:"loadResources",value:function(e){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ue,o=a,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode")return o();var u=[],f=function(v){if(!!v){var m=r.services.languageUtils.toResolveHierarchy(v);m.forEach(function(d){u.indexOf(d)<0&&u.push(d)})}};if(s)f(s);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(p){return f(p)})}this.options.preload&&this.options.preload.forEach(function(p){return f(p)}),this.services.backendConnector.load(u,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,r,a){var o=te();return e||(e=this.languages),r||(r=this.options.ns),a||(a=ue),this.services.backendConnector.reload(e,r,function(s){o.resolve(),a(s)}),o}},{key:"use",value:function(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"&&De.addPostProcessor(e),e.type==="3rdParty"&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,r){var a=this;this.isLanguageChangingTo=e;var o=te();this.emit("languageChanging",e);var s=function(c,p){p?(a.language=p,a.languages=a.services.languageUtils.toResolveHierarchy(p),a.translator.changeLanguage(p),a.isLanguageChangingTo=void 0,a.emit("languageChanged",p),a.logger.log("languageChanged",p)):a.isLanguageChangingTo=void 0,o.resolve(function(){return a.t.apply(a,arguments)}),r&&r(c,function(){return a.t.apply(a,arguments)})},u=function(c){var p=typeof c=="string"?c:a.services.languageUtils.getBestMatchFromCodes(c);p&&(a.language||(a.language=p,a.languages=a.services.languageUtils.toResolveHierarchy(p)),a.translator.language||a.translator.changeLanguage(p),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(p)),a.loadResources(p,function(v){s(v,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(e),o}},{key:"getFixedT",value:function(e,r){var a=this,o=function s(u,f){var c;if(D(f)!=="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),m=2;m<p;m++)v[m-2]=arguments[m];c=a.options.overloadTranslationOptionHandler([u,f].concat(v))}else c=I({},f);return c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,a.t(u,c)};return typeof e=="string"?o.lng=e:o.lngs=e,o.ns=r,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;var o=this.languages[0],s=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var f=function(v,m){var d=r.services.backendConnector.state["".concat(v,"|").concat(m)];return d===-1||d===2};if(a.precheck){var c=a.precheck(this,f);if(c!==void 0)return c}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||f(o,e)&&(!s||f(u,e)))}},{key:"loadNamespaces",value:function(e,r){var a=this,o=te();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(function(s){a.options.ns.indexOf(s)<0&&a.options.ns.push(s)}),this.loadResources(function(s){o.resolve(),r&&r(s)}),o):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function(e,r){var a=te();typeof e=="string"&&(e=[e]);var o=this.options.preload||[],s=e.filter(function(u){return o.indexOf(u)<0});return s.length?(this.options.preload=o.concat(s),this.loadResources(function(u){a.resolve(),r&&r(u)}),a):(r&&r(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";var r=["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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ue,o=I({},this.options,r,{isClone:!0}),s=new t(o),u=["store","services","language"];return u.forEach(function(f){s[f]=e[f]}),s.services=I({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new Ue(s.services,s.options),s.translator.on("*",function(f){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];s.emit.apply(s,[f].concat(p))}),s.init(o,a),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(W),It=new Dt;function Ut(i,t){if(i==null)return{};var n={},e=Object.keys(i),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(n[r]=i[r]);return n}function He(i,t){if(i==null)return{};var n=Ut(i,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(i,e)||(n[e]=i[e]))}return n}var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Bt={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},Ht=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Me(i){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=i.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(Bt[n[1]]||i.charAt(i.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var e=i.indexOf("-->");return{type:"comment",comment:e!==-1?i.slice(4,e):""}}for(var r=new RegExp(Ht),a=null;(a=r.exec(i))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),t.attrs[s[0]]=s[1],r.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var Mt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qt=/^\s*$/,Vt=Object.create(null);function qe(i,t){switch(t.type){case"text":return i+t.content;case"tag":return i+="<"+t.name+(t.attrs?function(n){var e=[];for(var r in n)e.push(r+'="'+n[r]+'"');return e.length?" "+e.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?i:i+t.children.reduce(qe,"")+"</"+t.name+">";case"comment":return i+"<!--"+t.comment+"-->"}}var $t={parse:function(i,t){t||(t={}),t.components||(t.components=Vt);var n,e=[],r=[],a=-1,o=!1;if(i.indexOf("<")!==0){var s=i.indexOf("<");e.push({type:"text",content:s===-1?i:i.substring(0,s)})}return i.replace(Mt,function(u,f){if(o){if(u!=="</"+n.name+">")return;o=!1}var c,p=u.charAt(1)!=="/",v=u.startsWith("<!--"),m=f+u.length,d=i.charAt(m);if(v){var y=Me(u);return a<0?(e.push(y),e):((c=r[a]).children.push(y),e)}if(p&&(a++,(n=Me(u)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:i.slice(m,i.indexOf("<",m))}),a===0&&e.push(n),(c=r[a-1])&&c.children.push(n),r[a]=n),(!p||n.voidElement)&&(a>-1&&(n.voidElement||n.name===u.slice(2,-1))&&(a--,n=a===-1?e:r[a]),!o&&d!=="<"&&d)){c=a===-1?e:r[a].children;var h=i.indexOf("<",m),b=i.slice(m,h===-1?void 0:h);qt.test(b)&&(b=" "),(h>-1&&a+c.length>=0||b!==" ")&&c.push({type:"text",content:b})}}),e},stringify:function(i){return i.reduce(function(t,n){return t+qe("",n)},"")}},zt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Kt={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Wt=function(t){return Kt[t]},Xt=function(t){return t.replace(zt,Wt)};function Ve(i,t){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(i);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),n.push.apply(n,e)}return n}function $e(i){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ve(Object(n),!0).forEach(function(e){ie(i,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))})}return i}var Se={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xt},ze,Ke=C.createContext();function Jt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Se=$e($e({},Se),i)}function We(){return Se}var Qt=function(){function i(){B(this,i),this.usedNamespaces={}}return H(i,[{key:"addUsedNamespaces",value:function(n){var e=this;n.forEach(function(r){e.usedNamespaces[r]||(e.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),i}();function Gt(i){ze=i}function Xe(){return ze}var Yt={type:"3rdParty",init:function(t){Jt(t.options.react),Gt(t)}};function le(){if(console&&console.warn){for(var i,t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(i=console).warn.apply(i,n)}}var Je={};function ce(){for(var i=arguments.length,t=new Array(i),n=0;n<i;n++)t[n]=arguments[n];typeof t[0]=="string"&&Je[t[0]]||(typeof t[0]=="string"&&(Je[t[0]]=new Date),le.apply(void 0,t))}function Qe(i,t,n){i.loadNamespaces(t,function(){if(i.isInitialized)n();else{var e=function r(){setTimeout(function(){i.off("initialized",r)},0),n()};i.on("initialized",e)}})}function Zt(i,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},e=t.languages[0],r=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(e.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,i)?!1:!!(t.hasResourceBundle(e,i)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(e,i)&&(!r||o(a,i)))}function en(i,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return ce("i18n.languages were undefined or empty",t.languages),!0;var e=t.options.ignoreJSONStructure!==void 0;return e?t.hasLoadedNamespace(i,{precheck:function(a,o){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,i))return!1}}):Zt(i,t,n)}var tn=["format"],nn=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function Ge(i,t){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(i);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),n.push.apply(n,e)}return n}function _(i){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ge(Object(n),!0).forEach(function(e){ie(i,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))})}return i}function Oe(i,t){if(!i)return!1;var n=i.props?i.props.children:i.children;return t?n.length>0:!!n}function xe(i){return i?i.props?i.props.children:i.children:[]}function rn(i){return Object.prototype.toString.call(i)!=="[object Array]"?!1:i.every(function(t){return C.isValidElement(t)})}function ne(i){return Array.isArray(i)?i:[i]}function an(i,t){var n=_({},t);return n.props=Object.assign(i.props,t.props),n}function Ye(i,t){if(!i)return"";var n="",e=ne(i),r=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return e.forEach(function(a,o){if(typeof a=="string")n+="".concat(a);else if(C.isValidElement(a)){var s=Object.keys(a.props).length,u=r.indexOf(a.type)>-1,f=a.props.children;if(!f&&u&&s===0)n+="<".concat(a.type,"/>");else if(!f&&(!u||s!==0))n+="<".concat(o,"></").concat(o,">");else if(a.props.i18nIsDynamicList)n+="<".concat(o,"></").concat(o,">");else if(u&&s===1&&typeof f=="string")n+="<".concat(a.type,">").concat(f,"</").concat(a.type,">");else{var c=Ye(f,t);n+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(a===null)le("Trans: the passed in value is invalid - seems you passed in a null child.");else if(D(a)==="object"){var p=a.format,v=He(a,tn),m=Object.keys(v);if(m.length===1){var d=p?"".concat(m[0],", ").concat(p):m[0];n+="{{".concat(d,"}}")}else le("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",a)}else le("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",a)}),n}function on(i,t,n,e,r,a){if(t==="")return[];var o=e.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.join("|")).test(t);if(!i&&!s)return[t];var u={};function f(h){var b=ne(h);b.forEach(function(S){typeof S!="string"&&(Oe(S)?f(xe(S)):D(S)==="object"&&!C.isValidElement(S)&&Object.assign(u,S))})}f(i);var c=$t.parse("<0>".concat(t,"</0>")),p=_(_({},u),r);function v(h,b,S){var O=xe(h),A=d(O,b.children,S);return rn(O)&&A.length===0?O:A}function m(h,b,S,O,A){h.dummy&&(h.children=b),S.push(C.cloneElement(h,_(_({},h.props),{},{key:O}),A?void 0:b))}function d(h,b,S){var O=ne(h),A=ne(b);return A.reduce(function(k,w,j){var R=w.children&&w.children[0]&&w.children[0].content&&n.services.interpolator.interpolate(w.children[0].content,p,n.language);if(w.type==="tag"){var N=O[parseInt(w.name,10)];!N&&S.length===1&&S[0][w.name]&&(N=S[0][w.name]),N||(N={});var P=Object.keys(w.attrs).length!==0?an({props:w.attrs},N):N,E=C.isValidElement(P),X=E&&Oe(w,!0)&&!w.voidElement,M=s&&D(P)==="object"&&P.dummy&&!E,l=D(i)==="object"&&i!==null&&Object.hasOwnProperty.call(i,w.name);if(typeof P=="string"){var g=n.services.interpolator.interpolate(P,p,n.language);k.push(g)}else if(Oe(P)||X){var x=v(P,w,S);m(P,x,k,j)}else if(M){var F=d(O,w.children,S);k.push(C.cloneElement(P,_(_({},P.props),{},{key:j}),F))}else if(Number.isNaN(parseFloat(w.name)))if(l){var T=v(P,w,S);m(P,T,k,j,w.voidElement)}else if(e.transSupportBasicHtmlNodes&&o.indexOf(w.name)>-1)if(w.voidElement)k.push(C.createElement(w.name,{key:"".concat(w.name,"-").concat(j)}));else{var L=d(O,w.children,S);k.push(C.createElement(w.name,{key:"".concat(w.name,"-").concat(j)},L))}else if(w.voidElement)k.push("<".concat(w.name," />"));else{var K=d(O,w.children,S);k.push("<".concat(w.name,">").concat(K,"</").concat(w.name,">"))}else if(D(P)==="object"&&!E){var U=w.children[0]?R:null;U&&k.push(U)}else w.children.length===1&&R?k.push(C.cloneElement(P,_(_({},P.props),{},{key:j}),R)):k.push(C.cloneElement(P,_(_({},P.props),{},{key:j})))}else if(w.type==="text"){var q=e.transWrapTextNodes,Y=a?e.unescape(n.services.interpolator.interpolate(w.content,p,n.language)):n.services.interpolator.interpolate(w.content,p,n.language);q?k.push(C.createElement(q,{key:"".concat(w.name,"-").concat(j)},Y)):k.push(Y)}return k},[])}var y=d([{dummy:!0,children:i||[]}],c,ne(i||[]));return xe(y[0])}function sn(i){var t=i.children,n=i.count,e=i.parent,r=i.i18nKey,a=i.context,o=i.tOptions,s=o===void 0?{}:o,u=i.values,f=i.defaults,c=i.components,p=i.ns,v=i.i18n,m=i.t,d=i.shouldUnescape,y=He(i,nn),h=C.useContext(Ke)||{},b=h.i18n,S=h.defaultNS,O=v||b||Xe();if(!O)return ce("You will need to pass in an i18next instance by using i18nextReactModule"),t;var A=m||O.t.bind(O)||function(g){return g};a&&(s.context=a);var k=_(_({},We()),O.options&&O.options.react),w=p||A.ns||S||O.options&&O.options.defaultNS;w=typeof w=="string"?[w]:w||["translation"];var j=f||Ye(t,k)||k.transEmptyNodeValue||r,R=k.hashTransKey,N=r||(R?R(j):j),P=u?s.interpolation:{interpolation:_(_({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},E=_(_(_(_({},s),{},{count:n},u),P),{},{defaultValue:j,ns:w}),X=N?A(N,E):j,M=on(c||t,X,O,k,E,d),l=e!==void 0?e:k.defaultTransParent;return l?C.createElement(l,y,M):M}function un(i){if(Array.isArray(i))return i}function fn(i,t){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var e,r,a,o,s=[],u=!0,f=!1;try{if(a=(n=n.call(i)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(e=a.call(n)).done)&&(s.push(e.value),s.length!==t);u=!0);}catch(c){f=!0,r=c}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw r}}return s}}function Ze(i,t){(t==null||t>i.length)&&(t=i.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=i[n];return e}function ln(i,t){if(!!i){if(typeof i=="string")return Ze(i,t);var n=Object.prototype.toString.call(i).slice(8,-1);if(n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set")return Array.from(i);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(i,t)}}function cn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pn(i,t){return un(i)||fn(i,t)||ln(i,t)||cn()}function et(i,t){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(i);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),n.push.apply(n,e)}return n}function ke(i){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?et(Object(n),!0).forEach(function(e){ie(i,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))})}return i}var dn=function(t,n){var e=C.useRef();return C.useEffect(function(){e.current=n?e.current:t},[t,n]),e.current};function gn(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,e=C.useContext(Ke)||{},r=e.i18n,a=e.defaultNS,o=n||r||Xe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Qt),!o){ce("You will need to pass in an i18next instance by using initReactI18next");var s=function(N){return Array.isArray(N)?N[N.length-1]:N},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&ce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=ke(ke(ke({},We()),o.options.react),t),c=f.useSuspense,p=f.keyPrefix,v=i||a||o.options&&o.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(v);var m=(o.isInitialized||o.initializedStoreOnce)&&v.every(function(R){return en(R,o,f)});function d(){return o.getFixedT(null,f.nsMode==="fallback"?v:v[0],p)}var y=C.useState(d),h=pn(y,2),b=h[0],S=h[1],O=v.join(),A=dn(O),k=C.useRef(!0);C.useEffect(function(){var R=f.bindI18n,N=f.bindI18nStore;k.current=!0,!m&&!c&&Qe(o,v,function(){k.current&&S(d)}),m&&A&&A!==O&&k.current&&S(d);function P(){k.current&&S(d)}return R&&o&&o.on(R,P),N&&o&&o.store.on(N,P),function(){k.current=!1,R&&o&&R.split(" ").forEach(function(E){return o.off(E,P)}),N&&o&&N.split(" ").forEach(function(E){return o.store.off(E,P)})}},[o,O]);var w=C.useRef(!0);C.useEffect(function(){k.current&&!w.current&&S(d),w.current=!1},[o,p]);var j=[b,o,m];if(j.t=b,j.i18n=o,j.ready=m,m||!m&&!c)return j;throw new Promise(function(R){Qe(o,v,function(){R()})})}function Le(i){return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(i)}var tt=[],hn=tt.forEach,vn=tt.slice;function Pe(i){return hn.call(vn.call(arguments,1),function(t){if(t)for(var n in t)i[n]===void 0&&(i[n]=t[n])}),i}function nt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Le(XMLHttpRequest))==="object"}function mn(i){return!!i&&typeof i.then=="function"}function yn(i){return mn(i)?i:Promise.resolve(i)}function bn(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pe={exports:{}},de={exports:{}},rt;function wn(){return rt||(rt=1,function(i,t){var n=typeof self<"u"?self:fe,e=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var s={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(l){return l&&DataView.prototype.isPrototypeOf(l)}if(s.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(l){return l&&f.indexOf(Object.prototype.toString.call(l))>-1};function p(l){if(typeof l!="string"&&(l=String(l)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))throw new TypeError("Invalid character in header field name");return l.toLowerCase()}function v(l){return typeof l!="string"&&(l=String(l)),l}function m(l){var g={next:function(){var x=l.shift();return{done:x===void 0,value:x}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(l){this.map={},l instanceof d?l.forEach(function(g,x){this.append(x,g)},this):Array.isArray(l)?l.forEach(function(g){this.append(g[0],g[1])},this):l&&Object.getOwnPropertyNames(l).forEach(function(g){this.append(g,l[g])},this)}d.prototype.append=function(l,g){l=p(l),g=v(g);var x=this.map[l];this.map[l]=x?x+", "+g:g},d.prototype.delete=function(l){delete this.map[p(l)]},d.prototype.get=function(l){return l=p(l),this.has(l)?this.map[l]:null},d.prototype.has=function(l){return this.map.hasOwnProperty(p(l))},d.prototype.set=function(l,g){this.map[p(l)]=v(g)},d.prototype.forEach=function(l,g){for(var x in this.map)this.map.hasOwnProperty(x)&&l.call(g,this.map[x],x,this)},d.prototype.keys=function(){var l=[];return this.forEach(function(g,x){l.push(x)}),m(l)},d.prototype.values=function(){var l=[];return this.forEach(function(g){l.push(g)}),m(l)},d.prototype.entries=function(){var l=[];return this.forEach(function(g,x){l.push([x,g])}),m(l)},s.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function y(l){if(l.bodyUsed)return Promise.reject(new TypeError("Already read"));l.bodyUsed=!0}function h(l){return new Promise(function(g,x){l.onload=function(){g(l.result)},l.onerror=function(){x(l.error)}})}function b(l){var g=new FileReader,x=h(g);return g.readAsArrayBuffer(l),x}function S(l){var g=new FileReader,x=h(g);return g.readAsText(l),x}function O(l){for(var g=new Uint8Array(l),x=new Array(g.length),F=0;F<g.length;F++)x[F]=String.fromCharCode(g[F]);return x.join("")}function A(l){if(l.slice)return l.slice(0);var g=new Uint8Array(l.byteLength);return g.set(new Uint8Array(l)),g.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(l){this._bodyInit=l,l?typeof l=="string"?this._bodyText=l:s.blob&&Blob.prototype.isPrototypeOf(l)?this._bodyBlob=l:s.formData&&FormData.prototype.isPrototypeOf(l)?this._bodyFormData=l:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)?this._bodyText=l.toString():s.arrayBuffer&&s.blob&&u(l)?(this._bodyArrayBuffer=A(l.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(l)||c(l))?this._bodyArrayBuffer=A(l):this._bodyText=l=Object.prototype.toString.call(l):this._bodyText="",this.headers.get("content-type")||(typeof l=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(N)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(l){var g=l.toUpperCase();return w.indexOf(g)>-1?g:l}function R(l,g){g=g||{};var x=g.body;if(l instanceof R){if(l.bodyUsed)throw new TypeError("Already read");this.url=l.url,this.credentials=l.credentials,g.headers||(this.headers=new d(l.headers)),this.method=l.method,this.mode=l.mode,this.signal=l.signal,!x&&l._bodyInit!=null&&(x=l._bodyInit,l.bodyUsed=!0)}else this.url=String(l);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new d(g.headers)),this.method=j(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function N(l){var g=new FormData;return l.trim().split("&").forEach(function(x){if(x){var F=x.split("="),T=F.shift().replace(/\+/g," "),L=F.join("=").replace(/\+/g," ");g.append(decodeURIComponent(T),decodeURIComponent(L))}}),g}function P(l){var g=new d,x=l.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(F){var T=F.split(":"),L=T.shift().trim();if(L){var K=T.join(":").trim();g.append(L,K)}}),g}k.call(R.prototype);function E(l,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new d(g.headers),this.url=g.url||"",this._initBody(l)}k.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var l=new E(null,{status:0,statusText:""});return l.type="error",l};var X=[301,302,303,307,308];E.redirect=function(l,g){if(X.indexOf(g)===-1)throw new RangeError("Invalid status code");return new E(null,{status:g,headers:{location:l}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,x){this.message=g,this.name=x;var F=Error(g);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(l,g){return new Promise(function(x,F){var T=new R(l,g);if(T.signal&&T.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function K(){L.abort()}L.onload=function(){var U={status:L.status,statusText:L.statusText,headers:P(L.getAllResponseHeaders()||"")};U.url="responseURL"in L?L.responseURL:U.headers.get("X-Request-URL");var q="response"in L?L.response:L.responseText;x(new E(q,U))},L.onerror=function(){F(new TypeError("Network request failed"))},L.ontimeout=function(){F(new TypeError("Network request failed"))},L.onabort=function(){F(new o.DOMException("Aborted","AbortError"))},L.open(T.method,T.url,!0),T.credentials==="include"?L.withCredentials=!0:T.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&s.blob&&(L.responseType="blob"),T.headers.forEach(function(U,q){L.setRequestHeader(q,U)}),T.signal&&(T.signal.addEventListener("abort",K),L.onreadystatechange=function(){L.readyState===4&&T.signal.removeEventListener("abort",K)}),L.send(typeof T._bodyInit>"u"?null:T._bodyInit)})}return M.polyfill=!0,a.fetch||(a.fetch=M,a.Headers=d,a.Request=R,a.Response=E),o.Headers=d,o.Request=R,o.Response=E,o.fetch=M,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(e),e.fetch.ponyfill=!0,delete e.fetch.polyfill;var r=e;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,i.exports=t}(de,de.exports)),de.exports}(function(i,t){var n;if(typeof fetch=="function"&&(typeof fe<"u"&&fe.fetch?n=fe.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof bn<"u"&&(typeof window>"u"||typeof window.document>"u")){var e=n||wn();e.default&&(e=e.default),t.default=e,i.exports=t.default}})(pe,pe.exports);const it=pe.exports,at=yt({__proto__:null,default:it},[pe.exports]);function ge(i){return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(i)}var z;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?z=global.fetch:typeof window<"u"&&window.fetch?z=window.fetch:z=fetch);var re;nt()&&(typeof global<"u"&&global.XMLHttpRequest?re=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(re=window.XMLHttpRequest));var he;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?he=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(he=window.ActiveXObject)),!z&&at&&!re&&!he&&(z=it||at),typeof z!="function"&&(z=void 0);var Ee=function(t,n){if(n&&ge(n)==="object"){var e="";for(var r in n)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n[r]);if(!e)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+e.slice(1)}return t},ot=function(t,n,e){z(t,n).then(function(r){if(!r.ok)return e(r.statusText||"Error",{status:r.status});r.text().then(function(a){e(null,{status:r.status,data:a})}).catch(e)}).catch(e)},st=!1,Sn=function(t,n,e,r){t.queryStringParams&&(n=Ee(n,t.queryStringParams));var a=Pe({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);e&&(a["Content-Type"]="application/json");var o=typeof t.requestOptions=="function"?t.requestOptions(e):t.requestOptions,s=Pe({method:e?"POST":"GET",body:e?t.stringify(e):void 0,headers:a},st?{}:o);try{ot(n,s,r)}catch(u){if(!o||Object.keys(o).length===0||!u.message||u.message.indexOf("not implemented")<0)return r(u);try{Object.keys(o).forEach(function(f){delete s[f]}),ot(n,s,r),st=!0}catch(f){r(f)}}},On=function(t,n,e,r){e&&ge(e)==="object"&&(e=Ee("",e).slice(1)),t.queryStringParams&&(n=Ee(n,t.queryStringParams));try{var a;re?a=new re:a=new he("MSXML2.XMLHTTP.3.0"),a.open(e?"POST":"GET",n,1),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!t.withCredentials,e&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var o=t.customHeaders;if(o=typeof o=="function"?o():o,o)for(var s in o)a.setRequestHeader(s,o[s]);a.onreadystatechange=function(){a.readyState>3&&r(a.status>=400?a.statusText:null,{status:a.status,data:a.responseText})},a.send(e)}catch(u){console&&console.log(u)}},xn=function(t,n,e,r){if(typeof e=="function"&&(r=e,e=void 0),r=r||function(){},z)return Sn(t,n,e,r);if(nt()||typeof ActiveXObject=="function")return On(t,n,e,r);r(new Error("No fetch and no xhr implementation found!"))};function kn(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ut(i,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}function Ln(i,t,n){return t&&ut(i.prototype,t),n&&ut(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}function Pn(i,t,n){return t in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var En=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,e,r){return Pn({},e,r||"")},request:xn,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},ft=function(){function i(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};kn(this,i),this.services=t,this.options=n,this.allOptions=e,this.type="backend",this.init(t,n,e)}return Ln(i,[{key:"init",value:function(n){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Pe(r,this.options||{},En()),this.allOptions=a,this.services&&this.options.reloadInterval&&setInterval(function(){return e.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,e,r){this._readAny(n,n,e,e,r)}},{key:"read",value:function(n,e,r){this._readAny([n],n,[e],e,r)}},{key:"_readAny",value:function(n,e,r,a,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(n,r)),u=yn(u),u.then(function(f){if(!f)return o(null,{});var c=s.services.interpolator.interpolate(f,{lng:n.join("+"),ns:r.join("+")});s.loadUrl(c,o,e,a)})}},{key:"loadUrl",value:function(n,e,r,a){var o=this;this.options.request(this.options,n,void 0,function(s,u){if(u&&(u.status>=500&&u.status<600||!u.status))return e("failed loading "+n+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return e("failed loading "+n+"; status code: "+u.status,!1);if(!u&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return e("failed loading "+n+": "+s.message,!0);if(s)return e(s,!1);var f,c;try{typeof u.data=="string"?f=o.options.parse(u.data,r,a):f=u.data}catch{c="failed parsing "+n+" to json"}if(c)return e(c,!1);e(null,f)})}},{key:"create",value:function(n,e,r,a,o){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var u=this.options.parsePayload(e,r,a),f=0,c=[],p=[];n.forEach(function(v){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(v,e));var d=s.services.interpolator.interpolate(m,{lng:v,ns:e});s.options.request(s.options,d,u,function(y,h){f+=1,c.push(y),p.push(h),f===n.length&&o&&o(c,p)})})}}},{key:"reload",value:function(){var n=this,e=this.services,r=e.backendConnector,a=e.languageUtils,o=e.logger,s=r.language;if(!(s&&s.toLowerCase()==="cimode")){var u=[],f=function(p){var v=a.toResolveHierarchy(p);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})};f(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return f(c)}),u.forEach(function(c){n.allOptions.ns.forEach(function(p){r.read(c,p,"read",null,null,function(v,m){v&&o.warn("loading namespace ".concat(p," for language ").concat(c," failed"),v),!v&&m&&o.log("loaded namespace ".concat(p," for language ").concat(c),m),r.loaded("".concat(c,"|").concat(p),v,m)})})})}}}]),i}();ft.type="backend";var lt=[],jn=lt.forEach,Rn=lt.slice;function Cn(i){return jn.call(Rn.call(arguments,1),function(t){if(t)for(var n in t)i[n]===void 0&&(i[n]=t[n])}),i}var ct=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nn=function(t,n,e){var r=e||{};r.path=r.path||"/";var a=encodeURIComponent(n),o=t+"="+a;if(r.maxAge>0){var s=r.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(r.domain){if(!ct.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!ct.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},pt={create:function(t,n,e,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};e&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+e*60*1e3)),r&&(a.domain=r),document.cookie=Nn(t,encodeURIComponent(n),a)},read:function(t){for(var n=t+"=",e=document.cookie.split(";"),r=0;r<e.length;r++){for(var a=e[r];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(n)===0)return a.substring(n.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},Tn={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var e=pt.read(t.lookupCookie);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&pt.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},An={name:"querystring",lookup:function(t){var n;if(typeof window<"u")for(var e=window.location.search.substring(1),r=e.split("&"),a=0;a<r.length;a++){var o=r[a].indexOf("=");if(o>0){var s=r[a].substring(0,o);s===t.lookupQuerystring&&(n=r[a].substring(o+1))}}return n}},ve;try{ve=window!=="undefined"&&window.localStorage!==null;var dt="i18next.translate.boo";window.localStorage.setItem(dt,"foo"),window.localStorage.removeItem(dt)}catch{ve=!1}var Fn={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&ve){var e=window.localStorage.getItem(t.lookupLocalStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&ve&&window.localStorage.setItem(n.lookupLocalStorage,t)}},me;try{me=window!=="undefined"&&window.sessionStorage!==null;var gt="i18next.translate.boo";window.sessionStorage.setItem(gt,"foo"),window.sessionStorage.removeItem(gt)}catch{me=!1}var _n={name:"sessionStorage",lookup:function(t){var n;if(t.lookupsessionStorage&&me){var e=window.sessionStorage.getItem(t.lookupsessionStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupsessionStorage&&me&&window.sessionStorage.setItem(n.lookupsessionStorage,t)}},Dn={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var e=0;e<navigator.languages.length;e++)n.push(navigator.languages[e]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},In={name:"htmlTag",lookup:function(t){var n,e=t.htmlTag||(typeof document<"u"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(n=e.getAttribute("lang")),n}},Un={name:"path",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(e instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof e[t.lookupFromPathIndex]!="string")return;n=e[t.lookupFromPathIndex].replace("/","")}else n=e[0].replace("/","")}return n}},Bn={name:"subdomain",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);e instanceof Array&&(typeof t.lookupFromSubdomainIndex=="number"?n=e[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n=e[0].replace("http://","").replace("https://","").replace(".",""))}return n}};function Hn(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ht=function(){function i(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,i),this.type="languageDetector",this.detectors={},this.init(t,n)}return H(i,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Cn(e,this.options||{},Hn()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Tn),this.addDetector(An),this.addDetector(Fn),this.addDetector(_n),this.addDetector(Dn),this.addDetector(In),this.addDetector(Un),this.addDetector(Bn)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var e=this;n||(n=this.options.order);var r=[];return n.forEach(function(a){if(e.detectors[a]){var o=e.detectors[a].lookup(e.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(n,e){var r=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||e.forEach(function(a){r.detectors[a]&&r.detectors[a].cacheUserLanguage(n,r.options)}))}}]),i}();ht.type="languageDetector";function Mn({detectorConfig:i,translationPath:t,customDetectors:n,...e}){const r=new ht,a={name:"hashRouterQuerystringDetector",lookup:f=>{try{const c=f&&f.lookupQuerystring||"lang",v=new RegExp(`[?&]${c}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(v&&v[2]){const m=decodeURIComponent(v[2].replace(/\+/g," "));if(m)return m}}catch(c){console.error(c)}}};r.addDetector(a),Array.isArray(n)&&n.forEach(f=>{r.addDetector(f)});const u={fallbackLng:"en-US",debug:!0,keySeparator:".",backend:{loadPath:t||"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},detection:i||{order:["querystring","hashRouterQuerystringDetector","cookie","localStorage"],lookupQuerystring:"lang",lookupCookie:"lang",lookupSessionStorage:"lang",lookupLocalStorage:"lang",caches:["localStorage","cookie"],excludeCacheFor:["cimode"],cookieOptions:{path:"/",sameSite:"strict"}},...e};return It.use(ft).use(r).use(Yt).init(u)}const qn=sn;function Vn(i="translation",t){return gn([i,"design-system"],t)}V.SpsLanguage=qn,V.localize=Mn,V.useSpsLanguage=Vn,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@spscommerce/i18n",
3
3
  "description": "SPS Design System React components",
4
- "version": "7.17.13",
4
+ "version": "7.19.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/i18n",
8
8
  "homepage": "https://github.com/spscommerce/woodland/tree/master/packages/@spscommerce/i18n#readme",
9
- "module": "./lib/index.es.js",
10
9
  "type": "module",
11
- "main": "./lib/index.cjs.js",
10
+ "module": "./lib/index.js",
11
+ "main": "./lib/index.umd.cjs",
12
12
  "types": "./lib/index.d.ts",
13
13
  "exports": {
14
- "import": "./lib/index.es.js",
15
- "require": "./lib/index.cjs.js",
16
- "default": "./lib/index.cjs.js",
14
+ "require": "./lib/index.umd.cjs",
15
+ "import": "./lib/index.js",
16
+ "default": "./lib/index.js",
17
17
  "types": "./lib/index.d.ts"
18
18
  },
19
19
  "bin": {
Binary file
package/vite.config.js CHANGED
@@ -8,8 +8,8 @@ export default defineConfig({
8
8
  build: {
9
9
  lib: {
10
10
  entry: path.resolve(__dirname, "src/index.ts"),
11
- formats: ["es", "cjs"],
12
- fileName: (format) => `index.${format}.js`,
11
+ name: "I18n",
12
+ fileName: "index",
13
13
  },
14
14
  outDir: path.resolve(__dirname, "./lib"),
15
15
  emptyOutDir: false,
package/lib/index.cjs.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("react");function mt(a,t){for(var n=0;n<t.length;n++){const e=t[n];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in a)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(a,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function I(a){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(a)}function yt(a,t){if(I(a)!="object"||!a)return a;var n=a[Symbol.toPrimitive];if(n!==void 0){var e=n.call(a,t||"default");if(I(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(a)}function tt(a){var t=yt(a,"string");return I(t)=="symbol"?t:String(t)}function ge(a,t,n){return t=tt(t),t in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,a}function D(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},e=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&e.push.apply(e,Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.forEach(function(r){ge(a,r,n[r])})}return a}function M(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Ne(a,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,tt(e.key),e)}}function q(a,t,n){return t&&Ne(a.prototype,t),n&&Ne(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a}function X(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function te(a,t){if(t&&(I(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(a)}function Y(a){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Y(a)}function xe(a,t){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},xe(a,t)}function he(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),t&&xe(a,t)}var bt={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},wt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.init(t,n)}return q(a,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=n||bt,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,e,r,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(r).concat(this.prefix," ").concat(n[0])),this.logger[e](n))}},{key:"create",value:function(n){return new a(this.logger,D({},{prefix:"".concat(this.prefix,":").concat(n,":")},this.options))}}]),a}(),$=new wt,W=function(){function a(){M(this,a),this.observers={}}return q(a,[{key:"on",value:function(n,e){var r=this;return n.split(" ").forEach(function(i){r.observers[i]=r.observers[i]||[],r.observers[i].push(e)}),this}},{key:"off",value:function(n,e){if(!!this.observers[n]){if(!e){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(r){return r!==e})}}},{key:"emit",value:function(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];if(this.observers[n]){var o=[].concat(this.observers[n]);o.forEach(function(u){u.apply(void 0,r)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[n].concat(r))})}}}]),a}();function Z(){var a,t,n=new Promise(function(e,r){a=e,t=r});return n.resolve=a,n.reject=t,n}function Ae(a){return a==null?"":""+a}function St(a,t,n){a.forEach(function(e){t[e]&&(n[e]=t[e])})}function je(a,t,n){function e(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function r(){return!a||typeof a=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(r())return{};var o=e(i.shift());!a[o]&&n&&(a[o]=new n),Object.prototype.hasOwnProperty.call(a,o)?a=a[o]:a={}}return r()?{}:{obj:a,k:e(i.shift())}}function Te(a,t,n){var e=je(a,t,Object),r=e.obj,i=e.k;r[i]=n}function Ot(a,t,n,e){var r=je(a,t,Object),i=r.obj,o=r.k;i[o]=i[o]||[],e&&(i[o]=i[o].concat(n)),e||i[o].push(n)}function se(a,t){var n=je(a,t),e=n.obj,r=n.k;if(!!e)return e[r]}function Fe(a,t,n){var e=se(a,n);return e!==void 0?e:se(t,n)}function nt(a,t,n){for(var e in t)e!=="__proto__"&&e!=="constructor"&&(e in a?typeof a[e]=="string"||a[e]instanceof String||typeof t[e]=="string"||t[e]instanceof String?n&&(a[e]=t[e]):nt(a[e],t[e],n):a[e]=t[e]);return a}function G(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function kt(a){return typeof a=="string"?a.replace(/[&<>"'\/]/g,function(t){return xt[t]}):a}var ve=typeof window<"u"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Lt=function(a){he(t,a);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return M(this,t),e=te(this,Y(t).call(this)),ve&&W.call(X(e)),e.data=n||{},e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e}return q(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=[e,r];return i&&typeof i!="string"&&(u=u.concat(i)),i&&typeof i=="string"&&(u=u.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(u=e.split(".")),se(this.data,u)}},{key:"addResource",value:function(e,r,i,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var f=[e,r];i&&(f=f.concat(u?i.split(u):i)),e.indexOf(".")>-1&&(f=e.split("."),o=r,r=f[1]),this.addNamespaces(r),Te(this.data,f,o),s.silent||this.emit("added",e,r,i,o)}},{key:"addResources",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var s in i)(typeof i[s]=="string"||Object.prototype.toString.apply(i[s])==="[object Array]")&&this.addResource(e,r,s,i[s],{silent:!0});o.silent||this.emit("added",e,r,i)}},{key:"addResourceBundle",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[e,r];e.indexOf(".")>-1&&(f=e.split("."),o=i,i=r,r=f[1]),this.addNamespaces(r);var c=se(this.data,f)||{};o?nt(c,i,s):c=D({},c,i),Te(this.data,f,c),u.silent||this.emit("added",e,r,i)}},{key:"removeResourceBundle",value:function(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}},{key:"hasResourceBundle",value:function(e,r){return this.getResource(e,r)!==void 0}},{key:"getResourceBundle",value:function(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?D({},{},this.getResource(e,r)):this.getResource(e,r)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(W),rt={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,e,r,i){var o=this;return t.forEach(function(s){o.processors[s]&&(n=o.processors[s].process(n,e,r,i))}),n}},_e={},De=function(a){he(t,a);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M(this,t),e=te(this,Y(t).call(this)),ve&&W.call(X(e)),St(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,X(e)),e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=$.create("translator"),e}return q(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=this.resolve(e,r);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(e,r){var i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS;if(i&&e.indexOf(i)>-1){var u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:s};var f=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),e=f.join(o)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}},{key:"translate",value:function(e,r,i){var o=this;if(I(r)!=="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);var s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],r),f=u.key,c=u.namespaces,p=c[c.length-1],v=r.lng||this.language,m=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var d=r.nsSeparator||this.options.nsSeparator;return p+d+f}return f}var y=this.resolve(e,r),h=y&&y.res,b=y&&y.usedKey||f,S=y&&y.exactUsedKey||f,O=Object.prototype.toString.apply(h),A=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,j=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(w&&h&&j&&A.indexOf(O)<0&&!(typeof k=="string"&&O==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,h,r):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(s){var R=O==="[object Array]",C=R?[]:{},P=R?S:b;for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)){var K="".concat(P).concat(s).concat(E);C[E]=this.translate(K,D({},r,{joinArrays:!1,ns:c})),C[E]===K&&(C[E]=h[E])}h=C}}else if(w&&typeof k=="string"&&O==="[object Array]")h=h.join(k),h&&(h=this.extendTranslation(h,e,r,i));else{var B=!1,l=!1,g=r.count!==void 0&&typeof r.count!="string",x=t.hasDefaultValue(r),F=g?this.pluralResolver.getSuffix(v,r.count):"",N=r["defaultValue".concat(F)]||r.defaultValue;!this.isValidLookup(h)&&x&&(B=!0,h=N),this.isValidLookup(h)||(l=!0,h=f);var L=x&&N!==h&&this.options.updateMissing;if(l||B||L){if(this.logger.log(L?"updateKey":"missingKey",v,p,f,L?N:h),s){var V=this.resolve(f,D({},r,{keySeparator:!1}));V&&V.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.")}var U=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(var J=0;J<H.length;J++)U.push(H[J]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(r.lng||this.language):U.push(r.lng||this.language);var Re=function(Q,ye,Ce){o.options.missingKeyHandler?o.options.missingKeyHandler(Q,p,ye,L?Ce:h,L,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(Q,p,ye,L?Ce:h,L,r),o.emit("missingKey",Q,p,ye,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?U.forEach(function(me){o.pluralResolver.getSuffixes(me).forEach(function(Q){Re([me],f+Q,r["defaultValue".concat(Q)]||N)})}):Re(U,f,N))}h=this.extendTranslation(h,e,r,y,i),l&&h===f&&this.options.appendNamespaceToMissingKey&&(h="".concat(p,":").concat(f)),l&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,r,i,o,s){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,i,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(D({},i,{interpolation:D({},this.options.interpolation,i.interpolation)}));var f=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,c;if(f){var p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}var v=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(v=D({},this.options.interpolation.defaultVariables,v)),e=this.interpolator.interpolate(e,v,i.lng||this.language,i),f){var m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;c<d&&(i.nest=!1)}i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var b=arguments.length,S=new Array(b),O=0;O<b;O++)S[O]=arguments[O];return s&&s[0]===S[0]&&!i.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(r[0])),null):u.translate.apply(u,S.concat([r]))},i)),i.interpolation&&this.interpolator.reset()}var y=i.postProcess||this.options.postProcess,h=typeof y=="string"?[y]:y;return e!=null&&h&&h.length&&i.applyPostProcessor!==!1&&(e=rt.handle(h,e,r,this.options&&this.options.postProcessPassResolved?D({i18nResolved:o},i):i,this)),e}},{key:"resolve",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,s,u,f,c;return typeof e=="string"&&(e=[e]),e.forEach(function(p){if(!r.isValidLookup(o)){var v=r.extractFromKey(p,i),m=v.key;s=m;var d=v.namespaces;r.options.fallbackNS&&(d=d.concat(r.options.fallbackNS));var y=i.count!==void 0&&typeof i.count!="string",h=i.context!==void 0&&typeof i.context=="string"&&i.context!=="",b=i.lngs?i.lngs:r.languageUtils.toResolveHierarchy(i.lng||r.language,i.fallbackLng);d.forEach(function(S){r.isValidLookup(o)||(c=S,!_e["".concat(b[0],"-").concat(S)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(c)&&(_e["".concat(b[0],"-").concat(S)]=!0,r.logger.warn('key "'.concat(s,'" for languages "').concat(b.join(", "),`" won't get resolved as namespace "`).concat(c,'" 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!!!")),b.forEach(function(O){if(!r.isValidLookup(o)){f=O;var A=m,k=[A];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(k,m,O,S,i);else{var w;y&&(w=r.pluralResolver.getSuffix(O,i.count)),y&&h&&k.push(A+w),h&&k.push(A+="".concat(r.options.contextSeparator).concat(i.context)),y&&k.push(A+=w)}for(var j;j=k.pop();)r.isValidLookup(o)||(u=j,o=r.getResource(O,S,j,i))}}))})}}),{res:o,usedKey:s,exactUsedKey:u,usedLng:f,usedNS:c}}},{key:"isValidLookup",value:function(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,i,o):this.resourceStore.getResource(e,r,i,o)}}],[{key:"hasDefaultValue",value:function(e){var r="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&r===i.substring(0,r.length)&&e[i]!==void 0)return!0;return!1}}]),t}(W);function be(a){return a.charAt(0).toUpperCase()+a.slice(1)}var Pt=function(){function a(t){M(this,a),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}return q(a,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var e=n.split("-");return e.length===2||(e.pop(),e[e.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(e.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var e=n.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],r=n.split("-");return this.options.lowerCaseLng?r=r.map(function(i){return i.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=be(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=be(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=be(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isWhitelisted",value:function(n){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(n)}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var e=this;if(!n)return null;var r;return n.forEach(function(i){if(!r){var o=e.formatLanguageCode(i);(!e.options.supportedLngs||e.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&n.forEach(function(i){if(!r){var o=e.getLanguagePartFromCode(i);if(e.isSupportedCode(o))return r=o;r=e.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(n,e){if(!n)return[];if(typeof n=="function"&&(n=n(e)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!e)return n.default||[];var r=n[e];return r||(r=n[this.getScriptPartFromCode(e)]),r||(r=n[this.formatLanguageCode(e)]),r||(r=n[this.getLanguagePartFromCode(e)]),r||(r=n.default),r||[]}},{key:"toResolveHierarchy",value:function(n,e){var r=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],n),o=[],s=function(f){!f||(r.isSupportedCode(f)?o.push(f):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(f)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),i.forEach(function(u){o.indexOf(u)<0&&s(r.formatLanguageCode(u))}),o}}]),a}(),Et=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],jt={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};function Rt(){var a={};return Et.forEach(function(t){t.lngs.forEach(function(n){a[n]={numbers:t.nr,plurals:jt[t.fc]}})}),a}var Ct=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.languageUtils=t,this.options=n,this.logger=$.create("pluralResolver"),this.rules=Rt()}return q(a,[{key:"addRule",value:function(n,e){this.rules[n]=e}},{key:"getRule",value:function(n){return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var e=this.getRule(n);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,e){return this.getSuffixes(n).map(function(r){return e+r})}},{key:"getSuffixes",value:function(n){var e=this,r=this.getRule(n);return r?r.numbers.map(function(i){return e.getSuffix(n,i)}):[]}},{key:"getSuffix",value:function(n,e){var r=this,i=this.getRule(n);if(i){var o=i.noAbs?i.plurals(e):i.plurals(Math.abs(e)),s=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var u=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?u():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(n)),""}}]),a}(),Nt=function(){function a(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,a),this.logger=$.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return q(a,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var e=n.interpolation;this.escape=e.escape!==void 0?e.escape:kt,this.escapeValue=e.escapeValue!==void 0?e.escapeValue:!0,this.useRawValueToEscape=e.useRawValueToEscape!==void 0?e.useRawValueToEscape:!1,this.prefix=e.prefix?G(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?G(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?G(e.nestingPrefix):e.nestingPrefixEscaped||G("$t("),this.nestingSuffix=e.nestingSuffix?G(e.nestingSuffix):e.nestingSuffixEscaped||G(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=e.alwaysFormat!==void 0?e.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(n,e,r,i){var o=this,s,u,f,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(h){return h.replace(/\$/g,"$$$$")}var v=function(b){if(b.indexOf(o.formatSeparator)<0){var S=Fe(e,c,b);return o.alwaysFormat?o.format(S,void 0,r):S}var O=b.split(o.formatSeparator),A=O.shift().trim(),k=O.join(o.formatSeparator).trim();return o.format(Fe(e,c,A),k,r,i)};this.resetRegExp();var m=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(b){return p(b)}},{regex:this.regexp,safeValue:function(b){return o.escapeValue?p(o.escape(b)):p(b)}}];return y.forEach(function(h){for(f=0;s=h.regex.exec(n);){if(u=v(s[1].trim()),u===void 0)if(typeof m=="function"){var b=m(n,s,i);u=typeof b=="string"?b:""}else if(d){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(n)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Ae(u));if(n=n.replace(s[0],h.safeValue(u)),h.regex.lastIndex=0,f++,f>=o.maxReplaces)break}}),n}},{key:"nest",value:function(n,e){var r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=D({},i);u.applyPostProcessor=!1,delete u.defaultValue;function f(m,d){var y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;var h=m.split(new RegExp("".concat(y,"[ ]*{"))),b="{".concat(h[1]);m=h[0],b=this.interpolate(b,u),b=b.replace(/'/g,'"');try{u=JSON.parse(b),d&&(u=D({},d,u))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),S),"".concat(m).concat(y).concat(b)}return delete u.defaultValue,m}for(;o=this.nestingRegexp.exec(n);){var c=[],p=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o[1])){var v=o[1].split(this.formatSeparator).map(function(m){return m.trim()});o[1]=v.shift(),c=v,p=!0}if(s=e(f.call(this,o[1].trim(),u),u),s&&o[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=Ae(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(n)),s=""),p&&(s=c.reduce(function(m,d){return r.format(m,d,i.lng,i)},s.trim())),n=n.replace(o[0],s),this.regexp.lastIndex=0}return n}}]),a}();function At(a,t){for(var n=a.indexOf(t);n!==-1;)a.splice(n,1),n=a.indexOf(t)}var Tt=function(a){he(t,a);function t(n,e,r){var i,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return M(this,t),i=te(this,Y(t).call(this)),ve&&W.call(X(i)),i.backend=n,i.store=e,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=$.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return q(t,[{key:"queueLoad",value:function(e,r,i,o){var s=this,u=[],f=[],c=[],p=[];return e.forEach(function(v){var m=!0;r.forEach(function(d){var y="".concat(v,"|").concat(d);!i.reload&&s.store.hasResourceBundle(v,d)?s.state[y]=2:s.state[y]<0||(s.state[y]===1?f.indexOf(y)<0&&f.push(y):(s.state[y]=1,m=!1,f.indexOf(y)<0&&f.push(y),u.indexOf(y)<0&&u.push(y),p.indexOf(d)<0&&p.push(d)))}),m||c.push(v)}),(u.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:o}),{toLoad:u,pending:f,toLoadLanguages:c,toLoadNamespaces:p}}},{key:"loaded",value:function(e,r,i){var o=e.split("|"),s=o[0],u=o[1];r&&this.emit("failedLoading",s,u,r),i&&this.store.addResourceBundle(s,u,i),this.state[e]=r?-1:2;var f={};this.queue.forEach(function(c){Ot(c.loaded,[s],u),At(c.pending,e),r&&c.errors.push(r),c.pending.length===0&&!c.done&&(Object.keys(c.loaded).forEach(function(p){f[p]||(f[p]=[]),c.loaded[p].length&&c.loaded[p].forEach(function(v){f[p].indexOf(v)<0&&f[p].push(v)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(e,r,i){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[i](e,r,function(c,p){if(c&&p&&s<5){setTimeout(function(){o.read.call(o,e,r,i,s+1,u*2,f)},u);return}f(c,p)}):f(null,{})}},{key:"prepareLoading",value:function(e,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);var u=this.queueLoad(e,r,o,s);if(!u.toLoad.length)return u.pending.length||s(),null;u.toLoad.forEach(function(f){i.loadOne(f)})}},{key:"load",value:function(e,r,i){this.prepareLoading(e,r,{},i)}},{key:"reload",value:function(e,r,i){this.prepareLoading(e,r,{reload:!0},i)}},{key:"loadOne",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=e.split("|"),s=o[0],u=o[1];this.read(s,u,"read",void 0,void 0,function(f,c){f&&r.logger.warn("".concat(i,"loading namespace ").concat(u," for language ").concat(s," failed"),f),!f&&c&&r.logger.log("".concat(i,"loaded namespace ").concat(u," for language ").concat(s),c),r.loaded(e,f,c)})}},{key:"saveMissing",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(r,'" 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}i==null||i===""||(this.backend&&this.backend.create&&this.backend.create(e,r,i,o,null,D({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],r,i,o))}}]),t}(W);function Ft(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(I(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),I(t[2])==="object"||I(t[3])==="object"){var e=t[3]||t[2];Object.keys(e).forEach(function(r){n[r]=e[r]})}return n},interpolation:{escapeValue:!0,format:function(t,n,e,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Ie(a){return typeof a.ns=="string"&&(a.ns=[a.ns]),typeof a.fallbackLng=="string"&&(a.fallbackLng=[a.fallbackLng]),typeof a.fallbackNS=="string"&&(a.fallbackNS=[a.fallbackNS]),a.whitelist&&(a.whitelist&&a.whitelist.indexOf("cimode")<0&&(a.whitelist=a.whitelist.concat(["cimode"])),a.supportedLngs=a.whitelist),a.nonExplicitWhitelist&&(a.nonExplicitSupportedLngs=a.nonExplicitWhitelist),a.supportedLngs&&a.supportedLngs.indexOf("cimode")<0&&(a.supportedLngs=a.supportedLngs.concat(["cimode"])),a}function re(){}var _t=function(a){he(t,a);function t(){var n,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(M(this,t),n=te(this,Y(t).call(this)),ve&&W.call(X(n)),n.options=Ie(e),n.services={},n.logger=$,n.modules={external:[]},r&&!n.isInitialized&&!e.isClone){if(!n.options.initImmediate)return n.init(e,r),te(n,X(n));setTimeout(function(){n.init(e,r)},0)}return n}return q(t,[{key:"init",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(i=r,r={}),r.whitelist&&!r.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),r.nonExplicitWhitelist&&!r.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=D({},Ft(),this.options,Ie(r)),this.format=this.options.interpolation.format,i||(i=re);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?$.init(o(this.modules.logger),this.options):$.init(null,this.options);var s=new Pt(this.options);this.store=new Lt(this.options.resources,this.options);var u=this.services;u.logger=$,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Ct(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new Nt(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Tt(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new De(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.external.forEach(function(d){d.init&&d.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments),e}});var v=Z(),m=function(){var y=function(b,S){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),v.resolve(S),i(b,S)};if(e.languages&&e.options.compatibilityAPI!=="v1"&&!e.isInitialized)return y(null,e.t.bind(e));e.changeLanguage(e.options.lng,y)};return this.options.resources||!this.options.initImmediate?m():setTimeout(m,0),v}},{key:"loadResources",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:re,o=i,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode")return o();var u=[],f=function(v){if(!!v){var m=r.services.languageUtils.toResolveHierarchy(v);m.forEach(function(d){u.indexOf(d)<0&&u.push(d)})}};if(s)f(s);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(p){return f(p)})}this.options.preload&&this.options.preload.forEach(function(p){return f(p)}),this.services.backendConnector.load(u,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,r,i){var o=Z();return e||(e=this.languages),r||(r=this.options.ns),i||(i=re),this.services.backendConnector.reload(e,r,function(s){o.resolve(),i(s)}),o}},{key:"use",value:function(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"&&rt.addPostProcessor(e),e.type==="3rdParty"&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,r){var i=this;this.isLanguageChangingTo=e;var o=Z();this.emit("languageChanging",e);var s=function(c,p){p?(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p),i.translator.changeLanguage(p),i.isLanguageChangingTo=void 0,i.emit("languageChanged",p),i.logger.log("languageChanged",p)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),r&&r(c,function(){return i.t.apply(i,arguments)})},u=function(c){var p=typeof c=="string"?c:i.services.languageUtils.getBestMatchFromCodes(c);p&&(i.language||(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p)),i.translator.language||i.translator.changeLanguage(p),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(p)),i.loadResources(p,function(v){s(v,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(e),o}},{key:"getFixedT",value:function(e,r){var i=this,o=function s(u,f){var c;if(I(f)!=="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),m=2;m<p;m++)v[m-2]=arguments[m];c=i.options.overloadTranslationOptionHandler([u,f].concat(v))}else c=D({},f);return c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,i.t(u,c)};return typeof e=="string"?o.lng=e:o.lngs=e,o.ns=r,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;var o=this.languages[0],s=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var f=function(v,m){var d=r.services.backendConnector.state["".concat(v,"|").concat(m)];return d===-1||d===2};if(i.precheck){var c=i.precheck(this,f);if(c!==void 0)return c}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||f(o,e)&&(!s||f(u,e)))}},{key:"loadNamespaces",value:function(e,r){var i=this,o=Z();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(function(s){i.options.ns.indexOf(s)<0&&i.options.ns.push(s)}),this.loadResources(function(s){o.resolve(),r&&r(s)}),o):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function(e,r){var i=Z();typeof e=="string"&&(e=[e]);var o=this.options.preload||[],s=e.filter(function(u){return o.indexOf(u)<0});return s.length?(this.options.preload=o.concat(s),this.loadResources(function(u){i.resolve(),r&&r(u)}),i):(r&&r(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";var r=["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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:re,o=D({},this.options,r,{isClone:!0}),s=new t(o),u=["store","services","language"];return u.forEach(function(f){s[f]=e[f]}),s.services=D({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new De(s.services,s.options),s.translator.on("*",function(f){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];s.emit.apply(s,[f].concat(p))}),s.init(o,i),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(W),Dt=new _t;function It(a,t){if(a==null)return{};var n={},e=Object.keys(a),r,i;for(i=0;i<e.length;i++)r=e[i],!(t.indexOf(r)>=0)&&(n[r]=a[r]);return n}function at(a,t){if(a==null)return{};var n=It(a,t),e,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);for(r=0;r<i.length;r++)e=i[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,e)||(n[e]=a[e]))}return n}var ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ut={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},Bt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ue(a){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=a.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(Ut[n[1]]||a.charAt(a.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var e=a.indexOf("-->");return{type:"comment",comment:e!==-1?a.slice(4,e):""}}for(var r=new RegExp(Bt),i=null;(i=r.exec(a))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),t.attrs[s[0]]=s[1],r.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var Ht=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Mt=/^\s*$/,qt=Object.create(null);function it(a,t){switch(t.type){case"text":return a+t.content;case"tag":return a+="<"+t.name+(t.attrs?function(n){var e=[];for(var r in n)e.push(r+'="'+n[r]+'"');return e.length?" "+e.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?a:a+t.children.reduce(it,"")+"</"+t.name+">";case"comment":return a+"<!--"+t.comment+"-->"}}var Vt={parse:function(a,t){t||(t={}),t.components||(t.components=qt);var n,e=[],r=[],i=-1,o=!1;if(a.indexOf("<")!==0){var s=a.indexOf("<");e.push({type:"text",content:s===-1?a:a.substring(0,s)})}return a.replace(Ht,function(u,f){if(o){if(u!=="</"+n.name+">")return;o=!1}var c,p=u.charAt(1)!=="/",v=u.startsWith("<!--"),m=f+u.length,d=a.charAt(m);if(v){var y=Ue(u);return i<0?(e.push(y),e):((c=r[i]).children.push(y),e)}if(p&&(i++,(n=Ue(u)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:a.slice(m,a.indexOf("<",m))}),i===0&&e.push(n),(c=r[i-1])&&c.children.push(n),r[i]=n),(!p||n.voidElement)&&(i>-1&&(n.voidElement||n.name===u.slice(2,-1))&&(i--,n=i===-1?e:r[i]),!o&&d!=="<"&&d)){c=i===-1?e:r[i].children;var h=a.indexOf("<",m),b=a.slice(m,h===-1?void 0:h);Mt.test(b)&&(b=" "),(h>-1&&i+c.length>=0||b!==" ")&&c.push({type:"text",content:b})}}),e},stringify:function(a){return a.reduce(function(t,n){return t+it("",n)},"")}},$t=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zt={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Kt=function(t){return zt[t]},Wt=function(t){return t.replace($t,Kt)};function Be(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function He(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Be(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}var ke={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Wt},ot,st=T.createContext();function Xt(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke=He(He({},ke),a)}function ut(){return ke}var Jt=function(){function a(){M(this,a),this.usedNamespaces={}}return q(a,[{key:"addUsedNamespaces",value:function(n){var e=this;n.forEach(function(r){e.usedNamespaces[r]||(e.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),a}();function Qt(a){ot=a}function ft(){return ot}var Gt={type:"3rdParty",init:function(t){Xt(t.options.react),Qt(t)}};function oe(){if(console&&console.warn){for(var a,t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(a=console).warn.apply(a,n)}}var Me={};function ue(){for(var a=arguments.length,t=new Array(a),n=0;n<a;n++)t[n]=arguments[n];typeof t[0]=="string"&&Me[t[0]]||(typeof t[0]=="string"&&(Me[t[0]]=new Date),oe.apply(void 0,t))}function qe(a,t,n){a.loadNamespaces(t,function(){if(a.isInitialized)n();else{var e=function r(){setTimeout(function(){a.off("initialized",r)},0),n()};a.on("initialized",e)}})}function Yt(a,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},e=t.languages[0],r=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(e.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,a)?!1:!!(t.hasResourceBundle(e,a)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(e,a)&&(!r||o(i,a)))}function Zt(a,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return ue("i18n.languages were undefined or empty",t.languages),!0;var e=t.options.ignoreJSONStructure!==void 0;return e?t.hasLoadedNamespace(a,{precheck:function(i,o){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,a))return!1}}):Yt(a,t,n)}var en=["format"],tn=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function Ve(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function _(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ve(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}function we(a,t){if(!a)return!1;var n=a.props?a.props.children:a.children;return t?n.length>0:!!n}function Se(a){return a?a.props?a.props.children:a.children:[]}function nn(a){return Object.prototype.toString.call(a)!=="[object Array]"?!1:a.every(function(t){return T.isValidElement(t)})}function ee(a){return Array.isArray(a)?a:[a]}function rn(a,t){var n=_({},t);return n.props=Object.assign(a.props,t.props),n}function lt(a,t){if(!a)return"";var n="",e=ee(a),r=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return e.forEach(function(i,o){if(typeof i=="string")n+="".concat(i);else if(T.isValidElement(i)){var s=Object.keys(i.props).length,u=r.indexOf(i.type)>-1,f=i.props.children;if(!f&&u&&s===0)n+="<".concat(i.type,"/>");else if(!f&&(!u||s!==0))n+="<".concat(o,"></").concat(o,">");else if(i.props.i18nIsDynamicList)n+="<".concat(o,"></").concat(o,">");else if(u&&s===1&&typeof f=="string")n+="<".concat(i.type,">").concat(f,"</").concat(i.type,">");else{var c=lt(f,t);n+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(i===null)oe("Trans: the passed in value is invalid - seems you passed in a null child.");else if(I(i)==="object"){var p=i.format,v=at(i,en),m=Object.keys(v);if(m.length===1){var d=p?"".concat(m[0],", ").concat(p):m[0];n+="{{".concat(d,"}}")}else oe("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else oe("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n}function an(a,t,n,e,r,i){if(t==="")return[];var o=e.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.join("|")).test(t);if(!a&&!s)return[t];var u={};function f(h){var b=ee(h);b.forEach(function(S){typeof S!="string"&&(we(S)?f(Se(S)):I(S)==="object"&&!T.isValidElement(S)&&Object.assign(u,S))})}f(a);var c=Vt.parse("<0>".concat(t,"</0>")),p=_(_({},u),r);function v(h,b,S){var O=Se(h),A=d(O,b.children,S);return nn(O)&&A.length===0?O:A}function m(h,b,S,O,A){h.dummy&&(h.children=b),S.push(T.cloneElement(h,_(_({},h.props),{},{key:O}),A?void 0:b))}function d(h,b,S){var O=ee(h),A=ee(b);return A.reduce(function(k,w,j){var R=w.children&&w.children[0]&&w.children[0].content&&n.services.interpolator.interpolate(w.children[0].content,p,n.language);if(w.type==="tag"){var C=O[parseInt(w.name,10)];!C&&S.length===1&&S[0][w.name]&&(C=S[0][w.name]),C||(C={});var P=Object.keys(w.attrs).length!==0?rn({props:w.attrs},C):C,E=T.isValidElement(P),K=E&&we(w,!0)&&!w.voidElement,B=s&&I(P)==="object"&&P.dummy&&!E,l=I(a)==="object"&&a!==null&&Object.hasOwnProperty.call(a,w.name);if(typeof P=="string"){var g=n.services.interpolator.interpolate(P,p,n.language);k.push(g)}else if(we(P)||K){var x=v(P,w,S);m(P,x,k,j)}else if(B){var F=d(O,w.children,S);k.push(T.cloneElement(P,_(_({},P.props),{},{key:j}),F))}else if(Number.isNaN(parseFloat(w.name)))if(l){var N=v(P,w,S);m(P,N,k,j,w.voidElement)}else if(e.transSupportBasicHtmlNodes&&o.indexOf(w.name)>-1)if(w.voidElement)k.push(T.createElement(w.name,{key:"".concat(w.name,"-").concat(j)}));else{var L=d(O,w.children,S);k.push(T.createElement(w.name,{key:"".concat(w.name,"-").concat(j)},L))}else if(w.voidElement)k.push("<".concat(w.name," />"));else{var V=d(O,w.children,S);k.push("<".concat(w.name,">").concat(V,"</").concat(w.name,">"))}else if(I(P)==="object"&&!E){var U=w.children[0]?R:null;U&&k.push(U)}else w.children.length===1&&R?k.push(T.cloneElement(P,_(_({},P.props),{},{key:j}),R)):k.push(T.cloneElement(P,_(_({},P.props),{},{key:j})))}else if(w.type==="text"){var H=e.transWrapTextNodes,J=i?e.unescape(n.services.interpolator.interpolate(w.content,p,n.language)):n.services.interpolator.interpolate(w.content,p,n.language);H?k.push(T.createElement(H,{key:"".concat(w.name,"-").concat(j)},J)):k.push(J)}return k},[])}var y=d([{dummy:!0,children:a||[]}],c,ee(a||[]));return Se(y[0])}function on(a){var t=a.children,n=a.count,e=a.parent,r=a.i18nKey,i=a.context,o=a.tOptions,s=o===void 0?{}:o,u=a.values,f=a.defaults,c=a.components,p=a.ns,v=a.i18n,m=a.t,d=a.shouldUnescape,y=at(a,tn),h=T.useContext(st)||{},b=h.i18n,S=h.defaultNS,O=v||b||ft();if(!O)return ue("You will need to pass in an i18next instance by using i18nextReactModule"),t;var A=m||O.t.bind(O)||function(g){return g};i&&(s.context=i);var k=_(_({},ut()),O.options&&O.options.react),w=p||A.ns||S||O.options&&O.options.defaultNS;w=typeof w=="string"?[w]:w||["translation"];var j=f||lt(t,k)||k.transEmptyNodeValue||r,R=k.hashTransKey,C=r||(R?R(j):j),P=u?s.interpolation:{interpolation:_(_({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},E=_(_(_(_({},s),{},{count:n},u),P),{},{defaultValue:j,ns:w}),K=C?A(C,E):j,B=an(c||t,K,O,k,E,d),l=e!==void 0?e:k.defaultTransParent;return l?T.createElement(l,y,B):B}function sn(a){if(Array.isArray(a))return a}function un(a,t){var n=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(n!=null){var e,r,i,o,s=[],u=!0,f=!1;try{if(i=(n=n.call(a)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(e=i.call(n)).done)&&(s.push(e.value),s.length!==t);u=!0);}catch(c){f=!0,r=c}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw r}}return s}}function $e(a,t){(t==null||t>a.length)&&(t=a.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=a[n];return e}function fn(a,t){if(!!a){if(typeof a=="string")return $e(a,t);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(a);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(a,t)}}function ln(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cn(a,t){return sn(a)||un(a,t)||fn(a,t)||ln()}function ze(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function Oe(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ze(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}var pn=function(t,n){var e=T.useRef();return T.useEffect(function(){e.current=n?e.current:t},[t,n]),e.current};function dn(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,e=T.useContext(st)||{},r=e.i18n,i=e.defaultNS,o=n||r||ft();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Jt),!o){ue("You will need to pass in an i18next instance by using initReactI18next");var s=function(C){return Array.isArray(C)?C[C.length-1]:C},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&ue("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=Oe(Oe(Oe({},ut()),o.options.react),t),c=f.useSuspense,p=f.keyPrefix,v=a||i||o.options&&o.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(v);var m=(o.isInitialized||o.initializedStoreOnce)&&v.every(function(R){return Zt(R,o,f)});function d(){return o.getFixedT(null,f.nsMode==="fallback"?v:v[0],p)}var y=T.useState(d),h=cn(y,2),b=h[0],S=h[1],O=v.join(),A=pn(O),k=T.useRef(!0);T.useEffect(function(){var R=f.bindI18n,C=f.bindI18nStore;k.current=!0,!m&&!c&&qe(o,v,function(){k.current&&S(d)}),m&&A&&A!==O&&k.current&&S(d);function P(){k.current&&S(d)}return R&&o&&o.on(R,P),C&&o&&o.store.on(C,P),function(){k.current=!1,R&&o&&R.split(" ").forEach(function(E){return o.off(E,P)}),C&&o&&C.split(" ").forEach(function(E){return o.store.off(E,P)})}},[o,O]);var w=T.useRef(!0);T.useEffect(function(){k.current&&!w.current&&S(d),w.current=!1},[o,p]);var j=[b,o,m];if(j.t=b,j.i18n=o,j.ready=m,m||!m&&!c)return j;throw new Promise(function(R){qe(o,v,function(){R()})})}function Le(a){return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(a)}var ct=[],gn=ct.forEach,hn=ct.slice;function Pe(a){return gn.call(hn.call(arguments,1),function(t){if(t)for(var n in t)a[n]===void 0&&(a[n]=t[n])}),a}function pt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Le(XMLHttpRequest))==="object"}function vn(a){return!!a&&typeof a.then=="function"}function mn(a){return vn(a)?a:Promise.resolve(a)}function yn(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fe={exports:{}},ae={exports:{}},Ke;function bn(){return Ke||(Ke=1,function(a,t){var n=typeof self<"u"?self:ie,e=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(o){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function u(l){return l&&DataView.prototype.isPrototypeOf(l)}if(s.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(l){return l&&f.indexOf(Object.prototype.toString.call(l))>-1};function p(l){if(typeof l!="string"&&(l=String(l)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))throw new TypeError("Invalid character in header field name");return l.toLowerCase()}function v(l){return typeof l!="string"&&(l=String(l)),l}function m(l){var g={next:function(){var x=l.shift();return{done:x===void 0,value:x}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(l){this.map={},l instanceof d?l.forEach(function(g,x){this.append(x,g)},this):Array.isArray(l)?l.forEach(function(g){this.append(g[0],g[1])},this):l&&Object.getOwnPropertyNames(l).forEach(function(g){this.append(g,l[g])},this)}d.prototype.append=function(l,g){l=p(l),g=v(g);var x=this.map[l];this.map[l]=x?x+", "+g:g},d.prototype.delete=function(l){delete this.map[p(l)]},d.prototype.get=function(l){return l=p(l),this.has(l)?this.map[l]:null},d.prototype.has=function(l){return this.map.hasOwnProperty(p(l))},d.prototype.set=function(l,g){this.map[p(l)]=v(g)},d.prototype.forEach=function(l,g){for(var x in this.map)this.map.hasOwnProperty(x)&&l.call(g,this.map[x],x,this)},d.prototype.keys=function(){var l=[];return this.forEach(function(g,x){l.push(x)}),m(l)},d.prototype.values=function(){var l=[];return this.forEach(function(g){l.push(g)}),m(l)},d.prototype.entries=function(){var l=[];return this.forEach(function(g,x){l.push([x,g])}),m(l)},s.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function y(l){if(l.bodyUsed)return Promise.reject(new TypeError("Already read"));l.bodyUsed=!0}function h(l){return new Promise(function(g,x){l.onload=function(){g(l.result)},l.onerror=function(){x(l.error)}})}function b(l){var g=new FileReader,x=h(g);return g.readAsArrayBuffer(l),x}function S(l){var g=new FileReader,x=h(g);return g.readAsText(l),x}function O(l){for(var g=new Uint8Array(l),x=new Array(g.length),F=0;F<g.length;F++)x[F]=String.fromCharCode(g[F]);return x.join("")}function A(l){if(l.slice)return l.slice(0);var g=new Uint8Array(l.byteLength);return g.set(new Uint8Array(l)),g.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(l){this._bodyInit=l,l?typeof l=="string"?this._bodyText=l:s.blob&&Blob.prototype.isPrototypeOf(l)?this._bodyBlob=l:s.formData&&FormData.prototype.isPrototypeOf(l)?this._bodyFormData=l:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)?this._bodyText=l.toString():s.arrayBuffer&&s.blob&&u(l)?(this._bodyArrayBuffer=A(l.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(l)||c(l))?this._bodyArrayBuffer=A(l):this._bodyText=l=Object.prototype.toString.call(l):this._bodyText="",this.headers.get("content-type")||(typeof l=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(l){var g=l.toUpperCase();return w.indexOf(g)>-1?g:l}function R(l,g){g=g||{};var x=g.body;if(l instanceof R){if(l.bodyUsed)throw new TypeError("Already read");this.url=l.url,this.credentials=l.credentials,g.headers||(this.headers=new d(l.headers)),this.method=l.method,this.mode=l.mode,this.signal=l.signal,!x&&l._bodyInit!=null&&(x=l._bodyInit,l.bodyUsed=!0)}else this.url=String(l);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new d(g.headers)),this.method=j(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function C(l){var g=new FormData;return l.trim().split("&").forEach(function(x){if(x){var F=x.split("="),N=F.shift().replace(/\+/g," "),L=F.join("=").replace(/\+/g," ");g.append(decodeURIComponent(N),decodeURIComponent(L))}}),g}function P(l){var g=new d,x=l.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(F){var N=F.split(":"),L=N.shift().trim();if(L){var V=N.join(":").trim();g.append(L,V)}}),g}k.call(R.prototype);function E(l,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new d(g.headers),this.url=g.url||"",this._initBody(l)}k.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var l=new E(null,{status:0,statusText:""});return l.type="error",l};var K=[301,302,303,307,308];E.redirect=function(l,g){if(K.indexOf(g)===-1)throw new RangeError("Invalid status code");return new E(null,{status:g,headers:{location:l}})},o.DOMException=i.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,x){this.message=g,this.name=x;var F=Error(g);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function B(l,g){return new Promise(function(x,F){var N=new R(l,g);if(N.signal&&N.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function V(){L.abort()}L.onload=function(){var U={status:L.status,statusText:L.statusText,headers:P(L.getAllResponseHeaders()||"")};U.url="responseURL"in L?L.responseURL:U.headers.get("X-Request-URL");var H="response"in L?L.response:L.responseText;x(new E(H,U))},L.onerror=function(){F(new TypeError("Network request failed"))},L.ontimeout=function(){F(new TypeError("Network request failed"))},L.onabort=function(){F(new o.DOMException("Aborted","AbortError"))},L.open(N.method,N.url,!0),N.credentials==="include"?L.withCredentials=!0:N.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&s.blob&&(L.responseType="blob"),N.headers.forEach(function(U,H){L.setRequestHeader(H,U)}),N.signal&&(N.signal.addEventListener("abort",V),L.onreadystatechange=function(){L.readyState===4&&N.signal.removeEventListener("abort",V)}),L.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return B.polyfill=!0,i.fetch||(i.fetch=B,i.Headers=d,i.Request=R,i.Response=E),o.Headers=d,o.Request=R,o.Response=E,o.fetch=B,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(e),e.fetch.ponyfill=!0,delete e.fetch.polyfill;var r=e;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,a.exports=t}(ae,ae.exports)),ae.exports}(function(a,t){var n;if(typeof fetch=="function"&&(typeof ie<"u"&&ie.fetch?n=ie.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof yn<"u"&&(typeof window>"u"||typeof window.document>"u")){var e=n||bn();e.default&&(e=e.default),t.default=e,a.exports=t.default}})(fe,fe.exports);const dt=fe.exports,We=mt({__proto__:null,default:dt},[fe.exports]);function le(a){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(a)}var z;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?z=global.fetch:typeof window<"u"&&window.fetch?z=window.fetch:z=fetch);var ne;pt()&&(typeof global<"u"&&global.XMLHttpRequest?ne=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ne=window.XMLHttpRequest));var ce;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ce=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ce=window.ActiveXObject));!z&&We&&!ne&&!ce&&(z=dt||We);typeof z!="function"&&(z=void 0);var Ee=function(t,n){if(n&&le(n)==="object"){var e="";for(var r in n)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n[r]);if(!e)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+e.slice(1)}return t},Xe=function(t,n,e){z(t,n).then(function(r){if(!r.ok)return e(r.statusText||"Error",{status:r.status});r.text().then(function(i){e(null,{status:r.status,data:i})}).catch(e)}).catch(e)},Je=!1,wn=function(t,n,e,r){t.queryStringParams&&(n=Ee(n,t.queryStringParams));var i=Pe({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);e&&(i["Content-Type"]="application/json");var o=typeof t.requestOptions=="function"?t.requestOptions(e):t.requestOptions,s=Pe({method:e?"POST":"GET",body:e?t.stringify(e):void 0,headers:i},Je?{}:o);try{Xe(n,s,r)}catch(u){if(!o||Object.keys(o).length===0||!u.message||u.message.indexOf("not implemented")<0)return r(u);try{Object.keys(o).forEach(function(f){delete s[f]}),Xe(n,s,r),Je=!0}catch(f){r(f)}}},Sn=function(t,n,e,r){e&&le(e)==="object"&&(e=Ee("",e).slice(1)),t.queryStringParams&&(n=Ee(n,t.queryStringParams));try{var i;ne?i=new ne:i=new ce("MSXML2.XMLHTTP.3.0"),i.open(e?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,e&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=t.customHeaders;if(o=typeof o=="function"?o():o,o)for(var s in o)i.setRequestHeader(s,o[s]);i.onreadystatechange=function(){i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(e)}catch(u){console&&console.log(u)}},On=function(t,n,e,r){if(typeof e=="function"&&(r=e,e=void 0),r=r||function(){},z)return wn(t,n,e,r);if(pt()||typeof ActiveXObject=="function")return Sn(t,n,e,r);r(new Error("No fetch and no xhr implementation found!"))};function xn(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(a,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function kn(a,t,n){return t&&Qe(a.prototype,t),n&&Qe(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a}function Ln(a,t,n){return t in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,a}var Pn=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,e,r){return Ln({},e,r||"")},request:On,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},gt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xn(this,a),this.services=t,this.options=n,this.allOptions=e,this.type="backend",this.init(t,n,e)}return kn(a,[{key:"init",value:function(n){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Pe(r,this.options||{},Pn()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return e.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,e,r){this._readAny(n,n,e,e,r)}},{key:"read",value:function(n,e,r){this._readAny([n],n,[e],e,r)}},{key:"_readAny",value:function(n,e,r,i,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(n,r)),u=mn(u),u.then(function(f){if(!f)return o(null,{});var c=s.services.interpolator.interpolate(f,{lng:n.join("+"),ns:r.join("+")});s.loadUrl(c,o,e,i)})}},{key:"loadUrl",value:function(n,e,r,i){var o=this;this.options.request(this.options,n,void 0,function(s,u){if(u&&(u.status>=500&&u.status<600||!u.status))return e("failed loading "+n+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return e("failed loading "+n+"; status code: "+u.status,!1);if(!u&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return e("failed loading "+n+": "+s.message,!0);if(s)return e(s,!1);var f,c;try{typeof u.data=="string"?f=o.options.parse(u.data,r,i):f=u.data}catch{c="failed parsing "+n+" to json"}if(c)return e(c,!1);e(null,f)})}},{key:"create",value:function(n,e,r,i,o){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var u=this.options.parsePayload(e,r,i),f=0,c=[],p=[];n.forEach(function(v){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(v,e));var d=s.services.interpolator.interpolate(m,{lng:v,ns:e});s.options.request(s.options,d,u,function(y,h){f+=1,c.push(y),p.push(h),f===n.length&&o&&o(c,p)})})}}},{key:"reload",value:function(){var n=this,e=this.services,r=e.backendConnector,i=e.languageUtils,o=e.logger,s=r.language;if(!(s&&s.toLowerCase()==="cimode")){var u=[],f=function(p){var v=i.toResolveHierarchy(p);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})};f(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return f(c)}),u.forEach(function(c){n.allOptions.ns.forEach(function(p){r.read(c,p,"read",null,null,function(v,m){v&&o.warn("loading namespace ".concat(p," for language ").concat(c," failed"),v),!v&&m&&o.log("loaded namespace ".concat(p," for language ").concat(c),m),r.loaded("".concat(c,"|").concat(p),v,m)})})})}}}]),a}();gt.type="backend";var ht=[],En=ht.forEach,jn=ht.slice;function Rn(a){return En.call(jn.call(arguments,1),function(t){if(t)for(var n in t)a[n]===void 0&&(a[n]=t[n])}),a}var Ge=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Cn=function(t,n,e){var r=e||{};r.path=r.path||"/";var i=encodeURIComponent(n),o=t+"="+i;if(r.maxAge>0){var s=r.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(r.domain){if(!Ge.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!Ge.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ye={create:function(t,n,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};e&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+e*60*1e3)),r&&(i.domain=r),document.cookie=Cn(t,encodeURIComponent(n),i)},read:function(t){for(var n=t+"=",e=document.cookie.split(";"),r=0;r<e.length;r++){for(var i=e[r];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},Nn={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var e=Ye.read(t.lookupCookie);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ye.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},An={name:"querystring",lookup:function(t){var n;if(typeof window<"u")for(var e=window.location.search.substring(1),r=e.split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(o>0){var s=r[i].substring(0,o);s===t.lookupQuerystring&&(n=r[i].substring(o+1))}}return n}},pe;try{pe=window!=="undefined"&&window.localStorage!==null;var Ze="i18next.translate.boo";window.localStorage.setItem(Ze,"foo"),window.localStorage.removeItem(Ze)}catch{pe=!1}var Tn={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&pe){var e=window.localStorage.getItem(t.lookupLocalStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&pe&&window.localStorage.setItem(n.lookupLocalStorage,t)}},de;try{de=window!=="undefined"&&window.sessionStorage!==null;var et="i18next.translate.boo";window.sessionStorage.setItem(et,"foo"),window.sessionStorage.removeItem(et)}catch{de=!1}var Fn={name:"sessionStorage",lookup:function(t){var n;if(t.lookupsessionStorage&&de){var e=window.sessionStorage.getItem(t.lookupsessionStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupsessionStorage&&de&&window.sessionStorage.setItem(n.lookupsessionStorage,t)}},_n={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var e=0;e<navigator.languages.length;e++)n.push(navigator.languages[e]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},Dn={name:"htmlTag",lookup:function(t){var n,e=t.htmlTag||(typeof document<"u"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(n=e.getAttribute("lang")),n}},In={name:"path",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(e instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof e[t.lookupFromPathIndex]!="string")return;n=e[t.lookupFromPathIndex].replace("/","")}else n=e[0].replace("/","")}return n}},Un={name:"subdomain",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);e instanceof Array&&(typeof t.lookupFromSubdomainIndex=="number"?n=e[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n=e[0].replace("http://","").replace("https://","").replace(".",""))}return n}};function Bn(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var vt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.type="languageDetector",this.detectors={},this.init(t,n)}return q(a,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Rn(e,this.options||{},Bn()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Nn),this.addDetector(An),this.addDetector(Tn),this.addDetector(Fn),this.addDetector(_n),this.addDetector(Dn),this.addDetector(In),this.addDetector(Un)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var e=this;n||(n=this.options.order);var r=[];return n.forEach(function(i){if(e.detectors[i]){var o=e.detectors[i].lookup(e.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(n,e){var r=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||e.forEach(function(i){r.detectors[i]&&r.detectors[i].cacheUserLanguage(n,r.options)}))}}]),a}();vt.type="languageDetector";function Hn({detectorConfig:a,translationPath:t,customDetectors:n,...e}){const r=new vt,i={name:"hashRouterQuerystringDetector",lookup:f=>{try{const c=f&&f.lookupQuerystring||"lang",v=new RegExp(`[?&]${c}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(v&&v[2]){const m=decodeURIComponent(v[2].replace(/\+/g," "));if(m)return m}}catch(c){console.error(c)}}};r.addDetector(i),Array.isArray(n)&&n.forEach(f=>{r.addDetector(f)});const u={fallbackLng:"en-US",debug:!0,keySeparator:".",backend:{loadPath:t||"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},detection:a||{order:["querystring","hashRouterQuerystringDetector","cookie","localStorage"],lookupQuerystring:"lang",lookupCookie:"lang",lookupSessionStorage:"lang",lookupLocalStorage:"lang",caches:["localStorage","cookie"],excludeCacheFor:["cimode"],cookieOptions:{path:"/",sameSite:"strict"}},...e};return Dt.use(gt).use(r).use(Gt).init(u)}const Mn=on;function qn(a="translation",t){return dn([a,"design-system"],t)}exports.SpsLanguage=Mn;exports.localize=Hn;exports.useSpsLanguage=qn;
File without changes