"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "i18next.min.js" between
i18next-19.8.3.tar.gz and i18next-19.8.4.tar.gz

About: i18next is an internationalization framework for browser or any other javascript environment.

i18next.min.js  (i18next-19.8.3):i18next.min.js  (i18next-19.8.4)
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.expor ts=t():"function"==typeof define&&define.amd?define(t):(e=e||self).i18next=t()}( this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&" symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symb ol":typeof e})(t)}function t(e,t,n){return t in e?Object.defineProperty(e,t,{val ue:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?Object(arguments[n]):{},i=O bject.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Objec t.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescri ptor(o,e).enumerable}))),i.forEach(function(n){t(e,n,o[n])})}return e}function o (e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a functio n")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumer able||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e, o.key,o)}}function r(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function a(e) {if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(t,n){return!n||"object"!==e(n)&&"functi on"!=typeof n?a(t):n}function u(e){return(u=Object.setPrototypeOf?Object.getProt otypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l (e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t )}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super e xpression must either be null or a function");e.prototype=Object.create(t&&t.pro totype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}var p={typ e:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("w arn",e)},error:function(e){this.output("error",e)},output:function(e,t){console& &console[e]&&console[e].apply(console,t)}},f=new(function(){function e(t){var n= arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t, n)}return r(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!== arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,t his.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug= e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n< e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:f unction(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n ];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e= arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forwar d(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t =new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNIN G DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.deb ug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").conca t(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this. logger,n({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]) ,e}()),g=function(){function e(){o(this,e),this.observers={}}return r(e,[{key:"o n",value:function(e,t){var n=this;return e.split(" ").forEach(function(e){n.obse rvers[e]=n.observers[e]||[],n.observers[e].push(t)}),this}},{key:"off",value:fun ction(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter(func tion(e){return e!==t}):delete this.observers[e])}},{key:"emit",value:function(e) {for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[ o];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(v oid 0,n)});this.observers["*"]&&[].concat(this.observers["*"]).forEach(function( t){t.apply(t,[e].concat(n))})}}]),e}();function h(){var e,t,n=new Promise(functi on(n,o){e=n,t=o});return n.resolve=e,n.reject=t,n}function d(e){return null==e?" ":""+e}function v(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/ ###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeo f t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var a=o(r.shift());!e [a]&&n&&(e[a]=new n),e=e[a]}return i()?{}:{obj:e,k:o(r.shift())}}function y(e,t, n){var o=v(e,t,Object);o.obj[o.k]=n}function m(e,t){var n=v(e,t),o=n.obj,i=n.k;i f(o)return o[i]}function b(e,t,n){var o=m(e,n);return void 0!==o?o:m(t,n)}functi on k(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var x={"& ":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function w(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return x[e]}):e }var S="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent& &window.navigator.userAgent.indexOf("MSIE")>-1,L=function(e){function t(e){var n ,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],de faultNS:"translation"};return o(this,t),n=s(this,u(t).call(this)),S&&g.call(a(n) ),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySepara tor="."),n}return c(t,g),r(t,[{key:"addNamespaces",value:function(e){this.option s.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:funct ion(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key :"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==argument s[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySe parator,r=[e,t];return n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeo f n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split(".")),m(this.dat a,r)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0=== r&&(r=".");var a=[e,t];n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(o=t,t =(a=e.split("."))[1]),this.addNamespaces(t),y(this.data,a,o),i.silent||this.emit ("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.le ngth>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!= typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addR esource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addRe sourceBundle",value:function(e,t,o,i,r){var a=arguments.length>5&&void 0!==argum ents[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(i=o,o=t,t=(s=e.spli t("."))[1]),this.addNamespaces(t);var u=m(this.data,s)||{};i?function e(t,n,o){f or(var i in n)"__proto__"!==i&&(i in t?"string"==typeof t[i]||t[i]instanceof Str ing||"string"==typeof n[i]||n[i]instanceof String?o&&(t[i]=n[i]):e(t[i],n[i],o): t[i]=n[i]);return t}(u,o,r):u=n({},u,o),y(this.data,s,u),a.silent||this.emit("ad ded",e,t,o)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBu ndle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e ,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResou rce(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.option s.defaultNS),"v1"===this.options.compatibilityAPI?n({},{},this.getResource(e,t)) :this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this. data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(),O={processors :{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t, n,o,i){var r=this;return e.forEach(function(e){r.processors[e]&&(t=r.processors[ e].process(t,n,o,i))}),t}},R={},C=function(t){function i(e){var t,n,r,l,c=argume nts.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,i),t=s(this,u( i).call(this)),S&&g.call(a(t)),n=["resourceStore","languageUtils","pluralResolve r","interpolator","backendConnector","i18nFormat","utils"],r=e,l=a(t),n.forEach( function(e){r[e]&&(l[e]=r[e])}),t.options=c,void 0===t.options.keySeparator&&(t. options.keySeparator="."),t.logger=f.create("translator"),t}return c(i,g),r(i,[{ key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",valu e:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inte rpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKe y",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.n sSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this .options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var r=e.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:e,namespa ces:i};var a=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(a[0])>-1)&&(i=a.s hift()),e=a.join(o)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{ke y:"translate",value:function(t,o,i){var r=this;if("object"!==e(o)&&this.options. overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandl er(arguments)),o||(o={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=this.extrac tFromKey(t[t.length-1],o),u=s.key,l=s.namespaces,c=l[l.length-1],p=o.lng||this.l anguage,f=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&& "cimode"===p.toLowerCase()){if(f){var g=o.nsSeparator||this.options.nsSeparator; return c+g+u}return u}var h=this.resolve(t,o),d=h&&h.res,v=h&&h.usedKey||u,y=h&& h.exactUsedKey||u,m=Object.prototype.toString.apply(d),b=void 0!==o.joinArrays?o .joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAs Object;if(k&&d&&("string"!=typeof d&&"boolean"!=typeof d&&"number"!=typeof d)&&[ "[object Number]","[object Function]","[object RegExp]"].indexOf(m)<0&&("string" !=typeof b||"[object Array]"!==m)){if(!o.returnObjects&&!this.options.returnObje cts)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHan dler(v,d,o):"key '".concat(u," (").concat(this.language,")' returned an object i nstead of string.");if(a){var x="[object Array]"===m,w=x?[]:{},S=x?y:v;for(var L in d)if(Object.prototype.hasOwnProperty.call(d,L)){var O="".concat(S).concat(a) .concat(L);w[L]=this.translate(O,n({},o,{joinArrays:!1,ns:l})),w[L]===O&&(w[L]=d [L])}d=w}}else if(k&&"string"==typeof b&&"[object Array]"===m)(d=d.join(b))&&(d= this.extendTranslation(d,t,o,i));else{var R=!1,C=!1;if(!this.isValidLookup(d)&&v oid 0!==o.defaultValue){if(R=!0,void 0!==o.count){var N=this.pluralResolver.getS uffix(p,o.count);d=o["defaultValue".concat(N)]}d||(d=o.defaultValue)}this.isVali dLookup(d)||(C=!0,d=u);var j=o.defaultValue&&o.defaultValue!==d&&this.options.up dateMissing;if(C||R||j){if(this.logger.log(j?"updateKey":"missingKey",p,c,u,j?o. defaultValue:d),a){var E=this.resolve(u,n({},o,{keySeparator:!1}));E&&E.res&&thi s.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 a re published in nested format.")}var P=[],F=this.languageUtils.getFallbackCodes( this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.save MissingTo&&F&&F[0])for(var V=0;V<F.length;V++)P.push(F[V]);else"all"===this.opti ons.saveMissingTo?P=this.languageUtils.toResolveHierarchy(o.lng||this.language): P.push(o.lng||this.language);var T=function(e,t){r.options.missingKeyHandler?r.o ptions.missingKeyHandler(e,c,t,j?o.defaultValue:d,j,o):r.backendConnector&&r.bac kendConnector.saveMissing&&r.backendConnector.saveMissing(e,c,t,j?o.defaultValue :d,j,o),r.emit("missingKey",e,c,t,d)};if(this.options.saveMissing){var A=void 0! ==o.count&&"string"!=typeof o.count;this.options.saveMissingPlurals&&A?P.forEach (function(e){r.pluralResolver.getPluralFormsOfKey(e,u).forEach(function(t){retur n T([e],t)})}):T(P,u)}}d=this.extendTranslation(d,t,o,h,i),C&&d===u&&this.option s.appendNamespaceToMissingKey&&(d="".concat(c,":").concat(u)),C&&this.options.pa rseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(d))}return d}},{key :"extendTranslation",value:function(e,t,o,i,r){var a=this;if(this.i18nFormat&&th is.i18nFormat.parse)e=this.i18nFormat.parse(e,o,i.usedLng,i.usedNS,i.usedKey,{re solved:i});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init (n({},o,{interpolation:n({},this.options.interpolation,o.interpolation)}));var s ,u=o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation. skipOnVariables;if(u){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.leng th}var c=o.replace&&"string"!=typeof o.replace?o.replace:o;if(this.options.inter polation.defaultVariables&&(c=n({},this.options.interpolation.defaultVariables,c )),e=this.interpolator.interpolate(e,c,o.lng||this.language,o),u){var p=e.match( this.interpolator.nestingRegexp);s<(p&&p.length)&&(o.nest=!1)}!1!==o.nest&&(e=th is.interpolator.nest(e,function(){for(var e=arguments.length,n=new Array(e),i=0; i<e;i++)n[i]=arguments[i];return r&&r[0]===n[0]&&!o.context?(a.logger.warn("It s eems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),n ull):a.translate.apply(a,n.concat([t]))},o)),o.interpolation&&this.interpolator. reset()}var f=o.postProcess||this.options.postProcess,g="string"==typeof f?[f]:f ;return null!=e&&g&&g.length&&!1!==o.applyPostProcessor&&(e=O.handle(g,e,t,this. options&&this.options.postProcessPassResolved?n({i18nResolved:i},o):o,this)),e}} ,{key:"resolve",value:function(e){var t,n,o,i,r,a=this,s=arguments.length>1&&voi d 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(f unction(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),l=u.key;n=l;var c =u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var p=voi d 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s .context&&""!==s.context,g=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.ln g||a.language,s.fallbackLng);c.forEach(function(e){a.isValidLookup(t)||(r=e,!R[" ".concat(g[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.has LoadedNamespace(r)&&(R["".concat(g[0],"-").concat(e)]=!0,a.logger.warn('key "'.c oncat(n,'" for languages "').concat(g.join(", "),'" won\'t get resolved as names pace "').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 bef ore accessing it!!!")),g.forEach(function(n){if(!a.isValidLookup(t)){i=n;var r,u ,c=l,g=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKey s(g,l,n,e,s);else p&&(r=a.pluralResolver.getSuffix(n,s.count)),p&&f&&g.push(c+r) ,f&&g.push(c+="".concat(a.options.contextSeparator).concat(s.context)),p&&g.push (c+=r);for(;u=g.pop();)a.isValidLookup(t)||(o=u,t=a.getResource(n,e,u,s))}}))})} }),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:r}}},{key:"isValidLookup",va lue:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.op tions.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nForm at&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resour ceStore.getResource(e,t,n,o)}}]),i}();function N(e){return e.charAt(0).toUpperCa se()+e.slice(1)}var j=function(){function e(t){o(this,e),this.options=t,this.whi telist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedL ngs||!1,this.logger=f.create("languageUtils")}return r(e,[{key:"getScriptPartFro mCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-"); return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.fo rmatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e ){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguage Code(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&& e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e. split("-");return this.options.lowerCaseLng?n=n.map(function(e){return e.toLower Case()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf (n[1].toLowerCase())>-1&&(n[1]=N(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0]. toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2]. length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=N(n[1] .toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=N(n[2].toLowerCase()))) ,n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerC ase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("l anguageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupp ortedCode" in the next major - please make sure to rename it\'s usage asap.'),th is.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languag eOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getL anguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.su pportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t ,n=this;return e?(e.forEach(function(e){if(!t){var o=n.formatLanguageCode(e);n.o ptions.supportedLngs&&!n.isSupportedCode(o)||(t=o)}}),!t&&this.options.supported Lngs&&e.forEach(function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSup portedCode(o))return t=o;t=n.options.supportedLngs.find(function(e){if(0===e.ind exOf(o))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]), t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("functio n"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.pro totype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n ||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||( n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHi erarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options. fallbackLng||[],e),i=[],r=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logge r.warn("rejecting language code not found in supportedLngs: ".concat(e)))};retur n"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(th is.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==th is.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.l oad&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLangua geCode(e)),o.forEach(function(e){i.indexOf(e)<0&&r(n.formatLanguageCode(e))}),i} }]),e}(),E=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi"," oc","pt","pt-BR","tg","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","fu r","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],f c: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,10 0],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}],P={1:function(e){return Number(e>1)},2:functio n(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e% 10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){r eturn Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:functi on(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e %10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0: 2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){retur n Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e ?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11 )},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e ?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100< 10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2 )},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){re turn Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1& &e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e %100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100= =3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10= =0?2:3)}};var F=function(){function e(t){var n,i=arguments.length>1&&void 0!==ar guments[1]?arguments[1]:{};o(this,e),this.languageUtils=t,this.options=i,this.lo gger=f.create("pluralResolver"),this.rules=(n={},E.forEach(function(e){e.lngs.fo rEach(function(t){n[t]={numbers:e.nr,plurals:P[e.fc]}})}),n)}return r(e,[{key:"a ddRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){r eturn this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}} ,{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers. length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,o=[],i=this .getRule(e);return i?(i.numbers.forEach(function(i){var r=n.getSuffix(e,i);o.pus h("".concat(t).concat(r))}),o):o}},{key:"getSuffix",value:function(e,t){var n=th is,o=this.getRule(e);if(o){var i=o.noAbs?o.plurals(t):o.plurals(Math.abs(t)),r=o .numbers[i];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbe rs[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){return n.options.prepen d&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.o ptions.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toStrin g()):a():"v2"===this.options.compatibilityJSON?a():this.options.simplifyPluralSu ffix&&2===o.numbers.length&&1===o.numbers[0]?a():this.options.prepend&&i.toStrin g()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no p lural rule found for: ".concat(e)),""}}]),e}(),V=function(){function e(){var t=a rguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),this.logger=f .create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolat ion.format||function(e){return e},this.init(t)}return r(e,[{key:"init",value:fun ction(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interp olation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=vo id 0!==t.escape?t.escape:w,this.escapeValue=void 0===t.escapeValue||t.escapeValu e,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape ,this.prefix=t.prefix?k(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?k(t .suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSe parator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescap ePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",thi s.nestingPrefix=t.nestingPrefix?k(t.nestingPrefix):t.nestingPrefixEscaped||k("$t ("),this.nestingSuffix=t.nestingSuffix?k(t.nestingSuffix):t.nestingSuffixEscaped ||k(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptions Separator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxRep laces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRe gExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{ key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(t his.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(th is.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this. regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").con cat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate ",value:function(e,t,n,o){var i,r,a,s=this,u=this.options&&this.options.interpol ation&&this.options.interpolation.defaultVariables||{};function l(e){return e.re place(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var i=b (t,u,e);return s.alwaysFormat?s.format(i,void 0,n):i}var r=e.split(s.formatSepar ator),a=r.shift().trim(),l=r.join(s.formatSeparator).trim();return s.format(b(t, u,a),l,n,o)};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.opt ions.missingInterpolationHandler,f=o&&o.interpolation&&o.interpolation.skipOnVar iables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnes cape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e ){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach(function(t){for(a=0;i=t.re gex.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var n=p(e, i,o);r="string"==typeof n?n:""}else{if(f){r=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r=""}else"st ring"==typeof r||s.useRawValueToEscape||(r=d(r));if(e=e.replace(i[0],t.safeValue (r)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}}),e}},{key:"nest",value:funct ion(e,t){var o,i,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2] :{},s=n({},a);function u(e,t){var o=this.nestingOptionsSeparator;if(e.indexOf(o) <0)return e;var i=e.split(new RegExp("".concat(o,"[ ]*{"))),r="{".concat(i[1]);e =i[0],r=(r=this.interpolate(r,s)).replace(/'/g,'"');try{s=JSON.parse(r),t&&(s=n( {},t,s))}catch(t){return this.logger.warn("failed parsing options string in nest ing for key ".concat(e),t),"".concat(e).concat(o).concat(r)}return delete s.defa ultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;o=this.nestingRegex p.exec(e);){var l=[],c=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o [1])){var p=o[1].split(this.formatSeparator).map(function(e){return e.trim()});o [1]=p.shift(),l=p,c=!0}if((i=t(u.call(this,o[1].trim(),s),s))&&o[0]===e&&"string "!=typeof i)return i;"string"!=typeof i&&(i=d(i)),i||(this.logger.warn("missed t o resolve ".concat(o[1]," for nesting ").concat(e)),i=""),c&&(i=l.reduce(functio n(e,t){return r.format(e,t,a.lng,a)},i.trim())),e=e.replace(o[0],i),this.regexp. lastIndex=0}return e}}]),e}();var T=function(e){function t(e,n,i){var r,l=argume nts.length>3&&void 0!==arguments[3]?arguments[3]:{};return o(this,t),r=s(this,u( t).call(this)),S&&g.call(a(r)),r.backend=e,r.store=n,r.services=i,r.languageUtil s=i.languageUtils,r.options=l,r.logger=f.create("backendConnector"),r.state={},r .queue=[],r.backend&&r.backend.init&&r.backend.init(i,l.backend,l),r}return c(t, g),r(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,r=[],a=[],s=[],u=[]; return e.forEach(function(e){var o=!0;t.forEach(function(t){var s="".concat(e,"| ").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0 ||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,o=!1,a.indexOf(s)<0&&a .push(s),r.indexOf(s)<0&&r.push(s),u.indexOf(t)<0&&u.push(t)))}),o||s.push(e)}), (r.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:o} ),{toLoad:r,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",valu e:function(e,t,n){var o=e.split("|"),i=o[0],r=o[1];t&&this.emit("failedLoading", i,r,t),n&&this.store.addResourceBundle(i,r,n),this.state[e]=t?-1:2;var a={};this .queue.forEach(function(n){var o,s,u,l,c,p;o=n.loaded,s=r,l=v(o,[i],Object),c=l. obj,p=l.k,c[p]=c[p]||[],u&&(c[p]=c[p].concat(s)),u||c[p].push(s),function(e,t){f or(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.er rors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach(functi on(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach(function(t){a[e].i ndexOf(t)<0&&a[e].push(t)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.c allback())}),this.emit("loaded",a),this.queue=this.queue.filter(function(e){retu rn!e.done})}},{key:"read",value:function(e,t,n){var o=this,i=arguments.length>3& &void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4 ]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this .backend[n](e,t,function(s,u){s&&u&&i<5?setTimeout(function(){o.read.call(o,e,t, n,i+1,2*r,a)},r):a(s,u)}):a(null,{})}},{key:"prepareLoading",value:function(e,t) {var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=argume nts.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No ba ckend was added via i18next.use. Will not load resources."),i&&i();"string"==typ eof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]); var r=this.queueLoad(e,t,o,i);if(!r.toLoad.length)return r.pending.length||i(),n ull;r.toLoad.forEach(function(e){n.loadOne(e)})}},{key:"load",value:function(e,t ,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.pre pareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=a rguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),i=o[0],r =o[1];this.read(i,r,"read",void 0,void 0,function(o,a){o&&t.logger.warn("".conca t(n,"loading namespace ").concat(r," for language ").concat(i," failed"),o),!o&& a&&t.logger.log("".concat(n,"loaded namespace ").concat(r," for language ").conc at(i),a),t.loaded(e,o,a)})}},{key:"saveMissing",value:function(e,t,o,i,r){var a= arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&t his.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t )?this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat( t,'" was not yet loaded'),"This means something IS WRONG in your setup. You acce ss the t function before i18next.init / i18next.loadNamespace / i18next.changeLa nguage was done. Wait for the callback or Promise to resolve before accessing it !!!"):null!=o&&""!==o&&(this.backend&&this.backend.create&&this.backend.create(e ,t,o,i,null,n({},a,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,o,i))}} ]),t}();function A(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeo f e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&& (e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("ci mode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whiteli st),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist), e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.support edLngs.concat(["cimode"])),e}function U(){}return new(function(t){function i(){v ar e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.len gth>1?arguments[1]:void 0;if(o(this,i),e=s(this,u(i).call(this)),S&&g.call(a(e)) ,e.options=A(t),e.services={},e.logger=f,e.modules={external:[]},n&&!e.isInitial ized&&!t.isClone){if(!e.options.initImmediate)return e.init(t,n),s(e,a(e));setTi meout(function(){e.init(t,n)},0)}return e}return c(i,g),r(i,[{key:"init",value:f unction(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{} ,i=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typ eof e?new e:e:null}if("function"==typeof o&&(i=o,o={}),o.whitelist&&!o.supported Lngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to " supportedLngs" in the next major - please make sure to rename this option asap.' ),o.nonExplicitWhitelist&&!o.nonExplicitSupportedLngs&&this.logger.deprecate("wh itelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupporte dLngs" in the next major - please make sure to rename this option asap.'),this.o ptions=n({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translatio n"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,suppo rtedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuff ix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_", partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallba ck",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,po stProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,retur nObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,app endNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOption Handler:function(t){var n={};if("object"===e(t[1])&&(n=t[1]),"string"==typeof t[ 1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"= ==e(t[2])||"object"===e(t[3])){var o=t[3]||t[2];Object.keys(o).forEach(function( e){n[e]=o[e]})}return n},interpolation:{escapeValue:!0,format:function(e,t,n,o){ return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nesting Prefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipO nVariables:!1}},this.options,A(o)),this.format=this.options.interpolation.format ,i||(i=U),!this.options.isClone){this.modules.logger?f.init(r(this.modules.logge r),this.options):f.init(null,this.options);var a=new j(this.options);this.store= new L(this.options.resources,this.options);var s=this.services;s.logger=f,s.reso urceStore=this.store,s.languageUtils=a,s.pluralResolver=new F(a,{prepend:this.op tions.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyP luralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new V(this.option s),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConn ector=new T(r(this.modules.backend),s.resourceStore,s,this.options),s.backendCon nector.on("*",function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1; i<n;i++)o[i-1]=arguments[i];t.emit.apply(t,[e].concat(o))}),this.modules.languag eDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetect or.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18n Format=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),th is.translator=new C(this.services,this.options),this.translator.on("*",function( e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=argument s[i];t.emit.apply(t,[e].concat(o))}),this.modules.external.forEach(function(e){e .init&&e.init(t)})}this.services.languageDetector||this.options.lng||this.logger .warn("init: no languageDetector is used and no lng is defined");["getResource", "hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(e) {t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}});["addResource" ,"addResources","addResourceBundle","removeResourceBundle"].forEach(function(e){ t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}});var u=h(),l=f unction(){t.changeLanguage(t.options.lng,function(e,n){t.isInitialized=!0,t.opti ons.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.option s),u.resolve(n),i(e,n)})};return this.options.resources||!this.options.initImmed iate?l():setTimeout(l,0),u}},{key:"loadResources",value:function(e){var t=this,n =arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,o="string"==typeof e?e :this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.opti ons.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return n();var i=[ ],r=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(functi on(e){i.indexOf(e)<0&&i.push(e)})};if(o)r(o);else this.services.languageUtils.ge tFallbackCodes(this.options.fallbackLng).forEach(function(e){return r(e)});this. options.preload&&this.options.preload.forEach(function(e){return r(e)}),this.ser vices.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadReso urces",value:function(e,t,n){var o=h();return e||(e=this.languages),t||(t=this.o ptions.ns),n||(n=U),this.services.backendConnector.reload(e,t,function(e){o.reso lve(),n(e)}),o}},{key:"use",value:function(e){if(!e)throw new Error("You are pas sing 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 th e object you are passing to i18next.use()");return"backend"===e.type&&(this.modu les.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger =e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"= ==e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&O.addPostProcess or(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLang uage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=h();this. emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.servic es.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.langua ges=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.tra nslator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetect or.cacheUserLanguage(i)),n.loadResources(i,function(e){!function(e,i){i?(n.langu age=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.ch angeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logg er.log("languageChanged",i)):n.isLanguageChangingTo=void 0,o.resolve(function(){ return n.t.apply(n,arguments)}),t&&t(e,function(){return n.t.apply(n,arguments)} )}(e,i)})};return e||!this.services.languageDetector||this.services.languageDete ctor.async?!e&&this.services.languageDetector&&this.services.languageDetector.as ync?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetect or.detect()),o}},{key:"getFixedT",value:function(t,o){var i=this,r=function t(o, r){var a;if("object"!==e(r)){for(var s=arguments.length,u=new Array(s>2?s-2:0),l =2;l<s;l++)u[l-2]=arguments[l];a=i.options.overloadTranslationOptionHandler([o,r ].concat(u))}else a=n({},r);return a.lng=a.lng||t.lng,a.lngs=a.lngs||t.lngs,a.ns =a.ns||t.ns,i.t(o,a)};return"string"==typeof t?r.lng=t:r.lngs=t,r.ns=o,r}},{key: "t",value:function(){var e;return this.translator&&(e=this.translator).translate .apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translato r&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",va lue:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:funct ion(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if (!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was no t initialized",this.languages),!1;if(!this.languages||!this.languages.length)ret urn this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty ",this.languages),!1;var o=this.languages[0],i=!!this.options&&this.options.fall backLng,r=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase()) return!0;var a=function(e,n){var o=t.services.backendConnector.state["".concat(e ,"|").concat(n)];return-1===o||2===o};if(n.precheck){var s=n.precheck(this,a);if (void 0!==s)return s}return!!this.hasResourceBundle(o,e)||(!this.services.backen dConnector.backend||!(!a(o,e)||i&&!a(r,e)))}},{key:"loadNamespaces",value:functi on(e,t){var n=this,o=h();return this.options.ns?("string"==typeof e&&(e=[e]),e.f orEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)}),this.loadRe sources(function(e){o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}},{key:" loadLanguages",value:function(e,t){var n=h();"string"==typeof e&&(e=[e]);var o=t his.options.preload||[],i=e.filter(function(e){return o.indexOf(e)<0});return i. length?(this.options.preload=o.concat(i),this.loadResources(function(e){n.resolv e(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e| |(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e) return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","a cm","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","hb o","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.la nguageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",v alue:function(){return new i(arguments.length>0&&void 0!==arguments[0]?arguments [0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:func tion(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o= arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,r=n({},this.options,t,{ isClone:!0}),a=new i(r);return["store","services","language"].forEach(function(t ){a[t]=e[t]}),a.services=n({},this.services),a.services.utils={hasLoadedNamespac e:a.hasLoadedNamespace.bind(a)},a.translator=new C(a.services,a.options),a.trans lator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o <t;o++)n[o-1]=arguments[o];a.emit.apply(a,[e].concat(n))}),a.init(r,o),a.transla tor.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNam espace:a.hasLoadedNamespace.bind(a)},a}}]),i}())}); !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.expor ts=t():"function"==typeof define&&define.amd?define(t):(e=e||self).i18next=t()}( this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&" symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symb ol":typeof e})(t)}function t(e,t,n){return t in e?Object.defineProperty(e,t,{val ue:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?Object(arguments[n]):{},i=O bject.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Objec t.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescri ptor(o,e).enumerable}))),i.forEach(function(n){t(e,n,o[n])})}return e}function o (e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a functio n")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumer able||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e, o.key,o)}}function r(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function a(e) {if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(t,n){return!n||"object"!==e(n)&&"functi on"!=typeof n?a(t):n}function u(e){return(u=Object.setPrototypeOf?Object.getProt otypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l (e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t )}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super e xpression must either be null or a function");e.prototype=Object.create(t&&t.pro totype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}var p={typ e:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("w arn",e)},error:function(e){this.output("error",e)},output:function(e,t){console& &console[e]&&console[e].apply(console,t)}},f=new(function(){function e(t){var n= arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t, n)}return r(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!== arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,t his.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug= e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n< e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:f unction(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n ];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e= arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forwar d(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t =new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNIN G DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.deb ug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").conca t(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this. logger,n({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]) ,e}()),g=function(){function e(){o(this,e),this.observers={}}return r(e,[{key:"o n",value:function(e,t){var n=this;return e.split(" ").forEach(function(e){n.obse rvers[e]=n.observers[e]||[],n.observers[e].push(t)}),this}},{key:"off",value:fun ction(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter(func tion(e){return e!==t}):delete this.observers[e])}},{key:"emit",value:function(e) {for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[ o];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(v oid 0,n)});this.observers["*"]&&[].concat(this.observers["*"]).forEach(function( t){t.apply(t,[e].concat(n))})}}]),e}();function h(){var e,t,n=new Promise(functi on(n,o){e=n,t=o});return n.resolve=e,n.reject=t,n}function d(e){return null==e?" ":""+e}function v(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/ ###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeo f t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var a=o(r.shift());!e [a]&&n&&(e[a]=new n),e=e[a]}return i()?{}:{obj:e,k:o(r.shift())}}function y(e,t, n){var o=v(e,t,Object);o.obj[o.k]=n}function m(e,t){var n=v(e,t),o=n.obj,i=n.k;i f(o)return o[i]}function b(e,t,n){var o=m(e,n);return void 0!==o?o:m(t,n)}functi on k(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var x={"& ":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function w(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return x[e]}):e }var S="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent& &window.navigator.userAgent.indexOf("MSIE")>-1,L=function(e){function t(e){var n ,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],de faultNS:"translation"};return o(this,t),n=s(this,u(t).call(this)),S&&g.call(a(n) ),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySepara tor="."),n}return c(t,g),r(t,[{key:"addNamespaces",value:function(e){this.option s.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:funct ion(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key :"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==argument s[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySe parator,r=[e,t];return n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeo f n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split(".")),m(this.dat a,r)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0=== r&&(r=".");var a=[e,t];n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(o=t,t =(a=e.split("."))[1]),this.addNamespaces(t),y(this.data,a,o),i.silent||this.emit ("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.le ngth>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!= typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addR esource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addRe sourceBundle",value:function(e,t,o,i,r){var a=arguments.length>5&&void 0!==argum ents[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(i=o,o=t,t=(s=e.spli t("."))[1]),this.addNamespaces(t);var u=m(this.data,s)||{};i?function e(t,n,o){f or(var i in n)"__proto__"!==i&&"constructor"!==i&&(i in t?"string"==typeof t[i]| |t[i]instanceof String||"string"==typeof n[i]||n[i]instanceof String?o&&(t[i]=n[ i]):e(t[i],n[i],o):t[i]=n[i]);return t}(u,o,r):u=n({},u,o),y(this.data,s,u),a.si lent||this.emit("added",e,t,o)}},{key:"removeResourceBundle",value:function(e,t) {this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),th is.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return voi d 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){retur n t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?n({},{},thi s.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:funct ion(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]) ,t}(),O={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},h andle:function(e,t,n,o,i){var r=this;return e.forEach(function(e){r.processors[e ]&&(t=r.processors[e].process(t,n,o,i))}),t}},R={},C=function(t){function i(e){v ar t,n,r,l,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o( this,i),t=s(this,u(i).call(this)),S&&g.call(a(t)),n=["resourceStore","languageUt ils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r= e,l=a(t),n.forEach(function(e){r[e]&&(l[e]=r[e])}),t.options=c,void 0===t.option s.keySeparator&&(t.options.keySeparator="."),t.logger=f.create("translator"),t}r eturn c(i,g),r(i,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}} ,{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1] ?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}}, {key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSepar ator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator? t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e. indexOf(n)>-1){var r=e.match(this.interpolator.nestingRegexp);if(r&&r.length>0)r eturn{key:e,namespaces:i};var a=e.split(n);(n!==o||n===o&&this.options.ns.indexO f(a[0])>-1)&&(i=a.shift()),e=a.join(o)}return"string"==typeof i&&(i=[i]),{key:e, namespaces:i}}},{key:"translate",value:function(t,o,i){var r=this;if("object"!== e(o)&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTra nslationOptionHandler(arguments)),o||(o={}),null==t)return"";Array.isArray(t)||( t=[String(t)]);var a=void 0!==o.keySeparator?o.keySeparator:this.options.keySepa rator,s=this.extractFromKey(t[t.length-1],o),u=s.key,l=s.namespaces,c=l[l.length -1],p=o.lng||this.language,f=o.appendNamespaceToCIMode||this.options.appendNames paceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(f){var g=o.nsSeparator||this.o ptions.nsSeparator;return c+g+u}return u}var h=this.resolve(t,o),d=h&&h.res,v=h& &h.usedKey||u,y=h&&h.exactUsedKey||u,m=Object.prototype.toString.apply(d),b=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this. i18nFormat.handleAsObject;if(k&&d&&("string"!=typeof d&&"boolean"!=typeof d&&"nu mber"!=typeof d)&&["[object Number]","[object Function]","[object RegExp]"].inde xOf(m)<0&&("string"!=typeof b||"[object Array]"!==m)){if(!o.returnObjects&&!this .options.returnObjects)return this.logger.warn("accessing an object - but return Objects options is not enabled!"),this.options.returnedObjectHandler?this.option s.returnedObjectHandler(v,d,o):"key '".concat(u," (").concat(this.language,")' r eturned an object instead of string.");if(a){var x="[object Array]"===m,w=x?[]:{ },S=x?y:v;for(var L in d)if(Object.prototype.hasOwnProperty.call(d,L)){var O="". concat(S).concat(a).concat(L);w[L]=this.translate(O,n({},o,{joinArrays:!1,ns:l}) ),w[L]===O&&(w[L]=d[L])}d=w}}else if(k&&"string"==typeof b&&"[object Array]"===m )(d=d.join(b))&&(d=this.extendTranslation(d,t,o,i));else{var R=!1,C=!1;if(!this. isValidLookup(d)&&void 0!==o.defaultValue){if(R=!0,void 0!==o.count){var N=this. pluralResolver.getSuffix(p,o.count);d=o["defaultValue".concat(N)]}d||(d=o.defaul tValue)}this.isValidLookup(d)||(C=!0,d=u);var j=o.defaultValue&&o.defaultValue!= =d&&this.options.updateMissing;if(C||R||j){if(this.logger.log(j?"updateKey":"mis singKey",p,c,u,j?o.defaultValue:d),a){var E=this.resolve(u,n({},o,{keySeparator: !1}));E&&E.res&&this.logger.warn("Seems the loaded translations were in flat JSO N format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var P=[],F=this.languageUtil s.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"= ==this.options.saveMissingTo&&F&&F[0])for(var V=0;V<F.length;V++)P.push(F[V]);el se"all"===this.options.saveMissingTo?P=this.languageUtils.toResolveHierarchy(o.l ng||this.language):P.push(o.lng||this.language);var T=function(e,t){r.options.mi ssingKeyHandler?r.options.missingKeyHandler(e,c,t,j?o.defaultValue:d,j,o):r.back endConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,c ,t,j?o.defaultValue:d,j,o),r.emit("missingKey",e,c,t,d)};if(this.options.saveMis sing){var A=void 0!==o.count&&"string"!=typeof o.count;this.options.saveMissingP lurals&&A?P.forEach(function(e){r.pluralResolver.getPluralFormsOfKey(e,u).forEac h(function(t){return T([e],t)})}):T(P,u)}}d=this.extendTranslation(d,t,o,h,i),C& &d===u&&this.options.appendNamespaceToMissingKey&&(d="".concat(c,":").concat(u)) ,C&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler( d))}return d}},{key:"extendTranslation",value:function(e,t,o,i,r){var a=this;if( this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,o,i.usedLng,i.u sedNS,i.usedKey,{resolved:i});else if(!o.skipInterpolation){o.interpolation&&thi s.interpolator.init(n({},o,{interpolation:n({},this.options.interpolation,o.inte rpolation)}));var s,u=o.interpolation&&o.interpolation.skipOnVariables||this.opt ions.interpolation.skipOnVariables;if(u){var l=e.match(this.interpolator.nesting Regexp);s=l&&l.length}var c=o.replace&&"string"!=typeof o.replace?o.replace:o;if (this.options.interpolation.defaultVariables&&(c=n({},this.options.interpolation .defaultVariables,c)),e=this.interpolator.interpolate(e,c,o.lng||this.language,o ),u){var p=e.match(this.interpolator.nestingRegexp);s<(p&&p.length)&&(o.nest=!1) }!1!==o.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length, n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r&&r[0]===n[0]&&!o.context?( a.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):a.translate.apply(a,n.concat([t]))},o)),o.interpolation& &this.interpolator.reset()}var f=o.postProcess||this.options.postProcess,g="stri ng"==typeof f?[f]:f;return null!=e&&g&&g.length&&!1!==o.applyPostProcessor&&(e=O .handle(g,e,t,this.options&&this.options.postProcessPassResolved?n({i18nResolved :i},o):o,this)),e}},{key:"resolve",value:function(e){var t,n,o,i,r,a=this,s=argu ments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&& (e=[e]),e.forEach(function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s ),l=u.key;n=l;var c=u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fal lbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context& &"string"==typeof s.context&&""!==s.context,g=s.lngs?s.lngs:a.languageUtils.toRe solveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach(function(e){a.isValidL ookup(t)||(r=e,!R["".concat(g[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedName space&&!a.utils.hasLoadedNamespace(r)&&(R["".concat(g[0],"-").concat(e)]=!0,a.lo gger.warn('key "'.concat(n,'" for languages "').concat(g.join(", "),'" won\'t ge t resolved as namespace "').concat(r,'" was not yet loaded'),"This means somethi ng IS WRONG in your setup. You access the t function before i18next.init / i18ne xt.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Pro mise to resolve before accessing it!!!")),g.forEach(function(n){if(!a.isValidLoo kup(t)){i=n;var r,u,c=l,g=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18n Format.addLookupKeys(g,l,n,e,s);else p&&(r=a.pluralResolver.getSuffix(n,s.count) ),p&&f&&g.push(c+r),f&&g.push(c+="".concat(a.options.contextSeparator).concat(s. context)),p&&g.push(c+=r);for(;u=g.pop();)a.isValidLookup(t)||(o=u,t=a.getResour ce(n,e,u,s))}}))})}}),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:r}}},{key :"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull& &null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:f unction(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r eturn this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e ,t,n,o):this.resourceStore.getResource(e,t,n,o)}}]),i}();function N(e){return e. charAt(0).toUpperCase()+e.slice(1)}var j=function(){function e(t){o(this,e),this .options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this .options.supportedLngs||!1,this.logger=f.create("languageUtils")}return r(e,[{ke y:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null; var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLower Case()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCod e",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if(" string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans", "mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function( e){return e.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUp perCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=N(n[1].toLowerCase()))):3===n. length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn "!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase( ))>-1&&(n[1]=N(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=N(n[ 2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowe rCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){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(e)}},{key:"isSupportedCode",value:function (e){return("languageOnly"===this.options.load||this.options.nonExplicitSupported Lngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedL ngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",valu e:function(e){var t,n=this;return e?(e.forEach(function(e){if(!t){var o=n.format LanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}}),!t&&thi s.options.supportedLngs&&e.forEach(function(e){if(!t){var o=n.getLanguagePartFro mCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find(funct ion(e){if(0===e.indexOf(o))return e})}}),t||(t=this.getFallbackCodes(this.option s.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)r eturn[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object A rray]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[]; var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLan guageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]} },{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCod es(t||this.options.fallbackLng||[],e),i=[],r=function(e){e&&(n.isSupportedCode(e )?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: " .concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this .options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load& &"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnl y"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&& r(this.formatLanguageCode(e)),o.forEach(function(e){i.indexOf(e)<0&&r(n.formatLa nguageCode(e))}),i}}]),e}(),E=[{lngs:["ach","ak","am","arn","br","fil","gun","ln ","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{ln gs:["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","pm s","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","u r","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","k k","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}],P={1:function(e){return Num ber(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function( e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1: 2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100 >=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){ret urn Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){re turn Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},1 0:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number (e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11 ?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e% 100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1) },18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1= =e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Nu mber(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1? 1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1 :(e<0||e>10)&&e%10==0?2:3)}};var F=function(){function e(t){var n,i=arguments.le ngth>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.languageUtils=t,thi s.options=i,this.logger=f.create("pluralResolver"),this.rules=(n={},E.forEach(fu nction(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:P[e.fc]}})}),n)} return r(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule", value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguag ePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);r eturn t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,o=[],i=this.getRule(e);return i?(i.numbers.forEach(function(i){var r=n.g etSuffix(e,i);o.push("".concat(t).concat(r))}),o):o}},{key:"getSuffix",value:fun ction(e,t){var n=this,o=this.getRule(e);if(o){var i=o.noAbs?o.plurals(t):o.plura ls(Math.abs(t)),r=o.numbers[i];this.options.simplifyPluralSuffix&&2===o.numbers. length&&1===o.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){retu rn n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()}; return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural _".concat(r.toString()):a():"v2"===this.options.compatibilityJSON?a():this.optio ns.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?a():this.options .prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return thi s.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),V=function(){f unction e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(th is,e),this.logger=f.create("interpolator"),this.options=t,this.format=t.interpol ation&&t.interpolation.format||function(e){return e},this.init(t)}return r(e,[{k ey:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?argum ents[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpola tion;this.escape=void 0!==t.escape?t.escape:w,this.escapeValue=void 0===t.escape Value||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t. useRawValueToEscape,this.prefix=t.prefix?k(t.prefix):t.prefixEscaped||"{{",this. suffix=t.suffix?k(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatS eparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescape Suffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.une scapeSuffix||"",this.nestingPrefix=t.nestingPrefix?k(t.nestingPrefix):t.nestingP refixEscaped||k("$t("),this.nestingSuffix=t.nestingSuffix?k(t.nestingSuffix):t.n estingSuffixEscaped||k(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparat or?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.m axReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.always Format,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.ini t(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefi x,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(thi s.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat (this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nesting Prefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")} },{key:"interpolate",value:function(e,t,n,o){var i,r,a,s=this,u=this.options&&th is.options.interpolation&&this.options.interpolation.defaultVariables||{};functi on l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSe parator)<0){var i=b(t,u,e);return s.alwaysFormat?s.format(i,void 0,n):i}var r=e. split(s.formatSeparator),a=r.shift().trim(),l=r.join(s.formatSeparator).trim();r eturn s.format(b(t,u,a),l,n,o)};this.resetRegExp();var p=o&&o.missingInterpolati onHandler||this.options.missingInterpolationHandler,f=o&&o.interpolation&&o.inte rpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{re gex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,s afeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach(functio n(t){for(a=0;i=t.regex.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==t ypeof p){var n=p(e,i,o);r="string"==typeof n?n:""}else{if(f){r=i[0];continue}s.l ogger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").conc at(e)),r=""}else"string"==typeof r||s.useRawValueToEscape||(r=d(r));if(e=e.repla ce(i[0],t.safeValue(r)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}}),e}},{key :"nest",value:function(e,t){var o,i,r=this,a=arguments.length>2&&void 0!==argume nts[2]?arguments[2]:{},s=n({},a);function u(e,t){var o=this.nestingOptionsSepara tor;if(e.indexOf(o)<0)return e;var i=e.split(new RegExp("".concat(o,"[ ]*{"))),r ="{".concat(i[1]);e=i[0],r=(r=this.interpolate(r,s)).replace(/'/g,'"');try{s=JSO N.parse(r),t&&(s=n({},t,s))}catch(t){return this.logger.warn("failed parsing opt ions string in nesting for key ".concat(e),t),"".concat(e).concat(o).concat(r)}r eturn delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue; o=this.nestingRegexp.exec(e);){var l=[],c=!1;if(o[0].includes(this.formatSeparat or)&&!/{.*}/.test(o[1])){var p=o[1].split(this.formatSeparator).map(function(e){ return e.trim()});o[1]=p.shift(),l=p,c=!0}if((i=t(u.call(this,o[1].trim(),s),s)) &&o[0]===e&&"string"!=typeof i)return i;"string"!=typeof i&&(i=d(i)),i||(this.lo gger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),i=""),c&& (i=l.reduce(function(e,t){return r.format(e,t,a.lng,a)},i.trim())),e=e.replace(o [0],i),this.regexp.lastIndex=0}return e}}]),e}();var T=function(e){function t(e, n,i){var r,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o( this,t),r=s(this,u(t).call(this)),S&&g.call(a(r)),r.backend=e,r.store=n,r.servic es=i,r.languageUtils=i.languageUtils,r.options=l,r.logger=f.create("backendConne ctor"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(i,l.backe nd,l),r}return c(t,g),r(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,r =[],a=[],s=[],u=[];return e.forEach(function(e){var o=!0;t.forEach(function(t){v ar s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.stat e[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,o=! 1,a.indexOf(s)<0&&a.push(s),r.indexOf(s)<0&&r.push(s),u.indexOf(t)<0&&u.push(t)) )}),o||s.push(e)}),(r.length||a.length)&&this.queue.push({pending:a,loaded:{},er rors:[],callback:o}),{toLoad:r,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}} ,{key:"loaded",value:function(e,t,n){var o=e.split("|"),i=o[0],r=o[1];t&&this.em it("failedLoading",i,r,t),n&&this.store.addResourceBundle(i,r,n),this.state[e]=t ?-1:2;var a={};this.queue.forEach(function(n){var o,s,u,l,c,p;o=n.loaded,s=r,l=v (o,[i],Object),c=l.obj,p=l.k,c[p]=c[p]||[],u&&(c[p]=c[p].concat(s)),u||c[p].push (s),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n .pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loa ded).forEach(function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach (function(t){a[e].indexOf(t)<0&&a[e].push(t)})}),n.done=!0,n.errors.length?n.cal lback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filt er(function(e){return!e.done})}},{key:"read",value:function(e,t,n){var o=this,i= arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&v oid 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;r eturn e.length?this.backend[n](e,t,function(s,u){s&&u&&i<5?setTimeout(function() {o.read.call(o,e,t,n,i+1,2*r,a)},r):a(s,u)}):a(null,{})}},{key:"prepareLoading", value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?argum ents[2]:{},i=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."),i &&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"= =typeof t&&(t=[t]);var r=this.queueLoad(e,t,o,i);if(!r.toLoad.length)return r.pe nding.length||i(),null;r.toLoad.forEach(function(e){n.loadOne(e)})}},{key:"load" ,value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:funct ion(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:functio n(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e. split("|"),i=o[0],r=o[1];this.read(i,r,"read",void 0,void 0,function(o,a){o&&t.l ogger.warn("".concat(n,"loading namespace ").concat(r," for language ").concat(i ," failed"),o),!o&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(r," f or language ").concat(i),a),t.loaded(e,o,a)})}},{key:"saveMissing",value:functio n(e,t,o,i,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};thi s.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.h asLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(o,'" as the na mespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in y our 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!!!"):null!=o&&""!==o&&(this.backend&&this.backend.create&&th is.backend.create(e,t,o,i,null,n({},a,{isUpdate:r})),e&&e[0]&&this.store.addReso urce(e[0],t,o,i))}}]),t}();function A(e){return"string"==typeof e.ns&&(e.ns=[e.n s]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==ty peof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.wh itelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supp ortedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.non ExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supp ortedLngs=e.supportedLngs.concat(["cimode"])),e}function U(){}return new(functio n(t){function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0] :{},n=arguments.length>1?arguments[1]:void 0;if(o(this,i),e=s(this,u(i).call(thi s)),S&&g.call(a(e)),e.options=A(t),e.services={},e.logger=f,e.modules={external: []},n&&!e.isInitialized&&!t.isClone){if(!e.options.initImmediate)return e.init(t ,n),s(e,a(e));setTimeout(function(){e.init(t,n)},0)}return e}return c(i,g),r(i,[ {key:"init",value:function(){var t=this,o=arguments.length>0&&void 0!==arguments [0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function r(e){retur n e?"function"==typeof e?new e:e:null}if("function"==typeof o&&(i=o,o={}),o.whit elist&&!o.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" w ill be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),o.nonExplicitWhitelist&&!o.nonExplicitSupportedLngs&&this.l ogger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to " nonExplicitSupportedLngs" in the next major - please make sure to rename this op tion asap.'),this.options=n({},{debug:!1,initImmediate:!0,ns:["translation"],def aultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplici tWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1 ,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",co ntextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,sa veMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpo lationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnE mptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissi ngKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overlo adTranslationOptionHandler:function(t){var n={};if("object"===e(t[1])&&(n=t[1]), "string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescript ion=t[2]),"object"===e(t[2])||"object"===e(t[3])){var o=t[3]||t[2];Object.keys(o ).forEach(function(e){n[e]=o[e]})}return n},interpolation:{escapeValue:!0,format :function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescap ePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",ma xReplaces:1e3,skipOnVariables:!1}},this.options,A(o)),this.format=this.options.i nterpolation.format,i||(i=U),!this.options.isClone){this.modules.logger?f.init(r (this.modules.logger),this.options):f.init(null,this.options);var a=new j(this.o ptions);this.store=new L(this.options.resources,this.options);var s=this.service s;s.logger=f,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new F (a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatib ilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolato r=new V(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(t his)},s.backendConnector=new T(r(this.modules.backend),s.resourceStore,s,this.op tions),s.backendConnector.on("*",function(e){for(var n=arguments.length,o=new Ar ray(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t.emit.apply(t,[e].concat(o))}),t his.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetecto r),s.languageDetector.init(s,this.options.detection,this.options)),this.modules. i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFo rmat.init(this)),this.translator=new C(this.services,this.options),this.translat or.on("*",function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n; i++)o[i-1]=arguments[i];t.emit.apply(t,[e].concat(o))}),this.modules.external.fo rEach(function(e){e.init&&e.init(t)})}this.services.languageDetector||this.optio ns.lng||this.logger.warn("init: no languageDetector is used and no lng is define d");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"]. forEach(function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments )}});["addResource","addResources","addResourceBundle","removeResourceBundle"].f orEach(function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments) ,t}});var u=h(),l=function(){t.changeLanguage(t.options.lng,function(e,n){t.isIn itialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("in itialized",t.options),u.resolve(n),i(e,n)})};return this.options.resources||!thi s.options.initImmediate?l():setTimeout(l,0),u}},{key:"loadResources",value:funct ion(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,o=" string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.r esources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase() )return n();var i=[],r=function(e){e&&t.services.languageUtils.toResolveHierarch y(e).forEach(function(e){i.indexOf(e)<0&&i.push(e)})};if(o)r(o);else this.servic es.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){ return r(e)});this.options.preload&&this.options.preload.forEach(function(e){ret urn r(e)}),this.services.backendConnector.load(i,this.options.ns,n)}else n(null) }},{key:"reloadResources",value:function(e,t,n){var o=h();return e||(e=this.lang uages),t||(t=this.options.ns),n||(n=U),this.services.backendConnector.reload(e,t ,function(e){o.resolve(),n(e)}),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are pas sing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong modu le! Please check the object you are passing to i18next.use()");return"backend"== =e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&( this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetect or=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.typ e&&O.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this }},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingT o=e;var o=h();this.emit("languageChanging",e);var i=function(e){var i="string"== typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n. language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.transla tor.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.serv ices.languageDetector.cacheUserLanguage(i)),n.loadResources(i,function(e){!funct ion(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy (i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languag eChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,o. resolve(function(){return n.t.apply(n,arguments)}),t&&t(e,function(){return n.t. apply(n,arguments)})}(e,i)})};return e||!this.services.languageDetector||this.se rvices.languageDetector.async?!e&&this.services.languageDetector&&this.services. languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.serv ices.languageDetector.detect()),o}},{key:"getFixedT",value:function(t,o){var i=t his,r=function t(o,r){var a;if("object"!==e(r)){for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];a=i.options.overloadTranslatio nOptionHandler([o,r].concat(u))}else a=n({},r);return a.lng=a.lng||t.lng,a.lngs= a.lngs||t.lngs,a.ns=a.ns||t.ns,i.t(o,a)};return"string"==typeof t?r.lng=t:r.lngs =t,r.ns=o,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.tr anslator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;re turn this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setD efaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNam espace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1] ?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamesp ace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.l anguages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],i=!!this.options &&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode" ===o.toLowerCase())return!0;var a=function(e,n){var o=t.services.backendConnecto r.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var s=n. precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(o,e)||(!t his.services.backendConnector.backend||!(!a(o,e)||i&&!a(r,e)))}},{key:"loadNames paces",value:function(e,t){var n=this,o=h();return this.options.ns?("string"==ty peof e&&(e=[e]),e.forEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.pu sh(e)}),this.loadResources(function(e){o.resolve(),t&&t(e)}),o):(t&&t(),Promise. resolve())}},{key:"loadLanguages",value:function(e,t){var n=h();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter(function(e){return o.index Of(e)<0});return i.length?(this.options.preload=o.concat(i),this.loadResources(f unction(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"dir",valu e:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0] :this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud"," aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","aj p","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"].index Of(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key :"createInstance",value:function(){return new i(arguments.length>0&&void 0!==arg uments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneI nstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0] ?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,r=n( {},this.options,t,{isClone:!0}),a=new i(r);return["store","services","language"] .forEach(function(t){a[t]=e[t]}),a.services=n({},this.services),a.services.utils ={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new C(a.services ,a.options),a.translator.on("*",function(e){for(var t=arguments.length,n=new Arr ay(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];a.emit.apply(a,[e].concat(n))}),a. init(r,o),a.translator.options=a.options,a.translator.backendConnector.services. utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}}]),i}())});
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)