/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-68a4774
 * Released under the MIT license.
 */

import { cacheWrapper } from './cache-wrapper.js';
import { camelToKebab } from './case-converter.js';
function modAttrs(map) {
    return map
        ? Object.keys(map).reduce((attrs, key) => {
            const value = map[key];
            // Skip null, undefined, false
            if (value == null || value === false) {
                return attrs;
            }
            const attrName = `data-${camelToKebab(key)}`;
            if (value === true) {
                // Boolean true: data-{name}=""
                attrs[attrName] = '';
            }
            else if (typeof value === 'string') {
                // String value: data-{name}="value"
                attrs[attrName] = value;
            }
            else if (typeof value === 'number') {
                // Number: convert to string
                attrs[attrName] = String(value);
            }
            else {
                // Reject other types (objects, arrays, functions)
                if (process.env.NODE_ENV !== 'production') {
                    console.warn(`CubeUIKit: Invalid mod value for "${key}". Expected boolean, string, or number, got ${typeof value}`);
                }
            }
            return attrs;
        }, {})
        : null;
}
const _modAttrs = cacheWrapper(modAttrs);
export { _modAttrs as modAttrs };

        