import './assets/fonts/vazir/style.css'
import './assets/css/style.css'
import './assets/css/theme.css'
import 'primeicons/primeicons.css'

import { createApp, watch } from 'vue'
import PrimeVue from 'primevue/config';
import Ripple from 'primevue/ripple'
import Tooltip from 'primevue/tooltip';
import Badge from 'primevue/badgedirective'
import ToastService from 'primevue/toastservice'
import DialogService from 'primevue/dialogservice'
import ConfirmationService from 'primevue/confirmationservice';
import App from './App.vue'
import router from './router'
import i18n from './plugins/i18n'
import Vue3PersianDatetimePicker from 'vue3-persian-datetime-picker'

import { createPinia } from 'pinia'

import FloatLabel from 'primevue/floatlabel';
import InputGroup from 'primevue/inputgroup';
import InputGroupAddon from 'primevue/inputgroupaddon';
import Pagination from '@/components/Pagination.vue'
import Stepper from 'primevue/stepper';
import StepperPanel from 'primevue/stepperpanel';
import Calendar from 'primevue/calendar';
//import Select from 'primevue/select';

const pinia = createPinia()
const app = createApp(App)
app.use(i18n)
app.use(router)
app.use(pinia)
app.use(PrimeVue, { ripple: true, pt: {} });
app.use(ConfirmationService);
app.use(DialogService)
app.use(ToastService)

app.directive('badge', Badge)
app.directive('ripple', Ripple)
app.directive('tooltip', Tooltip);

app.component('FloatLabel', FloatLabel)
app.component('InputGroup', InputGroup)
app.component('InputGroupAddon', InputGroupAddon)
app.component('Stepper', Stepper)
app.component('StepperPanel', StepperPanel)
app.component('Calendar', Calendar)
// app.component('Select', Select)
app.component('Pagination', Pagination)
app.component('DatePicker', Vue3PersianDatetimePicker)
//app.component('date-picker', VuePersianDatetimePicker);

app.mount('body')

watch(pinia.state, (state) => localStorage.setItem('state', JSON.stringify(state)), { deep: true })
if (localStorage.getItem('state'))
    pinia.state.value = JSON.parse(localStorage.getItem('state') || '{}')


