'use strict';

var vue = require('vue');
var pinia = require('pinia');
var core = require('@vueuse/core');
require('../../../api/shopAdmin/index.js');
var postShopAdminStoreFilter = require('../../../api/shopAdmin/store/postShopAdminStoreFilter.js');

const useLineListStore = pinia.defineStore("gmLineList", () => {
  const lineList = core.useSessionStorage("gmLineList", [], { listenToStorageChanges: false });
  const isLoading = vue.ref(false);
  const getLineList = async () => {
    if (lineList.value.length !== 0) {
      isLoading.value = false;
      return;
    }
    if (isLoading.value) {
      return;
    }
    try {
      isLoading.value = true;
      const { data } = await postShopAdminStoreFilter.postShopAdminStoreFilter({ keys: "line" });
      isLoading.value = false;
      if (data.code !== 0) {
        return;
      }
      lineList.value = data.data.line;
    } catch (e) {
      console.error(e);
      isLoading.value = false;
    }
  };
  core.tryOnMounted(() => {
    getLineList();
  });
  return {
    lineList,
    isLoading,
    getLineList
  };
});

exports.useLineListStore = useLineListStore;
//# sourceMappingURL=index.js.map
