import * as i0 from '@angular/core';
import { InjectionToken, ErrorHandler, Optional, Inject, NgModule } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { CommonModule } from '@angular/common';
import * as i1 from '@ngx-translate/core';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import * as i2 from '@ngrx/store';
import { StoreModule } from '@ngrx/store';
import { cartReducer, CartEffects } from '@testlocallibrary/shared-kernel/store';
import { CartLocalStorageService } from '@testlocallibrary/shared-kernel/services/local-storage';
import { TranslationService } from '@testlocallibrary/shared-kernel/services/language';
import { MainApiActionService } from '@testlocallibrary/shared-kernel/services/main-api-action';
import { GlobalHttpErrorHandlerInterceptor } from '@testlocallibrary/shared-kernel/services/global-http-error-handler';
import { LoaderService } from '@testlocallibrary/shared-kernel/services/loader';
import { CartService } from '@testlocallibrary/shared-kernel/services/cart-service';
import { CustomErrorHandlerService } from '@testlocallibrary/shared-kernel/services/custom-error-handler';
import { HelpersService } from '@testlocallibrary/shared-kernel/services/helpers-service';
import { CookieService } from 'ngx-cookie-service';
import * as i3 from '@ngrx/effects';
import { EffectsModule } from '@ngrx/effects';
import { MatDialogModule } from '@angular/material/dialog';
import { ErrorHandlerPopUpStateService } from '@testlocallibrary/shared-kernel/services/error-handler-pop-up-state';

const TRANSLATION_ASSET_NAME = new InjectionToken('TRANSLATION_ASSET_NAME');
function CreateTranslateLoader(http, assetName = 'ldc') {
    return new TranslateHttpLoader(http, `./assets/i18n/${assetName}/`, '.json');
}
class SharedKernelModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SharedKernelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SharedKernelModule, imports: [CommonModule,
            HttpClientModule,
            MatDialogModule, i1.TranslateModule, i2.StoreRootModule, i3.EffectsRootModule], exports: [TranslateModule,
            HttpClientModule,
            MatDialogModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SharedKernelModule, providers: [
            CartService,
            CartLocalStorageService,
            TranslationService,
            MainApiActionService,
            GlobalHttpErrorHandlerInterceptor,
            LoaderService,
            CustomErrorHandlerService,
            CookieService,
            HelpersService,
            ErrorHandlerPopUpStateService,
            {
                provide: HTTP_INTERCEPTORS,
                useClass: GlobalHttpErrorHandlerInterceptor,
                multi: true,
            },
            {
                provide: ErrorHandler,
                useClass: CustomErrorHandlerService
            }
        ], imports: [CommonModule,
            HttpClientModule,
            MatDialogModule,
            TranslateModule.forRoot({
                defaultLanguage: 'en',
                loader: {
                    provide: TranslateLoader,
                    useFactory: CreateTranslateLoader,
                    deps: [HttpClient, [new Optional(), new Inject(TRANSLATION_ASSET_NAME)]],
                }
            }),
            StoreModule.forRoot({ cart: cartReducer }),
            EffectsModule.forRoot([CartEffects]), TranslateModule,
            HttpClientModule,
            MatDialogModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SharedKernelModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [
                        CommonModule,
                        HttpClientModule,
                        MatDialogModule,
                        TranslateModule.forRoot({
                            defaultLanguage: 'en',
                            loader: {
                                provide: TranslateLoader,
                                useFactory: CreateTranslateLoader,
                                deps: [HttpClient, [new Optional(), new Inject(TRANSLATION_ASSET_NAME)]],
                            }
                        }),
                        StoreModule.forRoot({ cart: cartReducer }),
                        EffectsModule.forRoot([CartEffects]),
                    ],
                    providers: [
                        CartService,
                        CartLocalStorageService,
                        TranslationService,
                        MainApiActionService,
                        GlobalHttpErrorHandlerInterceptor,
                        LoaderService,
                        CustomErrorHandlerService,
                        CookieService,
                        HelpersService,
                        ErrorHandlerPopUpStateService,
                        {
                            provide: HTTP_INTERCEPTORS,
                            useClass: GlobalHttpErrorHandlerInterceptor,
                            multi: true,
                        },
                        {
                            provide: ErrorHandler,
                            useClass: CustomErrorHandlerService
                        }
                    ],
                    exports: [
                        TranslateModule,
                        HttpClientModule,
                        MatDialogModule
                    ]
                }]
        }] });

/*
 * Public API Surface of shared-kernel
 */

/**
 * Generated bundle index. Do not edit.
 */

export { CreateTranslateLoader, SharedKernelModule, TRANSLATION_ASSET_NAME };
//# sourceMappingURL=testlocallibrary-shared-kernel.mjs.map
