"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const pinia = require("pinia");
const designSetting = require("../../../settings/designSetting.js");
require("../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.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");
const storageEnum = require("../../../enums/storageEnum.js");
const storage = require("../../../utils/storage.js");
require("../../../router/index.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");
const styleEnum = require("../../../enums/styleEnum.js");
const { GO_DESIGN_STORE } = storageEnum.StorageEnum;
const { darkTheme, appTheme, appThemeDetail } = designSetting.theme;
const storageDesign = storage.getLocalStorage(GO_DESIGN_STORE);
const useDesignStore = pinia.defineStore({
  id: "useDesignStore",
  state: () => storageDesign || {
    // 是否暗黑
    darkTheme,
    // 主题名称
    themeName: darkTheme && styleEnum.ThemeEnum.DARK || styleEnum.ThemeEnum.LIGHT,
    // 颜色色号
    appTheme,
    appThemeDetail
  },
  getters: {
    getDarkTheme(e) {
      return this.darkTheme;
    },
    getAppTheme() {
      return this.appTheme;
    },
    getAppThemeDetail() {
      return this.appThemeDetail;
    }
  },
  actions: {
    // 切换主题
    changeTheme() {
      this.darkTheme = !this.darkTheme;
      this.themeName = this.darkTheme ? styleEnum.ThemeEnum.DARK : styleEnum.ThemeEnum.LIGHT;
      storage.setLocalStorage(GO_DESIGN_STORE, this.$state);
    },
    // 设置颜色
    setAppColor(color) {
      this.appTheme = color.hex;
      this.appThemeDetail = color;
      storage.setLocalStorage(GO_DESIGN_STORE, this.$state);
    }
  }
});
exports.useDesignStore = useDesignStore;
