import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import {
  NgbAlertModule,
  NgbDatepickerModule,
  NgbDropdownModule,
  NgbPopoverModule,
  NgbProgressbarModule,
  NgbTimepickerModule,
  NgbTooltipModule
} from '@ng-bootstrap/ng-bootstrap';
import { ClickOutsideModule } from 'ng-click-outside';
import { provideCharts, withDefaultRegisterables, BaseChartDirective } from 'ng2-charts';
import { SimplebarAngularModule } from 'simplebar-angular';
import {
  UIShellModule,
  ButtonModule,
  NotificationModule,
  IconModule,
  IconService,
  TooltipModule,
  GridModule,
  AccordionModule,
  LoadingModule,
  ModalModule,
  InputModule,
  CheckboxModule,
  DatePickerModule,
  TimePickerModule,
  TimePickerSelectModule,
  NumberModule,
  DropdownModule,
  SelectModule,
  ComboBoxModule,
  ProgressIndicatorModule,
  InlineLoadingModule,
  PanelModule,
  TagModule,
  LinkModule,
  LayerModule,
  LayoutModule,
  TilesModule,
  ThemeModule
} from 'carbon-components-angular';

import { MotdComponent } from '~/app/shared/components/motd/motd.component';
import { DirectivesModule } from '../directives/directives.module';
import { PipesModule } from '../pipes/pipes.module';
import { AlertPanelComponent } from './alert-panel/alert-panel.component';
import { BackButtonComponent } from './back-button/back-button.component';
import { CdLabelComponent } from './cd-label/cd-label.component';
import { ColorClassFromTextPipe } from './cd-label/color-class-from-text.pipe';
import { ConfigOptionComponent } from './config-option/config-option.component';
import { ConfirmationModalComponent } from './confirmation-modal/confirmation-modal.component';
import { Copy2ClipboardButtonComponent } from './copy2clipboard-button/copy2clipboard-button.component';
import { DeleteConfirmationModalComponent } from './delete-confirmation-modal/delete-confirmation-modal.component';
import { CustomLoginBannerComponent } from './custom-login-banner/custom-login-banner.component';
import { DateTimePickerComponent } from './date-time-picker/date-time-picker.component';
import { DocComponent } from './doc/doc.component';
import { DownloadButtonComponent } from './download-button/download-button.component';
import { FormButtonPanelComponent } from './form-button-panel/form-button-panel.component';
import { FormModalComponent } from './form-modal/form-modal.component';
import { GrafanaComponent } from './grafana/grafana.component';
import { HelperComponent } from './helper/helper.component';
import { LanguageSelectorComponent } from './language-selector/language-selector.component';
import { LoadingPanelComponent } from './loading-panel/loading-panel.component';
import { ModalComponent } from './modal/modal.component';
import { NotificationsSidebarComponent } from './notifications-sidebar/notifications-sidebar.component';
import { OrchestratorDocPanelComponent } from './orchestrator-doc-panel/orchestrator-doc-panel.component';
import { PwdExpirationNotificationComponent } from './pwd-expiration-notification/pwd-expiration-notification.component';
import { RefreshSelectorComponent } from './refresh-selector/refresh-selector.component';
import { SelectBadgesComponent } from './select-badges/select-badges.component';
import { SelectComponent } from './select/select.component';
import { SparklineComponent } from './sparkline/sparkline.component';
import { SubmitButtonComponent } from './submit-button/submit-button.component';
import { TelemetryNotificationComponent } from './telemetry-notification/telemetry-notification.component';
import { UsageBarComponent } from './usage-bar/usage-bar.component';
import { WizardComponent } from './wizard/wizard.component';
import { CardComponent } from './card/card.component';
import { CardRowComponent } from './card-row/card-row.component';
import { CodeBlockComponent } from './code-block/code-block.component';
import { VerticalNavigationComponent } from './vertical-navigation/vertical-navigation.component';
import { CardGroupComponent } from './card-group/card-group.component';
import { HelpTextComponent } from './help-text/help-text.component';
import { FormAdvancedFieldsetComponent } from './form-advanced-fieldset/form-advanced-fieldset.component';
import { UpgradableComponent } from './upgradable/upgradable.component';
import { ProgressComponent } from './progress/progress.component';
import { TearsheetComponent } from './tearsheet/tearsheet.component';
import { TearsheetStepComponent } from './tearsheet-step/tearsheet-step.component';
import { DetailsCardComponent } from './details-card/details-card.component';
import { SidePanelComponent } from './side-panel/side-panel.component';

// Icons
import InfoIcon from '@carbon/icons/es/information/16';
import CopyIcon from '@carbon/icons/es/copy/32';
import { IconComponent } from './icon/icon.component';
import downloadIcon from '@carbon/icons/es/download/16';
import { ChartsModule } from '@carbon/charts-angular';
import CheckmarkFilledIcon from '@carbon/icons/es/checkmark--filled/16';
import ErrorFilledIcon from '@carbon/icons/es/error--filled/16';
import InformationFilledIcon from '@carbon/icons/es/information--filled/16';
import WarningFilledIcon from '@carbon/icons/es/warning--filled/16';
import NotificationFilledIcon from '@carbon/icons/es/notification--filled/16';
import DataViewAlt16 from '@carbon/icons/es/data--view--alt/16';
import DataCenter16 from '@carbon/icons/es/data--center/16';
import Upgrade16 from '@carbon/icons/es/upgrade/16';
import Close16 from '@carbon/icons/es/close/16';
import WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16';
import Help16 from '@carbon/icons/es/help/16';
import IncidentReporter16 from '@carbon/icons/es/incident-reporter/16';
import IbmStreamSets16 from '@carbon/icons/es/ibm--streamsets/16';
import DataEnrichment16 from '@carbon/icons/es/data-enrichment/16';
import Network116 from '@carbon/icons/es/network--1/16';
import Chip16 from '@carbon/icons/es/chip/16';
import Plug16 from '@carbon/icons/es/plug/16';
import VmdkDisk16 from '@carbon/icons/es/vmdk-disk/16';
import WarningAlt16 from '@carbon/icons/es/warning--alt/16';
import CheckMarkOutline16 from '@carbon/icons/es/checkmark--outline/16';
import ArrowUpRight16 from '@carbon/icons/es/arrow--up-right/16';
import InProgress16 from '@carbon/icons/es/in-progress/16';
import ArrowDown16 from '@carbon/icons/es/arrow--down/16';
import Warning16 from '@carbon/icons/es/warning/16';
import Deploy16 from '@carbon/icons/es/deploy/16';
import { SidebarLayoutComponent } from './sidebar-layout/sidebar-layout.component';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    NgbAlertModule,
    NgbPopoverModule,
    NgbProgressbarModule,
    NgbTooltipModule,
    ReactiveFormsModule,
    PipesModule,
    DirectivesModule,
    NgbDropdownModule,
    ClickOutsideModule,
    SimplebarAngularModule,
    RouterModule,
    NgbDatepickerModule,
    NgbTimepickerModule,
    UIShellModule,
    ButtonModule,
    NotificationModule,
    IconModule,
    TooltipModule,
    GridModule,
    AccordionModule,
    LoadingModule,
    ModalModule,
    InputModule,
    NumberModule,
    CheckboxModule,
    DatePickerModule,
    TimePickerModule,
    TimePickerSelectModule,
    DropdownModule,
    SelectModule,
    ComboBoxModule,
    ProgressIndicatorModule,
    BaseChartDirective,
    InlineLoadingModule,
    PanelModule,
    ChartsModule,
    TagModule,
    LinkModule,
    LayerModule,
    LayoutModule,
    TilesModule,
    ThemeModule
  ],
  declarations: [
    SparklineComponent,
    HelperComponent,
    SelectBadgesComponent,
    SubmitButtonComponent,
    UsageBarComponent,
    LoadingPanelComponent,
    ModalComponent,
    NotificationsSidebarComponent,
    DeleteConfirmationModalComponent,
    ConfirmationModalComponent,
    LanguageSelectorComponent,
    GrafanaComponent,
    SelectComponent,
    BackButtonComponent,
    RefreshSelectorComponent,
    ConfigOptionComponent,
    AlertPanelComponent,
    FormModalComponent,
    PwdExpirationNotificationComponent,
    TelemetryNotificationComponent,
    OrchestratorDocPanelComponent,
    DateTimePickerComponent,
    DocComponent,
    Copy2ClipboardButtonComponent,
    DownloadButtonComponent,
    FormButtonPanelComponent,
    MotdComponent,
    WizardComponent,
    CustomLoginBannerComponent,
    CdLabelComponent,
    ColorClassFromTextPipe,
    CardComponent,
    CardRowComponent,
    CodeBlockComponent,
    VerticalNavigationComponent,
    CardGroupComponent,
    HelpTextComponent,
    FormAdvancedFieldsetComponent,
    UpgradableComponent,
    ProgressComponent,
    IconComponent,
    TearsheetComponent,
    TearsheetStepComponent,
    DetailsCardComponent,
    SidePanelComponent,
    SidebarLayoutComponent
  ],
  providers: [provideCharts(withDefaultRegisterables())],
  exports: [
    SparklineComponent,
    HelperComponent,
    SelectBadgesComponent,
    SubmitButtonComponent,
    BackButtonComponent,
    LoadingPanelComponent,
    UsageBarComponent,
    ModalComponent,
    NotificationsSidebarComponent,
    LanguageSelectorComponent,
    GrafanaComponent,
    SelectComponent,
    RefreshSelectorComponent,
    ConfigOptionComponent,
    AlertPanelComponent,
    PwdExpirationNotificationComponent,
    TelemetryNotificationComponent,
    OrchestratorDocPanelComponent,
    DateTimePickerComponent,
    DocComponent,
    Copy2ClipboardButtonComponent,
    DownloadButtonComponent,
    FormButtonPanelComponent,
    MotdComponent,
    WizardComponent,
    CustomLoginBannerComponent,
    CdLabelComponent,
    CardComponent,
    CardRowComponent,
    CodeBlockComponent,
    VerticalNavigationComponent,
    CardGroupComponent,
    HelpTextComponent,
    FormAdvancedFieldsetComponent,
    UpgradableComponent,
    ProgressComponent,
    IconComponent,
    TearsheetComponent,
    TearsheetStepComponent,
    DetailsCardComponent,
    SidePanelComponent,
    SidebarLayoutComponent
  ]
})
export class ComponentsModule {
  constructor(private iconService: IconService) {
    this.iconService.registerAll([
      InfoIcon,
      CopyIcon,
      downloadIcon,
      CheckmarkFilledIcon,
      ErrorFilledIcon,
      InformationFilledIcon,
      WarningFilledIcon,
      NotificationFilledIcon,
      Close16,
      DataViewAlt16,
      DataCenter16,
      Upgrade16,
      WarningAltFilled16,
      Help16,
      IncidentReporter16,
      IbmStreamSets16,
      DataEnrichment16,
      Network116,
      Chip16,
      Plug16,
      VmdkDisk16,
      WarningAlt16,
      CheckMarkOutline16,
      ArrowUpRight16,
      InProgress16,
      ArrowDown16,
      Deploy16,
      Warning16
    ]);
  }
}
