import { computed as g, ref as v, watch as He, onMounted as Ge, onBeforeUnmount as Xe, openBlock as u, createElementBlock as i, normalizeClass as U, normalizeStyle as T, unref as x, createBlock as z, createCommentVNode as m, createSlots as Ye, withCtx as k, renderSlot as b, normalizeProps as W, guardReactiveProps as E, createVNode as _e, Fragment as C, renderList as F, createElementVNode as I, toDisplayString as D, createTextVNode as qe } from "vue";
import { u as Je, c as ee, t as Ke, a as Qe, p as H, o as Ze, e as Me, g as et, b as tt, d as at, D as lt, R as ot, S as st, T as nt, X as ut, x as ze, i as Fe, f as Ie, y as it, q as rt, r as ct, F as G } from "./index-CxkSLqkR.js";
import { t as vt, u as dt } from "./useResponsive-CoxXLe23.js";
import { _ as ht } from "./Title-DlWf9Ddn.js";
import { L as pt } from "./Legend-1PzxSsgB.js";
import { _ as mt } from "./Tooltip-CvkadVaG.js";
import { _ as yt } from "./Shape-Ci6tClcc.js";
import { u as ft, U as gt } from "./usePrinter-C6iBjau1.js";
import { D as bt } from "./DataTable-BE81z-1L.js";
import xt from "./vue-ui-accordion-ElsMWD7y.js";
import kt from "./vue-ui-skeleton-BNcyfNtG.js";
import { u as Pe } from "./useNestedProp-Cl0RLl8U.js";
import { _ as wt } from "./PackageVersion-CZWTAkjP.js";
import { P as Ct } from "./PenAndPaper-B-Xy37LR.js";
import { u as $t } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Tt = ["id"], _t = ["xmlns", "viewBox"], Mt = ["x", "y", "width", "height"], zt = { style: { "pointer-events": "none" } }, Ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], It = ["x", "y", "fill", "font-size", "font-weight"], Pt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Nt = ["x", "y", "fill", "font-size", "font-weight"], Lt = { key: 0 }, Ot = ["x", "y", "font-size", "fill"], St = ["width", "x", "y"], Dt = { style: { width: "100%" } }, Ut = ["x", "y", "fill", "font-weight", "font-size", "onMouseenter"], Wt = ["d", "stroke", "stroke-width", "onMouseenter"], Et = ["d", "onMouseenter"], Vt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, jt = ["onClick"], Bt = ["innerHTML"], Rt = {
  __name: "vue-ui-parallel-coordinate-plot",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(Ne, { expose: Le, emit: te }) {
    const _ = Ne, { vue_ui_parallel_coordinate_plot: Oe } = Je(), P = g({
      get() {
        return !!_.dataset && _.dataset.length;
      },
      set(t) {
        return t;
      }
    }), ae = v(0), N = v(null), le = v(null), oe = v(null), se = v(null), ne = v(null), ue = v(0), ie = v(0), re = v(0), X = v(ee()), L = v(!1);
    function Se(t) {
      L.value = t, ae.value += 1;
    }
    const e = g({
      get: () => de(),
      set: (t) => t
    }), { userOptionsVisible: Y, setUserOptionsVisibility: ce, keepUserOptionState: ve } = $t({ config: e.value });
    function de() {
      const t = Pe({
        userConfig: _.config,
        defaultConfig: Oe
      });
      return t.theme ? {
        ...Pe({
          userConfig: Ke.vue_ui_parallel_coordinate_plot[t.theme] || _.config,
          defaultConfig: t
        }),
        customPalette: Qe[t.theme] || H
      } : t;
    }
    He(() => _.config, (t) => {
      e.value = de(), Y.value = !e.value.userOptions.showOnChartHover, he(), ue.value += 1, re.value += 1, ie.value += 1, h.value.dataLabels.show = e.value.style.chart.yAxis.labels.datapoints.show, h.value.showTable = e.value.table.show, h.value.showTooltip = e.value.style.chart.tooltip.show;
    }, { deep: !0 });
    const V = v(null);
    Ge(() => {
      he();
    });
    function he() {
      if (Ze(_.dataset) ? Me({
        componentName: "VueUiParallelCoordinatePlot",
        type: "dataset"
      }) : _.dataset.forEach((t, l) => {
        et({
          datasetObject: t,
          requiredAttributes: ["name", "series"]
        }).forEach((a) => {
          P.value = !1, Me({
            componentName: "VueUiParallelCoordinatePlot",
            type: "datasetSerieAttribute",
            property: a,
            index: l
          });
        });
      }), e.value.responsive) {
        const t = vt(() => {
          const { width: l, height: a } = dt({
            chart: N.value,
            title: e.value.style.chart.title.text ? le.value : null,
            legend: e.value.style.chart.legend.show ? oe.value : null,
            source: se.value,
            noTitle: ne.value
          });
          requestAnimationFrame(() => {
            d.value.width = l, d.value.height = a, d.value.plotSize = G({
              relator: Math.min(l, a),
              adjuster: 600,
              source: e.value.style.chart.plots.radius,
              threshold: 2,
              fallback: 2
            }), d.value.ticksFontSize = G({
              relator: Math.min(l, a),
              adjuster: 600,
              source: e.value.style.chart.yAxis.labels.ticks.fontSize,
              threshold: 10,
              fallback: 10
            }), d.value.datapointFontSize = G({
              relator: Math.min(l, a),
              adjuster: 600,
              source: e.value.style.chart.yAxis.labels.datapoints.fontSize,
              threshold: 10,
              fallback: 10
            }), d.value.axisNameFontSize = G({
              relator: Math.min(l, a),
              adjuster: 600,
              source: e.value.style.chart.yAxis.labels.axisNamesFontSize,
              threshold: 12,
              fallback: 12
            });
          });
        });
        V.value = new ResizeObserver(t), V.value.observe(N.value.parentNode);
      }
    }
    Xe(() => {
      V.value && V.value.disconnect();
    });
    const { isPrinting: pe, isImaging: me, generatePdf: ye, generateImage: fe } = ft({
      elementId: `pcp_${X.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot"
    }), De = g(() => e.value.userOptions.show && !e.value.style.chart.title.text), d = v({
      height: e.value.style.chart.height,
      width: e.value.style.chart.width,
      plotSize: e.value.style.chart.plots.radius,
      // ratio 100
      ticksFontSize: e.value.style.chart.yAxis.labels.ticks.fontSize,
      // ratio 42.85
      datapointFontSize: e.value.style.chart.yAxis.labels.datapoints.fontSize,
      axisNameFontSize: e.value.style.chart.yAxis.labels.axisNamesFontSize
    }), c = g(() => {
      const { top: t, right: l, bottom: a, left: o } = e.value.style.chart.padding, n = d.value.height, s = d.value.width;
      return {
        chartHeight: n,
        chartWidth: s,
        height: n - t - a,
        width: s - o - l,
        top: t,
        left: o,
        right: s - l,
        bottom: n - a
      };
    }), Ue = g(() => tt(e.value.customPalette)), h = v({
      dataLabels: {
        show: e.value.style.chart.yAxis.labels.datapoints.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), $ = v([]);
    function ge(t) {
      $.value.includes(t) ? $.value = $.value.filter((l) => l !== t) : $.value.push(t);
    }
    const M = g(() => _.dataset.map((t, l) => {
      const a = at(t.color) || Ue.value[l] || H[l] || H[l % H.length];
      return {
        ...t,
        series: t.series.map((o) => ({
          ...o,
          id: ee(),
          color: a
        })),
        seriesIndex: l,
        color: a,
        id: ee(),
        shape: t.shape || "circle"
      };
    })), We = g(() => M.value.map((t) => ({
      ...t,
      opacity: $.value.includes(t.id) ? 0.5 : 1,
      segregate: () => ge(t.id),
      isSegregated: $.value.includes(t.id)
    }))), Ee = g(() => ({
      cy: "pcp-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" : ""
    })), be = g(() => Math.max(
      ...M.value.filter((t) => !$.value.includes(t.id)).map((t) => Math.max(...t.series.flatMap((l) => l.values.length)))
    )), w = g(() => c.value.width / be.value), q = g(() => M.value.filter((t) => !$.value.includes(t.id))), f = g(() => {
      let t = [];
      for (let l = 0; l < be.value; l += 1) {
        const a = Math.min(...q.value.flatMap((p) => p.series.map((R) => R.values[l] || 0) || 0)), o = Math.max(...q.value.flatMap((p) => p.series.map((R) => R.values[l] || 0) || 0)), n = o === a ? a / 4 : a, s = o === a ? o * 2 : o, r = lt(n, s, e.value.style.chart.yAxis.scaleTicks), A = r.ticks.map((p, R) => {
          const Be = r.min < 0 ? p + Math.abs(r.min) : p - Math.abs(r.min), Re = r.min < 0 ? r.max + Math.abs(r.min) : r.max - Math.abs(r.min);
          return {
            y: c.value.bottom - c.value.height * (Be / Re),
            x: c.value.left + w.value * l + w.value / 2,
            value: p
          };
        });
        t.push({
          scale: r,
          ticks: A,
          name: e.value.style.chart.yAxis.labels.axisNames[l] || `Y-${l + 1}`
        });
      }
      return t;
    }), J = g(() => q.value.map((t, l) => ({
      ...t,
      series: t.series.map((a, o) => ({
        ...a,
        datapoints: a.values.map((n, s) => {
          const r = f.value[s].scale.min < 0 ? (n || 0) + Math.abs(f.value[s].scale.min) : (n || 0) - Math.abs(f.value[s].scale.min), A = f.value[s].scale.min < 0 ? f.value[s].scale.max + Math.abs(f.value[s].scale.min) : f.value[s].scale.max - Math.abs(f.value[s].scale.min);
          return {
            name: a.name,
            seriesName: t.name,
            axisIndex: s,
            datapointIndex: o,
            seriesIndex: l,
            value: n || 0,
            x: c.value.left + w.value * s + w.value / 2,
            y: c.value.bottom - c.value.height * (r / A),
            comment: a.comments && a.comments[s] || ""
          };
        })
      }))
    })).map((t) => ({
      ...t,
      series: t.series.map((l) => {
        const a = ot(l.datapoints), o = st(l.datapoints), n = nt(e.value.style.chart.lines.smooth ? `M ${o}` : `M ${a}`);
        return {
          ...l,
          smoothPath: o,
          straightPath: a,
          pathLength: n
        };
      })
    })));
    function xe({ value: t, index: l, datapoint: a }) {
      return Fe(
        e.value.style.chart.yAxis.labels.formatters[l] || null,
        t,
        Ie({
          p: e.value.style.chart.yAxis.labels.prefixes[l] || "",
          v: t,
          s: e.value.style.chart.yAxis.labels.suffixes[l] || "",
          r: e.value.style.chart.yAxis.labels.roundings[l] || 0
        }),
        { datapoint: a, seriesIndex: l }
      );
    }
    const y = v(null), K = v(null), O = v(!1), Q = v("");
    function j({ shape: t, serieName: l, serie: a, relativeIndex: o, seriesIndex: n }) {
      K.value = { serie: a, relativeIndex: o, seriesIndex: n, series: M.value, scales: f.value }, O.value = !0, y.value = a.id;
      let s = "";
      const r = e.value.style.chart.tooltip.customFormat;
      ze(r) && it(() => r({
        serie: a,
        seriesIndex: a.seriesIndex,
        series: M.value,
        config: e.value,
        scales: f.value
      })) ? Q.value = r({
        serie: a,
        seriesIndex: a.seriesIndex,
        series: M.value,
        config: e.value,
        scales: f.value
      }) : (s += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l ? l + " - " : ""}${a.name}</div>`, f.value.map((A) => A.name).forEach((A, p) => {
        s += `
                <div class="vue-ui-tooltip-item" style="text-align:left">
                    <span>${A}: </span>
                    <span>
                        ${Fe(
          e.value.style.chart.yAxis.labels.formatters[p] || null,
          a.datapoints[p].value,
          Ie({
            p: e.value.style.chart.yAxis.labels.prefixes[p] || "",
            v: a.datapoints[p].value,
            s: e.value.style.chart.yAxis.labels.suffixes[p] || "",
            r: e.value.style.chart.yAxis.labels.roundings[p] || ""
          }),
          { datapoint: a.datapoints[p], seriesIndex: p }
        )}    
                    </span>
                </div>
            `, e.value.style.chart.comments.showInTooltip && a.datapoints[p].comment && (s += `<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${a.color}">${a.datapoints[p].comment}</div>`);
      }), Q.value = `<div>${s}</div>`);
    }
    function Ve() {
      return M.value;
    }
    const S = g(() => {
      const t = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(f.value.map((n) => n.name)), l = J.value.flatMap((n, s) => n.series.map((r) => [n.name].concat([r.name]).concat(r.values))), a = {
        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
      }, o = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(f.value.map((n) => n.name));
      return {
        body: l,
        head: t,
        config: a,
        colNames: o
      };
    }), ke = g(() => J.value.length === 0 ? { head: [], body: [], config: {}, columnNames: [] } : {
      head: S.value.head,
      body: S.value.body
    });
    function we() {
      const t = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], l = ke.value.head, a = ke.value.body, o = t.concat([l]).concat(a), n = rt(o);
      ct({ csvContent: n, title: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot" });
    }
    function je(t) {
      te("selectDatapoint", t);
    }
    function Ce(t) {
      te("selectLegend", {
        ...t,
        isSegregated: !t.isSegregated,
        opacity: t.isSegregated ? 1 : 0.5
      });
    }
    function $e() {
      h.value.showTable = !h.value.showTable;
    }
    function Ae() {
      h.value.dataLabels.show = !h.value.dataLabels.show;
    }
    function Te() {
      h.value.showTooltip = !h.value.showTooltip;
    }
    const B = v(!1);
    function Z() {
      B.value = !B.value;
    }
    return Le({
      getData: Ve,
      generateCsv: we,
      generatePdf: ye,
      generateImage: fe,
      toggleTable: $e,
      toggleLabels: Ae,
      toggleTooltip: Te,
      toggleAnnotator: Z
    }), (t, l) => (u(), i("div", {
      ref_key: "pcpChart",
      ref: N,
      class: U(`vue-ui-pcp ${L.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: T(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      id: `pcp_${X.value}`,
      onMouseenter: l[6] || (l[6] = () => x(ce)(!0)),
      onMouseleave: l[7] || (l[7] = () => x(ce)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (u(), z(Ct, {
        key: 0,
        parent: N.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: B.value,
        onClose: Z
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : m("", !0),
      De.value ? (u(), i("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ne,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : m("", !0),
      e.value.style.chart.title.text ? (u(), i("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: le,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (u(), z(ht, {
          key: `title_${ue.value}`,
          config: {
            title: {
              cy: "pcp-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "pcp-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : m("", !0),
      e.value.userOptions.show && P.value && (x(ve) || x(Y)) ? (u(), z(gt, {
        ref: "details",
        key: `user_options_${ae.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: x(pe),
        isImaging: x(me),
        uid: X.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: L.value,
        isTooltip: h.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: N.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: B.value,
        onToggleFullscreen: Se,
        onGeneratePdf: x(ye),
        onGenerateCsv: we,
        onGenerateImage: x(fe),
        onToggleTable: $e,
        onToggleLabels: Ae,
        onToggleTooltip: Te,
        onToggleAnnotator: Z,
        style: T({
          visibility: x(ve) ? x(Y) ? "visible" : "hidden" : "visible"
        })
      }, Ye({ _: 2 }, [
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: k(() => [
            b(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: k(() => [
            b(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: k(() => [
            b(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: k(() => [
            b(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionLabels ? {
          name: "optionLabels",
          fn: k(() => [
            b(t.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: k(({ toggleFullscreen: a, isFullscreen: o }) => [
            b(t.$slots, "optionFullscreen", W(E({ toggleFullscreen: a, isFullscreen: o })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: k(({ toggleAnnotator: a, isAnnotator: o }) => [
            b(t.$slots, "optionAnnotator", W(E({ toggleAnnotator: a, isAnnotator: o })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
      P.value ? (u(), i("svg", {
        key: 4,
        xmlns: x(ut),
        class: U({ "vue-data-ui-fullscreen--on": L.value, "vue-data-ui-fulscreen--off": !L.value }),
        viewBox: `0 0 ${c.value.chartWidth <= 0 ? 10 : c.value.chartWidth} ${c.value.chartHeight <= 0 ? 10 : c.value.chartHeight}`,
        style: T(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        _e(wt),
        t.$slots["chart-background"] ? (u(), i("foreignObject", {
          key: 0,
          x: c.value.left,
          y: c.value.top,
          width: c.value.width,
          height: c.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          b(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, Mt)) : m("", !0),
        (u(!0), i(C, null, F(f.value, (a, o) => (u(), i("g", zt, [
          I("line", {
            x1: c.value.left + w.value * o + w.value / 2,
            x2: c.value.left + w.value * o + w.value / 2,
            y1: c.value.top,
            y2: c.value.bottom,
            stroke: e.value.style.chart.yAxis.stroke,
            "stroke-width": e.value.style.chart.yAxis.strokeWidth
          }, null, 8, Ft),
          I("text", {
            x: c.value.left + w.value * o + w.value / 2,
            y: c.value.top - 24,
            fill: e.value.style.chart.yAxis.labels.axisNamesColor,
            "font-size": d.value.axisNameFontSize,
            "font-weight": e.value.style.chart.yAxis.labels.axisNamesBold ? "bold" : "",
            "text-anchor": "middle"
          }, D(a.name), 9, It),
          e.value.style.chart.yAxis.labels.ticks.show ? (u(), i(C, { key: 0 }, [
            (u(!0), i(C, null, F(a.ticks, (n) => (u(), i("line", {
              x1: n.x,
              x2: n.x - 10,
              y1: n.y,
              y2: n.y,
              stroke: e.value.style.chart.yAxis.stroke,
              "stroke-width": e.value.style.chart.yAxis.strokeWidth,
              style: T(`opacity:${y.value && !h.value.showTooltip ? 0.2 : 1}`)
            }, null, 12, Pt))), 256)),
            (u(!0), i(C, null, F(a.ticks, (n) => (u(), i("text", {
              x: n.x - 12 + e.value.style.chart.yAxis.labels.ticks.offsetX,
              y: n.y + e.value.style.chart.yAxis.labels.ticks.offsetY + d.value.ticksFontSize / 3,
              fill: e.value.style.chart.yAxis.labels.ticks.color,
              "text-anchor": "end",
              "font-size": d.value.ticksFontSize,
              "font-weight": e.value.style.chart.yAxis.labels.ticks.bold ? "bold" : "normal",
              style: T(`opacity:${y.value && !h.value.showTooltip ? 0.2 : 1}`)
            }, D(xe({ value: n.value, index: o, datapoint: n })), 13, Nt))), 256))
          ], 64)) : m("", !0)
        ]))), 256)),
        (u(!0), i(C, null, F(J.value, (a) => (u(), i("g", null, [
          (u(!0), i(C, null, F(a.series, (o, n) => (u(), i("g", null, [
            e.value.style.chart.plots.show ? (u(), i("g", Lt, [
              (u(!0), i(C, null, F(o.datapoints, (s) => (u(), z(yt, {
                plot: { x: s.x, y: s.y },
                color: a.color,
                shape: a.shape,
                radius: a.shape === "triangle" ? d.value.plotSize * 1.2 : d.value.plotSize,
                stroke: e.value.style.chart.backgroundColor,
                strokeWidth: 0.5,
                onMouseenter: (r) => j({
                  shape: a.shape,
                  serieName: a.name,
                  serie: o,
                  relativeIndex: n,
                  seriesIndex: o.seriesIndex
                }),
                onMouseleave: l[0] || (l[0] = (r) => {
                  y.value = null, O.value = !1;
                }),
                style: T(`opacity:${y.value ? y.value === o.id ? e.value.style.chart.plots.opacity : 0.2 : e.value.style.chart.plots.opacity}`),
                onClick: () => je(s)
              }, null, 8, ["plot", "color", "shape", "radius", "stroke", "onMouseenter", "style", "onClick"]))), 256)),
              h.value.showTooltip ? m("", !0) : (u(), i(C, { key: 0 }, [
                y.value && y.value === o.id && o.datapoints.length ? (u(), i("text", {
                  key: 0,
                  x: o.datapoints[0].x - d.value.ticksFontSize,
                  y: o.datapoints[0].y + d.value.ticksFontSize / 3,
                  "text-anchor": "end",
                  "font-size": d.value.ticksFontSize,
                  fill: a.color,
                  "font-weight": "bold"
                }, D(o.name), 9, Ot)) : m("", !0)
              ], 64)),
              e.value.style.chart.comments.show ? (u(!0), i(C, { key: 1 }, F(o.datapoints, (s) => (u(), i("g", null, [
                s.comment ? (u(), i("foreignObject", {
                  key: 0,
                  style: { overflow: "visible" },
                  height: "12",
                  width: e.value.style.chart.comments.width,
                  x: s.x - e.value.style.chart.comments.width / 2 + e.value.style.chart.comments.offsetX,
                  y: s.y + e.value.style.chart.comments.offsetY + 6
                }, [
                  I("div", Dt, [
                    b(t.$slots, "plot-comment", {
                      plot: { ...s, color: a.color }
                    }, void 0, !0)
                  ])
                ], 8, St)) : m("", !0)
              ]))), 256)) : m("", !0)
            ])) : m("", !0),
            h.value.dataLabels.show || y.value && y.value === o.id ? (u(!0), i(C, { key: 1 }, F(o.datapoints, (s, r) => (u(), i("text", {
              x: s.x + 12 + e.value.style.chart.yAxis.labels.datapoints.offsetX,
              y: s.y + e.value.style.chart.yAxis.labels.datapoints.offsetY + d.value.datapointFontSize / 3,
              fill: e.value.style.chart.yAxis.labels.datapoints.useSerieColor ? a.color : e.value.style.chart.yAxis.labels.datapoints.color,
              "text-anchor": "start",
              "font-weight": e.value.style.chart.yAxis.labels.datapoints.bold ? "bold" : "normal",
              class: U({ "vue-ui-pcp-animated": !1, "vue-ui-pcp-transition": !0 }),
              "font-size": d.value.datapointFontSize,
              onMouseenter: (A) => j({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[1] || (l[1] = (A) => {
                y.value = null, O.value = !1;
              }),
              style: T(`opacity:${y.value ? y.value === o.id ? 1 : 0.2 : 1}`)
            }, D(xe({ value: s.value, index: r, datapoint: s })), 45, Ut))), 256)) : m("", !0),
            I("path", {
              d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
              stroke: a.color,
              "stroke-width": e.value.style.chart.lines.strokeWidth,
              fill: "none",
              class: U({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
              onMouseenter: (s) => j({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[2] || (l[2] = (s) => {
                y.value = null, O.value = !1;
              }),
              style: T(`opacity:${y.value ? y.value === o.id ? e.value.style.chart.lines.opacity : 0.2 : e.value.style.chart.lines.opacity}; stroke-dasharray:${o.pathLength}; stroke-dashoffset: ${e.value.useCssAnimation ? o.pathLength : 0}`)
            }, null, 46, Wt),
            h.value.showTooltip ? (u(), i("path", {
              key: 2,
              d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
              stroke: "transparent",
              "stroke-width": 12,
              fill: "none",
              class: U({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
              onMouseenter: (s) => j({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[3] || (l[3] = (s) => {
                y.value = null, O.value = !1;
              }),
              style: { opacity: "0" }
            }, null, 42, Et)) : m("", !0)
          ]))), 256))
        ]))), 256)),
        b(t.$slots, "svg", { svg: c.value }, void 0, !0)
      ], 14, _t)) : m("", !0),
      t.$slots.watermark ? (u(), i("div", Vt, [
        b(t.$slots, "watermark", W(E({ isPrinting: x(pe) || x(me) })), void 0, !0)
      ])) : m("", !0),
      P.value ? m("", !0) : (u(), z(kt, {
        key: 6,
        config: {
          type: "parallelCoordinatePlot",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor
          }
        }
      }, null, 8, ["config"])),
      I("div", {
        ref_key: "chartLegend",
        ref: oe
      }, [
        e.value.style.chart.legend.show && P.value ? (u(), z(pt, {
          key: `legend_${ie.value}`,
          legendSet: We.value,
          config: Ee.value,
          onClickMarker: l[4] || (l[4] = ({ legend: a }) => {
            ge(a.id), Ce(a);
          })
        }, {
          item: k(({ legend: a, index: o }) => [
            I("div", {
              onClick: (n) => {
                a.segregate(), Ce(a);
              },
              style: T(`opacity:${$.value.includes(a.id) ? 0.5 : 1}`)
            }, D(a.name), 13, jt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : b(t.$slots, "legend", {
          key: 1,
          legend: M.value
        }, void 0, !0)
      ], 512),
      t.$slots.source ? (u(), i("div", {
        key: 7,
        ref_key: "source",
        ref: se,
        dir: "auto"
      }, [
        b(t.$slots, "source", {}, void 0, !0)
      ], 512)) : m("", !0),
      _e(mt, {
        show: h.value.showTooltip && O.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        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,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: N.value,
        content: Q.value,
        isFullscreen: L.value,
        isCustom: x(ze)(e.value.style.chart.tooltip.customFormat)
      }, {
        "tooltip-before": k(() => [
          b(t.$slots, "tooltip-before", W(E({ ...K.value })), void 0, !0)
        ]),
        "tooltip-after": k(() => [
          b(t.$slots, "tooltip-after", W(E({ ...K.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      P.value ? (u(), z(xt, {
        key: 8,
        hideDetails: "",
        config: {
          open: h.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: k(() => [
          (u(), z(bt, {
            key: `table_${re.value}`,
            colNames: S.value.colNames,
            head: S.value.head,
            body: S.value.body,
            config: S.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: l[5] || (l[5] = (a) => h.value.showTable = !1)
          }, {
            th: k(({ th: a }) => [
              I("div", { innerHTML: a }, null, 8, Bt)
            ]),
            td: k(({ td: a }) => [
              qe(D(a), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : m("", !0)
    ], 46, Tt));
  }
}, ua = /* @__PURE__ */ At(Rt, [["__scopeId", "data-v-5c936dc0"]]);
export {
  ua as default
};
