import './components/dashboard/echarts-setup';
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import App from './App.vue';
import router from './router';
import i18n from './i18n';
import { ensureStaffSession } from './utils/session-hydrate';

async function bootstrap() {
  if (localStorage.getItem('manage_token')) {
    await ensureStaffSession();
  }

  createApp(App).use(i18n).use(router).use(ElementPlus).mount('#app');
}

void bootstrap();
