text: import { createRouter, createWebHistory } from 'vue-router';
  
  import GlobalUtility from '@thzero/library_client/utility/global';
  
  const routes = [
  	{
  		path: '/',
  		component: () => import('./layouts/MainLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'default',
  				component: () => import('./components/Home.vue'),
  				meta: {
  					// requiresAuth: false
  				}
  			}
  		]
  	},
  	{
  		path: '/game/:id',
  		component: () => import(/* webpackChunkName: "group-game" */ './layouts/MainLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'game',
  				component: () => import(/* webpackChunkName: "group-game" */ './components/game/Game.vue'),
  				meta: {
  					requiresAuth: true
  				}
  			}
  		]
  	},
  	{
  		path: '/openSource',
  		component: () => import(/* webpackChunkName: "group-openSource" */ './layouts/MainLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'openSource',
  				component: () => import(/* webpackChunkName: "group-openSource" */ './components/OpenSource.vue'),
  				meta: {
  					requiresAuth: false
  				}
  			}
  		]
  	},
  	{
  		path: '/support',
  		component: () => import(/* webpackChunkName: "group-support" */ './layouts/MainLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'support',
  				component: () => import(/* webpackChunkName: "group-support" */ './components/Support.vue'),
  				meta: {
  					requiresAuth: true
  				}
  			}
  		]
  	},
  	{
  		path: '/auth',
  		component: () => import(/* webpackChunkName: "group-auth" */ '@/library_vue_quasar/layouts/AuthLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'auth',
  				component: () => import(/* webpackChunkName: "group-auth" */ './components/Auth.vue'),
  				meta: {
  					requiresAuth: false
  				}
  			}
  		]
  	},
  	{
  		path: '/notFound',
  		component: () => import(/* webpackChunkName: "group-notFound" */ '@/library_vue_quasar/layouts/BlankLayout.vue'),
  		children: [
  			{
  				path: '',
  				name: 'notFound',
  				component: () => import(/* webpackChunkName: "group-notFound" */ './components/NotFound.vue'),
  				meta: {
  					requiresAuth: false
  				}
  			}
  		]
  	},
  	{
  		path: '/:pathMatch(.*)*',
  		component: () => import(/* webpackChunkName: "group-blank" */ '@/library_vue_quasar/layouts/BlankLayout.vue'),
  		meta: {
  			notFound: true,
  			requiresAuth: false
  		}
  	}
  ];
  
  // const routes = [
  //   {
  //     path: '/home',
  //     component: () => import(/* webpackChunkName: "group-home" */ './layouts/MainLayout.vue'),
  //     children: [
  //       {
  //         path: '',
  //         component: () => import(/* webpackChunkName: "group-home" */ './components/Home.vue'),
  //         meta: {
  //           requiresAuth: false
  //         }
  //       }
  //     ]
  //   },
  //   // {
  //   //   path: '/game/:id',
  //   //   component: () => import(/* webpackChunkName: "group-game" */ './layouts/MainLayout.vue'),
  //   //   children: [
  //   //     {
  //   //       path: '',
  //   //       name: 'game',
  //   //       component: () => import(/* webpackChunkName: "group-game" */ './components/game/gameSystems/Game.vue'),
  //   //       meta: {
  //   //         requiresAuth: true
  //   //       }
  //   //     }
  //   //   ]
  //   // },
  //   // {
  //   //   path: '/admin',
  //   //   component: () => import(/* webpackChunkName: "group-admin" */ '@/library_vue/layouts/AdminLayout.vue'),
  //   //   children: [
  //   //     {
  //   //       path: '',
  //   //       name: 'admin',
  //   //       component: () => import(/* webpackChunkName: "group-admin" */ './components/admin/Admin.vue'),
  //   //       meta: {
  //   //         requiresAuth: true
  //   //       }
  //   //     }
  //   //   ]
  //   // },
  //   // {
  //   //	 path: '/about',
  //   //	 component: () => import('./layouts/MainLayout.vue'),
  //   //	 children: [
  //   //		 {
  //   //			 path: '',
  //   //			 name: 'about',
  //   //			 component: () => import('./components/About.vue'),
  //   //			 meta: {
  //   //				 requiresAuth: false
  //   //			 }
  //   //		 }
  //   //	 ]
  //   // },
  //   {
  //     path: '/settings',
  //     component: () => import(/* webpackChunkName: "group-settings" */ './layouts/MainLayout.vue'),
  //     children: [
  //       {
  //         path: '',
  //         name: 'settings',
  //         component: () => import(/* webpackChunkName: "group-settings" */ './components/Settings.vue'),
  //         meta: {
  //           requiresAuth: true
  //         }
  //       }
  //     ]
  //   },
  //   {
  //     path: '/support',
  //     component: () => import(/* webpackChunkName: "group-support" */ './layouts/MainLayout.vue'),
  //     children: [
  //       {
  //         path: '',
  //         name: 'support',
  //         component: () => import(/* webpackChunkName: "group-support" */ './components/Support.vue'),
  //         meta: {
  //           requiresAuth: true
  //         }
  //       }
  //     ]
  //   },
  // ];
  
  const router = createRouter({
  	// history: createWebHashHistory(),
  	history: createWebHistory(process.env.BASE_URL),
  	routes
  });
  
  // eslint-disable-next-line
  router.beforeResolve((to, from, next) => {
  	if (to.matched.some(record => record.meta.notFound)) {
  		GlobalUtility.$navRouter.push('/notFound');
  		return;
  	}
  
  	next();
  });
  
  export default router;
  