import V from "./index.es92.js";
import x from "./index.es93.js";
import w from "./index.es94.js";
import k from "./index.es95.js";
import D from "./index.es96.js";
import z from "./index.es97.js";
import j from "./index.es98.js";
import W from "./index.es99.js";
var ve = {
  type: "logger",
  log: function(i) {
    this.output("log", i);
  },
  warn: function(i) {
    this.output("warn", i);
  },
  error: function(i) {
    this.output("error", i);
  },
  output: function(i, n) {
    console && console[i] && console[i].apply(console, n);
  }
}, me = function() {
  function o(i) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    w(this, o), this.init(i, n);
  }
  return k(o, [{
    key: "init",
    value: function(n) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      this.prefix = e.prefix || "i18next:", this.logger = n || ve, this.options = e, this.debug = e.debug;
    }
  }, {
    key: "setDebug",
    value: function(n) {
      this.debug = n;
    }
  }, {
    key: "log",
    value: function() {
      for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
        e[t] = arguments[t];
      return this.forward(e, "log", "", !0);
    }
  }, {
    key: "warn",
    value: function() {
      for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
        e[t] = arguments[t];
      return this.forward(e, "warn", "", !0);
    }
  }, {
    key: "error",
    value: function() {
      for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
        e[t] = arguments[t];
      return this.forward(e, "error", "");
    }
  }, {
    key: "deprecate",
    value: function() {
      for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
        e[t] = arguments[t];
      return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
    }
  }, {
    key: "forward",
    value: function(n, e, t, r) {
      return r && !this.debug ? null : (typeof n[0] == "string" && (n[0] = "".concat(t).concat(this.prefix, " ").concat(n[0])), this.logger[e](n));
    }
  }, {
    key: "create",
    value: function(n) {
      return new o(this.logger, x({}, {
        prefix: "".concat(this.prefix, ":").concat(n, ":")
      }, this.options));
    }
  }]), o;
}(), S = new me(), O = function() {
  function o() {
    w(this, o), this.observers = {};
  }
  return k(o, [{
    key: "on",
    value: function(n, e) {
      var t = this;
      return n.split(" ").forEach(function(r) {
        t.observers[r] = t.observers[r] || [], t.observers[r].push(e);
      }), this;
    }
  }, {
    key: "off",
    value: function(n, e) {
      if (this.observers[n]) {
        if (!e) {
          delete this.observers[n];
          return;
        }
        this.observers[n] = this.observers[n].filter(function(t) {
          return t !== e;
        });
      }
    }
  }, {
    key: "emit",
    value: function(n) {
      for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
        t[r - 1] = arguments[r];
      if (this.observers[n]) {
        var s = [].concat(this.observers[n]);
        s.forEach(function(u) {
          u.apply(void 0, t);
        });
      }
      if (this.observers["*"]) {
        var a = [].concat(this.observers["*"]);
        a.forEach(function(u) {
          u.apply(u, [n].concat(t));
        });
      }
    }
  }]), o;
}();
function U() {
  var o, i, n = new Promise(function(e, t) {
    o = e, i = t;
  });
  return n.resolve = o, n.reject = i, n;
}
function se(o) {
  return o == null ? "" : "" + o;
}
function ye(o, i, n) {
  o.forEach(function(e) {
    i[e] && (n[e] = i[e]);
  });
}
function Q(o, i, n) {
  function e(a) {
    return a && a.indexOf("###") > -1 ? a.replace(/###/g, ".") : a;
  }
  function t() {
    return !o || typeof o == "string";
  }
  for (var r = typeof i != "string" ? [].concat(i) : i.split("."); r.length > 1; ) {
    if (t())
      return {};
    var s = e(r.shift());
    !o[s] && n && (o[s] = new n()), Object.prototype.hasOwnProperty.call(o, s) ? o = o[s] : o = {};
  }
  return t() ? {} : {
    obj: o,
    k: e(r.shift())
  };
}
function oe(o, i, n) {
  var e = Q(o, i, Object), t = e.obj, r = e.k;
  t[r] = n;
}
function be(o, i, n, e) {
  var t = Q(o, i, Object), r = t.obj, s = t.k;
  r[s] = r[s] || [], e && (r[s] = r[s].concat(n)), e || r[s].push(n);
}
function M(o, i) {
  var n = Q(o, i), e = n.obj, t = n.k;
  if (e)
    return e[t];
}
function ue(o, i, n) {
  var e = M(o, n);
  return e !== void 0 ? e : M(i, n);
}
function ge(o, i, n) {
  for (var e in i)
    e !== "__proto__" && e !== "constructor" && (e in o ? typeof o[e] == "string" || o[e] instanceof String || typeof i[e] == "string" || i[e] instanceof String ? n && (o[e] = i[e]) : ge(o[e], i[e], n) : o[e] = i[e]);
  return o;
}
function F(o) {
  return o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var xe = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
function Le(o) {
  return typeof o == "string" ? o.replace(/[&<>"'\/]/g, function(i) {
    return xe[i];
  }) : o;
}
var $ = typeof window < "u" && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, Se = function(o) {
  W(i, o);
  function i(n) {
    var e, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      ns: ["translation"],
      defaultNS: "translation"
    };
    return w(this, i), e = D(this, z(i).call(this)), $ && O.call(j(e)), e.data = n || {}, e.options = t, e.options.keySeparator === void 0 && (e.options.keySeparator = "."), e;
  }
  return k(i, [{
    key: "addNamespaces",
    value: function(e) {
      this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
    }
  }, {
    key: "removeNamespaces",
    value: function(e) {
      var t = this.options.ns.indexOf(e);
      t > -1 && this.options.ns.splice(t, 1);
    }
  }, {
    key: "getResource",
    value: function(e, t, r) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, u = [e, t];
      return r && typeof r != "string" && (u = u.concat(r)), r && typeof r == "string" && (u = u.concat(a ? r.split(a) : r)), e.indexOf(".") > -1 && (u = e.split(".")), M(this.data, u);
    }
  }, {
    key: "addResource",
    value: function(e, t, r, s) {
      var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
        silent: !1
      }, u = this.options.keySeparator;
      u === void 0 && (u = ".");
      var l = [e, t];
      r && (l = l.concat(u ? r.split(u) : r)), e.indexOf(".") > -1 && (l = e.split("."), s = t, t = l[1]), this.addNamespaces(t), oe(this.data, l, s), a.silent || this.emit("added", e, t, r, s);
    }
  }, {
    key: "addResources",
    value: function(e, t, r) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
        silent: !1
      };
      for (var a in r)
        (typeof r[a] == "string" || Object.prototype.toString.apply(r[a]) === "[object Array]") && this.addResource(e, t, a, r[a], {
          silent: !0
        });
      s.silent || this.emit("added", e, t, r);
    }
  }, {
    key: "addResourceBundle",
    value: function(e, t, r, s, a) {
      var u = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
        silent: !1
      }, l = [e, t];
      e.indexOf(".") > -1 && (l = e.split("."), s = r, r = t, t = l[1]), this.addNamespaces(t);
      var f = M(this.data, l) || {};
      s ? ge(f, r, a) : f = x({}, f, r), oe(this.data, l, f), u.silent || this.emit("added", e, t, r);
    }
  }, {
    key: "removeResourceBundle",
    value: function(e, t) {
      this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
    }
  }, {
    key: "hasResourceBundle",
    value: function(e, t) {
      return this.getResource(e, t) !== void 0;
    }
  }, {
    key: "getResourceBundle",
    value: function(e, t) {
      return t || (t = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? x({}, {}, this.getResource(e, t)) : this.getResource(e, t);
    }
  }, {
    key: "getDataByLanguage",
    value: function(e) {
      return this.data[e];
    }
  }, {
    key: "toJSON",
    value: function() {
      return this.data;
    }
  }]), i;
}(O), he = {
  processors: {},
  addPostProcessor: function(i) {
    this.processors[i.name] = i;
  },
  handle: function(i, n, e, t, r) {
    var s = this;
    return i.forEach(function(a) {
      s.processors[a] && (n = s.processors[a].process(n, e, t, r));
    }), n;
  }
}, le = {}, fe = function(o) {
  W(i, o);
  function i(n) {
    var e, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return w(this, i), e = D(this, z(i).call(this)), $ && O.call(j(e)), ye(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], n, j(e)), e.options = t, e.options.keySeparator === void 0 && (e.options.keySeparator = "."), e.logger = S.create("translator"), e;
  }
  return k(i, [{
    key: "changeLanguage",
    value: function(e) {
      e && (this.language = e);
    }
  }, {
    key: "exists",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        interpolation: {}
      }, r = this.resolve(e, t);
      return r && r.res !== void 0;
    }
  }, {
    key: "extractFromKey",
    value: function(e, t) {
      var r = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
      r === void 0 && (r = ":");
      var s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, a = t.ns || this.options.defaultNS;
      if (r && e.indexOf(r) > -1) {
        var u = e.match(this.interpolator.nestingRegexp);
        if (u && u.length > 0)
          return {
            key: e,
            namespaces: a
          };
        var l = e.split(r);
        (r !== s || r === s && this.options.ns.indexOf(l[0]) > -1) && (a = l.shift()), e = l.join(s);
      }
      return typeof a == "string" && (a = [a]), {
        key: e,
        namespaces: a
      };
    }
  }, {
    key: "translate",
    value: function(e, t, r) {
      var s = this;
      if (V(t) !== "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), t || (t = {}), e == null)
        return "";
      Array.isArray(e) || (e = [String(e)]);
      var a = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, u = this.extractFromKey(e[e.length - 1], t), l = u.key, f = u.namespaces, c = f[f.length - 1], d = t.lng || this.language, m = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
      if (d && d.toLowerCase() === "cimode") {
        if (m) {
          var p = t.nsSeparator || this.options.nsSeparator;
          return c + p + l;
        }
        return l;
      }
      var h = this.resolve(e, t), g = h && h.res, v = h && h.usedKey || l, y = h && h.exactUsedKey || l, b = Object.prototype.toString.apply(g), R = ["[object Number]", "[object Function]", "[object RegExp]"], L = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, N = !this.i18nFormat || this.i18nFormat.handleAsObject, T = typeof g != "string" && typeof g != "boolean" && typeof g != "number";
      if (N && g && T && R.indexOf(b) < 0 && !(typeof L == "string" && b === "[object Array]")) {
        if (!t.returnObjects && !this.options.returnObjects)
          return this.logger.warn("accessing an object - but returnObjects options is not enabled!"), this.options.returnedObjectHandler ? this.options.returnedObjectHandler(v, g, t) : "key '".concat(l, " (").concat(this.language, ")' returned an object instead of string.");
        if (a) {
          var X = b === "[object Array]", _ = X ? [] : {}, pe = X ? y : v;
          for (var P in g)
            if (Object.prototype.hasOwnProperty.call(g, P)) {
              var Z = "".concat(pe).concat(a).concat(P);
              _[P] = this.translate(Z, x({}, t, {
                joinArrays: !1,
                ns: f
              })), _[P] === Z && (_[P] = g[P]);
            }
          g = _;
        }
      } else if (N && typeof L == "string" && b === "[object Array]")
        g = g.join(L), g && (g = this.extendTranslation(g, e, t, r));
      else {
        var ee = !1, H = !1, te = t.count !== void 0 && typeof t.count != "string", ne = i.hasDefaultValue(t), de = te ? this.pluralResolver.getSuffix(d, t.count) : "", I = t["defaultValue".concat(de)] || t.defaultValue;
        !this.isValidLookup(g) && ne && (ee = !0, g = I), this.isValidLookup(g) || (H = !0, g = l);
        var C = ne && I !== g && this.options.updateMissing;
        if (H || ee || C) {
          if (this.logger.log(C ? "updateKey" : "missingKey", d, c, l, C ? I : g), a) {
            var re = this.resolve(l, x({}, t, {
              keySeparator: !1
            }));
            re && re.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
          }
          var A = [], K = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
          if (this.options.saveMissingTo === "fallback" && K && K[0])
            for (var J = 0; J < K.length; J++)
              A.push(K[J]);
          else
            this.options.saveMissingTo === "all" ? A = this.languageUtils.toResolveHierarchy(t.lng || this.language) : A.push(t.lng || this.language);
          var ie = function(E, G, ae) {
            s.options.missingKeyHandler ? s.options.missingKeyHandler(E, c, G, C ? ae : g, C, t) : s.backendConnector && s.backendConnector.saveMissing && s.backendConnector.saveMissing(E, c, G, C ? ae : g, C, t), s.emit("missingKey", E, c, G, g);
          };
          this.options.saveMissing && (this.options.saveMissingPlurals && te ? A.forEach(function(Y) {
            s.pluralResolver.getSuffixes(Y).forEach(function(E) {
              ie([Y], l + E, t["defaultValue".concat(E)] || I);
            });
          }) : ie(A, l, I));
        }
        g = this.extendTranslation(g, e, t, h, r), H && g === l && this.options.appendNamespaceToMissingKey && (g = "".concat(c, ":").concat(l)), H && this.options.parseMissingKeyHandler && (g = this.options.parseMissingKeyHandler(g));
      }
      return g;
    }
  }, {
    key: "extendTranslation",
    value: function(e, t, r, s, a) {
      var u = this;
      if (this.i18nFormat && this.i18nFormat.parse)
        e = this.i18nFormat.parse(e, r, s.usedLng, s.usedNS, s.usedKey, {
          resolved: s
        });
      else if (!r.skipInterpolation) {
        r.interpolation && this.interpolator.init(x({}, r, {
          interpolation: x({}, this.options.interpolation, r.interpolation)
        }));
        var l = r.interpolation && r.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables, f;
        if (l) {
          var c = e.match(this.interpolator.nestingRegexp);
          f = c && c.length;
        }
        var d = r.replace && typeof r.replace != "string" ? r.replace : r;
        if (this.options.interpolation.defaultVariables && (d = x({}, this.options.interpolation.defaultVariables, d)), e = this.interpolator.interpolate(e, d, r.lng || this.language, r), l) {
          var m = e.match(this.interpolator.nestingRegexp), p = m && m.length;
          f < p && (r.nest = !1);
        }
        r.nest !== !1 && (e = this.interpolator.nest(e, function() {
          for (var v = arguments.length, y = new Array(v), b = 0; b < v; b++)
            y[b] = arguments[b];
          return a && a[0] === y[0] && !r.context ? (u.logger.warn("It seems you are nesting recursively key: ".concat(y[0], " in key: ").concat(t[0])), null) : u.translate.apply(u, y.concat([t]));
        }, r)), r.interpolation && this.interpolator.reset();
      }
      var h = r.postProcess || this.options.postProcess, g = typeof h == "string" ? [h] : h;
      return e != null && g && g.length && r.applyPostProcessor !== !1 && (e = he.handle(g, e, t, this.options && this.options.postProcessPassResolved ? x({
        i18nResolved: s
      }, r) : r, this)), e;
    }
  }, {
    key: "resolve",
    value: function(e) {
      var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, a, u, l, f;
      return typeof e == "string" && (e = [e]), e.forEach(function(c) {
        if (!t.isValidLookup(s)) {
          var d = t.extractFromKey(c, r), m = d.key;
          a = m;
          var p = d.namespaces;
          t.options.fallbackNS && (p = p.concat(t.options.fallbackNS));
          var h = r.count !== void 0 && typeof r.count != "string", g = r.context !== void 0 && typeof r.context == "string" && r.context !== "", v = r.lngs ? r.lngs : t.languageUtils.toResolveHierarchy(r.lng || t.language, r.fallbackLng);
          p.forEach(function(y) {
            t.isValidLookup(s) || (f = y, !le["".concat(v[0], "-").concat(y)] && t.utils && t.utils.hasLoadedNamespace && !t.utils.hasLoadedNamespace(f) && (le["".concat(v[0], "-").concat(y)] = !0, t.logger.warn('key "'.concat(a, '" for languages "').concat(v.join(", "), `" won't get resolved as namespace "`).concat(f, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), v.forEach(function(b) {
              if (!t.isValidLookup(s)) {
                l = b;
                var R = m, L = [R];
                if (t.i18nFormat && t.i18nFormat.addLookupKeys)
                  t.i18nFormat.addLookupKeys(L, m, b, y, r);
                else {
                  var N;
                  h && (N = t.pluralResolver.getSuffix(b, r.count)), h && g && L.push(R + N), g && L.push(R += "".concat(t.options.contextSeparator).concat(r.context)), h && L.push(R += N);
                }
                for (var T; T = L.pop(); )
                  t.isValidLookup(s) || (u = T, s = t.getResource(b, y, T, r));
              }
            }));
          });
        }
      }), {
        res: s,
        usedKey: a,
        exactUsedKey: u,
        usedLng: l,
        usedNS: f
      };
    }
  }, {
    key: "isValidLookup",
    value: function(e) {
      return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
    }
  }, {
    key: "getResource",
    value: function(e, t, r) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, t, r, s) : this.resourceStore.getResource(e, t, r, s);
    }
  }], [{
    key: "hasDefaultValue",
    value: function(e) {
      var t = "defaultValue";
      for (var r in e)
        if (Object.prototype.hasOwnProperty.call(e, r) && t === r.substring(0, t.length) && e[r] !== void 0)
          return !0;
      return !1;
    }
  }]), i;
}(O);
function q(o) {
  return o.charAt(0).toUpperCase() + o.slice(1);
}
var we = function() {
  function o(i) {
    w(this, o), this.options = i, this.whitelist = this.options.supportedLngs || !1, this.supportedLngs = this.options.supportedLngs || !1, this.logger = S.create("languageUtils");
  }
  return k(o, [{
    key: "getScriptPartFromCode",
    value: function(n) {
      if (!n || n.indexOf("-") < 0)
        return null;
      var e = n.split("-");
      return e.length === 2 || (e.pop(), e[e.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(e.join("-"));
    }
  }, {
    key: "getLanguagePartFromCode",
    value: function(n) {
      if (!n || n.indexOf("-") < 0)
        return n;
      var e = n.split("-");
      return this.formatLanguageCode(e[0]);
    }
  }, {
    key: "formatLanguageCode",
    value: function(n) {
      if (typeof n == "string" && n.indexOf("-") > -1) {
        var e = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], t = n.split("-");
        return this.options.lowerCaseLng ? t = t.map(function(r) {
          return r.toLowerCase();
        }) : t.length === 2 ? (t[0] = t[0].toLowerCase(), t[1] = t[1].toUpperCase(), e.indexOf(t[1].toLowerCase()) > -1 && (t[1] = q(t[1].toLowerCase()))) : t.length === 3 && (t[0] = t[0].toLowerCase(), t[1].length === 2 && (t[1] = t[1].toUpperCase()), t[0] !== "sgn" && t[2].length === 2 && (t[2] = t[2].toUpperCase()), e.indexOf(t[1].toLowerCase()) > -1 && (t[1] = q(t[1].toLowerCase())), e.indexOf(t[2].toLowerCase()) > -1 && (t[2] = q(t[2].toLowerCase()))), t.join("-");
      }
      return this.options.cleanCode || this.options.lowerCaseLng ? n.toLowerCase() : n;
    }
  }, {
    key: "isWhitelisted",
    value: function(n) {
      return this.logger.deprecate("languageUtils.isWhitelisted", `function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`), this.isSupportedCode(n);
    }
  }, {
    key: "isSupportedCode",
    value: function(n) {
      return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (n = this.getLanguagePartFromCode(n)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(n) > -1;
    }
  }, {
    key: "getBestMatchFromCodes",
    value: function(n) {
      var e = this;
      if (!n)
        return null;
      var t;
      return n.forEach(function(r) {
        if (!t) {
          var s = e.formatLanguageCode(r);
          (!e.options.supportedLngs || e.isSupportedCode(s)) && (t = s);
        }
      }), !t && this.options.supportedLngs && n.forEach(function(r) {
        if (!t) {
          var s = e.getLanguagePartFromCode(r);
          if (e.isSupportedCode(s))
            return t = s;
          t = e.options.supportedLngs.find(function(a) {
            if (a.indexOf(s) === 0)
              return a;
          });
        }
      }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
    }
  }, {
    key: "getFallbackCodes",
    value: function(n, e) {
      if (!n)
        return [];
      if (typeof n == "function" && (n = n(e)), typeof n == "string" && (n = [n]), Object.prototype.toString.apply(n) === "[object Array]")
        return n;
      if (!e)
        return n.default || [];
      var t = n[e];
      return t || (t = n[this.getScriptPartFromCode(e)]), t || (t = n[this.formatLanguageCode(e)]), t || (t = n[this.getLanguagePartFromCode(e)]), t || (t = n.default), t || [];
    }
  }, {
    key: "toResolveHierarchy",
    value: function(n, e) {
      var t = this, r = this.getFallbackCodes(e || this.options.fallbackLng || [], n), s = [], a = function(l) {
        l && (t.isSupportedCode(l) ? s.push(l) : t.logger.warn("rejecting language code not found in supportedLngs: ".concat(l)));
      };
      return typeof n == "string" && n.indexOf("-") > -1 ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(n)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(n)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(n))) : typeof n == "string" && a(this.formatLanguageCode(n)), r.forEach(function(u) {
        s.indexOf(u) < 0 && a(t.formatLanguageCode(u));
      }), s;
    }
  }]), o;
}(), ke = [{
  lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
  nr: [1, 2],
  fc: 1
}, {
  lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
  nr: [1, 2],
  fc: 2
}, {
  lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "kk", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
  nr: [1],
  fc: 3
}, {
  lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
  nr: [1, 2, 5],
  fc: 4
}, {
  lngs: ["ar"],
  nr: [0, 1, 2, 3, 11, 100],
  fc: 5
}, {
  lngs: ["cs", "sk"],
  nr: [1, 2, 5],
  fc: 6
}, {
  lngs: ["csb", "pl"],
  nr: [1, 2, 5],
  fc: 7
}, {
  lngs: ["cy"],
  nr: [1, 2, 3, 8],
  fc: 8
}, {
  lngs: ["fr"],
  nr: [1, 2],
  fc: 9
}, {
  lngs: ["ga"],
  nr: [1, 2, 3, 7, 11],
  fc: 10
}, {
  lngs: ["gd"],
  nr: [1, 2, 3, 20],
  fc: 11
}, {
  lngs: ["is"],
  nr: [1, 2],
  fc: 12
}, {
  lngs: ["jv"],
  nr: [0, 1],
  fc: 13
}, {
  lngs: ["kw"],
  nr: [1, 2, 3, 4],
  fc: 14
}, {
  lngs: ["lt"],
  nr: [1, 2, 10],
  fc: 15
}, {
  lngs: ["lv"],
  nr: [1, 2, 0],
  fc: 16
}, {
  lngs: ["mk"],
  nr: [1, 2],
  fc: 17
}, {
  lngs: ["mnk"],
  nr: [0, 1, 2],
  fc: 18
}, {
  lngs: ["mt"],
  nr: [1, 2, 11, 20],
  fc: 19
}, {
  lngs: ["or"],
  nr: [2, 1],
  fc: 2
}, {
  lngs: ["ro"],
  nr: [1, 2, 20],
  fc: 20
}, {
  lngs: ["sl"],
  nr: [5, 1, 2, 3],
  fc: 21
}, {
  lngs: ["he", "iw"],
  nr: [1, 2, 20, 21],
  fc: 22
}], Re = {
  1: function(i) {
    return +(i > 1);
  },
  2: function(i) {
    return +(i != 1);
  },
  3: function(i) {
    return 0;
  },
  4: function(i) {
    return i % 10 == 1 && i % 100 != 11 ? 0 : i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
  },
  5: function(i) {
    return i == 0 ? 0 : i == 1 ? 1 : i == 2 ? 2 : i % 100 >= 3 && i % 100 <= 10 ? 3 : i % 100 >= 11 ? 4 : 5;
  },
  6: function(i) {
    return i == 1 ? 0 : i >= 2 && i <= 4 ? 1 : 2;
  },
  7: function(i) {
    return i == 1 ? 0 : i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
  },
  8: function(i) {
    return i == 1 ? 0 : i == 2 ? 1 : i != 8 && i != 11 ? 2 : 3;
  },
  9: function(i) {
    return +(i >= 2);
  },
  10: function(i) {
    return i == 1 ? 0 : i == 2 ? 1 : i < 7 ? 2 : i < 11 ? 3 : 4;
  },
  11: function(i) {
    return i == 1 || i == 11 ? 0 : i == 2 || i == 12 ? 1 : i > 2 && i < 20 ? 2 : 3;
  },
  12: function(i) {
    return +(i % 10 != 1 || i % 100 == 11);
  },
  13: function(i) {
    return +(i !== 0);
  },
  14: function(i) {
    return i == 1 ? 0 : i == 2 ? 1 : i == 3 ? 2 : 3;
  },
  15: function(i) {
    return i % 10 == 1 && i % 100 != 11 ? 0 : i % 10 >= 2 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
  },
  16: function(i) {
    return i % 10 == 1 && i % 100 != 11 ? 0 : i !== 0 ? 1 : 2;
  },
  17: function(i) {
    return i == 1 || i % 10 == 1 && i % 100 != 11 ? 0 : 1;
  },
  18: function(i) {
    return i == 0 ? 0 : i == 1 ? 1 : 2;
  },
  19: function(i) {
    return i == 1 ? 0 : i == 0 || i % 100 > 1 && i % 100 < 11 ? 1 : i % 100 > 10 && i % 100 < 20 ? 2 : 3;
  },
  20: function(i) {
    return i == 1 ? 0 : i == 0 || i % 100 > 0 && i % 100 < 20 ? 1 : 2;
  },
  21: function(i) {
    return i % 100 == 1 ? 1 : i % 100 == 2 ? 2 : i % 100 == 3 || i % 100 == 4 ? 3 : 0;
  },
  22: function(i) {
    return i == 1 ? 0 : i == 2 ? 1 : (i < 0 || i > 10) && i % 10 == 0 ? 2 : 3;
  }
};
function Oe() {
  var o = {};
  return ke.forEach(function(i) {
    i.lngs.forEach(function(n) {
      o[n] = {
        numbers: i.nr,
        plurals: Re[i.fc]
      };
    });
  }), o;
}
var Ce = function() {
  function o(i) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    w(this, o), this.languageUtils = i, this.options = n, this.logger = S.create("pluralResolver"), this.rules = Oe();
  }
  return k(o, [{
    key: "addRule",
    value: function(n, e) {
      this.rules[n] = e;
    }
  }, {
    key: "getRule",
    value: function(n) {
      return this.rules[n] || this.rules[this.languageUtils.getLanguagePartFromCode(n)];
    }
  }, {
    key: "needsPlural",
    value: function(n) {
      var e = this.getRule(n);
      return e && e.numbers.length > 1;
    }
  }, {
    key: "getPluralFormsOfKey",
    value: function(n, e) {
      return this.getSuffixes(n).map(function(t) {
        return e + t;
      });
    }
  }, {
    key: "getSuffixes",
    value: function(n) {
      var e = this, t = this.getRule(n);
      return t ? t.numbers.map(function(r) {
        return e.getSuffix(n, r);
      }) : [];
    }
  }, {
    key: "getSuffix",
    value: function(n, e) {
      var t = this, r = this.getRule(n);
      if (r) {
        var s = r.noAbs ? r.plurals(e) : r.plurals(Math.abs(e)), a = r.numbers[s];
        this.options.simplifyPluralSuffix && r.numbers.length === 2 && r.numbers[0] === 1 && (a === 2 ? a = "plural" : a === 1 && (a = ""));
        var u = function() {
          return t.options.prepend && a.toString() ? t.options.prepend + a.toString() : a.toString();
        };
        return this.options.compatibilityJSON === "v1" ? a === 1 ? "" : typeof a == "number" ? "_plural_".concat(a.toString()) : u() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && r.numbers.length === 2 && r.numbers[0] === 1 ? u() : this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
      }
      return this.logger.warn("no plural rule found for: ".concat(n)), "";
    }
  }]), o;
}(), Ne = function() {
  function o() {
    var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    w(this, o), this.logger = S.create("interpolator"), this.options = i, this.format = i.interpolation && i.interpolation.format || function(n) {
      return n;
    }, this.init(i);
  }
  return k(o, [{
    key: "init",
    value: function() {
      var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      n.interpolation || (n.interpolation = {
        escapeValue: !0
      });
      var e = n.interpolation;
      this.escape = e.escape !== void 0 ? e.escape : Le, this.escapeValue = e.escapeValue !== void 0 ? e.escapeValue : !0, this.useRawValueToEscape = e.useRawValueToEscape !== void 0 ? e.useRawValueToEscape : !1, this.prefix = e.prefix ? F(e.prefix) : e.prefixEscaped || "{{", this.suffix = e.suffix ? F(e.suffix) : e.suffixEscaped || "}}", this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ",", this.unescapePrefix = e.unescapeSuffix ? "" : e.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : e.unescapeSuffix || "", this.nestingPrefix = e.nestingPrefix ? F(e.nestingPrefix) : e.nestingPrefixEscaped || F("$t("), this.nestingSuffix = e.nestingSuffix ? F(e.nestingSuffix) : e.nestingSuffixEscaped || F(")"), this.nestingOptionsSeparator = e.nestingOptionsSeparator ? e.nestingOptionsSeparator : e.nestingOptionsSeparator || ",", this.maxReplaces = e.maxReplaces ? e.maxReplaces : 1e3, this.alwaysFormat = e.alwaysFormat !== void 0 ? e.alwaysFormat : !1, this.resetRegExp();
    }
  }, {
    key: "reset",
    value: function() {
      this.options && this.init(this.options);
    }
  }, {
    key: "resetRegExp",
    value: function() {
      var n = "".concat(this.prefix, "(.+?)").concat(this.suffix);
      this.regexp = new RegExp(n, "g");
      var e = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
      this.regexpUnescape = new RegExp(e, "g");
      var t = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
      this.nestingRegexp = new RegExp(t, "g");
    }
  }, {
    key: "interpolate",
    value: function(n, e, t, r) {
      var s = this, a, u, l, f = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
      function c(g) {
        return g.replace(/\$/g, "$$$$");
      }
      var d = function(v) {
        if (v.indexOf(s.formatSeparator) < 0) {
          var y = ue(e, f, v);
          return s.alwaysFormat ? s.format(y, void 0, t) : y;
        }
        var b = v.split(s.formatSeparator), R = b.shift().trim(), L = b.join(s.formatSeparator).trim();
        return s.format(ue(e, f, R), L, t, r);
      };
      this.resetRegExp();
      var m = r && r.missingInterpolationHandler || this.options.missingInterpolationHandler, p = r && r.interpolation && r.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables, h = [{
        regex: this.regexpUnescape,
        safeValue: function(v) {
          return c(v);
        }
      }, {
        regex: this.regexp,
        safeValue: function(v) {
          return s.escapeValue ? c(s.escape(v)) : c(v);
        }
      }];
      return h.forEach(function(g) {
        for (l = 0; a = g.regex.exec(n); ) {
          if (u = d(a[1].trim()), u === void 0)
            if (typeof m == "function") {
              var v = m(n, a, r);
              u = typeof v == "string" ? v : "";
            } else if (p) {
              u = a[0];
              continue;
            } else
              s.logger.warn("missed to pass in variable ".concat(a[1], " for interpolating ").concat(n)), u = "";
          else
            typeof u != "string" && !s.useRawValueToEscape && (u = se(u));
          if (n = n.replace(a[0], g.safeValue(u)), g.regex.lastIndex = 0, l++, l >= s.maxReplaces)
            break;
        }
      }), n;
    }
  }, {
    key: "nest",
    value: function(n, e) {
      var t = this, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s, a, u = x({}, r);
      u.applyPostProcessor = !1, delete u.defaultValue;
      function l(m, p) {
        var h = this.nestingOptionsSeparator;
        if (m.indexOf(h) < 0)
          return m;
        var g = m.split(new RegExp("".concat(h, "[ ]*{"))), v = "{".concat(g[1]);
        m = g[0], v = this.interpolate(v, u), v = v.replace(/'/g, '"');
        try {
          u = JSON.parse(v), p && (u = x({}, p, u));
        } catch (y) {
          return this.logger.warn("failed parsing options string in nesting for key ".concat(m), y), "".concat(m).concat(h).concat(v);
        }
        return delete u.defaultValue, m;
      }
      for (; s = this.nestingRegexp.exec(n); ) {
        var f = [], c = !1;
        if (s[0].includes(this.formatSeparator) && !/{.*}/.test(s[1])) {
          var d = s[1].split(this.formatSeparator).map(function(m) {
            return m.trim();
          });
          s[1] = d.shift(), f = d, c = !0;
        }
        if (a = e(l.call(this, s[1].trim(), u), u), a && s[0] === n && typeof a != "string")
          return a;
        typeof a != "string" && (a = se(a)), a || (this.logger.warn("missed to resolve ".concat(s[1], " for nesting ").concat(n)), a = ""), c && (a = f.reduce(function(m, p) {
          return t.format(m, p, r.lng, r);
        }, a.trim())), n = n.replace(s[0], a), this.regexp.lastIndex = 0;
      }
      return n;
    }
  }]), o;
}();
function Pe(o, i) {
  for (var n = o.indexOf(i); n !== -1; )
    o.splice(n, 1), n = o.indexOf(i);
}
var Ee = function(o) {
  W(i, o);
  function i(n, e, t) {
    var r, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    return w(this, i), r = D(this, z(i).call(this)), $ && O.call(j(r)), r.backend = n, r.store = e, r.services = t, r.languageUtils = t.languageUtils, r.options = s, r.logger = S.create("backendConnector"), r.state = {}, r.queue = [], r.backend && r.backend.init && r.backend.init(t, s.backend, s), r;
  }
  return k(i, [{
    key: "queueLoad",
    value: function(e, t, r, s) {
      var a = this, u = [], l = [], f = [], c = [];
      return e.forEach(function(d) {
        var m = !0;
        t.forEach(function(p) {
          var h = "".concat(d, "|").concat(p);
          !r.reload && a.store.hasResourceBundle(d, p) ? a.state[h] = 2 : a.state[h] < 0 || (a.state[h] === 1 ? l.indexOf(h) < 0 && l.push(h) : (a.state[h] = 1, m = !1, l.indexOf(h) < 0 && l.push(h), u.indexOf(h) < 0 && u.push(h), c.indexOf(p) < 0 && c.push(p)));
        }), m || f.push(d);
      }), (u.length || l.length) && this.queue.push({
        pending: l,
        loaded: {},
        errors: [],
        callback: s
      }), {
        toLoad: u,
        pending: l,
        toLoadLanguages: f,
        toLoadNamespaces: c
      };
    }
  }, {
    key: "loaded",
    value: function(e, t, r) {
      var s = e.split("|"), a = s[0], u = s[1];
      t && this.emit("failedLoading", a, u, t), r && this.store.addResourceBundle(a, u, r), this.state[e] = t ? -1 : 2;
      var l = {};
      this.queue.forEach(function(f) {
        be(f.loaded, [a], u), Pe(f.pending, e), t && f.errors.push(t), f.pending.length === 0 && !f.done && (Object.keys(f.loaded).forEach(function(c) {
          l[c] || (l[c] = []), f.loaded[c].length && f.loaded[c].forEach(function(d) {
            l[c].indexOf(d) < 0 && l[c].push(d);
          });
        }), f.done = !0, f.errors.length ? f.callback(f.errors) : f.callback());
      }), this.emit("loaded", l), this.queue = this.queue.filter(function(f) {
        return !f.done;
      });
    }
  }, {
    key: "read",
    value: function(e, t, r) {
      var s = this, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, u = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 350, l = arguments.length > 5 ? arguments[5] : void 0;
      return e.length ? this.backend[r](e, t, function(f, c) {
        if (f && c && a < 5) {
          setTimeout(function() {
            s.read.call(s, e, t, r, a + 1, u * 2, l);
          }, u);
          return;
        }
        l(f, c);
      }) : l(null, {});
    }
  }, {
    key: "prepareLoading",
    value: function(e, t) {
      var r = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = arguments.length > 3 ? arguments[3] : void 0;
      if (!this.backend)
        return this.logger.warn("No backend was added via i18next.use. Will not load resources."), a && a();
      typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof t == "string" && (t = [t]);
      var u = this.queueLoad(e, t, s, a);
      if (!u.toLoad.length)
        return u.pending.length || a(), null;
      u.toLoad.forEach(function(l) {
        r.loadOne(l);
      });
    }
  }, {
    key: "load",
    value: function(e, t, r) {
      this.prepareLoading(e, t, {}, r);
    }
  }, {
    key: "reload",
    value: function(e, t, r) {
      this.prepareLoading(e, t, {
        reload: !0
      }, r);
    }
  }, {
    key: "loadOne",
    value: function(e) {
      var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", s = e.split("|"), a = s[0], u = s[1];
      this.read(a, u, "read", void 0, void 0, function(l, f) {
        l && t.logger.warn("".concat(r, "loading namespace ").concat(u, " for language ").concat(a, " failed"), l), !l && f && t.logger.log("".concat(r, "loaded namespace ").concat(u, " for language ").concat(a), f), t.loaded(e, l, f);
      });
    }
  }, {
    key: "saveMissing",
    value: function(e, t, r, s, a) {
      var u = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
      if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
        this.logger.warn('did not save key "'.concat(r, '" as the namespace "').concat(t, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
        return;
      }
      r == null || r === "" || (this.backend && this.backend.create && this.backend.create(e, t, r, s, null, x({}, u, {
        isUpdate: a
      })), !(!e || !e[0]) && this.store.addResource(e[0], t, r, s));
    }
  }]), i;
}(O);
function Fe() {
  return {
    debug: !1,
    initImmediate: !0,
    ns: ["translation"],
    defaultNS: ["translation"],
    fallbackLng: ["dev"],
    fallbackNS: !1,
    whitelist: !1,
    nonExplicitWhitelist: !1,
    supportedLngs: !1,
    nonExplicitSupportedLngs: !1,
    load: "all",
    preload: !1,
    simplifyPluralSuffix: !0,
    keySeparator: ".",
    nsSeparator: ":",
    pluralSeparator: "_",
    contextSeparator: "_",
    partialBundledLanguages: !1,
    saveMissing: !1,
    updateMissing: !1,
    saveMissingTo: "fallback",
    saveMissingPlurals: !0,
    missingKeyHandler: !1,
    missingInterpolationHandler: !1,
    postProcess: !1,
    postProcessPassResolved: !1,
    returnNull: !0,
    returnEmptyString: !0,
    returnObjects: !1,
    joinArrays: !1,
    returnedObjectHandler: !1,
    parseMissingKeyHandler: !1,
    appendNamespaceToMissingKey: !1,
    appendNamespaceToCIMode: !1,
    overloadTranslationOptionHandler: function(i) {
      var n = {};
      if (V(i[1]) === "object" && (n = i[1]), typeof i[1] == "string" && (n.defaultValue = i[1]), typeof i[2] == "string" && (n.tDescription = i[2]), V(i[2]) === "object" || V(i[3]) === "object") {
        var e = i[3] || i[2];
        Object.keys(e).forEach(function(t) {
          n[t] = e[t];
        });
      }
      return n;
    },
    interpolation: {
      escapeValue: !0,
      format: function(i, n, e, t) {
        return i;
      },
      prefix: "{{",
      suffix: "}}",
      formatSeparator: ",",
      unescapePrefix: "-",
      nestingPrefix: "$t(",
      nestingSuffix: ")",
      nestingOptionsSeparator: ",",
      maxReplaces: 1e3,
      skipOnVariables: !1
    }
  };
}
function ce(o) {
  return typeof o.ns == "string" && (o.ns = [o.ns]), typeof o.fallbackLng == "string" && (o.fallbackLng = [o.fallbackLng]), typeof o.fallbackNS == "string" && (o.fallbackNS = [o.fallbackNS]), o.whitelist && (o.whitelist && o.whitelist.indexOf("cimode") < 0 && (o.whitelist = o.whitelist.concat(["cimode"])), o.supportedLngs = o.whitelist), o.nonExplicitWhitelist && (o.nonExplicitSupportedLngs = o.nonExplicitWhitelist), o.supportedLngs && o.supportedLngs.indexOf("cimode") < 0 && (o.supportedLngs = o.supportedLngs.concat(["cimode"])), o;
}
function B() {
}
var je = function(o) {
  W(i, o);
  function i() {
    var n, e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
    if (w(this, i), n = D(this, z(i).call(this)), $ && O.call(j(n)), n.options = ce(e), n.services = {}, n.logger = S, n.modules = {
      external: []
    }, t && !n.isInitialized && !e.isClone) {
      if (!n.options.initImmediate)
        return n.init(e, t), D(n, j(n));
      setTimeout(function() {
        n.init(e, t);
      }, 0);
    }
    return n;
  }
  return k(i, [{
    key: "init",
    value: function() {
      var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
      typeof t == "function" && (r = t, t = {}), t.whitelist && !t.supportedLngs && this.logger.deprecate("whitelist", 'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'), t.nonExplicitWhitelist && !t.nonExplicitSupportedLngs && this.logger.deprecate("whitelist", 'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'), this.options = x({}, Fe(), this.options, ce(t)), this.format = this.options.interpolation.format, r || (r = B);
      function s(p) {
        return p ? typeof p == "function" ? new p() : p : null;
      }
      if (!this.options.isClone) {
        this.modules.logger ? S.init(s(this.modules.logger), this.options) : S.init(null, this.options);
        var a = new we(this.options);
        this.store = new Se(this.options.resources, this.options);
        var u = this.services;
        u.logger = S, u.resourceStore = this.store, u.languageUtils = a, u.pluralResolver = new Ce(a, {
          prepend: this.options.pluralSeparator,
          compatibilityJSON: this.options.compatibilityJSON,
          simplifyPluralSuffix: this.options.simplifyPluralSuffix
        }), u.interpolator = new Ne(this.options), u.utils = {
          hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
        }, u.backendConnector = new Ee(s(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(p) {
          for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), v = 1; v < h; v++)
            g[v - 1] = arguments[v];
          e.emit.apply(e, [p].concat(g));
        }), this.modules.languageDetector && (u.languageDetector = s(this.modules.languageDetector), u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = s(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new fe(this.services, this.options), this.translator.on("*", function(p) {
          for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), v = 1; v < h; v++)
            g[v - 1] = arguments[v];
          e.emit.apply(e, [p].concat(g));
        }), this.modules.external.forEach(function(p) {
          p.init && p.init(e);
        });
      }
      if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
        var l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
        l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
      }
      !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined");
      var f = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
      f.forEach(function(p) {
        e[p] = function() {
          var h;
          return (h = e.store)[p].apply(h, arguments);
        };
      });
      var c = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
      c.forEach(function(p) {
        e[p] = function() {
          var h;
          return (h = e.store)[p].apply(h, arguments), e;
        };
      });
      var d = U(), m = function() {
        var h = function(v, y) {
          e.isInitialized && e.logger.warn("init: i18next is already initialized. You should call init just once!"), e.isInitialized = !0, e.options.isClone || e.logger.log("initialized", e.options), e.emit("initialized", e.options), d.resolve(y), r(v, y);
        };
        if (e.languages && e.options.compatibilityAPI !== "v1" && !e.isInitialized)
          return h(null, e.t.bind(e));
        e.changeLanguage(e.options.lng, h);
      };
      return this.options.resources || !this.options.initImmediate ? m() : setTimeout(m, 0), d;
    }
  }, {
    key: "loadResources",
    value: function(e) {
      var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : B, s = r, a = typeof e == "string" ? e : this.language;
      if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
        if (a && a.toLowerCase() === "cimode")
          return s();
        var u = [], l = function(d) {
          if (d) {
            var m = t.services.languageUtils.toResolveHierarchy(d);
            m.forEach(function(p) {
              u.indexOf(p) < 0 && u.push(p);
            });
          }
        };
        if (a)
          l(a);
        else {
          var f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
          f.forEach(function(c) {
            return l(c);
          });
        }
        this.options.preload && this.options.preload.forEach(function(c) {
          return l(c);
        }), this.services.backendConnector.load(u, this.options.ns, s);
      } else
        s(null);
    }
  }, {
    key: "reloadResources",
    value: function(e, t, r) {
      var s = U();
      return e || (e = this.languages), t || (t = this.options.ns), r || (r = B), this.services.backendConnector.reload(e, t, function(a) {
        s.resolve(), r(a);
      }), s;
    }
  }, {
    key: "use",
    value: function(e) {
      if (!e)
        throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
      if (!e.type)
        throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
      return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && he.addPostProcessor(e), e.type === "3rdParty" && this.modules.external.push(e), this;
    }
  }, {
    key: "changeLanguage",
    value: function(e, t) {
      var r = this;
      this.isLanguageChangingTo = e;
      var s = U();
      this.emit("languageChanging", e);
      var a = function(f, c) {
        c ? (r.language = c, r.languages = r.services.languageUtils.toResolveHierarchy(c), r.translator.changeLanguage(c), r.isLanguageChangingTo = void 0, r.emit("languageChanged", c), r.logger.log("languageChanged", c)) : r.isLanguageChangingTo = void 0, s.resolve(function() {
          return r.t.apply(r, arguments);
        }), t && t(f, function() {
          return r.t.apply(r, arguments);
        });
      }, u = function(f) {
        var c = typeof f == "string" ? f : r.services.languageUtils.getBestMatchFromCodes(f);
        c && (r.language || (r.language = c, r.languages = r.services.languageUtils.toResolveHierarchy(c)), r.translator.language || r.translator.changeLanguage(c), r.services.languageDetector && r.services.languageDetector.cacheUserLanguage(c)), r.loadResources(c, function(d) {
          a(d, c);
        });
      };
      return !e && this.services.languageDetector && !this.services.languageDetector.async ? u(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect(u) : u(e), s;
    }
  }, {
    key: "getFixedT",
    value: function(e, t) {
      var r = this, s = function a(u, l) {
        var f;
        if (V(l) !== "object") {
          for (var c = arguments.length, d = new Array(c > 2 ? c - 2 : 0), m = 2; m < c; m++)
            d[m - 2] = arguments[m];
          f = r.options.overloadTranslationOptionHandler([u, l].concat(d));
        } else
          f = x({}, l);
        return f.lng = f.lng || a.lng, f.lngs = f.lngs || a.lngs, f.ns = f.ns || a.ns, r.t(u, f);
      };
      return typeof e == "string" ? s.lng = e : s.lngs = e, s.ns = t, s;
    }
  }, {
    key: "t",
    value: function() {
      var e;
      return this.translator && (e = this.translator).translate.apply(e, arguments);
    }
  }, {
    key: "exists",
    value: function() {
      var e;
      return this.translator && (e = this.translator).exists.apply(e, arguments);
    }
  }, {
    key: "setDefaultNamespace",
    value: function(e) {
      this.options.defaultNS = e;
    }
  }, {
    key: "hasLoadedNamespace",
    value: function(e) {
      var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (!this.isInitialized)
        return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
      if (!this.languages || !this.languages.length)
        return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
      var s = this.languages[0], a = this.options ? this.options.fallbackLng : !1, u = this.languages[this.languages.length - 1];
      if (s.toLowerCase() === "cimode")
        return !0;
      var l = function(d, m) {
        var p = t.services.backendConnector.state["".concat(d, "|").concat(m)];
        return p === -1 || p === 2;
      };
      if (r.precheck) {
        var f = r.precheck(this, l);
        if (f !== void 0)
          return f;
      }
      return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || l(s, e) && (!a || l(u, e)));
    }
  }, {
    key: "loadNamespaces",
    value: function(e, t) {
      var r = this, s = U();
      return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach(function(a) {
        r.options.ns.indexOf(a) < 0 && r.options.ns.push(a);
      }), this.loadResources(function(a) {
        s.resolve(), t && t(a);
      }), s) : (t && t(), Promise.resolve());
    }
  }, {
    key: "loadLanguages",
    value: function(e, t) {
      var r = U();
      typeof e == "string" && (e = [e]);
      var s = this.options.preload || [], a = e.filter(function(u) {
        return s.indexOf(u) < 0;
      });
      return a.length ? (this.options.preload = s.concat(a), this.loadResources(function(u) {
        r.resolve(), t && t(u);
      }), r) : (t && t(), Promise.resolve());
    }
  }, {
    key: "dir",
    value: function(e) {
      if (e || (e = this.languages && this.languages.length > 0 ? this.languages[0] : this.language), !e)
        return "rtl";
      var t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam"];
      return t.indexOf(this.services.languageUtils.getLanguagePartFromCode(e)) >= 0 ? "rtl" : "ltr";
    }
  }, {
    key: "createInstance",
    value: function() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
      return new i(e, t);
    }
  }, {
    key: "cloneInstance",
    value: function() {
      var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : B, s = x({}, this.options, t, {
        isClone: !0
      }), a = new i(s), u = ["store", "services", "language"];
      return u.forEach(function(l) {
        a[l] = e[l];
      }), a.services = x({}, this.services), a.services.utils = {
        hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
      }, a.translator = new fe(a.services, a.options), a.translator.on("*", function(l) {
        for (var f = arguments.length, c = new Array(f > 1 ? f - 1 : 0), d = 1; d < f; d++)
          c[d - 1] = arguments[d];
        a.emit.apply(a, [l].concat(c));
      }), a.init(s, r), a.translator.options = a.options, a.translator.backendConnector.services.utils = {
        hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
      }, a;
    }
  }]), i;
}(O), Ke = new je();
export {
  Ke as default
};
//# sourceMappingURL=index.es75.js.map
