import Vue from 'vue'
import Router from 'vue-router'
import { normalizeURL, decode } from 'ufo'
import { interopDefault } from './utils'
import scrollBehavior from './router.scrollBehavior.js'

const _28290000 = () => interopDefault(import('..\\pages\\admin\\index.vue' /* webpackChunkName: "pages/admin/index" */))
const _2ae4e4e0 = () => interopDefault(import('..\\pages\\authenticate\\index.vue' /* webpackChunkName: "pages/authenticate/index" */))
const _6dbdd0c6 = () => interopDefault(import('..\\pages\\explore.vue' /* webpackChunkName: "pages/explore" */))
const _43d737ce = () => interopDefault(import('..\\pages\\install.vue' /* webpackChunkName: "pages/install" */))
const _e7e32368 = () => interopDefault(import('..\\pages\\project.vue' /* webpackChunkName: "pages/project" */))
const _5aa83556 = () => interopDefault(import('..\\pages\\project\\_pid\\calendar.vue' /* webpackChunkName: "pages/project/_pid/calendar" */))
const _50ddb662 = () => interopDefault(import('..\\pages\\project\\_pid\\kanban.vue' /* webpackChunkName: "pages/project/_pid/kanban" */))
const _15d89211 = () => interopDefault(import('..\\pages\\project\\_pid\\overview.vue' /* webpackChunkName: "pages/project/_pid/overview" */))
const _e0f2088a = () => interopDefault(import('..\\pages\\project\\_pid\\settings.vue' /* webpackChunkName: "pages/project/_pid/settings" */))
const _e3bb5a5e = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\components.vue' /* webpackChunkName: "pages/project/_pid/settings/components" */))
const _55c9cb86 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\general.vue' /* webpackChunkName: "pages/project/_pid/settings/general" */))
const _2a5e671e = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\import-export.vue' /* webpackChunkName: "pages/project/_pid/settings/import-export" */))
const _fd21c3fe = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\information.vue' /* webpackChunkName: "pages/project/_pid/settings/information" */))
const _17794c24 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\members.vue' /* webpackChunkName: "pages/project/_pid/settings/members" */))
const _418ae16a = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\teams.vue' /* webpackChunkName: "pages/project/_pid/settings/teams" */))
const _270fcdda = () => interopDefault(import('..\\pages\\project\\_pid\\storage.vue' /* webpackChunkName: "pages/project/_pid/storage" */))
const _1407f0a6 = () => interopDefault(import('..\\pages\\project\\_pid\\tasks.vue' /* webpackChunkName: "pages/project/_pid/tasks" */))
const _05017216 = () => interopDefault(import('..\\pages\\project\\_pid\\whiteboard.vue' /* webpackChunkName: "pages/project/_pid/whiteboard" */))
const _3f8eb900 = () => interopDefault(import('..\\pages\\settings.vue' /* webpackChunkName: "pages/settings" */))
const _bfd09246 = () => interopDefault(import('..\\pages\\settings\\account.vue' /* webpackChunkName: "pages/settings/account" */))
const _752f5d64 = () => interopDefault(import('..\\pages\\settings\\appearance.vue' /* webpackChunkName: "pages/settings/appearance" */))
const _16e21a18 = () => interopDefault(import('..\\pages\\settings\\notifications.vue' /* webpackChunkName: "pages/settings/notifications" */))
const _aab99ce8 = () => interopDefault(import('..\\pages\\admin\\users\\index.vue' /* webpackChunkName: "pages/admin/users/index" */))
const _05739a6b = () => interopDefault(import('..\\pages\\authenticate\\complete.vue' /* webpackChunkName: "pages/authenticate/complete" */))
const _3729c0de = () => interopDefault(import('..\\pages\\admin\\users\\_uid\\edit.vue' /* webpackChunkName: "pages/admin/users/_uid/edit" */))
const _63fbff75 = () => interopDefault(import('..\\pages\\profile\\_uid\\index.vue' /* webpackChunkName: "pages/profile/_uid/index" */))
const _89035b76 = () => interopDefault(import('..\\pages\\index.vue' /* webpackChunkName: "pages/index" */))

const emptyFn = () => {}

Vue.use(Router)

export const routerOptions = {
  mode: 'history',
  base: '/',
  linkActiveClass: 'nuxt-link-active',
  linkExactActiveClass: 'nuxt-link-exact-active',
  scrollBehavior,

  routes: [{
    path: "/admin",
    component: _28290000,
    name: "admin"
  }, {
    path: "/authenticate",
    component: _2ae4e4e0,
    name: "authenticate"
  }, {
    path: "/explore",
    component: _6dbdd0c6,
    name: "explore"
  }, {
    path: "/install",
    component: _43d737ce,
    name: "install"
  }, {
    path: "/project",
    component: _e7e32368,
    name: "project",
    children: [{
      path: ":pid?/calendar",
      component: _5aa83556,
      name: "project-pid-calendar"
    }, {
      path: ":pid?/kanban",
      component: _50ddb662,
      name: "project-pid-kanban"
    }, {
      path: ":pid?/overview",
      component: _15d89211,
      name: "project-pid-overview"
    }, {
      path: ":pid?/settings",
      component: _e0f2088a,
      name: "project-pid-settings",
      children: [{
        path: "components",
        component: _e3bb5a5e,
        name: "project-pid-settings-components"
      }, {
        path: "general",
        component: _55c9cb86,
        name: "project-pid-settings-general"
      }, {
        path: "import-export",
        component: _2a5e671e,
        name: "project-pid-settings-import-export"
      }, {
        path: "information",
        component: _fd21c3fe,
        name: "project-pid-settings-information"
      }, {
        path: "members",
        component: _17794c24,
        name: "project-pid-settings-members"
      }, {
        path: "teams",
        component: _418ae16a,
        name: "project-pid-settings-teams"
      }]
    }, {
      path: ":pid?/storage",
      component: _270fcdda,
      name: "project-pid-storage"
    }, {
      path: ":pid?/tasks",
      component: _1407f0a6,
      name: "project-pid-tasks"
    }, {
      path: ":pid?/whiteboard",
      component: _05017216,
      name: "project-pid-whiteboard"
    }]
  }, {
    path: "/settings",
    component: _3f8eb900,
    name: "settings",
    children: [{
      path: "account",
      component: _bfd09246,
      name: "settings-account"
    }, {
      path: "appearance",
      component: _752f5d64,
      name: "settings-appearance"
    }, {
      path: "notifications",
      component: _16e21a18,
      name: "settings-notifications"
    }]
  }, {
    path: "/admin/users",
    component: _aab99ce8,
    name: "admin-users"
  }, {
    path: "/authenticate/complete",
    component: _05739a6b,
    name: "authenticate-complete"
  }, {
    path: "/admin/users/:uid/edit",
    component: _3729c0de,
    name: "admin-users-uid-edit"
  }, {
    path: "/profile/:uid",
    component: _63fbff75,
    name: "profile-uid"
  }, {
    path: "/",
    component: _89035b76,
    name: "index"
  }],

  fallback: false
}

export function createRouter (ssrContext, config) {
  const base = (config._app && config._app.basePath) || routerOptions.base
  const router = new Router({ ...routerOptions, base  })

  // TODO: remove in Nuxt 3
  const originalPush = router.push
  router.push = function push (location, onComplete = emptyFn, onAbort) {
    return originalPush.call(this, location, onComplete, onAbort)
  }

  const resolve = router.resolve.bind(router)
  router.resolve = (to, current, append) => {
    if (typeof to === 'string') {
      to = normalizeURL(to)
    }
    return resolve(to, current, append)
  }

  return router
}
