import { HttpClientModule } from '@angular/common/http';
import { EffectsModule } from '@ngrx/effects';
import { Injectable, Optional, APP_INITIALIZER, Injector, NgModule, SkipSelf } from '@angular/core';
import { from } from 'rxjs';
import { take, tap } from 'rxjs/operators';
import { Storage } from '@ionic/storage';
import { __spread, __extends } from 'tslib';
import { AsyncStorageService, LogService, BaseModuleEffects, initialBaseAppState, baseAppReducers, initialBaseUserState, baseUserReducers, baseReducers, initialBaseState, BaseModule, getBaseRootProviders, getBaseChildProviders, BASE_NAME_TOKEN, APP_CONFIG_TOKEN, DEFAULT_BASE_CONFIG, baseInitApp } from '@eui/base';
export { ɵa, ɵb, UxBaseBlockDocumentComponentModule, UxBaseGrowlComponentModule, getBaseRootProviders, getBaseChildProviders, errorFeedbackServiceFactory, BaseModule, baseInitApp, basePreInitApp, getBaseAppConfig, getBaseGlobalConfig, getCoreModuleConfig, getModuleConfig, getUserApiConfig, getDefaultUserPreferencesConfig, getShowConnectionStatus, getHttpErrorHandlerConfig, getErrorMappingHandler, BASE_NAME_TOKEN, BASE_CONFIG_TOKEN, APP_CONFIG_TOKEN, GLOBAL_CONFIG_TOKEN, MODULE_NAME_TOKEN, MODULE_CONFIG_TOKEN, DEFAULT_BASE_GLOBAL_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_MODULES_CONFIG, DEFAULT_MODULE_CONFIG, DEFAULT_VERSIONS_CONFIG, DEFAULT_BASE_APP_CONFIG, DEFAULT_BASE_ENVIRONMENT_CONFIG, DEFAULT_BASE_CONFIG, loadDynamicEnvironmentConfig, euiLogServiceFactory, GlobalErrorHandler, AlertHttpErrorCallbackFn, ConsoleHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, DEFAULT_HTTP_ERROR_HANDLER_CONFIG, HttpErrorHandlerInterceptor, translateConfig, I18nResourceImpl, I18N_LOADER_CONFIG_TOKEN, I18nLoader, I18N_SERVICE_CONFIG_TOKEN, I18nService, I18nServiceMock, getI18nServiceConfig, getI18nLoaderConfig, DEFAULT_I18N_SERVICE_CONFIG, DEFAULT_I18N_LOADER_CONFIG, LANG_PARAM_KEY, AddLangParamInterceptor, CachePreventionInterceptor, CorsSecurityInterceptor, CsrfPreventionInterceptor, EuLoginSessionTimeoutHandlingInterceptor, UX_ERROR_MAPPING_HANDLER_TOKEN, UxRequestErrorModelInterceptor, LOG_LEVEL, LogLevel, LogLevelName, isLogConfigDefined, getLogLevelConfig, getTraceLevelConfig, getLogAppendersConfig, logServiceFactory, DEFAULT_LOG_CONFIG, LogAppender, DEFAULT_CONSOLE_APPENDER_PREFIX_CONVERTERS, ConsoleAppender, UrlAppender, Logger, LoggerMock, BASE_LOGGER_NAME_TOKEN, LOG_LEVEL_TOKEN, LOG_APPENDERS_TOKEN, LogService, LogServiceMock, LOG_CONFIG_TOKEN, LogModule, OpenIdConnectInterceptor, OpenIdConnectService, OpenIdConnectServiceMock, StorageService, StorageServiceMock, AsyncStorageService, AsyncStorageServiceMock, LocalStorageService, SessionStorageService, LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, LocalForageService, BaseAppActionTypes, InitStoreAction, UpdateAppVersionAction, UpdateAppConnectionAction, BaseUserActionTypes, UpdateUserDetailsAction, UpdateUserPreferencesAction, BaseModuleEffects, BaseAppEffects, initialBaseUserDetails, initialBaseUserPreferences, baseReducers, localStorageSync, baseAppReducers, baseUserReducers, getAppState, getUserState, getAppVersion, getAppConnection, getUserDetails, getUserPreferences, getUserId, getUserFirstName, getUserLastName, getUserFullName, getUserLang, initialBaseState, initialBaseAppState, initialBaseUserState, StoreService, StoreServiceMock, DEFAULT_USER_API_CONFIG, USER_API_CONFIG_TOKEN, DEFAULT_USER_PREFERENCES_TOKEN, UserService, UserServiceMock, isObject, merge, mergeDeep, mergeAll, xhr, DEFAULT_XHR_CONFIG, UxModal, UxService, UX_COLORS, UX_COUNTRIES, UX_TIMEZONES, UxDomService, UxAppShellService, UxAssetsService, UxTimezoneService, UxErrorFeedbackService, UxErrorManager, DEFAULT_AUTH_CONFIG, AUTH_CONFIG_TOKEN, UxAuthService, UxAuthGuardService, UxPermissionService, UxDynamicMenuService, withUxErrorManager, UxBadge, transformToUxHttpResponse, UxErrorOutput, UxErrorGroupOnClickEvent, UxMessageSeverity, UxMessageSeverityMetrics, UxValidationErrorClass, UxPublishErrorFeedbackEvent, UxClearErrorFeedbackEvent, UxLink, UxMessage, UxTimezones, UxLanguage, UxEuLanguages, baseInitApp as initApp, basePreInitApp as preInitApp, DEFAULT_BASE_CONFIG as DEFAULT_IONIC_CONFIG, DEFAULT_BASE_APP_CONFIG as DEFAULT_APP_CONFIG, DEFAULT_BASE_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, DEFAULT_BASE_ENVIRONMENT_CONFIG as DEFAULT_ENVIRONMENT_CONFIG } from '@eui/base';

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * ionic storage service, using the \@ionic/storage library
 * https://ionicframework.com/docs/building/storage
 */
var IonicStorageService = /** @class */ (function (_super) {
    __extends(IonicStorageService, _super);
    function IonicStorageService(storage, log) {
        var _this = _super.call(this) || this;
        _this.storage = storage;
        _this.log = log;
        return _this;
    }
    /**
     * the name of the storage service
     */
    /**
     * the name of the storage service
     * @return {?}
     */
    IonicStorageService.prototype.name = /**
     * the name of the storage service
     * @return {?}
     */
    function () {
        return IonicStorageService.NAME;
    };
    /**
     * reflects the readiness of the storage
     * @returns one time emission Observable<void>
     */
    /**
     * reflects the readiness of the storage
     * @return {?} one time emission Observable<void>
     */
    IonicStorageService.prototype.ready = /**
     * reflects the readiness of the storage
     * @return {?} one time emission Observable<void>
     */
    function () {
        var _this = this;
        return from(this.storage.ready())
            .pipe(take(1), tap((/**
         * @return {?}
         */
        function () {
        }), (/**
         * @param {?} err
         * @return {?}
         */
        function (err) {
            if (_this.log) {
                _this.log.error(_this.name(), 'ready', err);
            }
        })));
    };
    /**
     * retrieve an object from storage
     * @param key the associated key
     * @returns one time emission Observable of value
     */
    /**
     * retrieve an object from storage
     * @param {?} key the associated key
     * @return {?} one time emission Observable of value
     */
    IonicStorageService.prototype.get = /**
     * retrieve an object from storage
     * @param {?} key the associated key
     * @return {?} one time emission Observable of value
     */
    function (key) {
        var _this = this;
        return from(this.storage.get(key))
            .pipe(take(1), tap((/**
         * @return {?}
         */
        function () {
        }), (/**
         * @param {?} err
         * @return {?}
         */
        function (err) {
            if (_this.log) {
                _this.log.error(_this.name(), 'get', err);
            }
        })));
    };
    /**
     * sets an object in storage
     * @param key the associated key
     * @param value the value to set
     * @returns one time emission Observable
     */
    /**
     * sets an object in storage
     * @param {?} key the associated key
     * @param {?} value the value to set
     * @return {?} one time emission Observable
     */
    IonicStorageService.prototype.set = /**
     * sets an object in storage
     * @param {?} key the associated key
     * @param {?} value the value to set
     * @return {?} one time emission Observable
     */
    function (key, value) {
        var _this = this;
        return from(this.storage.set(key, value))
            .pipe(take(1), tap((/**
         * @return {?}
         */
        function () {
        }), (/**
         * @param {?} err
         * @return {?}
         */
        function (err) {
            if (_this.log) {
                _this.log.error(_this.name(), 'set', err);
            }
        })));
    };
    /**
     * removes an object from storage
     * @param key the associated key
     * @returns one time emission Observable
     */
    /**
     * removes an object from storage
     * @param {?} key the associated key
     * @return {?} one time emission Observable
     */
    IonicStorageService.prototype.remove = /**
     * removes an object from storage
     * @param {?} key the associated key
     * @return {?} one time emission Observable
     */
    function (key) {
        var _this = this;
        return from(this.storage.remove(key))
            .pipe(take(1), tap((/**
         * @return {?}
         */
        function () {
        }), (/**
         * @param {?} err
         * @return {?}
         */
        function (err) {
            if (_this.log) {
                _this.log.error(_this.name(), 'remove', err);
            }
        })));
    };
    IonicStorageService.NAME = 'IonicStorageService';
    IonicStorageService.decorators = [
        { type: Injectable }
    ];
    /** @nocollapse */
    IonicStorageService.ctorParameters = function () { return [
        { type: Storage },
        { type: LogService, decorators: [{ type: Optional }] }
    ]; };
    return IonicStorageService;
}(AsyncStorageService));

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @enum {?} */
var IonicAppActionTypes = {};

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @enum {?} */
var IonicUserActionTypes = {};

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var IonicModuleEffects = __spread(BaseModuleEffects);

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var initialIonicAppState = Object.assign({}, initialBaseAppState, {});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var actionToReducerMap = {};
/** @type {?} */
var ionicAppReducers = (/**
 * @param {?=} state
 * @param {?=} action
 * @return {?}
 */
function (state, action) {
    if (state === void 0) { state = initialIonicAppState; }
    if (actionToReducerMap[action.type]) {
        return actionToReducerMap[action.type](state, action);
    }
    // if the action type is not in the map, call the base reducers method
    return (/** @type {?} */ (baseAppReducers(state, action)));
});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var initialIonicUserState = Object.assign({}, initialBaseUserState, {});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var actionToReducerMap$1 = {};
/** @type {?} */
var ionicUserReducers = (/**
 * @param {?=} state
 * @param {?=} action
 * @return {?}
 */
function (state, action) {
    if (state === void 0) { state = initialIonicUserState; }
    if (actionToReducerMap$1[action.type]) {
        return actionToReducerMap$1[action.type](state, action);
    }
    // if the action type is not in the map, call the base reducers method
    return (/** @type {?} */ (baseUserReducers(state, action)));
});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var ionicReducers = Object.assign({}, baseReducers, {
    app: ionicAppReducers,
    user: ionicUserReducers,
});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
var initialIonicState = Object.assign({}, initialBaseState, {
    app: initialIonicAppState,
    user: initialIonicUserState,
});

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @param {?=} ionicConfig
 * @return {?}
 */
function getRootProviders(ionicConfig) {
    if (ionicConfig === void 0) { ionicConfig = DEFAULT_BASE_CONFIG; }
    return __spread(getBaseRootProviders(ionicConfig), [
        // ionic config
        { provide: BASE_NAME_TOKEN, useValue: 'eui-ionic' },
        // storage services
        IonicStorageService,
        { provide: AsyncStorageService, useExisting: IonicStorageService },
    ]);
}
/**
 * @param {?} moduleName
 * @return {?}
 */
function getChildProviders(moduleName) {
    return __spread(getBaseChildProviders(moduleName));
}
var IonicModule = /** @class */ (function (_super) {
    __extends(IonicModule, _super);
    function IonicModule(parentModule, injector) {
        return _super.call(this, parentModule, injector) || this;
    }
    /**
     * @param {?=} ionicConfig
     * @return {?}
     */
    IonicModule.forRoot = /**
     * @param {?=} ionicConfig
     * @return {?}
     */
    function (ionicConfig) {
        if (ionicConfig === void 0) { ionicConfig = DEFAULT_BASE_CONFIG; }
        return {
            ngModule: IonicModule,
            providers: __spread(getRootProviders(ionicConfig), [
                // ionic app initializer
                { provide: APP_INITIALIZER, useFactory: baseInitApp, multi: true, deps: [APP_CONFIG_TOKEN, Injector] },
            ]),
        };
    };
    /**
     * @param {?} moduleName
     * @return {?}
     */
    IonicModule.forChild = /**
     * @param {?} moduleName
     * @return {?}
     */
    function (moduleName) {
        return {
            ngModule: IonicModule,
            providers: getChildProviders(moduleName),
        };
    };
    IonicModule.decorators = [
        { type: NgModule, args: [{
                    imports: [
                        HttpClientModule,
                        EffectsModule.forRoot(IonicModuleEffects),
                    ],
                },] }
    ];
    /** @nocollapse */
    IonicModule.ctorParameters = function () { return [
        { type: IonicModule, decorators: [{ type: Optional }, { type: SkipSelf }] },
        { type: Injector }
    ]; };
    return IonicModule;
}(BaseModule));

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

export { getRootProviders, getChildProviders, IonicModule, IonicStorageService, IonicAppActionTypes, IonicUserActionTypes, IonicModuleEffects, ionicReducers as reducers, ionicAppReducers, ionicUserReducers, initialIonicAppState as initialAppState, initialIonicUserState as initialUserState, initialIonicState };

//# sourceMappingURL=eui-ionic.js.map