"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getInputProps = getInputProps;
exports["default"] = void 0;

var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));

var _react = _interopRequireDefault(require("react"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function getInputProps(props) {
  var attributes = props.attributes;
  var _attributes$InputProp = attributes.InputProps,
      InputProps = _attributes$InputProp === void 0 ? {} : _attributes$InputProp;

  if (!(0, _isEmpty["default"])(InputProps)) {
    var _InputProps$InputAdor = InputProps.InputAdornment,
        InputAdornment = _InputProps$InputAdor === void 0 ? {} : _InputProps$InputAdor;

    if (!(0, _isEmpty["default"])(InputAdornment)) {
      var INPUTADORMENT = props.library.InputAdornment;
      var ICON = props.library.Icon;
      var _InputAdornment$posit = InputAdornment.position,
          position = _InputAdornment$posit === void 0 ? 'start' : _InputAdornment$posit,
          icon = InputAdornment.icon,
          text = InputAdornment.text,
          _InputAdornment$texts = InputAdornment.textstyle,
          textstyle = _InputAdornment$texts === void 0 ? {} : _InputAdornment$texts;
      return _defineProperty({}, "".concat(position, "Adornment"), /*#__PURE__*/_react["default"].createElement(INPUTADORMENT, InputAdornment, icon ? /*#__PURE__*/_react["default"].createElement(ICON, null, icon) : !(0, _isEmpty["default"])(textstyle) ? /*#__PURE__*/_react["default"].createElement("div", {
        style: textstyle
      }, text || '') : text || ''));
    }
  }

  return {};
}

var _default = {
  getInputProps: getInputProps
};
exports["default"] = _default;