/* Dependencies */
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { NgxPaginationModule } from "ngx-pagination";
import { OrderModule } from "ngx-order-pipe";
import { CollapseModule } from  "ngx-bootstrap";
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { JwSocialButtonsModule } from "jw-angular-social-buttons";


/* User Services Components */
import { UserComponent } from "./user-services/user/user.component";
import { SignInComponent } from "./user-services/user/sign-in/sign-in.component";
import { SignUpComponent } from "./user-services/user/sign-up/sign-up.component";
import { AuthGuard } from "./user-services/auth/auth.guard";
import { AuthInterceptor } from "./user-services/auth/auth.interceptor";


/* Profile Components */
import { UserProfileComponent } from "./profile/user-profile/user-profile.component";
import { EditProfileComponent } from './profile/edit-profile/edit-profile.component';
import { HistoryComponent } from './profile/history/history.component';
import { SavedArticlesComponent } from './profile/saved-articles/saved-articles.component';



/* Displays Components */
import { HomepageComponent } from "./displays/homepage/homepage.component";
import { DisplayresultsComponent } from "./displays/displayresults/displayresults.component";
import { DisplayArticleComponent } from "./displays/display-article/display-article.component";

import { ConceptComponent } from "./concepts/concept.component";


/* Developer Components */
import { DeveloperstatsComponent } from './developer/developerstats/developerstats.component';
import { ClickHistoryComponent } from "./developer/click-history/click-history.component";
import { QueryInformationComponent } from  "./developer/query-information/query-information.component";
import { QueryHistoryComponent} from  "./developer/query-history/query-history.component";
import { ArticleInfoComponent } from "./developer/article-info/article-info.component";
import { BarChartComponent } from "./developer/bar-chart/bar-chart.component";

//used for chart visualization in developer stats
import { ChartistModule } from 'ng-chartist';

/* Templates - (In templates folder) */
import { NavbaraccountsearchComponent } from './templates/navbaraccountsearch/navbaraccountsearch.component';
import { NavbarwithsearchComponent } from "./templates/navbaraccount/navbaraccount.component";
import { NavbarlogoutComponent } from "./templates/navbarlogout/navbarlogout.component";
import { FooterfixedComponent } from "./templates/footerfixed/footerfixed.component";
import { FooterrelativeComponent } from "./templates/footerrelative/footerrelative.component";

import { AppComponent } from "./app.component";
import { appRoutes } from "./routes";

import { UserService } from "./shared/user.service";

@NgModule({
  declarations: [
    AppComponent,
    HomepageComponent,
    DisplayresultsComponent,
    DisplayArticleComponent,
    NavbarwithsearchComponent,
    NavbarlogoutComponent,
    FooterfixedComponent,
    FooterrelativeComponent,
    ConceptComponent,
    UserComponent,
    SignUpComponent,
    UserProfileComponent,
    SignInComponent,
    ClickHistoryComponent,
    DeveloperstatsComponent,
    BarChartComponent,
    ArticleInfoComponent,
    QueryInformationComponent,
    SavedArticlesComponent,
    HistoryComponent,
    EditProfileComponent,
    QueryHistoryComponent,
    NavbaraccountsearchComponent
  ],
  imports: [
    BrowserModule,
    RouterModule.forRoot(appRoutes),
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    NgxPaginationModule,
    OrderModule,
    JwSocialButtonsModule,
    CollapseModule.forRoot(),
    JwSocialButtonsModule,
    BrowserAnimationsModule,
    ChartistModule
  ],

  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: AuthInterceptor,
      multi: true
    },
    AuthInterceptor,
    AuthGuard,
    UserService
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
