import { __makeTemplateObject } from "tslib";
import styled, { css } from "styled-components";
import { getTheme } from "../utils/theme/getTheme";
import { LIGHT_THEME } from "../Pallette/themes";
import { defaultTheme } from "./themes";
var COMPONENT_NAME = "avatar";
export var OnlineStatus = styled.div.attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        componentName: COMPONENT_NAME,
        defaultTheme: defaultTheme
    })
}); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n  ", "\n  position: absolute;\n  box-sizing: border-box;\n  border: 1px solid\n    ", ";\n  ", ";\n"], ["\n  ", "\n  position: absolute;\n  box-sizing: border-box;\n  border: 1px solid\n    ", ";\n  ", ";\n"])), function (_a) {
    var status = _a.status, theme = _a.theme;
    return status && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n      background: ", ";\n    "], ["\n      background: ", ";\n    "])), theme.components[COMPONENT_NAME]["colorStatus" + (status.charAt(0).toUpperCase() + status.slice(1))]);
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].borderColorStatus;
}, function (_a) {
    var size = _a.size;
    switch (size) {
        case "l":
            return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n          height: 10px;\n          width: 10px;\n          right: 0;\n          top: 0;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: 0;\n          top: 0;\n          border-radius: 6px;\n        "])));
        case "m":
            return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n          height: 10px;\n          width: 10px;\n          border-radius: 6px;\n          right: -3px;\n          top: -4px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          border-radius: 6px;\n          right: -3px;\n          top: -4px;\n        "])));
        case "s":
            return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n          height: 10px;\n          width: 10px;\n          right: -3px;\n          top: -3px;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: -3px;\n          top: -3px;\n          border-radius: 6px;\n        "])));
        case "xs":
            return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n          height: 10px;\n          width: 10px;\n          right: -4px;\n          top: -4px;\n          border-radius: 6px;\n        "], ["\n          height: 10px;\n          width: 10px;\n          right: -4px;\n          top: -4px;\n          border-radius: 6px;\n        "])));
        case "xl":
        default:
            return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n          height: 16px;\n          width: 16px;\n          right: 0;\n          border-radius: 6px;\n          border: 2px solid\n            ", ";\n        "], ["\n          height: 16px;\n          width: 16px;\n          right: 0;\n          border-radius: 6px;\n          border: 2px solid\n            ", ";\n        "])), function (_a) {
                var theme = _a.theme;
                return theme.components[COMPONENT_NAME].borderColorStatus;
            });
    }
});
OnlineStatus.defaultProps = {
    theme: LIGHT_THEME
};
export var AvatarWrapper = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n  cursor: pointer;\n  display: inline-flex;\n  box-sizing: border-box;\n  position: relative;\n"], ["\n  cursor: pointer;\n  display: inline-flex;\n  box-sizing: border-box;\n  position: relative;\n"])));
AvatarWrapper.defaultProps = {
    theme: LIGHT_THEME
};
export var AvatarStyle = styled.button.attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        componentName: COMPONENT_NAME,
        defaultTheme: defaultTheme
    })
}); })(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n  transition: all 0.3s linear;\n  position: relative;\n  cursor: pointer;\n  background: ", ";\n  background-size: contain;\n  background-repeat: no-repeat;\n  border: none;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  font-weight: 600;\n  justify-content: center;\n  ", "\n\n  &:hover {\n    background: ", ";\n\n    .edit {\n      visibility: visible;\n      svg {\n        color: ", ";\n      }\n      transition: opacity 0.3s linear;\n      opacity: 1;\n    }\n\n    .avatar_icon {\n      visibility: hidden;\n      transition: all 0.3s linear;\n      opacity: 0;\n    }\n\n    .text {\n      opacity: 0;\n      transition: all 0.3s linear;\n    }\n  }\n\n  &:active {\n    border: none;\n    box-sizing: border-box;\n    transition: all 0.3s linear;\n    background: ", ";\n    background-size: contain;\n\n    .edit {\n      visibility: visible;\n      transition: color 0.3s linear;\n      svg {\n        color: ", ";\n      }\n    }\n  }\n\n  &:disabled {\n    cursor: not-allowed;\n    background: ", ";\n    box-sizing: border-box;\n    .disabled-icon {\n      visibility: visible;\n      opacity: 1;\n      svg {\n        color: ", ";\n      }\n    }\n    &:hover {\n      .edit {\n        visibility: hidden;\n      }\n    }\n  }\n\n  svg {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin: auto;\n    color: ", ";\n    ", "\n  }\n\n  .text {\n    transition: all 0.3s linear;\n    opacity: 1;\n    color: ", ";\n  }\n\n  .edit {\n    visibility: hidden;\n    transition: all 0.3s linear;\n    opacity: 0;\n  }\n\n  .avatar_icon {\n    visibility: visible;\n    transition: all 0.3s linear;\n    opacity: 1;\n  }\n"], ["\n  transition: all 0.3s linear;\n  position: relative;\n  cursor: pointer;\n  background: ", ";\n  background-size: contain;\n  background-repeat: no-repeat;\n  border: none;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  font-weight: 600;\n  justify-content: center;\n  ", "\n\n  &:hover {\n    background: ", ";\n\n    .edit {\n      visibility: visible;\n      svg {\n        color: ", ";\n      }\n      transition: opacity 0.3s linear;\n      opacity: 1;\n    }\n\n    .avatar_icon {\n      visibility: hidden;\n      transition: all 0.3s linear;\n      opacity: 0;\n    }\n\n    .text {\n      opacity: 0;\n      transition: all 0.3s linear;\n    }\n  }\n\n  &:active {\n    border: none;\n    box-sizing: border-box;\n    transition: all 0.3s linear;\n    background: ", ";\n    background-size: contain;\n\n    .edit {\n      visibility: visible;\n      transition: color 0.3s linear;\n      svg {\n        color: ", ";\n      }\n    }\n  }\n\n  &:disabled {\n    cursor: not-allowed;\n    background: ", ";\n    box-sizing: border-box;\n    .disabled-icon {\n      visibility: visible;\n      opacity: 1;\n      svg {\n        color: ", ";\n      }\n    }\n    &:hover {\n      .edit {\n        visibility: hidden;\n      }\n    }\n  }\n\n  svg {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin: auto;\n    color: ", ";\n    ", "\n  }\n\n  .text {\n    transition: all 0.3s linear;\n    opacity: 1;\n    color: ", ";\n  }\n\n  .edit {\n    visibility: hidden;\n    transition: all 0.3s linear;\n    opacity: 0;\n  }\n\n  .avatar_icon {\n    visibility: visible;\n    transition: all 0.3s linear;\n    opacity: 1;\n  }\n"])), function (_a) {
    var image = _a.image, disabled = _a.disabled;
    return image && !disabled
        ? "url(" + image + ") center"
        : function (_a) {
            var theme = _a.theme;
            return theme.components[COMPONENT_NAME].background;
        };
}, function (_a) {
    var size = _a.size;
    switch (size) {
        case "l":
            return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n          height: 48px;\n          width: 48px;\n          border-radius: 16px;\n          .text {\n            font-size: 13px;\n          }\n        "], ["\n          height: 48px;\n          width: 48px;\n          border-radius: 16px;\n          .text {\n            font-size: 13px;\n          }\n        "])));
        case "m":
            return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n          height: 32px;\n          width: 32px;\n          border-radius: 8px;\n        "], ["\n          height: 32px;\n          width: 32px;\n          border-radius: 8px;\n        "])));
        case "s":
            return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n          height: 24px;\n          width: 24px;\n          border-radius: 8px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "], ["\n          height: 24px;\n          width: 24px;\n          border-radius: 8px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "])));
        case "xs":
            return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n          height: 16px;\n          width: 16px;\n          border-radius: 12px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "], ["\n          height: 16px;\n          width: 16px;\n          border-radius: 12px;\n          .text {\n            font-size: 7px;\n            font-weight: 600;\n          }\n        "])));
        case "xl":
        default:
            return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n          height: 64px;\n          width: 64px;\n          border-radius: 24px;\n          font-size: 20px;\n        "], ["\n          height: 64px;\n          width: 64px;\n          border-radius: 24px;\n          font-size: 20px;\n        "])));
    }
}, function (_a) {
    var image = _a.image, theme = _a.theme, disabled = _a.disabled;
    if (!disabled) {
        return image
            ? theme.components[COMPONENT_NAME].backgroundImageHover
            : theme.components[COMPONENT_NAME].backgroundHover;
    }
}, function (_a) {
    var image = _a.image, theme = _a.theme;
    return image
        ? theme.components[COMPONENT_NAME].iconColorImage
        : theme.components[COMPONENT_NAME].iconColorHover;
}, function (_a) {
    var image = _a.image, theme = _a.theme, disabled = _a.disabled;
    if (!disabled) {
        return image
            ? theme.components[COMPONENT_NAME].backgroundImagePressed
            : theme.components[COMPONENT_NAME].backgroundPressed;
    }
}, function (_a) {
    var image = _a.image, theme = _a.theme;
    return image
        ? theme.components[COMPONENT_NAME].iconColorImage
        : theme.components[COMPONENT_NAME].iconColorPressed;
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].backgroundDisabled;
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].iconColorDisabled;
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].iconColor;
}, function (_a) {
    var size = _a.size;
    switch (size) {
        case "l":
            return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n            width: 15px;\n            height: 15px;\n          "], ["\n            width: 15px;\n            height: 15px;\n          "])));
        case "m":
            return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n            width: 10px;\n            height: 10px;\n          "], ["\n            width: 10px;\n            height: 10px;\n          "])));
        case "s":
            return css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n            width: 7.5px;\n            height: 7.5px;\n          "], ["\n            width: 7.5px;\n            height: 7.5px;\n          "])));
        case "xl":
        default:
            return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n            width: 24px;\n            height: 24px;\n          "], ["\n            width: 24px;\n            height: 24px;\n          "])));
    }
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].color;
});
AvatarStyle.defaultProps = {
    theme: LIGHT_THEME
};
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, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18;
