import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["sx", "columnStart", "gridColumnStart", "gridColumnEnd", "columnEnd", "rowEnd", "gridRowEnd", "rowStart", "gridRowStart", "column", "gridColumn", "row", "gridRow", "area", "gridArea", "justifySelf", "alignSelf", "placeSelf"];

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

/* eslint-disable react/forbid-prop-types */
import React from "react";
import PropTypes from "prop-types";
import Box from "../Box";
var Item = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var sx = props.sx,
      columnStart = props.columnStart,
      gridColumnStart = props.gridColumnStart,
      gridColumnEnd = props.gridColumnEnd,
      columnEnd = props.columnEnd,
      rowEnd = props.rowEnd,
      gridRowEnd = props.gridRowEnd,
      rowStart = props.rowStart,
      gridRowStart = props.gridRowStart,
      column = props.column,
      gridColumn = props.gridColumn,
      row = props.row,
      gridRow = props.gridRow,
      area = props.area,
      gridArea = props.gridArea,
      justifySelf = props.justifySelf,
      alignSelf = props.alignSelf,
      placeSelf = props.placeSelf,
      boxProps = _objectWithoutProperties(props, _excluded);

  var styles = _objectSpread({
    gridColumnStart: columnStart !== null && columnStart !== void 0 ? columnStart : gridColumnStart,
    gridRowStart: rowStart !== null && rowStart !== void 0 ? rowStart : gridRowStart,
    gridColumnEnd: columnEnd !== null && columnEnd !== void 0 ? columnEnd : gridColumnEnd,
    gridRowEnd: rowEnd !== null && rowEnd !== void 0 ? rowEnd : gridRowEnd,
    gridColumn: column !== null && column !== void 0 ? column : gridColumn,
    gridRow: row !== null && row !== void 0 ? row : gridRow,
    gridArea: area !== null && area !== void 0 ? area : gridArea,
    justifySelf: justifySelf,
    alignSelf: alignSelf
  }, sx);

  return /*#__PURE__*/React.createElement(Box, _extends({
    sx: styles,
    ref: ref
  }, boxProps));
});
Item.propTypes = {
  columnStart: PropTypes.any,
  gridColumnStart: PropTypes.any,
  gridColumnEnd: PropTypes.any,
  columnEnd: PropTypes.any,
  rowEnd: PropTypes.any,
  gridRowEnd: PropTypes.any,
  rowStart: PropTypes.any,
  gridRowStart: PropTypes.any,
  column: PropTypes.any,
  gridColumn: PropTypes.any,
  row: PropTypes.any,
  gridRow: PropTypes.any,
  area: PropTypes.any,
  gridArea: PropTypes.any,
  justifySelf: PropTypes.any,
  alignSelf: PropTypes.any,
  placeSelf: PropTypes.any,
  sx: PropTypes.object,
  component: PropTypes.elementType
};

if (process.env.NODE_ENV !== "production") {
  Item.displayName = "CssGrid.Item";
}

export default Item;