import { defineStore } from "pinia";
import { systemSetting } from "../../../settings/systemSetting.mjs";
import { asideCollapsedWidth } from "../../../settings/designSetting.mjs";
import "../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.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 { StorageEnum } from "../../../enums/storageEnum.mjs";
import { getLocalStorage, setLocalStorage } from "../../../utils/storage.mjs";
import "../../../router/index.mjs";
import "../designStore/designStore.mjs";
import "../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../components/GoSkeleton/index.vue.mjs";
import "../../../components/GoLoading/index.mjs";
const { GO_SYSTEM_SETTING_STORE } = StorageEnum;
const storageSetting = getLocalStorage(
  GO_SYSTEM_SETTING_STORE
);
const useSettingStore = defineStore({
  id: "useSettingStore",
  state: () => storageSetting || systemSetting,
  getters: {
    getHidePackageOneCategory() {
      return this.hidePackageOneCategory;
    },
    getChangeLangReload() {
      return this.changeLangReload;
    },
    getAsideAllCollapsed() {
      return this.asideAllCollapsed;
    },
    getAsideCollapsedWidth() {
      return this.asideAllCollapsed ? 0 : asideCollapsedWidth;
    },
    getChartMoveDistance() {
      return this.chartMoveDistance;
    },
    getChartAlignRange() {
      return this.chartAlignRange;
    },
    getChartToolsStatus() {
      return this.chartToolsStatus;
    },
    getChartToolsStatusHide() {
      return this.chartToolsStatusHide;
    }
  },
  actions: {
    setItem(key, value) {
      this.$patch((state) => {
        state[key] = value;
      });
      setLocalStorage(GO_SYSTEM_SETTING_STORE, this.$state);
    }
  }
});
export {
  useSettingStore
};
