<commit_before>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule, Http, Request, XHRBackend, RequestOptions} from '@angular/http';
import { RouterModule, Routes, Router } from '@angular/router';

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

import { AppComponent } from './app.component';
import { HomeComponent } from './components/';
import { LoginComponent } from './components/';
import { LogoutComponent } from './components/';
import { SetupComponent } from './components/';
import { NullComponent, TopBarComponent } from './components/';

import { AuthGuard } from './utils/index';
import { HttpInterceptor } from './utils/index';
import { SafePipe, SafePipeModule } from 'app/utils/safe.pipe';

import { modules } from './modules';
import { CategoryBarComponent } from './components/category-bar/category-bar.component';
import { CategoryItemComponent } from './components/category-item/category-item.component';

export const appRoutes: Routes = [
	{
		path : 'login',
		component : LoginComponent
	},
	{
		path : 'logout',
		component : LogoutComponent,
		canActivate : [AuthGuard]
	},
	{
		path: '',
		component: HomeComponent,
		canActivate : []
	},
	{
		path: '**',
		component: NullComponent
	}
];

export function setFactory (xhrBackend: XHRBackend,
				requestOptions: RequestOptions,
				router: Router) {
	return new HttpInterceptor(xhrBackend, requestOptions, router);
}

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    LoginComponent,
    LogoutComponent,
    SetupComponent,
    NullComponent,
    TopBarComponent,
    CategoryBarComponent,
    CategoryItemComponent
  ],
  imports: [
	modules,
	SafePipeModule,
    BrowserModule,
	FormsModule,
	HttpModule,
	NgbModule.forRoot(),
	RouterModule.forRoot(appRoutes)
  ],
  providers: [
	AuthGuard,
	SafePipe,
		{
			provide : Http,
			useFactory: setFactory,
			deps: [XHRBackend, RequestOptions, Router]
		}

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }<commit_msg>Customer and user login<commit_after>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule, Http, Request, XHRBackend, RequestOptions} from '@angular/http';
import { RouterModule, Routes, Router } from '@angular/router';

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

import { AppComponent } from './app.component';
import { HomeComponent } from './components/';
import { LoginComponent } from './components/';
import { LogoutComponent } from './components/';
import { SetupComponent } from './components/';
import { NullComponent, TopBarComponent } from './components/';
import { CustomerLoginComponent } from './components/customer-login/login.component';

import { AuthGuard } from './utils/index';
import { HttpInterceptor } from './utils/index';
import { SafePipe, SafePipeModule } from 'app/utils/safe.pipe';

import { modules } from './modules';
import { CategoryBarComponent } from './components/category-bar/category-bar.component';
import { CategoryItemComponent } from './components/category-item/category-item.component';
import { CategoryComponent } from './components/category/category.component';

import {UserService} from './services/user.service'

export const appRoutes: Routes = [
	{
		path : 'admin/login',
		component : LoginComponent
	},
	{
		path : 'login',
		component : CustomerLoginComponent
	},
	{
		path : 'logout',
		component : LogoutComponent,
		canActivate : [AuthGuard]
	},
    {
        path : 'category/:id',
        component : CategoryComponent
    },
	{
		path: '',
		component: HomeComponent,
		canActivate : []
	},
	{
		path: '**',
		component: NullComponent
	}
];

export function setFactory (xhrBackend: XHRBackend,
				requestOptions: RequestOptions,
				router: Router) {
	return new HttpInterceptor(xhrBackend, requestOptions, router);
}

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    LoginComponent,
    CustomerLoginComponent,
    LogoutComponent,
    SetupComponent,
    NullComponent,
    TopBarComponent,
    CategoryBarComponent,
    CategoryItemComponent,
    CategoryComponent
  ],
  imports: [
	modules,
	SafePipeModule,
    BrowserModule,
	FormsModule,
	HttpModule,
	NgbModule.forRoot(),
	RouterModule.forRoot(appRoutes)
  ],
  providers: [
	AuthGuard,
	UserService,
	SafePipe,
		{
			provide : Http,
			useFactory: setFactory,
			deps: [XHRBackend, RequestOptions, Router]
		}

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
{'fraction_non_alphanumeric': 0.1289281102023246, 'fraction_numerical': 0.0, 'mean_word_length': 4.304794520547945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4480543', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1385, 'n_words': 326}