"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sumTotalsBoldFormatter = void 0;
const utils_1 = require("@slickgrid-universal/utils");
const utilities_js_1 = require("../services/utilities.js");
const formatterUtilities_js_1 = require("../formatters/formatterUtilities.js");
const sumTotalsBoldFormatter = (totals, columnDef, grid) => {
    const field = columnDef.field ?? '';
    const val = totals.sum?.[field];
    const params = columnDef?.params;
    const prefix = params?.groupFormatterPrefix || '';
    const suffix = params?.groupFormatterSuffix || '';
    const { minDecimal, maxDecimal, decimalSeparator, thousandSeparator, wrapNegativeNumber } = (0, formatterUtilities_js_1.retrieveFormatterOptions)(columnDef, grid, 'regular', 'group');
    if ((0, utils_1.isNumber)(val)) {
        const formattedNumber = (0, utilities_js_1.formatNumber)(val, minDecimal, maxDecimal, wrapNegativeNumber, '', '', decimalSeparator, thousandSeparator);
        return (0, utils_1.createDomElement)('span', { style: { fontWeight: 'bold' }, textContent: `${prefix}${formattedNumber}${suffix}` });
    }
    return '';
};
exports.sumTotalsBoldFormatter = sumTotalsBoldFormatter;
//# sourceMappingURL=sumTotalsBoldFormatter.js.map