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