import { computed as v, ref as i, onMounted as Se, onBeforeUnmount as Le, openBlock as s, createElementBlock as n, normalizeClass as L, normalizeStyle as E, createVNode as B, createCommentVNode as f, createBlock as D, unref as h, createSlots as ze, withCtx as y, renderSlot as m, normalizeProps as G, guardReactiveProps as W, createElementVNode as w, Fragment as $, renderList as x, toDisplayString as z, createTextVNode as pe, nextTick as Re } from "vue";
import { u as Me, c as Ve, t as Ue, a as Ee, p as P, o as Be, e as F, b as De, g as ge, d as fe, M as ye, s as Ge, i as me, f as R, X as We, v as Xe, w as Q, N as be, x as Ye, y as je, q as qe, r as He } from "./index-CguVaFlt.js";
import { t as Je, u as Ke } from "./useResponsive-NZB-WLRF.js";
import { _ as Qe } from "./Title-DbTGPg4G.js";
import { u as Ze, U as et } from "./usePrinter-ClsMRVJG.js";
import { _ as tt } from "./Tooltip-u79R5W5y.js";
import at from "./vue-ui-sparkbar-DlHNW471.js";
import { L as ot } from "./Legend-CsVEDSh6.js";
import { D as lt } from "./DataTable-BwHWRlRZ.js";
import rt from "./vue-ui-skeleton-ChHLL5Hw.js";
import st from "./vue-ui-accordion-w15FGKRN.js";
import { u as ke } from "./useNestedProp-BbEbJmgv.js";
import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const ut = ["id"], it = ["xmlns", "viewBox"], ct = ["id"], dt = ["stop-color"], vt = ["stop-color"], ht = { key: 0 }, pt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], gt = { key: 0 }, ft = ["d", "stroke", "stroke-width"], yt = ["d", "stroke", "stroke-width"], mt = { key: 1 }, bt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], kt = ["points", "stroke", "stroke-width"], Ct = ["points", "stroke", "stroke-width", "fill"], _t = { key: 2 }, wt = ["cx", "cy", "fill", "r", "stroke"], $t = {
  key: 3,
  class: "vue-data-ui-watermark"
}, xt = ["onClick"], Pt = {
  key: 0,
  style: { "max-width": "200px", margin: "0 auto" }
}, Tt = {
  __name: "vue-ui-radar",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  emits: ["selectLegend"],
  setup(Ce, { expose: _e, emit: we }) {
    const p = Ce, { vue_ui_radar: $e } = Me(), O = v(() => !!p.dataset && Object.keys(p.dataset).length), _ = i(Ve()), xe = i(null), X = i(!1), Y = i(""), Z = i(0), A = i(null), ee = i(null), te = i(null), e = v(() => {
      const t = ke({
        userConfig: p.config,
        defaultConfig: $e
      });
      return t.theme ? {
        ...ke({
          userConfig: Ue.vue_ui_radar[t.theme] || p.config,
          defaultConfig: t
        }),
        customPalette: Ee[t.theme] || P
      } : t;
    }), M = i(null);
    Se(() => {
      if (Be(p.dataset) && F({
        componentName: "VueUiRadar",
        type: "dataset"
      }), e.value.responsive) {
        const t = Je(() => {
          const { width: a, height: o } = Ke({
            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;
        });
        M.value = new ResizeObserver(t), M.value.observe(A.value.parentNode);
      }
    }), Le(() => {
      M.value && M.value.disconnect();
    });
    const { isPrinting: ae, isImaging: oe, generatePdf: le, generateImage: re } = Ze({
      elementId: `vue-ui-radar_${_.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-radar"
    }), se = v(() => De(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
    }), Pe = v(() => ({
      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 ne(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)), we("selectLegend", N.value.filter((a, o) => !c.value.includes(o)).map((a) => ({
        name: a.name,
        color: a.color,
        proportion: a.totalProportion
      })));
    }
    function Te() {
      return N.value.map((t) => ({
        name: t.name,
        color: t.color,
        proportion: t.totalProportion
      }));
    }
    const g = v(() => [null, void 0].includes(p.dataset.categories) ? (F({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "categories ({ name: string; prefix?: string; suffix?: string}[])"
    }), []) : (p.dataset.categories.length === 0 ? F({
      componentName: "VueUiRadar",
      type: "datasetAttributeEmpty",
      property: "categories"
    }) : p.dataset.categories.forEach((t, a) => {
      ge({
        datasetObject: t,
        requiredAttributes: ["name"]
      }).forEach((o) => {
        F({
          componentName: "VueUiRadar",
          type: "datasetAttribute",
          property: `category.${o} at index ${a}`,
          index: a
        });
      });
    }), [null, void 0].includes(p.dataset.series) ? F({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "series ({ name: string; values: number[]; color?: string; target: number}[])"
    }) : p.dataset.series.forEach((t, a) => {
      ge({
        datasetObject: t,
        requiredAttributes: ["name", "values", "target"]
      }).forEach((o) => {
        F({
          componentName: "VueUiRadar",
          type: "datasetSerieAttribute",
          key: "series",
          property: o,
          index: a
        });
      });
    }), p.dataset.categories.map((t, a) => ({
      name: t.name,
      categoryId: `radar_category_${_.value}_${a}`,
      color: fe(t.color) || se.value[a] || P[a] || P[a % P.length],
      prefix: t.prefix ?? "",
      suffix: t.suffix ?? ""
    })))), b = v(() => O.value ? p.dataset.series.map((t, a) => ({
      ...t,
      color: fe(t.color) || se.value[a] || P[a] || P[a % P.length],
      serieId: `radar_serie_${_.value}_${a}`,
      formatter: t.formatter || null
    })) : []), ue = v(() => Math.max(...b.value.flatMap((t) => t.values))), ie = v(() => b.value.length), j = v(() => Math.min(u.value.width, u.value.height) / 3), ce = v(() => ye({
      plot: { x: u.value.width / 2, y: u.value.height / 2 },
      radius: j.value,
      sides: ie.value,
      rotation: 0
    })), Ne = v(() => {
      const t = [];
      for (let a = 0; a < j.value; a += j.value / e.value.style.chart.layout.grid.graduations)
        t.push(a);
      return t;
    }), C = v(() => ce.value.coordinates.map((t, a) => {
      const o = b.value[a].values.map((l) => Fe({
        centerX: u.value.width / 2,
        centerY: u.value.height / 2,
        apexX: t.x,
        apexY: t.y,
        proportion: l / (b.value[a].target || ue.value)
      }));
      return {
        ...t,
        ...b.value[a],
        plots: o
      };
    }));
    function q({ 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 Fe({ centerX: t, centerY: a, apexX: o, apexY: l, proportion: r }) {
      return {
        x: t + (o - t) * r,
        y: a + (l - a) * r
      };
    }
    const N = v(() => {
      const t = b.value.map((a, o) => a.values.map((l) => l / (a.target || ue.value)));
      return g.value.map((a, o) => ({
        ...a,
        totalProportion: Ge(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: () => ne(o),
        isSegregated: c.value.includes(o)
      }));
    }), Oe = v(() => ({
      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" : ""
    })), V = v(() => {
      const t = [
        { name: e.value.translations.datapoint, color: "" },
        { name: e.value.translations.target, color: "" },
        ...N.value
      ], a = p.dataset.series.map((l) => [
        l.name,
        me(
          l.formatter,
          l.target,
          R({
            p: l.prefix,
            v: l.target,
            s: l.suffix,
            r: e.value.table.td.roundingValue
          })
        ),
        ...l.values.map((r, d) => `${me(
          l.formatter,
          r,
          R({ p: g.value[d].prefix, v: r, s: g.value[d].suffix, r: e.value.table.td.roundingValue })
        )} (${isNaN(r / l.target) ? "" : R({
          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 };
    }), U = i(null), H = i([]), J = i(null);
    function Ae(t, a) {
      H.value = [], U.value = a, X.value = !0;
      let o = "";
      J.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 (Ye(l) && je(() => l({
        seriesIndex: a,
        datapoint: t,
        series: { categories: g.value, datapoints: b.value, radar: C.value },
        config: e.value
      })))
        Y.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) || H.value.push({
            name: g.value[r].name,
            value: t.values[r] / t.target * 100,
            color: g.value[r].color,
            suffix: "%)",
            prefix: `${R({ 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
          });
        Y.value = o;
      }
    }
    function de() {
      Re(() => {
        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 = p.dataset.series.map((d, Nt) => [d.name, d.target, ...d.values.flatMap((K) => [
          K,
          isNaN(K / d.target) ? "" : K / d.target * 100
        ])]), l = t.concat([a]).concat(o), r = qe(l);
        He({ csvContent: r, title: e.value.style.chart.title.text || "vue-ui-radar" });
      });
    }
    const S = i(!1);
    function Ie(t) {
      S.value = t, Z.value += 1;
    }
    function ve() {
      k.value.showTable = !k.value.showTable;
    }
    function he() {
      k.value.showTooltip = !k.value.showTooltip;
    }
    return _e({
      getData: Te,
      generatePdf: le,
      generateCsv: de,
      generateImage: re,
      toggleTable: ve,
      toggleTooltip: he
    }), (t, a) => (s(), n("div", {
      class: L(`vue-ui-radar ${S.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      ref_key: "radarChart",
      ref: A,
      id: `vue-ui-radar_${_.value}`,
      style: E(`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: E(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:12px`)
      }, [
        B(Qe, {
          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"])
      ], 4)) : f("", !0),
      e.value.userOptions.show && O.value ? (s(), D(et, {
        ref_key: "details",
        ref: xe,
        key: `user_options_${Z.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: h(oe),
        isPrinting: h(ae),
        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: S.value,
        isTooltip: k.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        onToggleFullscreen: Ie,
        onGeneratePdf: h(le),
        onGenerateCsv: de,
        onGenerateImage: h(re),
        onToggleTable: ve,
        onToggleTooltip: he
      }, ze({ _: 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", G(W({ 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", "onGeneratePdf", "onGenerateImage"])) : f("", !0),
      O.value ? (s(), n("svg", {
        key: 2,
        xmlns: h(We),
        class: L({ "vue-data-ui-fullscreen--on": S.value, "vue-data-ui-fulscreen--off": !S.value }),
        viewBox: `0 0 ${u.value.width <= 0 ? 10 : u.value.width} ${u.value.height <= 0 ? 10 : u.value.height}`,
        style: E(`max-width:100%;overflow:visible;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
      }, [
        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(Xe)(o.color, 0.05)}${h(Q)[e.value.style.chart.layout.dataPolygon.opacity]}`
            }, null, 8, dt),
            w("stop", {
              offset: "100%",
              "stop-color": o.color + h(Q)[e.value.style.chart.layout.dataPolygon.opacity]
            }, null, 8, vt)
          ], 8, ct))), 256))
        ]),
        e.value.style.chart.layout.grid.show ? (s(), n("g", ht, [
          (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, pt))), 256)),
          e.value.style.chart.layout.grid.graduations > 0 ? (s(), n("g", gt, [
            (s(!0), n($, null, x(Ne.value, (o) => (s(), n("path", {
              d: h(ye)({
                plot: { x: u.value.width / 2, y: u.value.height / 2 },
                radius: o,
                sides: ie.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, ft))), 256))
          ])) : f("", !0)
        ])) : f("", !0),
        w("path", {
          d: ce.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, yt),
        e.value.style.chart.layout.labels.dataLabels.show ? (s(), n("g", mt, [
          (s(!0), n($, null, x(C.value, (o, l) => (s(), n("text", {
            x: q(o).x,
            y: q(o).y,
            "text-anchor": q(o).anchor,
            "font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.labels.dataLabels.color,
            onMouseenter: (r) => Ae(o, l),
            onMouseleave: a[0] || (a[0] = (r) => {
              X.value = !1, U.value = null;
            })
          }, z(o.name), 41, bt))), 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(be)(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: L({ "animated-out": c.value.includes(l) && e.value.useCssAnimation, "animated-in": T.value && I.value === l && e.value.useCssAnimation })
            }, null, 10, kt)) : f("", !0),
            e.value.useCssAnimation || !e.value.useCssAnimation && !c.value.includes(l) ? (s(), n("polygon", {
              key: 1,
              "data-cy-radar-path": "",
              points: h(be)(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})` : o.color + h(Q)[e.value.style.chart.layout.dataPolygon.opacity],
              class: L({ "animated-out": c.value.includes(l) && e.value.useCssAnimation, "animated-in": T.value && I.value === l && e.value.useCssAnimation })
            }, null, 10, Ct)) : f("", !0)
          ])
        ]))), 256)),
        e.value.style.chart.layout.plots.show ? (s(), n("g", _t, [
          (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: U.value !== null && U.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: L({ "animated-out": c.value.includes(d) && e.value.useCssAnimation, "animated-in": T.value && I.value === d && e.value.useCssAnimation })
            }, null, 10, wt))), 256))
          ]))), 256))
        ])) : f("", !0),
        m(t.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, it)) : f("", !0),
      t.$slots.watermark ? (s(), n("div", $t, [
        m(t.$slots, "watermark", G(W({ isPrinting: h(ae) || h(oe) })), void 0, !0)
      ])) : f("", !0),
      O.value ? f("", !0) : (s(), D(rt, {
        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(), D(ot, {
          key: 0,
          legendSet: N.value,
          config: Oe.value,
          onClickMarker: a[1] || (a[1] = ({ i: o }) => ne(o))
        }, {
          item: y(({ legend: o, index: l }) => [
            w("div", {
              "data-cy-legend-item": "",
              onClick: (r) => o.segregate(),
              style: E(`opacity:${c.value.includes(l) ? 0.5 : 1}`)
            }, z(o.name) + ": " + z(h(R)({
              v: o.totalProportion * 100,
              s: "%",
              r: e.value.style.chart.legend.roundingPercentage
            })), 13, xt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : m(t.$slots, "legend", {
          key: 1,
          legend: N.value
        }, void 0, !0)
      ], 512),
      B(tt, {
        show: k.value.showTooltip && X.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: Y.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": y(() => [
          m(t.$slots, "tooltip-before", G(W({ ...J.value })), void 0, !0)
        ]),
        "tooltip-after": y(() => [
          ["function"].includes(typeof e.value.style.chart.tooltip.customFormat) ? f("", !0) : (s(), n("div", Pt, [
            B(at, {
              dataset: H.value,
              config: Pe.value,
              backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity
            }, null, 8, ["dataset", "config", "backgroundOpacity"])
          ])),
          m(t.$slots, "tooltip-after", G(W({ ...J.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "fontSize", "position", "offsetY", "parent", "content", "isCustom"]),
      O.value ? (s(), D(st, {
        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(() => [
          B(lt, {
            colNames: V.value.colNames,
            head: V.value.head,
            body: V.value.body,
            config: V.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 }) => [
              pe(z(o.name), 1)
            ]),
            td: y(({ td: o }) => [
              pe(z(o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"])
        ]),
        _: 1
      }, 8, ["config"])) : f("", !0)
    ], 14, ut));
  }
}, Dt = /* @__PURE__ */ nt(Tt, [["__scopeId", "data-v-11516433"]]);
export {
  Dt as default
};
