(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.getTheme = void 0;
    var tslib_1 = require("tslib");
    var getTheme = function (_a) {
        var _b;
        var theme = _a.theme, componentName = _a.componentName, defaultTheme = _a.defaultTheme;
        var componentTheme = Object.fromEntries(Object.keys(defaultTheme).map(function (paramsName) {
            var _a;
            var value = paramsName in ((_a = theme.components[componentName]) !== null && _a !== void 0 ? _a : {})
                ? theme.components[componentName][paramsName]
                : theme.colors[defaultTheme[paramsName]];
            return [paramsName, value];
        }));
        var components = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, theme.components), (_b = {}, _b[componentName] = componentTheme, _b));
        return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, theme), { components: components });
    };
    exports.getTheme = getTheme;
});
