import {Routes} from '@angular/router';
import {AuthGuard} from './guards/auth.guard';

export const routes: Routes = [
  {
    path: 'worlddl',
    redirectTo: 'redirect/worlddl',
    pathMatch: 'full'
  },
  {
    path: 'grove-dl',
    redirectTo: 'redirect/grove-dl',
    pathMatch: 'full'
  },
  {
    path: 'redirect/:type',
    loadComponent: () => import('./shared-components/redirect/redirect.component').then(m => m.RedirectComponent),
  },
  {
    path: 'login/:code',
    loadComponent: () => import('./pages/home/home.component').then(m => m.HomeComponent),
    canActivate: [AuthGuard],
    data: {
      requiredAuthorizations: ['SCOPE_user']
    }
  },
  {
    path: '',
    loadComponent: () => import('./pages/home/home.component').then(m => m.HomeComponent)
  },
  {
    path: 'particles',
    loadComponent: () => import('./pages/particles/particles.component').then(m => m.ParticlesComponent),
    canActivate: [AuthGuard],
    data: {
      requiredAuthorizations: ['SCOPE_head_mod']
    }
  },
  {
    path: 'staff-pt',
    loadComponent: () => import('./pages/head-mod/staff-pt/staff-pt.component').then(m => m.StaffPtComponent),
    canActivate: [AuthGuard],
    data: {
      requiredAuthorizations: ['SCOPE_head_mod']
    }
  },
  {
    path: 'map',
    loadComponent: () => import('./pages/features/map/map.component').then(m => m.MapComponent)
  },
  {
    path: 'rules',
    loadComponent: () => import('./pages/reference/rules/rules.component').then(m => m.RulesComponent)
  },
  {
    path: 'vote',
    loadComponent: () => import('./pages/vote/vote.component').then(m => m.VoteComponent)
  },
  {
    path: 'about',
    loadComponent: () => import('./pages/altitude/about/about.component').then(m => m.AboutComponent)
  },
  {
    path: 'socials',
    loadComponent: () => import('./pages/altitude/socials/socials.component').then(m => m.SocialsComponent)
  },
  {
    path: 'team',
    loadComponent: () => import('./pages/altitude/team/team.component').then(m => m.TeamComponent)
  },
  {
    path: 'birthdays',
    loadComponent: () => import('./pages/altitude/birthdays/birthdays.component').then(m => m.BirthdaysComponent)
  },
  {
    path: 'terms',
    loadComponent: () => import('./pages/footer/terms/terms.component').then(m => m.TermsComponent)
  },
  {
    path: 'privacy',
    loadComponent: () => import('./pages/footer/privacy/privacy.component').then(m => m.PrivacyComponent)
  },
  {
    path: 'bans',
    loadComponent: () => import('./pages/reference/bans/bans.component').then(m => m.BansComponent)
  },
  {
    path: 'bans/:type/:id',
    loadComponent: () => import('./pages/reference/bans/details/details.component').then(m => m.DetailsComponent)
  },
  {
    path: 'economy',
    loadComponent: () => import('./pages/features/economy/economy.component').then(m => m.EconomyComponent)
  },
  {
    path: 'claiming',
    loadComponent: () => import('./pages/features/claiming/claiming.component').then(m => m.ClaimingComponent)
  },
  {
    path: 'mypet',
    loadComponent: () => import('./pages/features/mypet/mypet.component').then(m => m.MypetComponent)
  },
  {
    path: 'warps',
    loadComponent: () => import('./pages/features/warps/warps.component').then(m => m.WarpsComponent)
  },
  {
    path: 'skyblock',
    loadComponent: () => import('./pages/features/skyblock/skyblock.component').then(m => m.SkyblockComponent)
  },
  {
    path: 'customfeatures',
    loadComponent: () => import('./pages/features/customfeatures/customfeatures.component').then(m => m.CustomfeaturesComponent)
  },
  {
    path: 'guide',
    loadComponent: () => import('./pages/reference/guide/guide.component').then(m => m.GuideComponent)
  },
  {
    path: 'ranks',
    loadComponent: () => import('./pages/reference/ranks/ranks.component').then(m => m.RanksComponent)
  },
  {
    path: 'commandlist',
    loadComponent: () => import('./pages/reference/commandlist/commandlist.component').then(m => m.CommandlistComponent)
  },
  {
    path: 'mapart',
    loadComponent: () => import('./pages/reference/mapart/mapart.component').then(m => m.MapartComponent)
  },
  {
    path: 'lag',
    loadComponent: () => import('./pages/reference/lag/lag.component').then(m => m.LagComponent)
  },
  {
    path: 'staffpowers',
    loadComponent: () => import('./pages/reference/staffpowers/staffpowers.component').then(m => m.StaffpowersComponent)
  },
  {
    path: 'forms',
    loadComponent: () => import('./pages/forms/forms.component').then(m => m.FormsComponent)
  },
  {
    path: 'appeal/:code',
    redirectTo: 'forms/appeal/:code',
    pathMatch: 'full'
  },
  {
    path: 'appeal',
    redirectTo: 'forms/appeal',
    pathMatch: 'full'
  },
  {
    path: 'discord-appeal',
    redirectTo: 'forms/discord-appeal',
    pathMatch: 'full'
  },
  {
    path: 'forms/appeal/:code',
    loadComponent: () => import('./pages/forms/appeal/appeal.component').then(m => m.AppealComponent),
    canActivate: [AuthGuard],
    data: {requiredAuthorizations: ['SCOPE_user']}
  },
  {
    path: 'forms/appeal',
    loadComponent: () => import('./pages/forms/appeal/appeal.component').then(m => m.AppealComponent),
    canActivate: [AuthGuard],
    data: {requiredAuthorizations: ['SCOPE_user']}
  },
  {
    path: 'forms/discord-appeal',
    loadComponent: () => import('./pages/forms/discord-appeal/discord-appeal.component').then(m => m.DiscordAppealComponent),
    canActivate: [AuthGuard],
    data: {requiredAuthorizations: ['SCOPE_user']}
  },
  {
    path: 'forms/sent',
    loadComponent: () => import('./pages/forms/sent/sent.component').then(m => m.SentComponent),
    canActivate: [AuthGuard],
    data: {
      requiredAuthorizations: ['SCOPE_user']
    }
  },
  {
    path: 'apply',
    redirectTo: 'forms/staff-application',
    pathMatch: 'full'
  },
  {
    path: 'forms/staff-application',
    loadComponent: () => import('./pages/forms/staff-application/staff-application.component').then(m => m.StaffApplicationComponent),
    canActivate: [AuthGuard],
    data: {
      requiredAuthorizations: ['SCOPE_user']
    }
  },
  {
    path: 'community',
    loadComponent: () => import('./pages/altitude/community/community.component').then(m => m.CommunityComponent)
  },
  {
    path: 'nicknames',
    loadComponent: () => import('./pages/reference/nicknames/nicknames.component').then(m => m.NicknamesComponent)
  },
  {
    path: 'nickgenerator',
    loadComponent: () => import('@pages/reference/nickgenerator/nick-generator.component').then(m => m.NickGeneratorComponent)
  },
];
