
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import * as Sentry from '@sentry/vue';

import { 
    deepClone,
    parseTime, 
} from '@/utils/ruoyi.js'




import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import "@/assets/styles/index.scss"; // global css 

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import App from './App.vue'
import router from './router'

const pinia = createPinia()
const app = createApp(App) 

app.config.globalProperties.parseTime = parseTime;

// Sentry.init({
//     app,
//     dsn: 'https://34a0d76174a64db09d31d13a8042560b@sentry.cnsdt.com/2', // 替换为你的 DSN
//     integrations: [
//       // 浏览器性能追踪集成 
//       Sentry.browserTracingIntegration({
//         router,
//       }),
//       // 会话回放集成
//       Sentry.replayIntegration({
//         maskAllText: false,
//         blockAllMedia: false,
//       }),
//     ],
//     // 性能监控采样率
//     tracesSampleRate: 1.0, // 生产环境建议设置为 0.1-0.2
//     // 会话回放采样率
//     replaysSessionSampleRate: 0.1,
//     replaysOnErrorSampleRate: 1.0,
//     // 环境配置
//     environment: import.meta.env.MODE, 
//     // 开发环境下可禁用 Sentry
//     enabled: import.meta.env.PROD,
//   });

for (const [key, component] of Object.entries(ElementPlusIconsVue)) { 
    app.component(key, component)
}

//全局组件
import Pagination from '@/components/Pagination/index.vue'

app.component('Pagination', Pagination)
app.use(pinia)
app.use(router)
app.use(ElementPlus, {
    locale: zhCn,
})

app.mount('#app')
