import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { registerLocaleData } from '@angular/common';
import { RouterModule } from '@angular/router';



// Internationalization i18n
import localeEs from '@angular/common/locales/es';
import localeEsExtra from '@angular/common/locales/extra/es';
registerLocaleData(localeEs, 'es-Es', localeEsExtra);

// used to create fake backend
//import { fakeBackendProvider } from './helpers';
//import { JwtInterceptor, ErrorInterceptor } from './helpers';


import { AppRoutingModule } from './app.routing';
import { AppComponent } from './app.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ChartsModule } from 'ng2-charts';
import { SharedModule } from './components/shared/shared.module';

import { AdminComponent } from './layouts/admin/admin.component';

import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { MatSelectModule } from '@angular/material/select';
import { AngularMyDatePickerModule } from 'angular-mydatepicker';

import { PluginsModule } from './components/plugins/plugins.module';
import { LoginComponent } from './components/login/login.component';

import { TokenInterceptor } from '@app/services/token.interceptor';
import { ConfirmAccountComponent } from './components/confirm-account/confirm-account.component';


@NgModule({
  declarations: [
    AppComponent,
    AdminComponent,
    LoginComponent,
    ConfirmAccountComponent,
  ],
  imports: [
    BrowserModule,
    NgbModule,
    ChartsModule,
    BrowserAnimationsModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    SharedModule,
    RouterModule,
    AppRoutingModule,
    PluginsModule,
    NgxDatatableModule,
    MatSelectModule,
    AngularMyDatePickerModule
  ],
  providers: [
    { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
    //{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
    //AuthenticationService,
    // provider used to create fake backend
    //fakeBackendProvider
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
