import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import store from './store'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入 Element Plus 暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
import i18n from './i18n'
import 'virtual:svg-icons-register'
import { initTheme } from '@/theme'
import { lightTheme } from '@/theme/light'
import { darkTheme } from '@/theme/dark'
import { initializeCustomNodes } from '@/nodes/custom/initialize-custom-nodes'
import '@/api/interceptor'
// import 'monaco-editor/esm/vs/editor/editor.main.css';
initTheme(lightTheme, darkTheme)
import 'normalize.css'
import 'virtual:uno.css'

const bootstrap = async () => {
	await initializeCustomNodes()

	const app = createApp(App)
	app.use(store)
	app.use(router)
	app.use(ElementPlus)

	app.provide('i18n', i18n)
	app.config.globalProperties.$t = (key: string) => i18n.t(key)

	app.mount('#app')
}

void bootstrap()
