import { useCssVars as xt, ref as h, reactive as bt, computed as w, onUnmounted as kt, createBlock as T, openBlock as r, Teleport as wt, createElementBlock as u, createCommentVNode as y, withModifiers as W, normalizeStyle as P, createElementVNode as c, unref as g, renderSlot as k, createVNode as qe, nextTick as Je, onMounted as Ct, onBeforeUnmount as $t, watch as Re, normalizeClass as Be, createSlots as We, withCtx as C, normalizeProps as de, guardReactiveProps as ve, Fragment as b, renderList as M, mergeProps as Ye, toDisplayString as j, createTextVNode as Ve } from "vue";
import { X as Ke, u as At, c as $e, o as St, e as Ae, g as Ue, b as _t, d as zt, p as he, ak as Ge, a7 as Mt, R as Lt, G as Tt, i as fe, f as ge, t as Ot, a as Et, q as Pt, r as Dt, al as Nt } from "./index-DJL8Ofhe.js";
import { u as Xt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as It } from "./useChartAccessibility-BWojgys7.js";
import { u as Ft, U as Ht } from "./usePrinter-BB_LyyCt.js";
import { t as Rt, u as Bt } from "./useResponsive-Cw4oZ8sQ.js";
import { u as je } from "./useNestedProp-nW23xHng.js";
import Wt from "./vue-ui-accordion-CFo12sAN.js";
import Yt from "./BaseIcon-Co2GD8iT.js";
import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
import { D as Vt } from "./DataTable-B3skHSzt.js";
import { L as Ut } from "./Legend-DTJsfZrl.js";
import { _ as Gt } from "./PenAndPaper-DvnLOqKv.js";
import { _ as jt } from "./Shape-C3dD_oLo.js";
import qt from "./vue-ui-skeleton-D7wiUDgm.js";
import { _ as Jt } from "./Title-DHJyUsEV.js";
import Kt from "./vue-ui-xy-N35O_x2x.js";
const Qt = ["xmlns"], Zt = { class: "modal-title" }, ea = { class: "modal-body" }, ta = {
  __name: "BaseDraggableDialog",
  props: {
    backgroundColor: { type: String },
    color: { type: String },
    headerBg: { type: String },
    headerColor: { type: String }
  },
  emits: ["close"],
  setup(X, { expose: ye, emit: pe }) {
    xt((i) => ({
      19616867: X.color
    }));
    const me = X, $ = pe, L = h(!1), Y = h(!1), l = bt({
      left: window.innerWidth / 2 - 200,
      top: window.innerHeight / 2 - 120,
      width: 400,
      height: 400,
      dragging: !1,
      resizing: !1,
      dragOffsetX: 0,
      dragOffsetY: 0,
      pointerStartX: 0,
      pointerStartY: 0,
      resizeStartW: 0,
      resizeStartH: 0
    });
    function se() {
      L.value = !0, Je(() => {
        Y.value || (l.left = Math.max(0, window.innerWidth / 2 - l.width / 2), l.top = Math.max(0, window.innerHeight / 2 - l.height / 2), Y.value = !0);
      });
    }
    function q() {
      L.value = !1, $("close");
    }
    ye({ open: se, close: q });
    const V = w(() => ({
      position: "fixed",
      left: `${l.left}px`,
      top: `${l.top}px`,
      width: `${l.width}px`,
      height: `${l.height}px`,
      padding: 0,
      border: "none",
      background: me.backgroundColor,
      boxShadow: "0 4px 24px rgba(0,0,0,0.15)",
      zIndex: 9999,
      overflow: "visible",
      borderRadius: "2px"
    }));
    function O(i) {
      return i.touches && i.touches.length ? { x: i.touches[0].clientX, y: i.touches[0].clientY } : { x: i.clientX, y: i.clientY };
    }
    function J(i) {
      var p;
      (p = i.preventDefault) == null || p.call(i), l.dragging = !0;
      const v = O(i);
      l.dragOffsetX = v.x - l.left, l.dragOffsetY = v.y - l.top, document.addEventListener("mousemove", I), document.addEventListener("mouseup", F), document.addEventListener("touchmove", I, { passive: !1 }), document.addEventListener("touchend", F);
    }
    function I(i) {
      var m;
      if (!l.dragging) return;
      (m = i.preventDefault) == null || m.call(i);
      const v = O(i);
      let p = v.x - l.dragOffsetX, e = v.y - l.dragOffsetY;
      p = Math.max(0, Math.min(p, window.innerWidth - l.width)), e = Math.max(0, Math.min(e, window.innerHeight - l.height)), l.left = p, l.top = e;
    }
    function F() {
      l.dragging = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", F), document.removeEventListener("touchmove", I), document.removeEventListener("touchend", F);
    }
    function K(i) {
      var p;
      (p = i.preventDefault) == null || p.call(i), l.resizing = !0;
      const v = O(i);
      l.pointerStartX = v.x, l.pointerStartY = v.y, l.resizeStartW = l.width, l.resizeStartH = l.height, document.addEventListener("mousemove", A), document.addEventListener("mouseup", D), document.addEventListener("touchmove", A, { passive: !1 }), document.addEventListener("touchend", D);
    }
    function A(i) {
      var m;
      if (!l.resizing) return;
      (m = i.preventDefault) == null || m.call(i);
      const v = O(i);
      let p = v.x - l.pointerStartX, e = v.y - l.pointerStartY;
      l.width = Math.max(240, l.resizeStartW + p), l.height = Math.max(400, l.resizeStartH + e);
    }
    function D() {
      l.resizing = !1, document.removeEventListener("mousemove", A), document.removeEventListener("mouseup", D), document.removeEventListener("touchmove", A), document.removeEventListener("touchend", D);
    }
    function ne(i) {
      var p;
      (p = i.preventDefault) == null || p.call(i), l.resizing = !0;
      const v = O(i);
      l.pointerStartX = v.x, l.pointerStartY = v.y, l.resizeStartW = l.width, l.resizeStartH = l.height, l.resizeStartLeft = l.left, l.resizeStartTop = l.top, document.addEventListener("mousemove", H), document.addEventListener("mouseup", f), document.addEventListener("touchmove", H, { passive: !1 }), document.addEventListener("touchend", f);
    }
    function H(i) {
      var Z;
      if (!l.resizing) return;
      (Z = i.preventDefault) == null || Z.call(i);
      const v = O(i);
      let p = v.x - l.pointerStartX, e = Math.min(
        Math.max(0, l.resizeStartLeft + p),
        l.resizeStartLeft + l.resizeStartW - 240
        // min width
      ), m = l.resizeStartW - (e - l.resizeStartLeft), Q = v.y - l.pointerStartY, re = Math.max(400, l.resizeStartH + Q);
      l.left = e, l.width = m, l.height = re;
    }
    function f() {
      l.resizing = !1, document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", f), document.removeEventListener("touchmove", H), document.removeEventListener("touchend", f);
    }
    return kt(() => {
      F(), D(), f();
    }), (i, v) => (r(), T(wt, { to: "body" }, [
      L.value ? (r(), u("div", {
        key: 0,
        class: "modal vue-ui-draggable-dialog",
        style: P(V.value),
        onClick: v[0] || (v[0] = W(() => {
        }, ["stop"]))
      }, [
        c("div", {
          class: "modal-header",
          style: P({
            backgroundColor: X.headerBg,
            color: X.headerColor
          })
        }, [
          c("span", {
            class: "drag-handle",
            onMousedown: W(J, ["stop", "prevent"]),
            onTouchstart: W(J, ["stop", "prevent"])
          }, [
            (r(), u("svg", {
              xmlns: g(Ke),
              width: "20",
              height: "20",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "1",
              "stroke-linecap": "round",
              "stroke-linejoin": "round"
            }, v[1] || (v[1] = [
              c("path", { d: "M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
              c("path", { d: "M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
              c("path", { d: "M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
              c("path", { d: "M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
              c("path", { d: "M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
              c("path", { d: "M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1)
            ]), 8, Qt))
          ], 32),
          c("span", Zt, [
            k(i.$slots, "title", {}, void 0, !0)
          ]),
          c("button", {
            class: "close",
            onClick: q
          }, [
            qe(Yt, {
              name: "close",
              stroke: X.headerColor
            }, null, 8, ["stroke"])
          ])
        ], 4),
        c("div", ea, [
          k(i.$slots, "default", {}, void 0, !0)
        ]),
        c("div", {
          class: "resize-handle",
          onMousedown: W(K, ["stop", "prevent"]),
          onTouchstart: W(K, ["stop", "prevent"])
        }, null, 32),
        c("div", {
          class: "resize-handle resize-handle-left",
          onMousedown: W(ne, ["stop", "prevent"]),
          onTouchstart: W(ne, ["stop", "prevent"])
        }, null, 32)
      ], 4)) : y("", !0)
    ]));
  }
}, aa = /* @__PURE__ */ Qe(ta, [["__scopeId", "data-v-f854cee8"]]), la = ["id"], oa = ["xmlns", "viewBox"], sa = ["id"], na = ["stop-color"], ra = ["stop-color"], ia = ["stop-color"], ua = ["stop-color"], ca = ["id"], da = ["stop-color"], va = ["stop-color"], ha = ["stop-color"], fa = ["stop-color"], ga = { key: 0 }, ya = ["fill", "d"], pa = ["fill", "stroke", "stroke-width", "d"], ma = ["stroke", "stroke-dasharray", "stroke-width", "d"], xa = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"], ba = ["cx", "cy", "stroke", "stroke-width", "r", "fill"], ka = ["x", "y", "font-size", "font-weight", "fill", "text-decoration", "onMouseenter", "onClick"], wa = { key: 1 }, Ca = ["font-size", "fill", "font-weight", "transform", "text-anchor"], $a = ["x", "y", "width", "height", "onMouseenter", "onClick"], Aa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Sa = ["cx", "cy", "stroke", "stroke-width", "r", "fill"], _a = ["x", "y", "text-anchor", "font-size", "fill"], za = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Ma = ["onClick"], La = ["innerHTML"], Ta = {
  __name: "vue-ui-ridgeline",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint", "selectX"],
  setup(X, { expose: ye, emit: pe }) {
    const { vue_ui_ridgeline: me } = At(), $ = X, L = w({
      get() {
        return !!$.dataset && $.dataset.length;
      },
      set(a) {
        return a;
      }
    }), Y = pe, l = h(null), se = h(null), q = h(null), V = h(null), O = h(null), J = h(null), I = h(0), F = h(0), K = h(0), A = h($e()), D = h(0), ne = h(0), H = h(512), f = h(null), i = h(null), v = h(null);
    function p() {
      const a = je({
        userConfig: $.config,
        defaultConfig: me
      });
      return a.theme ? {
        ...je({
          userConfig: Et.vue_ui_ridgeline[a.theme] || $.config,
          defaultConfig: a
        }),
        customPalette: Ot[a.theme] || he
      } : a;
    }
    const e = w({
      get: () => p(),
      set: (a) => a
    }), m = h(Math.min(
      e.value.style.chart.areas.height,
      e.value.style.chart.areas.rowHeight
    )), {
      userOptionsVisible: Q,
      setUserOptionsVisibility: re,
      keepUserOptionState: Z
    } = Xt({ config: e.value }), { svgRef: xe } = It({ config: e.value.style.chart.title });
    Ct(be), $t(() => {
      V.value && V.value.disconnect();
    });
    function be() {
      if (St($.dataset) ? Ae({
        componentName: "VueUiRidgeline",
        type: "dataset"
      }) : $.dataset.forEach((a, n) => {
        Ue({
          datasetObject: a,
          requiredAttributes: ["name", "datapoints"]
        }).forEach((t) => {
          L.value = !1, Ae({
            componentName: "VueUiRidgeline",
            type: "datasetSerieAttribute",
            property: t,
            index: n
          });
        }), a.datapoints.length && a.datapoints.forEach((t, s) => {
          Ue({
            datasetObject: t,
            requiredAttributes: ["name", "values"]
          }).forEach((o) => {
            L.value = !1, Ae({
              componentName: "VueUiRidgeline",
              type: "datasetSerieAttribute",
              property: `datapoint.${o}`,
              index: `${n}-${s}`
            });
          });
        });
      }), ne.value = $.dataset.length, m.value = Math.min(
        e.value.style.chart.areas.height,
        e.value.style.chart.areas.rowHeight
      ), e.value.responsive) {
        const a = Rt(() => {
          const { width: n, height: t } = Bt({
            chart: l.value,
            title: e.value.style.chart.title.text ? se.value : null,
            legend: e.value.style.chart.legend.show ? q.value : null,
            source: O.value,
            noTitle: J.value
          });
          requestAnimationFrame(() => {
            H.value = n, m.value = t / $.dataset.length;
          });
        });
        V.value = new ResizeObserver(a), V.value.observe(l.value.parentNode);
      }
    }
    const { isPrinting: Se, isImaging: _e, generatePdf: ze, generateImage: Me } = Ft({
      elementId: `vue-ui-ridgeline_${A.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-ridgeline",
      options: e.value.userOptions.print
    }), Ze = w(() => e.value.userOptions.show && !e.value.style.chart.title.text), et = w(() => _t(e.value.customPalette)), ee = h({
      showTable: e.value.table.show
    });
    Re(() => $.config, (a) => {
      e.value = p(), Q.value = !e.value.userOptions.showOnChartHover, be(), I.value += 1, K.value += 1, m.value = Math.min(
        e.value.style.chart.areas.height,
        e.value.style.chart.areas.rowHeight
      ), ee.value.showTable = e.value.table.show;
    }, { deep: !0 }), Re(() => $.dataset, be, { deep: !0 });
    const ke = w(() => e.value.style.chart.areas.height / e.value.style.chart.areas.rowHeight);
    function Le(a) {
      N.value.includes(a) ? N.value = N.value.filter((n) => n !== a) : N.value.push(a), Y("selectLegend", G.value);
    }
    const E = w(() => L.value ? $.dataset.map((a, n) => ({
      ...a,
      labelLen: lt(a.name, e.value.style.chart.yAxis.labels.fontSize),
      uid: $e(),
      datapoints: a.datapoints.map((t, s) => {
        const o = t.color ? zt(t.color) : et.value[s] || he[s] || he[s % he.length], d = Ge(t.name);
        return {
          ...t,
          color: o,
          id: d
        };
      })
    })) : []), Te = w(() => e.value.style.chart.padding.top + m.value * $.dataset.length + m.value * ke.value), _ = w(() => ({
      fullHeight: x.value.padding.top + x.value.padding.bottom + x.value.height,
      top: x.value.padding.top,
      left: x.value.padding.left,
      right: x.value.width - x.value.padding.right,
      bottom: x.value.padding.top + x.value.height,
      width: x.value.width - (x.value.padding.left + x.value.padding.right)
    })), x = w(() => {
      const a = e.value.style.chart.padding;
      return {
        width: H.value,
        height: Te.value,
        padding: a
      };
    }), U = w(() => {
      const a = Math.max(...E.value.map((d) => d.labelLen)), n = Math.max(...E.value.flatMap((d) => d.datapoints.map((z) => z.values.length))), t = x.value.padding.left + a + 16 + e.value.style.chart.yAxis.labels.offsetX, s = (_.value.width - t) / n, o = [];
      for (let d = 0; d < n; d += 1)
        o.push({
          selectorX: t + s * d,
          x: t + s * d - s / 2,
          y: _.value.top,
          label: e.value.style.chart.xAxis.labels.values[d] || "",
          index: d,
          width: s,
          height: Te.value
        });
      return o;
    });
    function tt(a) {
      Y("selectX", E.value.map((n) => n.datapoints.map((t) => ({
        dp: t,
        selected: t.values[a.index]
      }))));
    }
    function at(a, n) {
      return a.length * n / 2 + n;
    }
    function Oe(a, n, t) {
      const s = at(n, t);
      return a + s > _.value.right;
    }
    function lt(a, n, t = "sans-serif") {
      const o = document.createElement("canvas").getContext("2d"), d = typeof n == "number" ? `${n}px` : n;
      return o.font = `${d} ${t}`, o.measureText(a).width;
    }
    const G = w(() => {
      m.value;
      const a = Math.max(...E.value.map((S) => S.labelLen)), n = Math.max(...E.value.flatMap((S) => S.datapoints.map((R) => R.values.length))), t = Math.max(...E.value.flatMap((S) => S.datapoints.flatMap((R) => R.values))), s = Math.min(...E.value.flatMap((S) => S.datapoints.flatMap((R) => R.values))), o = x.value.padding.left + a + 16 + e.value.style.chart.yAxis.labels.offsetX, d = (_.value.width - o) / n, z = Math.abs(Math.min(s, 0)), Ie = t + z;
      function Fe(S) {
        return isNaN(S / Ie) ? 0 : S / Ie;
      }
      return E.value.map((S, R) => {
        const He = _.value.top + m.value * R, B = _.value.top + He + m.value * ke.value * (1 - Fe(z));
        return {
          ...S,
          label: {
            x: o - e.value.style.chart.yAxis.labels.fontSize,
            y: B
          },
          datapoints: S.datapoints.map((ae) => {
            const le = ae.values.map((oe, ft) => {
              const gt = isNaN(oe) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(oe) ? 0 : oe || 0, yt = o + d * ft, pt = _.value.top + He + m.value * ke.value * (1 - Fe(gt + z)), mt = oe === Math.max(...ae.values);
              return {
                x: yt,
                y: pt,
                value: oe,
                isMaxPoint: mt,
                zero: B
              };
            }), dt = `${Mt(le, B, !1, !1)}`, vt = `M ${o},${B} ${Lt(le)} ${le.at(-1).x},${B}`, ht = `M ${o},${B} ${le.at(-1).x},${B}`;
            return {
              ...ae,
              uid: $e(),
              plots: le,
              smoothPath: dt,
              straightPath: vt,
              zeroPath: ht
            };
          }).filter((ae) => !N.value.includes(ae.id))
        };
      });
    }), N = h([]);
    function ot(a) {
      const n = /* @__PURE__ */ new Map();
      return a.forEach((t) => {
        t.datapoints.forEach((s, o) => {
          const d = Ge(s.name);
          n.has(d) || n.set(d, {
            id: d,
            name: s.name,
            color: s.color,
            shape: "circle",
            segregate: () => Le(d),
            isSegregated: N.value.includes(d),
            opacity: N.value.includes(d) ? 0.5 : 1
          });
        });
      }), Array.from(n.values());
    }
    const ie = w(() => ot(E.value)), st = w(() => ({
      cy: "donut-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" : ""
    })), te = h(!1);
    function nt(a) {
      te.value = a, D.value += 1;
    }
    const Ee = h({}), Pe = h([]);
    function rt(a) {
      Y("selectDatapoint", a), e.value.style.chart.dialog.show && (Pe.value = a.datapoints.map((n) => ({
        name: n.name,
        color: n.color,
        type: "line",
        useArea: !0,
        smooth: e.value.style.chart.areas.smooth,
        series: n.values
      })), i.value = a, Ee.value = Nt({
        ...e.value.style.chart.dialog.xyChart,
        responsive: !0,
        // Overriding 
        chart: {
          ...e.value.style.chart.dialog.xyChart.chart,
          grid: {
            ...e.value.style.chart.dialog.xyChart.chart.grid,
            labels: {
              ...e.value.style.chart.dialog.xyChart.chart.grid.labels,
              xAxisLabels: {
                ...e.value.style.chart.dialog.xyChart.chart.grid.labels.xAxisLabels,
                values: e.value.style.chart.xAxis.labels.values
                // Overriding
              }
            }
          },
          tooltip: {
            ...e.value.style.chart.dialog.xyChart.chart.tooltip,
            showTimeLabel: e.value.style.chart.xAxis.labels.values.length > 0
            // Overriding
          }
        }
      }), v.value && v.value.open());
    }
    const we = h(null);
    function it(a) {
      we.value = a;
    }
    function ut() {
      we.value = null;
    }
    const ue = h(!1);
    function Ce() {
      ue.value = !ue.value;
    }
    function De() {
      ee.value.showTable = !ee.value.showTable;
    }
    const Ne = w(() => ({ body: G.value.flatMap((t) => t.datapoints.flatMap((s) => ({
      ...s,
      rowName: `${t.name}: ${s.name}`
    }))).map((t) => [
      {
        name: t.rowName,
        color: t.color
      },
      ...t.values
    ]) })), ce = w(() => {
      const a = [
        e.value.table.columnNames.series,
        ...e.value.style.chart.xAxis.labels.values
      ], n = {
        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 {
        colNames: [
          e.value.table.columnNames.series,
          ...e.value.style.chart.xAxis.labels.values
        ],
        head: a,
        body: Ne.value.body,
        config: n
      };
    });
    function Xe() {
      Je(() => {
        const a = [
          [e.value.table.columnNames.series, ...e.value.style.chart.xAxis.labels.values.map((s) => [s])],
          ...Ne.value.body.map((s, o) => [s[0].name, ...s.slice(1)])
        ], n = [
          [e.value.style.chart.title.text],
          [e.value.style.chart.title.subtitle.text]
        ].concat(a), t = Pt(n);
        Dt({
          csvContent: t,
          title: e.value.style.chart.title.text || "vue-ui-ridgeline"
        });
      });
    }
    function ct() {
      return G.value;
    }
    return ye({
      getData: ct,
      generateImage: Me,
      generatePdf: ze,
      generateCsv: Xe,
      toggleAnnotator: Ce,
      toggleTable: De
    }), (a, n) => (r(), u("div", {
      ref_key: "ridgelineChart",
      ref: l,
      class: Be(`vue-ui-ridgeline ${te.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      id: `vue-ui-ridgeline_${A.value}`,
      style: P({
        fontFamily: e.value.style.fontFamily,
        width: "100%",
        textAlign: "center",
        background: e.value.style.chart.backgroundColor,
        height: e.value.responsive ? "100%" : void 0
      }),
      onMouseenter: n[4] || (n[4] = () => g(re)(!0)),
      onMouseleave: n[5] || (n[5] = () => g(re)(!1))
    }, [
      e.value.userOptions.buttons.annotator && g(xe) ? (r(), T(Gt, {
        key: 0,
        color: e.value.style.chart.color,
        backgroundColor: e.value.style.chart.backgroundColor,
        active: ue.value,
        svgRef: g(xe),
        onClose: Ce
      }, null, 8, ["color", "backgroundColor", "active", "svgRef"])) : y("", !0),
      k(a.$slots, "userConfig", {}, void 0, !0),
      Ze.value ? (r(), u("div", {
        key: 1,
        ref_key: "noTitle",
        ref: J,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : y("", !0),
      e.value.style.chart.title.text ? (r(), u("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: se,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (r(), T(Jt, {
          key: `title_${I.value}`,
          config: {
            title: {
              cy: "ridgeline-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "ridgeline-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : y("", !0),
      e.value.userOptions.show && L.value && (g(Z) || g(Q)) ? (r(), T(Ht, {
        ref: "details",
        key: `user_option_${D.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: g(Se),
        isImaging: g(_e),
        uid: A.value,
        hasTooltip: !1,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: !1,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: te.value,
        chartElement: l.value,
        position: e.value.userOptions.position,
        isTooltip: !1,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: ue.value,
        style: P({
          visibility: g(Z) ? g(Q) ? "visible" : "hidden" : "visible"
        }),
        onToggleFullscreen: nt,
        onGeneratePdf: g(ze),
        onGenerateCsv: Xe,
        onGenerateImage: g(Me),
        onToggleTable: De,
        onToggleAnnotator: Ce
      }, We({ _: 2 }, [
        a.$slots.menuIcon ? {
          name: "menuIcon",
          fn: C(({ isOpen: t, color: s }) => [
            k(a.$slots, "menuIcon", de(ve({ isOpen: t, color: s })), void 0, !0)
          ]),
          key: "0"
        } : void 0,
        a.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: C(() => [
            k(a.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        a.$slots.optionPdf ? {
          name: "optionPdf",
          fn: C(() => [
            k(a.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        a.$slots.optionCsv ? {
          name: "optionCsv",
          fn: C(() => [
            k(a.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        a.$slots.optionImg ? {
          name: "optionImg",
          fn: C(() => [
            k(a.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        a.$slots.optionTable ? {
          name: "optionTable",
          fn: C(() => [
            k(a.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        a.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: C(({ toggleFullscreen: t, isFullscreen: s }) => [
            k(a.$slots, "optionFullscreen", de(ve({ toggleFullscreen: t, isFullscreen: s })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        a.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: C(({ toggleAnnotator: t, isAnnotator: s }) => [
            k(a.$slots, "optionAnnotator", de(ve({ toggleAnnotator: t, isAnnotator: s })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "chartElement", "position", "titles", "hasAnnotator", "isAnnotation", "style", "onGeneratePdf", "onGenerateImage"])) : y("", !0),
      L.value ? (r(), u("svg", {
        key: 4,
        ref_key: "svgRef",
        ref: xe,
        xmlns: g(Ke),
        class: Be({ "vue-data-ui-fullscreen--on": te.value, "vue-data-ui-fulscreen--off": !te.value }),
        viewBox: `0 0 ${x.value.width <= 0 ? 10 : x.value.width} ${_.value.fullHeight <= 0 ? 10 : _.value.fullHeight}`,
        style: P(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color};${e.value.responsive ? "height: 100%; width: 100%;" : ""}`)
      }, [
        c("defs", null, [
          (r(!0), u(b, null, M(ie.value, (t, s) => (r(), u("linearGradient", {
            id: `gradient-${t.id}-${A.value}`,
            x1: "50%",
            y1: "0%",
            x2: "50%",
            y2: "100%"
          }, [
            c("stop", {
              offset: "0%",
              "stop-color": t.color,
              "stop-opacity": "1"
            }, null, 8, na),
            c("stop", {
              offset: "30%",
              "stop-color": t.color,
              "stop-opacity": "0.7"
            }, null, 8, ra),
            c("stop", {
              offset: "70%",
              "stop-color": t.color,
              "stop-opacity": "0.3"
            }, null, 8, ia),
            c("stop", {
              offset: "100%",
              "stop-color": t.color,
              "stop-opacity": "0.1"
            }, null, 8, ua)
          ], 8, sa))), 256)),
          (r(!0), u(b, null, M(G.value, (t, s) => (r(), u(b, null, [
            (r(!0), u(b, null, M(t.datapoints, (o, d) => (r(), u("linearGradient", {
              key: `grad${o.id}`,
              id: `gradient-single-${A.value}-${o.uid}`,
              x1: "50%",
              y1: "0%",
              x2: "50%",
              y2: "100%"
            }, [
              c("stop", {
                offset: "0%",
                "stop-color": o.color,
                "stop-opacity": "1"
              }, null, 8, da),
              c("stop", {
                offset: "30%",
                "stop-color": o.color,
                "stop-opacity": "0.7"
              }, null, 8, va),
              c("stop", {
                offset: "70%",
                "stop-color": o.color,
                "stop-opacity": "0.3"
              }, null, 8, ha),
              c("stop", {
                offset: "100%",
                "stop-color": o.color,
                "stop-opacity": "0.1"
              }, null, 8, fa)
            ], 8, ca))), 128))
          ], 64))), 256))
        ]),
        a.$slots.pattern ? (r(), u("g", ga, [
          (r(!0), u(b, null, M(ie.value, (t, s) => (r(), u("defs", null, [
            k(a.$slots, "pattern", Ye({ ref_for: !0 }, { variable: t, patternId: `pattern_${A.value}_${s}` }), void 0, !0)
          ]))), 256))
        ])) : y("", !0),
        (r(!0), u(b, null, M(G.value, (t, s) => (r(), u("g", {
          key: `ds-${s}`
        }, [
          (r(!0), u(b, null, M(t.datapoints, (o, d) => (r(), u("g", {
            key: o.id
          }, [
            c("path", {
              fill: e.value.style.chart.backgroundColor,
              stroke: "none",
              "stroke-linecap": "round",
              d: e.value.style.chart.areas.smooth ? o.smoothPath : o.straightPath,
              style: P({ opacity: e.value.style.chart.areas.opacity })
            }, null, 12, ya),
            c("path", {
              fill: e.value.style.chart.areas.useCommonColor ? `url(#gradient-${o.id}-${A.value})` : `url(#gradient-single-${A.value}-${o.uid})`,
              stroke: e.value.style.chart.areas.stroke.useSerieColor ? o.color : e.value.style.chart.areas.stroke.color,
              "stroke-width": e.value.style.chart.areas.strokeWidth,
              d: e.value.style.chart.areas.smooth ? o.smoothPath : o.straightPath,
              "stroke-linecap": "round",
              "stroke-linejoin": "round"
            }, null, 8, pa),
            c("path", {
              stroke: e.value.style.chart.zeroLine.useSerieColor ? o.color : e.value.style.chart.zeroLine.stroke,
              "stroke-dasharray": e.value.style.chart.zeroLine.strokeDasharray,
              "stroke-width": e.value.style.chart.zeroLine.strokeWidth,
              d: o.zeroPath,
              "stroke-linecap": "round"
            }, null, 8, ma),
            e.value.style.chart.areas.maxPoint.show && o.plots.length > 1 ? (r(!0), u(b, { key: 0 }, M(o.plots, (z) => (r(), u(b, null, [
              z.isMaxPoint ? (r(), u("line", {
                key: 0,
                x1: z.x,
                y1: z.y,
                x2: z.x,
                y2: z.zero,
                stroke: e.value.style.chart.areas.maxPoint.adaptStrokeToBackground ? g(Tt)(o.color) : e.value.style.chart.areas.maxPoint.stroke,
                "stroke-width": e.value.style.chart.areas.maxPoint.strokeWidth,
                "stroke-linecap": "round",
                "stroke-dasharray": e.value.style.chart.areas.maxPoint.strokeDasharray
              }, null, 8, xa)) : y("", !0)
            ], 64))), 256)) : y("", !0),
            o.plots.length === 1 ? (r(), u("circle", {
              key: 1,
              cx: o.plots[0].x,
              cy: o.plots[0].y,
              stroke: e.value.style.chart.selector.dot.stroke,
              "stroke-width": e.value.style.chart.selector.dot.strokeWidth,
              r: e.value.style.chart.selector.dot.radius,
              fill: e.value.style.chart.selector.dot.useDatapointColor ? o.color : e.value.style.chart.selector.dot.fill,
              style: {
                pointerEvents: "none"
              }
            }, null, 8, ba)) : y("", !0)
          ]))), 128)),
          c("text", {
            x: t.label.x,
            y: t.label.y,
            "text-anchor": "end",
            "font-size": e.value.style.chart.yAxis.labels.fontSize,
            "font-weight": e.value.style.chart.yAxis.labels.bold ? "bold" : "normal",
            fill: e.value.style.chart.yAxis.labels.color,
            style: P({
              cursor: e.value.style.chart.dialog.show ? "pointer" : "default"
            }),
            "text-decoration": e.value.style.chart.dialog.show && (we.value === s || i.value && t.uid === i.value.uid) ? "underline" : "",
            onMouseenter: (o) => it(s),
            onMouseleave: ut,
            onClick: (o) => rt(t)
          }, j(t.name), 45, ka)
        ]))), 128)),
        e.value.style.chart.xAxis.labels.values.length ? (r(), u("g", wa, [
          (r(!0), u(b, null, M(U.value, (t, s) => k(a.$slots, "time-label", Ye({ ref_for: !0 }, {
            show: t && !e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && !e.value.style.chart.xAxis.labels.showOnlyAtModulo || t && e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && (s === 0 || s === U.value.length - 1) || t && f.value && f.value.index === s || t && !e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && e.value.style.chart.xAxis.labels.showOnlyAtModulo && s % Math.floor(U.value.length / e.value.style.chart.xAxis.labels.modulo) === 0,
            fontSize: e.value.style.chart.xAxis.labels.fontSize,
            content: t.label,
            textAnchor: e.value.style.chart.xAxis.labels.rotation > 0 ? "start" : e.value.style.chart.xAxis.labels.rotation < 0 ? "end" : "middle",
            fill: e.value.style.chart.xAxis.labels.color,
            transform: `translate(${t.selectorX}, ${_.value.top + t.height + e.value.style.chart.xAxis.labels.offsetY}), rotate(${e.value.style.chart.xAxis.labels.rotation})`,
            x: t.selectorX,
            y: _.value.top + t.height + e.value.style.chart.xAxis.labels.offsetY
          }), () => [
            t && !e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && !e.value.style.chart.xAxis.labels.showOnlyAtModulo || t && e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && (s === 0 || s === U.value.length - 1) || t && f.value && f.value.index === s || t && !e.value.style.chart.xAxis.labels.showOnlyFirstAndLast && e.value.style.chart.xAxis.labels.showOnlyAtModulo && s % Math.floor(U.value.length / e.value.style.chart.xAxis.labels.modulo) === 0 ? (r(), u("text", {
              key: 0,
              "font-size": e.value.style.chart.xAxis.labels.fontSize,
              fill: e.value.style.chart.xAxis.labels.color,
              "font-weight": e.value.style.chart.xAxis.labels.bold ? "bold" : "normal",
              transform: `translate(${t.selectorX}, ${_.value.top + t.height + e.value.style.chart.xAxis.labels.offsetY}), rotate(${e.value.style.chart.xAxis.labels.rotation})`,
              "text-anchor": e.value.style.chart.xAxis.labels.rotation > 0 ? "start" : e.value.style.chart.xAxis.labels.rotation < 0 ? "end" : "middle",
              style: P({
                opacity: f.value ? f.value.index === s ? 1 : 0.2 : 1
              })
            }, j(t.label), 13, Ca)) : y("", !0)
          ], !0)), 256))
        ])) : y("", !0),
        c("g", null, [
          (r(!0), u(b, null, M(U.value, (t, s) => (r(), u("rect", {
            x: t.x,
            y: t.y,
            width: t.width < 0 ? 0.1 : t.width,
            height: t.height < 0 ? 0.1 : t.height,
            fill: "transparent",
            onMouseenter: (o) => f.value = t,
            onMouseleave: n[0] || (n[0] = (o) => f.value = null),
            onClick: () => tt(t)
          }, null, 40, $a))), 256)),
          e.value.style.chart.selector.show && f.value ? (r(), u("line", {
            key: 0,
            x1: f.value.selectorX,
            x2: f.value.selectorX,
            y1: f.value.y,
            y2: f.value.y + f.value.height - m.value / 2,
            stroke: e.value.style.chart.selector.stroke,
            "stroke-width": e.value.style.chart.selector.strokeWidth,
            "stroke-dasharray": e.value.style.chart.selector.strokeDasharray,
            "stroke-linecap": "round",
            style: { pointerEvents: "none" }
          }, null, 8, Aa)) : y("", !0),
          f.value ? (r(!0), u(b, { key: 1 }, M(G.value, (t) => (r(), u(b, null, [
            (r(!0), u(b, null, M(t.datapoints, (s) => (r(), u(b, null, [
              (r(!0), u(b, null, M(s.plots, (o, d) => (r(), u(b, null, [
                f.value && f.value.index === d ? (r(), u("circle", {
                  key: 0,
                  cx: o.x,
                  cy: o.y,
                  stroke: e.value.style.chart.selector.dot.stroke,
                  "stroke-width": e.value.style.chart.selector.dot.strokeWidth,
                  r: e.value.style.chart.selector.dot.radius,
                  fill: e.value.style.chart.selector.dot.useDatapointColor ? s.color : e.value.style.chart.selector.dot.fill,
                  style: {
                    pointerEvents: "none"
                  }
                }, null, 8, Sa)) : y("", !0),
                f.value && f.value.index === d ? (r(), u("text", {
                  key: 1,
                  x: Oe(
                    o.x,
                    g(fe)(
                      e.value.style.chart.selector.labels.formatter,
                      o.value,
                      g(ge)({
                        p: e.value.style.chart.xAxis.labels.prefix,
                        v: o.value,
                        s: e.value.style.chart.xAxis.labels.suffix,
                        r: e.value.style.chart.selector.labels.rounding
                      })
                    ),
                    e.value.style.chart.selector.labels.fontSize
                  ) ? o.x - e.value.style.chart.selector.labels.fontSize / 2 : o.x + e.value.style.chart.selector.labels.fontSize / 2,
                  y: o.y + e.value.style.chart.selector.labels.fontSize / 3,
                  "text-anchor": Oe(
                    o.x,
                    g(fe)(
                      e.value.style.chart.selector.labels.formatter,
                      o.value,
                      g(ge)({
                        p: e.value.style.chart.xAxis.labels.prefix,
                        v: o.value,
                        s: e.value.style.chart.xAxis.labels.suffix,
                        r: e.value.style.chart.selector.labels.rounding
                      })
                    ),
                    e.value.style.chart.selector.labels.fontSize
                  ) ? "end" : "start",
                  "font-size": e.value.style.chart.selector.labels.fontSize,
                  fill: e.value.style.chart.selector.labels.color,
                  style: {
                    pointerEvents: "none"
                  }
                }, j(g(fe)(
                  e.value.style.chart.selector.labels.formatter,
                  o.value,
                  g(ge)({
                    p: e.value.style.chart.xAxis.labels.prefix,
                    v: o.value,
                    s: e.value.style.chart.xAxis.labels.suffix,
                    r: e.value.style.chart.selector.labels.rounding
                  })
                )), 9, _a)) : y("", !0)
              ], 64))), 256))
            ], 64))), 256))
          ], 64))), 256)) : y("", !0)
        ]),
        k(a.$slots, "svg", { svg: x.value }, void 0, !0)
      ], 14, oa)) : y("", !0),
      a.$slots.watermark ? (r(), u("div", za, [
        k(a.$slots, "watermark", de(ve({ isPrinting: g(Se) || g(_e) })), void 0, !0)
      ])) : y("", !0),
      L.value ? y("", !0) : (r(), T(qt, {
        key: 6,
        config: {
          type: "ridgeline",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            ridgeline: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      c("div", {
        ref_key: "chartLegend",
        ref: q
      }, [
        e.value.style.chart.legend.show ? (r(), T(Ut, {
          key: `legend_${K.value}`,
          legendSet: ie.value,
          config: st.value,
          onClickMarker: n[1] || (n[1] = ({ legend: t }) => Le(t.id))
        }, We({
          item: C(({ legend: t }) => [
            c("div", {
              style: P(`opacity:${N.value.includes(t.id) ? 0.5 : 1}`),
              onClick: (s) => t.segregate()
            }, j(t.name), 13, Ma)
          ]),
          _: 2
        }, [
          a.$slots.pattern ? {
            name: "legend-pattern",
            fn: C(({ legend: t, index: s }) => [
              qe(jt, {
                shape: t.shape,
                radius: 30,
                stroke: "none",
                plot: { x: 30, y: 30 },
                fill: `url(#pattern_${A.value}_${s})`
              }, null, 8, ["shape", "fill"])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["legendSet", "config"])) : y("", !0),
        k(a.$slots, "legend", { legend: ie.value }, void 0, !0)
      ], 512),
      a.$slots.source ? (r(), u("div", {
        key: 7,
        ref_key: "source",
        ref: O,
        dir: "auto"
      }, [
        k(a.$slots, "source", {}, void 0, !0)
      ], 512)) : y("", !0),
      L.value ? (r(), T(Wt, {
        key: 8,
        hideDetails: "",
        config: {
          open: ee.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: C(() => [
          (r(), T(Vt, {
            key: `table_${F.value}`,
            colNames: ce.value.colNames,
            head: ce.value.head,
            body: ce.value.body,
            config: ce.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` :${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: n[2] || (n[2] = (t) => ee.value.showTable = !1)
          }, {
            th: C(({ th: t }) => [
              c("div", { innerHTML: t }, null, 8, La)
            ]),
            td: C(({ td: t }) => [
              Ve(j(t.name ? t.name : g(fe)(
                e.value.style.chart.selector.labels.formatter,
                t,
                g(ge)({
                  p: e.value.style.chart.xAxis.labels.prefix,
                  v: t,
                  s: e.value.style.chart.xAxis.labels.suffix,
                  r: e.value.table.td.roundingValue
                })
              )), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : y("", !0),
      e.value.style.chart.dialog.show ? (r(), T(aa, {
        key: 9,
        ref_key: "dialog",
        ref: v,
        onClose: n[3] || (n[3] = (t) => i.value = null),
        backgroundColor: e.value.style.chart.dialog.backgroundColor,
        color: e.value.style.chart.dialog.color,
        headerBg: e.value.style.chart.dialog.header.backgroundColor,
        headerColor: e.value.style.chart.dialog.header.color
      }, {
        title: C(() => [
          Ve(j(i.value.name), 1)
        ]),
        default: C(() => [
          i.value ? (r(), T(Kt, {
            key: 0,
            config: Ee.value,
            dataset: Pe.value
          }, null, 8, ["config", "dataset"])) : y("", !0)
        ]),
        _: 1
      }, 8, ["backgroundColor", "color", "headerBg", "headerColor"])) : y("", !0)
    ], 46, la));
  }
}, qa = /* @__PURE__ */ Qe(Ta, [["__scopeId", "data-v-d234d120"]]);
export {
  qa as default
};
