import {ErrorHandler, NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {FormsModule} from "@angular/forms";
import {AgGridModule} from "ag-grid-angular";
import {WebbpmComponent} from "./component/webbpm.component";
import {WebbpmRoutingModule} from "./webbpm-routing.module";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import {ToastNoAnimationModule} from "ngx-toastr";
import {AppModule} from "../app/app.module";
import {HomeComponent} from "./component/home.component";
import {
  BpmnModule,
  ComponentsModule,
  CoreModule,
  SecurityModule,
} from "@webbpm/base-package";
import {TaskParamsProvider} from "@webbpm/base-package";
import {ProcessInstanceParamsProvider} from "@webbpm/base-package";
import {AppRoutingModule} from "../app/app-routing.module";
import {AppJivoChatWidgetService} from "../app/service/app-jivo-chat.service";
import {UserManagementRoutingModule} from "./user-management-routing.module";
import {GlobalErrorHandler} from "./handler/global-error.handler.prod";
import {DEFAULT_HTTP_INTERCEPTOR_PROVIDERS} from "./interceptor/default-interceptors.prod";

let IMPORTS = [
  BrowserAnimationsModule,
  BrowserModule,
  FormsModule,
  NgbModule,
  ToastNoAnimationModule.forRoot(),
  AgGridModule,
  AppRoutingModule,
  UserManagementRoutingModule,
  BpmnModule,
  CoreModule,
  ComponentsModule,
  SecurityModule,
  AppModule,
  WebbpmRoutingModule
];

@NgModule({
            imports: IMPORTS,
            declarations: [
              WebbpmComponent,
              HomeComponent
            ],
            exports: [],
            providers: [
              TaskParamsProvider,
              ProcessInstanceParamsProvider,
              AppJivoChatWidgetService,
              {provide: ErrorHandler, useClass: GlobalErrorHandler},
              DEFAULT_HTTP_INTERCEPTOR_PROVIDERS
            ],
            bootstrap: [
              WebbpmComponent
            ]
          })
export class WebbpmModule {
}
