import { createApp } from 'vue'
import { createPinia } from 'pinia'

import '../node_modules/bulma/css/bulma.css'
import './assets/main.css'

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

import { SocketIoClientService } from '@/services/SocketIoClientService'
import { LoggingService } from '@/services/LoggingService'
import { AuthenticationService } from './services/AuthenticationService'
import { GameService } from './services/GameService'
import { PersistenceService } from './services/PersistenceService'

import * as PIXI from 'pixi.js'
import { gsap } from 'gsap'
import { PixiPlugin } from 'gsap/PixiPlugin'
import { InfoService } from './services/InfoService'

gsap.registerPlugin(PixiPlugin)
PixiPlugin.registerPIXI(PIXI)

const app = createApp(App)

app.use(createPinia())
app.use(i18n)
app.use(router)

app.provide('socket', new SocketIoClientService(import.meta.env.VITE_SOCKET_URL))
app.provide('logger', new LoggingService())
app.provide('auth', new AuthenticationService())
app.provide('game', new GameService())
app.provide('info', new InfoService())
PersistenceService.getInstance()

app.mount('#app')
