{"version":3,"file":"vendors-e7a27275.f584a1446b2fc034d810.bundle.js","mappings":"AAMA","sources":["webpack://lernplattform-admin-frontend/./node_modules/i18next-intervalplural-postprocessor/dist/commonjs/index.js","webpack://lernplattform-admin-frontend/./node_modules/i18next-intervalplural-postprocessor/index.js","webpack://lernplattform-admin-frontend/./node_modules/i18next-xhr-backend/dist/esm/i18nextXHRBackend.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/logger.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/EventEmitter.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/utils.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/ResourceStore.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/postProcessor.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/Translator.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/LanguageUtils.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/PluralResolver.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/Interpolator.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/BackendConnector.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/defaults.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/i18next.js","webpack://lernplattform-admin-frontend/./node_modules/i18next/dist/es/index.js","webpack://lernplattform-admin-frontend/./node_modules/iobuffer/lib-esm/text.js","webpack://lernplattform-admin-frontend/./node_modules/iobuffer/lib-esm/IOBuffer.js"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction intervalMatches(interval, count) {\n  if (interval.indexOf('-') > -1) {\n    var p = interval.split('-');\n    if (p[1] === 'inf') {\n      var from = parseInt(p[0], 10);\n      return count >= from;\n    } else {\n      var _from = parseInt(p[0], 10);\n      var to = parseInt(p[1], 10);\n      return count >= _from && count <= to;\n    }\n  } else {\n    var match = parseInt(interval, 10);\n    return match === count;\n  }\n}\n\nexports.default = {\n  name: 'interval',\n  type: 'postProcessor',\n\n  options: {\n    intervalSeparator: ';',\n    intervalRegex: /\\((\\S*)\\).*?\\[((.|\\n)*)\\]/,\n    intervalSuffix: '_interval'\n  },\n\n  setOptions: function setOptions(options) {\n    this.options = _extends({}, this.options, options);\n  },\n  process: function process(value, key, options, translator) {\n    var _this = this;\n\n    var p = value.split(this.options.intervalSeparator);\n\n    var found = void 0;\n    p.forEach(function (iv) {\n      if (found) return;\n      var match = _this.options.intervalRegex.exec(iv);\n\n      if (match && intervalMatches(match[1], options.count || 0)) {\n        found = match[2];\n      }\n    });\n\n    // not found fallback to classical plural\n    if (!found) {\n      var newOptions = _extends({}, options);\n      if (typeof newOptions.postProcess === 'string') {\n        delete newOptions.postProcess;\n      } else {\n        var index = newOptions.postProcess.indexOf('interval'); // <-- Not supported in <IE9\n        if (index !== -1) newOptions.postProcess.splice(index, 1);\n      }\n\n      var newKeys = void 0;\n      if (typeof key === 'string') {\n        newKeys = key.replace(this.options.intervalSuffix, '');\n      } else if (key.length > -1) {\n        newKeys = key.map(function (k) {\n          return k.replace(_this.options.intervalSuffix, '');\n        });\n      }\n      if (newKeys) found = translator.translate(newKeys, newOptions);\n    }\n\n    return found || value;\n  }\n};","module.exports = require('./dist/commonjs/index.js').default;\n","import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport _typeof from '@babel/runtime/helpers/esm/typeof';\n\nvar arr = [];\nvar each = arr.forEach;\nvar slice = arr.slice;\nfunction defaults(obj) {\n  each.call(slice.call(arguments, 1), function (source) {\n    if (source) {\n      for (var prop in source) {\n        if (obj[prop] === undefined) obj[prop] = source[prop];\n      }\n    }\n  });\n  return obj;\n}\n\nfunction addQueryString(url, params) {\n  if (params && _typeof(params) === 'object') {\n    var queryString = '',\n        e = encodeURIComponent; // Must encode data\n\n    for (var paramName in params) {\n      queryString += '&' + e(paramName) + '=' + e(params[paramName]);\n    }\n\n    if (!queryString) {\n      return url;\n    }\n\n    url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);\n  }\n\n  return url;\n} // https://gist.github.com/Xeoncross/7663273\n\n\nfunction ajax(url, options, callback, data, cache) {\n  if (data && _typeof(data) === 'object') {\n    if (!cache) {\n      data['_t'] = new Date();\n    } // URL encoded form data must be in querystring format\n\n\n    data = addQueryString('', data).slice(1);\n  }\n\n  if (options.queryStringParams) {\n    url = addQueryString(url, options.queryStringParams);\n  }\n\n  try {\n    var x;\n\n    if (XMLHttpRequest) {\n      x = new XMLHttpRequest();\n    } else {\n      x = new ActiveXObject('MSXML2.XMLHTTP.3.0');\n    }\n\n    x.open(data ? 'POST' : 'GET', url, 1);\n\n    if (!options.crossDomain) {\n      x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n    }\n\n    x.withCredentials = !!options.withCredentials;\n\n    if (data) {\n      x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n    }\n\n    if (x.overrideMimeType) {\n      x.overrideMimeType(\"application/json\");\n    }\n\n    var h = options.customHeaders;\n    h = typeof h === 'function' ? h() : h;\n\n    if (h) {\n      for (var i in h) {\n        x.setRequestHeader(i, h[i]);\n      }\n    }\n\n    x.onreadystatechange = function () {\n      x.readyState > 3 && callback && callback(x.responseText, x);\n    };\n\n    x.send(data);\n  } catch (e) {\n    console && console.log(e);\n  }\n}\n\nfunction getDefaults() {\n  return {\n    loadPath: '/locales/{{lng}}/{{ns}}.json',\n    addPath: '/locales/add/{{lng}}/{{ns}}',\n    allowMultiLoading: false,\n    parse: JSON.parse,\n    parsePayload: function parsePayload(namespace, key, fallbackValue) {\n      return _defineProperty({}, key, fallbackValue || '');\n    },\n    crossDomain: false,\n    ajax: ajax\n  };\n}\n\nvar Backend =\n/*#__PURE__*/\nfunction () {\n  function Backend(services) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    _classCallCheck(this, Backend);\n\n    this.init(services, options);\n    this.type = 'backend';\n  }\n\n  _createClass(Backend, [{\n    key: \"init\",\n    value: function init(services) {\n      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n      this.services = services;\n      this.options = defaults(options, this.options || {}, getDefaults());\n    }\n  }, {\n    key: \"readMulti\",\n    value: function readMulti(languages, namespaces, callback) {\n      var loadPath = this.options.loadPath;\n\n      if (typeof this.options.loadPath === 'function') {\n        loadPath = this.options.loadPath(languages, namespaces);\n      }\n\n      var url = this.services.interpolator.interpolate(loadPath, {\n        lng: languages.join('+'),\n        ns: namespaces.join('+')\n      });\n      this.loadUrl(url, callback);\n    }\n  }, {\n    key: \"read\",\n    value: function read(language, namespace, callback) {\n      var loadPath = this.options.loadPath;\n\n      if (typeof this.options.loadPath === 'function') {\n        loadPath = this.options.loadPath([language], [namespace]);\n      }\n\n      var url = this.services.interpolator.interpolate(loadPath, {\n        lng: language,\n        ns: namespace\n      });\n      this.loadUrl(url, callback);\n    }\n  }, {\n    key: \"loadUrl\",\n    value: function loadUrl(url, callback) {\n      var _this = this;\n\n      this.options.ajax(url, this.options, function (data, xhr) {\n        if (xhr.status >= 500 && xhr.status < 600) return callback('failed loading ' + url, true\n        /* retry */\n        );\n        if (xhr.status >= 400 && xhr.status < 500) return callback('failed loading ' + url, false\n        /* no retry */\n        );\n        var ret, err;\n\n        try {\n          ret = _this.options.parse(data, url);\n        } catch (e) {\n          err = 'failed parsing ' + url + ' to json';\n        }\n\n        if (err) return callback(err, false);\n        callback(null, ret);\n      });\n    }\n  }, {\n    key: \"create\",\n    value: function create(languages, namespace, key, fallbackValue) {\n      var _this2 = this;\n\n      if (typeof languages === 'string') languages = [languages];\n      var payload = this.options.parsePayload(namespace, key, fallbackValue);\n      languages.forEach(function (lng) {\n        var url = _this2.services.interpolator.interpolate(_this2.options.addPath, {\n          lng: lng,\n          ns: namespace\n        });\n\n        _this2.options.ajax(url, _this2.options, function (data, xhr) {//const statusCode = xhr.status.toString();\n          // TODO: if statusCode === 4xx do log\n        }, payload);\n      });\n    }\n  }]);\n\n  return Backend;\n}();\n\nBackend.type = 'backend';\n\nexport default Backend;\n","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar consoleLogger = {\n  type: 'logger',\n\n  log: function log(args) {\n    this.output('log', args);\n  },\n  warn: function warn(args) {\n    this.output('warn', args);\n  },\n  error: function error(args) {\n    this.output('error', args);\n  },\n  output: function output(type, args) {\n    var _console;\n\n    /* eslint no-console: 0 */\n    if (console && console[type]) (_console = console)[type].apply(_console, _toConsumableArray(args));\n  }\n};\n\nvar Logger = function () {\n  function Logger(concreteLogger) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    _classCallCheck(this, Logger);\n\n    this.init(concreteLogger, options);\n  }\n\n  Logger.prototype.init = function init(concreteLogger) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    this.prefix = options.prefix || 'i18next:';\n    this.logger = concreteLogger || consoleLogger;\n    this.options = options;\n    this.debug = options.debug;\n  };\n\n  Logger.prototype.setDebug = function setDebug(bool) {\n    this.debug = bool;\n  };\n\n  Logger.prototype.log = function log() {\n    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    return this.forward(args, 'log', '', true);\n  };\n\n  Logger.prototype.warn = function warn() {\n    for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    return this.forward(args, 'warn', '', true);\n  };\n\n  Logger.prototype.error = function error() {\n    for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      args[_key3] = arguments[_key3];\n    }\n\n    return this.forward(args, 'error', '');\n  };\n\n  Logger.prototype.deprecate = function deprecate() {\n    for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n      args[_key4] = arguments[_key4];\n    }\n\n    return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n  };\n\n  Logger.prototype.forward = function forward(args, lvl, prefix, debugOnly) {\n    if (debugOnly && !this.debug) return null;\n    if (typeof args[0] === 'string') args[0] = '' + prefix + this.prefix + ' ' + args[0];\n    return this.logger[lvl](args);\n  };\n\n  Logger.prototype.create = function create(moduleName) {\n    return new Logger(this.logger, _extends({ prefix: this.prefix + ':' + moduleName + ':' }, this.options));\n  };\n\n  return Logger;\n}();\n\nexport default new Logger();","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventEmitter = function () {\n  function EventEmitter() {\n    _classCallCheck(this, EventEmitter);\n\n    this.observers = {};\n  }\n\n  EventEmitter.prototype.on = function on(events, listener) {\n    var _this = this;\n\n    events.split(' ').forEach(function (event) {\n      _this.observers[event] = _this.observers[event] || [];\n      _this.observers[event].push(listener);\n    });\n    return this;\n  };\n\n  EventEmitter.prototype.off = function off(event, listener) {\n    var _this2 = this;\n\n    if (!this.observers[event]) {\n      return;\n    }\n\n    this.observers[event].forEach(function () {\n      if (!listener) {\n        delete _this2.observers[event];\n      } else {\n        var index = _this2.observers[event].indexOf(listener);\n        if (index > -1) {\n          _this2.observers[event].splice(index, 1);\n        }\n      }\n    });\n  };\n\n  EventEmitter.prototype.emit = function emit(event) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    if (this.observers[event]) {\n      var cloned = [].concat(this.observers[event]);\n      cloned.forEach(function (observer) {\n        observer.apply(undefined, args);\n      });\n    }\n\n    if (this.observers['*']) {\n      var _cloned = [].concat(this.observers['*']);\n      _cloned.forEach(function (observer) {\n        observer.apply(observer, [event].concat(args));\n      });\n    }\n  };\n\n  return EventEmitter;\n}();\n\nexport default EventEmitter;","// http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/\nexport function defer() {\n  var res = void 0;\n  var rej = void 0;\n\n  var promise = new Promise(function (resolve, reject) {\n    res = resolve;\n    rej = reject;\n  });\n\n  promise.resolve = res;\n  promise.reject = rej;\n\n  return promise;\n}\n\nexport function makeString(object) {\n  if (object == null) return '';\n  /* eslint prefer-template: 0 */\n  return '' + object;\n}\n\nexport function copy(a, s, t) {\n  a.forEach(function (m) {\n    if (s[m]) t[m] = s[m];\n  });\n}\n\nfunction getLastOfPath(object, path, Empty) {\n  function cleanKey(key) {\n    return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;\n  }\n\n  function canNotTraverseDeeper() {\n    return !object || typeof object === 'string';\n  }\n\n  var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');\n  while (stack.length > 1) {\n    if (canNotTraverseDeeper()) return {};\n\n    var key = cleanKey(stack.shift());\n    if (!object[key] && Empty) object[key] = new Empty();\n    object = object[key];\n  }\n\n  if (canNotTraverseDeeper()) return {};\n  return {\n    obj: object,\n    k: cleanKey(stack.shift())\n  };\n}\n\nexport function setPath(object, path, newValue) {\n  var _getLastOfPath = getLastOfPath(object, path, Object),\n      obj = _getLastOfPath.obj,\n      k = _getLastOfPath.k;\n\n  obj[k] = newValue;\n}\n\nexport function pushPath(object, path, newValue, concat) {\n  var _getLastOfPath2 = getLastOfPath(object, path, Object),\n      obj = _getLastOfPath2.obj,\n      k = _getLastOfPath2.k;\n\n  obj[k] = obj[k] || [];\n  if (concat) obj[k] = obj[k].concat(newValue);\n  if (!concat) obj[k].push(newValue);\n}\n\nexport function getPath(object, path) {\n  var _getLastOfPath3 = getLastOfPath(object, path),\n      obj = _getLastOfPath3.obj,\n      k = _getLastOfPath3.k;\n\n  if (!obj) return undefined;\n  return obj[k];\n}\n\nexport function deepExtend(target, source, overwrite) {\n  /* eslint no-restricted-syntax: 0 */\n  for (var prop in source) {\n    if (prop in target) {\n      // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch\n      if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {\n        if (overwrite) target[prop] = source[prop];\n      } else {\n        deepExtend(target[prop], source[prop], overwrite);\n      }\n    } else {\n      target[prop] = source[prop];\n    }\n  }\n  return target;\n}\n\nexport function regexEscape(str) {\n  /* eslint no-useless-escape: 0 */\n  return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/* eslint-disable */\nvar _entityMap = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;',\n  '/': '&#x2F;'\n};\n/* eslint-enable */\n\nexport function escape(data) {\n  if (typeof data === 'string') {\n    return data.replace(/[&<>\"'\\/]/g, function (s) {\n      return _entityMap[s];\n    });\n  }\n\n  return data;\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }\n\nimport EventEmitter from './EventEmitter.js';\nimport * as utils from './utils.js';\n\nvar ResourceStore = function (_EventEmitter) {\n  _inherits(ResourceStore, _EventEmitter);\n\n  function ResourceStore(data) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { ns: ['translation'], defaultNS: 'translation' };\n\n    _classCallCheck(this, ResourceStore);\n\n    var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n    _this.data = data || {};\n    _this.options = options;\n    if (_this.options.keySeparator === undefined) {\n      _this.options.keySeparator = '.';\n    }\n    return _this;\n  }\n\n  ResourceStore.prototype.addNamespaces = function addNamespaces(ns) {\n    if (this.options.ns.indexOf(ns) < 0) {\n      this.options.ns.push(ns);\n    }\n  };\n\n  ResourceStore.prototype.removeNamespaces = function removeNamespaces(ns) {\n    var index = this.options.ns.indexOf(ns);\n    if (index > -1) {\n      this.options.ns.splice(index, 1);\n    }\n  };\n\n  ResourceStore.prototype.getResource = function getResource(lng, ns, key) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n    var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n\n    var path = [lng, ns];\n    if (key && typeof key !== 'string') path = path.concat(key);\n    if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n    if (lng.indexOf('.') > -1) {\n      path = lng.split('.');\n    }\n\n    return utils.getPath(this.data, path);\n  };\n\n  ResourceStore.prototype.addResource = function addResource(lng, ns, key, value) {\n    var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { silent: false };\n\n    var keySeparator = this.options.keySeparator;\n    if (keySeparator === undefined) keySeparator = '.';\n\n    var path = [lng, ns];\n    if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n    if (lng.indexOf('.') > -1) {\n      path = lng.split('.');\n      value = ns;\n      ns = path[1];\n    }\n\n    this.addNamespaces(ns);\n\n    utils.setPath(this.data, path, value);\n\n    if (!options.silent) this.emit('added', lng, ns, key, value);\n  };\n\n  ResourceStore.prototype.addResources = function addResources(lng, ns, resources) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { silent: false };\n\n    /* eslint no-restricted-syntax: 0 */\n    for (var m in resources) {\n      if (typeof resources[m] === 'string') this.addResource(lng, ns, m, resources[m], { silent: true });\n    }\n    if (!options.silent) this.emit('added', lng, ns, resources);\n  };\n\n  ResourceStore.prototype.addResourceBundle = function addResourceBundle(lng, ns, resources, deep, overwrite) {\n    var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { silent: false };\n\n    var path = [lng, ns];\n    if (lng.indexOf('.') > -1) {\n      path = lng.split('.');\n      deep = resources;\n      resources = ns;\n      ns = path[1];\n    }\n\n    this.addNamespaces(ns);\n\n    var pack = utils.getPath(this.data, path) || {};\n\n    if (deep) {\n      utils.deepExtend(pack, resources, overwrite);\n    } else {\n      pack = _extends({}, pack, resources);\n    }\n\n    utils.setPath(this.data, path, pack);\n\n    if (!options.silent) this.emit('added', lng, ns, resources);\n  };\n\n  ResourceStore.prototype.removeResourceBundle = function removeResourceBundle(lng, ns) {\n    if (this.hasResourceBundle(lng, ns)) {\n      delete this.data[lng][ns];\n    }\n    this.removeNamespaces(ns);\n\n    this.emit('removed', lng, ns);\n  };\n\n  ResourceStore.prototype.hasResourceBundle = function hasResourceBundle(lng, ns) {\n    return this.getResource(lng, ns) !== undefined;\n  };\n\n  ResourceStore.prototype.getResourceBundle = function getResourceBundle(lng, ns) {\n    if (!ns) ns = this.options.defaultNS;\n\n    // COMPATIBILITY: remove extend in v2.1.0\n    if (this.options.compatibilityAPI === 'v1') return _extends({}, this.getResource(lng, ns));\n\n    return this.getResource(lng, ns);\n  };\n\n  ResourceStore.prototype.getDataByLanguage = function getDataByLanguage(lng) {\n    return this.data[lng];\n  };\n\n  ResourceStore.prototype.toJSON = function toJSON() {\n    return this.data;\n  };\n\n  return ResourceStore;\n}(EventEmitter);\n\nexport default ResourceStore;","export default {\n  processors: {},\n\n  addPostProcessor: function addPostProcessor(module) {\n    this.processors[module.name] = module;\n  },\n  handle: function handle(processors, value, key, options, translator) {\n    var _this = this;\n\n    processors.forEach(function (processor) {\n      if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);\n    });\n\n    return value;\n  }\n};","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }\n\nimport baseLogger from './logger.js';\nimport EventEmitter from './EventEmitter.js';\nimport postProcessor from './postProcessor.js';\nimport * as utils from './utils.js';\n\nvar Translator = function (_EventEmitter) {\n  _inherits(Translator, _EventEmitter);\n\n  function Translator(services) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    _classCallCheck(this, Translator);\n\n    var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n    utils.copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat'], services, _this);\n\n    _this.options = options;\n    if (_this.options.keySeparator === undefined) {\n      _this.options.keySeparator = '.';\n    }\n\n    _this.logger = baseLogger.create('translator');\n    return _this;\n  }\n\n  Translator.prototype.changeLanguage = function changeLanguage(lng) {\n    if (lng) this.language = lng;\n  };\n\n  Translator.prototype.exists = function exists(key) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { interpolation: {} };\n\n    var resolved = this.resolve(key, options);\n    return resolved && resolved.res !== undefined;\n  };\n\n  Translator.prototype.extractFromKey = function extractFromKey(key, options) {\n    var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n    if (nsSeparator === undefined) nsSeparator = ':';\n\n    var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n\n    var namespaces = options.ns || this.options.defaultNS;\n    if (nsSeparator && key.indexOf(nsSeparator) > -1) {\n      var parts = key.split(nsSeparator);\n      if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n      key = parts.join(keySeparator);\n    }\n    if (typeof namespaces === 'string') namespaces = [namespaces];\n\n    return {\n      key: key,\n      namespaces: namespaces\n    };\n  };\n\n  Translator.prototype.translate = function translate(keys, options) {\n    var _this2 = this;\n\n    if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object' && this.options.overloadTranslationOptionHandler) {\n      /* eslint prefer-rest-params: 0 */\n      options = this.options.overloadTranslationOptionHandler(arguments);\n    }\n    if (!options) options = {};\n\n    // non valid keys handling\n    if (keys === undefined || keys === null) return '';\n    if (!Array.isArray(keys)) keys = [String(keys)];\n\n    // separators\n    var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n\n    // get namespace(s)\n\n    var _extractFromKey = this.extractFromKey(keys[keys.length - 1], options),\n        key = _extractFromKey.key,\n        namespaces = _extractFromKey.namespaces;\n\n    var namespace = namespaces[namespaces.length - 1];\n\n    // return key on CIMode\n    var lng = options.lng || this.language;\n    var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n    if (lng && lng.toLowerCase() === 'cimode') {\n      if (appendNamespaceToCIMode) {\n        var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n        return namespace + nsSeparator + key;\n      }\n\n      return key;\n    }\n\n    // resolve from store\n    var resolved = this.resolve(keys, options);\n    var res = resolved && resolved.res;\n    var resUsedKey = resolved && resolved.usedKey || key;\n    var resExactUsedKey = resolved && resolved.exactUsedKey || key;\n\n    var resType = Object.prototype.toString.apply(res);\n    var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n    var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;\n\n    // object\n    var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n    var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';\n    if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {\n      if (!options.returnObjects && !this.options.returnObjects) {\n        this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n        return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, options) : 'key \\'' + key + ' (' + this.language + ')\\' returned an object instead of string.';\n      }\n\n      // if we got a separator we loop over children - else we just return object as is\n      // as having it set to false means no hierarchy so no lookup for nested values\n      if (keySeparator) {\n        var resTypeIsArray = resType === '[object Array]';\n        var copy = resTypeIsArray ? [] : {}; // apply child translation on a copy\n\n        /* eslint no-restricted-syntax: 0 */\n        var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n        for (var m in res) {\n          if (Object.prototype.hasOwnProperty.call(res, m)) {\n            var deepKey = '' + newKeyToUse + keySeparator + m;\n            copy[m] = this.translate(deepKey, _extends({}, options, { joinArrays: false, ns: namespaces }));\n            if (copy[m] === deepKey) copy[m] = res[m]; // if nothing found use orginal value as fallback\n          }\n        }\n        res = copy;\n      }\n    } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {\n      // array special treatment\n      res = res.join(joinArrays);\n      if (res) res = this.extendTranslation(res, keys, options);\n    } else {\n      // string, empty or null\n      var usedDefault = false;\n      var usedKey = false;\n\n      // fallback value\n      if (!this.isValidLookup(res) && options.defaultValue !== undefined) {\n        usedDefault = true;\n\n        if (options.count !== undefined) {\n          var suffix = this.pluralResolver.getSuffix(lng, options.count);\n          res = options['defaultValue' + suffix];\n        }\n        if (!res) res = options.defaultValue;\n      }\n      if (!this.isValidLookup(res)) {\n        usedKey = true;\n        res = key;\n      }\n\n      // save missing\n      var updateMissing = options.defaultValue && options.defaultValue !== res && this.options.updateMissing;\n      if (usedKey || usedDefault || updateMissing) {\n        this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? options.defaultValue : res);\n\n        var lngs = [];\n        var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n        if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n          for (var i = 0; i < fallbackLngs.length; i++) {\n            lngs.push(fallbackLngs[i]);\n          }\n        } else if (this.options.saveMissingTo === 'all') {\n          lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n        } else {\n          lngs.push(options.lng || this.language);\n        }\n\n        var send = function send(l, k) {\n          if (_this2.options.missingKeyHandler) {\n            _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options);\n          } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {\n            _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options);\n          }\n          _this2.emit('missingKey', l, namespace, k, res);\n        };\n\n        if (this.options.saveMissing) {\n          var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n          if (this.options.saveMissingPlurals && needsPluralHandling) {\n            lngs.forEach(function (l) {\n              var plurals = _this2.pluralResolver.getPluralFormsOfKey(l, key);\n\n              plurals.forEach(function (p) {\n                return send([l], p);\n              });\n            });\n          } else {\n            send(lngs, key);\n          }\n        }\n      }\n\n      // extend\n      res = this.extendTranslation(res, keys, options, resolved);\n\n      // append namespace if still key\n      if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = namespace + ':' + key;\n\n      // parseMissingKeyHandler\n      if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res);\n    }\n\n    // return\n    return res;\n  };\n\n  Translator.prototype.extendTranslation = function extendTranslation(res, key, options, resolved) {\n    var _this3 = this;\n\n    if (this.i18nFormat && this.i18nFormat.parse) {\n      res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, { resolved: resolved });\n    } else if (!options.skipInterpolation) {\n      // i18next.parsing\n      if (options.interpolation) this.interpolator.init(_extends({}, options, { interpolation: _extends({}, this.options.interpolation, options.interpolation) }));\n\n      // interpolate\n      var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;\n      if (this.options.interpolation.defaultVariables) data = _extends({}, this.options.interpolation.defaultVariables, data);\n      res = this.interpolator.interpolate(res, data, options.lng || this.language, options);\n\n      // nesting\n      if (options.nest !== false) res = this.interpolator.nest(res, function () {\n        return _this3.translate.apply(_this3, arguments);\n      }, options);\n\n      if (options.interpolation) this.interpolator.reset();\n    }\n\n    // post process\n    var postProcess = options.postProcess || this.options.postProcess;\n    var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;\n\n    if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n      res = postProcessor.handle(postProcessorNames, res, key, options, this);\n    }\n\n    return res;\n  };\n\n  Translator.prototype.resolve = function resolve(keys) {\n    var _this4 = this;\n\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    var found = void 0;\n    var usedKey = void 0; // plain key\n    var exactUsedKey = void 0; // key with context / plural\n    var usedLng = void 0;\n    var usedNS = void 0;\n\n    if (typeof keys === 'string') keys = [keys];\n\n    // forEach possible key\n    keys.forEach(function (k) {\n      if (_this4.isValidLookup(found)) return;\n      var extracted = _this4.extractFromKey(k, options);\n      var key = extracted.key;\n      usedKey = key;\n      var namespaces = extracted.namespaces;\n      if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);\n\n      var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n      var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== '';\n\n      var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);\n\n      namespaces.forEach(function (ns) {\n        if (_this4.isValidLookup(found)) return;\n        usedNS = ns;\n\n        codes.forEach(function (code) {\n          if (_this4.isValidLookup(found)) return;\n          usedLng = code;\n\n          var finalKey = key;\n          var finalKeys = [finalKey];\n\n          if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {\n            _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n          } else {\n            var pluralSuffix = void 0;\n            if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count);\n\n            // fallback for plural if context not found\n            if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix);\n\n            // get key for context if needed\n            if (needsContextHandling) finalKeys.push(finalKey += '' + _this4.options.contextSeparator + options.context);\n\n            // get key for plural if needed\n            if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix);\n          }\n\n          // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only\n          var possibleKey = void 0;\n          /* eslint no-cond-assign: 0 */\n          while (possibleKey = finalKeys.pop()) {\n            if (!_this4.isValidLookup(found)) {\n              exactUsedKey = possibleKey;\n              found = _this4.getResource(code, ns, possibleKey, options);\n            }\n          }\n        });\n      });\n    });\n\n    return { res: found, usedKey: usedKey, exactUsedKey: exactUsedKey, usedLng: usedLng, usedNS: usedNS };\n  };\n\n  Translator.prototype.isValidLookup = function isValidLookup(res) {\n    return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n  };\n\n  Translator.prototype.getResource = function getResource(code, ns, key) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n    if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n    return this.resourceStore.getResource(code, ns, key, options);\n  };\n\n  return Translator;\n}(EventEmitter);\n\nexport default Translator;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport baseLogger from './logger.js';\n\nfunction capitalize(string) {\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nvar LanguageUtil = function () {\n  function LanguageUtil(options) {\n    _classCallCheck(this, LanguageUtil);\n\n    this.options = options;\n\n    this.whitelist = this.options.whitelist || false;\n    this.logger = baseLogger.create('languageUtils');\n  }\n\n  LanguageUtil.prototype.getScriptPartFromCode = function getScriptPartFromCode(code) {\n    if (!code || code.indexOf('-') < 0) return null;\n\n    var p = code.split('-');\n    if (p.length === 2) return null;\n    p.pop();\n    return this.formatLanguageCode(p.join('-'));\n  };\n\n  LanguageUtil.prototype.getLanguagePartFromCode = function getLanguagePartFromCode(code) {\n    if (!code || code.indexOf('-') < 0) return code;\n\n    var p = code.split('-');\n    return this.formatLanguageCode(p[0]);\n  };\n\n  LanguageUtil.prototype.formatLanguageCode = function formatLanguageCode(code) {\n    // http://www.iana.org/assignments/language-tags/language-tags.xhtml\n    if (typeof code === 'string' && code.indexOf('-') > -1) {\n      var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n      var p = code.split('-');\n\n      if (this.options.lowerCaseLng) {\n        p = p.map(function (part) {\n          return part.toLowerCase();\n        });\n      } else if (p.length === 2) {\n        p[0] = p[0].toLowerCase();\n        p[1] = p[1].toUpperCase();\n\n        if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n      } else if (p.length === 3) {\n        p[0] = p[0].toLowerCase();\n\n        // if lenght 2 guess it's a country\n        if (p[1].length === 2) p[1] = p[1].toUpperCase();\n        if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n\n        if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n        if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n      }\n\n      return p.join('-');\n    }\n\n    return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n  };\n\n  LanguageUtil.prototype.isWhitelisted = function isWhitelisted(code) {\n    if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) {\n      code = this.getLanguagePartFromCode(code);\n    }\n    return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1;\n  };\n\n  LanguageUtil.prototype.getFallbackCodes = function getFallbackCodes(fallbacks, code) {\n    if (!fallbacks) return [];\n    if (typeof fallbacks === 'string') fallbacks = [fallbacks];\n    if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;\n\n    if (!code) return fallbacks.default || [];\n\n    // asume we have an object defining fallbacks\n    var found = fallbacks[code];\n    if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n    if (!found) found = fallbacks[this.formatLanguageCode(code)];\n    if (!found) found = fallbacks.default;\n\n    return found || [];\n  };\n\n  LanguageUtil.prototype.toResolveHierarchy = function toResolveHierarchy(code, fallbackCode) {\n    var _this = this;\n\n    var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n\n    var codes = [];\n    var addCode = function addCode(c) {\n      if (!c) return;\n      if (_this.isWhitelisted(c)) {\n        codes.push(c);\n      } else {\n        _this.logger.warn('rejecting non-whitelisted language code: ' + c);\n      }\n    };\n\n    if (typeof code === 'string' && code.indexOf('-') > -1) {\n      if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n      if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n      if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n    } else if (typeof code === 'string') {\n      addCode(this.formatLanguageCode(code));\n    }\n\n    fallbackCodes.forEach(function (fc) {\n      if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc));\n    });\n\n    return codes;\n  };\n\n  return LanguageUtil;\n}();\n\nexport default LanguageUtil;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport baseLogger from './logger.js';\n\n// definition http://translate.sourceforge.net/wiki/l10n/pluralforms\n/* eslint-disable */\nvar sets = [{ 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', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'], nr: [1, 2], fc: 2 }, { lngs: ['ay', 'bo', 'cgg', 'fa', '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', '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'], nr: [1, 2, 20, 21], fc: 22 }];\n\nvar _rulesPluralsTypes = {\n  1: function _(n) {\n    return Number(n > 1);\n  },\n  2: function _(n) {\n    return Number(n != 1);\n  },\n  3: function _(n) {\n    return 0;\n  },\n  4: function _(n) {\n    return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n  },\n  5: function _(n) {\n    return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);\n  },\n  6: function _(n) {\n    return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);\n  },\n  7: function _(n) {\n    return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n  },\n  8: function _(n) {\n    return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);\n  },\n  9: function _(n) {\n    return Number(n >= 2);\n  },\n  10: function _(n) {\n    return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);\n  },\n  11: function _(n) {\n    return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);\n  },\n  12: function _(n) {\n    return Number(n % 10 != 1 || n % 100 == 11);\n  },\n  13: function _(n) {\n    return Number(n !== 0);\n  },\n  14: function _(n) {\n    return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);\n  },\n  15: function _(n) {\n    return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n  },\n  16: function _(n) {\n    return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);\n  },\n  17: function _(n) {\n    return Number(n == 1 || n % 10 == 1 ? 0 : 1);\n  },\n  18: function _(n) {\n    return Number(n == 0 ? 0 : n == 1 ? 1 : 2);\n  },\n  19: function _(n) {\n    return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);\n  },\n  20: function _(n) {\n    return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);\n  },\n  21: function _(n) {\n    return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n  },\n  22: function _(n) {\n    return Number(n === 1 ? 0 : n === 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);\n  }\n};\n/* eslint-enable */\n\nfunction createRules() {\n  var rules = {};\n  sets.forEach(function (set) {\n    set.lngs.forEach(function (l) {\n      rules[l] = {\n        numbers: set.nr,\n        plurals: _rulesPluralsTypes[set.fc]\n      };\n    });\n  });\n  return rules;\n}\n\nvar PluralResolver = function () {\n  function PluralResolver(languageUtils) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n    _classCallCheck(this, PluralResolver);\n\n    this.languageUtils = languageUtils;\n    this.options = options;\n\n    this.logger = baseLogger.create('pluralResolver');\n\n    this.rules = createRules();\n  }\n\n  PluralResolver.prototype.addRule = function addRule(lng, obj) {\n    this.rules[lng] = obj;\n  };\n\n  PluralResolver.prototype.getRule = function getRule(code) {\n    return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n  };\n\n  PluralResolver.prototype.needsPlural = function needsPlural(code) {\n    var rule = this.getRule(code);\n\n    return rule && rule.numbers.length > 1;\n  };\n\n  PluralResolver.prototype.getPluralFormsOfKey = function getPluralFormsOfKey(code, key) {\n    var _this = this;\n\n    var ret = [];\n\n    var rule = this.getRule(code);\n\n    if (!rule) return ret;\n\n    rule.numbers.forEach(function (n) {\n      var suffix = _this.getSuffix(code, n);\n      ret.push('' + key + suffix);\n    });\n\n    return ret;\n  };\n\n  PluralResolver.prototype.getSuffix = function getSuffix(code, count) {\n    var _this2 = this;\n\n    var rule = this.getRule(code);\n\n    if (rule) {\n      // if (rule.numbers.length === 1) return ''; // only singular\n\n      var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n      var suffix = rule.numbers[idx];\n\n      // special treatment for lngs only having singular and plural\n      if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n        if (suffix === 2) {\n          suffix = 'plural';\n        } else if (suffix === 1) {\n          suffix = '';\n        }\n      }\n\n      var returnSuffix = function returnSuffix() {\n        return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();\n      };\n\n      // COMPATIBILITY JSON\n      // v1\n      if (this.options.compatibilityJSON === 'v1') {\n        if (suffix === 1) return '';\n        if (typeof suffix === 'number') return '_plural_' + suffix.toString();\n        return returnSuffix();\n      } else if ( /* v2 */this.options.compatibilityJSON === 'v2') {\n        return returnSuffix();\n      } else if ( /* v3 - gettext index */this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n        return returnSuffix();\n      }\n      return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n    }\n\n    this.logger.warn('no plural rule found for: ' + code);\n    return '';\n  };\n\n  return PluralResolver;\n}();\n\nexport default PluralResolver;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport * as utils from './utils.js';\nimport baseLogger from './logger.js';\n\nvar Interpolator = function () {\n  function Interpolator() {\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n    _classCallCheck(this, Interpolator);\n\n    this.logger = baseLogger.create('interpolator');\n\n    this.init(options, true);\n  }\n\n  /* eslint no-param-reassign: 0 */\n\n\n  Interpolator.prototype.init = function init() {\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var reset = arguments[1];\n\n    if (reset) {\n      this.options = options;\n      this.format = options.interpolation && options.interpolation.format || function (value) {\n        return value;\n      };\n    }\n    if (!options.interpolation) options.interpolation = { escapeValue: true };\n\n    var iOpts = options.interpolation;\n\n    this.escape = iOpts.escape !== undefined ? iOpts.escape : utils.escape;\n    this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;\n    this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;\n\n    this.prefix = iOpts.prefix ? utils.regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';\n    this.suffix = iOpts.suffix ? utils.regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';\n\n    this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n\n    this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';\n    this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';\n\n    this.nestingPrefix = iOpts.nestingPrefix ? utils.regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || utils.regexEscape('$t(');\n    this.nestingSuffix = iOpts.nestingSuffix ? utils.regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || utils.regexEscape(')');\n\n    this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;\n\n    // the regexp\n    this.resetRegExp();\n  };\n\n  Interpolator.prototype.reset = function reset() {\n    if (this.options) this.init(this.options);\n  };\n\n  Interpolator.prototype.resetRegExp = function resetRegExp() {\n    // the regexp\n    var regexpStr = this.prefix + '(.+?)' + this.suffix;\n    this.regexp = new RegExp(regexpStr, 'g');\n\n    var regexpUnescapeStr = '' + this.prefix + this.unescapePrefix + '(.+?)' + this.unescapeSuffix + this.suffix;\n    this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');\n\n    var nestingRegexpStr = this.nestingPrefix + '(.+?)' + this.nestingSuffix;\n    this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');\n  };\n\n  Interpolator.prototype.interpolate = function interpolate(str, data, lng, options) {\n    var _this = this;\n\n    var match = void 0;\n    var value = void 0;\n    var replaces = void 0;\n\n    function regexSafe(val) {\n      return val.replace(/\\$/g, '$$$$');\n    }\n\n    var handleFormat = function handleFormat(key) {\n      if (key.indexOf(_this.formatSeparator) < 0) return utils.getPath(data, key);\n\n      var p = key.split(_this.formatSeparator);\n      var k = p.shift().trim();\n      var f = p.join(_this.formatSeparator).trim();\n\n      return _this.format(utils.getPath(data, k), f, lng);\n    };\n\n    this.resetRegExp();\n\n    var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n\n    replaces = 0;\n    // unescape if has unescapePrefix/Suffix\n    /* eslint no-cond-assign: 0 */\n    while (match = this.regexpUnescape.exec(str)) {\n      value = handleFormat(match[1].trim());\n      str = str.replace(match[0], value);\n      this.regexpUnescape.lastIndex = 0;\n      replaces++;\n      if (replaces >= this.maxReplaces) {\n        break;\n      }\n    }\n\n    replaces = 0;\n    // regular escape on demand\n    while (match = this.regexp.exec(str)) {\n      value = handleFormat(match[1].trim());\n      if (value === undefined) {\n        if (typeof missingInterpolationHandler === 'function') {\n          var temp = missingInterpolationHandler(str, match, options);\n          value = typeof temp === 'string' ? temp : '';\n        } else {\n          this.logger.warn('missed to pass in variable ' + match[1] + ' for interpolating ' + str);\n          value = '';\n        }\n      } else if (typeof value !== 'string' && !this.useRawValueToEscape) {\n        value = utils.makeString(value);\n      }\n      value = this.escapeValue ? regexSafe(this.escape(value)) : regexSafe(value);\n      str = str.replace(match[0], value);\n      this.regexp.lastIndex = 0;\n      replaces++;\n      if (replaces >= this.maxReplaces) {\n        break;\n      }\n    }\n    return str;\n  };\n\n  Interpolator.prototype.nest = function nest(str, fc) {\n    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n    var match = void 0;\n    var value = void 0;\n\n    var clonedOptions = _extends({}, options);\n    clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup\n\n    // if value is something like \"myKey\": \"lorem $(anotherKey, { \"count\": {{aValueInOptions}} })\"\n    function handleHasOptions(key, inheritedOptions) {\n      if (key.indexOf(',') < 0) return key;\n\n      var p = key.split(',');\n      key = p.shift();\n      var optionsString = p.join(',');\n      optionsString = this.interpolate(optionsString, clonedOptions);\n      optionsString = optionsString.replace(/'/g, '\"');\n\n      try {\n        clonedOptions = JSON.parse(optionsString);\n\n        if (inheritedOptions) clonedOptions = _extends({}, inheritedOptions, clonedOptions);\n      } catch (e) {\n        this.logger.error('failed parsing options string in nesting for key ' + key, e);\n      }\n\n      return key;\n    }\n\n    // regular escape on demand\n    while (match = this.nestingRegexp.exec(str)) {\n      value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n\n      // is only the nesting key (key1 = '$(key2)') return the value without stringify\n      if (value && match[0] === str && typeof value !== 'string') return value;\n\n      // no string to include or empty\n      if (typeof value !== 'string') value = utils.makeString(value);\n      if (!value) {\n        this.logger.warn('missed to resolve ' + match[1] + ' for nesting ' + str);\n        value = '';\n      }\n      // Nested keys should not be escaped by default #854\n      // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value);\n      str = str.replace(match[0], value);\n      this.regexp.lastIndex = 0;\n    }\n    return str;\n  };\n\n  return Interpolator;\n}();\n\nexport default Interpolator;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }\n\nimport * as utils from './utils.js';\nimport baseLogger from './logger.js';\nimport EventEmitter from './EventEmitter.js';\n\nfunction remove(arr, what) {\n  var found = arr.indexOf(what);\n\n  while (found !== -1) {\n    arr.splice(found, 1);\n    found = arr.indexOf(what);\n  }\n}\n\nvar Connector = function (_EventEmitter) {\n  _inherits(Connector, _EventEmitter);\n\n  function Connector(backend, store, services) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n    _classCallCheck(this, Connector);\n\n    var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n    _this.backend = backend;\n    _this.store = store;\n    _this.languageUtils = services.languageUtils;\n    _this.options = options;\n    _this.logger = baseLogger.create('backendConnector');\n\n    _this.state = {};\n    _this.queue = [];\n\n    if (_this.backend && _this.backend.init) {\n      _this.backend.init(services, options.backend, options);\n    }\n    return _this;\n  }\n\n  Connector.prototype.queueLoad = function queueLoad(languages, namespaces, options, callback) {\n    var _this2 = this;\n\n    // find what needs to be loaded\n    var toLoad = [];\n    var pending = [];\n    var toLoadLanguages = [];\n    var toLoadNamespaces = [];\n\n    languages.forEach(function (lng) {\n      var hasAllNamespaces = true;\n\n      namespaces.forEach(function (ns) {\n        var name = lng + '|' + ns;\n\n        if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {\n          _this2.state[name] = 2; // loaded\n        } else if (_this2.state[name] < 0) {\n          // nothing to do for err\n        } else if (_this2.state[name] === 1) {\n          if (pending.indexOf(name) < 0) pending.push(name);\n        } else {\n          _this2.state[name] = 1; // pending\n\n          hasAllNamespaces = false;\n\n          if (pending.indexOf(name) < 0) pending.push(name);\n          if (toLoad.indexOf(name) < 0) toLoad.push(name);\n          if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns);\n        }\n      });\n\n      if (!hasAllNamespaces) toLoadLanguages.push(lng);\n    });\n\n    if (toLoad.length || pending.length) {\n      this.queue.push({\n        pending: pending,\n        loaded: {},\n        errors: [],\n        callback: callback\n      });\n    }\n\n    return {\n      toLoad: toLoad,\n      pending: pending,\n      toLoadLanguages: toLoadLanguages,\n      toLoadNamespaces: toLoadNamespaces\n    };\n  };\n\n  Connector.prototype.loaded = function loaded(name, err, data) {\n    var _name$split = name.split('|'),\n        _name$split2 = _slicedToArray(_name$split, 2),\n        lng = _name$split2[0],\n        ns = _name$split2[1];\n\n    if (err) this.emit('failedLoading', lng, ns, err);\n\n    if (data) {\n      this.store.addResourceBundle(lng, ns, data);\n    }\n\n    // set loaded\n    this.state[name] = err ? -1 : 2;\n\n    // consolidated loading done in this run - only emit once for a loaded namespace\n    var loaded = {};\n\n    // callback if ready\n    this.queue.forEach(function (q) {\n      utils.pushPath(q.loaded, [lng], ns);\n      remove(q.pending, name);\n\n      if (err) q.errors.push(err);\n\n      if (q.pending.length === 0 && !q.done) {\n        // only do once per loaded -> this.emit('loaded', q.loaded);\n        Object.keys(q.loaded).forEach(function (l) {\n          if (!loaded[l]) loaded[l] = [];\n          if (q.loaded[l].length) {\n            q.loaded[l].forEach(function (ns) {\n              if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns);\n            });\n          }\n        });\n\n        /* eslint no-param-reassign: 0 */\n        q.done = true;\n        if (q.errors.length) {\n          q.callback(q.errors);\n        } else {\n          q.callback();\n        }\n      }\n    });\n\n    // emit consolidated loaded event\n    this.emit('loaded', loaded);\n\n    // remove done load requests\n    this.queue = this.queue.filter(function (q) {\n      return !q.done;\n    });\n  };\n\n  Connector.prototype.read = function read(lng, ns, fcName) {\n    var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n    var _this3 = this;\n\n    var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 250;\n    var callback = arguments[5];\n\n    if (!lng.length) return callback(null, {}); // noting to load\n\n    return this.backend[fcName](lng, ns, function (err, data) {\n      if (err && data /* = retryFlag */ && tried < 5) {\n        setTimeout(function () {\n          _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);\n        }, wait);\n        return;\n      }\n      callback(err, data);\n    });\n  };\n\n  /* eslint consistent-return: 0 */\n\n\n  Connector.prototype.prepareLoading = function prepareLoading(languages, namespaces) {\n    var _this4 = this;\n\n    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n    var callback = arguments[3];\n\n    if (!this.backend) {\n      this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n      return callback && callback();\n    }\n\n    if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);\n    if (typeof namespaces === 'string') namespaces = [namespaces];\n\n    var toLoad = this.queueLoad(languages, namespaces, options, callback);\n    if (!toLoad.toLoad.length) {\n      if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now\n      return null; // pendings will trigger callback\n    }\n\n    toLoad.toLoad.forEach(function (name) {\n      _this4.loadOne(name);\n    });\n  };\n\n  Connector.prototype.load = function load(languages, namespaces, callback) {\n    this.prepareLoading(languages, namespaces, {}, callback);\n  };\n\n  Connector.prototype.reload = function reload(languages, namespaces, callback) {\n    this.prepareLoading(languages, namespaces, { reload: true }, callback);\n  };\n\n  Connector.prototype.loadOne = function loadOne(name) {\n    var _this5 = this;\n\n    var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n    var _name$split3 = name.split('|'),\n        _name$split4 = _slicedToArray(_name$split3, 2),\n        lng = _name$split4[0],\n        ns = _name$split4[1];\n\n    this.read(lng, ns, 'read', null, null, function (err, data) {\n      if (err) _this5.logger.warn(prefix + 'loading namespace ' + ns + ' for language ' + lng + ' failed', err);\n      if (!err && data) _this5.logger.log(prefix + 'loaded namespace ' + ns + ' for language ' + lng, data);\n\n      _this5.loaded(name, err, data);\n    });\n  };\n\n  Connector.prototype.saveMissing = function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n    var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n\n    if (this.backend && this.backend.create) {\n      this.backend.create(languages, namespace, key, fallbackValue, null /* unused callback */, _extends({}, options, {\n        isUpdate: isUpdate\n      }));\n    }\n\n    // write to store to avoid resending\n    if (!languages || !languages[0]) return;\n    this.store.addResource(languages[0], namespace, key, fallbackValue);\n  };\n\n  return Connector;\n}(EventEmitter);\n\nexport default Connector;","export { get };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction get() {\n  return {\n    debug: false,\n    initImmediate: true,\n\n    ns: ['translation'],\n    defaultNS: ['translation'],\n    fallbackLng: ['dev'],\n    fallbackNS: false, // string or array of namespaces\n\n    whitelist: false, // array with whitelisted languages\n    nonExplicitWhitelist: false,\n    load: 'all', // | currentOnly | languageOnly\n    preload: false, // array with preload languages\n\n    simplifyPluralSuffix: true,\n    keySeparator: '.',\n    nsSeparator: ':',\n    pluralSeparator: '_',\n    contextSeparator: '_',\n\n    partialBundledLanguages: false, // allow bundling certain languages that are not remotely fetched\n    saveMissing: false, // enable to send missing values\n    updateMissing: false, // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth)\n    saveMissingTo: 'fallback', // 'current' || 'all'\n    saveMissingPlurals: true, // will save all forms not only singular key\n    missingKeyHandler: false, // function(lng, ns, key, fallbackValue) -> override if prefer on handling\n    missingInterpolationHandler: false, // function(str, match)\n\n    postProcess: false, // string or array of postProcessor names\n    returnNull: true, // allows null value as valid translation\n    returnEmptyString: true, // allows empty string value as valid translation\n    returnObjects: false,\n    joinArrays: false, // or string to join array\n    returnedObjectHandler: function returnedObjectHandler() {}, // function(key, value, options) triggered if key returns object but returnObjects is set to false\n    parseMissingKeyHandler: false, // function(key) parsed a key that was not found in t() before returning\n    appendNamespaceToMissingKey: false,\n    appendNamespaceToCIMode: false,\n    overloadTranslationOptionHandler: function handle(args) {\n      var ret = {};\n      if (_typeof(args[1]) === 'object') ret = args[1];\n      if (typeof args[1] === 'string') ret.defaultValue = args[1];\n      if (typeof args[2] === 'string') ret.tDescription = args[2];\n      if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {\n        var options = args[3] || args[2];\n        Object.keys(options).forEach(function (key) {\n          ret[key] = options[key];\n        });\n      }\n      return ret;\n    },\n    interpolation: {\n      escapeValue: true,\n      format: function format(value, _format, lng) {\n        return value;\n      },\n      prefix: '{{',\n      suffix: '}}',\n      formatSeparator: ',',\n      // prefixEscaped: '{{',\n      // suffixEscaped: '}}',\n      // unescapeSuffix: '',\n      unescapePrefix: '-',\n\n      nestingPrefix: '$t(',\n      nestingSuffix: ')',\n      // nestingPrefixEscaped: '$t(',\n      // nestingSuffixEscaped: ')',\n      // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data\n      maxReplaces: 1000 // max replaces to prevent endless loop\n    }\n  };\n}\n\n/* eslint no-param-reassign: 0 */\nexport function transformOptions(options) {\n  // create namespace object if namespace is passed in as string\n  if (typeof options.ns === 'string') options.ns = [options.ns];\n  if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];\n  if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];\n\n  // extend whitelist with cimode\n  if (options.whitelist && options.whitelist.indexOf('cimode') < 0) {\n    options.whitelist = options.whitelist.concat(['cimode']);\n  }\n\n  return options;\n}","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }\n\nimport baseLogger from './logger.js';\nimport EventEmitter from './EventEmitter.js';\nimport ResourceStore from './ResourceStore.js';\nimport Translator from './Translator.js';\nimport LanguageUtils from './LanguageUtils.js';\nimport PluralResolver from './PluralResolver.js';\nimport Interpolator from './Interpolator.js';\nimport BackendConnector from './BackendConnector.js';\nimport { get as getDefaults, transformOptions } from './defaults.js';\nimport postProcessor from './postProcessor.js';\nimport { defer } from './utils.js';\n\nfunction noop() {}\n\nvar I18n = function (_EventEmitter) {\n  _inherits(I18n, _EventEmitter);\n\n  function I18n() {\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var callback = arguments[1];\n\n    _classCallCheck(this, I18n);\n\n    var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n    _this.options = transformOptions(options);\n    _this.services = {};\n    _this.logger = baseLogger;\n    _this.modules = { external: [] };\n\n    if (callback && !_this.isInitialized && !options.isClone) {\n      // https://github.com/i18next/i18next/issues/879\n      if (!_this.options.initImmediate) {\n        var _ret;\n\n        _this.init(options, callback);\n        return _ret = _this, _possibleConstructorReturn(_this, _ret);\n      }\n      setTimeout(function () {\n        _this.init(options, callback);\n      }, 0);\n    }\n    return _this;\n  }\n\n  I18n.prototype.init = function init() {\n    var _this2 = this;\n\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var callback = arguments[1];\n\n    if (typeof options === 'function') {\n      callback = options;\n      options = {};\n    }\n    this.options = _extends({}, getDefaults(), this.options, transformOptions(options));\n\n    this.format = this.options.interpolation.format;\n    if (!callback) callback = noop;\n\n    function createClassOnDemand(ClassOrObject) {\n      if (!ClassOrObject) return null;\n      if (typeof ClassOrObject === 'function') return new ClassOrObject();\n      return ClassOrObject;\n    }\n\n    // init services\n    if (!this.options.isClone) {\n      if (this.modules.logger) {\n        baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n      } else {\n        baseLogger.init(null, this.options);\n      }\n\n      var lu = new LanguageUtils(this.options);\n      this.store = new ResourceStore(this.options.resources, this.options);\n\n      var s = this.services;\n      s.logger = baseLogger;\n      s.resourceStore = this.store;\n      s.languageUtils = lu;\n      s.pluralResolver = new PluralResolver(lu, {\n        prepend: this.options.pluralSeparator,\n        compatibilityJSON: this.options.compatibilityJSON,\n        simplifyPluralSuffix: this.options.simplifyPluralSuffix\n      });\n      s.interpolator = new Interpolator(this.options);\n\n      s.backendConnector = new BackendConnector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n      // pipe events from backendConnector\n      s.backendConnector.on('*', function (event) {\n        for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n          args[_key - 1] = arguments[_key];\n        }\n\n        _this2.emit.apply(_this2, [event].concat(args));\n      });\n\n      if (this.modules.languageDetector) {\n        s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n        s.languageDetector.init(s, this.options.detection, this.options);\n      }\n\n      if (this.modules.i18nFormat) {\n        s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n        if (s.i18nFormat.init) s.i18nFormat.init(this);\n      }\n\n      this.translator = new Translator(this.services, this.options);\n      // pipe events from translator\n      this.translator.on('*', function (event) {\n        for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n          args[_key2 - 1] = arguments[_key2];\n        }\n\n        _this2.emit.apply(_this2, [event].concat(args));\n      });\n\n      this.modules.external.forEach(function (m) {\n        if (m.init) m.init(_this2);\n      });\n    }\n\n    // append api\n    var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n    storeApi.forEach(function (fcName) {\n      _this2[fcName] = function () {\n        var _store;\n\n        return (_store = _this2.store)[fcName].apply(_store, arguments);\n      };\n    });\n\n    var deferred = defer();\n\n    var load = function load() {\n      _this2.changeLanguage(_this2.options.lng, function (err, t) {\n        _this2.isInitialized = true;\n        _this2.logger.log('initialized', _this2.options);\n        _this2.emit('initialized', _this2.options);\n\n        deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning)\n        callback(err, t);\n      });\n    };\n\n    if (this.options.resources || !this.options.initImmediate) {\n      load();\n    } else {\n      setTimeout(load, 0);\n    }\n\n    return deferred;\n  };\n\n  /* eslint consistent-return: 0 */\n\n\n  I18n.prototype.loadResources = function loadResources() {\n    var _this3 = this;\n\n    var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n\n    if (!this.options.resources || this.options.partialBundledLanguages) {\n      if (this.language && this.language.toLowerCase() === 'cimode') return callback(); // avoid loading resources for cimode\n\n      var toLoad = [];\n\n      var append = function append(lng) {\n        if (!lng) return;\n        var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);\n        lngs.forEach(function (l) {\n          if (toLoad.indexOf(l) < 0) toLoad.push(l);\n        });\n      };\n\n      if (!this.language) {\n        // at least load fallbacks in this case\n        var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n        fallbacks.forEach(function (l) {\n          return append(l);\n        });\n      } else {\n        append(this.language);\n      }\n\n      if (this.options.preload) {\n        this.options.preload.forEach(function (l) {\n          return append(l);\n        });\n      }\n\n      this.services.backendConnector.load(toLoad, this.options.ns, callback);\n    } else {\n      callback(null);\n    }\n  };\n\n  I18n.prototype.reloadResources = function reloadResources(lngs, ns, callback) {\n    var deferred = defer();\n    if (!lngs) lngs = this.languages;\n    if (!ns) ns = this.options.ns;\n    if (!callback) callback = noop;\n    this.services.backendConnector.reload(lngs, ns, function () {\n      deferred.resolve();\n      callback(null);\n    });\n    return deferred;\n  };\n\n  I18n.prototype.use = function use(module) {\n    if (module.type === 'backend') {\n      this.modules.backend = module;\n    }\n\n    if (module.type === 'logger' || module.log && module.warn && module.error) {\n      this.modules.logger = module;\n    }\n\n    if (module.type === 'languageDetector') {\n      this.modules.languageDetector = module;\n    }\n\n    if (module.type === 'i18nFormat') {\n      this.modules.i18nFormat = module;\n    }\n\n    if (module.type === 'postProcessor') {\n      postProcessor.addPostProcessor(module);\n    }\n\n    if (module.type === '3rdParty') {\n      this.modules.external.push(module);\n    }\n\n    return this;\n  };\n\n  I18n.prototype.changeLanguage = function changeLanguage(lng, callback) {\n    var _this4 = this;\n\n    var deferred = defer();\n\n    var done = function done(err, l) {\n      _this4.translator.changeLanguage(l);\n\n      if (l) {\n        _this4.emit('languageChanged', l);\n        _this4.logger.log('languageChanged', l);\n      }\n\n      deferred.resolve(function () {\n        return _this4.t.apply(_this4, arguments);\n      });\n      if (callback) callback(err, function () {\n        return _this4.t.apply(_this4, arguments);\n      });\n    };\n\n    var setLng = function setLng(l) {\n      if (l) {\n        _this4.language = l;\n        _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n        if (!_this4.translator.language) _this4.translator.changeLanguage(l);\n\n        if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);\n      }\n\n      _this4.loadResources(function (err) {\n        done(err, l);\n      });\n    };\n\n    if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n      setLng(this.services.languageDetector.detect());\n    } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n      this.services.languageDetector.detect(setLng);\n    } else {\n      setLng(lng);\n    }\n\n    return deferred;\n  };\n\n  I18n.prototype.getFixedT = function getFixedT(lng, ns) {\n    var _this5 = this;\n\n    var fixedT = function fixedT(key, opts) {\n      for (var _len3 = arguments.length, rest = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n        rest[_key3 - 2] = arguments[_key3];\n      }\n\n      var options = _extends({}, opts);\n      if ((typeof opts === 'undefined' ? 'undefined' : _typeof(opts)) !== 'object') {\n        options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n      }\n\n      options.lng = options.lng || fixedT.lng;\n      options.lngs = options.lngs || fixedT.lngs;\n      options.ns = options.ns || fixedT.ns;\n      return _this5.t(key, options);\n    };\n    if (typeof lng === 'string') {\n      fixedT.lng = lng;\n    } else {\n      fixedT.lngs = lng;\n    }\n    fixedT.ns = ns;\n    return fixedT;\n  };\n\n  I18n.prototype.t = function t() {\n    var _translator;\n\n    return this.translator && (_translator = this.translator).translate.apply(_translator, arguments);\n  };\n\n  I18n.prototype.exists = function exists() {\n    var _translator2;\n\n    return this.translator && (_translator2 = this.translator).exists.apply(_translator2, arguments);\n  };\n\n  I18n.prototype.setDefaultNamespace = function setDefaultNamespace(ns) {\n    this.options.defaultNS = ns;\n  };\n\n  I18n.prototype.loadNamespaces = function loadNamespaces(ns, callback) {\n    var _this6 = this;\n\n    var deferred = defer();\n\n    if (!this.options.ns) {\n      callback && callback();\n      return Promise.resolve();\n    }\n    if (typeof ns === 'string') ns = [ns];\n\n    ns.forEach(function (n) {\n      if (_this6.options.ns.indexOf(n) < 0) _this6.options.ns.push(n);\n    });\n\n    this.loadResources(function (err) {\n      deferred.resolve();\n      if (callback) callback(err);\n    });\n\n    return deferred;\n  };\n\n  I18n.prototype.loadLanguages = function loadLanguages(lngs, callback) {\n    var deferred = defer();\n\n    if (typeof lngs === 'string') lngs = [lngs];\n    var preloaded = this.options.preload || [];\n\n    var newLngs = lngs.filter(function (lng) {\n      return preloaded.indexOf(lng) < 0;\n    });\n    // Exit early if all given languages are already preloaded\n    if (!newLngs.length) {\n      if (callback) callback();\n      return Promise.resolve();\n    }\n\n    this.options.preload = preloaded.concat(newLngs);\n    this.loadResources(function (err) {\n      deferred.resolve();\n      if (callback) callback(err);\n    });\n\n    return deferred;\n  };\n\n  I18n.prototype.dir = function dir(lng) {\n    if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language;\n    if (!lng) return 'rtl';\n\n    var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam'];\n\n    return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr';\n  };\n\n  /* eslint class-methods-use-this: 0 */\n\n\n  I18n.prototype.createInstance = function createInstance() {\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var callback = arguments[1];\n\n    return new I18n(options, callback);\n  };\n\n  I18n.prototype.cloneInstance = function cloneInstance() {\n    var _this7 = this;\n\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n\n    var mergedOptions = _extends({}, this.options, options, { isClone: true });\n    var clone = new I18n(mergedOptions);\n    var membersToCopy = ['store', 'services', 'language'];\n    membersToCopy.forEach(function (m) {\n      clone[m] = _this7[m];\n    });\n    clone.translator = new Translator(clone.services, clone.options);\n    clone.translator.on('*', function (event) {\n      for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n        args[_key4 - 1] = arguments[_key4];\n      }\n\n      clone.emit.apply(clone, [event].concat(args));\n    });\n    clone.init(mergedOptions, callback);\n    clone.translator.options = clone.options; // sync options\n\n    return clone;\n  };\n\n  return I18n;\n}(EventEmitter);\n\nexport default new I18n();","import i18next from './i18next.js';\n\nexport default i18next;\n\nexport var changeLanguage = i18next.changeLanguage.bind(i18next);\nexport var cloneInstance = i18next.cloneInstance.bind(i18next);\nexport var createInstance = i18next.createInstance.bind(i18next);\nexport var dir = i18next.dir.bind(i18next);\nexport var exists = i18next.exists.bind(i18next);\nexport var getFixedT = i18next.getFixedT.bind(i18next);\nexport var init = i18next.init.bind(i18next);\nexport var loadLanguages = i18next.loadLanguages.bind(i18next);\nexport var loadNamespaces = i18next.loadNamespaces.bind(i18next);\nexport var loadResources = i18next.loadResources.bind(i18next);\nexport var off = i18next.off.bind(i18next);\nexport var on = i18next.on.bind(i18next);\nexport var setDefaultNamespace = i18next.setDefaultNamespace.bind(i18next);\nexport var t = i18next.t.bind(i18next);\nexport var use = i18next.use.bind(i18next);","export function decode(bytes, encoding = 'utf8') {\n    const decoder = new TextDecoder(encoding);\n    return decoder.decode(bytes);\n}\nconst encoder = new TextEncoder();\nexport function encode(str) {\n    return encoder.encode(str);\n}\n//# sourceMappingURL=text.js.map","import { decode, encode } from './text';\nconst defaultByteLength = 1024 * 8;\nconst hostBigEndian = (() => {\n    const array = new Uint8Array(4);\n    const view = new Uint32Array(array.buffer);\n    return !((view[0] = 1) & array[0]);\n})();\nconst typedArrays = {\n    int8: globalThis.Int8Array,\n    uint8: globalThis.Uint8Array,\n    int16: globalThis.Int16Array,\n    uint16: globalThis.Uint16Array,\n    int32: globalThis.Int32Array,\n    uint32: globalThis.Uint32Array,\n    uint64: globalThis.BigUint64Array,\n    int64: globalThis.BigInt64Array,\n    float32: globalThis.Float32Array,\n    float64: globalThis.Float64Array,\n};\nexport class IOBuffer {\n    /**\n     * Reference to the internal ArrayBuffer object.\n     */\n    buffer;\n    /**\n     * Byte length of the internal ArrayBuffer.\n     */\n    byteLength;\n    /**\n     * Byte offset of the internal ArrayBuffer.\n     */\n    byteOffset;\n    /**\n     * Byte length of the internal ArrayBuffer.\n     */\n    length;\n    /**\n     * The current offset of the buffer's pointer.\n     */\n    offset;\n    lastWrittenByte;\n    littleEndian;\n    _data;\n    _mark;\n    _marks;\n    /**\n     * Create a new IOBuffer.\n     * @param data - The data to construct the IOBuffer with.\n     * If data is a number, it will be the new buffer's length<br>\n     * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>\n     * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,\n     * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.\n     * @param options - An object for the options.\n     * @returns A new IOBuffer instance.\n     */\n    constructor(data = defaultByteLength, options = {}) {\n        let dataIsGiven = false;\n        if (typeof data === 'number') {\n            data = new ArrayBuffer(data);\n        }\n        else {\n            dataIsGiven = true;\n            this.lastWrittenByte = data.byteLength;\n        }\n        const offset = options.offset ? options.offset >>> 0 : 0;\n        const byteLength = data.byteLength - offset;\n        let dvOffset = offset;\n        if (ArrayBuffer.isView(data) || data instanceof IOBuffer) {\n            if (data.byteLength !== data.buffer.byteLength) {\n                dvOffset = data.byteOffset + offset;\n            }\n            data = data.buffer;\n        }\n        if (dataIsGiven) {\n            this.lastWrittenByte = byteLength;\n        }\n        else {\n            this.lastWrittenByte = 0;\n        }\n        this.buffer = data;\n        this.length = byteLength;\n        this.byteLength = byteLength;\n        this.byteOffset = dvOffset;\n        this.offset = 0;\n        this.littleEndian = true;\n        this._data = new DataView(this.buffer, dvOffset, byteLength);\n        this._mark = 0;\n        this._marks = [];\n    }\n    /**\n     * Checks if the memory allocated to the buffer is sufficient to store more\n     * bytes after the offset.\n     * @param byteLength - The needed memory in bytes.\n     * @returns `true` if there is sufficient space and `false` otherwise.\n     */\n    available(byteLength = 1) {\n        return this.offset + byteLength <= this.length;\n    }\n    /**\n     * Check if little-endian mode is used for reading and writing multi-byte\n     * values.\n     * @returns `true` if little-endian mode is used, `false` otherwise.\n     */\n    isLittleEndian() {\n        return this.littleEndian;\n    }\n    /**\n     * Set little-endian mode for reading and writing multi-byte values.\n     * @returns This.\n     */\n    setLittleEndian() {\n        this.littleEndian = true;\n        return this;\n    }\n    /**\n     * Check if big-endian mode is used for reading and writing multi-byte values.\n     * @returns `true` if big-endian mode is used, `false` otherwise.\n     */\n    isBigEndian() {\n        return !this.littleEndian;\n    }\n    /**\n     * Switches to big-endian mode for reading and writing multi-byte values.\n     * @returns This.\n     */\n    setBigEndian() {\n        this.littleEndian = false;\n        return this;\n    }\n    /**\n     * Move the pointer n bytes forward.\n     * @param n - Number of bytes to skip.\n     * @returns This.\n     */\n    skip(n = 1) {\n        this.offset += n;\n        return this;\n    }\n    /**\n     * Move the pointer n bytes backward.\n     * @param n - Number of bytes to move back.\n     * @returns This.\n     */\n    back(n = 1) {\n        this.offset -= n;\n        return this;\n    }\n    /**\n     * Move the pointer to the given offset.\n     * @param offset - The offset to move to.\n     * @returns This.\n     */\n    seek(offset) {\n        this.offset = offset;\n        return this;\n    }\n    /**\n     * Store the current pointer offset.\n     * @see {@link IOBuffer#reset}\n     * @returns This.\n     */\n    mark() {\n        this._mark = this.offset;\n        return this;\n    }\n    /**\n     * Move the pointer back to the last pointer offset set by mark.\n     * @see {@link IOBuffer#mark}\n     * @returns This.\n     */\n    reset() {\n        this.offset = this._mark;\n        return this;\n    }\n    /**\n     * Push the current pointer offset to the mark stack.\n     * @see {@link IOBuffer#popMark}\n     * @returns This.\n     */\n    pushMark() {\n        this._marks.push(this.offset);\n        return this;\n    }\n    /**\n     * Pop the last pointer offset from the mark stack, and set the current\n     * pointer offset to the popped value.\n     * @see {@link IOBuffer#pushMark}\n     * @returns This.\n     */\n    popMark() {\n        const offset = this._marks.pop();\n        if (offset === undefined) {\n            throw new Error('Mark stack empty');\n        }\n        this.seek(offset);\n        return this;\n    }\n    /**\n     * Move the pointer offset back to 0.\n     * @returns This.\n     */\n    rewind() {\n        this.offset = 0;\n        return this;\n    }\n    /**\n     * Make sure the buffer has sufficient memory to write a given byteLength at\n     * the current pointer offset.\n     * If the buffer's memory is insufficient, this method will create a new\n     * buffer (a copy) with a length that is twice (byteLength + current offset).\n     * @param byteLength - The needed memory in bytes.\n     * @returns This.\n     */\n    ensureAvailable(byteLength = 1) {\n        if (!this.available(byteLength)) {\n            const lengthNeeded = this.offset + byteLength;\n            const newLength = lengthNeeded * 2;\n            const newArray = new Uint8Array(newLength);\n            newArray.set(new Uint8Array(this.buffer));\n            this.buffer = newArray.buffer;\n            this.length = newLength;\n            this.byteLength = newLength;\n            this._data = new DataView(this.buffer);\n        }\n        return this;\n    }\n    /**\n     * Read a byte and return false if the byte's value is 0, or true otherwise.\n     * Moves pointer forward by one byte.\n     * @returns The read boolean.\n     */\n    readBoolean() {\n        return this.readUint8() !== 0;\n    }\n    /**\n     * Read a signed 8-bit integer and move pointer forward by 1 byte.\n     * @returns The read byte.\n     */\n    readInt8() {\n        return this._data.getInt8(this.offset++);\n    }\n    /**\n     * Read an unsigned 8-bit integer and move pointer forward by 1 byte.\n     * @returns The read byte.\n     */\n    readUint8() {\n        return this._data.getUint8(this.offset++);\n    }\n    /**\n     * Alias for {@link IOBuffer#readUint8}.\n     * @returns The read byte.\n     */\n    readByte() {\n        return this.readUint8();\n    }\n    /**\n     * Read `n` bytes and move pointer forward by `n` bytes.\n     * @param n - Number of bytes to read.\n     * @returns The read bytes.\n     */\n    readBytes(n = 1) {\n        return this.readArray(n, 'uint8');\n    }\n    /**\n     * Creates an array of corresponding to the type `type` and size `size`.\n     * For example type `uint8` will create a `Uint8Array`.\n     * @param size - size of the resulting array\n     * @param type - number type of elements to read\n     * @returns The read array.\n     */\n    readArray(size, type) {\n        const bytes = typedArrays[type].BYTES_PER_ELEMENT * size;\n        const offset = this.byteOffset + this.offset;\n        const slice = this.buffer.slice(offset, offset + bytes);\n        if (this.littleEndian === hostBigEndian &&\n            type !== 'uint8' &&\n            type !== 'int8') {\n            const slice = new Uint8Array(this.buffer.slice(offset, offset + bytes));\n            slice.reverse();\n            const returnArray = new typedArrays[type](slice.buffer);\n            this.offset += bytes;\n            returnArray.reverse();\n            return returnArray;\n        }\n        const returnArray = new typedArrays[type](slice);\n        this.offset += bytes;\n        return returnArray;\n    }\n    /**\n     * Read a 16-bit signed integer and move pointer forward by 2 bytes.\n     * @returns The read value.\n     */\n    readInt16() {\n        const value = this._data.getInt16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n    /**\n     * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.\n     * @returns The read value.\n     */\n    readUint16() {\n        const value = this._data.getUint16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n    /**\n     * Read a 32-bit signed integer and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readInt32() {\n        const value = this._data.getInt32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readUint32() {\n        const value = this._data.getUint32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 32-bit floating number and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readFloat32() {\n        const value = this._data.getFloat32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 64-bit floating number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readFloat64() {\n        const value = this._data.getFloat64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 64-bit signed integer number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readBigInt64() {\n        const value = this._data.getBigInt64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readBigUint64() {\n        const value = this._data.getBigUint64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 1-byte ASCII character and move pointer forward by 1 byte.\n     * @returns The read character.\n     */\n    readChar() {\n        // eslint-disable-next-line unicorn/prefer-code-point\n        return String.fromCharCode(this.readInt8());\n    }\n    /**\n     * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.\n     * @param n - Number of characters to read.\n     * @returns The read characters.\n     */\n    readChars(n = 1) {\n        let result = '';\n        for (let i = 0; i < n; i++) {\n            result += this.readChar();\n        }\n        return result;\n    }\n    /**\n     * Read the next `n` bytes, return a UTF-8 decoded string and move pointer\n     * forward by `n` bytes.\n     * @param n - Number of bytes to read.\n     * @returns The decoded string.\n     */\n    readUtf8(n = 1) {\n        return decode(this.readBytes(n));\n    }\n    /**\n     * Read the next `n` bytes, return a string decoded with `encoding` and move pointer\n     * forward by `n` bytes.\n     * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}\n     * @param n - Number of bytes to read.\n     * @param encoding - The encoding to use. Default is 'utf8'.\n     * @returns The decoded string.\n     */\n    decodeText(n = 1, encoding = 'utf8') {\n        return decode(this.readBytes(n), encoding);\n    }\n    /**\n     * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer\n     * forward by 1 byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBoolean(value) {\n        this.writeUint8(value ? 0xff : 0x00);\n        return this;\n    }\n    /**\n     * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt8(value) {\n        this.ensureAvailable(1);\n        this._data.setInt8(this.offset++, value);\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as an 8-bit unsigned integer and move pointer forward by 1\n     * byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint8(value) {\n        this.ensureAvailable(1);\n        this._data.setUint8(this.offset++, value);\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * An alias for {@link IOBuffer#writeUint8}.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeByte(value) {\n        return this.writeUint8(value);\n    }\n    /**\n     * Write all elements of `bytes` as uint8 values and move pointer forward by\n     * `bytes.length` bytes.\n     * @param bytes - The array of bytes to write.\n     * @returns This.\n     */\n    writeBytes(bytes) {\n        this.ensureAvailable(bytes.length);\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < bytes.length; i++) {\n            this._data.setUint8(this.offset++, bytes[i]);\n        }\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 16-bit signed integer and move pointer forward by 2\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt16(value) {\n        this.ensureAvailable(2);\n        this._data.setInt16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 16-bit unsigned integer and move pointer forward by 2\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint16(value) {\n        this.ensureAvailable(2);\n        this._data.setUint16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit signed integer and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt32(value) {\n        this.ensureAvailable(4);\n        this._data.setInt32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit unsigned integer and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint32(value) {\n        this.ensureAvailable(4);\n        this._data.setUint32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit floating number and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeFloat32(value) {\n        this.ensureAvailable(4);\n        this._data.setFloat32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit floating number and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeFloat64(value) {\n        this.ensureAvailable(8);\n        this._data.setFloat64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit signed bigint and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBigInt64(value) {\n        this.ensureAvailable(8);\n        this._data.setBigInt64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBigUint64(value) {\n        this.ensureAvailable(8);\n        this._data.setBigUint64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write the charCode of `str`'s first character as an 8-bit unsigned integer\n     * and move pointer forward by 1 byte.\n     * @param str - The character to write.\n     * @returns This.\n     */\n    writeChar(str) {\n        // eslint-disable-next-line unicorn/prefer-code-point\n        return this.writeUint8(str.charCodeAt(0));\n    }\n    /**\n     * Write the charCodes of all `str`'s characters as 8-bit unsigned integers\n     * and move pointer forward by `str.length` bytes.\n     * @param str - The characters to write.\n     * @returns This.\n     */\n    writeChars(str) {\n        for (let i = 0; i < str.length; i++) {\n            // eslint-disable-next-line unicorn/prefer-code-point\n            this.writeUint8(str.charCodeAt(i));\n        }\n        return this;\n    }\n    /**\n     * UTF-8 encode and write `str` to the current pointer offset and move pointer\n     * forward according to the encoded length.\n     * @param str - The string to write.\n     * @returns This.\n     */\n    writeUtf8(str) {\n        return this.writeBytes(encode(str));\n    }\n    /**\n     * Export a Uint8Array view of the internal buffer.\n     * The view starts at the byte offset and its length\n     * is calculated to stop at the last written byte or the original length.\n     * @returns A new Uint8Array view.\n     */\n    toArray() {\n        return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);\n    }\n    /**\n     *  Get the total number of bytes written so far, regardless of the current offset.\n     * @returns - Total number of bytes.\n     */\n    getWrittenByteLength() {\n        return this.lastWrittenByte - this.byteOffset;\n    }\n    /**\n     * Update the last written byte offset\n     * @private\n     */\n    _updateLastWrittenByte() {\n        if (this.offset > this.lastWrittenByte) {\n            this.lastWrittenByte = this.offset;\n        }\n    }\n}\n//# sourceMappingURL=IOBuffer.js.map"],"names":[],"sourceRoot":""}