import styled from "@emotion/styled";
import { addFocus, applyEllipsis } from "../../../../../../mixins";
import { component, mergeConfig } from "../../../../../../engines";
import { classes, tokens, constants } from "../../../../Select.tokens";
import { checkboxConfig, checkboxTokens } from "../../../../../Checkbox";
import { cellConfig, cellTokens } from "../../../../../Cell";
import { indicatorConfig, indicatorTokens } from "../../../../../Indicator";
import { IconDisclosureRightCentered, IconDone } from "../../../../../_Icon";
export var ItemWrapper = /*#__PURE__*/ styled("div", {
    target: "eo55n2r0",
    label: "ItemWrapper"
})();
var mergedCheckboxConfig = mergeConfig(checkboxConfig);
var Checkbox = component(mergedCheckboxConfig);
var mergedCellConfig = mergeConfig(cellConfig);
var Cell = component(mergedCellConfig);
var mergedIndicatorConfig = mergeConfig(indicatorConfig);
var Indicator = component(mergedIndicatorConfig);
// TODO: #1548
export var StyledCell = /*#__PURE__*/ styled(Cell, {
    target: "eo55n2r1",
    label: "StyledCell"
})(cellTokens.cellTitleColor, ":var(", constants.cellTitleColor, ");", cellTokens.cellBackgroundColor, ":var(", constants.cellBackgroundColor, ");", cellTokens.cellPadding, ":var(", tokens.cellPadding, ");", cellTokens.cellPaddingLeftContent, ":var(", tokens.cellPaddingLeftContent, ");", cellTokens.cellPaddingContent, ":var(", tokens.cellPaddingContent, ");", cellTokens.cellPaddingRightContent, ":var(", tokens.cellPaddingRightContent, ");", cellTokens.cellTextboxGap, ":var(", tokens.cellTextboxGap, ");", cellTokens.cellGap, ":var(", tokens.cellGap, ");", cellTokens.cellTitleFontFamily, ":var(", tokens.cellTitleFontFamily, ");", cellTokens.cellTitleFontSize, ":var(", tokens.cellTitleFontSize, ");", cellTokens.cellTitleFontStyle, ":var(", tokens.cellTitleFontStyle, ");", cellTokens.cellTitleFontWeight, ":var(", tokens.cellTitleFontWeight, ");", cellTokens.cellTitleLetterSpacing, ":var(", tokens.cellTitleLetterSpacing, ");", cellTokens.cellTitleLineHeight, ":var(", tokens.cellTitleLineHeight, ");flex:1;min-width:0;& *{min-width:0;}&.", classes.singleLineMode, " .cell-textbox-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}");
export var StyledCheckbox = /*#__PURE__*/ styled(Checkbox, {
    target: "eo55n2r2",
    label: "StyledCheckbox"
})(checkboxTokens.triggerSize, ":var(", tokens.checkboxTriggerSize, ");", checkboxTokens.triggerBorderRadius, ":var(", tokens.checkboxTriggerBorderRadius, ");", checkboxTokens.fillColor, ":var(", tokens.checkboxFillColor, ");", checkboxTokens.iconColor, ":var(", tokens.checkboxIconColor, ");", checkboxTokens.triggerBorderWidth, ":var(", tokens.checkboxTriggerBorderWidth, ");", checkboxTokens.triggerBorderColor, ":var(", tokens.checkboxTriggerBorderColor, ");", checkboxTokens.triggerBorderCheckedColor, ":var(", tokens.checkboxTriggerBorderCheckedColor, ");");
export var StyledIndicator = /*#__PURE__*/ styled(Indicator, {
    target: "eo55n2r3",
    label: "StyledIndicator"
})(indicatorTokens.size, ":var(", tokens.indicatorSize, ");", indicatorTokens.color, ":var(", tokens.itemIconColor, ");");
// TODO: Удалить после поддержки JS переменных в конфиге компонент
export var sizeMap = {
    xs: '1rem',
    s: '1.5rem'
};
export var StyledArrowLeft = /*#__PURE__*/ styled(IconDisclosureRightCentered, {
    target: "eo55n2r4",
    label: "StyledArrowLeft"
})("width:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";height:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";&.", classes.arrowInverse, "{transform:rotate(90deg);}");
export var StyledArrowRight = /*#__PURE__*/ styled(IconDisclosureRightCentered, {
    target: "eo55n2r5",
    label: "StyledArrowRight"
})("width:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";height:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";transform:rotate(90deg);&.", classes.arrowInverse, "{transform:rotate(-90deg);}");
export var StyledIconDone = /*#__PURE__*/ styled(IconDone, {
    target: "eo55n2r6",
    label: "StyledIconDone"
})("width:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";height:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";");
export var DisclosureIconWrapper = /*#__PURE__*/ styled("div", {
    target: "eo55n2r7",
    label: "DisclosureIconWrapper"
})("line-height:0;color:var(", tokens.disclosureNestedIconColor, ",var(", tokens.disclosureIconColor, "));visibility:", function(param) {
    var visibility = param.visibility;
    return visibility || 'visible';
}, ";&:hover{color:var(", tokens.disclosureNestedIconColorHover, ",var(", tokens.disclosureIconColorHover, "));}");
export var IconWrapper = /*#__PURE__*/ styled("div", {
    target: "eo55n2r8",
    label: "IconWrapper"
})("display:flex;align-items:center;justify-content:center;flex:none;width:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize, ")");
}, ";height:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize, ")");
}, ";line-height:0;color:var(", tokens.itemIconColor, ");");
export var StyledText = /*#__PURE__*/ styled("div", {
    target: "eo55n2r9",
    label: "StyledText"
})(applyEllipsis(), ";flex:1;");
export var Wrapper = /*#__PURE__*/ styled("div", {
    target: "eo55n2r10",
    label: "Wrapper"
})("display:flex;align-items:center;gap:var(", tokens.itemGap, ");min-height:var(", tokens.itemHeight, ");margin:0;box-sizing:content-box;padding:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding, ")");
}, ";font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.fontLetterSpacing, ");line-height:var(", tokens.fontLineHeight, ");background-color:var(", constants.itemBackground, ");color:var(--text-primary);border-radius:calc(var(", tokens.borderRadius, ") - 0.125rem - var(", tokens.dropdownBorderWidth, ",0rem));user-select:none;background-clip:padding-box;&:hover:not(.", classes.dropdownItemIsDisabled, "){cursor:pointer;background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsActive, "{background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsDisabled, "{opacity:", constants.opacity, ";cursor:not-allowed;}:focus{outline:none;}", addFocus({
    outlineSize: '0',
    outlineOffset: '0',
    outlineColor: "var(".concat(constants.focusColor, ")"),
    outlineRadius: "calc(var(".concat(tokens.borderRadius, ") - 0.125rem - var(").concat(tokens.dropdownBorderWidth, ", 0rem))"),
    hasTransition: false,
    customFocusRules: "\n            &.".concat(classes.dropdownItemIsFocused, ":before {\n                outline: none;\n                box-shadow: inset 0 0 0 0.0625rem var(").concat(constants.focusColor, ");\n            }\n        ")
}), ";");
export var StyledCheckboxWrapper = /*#__PURE__*/ styled("span", {
    target: "eo55n2r11",
    label: "StyledCheckboxWrapper"
})();
export var ChildItems = /*#__PURE__*/ styled("div", {
    target: "eo55n2r12",
    label: "ChildItems"
})();
export var Offset = /*#__PURE__*/ styled("div", {
    target: "eo55n2r13",
    label: "Offset"
})("width:calc(", function(param) {
    var depth = param.depth;
    return depth || 0;
}, " * var(", tokens.itemTreeOffsetWidth, "));flex:none;margin-right:calc(var(", tokens.itemGap, ") * -1);");
