"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ControlBox = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _base = _interopRequireDefault(require("@emotion/styled/base"));

var _css2 = _interopRequireDefault(require("@styled-system/css"));

var _Box = require("../Box");

var _config = require("../Box/config");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

var ControlBox = ( /*#__PURE__*/0, _base["default"])(_Box.Box, process.env.NODE_ENV === "production" ? {
  target: "e1y9zx080"
} : {
  target: "e1y9zx080",
  label: "ControlBox"
})(function (_ref) {
  var _css;

  var _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'checkbox' : _ref$type,
      _hover = _ref._hover,
      _invalid = _ref._invalid,
      _disabled = _ref._disabled,
      _focus = _ref._focus,
      _checked = _ref._checked,
      _ref$_child = _ref._child,
      _child = _ref$_child === void 0 ? {
    opacity: 0
  } : _ref$_child,
      _ref$_checkedAndChild = _ref._checkedAndChild,
      _checkedAndChild = _ref$_checkedAndChild === void 0 ? {
    opacity: 1
  } : _ref$_checkedAndChild,
      _checkedAndDisabled = _ref._checkedAndDisabled,
      _checkedAndFocus = _ref._checkedAndFocus,
      _checkedAndHover = _ref._checkedAndHover;

  var checkedAndDisabled = "input[type=".concat(type, "]:checked:disabled + &, input[type=").concat(type, "][aria-checked=mixed]:disabled + &");
  var checkedAndHover = "input[type=".concat(type, "]:checked:hover:not(:disabled) + &, input[type=").concat(type, "][aria-checked=mixed]:hover:not(:disabled) + &");
  var checkedAndFocus = "input[type=".concat(type, "]:checked:focus + &, input[type=").concat(type, "][aria-checked=mixed]:focus + &");
  var disabled = "input[type=".concat(type, "]:disabled + &");
  var focus = "input[type=".concat(type, "]:focus + &");
  var hover = "input[type=".concat(type, "]:hover:not(:disabled):not(:checked) + &");
  var checked = "input[type=".concat(type, "]:checked + &, input[type=").concat(type, "][aria-checked=mixed] + &");
  var invalid = "input[type=".concat(type, "][aria-invalid=true] + &");
  return (0, _css2["default"])((_css = {}, (0, _defineProperty2["default"])(_css, focus, (0, _config.transformAliasProps)(_focus)), (0, _defineProperty2["default"])(_css, hover, (0, _config.transformAliasProps)(_hover)), (0, _defineProperty2["default"])(_css, disabled, (0, _config.transformAliasProps)(_disabled)), (0, _defineProperty2["default"])(_css, invalid, (0, _config.transformAliasProps)(_invalid)), (0, _defineProperty2["default"])(_css, checkedAndDisabled, (0, _config.transformAliasProps)(_checkedAndDisabled)), (0, _defineProperty2["default"])(_css, checkedAndFocus, (0, _config.transformAliasProps)(_checkedAndFocus)), (0, _defineProperty2["default"])(_css, checkedAndHover, (0, _config.transformAliasProps)(_checkedAndHover)), (0, _defineProperty2["default"])(_css, '& > *', (0, _config.transformAliasProps)(_child)), (0, _defineProperty2["default"])(_css, checked, _objectSpread(_objectSpread({}, (0, _config.transformAliasProps)(_checked)), {}, {
    '& > *': (0, _config.transformAliasProps)(_checkedAndChild)
  })), _css));
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Db250cm9sQm94L0NvbnRyb2xCb3gudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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GlzYWJsZWRdOiB0cmFuc2Zvcm1BbGlhc1Byb3BzKF9kaXNhYmxlZCksXG4gICAgICAgICAgICBbaW52YWxpZF06IHRyYW5zZm9ybUFsaWFzUHJvcHMoX2ludmFsaWQpLFxuICAgICAgICAgICAgW2NoZWNrZWRBbmREaXNhYmxlZF06IHRyYW5zZm9ybUFsaWFzUHJvcHMoX2NoZWNrZWRBbmREaXNhYmxlZCksXG4gICAgICAgICAgICBbY2hlY2tlZEFuZEZvY3VzXTogdHJhbnNmb3JtQWxpYXNQcm9wcyhfY2hlY2tlZEFuZEZvY3VzKSxcbiAgICAgICAgICAgIFtjaGVja2VkQW5kSG92ZXJdOiB0cmFuc2Zvcm1BbGlhc1Byb3BzKF9jaGVja2VkQW5kSG92ZXIpLFxuICAgICAgICAgICAgJyYgPiAqJzogdHJhbnNmb3JtQWxpYXNQcm9wcyhfY2hpbGQpLFxuICAgICAgICAgICAgW2NoZWNrZWRdOiB7XG4gICAgICAgICAgICAgICAgLi4udHJhbnNmb3JtQWxpYXNQcm9wcyhfY2hlY2tlZCksXG4gICAgICAgICAgICAgICAgJyYgPiAqJzogdHJhbnNmb3JtQWxpYXNQcm9wcyhfY2hlY2tlZEFuZENoaWxkKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbik7XG5cbkNvbnRyb2xCb3guZGVmYXVsdFByb3BzID0ge1xuICAgIGRpc3BsYXk6ICdpbmxpbmUtZmxleCcsXG4gICAgYWxpZ25JdGVtczogJ2NlbnRlcicsXG4gICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxuICAgIHRyYW5zaXRpb246ICdhbGwgMTIwbXMnLFxuICAgIGZsZXhTaHJpbms6IDAsXG4gICAgJ2FyaWEtaGlkZGVuJzogJ3RydWUnLFxufTtcbiJdfQ== */");
exports.ControlBox = ControlBox;
ControlBox.defaultProps = {
  display: 'inline-flex',
  alignItems: 'center',
  justifyContent: 'center',
  transition: 'all 120ms',
  flexShrink: 0,
  'aria-hidden': 'true'
};
//# sourceMappingURL=ControlBox.js.map