import { toRefs as Z, defineAsyncComponent as e, computed as g, ref as o, onMounted as R, watch as F, shallowReactive as w, unref as s, openBlock as N, createElementBlock as tt, createElementVNode as et, createVNode as ot, createTextVNode as it, toDisplayString as at, createBlock as nt, resolveDynamicComponent as rt, mergeProps as lt, toHandlers as st, createSlots as ut, renderList as ct, withCtx as gt, renderSlot as pt, normalizeProps as mt, guardReactiveProps as dt } from "vue";
import Vt from "./BaseIcon-MqKW8Nkx.js";
const Ut = {
  key: 0,
  style: { width: "100%", display: "flex", gap: "6px", "align-items": "center", color: "#FF0000" }
}, ft = { style: { width: "36px" } }, kt = {
  __name: "vue-data-ui",
  props: {
    component: { type: String },
    dataset: { type: [Object, Array, Number, String] },
    config: { type: Object }
  },
  emits: [
    "selectLegend",
    "selectDatapoint",
    "toggleOpenState",
    "saveAnnotations",
    "selectRoot",
    "selectBranch",
    "selectNut",
    "change",
    "selectPlot",
    "selectSide",
    "rate",
    "postImage",
    "hoverIndex",
    "selectX",
    "toggleLock",
    "toggleTooltip",
    "start",
    "play",
    "pause",
    "reset",
    "restart",
    "lap",
    "toggleAnnotator"
  ],
  setup(G, { expose: M, emit: W }) {
    const n = G, { component: X, dataset: Q, config: $ } = Z(n), u = {
      VueUi3dBar: e(() => import("./vue-ui-3d-bar-Dy9IT7b_.js")),
      VueUiAgePyramid: e(() => import("./vue-ui-age-pyramid-CmOPXIKs.js")),
      VueUiAnnotator: e(() => import("./vue-ui-annotator-BluQy6AO.js")),
      VueUiCandlestick: e(() => import("./vue-ui-candlestick-CXH-JU3a.js")),
      VueUiChestnut: e(() => import("./vue-ui-chestnut-CgIGBZOp.js")),
      VueUiDashboard: e(() => import("./vue-ui-dashboard-D9r-_Yp9.js")),
      VueUiDigits: e(() => import("./vue-ui-digits-BsNESTvv.js")),
      VueUiDonut: e(() => import("./vue-ui-donut-CF31Tklz.js")),
      VueUiDonutEvolution: e(() => import("./vue-ui-donut-evolution-CZnbH5cI.js")),
      VueUiGalaxy: e(() => import("./vue-ui-galaxy-BqP7DV2h.js")),
      VueUiGauge: e(() => import("./vue-ui-gauge-CyEOSqK9.js")),
      VueUiHeatmap: e(() => import("./vue-ui-heatmap-DaqeL7jz.js")),
      VueUiKpi: e(() => import("./vue-ui-kpi-OogOt-5l.js")),
      VueUiMiniLoader: e(() => import("./vue-ui-mini-loader-BtIHGdFo.js")),
      VueUiMolecule: e(() => import("./vue-ui-molecule-DngGbGHv.js")),
      VueUiMoodRadar: e(() => import("./vue-ui-mood-radar-SyMnuuy_.js")),
      VueUiNestedDonuts: e(() => import("./vue-ui-nested-donuts-B77aqg1V.js")),
      VueUiOnion: e(() => import("./vue-ui-onion-DVMr8tRH.js")),
      VueUiQuadrant: e(() => import("./vue-ui-quadrant-CbLBo2J1.js")),
      VueUiRadar: e(() => import("./vue-ui-radar-nSeaMPwh.js")),
      VueUiRating: e(() => import("./vue-ui-rating-7ZT1rO63.js")),
      VueUiRelationCircle: e(() => import("./vue-ui-relation-circle-B_DnLgAX.js")),
      VueUiRings: e(() => import("./vue-ui-rings-tjWf6OXS.js")),
      VueUiScatter: e(() => import("./vue-ui-scatter-DkDSKkQd.js")),
      VueUiScreenshot: e(() => import("./vue-ui-screenshot-CBm-ePVs.js")),
      VueUiSkeleton: e(() => import("./vue-ui-skeleton-Qec_XSRf.js")),
      VueUiSmiley: e(() => import("./vue-ui-smiley-CUZPvXfN.js")),
      VueUiSparkbar: e(() => import("./vue-ui-sparkbar-BjpcvwYW.js")),
      VueUiSparkgauge: e(() => import("./vue-ui-sparkgauge-CuVY3WIf.js")),
      VueUiSparkHistogram: e(() => import("./vue-ui-sparkhistogram-CQ_jqgAF.js")),
      VueUiSparkline: e(() => import("./vue-ui-sparkline-CT-jTpEu.js")),
      VueUiSparkStackbar: e(() => import("./vue-ui-sparkstackbar-DhIOcoU4.js")),
      VueUiTable: e(() => import("./vue-ui-table-CdYHheIn.js")),
      VueUiTableSparkline: e(() => import("./vue-ui-table-sparkline-jstiTad-.js")),
      VueUiThermometer: e(() => import("./vue-ui-thermometer-1UrktBgV.js")),
      VueUiTiremarks: e(() => import("./vue-ui-tiremarks-BXN4tkeC.js")),
      VueUiTreemap: e(() => import("./vue-ui-treemap-DsuVJbU0.js")),
      VueUiVerticalBar: e(() => import("./vue-ui-vertical-bar-Cs0ksRP-.js")),
      VueUiWaffle: e(() => import("./vue-ui-waffle-D5O9qIzl.js")),
      VueUiWheel: e(() => import("./vue-ui-wheel-BMaoSHuB.js")),
      VueUiXy: e(() => import("./vue-ui-xy--mQsD4gr.js")),
      VueUiTableHeatmap: e(() => import("./vue-ui-table-heatmap-C4leKtAS.js")),
      VueUiAccordion: e(() => import("./vue-ui-accordion-BQCDXXDs.js")),
      VueUiQuickChart: e(() => import("./vue-ui-quick-chart-CYUjQKqI.js")),
      VueUiCursor: e(() => import("./vue-ui-cursor-D4ZTtWBI.js")),
      VueUiSparkTrend: e(() => import("./vue-ui-spark-trend-YDHnm7YL.js")),
      VueUiStripPlot: e(() => import("./vue-ui-strip-plot-Vu3mezCN.js")),
      VueUiDumbbell: e(() => import("./vue-ui-dumbbell-t4Mkjc_5.js")),
      VueUiWordCloud: e(() => import("./vue-ui-word-cloud-DvIc1WSa.js")),
      VueUiXyCanvas: e(() => import("./vue-ui-xy-canvas--X_m7JyY.js")),
      VueUiFlow: e(() => import("./vue-ui-flow-CcN1hHA5.js")),
      VueUiParallelCoordinatePlot: e(() => import("./vue-ui-parallel-coordinate-plot-C5BxPfiI.js")),
      VueUiTimer: e(() => import("./vue-ui-timer-ZUsvCPuO.js")),
      VueUiCarouselTable: e(() => import("./vue-ui-carousel-table-BfDwY_KY.js")),
      VueUiGizmo: e(() => import("./vue-ui-gizmo-Dt_WO6Ng.js")),
      VueUiStackbar: e(() => import("./vue-ui-stackbar-DJKoPjAW.js")),
      VueUiBullet: e(() => import("./vue-ui-bullet-22LsnNCd.js")),
      VueUiFunnel: e(() => import("./vue-ui-funnel-DfZITwCq.js")),
      VueUiHistoryPlot: e(() => import("./vue-ui-history-plot-0yszHqJq.js"))
    }, j = {
      VueUi3dBar: ["config", "dataset"],
      VueUiAgePyramid: ["config", "dataset"],
      VueUiAnnotator: ["config", "dataset"],
      VueUiCandlestick: ["config", "dataset"],
      VueUiChestnut: ["config", "dataset"],
      VueUiDashboard: ["config", "dataset"],
      VueUiDigits: ["config", "dataset"],
      VueUiDonut: ["config", "dataset"],
      VueUiDonutEvolution: ["config", "dataset"],
      VueUiGalaxy: ["config", "dataset"],
      VueUiGauge: ["config", "dataset"],
      VueUiHeatmap: ["config", "dataset"],
      VueUiKpi: ["config", "dataset"],
      VueUiMiniLoader: ["config"],
      VueUiMolecule: ["config", "dataset"],
      VueUiMoodRadar: ["config", "dataset"],
      VueUiNestedDonuts: ["config", "dataset"],
      VueUiOnion: ["config", "dataset"],
      VueUiQuadrant: ["config", "dataset"],
      VueUiRadar: ["config", "dataset"],
      VueUiRating: ["config", "dataset"],
      VueUiRelationCircle: ["config", "dataset"],
      VueUiRings: ["config", "dataset"],
      VueUiScatter: ["config", "dataset"],
      VueUiScreenshot: ["config"],
      VueUiSkeleton: ["config"],
      VueUiSmiley: ["config", "dataset"],
      VueUiSparkbar: ["config", "dataset"],
      VueUiSparkgauge: ["config", "dataset"],
      VueUiSparkHistogram: ["config", "dataset"],
      VueUiSparkline: ["config", "dataset"],
      VueUiSparkStackbar: ["config", "dataset"],
      VueUiTable: ["config", "dataset"],
      VueUiTableSparkline: ["config", "dataset"],
      VueUiThermometer: ["config", "dataset"],
      VueUiTiremarks: ["config", "dataset"],
      VueUiTreemap: ["config", "dataset"],
      VueUiVerticalBar: ["config", "dataset"],
      VueUiWaffle: ["config", "dataset"],
      VueUiWheel: ["config", "dataset"],
      VueUiXy: ["config", "dataset"],
      VueUiTableHeatmap: ["config", "dataset"],
      VueUiAccordion: ["config"],
      VueUiQuickChart: ["config", "dataset"],
      VueUiCursor: ["config"],
      VueUiSparkTrend: ["config", "dataset"],
      VueUiStripPlot: ["config", "dataset"],
      VueUiDumbbell: ["config", "dataset"],
      VueUiWordCloud: ["config", "dataset"],
      VueUiXyCanvas: ["config", "dataset"],
      VueUiFlow: ["config", "dataset"],
      VueUiParallelCoordinatePlot: ["config", "dataset"],
      VueUiTimer: ["config"],
      VueUiCarouselTable: ["config", "dataset"],
      VueUiGizmo: ["config", "dataset"],
      VueUiStackbar: ["config", "dataset"],
      VueUiBullet: ["config", "dataset"],
      VueUiFunnel: ["config", "dataset"],
      VueUiHistoryPlot: ["config", "dataset"]
    }, z = W, p = g(() => !u[n.component]), K = g(() => u[n.component] || null), i = o(null), q = g(() => {
      const t = j[n.component] || [], a = {};
      return t.includes("config") && (a.config = $.value), t.includes("dataset") && (a.dataset = Q.value), a;
    }), m = o(() => null), d = o(() => null), V = o(() => null), U = o(() => null), f = o(() => null), v = o(() => null), h = o(() => null), k = o(() => null), S = o(() => null), y = o(() => null), b = o(() => null), T = o(() => null), A = o(() => null), C = o(() => null), P = o(() => null), D = o(() => null), x = o(() => null), H = o(() => null), L = o(() => null), _ = o(() => null), B = o(() => null), I = o(() => null), E = o(() => null), O = o(() => null);
    R(() => {
      if (p.value)
        throw new Error(`

Vue Data UI exception:
The provided component "${n.component}" does not exist. Check the spelling.

Available components:

${Object.keys(u).map((t) => `. ${t}
`).join("")}`);
    }), F(i, async (t) => {
      t && (t.generatePdf && (m.value = t.generatePdf), t.generateImage && (V.value = t.generateImage), t.generateCsv && (d.value = t.generateCsv), t.getItemsPositions && (U.value = t.getItemsPositions), t.toggleReadonly && (f.value = t.toggleReadonly), t.shoot && (v.value = t.shoot), t.close && (h.value = t.close), t.restoreOrder && (k.value = t.restoreOrder), t.recalculateHeight && (S.value = t.recalculateHeight), t.toggleLock && (y.value = t.toggleLock), t.toggleTable && (b.value = t.toggleTable), t.toggleLabels && (T.value = t.toggleLabels), t.toggleSort && (A.value = t.toggleSort), t.toggleStack && (C.value = t.toggleStack), t.toggleTooltip && (P.value = t.toggleTooltip), t.start && (D.value = t.start), t.pause && (x.value = t.pause), t.reset && (H.value = t.reset), t.restart && (L.value = t.restart), t.lap && (_.value = t.lap), t.toggleAnimation && (B.value = t.toggleAnimation), t.pauseAnimation && (I.value = t.pauseAnimation), t.resumeAnimation && (E.value = t.resumeAnimation), t.toggleAnnotator && (O.value = t.toggleAnnotator));
    });
    const J = () => {
      const t = [
        "selectLegend",
        "selectDatapoint",
        "toggleOpenState",
        "saveAnnotations",
        "selectRoot",
        "selectBranch",
        "selectNut",
        "change",
        "selectPlot",
        "selectSide",
        "rate",
        "postImage",
        "hoverIndex",
        "selectX",
        "toggleLock",
        "toggleTooltip",
        "start",
        "pause",
        "reset",
        "restart",
        "lap",
        "toggleAnimation",
        "pauseAnimation",
        "resumeAnimation",
        "toggleAnnotator"
      ], a = {};
      return t.forEach((c) => {
        a[c] = (...l) => z(c, ...l);
      }), a;
    }, r = w([]);
    return F([r, i], () => {
      if (i.value)
        for (; r.length; ) {
          const [t, ...a] = r.shift();
          typeof i.value[t] == "function" && i.value[t](...a);
        }
    }), M({
      getData: (...t) => i.value && typeof i.value.getData == "function" ? i.value.getData() : r.push(["getData", ...t]),
      generatePdf: m,
      generateCsv: d,
      generateImage: V,
      getItemsPositions: U,
      toggleReadonly: f,
      shoot: v,
      close: h,
      restoreOrder: k,
      recalculateHeight: S,
      toggleLock: y,
      toggleTable: b,
      toggleLabels: T,
      toggleSort: A,
      toggleStack: C,
      toggleTooltip: P,
      start: D,
      pause: x,
      reset: H,
      restart: L,
      lap: _,
      pauseAnimation: I,
      resumeAnimation: E,
      toggleAnimation: B,
      toggleAnnotator: O
    }), (t, a) => s(p) ? (N(), tt("div", Ut, [
      et("div", ft, [
        ot(Vt, {
          name: "moodFlat",
          stroke: "#FF0000"
        })
      ]),
      it(' The provided component "' + at(s(X)) + '" does not exist ', 1)
    ])) : (N(), nt(rt(s(K)), lt({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, s(q), st(J())), ut({ _: 2 }, [
      ct(t.$slots, (c, l) => ({
        name: l,
        fn: gt((Y) => [
          pt(t.$slots, l, mt(dt(Y)))
        ])
      }))
    ]), 1040));
  }
};
export {
  kt as default
};
