import { defineComponent as x, computed as I, ref as v, onMounted as T, nextTick as g, createElementBlock as l, openBlock as s, normalizeStyle as a, unref as n, createCommentVNode as k, Fragment as V, renderList as w, withModifiers as N, normalizeClass as B, createElementVNode as D, createVNode as W } from "vue";
import { useResizeObserver as _ } from "@vueuse/core";
import { useWatch as H } from "./hooks/useWatch.mjs";
/* empty css                                     */
/* empty css                                     */
import "../Tabs/index.mjs";
import "./index.mjs";
import "../Button/index.mjs";
import "../DatePicker/index.mjs";
import "../DatePickerRange/index.mjs";
import "../Switch/index.mjs";
import "../Input/index.mjs";
import "../Select/index.mjs";
import "../Slider/index.mjs";
import "../../../Text/components/List/index.mjs";
import "../../../Text/components/Text/index.mjs";
import "../../../Text/components/TextDynamic/index.mjs";
import "../../../Text/components/TableBasic/index.mjs";
import "../../../Text/components/TableScroll/index.mjs";
import "../../../Text/components/RowScroll/index.mjs";
import "../../../Text/components/RealTime/index.mjs";
import "../../../Text/components/OverNumber/index.mjs";
import "../../../Text/components/CountDown/index.mjs";
import "../../../Text/components/TextCarousel/index.mjs";
import "../../../Media/components/Audio/index.mjs";
import "../../../Media/components/Video/index.mjs";
import "../../../Media/components/Carousel/index.mjs";
import "../../../Media/components/Flv/index.mjs";
import "../../../Media/components/Iframe/index.mjs";
import "../../../Media/components/IframeCarousel/index.mjs";
import "../../../Media/components/Image/index.mjs";
import "../../../Media/components/ImageDynamic/index.mjs";
import "../../../Media/components/M3u8/index.mjs";
import "../../../Media/components/Wavesurfer/index.mjs";
import "../../../Media/components/Weather/index.mjs";
import "../../../Media/components/Qrcode/index.mjs";
import "../../../Chart/components/bar/basic/index.mjs";
import "../../../Chart/components/bar/animation/index.mjs";
import "../../../Chart/components/bar/contrast/index.mjs";
import "../../../Chart/components/bar/contrast2/index.mjs";
import "../../../Chart/components/bar/contrast3/index.mjs";
import "../../../Chart/components/bar/gradient-column-chart/index.mjs";
import "../../../Chart/components/bar/horizontal/index.mjs";
import "../../../Chart/components/bar/horizontal-stack/index.mjs";
import "../../../Chart/components/bar/line-bar/index.mjs";
import "../../../Chart/components/bar/line-bar2/index.mjs";
import "../../../Chart/components/bar/loop/index.mjs";
import "../../../Chart/components/bar/mini/index.mjs";
import "../../../Chart/components/bar/polar/index.mjs";
import "../../../Chart/components/bar/polar-stack/index.mjs";
import "../../../Chart/components/bar/polar2/index.mjs";
import "../../../Chart/components/bar/radius-circle/index.mjs";
import "../../../Chart/components/bar/rank/index.mjs";
import "../../../Chart/components/bar/segmented-progress/index.mjs";
import "../../../Chart/components/bar/spire/index.mjs";
import "../../../Chart/components/bar/stack/index.mjs";
import "../../../Chart/components/bar/stack-line/index.mjs";
import "../../../Chart/components/bar/stack2/index.mjs";
import "../../../Chart/components/bar/stack3/index.mjs";
import "../../../Chart/components/bar/staggered/index.mjs";
import "../../../Chart/components/bar/three/index.mjs";
import "../../../Chart/components/bar/waterfall/index.mjs";
import "../../../Chart/components/bar/zebra/index.mjs";
import "../../../Chart/components/line/area-gradient/index.mjs";
import "../../../Chart/components/line/area-highlight/index.mjs";
import "../../../Chart/components/line/area-highlight2/index.mjs";
import "../../../Chart/components/line/basic/index.mjs";
import "../../../Chart/components/line/bump/index.mjs";
import "../../../Chart/components/line/dashed/index.mjs";
import "../../../Chart/components/line/ladder/index.mjs";
import "../../../Chart/components/line/logarithm/index.mjs";
import "../../../Chart/components/line/multix/index.mjs";
import "../../../Chart/components/line/polar-double/index.mjs";
import "../../../Chart/components/line/rain-flow/index.mjs";
import "../../../Chart/components/line/scale/index.mjs";
import "../../../Chart/components/line/smooth/index.mjs";
import "../../../Chart/components/line/smooth-area/index.mjs";
import "../../../Chart/components/line/stack/index.mjs";
import "../../../Chart/components/line/stack-area/index.mjs";
import "../../../Chart/components/line/temp/index.mjs";
import "../../../Chart/components/line/vertical/index.mjs";
import "../../../Chart/components/map/basic/index.mjs";
import "../../../Chart/components/map/bmap-basic/index.mjs";
import "../../../Chart/components/map/bmap-heatmap/index.mjs";
import "../../../Chart/components/map/bmap-rich/index.mjs";
import "../../../Chart/components/map/customize/index.mjs";
import "../../../Chart/components/map/lines/index.mjs";
import "../../../Chart/components/map/scatter/index.mjs";
import "../../../Chart/components/pie/3d/index.mjs";
import "../../../Chart/components/pie/basic/index.mjs";
import "../../../Chart/components/pie/basic2/index.mjs";
import "../../../Chart/components/pie/customized/index.mjs";
import "../../../Chart/components/pie/index/index.mjs";
import "../../../Chart/components/pie/interval/index.mjs";
import "../../../Chart/components/pie/legend-scroll/index.mjs";
import "../../../Chart/components/pie/radius/index.mjs";
import "../../../Chart/components/pie/rose/index.mjs";
import "../../../Chart/components/pie/round/index.mjs";
import "../../../Chart/components/pie/sunburst/index.mjs";
import "../../../Chart/components/scatter/basic/index.mjs";
import "../../../Chart/components/scatter/basic2/index.mjs";
import "../../../Chart/components/scatter/bubble/index.mjs";
import "../../../Chart/components/scatter/ripples/index.mjs";
import "../../../Chart/components/other/candlestick-basic/index.mjs";
import "../../../Chart/components/other/sunburst-basic/index.mjs";
import "../../../Chart/components/other/sunburst-basic2/index.mjs";
import "../../../Chart/components/other/sunburst-basic3/index.mjs";
import "../../../Chart/components/other/sunburst-basic4/index.mjs";
import "../../../Chart/components/other/sunburst-book/index.mjs";
import "../../../Chart/components/other/sunburst-flavors/index.mjs";
import "../../../Chart/components/other/sunburst-radius/index.mjs";
import "../../../Chart/components/other/funnel/index.mjs";
import "../../../Chart/components/other/funnel-contrast/index.mjs";
import "../../../Chart/components/other/funnel-split/index.mjs";
import "../../../Chart/components/other/funnel2/index.mjs";
import "../../../Chart/components/other/force/index.mjs";
import "../../../Chart/components/other/force2/index.mjs";
import "../../../Chart/components/other/gauge/index.mjs";
import "../../../Chart/components/other/gauge-grade/index.mjs";
import "../../../Chart/components/other/gauge-stage/index.mjs";
import "../../../Chart/components/other/graph-basic/index.mjs";
import "../../../Chart/components/other/graph-basic2/index.mjs";
import "../../../Chart/components/other/graph-calendar/index.mjs";
import "../../../Chart/components/other/circular-graph/index.mjs";
import "../../../Chart/components/other/heatmap/index.mjs";
import "../../../Chart/components/other/liquidfill/index.mjs";
import "../../../Chart/components/other/parallel-basic/index.mjs";
import "../../../Chart/components/other/parallel-mul/index.mjs";
import "../../../Chart/components/other/radar-stack/index.mjs";
import "../../../Chart/components/other/tree/index.mjs";
import "../../../Chart/components/other/tree-line/index.mjs";
import "../../../Chart/components/other/word-cloud/index.mjs";
import "../../../Chart/components/other/treemap/index.mjs";
import "../../../Chart/components/other/treemap-basic/index.mjs";
import "../../../Chart/components/other/label-gauge/index.mjs";
import "../../../Chart/components/other/grid-percentage/index.mjs";
import "../../../Chart/components/other/radar/index.mjs";
import "../../../Commons/components/CustomComponentRender/index.mjs";
import "../../../Commons/components/Graphical/index.mjs";
import "../../../Commons/components/Svg/index.mjs";
import "../../../Commons/components/ModelViewer/index.mjs";
import "../../../Commons/components/VrVideo/index.mjs";
import "../../../Commons/components/VrPhoto/index.mjs";
import "../../../Commons/components/Babylon/index.mjs";
import "../../../Commons/components/Echarts/index.mjs";
import "../../../Commons/components/GSViewer/index.mjs";
import "../../../Scene/components/Amap2d/index.mjs";
import "../../../Scene/components/Amap3d/index.mjs";
import "../../../Scene/components/Default/index.mjs";
import "../../../Scene/components/Map2d/index.mjs";
import "../../../Scene/components/Map3d/index.mjs";
import "../../../Scene/components/UeIframe/index.mjs";
import "../../../Scene/components/UeShj/index.mjs";
import "../../../Scene/components/UnityIframe/index.mjs";
import "../../../Scene/components/UnityWebgl/index.mjs";
import "../../../Scene/components/Vr/index.mjs";
import "../../../Scene/components/Earth/index.mjs";
import { SHJDatasourceV2 as J } from "../../../../commons/plugins/datasource/index.mjs";
import { SHJParseEvent as d } from "../../../../commons/plugins/event/index.mjs";
import "lodash";
import { Utils as c } from "../../../../commons/utils/utils.mjs";
import M from "../../../../commons/components/Text.vue.mjs";
import { upgradeTabsIcon as R } from "./version.mjs";
const F = ["onClick"], P = ["src"], U = x({ name: "ShjTabsIcon" }), Gr = /* @__PURE__ */ x({
  ...U,
  props: {
    option: {},
    sources: {},
    useEvents: {}
  },
  emits: ["on-change"],
  setup(p, { expose: j, emit: C }) {
    const t = I(() => R(p.option)), E = C, m = v([]), o = v(t.value.default.value), u = () => {
      J.parse({
        sources: p.sources,
        callback: ({ data: r }) => {
          if (!(r && r.length > 0)) {
            m.value = [], d.parseEvents(p.useEvents, "dataListener", []);
            return;
          }
          m.value = r[0].data, d.parseEvents(p.useEvents, "dataListener", m.value), t.value.default.isDefaultSelect && (o.value = t.value.default.value, !o.value && m.value.length > 0 && (o.value = m.value[0].value)), b();
        }
      });
    }, S = (r) => {
      r.value !== o.value && (E("on-change", r), d.parseEvents(p.useEvents, "on-change", r)), o.value = r.value;
    }, i = v(null), h = 150, f = v(!1), b = () => {
      g(() => {
        if (i.value) {
          const { scrollWidth: r, clientWidth: y } = i.value;
          f.value = r > y;
        }
      });
    }, z = () => {
      i.value && (i.value.scrollLeft -= h);
    }, L = () => {
      i.value && (i.value.scrollLeft += h);
    };
    return _(i, () => b()), T(() => {
      g(() => {
        u();
      });
    }), H({ option: t.value, sources: p.sources }, u, o, m), j({
      refresh: () => u(),
      refreshView: () => {
      },
      // 刷新视图 无需刷新
      refreshData: () => u()
    }), (r, y) => (s(), l("div", {
      ref_key: "tabsContainer",
      ref: i,
      class: "height-100 flex overflow-hidden scroll-behavior-smooth",
      style: a(n(c).json2cssObject(t.value.style.layout))
    }, [
      f.value ? (s(), l("button", {
        key: 0,
        class: "flex-none cursor-pointer position-absolute translate-center-left-active-scale-095 top-50 background-size-cover",
        style: a(n(c).json2cssObject(t.value.style.nav.left)),
        onClick: z
      }, null, 4)) : k("", !0),
      (s(!0), l(V, null, w(m.value, (e, O) => (s(), l("div", {
        key: O,
        class: B(["flex flex-none position-relative cursor-pointer transition-color-background-color background-size-cover", { selected: e.value === o.value }]),
        style: a(
          n(c).json2cssObject(
            e.value === o.value ? t.value.style.item.selected : t.value.style.item
          )
        ),
        onClick: N(($) => S(e), ["stop"])
      }, [
        D("img", {
          class: "img-drag-none img-30",
          style: a(
            n(c).json2cssObject(
              e.value === o.value ? t.value.style.item.selected.img : t.value.style.item.img
            )
          ),
          src: e.value === o.value ? e.selectedImg : e.defaultImg
        }, null, 12, P),
        W(M, {
          "text-style": e.value === o.value ? t.value.style.item.selected.textStyle : t.value.style.item.textStyle,
          text: e.label
        }, null, 8, ["text-style", "text"])
      ], 14, F))), 128)),
      f.value ? (s(), l("button", {
        key: 1,
        class: "flex-none cursor-pointer position-absolute translate-center-right-active-scale-095 top-50 background-size-cover",
        style: a(n(c).json2cssObject(t.value.style.nav.right)),
        onClick: L
      }, null, 4)) : k("", !0)
    ], 4));
  }
});
export {
  Gr as default
};
