UNPKG

svgedit

Version:

Powerful SVG-Editor for your browser

1 lines 2.24 MB
function _mergeNamespaces(eo,to){return to.forEach((function(to){to&&"string"!=typeof to&&!Array.isArray(to)&&Object.keys(to).forEach((function(oo){if("default"!==oo&&!(oo in eo)){var no=Object.getOwnPropertyDescriptor(to,oo);Object.defineProperty(eo,oo,no.get?no:{enumerable:!0,get:function(){return to[oo]}})}}))})),Object.freeze(eo)}function _typeof$1(eo){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(eo){return typeof eo}:function _typeof(eo){return eo&&"function"==typeof Symbol&&eo.constructor===Symbol&&eo!==Symbol.prototype?"symbol":typeof eo})(eo)}function _defineProperty(eo,to,oo){return to in eo?Object.defineProperty(eo,to,{value:oo,enumerable:!0,configurable:!0,writable:!0}):eo[to]=oo,eo}function _objectSpread$3(eo){for(var to=1;to<arguments.length;to++){var oo=null!=arguments[to]?Object(arguments[to]):{},no=Object.keys(oo);"function"==typeof Object.getOwnPropertySymbols&&no.push.apply(no,Object.getOwnPropertySymbols(oo).filter((function(eo){return Object.getOwnPropertyDescriptor(oo,eo).enumerable}))),no.forEach((function(to){_defineProperty(eo,to,oo[to])}))}return eo}function _classCallCheck$1(eo,to){if(!(eo instanceof to))throw new TypeError("Cannot call a class as a function")}function _defineProperties(eo,to){for(var oo=0;oo<to.length;oo++){var no=to[oo];no.enumerable=no.enumerable||!1,no.configurable=!0,"value"in no&&(no.writable=!0),Object.defineProperty(eo,no.key,no)}}function _createClass(eo,to,oo){return to&&_defineProperties(eo.prototype,to),oo&&_defineProperties(eo,oo),eo}function _assertThisInitialized(eo){if(void 0===eo)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return eo}function _possibleConstructorReturn(eo,to){if(to&&("object"===_typeof$1(to)||"function"==typeof to))return to;if(void 0!==to)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(eo)}function _getPrototypeOf(eo){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(eo){return eo.__proto__||Object.getPrototypeOf(eo)})(eo)}function _setPrototypeOf(eo,to){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(eo,to){return eo.__proto__=to,eo})(eo,to)}function _inherits(eo,to){if("function"!=typeof to&&null!==to)throw new TypeError("Super expression must either be null or a function");eo.prototype=Object.create(to&&to.prototype,{constructor:{value:eo,writable:!0,configurable:!0}}),to&&_setPrototypeOf(eo,to)}function _arrayLikeToArray(eo,to){(null==to||to>eo.length)&&(to=eo.length);for(var oo=0,no=new Array(to);oo<to;oo++)no[oo]=eo[oo];return no}function _slicedToArray(eo,to){return function _arrayWithHoles(eo){if(Array.isArray(eo))return eo}(eo)||function _iterableToArrayLimit(eo,to){var oo=null==eo?null:"undefined"!=typeof Symbol&&eo[Symbol.iterator]||eo["@@iterator"];if(null!=oo){var no,ro,io=[],ao=!0,so=!1;try{for(oo=oo.call(eo);!(ao=(no=oo.next()).done)&&(io.push(no.value),!to||io.length!==to);ao=!0);}catch(eo){so=!0,ro=eo}finally{try{ao||null==oo.return||oo.return()}finally{if(so)throw ro}}return io}}(eo,to)||function _unsupportedIterableToArray(eo,to){if(eo){if("string"==typeof eo)return _arrayLikeToArray(eo,to);var oo=Object.prototype.toString.call(eo).slice(8,-1);return"Object"===oo&&eo.constructor&&(oo=eo.constructor.name),"Map"===oo||"Set"===oo?Array.from(eo):"Arguments"===oo||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oo)?_arrayLikeToArray(eo,to):void 0}}(eo,to)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eo={type:"logger",log:function log(eo){this.output("log",eo)},warn:function warn(eo){this.output("warn",eo)},error:function error(eo){this.output("error",eo)},output:function output(eo,to){console&&console[eo]&&console[eo].apply(console,to)}},to=new(function(){function Logger(eo){var to=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck$1(this,Logger),this.init(eo,to)}return _createClass(Logger,[{key:"init",value:function init(to){var oo=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=oo.prefix||"i18next:",this.logger=to||eo,this.options=oo,this.debug=oo.debug}},{key:"setDebug",value:function setDebug(eo){this.debug=eo}},{key:"log",value:function log(){for(var eo=arguments.length,to=new Array(eo),oo=0;oo<eo;oo++)to[oo]=arguments[oo];return this.forward(to,"log","",!0)}},{key:"warn",value:function warn(){for(var eo=arguments.length,to=new Array(eo),oo=0;oo<eo;oo++)to[oo]=arguments[oo];return this.forward(to,"warn","",!0)}},{key:"error",value:function error(){for(var eo=arguments.length,to=new Array(eo),oo=0;oo<eo;oo++)to[oo]=arguments[oo];return this.forward(to,"error","")}},{key:"deprecate",value:function deprecate(){for(var eo=arguments.length,to=new Array(eo),oo=0;oo<eo;oo++)to[oo]=arguments[oo];return this.forward(to,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function forward(eo,to,oo,no){return no&&!this.debug?null:("string"==typeof eo[0]&&(eo[0]="".concat(oo).concat(this.prefix," ").concat(eo[0])),this.logger[to](eo))}},{key:"create",value:function create(eo){return new Logger(this.logger,_objectSpread$3({},{prefix:"".concat(this.prefix,":").concat(eo,":")},this.options))}}]),Logger}()),oo=function(){function EventEmitter(){_classCallCheck$1(this,EventEmitter),this.observers={}}return _createClass(EventEmitter,[{key:"on",value:function on(eo,to){var oo=this;return eo.split(" ").forEach((function(eo){oo.observers[eo]=oo.observers[eo]||[],oo.observers[eo].push(to)})),this}},{key:"off",value:function off(eo,to){this.observers[eo]&&(to?this.observers[eo]=this.observers[eo].filter((function(eo){return eo!==to})):delete this.observers[eo])}},{key:"emit",value:function emit(eo){for(var to=arguments.length,oo=new Array(to>1?to-1:0),no=1;no<to;no++)oo[no-1]=arguments[no];if(this.observers[eo]){var ro=[].concat(this.observers[eo]);ro.forEach((function(eo){eo.apply(void 0,oo)}))}if(this.observers["*"]){var io=[].concat(this.observers["*"]);io.forEach((function(to){to.apply(to,[eo].concat(oo))}))}}}]),EventEmitter}();function defer(){var eo,to,oo=new Promise((function(oo,no){eo=oo,to=no}));return oo.resolve=eo,oo.reject=to,oo}function makeString(eo){return null==eo?"":""+eo}function copy(eo,to,oo){eo.forEach((function(eo){to[eo]&&(oo[eo]=to[eo])}))}function getLastOfPath(eo,to,oo){function cleanKey(eo){return eo&&eo.indexOf("###")>-1?eo.replace(/###/g,"."):eo}function canNotTraverseDeeper(){return!eo||"string"==typeof eo}for(var no="string"!=typeof to?[].concat(to):to.split(".");no.length>1;){if(canNotTraverseDeeper())return{};var ro=cleanKey(no.shift());!eo[ro]&&oo&&(eo[ro]=new oo),eo=Object.prototype.hasOwnProperty.call(eo,ro)?eo[ro]:{}}return canNotTraverseDeeper()?{}:{obj:eo,k:cleanKey(no.shift())}}function setPath(eo,to,oo){var no=getLastOfPath(eo,to,Object);no.obj[no.k]=oo}function getPath(eo,to){var oo=getLastOfPath(eo,to),no=oo.obj,ro=oo.k;if(no)return no[ro]}function getPathWithDefaults(eo,to,oo){var no=getPath(eo,oo);return void 0!==no?no:getPath(to,oo)}function deepExtend(eo,to,oo){for(var no in to)"__proto__"!==no&&"constructor"!==no&&(no in eo?"string"==typeof eo[no]||eo[no]instanceof String||"string"==typeof to[no]||to[no]instanceof String?oo&&(eo[no]=to[no]):deepExtend(eo[no],to[no],oo):eo[no]=to[no]);return eo}function regexEscape$1(eo){return eo.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var no={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escape$1(eo){return"string"==typeof eo?eo.replace(/[&<>"'\/]/g,(function(eo){return no[eo]})):eo}var ro="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,io=[" ",",","?","!",";"];function deepFind(eo,to){var oo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(eo){if(eo[to])return eo[to];for(var no=to.split(oo),ro=eo,io=0;io<no.length;++io){if(!ro)return;if("string"==typeof ro[no[io]]&&io+1<no.length)return;if(void 0===ro[no[io]]){for(var ao=2,so=no.slice(io,io+ao).join(oo),lo=ro[so];void 0===lo&&no.length>io+ao;)ao++,lo=ro[so=no.slice(io,io+ao).join(oo)];if(void 0===lo)return;if("string"==typeof lo)return lo;if(so&&"string"==typeof lo[so])return lo[so];var Ao=no.slice(io+ao).join(oo);return Ao?deepFind(lo,Ao,oo):void 0}ro=ro[no[io]]}return ro}}var ao=function(eo){function ResourceStore(eo){var to,no=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck$1(this,ResourceStore),to=_possibleConstructorReturn(this,_getPrototypeOf(ResourceStore).call(this)),ro&&oo.call(_assertThisInitialized(to)),to.data=eo||{},to.options=no,void 0===to.options.keySeparator&&(to.options.keySeparator="."),void 0===to.options.ignoreJSONStructure&&(to.options.ignoreJSONStructure=!0),to}return _inherits(ResourceStore,oo),_createClass(ResourceStore,[{key:"addNamespaces",value:function addNamespaces(eo){this.options.ns.indexOf(eo)<0&&this.options.ns.push(eo)}},{key:"removeNamespaces",value:function removeNamespaces(eo){var to=this.options.ns.indexOf(eo);to>-1&&this.options.ns.splice(to,1)}},{key:"getResource",value:function getResource(eo,to,oo){var no=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},ro=void 0!==no.keySeparator?no.keySeparator:this.options.keySeparator,io=void 0!==no.ignoreJSONStructure?no.ignoreJSONStructure:this.options.ignoreJSONStructure,ao=[eo,to];oo&&"string"!=typeof oo&&(ao=ao.concat(oo)),oo&&"string"==typeof oo&&(ao=ao.concat(ro?oo.split(ro):oo)),eo.indexOf(".")>-1&&(ao=eo.split("."));var so=getPath(this.data,ao);return so||!io||"string"!=typeof oo?so:deepFind(this.data&&this.data[eo]&&this.data[eo][to],oo,ro)}},{key:"addResource",value:function addResource(eo,to,oo,no){var ro=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},io=this.options.keySeparator;void 0===io&&(io=".");var ao=[eo,to];oo&&(ao=ao.concat(io?oo.split(io):oo)),eo.indexOf(".")>-1&&(no=to,to=(ao=eo.split("."))[1]),this.addNamespaces(to),setPath(this.data,ao,no),ro.silent||this.emit("added",eo,to,oo,no)}},{key:"addResources",value:function addResources(eo,to,oo){var no=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var ro in oo)"string"!=typeof oo[ro]&&"[object Array]"!==Object.prototype.toString.apply(oo[ro])||this.addResource(eo,to,ro,oo[ro],{silent:!0});no.silent||this.emit("added",eo,to,oo)}},{key:"addResourceBundle",value:function addResourceBundle(eo,to,oo,no,ro){var io=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},ao=[eo,to];eo.indexOf(".")>-1&&(no=oo,oo=to,to=(ao=eo.split("."))[1]),this.addNamespaces(to);var so=getPath(this.data,ao)||{};no?deepExtend(so,oo,ro):so=_objectSpread$3({},so,oo),setPath(this.data,ao,so),io.silent||this.emit("added",eo,to,oo)}},{key:"removeResourceBundle",value:function removeResourceBundle(eo,to){this.hasResourceBundle(eo,to)&&delete this.data[eo][to],this.removeNamespaces(to),this.emit("removed",eo,to)}},{key:"hasResourceBundle",value:function hasResourceBundle(eo,to){return void 0!==this.getResource(eo,to)}},{key:"getResourceBundle",value:function getResourceBundle(eo,to){return to||(to=this.options.defaultNS),"v1"===this.options.compatibilityAPI?_objectSpread$3({},{},this.getResource(eo,to)):this.getResource(eo,to)}},{key:"getDataByLanguage",value:function getDataByLanguage(eo){return this.data[eo]}},{key:"hasLanguageSomeTranslations",value:function hasLanguageSomeTranslations(eo){var to=this.getDataByLanguage(eo);return!!(to&&Object.keys(to)||[]).find((function(eo){return to[eo]&&Object.keys(to[eo]).length>0}))}},{key:"toJSON",value:function toJSON(){return this.data}}]),ResourceStore}(),so={processors:{},addPostProcessor:function addPostProcessor(eo){this.processors[eo.name]=eo},handle:function handle(eo,to,oo,no,ro){var io=this;return eo.forEach((function(eo){io.processors[eo]&&(to=io.processors[eo].process(to,oo,no,ro))})),to}},lo={},Ao=function(eo){function Translator(eo){var no,io=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck$1(this,Translator),no=_possibleConstructorReturn(this,_getPrototypeOf(Translator).call(this)),ro&&oo.call(_assertThisInitialized(no)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],eo,_assertThisInitialized(no)),no.options=io,void 0===no.options.keySeparator&&(no.options.keySeparator="."),no.logger=to.create("translator"),no}return _inherits(Translator,oo),_createClass(Translator,[{key:"changeLanguage",value:function changeLanguage(eo){eo&&(this.language=eo)}},{key:"exists",value:function exists(eo){var to=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==eo)return!1;var oo=this.resolve(eo,to);return oo&&void 0!==oo.res}},{key:"extractFromKey",value:function extractFromKey(eo,to){var oo=void 0!==to.nsSeparator?to.nsSeparator:this.options.nsSeparator;void 0===oo&&(oo=":");var no=void 0!==to.keySeparator?to.keySeparator:this.options.keySeparator,ro=to.ns||this.options.defaultNS,ao=oo&&eo.indexOf(oo)>-1,so=!(this.options.userDefinedKeySeparator||to.keySeparator||this.options.userDefinedNsSeparator||to.nsSeparator||function looksLikeObjectPath(eo,to,oo){to=to||"",oo=oo||"";var no=io.filter((function(eo){return to.indexOf(eo)<0&&oo.indexOf(eo)<0}));if(0===no.length)return!0;var ro=new RegExp("(".concat(no.map((function(eo){return"?"===eo?"\\?":eo})).join("|"),")")),ao=!ro.test(eo);if(!ao){var so=eo.indexOf(oo);so>0&&!ro.test(eo.substring(0,so))&&(ao=!0)}return ao}(eo,oo,no));if(ao&&!so){var lo=eo.match(this.interpolator.nestingRegexp);if(lo&&lo.length>0)return{key:eo,namespaces:ro};var Ao=eo.split(oo);(oo!==no||oo===no&&this.options.ns.indexOf(Ao[0])>-1)&&(ro=Ao.shift()),eo=Ao.join(no)}return"string"==typeof ro&&(ro=[ro]),{key:eo,namespaces:ro}}},{key:"translate",value:function translate(eo,to,oo){var no=this;if("object"!==_typeof$1(to)&&this.options.overloadTranslationOptionHandler&&(to=this.options.overloadTranslationOptionHandler(arguments)),to||(to={}),null==eo)return"";Array.isArray(eo)||(eo=[String(eo)]);var ro=void 0!==to.keySeparator?to.keySeparator:this.options.keySeparator,io=this.extractFromKey(eo[eo.length-1],to),ao=io.key,so=io.namespaces,lo=so[so.length-1],Ao=to.lng||this.language,co=to.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(Ao&&"cimode"===Ao.toLowerCase()){if(co){var uo=to.nsSeparator||this.options.nsSeparator;return lo+uo+ao}return ao}var po=this.resolve(eo,to),ho=po&&po.res,go=po&&po.usedKey||ao,_o=po&&po.exactUsedKey||ao,mo=Object.prototype.toString.apply(ho),fo=["[object Number]","[object Function]","[object RegExp]"],yo=void 0!==to.joinArrays?to.joinArrays:this.options.joinArrays,bo=!this.i18nFormat||this.i18nFormat.handleAsObject,vo="string"!=typeof ho&&"boolean"!=typeof ho&&"number"!=typeof ho;if(bo&&ho&&vo&&fo.indexOf(mo)<0&&("string"!=typeof yo||"[object Array]"!==mo)){if(!to.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(go,ho,_objectSpread$3({},to,{ns:so})):"key '".concat(ao," (").concat(this.language,")' returned an object instead of string.");if(ro){var wo="[object Array]"===mo,xo=wo?[]:{},Co=wo?_o:go;for(var ko in ho)if(Object.prototype.hasOwnProperty.call(ho,ko)){var So="".concat(Co).concat(ro).concat(ko);xo[ko]=this.translate(So,_objectSpread$3({},to,{joinArrays:!1,ns:so})),xo[ko]===So&&(xo[ko]=ho[ko])}ho=xo}}else if(bo&&"string"==typeof yo&&"[object Array]"===mo)(ho=ho.join(yo))&&(ho=this.extendTranslation(ho,eo,to,oo));else{var Bo=!1,Eo=!1,Lo=void 0!==to.count&&"string"!=typeof to.count,Po=Translator.hasDefaultValue(to),jo=Lo?this.pluralResolver.getSuffix(Ao,to.count,to):"",To=to["defaultValue".concat(jo)]||to.defaultValue;!this.isValidLookup(ho)&&Po&&(Bo=!0,ho=To),this.isValidLookup(ho)||(Eo=!0,ho=ao);var Fo=to.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Io=Fo&&Eo?void 0:ho,No=Po&&To!==ho&&this.options.updateMissing;if(Eo||Bo||No){if(this.logger.log(No?"updateKey":"missingKey",Ao,lo,ao,No?To:ho),ro){var Uo=this.resolve(ao,_objectSpread$3({},to,{keySeparator:!1}));Uo&&Uo.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 Mo=[],Ro=this.languageUtils.getFallbackCodes(this.options.fallbackLng,to.lng||this.language);if("fallback"===this.options.saveMissingTo&&Ro&&Ro[0])for(var Oo=0;Oo<Ro.length;Oo++)Mo.push(Ro[Oo]);else"all"===this.options.saveMissingTo?Mo=this.languageUtils.toResolveHierarchy(to.lng||this.language):Mo.push(to.lng||this.language);var Qo=function send(eo,oo,ro){no.options.missingKeyHandler?no.options.missingKeyHandler(eo,lo,oo,No?ro:Io,No,to):no.backendConnector&&no.backendConnector.saveMissing&&no.backendConnector.saveMissing(eo,lo,oo,No?ro:Io,No,to),no.emit("missingKey",eo,lo,oo,ho)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Lo?Mo.forEach((function(eo){no.pluralResolver.getSuffixes(eo).forEach((function(oo){Qo([eo],ao+oo,to["defaultValue".concat(oo)]||To)}))})):Qo(Mo,ao,To))}ho=this.extendTranslation(ho,eo,to,po,oo),Eo&&ho===ao&&this.options.appendNamespaceToMissingKey&&(ho="".concat(lo,":").concat(ao)),(Eo||Bo)&&this.options.parseMissingKeyHandler&&(ho=this.options.parseMissingKeyHandler(ho))}return ho}},{key:"extendTranslation",value:function extendTranslation(eo,to,oo,no,ro){var io=this;if(this.i18nFormat&&this.i18nFormat.parse)eo=this.i18nFormat.parse(eo,oo,no.usedLng,no.usedNS,no.usedKey,{resolved:no});else if(!oo.skipInterpolation){oo.interpolation&&this.interpolator.init(_objectSpread$3({},oo,{interpolation:_objectSpread$3({},this.options.interpolation,oo.interpolation)}));var ao,lo=oo.interpolation&&oo.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(lo){var Ao=eo.match(this.interpolator.nestingRegexp);ao=Ao&&Ao.length}var co=oo.replace&&"string"!=typeof oo.replace?oo.replace:oo;if(this.options.interpolation.defaultVariables&&(co=_objectSpread$3({},this.options.interpolation.defaultVariables,co)),eo=this.interpolator.interpolate(eo,co,oo.lng||this.language,oo),lo){var uo=eo.match(this.interpolator.nestingRegexp);ao<(uo&&uo.length)&&(oo.nest=!1)}!1!==oo.nest&&(eo=this.interpolator.nest(eo,(function(){for(var eo=arguments.length,no=new Array(eo),ao=0;ao<eo;ao++)no[ao]=arguments[ao];return ro&&ro[0]===no[0]&&!oo.context?(io.logger.warn("It seems you are nesting recursively key: ".concat(no[0]," in key: ").concat(to[0])),null):io.translate.apply(io,no.concat([to]))}),oo)),oo.interpolation&&this.interpolator.reset()}var po=oo.postProcess||this.options.postProcess,ho="string"==typeof po?[po]:po;return null!=eo&&ho&&ho.length&&!1!==oo.applyPostProcessor&&(eo=so.handle(ho,eo,to,this.options&&this.options.postProcessPassResolved?_objectSpread$3({i18nResolved:no},oo):oo,this)),eo}},{key:"resolve",value:function resolve(eo){var to,oo,no,ro,io,ao=this,so=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof eo&&(eo=[eo]),eo.forEach((function(eo){if(!ao.isValidLookup(to)){var Ao=ao.extractFromKey(eo,so),co=Ao.key;oo=co;var uo=Ao.namespaces;ao.options.fallbackNS&&(uo=uo.concat(ao.options.fallbackNS));var po=void 0!==so.count&&"string"!=typeof so.count,ho=void 0!==so.context&&("string"==typeof so.context||"number"==typeof so.context)&&""!==so.context,go=so.lngs?so.lngs:ao.languageUtils.toResolveHierarchy(so.lng||ao.language,so.fallbackLng);uo.forEach((function(eo){ao.isValidLookup(to)||(io=eo,!lo["".concat(go[0],"-").concat(eo)]&&ao.utils&&ao.utils.hasLoadedNamespace&&!ao.utils.hasLoadedNamespace(io)&&(lo["".concat(go[0],"-").concat(eo)]=!0,ao.logger.warn('key "'.concat(oo,'" for languages "').concat(go.join(", "),'" won\'t get resolved as namespace "').concat(io,'" 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!!!")),go.forEach((function(oo){if(!ao.isValidLookup(to)){ro=oo;var io,lo,Ao=co,uo=[Ao];if(ao.i18nFormat&&ao.i18nFormat.addLookupKeys)ao.i18nFormat.addLookupKeys(uo,co,oo,eo,so);else po&&(io=ao.pluralResolver.getSuffix(oo,so.count,so)),po&&ho&&uo.push(Ao+io),ho&&uo.push(Ao+="".concat(ao.options.contextSeparator).concat(so.context)),po&&uo.push(Ao+=io);for(;lo=uo.pop();)ao.isValidLookup(to)||(no=lo,to=ao.getResource(oo,eo,lo,so))}})))}))}})),{res:to,usedKey:oo,exactUsedKey:no,usedLng:ro,usedNS:io}}},{key:"isValidLookup",value:function isValidLookup(eo){return!(void 0===eo||!this.options.returnNull&&null===eo||!this.options.returnEmptyString&&""===eo)}},{key:"getResource",value:function getResource(eo,to,oo){var no=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(eo,to,oo,no):this.resourceStore.getResource(eo,to,oo,no)}}],[{key:"hasDefaultValue",value:function hasDefaultValue(eo){var to="defaultValue";for(var oo in eo)if(Object.prototype.hasOwnProperty.call(eo,oo)&&to===oo.substring(0,to.length)&&void 0!==eo[oo])return!0;return!1}}]),Translator}();function capitalize(eo){return eo.charAt(0).toUpperCase()+eo.slice(1)}var co=function(){function LanguageUtil(eo){_classCallCheck$1(this,LanguageUtil),this.options=eo,this.supportedLngs=this.options.supportedLngs||!1,this.logger=to.create("languageUtils")}return _createClass(LanguageUtil,[{key:"getScriptPartFromCode",value:function getScriptPartFromCode(eo){if(!eo||eo.indexOf("-")<0)return null;var to=eo.split("-");return 2===to.length?null:(to.pop(),"x"===to[to.length-1].toLowerCase()?null:this.formatLanguageCode(to.join("-")))}},{key:"getLanguagePartFromCode",value:function getLanguagePartFromCode(eo){if(!eo||eo.indexOf("-")<0)return eo;var to=eo.split("-");return this.formatLanguageCode(to[0])}},{key:"formatLanguageCode",value:function formatLanguageCode(eo){if("string"==typeof eo&&eo.indexOf("-")>-1){var to=["hans","hant","latn","cyrl","cans","mong","arab"],oo=eo.split("-");return this.options.lowerCaseLng?oo=oo.map((function(eo){return eo.toLowerCase()})):2===oo.length?(oo[0]=oo[0].toLowerCase(),oo[1]=oo[1].toUpperCase(),to.indexOf(oo[1].toLowerCase())>-1&&(oo[1]=capitalize(oo[1].toLowerCase()))):3===oo.length&&(oo[0]=oo[0].toLowerCase(),2===oo[1].length&&(oo[1]=oo[1].toUpperCase()),"sgn"!==oo[0]&&2===oo[2].length&&(oo[2]=oo[2].toUpperCase()),to.indexOf(oo[1].toLowerCase())>-1&&(oo[1]=capitalize(oo[1].toLowerCase())),to.indexOf(oo[2].toLowerCase())>-1&&(oo[2]=capitalize(oo[2].toLowerCase()))),oo.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?eo.toLowerCase():eo}},{key:"isSupportedCode",value:function isSupportedCode(eo){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(eo=this.getLanguagePartFromCode(eo)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(eo)>-1}},{key:"getBestMatchFromCodes",value:function getBestMatchFromCodes(eo){var to,oo=this;return eo?(eo.forEach((function(eo){if(!to){var no=oo.formatLanguageCode(eo);oo.options.supportedLngs&&!oo.isSupportedCode(no)||(to=no)}})),!to&&this.options.supportedLngs&&eo.forEach((function(eo){if(!to){var no=oo.getLanguagePartFromCode(eo);if(oo.isSupportedCode(no))return to=no;to=oo.options.supportedLngs.find((function(eo){if(0===eo.indexOf(no))return eo}))}})),to||(to=this.getFallbackCodes(this.options.fallbackLng)[0]),to):null}},{key:"getFallbackCodes",value:function getFallbackCodes(eo,to){if(!eo)return[];if("function"==typeof eo&&(eo=eo(to)),"string"==typeof eo&&(eo=[eo]),"[object Array]"===Object.prototype.toString.apply(eo))return eo;if(!to)return eo.default||[];var oo=eo[to];return oo||(oo=eo[this.getScriptPartFromCode(to)]),oo||(oo=eo[this.formatLanguageCode(to)]),oo||(oo=eo[this.getLanguagePartFromCode(to)]),oo||(oo=eo.default),oo||[]}},{key:"toResolveHierarchy",value:function toResolveHierarchy(eo,to){var oo=this,no=this.getFallbackCodes(to||this.options.fallbackLng||[],eo),ro=[],io=function addCode(eo){eo&&(oo.isSupportedCode(eo)?ro.push(eo):oo.logger.warn("rejecting language code not found in supportedLngs: ".concat(eo)))};return"string"==typeof eo&&eo.indexOf("-")>-1?("languageOnly"!==this.options.load&&io(this.formatLanguageCode(eo)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&io(this.getScriptPartFromCode(eo)),"currentOnly"!==this.options.load&&io(this.getLanguagePartFromCode(eo))):"string"==typeof eo&&io(this.formatLanguageCode(eo)),no.forEach((function(eo){ro.indexOf(eo)<0&&io(oo.formatLanguageCode(eo))})),ro}}]),LanguageUtil}(),uo=[{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","kk","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","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}],po={1:function _(eo){return Number(eo>1)},2:function _(eo){return Number(1!=eo)},3:function _(eo){return 0},4:function _(eo){return Number(eo%10==1&&eo%100!=11?0:eo%10>=2&&eo%10<=4&&(eo%100<10||eo%100>=20)?1:2)},5:function _(eo){return Number(0==eo?0:1==eo?1:2==eo?2:eo%100>=3&&eo%100<=10?3:eo%100>=11?4:5)},6:function _(eo){return Number(1==eo?0:eo>=2&&eo<=4?1:2)},7:function _(eo){return Number(1==eo?0:eo%10>=2&&eo%10<=4&&(eo%100<10||eo%100>=20)?1:2)},8:function _(eo){return Number(1==eo?0:2==eo?1:8!=eo&&11!=eo?2:3)},9:function _(eo){return Number(eo>=2)},10:function _(eo){return Number(1==eo?0:2==eo?1:eo<7?2:eo<11?3:4)},11:function _(eo){return Number(1==eo||11==eo?0:2==eo||12==eo?1:eo>2&&eo<20?2:3)},12:function _(eo){return Number(eo%10!=1||eo%100==11)},13:function _(eo){return Number(0!==eo)},14:function _(eo){return Number(1==eo?0:2==eo?1:3==eo?2:3)},15:function _(eo){return Number(eo%10==1&&eo%100!=11?0:eo%10>=2&&(eo%100<10||eo%100>=20)?1:2)},16:function _(eo){return Number(eo%10==1&&eo%100!=11?0:0!==eo?1:2)},17:function _(eo){return Number(1==eo||eo%10==1&&eo%100!=11?0:1)},18:function _(eo){return Number(0==eo?0:1==eo?1:2)},19:function _(eo){return Number(1==eo?0:0==eo||eo%100>1&&eo%100<11?1:eo%100>10&&eo%100<20?2:3)},20:function _(eo){return Number(1==eo?0:0==eo||eo%100>0&&eo%100<20?1:2)},21:function _(eo){return Number(eo%100==1?1:eo%100==2?2:eo%100==3||eo%100==4?3:0)},22:function _(eo){return Number(1==eo?0:2==eo?1:(eo<0||eo>10)&&eo%10==0?2:3)}},ho=["v1","v2","v3"],go={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var eo={};return uo.forEach((function(to){to.lngs.forEach((function(oo){eo[oo]={numbers:to.nr,plurals:po[to.fc]}}))})),eo}var _o=function(){function PluralResolver(eo){var oo=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck$1(this,PluralResolver),this.languageUtils=eo,this.options=oo,this.logger=to.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass(PluralResolver,[{key:"addRule",value:function addRule(eo,to){this.rules[eo]=to}},{key:"getRule",value:function getRule(eo){var to=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(eo,{type:to.ordinal?"ordinal":"cardinal"})}catch(eo){return}return this.rules[eo]||this.rules[this.languageUtils.getLanguagePartFromCode(eo)]}},{key:"needsPlural",value:function needsPlural(eo){var to=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},oo=this.getRule(eo,to);return this.shouldUseIntlApi()?oo&&oo.resolvedOptions().pluralCategories.length>1:oo&&oo.numbers.length>1}},{key:"getPluralFormsOfKey",value:function getPluralFormsOfKey(eo,to){var oo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(eo,oo).map((function(eo){return"".concat(to).concat(eo)}))}},{key:"getSuffixes",value:function getSuffixes(eo){var to=this,oo=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},no=this.getRule(eo,oo);return no?this.shouldUseIntlApi()?no.resolvedOptions().pluralCategories.sort((function(eo,to){return go[eo]-go[to]})).map((function(eo){return"".concat(to.options.prepend).concat(eo)})):no.numbers.map((function(no){return to.getSuffix(eo,no,oo)})):[]}},{key:"getSuffix",value:function getSuffix(eo,to){var oo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},no=this.getRule(eo,oo);return no?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(no.select(to)):this.getSuffixRetroCompatible(no,to):(this.logger.warn("no plural rule found for: ".concat(eo)),"")}},{key:"getSuffixRetroCompatible",value:function getSuffixRetroCompatible(eo,to){var oo=this,no=eo.noAbs?eo.plurals(to):eo.plurals(Math.abs(to)),ro=eo.numbers[no];this.options.simplifyPluralSuffix&&2===eo.numbers.length&&1===eo.numbers[0]&&(2===ro?ro="plural":1===ro&&(ro=""));var io=function returnSuffix(){return oo.options.prepend&&ro.toString()?oo.options.prepend+ro.toString():ro.toString()};return"v1"===this.options.compatibilityJSON?1===ro?"":"number"==typeof ro?"_plural_".concat(ro.toString()):io():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===eo.numbers.length&&1===eo.numbers[0]?io():this.options.prepend&&no.toString()?this.options.prepend+no.toString():no.toString()}},{key:"shouldUseIntlApi",value:function shouldUseIntlApi(){return!ho.includes(this.options.compatibilityJSON)}}]),PluralResolver}(),mo=function(){function Interpolator(){var eo=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck$1(this,Interpolator),this.logger=to.create("interpolator"),this.options=eo,this.format=eo.interpolation&&eo.interpolation.format||function(eo){return eo},this.init(eo)}return _createClass(Interpolator,[{key:"init",value:function init(){var eo=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eo.interpolation||(eo.interpolation={escapeValue:!0});var to=eo.interpolation;this.escape=void 0!==to.escape?to.escape:escape$1,this.escapeValue=void 0===to.escapeValue||to.escapeValue,this.useRawValueToEscape=void 0!==to.useRawValueToEscape&&to.useRawValueToEscape,this.prefix=to.prefix?regexEscape$1(to.prefix):to.prefixEscaped||"{{",this.suffix=to.suffix?regexEscape$1(to.suffix):to.suffixEscaped||"}}",this.formatSeparator=to.formatSeparator?to.formatSeparator:to.formatSeparator||",",this.unescapePrefix=to.unescapeSuffix?"":to.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":to.unescapeSuffix||"",this.nestingPrefix=to.nestingPrefix?regexEscape$1(to.nestingPrefix):to.nestingPrefixEscaped||regexEscape$1("$t("),this.nestingSuffix=to.nestingSuffix?regexEscape$1(to.nestingSuffix):to.nestingSuffixEscaped||regexEscape$1(")"),this.nestingOptionsSeparator=to.nestingOptionsSeparator?to.nestingOptionsSeparator:to.nestingOptionsSeparator||",",this.maxReplaces=to.maxReplaces?to.maxReplaces:1e3,this.alwaysFormat=void 0!==to.alwaysFormat&&to.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function reset(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function resetRegExp(){var eo="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(eo,"g");var to="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(to,"g");var oo="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(oo,"g")}},{key:"interpolate",value:function interpolate(eo,to,oo,no){var ro,io,ao,so=this,lo=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function regexSafe(eo){return eo.replace(/\$/g,"$$$$")}var Ao=function handleFormat(eo){if(eo.indexOf(so.formatSeparator)<0){var ro=getPathWithDefaults(to,lo,eo);return so.alwaysFormat?so.format(ro,void 0,oo,_objectSpread$3({},no,to,{interpolationkey:eo})):ro}var io=eo.split(so.formatSeparator),ao=io.shift().trim(),Ao=io.join(so.formatSeparator).trim();return so.format(getPathWithDefaults(to,lo,ao),Ao,oo,_objectSpread$3({},no,to,{interpolationkey:ao}))};this.resetRegExp();var co=no&&no.missingInterpolationHandler||this.options.missingInterpolationHandler,uo=no&&no.interpolation&&no.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function safeValue(eo){return regexSafe(eo)}},{regex:this.regexp,safeValue:function safeValue(eo){return so.escapeValue?regexSafe(so.escape(eo)):regexSafe(eo)}}].forEach((function(to){for(ao=0;ro=to.regex.exec(eo);){if(void 0===(io=Ao(ro[1].trim())))if("function"==typeof co){var oo=co(eo,ro,no);io="string"==typeof oo?oo:""}else{if(uo){io=ro[0];continue}so.logger.warn("missed to pass in variable ".concat(ro[1]," for interpolating ").concat(eo)),io=""}else"string"==typeof io||so.useRawValueToEscape||(io=makeString(io));var lo=to.safeValue(io);if(eo=eo.replace(ro[0],lo),uo?(to.regex.lastIndex+=lo.length,to.regex.lastIndex-=ro[0].length):to.regex.lastIndex=0,++ao>=so.maxReplaces)break}})),eo}},{key:"nest",value:function nest(eo,to){var oo,no,ro=this,io=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},ao=_objectSpread$3({},io);function handleHasOptions(eo,to){var oo=this.nestingOptionsSeparator;if(eo.indexOf(oo)<0)return eo;var no=eo.split(new RegExp("".concat(oo,"[ ]*{"))),ro="{".concat(no[1]);eo=no[0],ro=(ro=this.interpolate(ro,ao)).replace(/'/g,'"');try{ao=JSON.parse(ro),to&&(ao=_objectSpread$3({},to,ao))}catch(to){return this.logger.warn("failed parsing options string in nesting for key ".concat(eo),to),"".concat(eo).concat(oo).concat(ro)}return delete ao.defaultValue,eo}for(ao.applyPostProcessor=!1,delete ao.defaultValue;oo=this.nestingRegexp.exec(eo);){var so=[],lo=!1;if(-1!==oo[0].indexOf(this.formatSeparator)&&!/{.*}/.test(oo[1])){var Ao=oo[1].split(this.formatSeparator).map((function(eo){return eo.trim()}));oo[1]=Ao.shift(),so=Ao,lo=!0}if((no=to(handleHasOptions.call(this,oo[1].trim(),ao),ao))&&oo[0]===eo&&"string"!=typeof no)return no;"string"!=typeof no&&(no=makeString(no)),no||(this.logger.warn("missed to resolve ".concat(oo[1]," for nesting ").concat(eo)),no=""),lo&&(no=so.reduce((function(eo,to){return ro.format(eo,to,io.lng,_objectSpread$3({},io,{interpolationkey:oo[1].trim()}))}),no.trim())),eo=eo.replace(oo[0],no),this.regexp.lastIndex=0}return eo}}]),Interpolator}();var fo=function(){function Formatter(){var eo=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck$1(this,Formatter),this.logger=to.create("formatter"),this.options=eo,this.formats={number:function number(eo,to,oo){return new Intl.NumberFormat(to,oo).format(eo)},currency:function currency(eo,to,oo){return new Intl.NumberFormat(to,_objectSpread$3({},oo,{style:"currency"})).format(eo)},datetime:function datetime(eo,to,oo){return new Intl.DateTimeFormat(to,_objectSpread$3({},oo)).format(eo)},relativetime:function relativetime(eo,to,oo){return new Intl.RelativeTimeFormat(to,_objectSpread$3({},oo)).format(eo,oo.range||"day")},list:function list(eo,to,oo){return new Intl.ListFormat(to,_objectSpread$3({},oo)).format(eo)}},this.init(eo)}return _createClass(Formatter,[{key:"init",value:function init(eo){var to=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},oo=to.interpolation;this.formatSeparator=oo.formatSeparator?oo.formatSeparator:oo.formatSeparator||","}},{key:"add",value:function add(eo,to){this.formats[eo]=to}},{key:"format",value:function format(eo,to,oo,no){var ro=this;return to.split(this.formatSeparator).reduce((function(eo,to){var io=function parseFormatStr(eo){var to=eo.toLowerCase(),oo={};if(eo.indexOf("(")>-1){var no=eo.split("(");to=no[0].toLowerCase();var ro=no[1].substring(0,no[1].length-1);"currency"===to&&ro.indexOf(":")<0?oo.currency||(oo.currency=ro.trim()):"relativetime"===to&&ro.indexOf(":")<0?oo.range||(oo.range=ro.trim()):ro.split(";").forEach((function(eo){if(eo){var to=_slicedToArray(eo.split(":"),2),no=to[0],ro=to[1];"false"===ro.trim()&&(oo[no.trim()]=!1),"true"===ro.trim()&&(oo[no.trim()]=!0),isNaN(ro.trim())||(oo[no.trim()]=parseInt(ro.trim(),10)),oo[no.trim()]||(oo[no.trim()]=ro.trim())}}))}return{formatName:to,formatOptions:oo}}(to),ao=io.formatName,so=io.formatOptions;if(ro.formats[ao]){var lo=eo;try{var Ao=no&&no.formatParams&&no.formatParams[no.interpolationkey]||{},co=Ao.locale||Ao.lng||no.locale||no.lng||oo;lo=ro.formats[ao](eo,co,_objectSpread$3({},so,no,Ao))}catch(eo){ro.logger.warn(eo)}return lo}return ro.logger.warn("there was no format function for ".concat(ao)),eo}),eo)}}]),Formatter}();var yo=function(eo){function Connector(eo,no,io){var ao,so=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _classCallCheck$1(this,Connector),ao=_possibleConstructorReturn(this,_getPrototypeOf(Connector).call(this)),ro&&oo.call(_assertThisInitialized(ao)),ao.backend=eo,ao.store=no,ao.services=io,ao.languageUtils=io.languageUtils,ao.options=so,ao.logger=to.create("backendConnector"),ao.state={},ao.queue=[],ao.backend&&ao.backend.init&&ao.backend.init(io,so.backend,so),ao}return _inherits(Connector,oo),_createClass(Connector,[{key:"queueLoad",value:function queueLoad(eo,to,oo,no){var ro=this,io=[],ao=[],so=[],lo=[];return eo.forEach((function(eo){var no=!0;to.forEach((function(to){var so="".concat(eo,"|").concat(to);!oo.reload&&ro.store.hasResourceBundle(eo,to)?ro.state[so]=2:ro.state[so]<0||(1===ro.state[so]?ao.indexOf(so)<0&&ao.push(so):(ro.state[so]=1,no=!1,ao.indexOf(so)<0&&ao.push(so),io.indexOf(so)<0&&io.push(so),lo.indexOf(to)<0&&lo.push(to)))})),no||so.push(eo)})),(io.length||ao.length)&&this.queue.push({pending:ao,loaded:{},errors:[],callback:no}),{toLoad:io,pending:ao,toLoadLanguages:so,toLoadNamespaces:lo}}},{key:"loaded",value:function loaded(eo,to,oo){var no=eo.split("|"),ro=no[0],io=no[1];to&&this.emit("failedLoading",ro,io,to),oo&&this.store.addResourceBundle(ro,io,oo),this.state[eo]=to?-1:2;var loaded={};this.queue.forEach((function(oo){!function pushPath(eo,to,oo,no){var ro=getLastOfPath(eo,to,Object),io=ro.obj,ao=ro.k;io[ao]=io[ao]||[],no&&(io[ao]=io[ao].concat(oo)),no||io[ao].push(oo)}(oo.loaded,[ro],io),function remove(eo,to){for(var oo=eo.indexOf(to);-1!==oo;)eo.splice(oo,1),oo=eo.indexOf(to)}(oo.pending,eo),to&&oo.errors.push(to),0!==oo.pending.length||oo.done||(Object.keys(oo.loaded).forEach((function(eo){loaded[eo]||(loaded[eo]=[]),oo.loaded[eo].length&&oo.loaded[eo].forEach((function(to){loaded[eo].indexOf(to)<0&&loaded[eo].push(to)}))})),oo.done=!0,oo.errors.length?oo.callback(oo.errors):oo.callback())})),this.emit("loaded",loaded),this.queue=this.queue.filter((function(eo){return!eo.done}))}},{key:"read",value:function read(eo,to,oo){var no=this,ro=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,io=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,ao=arguments.length>5?arguments[5]:void 0;return eo.length?this.backend[oo](eo,to,(function(so,lo){so&&lo&&ro<5?setTimeout((function(){no.read.call(no,eo,to,oo,ro+1,2*io,ao)}),io):ao(so,lo)})):ao(null,{})}},{key:"prepareLoading",value:function prepareLoading(eo,to){var oo=this,no=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},ro=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."),ro&&ro();"string"==typeof eo&&(eo=this.languageUtils.toResolveHierarchy(eo)),"string"==typeof to&&(to=[to]);var io=this.queueLoad(eo,to,no,ro);if(!io.toLoad.length)return io.pending.length||ro(),null;io.toLoad.forEach((function(eo){oo.loadOne(eo)}))}},{key:"load",value:function load(eo,to,oo){this.prepareLoading(eo,to,{},oo)}},{key:"reload",value:function reload(eo,to,oo){this.prepareLoading(eo,to,{reload:!0},oo)}},{key:"loadOne",value:function loadOne(eo){var to=this,oo=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",no=eo.split("|"),ro=no[0],io=no[1];this.read(ro,io,"read",void 0,void 0,(function(no,ao){no&&to.logger.warn("".concat(oo,"loading namespace ").concat(io," for language ").concat(ro," failed"),no),!no&&ao&&to.logger.log("".concat(oo,"loaded namespace ").concat(io," for language ").concat(ro),ao),to.loaded(eo,no,ao)}))}},{key:"saveMissing",value:function saveMissing(eo,to,oo,no,ro){var io=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(to)?this.logger.warn('did not save key "'.concat(oo,'" as the namespace "').concat(to,'" 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!!!"):null!=oo&&""!==oo&&(this.backend&&this.backend.create&&this.backend.create(eo,to,oo,no,null,_objectSpread$3({},io,{isUpdate:ro})),eo&&eo[0]&&this.store.addResource(eo[0],to,oo,no))}}]),Connector}();function get$1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function handle(eo){var to={};if("object"===_typeof$1(eo[1])&&(to=eo[1]),"string"==typeof eo[1]&&(to.defaultValue=eo[1]),"string"==typeof eo[2]&&(to.tDescription=eo[2]),"object"===_typeof$1(eo[2])||"object"===_typeof$1(eo[3])){var oo=eo[3]||eo[2];Object.keys(oo).forEach((function(eo){to[eo]=oo[eo]}))}return to},interpolation:{escapeValue:!0,format:function format(eo,to,oo,no){return eo},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(eo){return"string"==typeof eo.ns&&(eo.ns=[eo.ns]),"string"==typeof eo.fallbackLng&&(eo.fallbackLng=[eo.fallbackLng]),"string"==typeof eo.fallbackNS&&(eo.fallbackNS=[eo.fallbackNS]),eo.supportedLngs&&eo.supportedLngs.indexOf("cimode")<0&&(eo.supportedLngs=eo.supportedLngs.concat(["cimode"])),eo}function noop$1(){}function bindMemberFunctions(eo){Object.getOwnPropertyNames(Object.getPrototypeOf(eo)).forEach((function(to){"function"==typeof eo[to]&&(eo[to]=eo[to].bind(eo))}))}var bo=new(function(eo){function I18n(){var eo,no=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},io=arguments.length>1?arguments[1]:void 0;if(_classCallCheck$1(this,I18n),eo=_possibleConstructorReturn(this,_getPrototypeOf(I18n).call(this)),ro&&oo.call(_assertThisInitialized(eo)),eo.options=transformOptions(no),eo.services={},eo.logger=to,eo.modules={external:[]},bindMemberFunctions(_assertThisInitialized(eo)),io&&!eo.isInitialized&&!no.isClone){if(!eo.options.initImmediate)return eo.init(no,io),_possibleConstructorReturn(eo,_assertThisInitialized(eo));setTimeout((function(){eo.init(no,io)}),0)}return eo}return _inherits(I18n,oo),_createClass(I18n,[{key:"init",value:function init(){var eo=this,oo=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},no=arguments.length>1?arguments[1]:void 0;"function"==typeof oo&&(no=oo,oo={}),!oo.defaultNS&&oo.ns&&("string"==typeof oo.ns?oo.defaultNS=oo.ns:oo.ns.indexOf("translation")<0&&(oo.defaultNS=oo.ns[0]));var ro=get$1();function createClassOnDemand(eo){return eo?"function"==typeof eo?new eo:eo:null}if(this.options=_objectSpread$3({},ro,this.options,transformOptions(oo)),void 0!==oo.keySeparator&&(this.options.userDefinedKeySeparator=oo.keySeparator),void 0!==oo.nsSeparator&&(this.options.userDefinedNsSeparator=oo.nsSeparator),!this.options.isClone){var io;this.modules.logger?to.init(createClassOnDemand(this.modules.logger),this.options):to.init(null,this.options),this.modules.formatter?io=this.modules.formatter:"undefined"!=typeof Intl&&(io=fo);var so=new co(this.options);this.store=new ao(this.options.resources,this.options);var lo=this.services;lo.logger=to,lo.resourceStore=this.store,lo.languageUtils=so,lo.pluralResolver=new _o(so,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!io||this.options.interpolation.format&&this.options.interpolation.format!==ro.interpolation.format||(lo.formatter=createClassOnDemand(io),lo.formatter.init(lo,this.options),this.options.interpolation.format=lo.formatter.format.bind(lo.formatter)),lo.interpolator=new mo(this.options),lo.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},lo.backendConnector=new yo(createClassOnDemand(this.modules.backend),lo.resourceStore,lo,this.options),lo.backendConnector.on("*",(function(to){for(var oo=arguments.length,no=new Array(oo>1?oo-1:0),ro=1;ro<oo;ro++)no[ro-1]=arguments[ro];eo.emit.apply(eo,[to].concat(no))})),this.modules.languageDetector&&(lo.languageDetector=createClassOnDemand(this.modules.languageDetector),lo.languageDetector.init(lo,this.options.detection,this.options)),this.modules.i18nFormat&&(lo.i18nFormat=createClassOnDemand(this.modules.i18nFormat),lo.i18nFormat.init&&lo.i18nFormat.init(this)),this.translator=new Ao(this.services,this.options),this.translator.on("*",(function(to){for(var oo=arguments.length,no=new Array(oo>1?oo-1:0),ro=1;ro<oo;ro++)no[ro-1]=arguments[ro];eo.emit.apply(eo,[to].concat(no))})),this.modules.external.forEach((function(to){to.init&&to.init(eo)}))}if(this.format=this.options.interpolation.format,no||(no=noop$1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var uo=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);uo.length>0&&"dev"!==uo[0]&&(this.options.lng=uo[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var po=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];po.forEach((function(to){eo[to]=function(){var oo;return(oo=eo.store)[to].apply(oo,arguments)}}));var ho=["addResource","addResources","addResourceBundle","removeResourceBundle"];ho.forEach((function(to){eo[to]=function(){var oo;return(oo=eo.store)[to].apply(oo,arguments),eo}}));var go=defer(),bo=function load(){var to=function finish(to,oo){eo.isInitialized&&!eo.initializedStoreOnce&&eo.logger.warn("init: i18next is already initialized. You should call init just once!"),eo.isInitialized=!0,eo.options.isClone||eo.logger.log("initialized",eo.options),eo.emit("initialized",eo.options),go.resolve(oo),no(to,oo)};if(eo.languages&&"v1"!==eo.options.compatibilityAPI&&!eo.isInitialized)return to(null,eo.t.bind(eo));eo.changeLanguage(eo.options.lng,to)};return this.options.resources||!this.options.initImmediate?bo():setTimeout(bo,0),go}},{key:"loadResources",value:function loadResources(eo){var to=this,oo=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop$1,no=oo,ro="string"==typeof eo?eo:this.language;if("function"==typeof eo&&(no=eo),!this.options.resources||this.options.partialBundledLanguages){if(ro&&"cimode"===ro.toLowerCase())return no();var io=[],ao=function append(eo){eo&&to.services.languageUtils.toResolveHierarchy(eo).forEach((function(eo){io.indexOf(eo)<0&&io.push(eo)}))};if(ro)ao(ro);else{var so=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);so.forEach((function(eo){return ao(eo)}))}this.options.preload&&this.options.preload.forEach((function(eo){return ao(eo)})),this.services.backendConnector.load(io,this.options.ns,no)}else no(null)}},{key:"reloadResources",value:function reloadResources(eo,to,oo){var no=defer();return eo||(eo=this.languages),to||(to=this.options.ns),oo||(oo=noop$1),this.services.backendConnector.reload(eo,to,(function(eo){no.resolve(),oo(eo)})),no}},{key:"use",value:function use(eo){if(!eo)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!eo.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===eo.type&&(this.modules.backend=eo),("logger"===eo.type||eo.log&&eo.warn&&eo.error)&&(this.modules.logger=eo),"