"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get FieldContent () {
        return FieldContent;
    },
    get FieldHelper () {
        return FieldHelper;
    },
    get FieldPlaceholder () {
        return FieldPlaceholder;
    },
    get FieldRoot () {
        return FieldRoot;
    }
});
var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
var _mixins = require("../../mixins");
var _tokens = require("../../tokens");
var _Fieldstatuses = require("./Field.statuses");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
var FieldPlaceholder = _styledcomponents.default.label.withConfig({
    displayName: "Field__FieldPlaceholder",
    componentId: "sc-cb2977c5-0"
})([
    "position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;color:",
    ";pointer-events:none;transition:",
    ";transform-origin:top left;",
    ""
], _tokens.tertiary, function(param) {
    var theme = param.theme;
    return theme.lowPerformance ? 'unset' : 'all 0.1s ease-in';
}, _mixins.applyEllipsis);
var FieldContent = _styledcomponents.default.div.withConfig({
    displayName: "Field__FieldContent",
    componentId: "sc-cb2977c5-1"
})([
    "position:absolute;top:0;",
    ";bottom:0;display:flex;align-items:center;height:3rem;"
], function(param) {
    var pos = param.pos;
    return pos === 'left' ? 'left: 1rem' : 'right: 1rem';
});
var FieldHelper = _styledcomponents.default.span.withConfig({
    displayName: "Field__FieldHelper",
    componentId: "sc-cb2977c5-2"
})([
    "",
    ";display:block;margin-top:0.25rem;",
    ""
], _tokens.caption, _mixins.applyEllipsis);
var FieldRoot = _styledcomponents.default.div.withConfig({
    displayName: "Field__FieldRoot",
    componentId: "sc-cb2977c5-3"
})([
    "",
    ";position:relative;display:block;box-sizing:border-box;color:",
    ";",
    " ",
    " ",
    " ",
    ""
], _tokens.body1, _tokens.secondary, _mixins.applyDisabled, function(param) {
    var _param_$size = param.$size, $size = _param_$size === void 0 ? 'm' : _param_$size;
    return $size === 'l' ? (0, _styledcomponents.css)([
        "",
        "{top:1.125rem;left:1rem;right:1rem;}input:not(:placeholder-shown) ~ ",
        "{transform:scale(0.75);top:0.375rem;}",
        "{height:3.5rem;}"
    ], FieldPlaceholder, FieldPlaceholder, FieldContent) : (0, _styledcomponents.css)([
        "",
        "{height:3rem;}"
    ], FieldContent);
}, function(param) {
    var $isContentLeft = param.$isContentLeft, $isContentRight = param.$isContentRight;
    return (0, _styledcomponents.css)([
        "input,textarea{",
        "  ",
        "}",
        "{",
        "  ",
        "}"
    ], $isContentLeft && 'padding-left: 3.125rem;', $isContentRight && 'padding-right: 3.125rem;', FieldPlaceholder, $isContentLeft && 'left: 3.125rem;', $isContentRight && 'right: 3.125rem;');
}, function(param) {
    var $isHelper = param.$isHelper, status = param.status;
    return status && ($isHelper ? (0, _styledcomponents.css)([
        "",
        "{color:",
        ";}"
    ], FieldHelper, _Fieldstatuses.fieldStatuses[status]) : (0, _styledcomponents.css)([
        "",
        "{color:",
        ";}"
    ], FieldPlaceholder, _Fieldstatuses.fieldStatuses[status]));
});
