function T(n, e) {
  return n == null || e == null ? NaN : n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
}
function Jn(n, e) {
  return n == null || e == null ? NaN : e < n ? -1 : e > n ? 1 : e >= n ? 0 : NaN;
}
function Sn(n) {
  let e, r, t;
  n.length !== 2 ? (e = T, r = (f, s) => T(n(f), s), t = (f, s) => n(f) - s) : (e = n === T || n === Jn ? n : Kn, r = n, t = n);
  function i(f, s, u = 0, l = f.length) {
    if (u < l) {
      if (e(s, s) !== 0) return l;
      do {
        const c = u + l >>> 1;
        r(f[c], s) < 0 ? u = c + 1 : l = c;
      } while (u < l);
    }
    return u;
  }
  function o(f, s, u = 0, l = f.length) {
    if (u < l) {
      if (e(s, s) !== 0) return l;
      do {
        const c = u + l >>> 1;
        r(f[c], s) <= 0 ? u = c + 1 : l = c;
      } while (u < l);
    }
    return u;
  }
  function a(f, s, u = 0, l = f.length) {
    const c = i(f, s, u, l - 1);
    return c > u && t(f[c - 1], s) > -t(f[c], s) ? c - 1 : c;
  }
  return { left: i, center: a, right: o };
}
function Kn() {
  return 0;
}
function Qn(n) {
  return n === null ? NaN : +n;
}
function* Ze(n, e) {
  if (e === void 0)
    for (let r of n)
      r != null && (r = +r) >= r && (yield r);
  else {
    let r = -1;
    for (let t of n)
      (t = e(t, ++r, n)) != null && (t = +t) >= t && (yield t);
  }
}
const qn = Sn(T), Wn = qn.right, Je = qn.left;
Sn(Qn).center;
const ne = Math.sqrt(50), ee = Math.sqrt(10), re = Math.sqrt(2);
function G(n, e, r) {
  const t = (e - n) / Math.max(0, r), i = Math.floor(Math.log10(t)), o = t / Math.pow(10, i), a = o >= ne ? 10 : o >= ee ? 5 : o >= re ? 2 : 1;
  let f, s, u;
  return i < 0 ? (u = Math.pow(10, -i) / a, f = Math.round(n * u), s = Math.round(e * u), f / u < n && ++f, s / u > e && --s, u = -u) : (u = Math.pow(10, i) * a, f = Math.round(n / u), s = Math.round(e / u), f * u < n && ++f, s * u > e && --s), s < f && 0.5 <= r && r < 2 ? G(n, e, r * 2) : [f, s, u];
}
function te(n, e, r) {
  if (e = +e, n = +n, r = +r, !(r > 0)) return [];
  if (n === e) return [n];
  const t = e < n, [i, o, a] = t ? G(e, n, r) : G(n, e, r);
  if (!(o >= i)) return [];
  const f = o - i + 1, s = new Array(f);
  if (t)
    if (a < 0) for (let u = 0; u < f; ++u) s[u] = (o - u) / -a;
    else for (let u = 0; u < f; ++u) s[u] = (o - u) * a;
  else if (a < 0) for (let u = 0; u < f; ++u) s[u] = (i + u) / -a;
  else for (let u = 0; u < f; ++u) s[u] = (i + u) * a;
  return s;
}
function en(n, e, r) {
  return e = +e, n = +n, r = +r, G(n, e, r)[2];
}
function ie(n, e, r) {
  e = +e, n = +n, r = +r;
  const t = e < n, i = t ? en(e, n, r) : en(n, e, r);
  return (t ? -1 : 1) * (i < 0 ? 1 / -i : i);
}
function ae(n) {
  return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
}
function V(n, e) {
  if ((r = (n = e ? n.toExponential(e - 1) : n.toExponential()).indexOf("e")) < 0) return null;
  var r, t = n.slice(0, r);
  return [
    t.length > 1 ? t[0] + t.slice(2) : t,
    +n.slice(r + 1)
  ];
}
function H(n) {
  return n = V(Math.abs(n)), n ? n[1] : NaN;
}
function fe(n, e) {
  return function(r, t) {
    for (var i = r.length, o = [], a = 0, f = n[0], s = 0; i > 0 && f > 0 && (s + f + 1 > t && (f = Math.max(1, t - s)), o.push(r.substring(i -= f, i + f)), !((s += f + 1) > t)); )
      f = n[a = (a + 1) % n.length];
    return o.reverse().join(e);
  };
}
function oe(n) {
  return function(e) {
    return e.replace(/[0-9]/g, function(r) {
      return n[+r];
    });
  };
}
var ue = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function X(n) {
  if (!(e = ue.exec(n))) throw new Error("invalid format: " + n);
  var e;
  return new an({
    fill: e[1],
    align: e[2],
    sign: e[3],
    symbol: e[4],
    zero: e[5],
    width: e[6],
    comma: e[7],
    precision: e[8] && e[8].slice(1),
    trim: e[9],
    type: e[10]
  });
}
X.prototype = an.prototype;
function an(n) {
  this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
}
an.prototype.toString = function() {
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};
function se(n) {
  n: for (var e = n.length, r = 1, t = -1, i; r < e; ++r)
    switch (n[r]) {
      case ".":
        t = i = r;
        break;
      case "0":
        t === 0 && (t = r), i = r;
        break;
      default:
        if (!+n[r]) break n;
        t > 0 && (t = 0);
        break;
    }
  return t > 0 ? n.slice(0, t) + n.slice(i + 1) : n;
}
var Hn;
function ce(n, e) {
  var r = V(n, e);
  if (!r) return n + "";
  var t = r[0], i = r[1], o = i - (Hn = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, a = t.length;
  return o === a ? t : o > a ? t + new Array(o - a + 1).join("0") : o > 0 ? t.slice(0, o) + "." + t.slice(o) : "0." + new Array(1 - o).join("0") + V(n, Math.max(0, e + o - 1))[0];
}
function hn(n, e) {
  var r = V(n, e);
  if (!r) return n + "";
  var t = r[0], i = r[1];
  return i < 0 ? "0." + new Array(-i).join("0") + t : t.length > i + 1 ? t.slice(0, i + 1) + "." + t.slice(i + 1) : t + new Array(i - t.length + 2).join("0");
}
const dn = {
  "%": (n, e) => (n * 100).toFixed(e),
  b: (n) => Math.round(n).toString(2),
  c: (n) => n + "",
  d: ae,
  e: (n, e) => n.toExponential(e),
  f: (n, e) => n.toFixed(e),
  g: (n, e) => n.toPrecision(e),
  o: (n) => Math.round(n).toString(8),
  p: (n, e) => hn(n * 100, e),
  r: hn,
  s: ce,
  X: (n) => Math.round(n).toString(16).toUpperCase(),
  x: (n) => Math.round(n).toString(16)
};
function gn(n) {
  return n;
}
var xn = Array.prototype.map, mn = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function le(n) {
  var e = n.grouping === void 0 || n.thousands === void 0 ? gn : fe(xn.call(n.grouping, Number), n.thousands + ""), r = n.currency === void 0 ? "" : n.currency[0] + "", t = n.currency === void 0 ? "" : n.currency[1] + "", i = n.decimal === void 0 ? "." : n.decimal + "", o = n.numerals === void 0 ? gn : oe(xn.call(n.numerals, String)), a = n.percent === void 0 ? "%" : n.percent + "", f = n.minus === void 0 ? "−" : n.minus + "", s = n.nan === void 0 ? "NaN" : n.nan + "";
  function u(c) {
    c = X(c);
    var d = c.fill, N = c.align, p = c.sign, P = c.symbol, R = c.zero, E = c.width, Q = c.comma, $ = c.precision, un = c.trim, x = c.type;
    x === "n" ? (Q = !0, x = "g") : dn[x] || ($ === void 0 && ($ = 12), un = !0, x = "g"), (R || d === "0" && N === "=") && (R = !0, d = "0", N = "=");
    var Un = P === "$" ? r : P === "#" && /[boxX]/.test(x) ? "0" + x.toLowerCase() : "", Yn = P === "$" ? t : /[%p]/.test(x) ? a : "", sn = dn[x], Zn = /[defgprs%]/.test(x);
    $ = $ === void 0 ? 6 : /[gprs]/.test(x) ? Math.max(1, Math.min(21, $)) : Math.max(0, Math.min(20, $));
    function cn(h) {
      var k = Un, m = Yn, S, ln, F;
      if (x === "c")
        m = sn(h) + m, h = "";
      else {
        h = +h;
        var L = h < 0 || 1 / h < 0;
        if (h = isNaN(h) ? s : sn(Math.abs(h), $), un && (h = se(h)), L && +h == 0 && p !== "+" && (L = !1), k = (L ? p === "(" ? p : f : p === "-" || p === "(" ? "" : p) + k, m = (x === "s" ? mn[8 + Hn / 3] : "") + m + (L && p === "(" ? ")" : ""), Zn) {
          for (S = -1, ln = h.length; ++S < ln; )
            if (F = h.charCodeAt(S), 48 > F || F > 57) {
              m = (F === 46 ? i + h.slice(S + 1) : h.slice(S)) + m, h = h.slice(0, S);
              break;
            }
        }
      }
      Q && !R && (h = e(h, 1 / 0));
      var _ = k.length + h.length + m.length, M = _ < E ? new Array(E - _ + 1).join(d) : "";
      switch (Q && R && (h = e(M + h, M.length ? E - m.length : 1 / 0), M = ""), N) {
        case "<":
          h = k + h + m + M;
          break;
        case "=":
          h = k + M + h + m;
          break;
        case "^":
          h = M.slice(0, _ = M.length >> 1) + k + h + m + M.slice(_);
          break;
        default:
          h = M + k + h + m;
          break;
      }
      return o(h);
    }
    return cn.toString = function() {
      return c + "";
    }, cn;
  }
  function l(c, d) {
    var N = u((c = X(c), c.type = "f", c)), p = Math.max(-8, Math.min(8, Math.floor(H(d) / 3))) * 3, P = Math.pow(10, -p), R = mn[8 + p / 3];
    return function(E) {
      return N(P * E) + R;
    };
  }
  return {
    format: u,
    formatPrefix: l
  };
}
var B, Pn, En;
he({
  thousands: ",",
  grouping: [3],
  currency: ["$", ""]
});
function he(n) {
  return B = le(n), Pn = B.format, En = B.formatPrefix, B;
}
function de(n) {
  return Math.max(0, -H(Math.abs(n)));
}
function ge(n, e) {
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(H(e) / 3))) * 3 - H(Math.abs(n)));
}
function xe(n, e) {
  return n = Math.abs(n), e = Math.abs(e) - n, Math.max(0, H(e) - H(n)) + 1;
}
function jn(n, e) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      this.range(n);
      break;
    default:
      this.range(e).domain(n);
      break;
  }
  return this;
}
function Ke(n, e) {
  switch (arguments.length) {
    case 0:
      break;
    case 1: {
      typeof n == "function" ? this.interpolator(n) : this.range(n);
      break;
    }
    default: {
      this.domain(n), typeof e == "function" ? this.interpolator(e) : this.range(e);
      break;
    }
  }
  return this;
}
function fn(n, e, r) {
  n.prototype = e.prototype = r, r.constructor = n;
}
function zn(n, e) {
  var r = Object.create(n.prototype);
  for (var t in e) r[t] = e[t];
  return r;
}
function C() {
}
var j = 0.7, U = 1 / j, q = "\\s*([+-]?\\d+)\\s*", z = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", w = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", me = /^#([0-9a-f]{3,8})$/, be = new RegExp(`^rgb\\(${q},${q},${q}\\)$`), pe = new RegExp(`^rgb\\(${w},${w},${w}\\)$`), ye = new RegExp(`^rgba\\(${q},${q},${q},${z}\\)$`), we = new RegExp(`^rgba\\(${w},${w},${w},${z}\\)$`), Me = new RegExp(`^hsl\\(${z},${w},${w}\\)$`), Ne = new RegExp(`^hsla\\(${z},${w},${w},${z}\\)$`), bn = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
fn(C, I, {
  copy(n) {
    return Object.assign(new this.constructor(), this, n);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: pn,
  // Deprecated! Use color.formatHex.
  formatHex: pn,
  formatHex8: $e,
  formatHsl: ke,
  formatRgb: yn,
  toString: yn
});
function pn() {
  return this.rgb().formatHex();
}
function $e() {
  return this.rgb().formatHex8();
}
function ke() {
  return In(this).formatHsl();
}
function yn() {
  return this.rgb().formatRgb();
}
function I(n) {
  var e, r;
  return n = (n + "").trim().toLowerCase(), (e = me.exec(n)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? wn(e) : r === 3 ? new g(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : r === 8 ? D(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : r === 4 ? D(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = be.exec(n)) ? new g(e[1], e[2], e[3], 1) : (e = pe.exec(n)) ? new g(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ye.exec(n)) ? D(e[1], e[2], e[3], e[4]) : (e = we.exec(n)) ? D(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Me.exec(n)) ? $n(e[1], e[2] / 100, e[3] / 100, 1) : (e = Ne.exec(n)) ? $n(e[1], e[2] / 100, e[3] / 100, e[4]) : bn.hasOwnProperty(n) ? wn(bn[n]) : n === "transparent" ? new g(NaN, NaN, NaN, 0) : null;
}
function wn(n) {
  return new g(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
}
function D(n, e, r, t) {
  return t <= 0 && (n = e = r = NaN), new g(n, e, r, t);
}
function ve(n) {
  return n instanceof C || (n = I(n)), n ? (n = n.rgb(), new g(n.r, n.g, n.b, n.opacity)) : new g();
}
function Y(n, e, r, t) {
  return arguments.length === 1 ? ve(n) : new g(n, e, r, t ?? 1);
}
function g(n, e, r, t) {
  this.r = +n, this.g = +e, this.b = +r, this.opacity = +t;
}
fn(g, Y, zn(C, {
  brighter(n) {
    return n = n == null ? U : Math.pow(U, n), new g(this.r * n, this.g * n, this.b * n, this.opacity);
  },
  darker(n) {
    return n = n == null ? j : Math.pow(j, n), new g(this.r * n, this.g * n, this.b * n, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new g(A(this.r), A(this.g), A(this.b), Z(this.opacity));
  },
  displayable() {
    return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  },
  hex: Mn,
  // Deprecated! Use color.formatHex.
  formatHex: Mn,
  formatHex8: Ae,
  formatRgb: Nn,
  toString: Nn
}));
function Mn() {
  return `#${v(this.r)}${v(this.g)}${v(this.b)}`;
}
function Ae() {
  return `#${v(this.r)}${v(this.g)}${v(this.b)}${v((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function Nn() {
  const n = Z(this.opacity);
  return `${n === 1 ? "rgb(" : "rgba("}${A(this.r)}, ${A(this.g)}, ${A(this.b)}${n === 1 ? ")" : `, ${n})`}`;
}
function Z(n) {
  return isNaN(n) ? 1 : Math.max(0, Math.min(1, n));
}
function A(n) {
  return Math.max(0, Math.min(255, Math.round(n) || 0));
}
function v(n) {
  return n = A(n), (n < 16 ? "0" : "") + n.toString(16);
}
function $n(n, e, r, t) {
  return t <= 0 ? n = e = r = NaN : r <= 0 || r >= 1 ? n = e = NaN : e <= 0 && (n = NaN), new b(n, e, r, t);
}
function In(n) {
  if (n instanceof b) return new b(n.h, n.s, n.l, n.opacity);
  if (n instanceof C || (n = I(n)), !n) return new b();
  if (n instanceof b) return n;
  n = n.rgb();
  var e = n.r / 255, r = n.g / 255, t = n.b / 255, i = Math.min(e, r, t), o = Math.max(e, r, t), a = NaN, f = o - i, s = (o + i) / 2;
  return f ? (e === o ? a = (r - t) / f + (r < t) * 6 : r === o ? a = (t - e) / f + 2 : a = (e - r) / f + 4, f /= s < 0.5 ? o + i : 2 - o - i, a *= 60) : f = s > 0 && s < 1 ? 0 : a, new b(a, f, s, n.opacity);
}
function Re(n, e, r, t) {
  return arguments.length === 1 ? In(n) : new b(n, e, r, t ?? 1);
}
function b(n, e, r, t) {
  this.h = +n, this.s = +e, this.l = +r, this.opacity = +t;
}
fn(b, Re, zn(C, {
  brighter(n) {
    return n = n == null ? U : Math.pow(U, n), new b(this.h, this.s, this.l * n, this.opacity);
  },
  darker(n) {
    return n = n == null ? j : Math.pow(j, n), new b(this.h, this.s, this.l * n, this.opacity);
  },
  rgb() {
    var n = this.h % 360 + (this.h < 0) * 360, e = isNaN(n) || isNaN(this.s) ? 0 : this.s, r = this.l, t = r + (r < 0.5 ? r : 1 - r) * e, i = 2 * r - t;
    return new g(
      W(n >= 240 ? n - 240 : n + 120, i, t),
      W(n, i, t),
      W(n < 120 ? n + 240 : n - 120, i, t),
      this.opacity
    );
  },
  clamp() {
    return new b(kn(this.h), O(this.s), O(this.l), Z(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  },
  formatHsl() {
    const n = Z(this.opacity);
    return `${n === 1 ? "hsl(" : "hsla("}${kn(this.h)}, ${O(this.s) * 100}%, ${O(this.l) * 100}%${n === 1 ? ")" : `, ${n})`}`;
  }
}));
function kn(n) {
  return n = (n || 0) % 360, n < 0 ? n + 360 : n;
}
function O(n) {
  return Math.max(0, Math.min(1, n || 0));
}
function W(n, e, r) {
  return (n < 60 ? e + (r - e) * n / 60 : n < 180 ? r : n < 240 ? e + (r - e) * (240 - n) / 60 : e) * 255;
}
function Cn(n, e, r, t, i) {
  var o = n * n, a = o * n;
  return ((1 - 3 * n + 3 * o - a) * e + (4 - 6 * o + 3 * a) * r + (1 + 3 * n + 3 * o - 3 * a) * t + a * i) / 6;
}
function Se(n) {
  var e = n.length - 1;
  return function(r) {
    var t = r <= 0 ? r = 0 : r >= 1 ? (r = 1, e - 1) : Math.floor(r * e), i = n[t], o = n[t + 1], a = t > 0 ? n[t - 1] : 2 * i - o, f = t < e - 1 ? n[t + 2] : 2 * o - i;
    return Cn((r - t / e) * e, a, i, o, f);
  };
}
function qe(n) {
  var e = n.length;
  return function(r) {
    var t = Math.floor(((r %= 1) < 0 ? ++r : r) * e), i = n[(t + e - 1) % e], o = n[t % e], a = n[(t + 1) % e], f = n[(t + 2) % e];
    return Cn((r - t / e) * e, i, o, a, f);
  };
}
const K = (n) => () => n;
function Fn(n, e) {
  return function(r) {
    return n + r * e;
  };
}
function He(n, e, r) {
  return n = Math.pow(n, r), e = Math.pow(e, r) - n, r = 1 / r, function(t) {
    return Math.pow(n + t * e, r);
  };
}
function Qe(n, e) {
  var r = e - n;
  return r ? Fn(n, r > 180 || r < -180 ? r - 360 * Math.round(r / 360) : r) : K(isNaN(n) ? e : n);
}
function Pe(n) {
  return (n = +n) == 1 ? Ln : function(e, r) {
    return r - e ? He(e, r, n) : K(isNaN(e) ? r : e);
  };
}
function Ln(n, e) {
  var r = e - n;
  return r ? Fn(n, r) : K(isNaN(n) ? e : n);
}
const vn = (function n(e) {
  var r = Pe(e);
  function t(i, o) {
    var a = r((i = Y(i)).r, (o = Y(o)).r), f = r(i.g, o.g), s = r(i.b, o.b), u = Ln(i.opacity, o.opacity);
    return function(l) {
      return i.r = a(l), i.g = f(l), i.b = s(l), i.opacity = u(l), i + "";
    };
  }
  return t.gamma = n, t;
})(1);
function _n(n) {
  return function(e) {
    var r = e.length, t = new Array(r), i = new Array(r), o = new Array(r), a, f;
    for (a = 0; a < r; ++a)
      f = Y(e[a]), t[a] = f.r || 0, i[a] = f.g || 0, o[a] = f.b || 0;
    return t = n(t), i = n(i), o = n(o), f.opacity = 1, function(s) {
      return f.r = t(s), f.g = i(s), f.b = o(s), f + "";
    };
  };
}
var We = _n(Se), nr = _n(qe);
function Bn(n, e) {
  e || (e = []);
  var r = n ? Math.min(e.length, n.length) : 0, t = e.slice(), i;
  return function(o) {
    for (i = 0; i < r; ++i) t[i] = n[i] * (1 - o) + e[i] * o;
    return t;
  };
}
function Dn(n) {
  return ArrayBuffer.isView(n) && !(n instanceof DataView);
}
function er(n, e) {
  return (Dn(e) ? Bn : On)(n, e);
}
function On(n, e) {
  var r = e ? e.length : 0, t = n ? Math.min(r, n.length) : 0, i = new Array(t), o = new Array(r), a;
  for (a = 0; a < t; ++a) i[a] = on(n[a], e[a]);
  for (; a < r; ++a) o[a] = e[a];
  return function(f) {
    for (a = 0; a < t; ++a) o[a] = i[a](f);
    return o;
  };
}
function Ee(n, e) {
  var r = /* @__PURE__ */ new Date();
  return n = +n, e = +e, function(t) {
    return r.setTime(n * (1 - t) + e * t), r;
  };
}
function J(n, e) {
  return n = +n, e = +e, function(r) {
    return n * (1 - r) + e * r;
  };
}
function je(n, e) {
  var r = {}, t = {}, i;
  (n === null || typeof n != "object") && (n = {}), (e === null || typeof e != "object") && (e = {});
  for (i in e)
    i in n ? r[i] = on(n[i], e[i]) : t[i] = e[i];
  return function(o) {
    for (i in r) t[i] = r[i](o);
    return t;
  };
}
var rn = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, nn = new RegExp(rn.source, "g");
function ze(n) {
  return function() {
    return n;
  };
}
function Ie(n) {
  return function(e) {
    return n(e) + "";
  };
}
function Ce(n, e) {
  var r = rn.lastIndex = nn.lastIndex = 0, t, i, o, a = -1, f = [], s = [];
  for (n = n + "", e = e + ""; (t = rn.exec(n)) && (i = nn.exec(e)); )
    (o = i.index) > r && (o = e.slice(r, o), f[a] ? f[a] += o : f[++a] = o), (t = t[0]) === (i = i[0]) ? f[a] ? f[a] += i : f[++a] = i : (f[++a] = null, s.push({ i: a, x: J(t, i) })), r = nn.lastIndex;
  return r < e.length && (o = e.slice(r), f[a] ? f[a] += o : f[++a] = o), f.length < 2 ? s[0] ? Ie(s[0].x) : ze(e) : (e = s.length, function(u) {
    for (var l = 0, c; l < e; ++l) f[(c = s[l]).i] = c.x(u);
    return f.join("");
  });
}
function on(n, e) {
  var r = typeof e, t;
  return e == null || r === "boolean" ? K(e) : (r === "number" ? J : r === "string" ? (t = I(e)) ? (e = t, vn) : Ce : e instanceof I ? vn : e instanceof Date ? Ee : Dn(e) ? Bn : Array.isArray(e) ? On : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? je : J)(n, e);
}
function Fe(n, e) {
  return n = +n, e = +e, function(r) {
    return Math.round(n * (1 - r) + e * r);
  };
}
function Le(n) {
  return function() {
    return n;
  };
}
function _e(n) {
  return +n;
}
var An = [0, 1];
function y(n) {
  return n;
}
function tn(n, e) {
  return (e -= n = +n) ? function(r) {
    return (r - n) / e;
  } : Le(isNaN(e) ? NaN : 0.5);
}
function Be(n, e) {
  var r;
  return n > e && (r = n, n = e, e = r), function(t) {
    return Math.max(n, Math.min(e, t));
  };
}
function De(n, e, r) {
  var t = n[0], i = n[1], o = e[0], a = e[1];
  return i < t ? (t = tn(i, t), o = r(a, o)) : (t = tn(t, i), o = r(o, a)), function(f) {
    return o(t(f));
  };
}
function Oe(n, e, r) {
  var t = Math.min(n.length, e.length) - 1, i = new Array(t), o = new Array(t), a = -1;
  for (n[t] < n[0] && (n = n.slice().reverse(), e = e.slice().reverse()); ++a < t; )
    i[a] = tn(n[a], n[a + 1]), o[a] = r(e[a], e[a + 1]);
  return function(f) {
    var s = Wn(n, f, 1, t) - 1;
    return o[s](i[s](f));
  };
}
function Tn(n, e) {
  return e.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());
}
function Gn() {
  var n = An, e = An, r = on, t, i, o, a = y, f, s, u;
  function l() {
    var d = Math.min(n.length, e.length);
    return a !== y && (a = Be(n[0], n[d - 1])), f = d > 2 ? Oe : De, s = u = null, c;
  }
  function c(d) {
    return d == null || isNaN(d = +d) ? o : (s || (s = f(n.map(t), e, r)))(t(a(d)));
  }
  return c.invert = function(d) {
    return a(i((u || (u = f(e, n.map(t), J)))(d)));
  }, c.domain = function(d) {
    return arguments.length ? (n = Array.from(d, _e), l()) : n.slice();
  }, c.range = function(d) {
    return arguments.length ? (e = Array.from(d), l()) : e.slice();
  }, c.rangeRound = function(d) {
    return e = Array.from(d), r = Fe, l();
  }, c.clamp = function(d) {
    return arguments.length ? (a = d ? !0 : y, l()) : a !== y;
  }, c.interpolate = function(d) {
    return arguments.length ? (r = d, l()) : r;
  }, c.unknown = function(d) {
    return arguments.length ? (o = d, c) : o;
  }, function(d, N) {
    return t = d, i = N, l();
  };
}
function Te() {
  return Gn()(y, y);
}
function Ge(n, e, r, t) {
  var i = ie(n, e, r), o;
  switch (t = X(t ?? ",f"), t.type) {
    case "s": {
      var a = Math.max(Math.abs(n), Math.abs(e));
      return t.precision == null && !isNaN(o = ge(i, a)) && (t.precision = o), En(t, a);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      t.precision == null && !isNaN(o = xe(i, Math.max(Math.abs(n), Math.abs(e)))) && (t.precision = o - (t.type === "e"));
      break;
    }
    case "f":
    case "%": {
      t.precision == null && !isNaN(o = de(i)) && (t.precision = o - (t.type === "%") * 2);
      break;
    }
  }
  return Pn(t);
}
function Vn(n) {
  var e = n.domain;
  return n.ticks = function(r) {
    var t = e();
    return te(t[0], t[t.length - 1], r ?? 10);
  }, n.tickFormat = function(r, t) {
    var i = e();
    return Ge(i[0], i[i.length - 1], r ?? 10, t);
  }, n.nice = function(r) {
    r == null && (r = 10);
    var t = e(), i = 0, o = t.length - 1, a = t[i], f = t[o], s, u, l = 10;
    for (f < a && (u = a, a = f, f = u, u = i, i = o, o = u); l-- > 0; ) {
      if (u = en(a, f, r), u === s)
        return t[i] = a, t[o] = f, e(t);
      if (u > 0)
        a = Math.floor(a / u) * u, f = Math.ceil(f / u) * u;
      else if (u < 0)
        a = Math.ceil(a * u) / u, f = Math.floor(f * u) / u;
      else
        break;
      s = u;
    }
    return n;
  }, n;
}
function Ve() {
  var n = Te();
  return n.copy = function() {
    return Tn(n, Ve());
  }, jn.apply(n, arguments), Vn(n);
}
function Rn(n) {
  return function(e) {
    return e < 0 ? -Math.pow(-e, n) : Math.pow(e, n);
  };
}
function Xe(n) {
  return n < 0 ? -Math.sqrt(-n) : Math.sqrt(n);
}
function Ue(n) {
  return n < 0 ? -n * n : n * n;
}
function Ye(n) {
  var e = n(y, y), r = 1;
  function t() {
    return r === 1 ? n(y, y) : r === 0.5 ? n(Xe, Ue) : n(Rn(r), Rn(1 / r));
  }
  return e.exponent = function(i) {
    return arguments.length ? (r = +i, t()) : r;
  }, Vn(e);
}
function Xn() {
  var n = Ye(Gn());
  return n.copy = function() {
    return Tn(n, Xn()).exponent(n.exponent());
  }, jn.apply(n, arguments), n;
}
function rr() {
  return Xn.apply(null, arguments).exponent(0.5);
}
export {
  qe as A,
  Ee as B,
  C,
  Bn as D,
  je as E,
  vn as F,
  We as G,
  nr as H,
  Fe as I,
  Ce as J,
  _e as K,
  Vn as L,
  Gn as M,
  Tn as N,
  te as O,
  Wn as P,
  Te as Q,
  g as R,
  y as S,
  Ke as T,
  Ye as U,
  Ve as V,
  Xn as W,
  Ge as X,
  Y,
  Je as Z,
  T as a,
  Qn as b,
  Sn as c,
  X as d,
  xe as e,
  le as f,
  ge as g,
  Pn as h,
  En as i,
  jn as j,
  fn as k,
  zn as l,
  j as m,
  Ze as n,
  U as o,
  de as p,
  Qe as q,
  ve as r,
  rr as s,
  ie as t,
  J as u,
  Re as v,
  Ln as w,
  on as x,
  er as y,
  Se as z
};
//# sourceMappingURL=pow-BtYymBCr.mjs.map
