"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    CHART_TITLE_PADDING: function() {
        return CHART_TITLE_PADDING;
    },
    getAxisTitleStyle: function() {
        return getAxisTitleStyle;
    },
    getBarLabelStyle: function() {
        return getBarLabelStyle;
    },
    getChartTitleInlineStyles: function() {
        return getChartTitleInlineStyles;
    },
    getChartTitleStyles: function() {
        return getChartTitleStyles;
    },
    getMarkerLabelStyle: function() {
        return getMarkerLabelStyle;
    },
    getTooltipStyle: function() {
        return getTooltipStyle;
    }
});
const _utilities = require("../utilities/utilities");
const _reacttheme = require("@fluentui/react-theme");
const CHART_TITLE_PADDING = 20;
const getTooltipStyle = ()=>{
    return {
        ..._reacttheme.typographyStyles.body1,
        display: 'flex',
        flexDirection: 'column',
        padding: _reacttheme.tokens.spacingHorizontalS,
        position: 'absolute',
        textAlign: 'center',
        backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
        borderRadius: _reacttheme.tokens.borderRadiusSmall,
        pointerEvents: 'none',
        color: _reacttheme.tokens.colorNeutralForeground1
    };
};
const getAxisTitleStyle = ()=>{
    return {
        ..._reacttheme.typographyStyles.caption2Strong,
        fontStyle: 'normal',
        textAlign: 'center',
        color: _reacttheme.tokens.colorNeutralForeground2,
        fill: _reacttheme.tokens.colorNeutralForeground1,
        [_utilities.HighContrastSelector]: {
            fill: 'CanvasText'
        }
    };
};
const getBarLabelStyle = ()=>{
    return {
        ..._reacttheme.typographyStyles.caption1Strong,
        fill: _reacttheme.tokens.colorNeutralForeground1,
        forcedColorAdjust: 'auto'
    };
};
const getMarkerLabelStyle = ()=>{
    return {
        ..._reacttheme.typographyStyles.body1,
        fill: _reacttheme.tokens.colorNeutralForeground1,
        textAnchor: 'middle',
        [_utilities.HighContrastSelector]: {
            fill: 'CanvasText'
        }
    };
};
const getChartTitleStyles = ()=>{
    return {
        ..._reacttheme.typographyStyles.caption2Strong,
        fill: _reacttheme.tokens.colorNeutralForeground1,
        forcedColorAdjust: 'auto',
        textAlign: 'center',
        marginBottom: _reacttheme.tokens.spacingVerticalS
    };
};
function getChartTitleInlineStyles(titleFont, xanchor, yanchor, pad) {
    const styles = {};
    if (titleFont) {
        Object.assign(styles, titleFont.family && {
            fontFamily: titleFont.family
        }, titleFont.size && {
            fontSize: `${titleFont.size}px`
        }, titleFont.weight && {
            fontWeight: titleFont.weight
        }, titleFont.color && {
            fill: titleFont.color
        }, titleFont.shadow && titleFont.shadow !== 'none' && {
            filter: `drop-shadow(${titleFont.shadow})`
        });
    }
    if (xanchor) {
        const anchorMap = {
            left: 'left',
            center: 'center',
            right: 'right'
        };
        const alignmentKey = xanchor.toLowerCase();
        if (anchorMap[alignmentKey]) {
            styles.textAlign = anchorMap[alignmentKey];
        }
    }
    if (yanchor) {
        const anchorMap = {
            top: 'flex-start',
            middle: 'center',
            bottom: 'flex-end'
        };
        const alignmentKey = yanchor.toLowerCase();
        if (anchorMap[alignmentKey]) {
            styles.alignSelf = anchorMap[alignmentKey];
        }
    }
    if (pad) {
        var _pad_t;
        const t = (_pad_t = pad.t) !== null && _pad_t !== void 0 ? _pad_t : 0;
        var _pad_r;
        const r = (_pad_r = pad.r) !== null && _pad_r !== void 0 ? _pad_r : 0;
        var _pad_b;
        const b = (_pad_b = pad.b) !== null && _pad_b !== void 0 ? _pad_b : 0;
        var _pad_l;
        const l = (_pad_l = pad.l) !== null && _pad_l !== void 0 ? _pad_l : 0;
        styles.padding = `${t}px ${r}px ${b}px ${l}px`;
    }
    return styles;
}
