import { __makeTemplateObject } from "tslib";
import styled, { css } from "styled-components";
import { LIGHT_THEME } from "../Pallette/themes";
import { getTheme } from "../utils/theme/getTheme";
import { defaultThemeTree } from "./theme";
var COMPONENT_NAME = "tree";
export var TreeWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n  ", "\n"], ["\n  ", "\n"])), function (_a) {
    var isDragOver = _a.isDragOver, isDragging = _a.isDragging, isAnyDragging = _a.isAnyDragging, theme = _a.theme;
    if (isAnyDragging || isDragOver) {
        return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n        ", "\n        ", "\n      "], ["\n        ", "\n        ", "\n      "])), isAnyDragging && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n          * {\n            user-select: none;\n            cursor: grabbing;\n          }\n        "], ["\n          * {\n            user-select: none;\n            cursor: grabbing;\n          }\n        "]))), isDragOver && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n          background-color: ", ";\n          border-radius: 8px;\n        "], ["\n          background-color: ", ";\n          border-radius: 8px;\n        "])), theme.components[COMPONENT_NAME].backgroundEdit));
    }
    if (isDragging) {
        return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n        cursor: grabbing;\n        .tree-header__title {\n          background-color: transparent;\n        }\n        .tree_header {\n          width: 50%;\n          background-color: ", ";\n          ", "\n          ", "\n          ", "\n          ", "\n          position: fixed;\n          z-index: 20;\n          pointer-events: none;\n        }\n      "], ["\n        cursor: grabbing;\n        .tree-header__title {\n          background-color: transparent;\n        }\n        .tree_header {\n          width: 50%;\n          background-color: ", ";\n          ", "\n          ", "\n          ", "\n          ", "\n          position: fixed;\n          z-index: 20;\n          pointer-events: none;\n        }\n      "])), theme.components[COMPONENT_NAME]
            .backgroundDragging, theme.shadows.tp.top, theme.shadows.tp.bottom, theme.shadows.tp.left, theme.shadows.tp.right);
    }
    return "";
});
export var TreeHeader = styled.div.attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        defaultTheme: defaultThemeTree,
        componentName: COMPONENT_NAME
    })
}); })(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: start;\n  border-radius: 8px;\n  padding: 0px 8px 0px 8px;\n  ", ";\n  gap: 8px;\n  width: 100%;\n  ", "\n\n  & > div {\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n    justify-content: center;\n  }\n\n  .tree-header__right-content {\n    margin-left: auto;\n    display: flex;\n    flex-direction: row;\n    gap: 8px;\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n  }\n\n  [data-element=\"radioButton\"] {\n    align-items: normal;\n  }\n"], ["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: start;\n  border-radius: 8px;\n  padding: 0px 8px 0px 8px;\n  ", ";\n  gap: 8px;\n  width: 100%;\n  ", "\n\n  & > div {\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n    justify-content: center;\n  }\n\n  .tree-header__right-content {\n    margin-left: auto;\n    display: flex;\n    flex-direction: row;\n    gap: 8px;\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n  }\n\n  [data-element=\"radioButton\"] {\n    align-items: normal;\n  }\n"])), function (_a) {
    var isDragAllowed = _a.isDragAllowed, isAnyDragging = _a.isAnyDragging;
    return !isAnyDragging && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n      cursor: ", ";\n      .arrow-icon {\n        cursor: pointer;\n      }\n    "], ["\n      cursor: ", ";\n      .arrow-icon {\n        cursor: pointer;\n      }\n    "])), isDragAllowed ? "grab" : "pointer");
}, function (_a) {
    var theme = _a.theme, isDisabled = _a.isDisabled, isActive = _a.isActive;
    if (isDisabled) {
        return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n        cursor: not-allowed;\n        color: ", ";\n      "], ["\n        cursor: not-allowed;\n        color: ", ";\n      "])), theme.components[COMPONENT_NAME].colorDisabled);
    }
    else if (isActive) {
        return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n        color: ", ";\n      "], ["\n        color: ", ";\n      "])), theme.components[COMPONENT_NAME].colorActive);
    }
    return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n      color: ", ";\n      &:hover {\n        color: ", ";\n      }\n    "], ["\n      color: ", ";\n      &:hover {\n        color: ", ";\n      }\n    "])), theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].colorHover);
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].colorActive;
}, function (_a) {
    var theme = _a.theme;
    return theme.components[COMPONENT_NAME].colorIcon;
});
export var TreeList = styled.div.attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        defaultTheme: defaultThemeTree,
        componentName: COMPONENT_NAME
    })
}); })(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  border-left: 1px solid ", ";\n  margin-left: 7px;\n  padding-left: 15px;\n"], ["\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  border-left: 1px solid ", ";\n  margin-left: 7px;\n  padding-left: 15px;\n"])), function (_a) {
    var theme = _a.theme;
    return theme.dividersColors.secondary;
});
export var TreeItem = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n  padding: 8px 0;\n  margin-left: 2px;\n  ", " {\n    padding: 0 8px 0 0;\n  }\n"], ["\n  padding: 8px 0;\n  margin-left: 2px;\n  ", " {\n    padding: 0 8px 0 0;\n  }\n"])), TreeHeader);
export var IconWrapper = styled.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n  display: flex;\n\n  .arrow-icon {\n    transition: all 0.3s;\n    ", "\n  }\n"], ["\n  display: flex;\n\n  .arrow-icon {\n    transition: all 0.3s;\n    ", "\n  }\n"])), function (_a) {
    var isShown = _a.isShown;
    return isShown && css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n        transform: rotate(90deg);\n      "], ["\n        transform: rotate(90deg);\n      "])));
});
export var Title = styled.input(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n  margin: 3px 0;\n  padding: 4px;\n  box-sizing: border-box;\n  width: 100%;\n  background: transparent;\n  border: none;\n  :disabled {\n    cursor: not-allowed;\n  }\n  :focus {\n    outline: none;\n    ", "\n  }\n  z-index: 5;\n"], ["\n  margin: 3px 0;\n  padding: 4px;\n  box-sizing: border-box;\n  width: 100%;\n  background: transparent;\n  border: none;\n  :disabled {\n    cursor: not-allowed;\n  }\n  :focus {\n    outline: none;\n    ", "\n  }\n  z-index: 5;\n"])), function (_a) {
    var readOnly = _a.readOnly;
    return !readOnly && css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n        border-radius: 8px;\n        background-color: ", ";\n      "], ["\n        border-radius: 8px;\n        background-color: ", ";\n      "])), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].backgroundEdit;
    });
});
Title.defaultProps = {
    theme: LIGHT_THEME
};
TreeList.defaultProps = {
    theme: LIGHT_THEME
};
TreeHeader.defaultProps = {
    theme: LIGHT_THEME
};
TreeWrapper.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;
