"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHidePersonalData = void 0;
const react_1 = require("react");
const ConfigProvider_1 = require("../../ConfigProvider");
/**
 * Добавляет className для скрытия персональных данных от инструментов мониторинга
 */
const useHidePersonalData = (options = {}) => {
    const { isEnabled, type = 'container' } = options;
    const { hidePersonalData: isEnabledInContext, hidePersonalDataClassname = '', hidePersonalInputDataClassname = '', } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
    return (0, react_1.useMemo)(() => {
        const hideDataClassName = type === 'input'
            ? hidePersonalInputDataClassname
            : hidePersonalDataClassname;
        if (!isEnabledInContext) {
            return '';
        }
        if (isEnabled || isEnabled === undefined) {
            return hideDataClassName;
        }
        return '';
    }, [type, isEnabled, isEnabledInContext]);
};
exports.useHidePersonalData = useHidePersonalData;
