\n ,\n this.getContainer() || document.body\n )}\n \n );\n }}\n \n );\n }\n}\n","function toVal(mix) {\n\tvar k, y, str='';\n\tif (mix) {\n\t\tif (typeof mix === 'object') {\n\t\t\tif (Array.isArray(mix)) {\n\t\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\t\tif (mix[k] && (y = toVal(mix[k]))) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (k in mix) {\n\t\t\t\t\tif (mix[k] && (y = toVal(k))) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (typeof mix !== 'boolean' && !mix.call) {\n\t\t\tstr && (str += ' ');\n\t\t\tstr += mix;\n\t\t}\n\t}\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (x = toVal(arguments[i++])) {\n\t\t\tstr && (str += ' ');\n\t\t\tstr += x\n\t\t}\n\t}\n\treturn str;\n}\n","\n\nexport default function calculateSizeAndPositionDataAndUpdateScrollOffset(_ref) {\n var cellCount = _ref.cellCount,\n cellSize = _ref.cellSize,\n computeMetadataCallback = _ref.computeMetadataCallback,\n computeMetadataCallbackProps = _ref.computeMetadataCallbackProps,\n nextCellsCount = _ref.nextCellsCount,\n nextCellSize = _ref.nextCellSize,\n nextScrollToIndex = _ref.nextScrollToIndex,\n scrollToIndex = _ref.scrollToIndex,\n updateScrollOffsetForScrollToIndex = _ref.updateScrollOffsetForScrollToIndex;\n\n // Don't compare cell sizes if they are functions because inline functions would cause infinite loops.\n // In that event users should use the manual recompute methods to inform of changes.\n if (cellCount !== nextCellsCount || (typeof cellSize === 'number' || typeof nextCellSize === 'number') && cellSize !== nextCellSize) {\n computeMetadataCallback(computeMetadataCallbackProps);\n\n // Updated cell metadata may have hidden the previous scrolled-to item.\n // In this case we should also update the scrollTop to ensure it stays visible.\n if (scrollToIndex >= 0 && scrollToIndex === nextScrollToIndex) {\n updateScrollOffsetForScrollToIndex();\n }\n }\n}\n\n/**\n * Helper method that determines when to recalculate row or column metadata.\n */","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\n\n/**\n * Just-in-time calculates and caches size and position information for a collection of cells.\n */\n\nvar CellSizeAndPositionManager = function () {\n\n // Used in deferred mode to track which cells have been queued for measurement.\n\n // Cache of size and position data for cells, mapped by cell index.\n // Note that invalid values may exist in this map so only rely on cells up to this._lastMeasuredIndex\n function CellSizeAndPositionManager(_ref) {\n var cellCount = _ref.cellCount,\n cellSizeGetter = _ref.cellSizeGetter,\n estimatedCellSize = _ref.estimatedCellSize;\n\n _classCallCheck(this, CellSizeAndPositionManager);\n\n this._cellSizeAndPositionData = {};\n this._lastMeasuredIndex = -1;\n this._lastBatchedIndex = -1;\n\n this._cellSizeGetter = cellSizeGetter;\n this._cellCount = cellCount;\n this._estimatedCellSize = estimatedCellSize;\n }\n\n // Measurements for cells up to this index can be trusted; cells afterward should be estimated.\n\n\n _createClass(CellSizeAndPositionManager, [{\n key: 'areOffsetsAdjusted',\n value: function areOffsetsAdjusted() {\n return false;\n }\n }, {\n key: 'configure',\n value: function configure(_ref2) {\n var cellCount = _ref2.cellCount,\n estimatedCellSize = _ref2.estimatedCellSize,\n cellSizeGetter = _ref2.cellSizeGetter;\n\n this._cellCount = cellCount;\n this._estimatedCellSize = estimatedCellSize;\n this._cellSizeGetter = cellSizeGetter;\n }\n }, {\n key: 'getCellCount',\n value: function getCellCount() {\n return this._cellCount;\n }\n }, {\n key: 'getEstimatedCellSize',\n value: function getEstimatedCellSize() {\n return this._estimatedCellSize;\n }\n }, {\n key: 'getLastMeasuredIndex',\n value: function getLastMeasuredIndex() {\n return this._lastMeasuredIndex;\n }\n }, {\n key: 'getOffsetAdjustment',\n value: function getOffsetAdjustment() {\n return 0;\n }\n\n /**\n * This method returns the size and position for the cell at the specified index.\n * It just-in-time calculates (or used cached values) for cells leading up to the index.\n */\n\n }, {\n key: 'getSizeAndPositionOfCell',\n value: function getSizeAndPositionOfCell(index) {\n if (index < 0 || index >= this._cellCount) {\n throw Error('Requested index ' + index + ' is outside of range 0..' + this._cellCount);\n }\n\n if (index > this._lastMeasuredIndex) {\n var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();\n var _offset = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size;\n\n for (var i = this._lastMeasuredIndex + 1; i <= index; i++) {\n var _size = this._cellSizeGetter({ index: i });\n\n // undefined or NaN probably means a logic error in the size getter.\n // null means we're using CellMeasurer and haven't yet measured a given index.\n if (_size === undefined || isNaN(_size)) {\n throw Error('Invalid size returned for cell ' + i + ' of value ' + _size);\n } else if (_size === null) {\n this._cellSizeAndPositionData[i] = {\n offset: _offset,\n size: 0\n };\n\n this._lastBatchedIndex = index;\n } else {\n this._cellSizeAndPositionData[i] = {\n offset: _offset,\n size: _size\n };\n\n _offset += _size;\n\n this._lastMeasuredIndex = index;\n }\n }\n }\n\n return this._cellSizeAndPositionData[index];\n }\n }, {\n key: 'getSizeAndPositionOfLastMeasuredCell',\n value: function getSizeAndPositionOfLastMeasuredCell() {\n return this._lastMeasuredIndex >= 0 ? this._cellSizeAndPositionData[this._lastMeasuredIndex] : {\n offset: 0,\n size: 0\n };\n }\n\n /**\n * Total size of all cells being measured.\n * This value will be completely estimated initially.\n * As cells are measured, the estimate will be updated.\n */\n\n }, {\n key: 'getTotalSize',\n value: function getTotalSize() {\n var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();\n var totalSizeOfMeasuredCells = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size;\n var numUnmeasuredCells = this._cellCount - this._lastMeasuredIndex - 1;\n var totalSizeOfUnmeasuredCells = numUnmeasuredCells * this._estimatedCellSize;\n return totalSizeOfMeasuredCells + totalSizeOfUnmeasuredCells;\n }\n\n /**\n * Determines a new offset that ensures a certain cell is visible, given the current offset.\n * If the cell is already visible then the current offset will be returned.\n * If the current offset is too great or small, it will be adjusted just enough to ensure the specified index is visible.\n *\n * @param align Desired alignment within container; one of \"auto\" (default), \"start\", or \"end\"\n * @param containerSize Size (width or height) of the container viewport\n * @param currentOffset Container's current (x or y) offset\n * @param totalSize Total size (width or height) of all cells\n * @return Offset to use to ensure the specified cell is visible\n */\n\n }, {\n key: 'getUpdatedOffsetForIndex',\n value: function getUpdatedOffsetForIndex(_ref3) {\n var _ref3$align = _ref3.align,\n align = _ref3$align === undefined ? 'auto' : _ref3$align,\n containerSize = _ref3.containerSize,\n currentOffset = _ref3.currentOffset,\n targetIndex = _ref3.targetIndex;\n\n if (containerSize <= 0) {\n return 0;\n }\n\n var datum = this.getSizeAndPositionOfCell(targetIndex);\n var maxOffset = datum.offset;\n var minOffset = maxOffset - containerSize + datum.size;\n\n var idealOffset = void 0;\n\n switch (align) {\n case 'start':\n idealOffset = maxOffset;\n break;\n case 'end':\n idealOffset = minOffset;\n break;\n case 'center':\n idealOffset = maxOffset - (containerSize - datum.size) / 2;\n break;\n default:\n idealOffset = Math.max(minOffset, Math.min(maxOffset, currentOffset));\n break;\n }\n\n var totalSize = this.getTotalSize();\n\n return Math.max(0, Math.min(totalSize - containerSize, idealOffset));\n }\n }, {\n key: 'getVisibleCellRange',\n value: function getVisibleCellRange(params) {\n var containerSize = params.containerSize,\n offset = params.offset;\n\n\n var totalSize = this.getTotalSize();\n\n if (totalSize === 0) {\n return {};\n }\n\n var maxOffset = offset + containerSize;\n var start = this._findNearestCell(offset);\n\n var datum = this.getSizeAndPositionOfCell(start);\n offset = datum.offset + datum.size;\n\n var stop = start;\n\n while (offset < maxOffset && stop < this._cellCount - 1) {\n stop++;\n\n offset += this.getSizeAndPositionOfCell(stop).size;\n }\n\n return {\n start: start,\n stop: stop\n };\n }\n\n /**\n * Clear all cached values for cells after the specified index.\n * This method should be called for any cell that has changed its size.\n * It will not immediately perform any calculations; they'll be performed the next time getSizeAndPositionOfCell() is called.\n */\n\n }, {\n key: 'resetCell',\n value: function resetCell(index) {\n this._lastMeasuredIndex = Math.min(this._lastMeasuredIndex, index - 1);\n }\n }, {\n key: '_binarySearch',\n value: function _binarySearch(high, low, offset) {\n while (low <= high) {\n var middle = low + Math.floor((high - low) / 2);\n var _currentOffset = this.getSizeAndPositionOfCell(middle).offset;\n\n if (_currentOffset === offset) {\n return middle;\n } else if (_currentOffset < offset) {\n low = middle + 1;\n } else if (_currentOffset > offset) {\n high = middle - 1;\n }\n }\n\n if (low > 0) {\n return low - 1;\n } else {\n return 0;\n }\n }\n }, {\n key: '_exponentialSearch',\n value: function _exponentialSearch(index, offset) {\n var interval = 1;\n\n while (index < this._cellCount && this.getSizeAndPositionOfCell(index).offset < offset) {\n index += interval;\n interval *= 2;\n }\n\n return this._binarySearch(Math.min(index, this._cellCount - 1), Math.floor(index / 2), offset);\n }\n\n /**\n * Searches for the cell (index) nearest the specified offset.\n *\n * If no exact match is found the next lowest cell index will be returned.\n * This allows partially visible cells (with offsets just before/above the fold) to be visible.\n */\n\n }, {\n key: '_findNearestCell',\n value: function _findNearestCell(offset) {\n if (isNaN(offset)) {\n throw Error('Invalid offset ' + offset + ' specified');\n }\n\n // Our search algorithms find the nearest match at or below the specified offset.\n // So make sure the offset is at least 0 or no match will be found.\n offset = Math.max(0, offset);\n\n var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();\n var lastMeasuredIndex = Math.max(0, this._lastMeasuredIndex);\n\n if (lastMeasuredCellSizeAndPosition.offset >= offset) {\n // If we've already measured cells within this range just use a binary search as it's faster.\n return this._binarySearch(lastMeasuredIndex, 0, offset);\n } else {\n // If we haven't yet measured this high, fallback to an exponential search with an inner binary search.\n // The exponential search avoids pre-computing sizes for the full set of cells as a binary search would.\n // The overall complexity for this approach is O(log n).\n return this._exponentialSearch(lastMeasuredIndex, offset);\n }\n }\n }]);\n\n return CellSizeAndPositionManager;\n}();\n\nexport default CellSizeAndPositionManager;\nimport { bpfrpt_proptype_Alignment } from '../types';\nimport { bpfrpt_proptype_CellSizeGetter } from '../types';\nimport { bpfrpt_proptype_VisibleCellRange } from '../types';","var DEFAULT_MAX_ELEMENT_SIZE = 1500000;\nvar CHROME_MAX_ELEMENT_SIZE = 1.67771e7;\n\nvar isBrowser = function isBrowser() {\n return typeof window !== 'undefined';\n};\n\nvar isChrome = function isChrome() {\n return !!window.chrome;\n};\n\nexport var getMaxElementSize = function getMaxElementSize() {\n if (isBrowser()) {\n if (isChrome()) {\n return CHROME_MAX_ELEMENT_SIZE;\n }\n }\n return DEFAULT_MAX_ELEMENT_SIZE;\n};","import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\n\n\nimport CellSizeAndPositionManager from './CellSizeAndPositionManager';\n\nimport { getMaxElementSize } from './maxElementSize.js';\n\n/**\n * Browsers have scroll offset limitations (eg Chrome stops scrolling at ~33.5M pixels where as Edge tops out at ~1.5M pixels).\n * After a certain position, the browser won't allow the user to scroll further (even via JavaScript scroll offset adjustments).\n * This util picks a lower ceiling for max size and artificially adjusts positions within to make it transparent for users.\n */\n\n/**\n * Extends CellSizeAndPositionManager and adds scaling behavior for lists that are too large to fit within a browser's native limits.\n */\nvar ScalingCellSizeAndPositionManager = function () {\n function ScalingCellSizeAndPositionManager(_ref) {\n var _ref$maxScrollSize = _ref.maxScrollSize,\n maxScrollSize = _ref$maxScrollSize === undefined ? getMaxElementSize() : _ref$maxScrollSize,\n params = _objectWithoutProperties(_ref, ['maxScrollSize']);\n\n _classCallCheck(this, ScalingCellSizeAndPositionManager);\n\n // Favor composition over inheritance to simplify IE10 support\n this._cellSizeAndPositionManager = new CellSizeAndPositionManager(params);\n this._maxScrollSize = maxScrollSize;\n }\n\n _createClass(ScalingCellSizeAndPositionManager, [{\n key: 'areOffsetsAdjusted',\n value: function areOffsetsAdjusted() {\n return this._cellSizeAndPositionManager.getTotalSize() > this._maxScrollSize;\n }\n }, {\n key: 'configure',\n value: function configure(params) {\n this._cellSizeAndPositionManager.configure(params);\n }\n }, {\n key: 'getCellCount',\n value: function getCellCount() {\n return this._cellSizeAndPositionManager.getCellCount();\n }\n }, {\n key: 'getEstimatedCellSize',\n value: function getEstimatedCellSize() {\n return this._cellSizeAndPositionManager.getEstimatedCellSize();\n }\n }, {\n key: 'getLastMeasuredIndex',\n value: function getLastMeasuredIndex() {\n return this._cellSizeAndPositionManager.getLastMeasuredIndex();\n }\n\n /**\n * Number of pixels a cell at the given position (offset) should be shifted in order to fit within the scaled container.\n * The offset passed to this function is scaled (safe) as well.\n */\n\n }, {\n key: 'getOffsetAdjustment',\n value: function getOffsetAdjustment(_ref2) {\n var containerSize = _ref2.containerSize,\n offset = _ref2.offset;\n\n var totalSize = this._cellSizeAndPositionManager.getTotalSize();\n var safeTotalSize = this.getTotalSize();\n var offsetPercentage = this._getOffsetPercentage({\n containerSize: containerSize,\n offset: offset,\n totalSize: safeTotalSize\n });\n\n return Math.round(offsetPercentage * (safeTotalSize - totalSize));\n }\n }, {\n key: 'getSizeAndPositionOfCell',\n value: function getSizeAndPositionOfCell(index) {\n return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index);\n }\n }, {\n key: 'getSizeAndPositionOfLastMeasuredCell',\n value: function getSizeAndPositionOfLastMeasuredCell() {\n return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell();\n }\n\n /** See CellSizeAndPositionManager#getTotalSize */\n\n }, {\n key: 'getTotalSize',\n value: function getTotalSize() {\n return Math.min(this._maxScrollSize, this._cellSizeAndPositionManager.getTotalSize());\n }\n\n /** See CellSizeAndPositionManager#getUpdatedOffsetForIndex */\n\n }, {\n key: 'getUpdatedOffsetForIndex',\n value: function getUpdatedOffsetForIndex(_ref3) {\n var _ref3$align = _ref3.align,\n align = _ref3$align === undefined ? 'auto' : _ref3$align,\n containerSize = _ref3.containerSize,\n currentOffset = _ref3.currentOffset,\n targetIndex = _ref3.targetIndex;\n\n currentOffset = this._safeOffsetToOffset({\n containerSize: containerSize,\n offset: currentOffset\n });\n\n var offset = this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({\n align: align,\n containerSize: containerSize,\n currentOffset: currentOffset,\n targetIndex: targetIndex\n });\n\n return this._offsetToSafeOffset({\n containerSize: containerSize,\n offset: offset\n });\n }\n\n /** See CellSizeAndPositionManager#getVisibleCellRange */\n\n }, {\n key: 'getVisibleCellRange',\n value: function getVisibleCellRange(_ref4) {\n var containerSize = _ref4.containerSize,\n offset = _ref4.offset;\n\n offset = this._safeOffsetToOffset({\n containerSize: containerSize,\n offset: offset\n });\n\n return this._cellSizeAndPositionManager.getVisibleCellRange({\n containerSize: containerSize,\n offset: offset\n });\n }\n }, {\n key: 'resetCell',\n value: function resetCell(index) {\n this._cellSizeAndPositionManager.resetCell(index);\n }\n }, {\n key: '_getOffsetPercentage',\n value: function _getOffsetPercentage(_ref5) {\n var containerSize = _ref5.containerSize,\n offset = _ref5.offset,\n totalSize = _ref5.totalSize;\n\n return totalSize <= containerSize ? 0 : offset / (totalSize - containerSize);\n }\n }, {\n key: '_offsetToSafeOffset',\n value: function _offsetToSafeOffset(_ref6) {\n var containerSize = _ref6.containerSize,\n offset = _ref6.offset;\n\n var totalSize = this._cellSizeAndPositionManager.getTotalSize();\n var safeTotalSize = this.getTotalSize();\n\n if (totalSize === safeTotalSize) {\n return offset;\n } else {\n var offsetPercentage = this._getOffsetPercentage({\n containerSize: containerSize,\n offset: offset,\n totalSize: totalSize\n });\n\n return Math.round(offsetPercentage * (safeTotalSize - containerSize));\n }\n }\n }, {\n key: '_safeOffsetToOffset',\n value: function _safeOffsetToOffset(_ref7) {\n var containerSize = _ref7.containerSize,\n offset = _ref7.offset;\n\n var totalSize = this._cellSizeAndPositionManager.getTotalSize();\n var safeTotalSize = this.getTotalSize();\n\n if (totalSize === safeTotalSize) {\n return offset;\n } else {\n var offsetPercentage = this._getOffsetPercentage({\n containerSize: containerSize,\n offset: offset,\n totalSize: safeTotalSize\n });\n\n return Math.round(offsetPercentage * (totalSize - containerSize));\n }\n }\n }]);\n\n return ScalingCellSizeAndPositionManager;\n}();\n\nexport default ScalingCellSizeAndPositionManager;\nimport { bpfrpt_proptype_Alignment } from '../types';\nimport { bpfrpt_proptype_CellSizeGetter } from '../types';\nimport { bpfrpt_proptype_VisibleCellRange } from '../types';","import _Object$keys from 'babel-runtime/core-js/object/keys';\n/**\n * Helper utility that updates the specified callback whenever any of the specified indices have changed.\n */\nexport default function createCallbackMemoizer() {\n var requireAllKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n var cachedIndices = {};\n\n return function (_ref) {\n var callback = _ref.callback,\n indices = _ref.indices;\n\n var keys = _Object$keys(indices);\n var allInitialized = !requireAllKeys || keys.every(function (key) {\n var value = indices[key];\n return Array.isArray(value) ? value.length > 0 : value >= 0;\n });\n var indexChanged = keys.length !== _Object$keys(cachedIndices).length || keys.some(function (key) {\n var cachedValue = cachedIndices[key];\n var value = indices[key];\n\n return Array.isArray(value) ? cachedValue.join(',') !== value.join(',') : cachedValue !== value;\n });\n\n cachedIndices = indices;\n\n if (allInitialized && indexChanged) {\n callback(indices);\n }\n };\n}","\n\nimport ScalingCellSizeAndPositionManager from './ScalingCellSizeAndPositionManager.js';\n\n/**\n * Helper function that determines when to update scroll offsets to ensure that a scroll-to-index remains visible.\n * This function also ensures that the scroll ofset isn't past the last column/row of cells.\n */\n\nexport default function updateScrollIndexHelper(_ref) {\n var cellSize = _ref.cellSize,\n cellSizeAndPositionManager = _ref.cellSizeAndPositionManager,\n previousCellsCount = _ref.previousCellsCount,\n previousCellSize = _ref.previousCellSize,\n previousScrollToAlignment = _ref.previousScrollToAlignment,\n previousScrollToIndex = _ref.previousScrollToIndex,\n previousSize = _ref.previousSize,\n scrollOffset = _ref.scrollOffset,\n scrollToAlignment = _ref.scrollToAlignment,\n scrollToIndex = _ref.scrollToIndex,\n size = _ref.size,\n sizeJustIncreasedFromZero = _ref.sizeJustIncreasedFromZero,\n updateScrollIndexCallback = _ref.updateScrollIndexCallback;\n\n var cellCount = cellSizeAndPositionManager.getCellCount();\n var hasScrollToIndex = scrollToIndex >= 0 && scrollToIndex < cellCount;\n var sizeHasChanged = size !== previousSize || sizeJustIncreasedFromZero || !previousCellSize || typeof cellSize === 'number' && cellSize !== previousCellSize;\n\n // If we have a new scroll target OR if height/row-height has changed,\n // We should ensure that the scroll target is visible.\n if (hasScrollToIndex && (sizeHasChanged || scrollToAlignment !== previousScrollToAlignment || scrollToIndex !== previousScrollToIndex)) {\n updateScrollIndexCallback(scrollToIndex);\n\n // If we don't have a selected item but list size or number of children have decreased,\n // Make sure we aren't scrolled too far past the current content.\n } else if (!hasScrollToIndex && cellCount > 0 && (size < previousSize || cellCount < previousCellsCount)) {\n // We need to ensure that the current scroll offset is still within the collection's range.\n // To do this, we don't need to measure everything; CellMeasurer would perform poorly.\n // Just check to make sure we're still okay.\n // Only adjust the scroll position if we've scrolled below the last set of rows.\n if (scrollOffset > cellSizeAndPositionManager.getTotalSize() - size) {\n updateScrollIndexCallback(cellCount - 1);\n }\n }\n}\nimport { bpfrpt_proptype_Alignment } from '../types';\nimport { bpfrpt_proptype_CellSize } from '../types';","export default !!(typeof window !== 'undefined' && window.document && window.document.createElement);","import canUseDOM from './canUseDOM';\nvar size;\nexport default function scrollbarSize(recalc) {\n if (!size && size !== 0 || recalc) {\n if (canUseDOM) {\n var scrollDiv = document.createElement('div');\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = '-9999px';\n scrollDiv.style.width = '50px';\n scrollDiv.style.height = '50px';\n scrollDiv.style.overflow = 'scroll';\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n }\n }\n\n return size;\n}","\n\n// Properly handle server-side rendering.\nvar win = void 0;\n\nif (typeof window !== 'undefined') {\n win = window;\n} else if (typeof self !== 'undefined') {\n win = self;\n} else {\n win = {};\n}\n\n// requestAnimationFrame() shim by Paul Irish\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\nvar request = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || win.msRequestAnimationFrame || function (callback) {\n return win.setTimeout(callback, 1000 / 60);\n};\n\nvar cancel = win.cancelAnimationFrame || win.webkitCancelAnimationFrame || win.mozCancelAnimationFrame || win.oCancelAnimationFrame || win.msCancelAnimationFrame || function (id) {\n win.clearTimeout(id);\n};\n\nexport var raf = request;\nexport var caf = cancel;","import _Promise from 'babel-runtime/core-js/promise';\nimport { caf, raf } from './animationFrame';\n\nvar bpfrpt_proptype_AnimationTimeoutId = process.env.NODE_ENV === 'production' ? null : {\n id: PropTypes.number.isRequired\n};\n\n\nexport var cancelAnimationTimeout = function cancelAnimationTimeout(frame) {\n return caf(frame.id);\n};\n\n/**\n * Recursively calls requestAnimationFrame until a specified delay has been met or exceeded.\n * When the delay time has been reached the function you're timing out will be called.\n *\n * Credit: Joe Lambert (https://gist.github.com/joelambert/1002116#file-requesttimeout-js)\n */\nexport var requestAnimationTimeout = function requestAnimationTimeout(callback, delay) {\n var start = void 0;\n // wait for end of processing current event handler, because event handler may be long\n _Promise.resolve().then(function () {\n start = Date.now();\n });\n\n var timeout = function timeout() {\n if (Date.now() - start >= delay) {\n callback.call();\n } else {\n frame.id = raf(timeout);\n }\n };\n\n var frame = {\n id: raf(timeout)\n };\n\n return frame;\n};\nimport PropTypes from 'prop-types';\nexport { bpfrpt_proptype_AnimationTimeoutId };","import _Object$assign from 'babel-runtime/core-js/object/assign';\nimport _extends from 'babel-runtime/helpers/extends';\nimport _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport calculateSizeAndPositionDataAndUpdateScrollOffset from './utils/calculateSizeAndPositionDataAndUpdateScrollOffset';\nimport ScalingCellSizeAndPositionManager from './utils/ScalingCellSizeAndPositionManager';\nimport createCallbackMemoizer from '../utils/createCallbackMemoizer';\nimport defaultOverscanIndicesGetter, { SCROLL_DIRECTION_BACKWARD, SCROLL_DIRECTION_FORWARD } from './defaultOverscanIndicesGetter';\nimport updateScrollIndexHelper from './utils/updateScrollIndexHelper';\nimport defaultCellRangeRenderer from './defaultCellRangeRenderer';\nimport scrollbarSize from 'dom-helpers/scrollbarSize';\nimport { polyfill } from 'react-lifecycles-compat';\nimport { requestAnimationTimeout, cancelAnimationTimeout } from '../utils/requestAnimationTimeout';\n\n/**\n * Specifies the number of milliseconds during which to disable pointer events while a scroll is in progress.\n * This improves performance and makes scrolling smoother.\n */\nexport var DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150;\n\n/**\n * Controls whether the Grid updates the DOM element's scrollLeft/scrollTop based on the current state or just observes it.\n * This prevents Grid from interrupting mouse-wheel animations (see issue #2).\n */\nvar SCROLL_POSITION_CHANGE_REASONS = {\n OBSERVED: 'observed',\n REQUESTED: 'requested'\n};\n\nvar renderNull = function renderNull() {\n return null;\n};\n\n/**\n * Renders tabular data with virtualization along the vertical and horizontal axes.\n * Row heights and column widths must be known ahead of time and specified as properties.\n */\nvar Grid = function (_React$PureComponent) {\n _inherits(Grid, _React$PureComponent);\n\n // Invokes onSectionRendered callback only when start/stop row or column indices change\n function Grid(props) {\n _classCallCheck(this, Grid);\n\n var _this = _possibleConstructorReturn(this, (Grid.__proto__ || _Object$getPrototypeOf(Grid)).call(this, props));\n\n _this._onGridRenderedMemoizer = createCallbackMemoizer();\n _this._onScrollMemoizer = createCallbackMemoizer(false);\n _this._deferredInvalidateColumnIndex = null;\n _this._deferredInvalidateRowIndex = null;\n _this._recomputeScrollLeftFlag = false;\n _this._recomputeScrollTopFlag = false;\n _this._horizontalScrollBarSize = 0;\n _this._verticalScrollBarSize = 0;\n _this._scrollbarPresenceChanged = false;\n _this._renderedColumnStartIndex = 0;\n _this._renderedColumnStopIndex = 0;\n _this._renderedRowStartIndex = 0;\n _this._renderedRowStopIndex = 0;\n _this._styleCache = {};\n _this._cellCache = {};\n\n _this._debounceScrollEndedCallback = function () {\n _this._disablePointerEventsTimeoutId = null;\n // isScrolling is used to determine if we reset styleCache\n _this.setState({\n isScrolling: false,\n needToResetStyleCache: false\n });\n };\n\n _this._invokeOnGridRenderedHelper = function () {\n var onSectionRendered = _this.props.onSectionRendered;\n\n\n _this._onGridRenderedMemoizer({\n callback: onSectionRendered,\n indices: {\n columnOverscanStartIndex: _this._columnStartIndex,\n columnOverscanStopIndex: _this._columnStopIndex,\n columnStartIndex: _this._renderedColumnStartIndex,\n columnStopIndex: _this._renderedColumnStopIndex,\n rowOverscanStartIndex: _this._rowStartIndex,\n rowOverscanStopIndex: _this._rowStopIndex,\n rowStartIndex: _this._renderedRowStartIndex,\n rowStopIndex: _this._renderedRowStopIndex\n }\n });\n };\n\n _this._setScrollingContainerRef = function (ref) {\n _this._scrollingContainer = ref;\n };\n\n _this._onScroll = function (event) {\n // In certain edge-cases React dispatches an onScroll event with an invalid target.scrollLeft / target.scrollTop.\n // This invalid event can be detected by comparing event.target to this component's scrollable DOM element.\n // See issue #404 for more information.\n if (event.target === _this._scrollingContainer) {\n _this.handleScrollEvent(event.target);\n }\n };\n\n var columnSizeAndPositionManager = new ScalingCellSizeAndPositionManager({\n cellCount: props.columnCount,\n cellSizeGetter: function cellSizeGetter(params) {\n return Grid._wrapSizeGetter(props.columnWidth)(params);\n },\n estimatedCellSize: Grid._getEstimatedColumnSize(props)\n });\n var rowSizeAndPositionManager = new ScalingCellSizeAndPositionManager({\n cellCount: props.rowCount,\n cellSizeGetter: function cellSizeGetter(params) {\n return Grid._wrapSizeGetter(props.rowHeight)(params);\n },\n estimatedCellSize: Grid._getEstimatedRowSize(props)\n });\n\n _this.state = {\n instanceProps: {\n columnSizeAndPositionManager: columnSizeAndPositionManager,\n rowSizeAndPositionManager: rowSizeAndPositionManager,\n\n prevColumnWidth: props.columnWidth,\n prevRowHeight: props.rowHeight,\n prevColumnCount: props.columnCount,\n prevRowCount: props.rowCount,\n prevIsScrolling: props.isScrolling === true,\n prevScrollToColumn: props.scrollToColumn,\n prevScrollToRow: props.scrollToRow,\n\n scrollbarSize: 0,\n scrollbarSizeMeasured: false\n },\n isScrolling: false,\n scrollDirectionHorizontal: SCROLL_DIRECTION_FORWARD,\n scrollDirectionVertical: SCROLL_DIRECTION_FORWARD,\n scrollLeft: 0,\n scrollTop: 0,\n scrollPositionChangeReason: null,\n\n needToResetStyleCache: false\n };\n\n if (props.scrollToRow > 0) {\n _this._initialScrollTop = _this._getCalculatedScrollTop(props, _this.state);\n }\n if (props.scrollToColumn > 0) {\n _this._initialScrollLeft = _this._getCalculatedScrollLeft(props, _this.state);\n }\n return _this;\n }\n\n /**\n * Gets offsets for a given cell and alignment.\n */\n\n\n _createClass(Grid, [{\n key: 'getOffsetForCell',\n value: function getOffsetForCell() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$alignment = _ref.alignment,\n alignment = _ref$alignment === undefined ? this.props.scrollToAlignment : _ref$alignment,\n _ref$columnIndex = _ref.columnIndex,\n columnIndex = _ref$columnIndex === undefined ? this.props.scrollToColumn : _ref$columnIndex,\n _ref$rowIndex = _ref.rowIndex,\n rowIndex = _ref$rowIndex === undefined ? this.props.scrollToRow : _ref$rowIndex;\n\n var offsetProps = _extends({}, this.props, {\n scrollToAlignment: alignment,\n scrollToColumn: columnIndex,\n scrollToRow: rowIndex\n });\n\n return {\n scrollLeft: this._getCalculatedScrollLeft(offsetProps),\n scrollTop: this._getCalculatedScrollTop(offsetProps)\n };\n }\n\n /**\n * Gets estimated total rows' height.\n */\n\n }, {\n key: 'getTotalRowsHeight',\n value: function getTotalRowsHeight() {\n return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize();\n }\n\n /**\n * Gets estimated total columns' width.\n */\n\n }, {\n key: 'getTotalColumnsWidth',\n value: function getTotalColumnsWidth() {\n return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize();\n }\n\n /**\n * This method handles a scroll event originating from an external scroll control.\n * It's an advanced method and should probably not be used unless you're implementing a custom scroll-bar solution.\n */\n\n }, {\n key: 'handleScrollEvent',\n value: function handleScrollEvent(_ref2) {\n var _ref2$scrollLeft = _ref2.scrollLeft,\n scrollLeftParam = _ref2$scrollLeft === undefined ? 0 : _ref2$scrollLeft,\n _ref2$scrollTop = _ref2.scrollTop,\n scrollTopParam = _ref2$scrollTop === undefined ? 0 : _ref2$scrollTop;\n\n // On iOS, we can arrive at negative offsets by swiping past the start.\n // To prevent flicker here, we make playing in the negative offset zone cause nothing to happen.\n if (scrollTopParam < 0) {\n return;\n }\n\n // Prevent pointer events from interrupting a smooth scroll\n this._debounceScrollEnded();\n\n var _props = this.props,\n autoHeight = _props.autoHeight,\n autoWidth = _props.autoWidth,\n height = _props.height,\n width = _props.width;\n var instanceProps = this.state.instanceProps;\n\n // When this component is shrunk drastically, React dispatches a series of back-to-back scroll events,\n // Gradually converging on a scrollTop that is within the bounds of the new, smaller height.\n // This causes a series of rapid renders that is slow for long lists.\n // We can avoid that by doing some simple bounds checking to ensure that scroll offsets never exceed their bounds.\n\n var scrollbarSize = instanceProps.scrollbarSize;\n var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();\n var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();\n var scrollLeft = Math.min(Math.max(0, totalColumnsWidth - width + scrollbarSize), scrollLeftParam);\n var scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), scrollTopParam);\n\n // Certain devices (like Apple touchpad) rapid-fire duplicate events.\n // Don't force a re-render if this is the case.\n // The mouse may move faster then the animation frame does.\n // Use requestAnimationFrame to avoid over-updating.\n if (this.state.scrollLeft !== scrollLeft || this.state.scrollTop !== scrollTop) {\n // Track scrolling direction so we can more efficiently overscan rows to reduce empty space around the edges while scrolling.\n // Don't change direction for an axis unless scroll offset has changed.\n var _scrollDirectionHorizontal = scrollLeft !== this.state.scrollLeft ? scrollLeft > this.state.scrollLeft ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD : this.state.scrollDirectionHorizontal;\n var _scrollDirectionVertical = scrollTop !== this.state.scrollTop ? scrollTop > this.state.scrollTop ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD : this.state.scrollDirectionVertical;\n\n var newState = {\n isScrolling: true,\n scrollDirectionHorizontal: _scrollDirectionHorizontal,\n scrollDirectionVertical: _scrollDirectionVertical,\n scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.OBSERVED\n };\n\n if (!autoHeight) {\n newState.scrollTop = scrollTop;\n }\n\n if (!autoWidth) {\n newState.scrollLeft = scrollLeft;\n }\n\n newState.needToResetStyleCache = false;\n this.setState(newState);\n }\n\n this._invokeOnScrollMemoizer({\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n totalColumnsWidth: totalColumnsWidth,\n totalRowsHeight: totalRowsHeight\n });\n }\n\n /**\n * Invalidate Grid size and recompute visible cells.\n * This is a deferred wrapper for recomputeGridSize().\n * It sets a flag to be evaluated on cDM/cDU to avoid unnecessary renders.\n * This method is intended for advanced use-cases like CellMeasurer.\n */\n // @TODO (bvaughn) Add automated test coverage for this.\n\n }, {\n key: 'invalidateCellSizeAfterRender',\n value: function invalidateCellSizeAfterRender(_ref3) {\n var columnIndex = _ref3.columnIndex,\n rowIndex = _ref3.rowIndex;\n\n this._deferredInvalidateColumnIndex = typeof this._deferredInvalidateColumnIndex === 'number' ? Math.min(this._deferredInvalidateColumnIndex, columnIndex) : columnIndex;\n this._deferredInvalidateRowIndex = typeof this._deferredInvalidateRowIndex === 'number' ? Math.min(this._deferredInvalidateRowIndex, rowIndex) : rowIndex;\n }\n\n /**\n * Pre-measure all columns and rows in a Grid.\n * Typically cells are only measured as needed and estimated sizes are used for cells that have not yet been measured.\n * This method ensures that the next call to getTotalSize() returns an exact size (as opposed to just an estimated one).\n */\n\n }, {\n key: 'measureAllCells',\n value: function measureAllCells() {\n var _props2 = this.props,\n columnCount = _props2.columnCount,\n rowCount = _props2.rowCount;\n var instanceProps = this.state.instanceProps;\n\n instanceProps.columnSizeAndPositionManager.getSizeAndPositionOfCell(columnCount - 1);\n instanceProps.rowSizeAndPositionManager.getSizeAndPositionOfCell(rowCount - 1);\n }\n\n /**\n * Forced recompute of row heights and column widths.\n * This function should be called if dynamic column or row sizes have changed but nothing else has.\n * Since Grid only receives :columnCount and :rowCount it has no way of detecting when the underlying data changes.\n */\n\n }, {\n key: 'recomputeGridSize',\n value: function recomputeGridSize() {\n var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref4$columnIndex = _ref4.columnIndex,\n columnIndex = _ref4$columnIndex === undefined ? 0 : _ref4$columnIndex,\n _ref4$rowIndex = _ref4.rowIndex,\n rowIndex = _ref4$rowIndex === undefined ? 0 : _ref4$rowIndex;\n\n var _props3 = this.props,\n scrollToColumn = _props3.scrollToColumn,\n scrollToRow = _props3.scrollToRow;\n var instanceProps = this.state.instanceProps;\n\n\n instanceProps.columnSizeAndPositionManager.resetCell(columnIndex);\n instanceProps.rowSizeAndPositionManager.resetCell(rowIndex);\n\n // Cell sizes may be determined by a function property.\n // In this case the cDU handler can't know if they changed.\n // Store this flag to let the next cDU pass know it needs to recompute the scroll offset.\n this._recomputeScrollLeftFlag = scrollToColumn >= 0 && (this.state.scrollDirectionHorizontal === SCROLL_DIRECTION_FORWARD ? columnIndex <= scrollToColumn : columnIndex >= scrollToColumn);\n this._recomputeScrollTopFlag = scrollToRow >= 0 && (this.state.scrollDirectionVertical === SCROLL_DIRECTION_FORWARD ? rowIndex <= scrollToRow : rowIndex >= scrollToRow);\n\n // Clear cell cache in case we are scrolling;\n // Invalid row heights likely mean invalid cached content as well.\n this._styleCache = {};\n this._cellCache = {};\n\n this.forceUpdate();\n }\n\n /**\n * Ensure column and row are visible.\n */\n\n }, {\n key: 'scrollToCell',\n value: function scrollToCell(_ref5) {\n var columnIndex = _ref5.columnIndex,\n rowIndex = _ref5.rowIndex;\n var columnCount = this.props.columnCount;\n\n\n var props = this.props;\n\n // Don't adjust scroll offset for single-column grids (eg List, Table).\n // This can cause a funky scroll offset because of the vertical scrollbar width.\n if (columnCount > 1 && columnIndex !== undefined) {\n this._updateScrollLeftForScrollToColumn(_extends({}, props, {\n scrollToColumn: columnIndex\n }));\n }\n\n if (rowIndex !== undefined) {\n this._updateScrollTopForScrollToRow(_extends({}, props, {\n scrollToRow: rowIndex\n }));\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props4 = this.props,\n getScrollbarSize = _props4.getScrollbarSize,\n height = _props4.height,\n scrollLeft = _props4.scrollLeft,\n scrollToColumn = _props4.scrollToColumn,\n scrollTop = _props4.scrollTop,\n scrollToRow = _props4.scrollToRow,\n width = _props4.width;\n var instanceProps = this.state.instanceProps;\n\n // Reset initial offsets to be ignored in browser\n\n this._initialScrollTop = 0;\n this._initialScrollLeft = 0;\n\n // If cell sizes have been invalidated (eg we are using CellMeasurer) then reset cached positions.\n // We must do this at the start of the method as we may calculate and update scroll position below.\n this._handleInvalidatedGridSize();\n\n // If this component was first rendered server-side, scrollbar size will be undefined.\n // In that event we need to remeasure.\n if (!instanceProps.scrollbarSizeMeasured) {\n this.setState(function (prevState) {\n var stateUpdate = _extends({}, prevState, { needToResetStyleCache: false });\n stateUpdate.instanceProps.scrollbarSize = getScrollbarSize();\n stateUpdate.instanceProps.scrollbarSizeMeasured = true;\n return stateUpdate;\n });\n }\n\n if (typeof scrollLeft === 'number' && scrollLeft >= 0 || typeof scrollTop === 'number' && scrollTop >= 0) {\n var stateUpdate = Grid._getScrollToPositionStateUpdate({\n prevState: this.state,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n });\n if (stateUpdate) {\n stateUpdate.needToResetStyleCache = false;\n this.setState(stateUpdate);\n }\n }\n\n // refs don't work in `react-test-renderer`\n if (this._scrollingContainer) {\n // setting the ref's scrollLeft and scrollTop.\n // Somehow in MultiGrid the main grid doesn't trigger a update on mount.\n if (this._scrollingContainer.scrollLeft !== this.state.scrollLeft) {\n this._scrollingContainer.scrollLeft = this.state.scrollLeft;\n }\n if (this._scrollingContainer.scrollTop !== this.state.scrollTop) {\n this._scrollingContainer.scrollTop = this.state.scrollTop;\n }\n }\n\n // Don't update scroll offset if the size is 0; we don't render any cells in this case.\n // Setting a state may cause us to later thing we've updated the offce when we haven't.\n var sizeIsBiggerThanZero = height > 0 && width > 0;\n if (scrollToColumn >= 0 && sizeIsBiggerThanZero) {\n this._updateScrollLeftForScrollToColumn();\n }\n if (scrollToRow >= 0 && sizeIsBiggerThanZero) {\n this._updateScrollTopForScrollToRow();\n }\n\n // Update onRowsRendered callback\n this._invokeOnGridRenderedHelper();\n\n // Initialize onScroll callback\n this._invokeOnScrollMemoizer({\n scrollLeft: scrollLeft || 0,\n scrollTop: scrollTop || 0,\n totalColumnsWidth: instanceProps.columnSizeAndPositionManager.getTotalSize(),\n totalRowsHeight: instanceProps.rowSizeAndPositionManager.getTotalSize()\n });\n\n this._maybeCallOnScrollbarPresenceChange();\n }\n\n /**\n * @private\n * This method updates scrollLeft/scrollTop in state for the following conditions:\n * 1) New scroll-to-cell props have been set\n */\n\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n var _this2 = this;\n\n var _props5 = this.props,\n autoHeight = _props5.autoHeight,\n autoWidth = _props5.autoWidth,\n columnCount = _props5.columnCount,\n height = _props5.height,\n rowCount = _props5.rowCount,\n scrollToAlignment = _props5.scrollToAlignment,\n scrollToColumn = _props5.scrollToColumn,\n scrollToRow = _props5.scrollToRow,\n width = _props5.width;\n var _state = this.state,\n scrollLeft = _state.scrollLeft,\n scrollPositionChangeReason = _state.scrollPositionChangeReason,\n scrollTop = _state.scrollTop,\n instanceProps = _state.instanceProps;\n // If cell sizes have been invalidated (eg we are using CellMeasurer) then reset cached positions.\n // We must do this at the start of the method as we may calculate and update scroll position below.\n\n this._handleInvalidatedGridSize();\n\n // Handle edge case where column or row count has only just increased over 0.\n // In this case we may have to restore a previously-specified scroll offset.\n // For more info see bvaughn/react-virtualized/issues/218\n var columnOrRowCountJustIncreasedFromZero = columnCount > 0 && prevProps.columnCount === 0 || rowCount > 0 && prevProps.rowCount === 0;\n\n // Make sure requested changes to :scrollLeft or :scrollTop get applied.\n // Assigning to scrollLeft/scrollTop tells the browser to interrupt any running scroll animations,\n // And to discard any pending async changes to the scroll position that may have happened in the meantime (e.g. on a separate scrolling thread).\n // So we only set these when we require an adjustment of the scroll position.\n // See issue #2 for more information.\n if (scrollPositionChangeReason === SCROLL_POSITION_CHANGE_REASONS.REQUESTED) {\n // @TRICKY :autoHeight and :autoWidth properties instructs Grid to leave :scrollTop and :scrollLeft management to an external HOC (eg WindowScroller).\n // In this case we should avoid checking scrollingContainer.scrollTop and scrollingContainer.scrollLeft since it forces layout/flow.\n if (!autoWidth && scrollLeft >= 0 && (scrollLeft !== this._scrollingContainer.scrollLeft || columnOrRowCountJustIncreasedFromZero)) {\n this._scrollingContainer.scrollLeft = scrollLeft;\n }\n if (!autoHeight && scrollTop >= 0 && (scrollTop !== this._scrollingContainer.scrollTop || columnOrRowCountJustIncreasedFromZero)) {\n this._scrollingContainer.scrollTop = scrollTop;\n }\n }\n\n // Special case where the previous size was 0:\n // In this case we don't show any windowed cells at all.\n // So we should always recalculate offset afterwards.\n var sizeJustIncreasedFromZero = (prevProps.width === 0 || prevProps.height === 0) && height > 0 && width > 0;\n\n // Update scroll offsets if the current :scrollToColumn or :scrollToRow values requires it\n // @TODO Do we also need this check or can the one in componentWillUpdate() suffice?\n if (this._recomputeScrollLeftFlag) {\n this._recomputeScrollLeftFlag = false;\n this._updateScrollLeftForScrollToColumn(this.props);\n } else {\n updateScrollIndexHelper({\n cellSizeAndPositionManager: instanceProps.columnSizeAndPositionManager,\n previousCellsCount: prevProps.columnCount,\n previousCellSize: prevProps.columnWidth,\n previousScrollToAlignment: prevProps.scrollToAlignment,\n previousScrollToIndex: prevProps.scrollToColumn,\n previousSize: prevProps.width,\n scrollOffset: scrollLeft,\n scrollToAlignment: scrollToAlignment,\n scrollToIndex: scrollToColumn,\n size: width,\n sizeJustIncreasedFromZero: sizeJustIncreasedFromZero,\n updateScrollIndexCallback: function updateScrollIndexCallback() {\n return _this2._updateScrollLeftForScrollToColumn(_this2.props);\n }\n });\n }\n\n if (this._recomputeScrollTopFlag) {\n this._recomputeScrollTopFlag = false;\n this._updateScrollTopForScrollToRow(this.props);\n } else {\n updateScrollIndexHelper({\n cellSizeAndPositionManager: instanceProps.rowSizeAndPositionManager,\n previousCellsCount: prevProps.rowCount,\n previousCellSize: prevProps.rowHeight,\n previousScrollToAlignment: prevProps.scrollToAlignment,\n previousScrollToIndex: prevProps.scrollToRow,\n previousSize: prevProps.height,\n scrollOffset: scrollTop,\n scrollToAlignment: scrollToAlignment,\n scrollToIndex: scrollToRow,\n size: height,\n sizeJustIncreasedFromZero: sizeJustIncreasedFromZero,\n updateScrollIndexCallback: function updateScrollIndexCallback() {\n return _this2._updateScrollTopForScrollToRow(_this2.props);\n }\n });\n }\n\n // Update onRowsRendered callback if start/stop indices have changed\n this._invokeOnGridRenderedHelper();\n\n // Changes to :scrollLeft or :scrollTop should also notify :onScroll listeners\n if (scrollLeft !== prevState.scrollLeft || scrollTop !== prevState.scrollTop) {\n var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();\n var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();\n\n this._invokeOnScrollMemoizer({\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n totalColumnsWidth: totalColumnsWidth,\n totalRowsHeight: totalRowsHeight\n });\n }\n\n this._maybeCallOnScrollbarPresenceChange();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this._disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(this._disablePointerEventsTimeoutId);\n }\n }\n\n /**\n * This method updates scrollLeft/scrollTop in state for the following conditions:\n * 1) Empty content (0 rows or columns)\n * 2) New scroll props overriding the current state\n * 3) Cells-count or cells-size has changed, making previous scroll offsets invalid\n */\n\n }, {\n key: 'render',\n value: function render() {\n var _props6 = this.props,\n autoContainerWidth = _props6.autoContainerWidth,\n autoHeight = _props6.autoHeight,\n autoWidth = _props6.autoWidth,\n className = _props6.className,\n containerProps = _props6.containerProps,\n containerRole = _props6.containerRole,\n containerStyle = _props6.containerStyle,\n height = _props6.height,\n id = _props6.id,\n noContentRenderer = _props6.noContentRenderer,\n role = _props6.role,\n style = _props6.style,\n tabIndex = _props6.tabIndex,\n width = _props6.width;\n var _state2 = this.state,\n instanceProps = _state2.instanceProps,\n needToResetStyleCache = _state2.needToResetStyleCache;\n\n\n var isScrolling = this._isScrolling();\n\n var gridStyle = {\n boxSizing: 'border-box',\n direction: 'ltr',\n height: autoHeight ? 'auto' : height,\n position: 'relative',\n width: autoWidth ? 'auto' : width,\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform'\n };\n\n if (needToResetStyleCache) {\n this._styleCache = {};\n }\n\n // calculate _styleCache here\n // if state.isScrolling (not from _isScrolling) then reset\n if (!this.state.isScrolling) {\n this._resetStyleCache();\n }\n\n // calculate children to render here\n this._calculateChildrenToRender(this.props, this.state);\n\n var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();\n var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();\n\n // Force browser to hide scrollbars when we know they aren't necessary.\n // Otherwise once scrollbars appear they may not disappear again.\n // For more info see issue #116\n var verticalScrollBarSize = totalRowsHeight > height ? instanceProps.scrollbarSize : 0;\n var horizontalScrollBarSize = totalColumnsWidth > width ? instanceProps.scrollbarSize : 0;\n\n if (horizontalScrollBarSize !== this._horizontalScrollBarSize || verticalScrollBarSize !== this._verticalScrollBarSize) {\n this._horizontalScrollBarSize = horizontalScrollBarSize;\n this._verticalScrollBarSize = verticalScrollBarSize;\n this._scrollbarPresenceChanged = true;\n }\n\n // Also explicitly init styles to 'auto' if scrollbars are required.\n // This works around an obscure edge case where external CSS styles have not yet been loaded,\n // But an initial scroll index of offset is set as an external prop.\n // Without this style, Grid would render the correct range of cells but would NOT update its internal offset.\n // This was originally reported via clauderic/react-infinite-calendar/issues/23\n gridStyle.overflowX = totalColumnsWidth + verticalScrollBarSize <= width ? 'hidden' : 'auto';\n gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';\n\n var childrenToDisplay = this._childrenToDisplay;\n\n var showNoContentRenderer = childrenToDisplay.length === 0 && height > 0 && width > 0;\n\n return React.createElement(\n 'div',\n _extends({\n ref: this._setScrollingContainerRef\n }, containerProps, {\n 'aria-label': this.props['aria-label'],\n 'aria-readonly': this.props['aria-readonly'],\n className: clsx('ReactVirtualized__Grid', className),\n id: id,\n onScroll: this._onScroll,\n role: role,\n style: _extends({}, gridStyle, style),\n tabIndex: tabIndex }),\n childrenToDisplay.length > 0 && React.createElement(\n 'div',\n {\n className: 'ReactVirtualized__Grid__innerScrollContainer',\n role: containerRole,\n style: _extends({\n width: autoContainerWidth ? 'auto' : totalColumnsWidth,\n height: totalRowsHeight,\n maxWidth: totalColumnsWidth,\n maxHeight: totalRowsHeight,\n overflow: 'hidden',\n pointerEvents: isScrolling ? 'none' : '',\n position: 'relative'\n }, containerStyle) },\n childrenToDisplay\n ),\n showNoContentRenderer && noContentRenderer()\n );\n }\n\n /* ---------------------------- Helper methods ---------------------------- */\n\n }, {\n key: '_calculateChildrenToRender',\n value: function _calculateChildrenToRender() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n var cellRenderer = props.cellRenderer,\n cellRangeRenderer = props.cellRangeRenderer,\n columnCount = props.columnCount,\n deferredMeasurementCache = props.deferredMeasurementCache,\n height = props.height,\n overscanColumnCount = props.overscanColumnCount,\n overscanIndicesGetter = props.overscanIndicesGetter,\n overscanRowCount = props.overscanRowCount,\n rowCount = props.rowCount,\n width = props.width,\n isScrollingOptOut = props.isScrollingOptOut;\n var scrollDirectionHorizontal = state.scrollDirectionHorizontal,\n scrollDirectionVertical = state.scrollDirectionVertical,\n instanceProps = state.instanceProps;\n\n\n var scrollTop = this._initialScrollTop > 0 ? this._initialScrollTop : state.scrollTop;\n var scrollLeft = this._initialScrollLeft > 0 ? this._initialScrollLeft : state.scrollLeft;\n\n var isScrolling = this._isScrolling(props, state);\n\n this._childrenToDisplay = [];\n\n // Render only enough columns and rows to cover the visible area of the grid.\n if (height > 0 && width > 0) {\n var visibleColumnIndices = instanceProps.columnSizeAndPositionManager.getVisibleCellRange({\n containerSize: width,\n offset: scrollLeft\n });\n var visibleRowIndices = instanceProps.rowSizeAndPositionManager.getVisibleCellRange({\n containerSize: height,\n offset: scrollTop\n });\n\n var horizontalOffsetAdjustment = instanceProps.columnSizeAndPositionManager.getOffsetAdjustment({\n containerSize: width,\n offset: scrollLeft\n });\n var verticalOffsetAdjustment = instanceProps.rowSizeAndPositionManager.getOffsetAdjustment({\n containerSize: height,\n offset: scrollTop\n });\n\n // Store for _invokeOnGridRenderedHelper()\n this._renderedColumnStartIndex = visibleColumnIndices.start;\n this._renderedColumnStopIndex = visibleColumnIndices.stop;\n this._renderedRowStartIndex = visibleRowIndices.start;\n this._renderedRowStopIndex = visibleRowIndices.stop;\n\n var overscanColumnIndices = overscanIndicesGetter({\n direction: 'horizontal',\n cellCount: columnCount,\n overscanCellsCount: overscanColumnCount,\n scrollDirection: scrollDirectionHorizontal,\n startIndex: typeof visibleColumnIndices.start === 'number' ? visibleColumnIndices.start : 0,\n stopIndex: typeof visibleColumnIndices.stop === 'number' ? visibleColumnIndices.stop : -1\n });\n\n var overscanRowIndices = overscanIndicesGetter({\n direction: 'vertical',\n cellCount: rowCount,\n overscanCellsCount: overscanRowCount,\n scrollDirection: scrollDirectionVertical,\n startIndex: typeof visibleRowIndices.start === 'number' ? visibleRowIndices.start : 0,\n stopIndex: typeof visibleRowIndices.stop === 'number' ? visibleRowIndices.stop : -1\n });\n\n // Store for _invokeOnGridRenderedHelper()\n var columnStartIndex = overscanColumnIndices.overscanStartIndex;\n var columnStopIndex = overscanColumnIndices.overscanStopIndex;\n var rowStartIndex = overscanRowIndices.overscanStartIndex;\n var rowStopIndex = overscanRowIndices.overscanStopIndex;\n\n // Advanced use-cases (eg CellMeasurer) require batched measurements to determine accurate sizes.\n if (deferredMeasurementCache) {\n // If rows have a dynamic height, scan the rows we are about to render.\n // If any have not yet been measured, then we need to render all columns initially,\n // Because the height of the row is equal to the tallest cell within that row,\n // (And so we can't know the height without measuring all column-cells first).\n if (!deferredMeasurementCache.hasFixedHeight()) {\n for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {\n if (!deferredMeasurementCache.has(rowIndex, 0)) {\n columnStartIndex = 0;\n columnStopIndex = columnCount - 1;\n break;\n }\n }\n }\n\n // If columns have a dynamic width, scan the columns we are about to render.\n // If any have not yet been measured, then we need to render all rows initially,\n // Because the width of the column is equal to the widest cell within that column,\n // (And so we can't know the width without measuring all row-cells first).\n if (!deferredMeasurementCache.hasFixedWidth()) {\n for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {\n if (!deferredMeasurementCache.has(0, columnIndex)) {\n rowStartIndex = 0;\n rowStopIndex = rowCount - 1;\n break;\n }\n }\n }\n }\n\n this._childrenToDisplay = cellRangeRenderer({\n cellCache: this._cellCache,\n cellRenderer: cellRenderer,\n columnSizeAndPositionManager: instanceProps.columnSizeAndPositionManager,\n columnStartIndex: columnStartIndex,\n columnStopIndex: columnStopIndex,\n deferredMeasurementCache: deferredMeasurementCache,\n horizontalOffsetAdjustment: horizontalOffsetAdjustment,\n isScrolling: isScrolling,\n isScrollingOptOut: isScrollingOptOut,\n parent: this,\n rowSizeAndPositionManager: instanceProps.rowSizeAndPositionManager,\n rowStartIndex: rowStartIndex,\n rowStopIndex: rowStopIndex,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n styleCache: this._styleCache,\n verticalOffsetAdjustment: verticalOffsetAdjustment,\n visibleColumnIndices: visibleColumnIndices,\n visibleRowIndices: visibleRowIndices\n });\n\n // update the indices\n this._columnStartIndex = columnStartIndex;\n this._columnStopIndex = columnStopIndex;\n this._rowStartIndex = rowStartIndex;\n this._rowStopIndex = rowStopIndex;\n }\n }\n\n /**\n * Sets an :isScrolling flag for a small window of time.\n * This flag is used to disable pointer events on the scrollable portion of the Grid.\n * This prevents jerky/stuttery mouse-wheel scrolling.\n */\n\n }, {\n key: '_debounceScrollEnded',\n value: function _debounceScrollEnded() {\n var scrollingResetTimeInterval = this.props.scrollingResetTimeInterval;\n\n\n if (this._disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(this._disablePointerEventsTimeoutId);\n }\n\n this._disablePointerEventsTimeoutId = requestAnimationTimeout(this._debounceScrollEndedCallback, scrollingResetTimeInterval);\n }\n }, {\n key: '_handleInvalidatedGridSize',\n\n\n /**\n * Check for batched CellMeasurer size invalidations.\n * This will occur the first time one or more previously unmeasured cells are rendered.\n */\n value: function _handleInvalidatedGridSize() {\n if (typeof this._deferredInvalidateColumnIndex === 'number' && typeof this._deferredInvalidateRowIndex === 'number') {\n var columnIndex = this._deferredInvalidateColumnIndex;\n var rowIndex = this._deferredInvalidateRowIndex;\n\n this._deferredInvalidateColumnIndex = null;\n this._deferredInvalidateRowIndex = null;\n\n this.recomputeGridSize({ columnIndex: columnIndex, rowIndex: rowIndex });\n }\n }\n }, {\n key: '_invokeOnScrollMemoizer',\n value: function _invokeOnScrollMemoizer(_ref6) {\n var _this3 = this;\n\n var scrollLeft = _ref6.scrollLeft,\n scrollTop = _ref6.scrollTop,\n totalColumnsWidth = _ref6.totalColumnsWidth,\n totalRowsHeight = _ref6.totalRowsHeight;\n\n this._onScrollMemoizer({\n callback: function callback(_ref7) {\n var scrollLeft = _ref7.scrollLeft,\n scrollTop = _ref7.scrollTop;\n var _props7 = _this3.props,\n height = _props7.height,\n onScroll = _props7.onScroll,\n width = _props7.width;\n\n\n onScroll({\n clientHeight: height,\n clientWidth: width,\n scrollHeight: totalRowsHeight,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n scrollWidth: totalColumnsWidth\n });\n },\n indices: {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n }\n });\n }\n }, {\n key: '_isScrolling',\n value: function _isScrolling() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n\n // If isScrolling is defined in props, use it to override the value in state\n // This is a performance optimization for WindowScroller + Grid\n return Object.hasOwnProperty.call(props, 'isScrolling') ? Boolean(props.isScrolling) : Boolean(state.isScrolling);\n }\n }, {\n key: '_maybeCallOnScrollbarPresenceChange',\n value: function _maybeCallOnScrollbarPresenceChange() {\n if (this._scrollbarPresenceChanged) {\n var _onScrollbarPresenceChange = this.props.onScrollbarPresenceChange;\n\n\n this._scrollbarPresenceChanged = false;\n\n _onScrollbarPresenceChange({\n horizontal: this._horizontalScrollBarSize > 0,\n size: this.state.instanceProps.scrollbarSize,\n vertical: this._verticalScrollBarSize > 0\n });\n }\n }\n }, {\n key: 'scrollToPosition',\n\n\n /**\n * Scroll to the specified offset(s).\n * Useful for animating position changes.\n */\n value: function scrollToPosition(_ref8) {\n var scrollLeft = _ref8.scrollLeft,\n scrollTop = _ref8.scrollTop;\n\n var stateUpdate = Grid._getScrollToPositionStateUpdate({\n prevState: this.state,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n });\n\n if (stateUpdate) {\n stateUpdate.needToResetStyleCache = false;\n this.setState(stateUpdate);\n }\n }\n }, {\n key: '_getCalculatedScrollLeft',\n value: function _getCalculatedScrollLeft() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n\n return Grid._getCalculatedScrollLeft(props, state);\n }\n }, {\n key: '_updateScrollLeftForScrollToColumn',\n value: function _updateScrollLeftForScrollToColumn() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n\n var stateUpdate = Grid._getScrollLeftForScrollToColumnStateUpdate(props, state);\n if (stateUpdate) {\n stateUpdate.needToResetStyleCache = false;\n this.setState(stateUpdate);\n }\n }\n }, {\n key: '_getCalculatedScrollTop',\n value: function _getCalculatedScrollTop() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n\n return Grid._getCalculatedScrollTop(props, state);\n }\n }, {\n key: '_resetStyleCache',\n value: function _resetStyleCache() {\n var styleCache = this._styleCache;\n var cellCache = this._cellCache;\n var isScrollingOptOut = this.props.isScrollingOptOut;\n\n // Reset cell and style caches once scrolling stops.\n // This makes Grid simpler to use (since cells commonly change).\n // And it keeps the caches from growing too large.\n // Performance is most sensitive when a user is scrolling.\n // Don't clear visible cells from cellCache if isScrollingOptOut is specified.\n // This keeps the cellCache to a resonable size.\n\n this._cellCache = {};\n this._styleCache = {};\n\n // Copy over the visible cell styles so avoid unnecessary re-render.\n for (var rowIndex = this._rowStartIndex; rowIndex <= this._rowStopIndex; rowIndex++) {\n for (var columnIndex = this._columnStartIndex; columnIndex <= this._columnStopIndex; columnIndex++) {\n var key = rowIndex + '-' + columnIndex;\n this._styleCache[key] = styleCache[key];\n\n if (isScrollingOptOut) {\n this._cellCache[key] = cellCache[key];\n }\n }\n }\n }\n }, {\n key: '_updateScrollTopForScrollToRow',\n value: function _updateScrollTopForScrollToRow() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;\n\n var stateUpdate = Grid._getScrollTopForScrollToRowStateUpdate(props, state);\n if (stateUpdate) {\n stateUpdate.needToResetStyleCache = false;\n this.setState(stateUpdate);\n }\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var newState = {};\n\n if (nextProps.columnCount === 0 && prevState.scrollLeft !== 0 || nextProps.rowCount === 0 && prevState.scrollTop !== 0) {\n newState.scrollLeft = 0;\n newState.scrollTop = 0;\n\n // only use scroll{Left,Top} from props if scrollTo{Column,Row} isn't specified\n // scrollTo{Column,Row} should override scroll{Left,Top}\n } else if (nextProps.scrollLeft !== prevState.scrollLeft && nextProps.scrollToColumn < 0 || nextProps.scrollTop !== prevState.scrollTop && nextProps.scrollToRow < 0) {\n _Object$assign(newState, Grid._getScrollToPositionStateUpdate({\n prevState: prevState,\n scrollLeft: nextProps.scrollLeft,\n scrollTop: nextProps.scrollTop\n }));\n }\n\n var instanceProps = prevState.instanceProps;\n\n // Initially we should not clearStyleCache\n\n newState.needToResetStyleCache = false;\n if (nextProps.columnWidth !== instanceProps.prevColumnWidth || nextProps.rowHeight !== instanceProps.prevRowHeight) {\n // Reset cache. set it to {} in render\n newState.needToResetStyleCache = true;\n }\n\n instanceProps.columnSizeAndPositionManager.configure({\n cellCount: nextProps.columnCount,\n estimatedCellSize: Grid._getEstimatedColumnSize(nextProps),\n cellSizeGetter: Grid._wrapSizeGetter(nextProps.columnWidth)\n });\n\n instanceProps.rowSizeAndPositionManager.configure({\n cellCount: nextProps.rowCount,\n estimatedCellSize: Grid._getEstimatedRowSize(nextProps),\n cellSizeGetter: Grid._wrapSizeGetter(nextProps.rowHeight)\n });\n\n if (instanceProps.prevColumnCount === 0 || instanceProps.prevRowCount === 0) {\n instanceProps.prevColumnCount = 0;\n instanceProps.prevRowCount = 0;\n }\n\n // If scrolling is controlled outside this component, clear cache when scrolling stops\n if (nextProps.autoHeight && nextProps.isScrolling === false && instanceProps.prevIsScrolling === true) {\n _Object$assign(newState, {\n isScrolling: false\n });\n }\n\n var maybeStateA = void 0;\n var maybeStateB = void 0;\n\n calculateSizeAndPositionDataAndUpdateScrollOffset({\n cellCount: instanceProps.prevColumnCount,\n cellSize: typeof instanceProps.prevColumnWidth === 'number' ? instanceProps.prevColumnWidth : null,\n computeMetadataCallback: function computeMetadataCallback() {\n return instanceProps.columnSizeAndPositionManager.resetCell(0);\n },\n computeMetadataCallbackProps: nextProps,\n nextCellsCount: nextProps.columnCount,\n nextCellSize: typeof nextProps.columnWidth === 'number' ? nextProps.columnWidth : null,\n nextScrollToIndex: nextProps.scrollToColumn,\n scrollToIndex: instanceProps.prevScrollToColumn,\n updateScrollOffsetForScrollToIndex: function updateScrollOffsetForScrollToIndex() {\n maybeStateA = Grid._getScrollLeftForScrollToColumnStateUpdate(nextProps, prevState);\n }\n });\n calculateSizeAndPositionDataAndUpdateScrollOffset({\n cellCount: instanceProps.prevRowCount,\n cellSize: typeof instanceProps.prevRowHeight === 'number' ? instanceProps.prevRowHeight : null,\n computeMetadataCallback: function computeMetadataCallback() {\n return instanceProps.rowSizeAndPositionManager.resetCell(0);\n },\n computeMetadataCallbackProps: nextProps,\n nextCellsCount: nextProps.rowCount,\n nextCellSize: typeof nextProps.rowHeight === 'number' ? nextProps.rowHeight : null,\n nextScrollToIndex: nextProps.scrollToRow,\n scrollToIndex: instanceProps.prevScrollToRow,\n updateScrollOffsetForScrollToIndex: function updateScrollOffsetForScrollToIndex() {\n maybeStateB = Grid._getScrollTopForScrollToRowStateUpdate(nextProps, prevState);\n }\n });\n\n instanceProps.prevColumnCount = nextProps.columnCount;\n instanceProps.prevColumnWidth = nextProps.columnWidth;\n instanceProps.prevIsScrolling = nextProps.isScrolling === true;\n instanceProps.prevRowCount = nextProps.rowCount;\n instanceProps.prevRowHeight = nextProps.rowHeight;\n instanceProps.prevScrollToColumn = nextProps.scrollToColumn;\n instanceProps.prevScrollToRow = nextProps.scrollToRow;\n\n // getting scrollBarSize (moved from componentWillMount)\n instanceProps.scrollbarSize = nextProps.getScrollbarSize();\n if (instanceProps.scrollbarSize === undefined) {\n instanceProps.scrollbarSizeMeasured = false;\n instanceProps.scrollbarSize = 0;\n } else {\n instanceProps.scrollbarSizeMeasured = true;\n }\n\n newState.instanceProps = instanceProps;\n\n return _extends({}, newState, maybeStateA, maybeStateB);\n }\n }, {\n key: '_getEstimatedColumnSize',\n value: function _getEstimatedColumnSize(props) {\n return typeof props.columnWidth === 'number' ? props.columnWidth : props.estimatedColumnSize;\n }\n }, {\n key: '_getEstimatedRowSize',\n value: function _getEstimatedRowSize(props) {\n return typeof props.rowHeight === 'number' ? props.rowHeight : props.estimatedRowSize;\n }\n }, {\n key: '_getScrollToPositionStateUpdate',\n\n\n /**\n * Get the updated state after scrolling to\n * scrollLeft and scrollTop\n */\n value: function _getScrollToPositionStateUpdate(_ref9) {\n var prevState = _ref9.prevState,\n scrollLeft = _ref9.scrollLeft,\n scrollTop = _ref9.scrollTop;\n\n var newState = {\n scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED\n };\n\n if (typeof scrollLeft === 'number' && scrollLeft >= 0) {\n newState.scrollDirectionHorizontal = scrollLeft > prevState.scrollLeft ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD;\n newState.scrollLeft = scrollLeft;\n }\n\n if (typeof scrollTop === 'number' && scrollTop >= 0) {\n newState.scrollDirectionVertical = scrollTop > prevState.scrollTop ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD;\n newState.scrollTop = scrollTop;\n }\n\n if (typeof scrollLeft === 'number' && scrollLeft >= 0 && scrollLeft !== prevState.scrollLeft || typeof scrollTop === 'number' && scrollTop >= 0 && scrollTop !== prevState.scrollTop) {\n return newState;\n }\n return null;\n }\n }, {\n key: '_wrapSizeGetter',\n value: function _wrapSizeGetter(value) {\n return typeof value === 'function' ? value : function () {\n return value;\n };\n }\n }, {\n key: '_getCalculatedScrollLeft',\n value: function _getCalculatedScrollLeft(nextProps, prevState) {\n var columnCount = nextProps.columnCount,\n height = nextProps.height,\n scrollToAlignment = nextProps.scrollToAlignment,\n scrollToColumn = nextProps.scrollToColumn,\n width = nextProps.width;\n var scrollLeft = prevState.scrollLeft,\n instanceProps = prevState.instanceProps;\n\n\n if (columnCount > 0) {\n var finalColumn = columnCount - 1;\n var targetIndex = scrollToColumn < 0 ? finalColumn : Math.min(finalColumn, scrollToColumn);\n var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();\n var scrollBarSize = instanceProps.scrollbarSizeMeasured && totalRowsHeight > height ? instanceProps.scrollbarSize : 0;\n\n return instanceProps.columnSizeAndPositionManager.getUpdatedOffsetForIndex({\n align: scrollToAlignment,\n containerSize: width - scrollBarSize,\n currentOffset: scrollLeft,\n targetIndex: targetIndex\n });\n }\n return 0;\n }\n }, {\n key: '_getScrollLeftForScrollToColumnStateUpdate',\n value: function _getScrollLeftForScrollToColumnStateUpdate(nextProps, prevState) {\n var scrollLeft = prevState.scrollLeft;\n\n var calculatedScrollLeft = Grid._getCalculatedScrollLeft(nextProps, prevState);\n\n if (typeof calculatedScrollLeft === 'number' && calculatedScrollLeft >= 0 && scrollLeft !== calculatedScrollLeft) {\n return Grid._getScrollToPositionStateUpdate({\n prevState: prevState,\n scrollLeft: calculatedScrollLeft,\n scrollTop: -1\n });\n }\n return null;\n }\n }, {\n key: '_getCalculatedScrollTop',\n value: function _getCalculatedScrollTop(nextProps, prevState) {\n var height = nextProps.height,\n rowCount = nextProps.rowCount,\n scrollToAlignment = nextProps.scrollToAlignment,\n scrollToRow = nextProps.scrollToRow,\n width = nextProps.width;\n var scrollTop = prevState.scrollTop,\n instanceProps = prevState.instanceProps;\n\n\n if (rowCount > 0) {\n var finalRow = rowCount - 1;\n var targetIndex = scrollToRow < 0 ? finalRow : Math.min(finalRow, scrollToRow);\n var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();\n var scrollBarSize = instanceProps.scrollbarSizeMeasured && totalColumnsWidth > width ? instanceProps.scrollbarSize : 0;\n\n return instanceProps.rowSizeAndPositionManager.getUpdatedOffsetForIndex({\n align: scrollToAlignment,\n containerSize: height - scrollBarSize,\n currentOffset: scrollTop,\n targetIndex: targetIndex\n });\n }\n return 0;\n }\n }, {\n key: '_getScrollTopForScrollToRowStateUpdate',\n value: function _getScrollTopForScrollToRowStateUpdate(nextProps, prevState) {\n var scrollTop = prevState.scrollTop;\n\n var calculatedScrollTop = Grid._getCalculatedScrollTop(nextProps, prevState);\n\n if (typeof calculatedScrollTop === 'number' && calculatedScrollTop >= 0 && scrollTop !== calculatedScrollTop) {\n return Grid._getScrollToPositionStateUpdate({\n prevState: prevState,\n scrollLeft: -1,\n scrollTop: calculatedScrollTop\n });\n }\n return null;\n }\n }]);\n\n return Grid;\n}(React.PureComponent);\n\nGrid.defaultProps = {\n 'aria-label': 'grid',\n 'aria-readonly': true,\n autoContainerWidth: false,\n autoHeight: false,\n autoWidth: false,\n cellRangeRenderer: defaultCellRangeRenderer,\n containerRole: 'rowgroup',\n containerStyle: {},\n estimatedColumnSize: 100,\n estimatedRowSize: 30,\n getScrollbarSize: scrollbarSize,\n noContentRenderer: renderNull,\n onScroll: function onScroll() {},\n onScrollbarPresenceChange: function onScrollbarPresenceChange() {},\n onSectionRendered: function onSectionRendered() {},\n overscanColumnCount: 0,\n overscanIndicesGetter: defaultOverscanIndicesGetter,\n overscanRowCount: 10,\n role: 'grid',\n scrollingResetTimeInterval: DEFAULT_SCROLLING_RESET_TIME_INTERVAL,\n scrollToAlignment: 'auto',\n scrollToColumn: -1,\n scrollToRow: -1,\n style: {},\n tabIndex: 0,\n isScrollingOptOut: false\n};\nGrid.propTypes = process.env.NODE_ENV === 'production' ? null : {\n \"aria-label\": PropTypes.string.isRequired,\n \"aria-readonly\": PropTypes.bool,\n\n\n /**\n * Set the width of the inner scrollable container to 'auto'.\n * This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar.\n */\n autoContainerWidth: PropTypes.bool.isRequired,\n\n\n /**\n * Removes fixed height from the scrollingContainer so that the total height of rows can stretch the window.\n * Intended for use with WindowScroller\n */\n autoHeight: PropTypes.bool.isRequired,\n\n\n /**\n * Removes fixed width from the scrollingContainer so that the total width of rows can stretch the window.\n * Intended for use with WindowScroller\n */\n autoWidth: PropTypes.bool.isRequired,\n\n\n /** Responsible for rendering a cell given an row and column index. */\n cellRenderer: function cellRenderer() {\n return (typeof bpfrpt_proptype_CellRenderer === 'function' ? bpfrpt_proptype_CellRenderer.isRequired ? bpfrpt_proptype_CellRenderer.isRequired : bpfrpt_proptype_CellRenderer : PropTypes.shape(bpfrpt_proptype_CellRenderer).isRequired).apply(this, arguments);\n },\n\n\n /** Responsible for rendering a group of cells given their index ranges. */\n cellRangeRenderer: function cellRangeRenderer() {\n return (typeof bpfrpt_proptype_CellRangeRenderer === 'function' ? bpfrpt_proptype_CellRangeRenderer.isRequired ? bpfrpt_proptype_CellRangeRenderer.isRequired : bpfrpt_proptype_CellRangeRenderer : PropTypes.shape(bpfrpt_proptype_CellRangeRenderer).isRequired).apply(this, arguments);\n },\n\n\n /** Optional custom CSS class name to attach to root Grid element. */\n className: PropTypes.string,\n\n\n /** Number of columns in grid. */\n columnCount: PropTypes.number.isRequired,\n\n\n /** Either a fixed column width (number) or a function that returns the width of a column given its index. */\n columnWidth: function columnWidth() {\n return (typeof bpfrpt_proptype_CellSize === 'function' ? bpfrpt_proptype_CellSize.isRequired ? bpfrpt_proptype_CellSize.isRequired : bpfrpt_proptype_CellSize : PropTypes.shape(bpfrpt_proptype_CellSize).isRequired).apply(this, arguments);\n },\n\n\n /** Unfiltered props for the Grid container. */\n containerProps: PropTypes.object,\n\n\n /** ARIA role for the cell-container. */\n containerRole: PropTypes.string.isRequired,\n\n\n /** Optional inline style applied to inner cell-container */\n containerStyle: PropTypes.object.isRequired,\n\n\n /**\n * If CellMeasurer is used to measure this Grid's children, this should be a pointer to its CellMeasurerCache.\n * A shared CellMeasurerCache reference enables Grid and CellMeasurer to share measurement data.\n */\n deferredMeasurementCache: PropTypes.object,\n\n\n /**\n * Used to estimate the total width of a Grid before all of its columns have actually been measured.\n * The estimated total width is adjusted as columns are rendered.\n */\n estimatedColumnSize: PropTypes.number.isRequired,\n\n\n /**\n * Used to estimate the total height of a Grid before all of its rows have actually been measured.\n * The estimated total height is adjusted as rows are rendered.\n */\n estimatedRowSize: PropTypes.number.isRequired,\n\n\n /** Exposed for testing purposes only. */\n getScrollbarSize: PropTypes.func.isRequired,\n\n\n /** Height of Grid; this property determines the number of visible (vs virtualized) rows. */\n height: PropTypes.number.isRequired,\n\n\n /** Optional custom id to attach to root Grid element. */\n id: PropTypes.string,\n\n\n /**\n * Override internal is-scrolling state tracking.\n * This property is primarily intended for use with the WindowScroller component.\n */\n isScrolling: PropTypes.bool,\n\n\n /**\n * Opt-out of isScrolling param passed to cellRangeRenderer.\n * To avoid the extra render when scroll stops.\n */\n isScrollingOptOut: PropTypes.bool.isRequired,\n\n\n /** Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0. */\n noContentRenderer: function noContentRenderer() {\n return (typeof bpfrpt_proptype_NoContentRenderer === 'function' ? bpfrpt_proptype_NoContentRenderer.isRequired ? bpfrpt_proptype_NoContentRenderer.isRequired : bpfrpt_proptype_NoContentRenderer : PropTypes.shape(bpfrpt_proptype_NoContentRenderer).isRequired).apply(this, arguments);\n },\n\n\n /**\n * Callback invoked whenever the scroll offset changes within the inner scrollable region.\n * This callback can be used to sync scrolling between lists, tables, or grids.\n */\n onScroll: PropTypes.func.isRequired,\n\n\n /**\n * Called whenever a horizontal or vertical scrollbar is added or removed.\n * This prop is not intended for end-user use;\n * It is used by MultiGrid to support fixed-row/fixed-column scroll syncing.\n */\n onScrollbarPresenceChange: PropTypes.func.isRequired,\n\n\n /** Callback invoked with information about the section of the Grid that was just rendered. */\n onSectionRendered: PropTypes.func.isRequired,\n\n\n /**\n * Number of columns to render before/after the visible section of the grid.\n * These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently.\n */\n overscanColumnCount: PropTypes.number.isRequired,\n\n\n /**\n * Calculates the number of cells to overscan before and after a specified range.\n * This function ensures that overscanning doesn't exceed the available cells.\n */\n overscanIndicesGetter: function overscanIndicesGetter() {\n return (typeof bpfrpt_proptype_OverscanIndicesGetter === 'function' ? bpfrpt_proptype_OverscanIndicesGetter.isRequired ? bpfrpt_proptype_OverscanIndicesGetter.isRequired : bpfrpt_proptype_OverscanIndicesGetter : PropTypes.shape(bpfrpt_proptype_OverscanIndicesGetter).isRequired).apply(this, arguments);\n },\n\n\n /**\n * Number of rows to render above/below the visible section of the grid.\n * These rows can help for smoother scrolling on touch devices or browsers that send scroll events infrequently.\n */\n overscanRowCount: PropTypes.number.isRequired,\n\n\n /** ARIA role for the grid element. */\n role: PropTypes.string.isRequired,\n\n\n /**\n * Either a fixed row height (number) or a function that returns the height of a row given its index.\n * Should implement the following interface: ({ index: number }): number\n */\n rowHeight: function rowHeight() {\n return (typeof bpfrpt_proptype_CellSize === 'function' ? bpfrpt_proptype_CellSize.isRequired ? bpfrpt_proptype_CellSize.isRequired : bpfrpt_proptype_CellSize : PropTypes.shape(bpfrpt_proptype_CellSize).isRequired).apply(this, arguments);\n },\n\n\n /** Number of rows in grid. */\n rowCount: PropTypes.number.isRequired,\n\n\n /** Wait this amount of time after the last scroll event before resetting Grid `pointer-events`. */\n scrollingResetTimeInterval: PropTypes.number.isRequired,\n\n\n /** Horizontal offset. */\n scrollLeft: PropTypes.number,\n\n\n /**\n * Controls scroll-to-cell behavior of the Grid.\n * The default (\"auto\") scrolls the least amount possible to ensure that the specified cell is fully visible.\n * Use \"start\" to align cells to the top/left of the Grid and \"end\" to align bottom/right.\n */\n scrollToAlignment: function scrollToAlignment() {\n return (typeof bpfrpt_proptype_Alignment === 'function' ? bpfrpt_proptype_Alignment.isRequired ? bpfrpt_proptype_Alignment.isRequired : bpfrpt_proptype_Alignment : PropTypes.shape(bpfrpt_proptype_Alignment).isRequired).apply(this, arguments);\n },\n\n\n /** Column index to ensure visible (by forcefully scrolling if necessary) */\n scrollToColumn: PropTypes.number.isRequired,\n\n\n /** Vertical offset. */\n scrollTop: PropTypes.number,\n\n\n /** Row index to ensure visible (by forcefully scrolling if necessary) */\n scrollToRow: PropTypes.number.isRequired,\n\n\n /** Optional inline style */\n style: PropTypes.object.isRequired,\n\n\n /** Tab index for focus */\n tabIndex: PropTypes.number,\n\n\n /** Width of Grid; this property determines the number of visible (vs virtualized) columns. */\n width: PropTypes.number.isRequired\n};\n\n\npolyfill(Grid);\nexport default Grid;\nimport { bpfrpt_proptype_CellRenderer } from './types';\nimport { bpfrpt_proptype_CellRangeRenderer } from './types';\nimport { bpfrpt_proptype_CellPosition } from './types';\nimport { bpfrpt_proptype_CellSize } from './types';\nimport { bpfrpt_proptype_CellSizeGetter } from './types';\nimport { bpfrpt_proptype_NoContentRenderer } from './types';\nimport { bpfrpt_proptype_Scroll } from './types';\nimport { bpfrpt_proptype_ScrollbarPresenceChange } from './types';\nimport { bpfrpt_proptype_RenderedSection } from './types';\nimport { bpfrpt_proptype_OverscanIndicesGetter } from './types';\nimport { bpfrpt_proptype_Alignment } from './types';\nimport { bpfrpt_proptype_CellCache } from './types';\nimport { bpfrpt_proptype_StyleCache } from './types';\nimport { bpfrpt_proptype_AnimationTimeoutId } from '../utils/requestAnimationTimeout';\nimport PropTypes from 'prop-types';","\n\nexport var SCROLL_DIRECTION_BACKWARD = -1;\n\nexport var SCROLL_DIRECTION_FORWARD = 1;\n\nexport var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';\nexport var SCROLL_DIRECTION_VERTICAL = 'vertical';\n\n/**\n * Calculates the number of cells to overscan before and after a specified range.\n * This function ensures that overscanning doesn't exceed the available cells.\n */\n\nexport default function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex)\n };\n }\n}\nimport { bpfrpt_proptype_OverscanIndicesGetterParams } from './types';\nimport { bpfrpt_proptype_OverscanIndices } from './types';","\n\n/**\n * Default implementation of cellRangeRenderer used by Grid.\n * This renderer supports cell-caching while the user is scrolling.\n */\n\nexport default function defaultCellRangeRenderer(_ref) {\n var cellCache = _ref.cellCache,\n cellRenderer = _ref.cellRenderer,\n columnSizeAndPositionManager = _ref.columnSizeAndPositionManager,\n columnStartIndex = _ref.columnStartIndex,\n columnStopIndex = _ref.columnStopIndex,\n deferredMeasurementCache = _ref.deferredMeasurementCache,\n horizontalOffsetAdjustment = _ref.horizontalOffsetAdjustment,\n isScrolling = _ref.isScrolling,\n isScrollingOptOut = _ref.isScrollingOptOut,\n parent = _ref.parent,\n rowSizeAndPositionManager = _ref.rowSizeAndPositionManager,\n rowStartIndex = _ref.rowStartIndex,\n rowStopIndex = _ref.rowStopIndex,\n styleCache = _ref.styleCache,\n verticalOffsetAdjustment = _ref.verticalOffsetAdjustment,\n visibleColumnIndices = _ref.visibleColumnIndices,\n visibleRowIndices = _ref.visibleRowIndices;\n\n var renderedCells = [];\n\n // Browsers have native size limits for elements (eg Chrome 33M pixels, IE 1.5M pixes).\n // User cannot scroll beyond these size limitations.\n // In order to work around this, ScalingCellSizeAndPositionManager compresses offsets.\n // We should never cache styles for compressed offsets though as this can lead to bugs.\n // See issue #576 for more.\n var areOffsetsAdjusted = columnSizeAndPositionManager.areOffsetsAdjusted() || rowSizeAndPositionManager.areOffsetsAdjusted();\n\n var canCacheStyle = !isScrolling && !areOffsetsAdjusted;\n\n for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {\n var rowDatum = rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);\n\n for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {\n var columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);\n var isVisible = columnIndex >= visibleColumnIndices.start && columnIndex <= visibleColumnIndices.stop && rowIndex >= visibleRowIndices.start && rowIndex <= visibleRowIndices.stop;\n var key = rowIndex + '-' + columnIndex;\n var style = void 0;\n\n // Cache style objects so shallow-compare doesn't re-render unnecessarily.\n if (canCacheStyle && styleCache[key]) {\n style = styleCache[key];\n } else {\n // In deferred mode, cells will be initially rendered before we know their size.\n // Don't interfere with CellMeasurer's measurements by setting an invalid size.\n if (deferredMeasurementCache && !deferredMeasurementCache.has(rowIndex, columnIndex)) {\n // Position not-yet-measured cells at top/left 0,0,\n // And give them width/height of 'auto' so they can grow larger than the parent Grid if necessary.\n // Positioning them further to the right/bottom influences their measured size.\n style = {\n height: 'auto',\n left: 0,\n position: 'absolute',\n top: 0,\n width: 'auto'\n };\n } else {\n style = {\n height: rowDatum.size,\n left: columnDatum.offset + horizontalOffsetAdjustment,\n position: 'absolute',\n top: rowDatum.offset + verticalOffsetAdjustment,\n width: columnDatum.size\n };\n\n styleCache[key] = style;\n }\n }\n\n var cellRendererParams = {\n columnIndex: columnIndex,\n isScrolling: isScrolling,\n isVisible: isVisible,\n key: key,\n parent: parent,\n rowIndex: rowIndex,\n style: style\n };\n\n var renderedCell = void 0;\n\n // Avoid re-creating cells while scrolling.\n // This can lead to the same cell being created many times and can cause performance issues for \"heavy\" cells.\n // If a scroll is in progress- cache and reuse cells.\n // This cache will be thrown away once scrolling completes.\n // However if we are scaling scroll positions and sizes, we should also avoid caching.\n // This is because the offset changes slightly as scroll position changes and caching leads to stale values.\n // For more info refer to issue #395\n //\n // If isScrollingOptOut is specified, we always cache cells.\n // For more info refer to issue #1028\n if ((isScrollingOptOut || isScrolling) && !horizontalOffsetAdjustment && !verticalOffsetAdjustment) {\n if (!cellCache[key]) {\n cellCache[key] = cellRenderer(cellRendererParams);\n }\n\n renderedCell = cellCache[key];\n\n // If the user is no longer scrolling, don't cache cells.\n // This makes dynamic cell content difficult for users and would also lead to a heavier memory footprint.\n } else {\n renderedCell = cellRenderer(cellRendererParams);\n }\n\n if (renderedCell == null || renderedCell === false) {\n continue;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n warnAboutMissingStyle(parent, renderedCell);\n }\n\n renderedCells.push(renderedCell);\n }\n }\n\n return renderedCells;\n}\n\nfunction warnAboutMissingStyle(parent, renderedCell) {\n if (process.env.NODE_ENV !== 'production') {\n if (renderedCell) {\n // If the direct child is a CellMeasurer, then we should check its child\n // See issue #611\n if (renderedCell.type && renderedCell.type.__internalCellMeasurerFlag) {\n renderedCell = renderedCell.props.children;\n }\n\n if (renderedCell && renderedCell.props && renderedCell.props.style === undefined && parent.__warnedAboutMissingStyle !== true) {\n parent.__warnedAboutMissingStyle = true;\n\n console.warn('Rendered cell should include style property for positioning.');\n }\n }\n }\n}\nimport { bpfrpt_proptype_CellRangeRendererParams } from './types';","import * as React from 'react';\n\nvar bpfrpt_proptype_RowRendererParams = process.env.NODE_ENV === 'production' ? null : {\n index: PropTypes.number.isRequired,\n isScrolling: PropTypes.bool.isRequired,\n isVisible: PropTypes.bool.isRequired,\n key: PropTypes.string.isRequired,\n parent: PropTypes.object.isRequired,\n style: PropTypes.object.isRequired\n};\nvar bpfrpt_proptype_RowRenderer = process.env.NODE_ENV === 'production' ? null : PropTypes.func;\nvar bpfrpt_proptype_RenderedRows = process.env.NODE_ENV === 'production' ? null : {\n overscanStartIndex: PropTypes.number.isRequired,\n overscanStopIndex: PropTypes.number.isRequired,\n startIndex: PropTypes.number.isRequired,\n stopIndex: PropTypes.number.isRequired\n};\nvar bpfrpt_proptype_Scroll = process.env.NODE_ENV === 'production' ? null : {\n clientHeight: PropTypes.number.isRequired,\n scrollHeight: PropTypes.number.isRequired,\n scrollTop: PropTypes.number.isRequired\n};\nimport PropTypes from 'prop-types';\nexport { bpfrpt_proptype_RowRendererParams };\nexport { bpfrpt_proptype_RowRenderer };\nexport { bpfrpt_proptype_RenderedRows };\nexport { bpfrpt_proptype_Scroll };","import _extends from 'babel-runtime/helpers/extends';\nimport _Object$getOwnPropertyDescriptor from 'babel-runtime/core-js/object/get-own-property-descriptor';\nimport _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport Grid, { accessibilityOverscanIndicesGetter } from '../Grid';\nimport * as React from 'react';\nimport clsx from 'clsx';\n\n/**\n * It is inefficient to create and manage a large list of DOM elements within a scrolling container\n * if only a few of those elements are visible. The primary purpose of this component is to improve\n * performance by only rendering the DOM nodes that a user is able to see based on their current\n * scroll position.\n *\n * This component renders a virtualized list of elements with either fixed or dynamic heights.\n */\n\nvar List = function (_React$PureComponent) {\n _inherits(List, _React$PureComponent);\n\n function List() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, List);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = List.__proto__ || _Object$getPrototypeOf(List)).call.apply(_ref, [this].concat(args))), _this), _this._cellRenderer = function (_ref2) {\n var parent = _ref2.parent,\n rowIndex = _ref2.rowIndex,\n style = _ref2.style,\n isScrolling = _ref2.isScrolling,\n isVisible = _ref2.isVisible,\n key = _ref2.key;\n var rowRenderer = _this.props.rowRenderer;\n\n // TRICKY The style object is sometimes cached by Grid.\n // This prevents new style objects from bypassing shallowCompare().\n // However as of React 16, style props are auto-frozen (at least in dev mode)\n // Check to make sure we can still modify the style before proceeding.\n // https://github.com/facebook/react/commit/977357765b44af8ff0cfea327866861073095c12#commitcomment-20648713\n\n var _Object$getOwnPropert = _Object$getOwnPropertyDescriptor(style, 'width'),\n writable = _Object$getOwnPropert.writable;\n\n if (writable) {\n // By default, List cells should be 100% width.\n // This prevents them from flowing under a scrollbar (if present).\n style.width = '100%';\n }\n\n return rowRenderer({\n index: rowIndex,\n style: style,\n isScrolling: isScrolling,\n isVisible: isVisible,\n key: key,\n parent: parent\n });\n }, _this._setRef = function (ref) {\n _this.Grid = ref;\n }, _this._onScroll = function (_ref3) {\n var clientHeight = _ref3.clientHeight,\n scrollHeight = _ref3.scrollHeight,\n scrollTop = _ref3.scrollTop;\n var onScroll = _this.props.onScroll;\n\n\n onScroll({ clientHeight: clientHeight, scrollHeight: scrollHeight, scrollTop: scrollTop });\n }, _this._onSectionRendered = function (_ref4) {\n var rowOverscanStartIndex = _ref4.rowOverscanStartIndex,\n rowOverscanStopIndex = _ref4.rowOverscanStopIndex,\n rowStartIndex = _ref4.rowStartIndex,\n rowStopIndex = _ref4.rowStopIndex;\n var onRowsRendered = _this.props.onRowsRendered;\n\n\n onRowsRendered({\n overscanStartIndex: rowOverscanStartIndex,\n overscanStopIndex: rowOverscanStopIndex,\n startIndex: rowStartIndex,\n stopIndex: rowStopIndex\n });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(List, [{\n key: 'forceUpdateGrid',\n value: function forceUpdateGrid() {\n if (this.Grid) {\n this.Grid.forceUpdate();\n }\n }\n\n /** See Grid#getOffsetForCell */\n\n }, {\n key: 'getOffsetForRow',\n value: function getOffsetForRow(_ref5) {\n var alignment = _ref5.alignment,\n index = _ref5.index;\n\n if (this.Grid) {\n var _Grid$getOffsetForCel = this.Grid.getOffsetForCell({\n alignment: alignment,\n rowIndex: index,\n columnIndex: 0\n }),\n _scrollTop = _Grid$getOffsetForCel.scrollTop;\n\n return _scrollTop;\n }\n return 0;\n }\n\n /** CellMeasurer compatibility */\n\n }, {\n key: 'invalidateCellSizeAfterRender',\n value: function invalidateCellSizeAfterRender(_ref6) {\n var columnIndex = _ref6.columnIndex,\n rowIndex = _ref6.rowIndex;\n\n if (this.Grid) {\n this.Grid.invalidateCellSizeAfterRender({\n rowIndex: rowIndex,\n columnIndex: columnIndex\n });\n }\n }\n\n /** See Grid#measureAllCells */\n\n }, {\n key: 'measureAllRows',\n value: function measureAllRows() {\n if (this.Grid) {\n this.Grid.measureAllCells();\n }\n }\n\n /** CellMeasurer compatibility */\n\n }, {\n key: 'recomputeGridSize',\n value: function recomputeGridSize() {\n var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref7$columnIndex = _ref7.columnIndex,\n columnIndex = _ref7$columnIndex === undefined ? 0 : _ref7$columnIndex,\n _ref7$rowIndex = _ref7.rowIndex,\n rowIndex = _ref7$rowIndex === undefined ? 0 : _ref7$rowIndex;\n\n if (this.Grid) {\n this.Grid.recomputeGridSize({\n rowIndex: rowIndex,\n columnIndex: columnIndex\n });\n }\n }\n\n /** See Grid#recomputeGridSize */\n\n }, {\n key: 'recomputeRowHeights',\n value: function recomputeRowHeights() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (this.Grid) {\n this.Grid.recomputeGridSize({\n rowIndex: index,\n columnIndex: 0\n });\n }\n }\n\n /** See Grid#scrollToPosition */\n\n }, {\n key: 'scrollToPosition',\n value: function scrollToPosition() {\n var scrollTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (this.Grid) {\n this.Grid.scrollToPosition({ scrollTop: scrollTop });\n }\n }\n\n /** See Grid#scrollToCell */\n\n }, {\n key: 'scrollToRow',\n value: function scrollToRow() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (this.Grid) {\n this.Grid.scrollToCell({\n columnIndex: 0,\n rowIndex: index\n });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n className = _props.className,\n noRowsRenderer = _props.noRowsRenderer,\n scrollToIndex = _props.scrollToIndex,\n width = _props.width;\n\n\n var classNames = clsx('ReactVirtualized__List', className);\n\n return React.createElement(Grid, _extends({}, this.props, {\n autoContainerWidth: true,\n cellRenderer: this._cellRenderer,\n className: classNames,\n columnWidth: width,\n columnCount: 1,\n noContentRenderer: noRowsRenderer,\n onScroll: this._onScroll,\n onSectionRendered: this._onSectionRendered,\n ref: this._setRef,\n scrollToRow: scrollToIndex\n }));\n }\n }]);\n\n return List;\n}(React.PureComponent);\n\nList.defaultProps = {\n autoHeight: false,\n estimatedRowSize: 30,\n onScroll: function onScroll() {},\n noRowsRenderer: function noRowsRenderer() {\n return null;\n },\n onRowsRendered: function onRowsRendered() {},\n overscanIndicesGetter: accessibilityOverscanIndicesGetter,\n overscanRowCount: 10,\n scrollToAlignment: 'auto',\n scrollToIndex: -1,\n style: {}\n};\nList.propTypes = process.env.NODE_ENV === 'production' ? null : {\n \"aria-label\": PropTypes.string,\n\n\n /**\n * Removes fixed height from the scrollingContainer so that the total height\n * of rows can stretch the window. Intended for use with WindowScroller\n */\n autoHeight: PropTypes.bool.isRequired,\n\n\n /** Optional CSS class name */\n className: PropTypes.string,\n\n\n /**\n * Used to estimate the total height of a List before all of its rows have actually been measured.\n * The estimated total height is adjusted as rows are rendered.\n */\n estimatedRowSize: PropTypes.number.isRequired,\n\n\n /** Height constraint for list (determines how many actual rows are rendered) */\n height: PropTypes.number.isRequired,\n\n\n /** Optional renderer to be used in place of rows when rowCount is 0 */\n noRowsRenderer: function noRowsRenderer() {\n return (typeof bpfrpt_proptype_NoContentRenderer === 'function' ? bpfrpt_proptype_NoContentRenderer.isRequired ? bpfrpt_proptype_NoContentRenderer.isRequired : bpfrpt_proptype_NoContentRenderer : PropTypes.shape(bpfrpt_proptype_NoContentRenderer).isRequired).apply(this, arguments);\n },\n\n\n /** Callback invoked with information about the slice of rows that were just rendered. */\n\n onRowsRendered: PropTypes.func.isRequired,\n\n\n /**\n * Callback invoked whenever the scroll offset changes within the inner scrollable region.\n * This callback can be used to sync scrolling between lists, tables, or grids.\n */\n onScroll: PropTypes.func.isRequired,\n\n\n /** See Grid#overscanIndicesGetter */\n overscanIndicesGetter: function overscanIndicesGetter() {\n return (typeof bpfrpt_proptype_OverscanIndicesGetter === 'function' ? bpfrpt_proptype_OverscanIndicesGetter.isRequired ? bpfrpt_proptype_OverscanIndicesGetter.isRequired : bpfrpt_proptype_OverscanIndicesGetter : PropTypes.shape(bpfrpt_proptype_OverscanIndicesGetter).isRequired).apply(this, arguments);\n },\n\n\n /**\n * Number of rows to render above/below the visible bounds of the list.\n * These rows can help for smoother scrolling on touch devices.\n */\n overscanRowCount: PropTypes.number.isRequired,\n\n\n /** Either a fixed row height (number) or a function that returns the height of a row given its index. */\n rowHeight: function rowHeight() {\n return (typeof bpfrpt_proptype_CellSize === 'function' ? bpfrpt_proptype_CellSize.isRequired ? bpfrpt_proptype_CellSize.isRequired : bpfrpt_proptype_CellSize : PropTypes.shape(bpfrpt_proptype_CellSize).isRequired).apply(this, arguments);\n },\n\n\n /** Responsible for rendering a row given an index; ({ index: number }): node */\n rowRenderer: function rowRenderer() {\n return (typeof bpfrpt_proptype_RowRenderer === 'function' ? bpfrpt_proptype_RowRenderer.isRequired ? bpfrpt_proptype_RowRenderer.isRequired : bpfrpt_proptype_RowRenderer : PropTypes.shape(bpfrpt_proptype_RowRenderer).isRequired).apply(this, arguments);\n },\n\n\n /** Number of rows in list. */\n rowCount: PropTypes.number.isRequired,\n\n\n /** See Grid#scrollToAlignment */\n scrollToAlignment: function scrollToAlignment() {\n return (typeof bpfrpt_proptype_Alignment === 'function' ? bpfrpt_proptype_Alignment.isRequired ? bpfrpt_proptype_Alignment.isRequired : bpfrpt_proptype_Alignment : PropTypes.shape(bpfrpt_proptype_Alignment).isRequired).apply(this, arguments);\n },\n\n\n /** Row index to ensure visible (by forcefully scrolling if necessary) */\n scrollToIndex: PropTypes.number.isRequired,\n\n\n /** Vertical offset. */\n scrollTop: PropTypes.number,\n\n\n /** Optional inline style */\n style: PropTypes.object.isRequired,\n\n\n /** Tab index for focus */\n tabIndex: PropTypes.number,\n\n\n /** Width of list */\n width: PropTypes.number.isRequired\n};\nexport default List;\nimport { bpfrpt_proptype_NoContentRenderer } from '../Grid';\nimport { bpfrpt_proptype_Alignment } from '../Grid';\nimport { bpfrpt_proptype_CellSize } from '../Grid';\nimport { bpfrpt_proptype_CellPosition } from '../Grid';\nimport { bpfrpt_proptype_OverscanIndicesGetter } from '../Grid';\nimport { bpfrpt_proptype_RenderedSection } from '../Grid';\nimport { bpfrpt_proptype_CellRendererParams } from '../Grid';\nimport { bpfrpt_proptype_Scroll as bpfrpt_proptype_GridScroll } from '../Grid';\nimport { bpfrpt_proptype_RowRenderer } from './types';\nimport { bpfrpt_proptype_RenderedRows } from './types';\nimport { bpfrpt_proptype_Scroll } from './types';\nimport PropTypes from 'prop-types';","\n\nexport var SCROLL_DIRECTION_BACKWARD = -1;\n\nexport var SCROLL_DIRECTION_FORWARD = 1;\n\nexport var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';\nexport var SCROLL_DIRECTION_VERTICAL = 'vertical';\n\n/**\n * Calculates the number of cells to overscan before and after a specified range.\n * This function ensures that overscanning doesn't exceed the available cells.\n */\n\nexport default function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n // Make sure we render at least 1 cell extra before and after (except near boundaries)\n // This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases\n // For more info see issues #625\n overscanCellsCount = Math.max(1, overscanCellsCount);\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex - 1),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + 1)\n };\n }\n}\nimport { bpfrpt_proptype_OverscanIndicesGetterParams } from './types';\nimport { bpfrpt_proptype_OverscanIndices } from './types';","import _extends from 'babel-runtime/helpers/extends';\nimport _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport * as React from 'react';\nimport createDetectElementResize from '../vendor/detectElementResize';\n\nvar AutoSizer = function (_React$PureComponent) {\n _inherits(AutoSizer, _React$PureComponent);\n\n function AutoSizer() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, AutoSizer);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AutoSizer.__proto__ || _Object$getPrototypeOf(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n height: _this.props.defaultHeight || 0,\n width: _this.props.defaultWidth || 0\n }, _this._onResize = function () {\n var _this$props = _this.props,\n disableHeight = _this$props.disableHeight,\n disableWidth = _this$props.disableWidth,\n onResize = _this$props.onResize;\n\n\n if (_this._parentNode) {\n // Guard against AutoSizer component being removed from the DOM immediately after being added.\n // This can result in invalid style values which can result in NaN values if we don't handle them.\n // See issue #150 for more context.\n\n var _height = _this._parentNode.offsetHeight || 0;\n var _width = _this._parentNode.offsetWidth || 0;\n\n var win = _this._window || window;\n var _style = win.getComputedStyle(_this._parentNode) || {};\n var paddingLeft = parseInt(_style.paddingLeft, 10) || 0;\n var paddingRight = parseInt(_style.paddingRight, 10) || 0;\n var paddingTop = parseInt(_style.paddingTop, 10) || 0;\n var paddingBottom = parseInt(_style.paddingBottom, 10) || 0;\n\n var newHeight = _height - paddingTop - paddingBottom;\n var newWidth = _width - paddingLeft - paddingRight;\n\n if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) {\n _this.setState({\n height: _height - paddingTop - paddingBottom,\n width: _width - paddingLeft - paddingRight\n });\n\n onResize({ height: _height, width: _width });\n }\n }\n }, _this._setRef = function (autoSizer) {\n _this._autoSizer = autoSizer;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n } // uses any instead of Window because Flow doesn't have window type\n\n\n _createClass(AutoSizer, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var nonce = this.props.nonce;\n\n if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {\n // Delay access of parentNode until mount.\n // This handles edge-cases where the component has already been unmounted before its ref has been set,\n // As well as libraries like react-lite which have a slightly different lifecycle.\n this._parentNode = this._autoSizer.parentNode;\n this._window = this._autoSizer.parentNode.ownerDocument.defaultView;\n\n // Defer requiring resize handler in order to support server-side rendering.\n // See issue #41\n this._detectElementResize = createDetectElementResize(nonce, this._window);\n this._detectElementResize.addResizeListener(this._parentNode, this._onResize);\n\n this._onResize();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this._detectElementResize && this._parentNode) {\n this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n className = _props.className,\n disableHeight = _props.disableHeight,\n disableWidth = _props.disableWidth,\n style = _props.style;\n var _state = this.state,\n height = _state.height,\n width = _state.width;\n\n // Outer div should not force width/height since that may prevent containers from shrinking.\n // Inner component should overflow and use calculated width/height.\n // See issue #68 for more information.\n\n var outerStyle = { overflow: 'visible' };\n var childParams = {};\n\n if (!disableHeight) {\n outerStyle.height = 0;\n childParams.height = height;\n }\n\n if (!disableWidth) {\n outerStyle.width = 0;\n childParams.width = width;\n }\n\n /**\n * TODO: Avoid rendering children before the initial measurements have been collected.\n * At best this would just be wasting cycles.\n * Add this check into version 10 though as it could break too many ref callbacks in version 9.\n * Note that if default width/height props were provided this would still work with SSR.\n if (\n height !== 0 &&\n width !== 0\n ) {\n child = children({ height, width })\n }\n */\n\n return React.createElement(\n 'div',\n {\n className: className,\n ref: this._setRef,\n style: _extends({}, outerStyle, style) },\n children(childParams)\n );\n }\n }]);\n\n return AutoSizer;\n}(React.PureComponent);\n\nAutoSizer.defaultProps = {\n onResize: function onResize() {},\n disableHeight: false,\n disableWidth: false,\n style: {}\n};\nAutoSizer.propTypes = process.env.NODE_ENV === 'production' ? null : {\n /** Function responsible for rendering children.*/\n children: PropTypes.func.isRequired,\n\n\n /** Optional custom CSS class name to attach to root AutoSizer element. */\n className: PropTypes.string,\n\n\n /** Default height to use for initial render; useful for SSR */\n defaultHeight: PropTypes.number,\n\n\n /** Default width to use for initial render; useful for SSR */\n defaultWidth: PropTypes.number,\n\n\n /** Disable dynamic :height property */\n disableHeight: PropTypes.bool.isRequired,\n\n\n /** Disable dynamic :width property */\n disableWidth: PropTypes.bool.isRequired,\n\n\n /** Nonce of the inlined stylesheet for Content Security Policy */\n nonce: PropTypes.string,\n\n\n /** Callback to be invoked on-resize */\n onResize: PropTypes.func.isRequired,\n\n\n /** Optional inline style */\n style: PropTypes.object\n};\nexport default AutoSizer;\nimport PropTypes from 'prop-types';","import { requestAnimationTimeout, cancelAnimationTimeout } from '../../utils/requestAnimationTimeout';\n\n\nvar mountedInstances = [];\nvar originalBodyPointerEvents = null;\nvar disablePointerEventsTimeoutId = null;\n\nfunction enablePointerEventsIfDisabled() {\n if (disablePointerEventsTimeoutId) {\n disablePointerEventsTimeoutId = null;\n\n if (document.body && originalBodyPointerEvents != null) {\n document.body.style.pointerEvents = originalBodyPointerEvents;\n }\n\n originalBodyPointerEvents = null;\n }\n}\n\nfunction enablePointerEventsAfterDelayCallback() {\n enablePointerEventsIfDisabled();\n mountedInstances.forEach(function (instance) {\n return instance.__resetIsScrolling();\n });\n}\n\nfunction enablePointerEventsAfterDelay() {\n if (disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(disablePointerEventsTimeoutId);\n }\n\n var maximumTimeout = 0;\n mountedInstances.forEach(function (instance) {\n maximumTimeout = Math.max(maximumTimeout, instance.props.scrollingResetTimeInterval);\n });\n\n disablePointerEventsTimeoutId = requestAnimationTimeout(enablePointerEventsAfterDelayCallback, maximumTimeout);\n}\n\nfunction onScrollWindow(event) {\n if (event.currentTarget === window && originalBodyPointerEvents == null && document.body) {\n originalBodyPointerEvents = document.body.style.pointerEvents;\n\n document.body.style.pointerEvents = 'none';\n }\n enablePointerEventsAfterDelay();\n mountedInstances.forEach(function (instance) {\n if (instance.props.scrollElement === event.currentTarget) {\n instance.__handleWindowScrollEvent();\n }\n });\n}\n\nexport function registerScrollListener(component, element) {\n if (!mountedInstances.some(function (instance) {\n return instance.props.scrollElement === element;\n })) {\n element.addEventListener('scroll', onScrollWindow);\n }\n mountedInstances.push(component);\n}\n\nexport function unregisterScrollListener(component, element) {\n mountedInstances = mountedInstances.filter(function (instance) {\n return instance !== component;\n });\n if (!mountedInstances.length) {\n element.removeEventListener('scroll', onScrollWindow);\n if (disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(disablePointerEventsTimeoutId);\n enablePointerEventsIfDisabled();\n }\n }\n}\nimport { bpfrpt_proptype_WindowScroller } from '../WindowScroller.js';","\n\n/**\n * Gets the dimensions of the element, accounting for API differences between\n * `window` and other DOM elements.\n */\n\nvar isWindow = function isWindow(element) {\n return element === window;\n};\n\n// TODO Move this into WindowScroller and import from there\n\n\nvar getBoundingBox = function getBoundingBox(element) {\n return element.getBoundingClientRect();\n};\n\nexport function getDimensions(scrollElement, props) {\n if (!scrollElement) {\n return {\n height: props.serverHeight,\n width: props.serverWidth\n };\n } else if (isWindow(scrollElement)) {\n var _window = window,\n innerHeight = _window.innerHeight,\n innerWidth = _window.innerWidth;\n\n return {\n height: typeof innerHeight === 'number' ? innerHeight : 0,\n width: typeof innerWidth === 'number' ? innerWidth : 0\n };\n } else {\n return getBoundingBox(scrollElement);\n }\n}\n\n/**\n * Gets the vertical and horizontal position of an element within its scroll container.\n * Elements that have been “scrolled past” return negative values.\n * Handles edge-case where a user is navigating back (history) from an already-scrolled page.\n * In this case the body’s top or left position will be a negative number and this element’s top or left will be increased (by that amount).\n */\nexport function getPositionOffset(element, container) {\n if (isWindow(container) && document.documentElement) {\n var containerElement = document.documentElement;\n var elementRect = getBoundingBox(element);\n var containerRect = getBoundingBox(containerElement);\n return {\n top: elementRect.top - containerRect.top,\n left: elementRect.left - containerRect.left\n };\n } else {\n var scrollOffset = getScrollOffset(container);\n var _elementRect = getBoundingBox(element);\n var _containerRect = getBoundingBox(container);\n return {\n top: _elementRect.top + scrollOffset.top - _containerRect.top,\n left: _elementRect.left + scrollOffset.left - _containerRect.left\n };\n }\n}\n\n/**\n * Gets the vertical and horizontal scroll amount of the element, accounting for IE compatibility\n * and API differences between `window` and other DOM elements.\n */\nexport function getScrollOffset(element) {\n if (isWindow(element) && document.documentElement) {\n return {\n top: 'scrollY' in window ? window.scrollY : document.documentElement.scrollTop,\n left: 'scrollX' in window ? window.scrollX : document.documentElement.scrollLeft\n };\n } else {\n return {\n top: element.scrollTop,\n left: element.scrollLeft\n };\n }\n}","import _extends from 'babel-runtime/helpers/extends';\nimport _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { registerScrollListener, unregisterScrollListener } from './utils/onScroll';\nimport { getDimensions, getPositionOffset, getScrollOffset } from './utils/dimensions';\nimport createDetectElementResize from '../vendor/detectElementResize';\n\n/**\n * Specifies the number of miliseconds during which to disable pointer events while a scroll is in progress.\n * This improves performance and makes scrolling smoother.\n */\nexport var IS_SCROLLING_TIMEOUT = 150;\n\nvar getWindow = function getWindow() {\n return typeof window !== 'undefined' ? window : undefined;\n};\n\nvar WindowScroller = function (_React$PureComponent) {\n _inherits(WindowScroller, _React$PureComponent);\n\n function WindowScroller() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, WindowScroller);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WindowScroller.__proto__ || _Object$getPrototypeOf(WindowScroller)).call.apply(_ref, [this].concat(args))), _this), _this._window = getWindow(), _this._isMounted = false, _this._positionFromTop = 0, _this._positionFromLeft = 0, _this.state = _extends({}, getDimensions(_this.props.scrollElement, _this.props), {\n isScrolling: false,\n scrollLeft: 0,\n scrollTop: 0\n }), _this._registerChild = function (element) {\n if (element && !(element instanceof Element)) {\n console.warn('WindowScroller registerChild expects to be passed Element or null');\n }\n _this._child = element;\n _this.updatePosition();\n }, _this._onChildScroll = function (_ref2) {\n var scrollTop = _ref2.scrollTop;\n\n if (_this.state.scrollTop === scrollTop) {\n return;\n }\n\n var scrollElement = _this.props.scrollElement;\n if (scrollElement) {\n if (typeof scrollElement.scrollTo === 'function') {\n scrollElement.scrollTo(0, scrollTop + _this._positionFromTop);\n } else {\n scrollElement.scrollTop = scrollTop + _this._positionFromTop;\n }\n }\n }, _this._registerResizeListener = function (element) {\n if (element === window) {\n window.addEventListener('resize', _this._onResize, false);\n } else {\n _this._detectElementResize.addResizeListener(element, _this._onResize);\n }\n }, _this._unregisterResizeListener = function (element) {\n if (element === window) {\n window.removeEventListener('resize', _this._onResize, false);\n } else if (element) {\n _this._detectElementResize.removeResizeListener(element, _this._onResize);\n }\n }, _this._onResize = function () {\n _this.updatePosition();\n }, _this.__handleWindowScrollEvent = function () {\n if (!_this._isMounted) {\n return;\n }\n\n var onScroll = _this.props.onScroll;\n\n\n var scrollElement = _this.props.scrollElement;\n if (scrollElement) {\n var scrollOffset = getScrollOffset(scrollElement);\n var _scrollLeft = Math.max(0, scrollOffset.left - _this._positionFromLeft);\n var _scrollTop = Math.max(0, scrollOffset.top - _this._positionFromTop);\n\n _this.setState({\n isScrolling: true,\n scrollLeft: _scrollLeft,\n scrollTop: _scrollTop\n });\n\n onScroll({\n scrollLeft: _scrollLeft,\n scrollTop: _scrollTop\n });\n }\n }, _this.__resetIsScrolling = function () {\n _this.setState({\n isScrolling: false\n });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(WindowScroller, [{\n key: 'updatePosition',\n value: function updatePosition() {\n var scrollElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.scrollElement;\n var onResize = this.props.onResize;\n var _state = this.state,\n height = _state.height,\n width = _state.width;\n\n\n var thisNode = this._child || ReactDOM.findDOMNode(this);\n if (thisNode instanceof Element && scrollElement) {\n var offset = getPositionOffset(thisNode, scrollElement);\n this._positionFromTop = offset.top;\n this._positionFromLeft = offset.left;\n }\n\n var dimensions = getDimensions(scrollElement, this.props);\n if (height !== dimensions.height || width !== dimensions.width) {\n this.setState({\n height: dimensions.height,\n width: dimensions.width\n });\n onResize({\n height: dimensions.height,\n width: dimensions.width\n });\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var scrollElement = this.props.scrollElement;\n\n this._detectElementResize = createDetectElementResize();\n\n this.updatePosition(scrollElement);\n\n if (scrollElement) {\n registerScrollListener(this, scrollElement);\n this._registerResizeListener(scrollElement);\n }\n\n this._isMounted = true;\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n var scrollElement = this.props.scrollElement;\n var prevScrollElement = prevProps.scrollElement;\n\n\n if (prevScrollElement !== scrollElement && prevScrollElement != null && scrollElement != null) {\n this.updatePosition(scrollElement);\n\n unregisterScrollListener(this, prevScrollElement);\n registerScrollListener(this, scrollElement);\n\n this._unregisterResizeListener(prevScrollElement);\n this._registerResizeListener(scrollElement);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var scrollElement = this.props.scrollElement;\n if (scrollElement) {\n unregisterScrollListener(this, scrollElement);\n this._unregisterResizeListener(scrollElement);\n }\n\n this._isMounted = false;\n }\n }, {\n key: 'render',\n value: function render() {\n var children = this.props.children;\n var _state2 = this.state,\n isScrolling = _state2.isScrolling,\n scrollTop = _state2.scrollTop,\n scrollLeft = _state2.scrollLeft,\n height = _state2.height,\n width = _state2.width;\n\n\n return children({\n onChildScroll: this._onChildScroll,\n registerChild: this._registerChild,\n height: height,\n isScrolling: isScrolling,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n width: width\n });\n }\n\n // Referenced by utils/onScroll\n\n\n // Referenced by utils/onScroll\n\n }]);\n\n return WindowScroller;\n}(React.PureComponent);\n\nWindowScroller.defaultProps = {\n onResize: function onResize() {},\n onScroll: function onScroll() {},\n scrollingResetTimeInterval: IS_SCROLLING_TIMEOUT,\n scrollElement: getWindow(),\n serverHeight: 0,\n serverWidth: 0\n};\nWindowScroller.propTypes = process.env.NODE_ENV === 'production' ? null : {\n /**\n * Function responsible for rendering children.\n * This function should implement the following signature:\n * ({ height, isScrolling, scrollLeft, scrollTop, width }) => PropTypes.element\n */\n children: PropTypes.func.isRequired,\n\n\n /** Callback to be invoked on-resize: ({ height, width }) */\n onResize: PropTypes.func.isRequired,\n\n\n /** Callback to be invoked on-scroll: ({ scrollLeft, scrollTop }) */\n onScroll: PropTypes.func.isRequired,\n\n\n /** Element to attach scroll event listeners. Defaults to window. */\n scrollElement: PropTypes.oneOfType([PropTypes.any, function () {\n return (typeof Element === 'function' ? PropTypes.instanceOf(Element) : PropTypes.any).apply(this, arguments);\n }]),\n\n /**\n * Wait this amount of time after the last scroll event before resetting child `pointer-events`.\n */\n scrollingResetTimeInterval: PropTypes.number.isRequired,\n\n\n /** Height used for server-side rendering */\n serverHeight: PropTypes.number.isRequired,\n\n\n /** Width used for server-side rendering */\n serverWidth: PropTypes.number.isRequired\n};\nexport default WindowScroller;\nimport PropTypes from 'prop-types';","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nvar _class, _temp;\n\nimport * as React from 'react';\nimport { findDOMNode } from 'react-dom';\n\n/**\n * Wraps a cell and measures its rendered content.\n * Measurements are stored in a per-cell cache.\n * Cached-content is not be re-measured.\n */\nvar CellMeasurer = (_temp = _class =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(CellMeasurer, _React$PureComponent);\n\n function CellMeasurer() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, CellMeasurer);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CellMeasurer)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"_child\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_measure\", function () {\n var _this$props = _this.props,\n cache = _this$props.cache,\n _this$props$columnInd = _this$props.columnIndex,\n columnIndex = _this$props$columnInd === void 0 ? 0 : _this$props$columnInd,\n parent = _this$props.parent,\n _this$props$rowIndex = _this$props.rowIndex,\n rowIndex = _this$props$rowIndex === void 0 ? _this.props.index || 0 : _this$props$rowIndex;\n\n var _this$_getCellMeasure = _this._getCellMeasurements(),\n height = _this$_getCellMeasure.height,\n width = _this$_getCellMeasure.width;\n\n if (height !== cache.getHeight(rowIndex, columnIndex) || width !== cache.getWidth(rowIndex, columnIndex)) {\n cache.set(rowIndex, columnIndex, width, height);\n\n if (parent && typeof parent.recomputeGridSize === 'function') {\n parent.recomputeGridSize({\n columnIndex: columnIndex,\n rowIndex: rowIndex\n });\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_registerChild\", function (element) {\n if (element && !(element instanceof Element)) {\n console.warn('CellMeasurer registerChild expects to be passed Element or null');\n }\n\n _this._child = element;\n\n if (element) {\n _this._maybeMeasureCell();\n }\n });\n\n return _this;\n }\n\n _createClass(CellMeasurer, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this._maybeMeasureCell();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this._maybeMeasureCell();\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n return typeof children === 'function' ? children({\n measure: this._measure,\n registerChild: this._registerChild\n }) : children;\n }\n }, {\n key: \"_getCellMeasurements\",\n value: function _getCellMeasurements() {\n var cache = this.props.cache;\n var node = this._child || findDOMNode(this); // TODO Check for a bad combination of fixedWidth and missing numeric width or vice versa with height\n\n if (node && node.ownerDocument && node.ownerDocument.defaultView && node instanceof node.ownerDocument.defaultView.HTMLElement) {\n var styleWidth = node.style.width;\n var styleHeight = node.style.height; // If we are re-measuring a cell that has already been measured,\n // It will have a hard-coded width/height from the previous measurement.\n // The fact that we are measuring indicates this measurement is probably stale,\n // So explicitly clear it out (eg set to \"auto\") so we can recalculate.\n // See issue #593 for more info.\n // Even if we are measuring initially- if we're inside of a MultiGrid component,\n // Explicitly clear width/height before measuring to avoid being tainted by another Grid.\n // eg top/left Grid renders before bottom/right Grid\n // Since the CellMeasurerCache is shared between them this taints derived cell size values.\n\n if (!cache.hasFixedWidth()) {\n node.style.width = 'auto';\n }\n\n if (!cache.hasFixedHeight()) {\n node.style.height = 'auto';\n }\n\n var height = Math.ceil(node.offsetHeight);\n var width = Math.ceil(node.offsetWidth); // Reset after measuring to avoid breaking styles; see #660\n\n if (styleWidth) {\n node.style.width = styleWidth;\n }\n\n if (styleHeight) {\n node.style.height = styleHeight;\n }\n\n return {\n height: height,\n width: width\n };\n } else {\n return {\n height: 0,\n width: 0\n };\n }\n }\n }, {\n key: \"_maybeMeasureCell\",\n value: function _maybeMeasureCell() {\n var _this$props2 = this.props,\n cache = _this$props2.cache,\n _this$props2$columnIn = _this$props2.columnIndex,\n columnIndex = _this$props2$columnIn === void 0 ? 0 : _this$props2$columnIn,\n parent = _this$props2.parent,\n _this$props2$rowIndex = _this$props2.rowIndex,\n rowIndex = _this$props2$rowIndex === void 0 ? this.props.index || 0 : _this$props2$rowIndex;\n\n if (!cache.has(rowIndex, columnIndex)) {\n var _this$_getCellMeasure2 = this._getCellMeasurements(),\n height = _this$_getCellMeasure2.height,\n width = _this$_getCellMeasure2.width;\n\n cache.set(rowIndex, columnIndex, width, height); // If size has changed, let Grid know to re-render.\n\n if (parent && typeof parent.invalidateCellSizeAfterRender === 'function') {\n parent.invalidateCellSizeAfterRender({\n columnIndex: columnIndex,\n rowIndex: rowIndex\n });\n }\n }\n }\n }]);\n\n return CellMeasurer;\n}(React.PureComponent), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n cache: function cache() {\n return (typeof bpfrpt_proptype_CellMeasureCache === \"function\" ? bpfrpt_proptype_CellMeasureCache.isRequired ? bpfrpt_proptype_CellMeasureCache.isRequired : bpfrpt_proptype_CellMeasureCache : PropTypes.shape(bpfrpt_proptype_CellMeasureCache).isRequired).apply(this, arguments);\n },\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n columnIndex: PropTypes.number,\n index: PropTypes.number,\n parent: PropTypes.shape({\n invalidateCellSizeAfterRender: PropTypes.func,\n recomputeGridSize: PropTypes.func\n }).isRequired,\n rowIndex: PropTypes.number\n}), _temp); // Used for DEV mode warning check\n\n_defineProperty(CellMeasurer, \"__internalCellMeasurerFlag\", false);\n\nexport { CellMeasurer as default };\n\nif (process.env.NODE_ENV !== 'production') {\n CellMeasurer.__internalCellMeasurerFlag = true;\n}\n\nimport { bpfrpt_proptype_CellMeasureCache } from \"./types\";\nimport PropTypes from \"prop-types\";","import WindowScroller, { IS_SCROLLING_TIMEOUT } from './WindowScroller';\n\nexport default WindowScroller;\nexport { WindowScroller, IS_SCROLLING_TIMEOUT };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport var DEFAULT_HEIGHT = 30;\nexport var DEFAULT_WIDTH = 100; // Enables more intelligent mapping of a given column and row index to an item ID.\n// This prevents a cell cache from being invalidated when its parent collection is modified.\n\n/**\n * Caches measurements for a given cell.\n */\nvar CellMeasurerCache =\n/*#__PURE__*/\nfunction () {\n function CellMeasurerCache() {\n var _this = this;\n\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, CellMeasurerCache);\n\n _defineProperty(this, \"_cellHeightCache\", {});\n\n _defineProperty(this, \"_cellWidthCache\", {});\n\n _defineProperty(this, \"_columnWidthCache\", {});\n\n _defineProperty(this, \"_rowHeightCache\", {});\n\n _defineProperty(this, \"_defaultHeight\", void 0);\n\n _defineProperty(this, \"_defaultWidth\", void 0);\n\n _defineProperty(this, \"_minHeight\", void 0);\n\n _defineProperty(this, \"_minWidth\", void 0);\n\n _defineProperty(this, \"_keyMapper\", void 0);\n\n _defineProperty(this, \"_hasFixedHeight\", void 0);\n\n _defineProperty(this, \"_hasFixedWidth\", void 0);\n\n _defineProperty(this, \"_columnCount\", 0);\n\n _defineProperty(this, \"_rowCount\", 0);\n\n _defineProperty(this, \"columnWidth\", function (_ref) {\n var index = _ref.index;\n\n var key = _this._keyMapper(0, index);\n\n return _this._columnWidthCache[key] !== undefined ? _this._columnWidthCache[key] : _this._defaultWidth;\n });\n\n _defineProperty(this, \"rowHeight\", function (_ref2) {\n var index = _ref2.index;\n\n var key = _this._keyMapper(index, 0);\n\n return _this._rowHeightCache[key] !== undefined ? _this._rowHeightCache[key] : _this._defaultHeight;\n });\n\n var defaultHeight = params.defaultHeight,\n defaultWidth = params.defaultWidth,\n fixedHeight = params.fixedHeight,\n fixedWidth = params.fixedWidth,\n keyMapper = params.keyMapper,\n minHeight = params.minHeight,\n minWidth = params.minWidth;\n this._hasFixedHeight = fixedHeight === true;\n this._hasFixedWidth = fixedWidth === true;\n this._minHeight = minHeight || 0;\n this._minWidth = minWidth || 0;\n this._keyMapper = keyMapper || defaultKeyMapper;\n this._defaultHeight = Math.max(this._minHeight, typeof defaultHeight === 'number' ? defaultHeight : DEFAULT_HEIGHT);\n this._defaultWidth = Math.max(this._minWidth, typeof defaultWidth === 'number' ? defaultWidth : DEFAULT_WIDTH);\n\n if (process.env.NODE_ENV !== 'production') {\n if (this._hasFixedHeight === false && this._hasFixedWidth === false) {\n console.warn(\"CellMeasurerCache should only measure a cell's width or height. \" + 'You have configured CellMeasurerCache to measure both. ' + 'This will result in poor performance.');\n }\n\n if (this._hasFixedHeight === false && this._defaultHeight === 0) {\n console.warn('Fixed height CellMeasurerCache should specify a :defaultHeight greater than 0. ' + 'Failing to do so will lead to unnecessary layout and poor performance.');\n }\n\n if (this._hasFixedWidth === false && this._defaultWidth === 0) {\n console.warn('Fixed width CellMeasurerCache should specify a :defaultWidth greater than 0. ' + 'Failing to do so will lead to unnecessary layout and poor performance.');\n }\n }\n }\n\n _createClass(CellMeasurerCache, [{\n key: \"clear\",\n value: function clear(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var key = this._keyMapper(rowIndex, columnIndex);\n\n delete this._cellHeightCache[key];\n delete this._cellWidthCache[key];\n\n this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);\n }\n }, {\n key: \"clearAll\",\n value: function clearAll() {\n this._cellHeightCache = {};\n this._cellWidthCache = {};\n this._columnWidthCache = {};\n this._rowHeightCache = {};\n this._rowCount = 0;\n this._columnCount = 0;\n }\n }, {\n key: \"hasFixedHeight\",\n value: function hasFixedHeight() {\n return this._hasFixedHeight;\n }\n }, {\n key: \"hasFixedWidth\",\n value: function hasFixedWidth() {\n return this._hasFixedWidth;\n }\n }, {\n key: \"getHeight\",\n value: function getHeight(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (this._hasFixedHeight) {\n return this._defaultHeight;\n } else {\n var _key = this._keyMapper(rowIndex, columnIndex);\n\n return this._cellHeightCache[_key] !== undefined ? Math.max(this._minHeight, this._cellHeightCache[_key]) : this._defaultHeight;\n }\n }\n }, {\n key: \"getWidth\",\n value: function getWidth(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (this._hasFixedWidth) {\n return this._defaultWidth;\n } else {\n var _key2 = this._keyMapper(rowIndex, columnIndex);\n\n return this._cellWidthCache[_key2] !== undefined ? Math.max(this._minWidth, this._cellWidthCache[_key2]) : this._defaultWidth;\n }\n }\n }, {\n key: \"has\",\n value: function has(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var key = this._keyMapper(rowIndex, columnIndex);\n\n return this._cellHeightCache[key] !== undefined;\n }\n }, {\n key: \"set\",\n value: function set(rowIndex, columnIndex, width, height) {\n var key = this._keyMapper(rowIndex, columnIndex);\n\n if (columnIndex >= this._columnCount) {\n this._columnCount = columnIndex + 1;\n }\n\n if (rowIndex >= this._rowCount) {\n this._rowCount = rowIndex + 1;\n } // Size is cached per cell so we don't have to re-measure if cells are re-ordered.\n\n\n this._cellHeightCache[key] = height;\n this._cellWidthCache[key] = width;\n\n this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);\n }\n }, {\n key: \"_updateCachedColumnAndRowSizes\",\n value: function _updateCachedColumnAndRowSizes(rowIndex, columnIndex) {\n // :columnWidth and :rowHeight are derived based on all cells in a column/row.\n // Pre-cache these derived values for faster lookup later.\n // Reads are expected to occur more frequently than writes in this case.\n // Only update non-fixed dimensions though to avoid doing unnecessary work.\n if (!this._hasFixedWidth) {\n var columnWidth = 0;\n\n for (var i = 0; i < this._rowCount; i++) {\n columnWidth = Math.max(columnWidth, this.getWidth(i, columnIndex));\n }\n\n var columnKey = this._keyMapper(0, columnIndex);\n\n this._columnWidthCache[columnKey] = columnWidth;\n }\n\n if (!this._hasFixedHeight) {\n var rowHeight = 0;\n\n for (var _i = 0; _i < this._columnCount; _i++) {\n rowHeight = Math.max(rowHeight, this.getHeight(rowIndex, _i));\n }\n\n var rowKey = this._keyMapper(rowIndex, 0);\n\n this._rowHeightCache[rowKey] = rowHeight;\n }\n }\n }, {\n key: \"defaultHeight\",\n get: function get() {\n return this._defaultHeight;\n }\n }, {\n key: \"defaultWidth\",\n get: function get() {\n return this._defaultWidth;\n }\n }]);\n\n return CellMeasurerCache;\n}();\n\nexport { CellMeasurerCache as default };\n\nfunction defaultKeyMapper(rowIndex, columnIndex) {\n return \"\".concat(rowIndex, \"-\").concat(columnIndex);\n}\n\nimport { bpfrpt_proptype_CellMeasureCache } from \"./types\";","function areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (newInputs[i] !== lastInputs[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) { isEqual = areInputsEqual; }\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n return memoized;\n}\n\nexport default memoizeOne;\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport checkmarkIcon from '@jetbrains/icons/checkmark.svg';\n\nimport Icon from '../icon/icon';\n\nimport styles from './checkbox.css';\n\n/**\n * @name Checkbox\n */\nexport default class Checkbox extends PureComponent {\n\n static propTypes = {\n name: PropTypes.string,\n label: PropTypes.string,\n className: PropTypes.string,\n defaultChecked: PropTypes.bool,\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n children: PropTypes.node\n };\n\n inputRef = el => {\n this.input = el;\n };\n\n render() {\n const {children, label, ...restProps} = this.props;\n\n const classes = classNames(\n styles.input,\n this.props.className\n );\n\n return (\n \n );\n }\n}\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport dataTests from '../global/data-tests';\nimport Avatar, {Size as AvatarSize} from '../avatar/avatar';\nimport Checkbox from '../checkbox/checkbox';\nimport Icon from '../icon';\n\nimport getUID from '../global/get-uid';\nimport globalStyles from '../global/global.css';\n\nimport styles from './list.css';\n\n/**\n * @constructor\n * @extends {ReactComponent}\n */\n\nconst RING_UNIT = 8;\nconst DEFAULT_PADDING = 16;\nconst CHECKBOX_WIDTH = 28;\n\nexport default class ListItem extends PureComponent {\n static propTypes = {\n scrolling: PropTypes.bool,\n hover: PropTypes.bool,\n details: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n tabIndex: PropTypes.number,\n checkbox: PropTypes.bool,\n description: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n PropTypes.array\n ]),\n avatar: PropTypes.string,\n subavatar: PropTypes.string,\n glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),\n icon: PropTypes.string,\n iconSize: PropTypes.number,\n rightNodes: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n PropTypes.array\n ]),\n leftNodes: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n PropTypes.array\n ]),\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n title: PropTypes.string,\n level: PropTypes.number,\n rgItemType: PropTypes.number,\n rightGlyph: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),\n compact: PropTypes.bool,\n onClick: PropTypes.func,\n onCheckboxChange: PropTypes.func,\n onMouseOver: PropTypes.func,\n onMouseUp: PropTypes.func,\n 'data-test': PropTypes.string\n };\n\n id = getUID('list-item-');\n\n stopBubbling = e => e.stopPropagation();\n\n _isString = val => typeof val === 'string' || val instanceof String;\n\n render() {\n const {\n scrolling,\n className,\n disabled,\n checkbox,\n avatar,\n subavatar,\n glyph,\n icon,\n rightGlyph,\n description,\n label,\n title,\n details,\n hover,\n rgItemType,\n level,\n tabIndex,\n compact,\n onClick,\n onCheckboxChange,\n onMouseOver,\n onMouseUp,\n rightNodes,\n leftNodes,\n ...restProps\n } = this.props;\n\n const checkable = checkbox !== undefined;\n const hasLeftNodes = leftNodes || glyph || avatar;\n const showCheckbox = checkable && (checkbox || !hasLeftNodes || (hover && !disabled));\n\n const classes = classNames(styles.item, globalStyles.resetButton, className, {\n [styles.action]: !disabled,\n [styles.hover]: hover && !disabled,\n [styles.compact]: compact,\n [styles.scrolling]: scrolling,\n [styles.disabled]: disabled\n });\n\n const detailsClasses = classNames({\n [styles.details]: details,\n [styles.padded]: icon !== undefined ||\n checkbox !== undefined ||\n glyph !== undefined\n });\n\n const style = {\n paddingLeft: `${(+level || 0) * RING_UNIT + DEFAULT_PADDING + (showCheckbox ? CHECKBOX_WIDTH : 0)}px`\n };\n\n let computedTitle = null;\n if (this._isString(title)) {\n // if title is specified and is a string then use it\n computedTitle = title;\n } else {\n // otherwise use label if it is a string;\n // label can also be an element, use empty string in this case\n computedTitle = this._isString(label) ? label : '';\n }\n\n const dataTest = dataTests({\n 'ring-list-item': (restProps['data-test'] || '').indexOf('ring-list-item') === -1,\n 'ring-list-item-action': !disabled,\n 'ring-list-item-selected': checkbox\n }, restProps['data-test']);\n\n return (\n
\n {showCheckbox && (\n
\n \n
\n )}\n \n
\n );\n }\n}\n","// react-dom getEventKey function extracted\n\nconst normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n\nconst translateToKey = {\n 8: 'Backspace',\n 9: 'Tab',\n 12: 'Clear',\n 13: 'Enter',\n 16: 'Shift',\n 17: 'Control',\n 18: 'Alt',\n 19: 'Pause',\n 20: 'CapsLock',\n 27: 'Escape',\n 32: ' ',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 45: 'Insert',\n 46: 'Delete',\n 112: 'F1',\n 113: 'F2',\n 114: 'F3',\n 115: 'F4',\n 116: 'F5',\n 117: 'F6',\n 118: 'F7',\n 119: 'F8',\n 120: 'F9',\n 121: 'F10',\n 122: 'F11',\n 123: 'F12',\n 144: 'NumLock',\n 145: 'ScrollLock',\n 224: 'Meta'\n};\n\nconst ENTER = 13;\nconst SPACE = 32;\n\nfunction getEventCharCode(nativeEvent) {\n let charCode;\n const keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode;\n\n // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n if (charCode === 0 && keyCode === ENTER) {\n charCode = ENTER;\n }\n } else {\n // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n }\n\n // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n // Must not discard the (non-)printable Enter-key.\n if (charCode >= SPACE || charCode === ENTER) {\n return charCode;\n }\n return 0;\n}\n\n\nexport default function getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n // Normalize inconsistent values reported by browsers due to\n // implementations of a working draft specification.\n\n // FireFox implements `key` but returns `MozPrintableKey` for all\n // printable characters (normalized to `Unidentified`), ignore it.\n const key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n if (key !== 'Unidentified') {\n return key;\n }\n }\n\n // Browser does not implement `key`, polyfill as much of it as we can.\n if (nativeEvent.type === 'keypress') {\n const charCode = getEventCharCode(nativeEvent);\n\n // The enter-key is technically both printable and non-printable and can\n // thus be captured by `keypress`, no other non-printable key should.\n return charCode === SPACE ? 'Enter' : String.fromCharCode(charCode);\n }\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n // While user keyboard layout determines the actual meaning of each\n // `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n return '';\n}\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport dataTests from '../global/data-tests';\nimport getEventKey from '../global/get-event-key';\n\nimport styles from './list.css';\n\nexport default class ListCustom extends PureComponent {\n static propTypes = {\n scrolling: PropTypes.bool,\n hover: PropTypes.bool,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n rgItemType: PropTypes.number,\n tabIndex: PropTypes.number,\n template: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.element,\n PropTypes.string\n ]),\n onClick: PropTypes.func,\n onMouseOver: PropTypes.func,\n onMouseUp: PropTypes.func,\n onCheckboxChange: PropTypes.func,\n 'data-test': PropTypes.string\n };\n\n static defaultProps = {\n hover: false\n };\n\n handleKeyPress = event => {\n const key = getEventKey(event);\n if (key === 'Enter' || key === ' ') {\n this.props.onClick(event);\n }\n };\n\n render() {\n const {\n scrolling,\n hover,\n className,\n disabled,\n template,\n rgItemType,\n tabIndex,\n onClick,\n onCheckboxChange,\n onMouseOver,\n onMouseUp,\n ...restProps\n } = this.props;\n const classes = classNames(styles.item, className, {\n [styles.action]: !disabled,\n [styles.hover]: hover && !disabled,\n [styles.scrolling]: scrolling\n });\n\n\n const dataTest = dataTests('ring-list-item-custom', {\n 'ring-list-item-action': !disabled\n }, restProps['data-test']);\n\n const content = (typeof template === 'function') ? template(this.props) : template;\n return (\n \n {content}\n \n );\n }\n}\n","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport {pure} from 'recompose';\n\nimport memoize from '../global/memoize';\nimport dataTests from '../global/data-tests';\n\nimport ClickableLink from './clickableLink';\nimport styles from './link.css';\n\n/**\n * @name Link\n */\n\nlet isCompatibilityMode = false;\n\nexport function setCompatibilityMode(isEnabled) {\n isCompatibilityMode = isEnabled;\n}\n\nconst makeWrapText = memoize(innerClassName => {\n const WrapText = pure(function WrapText({className, children}) {\n const classes = classNames(styles.inner, className, innerClassName);\n return {children};\n });\n\n WrapText.propTypes = {\n className: PropTypes.string,\n children: PropTypes.node\n };\n\n return WrapText;\n});\n\nexport function linkHOC(ComposedComponent) {\n const isCustom = typeof ComposedComponent !== 'string' && ComposedComponent !== ClickableLink;\n\n return class Link extends Component {\n static propTypes = {\n className: PropTypes.string,\n innerClassName: PropTypes.string,\n active: PropTypes.bool,\n inherit: PropTypes.bool,\n pseudo: PropTypes.bool,\n hover: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n 'data-test': PropTypes.string,\n href: PropTypes.string,\n onPlainLeftClick: PropTypes.func,\n onClick: PropTypes.func\n };\n\n getChildren() {\n const {children, innerClassName} = this.props;\n\n const WrapText = makeWrapText(innerClassName);\n\n return typeof children === 'function'\n ? children(WrapText)\n : {children};\n }\n\n render() {\n const {\n active,\n inherit,\n pseudo,\n hover,\n className,\n 'data-test': dataTest,\n href,\n innerClassName, children, onPlainLeftClick, onClick,\n ...props\n } = this.props;\n const useButton = pseudo || !isCustom && href == null;\n\n const classes = classNames(styles.link, className, {\n [styles.active]: active,\n [styles.inherit]: inherit,\n [styles.hover]: hover,\n [styles.compatibilityUnderlineMode]: isCompatibilityMode,\n [styles.pseudo]: useButton\n });\n\n if (isCustom && !props.activeClassName) {\n props.activeClassName = styles.active;\n }\n\n if (useButton) {\n return (\n \n );\n }\n\n return (\n \n {this.getChildren()}\n \n );\n }\n };\n}\n\nexport default linkHOC(ClickableLink);\n","import React, {Component, PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport Link, {linkHOC} from '../link/link';\nimport dataTests from '../global/data-tests';\n\nimport styles from './list.css';\n\n/**\n * @constructor\n * @extends {ReactComponent}\n */\nexport default class ListLink extends PureComponent {\n static propTypes = {\n ...Link.propTypes,\n description: PropTypes.string,\n label: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.string\n ]),\n rgItemType: PropTypes.number,\n scrolling: PropTypes.bool,\n url: PropTypes.string,\n LinkComponent: PropTypes.oneOfType([\n PropTypes.instanceOf(Component),\n PropTypes.func,\n PropTypes.string\n ]),\n onCheckboxChange: PropTypes.func,\n compact: PropTypes.bool\n };\n\n render() {\n const {\n scrolling,\n 'data-test': dataTest,\n className,\n label,\n hover,\n description,\n rgItemType,\n url,\n onCheckboxChange,\n disabled,\n LinkComponent,\n compact,\n hoverClassName,\n ...restProps\n } = this.props;\n const classes = classNames(styles.item, className, {\n [styles.actionLink]: !disabled,\n [styles.compact]: compact,\n [styles.scrolling]: scrolling\n });\n\n const Comp = LinkComponent ? linkHOC(LinkComponent) : Link;\n\n return (\n \n {label}\n \n );\n }\n}\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport styles from './list.css';\n\nexport default class ListTitle extends PureComponent {\n static propTypes = {\n className: PropTypes.string,\n description: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.string\n ]),\n label: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.string\n ]),\n isFirst: PropTypes.bool\n };\n\n render() {\n const {className, description, label, isFirst} = this.props;\n\n const classes = classnames(styles.title, className, {\n [styles.title_first]: isFirst\n });\n\n return (\n \n {label}\n
{description}
\n \n );\n }\n}\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport styles from './list.css';\n\nexport default class ListSeparator extends PureComponent {\n static propTypes = {\n className: PropTypes.string,\n description: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.string\n ]),\n isFirst: PropTypes.bool\n };\n\n render() {\n const {description, isFirst, className} = this.props;\n\n const classes = classNames(styles.separator, className, {\n [styles.separator_first]: isFirst\n });\n\n return (\n {description}\n );\n }\n}\n","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport styles from './list.css';\n\n/**\n * @constructor\n * @extends {ReactComponent}\n */\nexport default class ListHint extends PureComponent {\n static propTypes = {\n label: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.string\n ])\n };\n\n render() {\n return (\n {this.props.label}\n );\n }\n}\n","/**\n * @name List\n */\n\nimport 'dom4';\nimport React, {Component, cloneElement} from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport VirtualizedList from 'react-virtualized/dist/es/List';\nimport AutoSizer from 'react-virtualized/dist/es/AutoSizer';\nimport WindowScroller from 'react-virtualized/dist/es/WindowScroller';\n// TODO move back when https://github.com/bvaughn/react-virtualized/pull/1477 is merged and released\nimport {CellMeasurer, CellMeasurerCache} from '@hypnosphi/react-virtualized/dist/es/CellMeasurer';\nimport deprecate from 'util-deprecate';\nimport memoizeOne from 'memoize-one';\n\nimport dataTests from '../global/data-tests';\nimport getUID from '../global/get-uid';\nimport scheduleRAF from '../global/schedule-raf';\nimport memoize from '../global/memoize';\nimport {preventDefault} from '../global/dom';\nimport Shortcuts from '../shortcuts/shortcuts';\n\nimport styles from './list.css';\nimport ListItem from './list__item';\nimport ListCustom from './list__custom';\nimport ListLink from './list__link';\nimport ListTitle from './list__title';\nimport ListSeparator from './list__separator';\nimport ListHint from './list__hint';\n\nconst scheduleScrollListener = scheduleRAF();\nconst scheduleHoverListener = scheduleRAF();\n/**\n * @enum {number}\n */\nconst Type = {\n SEPARATOR: 0,\n LINK: 1,\n ITEM: 2,\n HINT: 3,\n CUSTOM: 4,\n TITLE: 5,\n MARGIN: 6\n};\n\nconst Dimension = {\n ITEM_PADDING: 16,\n ITEM_HEIGHT: 32,\n COMPACT_ITEM_HEIGHT: 24,\n SEPARATOR_HEIGHT: 25,\n SEPARATOR_FIRST_HEIGHT: 16,\n SEPARATOR_TEXT_HEIGHT: 18,\n TITLE_HEIGHT: 42,\n INNER_PADDING: 8,\n MARGIN: 8\n};\n\nconst DEFAULT_ITEM_TYPE = Type.ITEM;\n\nfunction noop() {}\n\nconst warnEmptyKey = deprecate(\n () => {},\n 'No key passed for list item with non-string label. It is considered as a bad practice and has been deprecated, please provide a key.'\n);\n\n/**\n * @param {Type} listItemType\n * @param {Object} item list item\n */\nfunction isItemType(listItemType, item) {\n let type = item.rgItemType;\n if (type == null) {\n type = DEFAULT_ITEM_TYPE;\n }\n return type === listItemType;\n}\n\nconst nonActivatableTypes = [\n Type.SEPARATOR,\n Type.TITLE,\n Type.MARGIN\n];\n\nfunction isActivatable(item) {\n return !nonActivatableTypes.includes(item.rgItemType) && !item.disabled;\n}\n\nconst shouldActivateFirstItem = props => props.activateFirstItem ||\n props.activateSingleItem && props.data.length === 1;\n\n/**\n * @name List\n * @constructor\n * @extends {ReactComponent}\n */\nexport default class List extends Component {\n static propTypes = {\n className: PropTypes.string,\n hint: PropTypes.string,\n hintOnSelection: PropTypes.string,\n data: PropTypes.array,\n maxHeight: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n activeIndex: PropTypes.number,\n restoreActiveIndex: PropTypes.bool,\n activateSingleItem: PropTypes.bool,\n activateFirstItem: PropTypes.bool,\n shortcuts: PropTypes.bool,\n onMouseOut: PropTypes.func,\n onSelect: PropTypes.func,\n onScrollToBottom: PropTypes.func,\n onResize: PropTypes.func,\n useMouseUp: PropTypes.bool,\n visible: PropTypes.bool,\n renderOptimization: PropTypes.bool,\n disableMoveOverflow: PropTypes.bool,\n disableMoveDownOverflow: PropTypes.bool,\n compact: PropTypes.bool,\n disableScrollToActive: PropTypes.bool\n };\n\n static defaultProps = {\n data: [],\n restoreActiveIndex: false, // restore active item using its \"key\" property\n activateSingleItem: false, // if there is only one item, activate it\n activateFirstItem: false, // if there no active items, activate the first one\n onMouseOut: noop,\n onSelect: noop,\n onScrollToBottom: noop,\n onResize: noop,\n shortcuts: false,\n renderOptimization: true,\n disableMoveDownOverflow: false\n };\n\n state = {\n activeIndex: null,\n prevActiveIndex: null,\n prevData: [],\n activeItem: null,\n needScrollToActive: false,\n scrolling: false,\n hasOverflow: false,\n disabledHover: false,\n scrolledToBottom: false\n };\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const {prevActiveIndex, prevData, activeItem} = prevState;\n const {data, activeIndex, restoreActiveIndex} = nextProps;\n const nextState = {prevActiveIndex: activeIndex, prevData: data};\n\n if (data !== prevData) {\n Object.assign(nextState, {\n activeIndex: null,\n activeItem: null\n });\n }\n\n if (activeIndex != null && activeIndex !== prevActiveIndex && data[activeIndex] != null) {\n Object.assign(nextState, {\n activeIndex,\n activeItem: data[activeIndex],\n needScrollToActive: true\n });\n } else if (\n data !== prevData &&\n restoreActiveIndex &&\n activeItem != null &&\n activeItem.key != null\n ) {\n // Restore active index if there is an item with the same \"key\" property\n const index = data.findIndex(item => item.key === activeItem.key);\n if (index >= 0) {\n Object.assign(nextState, {\n activeIndex: index,\n activeItem: data[index]\n });\n }\n }\n\n if (\n activeIndex == null &&\n prevState.activeIndex == null &&\n shouldActivateFirstItem(nextProps)\n ) {\n const firstActivatableIndex = data.findIndex(isActivatable);\n if (firstActivatableIndex >= 0) {\n Object.assign(nextState, {\n activeIndex: firstActivatableIndex,\n activeItem: data[firstActivatableIndex],\n needScrollToActive: true\n });\n }\n }\n\n return nextState;\n }\n\n componentDidMount() {\n document.addEventListener('mousemove', this.onDocumentMouseMove);\n document.addEventListener('keydown', this.onDocumentKeyDown, true);\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n return nextProps !== this.props ||\n Object.keys(nextState).some(key => nextState[key] !== this.state[key]);\n }\n\n componentDidUpdate(prevProps) {\n if (this.virtualizedList && prevProps.data !== this.props.data) {\n this.virtualizedList.recomputeRowHeights();\n }\n\n this.checkOverflow();\n }\n\n componentWillUnmount() {\n this.unmounted = true;\n document.removeEventListener('mousemove', this.onDocumentMouseMove);\n document.removeEventListener('keydown', this.onDocumentKeyDown, true);\n }\n\n static isItemType = isItemType;\n\n static ListHint = ListHint;\n\n static ListProps = {\n Type,\n Dimension\n };\n\n hoverHandler = memoize(index => () =>\n scheduleHoverListener(() => {\n if (this.state.disabledHover) {\n return;\n }\n\n if (this.container) {\n this.setState({\n activeIndex: index,\n activeItem: this.props.data[index],\n needScrollToActive: false\n });\n }\n })\n );\n\n _activatableItems = false;\n\n // eslint-disable-next-line no-magic-numbers\n _bufferSize = 10; // keep X items above and below of the visible area\n // reuse size cache for similar items\n sizeCacheKey = index => {\n if (index === 0 || index === this.props.data.length + 1) {\n return Type.MARGIN;\n }\n\n const item = this.props.data[index - 1];\n const isFirst = index === 1;\n switch (item.rgItemType) {\n case Type.SEPARATOR:\n case Type.TITLE:\n return `${item.rgItemType}${isFirst ? '_first' : ''}${item.description ? '_desc' : ''}`;\n case Type.MARGIN:\n return Type.MARGIN;\n case Type.CUSTOM:\n return `${Type.CUSTOM}_${item.key}`;\n case Type.ITEM:\n case Type.LINK:\n default:\n if (item.details) {\n return `${Type.ITEM}_${item.details}`;\n }\n return Type.ITEM;\n }\n };\n\n _cache = new CellMeasurerCache({\n defaultHeight: this.defaultItemHeight(),\n fixedWidth: true,\n keyMapper: this.sizeCacheKey\n });\n\n _hasActivatableItems = memoizeOne(items => items.some(isActivatable));\n hasActivatableItems() {\n return this._hasActivatableItems(this.props.data);\n }\n\n selectHandler = memoize(index => (event, tryKeepOpen = false) => {\n const item = this.props.data[index];\n if (!this.props.useMouseUp && item.onClick) {\n item.onClick(item, event);\n } else if (this.props.useMouseUp && item.onMouseUp) {\n item.onMouseUp(item, event);\n }\n\n if (this.props.onSelect) {\n this.props.onSelect(item, event, {tryKeepOpen});\n }\n });\n\n upHandler = e => {\n const {data, disableMoveOverflow} = this.props;\n const index = this.state.activeIndex;\n let newIndex;\n\n if (index === null || index === 0) {\n if (!disableMoveOverflow) {\n newIndex = data.length - 1;\n } else {\n return;\n }\n } else {\n newIndex = index - 1;\n }\n\n this.moveHandler(newIndex, this.upHandler, e);\n };\n\n downHandler = e => {\n const {data, disableMoveOverflow, disableMoveDownOverflow} = this.props;\n const index = this.state.activeIndex;\n let newIndex;\n\n if (index === null) {\n newIndex = 0;\n } else if (index + 1 === data.length) {\n if (!disableMoveOverflow && !disableMoveDownOverflow) {\n newIndex = 0;\n } else {\n return;\n }\n } else {\n newIndex = index + 1;\n }\n\n this.moveHandler(newIndex, this.downHandler, e);\n };\n\n homeHandler = e => {\n this.moveHandler(0, this.downHandler, e);\n };\n\n endHandler = e => {\n this.moveHandler(this.props.data.length - 1, this.upHandler, e);\n };\n\n onDocumentMouseMove = () => {\n if (this.state.disabledHover) {\n this.setState({disabledHover: false});\n }\n };\n\n onDocumentKeyDown = e => {\n const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line no-magic-numbers\n if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {\n this.setState({disabledHover: true});\n }\n };\n\n moveHandler(index, retryCallback, e) {\n let correctedIndex;\n if (this.props.data.length === 0 || !this.hasActivatableItems()) {\n return;\n } else if (this.props.data.length < index) {\n correctedIndex = 0;\n } else {\n correctedIndex = index;\n }\n\n const item = this.props.data[correctedIndex];\n this.setState(\n {\n activeIndex: correctedIndex,\n activeItem: item,\n needScrollToActive: true\n },\n function onSet() {\n if (!isActivatable(item)) {\n retryCallback(e);\n return;\n }\n\n if (e.key !== 'Home' && e.key !== 'End') {\n preventDefault(e);\n }\n }\n );\n }\n\n mouseHandler = () => {\n this.setState({scrolling: false});\n };\n\n scrollHandler = () => {\n this.setState({scrolling: true}, this.scrollEndHandler);\n };\n\n enterHandler = (event, shortcut) => {\n if (this.state.activeIndex !== null) {\n const item = this.props.data[this.state.activeIndex];\n this.selectHandler(this.state.activeIndex)(event);\n\n if (item.href && !event.defaultPrevented) {\n if (['command+enter', 'ctrl+enter'].includes(shortcut)) {\n window.open(item.href, '_blank');\n } else if (shortcut === 'shift+enter') {\n window.open(item.href);\n } else {\n window.location.href = item.href;\n }\n }\n return false; // do not propagate event\n } else {\n return true; // propagate event to the parent component (e.g., QueryAssist)\n }\n };\n\n getFirst() {\n return this.props.data.find(\n item => item.rgItemType === Type.ITEM || item.rgItemType === Type.CUSTOM\n );\n }\n\n getSelected() {\n return this.props.data[this.state.activeIndex];\n }\n\n clearSelected = () => {\n this.setState({\n activeIndex: null,\n needScrollToActive: false\n });\n };\n\n defaultItemHeight() {\n return this.props.compact ? Dimension.COMPACT_ITEM_HEIGHT : Dimension.ITEM_HEIGHT;\n }\n\n scrollEndHandler = () => scheduleScrollListener(() => {\n const innerContainer = this.inner;\n if (innerContainer) {\n const maxScrollingPosition = innerContainer.scrollHeight;\n const sensitivity = this.defaultItemHeight() / 2;\n const currentScrollingPosition =\n innerContainer.scrollTop + innerContainer.clientHeight + sensitivity;\n const scrolledToBottom =\n maxScrollingPosition > 0 && currentScrollingPosition >= maxScrollingPosition;\n if (!this.unmounted) {\n this.setState({scrolledToBottom});\n }\n if (scrolledToBottom) {\n this.props.onScrollToBottom();\n }\n }\n });\n\n checkOverflow = () => {\n if (this.inner) {\n this.setState({\n hasOverflow: this.inner.scrollHeight - this.inner.clientHeight > 1\n });\n }\n };\n\n getVisibleListHeight(props) {\n return props.maxHeight - this.defaultItemHeight() - Dimension.INNER_PADDING;\n }\n\n _deprecatedGenerateKeyFromContent(itemProps) {\n const identificator = itemProps.label || itemProps.description;\n const isString = typeof identificator === 'string' || identificator instanceof String;\n if (identificator && !isString) {\n warnEmptyKey();\n `${itemProps.rgItemType}_${JSON.stringify(identificator)}`;\n }\n return `${itemProps.rgItemType}_${identificator}`;\n }\n\n renderItem = ({index, style, isScrolling, parent, key}) => {\n let itemKey;\n let el;\n\n const realIndex = index - 1;\n\n const item = this.props.data[realIndex];\n\n // top and bottom margins\n if (index === 0 || index === this.props.data.length + 1 || item.rgItemType === Type.MARGIN) {\n itemKey = key || `${Type.MARGIN}_${index}`;\n el = ;\n } else {\n\n // Hack around SelectNG implementation\n const {selectedLabel, originalModel, ...cleanedProps} = item;\n const itemProps = Object.assign({rgItemType: DEFAULT_ITEM_TYPE}, cleanedProps);\n\n if (itemProps.url) {\n itemProps.href = itemProps.url;\n }\n if (itemProps.href) {\n itemProps.rgItemType = Type.LINK;\n }\n\n itemKey = key || itemProps.key || this._deprecatedGenerateKeyFromContent(itemProps);\n\n itemProps.hover = (realIndex === this.state.activeIndex);\n if (itemProps.hoverClassName != null && itemProps.hover) {\n itemProps.className = classNames(itemProps.className, itemProps.hoverClassName);\n }\n itemProps.onMouseOver = this.hoverHandler(realIndex);\n itemProps.tabIndex = -1;\n itemProps.scrolling = isScrolling;\n\n const selectHandler = this.selectHandler(realIndex);\n\n if (this.props.useMouseUp) {\n itemProps.onMouseUp = selectHandler;\n } else {\n itemProps.onClick = selectHandler;\n }\n itemProps.onCheckboxChange = event => selectHandler(event, true);\n\n if (itemProps.compact == null) {\n itemProps.compact = this.props.compact;\n }\n\n let ItemComponent;\n const isFirst = index === 1;\n switch (itemProps.rgItemType) {\n case Type.SEPARATOR:\n ItemComponent = ListSeparator;\n itemProps.isFirst = isFirst;\n break;\n case Type.LINK:\n ItemComponent = ListLink;\n this.addItemDataTestToProp(itemProps);\n break;\n case Type.ITEM:\n ItemComponent = ListItem;\n this.addItemDataTestToProp(itemProps);\n break;\n case Type.CUSTOM:\n ItemComponent = ListCustom;\n this.addItemDataTestToProp(itemProps);\n break;\n case Type.TITLE:\n itemProps.isFirst = isFirst;\n ItemComponent = ListTitle;\n break;\n default:\n throw new Error(`Unknown menu element type: ${itemProps.rgItemType}`);\n }\n\n el = ;\n }\n\n return parent ? (\n \n {({registerChild}) => (\n
\n );\n\n\n // Cache the value because this method is called\n // inside `render` function which can be called N times\n // and should be fast as possible.\n // Cache invalidates each time hidden or userDefinedMaxHeight changes\n _adjustListMaxHeight = memoizeOne((hidden, userDefinedMaxHeight) => {\n if (hidden) {\n return userDefinedMaxHeight;\n }\n\n // Calculate list's maximum height that can't\n // get beyond the screen\n // @see RG-1838, JT-48358\n const minMaxHeight = 100;\n const directions = this.props.directions || DEFAULT_DIRECTIONS;\n\n // Note:\n // 1. Create a method which'll be called only when the popup opens and before\n // render the list would be a better way\n // 2. We use this.popup.getContainer because there is the logic about how to extract\n // a link on the container node. It looks awkward using popup in this component\n // maybe we can find a better solution\n const anchorNode = this.props.anchorElement;\n const containerNode = document.documentElement; // A temporary fix for RG-2050. To be made permanent if working\n return Math.min(\n directions.reduce((maxHeight, direction) => (\n Math.max(maxHeight, maxHeightForDirection(direction, anchorNode, containerNode))\n ), minMaxHeight),\n userDefinedMaxHeight\n );\n });\n\n popupRef = el => {\n this.popup = el;\n };\n\n listRef = el => {\n this.list = el;\n };\n\n filterRef = el => {\n this.filter = el;\n this.caret = new Caret(this.filter);\n };\n\n shortcutsScope = getUID('select-popup-');\n shortcutsMap = {\n tab: this.tabPress\n };\n\n popupFilterShortcuts = {\n map: {\n up: event => (this.list && this.list.upHandler(event)),\n down: event => (this.list && this.list.downHandler(event)),\n home: event => (this.list && this.list.homeHandler(event)),\n end: event => (this.list && this.list.endHandler(event)),\n enter: event => (this.list\n ? this.list.enterHandler(event)\n : this.props.onEmptyPopupEnter(event)),\n esc: event => this.props.onCloseAttempt(event, true),\n tab: event => this.tabPress(event),\n backspace: event => this.handleBackspace(event),\n del: () => this.removeSelectedTag(),\n left: () => this.handleNavigation(true),\n right: () => this.handleNavigation()\n }\n };\n\n render() {\n const classes = classNames(styles.popup, this.props.className);\n\n return (\n \n
\n {!this.props.hidden && this.props.filter &&\n (\n \n )\n }\n {/* Add empty div to prevent the change of List position in DOM*/}\n {this.props.hidden ? : this.getFilterWithTags()}\n {this.props.multiple &&\n !this.props.multiple.limit &&\n this.props.multiple.selectAll &&\n this.getSelectAll()\n }\n {this.getList()}\n {this.getBottomLine()}\n {this.props.toolbar}\n
\n \n );\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport getUID from '../global/get-uid';\n\nimport Shortcuts from './shortcuts';\n\nexport default function shortcutsHOC(ComposedComponent) {\n\n return class WithShortcuts extends React.Component {\n static propTypes = {\n rgShortcutsOptions: PropTypes.object,\n rgShortcutsMap: PropTypes.object\n };\n\n _shortcutsScopeUid = getUID('rg-shortcuts-');\n\n render() {\n const {rgShortcutsOptions, rgShortcutsMap, ...props} = this.props;\n\n return (\n \n \n \n );\n }\n };\n}\n","import React, {Component, Fragment} from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport chevronDownIcon from '@jetbrains/icons/chevron-10px.svg';\nimport closeIcon from '@jetbrains/icons/close.svg';\n\nimport {Anchor} from '../dropdown/dropdown';\nimport Avatar, {Size as AvatarSize} from '../avatar/avatar';\nimport Popup from '../popup/popup';\nimport List from '../list/list';\nimport Input, {Size} from '../input/input';\nimport Shortcuts from '../shortcuts/shortcuts';\nimport Button from '../button/button';\nimport buttonStyles from '../button/button.css';\nimport getUID from '../global/get-uid';\nimport rerenderHOC from '../global/rerender-hoc';\nimport fuzzyHighlight from '../global/fuzzy-highlight';\nimport Theme, {ThemeContext} from '../global/theme';\nimport memoize from '../global/memoize';\nimport getEventKey from '../global/get-event-key';\n\nimport SelectPopup from './select__popup';\nimport styles from './select.css';\n\n/**\n * @name Select\n */\n\nfunction noop() {}\n\n/**\n * @enum {number}\n */\nconst Type = {\n BUTTON: 'BUTTON',\n INPUT: 'INPUT',\n CUSTOM: 'CUSTOM',\n INLINE: 'INLINE',\n MATERIAL: 'MATERIAL',\n INPUT_WITHOUT_CONTROLS: 'INPUT_WITHOUT_CONTROLS'\n};\n\nconst ICON_WIDTH = 20;\nconst getStyle = memoize(iconsLength => ({\n paddingRight: iconsLength * ICON_WIDTH\n}));\n\nconst isInputMode = type => type === Type.INPUT || type === Type.INPUT_WITHOUT_CONTROLS;\n\nfunction getLowerCaseLabel(item) {\n if (\n List.isItemType(List.ListProps.Type.SEPARATOR, item) ||\n List.isItemType(List.ListProps.Type.HINT, item) ||\n item.label == null\n ) {\n return null;\n }\n\n return item.label.toLowerCase();\n}\n\nfunction doesLabelMatch(itemToCheck, fn) {\n const lowerCaseLabel = getLowerCaseLabel(itemToCheck);\n\n if (lowerCaseLabel == null) {\n return true;\n }\n\n return fn(lowerCaseLabel);\n}\n\nfunction getFilterFn(filter) {\n if (filter.fn) {\n return filter.fn;\n }\n\n if (filter.fuzzy) {\n return (itemToCheck, checkString) =>\n doesLabelMatch(itemToCheck, lowerCaseLabel =>\n fuzzyHighlight(checkString, lowerCaseLabel).matched\n );\n }\n\n return (itemToCheck, checkString) =>\n doesLabelMatch(itemToCheck, lowerCaseLabel =>\n lowerCaseLabel.indexOf(checkString) >= 0\n );\n}\n\nconst buildMultipleMap = selected => Object.fromEntries(selected.map(({key}) => [key, true]));\n\nfunction getListItems(props, state, rawFilterString, data = props.data) {\n let filterString = rawFilterString.trim();\n\n if (isInputMode(props.type) && state.selected && filterString === state.selected.label) {\n filterString = ''; // ignore multiple if it is exactly the selected item\n }\n const lowerCaseString = filterString.toLowerCase();\n\n const filteredData = [];\n let exactMatch = false;\n\n const check = getFilterFn(props.filter);\n\n for (let i = 0; i < data.length; i++) {\n const item = {...data[i]};\n if (check(item, lowerCaseString, data)) {\n exactMatch = (item.label === filterString);\n\n if (props.multiple && !props.multiple.removeSelectedItems) {\n item.checkbox = !!state.multipleMap[item.key];\n }\n\n if (\n props.multiple &&\n props.multiple.limit\n ) {\n item.disabled = props.multiple.limit === state.selected.length &&\n !state.selected.find(selectedItem => selectedItem.key === item.key);\n }\n\n // Ignore item if it's multiple and is already selected\n if (\n !(props.multiple &&\n props.multiple.removeSelectedItems &&\n state.multipleMap[item.key])\n ) {\n filteredData.push(item);\n }\n }\n }\n\n let addButton = null;\n const {add} = props;\n if (\n (add && filterString && !exactMatch) ||\n (add && add.alwaysVisible)\n ) {\n if (!(add.regexp && !add.regexp.test(filterString)) &&\n !(add.minlength && filterString.length < +add.minlength) ||\n add.alwaysVisible) {\n\n addButton = {\n prefix: add.prefix,\n label: add.label || filterString,\n delayed: add.hasOwnProperty('delayed') ? add.delayed : true\n };\n }\n }\n\n return {filteredData, addButton};\n}\n\nfunction getSelectedIndex(selected, data, multiple) {\n const firstSelected = multiple ? selected[0] : selected;\n if (firstSelected == null) {\n return null;\n }\n\n for (let i = 0; i < data.length; i++) {\n const item = data[i];\n\n if (item.key === undefined) {\n continue;\n }\n\n if (item.key === firstSelected.key) {\n return i;\n }\n }\n\n return null;\n}\n\nconst getItemLabel = ({selectedLabel, label}) => (selectedLabel != null ? selectedLabel : label);\n\nconst getValueForFilter = (selected, type, filterValue) =>\n (selected && isInputMode(type) ? getItemLabel(selected) : filterValue);\n\nfunction isSameSelected(prevSelected, selected) {\n if (!prevSelected || !selected || prevSelected.length !== selected.length) {\n return false;\n }\n\n const keysMap = selected.reduce((result, item) => {\n result[item.key] = true;\n return result;\n }, {});\n\n return prevSelected.every(it => keysMap[it.key]);\n}\n\n/**\n * @name Select\n * @constructor\n * @extends {Component}\n */\nexport default class Select extends Component {\n static _getEmptyValue(multiple) {\n return multiple ? [] : null;\n }\n\n static propTypes = {\n className: PropTypes.string,\n id: PropTypes.string,\n multiple: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),\n allowAny: PropTypes.bool,\n filter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),\n\n getInitial: PropTypes.func,\n onClose: PropTypes.func,\n onOpen: PropTypes.func,\n onDone: PropTypes.func,\n onFilter: PropTypes.func,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n onLoadMore: PropTypes.func,\n onAdd: PropTypes.func,\n onBeforeOpen: PropTypes.func,\n onSelect: PropTypes.func,\n onDeselect: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onKeyDown: PropTypes.func,\n\n selected: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n data: PropTypes.array,\n tags: PropTypes.object,\n targetElement: PropTypes.object,\n loading: PropTypes.bool,\n loadingMessage: PropTypes.string,\n notFoundMessage: PropTypes.string,\n maxHeight: PropTypes.number,\n minWidth: PropTypes.number,\n directions: PropTypes.array,\n popupClassName: PropTypes.string,\n popupStyle: PropTypes.object,\n top: PropTypes.number,\n left: PropTypes.number,\n renderOptimization: PropTypes.bool,\n ringPopupTarget: PropTypes.string,\n hint: List.ListHint.propTypes.label,\n add: PropTypes.object,\n type: PropTypes.oneOf(Object.values(Type)),\n disabled: PropTypes.bool,\n hideSelected: PropTypes.bool,\n label: PropTypes.string,\n selectedLabel: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n inputPlaceholder: PropTypes.string,\n clear: PropTypes.bool,\n hideArrow: PropTypes.bool,\n compact: PropTypes.bool,\n size: PropTypes.oneOf(Object.values(Size)),\n theme: PropTypes.string,\n customAnchor: PropTypes.func,\n disableMoveOverflow: PropTypes.bool,\n disableScrollToActive: PropTypes.bool,\n dir: PropTypes.oneOf(['ltr', 'rtl'])\n };\n\n static defaultProps = {\n data: [],\n filter: false, // enable filter (not in INPUT modes)\n multiple: false, // multiple can be an object - see demo for more information\n clear: false, // enable clear button that clears the \"selected\" state\n loading: false, // show a loading indicator while data is loading\n disabled: false, // disable select\n\n loadingMessage: 'Loading...',\n notFoundMessage: 'No options found',\n\n type: Type.MATERIAL,\n size: Size.M,\n targetElement: null, // element to bind the popup to (select BUTTON or INPUT by default)\n hideSelected: false, // INPUT mode: clears the input after an option is selected (useful when the selection is displayed in some custom way elsewhere)\n allowAny: false, // INPUT mode: allows any value to be entered, hides the dropdown icon\n hideArrow: false, // hide dropdown arrow icon\n\n maxHeight: 600, // height of the options list, including the filter and the 'Add' button\n directions: [\n Popup.PopupProps.Directions.BOTTOM_RIGHT,\n Popup.PopupProps.Directions.BOTTOM_LEFT,\n Popup.PopupProps.Directions.TOP_LEFT,\n Popup.PopupProps.Directions.TOP_RIGHT\n ],\n\n selected: null, // current selection (item / array of items)\n\n label: '', // BUTTON or INPUT label (nothing selected)\n selectedLabel: '', // BUTTON or INPUT label (something selected)\n inputPlaceholder: '', // Placeholder for input modes\n hint: null, // hint text to display under the list\n\n shortcutsEnabled: false,\n\n onBeforeOpen: noop,\n onLoadMore: noop,\n onOpen: noop,\n onClose: noop,\n onFilter: noop, // search string as first argument\n onFocus: noop,\n onBlur: noop,\n onKeyDown: noop,\n\n onSelect: noop, // single + multi\n onDeselect: noop, // multi\n onChange: noop, // multi\n\n onAdd: noop, // search string as first argument\n\n onDone: noop,\n onReset: noop,\n\n tags: null,\n onRemoveTag: noop,\n ringPopupTarget: null,\n dir: 'ltr'\n };\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const {multiple, data, type} = nextProps;\n const {prevSelected, prevData, prevMultiple, filterValue} = prevState;\n const nextState = {prevData: data, prevSelected: nextProps.selected, prevMultiple: multiple};\n\n if ('data' in nextProps && data !== prevData) {\n const {filteredData, addButton} = getListItems(nextProps, prevState, filterValue, data);\n Object.assign(nextState, {shownData: filteredData, addButton});\n\n if (prevState.selected) {\n Object.assign(nextState, {\n selectedIndex: getSelectedIndex(\n prevState.selected,\n data,\n multiple,\n ),\n prevFilterValue: getValueForFilter(prevState.selected, type, filterValue)\n });\n }\n }\n\n if ('selected' in nextProps && nextProps.selected !== prevSelected) {\n const selected = nextProps.selected || Select._getEmptyValue(multiple);\n\n const selectedIndex = getSelectedIndex(\n selected,\n data || prevData,\n multiple,\n );\n\n Object.assign(nextState, {\n selected,\n prevFilterValue: getValueForFilter(selected, type, filterValue)\n });\n\n if (!multiple || !isSameSelected(prevSelected, selected)) {\n Object.assign(nextState, {selectedIndex});\n }\n }\n\n if (prevMultiple !== multiple) {\n nextState.selected = Select._getEmptyValue(multiple);\n }\n\n const {selected} = {...prevState, ...nextState};\n if (selected && multiple) {\n nextState.multipleMap = buildMultipleMap(selected);\n }\n\n return nextState;\n }\n\n state = {\n data: [],\n shownData: [],\n selected: (this.props.multiple ? [] : null),\n selectedIndex: null,\n filterValue: this.props.filter && this.props.filter.value || '',\n shortcutsEnabled: false,\n popupShortcuts: false,\n showPopup: false,\n prevData: this.props.data,\n prevSelected: null,\n prevMultiple: this.props.multiple,\n multipleMap: {},\n addButton: null\n };\n\n componentDidUpdate(prevProps, prevState) {\n const {showPopup, selected} = this.state;\n const {onClose, onOpen, onChange, multiple} = this.props;\n\n if (prevState.showPopup && !showPopup) {\n onClose(selected);\n } else if (!prevState.showPopup && showPopup) {\n onOpen();\n }\n\n if (multiple !== prevProps.multiple) {\n onChange(selected);\n }\n }\n\n static Type = Type;\n static Size = Size;\n static Theme = Theme;\n\n shortcutsScope = getUID('select-');\n _focusHandler = () => {\n this.props.onFocus();\n\n this.setState({\n shortcutsEnabled: true,\n focused: true\n });\n };\n\n _blurHandler = () => {\n this.props.onBlur();\n\n if (this._popup && this._popup.isVisible() && !this._popup.isClickingPopup) {\n window.setTimeout(() => {\n this.setState({showPopup: false});\n });\n }\n\n if (!this._popup.isClickingPopup) {\n this.setState({\n shortcutsEnabled: false,\n focused: false\n });\n }\n };\n\n nodeRef = el => {\n this.node = el;\n };\n\n _popup = null;\n\n onEmptyPopupEnter = () => {\n if (this.state.addButton) {\n this.addHandler();\n }\n };\n\n _onEnter = () => {\n if (this.state.addButton && this.state.shownData.length === 0) {\n this.addHandler();\n }\n\n this.props.onDone();\n\n if (!this._popup.isVisible() && this.props.allowAny) {\n return true;\n }\n\n return undefined;\n };\n\n _onEsc = event => {\n if (!this._popup.isVisible()) {\n return true;\n } else if (this.props.multiple || !this.props.getInitial) {\n return false;\n }\n\n const selected = {\n key: Math.random(),\n label: this.props.getInitial()\n };\n\n this.setState({\n selected,\n filterValue: this.getValueForFilter(selected)\n }, () => {\n this.props.onChange(selected, event);\n this.props.onReset();\n });\n\n return undefined;\n };\n\n _inputShortcutHandler = () => {\n if (this.state.focused && this._popup && !this._popup.isVisible()) {\n this._clickHandler();\n }\n };\n\n getValueForFilter(selected) {\n return getValueForFilter(selected, this.props.type, this.state.filterValue);\n }\n\n _getSelectedIndex(selected, data) {\n return getSelectedIndex(selected, data, this.props.multiple);\n }\n\n popupRef = el => {\n this._popup = el;\n };\n\n _getResetOption() {\n const isOptionsSelected = this.state.selected && this.state.selected.length;\n const hasTagsResetProp = this.props.tags && this.props.tags.reset;\n if (!isOptionsSelected || !hasTagsResetProp) {\n return null;\n }\n\n const {reset} = this.props.tags;\n return {\n isResetItem: true,\n separator: reset.separator,\n key: reset.label,\n rgItemType: List.ListProps.Type.ITEM,\n label: reset.label,\n glyph: reset.glyph,\n className: 'ring-select__clear-tags',\n onClick: (item, event) => {\n this.clear(event);\n this.clearFilter();\n this.props.onFilter('');\n this.setState(prevState => ({\n shownData: prevState.shownData.slice(reset.separator ? 2 : 1),\n multipleMap: {}\n }));\n this._redrawPopup();\n }\n };\n }\n\n _prependResetOption(shownData) {\n const resetOption = this._getResetOption();\n const margin = {rgItemType: List.ListProps.Type.MARGIN};\n if (resetOption) {\n const resetItems = [margin, resetOption, margin];\n if (resetOption.separator) {\n resetItems.push({\n rgItemType: List.ListProps.Type.SEPARATOR\n });\n }\n return resetItems.concat(shownData);\n }\n return shownData;\n }\n\n _renderPopup() {\n const anchorElement = this.props.targetElement || this.node;\n const {showPopup, shownData} = this.state;\n const _shownData = this._prependResetOption(shownData);\n let message = null;\n\n if (this.props.loading) {\n message = this.props.loadingMessage;\n } else if (!shownData.length) {\n message = this.props.notFoundMessage;\n }\n\n return (\n \n );\n }\n\n _showPopup() {\n if (!this.node) {\n return;\n }\n\n const shownData = this.getListItems(this.filterValue());\n this.setState({\n showPopup: !!shownData.length || !this.props.allowAny,\n shownData\n });\n }\n\n _hidePopup(tryFocusAnchor) {\n if (this.node && this.state.showPopup) {\n this.setState({\n showPopup: false,\n filterValue: ''\n });\n\n if (tryFocusAnchor) {\n const restoreFocusNode = this.props.targetElement ||\n this.node.query('[data-test~=ring-select__focus]');\n if (restoreFocusNode) {\n restoreFocusNode.focus();\n }\n }\n }\n }\n\n addHandler = () => {\n const value = this.filterValue();\n this._hidePopup();\n this.props.onAdd(value);\n };\n\n getToolbar() {\n const {hint} = this.props;\n const {prefix, label, delayed} = this.state.addButton || {};\n const isToolbarHasElements = this.state.addButton || hint;\n if (!isToolbarHasElements) {\n return null;\n }\n\n return (\n