import { createApp } from 'vue'
import { createPinia } from 'pinia'
// import * as Sentry from '@sentry/vue'
import App from './App.vue'
import router from './router'
import i18n from './i18n'
import './assets/css/global.css'
import 'flag-icons/css/flag-icons.min.css'

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

app.use(pinia)
app.use(i18n)

import { useAuthStore } from './stores/auth'
const auth = useAuthStore()
auth.init()

// Sentry.init({
//   app,
//   dsn: import.meta.env.VITE_SENTRY_DSN as string,
//   integrations: [
//     Sentry.browserTracingIntegration({ router }),
//     Sentry.replayIntegration(),
//   ],
//   tracesSampleRate: 0.1,
//   replaysSessionSampleRate: 0.1,
//   replaysOnErrorSampleRate: 1.0,
//   beforeSend(event) {
//     const message =
//       event.message ?? event.exception?.values?.[0]?.value ?? ''
//     if (message.includes('Object Not Found Matching Id:')) return null
//     return event
//   },
// })

app.use(router)

app.mount('#app')
