"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const editPageEnum = require("../../../../../enums/editPageEnum.js");
require("../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
require("../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.js");
require("../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../../enums/pageEnum.js");
require("../../../../../router/index.js");
const style = require("../../../../../utils/style.js");
require("../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../../components/GoSkeleton/index.vue.js");
require("../../../../../components/GoLoading/index.js");
require("../../../../../settings/designSetting.js");
const chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
const useContextMenu_hook = require("../../../hooks/useContextMenu.hook.js");
const useDrag_hook = require("../../hooks/useDrag.hook.js");
const useStyle_hook = require("../../hooks/useStyle.hook.js");
const index = require("../EditShapeBox/index.vue.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _hoisted_1 = { class: "go-edit-group-box" };
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    groupData: {
      type: Object,
      required: true
    },
    groupIndex: {
      type: Number,
      required: true
    }
  },
  setup(__props) {
    const chartEditStore$1 = chartEditStore.useChartEditStore();
    const { handleContextMenu } = useContextMenu_hook.useContextMenu();
    const { mouseenterHandle, mouseleaveHandle, mousedownHandle, mouseClickHandle } = useDrag_hook.useMouseHandle();
    const optionsHandle = (targetList, allList, targetInstance) => {
      const filter = (menulist) => {
        return allList.filter((i) => menulist.includes(i.key));
      };
      if (chartEditStore$1.getTargetChart.selectId.length > 1) {
        return filter([editPageEnum.MenuEnum.GROUP, editPageEnum.MenuEnum.DELETE]);
      } else {
        const statusMenuEnums = [];
        if (targetInstance.status.lock) {
          statusMenuEnums.push(editPageEnum.MenuEnum.LOCK);
        } else {
          statusMenuEnums.push(editPageEnum.MenuEnum.UNLOCK);
        }
        if (targetInstance.status.hide) {
          statusMenuEnums.push(editPageEnum.MenuEnum.HIDE);
        } else {
          statusMenuEnums.push(editPageEnum.MenuEnum.SHOW);
        }
        const singleMenuEnums = [editPageEnum.MenuEnum.UN_GROUP];
        return [
          ...filter(singleMenuEnums),
          useContextMenu_hook.divider(),
          ...targetList.filter((i) => !statusMenuEnums.includes(i.key))
        ];
      }
    };
    const themeColor = runtimeCore_esmBundler.computed(() => {
      const colorCustomMergeData = style.colorCustomMerge(chartEditStore$1.getEditCanvasConfig.chartCustomThemeColorInfo);
      return colorCustomMergeData[chartEditStore$1.getEditCanvasConfig.chartThemeColor];
    });
    const themeSetting = runtimeCore_esmBundler.computed(() => {
      const chartThemeSetting = chartEditStore$1.getEditCanvasConfig.chartThemeSetting;
      return chartThemeSetting;
    });
    return (_ctx, _cache) => {
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", _hoisted_1, [
        (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(reactivity_esmBundler.unref(index.default), {
          key: __props.groupData.id,
          "data-id": __props.groupData.id,
          index: __props.groupIndex,
          item: __props.groupData,
          hiddenPoint: true,
          class: shared_esmBundler.normalizeClass(reactivity_esmBundler.unref(style.animationsClass)(__props.groupData.styles.animations)),
          style: shared_esmBundler.normalizeStyle({
            ...reactivity_esmBundler.unref(useStyle_hook.useComponentStyle)(__props.groupData.attr, __props.groupIndex),
            ...reactivity_esmBundler.unref(useStyle_hook.useSizeStyle)(__props.groupData.attr),
            ...reactivity_esmBundler.unref(style.getFilterStyle)(__props.groupData.styles),
            ...reactivity_esmBundler.unref(style.getTransformStyle)(__props.groupData.styles),
            ...reactivity_esmBundler.unref(style.getBlendModeStyle)(__props.groupData.styles)
          }),
          onClick: _cache[0] || (_cache[0] = ($event) => reactivity_esmBundler.unref(mouseClickHandle)($event, __props.groupData)),
          onMousedown: _cache[1] || (_cache[1] = ($event) => reactivity_esmBundler.unref(mousedownHandle)($event, __props.groupData)),
          onMouseenter: _cache[2] || (_cache[2] = ($event) => reactivity_esmBundler.unref(mouseenterHandle)($event, __props.groupData)),
          onMouseleave: _cache[3] || (_cache[3] = ($event) => reactivity_esmBundler.unref(mouseleaveHandle)($event, __props.groupData)),
          onContextmenu: _cache[4] || (_cache[4] = ($event) => reactivity_esmBundler.unref(handleContextMenu)($event, __props.groupData, optionsHandle))
        }, {
          default: runtimeCore_esmBundler.withCtx(() => [
            (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(__props.groupData.groupList, (item) => {
              return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(reactivity_esmBundler.unref(index.default), {
                key: item.id,
                "data-id": item.id,
                index: __props.groupIndex,
                item,
                hiddenPoint: true,
                style: shared_esmBundler.normalizeStyle({
                  ...reactivity_esmBundler.unref(useStyle_hook.useComponentStyle)(item.attr, __props.groupIndex)
                })
              }, {
                default: runtimeCore_esmBundler.withCtx(() => [
                  (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.chartConfig.chartKey), {
                    class: shared_esmBundler.normalizeClass(["edit-content-chart", reactivity_esmBundler.unref(style.animationsClass)(item.styles.animations)]),
                    chartConfig: item,
                    themeSetting: themeSetting.value,
                    themeColor: themeColor.value,
                    style: shared_esmBundler.normalizeStyle({
                      ...reactivity_esmBundler.unref(useStyle_hook.useSizeStyle)(item.attr),
                      ...reactivity_esmBundler.unref(style.getFilterStyle)(item.styles),
                      ...reactivity_esmBundler.unref(style.getTransformStyle)(item.styles)
                    })
                  }, null, 8, ["class", "chartConfig", "themeSetting", "themeColor", "style"]))
                ]),
                _: 2
              }, 1032, ["data-id", "index", "item", "style"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["data-id", "index", "item", "class", "style"]))
      ]);
    };
  }
});
exports.default = _sfc_main;
