import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';

import { UserPreferencesComponent } from './preferences/userPreferences/userPreferences.component';
import { ViewUserPreferenceModalComponent } from './preferences/userPreferences/view-userPreference-modal.component';
import { CreateOrEditUserPreferenceModalComponent } from './preferences/userPreferences/create-or-edit-userPreference-modal.component';

import { ClientPreferencesComponent } from './preferences/clientPreferences/clientPreferences.component';
import { ViewClientPreferenceModalComponent } from './preferences/clientPreferences/view-clientPreference-modal.component';
import { CreateOrEditClientPreferenceModalComponent } from './preferences/clientPreferences/create-or-edit-clientPreference-modal.component';

import { PreferencesComponent } from './preferences/preferences/preferences.component';
import { ViewPreferenceModalComponent } from './preferences/preferences/view-preference-modal.component';
import { CreateOrEditPreferenceModalComponent } from './preferences/preferences/create-or-edit-preference-modal.component';

import { RouteDefinitionsComponent } from './laboratory/routeDefinitions/routeDefinitions.component';
import { ViewRouteDefinitionModalComponent } from './laboratory/routeDefinitions/view-routeDefinition-modal.component';
import { CreateOrEditRouteDefinitionModalComponent } from './laboratory/routeDefinitions/create-or-edit-routeDefinition-modal.component';
import { RouteDefinitionRouteTypeLookupTableModalComponent } from './laboratory/routeDefinitions/routeDefinition-routeType-lookup-table-modal.component';


import { RouteStopsComponent } from './laboratory/routeStops/routeStops.component';
import { ViewRouteStopModalComponent } from './laboratory/routeStops/view-routeStop-modal.component';
import { CreateOrEditRouteStopModalComponent } from './laboratory/routeStops/create-or-edit-routeStop-modal.component';
import { RouteStopContactLookupTableModalComponent } from './laboratory/routeStops/routeStop-contact-lookup-table-modal.component';



import { RouteTypesComponent } from './laboratory/routeTypes/routeTypes.component';
import { ViewRouteTypeModalComponent } from './laboratory/routeTypes/view-routeType-modal.component';
import { CreateOrEditRouteTypeModalComponent } from './laboratory/routeTypes/create-or-edit-routeType-modal.component';

import { RouteScheduleDetailsComponent } from './laboratory/routeScheduleDetails/routeScheduleDetails.component';
import { ViewRouteScheduleDetailModalComponent } from './laboratory/routeScheduleDetails/view-routeScheduleDetail-modal.component';
import { CreateOrEditRouteScheduleDetailModalComponent } from './laboratory/routeScheduleDetails/create-or-edit-routeScheduleDetail-modal.component';

import { RouteSchedulesComponent } from './laboratory/routeSchedules/routeSchedules.component';
import { ViewRouteScheduleModalComponent } from './laboratory/routeSchedules/view-routeSchedule-modal.component';
import { CreateOrEditRouteScheduleModalComponent } from './laboratory/routeSchedules/create-or-edit-routeSchedule-modal.component';


import { ClinicsComponent } from './laboratory/clinics/clinics.component';
import { ViewClinicModalComponent } from './laboratory/clinics/view-clinic-modal.component';
import { CreateOrEditClinicModalComponent } from './laboratory/clinics/create-or-edit-clinic-modal.component';
import { ClinicScheduleComponent } from './laboratory/clinics/clinic-schedule.component';


import { AutoCompleteModule } from 'primeng/autocomplete';
import { PaginatorModule } from 'primeng/paginator';
import { EditorModule } from 'primeng/editor';
import { InputMaskModule } from 'primeng/inputmask'; import { FileUploadModule } from 'primeng/fileupload';
import { TableModule } from 'primeng/table';

import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PopoverModule, BsModalRef, TimepickerModule } from 'ngx-bootstrap';
import { TimePickerModule } from '@progress/kendo-angular-dateinputs';
import { DashboardComponent } from './dashboard/dashboard.component';
import { MainRoutingModule } from './main-routing.module';
import { NgxChartsModule } from '@swimlane/ngx-charts';

import { BsDatepickerModule, BsDatepickerConfig, BsDaterangepickerConfig, BsLocaleService } from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { FlyOutComponent } from '@app/shared/layout/flyout/flyout.component';
import { AgmCoreModule } from '@agm/core';
import { FlyOutLocationModalComponent } from '@app/shared/layout/flyout/location/location-modal.component';
import { FlyOutPackageTypeModalComponent } from '@app/shared/layout/flyout/package-type/package-type-modal.component';
import { FlyOutFleetModalComponent } from '@app/shared/layout/flyout/fleet/fleet-modal.component';
import { FlyOutContactsModalComponent } from '@app/shared/layout/flyout/contacts/contacts-modal.component';
import { AddressFormComponent } from '@app/shared/layout/form/address-form.component';
import { ContactFormComponent } from '@app/shared/layout/form/contact.form.component';
import { FlyOutDriverModalComponent } from '@app/shared/layout/flyout/driver/driver-modal.component';
import { ContactFormMainComponent } from '@app/shared/layout/formMain/contact.form.component';
import { AddressFormMainComponent } from '@app/shared/layout/formMain/address-form.component';
import { ColorPickerModule } from 'primeng/components/colorpicker/colorpicker';

import { CreateEditClinicComponent } from './laboratory/clinics/create-or-edit-clinic.component';
import { UserPreferencesFlyoutComponent } from '@app/shared/layout/flyout/user-preferences/user-preferences-flyout.component';


NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
		FileUploadModule,
		AutoCompleteModule,
		PaginatorModule,
		EditorModule,
		InputMaskModule,		TableModule,
        ColorPickerModule,
        CommonModule,
        FormsModule,
        ModalModule.forRoot(),
        TabsModule,
        TooltipModule,
        AppCommonModule,
        UtilsModule,
        MainRoutingModule,
        CountoModule,
        NgxChartsModule,
        BsDatepickerModule.forRoot(),
        BsDropdownModule.forRoot(),
        TimepickerModule.forRoot(),
        TimePickerModule,
        PopoverModule.forRoot(),
        AgmCoreModule.forRoot({
          apiKey: 'AIzaSyDS2kFDBSQClK7PEB8p9gy23KBtP2_MLtE'
        }),
    ],
    declarations: [
		UserPreferencesComponent,
		ViewUserPreferenceModalComponent,		CreateOrEditUserPreferenceModalComponent,
		ClientPreferencesComponent,
		ViewClientPreferenceModalComponent,		CreateOrEditClientPreferenceModalComponent,
		PreferencesComponent,
		ViewPreferenceModalComponent,		CreateOrEditPreferenceModalComponent,
		RouteDefinitionsComponent,
		ViewRouteDefinitionModalComponent,		CreateOrEditRouteDefinitionModalComponent,
    RouteDefinitionRouteTypeLookupTableModalComponent,
    	RouteStopsComponent,
		ViewRouteStopModalComponent,		CreateOrEditRouteStopModalComponent,
    RouteStopContactLookupTableModalComponent,
	    RouteTypesComponent,
		ViewRouteTypeModalComponent,		CreateOrEditRouteTypeModalComponent,
		RouteScheduleDetailsComponent,
		ViewRouteScheduleDetailModalComponent,		CreateOrEditRouteScheduleDetailModalComponent,
    	RouteSchedulesComponent,
		ViewRouteScheduleModalComponent,		CreateOrEditRouteScheduleModalComponent,
    	ClinicsComponent,
		ViewClinicModalComponent,		CreateOrEditClinicModalComponent,
        ClinicScheduleComponent,
        DashboardComponent,
        FlyOutComponent,
        FlyOutLocationModalComponent,
        FlyOutPackageTypeModalComponent,
        FlyOutFleetModalComponent,
        FlyOutDriverModalComponent,
        FlyOutContactsModalComponent,
        ContactFormMainComponent,
        AddressFormMainComponent,
        CreateEditClinicComponent
    ],
    providers: [
        { provide: BsDatepickerConfig, useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig },
        { provide: BsDaterangepickerConfig, useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig },
        { provide: BsLocaleService, useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale }
    ]
})
export class MainModule { }
