import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: () => import('@/layouts/SideMenu'),
    children: [
      {
        path: "/",
        name: "side-menu-dashboard",
        component: () => import('@/views/Dashboard')
      },
      {
        path: "inbox",
        name: "side-menu-inbox",
        component: () => import('@/views/Inbox')
      },
      {
        path: "file-manager",
        name: "side-menu-file-manager",
        component: () => import('@/views/FileManager')
      },
      {
        path: "point-of-sale",
        name: "side-menu-point-of-sale",
        component: () => import('@/views/PointOfSale')
      },
      {
        path: "chat",
        name: "side-menu-chat",
        component: () => import('@/views/Chat')
      },
      {
        path: "post",
        name: "side-menu-post",
        component: () => import('@/views/Post')
      },
      {
        path: "crud-data-list",
        name: "side-menu-crud-data-list",
        component: () => import('@/views/CrudDataList')
      },
      {
        path: "crud-form",
        name: "side-menu-crud-form",
        component: () => import('@/views/CrudForm')
      },
      {
        path: "users-layout-1",
        name: "side-menu-users-layout-1",
        component: () => import('@/views/UsersLayout1')
      },
      {
        path: "users-layout-2",
        name: "side-menu-users-layout-2",
        component: () => import('@/views/UsersLayout2')
      },
      {
        path: "users-layout-3",
        name: "side-menu-users-layout-3",
        component: () => import('@/views/UsersLayout3')
      },
      {
        path: "profile-overview-1",
        name: "side-menu-profile-overview-1",
        component: () => import('@/views/ProfileOverview1')
      },
      {
        path: "profile-overview-2",
        name: "side-menu-profile-overview-2",
        component: () => import('@/views/ProfileOverview2')
      },
      {
        path: "profile-overview-3",
        name: "side-menu-profile-overview-3",
        component: () => import('@/views/ProfileOverview3')
      },
      {
        path: "wizard-layout-1",
        name: "side-menu-wizard-layout-1",
        component: () => import('@/views/WizardLayout1')
      },
      {
        path: "wizard-layout-2",
        name: "side-menu-wizard-layout-2",
        component: () => import('@/views/WizardLayout2')
      },
      {
        path: "wizard-layout-3",
        name: "side-menu-wizard-layout-3",
        component: () => import('@/views/WizardLayout3')
      },
      {
        path: "blog-layout-1",
        name: "side-menu-blog-layout-1",
        component: () => import('@/views/BlogLayout1')
      },
      {
        path: "blog-layout-2",
        name: "side-menu-blog-layout-2",
        component: () => import('@/views/BlogLayout2')
      },
      {
        path: "blog-layout-3",
        name: "side-menu-blog-layout-3",
        component: () => import('@/views/BlogLayout3')
      },
      {
        path: "pricing-layout-1",
        name: "side-menu-pricing-layout-1",
        component: () => import('@/views/PricingLayout1')
      },
      {
        path: "pricing-layout-2",
        name: "side-menu-pricing-layout-2",
        component: () => import('@/views/PricingLayout2')
      },
      {
        path: "invoice-layout-1",
        name: "side-menu-invoice-layout-1",
        component: () => import('@/views/InvoiceLayout1')
      },
      {
        path: "invoice-layout-2",
        name: "side-menu-invoice-layout-2",
        component: () => import('@/views/InvoiceLayout2')
      },
      {
        path: "faq-layout-1",
        name: "side-menu-faq-layout-1",
        component: () => import('@/views/FaqLayout1')
      },
      {
        path: "faq-layout-2",
        name: "side-menu-faq-layout-2",
        component: () => import('@/views/FaqLayout2')
      },
      {
        path: "faq-layout-3",
        name: "side-menu-faq-layout-3",
        component: () => import('@/views/FaqLayout3')
      },
      {
        path: "update-profile",
        name: "side-menu-update-profile",
        component: () => import('@/views/UpdateProfile')
      },
      {
        path: "change-password",
        name: "side-menu-change-password",
        component: () => import('@/views/ChangePassword')
      },
      {
        path: "regular-table",
        name: "side-menu-regular-table",
        component: () => import('@/views/RegularTable')
      },
      {
        path: "tabulator",
        name: "side-menu-tabulator",
        component: () => import('@/views/Tabulator')
      },
      {
        path: "accordion",
        name: "side-menu-accordion",
        component: () => import('@/views/Accordion')
      },
      {
        path: "button",
        name: "side-menu-button",
        component: () => import('@/views/Button')
      },
      {
        path: "modal",
        name: "side-menu-modal",
        component: () => import('@/views/Modal')
      },
      {
        path: "alert",
        name: "side-menu-alert",
        component: () => import('@/views/Alert')
      },
      {
        path: "progress-bar",
        name: "side-menu-progress-bar",
        component: () => import('@/views/ProgressBar')
      },
      {
        path: "tooltip",
        name: "side-menu-tooltip",
        component: () => import('@/views/Tooltip')
      },
      {
        path: "dropdown",
        name: "side-menu-dropdown",
        component: () => import('@/views/Dropdown')
      },
      {
        path: "toast",
        name: "side-menu-toast",
        component: () => import('@/views/Toast')
      },
      {
        path: "typography",
        name: "side-menu-typography",
        component: () => import('@/views/Typography')
      },
      {
        path: "icon",
        name: "side-menu-icon",
        component: () => import('@/views/Icon')
      },
      {
        path: "loading-icon",
        name: "side-menu-loading-icon",
        component: () => import('@/views/LoadingIcon')
      },
      {
        path: "regular-form",
        name: "side-menu-regular-form",
        component: () => import('@/views/RegularForm')
      },
      {
        path: "datepicker",
        name: "side-menu-datepicker",
        component: () => import('@/views/Datepicker')
      },
      {
        path: "tail-select",
        name: "side-menu-tail-select",
        component: () => import('@/views/TailSelect')
      },
      {
        path: "file-upload",
        name: "side-menu-file-upload",
        component: () => import('@/views/FileUpload')
      },
      {
        path: "wysiwyg-editor",
        name: "side-menu-wysiwyg-editor",
        component: () => import('@/views/WysiwygEditor')
      },
      {
        path: "validation",
        name: "side-menu-validation",
        component: () => import('@/views/Validation')
      },
      {
        path: "chart",
        name: "side-menu-chart",
        component: () => import('@/views/Chart')
      },
      {
        path: "slider",
        name: "side-menu-slider",
        component: () => import('@/views/Slider')
      },
      {
        path: "image-zoom",
        name: "side-menu-image-zoom",
        component: () => import('@/views/ImageZoom')
      }
    ]
  },
  {
    path: "/simple-menu",
    component: () => import('@/layouts/SimpleMenu'),
    children: [
      {
        path: "/",
        name: "simple-menu-dashboard",
        component: () => import('@/views/Dashboard')
      },
      {
        path: "inbox",
        name: "simple-menu-inbox",
        component: () => import('@/views/Inbox')
      },
      {
        path: "file-manager",
        name: "simple-menu-file-manager",
        component: () => import('@/views/FileManager')
      },
      {
        path: "point-of-sale",
        name: "simple-menu-point-of-sale",
        component: () => import('@/views/PointOfSale')
      },
      {
        path: "chat",
        name: "simple-menu-chat",
        component: () => import('@/views/Chat')
      },
      {
        path: "post",
        name: "simple-menu-post",
        component: () => import('@/views/Post')
      },
      {
        path: "crud-data-list",
        name: "simple-menu-crud-data-list",
        component: () => import('@/views/CrudDataList')
      },
      {
        path: "crud-form",
        name: "simple-menu-crud-form",
        component: () => import('@/views/CrudForm')
      },
      {
        path: "users-layout-1",
        name: "simple-menu-users-layout-1",
        component: () => import('@/views/UsersLayout1')
      },
      {
        path: "users-layout-2",
        name: "simple-menu-users-layout-2",
        component: () => import('@/views/UsersLayout2')
      },
      {
        path: "users-layout-3",
        name: "simple-menu-users-layout-3",
        component: () => import('@/views/UsersLayout3')
      },
      {
        path: "profile-overview-1",
        name: "simple-menu-profile-overview-1",
        component: () => import('@/views/ProfileOverview1')
      },
      {
        path: "profile-overview-2",
        name: "simple-menu-profile-overview-2",
        component: () => import('@/views/ProfileOverview2')
      },
      {
        path: "profile-overview-3",
        name: "simple-menu-profile-overview-3",
        component: () => import('@/views/ProfileOverview3')
      },
      {
        path: "wizard-layout-1",
        name: "simple-menu-wizard-layout-1",
        component: () => import('@/views/WizardLayout1')
      },
      {
        path: "wizard-layout-2",
        name: "simple-menu-wizard-layout-2",
        component: () => import('@/views/WizardLayout2')
      },
      {
        path: "wizard-layout-3",
        name: "simple-menu-wizard-layout-3",
        component: () => import('@/views/WizardLayout3')
      },
      {
        path: "blog-layout-1",
        name: "simple-menu-blog-layout-1",
        component: () => import('@/views/BlogLayout1')
      },
      {
        path: "blog-layout-2",
        name: "simple-menu-blog-layout-2",
        component: () => import('@/views/BlogLayout2')
      },
      {
        path: "blog-layout-3",
        name: "simple-menu-blog-layout-3",
        component: () => import('@/views/BlogLayout3')
      },
      {
        path: "pricing-layout-1",
        name: "simple-menu-pricing-layout-1",
        component: () => import('@/views/PricingLayout1')
      },
      {
        path: "pricing-layout-2",
        name: "simple-menu-pricing-layout-2",
        component: () => import('@/views/PricingLayout2')
      },
      {
        path: "invoice-layout-1",
        name: "simple-menu-invoice-layout-1",
        component: () => import('@/views/InvoiceLayout1')
      },
      {
        path: "invoice-layout-2",
        name: "simple-menu-invoice-layout-2",
        component: () => import('@/views/InvoiceLayout2')
      },
      {
        path: "faq-layout-1",
        name: "simple-menu-faq-layout-1",
        component: () => import('@/views/FaqLayout1')
      },
      {
        path: "faq-layout-2",
        name: "simple-menu-faq-layout-2",
        component: () => import('@/views/FaqLayout2')
      },
      {
        path: "faq-layout-3",
        name: "simple-menu-faq-layout-3",
        component: () => import('@/views/FaqLayout3')
      },
      {
        path: "update-profile",
        name: "simple-menu-update-profile",
        component: () => import('@/views/UpdateProfile')
      },
      {
        path: "change-password",
        name: "simple-menu-change-password",
        component: () => import('@/views/ChangePassword')
      },
      {
        path: "regular-table",
        name: "simple-menu-regular-table",
        component: () => import('@/views/RegularTable')
      },
      {
        path: "tabulator",
        name: "simple-menu-tabulator",
        component: () => import('@/views/Tabulator')
      },
      {
        path: "accordion",
        name: "simple-menu-accordion",
        component: () => import('@/views/Accordion')
      },
      {
        path: "button",
        name: "simple-menu-button",
        component: () => import('@/views/Button')
      },
      {
        path: "modal",
        name: "simple-menu-modal",
        component: () => import('@/views/Modal')
      },
      {
        path: "alert",
        name: "simple-menu-alert",
        component: () => import('@/views/Alert')
      },
      {
        path: "progress-bar",
        name: "simple-menu-progress-bar",
        component: () => import('@/views/ProgressBar')
      },
      {
        path: "tooltip",
        name: "simple-menu-tooltip",
        component: () => import('@/views/Tooltip')
      },
      {
        path: "dropdown",
        name: "simple-menu-dropdown",
        component: () => import('@/views/Dropdown')
      },
      {
        path: "toast",
        name: "simple-menu-toast",
        component: () => import('@/views/Toast')
      },
      {
        path: "typography",
        name: "simple-menu-typography",
        component: () => import('@/views/Typography')
      },
      {
        path: "icon",
        name: "simple-menu-icon",
        component: () => import('@/views/Icon')
      },
      {
        path: "loading-icon",
        name: "simple-menu-loading-icon",
        component: () => import('@/views/LoadingIcon')
      },
      {
        path: "regular-form",
        name: "simple-menu-regular-form",
        component: () => import('@/views/RegularForm')
      },
      {
        path: "datepicker",
        name: "simple-menu-datepicker",
        component: () => import('@/views/Datepicker')
      },
      {
        path: "file-upload",
        name: "simple-menu-file-upload",
        component: () => import('@/views/FileUpload')
      },
      {
        path: "wysiwyg-editor",
        name: "simple-menu-wysiwyg-editor",
        component: () => import('@/views/WysiwygEditor')
      },
      {
        path: "validation",
        name: "simple-menu-validation",
        component: () => import('@/views/Validation')
      },
      {
        path: "chart",
        name: "simple-menu-chart",
        component: () => import('@/views/Chart')
      },
      {
        path: "slider",
        name: "simple-menu-slider",
        component: () => import('@/views/Slider')
      },
      {
        path: "image-zoom",
        name: "simple-menu-image-zoom",
        component: () => import('@/views/ImageZoom')
      }
    ]
  },
  {
    path: "/top-menu",
    component: () => import('@/layouts/TopMenu'),
    children: [
      {
        path: "/",
        name: "top-menu-dashboard",
        component: () => import('@/views/Dashboard')
      },
      {
        path: "inbox",
        name: "top-menu-inbox",
        component: () => import('@/views/Inbox')
      },
      {
        path: "file-manager",
        name: "top-menu-file-manager",
        component: () => import('@/views/FileManager')
      },
      {
        path: "point-of-sale",
        name: "top-menu-point-of-sale",
        component: () => import('@/views/PointOfSale')
      },
      {
        path: "chat",
        name: "top-menu-chat",
        component: () => import('@/views/Chat')
      },
      {
        path: "post",
        name: "top-menu-post",
        component: () => import('@/views/Post')
      },
      {
        path: "crud-data-list",
        name: "top-menu-crud-data-list",
        component: () => import('@/views/CrudDataList')
      },
      {
        path: "crud-form",
        name: "top-menu-crud-form",
        component: () => import('@/views/CrudForm')
      },
      {
        path: "users-layout-1",
        name: "top-menu-users-layout-1",
        component: () => import('@/views/UsersLayout1')
      },
      {
        path: "users-layout-2",
        name: "top-menu-users-layout-2",
        component: () => import('@/views/UsersLayout2')
      },
      {
        path: "users-layout-3",
        name: "top-menu-users-layout-3",
        component: () => import('@/views/UsersLayout3')
      },
      {
        path: "profile-overview-1",
        name: "top-menu-profile-overview-1",
        component: () => import('@/views/ProfileOverview1')
      },
      {
        path: "profile-overview-2",
        name: "top-menu-profile-overview-2",
        component: () => import('@/views/ProfileOverview2')
      },
      {
        path: "profile-overview-3",
        name: "top-menu-profile-overview-3",
        component: () => import('@/views/ProfileOverview3')
      },
      {
        path: "wizard-layout-1",
        name: "top-menu-wizard-layout-1",
        component: () => import('@/views/WizardLayout1')
      },
      {
        path: "wizard-layout-2",
        name: "top-menu-wizard-layout-2",
        component: () => import('@/views/WizardLayout2')
      },
      {
        path: "wizard-layout-3",
        name: "top-menu-wizard-layout-3",
        component: () => import('@/views/WizardLayout3')
      },
      {
        path: "blog-layout-1",
        name: "top-menu-blog-layout-1",
        component: () => import('@/views/BlogLayout1')
      },
      {
        path: "blog-layout-2",
        name: "top-menu-blog-layout-2",
        component: () => import('@/views/BlogLayout2')
      },
      {
        path: "blog-layout-3",
        name: "top-menu-blog-layout-3",
        component: () => import('@/views/BlogLayout3')
      },
      {
        path: "pricing-layout-1",
        name: "top-menu-pricing-layout-1",
        component: () => import('@/views/PricingLayout1')
      },
      {
        path: "pricing-layout-2",
        name: "top-menu-pricing-layout-2",
        component: () => import('@/views/PricingLayout2')
      },
      {
        path: "invoice-layout-1",
        name: "top-menu-invoice-layout-1",
        component: () => import('@/views/InvoiceLayout1')
      },
      {
        path: "invoice-layout-2",
        name: "top-menu-invoice-layout-2",
        component: () => import('@/views/InvoiceLayout2')
      },
      {
        path: "faq-layout-1",
        name: "top-menu-faq-layout-1",
        component: () => import('@/views/FaqLayout1')
      },
      {
        path: "faq-layout-2",
        name: "top-menu-faq-layout-2",
        component: () => import('@/views/FaqLayout2')
      },
      {
        path: "faq-layout-3",
        name: "top-menu-faq-layout-3",
        component: () => import('@/views/FaqLayout3')
      },
      {
        path: "update-profile",
        name: "top-menu-update-profile",
        component: () => import('@/views/UpdateProfile')
      },
      {
        path: "change-password",
        name: "top-menu-change-password",
        component: () => import('@/views/ChangePassword')
      },
      {
        path: "regular-table",
        name: "top-menu-regular-table",
        component: () => import('@/views/RegularTable')
      },
      {
        path: "tabulator",
        name: "top-menu-tabulator",
        component: () => import('@/views/Tabulator')
      },
      {
        path: "accordion",
        name: "top-menu-accordion",
        component: () => import('@/views/Accordion')
      },
      {
        path: "button",
        name: "top-menu-button",
        component: () => import('@/views/Button')
      },
      {
        path: "modal",
        name: "top-menu-modal",
        component: () => import('@/views/Modal')
      },
      {
        path: "alert",
        name: "top-menu-alert",
        component: () => import('@/views/Alert')
      },
      {
        path: "progress-bar",
        name: "top-menu-progress-bar",
        component: () => import('@/views/ProgressBar')
      },
      {
        path: "tooltip",
        name: "top-menu-tooltip",
        component: () => import('@/views/Tooltip')
      },
      {
        path: "dropdown",
        name: "top-menu-dropdown",
        component: () => import('@/views/Dropdown')
      },
      {
        path: "toast",
        name: "top-menu-toast",
        component: () => import('@/views/Toast')
      },
      {
        path: "typography",
        name: "top-menu-typography",
        component: () => import('@/views/Typography')
      },
      {
        path: "icon",
        name: "top-menu-icon",
        component: () => import('@/views/Icon')
      },
      {
        path: "loading-icon",
        name: "top-menu-loading-icon",
        component: () => import('@/views/LoadingIcon')
      },
      {
        path: "regular-form",
        name: "top-menu-regular-form",
        component: () => import('@/views/RegularForm')
      },
      {
        path: "datepicker",
        name: "top-menu-datepicker",
        component: () => import('@/views/Datepicker')
      },
      {
        path: "file-upload",
        name: "top-menu-file-upload",
        component: () => import('@/views/FileUpload')
      },
      {
        path: "wysiwyg-editor",
        name: "top-menu-wysiwyg-editor",
        component: () => import('@/views/WysiwygEditor')
      },
      {
        path: "validation",
        name: "top-menu-validation",
        component: () => import('@/views/Validation')
      },
      {
        path: "chart",
        name: "top-menu-chart",
        component: () => import('@/views/Chart')
      },
      {
        path: "slider",
        name: "top-menu-slider",
        component: () => import('@/views/Slider')
      },
      {
        path: "image-zoom",
        name: "top-menu-image-zoom",
        component: () => import('@/views/ImageZoom')
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import('@/views/Login')
  },
  {
    path: "/register",
    name: "register",
    component: () => import('@/views/Register')
  },
  {
    path: "/error-page",
    name: "error-page",
    component: () => import('@/views/ErrorPage')
  },
  {
    path: "/*",
    component: () => import('@/views/ErrorPage')
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { x: 0, y: 0 };
    }
  }
});

export default router;
