import { BrowserModule } from '@angular/platform-browser';
import { NgModule, LOCALE_ID, DEFAULT_CURRENCY_CODE } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NeuSelectComponent } from './angular-neumorphism/dropdown/neu-select/neu-select.component';
import { ComponentsTestComponent } from './components/components-test/components-test.component';
import { NeuOptionComponent } from './angular-neumorphism/dropdown/neu-option/neu-option.component';
import { FormsModule } from '@angular/forms';
import { NeuButtonComponent } from './angular-neumorphism/neu-button/neu-button.component';
import { NeuRadioGroupComponent } from './angular-neumorphism/neu-radio/neu-radio-group/neu-radio-group.component';
import { NeuRadioButtonComponent } from './angular-neumorphism/neu-radio/neu-radio-button/neu-radio-button.component';
import { NeuCheckboxComponent } from './angular-neumorphism/neu-checkbox/neu-checkbox.component';
import { NeuInputComponent } from './angular-neumorphism/neu-input/neu-input.component';
import { NeuAccordionComponent } from './angular-neumorphism/neu-accordion/neu-accordion/neu-accordion.component';
import { NeuExpansionPanelComponent } from './angular-neumorphism/neu-accordion/neu-expansion-panel/neu-expansion-panel.component';
import { NeuExpansionPanelHeaderComponent } from './angular-neumorphism/neu-accordion/neu-expansion-panel-header/neu-expansion-panel-header.component';
import { NeuPanelTitleComponent } from './angular-neumorphism/neu-accordion/neu-panel-title/neu-panel-title.component';
import { NeuPanelDescriptionComponent } from './angular-neumorphism/neu-accordion/neu-panel-description/neu-panel-description.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { ToastrModule } from 'ngx-toastr';
import { NeuPaginatorComponent } from './angular-neumorphism/neu-paginator/neu-paginator.component';
import { NeuContainerComponent } from './angular-neumorphism/neu-container/neu-container.component';
import { NeuChipComponent } from './angular-neumorphism/neu-chip/neu-chip.component';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { ApiInterceptor } from './interceptors/api.interceptor';
import { MainLayoutComponent } from './components/main-layout/main-layout.component';
import { DashboardComponent } from './components/main-layout/dashboard/dashboard.component';
import { BoxCalendarComponent } from './components/main-layout/box-calendar/box-calendar.component';
import { NewsComponent } from './components/main-layout/news/news.component';
import { SubscriptionsComponent } from './components/main-layout/subscriptions/subscriptions.component';
import { WorkoutsComponent } from './components/main-layout/workouts/workouts.component';
import { BillingComponent } from './components/main-layout/billing/billing.component';
import { BusinessComponent } from './components/main-layout/business/business.component';
import { StartComponent } from './components/start/start.component';
import { AuthComponent } from './components/auth/auth.component';
import { ForgotPasswordComponent } from './components/auth/forgot-password/forgot-password.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { MinimizeNumberPipe } from './pipes/minimize-number.pipe';
import { NeuCarouselComponent } from './angular-neumorphism/neu-carousel/neu-carousel.component';
import { NeuSlideComponent } from './angular-neumorphism/neu-carousel/neu-slide/neu-slide.component';
import { RegisterLayoutComponent } from './components/register-layout/register-layout.component';
import { MyBusinessComponent } from './components/register-layout/my-business/my-business.component';
import { MyUserComponent } from './components/register-layout/my-user/my-user.component';
import { MyBoxComponent } from './components/register-layout/my-box/my-box.component';
import { MySubscriptionComponent } from './components/register-layout/my-subscription/my-subscription.component';
import { registerLocaleData, DatePipe } from '@angular/common';
import { MiniInfoComponent } from './components/utils/mini-info/mini-info.component';
import { ActivePlanComponent } from './components/utils/active-plan/active-plan.component';
import localeEs from '@angular/common/locales/es';
import localeEsExtra from '@angular/common/locales/extra/es';
import { SafePipe } from './pipes/safe.pipe';
import { LoginComponent } from './components/auth/login/login.component';
import { ChangePasswordComponent } from './components/auth/change-password/change-password.component';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { TokenInterceptor } from './interceptors/token.interceptor';
import { DashboardGuard } from './guards/dashboard.guard';
import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import { TrainingSessionDetailComponent } from './components/utils/training-session-detail/training-session-detail.component';
import { NeuAutocompleteComponent } from './angular-neumorphism/neu-autocomplete/neu-autocomplete.component';
import { NumberToWeekDayPipe } from './pipes/number-to-week-day.pipe';
import { NeuMultiToggleComponent } from './angular-neumorphism/neu-multi-toggle/neu-multi-toggle.component';
import { NeuToggleComponent } from './angular-neumorphism/neu-multi-toggle/neu-toggle/neu-toggle.component';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OrderComponent } from './components/utils/order/order.component';
import { OrderDetailComponent } from './components/utils/order-detail/order-detail.component';
import { SafeHtmlPipe } from './pipes/safeHtml.pipe';
import { ErrorPageComponent } from './components/utils/error-page/error-page.component';
import { SubscriptionDetailComponent } from './components/main-layout/subscriptions/subscription-detail/subscription-detail.component';
import { NewSubscriptionDialogComponent } from './components/utils/new-subscription-dialog/new-subscription-dialog.component';
import { NewUserDialogComponent } from './components/utils/new-user-dialog/new-user-dialog.component';
import { BillingDetailComponent } from './components/main-layout/billing/billing-detail/billing-detail.component';
import { UserSubscriptionComponent } from './components/utils/user-subscription/user-subscription.component';
import { TrainingWorkoutSectionComponent } from './components/utils/training-workout-section/training-workout-section.component';
import { WorkoutDetailComponent } from './components/main-layout/workouts/workout-detail/workout-detail.component';
import { DaysToPeriodPipe } from './pipes/days-to-period.pipe';
import { PricingSessionsWeeklyTextPipe } from './pipes/pricing-sessions-weekly-text.pipe';
import { ChangeCompanyPlanDialogComponent } from './components/utils/change-company-plan-dialog/change-company-plan-dialog.component';
import { UpdateCompanyPaymentMethodDialogComponent } from './components/utils/update-company-payment-method-dialog/update-company-payment-method-dialog.component';
import { BusinessHistoryRenewalsComponent } from './components/main-layout/business/business-history-renewals/business-history-renewals.component';
import { SecToMinPipe } from './pipes/sec-to-min.service';
import { UpdateBoxSettingsDialogComponent } from './components/utils/update-box-settings-dialog/update-box-settings-dialog.component';
import { TrainingRoomsComponent } from './components/main-layout/training-rooms/training-rooms.component';
import { LegalComponent } from './components/public/legal/legal.component';
import { ContactoComponent } from './components/utils/contacto/contacto.component';

registerLocaleData(localeEs, 'es-ES', localeEsExtra);

@NgModule({
  declarations: [
    AppComponent,
    NeuSelectComponent,
    ComponentsTestComponent,
    NeuOptionComponent,
    NeuButtonComponent,
    NeuRadioGroupComponent,
    NeuRadioButtonComponent,
    NeuCheckboxComponent,
    NeuInputComponent,
    NeuAccordionComponent,
    NeuExpansionPanelComponent,
    NeuExpansionPanelHeaderComponent,
    NeuPanelTitleComponent,
    NeuPanelDescriptionComponent,
    NeuPaginatorComponent,
    NeuContainerComponent,
    NeuChipComponent,
    MainLayoutComponent,
    DashboardComponent,
    BoxCalendarComponent,
    NewsComponent,
    SubscriptionsComponent,
    WorkoutsComponent,
    BillingComponent,
    BusinessComponent,
    StartComponent,
    AuthComponent,
    ForgotPasswordComponent,
    MinimizeNumberPipe,
    NeuCarouselComponent,
    NeuSlideComponent,
    RegisterLayoutComponent,
    MyBusinessComponent,
    MyUserComponent,
    MyBoxComponent,
    MySubscriptionComponent,
    MiniInfoComponent,
    ActivePlanComponent,
    LoginComponent,
    SafeHtmlPipe,
    ChangePasswordComponent,
    LoginComponent,
    SafePipe,
    ChangePasswordComponent,
    MiniInfoComponent,
    ActivePlanComponent,
    TrainingSessionDetailComponent,
    NeuAutocompleteComponent,
    OrderComponent,
    OrderDetailComponent,
    NumberToWeekDayPipe,
    NeuMultiToggleComponent,
    NeuToggleComponent,
    ErrorPageComponent,
    SubscriptionDetailComponent,
    NewSubscriptionDialogComponent,
    NewUserDialogComponent,
    BillingDetailComponent,
    UserSubscriptionComponent,
    TrainingWorkoutSectionComponent,
    WorkoutDetailComponent,
    DaysToPeriodPipe,
    PricingSessionsWeeklyTextPipe,
    ChangeCompanyPlanDialogComponent,
    UpdateCompanyPaymentMethodDialogComponent,
    BusinessHistoryRenewalsComponent,
    SecToMinPipe,
    TrainingRoomsComponent,
    LegalComponent,
    UpdateBoxSettingsDialogComponent,
    TrainingRoomsComponent,
    ContactoComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    MatProgressBarModule,
    ToastrModule.forRoot({
      newestOnTop: false,
      preventDuplicates: true,
      countDuplicates: true
    }),
    NgxChartsModule,
    NgxSkeletonLoaderModule,
    CalendarModule.forRoot({ provide: DateAdapter, useFactory: adapterFactory }),
    MatTooltipModule,
  ],
  providers: [
    DatePipe,
    NumberToWeekDayPipe,
    { provide: LOCALE_ID, useValue: 'es-ES' },
    { provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' },
    DashboardGuard,
    { provide: HTTP_INTERCEPTORS, useClass: ApiInterceptor, multi: true },
    { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
