UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

1,955 lines 57.5 kB
import { unref as tt, isRef as nt, toRaw as ft } from "vue";
const ht = "#COMP# dataset prop is either missing, undefined or empty.", Ft = "#COMP# dataset is missing the '#ATTR#' attribute.", dt = "#COMP# dataset '#ATTR#' attribute cannot be empty.", gt = "#COMP# dataset #KEY# item at index #INDX# is missing the '#ATTR#' attribute.", pt = "#COMP# : Chart could not be built. Dataset is not formatted correctly", Et = "#COMP# : A wrong value was provided to the #ATTR# attribute (#KEY# is not a valid value).", At = {
  dataset: ht,
  datasetAttribute: Ft,
  datasetAttributeEmpty: dt,
  datasetSerieAttribute: gt,
  notBuildable: pt,
  attributeWrongValue: Et
};
function Yt(t, n, e, o, r, s = 1.99999, c = 2, i = 1.45, l = 360, u = 105.25, a = 0) {
  const { series: f } = t;
  if (!f || f.length === 0)
    return [];
  const h = f.reduce((p, y) => p + y.value, 0), F = [];
  let d = 0;
  for (let p = 0; p < f.length; p++) {
    const y = f[p].value, x = f.length === 1, E = x ? 1 : h > 0 ? y / h : 0, C = E * (Math.PI * s), O = (x ? 0.5 : h > 0 ? y / 2 / h : 0.5) * (Math.PI * c), { startX: L, startY: m, endX: $, endY: M, path: D } = Z(
      [n, e],
      [o, r],
      [d, C],
      u,
      l,
      c
    ), g = Z(
      [n, e],
      [o - a, r - a],
      [d, C],
      u,
      l,
      c,
      !0
    ), I = Z(
      [n, e],
      [o * i, r * i],
      [d, O],
      u,
      l,
      c
    );
    F.push({
      arcSlice: `${D} L ${g.startX} ${g.startY} ${g.path} L ${L} ${m}`,
      cx: A(n),
      cy: A(e),
      ...f[p],
      proportion: A(E),
      ratio: A(C),
      path: D.replaceAll("NaN", "0"),
      startX: A(L),
      startY: A(m),
      endX: A($),
      endY: A(M),
      separator: {
        x: g.startX,
        y: g.startY
      },
      firstSeparator: {
        x: Number(g.path.split(" ").at(-2)),
        y: Number(g.path.split(" ").at(-1))
      },
      center: I
    }), d += C;
  }
  return F;
}
function et([t, n], [e, o]) {
  return [t + e, n + o];
}
function rt([[t, n], [e, o]], [r, s]) {
  return [t * r + n * s, e * r + o * s];
}
function yt(t) {
  return [
    [Math.cos(t), -Math.sin(t)],
    [Math.sin(t), Math.cos(t)]
  ];
}
function Z([t, n], [e, o], [r, s], c, i = 360, l = 2, u = !1) {
  s = s % (l * Math.PI);
  const a = yt(c), [f, h] = et(
    rt(a, [
      e * Math.cos(r),
      o * Math.sin(r)
    ]),
    [t, n]
  ), [F, d] = et(
    rt(a, [
      e * Math.cos(r + s),
      o * Math.sin(r + s)
    ]),
    [t, n]
  ), p = s > Math.PI ? 1 : 0, y = s > 0 ? u ? 0 : 1 : u ? 1 : 0;
  return {
    startX: A(u ? F : f),
    startY: A(u ? d : h),
    endX: A(u ? f : F),
    endY: A(u ? h : d),
    path: `M${A(u ? F : f)} ${A(u ? d : h)} A ${[
      A(e),
      A(o),
      A(c / (l * Math.PI) * i),
      A(p),
      A(y),
      A(u ? f : F),
      A(u ? h : d)
    ].join(" ")}`
  };
}
function xt({ defaultConfig: t, userConfig: n }) {
  const e = { ...t };
  return Object.keys(e).forEach((o) => {
    if (Object.hasOwn(n, o)) {
      const r = n[o];
      r === null ? e[o] = null : ["boolean", "function"].includes(typeof r) ? e[o] = r : ["string", "number"].includes(typeof r) ? lt(r) && (e[o] = r) : Array.isArray(e[o]) ? mt({ userConfig: n, key: o }) && (e[o] = r) : bt({ userConfig: n, key: o }) && (e[o] = xt({
        defaultConfig: e[o],
        userConfig: r
      }));
    }
  }), Object.keys(n).forEach((o) => {
    if (!Object.hasOwn(e, o)) {
      const r = n[o];
      e[o] = r && typeof r == "object" && !Array.isArray(r) ? { ...r } : r;
    }
  }), e;
}
function mt({ userConfig: t, key: n }) {
  return Object.hasOwn(t, n) && Array.isArray(t[n]) && t[n].length >= 0;
}
function bt({ userConfig: t, key: n }) {
  return Object.hasOwn(t, n) && !Array.isArray(t[n]) && typeof t[n] == "object";
}
function lt(t) {
  return ![null, void 0, NaN, 1 / 0, -1 / 0].includes(t);
}
function Ht(t) {
  return ![void 0, NaN, 1 / 0, -1 / 0].includes(t);
}
function Ut(t, n = 0) {
  return lt(t) ? t : n;
}
function A(t, n = 0) {
  return isNaN(t) ? n : t;
}
const st = [
  "#1f77b4",
  "#aec7e8",
  "#ff7f0e",
  "#ffbb78",
  "#2ca02c",
  "#98df8a",
  "#d62728",
  "#ff9896",
  "#9467bd",
  "#c5b0d5",
  "#8c564b",
  "#c49c94",
  "#e377c2",
  "#f7b6d2",
  "#7f7f7f",
  "#c7c7c7",
  "#bcbd22",
  "#dbdb8d",
  "#17becf",
  "#9edae5",
  "#393b79",
  "#5254a3",
  "#6b6ecf",
  "#9c9ede",
  "#637939",
  "#8ca252",
  "#b5cf6b",
  "#cedb9c",
  "#8c6d31",
  "#bd9e39",
  "#e7ba52",
  "#e7cb94",
  "#843c39",
  "#ad494a",
  "#d6616b",
  "#e7969c",
  "#7b4173",
  "#a55194",
  "#ce6dbd",
  "#de9ed6"
];
function Gt(t = "default") {
  switch (t) {
    case "hack":
      return v.hack;
    case "zen":
      return v.zen;
    case "concrete":
      return v.concrete;
    case "celebration":
      return v.celebration;
    case "celebrationNight":
      return v.celebrationNight;
    default:
      return v.default;
  }
}
const v = {
  default: st,
  dark: st,
  celebration: [
    "#D32F2F",
    "#E64A19",
    "#F57C00",
    "#FF9800",
    "#FF5722",
    "#FFC107",
    "#FFEB3B",
    "#FFD54F",
    "#FF6F00",
    "#D84315",
    "#BF360C",
    "#C62828",
    "#B71C1C",
    "#FF7043",
    "#FF8A65",
    "#FFB74D",
    "#FFA726",
    "#FFCC80",
    "#FFE082",
    "#FFECB3"
  ],
  celebrationNight: [
    "#D32F2F",
    "#E64A19",
    "#F57C00",
    "#FF9800",
    "#FF5722",
    "#FFC947",
    "#FFEB3B",
    "#FFD95B",
    "#FF8800",
    "#FF5722",
    "#DD2C00",
    "#F44336",
    "#C62828",
    "#FF6E6E",
    "#FF867C",
    "#FFB547",
    "#FFA837",
    "#FFD180",
    "#FFE57F",
    "#FFF59D"
  ],
  concrete: [
    "#4A6A75",
    "#6C94A0",
    "#7DA9B5",
    "#8EBFCA",
    "#9FD4E0",
    "#B0E9F5",
    "#C1FFFF",
    "#5C6B5B",
    "#6D7D6D",
    "#7E8F7E",
    "#8FA290",
    "#A1B5A3",
    "#B2C7B5",
    "#C3DAC8",
    "#D4ECDA",
    "#E6FFF0",
    "#8A9CA5",
    "#9AA7B0",
    "#ABB1BC",
    "#BBCBC7",
    "#CCD6D3",
    "#DEE1DE",
    "#EFECEC",
    "#404C4D",
    "#50605F",
    "#617472",
    "#718885",
    "#829C98",
    "#92B0AB",
    "#A3C4BE",
    "#B3D8D2",
    "#C4EDE5",
    "#D4F1E8",
    "#404C5A",
    "#50606C",
    "#61747E",
    "#718890",
    "#829CA2",
    "#92B0B5"
  ],
  hack: [
    "#004C00",
    "#006600",
    "#008000",
    "#009900",
    "#00B300",
    "#00CC00",
    "#00E600",
    "#00FF00",
    "#33FF33",
    "#33E633",
    "#33CC33",
    "#33B333",
    "#339933",
    "#338033",
    "#336633",
    "#334C33",
    "#333333",
    "#00AF19",
    "#19E619",
    "#19CC19",
    "#19B319",
    "#199919",
    "#198019",
    "#196619",
    "#194C19",
    "#193319",
    "#191919",
    "#66FF66",
    "#66E666",
    "#66CC66",
    "#66B366",
    "#669966",
    "#668066",
    "#666666",
    "#4CFF4C",
    "#4CE64C",
    "#4CCC4C",
    "#4CB34C"
  ],
  zen: [
    "#B9B99D",
    "#E0CFC3",
    "#DFCA99",
    "#DCB482",
    "#C09E85",
    "#8F837A",
    "#858480",
    "#B0B9A8",
    "#606C5A",
    "#5E5E5E",
    "#4F5B75",
    "#647393",
    "#818EA9",
    "#9FA9BE",
    "#BBC4D3",
    "#DCDFE7",
    "#928A98",
    "#8A9892",
    "#B1A7AD",
    "#C5B8A7",
    "#EBD6CC",
    "#D7E0D2",
    "#E0D2D7",
    "#E0DBD2",
    "#D2E0DB",
    "#DBD2E0",
    "#C1B7A5",
    "#A5AFC1",
    "#E0DBD2",
    "#D2D7E0",
    "#F7EDE2",
    "#97ACB7",
    "#C4CBBC",
    "#C3C5C5",
    "#A0AC94"
  ]
}, ot = ["00", "03", "05", "08", "0A", "0D", "0F", "12", "14", "17", "1A", "1C", "1F", "21", "24", "26", "29", "2B", "2E", "30", "33", "36", "38", "3B", "3D", "40", "42", "45", "47", "4A", "4D", "4F", "52", "54", "57", "59", "5C", "5E", "61", "63", "66", "69", "6B", "6E", "70", "73", "75", "78", "7A", "7D", "80", "82", "85", "87", "8A", "8C", "8F", "91", "94", "96", "99", "9C", "9E", "A1", "A3", "A6", "A8", "AB", "AD", "B0", "B3", "B5", "B8", "BA", "BD", "BF", "C2", "C4", "C7", "C9", "CC", "CF", "D1", "D4", "D6", "D9", "DB", "DE", "E0", "E3", "E6", "E8", "EB", "ED", "F0", "F2", "F5", "F7", "FA", "FC", "FF"];
function ut(t) {
  const n = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i, e = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i, o = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/i, r = /^hsla?\((\d+),\s*([\d.]+)%,\s*([\d.]+)%(?:,\s*([\d.]+))?\)$/i;
  if (t == null || typeof t == "number" && isNaN(t))
    return null;
  if (t = nt?.(t) ? tt(t) : t, t = It(t), Array.isArray(t)) {
    const [i, l, u, a = 1] = t;
    t = `rgba(${i},${l},${u},${a})`;
  } else if (typeof t == "object")
    if (Number.isFinite(t.r) && Number.isFinite(t.g) && Number.isFinite(t.b)) {
      const i = Number.isFinite(t.a) ? t.a : 1;
      t = `rgba(${t.r},${t.g},${t.b},${i})`;
    } else
      return null;
  else if (typeof t == "number") {
    const i = t >>> 0, l = i.toString(16).padStart(i <= 16777215 ? 6 : 8, "0");
    return `#${l.length === 6 ? l + "ff" : l}`;
  } else if (typeof t != "string")
    return null;
  if (t = t.trim(), t.toLowerCase() === "transparent")
    return "#FFFFFF00";
  t = t.replace(e, (i, l, u, a, f) => `#${l}${l}${u}${u}${a}${a}${f ? f + f : ""}`);
  let s, c = 1;
  if (s = t.match(n)) {
    const [, i, l, u, a] = s;
    return c = a ? parseInt(a, 16) / 255 : 1, `#${i}${l}${u}${G(Math.round(c * 255))}`;
  } else if (s = t.match(o)) {
    const [, i, l, u, a] = s;
    return c = a ? parseFloat(a) : 1, `#${G(i)}${G(l)}${G(u)}${G(Math.round(c * 255))}`;
  } else if (s = t.match(r)) {
    const [, i, l, u, a] = s;
    c = a ? parseFloat(a) : 1;
    const [f, h, F] = Mt(Number(i), Number(l), Number(u));
    return `#${G(f)}${G(h)}${G(F)}${G(Math.round(c * 255))}`;
  }
  return null;
}
function G(t) {
  const n = Number(t).toString(16);
  return n.length === 1 ? "0" + n : n;
}
function Mt(t, n, e, o = 1) {
  t /= 360, n /= 100, e /= 100;
  let r, s, c;
  if (n === 0)
    r = s = c = e;
  else {
    const i = (a, f, h) => (h < 0 && (h += 1), h > 1 && (h -= 1), h < 0.16666666666666666 ? a + (f - a) * 6 * h : h < 0.5 ? f : h < 0.6666666666666666 ? a + (f - a) * (0.6666666666666666 - h) * 6 : a), l = e < 0.5 ? e * (1 + n) : e + n - e * n, u = 2 * e - l;
    r = i(u, l, t + 1 / 3), s = i(u, l, t), c = i(u, l, t - 1 / 3);
  }
  return [
    Math.round(r * 255),
    Math.round(s * 255),
    Math.round(c * 255),
    o
  ];
}
function vt(t, n) {
  const e = t.length === 9 ? t.substring(0, 7) : t, o = t.length === 9 ? t.substring(7, 9) : null, r = (f) => ({
    r: parseInt(f.substring(1, 3), 16),
    g: parseInt(f.substring(3, 5), 16),
    b: parseInt(f.substring(5, 7), 16)
  }), s = ({ r: f, g: h, b: F }) => {
    f /= 255, h /= 255, F /= 255;
    const d = Math.max(f, h, F), p = Math.min(f, h, F);
    let y, x, E = (d + p) / 2;
    if (d === p)
      y = x = 0;
    else {
      const C = d - p;
      switch (x = E > 0.5 ? C / (2 - d - p) : C / (d + p), d) {
        case f:
          y = (h - F) / C + (h < F ? 6 : 0);
          break;
        case h:
          y = (F - f) / C + 2;
          break;
        case F:
          y = (f - h) / C + 4;
          break;
      }
      y /= 6;
    }
    return { h: y, s: x, l: E };
  }, c = ({ h: f, s: h, l: F }) => {
    let d, p, y;
    if (h === 0)
      d = p = y = F;
    else {
      const x = (R, O, L) => (L < 0 && (L += 1), L > 1 && (L -= 1), L < 0.16666666666666666 ? R + (O - R) * 6 * L : L < 0.5 ? O : L < 0.6666666666666666 ? R + (O - R) * (0.6666666666666666 - L) * 6 : R), E = F < 0.5 ? F * (1 + h) : F + h - F * h, C = 2 * F - E;
      d = x(C, E, f + 1 / 3), p = x(C, E, f), y = x(C, E, f - 1 / 3);
    }
    return {
      r: Math.round(d * 255),
      g: Math.round(p * 255),
      b: Math.round(y * 255)
    };
  }, i = r(e || "#000000"), l = s(i);
  l.h += n, l.h = (l.h + 1) % 1;
  const u = c(l);
  return `#${(u.r << 16 | u.g << 8 | u.b).toString(16).padStart(6, "0")}` + (o || "");
}
function Ct({
  centerX: t,
  centerY: n,
  outerPoints: e,
  radius: o,
  rotation: r
}) {
  const s = Math.PI / e, c = r;
  let i = "";
  const l = [];
  for (let u = 0; u < e * 2; u += 1) {
    let a = t + Math.cos(u * s + c) * o, f = n + Math.sin(u * s + c) * o;
    i += `${a},${f} `, l.push({ x: a, y: f });
  }
  return {
    path: `M${i}Z`,
    coordinates: l
  };
}
function Xt({
  plot: t,
  radius: n,
  sides: e,
  rotation: o = 0
}) {
  const r = t.x, s = t.y, c = e / 2;
  return Ct({
    centerX: r,
    centerY: s,
    outerPoints: c,
    radius: n + 1,
    rotation: o
  });
}
function $t({
  centerX: t,
  centerY: n,
  innerCirclePoints: e,
  innerRadius: o,
  outerRadius: r
}) {
  const s = Math.PI / e, c = 60, i = e * 2;
  let l = "";
  for (let u = 0; u < i; u += 1) {
    let f = u % 2 == 0 ? r : o, h = t + Math.cos(u * s + c) * f, F = n + Math.sin(u * s + c) * f;
    l += `${h},${F} `;
  }
  return l;
}
function jt({
  plot: t,
  radius: n,
  apexes: e = 5
}) {
  const o = t.x, r = t.y, s = e, c = n * 3.5 / s, l = c * 2;
  return $t({
    centerX: o,
    centerY: r,
    innerCirclePoints: s,
    innerRadius: c,
    outerRadius: l
  });
}
function Kt({ series: t }) {
  if (!Array.isArray(t) || t.length === 0) return "";
  const n = Array.from(
    new Map(
      t.filter((a) => a && Number.isFinite(a.x) && Number.isFinite(a.y)).map((a) => [`${a.x},${a.y}`, { x: +a.x, y: +a.y }])
    ).values()
  );
  if (n.length === 0) return "";
  if (n.length === 1) return `${Math.round(n[0].x)},${Math.round(n[0].y)} `;
  const e = (a, f) => {
    const h = a.x - f.x, F = a.y - f.y;
    return h * h + F * F;
  }, o = (a, f, h) => (f.x - a.x) * (h.y - a.y) - (f.y - a.y) * (h.x - a.x);
  let r = n[0];
  for (const a of n)
    (a.x < r.x || a.x === r.x && a.y < r.y) && (r = a);
  const s = [r];
  let c = r;
  const i = n.length + 2;
  let l = 0;
  for (; !(++l > i); ) {
    let a = n[0] === c ? n[1] : n[0];
    for (const f of n) {
      if (f === c || f === a) continue;
      const h = o(c, a, f);
      h < 0 || (h > 0 || e(c, f) > e(c, a)) && (a = f);
    }
    if (a === r) break;
    s.push(a), c = a;
  }
  let u = "";
  for (const a of s)
    u += `${Math.round(a.x)},${Math.round(a.y)} `;
  return u;
}
function X(t) {
  return t * Math.PI / 180;
}
function Wt(t) {
  if (t) {
    let n = t, e = 1;
    if (n.startsWith("rgba")) {
      const u = n.match(/rgba?\((\d+), (\d+), (\d+), ([\d.]+)\)/);
      if (u) {
        const [, a, f, h, F] = u;
        e = parseFloat(F), n = `#${parseInt(a).toString(16).padStart(2, "0")}${parseInt(f).toString(16).padStart(2, "0")}${parseInt(h).toString(16).padStart(2, "0")}`;
      }
    }
    n.charAt(0) !== "#" && (n = this.rgbToHex(t)), n = n.substring(1, 7);
    let o = parseInt(n.substring(0, 2), 16), r = parseInt(n.substring(2, 4), 16), s = parseInt(n.substring(4, 6), 16), i = [o / 255, r / 255, s / 255].map((u) => u <= 0.03928 ? u / 12.92 : Math.pow((u + 0.055) / 1.055, 2.4)), l = 0.2126 * i[0] + 0.7152 * i[1] + 0.0722 * i[2];
    return e < 1 ? e * l + (1 - e) * 1 > 0.3 ? "#000000" : "#FFFFFF" : l > 0.3 ? "#000000" : "#FFFFFF";
  }
  return "#000000";
}
function K(t) {
  return t !== null && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && (t.constructor === Object || t.constructor == null);
}
function Q(t) {
  return !!t && (t.__v_isRef || t.__v_isReactive || t.__v_isReadonly || t.effect || t.dep || t.deps || t.subs);
}
function it(t) {
  return t === "" ? "#000000" : t === "transparent" ? "#FFFFFF00" : ut(t) ?? t;
}
function q(t, n = /* @__PURE__ */ new WeakSet()) {
  const e = ft(t);
  if (!K(e) || n.has(e)) return e;
  n.add(e);
  for (const o in e) {
    const r = nt(e[o]) ? tt(e[o]) : e[o];
    if (o === "color" || o === "backgroundColor") {
      typeof r == "string" && (e[o] = it(r));
      continue;
    }
    if (o === "stroke") {
      typeof r == "string" ? e[o] = it(r) : K(r) && !Q(r) && q(r, n);
      continue;
    }
    if (Array.isArray(r)) {
      for (const s of r)
        K(s) && !Q(s) && q(s, n);
      continue;
    }
    K(r) && !Q(r) && q(r, n);
  }
  return e;
}
function Vt(t) {
  const n = t?.length ?? 0;
  if (n < 2) return { x1: 0, y1: 0, x2: 0, y2: 0, slope: 0, trend: 0 };
  let e = 0, o = 0, r = 0, s = 0;
  for (const { x: M, y: D } of t)
    e += M, o += D, r += M * D, s += M * M;
  const c = n * s - e * e || 1, i = (n * r - e * o) / c, l = (o - i * e) / n, u = t[0].x, a = t[n - 1].x, f = i * u + l, h = i * a + l;
  let F = 0, d = 0, p = 0, y = 0;
  for (let M = 0; M < n; M += 1)
    F += M, d += t[M].value, p += M * t[M].value, y += M * M;
  const x = n * y - F * F || 1, E = (n * p - F * d) / x, C = (d - E * F) / n, R = C, O = E * (n - 1) + C, m = Math.max(Math.abs(R), Math.abs(d / n), Math.abs(O), 1e-9), $ = (O - R) / m;
  return { x1: u, y1: f, x2: a, y2: h, slope: i, trend: $ };
}
function _t(t) {
  const n = Math.floor(t.length / 2), e = [...t].sort((o, r) => o - r);
  return t.length % 2 !== 0 ? e[n] : (e[n - 1] + e[n]) / 2;
}
function zt(t) {
  let n = [];
  for (let e = 0; e < t.length; e += 1)
    n.push(`${A(t[e].x)},${A(t[e].y)} `);
  return n.join(" ").trim();
}
function Zt(t) {
  if (t.length < 2) return "0,0";
  const n = t.length - 1, e = [`${A(t[0].x)},${A(t[0].y)}`], o = [], r = [], s = [], c = [];
  for (let i = 0; i < n; i += 1)
    o[i] = t[i + 1].x - t[i].x, r[i] = t[i + 1].y - t[i].y, s[i] = r[i] / o[i];
  c[0] = s[0], c[n] = s[n - 1];
  for (let i = 1; i < n; i += 1)
    if (s[i - 1] * s[i] <= 0)
      c[i] = 0;
    else {
      const l = 2 * s[i - 1] * s[i] / (s[i - 1] + s[i]);
      c[i] = l;
    }
  for (let i = 0; i < n; i += 1) {
    const l = t[i].x, u = t[i].y, a = t[i + 1].x, f = t[i + 1].y, h = c[i], F = c[i + 1], d = l + (a - l) / 3, p = u + h * (a - l) / 3, y = a - (a - l) / 3, x = f - F * (a - l) / 3;
    e.push(`C ${A(d)},${A(p)} ${A(y)},${A(x)} ${A(a)},${A(f)}`);
  }
  return e.join(" ");
}
function Qt(t, n = 0.2) {
  function e(c, i) {
    const l = i.x - c.x, u = i.y - c.y;
    return {
      length: Math.sqrt(Math.pow(l, 2) + Math.pow(u, 2)),
      angle: Math.atan2(u, l)
    };
  }
  function o(c, i, l, u) {
    const h = e(i || c, l || c), F = h.angle + (u ? Math.PI : 0), d = h.length * n, p = c.x + Math.cos(F) * d, y = c.y + Math.sin(F) * d;
    return { x: p, y };
  }
  function r(c, i, l) {
    const u = o(l[i - 1], l[i - 2], c), a = o(c, l[i - 1], l[i + 1], !0);
    return `C ${A(u.x)},${A(u.y)} ${A(a.x)},${A(a.y)} ${A(c.x)},${A(c.y)}`;
  }
  return t.filter((c) => !!c).reduce(
    (c, i, l, u) => l === 0 ? `${A(i.x)},${A(i.y)} ` : `${c} ${r(i, l, u)} `,
    ""
  );
}
function qt() {
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
    const n = Math.random() * 16 | 0;
    return (t == "x" ? n : n & 3 | 8).toString(16);
  });
}
function W(t, n = !1, e = 16, o = !1) {
  let r = 0, s = n ? e : 0, c = o ? "center" : "middle";
  return t.center.endX > t.cx ? (r = t.center.endX + e + s, c = o ? "left" : "start") : t.center.endX < t.cx ? (r = t.center.endX - e - s, c = o ? "right" : "end") : (r = t.centerX + s, c = o ? "center" : "middle"), { x: r, anchor: c };
}
function V(t, n = 16, e = 16) {
  return t.center.endY > t.cy ? t.center.endY + e : t.center.endY < t.cy ? t.center.endY - n : t.center.endY;
}
function Jt({
  initX: t,
  initY: n,
  offset: e,
  centerX: o,
  centerY: r
}) {
  const s = Math.atan2(n - r, t - o);
  return {
    x: t + e * Math.cos(s),
    y: n + e * Math.sin(s)
  };
}
function Dt(t) {
  const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
  n.setAttribute("d", t);
  const e = n.getTotalLength();
  let o = 0, r = e, s = e / 2;
  const c = 0.01;
  for (; r - o > c; ) {
    const u = (o + r) / 2, f = n.getPointAtLength(u).x;
    if (Math.abs(f - s) < c) {
      s = u;
      break;
    } else f < s ? o = u : r = u;
  }
  const { x: i, y: l } = n.getPointAtLength(s);
  return { x: i, y: l };
}
function tn(t, n = !1, e = 16, o = 16, r = !1, s = !1, c = 0, i = 12, l = !1) {
  const { x: u } = Dt(t.path), a = `${W(t).x},${V(t, e, o) - 4} `;
  let f = "", h, F;
  u > t.cx ? (h = W(t).x - i, F = V(t, e, o) - 4, f = `${h},${F}`) : u < t.cx ? (h = W(t).x + i, F = V(t, e, o) - 4, f = `${h},${F}`) : (h = W(t).x + i, F = V(t, e, o) - 4, f = `${h},${F}`);
  const d = ` ${t.center.endX},${t.center.endY}`;
  return l ? s ? `M${f} Q${f} ${d}` : `M${a} Q${f} ${d}` : `M${s ? "" : a}${f}${d}`;
}
function nn(t) {
  return ![null, void 0, NaN].includes(t);
}
function en(t, n) {
  return [...t].map((e) => e[n]).reduce((e, o) => e + o, 0);
}
function rn(t, n = !0, e = !1) {
  if (!t.length) return "M0,0";
  let o = "";
  return t.forEach((r) => {
    if (!r) return "";
    o += `${r.x},${r.y} `;
  }), e ? o.trim() : `M${o}${n ? "Z" : ""}`;
}
function sn({ csvContent: t, title: n = "vue-data-ui" }) {
  const e = encodeURI(t), o = document.createElement("a");
  o.setAttribute("href", e), o.setAttribute("download", `${n}.csv`), document.body.appendChild(o), o.click(), o.remove(), window.URL.revokeObjectURL(e);
}
function on(t) {
  return `data:text/csv;charset=utf-8,${t.map((n) => n.join(",")).join(`
`)}`;
}
function cn(t, n) {
  if (!/^#([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t))
    return console.warn("lightenHexColor : Invalid hex color format"), "#000000";
  let e = t.replace("#", "");
  e.length === 3 && (e = e.split("").map((a) => a + a).join(""));
  const o = parseInt(e.substring(0, 2), 16), r = parseInt(e.substring(2, 4), 16), s = parseInt(e.substring(4, 6), 16), c = Math.min(255, o + (255 - o) * n), i = Math.min(255, r + (255 - r) * n), l = Math.min(255, s + (255 - s) * n), u = `#${Math.round(c).toString(16).padStart(2, "0")}${Math.round(i).toString(16).padStart(2, "0")}${Math.round(l).toString(16).padStart(2, "0")}`;
  if (e.length === 8) {
    const a = e.substring(6, 8);
    return u + a;
  }
  return u;
}
function an(t, n) {
  if (!/^#([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t))
    return console.warn("darkenHexColor: Invalid hex color format"), "#000000";
  let e = t.replace("#", "");
  e.length === 3 && (e = e.split("").map((a) => a + a).join(""));
  const o = parseInt(e.substring(0, 2), 16), r = parseInt(e.substring(2, 4), 16), s = parseInt(e.substring(4, 6), 16), c = Math.max(0, o - o * n), i = Math.max(0, r - r * n), l = Math.max(0, s - s * n), u = `#${Math.round(c).toString(16).padStart(2, "0")}${Math.round(i).toString(16).padStart(2, "0")}${Math.round(l).toString(16).padStart(2, "0")}`;
  if (e.length === 8) {
    const a = e.substring(6, 8);
    return u + a;
  }
  return u;
}
function z(t, n) {
  const e = Math.floor(Math.log10(t)), o = t / Math.pow(10, e);
  let r;
  return n ? o < 1.5 ? r = 1 : o < 3 ? r = 2 : o < 7 ? r = 5 : r = 10 : o <= 1 ? r = 1 : o <= 2 ? r = 2 : o <= 5 ? r = 5 : r = 10, r * Math.pow(10, e);
}
function ln(t, n, e, o = !1) {
  const r = o ? n - t : z(n - t, !1), s = o ? r / (e - 1) : z(r / (e - 1), !0), c = Math.floor(t / s) * s, i = Math.ceil(n / s) * s, l = [];
  for (let u = c; u <= i; u += s)
    l.push(u);
  return {
    min: c,
    max: i,
    tickSize: s,
    ticks: l
  };
}
function un(t, n, e, o = !1) {
  const r = o ? n - t : z(n - t, !1), s = o ? r / (e - 1) : z(r / (e - 1), !0), c = Math.floor(t / s) * s, i = Math.ceil(n / s) * s;
  let l = [], u = c;
  for (; u <= i; )
    u >= t && u <= n && l.push(u), u += s;
  return l[0] !== t && (l[0] = t), l[l.length - 1] !== n && (l[l.length - 1] = n), {
    min: t,
    max: n,
    tickSize: s,
    ticks: l
  };
}
function fn(t, n, e, o, r) {
  const s = (h) => {
    let F = parseInt(h.substring(1, 3), 16), d = parseInt(h.substring(3, 5), 16), p = parseInt(h.substring(5, 7), 16), y = 1;
    return h.length === 9 && (y = parseInt(h.substring(7, 9), 16) / 255), { r: F, g: d, b: p, a: y };
  }, c = ({ r: h, g: F, b: d, a: p }) => {
    const y = (E) => E.toString(16).padStart(2, "0"), x = `#${y(h)}${y(F)}${y(d)}`;
    if (p !== 1) {
      const E = Math.round(p * 255).toString(16).padStart(2, "0");
      return x + E;
    }
    return x;
  }, i = s(t), l = s(n);
  r = Math.min(Math.max(r, e), o);
  const u = (r - e) / (o - e), a = {
    r: Math.round(i.r + (l.r - i.r) * u),
    g: Math.round(i.g + (l.g - i.g) * u),
    b: Math.round(i.b + (l.b - i.b) * u)
  }, f = i.a + (l.a - i.a) * u;
  return c({ ...a, a: f });
}
function hn({ p: t = "", v: n, s: e = "", r: o = 0, space: r = !1, isAnimating: s = !1, regex: c = /[^%]/g, replacement: i = "-", locale: l = null }) {
  const u = l ? Number(Number(n).toFixed(o)).toLocaleString(l) : Number(Number(n).toFixed(o)).toLocaleString(), a = u === 1 / 0 ? "∞" : u === -1 / 0 ? "-∞" : u, f = `${t ?? ""}${r ? " " : ""}${[void 0, null].includes(n) ? "-" : a}${r ? " " : ""}${e ?? ""}`;
  return s ? f.replace(c, i) : f;
}
function Fn({ source: t, length: n = 3 }) {
  if (!t && t !== 0)
    return "";
  t = String(t);
  const e = t.length > 1 ? t.split(" ") : [t];
  if (e.length === 1 && e[0].length === 1)
    return String(t).toUpperCase();
  if (e.length === 1)
    return t.slice(0, n).toUpperCase();
  {
    const o = [];
    return e.forEach((r, s) => {
      s < n && o.push(r.slice(0, 1));
    }), o.join().replaceAll(",", "").toUpperCase();
  }
}
function dn(t) {
  return !!t && typeof t == "function";
}
function gn(t) {
  return typeof t.apply(null, arguments) == "string";
}
function pn(t) {
  return Array.isArray(t) ? t.length === 0 : t ? Object.keys(t).length === 0 : !0;
}
function En({ componentName: t, type: n, property: e = "", index: o = "", key: r = "", warn: s = !0, debug: c = !0 }) {
  if (!c) return;
  const i = `
> ${At[n].replace("#COMP#", t).replace("#ATTR#", e).replace("#INDX#", o).replace("#KEY#", r)}
`;
  if (s)
    console.warn(i);
  else
    throw new Error(i);
}
function St({ points: t, a: n, b: e, angleStep: o, startX: r, startY: s }) {
  const c = [];
  for (let i = 0; i < t; i++) {
    const l = o * i, u = n + e * l, a = u * Math.cos(l) + r, f = u * Math.sin(l) + s;
    c.push({ x: a, y: f });
  }
  return c;
}
function Rt(t) {
  let n = 1 / 0, e = 1 / 0, o = -1 / 0, r = -1 / 0;
  for (const s of t)
    s.x < n && (n = s.x), s.y < e && (e = s.y), s.x > o && (o = s.x), s.y > r && (r = s.y);
  return { minX: n, minY: e, maxX: o, maxY: r, width: o - n || 1, height: r - e || 1 };
}
function Bt(t) {
  if (!t.length) return "";
  let n = `M${t[0].x} ${t[0].y}`;
  for (let e = 1; e < t.length - 2; e += 2) {
    const o = t[e - 1], r = t[e], s = t[e + 1], c = t[e + 2], i = (o.x + r.x) / 2, l = (o.y + r.y) / 2, u = (r.x + s.x) / 2, a = (r.y + s.y) / 2, f = (s.x + c.x) / 2, h = (s.y + c.y) / 2;
    n += ` C${i} ${l}, ${u} ${a}, ${f} ${h}`;
  }
  return n;
}
function An({
  maxPoints: t,
  a: n = 6,
  b: e = 6,
  angleStep: o = 0.07,
  startX: r,
  startY: s,
  boxWidth: c,
  boxHeight: i,
  padding: l = 12
}) {
  const u = St({ points: t, a: n, b: e, angleStep: o, startX: 0, startY: 0 }), { minX: a, minY: f, maxX: h, maxY: F, width: d, height: p } = Rt(u), y = (a + h) / 2, x = (f + F) / 2, E = Math.max(1, c - 2 * l), C = Math.max(1, i - 2 * l), R = Math.min(E / d, C / p), O = r - y * R, L = s - x * R;
  return function($) {
    const M = Math.max(2, Math.min(Math.round($), u.length)), D = u.slice(0, M).map((g) => ({ x: g.x * R + O, y: g.y * R + L }));
    return Bt(D);
  };
}
function yn({ datasetObject: t, requiredAttributes: n }) {
  let e = [];
  return n.forEach((o) => {
    Object.hasOwn(t, o) || e.push(o);
  }), e;
}
const ct = {
  ALICEBLUE: "#F0F8FF",
  ANTIQUEWHITE: "#FAEBD7",
  AQUA: "#00FFFF",
  AQUAMARINE: "#7FFFD4",
  AZURE: "#F0FFFF",
  BEIGE: "#F5F5DC",
  BISQUE: "#FFE4C4",
  BLACK: "#000000",
  BLANCHEDALMOND: "#FFEBCD",
  BLUE: "#0000FF",
  BLUEVIOLET: "#8A2BE2",
  BROWN: "#A52A2A",
  BURLYWOOD: "#DEB887",
  CADETBLUE: "#5F9EA0",
  CHARTREUSE: "#7FFF00",
  CHOCOLATE: "#D2691E",
  CORAL: "#FF7F50",
  CORNFLOWERBLUE: "#6495ED",
  CORNSILK: "#FFF8DC",
  CRIMSON: "#DC143C",
  CYAN: "#00FFFF",
  DARKBLUE: "#00008B",
  DARKCYAN: "#008B8B",
  DARKGOLDENROD: "#B8860B",
  DARKGREY: "#A9A9A9",
  DARKGREEN: "#006400",
  DARKKHAKI: "#BDB76B",
  DARKMAGENTA: "#8B008B",
  DARKOLIVEGREEN: "#556B2F",
  DARKORANGE: "#FF8C00",
  DARKORCHID: "#9932CC",
  DARKRED: "#8B0000",
  DARKSALMON: "#E9967A",
  DARKSEAGREEN: "#8FBC8F",
  DARKSLATEBLUE: "#483D8B",
  DARKSLATEGREY: "#2F4F4F",
  DARKTURQUOISE: "#00CED1",
  DARKVIOLET: "#9400D3",
  DEEPPINK: "#FF1493",
  DEEPSKYBLUE: "#00BFFF",
  DIMGRAY: "#696969",
  DODGERBLUE: "#1E90FF",
  FIREBRICK: "#B22222",
  FLORALWHITE: "#FFFAF0",
  FORESTGREEN: "#228B22",
  FUCHSIA: "#FF00FF",
  GAINSBORO: "#DCDCDC",
  GHOSTWHITE: "#F8F8FF",
  GOLD: "#FFD700",
  GOLDENROD: "#DAA520",
  GREY: "#808080",
  GREEN: "#008000",
  GREENYELLOW: "#ADFF2F",
  HONEYDEW: "#F0FFF0",
  HOTPINK: "#FF69B4",
  INDIANRED: "#CD5C5C",
  INDIGO: "#4B0082",
  IVORY: "#FFFFF0",
  KHAKI: "#F0E68C",
  LAVENDER: "#E6E6FA",
  LAVENDERBLUSH: "#FFF0F5",
  LAWNGREEN: "#7CFC00",
  LEMONCHIFFON: "#FFFACD",
  LIGHTBLUE: "#ADD8E6",
  LIGHTCORAL: "#F08080",
  LIGHTCYAN: "#E0FFFF",
  LIGHTGOLDENRODYELLOW: "#FAFAD2",
  LIGHTGREY: "#D3D3D3",
  LIGHTGREEN: "#90EE90",
  LIGHTPINK: "#FFB6C1",
  LIGHTSALMON: "#FFA07A",
  LIGHTSEAGREEN: "#20B2AA",
  LIGHTSKYBLUE: "#87CEFA",
  LIGHTSLATEGREY: "#778899",
  LIGHTSTEELBLUE: "#B0C4DE",
  LIGHTYELLOW: "#FFFFE0",
  LIME: "#00FF00",
  LIMEGREEN: "#32CD32",
  LINEN: "#FAF0E6",
  MAGENTA: "#FF00FF",
  MAROON: "#800000",
  MEDIUMAQUAMARINE: "#66CDAA",
  MEDIUMBLUE: "#0000CD",
  MEDIUMORCHID: "#BA55D3",
  MEDIUMPURPLE: "#9370D8",
  MEDIUMSEAGREEN: "#3CB371",
  MEDIUMSLATEBLUE: "#7B68EE",
  MEDIUMSPRINGGREEN: "#00FA9A",
  MEDIUMTURQUOISE: "#48D1CC",
  MEDIUMVIOLETRED: "#C71585",
  MIDNIGHTBLUE: "#191970",
  MINTCREAM: "#F5FFFA",
  MISTYROSE: "#FFE4E1",
  MOCCASIN: "#FFE4B5",
  NAVAJOWHITE: "#FFDEAD",
  NAVY: "#000080",
  OLDLACE: "#FDF5E6",
  OLIVE: "#808000",
  OLIVEDRAB: "#6B8E23",
  ORANGE: "#FFA500",
  ORANGERED: "#FF4500",
  ORCHID: "#DA70D6",
  PALEGOLDENROD: "#EEE8AA",
  PALEGREEN: "#98FB98",
  PALETURQUOISE: "#AFEEEE",
  PALEVIOLETRED: "#D87093",
  PAPAYAWHIP: "#FFEFD5",
  PEACHPUFF: "#FFDAB9",
  PERU: "#CD853F",
  PINK: "#FFC0CB",
  PLUM: "#DDA0DD",
  POWDERBLUE: "#B0E0E6",
  PURPLE: "#800080",
  RED: "#FF0000",
  ROSYBROWN: "#BC8F8F",
  ROYALBLUE: "#4169E1",
  SADDLEBROWN: "#8B4513",
  SALMON: "#FA8072",
  SANDYBROWN: "#F4A460",
  SEAGREEN: "#2E8B57",
  SEASHELL: "#FFF5EE",
  SIENNA: "#A0522D",
  SILVER: "#C0C0C0",
  SKYBLUE: "#87CEEB",
  SLATEBLUE: "#6A5ACD",
  SLATEGREY: "#708090",
  SNOW: "#FFFAFA",
  SPRINGGREEN: "#00FF7F",
  STEELBLUE: "#4682B4",
  TAN: "#D2B48C",
  TEAL: "#008080",
  THISTLE: "#D8BFD8",
  TOMATO: "#FF6347",
  TURQUOISE: "#40E0D0",
  VIOLET: "#EE82EE",
  WHEAT: "#F5DEB3",
  WHITE: "#FFFFFF",
  WHITESMOKE: "#F5F5F5",
  YELLOW: "#FFFF00",
  YELLOWGREEN: "#9ACD32",
  REBECCAPURPLE: "#663399"
};
function It(t) {
  const n = nt?.(t) ? tt(t) : t;
  if (typeof n != "string") return n;
  const e = n.trim();
  if (e === "" || e[0] === "#") return e;
  if (e.toLowerCase() === "transparent") return "#FFFFFF00";
  const o = e.toUpperCase(), r = o.replace(/GRAY/g, "GREY");
  return ct[o] || ct[r] || e;
}
const J = "http://www.w3.org/2000/svg";
function xn(t) {
  if (t.length < 2)
    return 0;
  let n = 0, e = 0;
  for (let r = 1; r < t.length; r++) {
    const s = t[r - 1], c = t[r];
    if ([null, void 0, 0, 1 / 0, -1 / 0].includes(s))
      continue;
    const i = (c - s) / Math.abs(s) * 100;
    n += i, e++;
  }
  return e === 0 ? 0 : n / e;
}
function mn({ content: t, fontSize: n, fill: e, x: o, y: r }) {
  return t.split(`
`).map(
    (c, i) => `<tspan x="${o}" y="${r + i * n}" fill="${e}">${c}</tspan>`
  ).join("");
}
function bn({ content: t, fontSize: n, fill: e, x: o, autoOffset: r = !1 }) {
  const s = t.split(`
`), c = r ? (s.length - 1) * n / 2 : 0;
  return s.map((i, l) => {
    const u = l === 0 ? -c : n;
    return `<tspan x="${o}" dy="${u}" fill="${e}">${i}</tspan>`;
  }).join("");
}
function Mn({
  content: t,
  fontSize: n,
  fill: e,
  maxWords: o,
  x: r,
  y: s
}) {
  function c(u, a) {
    const f = u.split(" "), h = [];
    for (let F = 0; F < f.length; F += a)
      h.push(f.slice(F, F + a).join(" "));
    return h;
  }
  let i = "";
  return c(t, o).forEach((u, a) => {
    const f = `<tspan x="${r}" y="${s + a * n}" fill="${e}">${u}</tspan>`;
    i += f;
  }), i;
}
function Cn(t) {
  return t.length ? t.map((n) => ut(n)) : [];
}
function $n(t, n = null) {
  const e = t.replace(/[\p{P}\p{S}]+/gu, " ").trim(), c = (/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Tibetan}\p{Script=Myanmar}\p{Script=Devanagari}]/u.test(t) ? [...e] : e.split(/\s+/)).filter((i) => i.trim().length > 0).reduce((i, l) => (i[l] ? i[l] += 1 : i[l] = 1, i), {});
  return Object.keys(c).map((i) => {
    let l = i;
    return typeof n == "function" && typeof n(i) == "string" && (l = n(i)), {
      name: l,
      value: c[i]
    };
  });
}
function Dn(t) {
  let n = t.reduce((i, l) => i + (l.stackRatio || 0), 0), e = t.filter((i) => i.stackRatio === void 0).length, o = 1 - n, r = e > 0 ? o / e : 0, s = t.map((i) => ({
    ...i,
    stackRatio: i.stackRatio !== void 0 ? i.stackRatio : r
  })), c = 0;
  return s = s.map((i, l) => (c += i.stackRatio, {
    ...i,
    stackIndex: l,
    cumulatedStackRatio: c
  })), s;
}
function Sn(t) {
  function n(u, a, f, h) {
    const F = f - u, d = h - a;
    return Math.sqrt(F * F + d * d);
  }
  function e(u, a, f, h) {
    let d = 0, p = u.x, y = u.y;
    for (let x = 1; x <= 100; x += 1) {
      const E = x / 100, C = 1 - E, R = C * C, O = E * E, L = R * C * u.x + 3 * R * E * a.x + 3 * C * O * f.x + O * E * h.x, m = R * C * u.y + 3 * R * E * a.y + 3 * C * O * f.y + O * E * h.y;
      d += n(p, y, L, m), p = L, y = m;
    }
    return d;
  }
  const o = t.match(/[a-zA-Z][^a-zA-Z]*/g);
  let r = 0, s = 0, c = 0, i = 0, l = 0;
  return o.forEach((u) => {
    const a = u[0], f = u.slice(1).trim().split(/[\s,]+/).map(Number);
    let h = 0;
    switch (a) {
      case "M":
        for (r = f[h++], s = f[h++], c = r, i = s; h < f.length; )
          l += n(r, s, f[h], f[h + 1]), r = f[h++], s = f[h++];
        break;
      case "L":
        for (; h < f.length; )
          l += n(r, s, f[h], f[h + 1]), r = f[h++], s = f[h++];
        break;
      case "H":
        for (; h < f.length; )
          l += n(r, s, f[h], s), r = f[h++];
        break;
      case "V":
        for (; h < f.length; )
          l += n(r, s, r, f[h]), s = f[h++];
        break;
      case "C":
        for (; h < f.length; )
          l += e(
            { x: r, y: s },
            { x: f[h], y: f[h + 1] },
            { x: f[h + 2], y: f[h + 3] },
            { x: f[h + 4], y: f[h + 5] }
          ), r = f[h + 4], s = f[h + 5], h += 6;
        break;
      case "Z":
        l += n(r, s, c, i), r = c, s = i;
        break;
    }
  }), l;
}
function Rn({
  relator: t,
  adjuster: n,
  source: e,
  threshold: o = 0,
  fallback: r,
  max: s = 24
}) {
  const c = t / (n / e);
  return c > s ? s : c < o ? r : c;
}
function Bn(t) {
  return t.reduce((n, e) => (e.series.forEach((o, r) => {
    ![void 0, null, 1 / 0, -1 / 0].includes(o) && !isNaN(o) && (n[r] = (n[r] || 0) + o);
  }), n), []);
}
function Lt(t, { value: n, config: e }) {
  let o = !1, r = n;
  if (typeof t == "function")
    try {
      r = t({ value: n, config: e }), ["number", "string"].includes(typeof r) ? o = !0 : r = n;
    } catch (s) {
      console.warn("Formatter could not be applied:", s), o = !1;
    }
  return {
    isValid: o,
    value: r
  };
}
function In(t, n, e, o) {
  const { isValid: r, value: s } = Lt(t, { value: n, config: o });
  return r ? s : e;
}
function Ln(t, n) {
  return n.split(".").every((e) => t !== null && typeof t == "object" && e in t ? (t = t[e], !0) : !1);
}
function Nn(t, n = [], e = !1) {
  function o(s) {
    return e && s === null ? null : typeof s == "string" && isNaN(Number(s)) || typeof s == "number" && isFinite(s) ? s : 0;
  }
  function r(s) {
    if (Array.isArray(s))
      return s.map((c) => r(c));
    if (typeof s == "object" && s !== null) {
      let c = { ...s };
      return n.forEach((i) => {
        c.hasOwnProperty(i) && ![
          "NAME",
          "name",
          "TITLE",
          "title",
          "DESCRIPTION",
          "description",
          "LABEL",
          "label",
          "TIME",
          "time",
          "PERIOD",
          "period",
          "MONTH",
          "month",
          "YEAR",
          "year",
          "MONTHS",
          "months",
          "YEARS",
          "years",
          "DAY",
          "day",
          "DAYS",
          "days",
          "HOUR",
          "hour",
          "HOURS",
          "hours"
        ].includes(i) && Array.isArray(c[i]) && (c[i] = r(c[i]));
      }), Object.fromEntries(
        Object.entries(c).map(([i, l]) => [i, r(l)])
      );
    } else
      return o(s);
  }
  return r(t);
}
function On(t, n = 100) {
  return t.length === 9 ? t.substring(0, 7) + ot[n] : t + ot[n];
}
function wn({ series: t, center: n, maxRadius: e, hasGhost: o = !1 }) {
  const s = 360 / (t.length - (o ? 1 : 0));
  return t.map((i, l) => {
    const a = i * e, f = l * s, h = f + s, F = f + s / 2, d = X(f) - X(90), p = X(h) - X(90), y = X(F) - X(90), x = n.x + a * Math.cos(d), E = n.y + a * Math.sin(d), C = n.x + a * Math.cos(p), R = n.y + a * Math.sin(p), O = n.x + a * Math.cos(y), L = n.y + a * Math.sin(y);
    return {
      path: `
            M ${n.x} ${n.y} 
            L ${x} ${E} 
            A ${a} ${a} 0 0 1 ${C} ${R} 
            Z
        `.trim(),
      middlePoint: { x: O, y: L },
      radius: a
    };
  });
}
function Tn({ data: t, threshold: n }) {
  if (n >= t.length || n < 3)
    return t;
  const e = [], o = (t.length - 2) / (n - 2);
  let r = 0;
  e.push(t[r]);
  for (let s = 0; s < n - 2; s += 1) {
    const c = Math.floor((s + 1) * o) + 1, i = Math.min(Math.floor((s + 2) * o) + 1, t.length), l = t.slice(c, i);
    let u = 0, a = 0;
    for (const F of l)
      u += F.x, a += F.y;
    u /= l.length, a /= l.length;
    let f = -1, h = r;
    for (let F = c; F < i; F += 1) {
      const d = Math.abs(
        (t[r].x - u) * (t[F].y - t[r].y) - (t[r].x - t[F].x) * (a - t[r].y)
      );
      d > f && (f = d, h = F);
    }
    e.push(t[h]), r = h;
  }
  return e.push(t[t.length - 1]), e;
}
function Pn({ data: t, threshold: n }) {
  if (n >= t.length || n < 3)
    return t;
  const e = [], o = (t.length - 2) / (n - 2);
  let r = 0;
  e.push(t[r]);
  for (let s = 0; s < n - 2; s += 1) {
    const c = Math.floor((s + 1) * o) + 1, i = Math.min(Math.floor((s + 2) * o) + 1, t.length), l = t.slice(c, i), u = l.reduce((h, F) => h + F, 0) / l.length;
    let a = -1, f = r;
    for (let h = c; h < i; h += 1) {
      const F = Math.abs((t[r] - u) * (h - r));
      F > a && (a = F, f = h);
    }
    e.push(t[f]), r = f;
  }
  return e.push(t[t.length - 1]), e;
}
function kn({ data: t, threshold: n, key: e = "value" }) {
  if (n >= t.length || n < 3)
    return t;
  const o = [], r = (t.length - 2) / (n - 2);
  let s = 0;
  o.push(t[s]);
  for (let c = 0; c < n - 2; c += 1) {
    const i = Math.floor((c + 1) * r) + 1, l = Math.min(Math.floor((c + 2) * r) + 1, t.length), u = t.slice(i, l), a = u.reduce((F, d) => F + d[e], 0) / u.length;
    let f = -1, h = s;
    for (let F = i; F < l; F += 1) {
      const d = Math.abs((t[s][e] - a) * (F - s));
      d > f && (f = d, h = F);
    }
    o.push(t[h]), s = h;
  }
  return o.push(t[t.length - 1]), o;
}
function Yn({ radius: t, centerX: n, centerY: e, percentage: o }) {
  o = Math.max(0, Math.min(1, o));
  const r = o * Math.PI, s = n - t, c = e, i = n - t * Math.cos(r), l = e - t * Math.sin(r);
  return `M ${n},${e} L ${s},${c} A ${t},${t} 0 0 1 ${i},${l} Z`.trim();
}
function Hn({ svgElement: t, x: n, y: e, offsetY: o = 0, element: r }) {
  if (!t || !r) return { top: 0, left: 0 };
  const s = t.createSVGPoint();
  s.x = n, s.y = e;
  const c = s.matrixTransform(t.getScreenCTM()), i = t.getBoundingClientRect(), l = r.getBoundingClientRect();
  let u = 0, a = 0;
  return c.x - l.width / 2 < i.left ? u = 0 : c.x + l.width > i.right ? u = -l.width : u = -l.width / 2, c.y - o - l.height < i.top ? a = o : a = -l.height - o, {
    top: c.y + a,
    left: c.x + u
  };
}
function Un({ svgElement: t, x: n, y: e, element: o, position: r }) {
  if (!t || !o) return { top: 0, left: 0 };
  const s = t.createSVGPoint();
  s.x = n, s.y = e;
  const c = s.matrixTransform(t.getScreenCTM()), { height: i, width: l } = o.getBoundingClientRect();
  let u = r === "right" ? 0 : -l, a = -(i / 2);
  return {
    top: c.y + a,
    left: c.x + u
  };
}
function _(t) {
  if (t === null || typeof t != "object")
    return t;
  if (t instanceof Date)
    return new Date(t.getTime());
  if (t instanceof RegExp)
    return new RegExp(t.source, t.flags);
  if (t instanceof Map) {
    const e = /* @__PURE__ */ new Map();
    for (const [o, r] of t.entries())
      e.set(o, _(r));
    return e;
  }
  if (t instanceof Set) {
    const e = /* @__PURE__ */ new Set();
    for (const o of t.values())
      e.add(_(o));
    return e;
  }
  if (Array.isArray(t))
    return t.map((e) => _(e));
  const n = {};
  for (const e in t)
    Object.prototype.hasOwnProperty.call(t, e) && (n[e] = _(t[e]));
  return n;
}
function Nt(t) {
  const n = [];
  let e = [];
  for (const o of t)
    !o || o.value == null || Number.isNaN(o.x) || Number.isNaN(o.y) ? (e.length && n.push(e), e = []) : e.push(o);
  return e.length && n.push(e), n;
}
function Gn(t, n) {
  const e = t.filter((c) => !!c);
  if (!e[0]) return [-10, -10, "", -10, -10].toString();
  const o = { x: e[0].x, y: n }, r = { x: e.at(-1).x, y: n }, s = [];
  return e.forEach((c) => {
    s.push(`${c.x},${c.y} `);
  }), [o.x, o.y, ...s, r.x, r.y].toString();
}
function vn(t, n) {
  if (!t[0]) return [-10, -10, "", -10, -10].toString();
  const e = Nt(t);
  return e.length ? e.map((o) => {
    const r = { x: o[0].x, y: n }, s = { x: o.at(-1).x, y: n }, c = [];
    return o.forEach((i) => {
      c.push(`${i.x},${i.y} `);
    }), [r.x, r.y, ...c, s.x, s.y].toString();
  }).join(";") : "";
}
function Ot(t) {
  const n = [];
  let e = [];
  for (const o of t)
    o.value == null || Number.isNaN(o.x) || Number.isNaN(o.y) ? (e.length > 1 && n.push(e), e = []) : e.push(o);
  return e.length > 1 && n.push(e), n;
}
function Xn(t) {
  let n = "", e = !1;
  const o = (r) => r.value != null && Number.isFinite(r.x) && Number.isFinite(r.y);
  for (let r = 0; r < t.length; r++) {
    const s = t[r];
    if (!o(s))
      continue;
    const c = `${A(s.x)},${A(s.y)}`;
    if (!e)
      n += c, e = !0;
    else {
      const i = t[r - 1], l = o(i) ? "L" : "M";
      n += `${l}${c}`;
    }
    n += " ";
  }
  return n.trim();
}
function jn(t) {
  const n = Ot(t);
  if (!n.length) return "";
  let e = "";
  for (const [o, r] of n.entries()) {
    if (r.length < 2) continue;
    const s = r.length - 1, c = [], i = [], l = [], u = [];
    for (let a = 0; a < s; a += 1)
      c[a] = r[a + 1].x - r[a].x, i[a] = r[a + 1].y - r[a].y, l[a] = i[a] / c[a];
    u[0] = l[0], u[s] = l[s - 1];
    for (let a = 1; a < s; a += 1)
      if (l[a - 1] * l[a] <= 0)
        u[a] = 0;
      else {
        const f = 2 * l[a - 1] * l[a] / (l[a - 1] + l[a]);
        u[a] = f;
      }
    e += `${o === 0 ? "" : "M"}${A(r[0].x)},${A(r[0].y)} `;
    for (let a = 0; a < s; a += 1) {
      const f = r[a].x, h = r[a].y, F = r[a + 1].x, d = r[a + 1].y, p = u[a], y = u[a + 1], x = f + (F - f) / 3, E = h + p * (F - f) / 3, C = F - (F - f) / 3, R = d - y * (F - f) / 3;
      e += `C${A(x)},${A(E)} ${A(C)},${A(R)} ${A(F)},${A(d)} `;
    }
  }
  return e.trim();
}
function Kn(t, n, e = !1, o = !0) {
  function r(c) {
    const i = [];
    let l = [];
    for (const u of c)
      !u || u.value == null || Number.isNaN(u.x) || Number.isNaN(u.y) ? (l.length > 1 && i.push(l), l = []) : l.push(u);
    return l.length > 1 && i.push(l), i;
  }
  return (e ? r(t) : [t]).map((c) => {
    if (c.length < 2) return "";
    const i = c.length - 1, l = [], u = [], a = [], f = [];
    for (let F = 0; F < i; F += 1)
      l[F] = c[F + 1].x - c[F].x, u[F] = c[F + 1].y - c[F].y, a[F] = u[F] / l[F];
    f[0] = a[0], f[i] = a[i - 1];
    for (let F = 1; F < i; F += 1)
      if (a[F - 1] * a[F] <= 0)
        f[F] = 0;
      else {
        const d = 2 * a[F - 1] * a[F] / (a[F - 1] + a[F]);
        f[F] = d;
      }
    let h = `M${c[0].x},${n}`;
    h += ` L${c[0].x},${c[0].y}`;
    for (let F = 0; F < i; F += 1) {
      const d = c[F].x, p = c[F].y, y = c[F + 1].x, x = c[F + 1].y, E = f[F], C = f[F + 1], R = d + (y - d) / 3, O = p + E * (y - d) / 3, L = y - (y - d) / 3, m = x - C * (y - d) / 3;
      h += ` C${R},${O} ${L},${m} ${y},${x}`;
    }
    return h += ` L${c[i].x},${n} ${o ? "Z" : ""}`, h;
  }).filter(Boolean);
}
function Wn(t) {
  return t.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
}
function wt(t) {
  return t && typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 0 ? null : t;
}
function at(t) {
  if (Array.isArray(t))
    return t.map(at);
  if (t && typeof t == "object" && !Array.isArray(t)) {
    const n = {};
    for (const e in t)
      Object.hasOwn(t, e) && (n[e] = at(t[e]));
    return wt(n);
  }
  return t;
}
function Vn(t) {
  return 1 - Math.pow(1 - t, 3);
}
function _n({ values: t, config: n = {} }) {
  const {
    keepInvalid: e = !0,
    convertInvalidToZero: o = !1
  } = n, r = [];
  let s = 0, c = 0;
  function i(u) {
    return typeof u != "number" || !Number.isFinite(u);
  }
  function l(u) {
    s += u, c += 1, r.push(s / c);
  }
  for (const u of t)
    i(u) ? o && e ? l(0) : !o && e && r.push(u) : l(u);
  return r;
}
function zn({ values: t, config: n = {} }) {
  const {
    keepInvalid: e = !0,
    convertInvalidToZero: o = !1
  } = n, r = [], s = [];
  function c(l) {
    return typeof l != "number" || !Number.isFinite(l);
  }
  function i(l) {
    s.push(l), s.sort((f, h) => f - h);
    const u = s.length, a = u >> 1;
    u % 2 === 1 ? r.push(s[a]) : r.push((s[a - 1] + s[a]) / 2);
  }
  for (const l of t)
    c(l) ? o && e ? i(0) : !o && e && r.push(l) : i(l);
  return r;
}
function Zn({
  el: t,
  bounds: n,
  currentFontSize: e,
  minFontSize: o = 6,
  attempts: r = 200,
  padding: s = 1
}) {
  if (!t || !e) return 0;
  let c = e;
  t.setAttribute("font-size", c);
  const { x: i, y: l, width: u, height: a } = n, f = i + s, h = l + s, F = i + u - s, d = l + a - s;
  let p = t.getBBox();
  if (p.x >= f + s && p.y >= h + s && p.x + p.width <= F - s && p.y + p.height <= d - s)
    return c;
  let y = r;
  for (; y-- > 0 && c > o && (c--, t.setAttribute("font-size", c), p = t.getBBox(), !(p.x >= f + s && p.y >= h + s && p.x + p.width <= F - s && p.y + p.height <= d - s)); )
    ;
  return c < o && (c = 0, t.setAttribute("font-size", c)), c;
}
function Qn({
  value: t,
  maxDecimals: n = 4,
  fallbackFormatter: e,
  removeTrailingZero: o = !0
}) {
  if (t === 0)
    return "0";
  const r = Math.abs(t);
  if (r >= 1 && typeof e == "function") {
    const i = e(t);
    return String(i);
  }
  let s;
  if (r < 1) {
    const i = Math.floor(Math.log10(r));
    s = Math.min(Math.max(1 - i, 1), n);
  } else
    s = n;
  let c = t.toFixed(s);
  return o && (c = c.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, "")), c;
}
function qn(t) {
  const n = [];
  for (let e = 0; e < t; e += 1)
    n.push(e === 0 ? 0 : e === 1 ? 1 : n[e - 1] + n[e - 2]);
  return n;
}
function Jn(t, n = 20) {
  t = t.replace(/[\r\n]+/g, " ");
  const e = t.split(" ");
  let o = "", r = "";
  for (let s of e)
    (o + (o ? " " : "") + s).length <= n ? o += (o ? " " : "") + s : (o && (r += (r ? `
` : "") + o), o = s);
  return o && (r += (r ? `
` : "") + o), r;
}
function te(t) {
  const {
    lineA: n,
    lineB: e,
    colorLineA: o,
    // fill when A is above
    colorLineB: r,
    // fill when B is above
    smoothA: s = !1,
    smoothB: c = !1,
    sampleStepPx: i = 2,
    cutNullValues: l = !0,
    // break across gaps
    merge: u = !0
    // merge into large polygons
  } = t || {};
  if (!Array.isArray(n) || !Array.isArray(e) || !n.length || !e.length)
    return [];
  const a = (m) => Number.isFinite(m);
  function f(m) {
    if (!l) return [m.filter((D) => D && a(D.x) && a(D.y))];
    const $ = [];
    let M = [];
    for (const D of m)
      D && a(D.x) && a(D.y) && D.value != null ? M.push({ x: D.x, y: D.y }) : (M.length > 1 && $.push(M), M = []);
    return M.length > 1 && $.push(M), $;
  }
  function h(m) {
    const $ = m.length - 1, M = new Array($), D = new Array($), g = new Array($), I = new Array(m.length);
    for (let b = 0; b < $; b += 1)
      M[b] = m[b + 1].x - m[b].x, D[b] = m[b + 1].y - m[b].y, g[b] = D[b] / M[b];
    I[0] = g[0], I[$] = g[$ - 1];
    for (let b = 1; b < $; b += 1)
      g[b - 1] * g[b] <= 0 ? I[b] = 0 : I[b] = 2 * g[b - 1] * g[b] / (g[b - 1] + g[b]);
    return I;
  }
  function F(m, $, M, D, g) {
    const I = m.x, b = $.x, w = m.y, S = $.y, T = b - I;
    if (T === 0) return w;
    const P = (g - I) / T, N = P * P, Y = N * P, H = 2 * Y - 3 * N + 1, B = Y - 2 * N + P, k = -2 * Y + 3 * N, U = Y - N;
    return H * w + B * (M * T) + k * S + U * (D * T);
  }
  function d(m, $) {
    const M = f(m);
    if (!M.length) return [];
    let D = 1 / 0, g = -1 / 0;
    for (const S of M)
      D = Math.min(D, S[0].x), g = Math.max(g, S[S.length - 1].x);
    if (!a(D) || !a(g) || g <= D) return [];
    const I = Math.max(1, i), b = [];
    for (let S = D; S <= g; S += I) b.push(S);
    b[b.length - 1] < g && b.push(g);
    const w = [];
    for (const S of b) {
      let T = null, P = !1;
      for (const N of M) {
        const Y = N.length - 1;
        if (!(S < N[0].x - 1e-9 || S > N[Y].x + 1e-9)) {
          for (let H = 0; H < Y; H += 1) {
            const B = N[H], k = N[H + 1];
            if (!(S + 1e-9 < B.x || S - 1e-9 > k.x)) {
              if ($) {
                const U = N.__tangents || (N.__tangents = h(N));
                T = F(B, k, U[H], U[H + 1], S);
              } else {
                const U = (S - B.x) / (k.x - B.x || 1);
                T = B.y + U * (k.y - B.y);
              }
              P = !0;
              break;
            }
          }
          if (P) break;
        }
      }
      T == null ? w.push({ x: S, y: null, hole: !0 }) : w.push({ x: S, y: T, hole: !1 });
    }
    return w;
  }
  function p(m, $, M) {
    return m + M * ($ - m);
  }
  function y(m, $) {
    const M = [], D = [], g = Math.min(m.length, $.length);
    for (let I = 0; I < g - 1; I += 1) {
      const b = m[I], w = m[I + 1], S = $[I], T = $[I + 1];
      if (M.push(b), D.push(S), b.hole || w.hole || S.hole || T.hole || b.y == null || w.y == null || S.y == null || T.y == null)
        continue;
      const P = b.y - S.y, N = w.y - T.y;
      if (P > 0 && N < 0 || P < 0 && N > 0) {
        const Y = P / (P - N), H = p(b.x, w.x, Y), B = p(b.y, w.y, Y), k = { x: H, y: B, hole: !1 }, U = { x: H, y: B, hole: !1 };
        M.push(k), D.push(U);
      }
    }
    return g > 0 && (M.push(m[g - 1]), D.push($[g - 1])), { A: M, B: D };
  }
  function x(m, $) {
    const M = [], D = Math.min(m.length, $.length);
    for (let g = 0; g < D - 1; g += 1) {
      const I = m[g], b = m[g + 1], w = $[g], S = $[g + 1];
      if (I.hole || b.hole || w.hole || S.hole || I.y == null || b.y == null || w.y == null || S.y == null) continue;
      const T = I.y - w.y, P = b.y - S.y, N = T <= 0 ? I : w, Y = P <= 0 ? b : S, H = P <= 0 ? S : b, B = T <= 0 ? w : I, k = T <= 0 ? o : r, U = [
        `M${N.x},${N.y}`,
        `L${Y.x},${Y.y}`,
        `L${H.x},${H.y}`,
        `L${B.x},${B.y}`,
        "Z"
      ].join(" ");
      M.push({ d: U, color: k });
    }
    return M;
  }
  function E(m, $) {
    const M = [], D = Math.min(m.length, $.length);
    if (D < 2) return M;
    let g = 0;
    for (; g < D - 1; ) {
      for (; g < D - 1; ) {
        const B = m[g], k = $[g], U = m[g + 1], j = $[g + 1];
        if (!B.hole && !k.hole && !U.hole && !j.hole && B.y != null && k.y != null && U.y != null && j.y != null) break;
        g += 1;
      }
      if (g >= D - 1) break;
      const I = g, b = Math.sign($[g].y - m[g].y || 0) || 1;
      for (g += 1; g < D - 1; ) {
        const B = m[g], k = $[g], U = m[g + 1], j = $[g + 1];
        if (B.hole || k.hole || U.hole || j.hole || B.y == null || k.y == null || U.y == null || j.y == null || (Math.sign(k.y - B.y || 0) || 1) !== b) break;
        g += 1;
      }
      const w = g + 0, S = b >= 0 ? m : $, T = b >= 0 ? $ : m, P = b >= 0 ? o : r, N = [];
      for (let B = I; B <= w; B += 1)
        N.push(`${S[B].x},${S[B].y}`);
      const Y = [];
      for (let B = w; B >= I; B -= 1)
        Y.push(`${T[B].x},${T[B].y}`);
      const H = `M${N[0]} L${N.slice(1).join(" L")} L${Y.join(" L")} Z`;
      M.push({ d: H, color: P });
    }
    return M;
  }
  const C = d(n, s), R = d(e, c), { A: O, B: L } = y(C, R);
  return u ? E(O, L) : x(O, L);
}
function ne(t, n, e = {}) {
  const r = { ...{ bubbles: !0, cancelable: !0, composed: !0 }, ...e }, s = /* @__PURE__ */ new Set([
    "click",
    "mousedown",
    "mouseup",
    "mousemove",
    "mouseover",
    "mouseout",
    "mouseenter",
    "mouseleave",
    "dblclick",
    "contextmenu"
  ]), c = /* @__PURE__ */ new Set([
    "keydown",
    "keyup",
    "keypress"
  ]);
  let i;
  if (s.has(n))
    i = new MouseEvent(n, r);
  else if (c.has(n))
    i = new KeyboardEvent(n, r);
  else if (n === "input")
    try {
      i = new InputEvent(n, r);
    } catch {
      i = new Event(n, r);
    }
  else n.startsWith("custom:") ? i = new CustomEvent(n, { ...r, detail: r.detail }) : i = new Event(n, r);
  return t.dispatchEvent(i), i;
}
function ee(t, { delta: n = 1, delay: e = 20, disableTransitions: o = !0 } = {}) {
  if (!t || !(t instanceof HTMLElement)) return;
  const r = t.style, s = {
    width: r.width,
    height: r.height,
    transition: r.transition
  }, c = t.getBoundingClientRect(), i = c.width, l = c.height;
  o && (r.transition = "none");
  const u = (a) => /%|em|rem/.test(a);
  r.width = s.width && u(s.width) ? `calc(${s.width} + ${n}px)` : `${Math.max(0, i + n)}px`, r.height = s.height && u(s.height) ? `calc(${s.height} + ${n}px)` : `${Math.max(0, l + n)}px`, t.offsetWidth, setTimeout(() => {
    r.width = s.width, r.height = s.height, t.offsetWidth, requestAnimationFrame(() => {
      o && (r.transition = s.transition);
    });
  }, e);
}
function Tt(t) {
  let n = null, e = null;
  return (...o) => {
    const r = JSON.stringify(o);
    return r === n || (n = r, e = t(...o)), e;
  };
}
const re = Tt((t, n, e, o, r, s, c, i) => {
  if (t)
    return o.length <= 2 ? o.map((E, C) => ({ text: E, absoluteIndex: C })) : o.map((E, C) => ({ text: C === 0 || C === o.length - 1 || c != null && C === c ? E : "", absoluteIndex: C }));
  if (!n)
    return o.map((x, E) => ({ text: x, absoluteIndex: E }));
  const l = Math.max(1, e || 1);
  if (i <= l)
    return o.map((x, E) => ({ text: x, absoluteIndex: E }));
  const u = [];
  for (let x = 0; x < o.length; x += 1) {
    const E = o[x] ?? "";
    if (!E) continue;
    const C = s + x - 1 >= 0 ? r[s + x - 1] ?? "" : null;
    E !== C && u.push(x);
  }
  if (!u.length)
    return o.map((x, E) => ({ text: "", absoluteIndex: E }));
  const a = u.length, f = l, h = Math.max(2, Math.min(f - 3, a)), F = Math.min(a, f + 3);
  let d = Math.min(f, a), p = 1 / 0;
  for (let x = h; x <= F; x += 1) {
    const E = (a - 1) % (x - 1), C = Math.abs(x - f), R = E * 10 + C;
    R < p && (p = R, d = x);
  }
  const y = /* @__PURE__ */ new Set();
  if (d <= 1)
    y.add(u[Math.round((a - 1) / 2)]);
  else {
    const x = (a - 1) / (d - 1);
    for (let E = 0; E < d; E += 1)
      y.add(u[Math.round(E * x)]);
  }
  return o.map((x, E) => ({
    text: y.has(E) ? x : "",
    absoluteIndex: E
  }));
});
function se(t) {
  return String(t).replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
}
function oe(t) {
  return String(t).replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
}
function ie(t) {
  if (!t || typeof t != "string")
    return null;
  const n = document.createElementNS(J, "svg");
  n.setAttribute("xmlns", J);
  const e = document.createElementNS(J, "path");
  e.setAttribute("d", t), n.appendChild(e);
  const o = e.getTotalLength(), r = e.getPointAtLength(o / 2);
  return { x: r.x, y: r.y };
}
function ce(t, n = "(", e = ")") {
  return `${n}${t}${e}`;
}
export {
  mn as $,
  Zt as A,
  Xn as B,
  zt as C,
  ne as D,
  lt as E,
  Hn as F,
  Fn as G,
  Mn as H,
  $n as I,
  Qn as J,
  _n as K,
  zn as L,
  Gt as M,
  ln as N,
  un as O,
  Ht as P,
  Ut as Q,
  Pn as R,
  re as S,
  Dn as T,
  A as U,
  Kn as V,
  vn as W,
  J as X,
  Gn as Y,
  te as Z,
  gn as _,
  In as a,
  Un as a0,
  Ln as a1,
  Rn as a2,
  Yt as a3,
  tn as a4,
  V as a5,
  W as a6,
  Nn as a7,
  nn as a8,
  en as a9,
  ie as aA,
  at as aa,
  An as ab,
  Jt as ac,
  Yn as ad,
  _ as ae,
  rn as af,
  Vn as ag,
  Sn as ah,
  Tn as ai,
  Kt as aj,
  Qt as ak,
  xn as al,
  fn as am,
  kn as an,
  _t as ao,
  qn as ap,
  Bn as aq,
  bn as ar,
  Wn as as,
  Jn as at,
  wn as au,
  Dt as av,
  oe as aw,
  se as ax,
  ee as ay,
  ot as az,
  jt as b,
  qt as c,
  hn as d,
  Xt as e,
  Zn as f,
  En as g,
  vt as h,
  v as i,
  st as j,
  Cn as k,
  yn as l,
  ut as m,
  Vt as n,
  pn as o,
  ce as p,
  cn as q,
  sn as r,
  On as s,
  xt as t,
  an as u,
  on as v,
  q as w,
  Wt as x,
  dn as y,
  jn as z
};