'use strict';

var utils = require('./utils-NnC78QR3.js');

const isWindow = typeof window !== "undefined";
const getWindowProperty = (name) => isWindow && window && utils.property(name, window);
const config = () => {
    const defaultConfig = {
        canValidateWcagOnRender: false,
        warningLog: false,
        errorLog: false,
        log: false,
        iconsPath: '/assets/icons',
        iconsLazyLoad: true,
        documentNode: document ? document : null,
    };
    const windowProperty = getWindowProperty('GOV_DS_CONFIG');
    if (windowProperty) {
        return Object.assign(Object.assign({}, defaultConfig), windowProperty);
    }
    return defaultConfig;
};
const canValidateWcagOnRender = () => config().canValidateWcagOnRender;
const useWarningLog = () => config().warningLog;
const useErrorLog = () => config().errorLog;
const useLog = () => config().log;
const iconsPath = () => config().iconsPath;
const iconsLazyLoad = () => config().iconsLazyLoad;
const documentNode = () => config().documentNode;

const WARNING_COLORS = { bg: '#ecae1a', text: '#3b3b3b' };
const INFO_COLORS = { bg: '#2362a2', text: '#fff' };
const govLog = (message, colors = INFO_COLORS, args) => {
    const styles = ['color: ' + colors.text, 'background: ' + colors.bg, 'font-size: 11px', 'padding: 2px 4px', 'border-radius: 3px', 'font-weight: 600'].join(';');
    if (useLog() || useWarningLog() || useErrorLog()) {
        console.log('%cgov', styles, message, args);
    }
};
const govWarningLog = (message, args) => {
    if (useWarningLog()) {
        govLog(message, WARNING_COLORS, args);
    }
};

exports.canValidateWcagOnRender = canValidateWcagOnRender;
exports.documentNode = documentNode;
exports.govWarningLog = govWarningLog;
exports.iconsLazyLoad = iconsLazyLoad;
exports.iconsPath = iconsPath;
exports.isWindow = isWindow;
//# sourceMappingURL=gov.log-C5EH15b_.js.map

//# sourceMappingURL=gov.log-C5EH15b_.js.map