var e, t, r, n, i, a, o = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function u(e2) {
  return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
function s() {
  return t ? e : (t = 1, e = { languageTag: "en-US", delimiters: { thousands: ",", decimal: "." }, abbreviations: { thousand: "k", million: "m", billion: "b", trillion: "t" }, spaceSeparated: false, ordinal: function(e2) {
    let t2 = e2 % 10;
    return 1 == ~~(e2 % 100 / 10) ? "th" : 1 === t2 ? "st" : 2 === t2 ? "nd" : 3 === t2 ? "rd" : "th";
  }, bytes: { binarySuffixes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"], decimalSuffixes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] }, currency: { symbol: "$", position: "prefix", code: "USD" }, currencyFormat: { thousandSeparated: true, totalLength: 4, spaceSeparated: true, spaceSeparatedCurrency: true }, formats: { fourDigits: { totalLength: 4, spaceSeparated: true }, fullWithTwoDecimals: { output: "currency", thousandSeparated: true, mantissa: 2 }, fullWithTwoDecimalsNoCurrency: { thousandSeparated: true, mantissa: 2 }, fullWithNoDecimals: { output: "currency", thousandSeparated: true, mantissa: 0 } } });
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
function l() {
  if (n)
    return r;
  n = 1;
  const e2 = [{ key: "ZiB", factor: Math.pow(1024, 7) }, { key: "ZB", factor: Math.pow(1e3, 7) }, { key: "YiB", factor: Math.pow(1024, 8) }, { key: "YB", factor: Math.pow(1e3, 8) }, { key: "TiB", factor: Math.pow(1024, 4) }, { key: "TB", factor: Math.pow(1e3, 4) }, { key: "PiB", factor: Math.pow(1024, 5) }, { key: "PB", factor: Math.pow(1e3, 5) }, { key: "MiB", factor: Math.pow(1024, 2) }, { key: "MB", factor: Math.pow(1e3, 2) }, { key: "KiB", factor: Math.pow(1024, 1) }, { key: "KB", factor: Math.pow(1e3, 1) }, { key: "GiB", factor: Math.pow(1024, 3) }, { key: "GB", factor: Math.pow(1e3, 3) }, { key: "EiB", factor: Math.pow(1024, 6) }, { key: "EB", factor: Math.pow(1e3, 6) }, { key: "B", factor: 1 }];
  function t2(e3) {
    return e3.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
  }
  function i2(r2, n2, a3, o2, u2, s2, l2) {
    if (!isNaN(+r2))
      return +r2;
    let c2 = "", f2 = r2.replace(/(^[^(]*)\((.*)\)([^)]*$)/, "$1$2$3");
    if (f2 !== r2)
      return -1 * i2(f2, n2, a3, o2, u2, s2);
    for (let t3 = 0; t3 < e2.length; t3++) {
      let l3 = e2[t3];
      if (c2 = r2.replace(RegExp(`([0-9 ])(${l3.key})$`), "$1"), c2 !== r2)
        return i2(c2, n2, a3, o2, u2, s2) * l3.factor;
    }
    if (c2 = r2.replace("%", ""), c2 !== r2)
      return i2(c2, n2, a3, o2, u2, s2) / 100;
    let p2 = parseFloat(r2);
    if (isNaN(p2))
      return;
    let g2 = o2(p2);
    if (g2 && "." !== g2 && (c2 = r2.replace(new RegExp(`${t2(g2)}$`), ""), c2 !== r2))
      return i2(c2, n2, a3, o2, u2, s2);
    let h2 = {};
    Object.keys(s2).forEach((e3) => {
      h2[s2[e3]] = e3;
    });
    let d2 = Object.keys(h2).sort().reverse(), m2 = d2.length;
    for (let e3 = 0; e3 < m2; e3++) {
      let t3 = d2[e3], l3 = h2[t3];
      if (c2 = r2.replace(t3, ""), c2 !== r2) {
        let e4;
        switch (l3) {
          case "thousand":
            e4 = Math.pow(10, 3);
            break;
          case "million":
            e4 = Math.pow(10, 6);
            break;
          case "billion":
            e4 = Math.pow(10, 9);
            break;
          case "trillion":
            e4 = Math.pow(10, 12);
        }
        return i2(c2, n2, a3, o2, u2, s2) * e4;
      }
    }
  }
  function a2(e3, r2, n2 = "", a3, o2, u2, s2) {
    if ("" === e3)
      return;
    if (e3 === o2)
      return 0;
    let l2 = function(e4, r3, n3) {
      let i3 = e4.replace(n3, "");
      return i3 = i3.replace(new RegExp(`([0-9])${t2(r3.thousands)}([0-9])`, "g"), "$1$2"), i3 = i3.replace(r3.decimal, "."), i3;
    }(e3, r2, n2);
    return i2(l2, r2, n2, a3, o2, u2);
  }
  return r = { unformat: function(e3, t3) {
    const r2 = h();
    let n2, i3 = r2.currentDelimiters(), o2 = r2.currentCurrency().symbol, u2 = r2.currentOrdinal(), s2 = r2.getZeroFormat(), l2 = r2.currentAbbreviations();
    if ("string" == typeof e3)
      n2 = function(e4, t4) {
        if (!e4.indexOf(":") || ":" === t4.thousands)
          return false;
        let r3 = e4.split(":");
        if (3 !== r3.length)
          return false;
        let n3 = +r3[0], i4 = +r3[1], a3 = +r3[2];
        return !isNaN(n3) && !isNaN(i4) && !isNaN(a3);
      }(e3, i3) ? function(e4) {
        let t4 = e4.split(":"), r3 = +t4[0], n3 = +t4[1];
        return +t4[2] + 60 * n3 + 3600 * r3;
      }(e3) : a2(e3, i3, o2, u2, s2, l2);
    else {
      if ("number" != typeof e3)
        return;
      n2 = e3;
    }
    if (void 0 !== n2)
      return n2;
  } }, r;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
function c() {
  if (a)
    return i;
  a = 1;
  let e2 = l();
  const t2 = /^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/, r2 = { output: { type: "string", validValues: ["currency", "percent", "byte", "time", "ordinal", "number"] }, base: { type: "string", validValues: ["decimal", "binary", "general"], restriction: (e3, t3) => "byte" === t3.output, message: "`base` must be provided only when the output is `byte`", mandatory: (e3) => "byte" === e3.output }, characteristic: { type: "number", restriction: (e3) => e3 >= 0, message: "value must be positive" }, prefix: "string", postfix: "string", forceAverage: { type: "string", validValues: ["trillion", "billion", "million", "thousand"] }, average: "boolean", lowPrecision: { type: "boolean", restriction: (e3, t3) => true === t3.average, message: "`lowPrecision` must be provided only when the option `average` is set" }, currencyPosition: { type: "string", validValues: ["prefix", "infix", "postfix"] }, currencySymbol: "string", totalLength: { type: "number", restrictions: [{ restriction: (e3) => e3 >= 0, message: "value must be positive" }, { restriction: (e3, t3) => !t3.exponential, message: "`totalLength` is incompatible with `exponential`" }] }, mantissa: { type: "number", restriction: (e3) => e3 >= 0, message: "value must be positive" }, optionalMantissa: "boolean", trimMantissa: "boolean", roundingFunction: "function", optionalCharacteristic: "boolean", thousandSeparated: "boolean", spaceSeparated: "boolean", spaceSeparatedCurrency: "boolean", spaceSeparatedAbbreviation: "boolean", abbreviations: { type: "object", children: { thousand: "string", million: "string", billion: "string", trillion: "string" } }, negative: { type: "string", validValues: ["sign", "parenthesis"] }, forceSign: "boolean", exponential: { type: "boolean" }, prefixSymbol: { type: "boolean", restriction: (e3, t3) => "percent" === t3.output, message: "`prefixSymbol` can be provided only when the output is `percent`" } }, n2 = { languageTag: { type: "string", mandatory: true, restriction: (e3) => e3.match(t2), message: "the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)" }, delimiters: { type: "object", children: { thousands: "string", decimal: "string", thousandsSize: "number" }, mandatory: true }, abbreviations: { type: "object", children: { thousand: { type: "string", mandatory: true }, million: { type: "string", mandatory: true }, billion: { type: "string", mandatory: true }, trillion: { type: "string", mandatory: true } }, mandatory: true }, spaceSeparated: "boolean", spaceSeparatedCurrency: "boolean", ordinal: { type: "function", mandatory: true }, bytes: { type: "object", children: { binarySuffixes: "object", decimalSuffixes: "object" } }, currency: { type: "object", children: { symbol: "string", position: "string", code: "string" }, mandatory: true }, defaults: "format", ordinalFormat: "format", byteFormat: "format", percentageFormat: "format", currencyFormat: "format", timeDefaults: "format", formats: { type: "object", children: { fourDigits: { type: "format", mandatory: true }, fullWithTwoDecimals: { type: "format", mandatory: true }, fullWithTwoDecimalsNoCurrency: { type: "format", mandatory: true }, fullWithNoDecimals: { type: "format", mandatory: true } } } };
  function o2(t3) {
    return void 0 !== e2.unformat(t3);
  }
  function u2(e3, t3, n3, i2 = false) {
    let a2 = Object.keys(e3).map((i3) => {
      if (!t3[i3])
        return console.error(`${n3} Invalid key: ${i3}`), false;
      let a3 = e3[i3], o3 = t3[i3];
      if ("string" == typeof o3 && (o3 = { type: o3 }), "format" === o3.type) {
        if (!u2(a3, r2, `[Validate ${i3}]`, true))
          return false;
      } else if (typeof a3 !== o3.type)
        return console.error(`${n3} ${i3} type mismatched: "${o3.type}" expected, "${typeof a3}" provided`), false;
      if (o3.restrictions && o3.restrictions.length) {
        let t4 = o3.restrictions.length;
        for (let r3 = 0; r3 < t4; r3++) {
          let { restriction: t5, message: u3 } = o3.restrictions[r3];
          if (!t5(a3, e3))
            return console.error(`${n3} ${i3} invalid value: ${u3}`), false;
        }
      }
      if (o3.restriction && !o3.restriction(a3, e3))
        return console.error(`${n3} ${i3} invalid value: ${o3.message}`), false;
      if (o3.validValues && -1 === o3.validValues.indexOf(a3))
        return console.error(`${n3} ${i3} invalid value: must be among ${JSON.stringify(o3.validValues)}, "${a3}" provided`), false;
      if (o3.children) {
        if (!u2(a3, o3.children, `[Validate ${i3}]`))
          return false;
      }
      return true;
    });
    return i2 || a2.push(...Object.keys(t3).map((r3) => {
      let i3 = t3[r3];
      if ("string" == typeof i3 && (i3 = { type: i3 }), i3.mandatory) {
        let t4 = i3.mandatory;
        if ("function" == typeof t4 && (t4 = t4(e3)), t4 && void 0 === e3[r3])
          return console.error(`${n3} Missing mandatory key "${r3}"`), false;
      }
      return true;
    })), a2.reduce((e4, t4) => e4 && t4, true);
  }
  function s2(e3) {
    return u2(e3, r2, "[Validate format]");
  }
  return i = { validate: function(e3, t3) {
    let r3 = o2(e3), n3 = s2(t3);
    return r3 && n3;
  }, validateFormat: s2, validateInput: o2, validateLanguage: function(e3) {
    return u2(e3, n2, "[Validate language]");
  } }, i;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
var f, p, g = { parseFormat: function(e2, t2 = {}) {
  return "string" != typeof e2 ? e2 : (function(e3, t3) {
    if (-1 === e3.indexOf("$")) {
      if (-1 === e3.indexOf("%"))
        return -1 !== e3.indexOf("bd") ? (t3.output = "byte", void (t3.base = "general")) : -1 !== e3.indexOf("b") ? (t3.output = "byte", void (t3.base = "binary")) : -1 !== e3.indexOf("d") ? (t3.output = "byte", void (t3.base = "decimal")) : void (-1 === e3.indexOf(":") ? -1 !== e3.indexOf("o") && (t3.output = "ordinal") : t3.output = "time");
      t3.output = "percent";
    } else
      t3.output = "currency";
  }(e2 = function(e3, t3) {
    let r2 = e3.match(/{([^}]*)}$/);
    return r2 ? (t3.postfix = r2[1], e3.slice(0, -r2[0].length)) : e3;
  }(e2 = function(e3, t3) {
    let r2 = e3.match(/^{([^}]*)}/);
    return r2 ? (t3.prefix = r2[1], e3.slice(r2[0].length)) : e3;
  }(e2, t2), t2), t2), function(e3, t3) {
    let r2 = e3.match(/[1-9]+[0-9]*/);
    r2 && (t3.totalLength = +r2[0]);
  }(e2, t2), function(e3, t3) {
    let r2 = e3.split(".")[0].match(/0+/);
    r2 && (t3.characteristic = r2[0].length);
  }(e2, t2), function(e3, t3) {
    if (-1 !== e3.indexOf(".")) {
      let r2 = e3.split(".")[0];
      t3.optionalCharacteristic = -1 === r2.indexOf("0");
    }
  }(e2, t2), function(e3, t3) {
    -1 !== e3.indexOf("a") && (t3.average = true);
  }(e2, t2), function(e3, t3) {
    -1 !== e3.indexOf("K") ? t3.forceAverage = "thousand" : -1 !== e3.indexOf("M") ? t3.forceAverage = "million" : -1 !== e3.indexOf("B") ? t3.forceAverage = "billion" : -1 !== e3.indexOf("T") && (t3.forceAverage = "trillion");
  }(e2, t2), function(e3, t3) {
    let r2 = e3.split(".")[1];
    if (r2) {
      let e4 = r2.match(/0+/);
      e4 && (t3.mantissa = e4[0].length);
    }
  }(e2, t2), function(e3, t3) {
    e3.match(/\[\.]/) ? t3.optionalMantissa = true : e3.match(/\./) && (t3.optionalMantissa = false);
  }(e2, t2), function(e3, t3) {
    const r2 = e3.split(".")[1];
    r2 && (t3.trimMantissa = -1 !== r2.indexOf("["));
  }(e2, t2), function(e3, t3) {
    -1 !== e3.indexOf(",") && (t3.thousandSeparated = true);
  }(e2, t2), function(e3, t3) {
    -1 !== e3.indexOf(" ") && (t3.spaceSeparated = true, t3.spaceSeparatedCurrency = true, (t3.average || t3.forceAverage) && (t3.spaceSeparatedAbbreviation = true));
  }(e2, t2), function(e3, t3) {
    e3.match(/^\+?\([^)]*\)$/) && (t3.negative = "parenthesis"), e3.match(/^\+?-/) && (t3.negative = "sign");
  }(e2, t2), function(e3, t3) {
    e3.match(/^\+/) && (t3.forceSign = true);
  }(e2, t2), t2);
} };
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
function h() {
  if (p)
    return f;
  p = 1;
  const e2 = s(), t2 = c(), r2 = g;
  let n2, i2 = {}, a2 = {}, o2 = null, u2 = {};
  function l2(e3) {
    n2 = e3;
  }
  function h2() {
    return a2[n2];
  }
  return i2.languages = () => Object.assign({}, a2), i2.currentLanguage = () => n2, i2.currentBytes = () => h2().bytes || {}, i2.currentCurrency = () => h2().currency, i2.currentAbbreviations = () => h2().abbreviations, i2.currentDelimiters = () => h2().delimiters, i2.currentOrdinal = () => h2().ordinal, i2.currentDefaults = () => Object.assign({}, h2().defaults, u2), i2.currentOrdinalDefaultFormat = () => Object.assign({}, i2.currentDefaults(), h2().ordinalFormat), i2.currentByteDefaultFormat = () => Object.assign({}, i2.currentDefaults(), h2().byteFormat), i2.currentPercentageDefaultFormat = () => Object.assign({}, i2.currentDefaults(), h2().percentageFormat), i2.currentCurrencyDefaultFormat = () => Object.assign({}, i2.currentDefaults(), h2().currencyFormat), i2.currentTimeDefaultFormat = () => Object.assign({}, i2.currentDefaults(), h2().timeFormat), i2.setDefaults = (e3) => {
    e3 = r2.parseFormat(e3), t2.validateFormat(e3) && (u2 = e3);
  }, i2.getZeroFormat = () => o2, i2.setZeroFormat = (e3) => o2 = "string" == typeof e3 ? e3 : null, i2.hasZeroFormat = () => null !== o2, i2.languageData = (e3) => {
    if (e3) {
      if (a2[e3])
        return a2[e3];
      throw new Error(`Unknown tag "${e3}"`);
    }
    return h2();
  }, i2.registerLanguage = (e3, r3 = false) => {
    if (!t2.validateLanguage(e3))
      throw new Error("Invalid language data");
    a2[e3.languageTag] = e3, r3 && l2(e3.languageTag);
  }, i2.setLanguage = (t3, r3 = e2.languageTag) => {
    if (!a2[t3]) {
      let e3 = t3.split("-")[0], n3 = Object.keys(a2).find((t4) => t4.split("-")[0] === e3);
      return a2[n3] ? void l2(n3) : void l2(r3);
    }
    l2(t3);
  }, i2.registerLanguage(e2), n2 = e2.languageTag, f = i2;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
function d(e2, t2) {
  e2.forEach((e3) => {
    let r2;
    try {
      r2 = function(e4) {
        throw new Error('Could not dynamically require "' + e4 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
      }(`../languages/${e3}`);
    } catch (t3) {
      console.error(`Unable to load "${e3}". No matching language file found.`);
    }
    r2 && t2.registerLanguage(r2);
  });
}
var m, y = { exports: {} };
m = y, function(e2) {
  var t2, r2 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, n2 = Math.ceil, i2 = Math.floor, a2 = "[BigNumber Error] ", o2 = a2 + "Number primitive has more than 15 significant digits: ", u2 = 1e14, s2 = 14, l2 = 9007199254740991, c2 = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], f2 = 1e7, p2 = 1e9;
  function g2(e3) {
    var t3 = 0 | e3;
    return e3 > 0 || e3 === t3 ? t3 : t3 - 1;
  }
  function h2(e3) {
    for (var t3, r3, n3 = 1, i3 = e3.length, a3 = e3[0] + ""; n3 < i3; ) {
      for (t3 = e3[n3++] + "", r3 = s2 - t3.length; r3--; t3 = "0" + t3)
        ;
      a3 += t3;
    }
    for (i3 = a3.length; 48 === a3.charCodeAt(--i3); )
      ;
    return a3.slice(0, i3 + 1 || 1);
  }
  function d2(e3, t3) {
    var r3, n3, i3 = e3.c, a3 = t3.c, o3 = e3.s, u3 = t3.s, s3 = e3.e, l3 = t3.e;
    if (!o3 || !u3)
      return null;
    if (r3 = i3 && !i3[0], n3 = a3 && !a3[0], r3 || n3)
      return r3 ? n3 ? 0 : -u3 : o3;
    if (o3 != u3)
      return o3;
    if (r3 = o3 < 0, n3 = s3 == l3, !i3 || !a3)
      return n3 ? 0 : !i3 ^ r3 ? 1 : -1;
    if (!n3)
      return s3 > l3 ^ r3 ? 1 : -1;
    for (u3 = (s3 = i3.length) < (l3 = a3.length) ? s3 : l3, o3 = 0; o3 < u3; o3++)
      if (i3[o3] != a3[o3])
        return i3[o3] > a3[o3] ^ r3 ? 1 : -1;
    return s3 == l3 ? 0 : s3 > l3 ^ r3 ? 1 : -1;
  }
  function y2(e3, t3, r3, n3) {
    if (e3 < t3 || e3 > r3 || e3 !== i2(e3))
      throw Error(a2 + (n3 || "Argument") + ("number" == typeof e3 ? e3 < t3 || e3 > r3 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(e3));
  }
  function b2(e3) {
    var t3 = e3.c.length - 1;
    return g2(e3.e / s2) == t3 && e3.c[t3] % 2 != 0;
  }
  function v2(e3, t3) {
    return (e3.length > 1 ? e3.charAt(0) + "." + e3.slice(1) : e3) + (t3 < 0 ? "e" : "e+") + t3;
  }
  function w2(e3, t3, r3) {
    var n3, i3;
    if (t3 < 0) {
      for (i3 = r3 + "."; ++t3; i3 += r3)
        ;
      e3 = i3 + e3;
    } else if (++t3 > (n3 = e3.length)) {
      for (i3 = r3, t3 -= n3; --t3; i3 += r3)
        ;
      e3 += i3;
    } else
      t3 < n3 && (e3 = e3.slice(0, t3) + "." + e3.slice(t3));
    return e3;
  }
  t2 = function e3(t3) {
    var m2, O2, x2, S2, N2, $2, B2, M2, D2, F2, E2 = q2.prototype = { constructor: q2, toString: null, valueOf: null }, A2 = new q2(1), _2 = 20, k2 = 4, L2 = -7, P2 = 21, C2 = -1e7, T2 = 1e7, j2 = false, U2 = 1, R2 = 0, I2 = { prefix: "", groupSize: 3, secondaryGroupSize: 0, groupSeparator: ",", decimalSeparator: ".", fractionGroupSize: 0, fractionGroupSeparator: " ", suffix: "" }, G2 = "0123456789abcdefghijklmnopqrstuvwxyz", V2 = true;
    function q2(e4, t4) {
      var n3, a3, u3, c3, f3, p3, g3, h3, d3 = this;
      if (!(d3 instanceof q2))
        return new q2(e4, t4);
      if (null == t4) {
        if (e4 && true === e4._isBigNumber)
          return d3.s = e4.s, void (!e4.c || e4.e > T2 ? d3.c = d3.e = null : e4.e < C2 ? d3.c = [d3.e = 0] : (d3.e = e4.e, d3.c = e4.c.slice()));
        if ((p3 = "number" == typeof e4) && 0 * e4 == 0) {
          if (d3.s = 1 / e4 < 0 ? (e4 = -e4, -1) : 1, e4 === ~~e4) {
            for (c3 = 0, f3 = e4; f3 >= 10; f3 /= 10, c3++)
              ;
            return void (c3 > T2 ? d3.c = d3.e = null : (d3.e = c3, d3.c = [e4]));
          }
          h3 = String(e4);
        } else {
          if (!r2.test(h3 = String(e4)))
            return x2(d3, h3, p3);
          d3.s = 45 == h3.charCodeAt(0) ? (h3 = h3.slice(1), -1) : 1;
        }
        (c3 = h3.indexOf(".")) > -1 && (h3 = h3.replace(".", "")), (f3 = h3.search(/e/i)) > 0 ? (c3 < 0 && (c3 = f3), c3 += +h3.slice(f3 + 1), h3 = h3.substring(0, f3)) : c3 < 0 && (c3 = h3.length);
      } else {
        if (y2(t4, 2, G2.length, "Base"), 10 == t4 && V2)
          return H(d3 = new q2(e4), _2 + d3.e + 1, k2);
        if (h3 = String(e4), p3 = "number" == typeof e4) {
          if (0 * e4 != 0)
            return x2(d3, h3, p3, t4);
          if (d3.s = 1 / e4 < 0 ? (h3 = h3.slice(1), -1) : 1, q2.DEBUG && h3.replace(/^0\.0*|\./, "").length > 15)
            throw Error(o2 + e4);
        } else
          d3.s = 45 === h3.charCodeAt(0) ? (h3 = h3.slice(1), -1) : 1;
        for (n3 = G2.slice(0, t4), c3 = f3 = 0, g3 = h3.length; f3 < g3; f3++)
          if (n3.indexOf(a3 = h3.charAt(f3)) < 0) {
            if ("." == a3) {
              if (f3 > c3) {
                c3 = g3;
                continue;
              }
            } else if (!u3 && (h3 == h3.toUpperCase() && (h3 = h3.toLowerCase()) || h3 == h3.toLowerCase() && (h3 = h3.toUpperCase()))) {
              u3 = true, f3 = -1, c3 = 0;
              continue;
            }
            return x2(d3, String(e4), p3, t4);
          }
        p3 = false, (c3 = (h3 = O2(h3, t4, 10, d3.s)).indexOf(".")) > -1 ? h3 = h3.replace(".", "") : c3 = h3.length;
      }
      for (f3 = 0; 48 === h3.charCodeAt(f3); f3++)
        ;
      for (g3 = h3.length; 48 === h3.charCodeAt(--g3); )
        ;
      if (h3 = h3.slice(f3, ++g3)) {
        if (g3 -= f3, p3 && q2.DEBUG && g3 > 15 && (e4 > l2 || e4 !== i2(e4)))
          throw Error(o2 + d3.s * e4);
        if ((c3 = c3 - f3 - 1) > T2)
          d3.c = d3.e = null;
        else if (c3 < C2)
          d3.c = [d3.e = 0];
        else {
          if (d3.e = c3, d3.c = [], f3 = (c3 + 1) % s2, c3 < 0 && (f3 += s2), f3 < g3) {
            for (f3 && d3.c.push(+h3.slice(0, f3)), g3 -= s2; f3 < g3; )
              d3.c.push(+h3.slice(f3, f3 += s2));
            f3 = s2 - (h3 = h3.slice(f3)).length;
          } else
            f3 -= g3;
          for (; f3--; h3 += "0")
            ;
          d3.c.push(+h3);
        }
      } else
        d3.c = [d3.e = 0];
    }
    function Z2(e4, t4, r3, n3) {
      var i3, a3, o3, u3, s3;
      if (null == r3 ? r3 = k2 : y2(r3, 0, 8), !e4.c)
        return e4.toString();
      if (i3 = e4.c[0], o3 = e4.e, null == t4)
        s3 = h2(e4.c), s3 = 1 == n3 || 2 == n3 && (o3 <= L2 || o3 >= P2) ? v2(s3, o3) : w2(s3, o3, "0");
      else if (a3 = (e4 = H(new q2(e4), t4, r3)).e, u3 = (s3 = h2(e4.c)).length, 1 == n3 || 2 == n3 && (t4 <= a3 || a3 <= L2)) {
        for (; u3 < t4; s3 += "0", u3++)
          ;
        s3 = v2(s3, a3);
      } else if (t4 -= o3, s3 = w2(s3, a3, "0"), a3 + 1 > u3) {
        if (--t4 > 0)
          for (s3 += "."; t4--; s3 += "0")
            ;
      } else if ((t4 += a3 - u3) > 0)
        for (a3 + 1 == u3 && (s3 += "."); t4--; s3 += "0")
          ;
      return e4.s < 0 && i3 ? "-" + s3 : s3;
    }
    function z2(e4, t4) {
      for (var r3, n3, i3 = 1, a3 = new q2(e4[0]); i3 < e4.length; i3++)
        (!(n3 = new q2(e4[i3])).s || (r3 = d2(a3, n3)) === t4 || 0 === r3 && a3.s === t4) && (a3 = n3);
      return a3;
    }
    function W(e4, t4, r3) {
      for (var n3 = 1, i3 = t4.length; !t4[--i3]; t4.pop())
        ;
      for (i3 = t4[0]; i3 >= 10; i3 /= 10, n3++)
        ;
      return (r3 = n3 + r3 * s2 - 1) > T2 ? e4.c = e4.e = null : r3 < C2 ? e4.c = [e4.e = 0] : (e4.e = r3, e4.c = t4), e4;
    }
    function H(e4, t4, r3, a3) {
      var o3, l3, f3, p3, g3, h3, d3, m3 = e4.c, y3 = c2;
      if (m3) {
        e: {
          for (o3 = 1, p3 = m3[0]; p3 >= 10; p3 /= 10, o3++)
            ;
          if ((l3 = t4 - o3) < 0)
            l3 += s2, f3 = t4, g3 = m3[h3 = 0], d3 = i2(g3 / y3[o3 - f3 - 1] % 10);
          else if ((h3 = n2((l3 + 1) / s2)) >= m3.length) {
            if (!a3)
              break e;
            for (; m3.length <= h3; m3.push(0))
              ;
            g3 = d3 = 0, o3 = 1, f3 = (l3 %= s2) - s2 + 1;
          } else {
            for (g3 = p3 = m3[h3], o3 = 1; p3 >= 10; p3 /= 10, o3++)
              ;
            d3 = (f3 = (l3 %= s2) - s2 + o3) < 0 ? 0 : i2(g3 / y3[o3 - f3 - 1] % 10);
          }
          if (a3 = a3 || t4 < 0 || null != m3[h3 + 1] || (f3 < 0 ? g3 : g3 % y3[o3 - f3 - 1]), a3 = r3 < 4 ? (d3 || a3) && (0 == r3 || r3 == (e4.s < 0 ? 3 : 2)) : d3 > 5 || 5 == d3 && (4 == r3 || a3 || 6 == r3 && (l3 > 0 ? f3 > 0 ? g3 / y3[o3 - f3] : 0 : m3[h3 - 1]) % 10 & 1 || r3 == (e4.s < 0 ? 8 : 7)), t4 < 1 || !m3[0])
            return m3.length = 0, a3 ? (t4 -= e4.e + 1, m3[0] = y3[(s2 - t4 % s2) % s2], e4.e = -t4 || 0) : m3[0] = e4.e = 0, e4;
          if (0 == l3 ? (m3.length = h3, p3 = 1, h3--) : (m3.length = h3 + 1, p3 = y3[s2 - l3], m3[h3] = f3 > 0 ? i2(g3 / y3[o3 - f3] % y3[f3]) * p3 : 0), a3)
            for (; ; ) {
              if (0 == h3) {
                for (l3 = 1, f3 = m3[0]; f3 >= 10; f3 /= 10, l3++)
                  ;
                for (f3 = m3[0] += p3, p3 = 1; f3 >= 10; f3 /= 10, p3++)
                  ;
                l3 != p3 && (e4.e++, m3[0] == u2 && (m3[0] = 1));
                break;
              }
              if (m3[h3] += p3, m3[h3] != u2)
                break;
              m3[h3--] = 0, p3 = 1;
            }
          for (l3 = m3.length; 0 === m3[--l3]; m3.pop())
            ;
        }
        e4.e > T2 ? e4.c = e4.e = null : e4.e < C2 && (e4.c = [e4.e = 0]);
      }
      return e4;
    }
    function Y(e4) {
      var t4, r3 = e4.e;
      return null === r3 ? e4.toString() : (t4 = h2(e4.c), t4 = r3 <= L2 || r3 >= P2 ? v2(t4, r3) : w2(t4, r3, "0"), e4.s < 0 ? "-" + t4 : t4);
    }
    return q2.clone = e3, q2.ROUND_UP = 0, q2.ROUND_DOWN = 1, q2.ROUND_CEIL = 2, q2.ROUND_FLOOR = 3, q2.ROUND_HALF_UP = 4, q2.ROUND_HALF_DOWN = 5, q2.ROUND_HALF_EVEN = 6, q2.ROUND_HALF_CEIL = 7, q2.ROUND_HALF_FLOOR = 8, q2.EUCLID = 9, q2.config = q2.set = function(e4) {
      var t4, r3;
      if (null != e4) {
        if ("object" != typeof e4)
          throw Error(a2 + "Object expected: " + e4);
        if (e4.hasOwnProperty(t4 = "DECIMAL_PLACES") && (y2(r3 = e4[t4], 0, p2, t4), _2 = r3), e4.hasOwnProperty(t4 = "ROUNDING_MODE") && (y2(r3 = e4[t4], 0, 8, t4), k2 = r3), e4.hasOwnProperty(t4 = "EXPONENTIAL_AT") && ((r3 = e4[t4]) && r3.pop ? (y2(r3[0], -p2, 0, t4), y2(r3[1], 0, p2, t4), L2 = r3[0], P2 = r3[1]) : (y2(r3, -p2, p2, t4), L2 = -(P2 = r3 < 0 ? -r3 : r3))), e4.hasOwnProperty(t4 = "RANGE"))
          if ((r3 = e4[t4]) && r3.pop)
            y2(r3[0], -p2, -1, t4), y2(r3[1], 1, p2, t4), C2 = r3[0], T2 = r3[1];
          else {
            if (y2(r3, -p2, p2, t4), !r3)
              throw Error(a2 + t4 + " cannot be zero: " + r3);
            C2 = -(T2 = r3 < 0 ? -r3 : r3);
          }
        if (e4.hasOwnProperty(t4 = "CRYPTO")) {
          if ((r3 = e4[t4]) !== !!r3)
            throw Error(a2 + t4 + " not true or false: " + r3);
          if (r3) {
            if ("undefined" == typeof crypto || !crypto || !crypto.getRandomValues && !crypto.randomBytes)
              throw j2 = !r3, Error(a2 + "crypto unavailable");
            j2 = r3;
          } else
            j2 = r3;
        }
        if (e4.hasOwnProperty(t4 = "MODULO_MODE") && (y2(r3 = e4[t4], 0, 9, t4), U2 = r3), e4.hasOwnProperty(t4 = "POW_PRECISION") && (y2(r3 = e4[t4], 0, p2, t4), R2 = r3), e4.hasOwnProperty(t4 = "FORMAT")) {
          if ("object" != typeof (r3 = e4[t4]))
            throw Error(a2 + t4 + " not an object: " + r3);
          I2 = r3;
        }
        if (e4.hasOwnProperty(t4 = "ALPHABET")) {
          if ("string" != typeof (r3 = e4[t4]) || /^.?$|[+\-.\s]|(.).*\1/.test(r3))
            throw Error(a2 + t4 + " invalid: " + r3);
          V2 = "0123456789" == r3.slice(0, 10), G2 = r3;
        }
      }
      return { DECIMAL_PLACES: _2, ROUNDING_MODE: k2, EXPONENTIAL_AT: [L2, P2], RANGE: [C2, T2], CRYPTO: j2, MODULO_MODE: U2, POW_PRECISION: R2, FORMAT: I2, ALPHABET: G2 };
    }, q2.isBigNumber = function(e4) {
      if (!e4 || true !== e4._isBigNumber)
        return false;
      if (!q2.DEBUG)
        return true;
      var t4, r3, n3 = e4.c, o3 = e4.e, l3 = e4.s;
      e:
        if ("[object Array]" == {}.toString.call(n3)) {
          if ((1 === l3 || -1 === l3) && o3 >= -p2 && o3 <= p2 && o3 === i2(o3)) {
            if (0 === n3[0]) {
              if (0 === o3 && 1 === n3.length)
                return true;
              break e;
            }
            if ((t4 = (o3 + 1) % s2) < 1 && (t4 += s2), String(n3[0]).length == t4) {
              for (t4 = 0; t4 < n3.length; t4++)
                if ((r3 = n3[t4]) < 0 || r3 >= u2 || r3 !== i2(r3))
                  break e;
              if (0 !== r3)
                return true;
            }
          }
        } else if (null === n3 && null === o3 && (null === l3 || 1 === l3 || -1 === l3))
          return true;
      throw Error(a2 + "Invalid BigNumber: " + e4);
    }, q2.maximum = q2.max = function() {
      return z2(arguments, -1);
    }, q2.minimum = q2.min = function() {
      return z2(arguments, 1);
    }, q2.random = (S2 = 9007199254740992, N2 = Math.random() * S2 & 2097151 ? function() {
      return i2(Math.random() * S2);
    } : function() {
      return 8388608 * (1073741824 * Math.random() | 0) + (8388608 * Math.random() | 0);
    }, function(e4) {
      var t4, r3, o3, u3, l3, f3 = 0, g3 = [], h3 = new q2(A2);
      if (null == e4 ? e4 = _2 : y2(e4, 0, p2), u3 = n2(e4 / s2), j2)
        if (crypto.getRandomValues) {
          for (t4 = crypto.getRandomValues(new Uint32Array(u3 *= 2)); f3 < u3; )
            (l3 = 131072 * t4[f3] + (t4[f3 + 1] >>> 11)) >= 9e15 ? (r3 = crypto.getRandomValues(new Uint32Array(2)), t4[f3] = r3[0], t4[f3 + 1] = r3[1]) : (g3.push(l3 % 1e14), f3 += 2);
          f3 = u3 / 2;
        } else {
          if (!crypto.randomBytes)
            throw j2 = false, Error(a2 + "crypto unavailable");
          for (t4 = crypto.randomBytes(u3 *= 7); f3 < u3; )
            (l3 = 281474976710656 * (31 & t4[f3]) + 1099511627776 * t4[f3 + 1] + 4294967296 * t4[f3 + 2] + 16777216 * t4[f3 + 3] + (t4[f3 + 4] << 16) + (t4[f3 + 5] << 8) + t4[f3 + 6]) >= 9e15 ? crypto.randomBytes(7).copy(t4, f3) : (g3.push(l3 % 1e14), f3 += 7);
          f3 = u3 / 7;
        }
      if (!j2)
        for (; f3 < u3; )
          (l3 = N2()) < 9e15 && (g3[f3++] = l3 % 1e14);
      for (u3 = g3[--f3], e4 %= s2, u3 && e4 && (l3 = c2[s2 - e4], g3[f3] = i2(u3 / l3) * l3); 0 === g3[f3]; g3.pop(), f3--)
        ;
      if (f3 < 0)
        g3 = [o3 = 0];
      else {
        for (o3 = -1; 0 === g3[0]; g3.splice(0, 1), o3 -= s2)
          ;
        for (f3 = 1, l3 = g3[0]; l3 >= 10; l3 /= 10, f3++)
          ;
        f3 < s2 && (o3 -= s2 - f3);
      }
      return h3.e = o3, h3.c = g3, h3;
    }), q2.sum = function() {
      for (var e4 = 1, t4 = arguments, r3 = new q2(t4[0]); e4 < t4.length; )
        r3 = r3.plus(t4[e4++]);
      return r3;
    }, O2 = function() {
      var e4 = "0123456789";
      function t4(e5, t5, r3, n3) {
        for (var i3, a3, o3 = [0], u3 = 0, s3 = e5.length; u3 < s3; ) {
          for (a3 = o3.length; a3--; o3[a3] *= t5)
            ;
          for (o3[0] += n3.indexOf(e5.charAt(u3++)), i3 = 0; i3 < o3.length; i3++)
            o3[i3] > r3 - 1 && (null == o3[i3 + 1] && (o3[i3 + 1] = 0), o3[i3 + 1] += o3[i3] / r3 | 0, o3[i3] %= r3);
        }
        return o3.reverse();
      }
      return function(r3, n3, i3, a3, o3) {
        var u3, s3, l3, c3, f3, p3, g3, d3, y3 = r3.indexOf("."), b3 = _2, v3 = k2;
        for (y3 >= 0 && (c3 = R2, R2 = 0, r3 = r3.replace(".", ""), p3 = (d3 = new q2(n3)).pow(r3.length - y3), R2 = c3, d3.c = t4(w2(h2(p3.c), p3.e, "0"), 10, i3, e4), d3.e = d3.c.length), l3 = c3 = (g3 = t4(r3, n3, i3, o3 ? (u3 = G2, e4) : (u3 = e4, G2))).length; 0 == g3[--c3]; g3.pop())
          ;
        if (!g3[0])
          return u3.charAt(0);
        if (y3 < 0 ? --l3 : (p3.c = g3, p3.e = l3, p3.s = a3, g3 = (p3 = m2(p3, d3, b3, v3, i3)).c, f3 = p3.r, l3 = p3.e), y3 = g3[s3 = l3 + b3 + 1], c3 = i3 / 2, f3 = f3 || s3 < 0 || null != g3[s3 + 1], f3 = v3 < 4 ? (null != y3 || f3) && (0 == v3 || v3 == (p3.s < 0 ? 3 : 2)) : y3 > c3 || y3 == c3 && (4 == v3 || f3 || 6 == v3 && 1 & g3[s3 - 1] || v3 == (p3.s < 0 ? 8 : 7)), s3 < 1 || !g3[0])
          r3 = f3 ? w2(u3.charAt(1), -b3, u3.charAt(0)) : u3.charAt(0);
        else {
          if (g3.length = s3, f3)
            for (--i3; ++g3[--s3] > i3; )
              g3[s3] = 0, s3 || (++l3, g3 = [1].concat(g3));
          for (c3 = g3.length; !g3[--c3]; )
            ;
          for (y3 = 0, r3 = ""; y3 <= c3; r3 += u3.charAt(g3[y3++]))
            ;
          r3 = w2(r3, l3, u3.charAt(0));
        }
        return r3;
      };
    }(), m2 = function() {
      function e4(e5, t5, r4) {
        var n3, i3, a3, o3, u3 = 0, s3 = e5.length, l3 = t5 % f2, c3 = t5 / f2 | 0;
        for (e5 = e5.slice(); s3--; )
          u3 = ((i3 = l3 * (a3 = e5[s3] % f2) + (n3 = c3 * a3 + (o3 = e5[s3] / f2 | 0) * l3) % f2 * f2 + u3) / r4 | 0) + (n3 / f2 | 0) + c3 * o3, e5[s3] = i3 % r4;
        return u3 && (e5 = [u3].concat(e5)), e5;
      }
      function t4(e5, t5, r4, n3) {
        var i3, a3;
        if (r4 != n3)
          a3 = r4 > n3 ? 1 : -1;
        else
          for (i3 = a3 = 0; i3 < r4; i3++)
            if (e5[i3] != t5[i3]) {
              a3 = e5[i3] > t5[i3] ? 1 : -1;
              break;
            }
        return a3;
      }
      function r3(e5, t5, r4, n3) {
        for (var i3 = 0; r4--; )
          e5[r4] -= i3, i3 = e5[r4] < t5[r4] ? 1 : 0, e5[r4] = i3 * n3 + e5[r4] - t5[r4];
        for (; !e5[0] && e5.length > 1; e5.splice(0, 1))
          ;
      }
      return function(n3, a3, o3, l3, c3) {
        var f3, p3, h3, d3, m3, y3, b3, v3, w3, O3, x3, S3, N3, $3, B3, M3, D3, F3 = n3.s == a3.s ? 1 : -1, E3 = n3.c, A3 = a3.c;
        if (!(E3 && E3[0] && A3 && A3[0]))
          return new q2(n3.s && a3.s && (E3 ? !A3 || E3[0] != A3[0] : A3) ? E3 && 0 == E3[0] || !A3 ? 0 * F3 : F3 / 0 : NaN);
        for (w3 = (v3 = new q2(F3)).c = [], F3 = o3 + (p3 = n3.e - a3.e) + 1, c3 || (c3 = u2, p3 = g2(n3.e / s2) - g2(a3.e / s2), F3 = F3 / s2 | 0), h3 = 0; A3[h3] == (E3[h3] || 0); h3++)
          ;
        if (A3[h3] > (E3[h3] || 0) && p3--, F3 < 0)
          w3.push(1), d3 = true;
        else {
          for ($3 = E3.length, M3 = A3.length, h3 = 0, F3 += 2, (m3 = i2(c3 / (A3[0] + 1))) > 1 && (A3 = e4(A3, m3, c3), E3 = e4(E3, m3, c3), M3 = A3.length, $3 = E3.length), N3 = M3, x3 = (O3 = E3.slice(0, M3)).length; x3 < M3; O3[x3++] = 0)
            ;
          D3 = A3.slice(), D3 = [0].concat(D3), B3 = A3[0], A3[1] >= c3 / 2 && B3++;
          do {
            if (m3 = 0, (f3 = t4(A3, O3, M3, x3)) < 0) {
              if (S3 = O3[0], M3 != x3 && (S3 = S3 * c3 + (O3[1] || 0)), (m3 = i2(S3 / B3)) > 1)
                for (m3 >= c3 && (m3 = c3 - 1), b3 = (y3 = e4(A3, m3, c3)).length, x3 = O3.length; 1 == t4(y3, O3, b3, x3); )
                  m3--, r3(y3, M3 < b3 ? D3 : A3, b3, c3), b3 = y3.length, f3 = 1;
              else
                0 == m3 && (f3 = m3 = 1), b3 = (y3 = A3.slice()).length;
              if (b3 < x3 && (y3 = [0].concat(y3)), r3(O3, y3, x3, c3), x3 = O3.length, -1 == f3)
                for (; t4(A3, O3, M3, x3) < 1; )
                  m3++, r3(O3, M3 < x3 ? D3 : A3, x3, c3), x3 = O3.length;
            } else
              0 === f3 && (m3++, O3 = [0]);
            w3[h3++] = m3, O3[0] ? O3[x3++] = E3[N3] || 0 : (O3 = [E3[N3]], x3 = 1);
          } while ((N3++ < $3 || null != O3[0]) && F3--);
          d3 = null != O3[0], w3[0] || w3.splice(0, 1);
        }
        if (c3 == u2) {
          for (h3 = 1, F3 = w3[0]; F3 >= 10; F3 /= 10, h3++)
            ;
          H(v3, o3 + (v3.e = h3 + p3 * s2 - 1) + 1, l3, d3);
        } else
          v3.e = p3, v3.r = +d3;
        return v3;
      };
    }(), $2 = /^(-?)0([xbo])(?=\w[\w.]*$)/i, B2 = /^([^.]+)\.$/, M2 = /^\.([^.]+)$/, D2 = /^-?(Infinity|NaN)$/, F2 = /^\s*\+(?=[\w.])|^\s+|\s+$/g, x2 = function(e4, t4, r3, n3) {
      var i3, o3 = r3 ? t4 : t4.replace(F2, "");
      if (D2.test(o3))
        e4.s = isNaN(o3) ? null : o3 < 0 ? -1 : 1;
      else {
        if (!r3 && (o3 = o3.replace($2, function(e5, t5, r4) {
          return i3 = "x" == (r4 = r4.toLowerCase()) ? 16 : "b" == r4 ? 2 : 8, n3 && n3 != i3 ? e5 : t5;
        }), n3 && (i3 = n3, o3 = o3.replace(B2, "$1").replace(M2, "0.$1")), t4 != o3))
          return new q2(o3, i3);
        if (q2.DEBUG)
          throw Error(a2 + "Not a" + (n3 ? " base " + n3 : "") + " number: " + t4);
        e4.s = null;
      }
      e4.c = e4.e = null;
    }, E2.absoluteValue = E2.abs = function() {
      var e4 = new q2(this);
      return e4.s < 0 && (e4.s = 1), e4;
    }, E2.comparedTo = function(e4, t4) {
      return d2(this, new q2(e4, t4));
    }, E2.decimalPlaces = E2.dp = function(e4, t4) {
      var r3, n3, i3, a3 = this;
      if (null != e4)
        return y2(e4, 0, p2), null == t4 ? t4 = k2 : y2(t4, 0, 8), H(new q2(a3), e4 + a3.e + 1, t4);
      if (!(r3 = a3.c))
        return null;
      if (n3 = ((i3 = r3.length - 1) - g2(this.e / s2)) * s2, i3 = r3[i3])
        for (; i3 % 10 == 0; i3 /= 10, n3--)
          ;
      return n3 < 0 && (n3 = 0), n3;
    }, E2.dividedBy = E2.div = function(e4, t4) {
      return m2(this, new q2(e4, t4), _2, k2);
    }, E2.dividedToIntegerBy = E2.idiv = function(e4, t4) {
      return m2(this, new q2(e4, t4), 0, 1);
    }, E2.exponentiatedBy = E2.pow = function(e4, t4) {
      var r3, o3, u3, l3, c3, f3, p3, g3, h3 = this;
      if ((e4 = new q2(e4)).c && !e4.isInteger())
        throw Error(a2 + "Exponent not an integer: " + Y(e4));
      if (null != t4 && (t4 = new q2(t4)), c3 = e4.e > 14, !h3.c || !h3.c[0] || 1 == h3.c[0] && !h3.e && 1 == h3.c.length || !e4.c || !e4.c[0])
        return g3 = new q2(Math.pow(+Y(h3), c3 ? e4.s * (2 - b2(e4)) : +Y(e4))), t4 ? g3.mod(t4) : g3;
      if (f3 = e4.s < 0, t4) {
        if (t4.c ? !t4.c[0] : !t4.s)
          return new q2(NaN);
        (o3 = !f3 && h3.isInteger() && t4.isInteger()) && (h3 = h3.mod(t4));
      } else {
        if (e4.e > 9 && (h3.e > 0 || h3.e < -1 || (0 == h3.e ? h3.c[0] > 1 || c3 && h3.c[1] >= 24e7 : h3.c[0] < 8e13 || c3 && h3.c[0] <= 9999975e7)))
          return l3 = h3.s < 0 && b2(e4) ? -0 : 0, h3.e > -1 && (l3 = 1 / l3), new q2(f3 ? 1 / l3 : l3);
        R2 && (l3 = n2(R2 / s2 + 2));
      }
      for (c3 ? (r3 = new q2(0.5), f3 && (e4.s = 1), p3 = b2(e4)) : p3 = (u3 = Math.abs(+Y(e4))) % 2, g3 = new q2(A2); ; ) {
        if (p3) {
          if (!(g3 = g3.times(h3)).c)
            break;
          l3 ? g3.c.length > l3 && (g3.c.length = l3) : o3 && (g3 = g3.mod(t4));
        }
        if (u3) {
          if (0 === (u3 = i2(u3 / 2)))
            break;
          p3 = u3 % 2;
        } else if (H(e4 = e4.times(r3), e4.e + 1, 1), e4.e > 14)
          p3 = b2(e4);
        else {
          if (0 == (u3 = +Y(e4)))
            break;
          p3 = u3 % 2;
        }
        h3 = h3.times(h3), l3 ? h3.c && h3.c.length > l3 && (h3.c.length = l3) : o3 && (h3 = h3.mod(t4));
      }
      return o3 ? g3 : (f3 && (g3 = A2.div(g3)), t4 ? g3.mod(t4) : l3 ? H(g3, R2, k2, void 0) : g3);
    }, E2.integerValue = function(e4) {
      var t4 = new q2(this);
      return null == e4 ? e4 = k2 : y2(e4, 0, 8), H(t4, t4.e + 1, e4);
    }, E2.isEqualTo = E2.eq = function(e4, t4) {
      return 0 === d2(this, new q2(e4, t4));
    }, E2.isFinite = function() {
      return !!this.c;
    }, E2.isGreaterThan = E2.gt = function(e4, t4) {
      return d2(this, new q2(e4, t4)) > 0;
    }, E2.isGreaterThanOrEqualTo = E2.gte = function(e4, t4) {
      return 1 === (t4 = d2(this, new q2(e4, t4))) || 0 === t4;
    }, E2.isInteger = function() {
      return !!this.c && g2(this.e / s2) > this.c.length - 2;
    }, E2.isLessThan = E2.lt = function(e4, t4) {
      return d2(this, new q2(e4, t4)) < 0;
    }, E2.isLessThanOrEqualTo = E2.lte = function(e4, t4) {
      return -1 === (t4 = d2(this, new q2(e4, t4))) || 0 === t4;
    }, E2.isNaN = function() {
      return !this.s;
    }, E2.isNegative = function() {
      return this.s < 0;
    }, E2.isPositive = function() {
      return this.s > 0;
    }, E2.isZero = function() {
      return !!this.c && 0 == this.c[0];
    }, E2.minus = function(e4, t4) {
      var r3, n3, i3, a3, o3 = this, l3 = o3.s;
      if (t4 = (e4 = new q2(e4, t4)).s, !l3 || !t4)
        return new q2(NaN);
      if (l3 != t4)
        return e4.s = -t4, o3.plus(e4);
      var c3 = o3.e / s2, f3 = e4.e / s2, p3 = o3.c, h3 = e4.c;
      if (!c3 || !f3) {
        if (!p3 || !h3)
          return p3 ? (e4.s = -t4, e4) : new q2(h3 ? o3 : NaN);
        if (!p3[0] || !h3[0])
          return h3[0] ? (e4.s = -t4, e4) : new q2(p3[0] ? o3 : 3 == k2 ? -0 : 0);
      }
      if (c3 = g2(c3), f3 = g2(f3), p3 = p3.slice(), l3 = c3 - f3) {
        for ((a3 = l3 < 0) ? (l3 = -l3, i3 = p3) : (f3 = c3, i3 = h3), i3.reverse(), t4 = l3; t4--; i3.push(0))
          ;
        i3.reverse();
      } else
        for (n3 = (a3 = (l3 = p3.length) < (t4 = h3.length)) ? l3 : t4, l3 = t4 = 0; t4 < n3; t4++)
          if (p3[t4] != h3[t4]) {
            a3 = p3[t4] < h3[t4];
            break;
          }
      if (a3 && (i3 = p3, p3 = h3, h3 = i3, e4.s = -e4.s), (t4 = (n3 = h3.length) - (r3 = p3.length)) > 0)
        for (; t4--; p3[r3++] = 0)
          ;
      for (t4 = u2 - 1; n3 > l3; ) {
        if (p3[--n3] < h3[n3]) {
          for (r3 = n3; r3 && !p3[--r3]; p3[r3] = t4)
            ;
          --p3[r3], p3[n3] += u2;
        }
        p3[n3] -= h3[n3];
      }
      for (; 0 == p3[0]; p3.splice(0, 1), --f3)
        ;
      return p3[0] ? W(e4, p3, f3) : (e4.s = 3 == k2 ? -1 : 1, e4.c = [e4.e = 0], e4);
    }, E2.modulo = E2.mod = function(e4, t4) {
      var r3, n3, i3 = this;
      return e4 = new q2(e4, t4), !i3.c || !e4.s || e4.c && !e4.c[0] ? new q2(NaN) : !e4.c || i3.c && !i3.c[0] ? new q2(i3) : (9 == U2 ? (n3 = e4.s, e4.s = 1, r3 = m2(i3, e4, 0, 3), e4.s = n3, r3.s *= n3) : r3 = m2(i3, e4, 0, U2), (e4 = i3.minus(r3.times(e4))).c[0] || 1 != U2 || (e4.s = i3.s), e4);
    }, E2.multipliedBy = E2.times = function(e4, t4) {
      var r3, n3, i3, a3, o3, l3, c3, p3, h3, d3, m3, y3, b3, v3, w3, O3 = this, x3 = O3.c, S3 = (e4 = new q2(e4, t4)).c;
      if (!(x3 && S3 && x3[0] && S3[0]))
        return !O3.s || !e4.s || x3 && !x3[0] && !S3 || S3 && !S3[0] && !x3 ? e4.c = e4.e = e4.s = null : (e4.s *= O3.s, x3 && S3 ? (e4.c = [0], e4.e = 0) : e4.c = e4.e = null), e4;
      for (n3 = g2(O3.e / s2) + g2(e4.e / s2), e4.s *= O3.s, (c3 = x3.length) < (d3 = S3.length) && (b3 = x3, x3 = S3, S3 = b3, i3 = c3, c3 = d3, d3 = i3), i3 = c3 + d3, b3 = []; i3--; b3.push(0))
        ;
      for (v3 = u2, w3 = f2, i3 = d3; --i3 >= 0; ) {
        for (r3 = 0, m3 = S3[i3] % w3, y3 = S3[i3] / w3 | 0, a3 = i3 + (o3 = c3); a3 > i3; )
          r3 = ((p3 = m3 * (p3 = x3[--o3] % w3) + (l3 = y3 * p3 + (h3 = x3[o3] / w3 | 0) * m3) % w3 * w3 + b3[a3] + r3) / v3 | 0) + (l3 / w3 | 0) + y3 * h3, b3[a3--] = p3 % v3;
        b3[a3] = r3;
      }
      return r3 ? ++n3 : b3.splice(0, 1), W(e4, b3, n3);
    }, E2.negated = function() {
      var e4 = new q2(this);
      return e4.s = -e4.s || null, e4;
    }, E2.plus = function(e4, t4) {
      var r3, n3 = this, i3 = n3.s;
      if (t4 = (e4 = new q2(e4, t4)).s, !i3 || !t4)
        return new q2(NaN);
      if (i3 != t4)
        return e4.s = -t4, n3.minus(e4);
      var a3 = n3.e / s2, o3 = e4.e / s2, l3 = n3.c, c3 = e4.c;
      if (!a3 || !o3) {
        if (!l3 || !c3)
          return new q2(i3 / 0);
        if (!l3[0] || !c3[0])
          return c3[0] ? e4 : new q2(l3[0] ? n3 : 0 * i3);
      }
      if (a3 = g2(a3), o3 = g2(o3), l3 = l3.slice(), i3 = a3 - o3) {
        for (i3 > 0 ? (o3 = a3, r3 = c3) : (i3 = -i3, r3 = l3), r3.reverse(); i3--; r3.push(0))
          ;
        r3.reverse();
      }
      for ((i3 = l3.length) - (t4 = c3.length) < 0 && (r3 = c3, c3 = l3, l3 = r3, t4 = i3), i3 = 0; t4; )
        i3 = (l3[--t4] = l3[t4] + c3[t4] + i3) / u2 | 0, l3[t4] = u2 === l3[t4] ? 0 : l3[t4] % u2;
      return i3 && (l3 = [i3].concat(l3), ++o3), W(e4, l3, o3);
    }, E2.precision = E2.sd = function(e4, t4) {
      var r3, n3, i3, a3 = this;
      if (null != e4 && e4 !== !!e4)
        return y2(e4, 1, p2), null == t4 ? t4 = k2 : y2(t4, 0, 8), H(new q2(a3), e4, t4);
      if (!(r3 = a3.c))
        return null;
      if (n3 = (i3 = r3.length - 1) * s2 + 1, i3 = r3[i3]) {
        for (; i3 % 10 == 0; i3 /= 10, n3--)
          ;
        for (i3 = r3[0]; i3 >= 10; i3 /= 10, n3++)
          ;
      }
      return e4 && a3.e + 1 > n3 && (n3 = a3.e + 1), n3;
    }, E2.shiftedBy = function(e4) {
      return y2(e4, -9007199254740991, l2), this.times("1e" + e4);
    }, E2.squareRoot = E2.sqrt = function() {
      var e4, t4, r3, n3, i3, a3 = this, o3 = a3.c, u3 = a3.s, s3 = a3.e, l3 = _2 + 4, c3 = new q2("0.5");
      if (1 !== u3 || !o3 || !o3[0])
        return new q2(!u3 || u3 < 0 && (!o3 || o3[0]) ? NaN : o3 ? a3 : 1 / 0);
      if (0 == (u3 = Math.sqrt(+Y(a3))) || u3 == 1 / 0 ? (((t4 = h2(o3)).length + s3) % 2 == 0 && (t4 += "0"), u3 = Math.sqrt(+t4), s3 = g2((s3 + 1) / 2) - (s3 < 0 || s3 % 2), r3 = new q2(t4 = u3 == 1 / 0 ? "5e" + s3 : (t4 = u3.toExponential()).slice(0, t4.indexOf("e") + 1) + s3)) : r3 = new q2(u3 + ""), r3.c[0]) {
        for ((u3 = (s3 = r3.e) + l3) < 3 && (u3 = 0); ; )
          if (i3 = r3, r3 = c3.times(i3.plus(m2(a3, i3, l3, 1))), h2(i3.c).slice(0, u3) === (t4 = h2(r3.c)).slice(0, u3)) {
            if (r3.e < s3 && --u3, "9999" != (t4 = t4.slice(u3 - 3, u3 + 1)) && (n3 || "4999" != t4)) {
              +t4 && (+t4.slice(1) || "5" != t4.charAt(0)) || (H(r3, r3.e + _2 + 2, 1), e4 = !r3.times(r3).eq(a3));
              break;
            }
            if (!n3 && (H(i3, i3.e + _2 + 2, 0), i3.times(i3).eq(a3))) {
              r3 = i3;
              break;
            }
            l3 += 4, u3 += 4, n3 = 1;
          }
      }
      return H(r3, r3.e + _2 + 1, k2, e4);
    }, E2.toExponential = function(e4, t4) {
      return null != e4 && (y2(e4, 0, p2), e4++), Z2(this, e4, t4, 1);
    }, E2.toFixed = function(e4, t4) {
      return null != e4 && (y2(e4, 0, p2), e4 = e4 + this.e + 1), Z2(this, e4, t4);
    }, E2.toFormat = function(e4, t4, r3) {
      var n3, i3 = this;
      if (null == r3)
        null != e4 && t4 && "object" == typeof t4 ? (r3 = t4, t4 = null) : e4 && "object" == typeof e4 ? (r3 = e4, e4 = t4 = null) : r3 = I2;
      else if ("object" != typeof r3)
        throw Error(a2 + "Argument not an object: " + r3);
      if (n3 = i3.toFixed(e4, t4), i3.c) {
        var o3, u3 = n3.split("."), s3 = +r3.groupSize, l3 = +r3.secondaryGroupSize, c3 = r3.groupSeparator || "", f3 = u3[0], p3 = u3[1], g3 = i3.s < 0, h3 = g3 ? f3.slice(1) : f3, d3 = h3.length;
        if (l3 && (o3 = s3, s3 = l3, l3 = o3, d3 -= o3), s3 > 0 && d3 > 0) {
          for (o3 = d3 % s3 || s3, f3 = h3.substr(0, o3); o3 < d3; o3 += s3)
            f3 += c3 + h3.substr(o3, s3);
          l3 > 0 && (f3 += c3 + h3.slice(o3)), g3 && (f3 = "-" + f3);
        }
        n3 = p3 ? f3 + (r3.decimalSeparator || "") + ((l3 = +r3.fractionGroupSize) ? p3.replace(new RegExp("\\d{" + l3 + "}\\B", "g"), "$&" + (r3.fractionGroupSeparator || "")) : p3) : f3;
      }
      return (r3.prefix || "") + n3 + (r3.suffix || "");
    }, E2.toFraction = function(e4) {
      var t4, r3, n3, i3, o3, u3, l3, f3, p3, g3, d3, y3, b3 = this, v3 = b3.c;
      if (null != e4 && (!(l3 = new q2(e4)).isInteger() && (l3.c || 1 !== l3.s) || l3.lt(A2)))
        throw Error(a2 + "Argument " + (l3.isInteger() ? "out of range: " : "not an integer: ") + Y(l3));
      if (!v3)
        return new q2(b3);
      for (t4 = new q2(A2), p3 = r3 = new q2(A2), n3 = f3 = new q2(A2), y3 = h2(v3), o3 = t4.e = y3.length - b3.e - 1, t4.c[0] = c2[(u3 = o3 % s2) < 0 ? s2 + u3 : u3], e4 = !e4 || l3.comparedTo(t4) > 0 ? o3 > 0 ? t4 : p3 : l3, u3 = T2, T2 = 1 / 0, l3 = new q2(y3), f3.c[0] = 0; g3 = m2(l3, t4, 0, 1), 1 != (i3 = r3.plus(g3.times(n3))).comparedTo(e4); )
        r3 = n3, n3 = i3, p3 = f3.plus(g3.times(i3 = p3)), f3 = i3, t4 = l3.minus(g3.times(i3 = t4)), l3 = i3;
      return i3 = m2(e4.minus(r3), n3, 0, 1), f3 = f3.plus(i3.times(p3)), r3 = r3.plus(i3.times(n3)), f3.s = p3.s = b3.s, d3 = m2(p3, n3, o3 *= 2, k2).minus(b3).abs().comparedTo(m2(f3, r3, o3, k2).minus(b3).abs()) < 1 ? [p3, n3] : [f3, r3], T2 = u3, d3;
    }, E2.toNumber = function() {
      return +Y(this);
    }, E2.toPrecision = function(e4, t4) {
      return null != e4 && y2(e4, 1, p2), Z2(this, e4, t4, 2);
    }, E2.toString = function(e4) {
      var t4, r3 = this, n3 = r3.s, i3 = r3.e;
      return null === i3 ? n3 ? (t4 = "Infinity", n3 < 0 && (t4 = "-" + t4)) : t4 = "NaN" : (null == e4 ? t4 = i3 <= L2 || i3 >= P2 ? v2(h2(r3.c), i3) : w2(h2(r3.c), i3, "0") : 10 === e4 && V2 ? t4 = w2(h2((r3 = H(new q2(r3), _2 + i3 + 1, k2)).c), r3.e, "0") : (y2(e4, 2, G2.length, "Base"), t4 = O2(w2(h2(r3.c), i3, "0"), 10, e4, n3, true)), n3 < 0 && r3.c[0] && (t4 = "-" + t4)), t4;
    }, E2.valueOf = E2.toJSON = function() {
      return Y(this);
    }, E2._isBigNumber = true, null != t3 && q2.set(t3), q2;
  }(), t2.default = t2.BigNumber = t2, m.exports ? m.exports = t2 : (e2 || (e2 = "undefined" != typeof self && self ? self : window), e2.BigNumber = t2);
}(o);
var b = y.exports;
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
const v = h(), w = c(), O = g, x = b, S = { trillion: Math.pow(10, 12), billion: Math.pow(10, 9), million: Math.pow(10, 6), thousand: Math.pow(10, 3) }, N = { totalLength: 0, characteristic: 0, forceAverage: false, average: false, mantissa: -1, optionalMantissa: true, thousandSeparated: false, spaceSeparated: false, negative: "sign", forceSign: false, roundingFunction: Math.round, spaceSeparatedAbbreviation: false }, { binarySuffixes: $, decimalSuffixes: B } = v.currentBytes(), M = { general: { scale: 1024, suffixes: B, marker: "bd" }, binary: { scale: 1024, suffixes: $, marker: "b" }, decimal: { scale: 1e3, suffixes: B, marker: "d" } };
function D(e2, t2 = {}, r2) {
  if ("string" == typeof t2 && (t2 = O.parseFormat(t2)), !w.validateFormat(t2))
    return "ERROR: invalid format";
  let n2 = t2.prefix || "", i2 = t2.postfix || "", a2 = function(e3, t3, r3) {
    switch (t3.output) {
      case "currency":
        return function(e4, t4, r4) {
          const n3 = r4.currentCurrency();
          let i3, a3 = Object.assign({}, t4), o2 = Object.assign({}, N, a3), u2 = "", s2 = !!o2.totalLength || !!o2.forceAverage || o2.average, l2 = a3.currencyPosition || n3.position, c2 = a3.currencySymbol || n3.symbol;
          const f2 = void 0 !== o2.spaceSeparatedCurrency ? o2.spaceSeparatedCurrency : o2.spaceSeparated;
          void 0 === a3.lowPrecision && (a3.lowPrecision = false);
          f2 && (u2 = " ");
          "infix" === l2 && (i3 = u2 + c2 + u2);
          let p2 = _({ instance: e4, providedFormat: a3, state: r4, decimalSeparator: i3 });
          "prefix" === l2 && (p2 = e4._value < 0 && "sign" === o2.negative ? `-${u2}${c2}${p2.slice(1)}` : e4._value > 0 && o2.forceSign ? `+${u2}${c2}${p2.slice(1)}` : c2 + u2 + p2);
          l2 && "postfix" !== l2 || (u2 = !o2.spaceSeparatedAbbreviation && s2 ? "" : u2, p2 = p2 + u2 + c2);
          return p2;
        }(e3, t3 = k(t3, v.currentCurrencyDefaultFormat()), v);
      case "percent":
        return function(e4, t4, r4, n3) {
          let i3 = t4.prefixSymbol, a3 = _({ instance: n3(100 * e4._value), providedFormat: t4, state: r4 }), o2 = Object.assign({}, N, t4);
          if (i3)
            return `%${o2.spaceSeparated ? " " : ""}${a3}`;
          return `${a3}${o2.spaceSeparated ? " " : ""}%`;
        }(e3, t3 = k(t3, v.currentPercentageDefaultFormat()), v, r3);
      case "byte":
        return function(e4, t4, r4, n3) {
          let i3 = t4.base || "binary", a3 = Object.assign({}, N, t4);
          const { binarySuffixes: o2, decimalSuffixes: u2 } = r4.currentBytes();
          let s2 = { general: { scale: 1024, suffixes: u2 || B, marker: "bd" }, binary: { scale: 1024, suffixes: o2 || $, marker: "b" }, decimal: { scale: 1e3, suffixes: u2 || B, marker: "d" } }[i3], { value: l2, suffix: c2 } = F(e4._value, s2.suffixes, s2.scale), f2 = _({ instance: n3(l2), providedFormat: t4, state: r4, defaults: r4.currentByteDefaultFormat() });
          return `${f2}${a3.spaceSeparated ? " " : ""}${c2}`;
        }(e3, t3 = k(t3, v.currentByteDefaultFormat()), v, r3);
      case "time":
        return t3 = k(t3, v.currentTimeDefaultFormat()), function(e4) {
          let t4 = Math.floor(e4._value / 60 / 60), r4 = Math.floor((e4._value - 60 * t4 * 60) / 60), n3 = Math.round(e4._value - 60 * t4 * 60 - 60 * r4);
          return `${t4}:${r4 < 10 ? "0" : ""}${r4}:${n3 < 10 ? "0" : ""}${n3}`;
        }(e3);
      case "ordinal":
        return function(e4, t4, r4) {
          let n3 = r4.currentOrdinal(), i3 = Object.assign({}, N, t4), a3 = _({ instance: e4, providedFormat: t4, state: r4 }), o2 = n3(e4._value);
          return `${a3}${i3.spaceSeparated ? " " : ""}${o2}`;
        }(e3, t3 = k(t3, v.currentOrdinalDefaultFormat()), v);
      default:
        return _({ instance: e3, providedFormat: t3, numbro: r3 });
    }
  }(e2, t2, r2);
  return a2 = function(e3, t3) {
    return t3 + e3;
  }(a2, n2), a2 = function(e3, t3) {
    return e3 + t3;
  }(a2, i2), a2;
}
function F(e2, t2, r2) {
  let n2 = t2[0], i2 = Math.abs(e2);
  if (i2 >= r2) {
    for (let a2 = 1; a2 < t2.length; ++a2) {
      let o2 = Math.pow(r2, a2), u2 = Math.pow(r2, a2 + 1);
      if (i2 >= o2 && i2 < u2) {
        n2 = t2[a2], e2 /= o2;
        break;
      }
    }
    n2 === t2[0] && (e2 /= Math.pow(r2, t2.length - 1), n2 = t2[t2.length - 1]);
  }
  return { value: e2, suffix: n2 };
}
function E(e2) {
  let t2 = "";
  for (let r2 = 0; r2 < e2; r2++)
    t2 += "0";
  return t2;
}
function A(e2, t2, r2 = Math.round) {
  if (-1 !== e2.toString().indexOf("e"))
    return function(e3, t3) {
      let r3 = e3.toString(), [n2, i2] = r3.split("e"), [a2, o2 = ""] = n2.split(".");
      if (+i2 > 0)
        r3 = a2 + o2 + E(i2 - o2.length);
      else {
        let e4 = ".";
        e4 = +a2 < 0 ? `-0${e4}` : `0${e4}`;
        let n3 = (E(-i2 - 1) + Math.abs(a2) + o2).substr(0, t3);
        n3.length < t3 && (n3 += E(t3 - n3.length)), r3 = e4 + n3;
      }
      return +i2 > 0 && t3 > 0 && (r3 += `.${E(t3)}`), r3;
    }(e2, t2);
  return new x(r2(+`${e2}e+${t2}`) / Math.pow(10, t2)).toFixed(t2);
}
function _({ instance: e2, providedFormat: t2, state: r2 = v, decimalSeparator: n2, defaults: i2 = r2.currentDefaults() }) {
  let a2 = e2._value;
  if (0 === a2 && r2.hasZeroFormat())
    return r2.getZeroFormat();
  if (!isFinite(a2))
    return a2.toString();
  let o2 = Object.assign({}, N, i2, t2), u2 = o2.totalLength, s2 = u2 ? 0 : o2.characteristic, l2 = o2.optionalCharacteristic, c2 = o2.forceAverage, f2 = o2.lowPrecision, p2 = !!u2 || !!c2 || o2.average, g2 = u2 ? -1 : p2 && void 0 === t2.mantissa ? 0 : o2.mantissa, h2 = !u2 && (void 0 === t2.optionalMantissa ? -1 === g2 : o2.optionalMantissa), d2 = o2.trimMantissa, m2 = o2.thousandSeparated, y2 = o2.spaceSeparated, b2 = o2.negative, w2 = o2.forceSign, O2 = o2.exponential, x2 = o2.roundingFunction, $2 = "";
  if (p2) {
    let e3 = function({ value: e4, forceAverage: t3, lowPrecision: r3 = true, abbreviations: n3, spaceSeparated: i3 = false, totalLength: a3 = 0, roundingFunction: o3 = Math.round }) {
      let u3 = "", s3 = Math.abs(e4), l3 = -1;
      if (t3 && n3[t3] && S[t3] ? (u3 = n3[t3], e4 /= S[t3]) : s3 >= S.trillion || r3 && 1 === o3(s3 / S.trillion) ? (u3 = n3.trillion, e4 /= S.trillion) : s3 < S.trillion && s3 >= S.billion || r3 && 1 === o3(s3 / S.billion) ? (u3 = n3.billion, e4 /= S.billion) : s3 < S.billion && s3 >= S.million || r3 && 1 === o3(s3 / S.million) ? (u3 = n3.million, e4 /= S.million) : (s3 < S.million && s3 >= S.thousand || r3 && 1 === o3(s3 / S.thousand)) && (u3 = n3.thousand, e4 /= S.thousand), u3 && (u3 = (i3 ? " " : "") + u3), a3) {
        let t4 = e4 < 0, r4 = e4.toString().split(".")[0], n4 = t4 ? r4.length - 1 : r4.length;
        l3 = Math.max(a3 - n4, 0);
      }
      return { value: e4, abbreviation: u3, mantissaPrecision: l3 };
    }({ value: a2, forceAverage: c2, lowPrecision: f2, abbreviations: r2.currentAbbreviations(), spaceSeparated: y2, roundingFunction: x2, totalLength: u2 });
    a2 = e3.value, $2 += e3.abbreviation, u2 && (g2 = e3.mantissaPrecision);
  }
  if (O2) {
    let e3 = function({ value: e4, characteristicPrecision: t3 }) {
      let [r3, n3] = e4.toExponential().split("e"), i3 = +r3;
      return t3 ? (1 < t3 && (i3 *= Math.pow(10, t3 - 1), n3 = +n3 - (t3 - 1), n3 = n3 >= 0 ? `+${n3}` : n3), { value: i3, abbreviation: `e${n3}` }) : { value: i3, abbreviation: `e${n3}` };
    }({ value: a2, characteristicPrecision: s2 });
    a2 = e3.value, $2 = e3.abbreviation + $2;
  }
  let B2 = function(e3, t3, r3, n3, i3, a3) {
    if (-1 === n3)
      return e3;
    let o3 = A(t3, n3, a3), [u3, s3 = ""] = o3.toString().split(".");
    if (s3.match(/^0+$/) && (r3 || i3))
      return u3;
    let l3 = s3.match(/0+$/);
    return i3 && l3 ? `${u3}.${s3.toString().slice(0, l3.index)}` : o3.toString();
  }(a2.toString(), a2, h2, g2, d2, x2);
  return B2 = function(e3, t3, r3, n3) {
    let i3 = e3, [a3, o3] = i3.toString().split(".");
    if (a3.match(/^-?0$/) && r3)
      return o3 ? `${a3.replace("0", "")}.${o3}` : a3.replace("0", "");
    const u3 = t3 < 0 && 0 === a3.indexOf("-");
    if (u3 && (a3 = a3.slice(1), i3 = i3.slice(1)), a3.length < n3) {
      let e4 = n3 - a3.length;
      for (let t4 = 0; t4 < e4; t4++)
        i3 = `0${i3}`;
    }
    return u3 && (i3 = `-${i3}`), i3.toString();
  }(B2, a2, l2, s2), B2 = function(e3, t3, r3, n3, i3) {
    let a3 = n3.currentDelimiters(), o3 = a3.thousands;
    i3 = i3 || a3.decimal;
    let u3 = a3.thousandsSize || 3, s3 = e3.toString(), l3 = s3.split(".")[0], c3 = s3.split(".")[1];
    const f3 = t3 < 0 && 0 === l3.indexOf("-");
    if (r3) {
      f3 && (l3 = l3.slice(1));
      let e4 = function(e5, t4) {
        let r4 = [], n4 = 0;
        for (let i4 = e5; i4 > 0; i4--)
          n4 === t4 && (r4.unshift(i4), n4 = 0), n4++;
        return r4;
      }(l3.length, u3);
      e4.forEach((e5, t4) => {
        l3 = l3.slice(0, e5 + t4) + o3 + l3.slice(e5 + t4);
      }), f3 && (l3 = `-${l3}`);
    }
    return s3 = c3 ? l3 + i3 + c3 : l3, s3;
  }(B2, a2, m2, r2, n2), (p2 || O2) && (B2 = function(e3, t3) {
    return e3 + t3;
  }(B2, $2)), (w2 || a2 < 0) && (B2 = function(e3, t3, r3) {
    return 0 === t3 ? e3 : 0 == +e3 ? e3.replace("-", "") : t3 > 0 ? `+${e3}` : "sign" === r3 ? e3 : `(${e3.replace("-", "")})`;
  }(B2, a2, b2)), B2;
}
function k(e2, t2) {
  if (!e2)
    return t2;
  let r2 = Object.keys(e2);
  return 1 === r2.length && "output" === r2[0] ? t2 : e2;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
const L = b;
function P(e2, t2, r2) {
  let n2 = new L(e2._value), i2 = t2;
  return r2.isNumbro(t2) && (i2 = t2._value), i2 = new L(i2), e2._value = n2.minus(i2).toNumber(), e2;
}
/*!
 * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
const C = h(), T = c(), j = ((e2) => ({ loadLanguagesInNode: (t2) => d(t2, e2) }))(Z), U = l();
let R = ((e2) => ({ format: (...t2) => D(...t2, e2), getByteUnit: (...t2) => function(e3) {
  let t3 = M.general;
  return F(e3._value, t3.suffixes, t3.scale).suffix;
}(...t2, e2), getBinaryByteUnit: (...t2) => function(e3) {
  let t3 = M.binary;
  return F(e3._value, t3.suffixes, t3.scale).suffix;
}(...t2, e2), getDecimalByteUnit: (...t2) => function(e3) {
  let t3 = M.decimal;
  return F(e3._value, t3.suffixes, t3.scale).suffix;
}(...t2, e2), formatOrDefault: k }))(Z), I = ((e2) => ({ add: (t2, r2) => function(e3, t3, r3) {
  let n2 = new L(e3._value), i2 = t3;
  return r3.isNumbro(t3) && (i2 = t3._value), i2 = new L(i2), e3._value = n2.plus(i2).toNumber(), e3;
}(t2, r2, e2), subtract: (t2, r2) => P(t2, r2, e2), multiply: (t2, r2) => function(e3, t3, r3) {
  let n2 = new L(e3._value), i2 = t3;
  return r3.isNumbro(t3) && (i2 = t3._value), i2 = new L(i2), e3._value = n2.times(i2).toNumber(), e3;
}(t2, r2, e2), divide: (t2, r2) => function(e3, t3, r3) {
  let n2 = new L(e3._value), i2 = t3;
  return r3.isNumbro(t3) && (i2 = t3._value), i2 = new L(i2), e3._value = n2.dividedBy(i2).toNumber(), e3;
}(t2, r2, e2), set: (t2, r2) => function(e3, t3, r3) {
  let n2 = t3;
  return r3.isNumbro(t3) && (n2 = t3._value), e3._value = n2, e3;
}(t2, r2, e2), difference: (t2, r2) => function(e3, t3, r3) {
  let n2 = r3(e3._value);
  return P(n2, t3, r3), Math.abs(n2._value);
}(t2, r2, e2), BigNumber: L }))(Z);
const G = g;
class V {
  constructor(e2) {
    this._value = e2;
  }
  clone() {
    return Z(this._value);
  }
  format(e2 = {}) {
    return R.format(this, e2);
  }
  formatCurrency(e2) {
    return "string" == typeof e2 && (e2 = G.parseFormat(e2)), (e2 = R.formatOrDefault(e2, C.currentCurrencyDefaultFormat())).output = "currency", R.format(this, e2);
  }
  formatTime(e2 = {}) {
    return e2.output = "time", R.format(this, e2);
  }
  binaryByteUnits() {
    return R.getBinaryByteUnit(this);
  }
  decimalByteUnits() {
    return R.getDecimalByteUnit(this);
  }
  byteUnits() {
    return R.getByteUnit(this);
  }
  difference(e2) {
    return I.difference(this, e2);
  }
  add(e2) {
    return I.add(this, e2);
  }
  subtract(e2) {
    return I.subtract(this, e2);
  }
  multiply(e2) {
    return I.multiply(this, e2);
  }
  divide(e2) {
    return I.divide(this, e2);
  }
  set(e2) {
    return I.set(this, q(e2));
  }
  value() {
    return this._value;
  }
  valueOf() {
    return this._value;
  }
}
function q(e2) {
  let t2 = e2;
  return Z.isNumbro(e2) ? t2 = e2._value : "string" == typeof e2 ? t2 = Z.unformat(e2) : isNaN(e2) && (t2 = NaN), t2;
}
function Z(e2) {
  return new V(q(e2));
}
Z.version = "2.5.0", Z.isNumbro = function(e2) {
  return e2 instanceof V;
}, Z.language = C.currentLanguage, Z.registerLanguage = C.registerLanguage, Z.setLanguage = C.setLanguage, Z.languages = C.languages, Z.languageData = C.languageData, Z.zeroFormat = C.setZeroFormat, Z.defaultFormat = C.currentDefaults, Z.setDefaults = C.setDefaults, Z.defaultCurrencyFormat = C.currentCurrencyDefaultFormat, Z.validate = T.validate, Z.loadLanguagesInNode = j.loadLanguagesInNode, Z.unformat = U.unformat, Z.BigNumber = I.BigNumber;
var z = u(Z);
export {
  z as n
};
