"use strict";

exports.__esModule = true;
exports.default = exports.MemoTableBody = exports.MemoTableRow = exports.useStyles = void 0;

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

var _Table = _interopRequireDefault(require("@material-ui/core/Table"));

var _TableContainer = _interopRequireDefault(require("@material-ui/core/TableContainer"));

var _TableHead = _interopRequireDefault(require("@material-ui/core/TableHead"));

var _TableRow = _interopRequireDefault(require("@material-ui/core/TableRow"));

var _styles = require("@material-ui/core/styles");

var _createInput = require("../Inputs/createInput");

var _useTableSelection3 = require("./useTableSelection");

var _TableProps = _interopRequireWildcard(require("./TableProps"));

var _classnames = _interopRequireDefault(require("classnames"));

var _reactResizeDetector = _interopRequireDefault(require("react-resize-detector"));

var _lodash = require("lodash");

var _excluded = ["deepPropsComparation", "dataRows", "isEditingMode"],
    _excluded2 = ["deepPropsComparation", "isEditingMode"];

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(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 = {}; 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; }

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    container: {
      flex: "0 1 100%",
      fontSize: theme.typography.fontSize,
      display: "flex",
      flexDirection: "column"
    },
    tableContainer: {
      overflowY: "auto",
      position: "relative"
    },
    table: {
      tableLayout: "fixed"
    },
    stickyHeaderHead: {
      borderTop: function borderTop(props) {
        return props.withoutTopBorder ? "none" : "1px solid " + theme.palette.grey.borders;
      },
      borderBottom: "1px solid " + theme.palette.grey.borders,
      backgroundColor: theme.palette.grey.lighter,
      display: "flex",
      cursor: "default"
    },
    stickyHeaderTable: {
      tableLayout: "fixed",
      width: function width(props) {
        return "calc(100% - " + (props.scrolled || "0") + "px)";
      }
    },
    stickyHeaderTableScroll: {
      width: function width(props) {
        return (props.scrolled || "0") + "px";
      },
      backgroundColor: theme.palette.grey.lighter,
      display: function display(props) {
        return props.scrolled > 0 ? "block" : "none";
      }
    },
    tableHeader: {
      borderTop: function borderTop(props) {
        return props.withoutTopBorder ? "none" : "1px solid " + theme.palette.grey.borders;
      },
      borderBottom: function borderBottom(props) {
        return props.stickyHeader ? "none" : "1px solid " + theme.palette.grey.borders;
      },
      display: function display(props) {
        return props.stickyHeader ? "none" : "table-header-group";
      },
      backgroundColor: theme.palette.grey.lighter,
      overflow: "hidden",
      cursor: "default"
    },
    tableBody: {
      overflowX: "hidden",
      overflowY: "auto"
    },
    tableRow: {
      borderBottom: "1px solid " + theme.palette.grey.borders,
      cursor: function cursor(props) {
        return props.onRowClick ? "pointer" : "default";
      },
      backgroundColor: theme.palette.background.paper + "!important",
      "&:hover": {
        backgroundColor: function backgroundColor(props) {
          return props.onRowClick ? theme.palette.grey.lighter : theme.palette.background.paper;
        }
      }
    },
    tableCell: {
      padding: theme.spacing(2)
    },
    tableCellSelect: {
      padding: theme.spacing(2),
      width: theme.spacing(3)
    },
    headerCell: {
      padding: theme.spacing(1, 2),
      textAlign: "left",
      fontWeight: theme.typography.fontWeightSemiBold
    },
    headerCellSelect: {
      padding: theme.spacing(1, 2),
      width: theme.spacing(3),
      textAlign: "left",
      fontWeight: theme.typography.fontWeightSemiBold
    },
    rowSelectCheckbox: {
      padding: 0
    },
    placeholder: {
      display: "flex",
      flex: 1,
      justifyContent: "center",
      alignItems: "center"
    }
  };
});
exports.useStyles = useStyles;

function headersAreIdentical(prevHeaders, nextHeaders) {
  prevHeaders.forEach(function (prevHeader, index) {
    var _nextHeaders$index;

    var prevSortOptions = prevHeader.cellElement.props.columnDefinition.sortOptions;
    var nextSortOptions = (_nextHeaders$index = nextHeaders[index]) == null ? void 0 : _nextHeaders$index.cellElement.props.columnDefinition.sortOptions;

    if (prevSortOptions != null && nextSortOptions != null) {
      if (prevSortOptions.sortField !== nextSortOptions.sortField) {
        return false;
      }

      return prevSortOptions.direction === nextSortOptions.direction;
    }

    return true;
  });
}

function readOnlyMode(prevTableProps, nextTableProps) {
  var _prevTableProps$get, _nextTableProps$get;

  var prevEditingMode = (_prevTableProps$get = prevTableProps == null ? void 0 : prevTableProps.get(_TableProps.default.propNames.isEditingMode)) != null ? _prevTableProps$get : false;
  var nextEditingMode = (_nextTableProps$get = nextTableProps == null ? void 0 : nextTableProps.get(_TableProps.default.propNames.isEditingMode)) != null ? _nextTableProps$get : false;
  return isInReadOnlyMode(prevEditingMode, nextEditingMode);
}

function rowAreIdentical(prevRows, nextRows) {
  return prevRows.length === nextRows.length && prevRows.findIndex(function (pr, index) {
    return pr.key !== nextRows[index].key;
  }) === -1;
}

function contextIsIdentical(prevContext, nextContext) {
  return (0, _lodash.isEqual)(prevContext, nextContext);
}

function propsAreEqualRow(prev, next) {
  var isReadOnly = isInReadOnlyMode(prev.isEditingMode, next.isEditingMode);

  if (prev.deepPropsComparation && isReadOnly) {
    return propsAreEqualDeeplyRow(prev.dataRows, next.dataRows) && contextIsIdentical(prev.context, next.context);
  }

  return prev.selected === next.selected && isReadOnly && contextIsIdentical(prev.context, next.context);
}

function propsAreEqualDeeplyRow(prevRow, nextRow) {
  /* istanbul ignore next */
  if (prevRow.length !== nextRow.length) return false;

  for (var i = 0; i < prevRow.length; i++) {
    if (!(0, _lodash.isEqual)(prevRow[i].element, nextRow[i].element) || prevRow[i].columns.length !== nextRow[i].columns.length) {
      return false;
    }
  }

  return true;
}

var TableRowMemo = function TableRowMemo(_ref) {
  var deepPropsComparation = _ref.deepPropsComparation,
      dataRows = _ref.dataRows,
      isEditingMode = _ref.isEditingMode,
      props = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/_react.default.createElement(_TableRow.default, props);
};

var MemoTableRow = _react.default.memo(TableRowMemo, propsAreEqualRow);

exports.MemoTableRow = MemoTableRow;

function isInReadOnlyMode(prevIsEditingMode, nextIsEditingMode) {
  // In editing mode, we need to re-render everytime has cell value may have changed
  return prevIsEditingMode === nextIsEditingMode && !nextIsEditingMode;
}

function propsAreEqualBody(prev, next) {
  var isEqualBody = contextIsIdentical(prev.context, next.context) && isInReadOnlyMode(prev.isEditingMode, next.isEditingMode) && prev.selectedNumber === next.selectedNumber && rowAreIdentical(prev.dataRows, next.dataRows);

  if (prev.deepPropsComparation) {
    isEqualBody = isEqualBody && propsAreEqualDeeplyRow(prev.dataRows, next.dataRows);
  }

  return isEqualBody;
}

var TableBody = function TableBody(_ref2) {
  var deepPropsComparation = _ref2.deepPropsComparation,
      isEditingMode = _ref2.isEditingMode,
      props = _objectWithoutProperties(_ref2, _excluded2);

  return /*#__PURE__*/_react.default.createElement("tbody", {
    className: props.className
  }, props.tableRows);
};

var MemoTableBody = _react.default.memo(TableBody, propsAreEqualBody);

exports.MemoTableBody = MemoTableBody;

var TableCell = _react.default.forwardRef(function (props, ref) {
  //withDeferredTooltip(
  return /*#__PURE__*/_react.default.createElement("td", _extends({
    className: props.className,
    ref: ref
  }, props), props.value);
}); //);


var buildRowCheckbox = function buildRowCheckbox(classes, key, selectionHandlers) {
  var rowSelected = selectionHandlers.isSelected(key);
  return /*#__PURE__*/_react.default.createElement("td", {
    className: classes.tableCellSelect,
    selected: rowSelected
  }, (0, _createInput.createInput)(_createInput.inputTypes.checkbox, {
    value: rowSelected,
    disabled: false,
    onChange: function onChange(event) {
      return selectionHandlers.selectionHandler(event, key);
    }
  }));
};

var buildTableCheckbox = function buildTableCheckbox(classes, tableSelectionStatus, selectionMethods) {
  return /*#__PURE__*/_react.default.createElement("th", {
    key: "tableSelector",
    className: classes.headerCellSelect
  }, (0, _createInput.createInput)(_createInput.inputTypes.checkbox, {
    value: tableSelectionStatus === _useTableSelection3.tableSelectionMode.all,
    disabled: false,
    indeterminate: tableSelectionStatus === _useTableSelection3.tableSelectionMode.indeterminate,
    onChange: function onChange(event) {
      return selectionMethods.selectionHandler(event, null);
    }
  }));
};

var StickerTableHeader = function StickerTableHeader(_ref3) {
  var classes = _ref3.classes,
      tableHeaders = _ref3.tableHeaders;
  return /*#__PURE__*/_react.default.createElement("div", {
    key: "stickyHeader",
    className: classes.stickyHeaderHead
  }, /*#__PURE__*/_react.default.createElement(_Table.default, {
    className: classes.stickyHeaderTable
  }, /*#__PURE__*/_react.default.createElement(_TableHead.default, null, /*#__PURE__*/_react.default.createElement(_TableRow.default, null, tableHeaders))), /*#__PURE__*/_react.default.createElement("div", {
    className: classes.stickyHeaderTableScroll
  }));
};

var buildTableHeaders = function buildTableHeaders(headers, classes, customClasses, selectMode, tableSelectionStatus, selectionMethods) {
  var tableCheckbox = selectMode === true ? [buildTableCheckbox(classes, tableSelectionStatus, selectionMethods)] : [];
  return tableCheckbox.concat(headers.map(function (header, index) {
    return /*#__PURE__*/_react.default.createElement("th", {
      key: index,
      className: (0, _classnames.default)(classes.headerCell, customClasses[header.className], customClasses.headerCell)
    }, header.cellElement);
  }));
};

var buildTableRows = function buildTableRows(rows, classes, customClasses, selectMode, onRowClick, selectionHandlers, deepPropsComparation, context, isEditingMode) {
  var _onClick = function onClick(evt, row) {
    if (evt.target.tagName !== "INPUT" && onRowClick != null) {
      onRowClick(evt, row.element);
    }
  };

  var mappedRows = rows.map(function (row) {
    var _row$style$show, _row$style, _row$style$customClas, _row$style2;

    var showStyle = (_row$style$show = row == null ? void 0 : (_row$style = row.style) == null ? void 0 : _row$style.show) != null ? _row$style$show : false;
    var rowClass = (_row$style$customClas = row == null ? void 0 : (_row$style2 = row.style) == null ? void 0 : _row$style2.customClass) != null ? _row$style$customClas : "";
    var customClassName = showStyle ? rowClass : "";
    return /*#__PURE__*/_react.default.createElement(MemoTableRow, {
      className: (0, _classnames.default)(classes.tableRow, customClasses.tableRow, customClasses[row.className], customClasses[customClassName]),
      key: row.key,
      onClick: function onClick(evt) {
        return _onClick(evt, row);
      },
      selected: selectionHandlers.isSelected(row.key),
      deepPropsComparation: deepPropsComparation,
      context: context,
      isEditingMode: isEditingMode,
      dataRows: rows
    }, selectMode === true ? buildRowCheckbox(classes, row.key, selectionHandlers) : null, row.columns.map(function (cell, cellIndex) {
      return /*#__PURE__*/_react.default.createElement(TableCell, {
        className: (0, _classnames.default)(classes.tableCell, customClasses[cell.className], customClasses.tableCell),
        key: cellIndex,
        value: cell.cellElement
      });
    }));
  });
  return mappedRows;
};

var FullTable = _react.default.forwardRef(function (props, ref) {
  var scrollEvent = function scrollEvent(evt) {
    if (evt.target.scrollHeight - (evt.target.scrollTop + evt.target.offsetHeight) < 100 && props.dataRows.length === props.latestPage * props.pageLength) {
      props.scrollLoader(props.latestPage + 1);
    }
  };

  return /*#__PURE__*/_react.default.createElement("div", {
    key: "actualTable",
    className: (0, _classnames.default)(props.classes.tableContainer, props.customClasses.tableContainer),
    ref: ref,
    onScroll: scrollEvent
  }, /*#__PURE__*/_react.default.createElement(_reactResizeDetector.default, {
    onResize: props.onResize
  }), /*#__PURE__*/_react.default.createElement(_Table.default, {
    className: (0, _classnames.default)(props.classes.table, props.customClasses.table)
  }, /*#__PURE__*/_react.default.createElement(_TableHead.default, {
    className: (0, _classnames.default)(props.classes.tableHeader, props.customClasses.tableHeader)
  }, /*#__PURE__*/_react.default.createElement(_TableRow.default, null, props.tableHeaders)), /*#__PURE__*/_react.default.createElement(MemoTableBody, {
    className: (0, _classnames.default)(props.classes.tableBody, props.customClasses.tableBody),
    dataRows: props.dataRows,
    tableRows: props.tableRows,
    selectedNumber: props.selectedNumber,
    deepPropsComparation: props.deepPropsComparation,
    isEditingMode: props.isEditingMode,
    context: props.context
  })), props.tableRows.length > 0 ? null : /*#__PURE__*/_react.default.createElement("div", {
    className: props.classes.placeholder
  }, props.placeholder));
});

var Table = function Table(_ref4) {
  var tableInfo = _ref4.tableInfo,
      headers = _ref4.headers,
      rows = _ref4.rows,
      scrollLoader = _ref4.scrollLoader,
      latestPage = _ref4.latestPage,
      pageLength = _ref4.pageLength,
      placeholder = _ref4.placeholder,
      tableProps = _ref4.tableProps,
      context = _ref4.context;

  if ((0, _TableProps.isTableProps)(tableProps) === false) {
    throw new TypeError("tableProps property is not of type TableProps");
  }

  var customClasses = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.classes)) || {};
  var selectMode = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.selectMode)) || false;
  var stickyHeader = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.stickyHeader)) || false;
  var withoutTopBorder = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.withoutTopBorder)) || false;
  var onRowClick = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.onRowClick)) || null;
  var deepPropsComparation = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.deepPropsComparation)) || false;
  var isEditingMode = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.isEditingMode)) || false;
  var selectedRows = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.selectedRows)) || null;
  var selectedRowsChanged = (tableProps == null ? void 0 : tableProps.get(_TableProps.default.propNames.selectedRowsChanged)) || null;
  customClasses["tableHeader"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableHeader)) || null;
  customClasses["tableRow"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableRow)) || null;
  customClasses["tableCell"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableCell)) || null;
  customClasses["headerCell"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.headerCell)) || null;
  customClasses["tableContainer"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableContainer)) || null;
  customClasses["container"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.container)) || null;
  customClasses["table"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.table)) || null;
  if (selectedRows && !selectedRowsChanged || !selectedRows && selectedRowsChanged) throw new Error("Both 'selectedRows' and 'selectedRowsChanged' need to be defined if one of them is.");
  var refScrolled = (0, _react.useRef)();

  var _useState = (0, _react.useState)(0),
      _useState2 = _slicedToArray(_useState, 2),
      scrolled = _useState2[0],
      setScrolled = _useState2[1];

  var _useState3 = (0, _react.useState)({
    width: 0,
    height: 0
  }),
      _useState4 = _slicedToArray(_useState3, 2),
      tableSize = _useState4[0],
      setTableSize = _useState4[1];

  var _useTableSelection = (0, _useTableSelection3.useTableSelection)(rows, selectedRows, selectedRowsChanged),
      _useTableSelection2 = _slicedToArray(_useTableSelection, 3),
      selectedNumber = _useTableSelection2[0],
      tableSelectionStatus = _useTableSelection2[1],
      selectionMethods = _useTableSelection2[2];

  var classes = useStyles({
    withoutTopBorder: withoutTopBorder,
    selectMode: selectMode,
    stickyHeader: stickyHeader,
    scrolled: scrolled,
    onRowClick: onRowClick
  });
  (0, _react.useEffect)(function () {
    var handleResize = function handleResize() {
      if (refScrolled.current.offsetHeight < refScrolled.current.scrollHeight) setScrolled(refScrolled.current.offsetWidth - refScrolled.current.clientWidth);else setScrolled(0);
    };

    handleResize();
    window.addEventListener("resize", handleResize);
    /* istanbul ignore next */

    return function () {
      return window.removeEventListener("resize", handleResize);
    };
  }, [refScrolled, tableSize.width, tableSize.height]);
  var tableHeaders = buildTableHeaders(headers, classes, customClasses, selectMode, tableSelectionStatus, selectionMethods);
  var tableRows = buildTableRows(rows, classes, customClasses, selectMode, onRowClick, selectionMethods, deepPropsComparation, context, isEditingMode);
  var stickerTableHeader = stickyHeader === true ? /*#__PURE__*/_react.default.createElement(StickerTableHeader, {
    selectMode: selectMode,
    classes: classes,
    tableHeaders: tableHeaders
  }) : null;
  /* istanbul ignore next */

  var onResize = (0, _react.useCallback)(function (width, height) {
    return setTableSize({
      width: width,
      height: height
    });
  }, [setTableSize]);
  return /*#__PURE__*/_react.default.createElement(_TableContainer.default, {
    className: (0, _classnames.default)(classes.container, customClasses.container)
  }, tableInfo, stickerTableHeader, /*#__PURE__*/_react.default.createElement(FullTable, {
    ref: refScrolled,
    classes: classes,
    customClasses: customClasses,
    onResize: onResize,
    selectedNumber: selectedNumber,
    scrollLoader: scrollLoader,
    tableHeaders: tableHeaders,
    dataRows: rows,
    tableRows: tableRows,
    stickyHeader: stickyHeader,
    latestPage: latestPage,
    pageLength: pageLength,
    placeholder: placeholder,
    deepPropsComparation: deepPropsComparation,
    isEditingMode: isEditingMode,
    context: context
  }));
};

__signature__(Table, "useRef{refScrolled}\nuseState{[scrolled, setScrolled](0)}\nuseState{[tableSize, setTableSize]({ width: 0, height: 0 })}\nuseTableSelection{[selectedNumber, tableSelectionStatus, selectionMethods]}\nuseStyles{classes}\nuseEffect{}\nuseCallback{onResize}", function () {
  return [_useTableSelection3.useTableSelection, useStyles];
});

__signature__(Table, "useRef{refScrolled}\nuseState{[scrolled, setScrolled](0)}\nuseState{[tableSize, setTableSize]({ width: 0, height: 0 })}\nuseTableSelection{[selectedNumber, tableSelectionStatus, selectionMethods]}\nuseStyles{classes}\nuseEffect{}\nuseCallback{onResize}", function () {
  return [_useTableSelection3.useTableSelection, useStyles];
});

var _default = _react.default.memo(Table, function (prev, next) {
  return readOnlyMode(prev.tableProps, next.tableProps) && rowAreIdentical(prev.rows, next.rows) && headersAreIdentical(prev.headers, next.headers);
});

var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(headersAreIdentical, "headersAreIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(readOnlyMode, "readOnlyMode", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(rowAreIdentical, "rowAreIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(contextIsIdentical, "contextIsIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualRow, "propsAreEqualRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualDeeplyRow, "propsAreEqualDeeplyRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableRowMemo, "TableRowMemo", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(MemoTableRow, "MemoTableRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(isInReadOnlyMode, "isInReadOnlyMode", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualBody, "propsAreEqualBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableBody, "TableBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(MemoTableBody, "MemoTableBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableCell, "TableCell", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildRowCheckbox, "buildRowCheckbox", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableCheckbox, "buildTableCheckbox", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(StickerTableHeader, "StickerTableHeader", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableHeaders, "buildTableHeaders", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableRows, "buildTableRows", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(FullTable, "FullTable", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(Table, "Table", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(headersAreIdentical, "headersAreIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(readOnlyMode, "readOnlyMode", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(rowAreIdentical, "rowAreIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(contextIsIdentical, "contextIsIdentical", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualRow, "propsAreEqualRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualDeeplyRow, "propsAreEqualDeeplyRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableRowMemo, "TableRowMemo", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(MemoTableRow, "MemoTableRow", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(isInReadOnlyMode, "isInReadOnlyMode", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(propsAreEqualBody, "propsAreEqualBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableBody, "TableBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(MemoTableBody, "MemoTableBody", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(TableCell, "TableCell", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildRowCheckbox, "buildRowCheckbox", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableCheckbox, "buildTableCheckbox", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(StickerTableHeader, "StickerTableHeader", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableHeaders, "buildTableHeaders", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(buildTableRows, "buildTableRows", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(FullTable, "FullTable", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(Table, "Table", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Table.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();