(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", "styled-components", "../utils/theme/getTheme", "../Pallette/themes", "./theme"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.CloseIconWrapper = exports.LeadIconWrapper = exports.TagWrapper = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_1 = require("../Pallette/themes");
    var theme_1 = require("./theme");
    var Padding = {
        s: "padding: 0 6px 0 8px;",
        m: "padding: 0 10px 0 12px;",
        xs: "padding: 0 6px 0 8px;"
    };
    var PaddingAvatar = {
        s: "padding: 0 4px 0 4px;",
        m: " padding: 0 14px 0 8px;",
        xs: "padding: 0 2px 0 0;"
    };
    var COMPONENT_NAME = "tag";
    exports.TagWrapper = styled_components_1.default.button.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeTag,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  box-sizing: border-box;\n  white-space: nowrap;\n  ", ";\n  border: 0;\n  font-feature-settings: \"pnum\" on, \"lnum\" on;\n  transition: all 0.2s linear;\n  border-radius: 16px;\n  cursor: pointer;\n\n  .tag__avatar {\n    margin-right: 4px;\n  }\n\n  ", "\n\n  ", "\n"], ["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  box-sizing: border-box;\n  white-space: nowrap;\n  ", ";\n  border: 0;\n  font-feature-settings: \"pnum\" on, \"lnum\" on;\n  transition: all 0.2s linear;\n  border-radius: 16px;\n  cursor: pointer;\n\n  .tag__avatar {\n    margin-right: 4px;\n  }\n\n  ", "\n\n  ", "\n"])), function (_a) {
        var avatarProps = _a.avatarProps, size = _a.size;
        if (avatarProps) {
            return PaddingAvatar[size];
        }
        else {
            return Padding[size];
        }
    }, function (_a) {
        var size = _a.size;
        switch (size) {
            case "xs":
                return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n          height: 20px;\n        "], ["\n          height: 20px;\n        "])));
            case "s":
                return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n          height: 24px;\n        "], ["\n          height: 24px;\n        "])));
            default:
                return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n          height: 32px;\n        "], ["\n          height: 32px;\n        "])));
        }
    }, function (_a) {
        var isPressed = _a.isPressed, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, theme = _a.theme;
        if (isDisabled) {
            return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "])), theme.components[COMPONENT_NAME].backgroundDisabled, theme.components[COMPONENT_NAME].colorDisabled, theme.components[COMPONENT_NAME].colorDisabled);
        }
        else if (isReadOnly) {
            return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "])), theme.components[COMPONENT_NAME].backgroundReadOnly, theme.components[COMPONENT_NAME].colorReadOnly, theme.components[COMPONENT_NAME].colorDisabled);
        }
        else if (isPressed) {
            return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n      "])), theme.components[COMPONENT_NAME].backgroundPressed, theme.components[COMPONENT_NAME].colorPressed, theme.components[COMPONENT_NAME].colorPressed);
        }
        else {
            return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n\n        &:hover {\n          background: ", ";\n          color: ", ";\n          svg {\n            color: ", ";\n          }\n        }\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n\n        &:hover {\n          background: ", ";\n          color: ", ";\n          svg {\n            color: ", ";\n          }\n        }\n      "])), theme.components[COMPONENT_NAME].backgroundDefault, theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].backgroundHover, theme.components[COMPONENT_NAME].colorHover, theme.components[COMPONENT_NAME].colorHover);
        }
    });
    exports.TagWrapper.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.LeadIconWrapper = styled_components_1.default.span(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n  margin-right: 8px;\n  width: 16px;\n  height: 16px;\n"], ["\n  margin-right: 8px;\n  width: 16px;\n  height: 16px;\n"])));
    exports.CloseIconWrapper = styled_components_1.default.span(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n  width: 12px;\n  height: 12px;\n  svg {\n    width: 12px;\n    height: 12px;\n  }\n  ", "\n"], ["\n  width: 12px;\n  height: 12px;\n  svg {\n    width: 12px;\n    height: 12px;\n  }\n  ", "\n"])), function (_a) {
        var size = _a.size;
        switch (size) {
            case "xs":
            case "s":
                return (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n          margin-left: 6px;\n        "], ["\n          margin-left: 6px;\n        "])));
            default:
                return (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n          margin-left: 14px;\n        "], ["\n          margin-left: 14px;\n        "])));
        }
    });
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
});
