import "../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import "../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.mjs";
import "../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../enums/pageEnum.mjs";
import "../../../router/index.mjs";
import "../../../store/modules/designStore/designStore.mjs";
import "../../../settings/designSetting.mjs";
import { loadAsyncComponent } from "../../../utils/components.mjs";
import "../../../components/GoSkeleton/index.vue.mjs";
import "../../../components/GoLoading/index.mjs";
import { icon } from "../../../plugins/icon.mjs";
import ContentBox from "../ContentBox/index.vue.mjs";
import { TabsEnum } from "./index.d.mjs";
import { useChartLayoutStore } from "../../../store/modules/chartLayoutStore/chartLayoutStore.mjs";
import { ChartLayoutStoreEnum } from "../../../store/modules/chartLayoutStore/chartLayoutStore.d.mjs";
import { useChartEditStore } from "../../../store/modules/chartEditStore/chartEditStore.mjs";
import { defineComponent, computed, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementBlock, Fragment, renderList, createElementVNode as createBaseVNode, resolveDynamicComponent, createCommentVNode } from "../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { toRefs, ref, unref } from "../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString } from "../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const { getDetails } = toRefs(useChartLayoutStore());
    const { setItem } = useChartLayoutStore();
    const chartEditStore = useChartEditStore();
    const { ConstructIcon, FlashIcon, DesktopOutlineIcon, LeafIcon, RocketIcon } = icon.ionicons5;
    const ContentEdit = loadAsyncComponent(() => import("../ContentEdit/index.vue.mjs"));
    const CanvasPage = loadAsyncComponent(() => import("./components/CanvasPage/index.vue.mjs"));
    const ChartSetting = loadAsyncComponent(() => import("./components/ChartSetting/index.vue.mjs"));
    const ChartData = loadAsyncComponent(() => import("./components/ChartData/index.vue.mjs"));
    loadAsyncComponent(() => import("./components/ChartEvent/index.vue.mjs"));
    loadAsyncComponent(() => import("./components/ChartAnimation/index.vue.mjs"));
    const collapsed = ref(getDetails.value);
    const tabsSelect = ref(TabsEnum.CHART_SETTING);
    const collapsedHandle = () => {
      collapsed.value = true;
      setItem(ChartLayoutStoreEnum.DETAILS, true);
    };
    const expandHandle = () => {
      collapsed.value = false;
      setItem(ChartLayoutStoreEnum.DETAILS, false);
    };
    const selectTarget = computed(() => {
      const selectId = chartEditStore.getTargetChart.selectId;
      if (selectId.length !== 1)
        return void 0;
      const target = chartEditStore.componentList[chartEditStore.fetchTargetIndex()];
      if (target == null ? void 0 : target.isGroup) {
        tabsSelect.value = TabsEnum.CHART_SETTING;
      }
      return target;
    });
    watch(getDetails, (newData) => {
      if (newData) {
        collapsedHandle();
      } else {
        expandHandle();
      }
    });
    const globalTabList = [
      {
        key: TabsEnum.PAGE_SETTING,
        title: "页面配置",
        icon: DesktopOutlineIcon,
        render: CanvasPage
      }
    ];
    const chartsDefaultTabList = [
      {
        key: TabsEnum.CHART_SETTING,
        title: "参数设置",
        icon: ConstructIcon,
        render: ChartSetting
      }
      // {
      //   key: TabsEnum.CHART_ANIMATION,
      //   title: '动画',
      //   icon: LeafIcon,
      //   render: ChartAnimation
      // }
    ];
    const chartsTabList = [
      ...chartsDefaultTabList,
      {
        key: TabsEnum.CHART_DATA,
        title: "数据源",
        icon: FlashIcon,
        render: ChartData
      }
      // {
      //   key: TabsEnum.CHART_EVENT,
      //   title: '事件',
      //   icon: RocketIcon,
      //   render: ChartEvent
      // }
    ];
    return (_ctx, _cache) => {
      const _component_n_layout_content = resolveComponent("n-layout-content");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_space = resolveComponent("n-space");
      const _component_n_tab_pane = resolveComponent("n-tab-pane");
      const _component_n_tabs = resolveComponent("n-tabs");
      const _component_n_layout_sider = resolveComponent("n-layout-sider");
      const _component_n_layout = resolveComponent("n-layout");
      return openBlock(), createBlock(_component_n_layout, {
        "has-sider": "",
        "sider-placement": "right"
      }, {
        default: withCtx(() => [
          createVNode(_component_n_layout_content, null, {
            default: withCtx(() => [
              createVNode(unref(ContentEdit))
            ]),
            _: 1
          }),
          createVNode(_component_n_layout_sider, {
            "collapse-mode": "transform",
            "collapsed-width": 0,
            width: 350,
            collapsed: collapsed.value,
            "native-scrollbar": false,
            "show-trigger": "bar",
            onCollapse: collapsedHandle,
            onExpand: expandHandle
          }, {
            default: withCtx(() => [
              createVNode(unref(ContentBox), {
                class: "go-content-configurations go-boderbox",
                "show-top": false,
                depth: 2
              }, {
                default: withCtx(() => [
                  !selectTarget.value ? (openBlock(), createBlock(_component_n_tabs, {
                    key: 0,
                    class: "tabs-box",
                    size: "small",
                    type: "segment"
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createElementBlock(Fragment, null, renderList(globalTabList, (item) => {
                        return createVNode(_component_n_tab_pane, {
                          key: item.key,
                          name: item.key,
                          size: "small",
                          "display-directive": "show:lazy"
                        }, {
                          tab: withCtx(() => [
                            createVNode(_component_n_space, null, {
                              default: withCtx(() => [
                                createBaseVNode("span", null, toDisplayString(item.title), 1),
                                createVNode(_component_n_icon, {
                                  size: "16",
                                  class: "icon-position"
                                }, {
                                  default: withCtx(() => [
                                    (openBlock(), createBlock(resolveDynamicComponent(item.icon)))
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: withCtx(() => [
                            (openBlock(), createBlock(resolveDynamicComponent(item.render)))
                          ]),
                          _: 2
                        }, 1032, ["name"]);
                      }), 64))
                    ]),
                    _: 1
                  })) : createCommentVNode("", true),
                  selectTarget.value ? (openBlock(), createBlock(_component_n_tabs, {
                    key: 1,
                    value: tabsSelect.value,
                    "onUpdate:value": _cache[0] || (_cache[0] = ($event) => tabsSelect.value = $event),
                    class: "tabs-box",
                    size: "small",
                    type: "segment"
                  }, {
                    default: withCtx(() => [
                      (openBlock(true), createElementBlock(Fragment, null, renderList(selectTarget.value.isGroup ? chartsDefaultTabList : chartsTabList, (item) => {
                        return openBlock(), createBlock(_component_n_tab_pane, {
                          key: item.key,
                          name: item.key,
                          size: "small",
                          "display-directive": "show:lazy"
                        }, {
                          tab: withCtx(() => [
                            createVNode(_component_n_space, null, {
                              default: withCtx(() => [
                                createBaseVNode("span", null, toDisplayString(item.title), 1),
                                createVNode(_component_n_icon, {
                                  size: "16",
                                  class: "icon-position"
                                }, {
                                  default: withCtx(() => [
                                    (openBlock(), createBlock(resolveDynamicComponent(item.icon)))
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: withCtx(() => [
                            (openBlock(), createBlock(resolveDynamicComponent(item.render)))
                          ]),
                          _: 2
                        }, 1032, ["name"]);
                      }), 128))
                    ]),
                    _: 1
                  }, 8, ["value"])) : createCommentVNode("", true)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["collapsed"])
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
