import { computed as p, ref as i, watch as Ve, onMounted as Ue, onBeforeUnmount as Ee, openBlock as s, createElementBlock as n, normalizeClass as z, normalizeStyle as J, createBlock as O, createCommentVNode as f, unref as h, createSlots as Be, withCtx as y, renderSlot as m, normalizeProps as B, guardReactiveProps as D, createVNode as K, createElementVNode as w, Fragment as $, renderList as x, toDisplayString as R, createTextVNode as be, nextTick as De } from "vue";
import { u as Ge, c as We, t as Xe, a as Ye, p as P, o as je, e as S, b as qe, g as ke, d as Ce, O as _e, v as He, i as we, f as M, X as Je, s as Q, w as Ke, P as $e, x as Qe, y as Ze, q as et, r as tt } from "./index-DK7qqHGP.js";
import { t as at, u as ot } from "./useResponsive-NZB-WLRF.js";
import { _ as lt } from "./Title-Cxlu3Etv.js";
import { u as rt, U as st } from "./usePrinter-Cza87yNE.js";
import { _ as nt } from "./Tooltip-Bt9pHzBM.js";
import ut from "./vue-ui-sparkbar-45yFHmFN.js";
import { L as it } from "./Legend-D4PxDNTf.js";
import { D as ct } from "./DataTable-B9SSwFM2.js";
import dt from "./vue-ui-skeleton-CQnYuosp.js";
import vt from "./vue-ui-accordion-5C4CP3gA.js";
import { u as xe } from "./useNestedProp-0nRX_rTi.js";
import { _ as pt } from "./PackageVersion-I1_4jcn_.js";
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const gt = ["id"], ft = ["xmlns", "viewBox"], yt = ["id"], mt = ["stop-color"], bt = ["stop-color"], kt = { key: 0 }, Ct = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], _t = { key: 0 }, wt = ["d", "stroke", "stroke-width"], $t = ["d", "stroke", "stroke-width"], xt = { key: 1 }, Pt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], Tt = ["points", "stroke", "stroke-width"], Nt = ["points", "stroke", "stroke-width", "fill"], Ot = { key: 2 }, St = ["cx", "cy", "fill", "r", "stroke"], Ft = {
  key: 3,
  class: "vue-data-ui-watermark"
}, At = ["onClick"], It = {
  key: 0,
  style: { "max-width": "200px", margin: "0 auto" }
}, Lt = {
  __name: "vue-ui-radar",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  emits: ["selectLegend"],
  setup(Pe, { expose: Te, emit: Ne }) {
    const v = Pe, { vue_ui_radar: Oe } = Ge(), F = p(() => !!v.dataset && Object.keys(v.dataset).length), _ = i(We()), Se = i(null), G = i(!1), W = i(""), Z = i(0), A = i(null), ee = i(null), te = i(null), ae = i(0), oe = i(0), le = i(0), e = p({
      get: () => re(),
      set: (t) => t
    });
    function re() {
      const t = xe({
        userConfig: v.config,
        defaultConfig: Oe
      });
      return t.theme ? {
        ...xe({
          userConfig: Xe.vue_ui_radar[t.theme] || v.config,
          defaultConfig: t
        }),
        customPalette: Ye[t.theme] || P
      } : t;
    }
    Ve(() => v.config, (t) => {
      e.value = re(), se(), ae.value += 1, oe.value += 1, le.value += 1;
    }, { deep: !0 });
    const V = i(null);
    function se() {
      if (je(v.dataset) && S({
        componentName: "VueUiRadar",
        type: "dataset"
      }), e.value.responsive) {
        const t = at(() => {
          const { width: a, height: o } = ot({
            chart: A.value,
            title: e.value.style.chart.title.text ? ee.value : null,
            legend: e.value.style.chart.legend.show ? te.value : null
          });
          u.value.width = a, u.value.height = o;
        });
        V.value = new ResizeObserver(t), V.value.observe(A.value.parentNode);
      }
    }
    Ue(() => {
      se();
    }), Ee(() => {
      V.value && V.value.disconnect();
    });
    const { isPrinting: ne, isImaging: ue, generatePdf: ie, generateImage: ce } = rt({
      elementId: `vue-ui-radar_${_.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-radar"
    }), de = p(() => qe(e.value.customPalette)), k = i({
      dataLabels: {
        show: e.value.style.chart.layout.labels.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), Fe = p(() => ({
      style: {
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        animation: {
          show: e.value.style.chart.tooltip.animation.show,
          animationFrames: e.value.style.chart.tooltip.animation.animationFrames
        },
        labels: {
          fontSize: e.value.style.chart.tooltip.fontSize,
          name: {
            color: e.value.style.chart.tooltip.color
          }
        },
        gutter: {
          backgroundColor: "#CCCCCC",
          opacity: 30
        }
      }
    })), u = i({
      height: 312,
      width: 512
    }), c = i([]), I = i(null), T = i(!1);
    function ve(t) {
      T.value = !0, c.value.includes(t) ? (I.value = t, c.value = c.value.filter((a) => a !== t), setTimeout(() => {
        T.value = !1, I.value = null;
      }, 500)) : (c.value.push(t), setTimeout(() => {
        T.value = !1;
      }, 500)), Ne("selectLegend", N.value.filter((a, o) => !c.value.includes(o)).map((a) => ({
        name: a.name,
        color: a.color,
        proportion: a.totalProportion
      })));
    }
    function Ae() {
      return N.value.map((t) => ({
        name: t.name,
        color: t.color,
        proportion: t.totalProportion
      }));
    }
    const g = p(() => [null, void 0].includes(v.dataset.categories) ? (S({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "categories ({ name: string; prefix?: string; suffix?: string}[])"
    }), []) : (v.dataset.categories.length === 0 ? S({
      componentName: "VueUiRadar",
      type: "datasetAttributeEmpty",
      property: "categories"
    }) : v.dataset.categories.forEach((t, a) => {
      ke({
        datasetObject: t,
        requiredAttributes: ["name"]
      }).forEach((o) => {
        S({
          componentName: "VueUiRadar",
          type: "datasetAttribute",
          property: `category.${o} at index ${a}`,
          index: a
        });
      });
    }), [null, void 0].includes(v.dataset.series) ? S({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "series ({ name: string; values: number[]; color?: string; target: number}[])"
    }) : v.dataset.series.forEach((t, a) => {
      ke({
        datasetObject: t,
        requiredAttributes: ["name", "values", "target"]
      }).forEach((o) => {
        S({
          componentName: "VueUiRadar",
          type: "datasetSerieAttribute",
          key: "series",
          property: o,
          index: a
        });
      });
    }), v.dataset.categories.map((t, a) => ({
      name: t.name,
      categoryId: `radar_category_${_.value}_${a}`,
      color: Ce(t.color) || de.value[a] || P[a] || P[a % P.length],
      prefix: t.prefix ?? "",
      suffix: t.suffix ?? ""
    })))), b = p(() => F.value ? v.dataset.series.map((t, a) => ({
      ...t,
      color: Ce(t.color) || de.value[a] || P[a] || P[a % P.length],
      serieId: `radar_serie_${_.value}_${a}`,
      formatter: t.formatter || null
    })) : []), pe = p(() => Math.max(...b.value.flatMap((t) => t.values))), he = p(() => b.value.length), X = p(() => Math.min(u.value.width, u.value.height) / 3), ge = p(() => _e({
      plot: { x: u.value.width / 2, y: u.value.height / 2 },
      radius: X.value,
      sides: he.value,
      rotation: 0
    })), Ie = p(() => {
      const t = [];
      for (let a = 0; a < X.value; a += X.value / e.value.style.chart.layout.grid.graduations)
        t.push(a);
      return t;
    }), C = p(() => ge.value.coordinates.map((t, a) => {
      const o = b.value[a].values.map((l) => Le({
        centerX: u.value.width / 2,
        centerY: u.value.height / 2,
        apexX: t.x,
        apexY: t.y,
        proportion: l / (b.value[a].target || pe.value)
      }));
      return {
        ...t,
        ...b.value[a],
        plots: o
      };
    }));
    function Y({ x: t, y: a }) {
      let o = "middle";
      return t = Math.round(t), a = Math.round(a), t > u.value.width / 2 && (t += 12, o = "start"), t < u.value.width / 2 && (t -= 12, o = "end"), a > u.value.height / 2 && (a += 20), a < u.value.height / 2 && (a -= 12), a === u.value.height / 2 && (a += 4), { x: t, y: a, anchor: o };
    }
    function Le({ centerX: t, centerY: a, apexX: o, apexY: l, proportion: r }) {
      return {
        x: t + (o - t) * r,
        y: a + (l - a) * r
      };
    }
    const N = p(() => {
      const t = b.value.map((a, o) => a.values.map((l) => l / (a.target || pe.value)));
      return g.value.map((a, o) => ({
        ...a,
        totalProportion: He(t.map((l) => l[o]).reduce((l, r) => l + r, 0) / b.value.length),
        shape: "circle",
        opacity: c.value.includes(o) ? 0.5 : 1,
        segregate: () => ve(o),
        isSegregated: c.value.includes(o)
      }));
    }), ze = p(() => ({
      cy: "radar-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), U = p(() => {
      const t = [
        { name: e.value.translations.datapoint, color: "" },
        { name: e.value.translations.target, color: "" },
        ...N.value
      ], a = v.dataset.series.map((l) => [
        l.name,
        we(
          l.formatter,
          l.target,
          M({
            p: l.prefix,
            v: l.target,
            s: l.suffix,
            r: e.value.table.td.roundingValue
          })
        ),
        ...l.values.map((r, d) => `${we(
          l.formatter,
          r,
          M({ p: g.value[d].prefix, v: r, s: g.value[d].suffix, r: e.value.table.td.roundingValue })
        )} (${isNaN(r / l.target) ? "" : M({
          v: r / l.target * 100,
          s: "%",
          r: e.value.table.td.roundingPercentage
        })})`)
      ]), o = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return { head: t, body: a, config: o, colNames: t };
    }), E = i(null), j = i([]), q = i(null);
    function Re(t, a) {
      j.value = [], E.value = a, G.value = !0;
      let o = "";
      q.value = {
        datapoint: t,
        seriesIndex: a,
        series: {
          categories: g.value,
          datapoints: b.value,
          radar: C.value
        },
        config: e.value
      };
      const l = e.value.style.chart.tooltip.customFormat;
      if (Qe(l) && Ze(() => l({
        seriesIndex: a,
        datapoint: t,
        series: { categories: g.value, datapoints: b.value, radar: C.value },
        config: e.value
      })))
        W.value = l({
          seriesIndex: a,
          datapoint: t,
          series: { categories: g.value, datapoints: b.value, radar: C.value },
          config: e.value
        });
      else {
        o += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`;
        for (let r = 0; r < t.values.length; r += 1)
          c.value.includes(r) || j.value.push({
            name: g.value[r].name,
            value: t.values[r] / t.target * 100,
            color: g.value[r].color,
            suffix: "%)",
            prefix: `${M({ p: g.value[r].prefix ?? "", v: t.values[r], s: g.value[r].suffix ?? "", r: e.value.style.chart.tooltip.roundingValue })} (`,
            rounding: e.value.style.chart.tooltip.roundingPercentage,
            formatter: t.formatter
          });
        W.value = o;
      }
    }
    function fe() {
      De(() => {
        const t = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], a = [[""], [e.value.translations.target], ...N.value.flatMap((d) => [[d.name], ["%"]])], o = v.dataset.series.map((d, zt) => [d.name, d.target, ...d.values.flatMap((H) => [
          H,
          isNaN(H / d.target) ? "" : H / d.target * 100
        ])]), l = t.concat([a]).concat(o), r = et(l);
        tt({ csvContent: r, title: e.value.style.chart.title.text || "vue-ui-radar" });
      });
    }
    const L = i(!1);
    function Me(t) {
      L.value = t, Z.value += 1;
    }
    function ye() {
      k.value.showTable = !k.value.showTable;
    }
    function me() {
      k.value.showTooltip = !k.value.showTooltip;
    }
    return Te({
      getData: Ae,
      generatePdf: ie,
      generateCsv: fe,
      generateImage: ce,
      toggleTable: ye,
      toggleTooltip: me
    }), (t, a) => (s(), n("div", {
      class: z(`vue-ui-radar ${L.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      ref_key: "radarChart",
      ref: A,
      id: `vue-ui-radar_${_.value}`,
      style: J(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor}`)
    }, [
      e.value.style.chart.title.text ? (s(), n("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: ee,
        style: "width:100%;background:transparent;padding-bottom:12px"
      }, [
        (s(), O(lt, {
          key: `title_${ae.value}`,
          config: {
            title: {
              cy: "radar-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "radar-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : f("", !0),
      e.value.userOptions.show && F.value ? (s(), O(st, {
        ref_key: "details",
        ref: Se,
        key: `user_options_${Z.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: h(ue),
        isPrinting: h(ne),
        uid: _.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: L.value,
        isTooltip: k.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        position: e.value.userOptions.position,
        onToggleFullscreen: Me,
        onGeneratePdf: h(ie),
        onGenerateCsv: fe,
        onGenerateImage: h(ce),
        onToggleTable: ye,
        onToggleTooltip: me
      }, Be({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: y(() => [
            m(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: y(() => [
            m(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: y(() => [
            m(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: y(() => [
            m(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: y(() => [
            m(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: y(({ toggleFullscreen: o, isFullscreen: l }) => [
            m(t.$slots, "optionFullscreen", B(D({ toggleFullscreen: o, isFullscreen: l })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : f("", !0),
      F.value ? (s(), n("svg", {
        key: 2,
        xmlns: h(Je),
        class: z({ "vue-data-ui-fullscreen--on": L.value, "vue-data-ui-fulscreen--off": !L.value }),
        viewBox: `0 0 ${u.value.width <= 0 ? 10 : u.value.width} ${u.value.height <= 0 ? 10 : u.value.height}`,
        style: J(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        K(pt),
        w("defs", null, [
          (s(!0), n($, null, x(g.value, (o, l) => (s(), n("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `radar_gradient_${_.value}_${l}`
          }, [
            w("stop", {
              offset: "0%",
              "stop-color": h(Q)(h(Ke)(o.color, 0.05), e.value.style.chart.layout.dataPolygon.opacity)
            }, null, 8, mt),
            w("stop", {
              offset: "100%",
              "stop-color": h(Q)(o.color, e.value.style.chart.layout.dataPolygon.opacity)
            }, null, 8, bt)
          ], 8, yt))), 256))
        ]),
        e.value.style.chart.layout.grid.show ? (s(), n("g", kt, [
          (s(!0), n($, null, x(C.value, (o) => (s(), n("line", {
            x1: u.value.width / 2,
            y1: u.value.height / 2,
            x2: o.x,
            y2: o.y,
            stroke: e.value.style.chart.layout.grid.stroke,
            "stroke-width": e.value.style.chart.layout.grid.strokeWidth
          }, null, 8, Ct))), 256)),
          e.value.style.chart.layout.grid.graduations > 0 ? (s(), n("g", _t, [
            (s(!0), n($, null, x(Ie.value, (o) => (s(), n("path", {
              d: h(_e)({
                plot: { x: u.value.width / 2, y: u.value.height / 2 },
                radius: o,
                sides: he.value,
                rotation: 0
              }).path,
              fill: "none",
              stroke: e.value.style.chart.layout.grid.stroke,
              "stroke-width": e.value.style.chart.layout.grid.strokeWidth
            }, null, 8, wt))), 256))
          ])) : f("", !0)
        ])) : f("", !0),
        w("path", {
          d: ge.value.path,
          fill: "none",
          stroke: e.value.style.chart.layout.outerPolygon.stroke,
          "stroke-width": e.value.style.chart.layout.outerPolygon.strokeWidth,
          "stroke-linejoin": "round",
          "stroke-linecap": "round"
        }, null, 8, $t),
        e.value.style.chart.layout.labels.dataLabels.show ? (s(), n("g", xt, [
          (s(!0), n($, null, x(C.value, (o, l) => (s(), n("text", {
            x: Y(o).x,
            y: Y(o).y,
            "text-anchor": Y(o).anchor,
            "font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.labels.dataLabels.color,
            onMouseenter: (r) => Re(o, l),
            onMouseleave: a[0] || (a[0] = (r) => {
              G.value = !1, E.value = null;
            })
          }, R(o.name), 41, Pt))), 256))
        ])) : f("", !0),
        (s(!0), n($, null, x(g.value, (o, l) => (s(), n("g", null, [
          w("g", null, [
            e.value.useCssAnimation || !e.value.useCssAnimation && !c.value.includes(l) ? (s(), n("polygon", {
              key: 0,
              "data-cy-radar-path": "",
              points: h($e)(C.value.map((r) => r.plots[l]), !1, !0),
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth + 1,
              fill: "none",
              class: z({ "animated-out": c.value.includes(l) && e.value.useCssAnimation, "animated-in": T.value && I.value === l && e.value.useCssAnimation })
            }, null, 10, Tt)) : f("", !0),
            e.value.useCssAnimation || !e.value.useCssAnimation && !c.value.includes(l) ? (s(), n("polygon", {
              key: 1,
              "data-cy-radar-path": "",
              points: h($e)(C.value.map((r) => r.plots[l]), !1, !0),
              stroke: o.color,
              "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth,
              fill: e.value.style.chart.layout.dataPolygon.transparent ? "transparent" : e.value.style.chart.layout.dataPolygon.useGradient ? `url(#radar_gradient_${_.value}_${l})` : h(Q)(o.color, e.value.style.chart.layout.dataPolygon.opacity),
              class: z({ "animated-out": c.value.includes(l) && e.value.useCssAnimation, "animated-in": T.value && I.value === l && e.value.useCssAnimation })
            }, null, 10, Nt)) : f("", !0)
          ])
        ]))), 256)),
        e.value.style.chart.layout.plots.show ? (s(), n("g", Ot, [
          (s(!0), n($, null, x(C.value, (o, l) => (s(), n("g", null, [
            (s(!0), n($, null, x(o.plots, (r, d) => (s(), n("circle", {
              cx: r.x,
              cy: r.y,
              fill: c.value.includes(d) ? "transparent" : g.value[d].color,
              r: E.value !== null && E.value === l ? e.value.style.chart.layout.plots.radius * 1.6 : e.value.style.chart.layout.plots.radius,
              stroke: c.value.includes(d) ? "transparent" : e.value.style.chart.backgroundColor,
              "stroke-width": 0.5,
              class: z({ "animated-out": c.value.includes(d) && e.value.useCssAnimation, "animated-in": T.value && I.value === d && e.value.useCssAnimation })
            }, null, 10, St))), 256))
          ]))), 256))
        ])) : f("", !0),
        m(t.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, ft)) : f("", !0),
      t.$slots.watermark ? (s(), n("div", Ft, [
        m(t.$slots, "watermark", B(D({ isPrinting: h(ne) || h(ue) })), void 0, !0)
      ])) : f("", !0),
      F.value ? f("", !0) : (s(), O(dt, {
        key: 4,
        config: {
          type: "radar",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            radar: {
              grid: {
                color: e.value.style.chart.layout.outerPolygon.stroke
              },
              shapes: {
                color: e.value.style.chart.layout.outerPolygon.stroke
              }
            }
          }
        }
      }, null, 8, ["config"])),
      w("div", {
        ref_key: "chartLegend",
        ref: te
      }, [
        e.value.style.chart.legend.show ? (s(), O(it, {
          key: `legend_${le.value}`,
          legendSet: N.value,
          config: ze.value,
          onClickMarker: a[1] || (a[1] = ({ i: o }) => ve(o))
        }, {
          item: y(({ legend: o, index: l }) => [
            w("div", {
              "data-cy-legend-item": "",
              onClick: (r) => o.segregate(),
              style: J(`opacity:${c.value.includes(l) ? 0.5 : 1}`)
            }, R(o.name) + ": " + R(h(M)({
              v: o.totalProportion * 100,
              s: "%",
              r: e.value.style.chart.legend.roundingPercentage
            })), 13, At)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : m(t.$slots, "legend", {
          key: 1,
          legend: N.value
        }, void 0, !0)
      ], 512),
      K(nt, {
        show: k.value.showTooltip && G.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        fontSize: e.value.style.chart.tooltip.fontSize,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: A.value,
        content: W.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": y(() => [
          m(t.$slots, "tooltip-before", B(D({ ...q.value })), void 0, !0)
        ]),
        "tooltip-after": y(() => [
          ["function"].includes(typeof e.value.style.chart.tooltip.customFormat) ? f("", !0) : (s(), n("div", It, [
            K(ut, {
              dataset: j.value,
              config: Fe.value,
              backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity
            }, null, 8, ["dataset", "config", "backgroundOpacity"])
          ])),
          m(t.$slots, "tooltip-after", B(D({ ...q.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "fontSize", "position", "offsetY", "parent", "content", "isCustom"]),
      F.value ? (s(), O(vt, {
        key: 5,
        hideDetails: "",
        config: {
          open: k.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: y(() => [
          (s(), O(ct, {
            key: `table_${oe.value}`,
            colNames: U.value.colNames,
            head: U.value.head,
            body: U.value.body,
            config: U.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: a[2] || (a[2] = (o) => k.value.showTable = !1)
          }, {
            th: y(({ th: o }) => [
              be(R(o.name), 1)
            ]),
            td: y(({ td: o }) => [
              be(R(o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : f("", !0)
    ], 14, gt));
  }
}, Jt = /* @__PURE__ */ ht(Lt, [["__scopeId", "data-v-ed1fdeb2"]]);
export {
  Jt as default
};
