(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", "../Input", "../Pallette/themes", "../utils/theme/getTheme", "./themes"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.ColorPickerWrapper = exports.InputColorWrapper = exports.ColorButton = exports.InputColorComponent = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var Input_1 = (0, tslib_1.__importDefault)(require("../Input"));
    var themes_1 = require("../Pallette/themes");
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_2 = require("./themes");
    exports.InputColorComponent = (0, styled_components_1.default)(Input_1.default)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n  ", ";\n  ", ";\n"], ["\n  ", ";\n  ", ";\n"])), function (_a) {
        var isReadonly = _a.isReadonly;
        if (isReadonly) {
            return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n        div {\n          cursor: default;\n        }\n      "], ["\n        div {\n          cursor: default;\n        }\n      "])));
        }
        return "";
    }, function (_a) {
        var isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly;
        return (isDisabled || isReadOnly) && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n      button {\n        cursor: not-allowed;\n      }\n    "], ["\n      button {\n        cursor: not-allowed;\n      }\n    "])));
    });
    exports.ColorButton = styled_components_1.default.button.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: themes_2.defaultThemeInputColor,
            componentName: "inputColor"
        })
    }); })(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n  width: 24px;\n  height: 24px;\n  background: ", ";\n  border: 1px solid\n    ", ";\n  border-radius: 8px;\n  cursor: pointer;\n"], ["\n  width: 24px;\n  height: 24px;\n  background: ", ";\n  border: 1px solid\n    ", ";\n  border-radius: 8px;\n  cursor: pointer;\n"])), function (_a) {
        var color = _a.color;
        return !color || color.length < 7 ? "transparent" : color;
    }, function (_a) {
        var color = _a.color, theme = _a.theme;
        if (!color || color.length < 7) {
            return theme.components.inputColor.borderColorButton;
        }
        return color;
    });
    exports.InputColorWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n  display: block;\n"], ["\n  display: block;\n"])));
    exports.ColorPickerWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n  ", ";\n  position: absolute;\n"], ["\n  ", ";\n  position: absolute;\n"])), function (_a) {
        var _b;
        var left = _a.left, top = _a.top, theme = _a.theme;
        return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n    left: ", "px;\n    top: ", "px;\n    z-index: ", ";\n  "], ["\n    left: ", "px;\n    top: ", "px;\n    z-index: ", ";\n  "])), left, top, (_b = theme.zindex) === null || _b === void 0 ? void 0 : _b.tooltip);
    });
    exports.ColorButton.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.ColorPickerWrapper.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.InputColorComponent.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
});
