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