// angular modules
import { CommonModule } from '@angular/common';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { InjectionToken, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

// external modules
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { OAuthModule } from 'angular-oauth2-oidc';
import { ClipboardModule } from 'ngx-clipboard';
import { UploadxModule } from 'ngx-uploadx';


// routing module
import { AppCommonRoutingModule } from './common-routing.module';

import { MODULE_NAME } from './module-name';

//components
import { AvatarModule } from 'ngx-avatars';
import { ImageCropperModule } from 'ngx-image-cropper';
import * as commonActions from './actions/app-common.actions';
import { AppMenuComponent } from './components/app-menu/app-menu.component';
import { AppComponent } from './components/app/app.component';
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
import { AvatarComponent } from './components/avatar/avatar.component';
import { BackButtonComponent } from './components/back-button/back-button.component';
import { EditImageModalComponent } from './components/edit-image-modal/edit-image-modal.component';
import { GradientSelectComponent } from './components/gradient-select/gradient-select.component';
import { GradientComponent } from './components/gradient/gradient.component';
import { HasClaimDirective } from './components/has-claim/has-claim.directive';
import { HasPackageDirective } from './components/has-package/has-package.directive';
import { HasRoleDirective } from './components/has-role/has-role.directive';
import { HelpMenuComponent } from './components/help-menu/help-menu.component';
import { SettingMenuComponent } from './components/setting-menu/setting-menu.component';
import { ItemLinkComponent } from './components/item-link/item-link.component';
import { MenuBackgroundComponent } from './components/menu-background/menu-background.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
import { NotificationMenuComponent } from './components/notification-menu/notification-menu.component';
import { PackageExistsDirective } from './components/package-exists/package-exists.directive';
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
import { SidePanelComponent } from './components/side-panel/side-panel.component';
import { TagInputComponent } from './components/tag-input/tag-input.component';
import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
import { TimespanComponent } from './components/timespan/timespan.component';
import { UserMenuComponent } from './components/user-menu/user-menu.component';
import * as commonEffects from './effects/app-common.effects';
import { Alert } from './enumerations/alert.enum';
import { IDataLayer } from './models/data.layer';
import { IEventMessage } from './models/event.message';
import { IColor, IGradientstop } from './models/gradient';
import { IItem, Item } from './models/item';
import { IItemType } from './models/item.type';
import { IItemTypes } from './models/item.types';
import { IItemLinkType } from './models/itemlink.type';
import { IItemTask, ItemTask } from './models/itemTask';
import { IJsonline } from './models/json-line';
import { IListItem } from './models/list.item';
import { IPackage, IPackages } from './models/package';
import { IAclRights } from './models/acl.rights';
import { IListItemAclRights } from './models/list.item.acl.rights';
import { ISharedItem } from './models/shared.item';
import { IQueryState } from './models/query.state';
import { ISenMLItem } from './models/senml-item';
import { ITypeaheadItem } from './models/typeahead.item';
import { IUrlType } from './models/url.type';
import { IUser } from './models/user';
import { WeatherCurrentObservation } from './models/weatherCurrentObservation';
import * as commonReducers from './reducers/app-common.reducer';
import { AuthConfigFactory, IAuthconfigFactory } from './shared/authconfigFactory';
import { SafePipe } from './shared/safe.pipe';
import { SecureOAuthStorage } from './shared/secureOAuthStorage';

export const FM_COMMON_STARTPAGE = new InjectionToken<string>('fm-common-startpage');

export {
  Alert, AppComponent, AuthCallbackComponent, AuthConfigFactory, AvatarComponent, BackButtonComponent, commonActions,
  commonReducers, EditImageModalComponent,
  GradientComponent,
  GradientSelectComponent, HasClaimDirective, HasPackageDirective, HasRoleDirective, IAuthconfigFactory, IColor, IDataLayer, IEventMessage, IGradientstop, IItem, IItemLinkType, IItemTask, IItemType, IItemTypes, IJsonline, IListItem, IPackage,
  IAclRights, IListItemAclRights, ISharedItem,
  IPackages, IQueryState, ISenMLItem, Item, ItemLinkComponent, ItemTask, ITypeaheadItem, IUrlType, IUser, MenuBackgroundComponent, NotFoundComponent,
  NotImplementedComponent, PackageExistsDirective, ResumableFileUploadComponent, SafePipe, SecureOAuthStorage, SessionClearedComponent, SidePanelComponent, TagInputComponent, ThumbnailComponent, TimespanComponent, UserMenuComponent, WeatherCurrentObservation
};

@NgModule({ declarations: [
        AppComponent,
        AuthCallbackComponent,
        SidePanelComponent,
        SafePipe,
        NotFoundComponent,
        NotImplementedComponent,
        ResumableFileUploadComponent,
        TimespanComponent,
        TagInputComponent,
        SessionClearedComponent,
        MenuBackgroundComponent,
        HasPackageDirective,
        PackageExistsDirective,
        HasClaimDirective,
        HasRoleDirective,
        UserMenuComponent,
        GradientComponent,
        GradientSelectComponent,
        AppMenuComponent,
        NotificationMenuComponent,
        HelpMenuComponent,
        SettingMenuComponent,
        BackButtonComponent,
        ThumbnailComponent,
        EditImageModalComponent,
        AvatarComponent,
        ItemLinkComponent
    ],
    exports: [
        NgbModule,
        UploadxModule,
        ClipboardModule,
        CommonModule,
        AppComponent,
        ResumableFileUploadComponent,
        AuthCallbackComponent,
        SidePanelComponent,
        SafePipe,
        NotFoundComponent,
        NotImplementedComponent,
        ResumableFileUploadComponent,
        TimespanComponent,
        TagInputComponent,
        SessionClearedComponent,
        MenuBackgroundComponent,
        HasPackageDirective,
        PackageExistsDirective,
        HasClaimDirective,
        HasRoleDirective,
        UserMenuComponent,
        GradientComponent,
        GradientSelectComponent,
        BackButtonComponent,
        ThumbnailComponent,
        AvatarComponent,
        ItemLinkComponent,
        EditImageModalComponent
    ], imports: [CommonModule,
        AppCommonRoutingModule,
        StoreModule.forFeature(MODULE_NAME, commonReducers.reducer),
        EffectsModule.forFeature([commonEffects.AppCommonEffects]),
        OAuthModule.forRoot(),
        NgbModule,
        FormsModule,
        UploadxModule,
        ClipboardModule,
        AvatarModule,
        ImageCropperModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class AppCommonModule {
}
