"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "getButtonSizesMixin", {
    enumerable: true,
    get: function() {
        return getButtonSizesMixin;
    }
});
var _styledcomponents = require("styled-components");
var _mixins = require("../../mixins");
var _utils = require("../../utils");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
    return function(param) {
        var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
        var paddingX = sizes[size].paddingX;
        if (square) {
            paddingX = sizes[size].paddingY;
        } else if (stretch) {
            paddingX = sizes[size].paddingStretchX;
        } else if (isContentLeft || isContentRight) {
            paddingX = sizes[size].paddingContentX;
        }
        return (0, _styledcomponents.css)([
            "height:",
            ";padding:",
            " ",
            ";border-radius:",
            ";",
            " ",
            " ",
            " ",
            " ",
            " ",
            ""
        ], sizes[size].height, sizes[size].paddingY, paddingX, (0, _utils.convertRoundnessMatrix)(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && " width: ".concat(sizes[size].height, ";"), shiftLeft && "margin-left: calc(-1 * ".concat(paddingX, ");"), shiftRight && "margin-right: calc(-1 * ".concat(paddingX, ");"), typos[size], (0, _mixins.addFocus)(_object_spread_props(_object_spread({}, theme), {
            focused: focused,
            outlined: outlined,
            outlineRadius: (0, _utils.convertRoundnessMatrix)(pin, "calc(".concat(sizes[size].radius, " + var(--plasma-outline-size))"), "calc(".concat(sizes[size].radiusCircle, " + var(--plasma-outline-size))"))
        })));
    };
};
