import { toRefs as J, defineAsyncComponent as e, computed as c, ref as o, onMounted as Y, watch as O, shallowReactive as Z, openBlock as F, createElementBlock as R, createElementVNode as w, createVNode as tt, createTextVNode as et, toDisplayString as ot, unref as it, createBlock as at, resolveDynamicComponent as nt, mergeProps as rt, toHandlers as lt, createSlots as ut, renderList as st, withCtx as ct, renderSlot as gt, normalizeProps as pt, guardReactiveProps as mt } from "vue";
import dt from "./BaseIcon-CmiukQBl.js";
const Vt = {
  key: 0,
  style: { width: "100%", display: "flex", gap: "6px", "align-items": "center", color: "#FF0000" }
}, Ut = { style: { width: "36px" } }, ht = {
  __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(N, { expose: G, emit: M }) {
    const n = N, { component: W, dataset: X, config: Q } = J(n), u = {
      VueUi3dBar: e(() => import("./vue-ui-3d-bar-wDYs3sVe.js")),
      VueUiAgePyramid: e(() => import("./vue-ui-age-pyramid-BH1khaaq.js")),
      VueUiAnnotator: e(() => import("./vue-ui-annotator-B9VKE_qz.js")),
      VueUiCandlestick: e(() => import("./vue-ui-candlestick-Bjz1uFbv.js")),
      VueUiChestnut: e(() => import("./vue-ui-chestnut-D5HpkuIa.js")),
      VueUiDashboard: e(() => import("./vue-ui-dashboard-DCqe4BZg.js")),
      VueUiDigits: e(() => import("./vue-ui-digits-BEWCnojc.js")),
      VueUiDonut: e(() => import("./vue-ui-donut-g5ZLhYPx.js")),
      VueUiDonutEvolution: e(() => import("./vue-ui-donut-evolution-Cu6dmlT2.js")),
      VueUiGalaxy: e(() => import("./vue-ui-galaxy-ByKjxVWV.js")),
      VueUiGauge: e(() => import("./vue-ui-gauge-PGirbe6O.js")),
      VueUiHeatmap: e(() => import("./vue-ui-heatmap-CK3FIWpo.js")),
      VueUiKpi: e(() => import("./vue-ui-kpi-DjC68pSz.js")),
      VueUiMiniLoader: e(() => import("./vue-ui-mini-loader-CzrblCCD.js")),
      VueUiMolecule: e(() => import("./vue-ui-molecule-DBQJQs4Y.js")),
      VueUiMoodRadar: e(() => import("./vue-ui-mood-radar-Ca9wPZpJ.js")),
      VueUiNestedDonuts: e(() => import("./vue-ui-nested-donuts-C8at93dN.js")),
      VueUiOnion: e(() => import("./vue-ui-onion-B-PXxNu6.js")),
      VueUiQuadrant: e(() => import("./vue-ui-quadrant-BqOJBcsI.js")),
      VueUiRadar: e(() => import("./vue-ui-radar-BKpD9xDr.js")),
      VueUiRating: e(() => import("./vue-ui-rating-DQRuqev5.js")),
      VueUiRelationCircle: e(() => import("./vue-ui-relation-circle-nZ2nBpWX.js")),
      VueUiRings: e(() => import("./vue-ui-rings-C1PV0873.js")),
      VueUiScatter: e(() => import("./vue-ui-scatter-dgs1m3-2.js")),
      VueUiScreenshot: e(() => import("./vue-ui-screenshot-Dxj0l8Jg.js")),
      VueUiSkeleton: e(() => import("./vue-ui-skeleton-Bniq21d9.js")),
      VueUiSmiley: e(() => import("./vue-ui-smiley-D4DAZIpA.js")),
      VueUiSparkbar: e(() => import("./vue-ui-sparkbar-q0G4GvFm.js")),
      VueUiSparkgauge: e(() => import("./vue-ui-sparkgauge-DA_h9jcN.js")),
      VueUiSparkHistogram: e(() => import("./vue-ui-sparkhistogram-B1WyBiq_.js")),
      VueUiSparkline: e(() => import("./vue-ui-sparkline-ccfl0s3m.js")),
      VueUiSparkStackbar: e(() => import("./vue-ui-sparkstackbar-PNKwVRu8.js")),
      VueUiTable: e(() => import("./vue-ui-table-CsEajH9S.js")),
      VueUiTableSparkline: e(() => import("./vue-ui-table-sparkline-YV8DUOqh.js")),
      VueUiThermometer: e(() => import("./vue-ui-thermometer-DmMjSLc1.js")),
      VueUiTiremarks: e(() => import("./vue-ui-tiremarks-CCrkDgjX.js")),
      VueUiTreemap: e(() => import("./vue-ui-treemap-C4A4spvg.js")),
      VueUiVerticalBar: e(() => import("./vue-ui-vertical-bar-8iL1xiaz.js")),
      VueUiWaffle: e(() => import("./vue-ui-waffle-CaYNz-Kd.js")),
      VueUiWheel: e(() => import("./vue-ui-wheel-BRR2rGou.js")),
      VueUiXy: e(() => import("./vue-ui-xy-CXoWP8bh.js")),
      VueUiTableHeatmap: e(() => import("./vue-ui-table-heatmap-CubRipoB.js")),
      VueUiAccordion: e(() => import("./vue-ui-accordion-5d5iVpr7.js")),
      VueUiQuickChart: e(() => import("./vue-ui-quick-chart-BfXxT3KM.js")),
      VueUiCursor: e(() => import("./vue-ui-cursor-DZNIbvR2.js")),
      VueUiSparkTrend: e(() => import("./vue-ui-spark-trend-ZqrwhwqS.js")),
      VueUiStripPlot: e(() => import("./vue-ui-strip-plot-TVlnzXFq.js")),
      VueUiDumbbell: e(() => import("./vue-ui-dumbbell-bb4-Ep6o.js")),
      VueUiWordCloud: e(() => import("./vue-ui-word-cloud-y2GGxwoq.js")),
      VueUiXyCanvas: e(() => import("./vue-ui-xy-canvas-D7MrUJj7.js")),
      VueUiFlow: e(() => import("./vue-ui-flow-hD0F6mTK.js")),
      VueUiParallelCoordinatePlot: e(() => import("./vue-ui-parallel-coordinate-plot-ByM3So9k.js")),
      VueUiTimer: e(() => import("./vue-ui-timer-DvE_nqd9.js")),
      VueUiCarouselTable: e(() => import("./vue-ui-carousel-table-B6zgTL-W.js")),
      VueUiGizmo: e(() => import("./vue-ui-gizmo-ChSfBYZ_.js")),
      VueUiStackbar: e(() => import("./vue-ui-stackbar-BBYnF8qm.js")),
      VueUiBullet: e(() => import("./vue-ui-bullet-BLi9CSZw.js")),
      VueUiFunnel: e(() => import("./vue-ui-funnel-hcbE4yky.js")),
      VueUiHistoryPlot: e(() => import("./vue-ui-history-plot-EmQ-Byiz.js"))
    }, $ = {
      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"]
    }, g = c(() => !u[n.component]), j = c(() => u[n.component] || null), i = o(null), z = c(() => {
      const t = $[n.component] || [], a = {};
      return t.includes("config") && (a.config = Q.value), t.includes("dataset") && (a.dataset = X.value), a;
    }), p = o(() => null), 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);
    Y(() => {
      if (g.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("")}`);
    }), O(i, async (t) => {
      t && (t.generatePdf && (p.value = t.generatePdf), t.generateImage && (d.value = t.generateImage), t.generateCsv && (m.value = t.generateCsv), t.getItemsPositions && (V.value = t.getItemsPositions), t.toggleReadonly && (U.value = t.toggleReadonly), t.shoot && (f.value = t.shoot), t.close && (v.value = t.close), t.restoreOrder && (h.value = t.restoreOrder), t.recalculateHeight && (k.value = t.recalculateHeight), t.toggleLock && (S.value = t.toggleLock), t.toggleTable && (y.value = t.toggleTable), t.toggleLabels && (b.value = t.toggleLabels), t.toggleSort && (T.value = t.toggleSort), t.toggleStack && (A.value = t.toggleStack), t.toggleTooltip && (C.value = t.toggleTooltip), t.start && (P.value = t.start), t.pause && (D.value = t.pause), t.reset && (x.value = t.reset), t.restart && (H.value = t.restart), t.lap && (L.value = t.lap), t.toggleAnimation && (_.value = t.toggleAnimation), t.pauseAnimation && (B.value = t.pauseAnimation), t.resumeAnimation && (I.value = t.resumeAnimation), t.toggleAnnotator && (E.value = t.toggleAnnotator));
    });
    const K = () => {
      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((s) => {
        a[s] = (...l) => M(s, ...l);
      }), a;
    }, r = Z([]);
    return O([r, i], () => {
      if (i.value)
        for (; r.length; ) {
          const [t, ...a] = r.shift();
          typeof i.value[t] == "function" && i.value[t](...a);
        }
    }), G({
      getData: (...t) => i.value && typeof i.value.getData == "function" ? i.value.getData() : r.push(["getData", ...t]),
      generatePdf: p,
      generateCsv: m,
      generateImage: d,
      getItemsPositions: V,
      toggleReadonly: U,
      shoot: f,
      close: v,
      restoreOrder: h,
      recalculateHeight: k,
      toggleLock: S,
      toggleTable: y,
      toggleLabels: b,
      toggleSort: T,
      toggleStack: A,
      toggleTooltip: C,
      start: P,
      pause: D,
      reset: x,
      restart: H,
      lap: L,
      pauseAnimation: B,
      resumeAnimation: I,
      toggleAnimation: _,
      toggleAnnotator: E
    }), (t, a) => g.value ? (F(), R("div", Vt, [
      w("div", Ut, [
        tt(dt, {
          name: "moodFlat",
          stroke: "#FF0000"
        })
      ]),
      et(' The provided component "' + ot(it(W)) + '" does not exist ', 1)
    ])) : (F(), at(nt(j.value), rt({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, z.value, lt(K())), ut({ _: 2 }, [
      st(t.$slots, (s, l) => ({
        name: l,
        fn: ct((q) => [
          gt(t.$slots, l, pt(mt(q)))
        ])
      }))
    ]), 1040));
  }
};
export {
  ht as default
};
