import "../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { fetchChartComponent } from "../../../packages/index.mjs";
import { ref } from "../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const useComInstall = (localStorageInfo) => {
  const show = ref(false);
  const intervalTiming = setInterval(() => {
    if (window["$vue"].component) {
      clearInterval(intervalTiming);
      const intComponent = (target) => {
        if (!window["$vue"].component(target.chartConfig.chartKey)) {
          window["$vue"].component(target.chartConfig.chartKey, fetchChartComponent(target.chartConfig));
        }
      };
      localStorageInfo.componentList.forEach(async (e) => {
        if (e.isGroup) {
          e.groupList.forEach((groupItem) => {
            intComponent(groupItem);
          });
        } else {
          intComponent(e);
        }
      });
      show.value = true;
    }
  }, 200);
  return {
    show
  };
};
export {
  useComInstall
};
