import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
// Kit component CSS ships prebuilt (kit v1.0 references its fonts by a
// relative url() — the bundler resolves them into vendor dist/assets).
// Imported before the app styles so app.scss wins cascade ties.
import 'gnexus-ui-kit/css'
import './styles/main.scss'
import { GnexusUiVue } from 'gnexus-ui-kit/vue'
const app = createApp(App)
app.use(createPinia())
app.use(GnexusUiVue)
app.mount('#app')
// PWA: register the service worker in production builds only — dev never
// registers, so HMR stays untouched. Failure is silently non-fatal: without
// the SW the app still works online, just without install/offline/push.
if (import.meta.env.PROD && 'serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').catch(() => {})
}