import { createApp } from 'vue';
import App from './App.vue';
import router from './router';

import { IonicVue } from '@ionic/vue';
//
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import VueSignaturePad from 'vue-signature-pad';

/* Core CSS required for Ionic components to work properly */
import '@ionic/vue/css/core.css';

/* Basic CSS for apps built with Ionic */
import '@ionic/vue/css/normalize.css';
import '@ionic/vue/css/structure.css';
import '@ionic/vue/css/typography.css';

/* Optional CSS utils that can be commented out */
import '@ionic/vue/css/display.css';
import '@ionic/vue/css/flex-utils.css';
import '@ionic/vue/css/float-elements.css';
import '@ionic/vue/css/padding.css';
import '@ionic/vue/css/text-alignment.css';
import '@ionic/vue/css/text-transformation.css';

import './registerServiceWorker';

/* Theme variables */
import { createI18n } from 'vue-i18n';
import { globalizationList } from './services/i18n';
import './theme/variables.css';
import './theme/global.scss';

const i18n = createI18n({
	legacy: false,
	locale: 'ko', // set locale
	fallbackLocale: 'ko', // set fallback locale
	messages: globalizationList, // set locale messages
	preserveDirectiveContent: true,
});

import commonService from './services/common.service';
commonService.getSharedService().prepareInstall();
const app = createApp(App).use(IonicVue).use(router).use(VueSignaturePad).use(i18n);
commonService.setI18n(i18n.global as any);
router.isReady().then(() => {
	app.mount('#app');
});
