import * as i0 from '@angular/core';
import { Injectable, InjectionToken, Inject, NgModule, Self } from '@angular/core';
import { isNil, isNotNil } from '@angular-ru/cdk/utils';
import { __decorate, __metadata } from 'tslib';
import { BoundClass } from '@angular-ru/cdk/decorators';
import { isString } from '@angular-ru/cdk/string';

class LoggerInjector {
    constructor(injector) {
        LoggerInjector.injector = injector;
    }
    static getInjector() {
        if (isNil(LoggerInjector.injector)) {
            throw new Error(`You've forgotten to import \`LoggerModule\``);
        }
        return LoggerInjector.injector;
    }
}
LoggerInjector.injector = null;
/** @nocollapse */ LoggerInjector.ɵfac = function LoggerInjector_Factory(t) { return new (t || LoggerInjector)(i0.ɵɵinject(i0.Injector)); };
/** @nocollapse */ LoggerInjector.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: LoggerInjector, factory: LoggerInjector.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggerInjector, [{
            type: Injectable
        }], function () { return [{ type: i0.Injector }]; }, null);
})();

const LOGGER_OPTIONS = new InjectionToken('LOGGER_OPTIONS');
/**
 * Used in factory methods
 */
// eslint-disable-next-line no-restricted-syntax
var LoggerLevel;
(function (LoggerLevel) {
    LoggerLevel[LoggerLevel["ALL"] = 1] = "ALL";
    LoggerLevel[LoggerLevel["TRACE"] = 2] = "TRACE";
    LoggerLevel[LoggerLevel["DEBUG"] = 3] = "DEBUG";
    LoggerLevel[LoggerLevel["INFO"] = 4] = "INFO";
    LoggerLevel[LoggerLevel["LOG"] = 5] = "LOG";
    LoggerLevel[LoggerLevel["WARN"] = 6] = "WARN";
    LoggerLevel[LoggerLevel["ERROR"] = 7] = "ERROR";
    LoggerLevel[LoggerLevel["OFF"] = 8] = "OFF";
})(LoggerLevel || (LoggerLevel = {}));

class LoggerOptionsImpl {
    constructor() {
        this.instance = console;
        this.minLevel = LoggerLevel.ALL;
        this.globalLineStyle = '';
        this.cssClassMap = {};
        this.useLevelGroup = true;
        this.labelColors = {
            [LoggerLevel.TRACE]: "#000080" /* TRACE */,
            [LoggerLevel.DEBUG]: "#00BFFE" /* DEBUG */,
            [LoggerLevel.INFO]: "#000000" /* INFO */,
            [LoggerLevel.WARN]: "#FF6419" /* WARN */,
            [LoggerLevel.ERROR]: "#F1062D" /* ERROR */
        };
        this.labelNames = {
            [LoggerLevel.TRACE]: "TRACE" /* TRACE */,
            [LoggerLevel.DEBUG]: "DEBUG" /* DEBUG */,
            [LoggerLevel.INFO]: "INFO" /* INFO */,
            [LoggerLevel.WARN]: "WARN" /* WARN */,
            [LoggerLevel.ERROR]: "ERROR" /* ERROR */
        };
    }
    format(label, style) {
        return { label: `[${label}]:`, style };
    }
}
/** @nocollapse */ LoggerOptionsImpl.ɵfac = function LoggerOptionsImpl_Factory(t) { return new (t || LoggerOptionsImpl)(); };
/** @nocollapse */ LoggerOptionsImpl.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: LoggerOptionsImpl, factory: LoggerOptionsImpl.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggerOptionsImpl, [{
            type: Injectable
        }], null, null);
})();

class ConsoleService {
    constructor(options) {
        this.options = options;
        this.minLevel = options.minLevel;
        this.instance = options.instance;
    }
    get noop() {
        // eslint-disable-next-line @typescript-eslint/no-empty-function
        return (() => { });
    }
    get console() {
        return this.instance;
    }
    set console(instance) {
        this.instance = instance;
    }
    getTemplateLabel(text) {
        return `%c${text}`;
    }
    getFormatTemplateLabel(text) {
        return `%c${text} %c%s`;
    }
    getTemplateWithoutLabel() {
        return `%c%s`;
    }
}
/** @nocollapse */ ConsoleService.ɵfac = function ConsoleService_Factory(t) { return new (t || ConsoleService)(i0.ɵɵinject(LOGGER_OPTIONS)); };
/** @nocollapse */ ConsoleService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ConsoleService, factory: ConsoleService.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConsoleService, [{
            type: Injectable
        }], function () {
        return [{ type: LoggerOptionsImpl, decorators: [{
                        type: Inject,
                        args: [LOGGER_OPTIONS]
                    }] }];
    }, null);
})();

class CssFactory {
    constructor(options) {
        this.options = options;
        this.lineStyle = null;
    }
    get style() {
        const style = this.localStyle;
        this.clearLocalStyle();
        return `${this.globalStyles}${style}`;
    }
    set style(css) {
        this.lineStyle = css;
    }
    get globalStyles() {
        return this.options.globalLineStyle ? `${this.options.globalLineStyle};` : '';
    }
    get localStyle() {
        var _a, _b;
        return ((_b = (_a = this.lineStyle) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 ? `${this.lineStyle};` : '';
    }
    getStyleLabel(level) {
        const color = this.options.labelColors[level];
        return `color: ${color}; font-weight: bold`;
    }
    setClass(cssClassName) {
        const classList = cssClassName.split(/\s+/g);
        const styles = [];
        for (const className of classList) {
            const style = this.options.cssClassMap[className];
            if (isNotNil(style)) {
                styles.push(style);
            }
        }
        const localStyles = styles.length > 0 ? styles.join('; ') : '';
        this.lineStyle = `${this.globalStyles}${localStyles}`;
    }
    clearLocalStyle() {
        this.lineStyle = '';
    }
}
/** @nocollapse */ CssFactory.ɵfac = function CssFactory_Factory(t) { return new (t || CssFactory)(i0.ɵɵinject(LOGGER_OPTIONS)); };
/** @nocollapse */ CssFactory.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: CssFactory, factory: CssFactory.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CssFactory, [{
            type: Injectable
        }], function () {
        return [{ type: LoggerOptionsImpl, decorators: [{
                        type: Inject,
                        args: [LOGGER_OPTIONS]
                    }] }];
    }, null);
})();

const DEFAULT_METHODS = {
    /**
     * Used `debug` instead `trace` method because need
     * output without stack trace in console
     * LoggerLevel.TRACE -> console.debug
     */
    [LoggerLevel.TRACE]: 'debug',
    [LoggerLevel.LOG]: 'log',
    [LoggerLevel.DEBUG]: 'info',
    [LoggerLevel.INFO]: 'info',
    [LoggerLevel.WARN]: 'warn',
    [LoggerLevel.ERROR]: 'error'
};
const LEXER_JSON = /("(\\u[\dA-Za-z]{4}|\\[^u]|[^"\\])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[Ee][+\-]?\d+)?)/g;

class GroupFactory {
    constructor(console, cssFactory, options) {
        this.console = console;
        this.cssFactory = cssFactory;
        this.options = options;
        this.counterOpenedGroup = 0;
        this.executePipesGroup = false;
    }
    close() {
        if (this.executePipesGroup) {
            this.counterOpenedGroup--;
            this.console.instance.groupEnd();
        }
    }
    closeAll() {
        while (this.counterOpenedGroup > 0) {
            this.close();
        }
    }
    // eslint-disable-next-line max-params-no-constructor/max-params-no-constructor
    group(title, pipeline, logger, level) {
        const group = this.console.instance.group.bind(this.console.instance);
        return this.createGroupLogger(group, title, pipeline, logger, level);
    }
    // eslint-disable-next-line max-params-no-constructor/max-params-no-constructor
    groupCollapsed(title, pipeline, logger, level) {
        const groupCollapsed = this.console.instance.groupCollapsed.bind(this.console.instance);
        return this.createGroupLogger(groupCollapsed, title, pipeline, logger, level);
    }
    // eslint-disable-next-line max-lines-per-function,max-params-no-constructor/max-params-no-constructor
    createGroupLogger(groupType, title, pipeline, logger, level) {
        const showGroup = this.console.minLevel <= level;
        let pipeLineResult;
        if (showGroup) {
            this.executePipesGroup = true;
            this.counterOpenedGroup++;
            const lineStyle = this.cssFactory.getStyleLabel(level);
            const { label: formatLabel, style: formatStyle } = this.getLabel(LoggerLevel[level], lineStyle);
            groupType(`%c${formatLabel}`, formatStyle, title);
            if (isNotNil(pipeline)) {
                const result = pipeline(logger);
                this.close();
                pipeLineResult = result;
            }
        }
        else {
            this.executePipesGroup = false;
        }
        return pipeLineResult;
    }
    getLabel(level, style) {
        return this.options.format(level, style);
    }
}
/** @nocollapse */ GroupFactory.ɵfac = function GroupFactory_Factory(t) { return new (t || GroupFactory)(i0.ɵɵinject(ConsoleService), i0.ɵɵinject(CssFactory), i0.ɵɵinject(LOGGER_OPTIONS)); };
/** @nocollapse */ GroupFactory.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: GroupFactory, factory: GroupFactory.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupFactory, [{
            type: Injectable
        }], function () {
        return [{ type: ConsoleService }, { type: CssFactory }, { type: LoggerOptionsImpl, decorators: [{
                        type: Inject,
                        args: [LOGGER_OPTIONS]
                    }] }];
    }, null);
})();

class LoggerFactory {
    // eslint-disable-next-line max-params
    constructor(options, console, cssFactory, groupFactory) {
        this.options = options;
        this.console = console;
        this.cssFactory = cssFactory;
        this.groupFactory = groupFactory;
    }
    createLogger(level, logger) {
        const args = this.getArgumentsByType(level);
        const methodName = DEFAULT_METHODS[level];
        const operation = this.console.minLevel <= level
            ? this.console.instance[methodName].bind(...args)
            : this.console.noop;
        const pipeOperation = this.options.useLevelGroup
            ? this.defineLevelGroups(level, operation, logger)
            : operation;
        return pipeOperation;
    }
    defineLevelGroups(level, operation, logger) {
        Object.defineProperties(operation, {
            ["group" /* GROUP */]: this.setGroupMethod("group" /* GROUP */, level, logger),
            ["groupCollapsed" /* GROUP_COLLAPSED */]: this.setGroupMethod("groupCollapsed" /* GROUP_COLLAPSED */, level, logger)
        });
        return operation;
    }
    setGroupMethod(methodName, level, logger) {
        return {
            enumerable: true,
            configurable: true,
            value: (label, pipeLine) => {
                const groupMethod = this.groupFactory[methodName].bind(this.groupFactory);
                groupMethod(label, pipeLine, logger, level);
                return logger;
            }
        };
    }
    // eslint-disable-next-line max-lines-per-function
    getArgumentsByType(level) {
        const styleLabel = this.cssFactory.getStyleLabel(level);
        const lineStyle = this.cssFactory.style;
        const args = [this.console.instance];
        const withLabel = level !== LoggerLevel.LOG;
        if (withLabel) {
            const { label: formatLabel, style } = this.options.format(this.options.labelNames[level], styleLabel);
            if (lineStyle) {
                const label = this.console.getFormatTemplateLabel(formatLabel);
                args.push(label, style, lineStyle);
            }
            else {
                const label = this.console.getTemplateLabel(formatLabel);
                args.push(label, style);
            }
        }
        else if (lineStyle) {
            args.push(this.console.getTemplateWithoutLabel(), lineStyle);
        }
        return args;
    }
}
/** @nocollapse */ LoggerFactory.ɵfac = function LoggerFactory_Factory(t) { return new (t || LoggerFactory)(i0.ɵɵinject(LOGGER_OPTIONS), i0.ɵɵinject(ConsoleService), i0.ɵɵinject(CssFactory), i0.ɵɵinject(GroupFactory)); };
/** @nocollapse */ LoggerFactory.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: LoggerFactory, factory: LoggerFactory.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggerFactory, [{
            type: Injectable
        }], function () {
        return [{ type: LoggerOptionsImpl, decorators: [{
                        type: Inject,
                        args: [LOGGER_OPTIONS]
                    }] }, { type: ConsoleService }, { type: CssFactory }, { type: GroupFactory }];
    }, null);
})();

class JsonFactory {
    constructor() {
        this._string = 'color:green';
        this._number = 'color:darkorange';
        this._boolean = 'color:blue';
        this._null = 'color:magenta';
        this._key = 'color:red';
        this.lexerTypeFinder = LEXER_JSON;
    }
    // eslint-disable-next-line max-lines-per-function
    colorsJSON(json) {
        let resultJson = json;
        const arr = [];
        resultJson = resultJson.replace(this.lexerTypeFinder, (match) => {
            let style = this._number;
            if (/^"/.test(match)) {
                if (/:$/.test(match)) {
                    style = this._key;
                }
                else {
                    style = this._string;
                }
            }
            else if (/true|false/.test(match)) {
                style = this._boolean;
            }
            else if (/null/.test(match)) {
                style = this._null;
            }
            arr.push(style, '');
            return `%c${match}%c`;
        });
        arr.unshift(resultJson);
        return arr;
    }
}
/** @nocollapse */ JsonFactory.ɵfac = function JsonFactory_Factory(t) { return new (t || JsonFactory)(); };
/** @nocollapse */ JsonFactory.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: JsonFactory, factory: JsonFactory.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonFactory, [{
            type: Injectable
        }], null, null);
})();

class TimerFactory {
    constructor(console) {
        this.console = console;
        this.DIGITS_TO_FIX = 4;
        this.SECONDS = 1000;
    }
    startTime(title, level) {
        let result = null;
        // eslint-disable-next-line sonarjs/no-inverted-boolean-check
        const canExecute = !(this.console.minLevel > level);
        if (canExecute) {
            result = { startTime: performance.now(), title };
        }
        return result;
    }
    // eslint-disable-next-line max-params-no-constructor/max-params-no-constructor
    endTime(info, level, isMillisecond, logger) {
        // eslint-disable-next-line sonarjs/no-inverted-boolean-check
        const canExecute = !(this.console.minLevel > level);
        if (canExecute) {
            const methodName = DEFAULT_METHODS[level];
            const time = this.ensureTime(info, isMillisecond);
            const logMethod = logger[methodName];
            logMethod(`TimerLog: ${info.title}`, `took ${time} to execute`);
        }
    }
    ensureTime(info, isMillisecond) {
        const msTime = parseFloat((performance.now() - info.startTime).toFixed(this.DIGITS_TO_FIX));
        return isMillisecond ? `${msTime}ms` : `${Math.floor(msTime / this.SECONDS)}s`;
    }
}
/** @nocollapse */ TimerFactory.ɵfac = function TimerFactory_Factory(t) { return new (t || TimerFactory)(i0.ɵɵinject(ConsoleService)); };
/** @nocollapse */ TimerFactory.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TimerFactory, factory: TimerFactory.ɵfac });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimerFactory, [{
            type: Injectable
        }], function () { return [{ type: ConsoleService }]; }, null);
})();

let LoggerService = class LoggerService {
    // eslint-disable-next-line max-params
    constructor(cssFactory, console, factory, groupFactory, jsonFactory, timerFactory, options) {
        this.cssFactory = cssFactory;
        this.console = console;
        this.factory = factory;
        this.groupFactory = groupFactory;
        this.jsonFactory = jsonFactory;
        this.timerFactory = timerFactory;
        this.options = options;
        this.DEFAULT_DEPTH = 2;
    }
    get clear() {
        return this.console.instance.clear.bind(this.console.instance);
    }
    get table() {
        return this.console.instance.table.bind(this.console.instance);
    }
    get log() {
        return this.factory.createLogger(LoggerLevel.LOG, this);
    }
    get trace() {
        return this.factory.createLogger(LoggerLevel.TRACE, this);
    }
    get assert() {
        return this.console.instance.assert.bind(this.console.instance);
    }
    get debug() {
        return this.factory.createLogger(LoggerLevel.DEBUG, this);
    }
    get info() {
        return this.factory.createLogger(LoggerLevel.INFO, this);
    }
    get warn() {
        return this.factory.createLogger(LoggerLevel.WARN, this);
    }
    get error() {
        return this.factory.createLogger(LoggerLevel.ERROR, this);
    }
    get level() {
        return this.console.minLevel;
    }
    set level(level) {
        this.console.minLevel = level;
    }
    getCurrentLineStyle() {
        return this.cssFactory.style;
    }
    clearCssCurrentLine() {
        this.cssFactory.style = '';
    }
    setLabels(labels) {
        this.options.labelNames = Object.assign(Object.assign({}, this.options.labelNames), labels);
    }
    setColors(colors) {
        this.options.labelColors = Object.assign(Object.assign({}, this.options.labelColors), colors);
    }
    pipe(...pipelines) {
        if (this.groupFactory.executePipesGroup) {
            for (const pipeline of pipelines) {
                pipeline(this);
            }
        }
        return this;
    }
    groupCollapsed(title, pipeline) {
        this.groupFactory.groupCollapsed(title, pipeline, this, LoggerLevel.INFO);
        return this;
    }
    close() {
        this.groupFactory.close();
        return this;
    }
    closeAll() {
        this.groupFactory.closeAll();
        return this;
    }
    group(title, pipeline) {
        this.groupFactory.group(title, pipeline, this, LoggerLevel.INFO);
        return this;
    }
    css(style) {
        this.cssFactory.style = style;
        return this;
    }
    prettyJSON(json) {
        return this.jsonFactory.colorsJSON(JSON.stringify(json, null, this.DEFAULT_DEPTH));
    }
    cssClass(cssClassName) {
        this.cssFactory.setClass(cssClassName);
        return this;
    }
    startTime(title, level = LoggerLevel.DEBUG) {
        return this.timerFactory.startTime(title, level);
    }
    endTime(info, level = LoggerLevel.DEBUG, isMillisecond = true) {
        if (isNotNil(info)) {
            this.timerFactory.endTime(info, level, isMillisecond, this);
        }
    }
};
/** @nocollapse */ LoggerService.ɵfac = function LoggerService_Factory(t) { return new (t || LoggerService)(i0.ɵɵinject(CssFactory), i0.ɵɵinject(ConsoleService), i0.ɵɵinject(LoggerFactory), i0.ɵɵinject(GroupFactory), i0.ɵɵinject(JsonFactory), i0.ɵɵinject(TimerFactory), i0.ɵɵinject(LOGGER_OPTIONS)); };
/** @nocollapse */ LoggerService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: LoggerService, factory: LoggerService.ɵfac });
LoggerService = __decorate([
    BoundClass,
    __metadata("design:paramtypes", [CssFactory,
        ConsoleService,
        LoggerFactory,
        GroupFactory,
        JsonFactory,
        TimerFactory,
        LoggerOptionsImpl])
], LoggerService);
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggerService, [{
            type: Injectable
        }], function () {
        return [{ type: CssFactory }, { type: ConsoleService }, { type: LoggerFactory }, { type: GroupFactory }, { type: JsonFactory }, { type: TimerFactory }, { type: LoggerOptionsImpl, decorators: [{
                        type: Inject,
                        args: [LOGGER_OPTIONS]
                    }] }];
    }, null);
})();

function DebugLog() {
    return function (target, propertyName) {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).debug;
            }
        });
    };
}

function ErrorLog() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).error;
            }
        });
    };
}

// eslint-disable-next-line max-params-no-constructor/max-params-no-constructor
function groupDecoratorFactory(level, groupType, method, title, args, target) {
    const logger = LoggerInjector.getInjector().get(LoggerService);
    const groupFactory = LoggerInjector.getInjector().get(GroupFactory);
    const groupMethod = groupFactory[groupType].bind(groupFactory);
    const label = isString(title) ? title : title(...args);
    groupMethod(label, null, logger, level);
    const result = method.apply(target, args);
    if (logger.level <= level) {
        logger.close();
    }
    return result;
}

function Group(title, level = LoggerLevel.INFO) {
    return function (_target, _key, descriptor) {
        const method = descriptor.value;
        descriptor.value = function (...args) {
            return groupDecoratorFactory(level, "group" /* GROUP */, method, title, args, this);
        };
        return descriptor;
    };
}

function GroupCollapsed(title, level = LoggerLevel.INFO) {
    return function (_target, _key, descriptor) {
        const method = descriptor.value;
        descriptor.value = function (...args) {
            return groupDecoratorFactory(level, "groupCollapsed" /* GROUP_COLLAPSED */, method, title, args, this);
        };
        return descriptor;
    };
}

function InfoLog() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).info;
            }
        });
    };
}

function Log() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).log;
            }
        });
    };
}

function Logger() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService);
            }
        });
    };
}

// eslint-disable-next-line max-lines-per-function
function TimerLog(title, level = LoggerLevel.DEBUG, isMillisecond = true) {
    return function (_target, _key, descriptor) {
        let result;
        const method = descriptor.value;
        descriptor.value = function (...args) {
            const info = LoggerInjector.getInjector()
                .get(LoggerService)
                .startTime(title, level);
            result = method.apply(this, args);
            LoggerInjector.getInjector().get(LoggerService).endTime(info, level, isMillisecond);
            return result;
        };
        return descriptor;
    };
}

function TraceLog() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).trace;
            }
        });
    };
}

function WarnLog() {
    return (target, propertyName) => {
        Object.defineProperty(target, propertyName, {
            configurable: false,
            get() {
                return LoggerInjector.getInjector().get(LoggerService).warn;
            }
        });
    };
}

class LoggerModule {
    constructor(loggerInjector) {
        this.loggerInjector = loggerInjector;
    }
    static forRoot(config = {}) {
        return {
            ngModule: LoggerModule,
            providers: [
                {
                    provide: LoggerModule.ROOT_OPTIONS,
                    useValue: config
                },
                {
                    provide: LOGGER_OPTIONS,
                    useFactory: LoggerModule.loggerConfigFactory,
                    deps: [LoggerModule.ROOT_OPTIONS]
                }
            ]
        };
    }
    static loggerConfigFactory(config) {
        return Object.assign(new LoggerOptionsImpl(), config);
    }
}
LoggerModule.ROOT_OPTIONS = new InjectionToken('ROOT_OPTIONS');
/** @nocollapse */ LoggerModule.ɵfac = function LoggerModule_Factory(t) { return new (t || LoggerModule)(i0.ɵɵinject(LoggerInjector, 2)); };
/** @nocollapse */ LoggerModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: LoggerModule });
/** @nocollapse */ LoggerModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [
        ConsoleService,
        CssFactory,
        GroupFactory,
        JsonFactory,
        LoggerFactory,
        LoggerInjector,
        LoggerService,
        TimerFactory
    ] });
(function () {
    (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggerModule, [{
            type: NgModule,
            args: [{
                    providers: [
                        ConsoleService,
                        CssFactory,
                        GroupFactory,
                        JsonFactory,
                        LoggerFactory,
                        LoggerInjector,
                        LoggerService,
                        TimerFactory
                    ]
                }]
        }], function () {
        return [{ type: LoggerInjector, decorators: [{
                        type: Self
                    }] }];
    }, null);
})();

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

export { ConsoleService, DEFAULT_METHODS, DebugLog, ErrorLog, Group, GroupCollapsed, InfoLog, LEXER_JSON, LOGGER_OPTIONS, Log, Logger, LoggerInjector, LoggerLevel, LoggerModule, LoggerService, TimerLog, TraceLog, WarnLog };
//# sourceMappingURL=angular-ru-cdk-logger.mjs.map
