. ' + 'Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs');\n\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return /*#__PURE__*/cloneElement(element, {\n ref: newRef\n });\n } else {\n return /*#__PURE__*/cloneElement(element, {\n ref: function ref(node) {\n setRef(previousRef, node);\n setRef(newRef, node);\n }\n });\n }\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nexport function isRef(obj) {\n return (// eslint-disable-next-line no-prototype-builtins\n obj !== null && _typeof(obj) === 'object' && Object.prototype.hasOwnProperty.call(obj, 'current')\n );\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction shallowEqual(objA, objB, compare, compareContext) {\n var compareResult = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (compareResult !== void 0) {\n return !!compareResult;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (_typeof(objA) !== 'object' || !objA || _typeof(objB) !== 'object' || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); // Test for A's keys different from B.\n\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n compareResult = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (compareResult === false || compareResult === void 0 && valueA !== valueB) {\n return false;\n }\n }\n\n return true;\n}\n\nexport { shallowEqual };","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { wrapConnectorHooks } from './wrapConnectorHooks';\nimport { isRef } from './isRef';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nexport var SourceConnector = /*#__PURE__*/function () {\n // The drop target may either be attached via ref or connect function\n // The drag preview may either be attached via ref or connect function\n function SourceConnector(backend) {\n var _this = this;\n\n _classCallCheck(this, SourceConnector);\n\n _defineProperty(this, \"hooks\", wrapConnectorHooks({\n dragSource: function dragSource(node, options) {\n _this.clearDragSource();\n\n _this.dragSourceOptions = options || null;\n\n if (isRef(node)) {\n _this.dragSourceRef = node;\n } else {\n _this.dragSourceNode = node;\n }\n\n _this.reconnectDragSource();\n },\n dragPreview: function dragPreview(node, options) {\n _this.clearDragPreview();\n\n _this.dragPreviewOptions = options || null;\n\n if (isRef(node)) {\n _this.dragPreviewRef = node;\n } else {\n _this.dragPreviewNode = node;\n }\n\n _this.reconnectDragPreview();\n }\n }));\n\n _defineProperty(this, \"handlerId\", null);\n\n _defineProperty(this, \"dragSourceRef\", null);\n\n _defineProperty(this, \"dragSourceNode\", void 0);\n\n _defineProperty(this, \"dragSourceOptionsInternal\", null);\n\n _defineProperty(this, \"dragSourceUnsubscribe\", void 0);\n\n _defineProperty(this, \"dragPreviewRef\", null);\n\n _defineProperty(this, \"dragPreviewNode\", void 0);\n\n _defineProperty(this, \"dragPreviewOptionsInternal\", null);\n\n _defineProperty(this, \"dragPreviewUnsubscribe\", void 0);\n\n _defineProperty(this, \"lastConnectedHandlerId\", null);\n\n _defineProperty(this, \"lastConnectedDragSource\", null);\n\n _defineProperty(this, \"lastConnectedDragSourceOptions\", null);\n\n _defineProperty(this, \"lastConnectedDragPreview\", null);\n\n _defineProperty(this, \"lastConnectedDragPreviewOptions\", null);\n\n _defineProperty(this, \"backend\", void 0);\n\n this.backend = backend;\n }\n\n _createClass(SourceConnector, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(newHandlerId) {\n if (this.handlerId === newHandlerId) {\n return;\n }\n\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n }, {\n key: \"connectTarget\",\n get: function get() {\n return this.dragSource;\n }\n }, {\n key: \"dragSourceOptions\",\n get: function get() {\n return this.dragSourceOptionsInternal;\n },\n set: function set(options) {\n this.dragSourceOptionsInternal = options;\n }\n }, {\n key: \"dragPreviewOptions\",\n get: function get() {\n return this.dragPreviewOptionsInternal;\n },\n set: function set(options) {\n this.dragPreviewOptionsInternal = options;\n }\n }, {\n key: \"reconnect\",\n value: function reconnect() {\n this.reconnectDragSource();\n this.reconnectDragPreview();\n }\n }, {\n key: \"reconnectDragSource\",\n value: function reconnectDragSource() {\n var dragSource = this.dragSource; // if nothing has changed then don't resubscribe\n\n var didChange = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();\n\n if (didChange) {\n this.disconnectDragSource();\n }\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dragSource) {\n this.lastConnectedDragSource = dragSource;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragSource = dragSource;\n this.lastConnectedDragSourceOptions = this.dragSourceOptions;\n this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, dragSource, this.dragSourceOptions);\n }\n }\n }, {\n key: \"reconnectDragPreview\",\n value: function reconnectDragPreview() {\n var dragPreview = this.dragPreview; // if nothing has changed then don't resubscribe\n\n var didChange = this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();\n\n if (didChange) {\n this.disconnectDragPreview();\n }\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dragPreview) {\n this.lastConnectedDragPreview = dragPreview;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragPreview = dragPreview;\n this.lastConnectedDragPreviewOptions = this.dragPreviewOptions;\n this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, dragPreview, this.dragPreviewOptions);\n }\n }\n }, {\n key: \"didHandlerIdChange\",\n value: function didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n }, {\n key: \"didConnectedDragSourceChange\",\n value: function didConnectedDragSourceChange() {\n return this.lastConnectedDragSource !== this.dragSource;\n }\n }, {\n key: \"didConnectedDragPreviewChange\",\n value: function didConnectedDragPreviewChange() {\n return this.lastConnectedDragPreview !== this.dragPreview;\n }\n }, {\n key: \"didDragSourceOptionsChange\",\n value: function didDragSourceOptionsChange() {\n return !shallowEqual(this.lastConnectedDragSourceOptions, this.dragSourceOptions);\n }\n }, {\n key: \"didDragPreviewOptionsChange\",\n value: function didDragPreviewOptionsChange() {\n return !shallowEqual(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);\n }\n }, {\n key: \"disconnectDragSource\",\n value: function disconnectDragSource() {\n if (this.dragSourceUnsubscribe) {\n this.dragSourceUnsubscribe();\n this.dragSourceUnsubscribe = undefined;\n }\n }\n }, {\n key: \"disconnectDragPreview\",\n value: function disconnectDragPreview() {\n if (this.dragPreviewUnsubscribe) {\n this.dragPreviewUnsubscribe();\n this.dragPreviewUnsubscribe = undefined;\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n }\n }, {\n key: \"dragSource\",\n get: function get() {\n return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;\n }\n }, {\n key: \"dragPreview\",\n get: function get() {\n return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;\n }\n }, {\n key: \"clearDragSource\",\n value: function clearDragSource() {\n this.dragSourceNode = null;\n this.dragSourceRef = null;\n }\n }, {\n key: \"clearDragPreview\",\n value: function clearDragPreview() {\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n }]);\n\n return SourceConnector;\n}();","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { invariant } from '@react-dnd/invariant';\nvar isCallingCanDrag = false;\nvar isCallingIsDragging = false;\nexport var DragSourceMonitorImpl = /*#__PURE__*/function () {\n function DragSourceMonitorImpl(manager) {\n _classCallCheck(this, DragSourceMonitorImpl);\n\n _defineProperty(this, \"internalMonitor\", void 0);\n\n _defineProperty(this, \"sourceId\", null);\n\n this.internalMonitor = manager.getMonitor();\n }\n\n _createClass(DragSourceMonitorImpl, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(sourceId) {\n this.sourceId = sourceId;\n }\n }, {\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.sourceId;\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n invariant(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n\n try {\n isCallingCanDrag = true;\n return this.internalMonitor.canDragSource(this.sourceId);\n } finally {\n isCallingCanDrag = false;\n }\n }\n }, {\n key: \"isDragging\",\n value: function isDragging() {\n if (!this.sourceId) {\n return false;\n }\n\n invariant(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n\n try {\n isCallingIsDragging = true;\n return this.internalMonitor.isDraggingSource(this.sourceId);\n } finally {\n isCallingIsDragging = false;\n }\n }\n }, {\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n }, {\n key: \"isDraggingSource\",\n value: function isDraggingSource(sourceId) {\n return this.internalMonitor.isDraggingSource(sourceId);\n }\n }, {\n key: \"isOverTarget\",\n value: function isOverTarget(targetId, options) {\n return this.internalMonitor.isOverTarget(targetId, options);\n }\n }, {\n key: \"getTargetIds\",\n value: function getTargetIds() {\n return this.internalMonitor.getTargetIds();\n }\n }, {\n key: \"isSourcePublic\",\n value: function isSourcePublic() {\n return this.internalMonitor.isSourcePublic();\n }\n }, {\n key: \"getSourceId\",\n value: function getSourceId() {\n return this.internalMonitor.getSourceId();\n }\n }, {\n key: \"subscribeToOffsetChange\",\n value: function subscribeToOffsetChange(listener) {\n return this.internalMonitor.subscribeToOffsetChange(listener);\n }\n }, {\n key: \"canDragSource\",\n value: function canDragSource(sourceId) {\n return this.internalMonitor.canDragSource(sourceId);\n }\n }, {\n key: \"canDropOnTarget\",\n value: function canDropOnTarget(targetId) {\n return this.internalMonitor.canDropOnTarget(targetId);\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.internalMonitor.getItemType();\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.internalMonitor.getItem();\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.internalMonitor.didDrop();\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n }]);\n\n return DragSourceMonitorImpl;\n}();","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nexport function getDecoratedComponent(instanceRef) {\n var currentRef = instanceRef.current;\n\n if (currentRef == null) {\n return null;\n } else if (currentRef.decoratedRef) {\n // go through the private field in decorateHandler to avoid the invariant hit\n return currentRef.decoratedRef.current;\n } else {\n return currentRef;\n }\n}\nexport function isClassComponent(Component) {\n return Component && Component.prototype && typeof Component.prototype.render === 'function';\n}\nexport function isRefForwardingComponent(C) {\n var _item$$$typeof;\n\n var item = C;\n return (item === null || item === void 0 ? void 0 : (_item$$$typeof = item.$$typeof) === null || _item$$$typeof === void 0 ? void 0 : _item$$$typeof.toString()) === 'Symbol(react.forward_ref)';\n}\nexport function isRefable(C) {\n return isClassComponent(C) || isRefForwardingComponent(C);\n}\nexport function checkDecoratorArguments(functionName, signature) {\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i++) {\n var arg = i + 2 < 2 || arguments.length <= i + 2 ? undefined : arguments[i + 2];\n\n if (arg && arg.prototype && arg.prototype.render) {\n // eslint-disable-next-line no-console\n console.error('You seem to be applying the arguments in the wrong order. ' + \"It should be \".concat(functionName, \"(\").concat(signature, \")(Component), not the other way around. \") + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#you-seem-to-be-applying-the-arguments-in-the-wrong-order');\n return;\n }\n }\n }\n}\nexport function isFunction(input) {\n return typeof input === 'function';\n}\nexport function noop() {// noop\n}\n\nfunction isObjectLike(input) {\n return _typeof(input) === 'object' && input !== null;\n}\n\nexport function isPlainObject(input) {\n if (!isObjectLike(input)) {\n return false;\n }\n\n if (Object.getPrototypeOf(input) === null) {\n return true;\n }\n\n var proto = input;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(input) === proto;\n}\nexport function isValidType(type, allowArray) {\n return typeof type === 'string' || _typeof(type) === 'symbol' || !!allowArray && Array.isArray(type) && type.every(function (t) {\n return isValidType(t, false);\n });\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { isFunction, noop } from './utils';\n/**\n * Provides a set of static methods for creating Disposables.\n * @param {Function} action Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n */\n\nexport var Disposable = /*#__PURE__*/function () {\n function Disposable(action) {\n _classCallCheck(this, Disposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"action\", void 0);\n\n this.action = isFunction(action) ? action : noop;\n }\n /** Performs the task of cleaning up resources. */\n\n\n _createClass(Disposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.action();\n this.isDisposed = true;\n }\n }\n }], [{\n key: \"isDisposable\",\n value:\n /**\n * Gets the disposable that does nothing when disposed.\n */\n\n /**\n * Validates whether the given object is a disposable\n * @param {Object} Object to test whether it has a dispose method\n * @returns {Boolean} true if a disposable object, else false.\n */\n function isDisposable(d) {\n return Boolean(d && isFunction(d.dispose));\n }\n }, {\n key: \"_fixup\",\n value: function _fixup(result) {\n return Disposable.isDisposable(result) ? result : Disposable.empty;\n }\n /**\n * Creates a disposable object that invokes the specified action when disposed.\n * @param {Function} dispose Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n * @return {Disposable} The disposable object that runs the given action upon disposal.\n */\n\n }, {\n key: \"create\",\n value: function create(action) {\n return new Disposable(action);\n }\n }]);\n\n return Disposable;\n}();\n/**\n * Represents a group of disposable resources that are disposed together.\n * @constructor\n */\n\n_defineProperty(Disposable, \"empty\", {\n dispose: noop\n});\n\nexport var CompositeDisposable = /*#__PURE__*/function () {\n function CompositeDisposable() {\n _classCallCheck(this, CompositeDisposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"disposables\", void 0);\n\n for (var _len = arguments.length, disposables = new Array(_len), _key = 0; _key < _len; _key++) {\n disposables[_key] = arguments[_key];\n }\n\n this.disposables = disposables;\n }\n /**\n * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.\n * @param {Any} item Disposable to add.\n */\n\n\n _createClass(CompositeDisposable, [{\n key: \"add\",\n value: function add(item) {\n if (this.isDisposed) {\n item.dispose();\n } else {\n this.disposables.push(item);\n }\n }\n /**\n * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.\n * @param {Any} item Disposable to remove.\n * @returns {Boolean} true if found; false otherwise.\n */\n\n }, {\n key: \"remove\",\n value: function remove(item) {\n var shouldDispose = false;\n\n if (!this.isDisposed) {\n var idx = this.disposables.indexOf(item);\n\n if (idx !== -1) {\n shouldDispose = true;\n this.disposables.splice(idx, 1);\n item.dispose();\n }\n }\n\n return shouldDispose;\n }\n /**\n * Disposes all disposables in the group and removes them from the group but\n * does not dispose the CompositeDisposable.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n if (!this.isDisposed) {\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i = 0; _i < len; _i++) {\n currentDisposables[_i].dispose();\n }\n }\n }\n /**\n * Disposes all disposables in the group and removes them from the group.\n */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i2 = 0; _i2 < len; _i2++) {\n currentDisposables[_i2].dispose();\n }\n }\n }\n }]);\n\n return CompositeDisposable;\n}();\n/**\n * Represents a disposable resource whose underlying disposable resource can\n * be replaced by another disposable resource, causing automatic disposal of\n * the previous underlying disposable resource.\n */\n\nexport var SerialDisposable = /*#__PURE__*/function () {\n function SerialDisposable() {\n _classCallCheck(this, SerialDisposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"current\", void 0);\n }\n\n _createClass(SerialDisposable, [{\n key: \"getDisposable\",\n value:\n /**\n * Gets the underlying disposable.\n * @returns {Any} the underlying disposable.\n */\n function getDisposable() {\n return this.current;\n }\n }, {\n key: \"setDisposable\",\n value: function setDisposable(value) {\n var shouldDispose = this.isDisposed;\n\n if (!shouldDispose) {\n var old = this.current;\n this.current = value;\n\n if (old) {\n old.dispose();\n }\n }\n\n if (shouldDispose && value) {\n value.dispose();\n }\n }\n /** Performs the task of cleaning up resources. */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var old = this.current;\n this.current = undefined;\n\n if (old) {\n old.dispose();\n }\n }\n }\n }]);\n\n return SerialDisposable;\n}();","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createRef, Component } from 'react';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { invariant } from '@react-dnd/invariant';\nimport { DndContext } from '../core';\nimport { isPlainObject } from './utils';\nimport { Disposable, CompositeDisposable, SerialDisposable } from './disposables';\nimport { isRefable } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\nexport function decorateHandler(_ref) {\n var DecoratedComponent = _ref.DecoratedComponent,\n createHandler = _ref.createHandler,\n createMonitor = _ref.createMonitor,\n createConnector = _ref.createConnector,\n registerHandler = _ref.registerHandler,\n containerDisplayName = _ref.containerDisplayName,\n getType = _ref.getType,\n collect = _ref.collect,\n options = _ref.options;\n var _options$arePropsEqua = options.arePropsEqual,\n arePropsEqual = _options$arePropsEqua === void 0 ? shallowEqual : _options$arePropsEqua;\n var Decorated = DecoratedComponent;\n var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';\n\n var DragDropContainer = /*#__PURE__*/function (_Component) {\n _inherits(DragDropContainer, _Component);\n\n var _super = _createSuper(DragDropContainer);\n\n function DragDropContainer(props) {\n var _this;\n\n _classCallCheck(this, DragDropContainer);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"decoratedRef\", /*#__PURE__*/createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"handlerId\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"manager\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handlerMonitor\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handlerConnector\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handler\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"disposable\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"currentType\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function () {\n var nextState = _this.getCurrentState();\n\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n });\n\n _this.disposable = new SerialDisposable();\n\n _this.receiveProps(props);\n\n _this.dispose();\n\n return _this;\n }\n\n _createClass(DragDropContainer, [{\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.handlerId;\n }\n }, {\n key: \"getDecoratedComponentInstance\",\n value: function getDecoratedComponentInstance() {\n invariant(this.decoratedRef.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');\n return this.decoratedRef.current;\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !arePropsEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.disposable = new SerialDisposable();\n this.currentType = undefined;\n this.receiveProps(this.props);\n this.handleChange();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!arePropsEqual(this.props, prevProps)) {\n this.receiveProps(this.props);\n this.handleChange();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.dispose();\n }\n }, {\n key: \"receiveProps\",\n value: function receiveProps(props) {\n if (!this.handler) {\n return;\n }\n\n this.handler.receiveProps(props);\n this.receiveType(getType(props));\n }\n }, {\n key: \"receiveType\",\n value: function receiveType(type) {\n if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {\n return;\n }\n\n if (type === this.currentType) {\n return;\n }\n\n this.currentType = type;\n\n var _registerHandler = registerHandler(type, this.handler, this.manager),\n _registerHandler2 = _slicedToArray(_registerHandler, 2),\n handlerId = _registerHandler2[0],\n unregister = _registerHandler2[1];\n\n this.handlerId = handlerId;\n this.handlerMonitor.receiveHandlerId(handlerId);\n this.handlerConnector.receiveHandlerId(handlerId);\n var globalMonitor = this.manager.getMonitor();\n var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, {\n handlerIds: [handlerId]\n });\n this.disposable.setDisposable(new CompositeDisposable(new Disposable(unsubscribe), new Disposable(unregister)));\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.disposable.dispose();\n\n if (this.handlerConnector) {\n this.handlerConnector.receiveHandlerId(null);\n }\n }\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n if (!this.handlerConnector) {\n return {};\n }\n\n var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor, this.props);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(isPlainObject(nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);\n }\n\n return nextState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return _jsx(DndContext.Consumer, {\n children: function children(_ref2) {\n var dragDropManager = _ref2.dragDropManager;\n\n _this2.receiveDragDropManager(dragDropManager);\n\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(function () {\n var _this2$handlerConnect;\n\n return (_this2$handlerConnect = _this2.handlerConnector) === null || _this2$handlerConnect === void 0 ? void 0 : _this2$handlerConnect.reconnect();\n });\n }\n\n return _jsx(Decorated, Object.assign({}, _this2.props, _this2.getCurrentState(), {\n // NOTE: if Decorated is a Function Component, decoratedRef will not be populated unless it's a refforwarding component.\n ref: isRefable(Decorated) ? _this2.decoratedRef : null\n }), void 0);\n }\n }, void 0);\n }\n }, {\n key: \"receiveDragDropManager\",\n value: function receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n\n invariant(dragDropManager !== undefined, 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to render a DndProvider component in your top-level component. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);\n\n if (dragDropManager === undefined) {\n return;\n }\n\n this.manager = dragDropManager;\n this.handlerMonitor = createMonitor(dragDropManager);\n this.handlerConnector = createConnector(dragDropManager.getBackend());\n this.handler = createHandler(this.handlerMonitor, this.decoratedRef);\n }\n }]);\n\n return DragDropContainer;\n }(Component);\n\n _defineProperty(DragDropContainer, \"DecoratedComponent\", DecoratedComponent);\n\n _defineProperty(DragDropContainer, \"displayName\", \"\".concat(containerDisplayName, \"(\").concat(displayName, \")\"));\n\n return hoistStatics(DragDropContainer, DecoratedComponent);\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { invariant } from '@react-dnd/invariant';\nimport { isPlainObject, getDecoratedComponent } from './utils';\nvar ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];\nvar REQUIRED_SPEC_METHODS = ['beginDrag'];\n\nvar SourceImpl = /*#__PURE__*/function () {\n function SourceImpl(spec, monitor, ref) {\n var _this = this;\n\n _classCallCheck(this, SourceImpl);\n\n _defineProperty(this, \"props\", null);\n\n _defineProperty(this, \"spec\", void 0);\n\n _defineProperty(this, \"monitor\", void 0);\n\n _defineProperty(this, \"ref\", void 0);\n\n _defineProperty(this, \"beginDrag\", function () {\n if (!_this.props) {\n return;\n }\n\n var item = _this.spec.beginDrag(_this.props, _this.monitor, _this.ref.current);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(isPlainObject(item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', item);\n }\n\n return item;\n });\n\n this.spec = spec;\n this.monitor = monitor;\n this.ref = ref;\n }\n\n _createClass(SourceImpl, [{\n key: \"receiveProps\",\n value: function receiveProps(props) {\n this.props = props;\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n if (!this.props) {\n return false;\n }\n\n if (!this.spec.canDrag) {\n return true;\n }\n\n return this.spec.canDrag(this.props, this.monitor);\n }\n }, {\n key: \"isDragging\",\n value: function isDragging(globalMonitor, sourceId) {\n if (!this.props) {\n return false;\n }\n\n if (!this.spec.isDragging) {\n return sourceId === globalMonitor.getSourceId();\n }\n\n return this.spec.isDragging(this.props, this.monitor);\n }\n }, {\n key: \"endDrag\",\n value: function endDrag() {\n if (!this.props) {\n return;\n }\n\n if (!this.spec.endDrag) {\n return;\n }\n\n this.spec.endDrag(this.props, this.monitor, getDecoratedComponent(this.ref));\n }\n }]);\n\n return SourceImpl;\n}();\n\nexport function createSourceFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected \"%s\" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);\n });\n REQUIRED_SPEC_METHODS.forEach(function (key) {\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);\n });\n return function createSource(monitor, ref) {\n return new SourceImpl(spec, monitor, ref);\n };\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { invariant } from '@react-dnd/invariant';\nvar isCallingCanDrop = false;\nexport var DropTargetMonitorImpl = /*#__PURE__*/function () {\n function DropTargetMonitorImpl(manager) {\n _classCallCheck(this, DropTargetMonitorImpl);\n\n _defineProperty(this, \"internalMonitor\", void 0);\n\n _defineProperty(this, \"targetId\", null);\n\n this.internalMonitor = manager.getMonitor();\n }\n\n _createClass(DropTargetMonitorImpl, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(targetId) {\n this.targetId = targetId;\n }\n }, {\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.targetId;\n }\n }, {\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n // Cut out early if the target id has not been set. This should prevent errors\n // where the user has an older version of dnd-core like in\n // https://github.com/react-dnd/react-dnd/issues/1310\n if (!this.targetId) {\n return false;\n }\n\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor');\n\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n } finally {\n isCallingCanDrop = false;\n }\n }\n }, {\n key: \"isOver\",\n value: function isOver(options) {\n if (!this.targetId) {\n return false;\n }\n\n return this.internalMonitor.isOverTarget(this.targetId, options);\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.internalMonitor.getItemType();\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.internalMonitor.getItem();\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.internalMonitor.didDrop();\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n }]);\n\n return DropTargetMonitorImpl;\n}();","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { wrapConnectorHooks } from './wrapConnectorHooks';\nimport { isRef } from './isRef';\nexport var TargetConnector = /*#__PURE__*/function () {\n // The drop target may either be attached via ref or connect function\n function TargetConnector(backend) {\n var _this = this;\n\n _classCallCheck(this, TargetConnector);\n\n _defineProperty(this, \"hooks\", wrapConnectorHooks({\n dropTarget: function dropTarget(node, options) {\n _this.clearDropTarget();\n\n _this.dropTargetOptions = options;\n\n if (isRef(node)) {\n _this.dropTargetRef = node;\n } else {\n _this.dropTargetNode = node;\n }\n\n _this.reconnect();\n }\n }));\n\n _defineProperty(this, \"handlerId\", null);\n\n _defineProperty(this, \"dropTargetRef\", null);\n\n _defineProperty(this, \"dropTargetNode\", void 0);\n\n _defineProperty(this, \"dropTargetOptionsInternal\", null);\n\n _defineProperty(this, \"unsubscribeDropTarget\", void 0);\n\n _defineProperty(this, \"lastConnectedHandlerId\", null);\n\n _defineProperty(this, \"lastConnectedDropTarget\", null);\n\n _defineProperty(this, \"lastConnectedDropTargetOptions\", null);\n\n _defineProperty(this, \"backend\", void 0);\n\n this.backend = backend;\n }\n\n _createClass(TargetConnector, [{\n key: \"connectTarget\",\n get: function get() {\n return this.dropTarget;\n }\n }, {\n key: \"reconnect\",\n value: function reconnect() {\n // if nothing has changed then don't resubscribe\n var didChange = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();\n\n if (didChange) {\n this.disconnectDropTarget();\n }\n\n var dropTarget = this.dropTarget;\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dropTarget) {\n this.lastConnectedDropTarget = dropTarget;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDropTarget = dropTarget;\n this.lastConnectedDropTargetOptions = this.dropTargetOptions;\n this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, dropTarget, this.dropTargetOptions);\n }\n }\n }, {\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(newHandlerId) {\n if (newHandlerId === this.handlerId) {\n return;\n }\n\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n }, {\n key: \"dropTargetOptions\",\n get: function get() {\n return this.dropTargetOptionsInternal;\n },\n set: function set(options) {\n this.dropTargetOptionsInternal = options;\n }\n }, {\n key: \"didHandlerIdChange\",\n value: function didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n }, {\n key: \"didDropTargetChange\",\n value: function didDropTargetChange() {\n return this.lastConnectedDropTarget !== this.dropTarget;\n }\n }, {\n key: \"didOptionsChange\",\n value: function didOptionsChange() {\n return !shallowEqual(this.lastConnectedDropTargetOptions, this.dropTargetOptions);\n }\n }, {\n key: \"disconnectDropTarget\",\n value: function disconnectDropTarget() {\n if (this.unsubscribeDropTarget) {\n this.unsubscribeDropTarget();\n this.unsubscribeDropTarget = undefined;\n }\n }\n }, {\n key: \"dropTarget\",\n get: function get() {\n return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;\n }\n }, {\n key: \"clearDropTarget\",\n value: function clearDropTarget() {\n this.dropTargetRef = null;\n this.dropTargetNode = null;\n }\n }]);\n\n return TargetConnector;\n}();","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { invariant } from '@react-dnd/invariant';\nimport { isPlainObject, getDecoratedComponent } from './utils';\nvar ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];\n\nvar TargetImpl = /*#__PURE__*/function () {\n function TargetImpl(spec, monitor, ref) {\n _classCallCheck(this, TargetImpl);\n\n _defineProperty(this, \"props\", null);\n\n _defineProperty(this, \"spec\", void 0);\n\n _defineProperty(this, \"monitor\", void 0);\n\n _defineProperty(this, \"ref\", void 0);\n\n this.spec = spec;\n this.monitor = monitor;\n this.ref = ref;\n }\n\n _createClass(TargetImpl, [{\n key: \"receiveProps\",\n value: function receiveProps(props) {\n this.props = props;\n }\n }, {\n key: \"receiveMonitor\",\n value: function receiveMonitor(monitor) {\n this.monitor = monitor;\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n if (!this.spec.canDrop) {\n return true;\n }\n\n return this.spec.canDrop(this.props, this.monitor);\n }\n }, {\n key: \"hover\",\n value: function hover() {\n if (!this.spec.hover || !this.props) {\n return;\n }\n\n this.spec.hover(this.props, this.monitor, getDecoratedComponent(this.ref));\n }\n }, {\n key: \"drop\",\n value: function drop() {\n if (!this.spec.drop) {\n return undefined;\n }\n\n var dropResult = this.spec.drop(this.props, this.monitor, this.ref.current);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(typeof dropResult === 'undefined' || isPlainObject(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', dropResult);\n }\n\n return dropResult;\n }\n }]);\n\n return TargetImpl;\n}();\n\nexport function createTargetFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected \"%s\" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', key, key, spec[key]);\n });\n return function createTarget(monitor, ref) {\n return new TargetImpl(spec, monitor, ref);\n };\n}","import { invariant } from '@react-dnd/invariant';\nimport { TargetConnector, DropTargetMonitorImpl, registerTarget } from '../internals';\nimport { isPlainObject, isValidType } from './utils';\nimport { checkDecoratorArguments } from './utils';\nimport { decorateHandler } from './decorateHandler';\nimport { createTargetFactory } from './createTargetFactory';\n/**\n * @param type The accepted target type\n * @param spec The DropTarget specification\n * @param collect The props collector function\n * @param options Options\n */\n\nexport function DropTarget(type, spec, collect) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n checkDecoratorArguments('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n\n if (typeof type !== 'function') {\n invariant(isValidType(type, true), 'Expected \"type\" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', type);\n\n getType = function getType() {\n return type;\n };\n }\n\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', spec);\n var createTarget = createTargetFactory(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n return function decorateTarget(DecoratedComponent) {\n return decorateHandler({\n containerDisplayName: 'DropTarget',\n createHandler: createTarget,\n registerHandler: registerTarget,\n createMonitor: function createMonitor(manager) {\n return new DropTargetMonitorImpl(manager);\n },\n createConnector: function createConnector(backend) {\n return new TargetConnector(backend);\n },\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options\n });\n };\n}","// cheap lodash replacements\nexport function memoize(fn) {\n var result = null;\n\n var memoized = function memoized() {\n if (result == null) {\n result = fn();\n }\n\n return result;\n };\n\n return memoized;\n}\n/**\n * drop-in replacement for _.without\n */\n\nexport function without(items, item) {\n return items.filter(function (i) {\n return i !== item;\n });\n}\nexport function union(itemsA, itemsB) {\n var set = new Set();\n\n var insertItem = function insertItem(item) {\n return set.add(item);\n };\n\n itemsA.forEach(insertItem);\n itemsB.forEach(insertItem);\n var result = [];\n set.forEach(function (key) {\n return result.push(key);\n });\n return result;\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { union, without } from './utils/js_utils';\nexport var EnterLeaveCounter = /*#__PURE__*/function () {\n function EnterLeaveCounter(isNodeInDocument) {\n _classCallCheck(this, EnterLeaveCounter);\n\n _defineProperty(this, \"entered\", []);\n\n _defineProperty(this, \"isNodeInDocument\", void 0);\n\n this.isNodeInDocument = isNodeInDocument;\n }\n\n _createClass(EnterLeaveCounter, [{\n key: \"enter\",\n value: function enter(enteringNode) {\n var _this = this;\n\n var previousLength = this.entered.length;\n\n var isNodeEntered = function isNodeEntered(node) {\n return _this.isNodeInDocument(node) && (!node.contains || node.contains(enteringNode));\n };\n\n this.entered = union(this.entered.filter(isNodeEntered), [enteringNode]);\n return previousLength === 0 && this.entered.length > 0;\n }\n }, {\n key: \"leave\",\n value: function leave(leavingNode) {\n var previousLength = this.entered.length;\n this.entered = without(this.entered.filter(this.isNodeInDocument), leavingNode);\n return previousLength > 0 && this.entered.length === 0;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.entered = [];\n }\n }]);\n\n return EnterLeaveCounter;\n}();","import { memoize } from './utils/js_utils';\nexport var isFirefox = memoize(function () {\n return /firefox/i.test(navigator.userAgent);\n});\nexport var isSafari = memoize(function () {\n return Boolean(window.safari);\n});","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nexport var MonotonicInterpolant = /*#__PURE__*/function () {\n function MonotonicInterpolant(xs, ys) {\n _classCallCheck(this, MonotonicInterpolant);\n\n _defineProperty(this, \"xs\", void 0);\n\n _defineProperty(this, \"ys\", void 0);\n\n _defineProperty(this, \"c1s\", void 0);\n\n _defineProperty(this, \"c2s\", void 0);\n\n _defineProperty(this, \"c3s\", void 0);\n\n var length = xs.length; // Rearrange xs and ys so that xs is sorted\n\n var indexes = [];\n\n for (var i = 0; i < length; i++) {\n indexes.push(i);\n }\n\n indexes.sort(function (a, b) {\n return xs[a] < xs[b] ? -1 : 1;\n }); // Get consecutive differences and slopes\n\n var dys = [];\n var dxs = [];\n var ms = [];\n var dx;\n var dy;\n\n for (var _i = 0; _i < length - 1; _i++) {\n dx = xs[_i + 1] - xs[_i];\n dy = ys[_i + 1] - ys[_i];\n dxs.push(dx);\n dys.push(dy);\n ms.push(dy / dx);\n } // Get degree-1 coefficients\n\n\n var c1s = [ms[0]];\n\n for (var _i2 = 0; _i2 < dxs.length - 1; _i2++) {\n var m2 = ms[_i2];\n var mNext = ms[_i2 + 1];\n\n if (m2 * mNext <= 0) {\n c1s.push(0);\n } else {\n dx = dxs[_i2];\n var dxNext = dxs[_i2 + 1];\n var common = dx + dxNext;\n c1s.push(3 * common / ((common + dxNext) / m2 + (common + dx) / mNext));\n }\n }\n\n c1s.push(ms[ms.length - 1]); // Get degree-2 and degree-3 coefficients\n\n var c2s = [];\n var c3s = [];\n var m;\n\n for (var _i3 = 0; _i3 < c1s.length - 1; _i3++) {\n m = ms[_i3];\n var c1 = c1s[_i3];\n var invDx = 1 / dxs[_i3];\n\n var _common = c1 + c1s[_i3 + 1] - m - m;\n\n c2s.push((m - c1 - _common) * invDx);\n c3s.push(_common * invDx * invDx);\n }\n\n this.xs = xs;\n this.ys = ys;\n this.c1s = c1s;\n this.c2s = c2s;\n this.c3s = c3s;\n }\n\n _createClass(MonotonicInterpolant, [{\n key: \"interpolate\",\n value: function interpolate(x) {\n var xs = this.xs,\n ys = this.ys,\n c1s = this.c1s,\n c2s = this.c2s,\n c3s = this.c3s; // The rightmost point in the dataset should give an exact result\n\n var i = xs.length - 1;\n\n if (x === xs[i]) {\n return ys[i];\n } // Search for the interval x is in, returning the corresponding y if x is one of the original xs\n\n\n var low = 0;\n var high = c3s.length - 1;\n var mid;\n\n while (low <= high) {\n mid = Math.floor(0.5 * (low + high));\n var xHere = xs[mid];\n\n if (xHere < x) {\n low = mid + 1;\n } else if (xHere > x) {\n high = mid - 1;\n } else {\n return ys[mid];\n }\n }\n\n i = Math.max(0, high); // Interpolate\n\n var diff = x - xs[i];\n var diffSq = diff * diff;\n return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;\n }\n }]);\n\n return MonotonicInterpolant;\n}();","import { isSafari, isFirefox } from './BrowserDetector';\nimport { MonotonicInterpolant } from './MonotonicInterpolant';\nvar ELEMENT_NODE = 1;\nexport function getNodeClientOffset(node) {\n var el = node.nodeType === ELEMENT_NODE ? node : node.parentElement;\n\n if (!el) {\n return null;\n }\n\n var _el$getBoundingClient = el.getBoundingClientRect(),\n top = _el$getBoundingClient.top,\n left = _el$getBoundingClient.left;\n\n return {\n x: left,\n y: top\n };\n}\nexport function getEventClientOffset(e) {\n return {\n x: e.clientX,\n y: e.clientY\n };\n}\n\nfunction isImageNode(node) {\n var _document$documentEle;\n\n return node.nodeName === 'IMG' && (isFirefox() || !((_document$documentEle = document.documentElement) !== null && _document$documentEle !== void 0 && _document$documentEle.contains(node)));\n}\n\nfunction getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight) {\n var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth;\n var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight; // Work around @2x coordinate discrepancies in browsers\n\n if (isSafari() && isImage) {\n dragPreviewHeight /= window.devicePixelRatio;\n dragPreviewWidth /= window.devicePixelRatio;\n }\n\n return {\n dragPreviewWidth: dragPreviewWidth,\n dragPreviewHeight: dragPreviewHeight\n };\n}\n\nexport function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint) {\n // The browsers will use the image intrinsic size under different conditions.\n // Firefox only cares if it's an image, but WebKit also wants it to be detached.\n var isImage = isImageNode(dragPreview);\n var dragPreviewNode = isImage ? sourceNode : dragPreview;\n var dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode);\n var offsetFromDragPreview = {\n x: clientOffset.x - dragPreviewNodeOffsetFromClient.x,\n y: clientOffset.y - dragPreviewNodeOffsetFromClient.y\n };\n var sourceWidth = sourceNode.offsetWidth,\n sourceHeight = sourceNode.offsetHeight;\n var anchorX = anchorPoint.anchorX,\n anchorY = anchorPoint.anchorY;\n\n var _getDragPreviewSize = getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight),\n dragPreviewWidth = _getDragPreviewSize.dragPreviewWidth,\n dragPreviewHeight = _getDragPreviewSize.dragPreviewHeight;\n\n var calculateYOffset = function calculateYOffset() {\n var interpolantY = new MonotonicInterpolant([0, 0.5, 1], [// Dock to the top\n offsetFromDragPreview.y, // Align at the center\n offsetFromDragPreview.y / sourceHeight * dragPreviewHeight, // Dock to the bottom\n offsetFromDragPreview.y + dragPreviewHeight - sourceHeight]);\n var y = interpolantY.interpolate(anchorY); // Work around Safari 8 positioning bug\n\n if (isSafari() && isImage) {\n // We'll have to wait for @3x to see if this is entirely correct\n y += (window.devicePixelRatio - 1) * dragPreviewHeight;\n }\n\n return y;\n };\n\n var calculateXOffset = function calculateXOffset() {\n // Interpolate coordinates depending on anchor point\n // If you know a simpler way to do this, let me know\n var interpolantX = new MonotonicInterpolant([0, 0.5, 1], [// Dock to the left\n offsetFromDragPreview.x, // Align at the center\n offsetFromDragPreview.x / sourceWidth * dragPreviewWidth, // Dock to the right\n offsetFromDragPreview.x + dragPreviewWidth - sourceWidth]);\n return interpolantX.interpolate(anchorX);\n }; // Force offsets if specified in the options.\n\n\n var offsetX = offsetPoint.offsetX,\n offsetY = offsetPoint.offsetY;\n var isManualOffsetX = offsetX === 0 || offsetX;\n var isManualOffsetY = offsetY === 0 || offsetY;\n return {\n x: isManualOffsetX ? offsetX : calculateXOffset(),\n y: isManualOffsetY ? offsetY : calculateYOffset()\n };\n}","export var FILE = '__NATIVE_FILE__';\nexport var URL = '__NATIVE_URL__';\nexport var TEXT = '__NATIVE_TEXT__';\nexport var HTML = '__NATIVE_HTML__';","var _nativeTypesConfig;\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport * as NativeTypes from '../NativeTypes';\nimport { getDataFromDataTransfer } from './getDataFromDataTransfer';\nexport var nativeTypesConfig = (_nativeTypesConfig = {}, _defineProperty(_nativeTypesConfig, NativeTypes.FILE, {\n exposeProperties: {\n files: function files(dataTransfer) {\n return Array.prototype.slice.call(dataTransfer.files);\n },\n items: function items(dataTransfer) {\n return dataTransfer.items;\n },\n dataTransfer: function dataTransfer(_dataTransfer) {\n return _dataTransfer;\n }\n },\n matchesTypes: ['Files']\n}), _defineProperty(_nativeTypesConfig, NativeTypes.HTML, {\n exposeProperties: {\n html: function html(dataTransfer, matchesTypes) {\n return getDataFromDataTransfer(dataTransfer, matchesTypes, '');\n },\n dataTransfer: function dataTransfer(_dataTransfer2) {\n return _dataTransfer2;\n }\n },\n matchesTypes: ['Html', 'text/html']\n}), _defineProperty(_nativeTypesConfig, NativeTypes.URL, {\n exposeProperties: {\n urls: function urls(dataTransfer, matchesTypes) {\n return getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\\n');\n },\n dataTransfer: function dataTransfer(_dataTransfer3) {\n return _dataTransfer3;\n }\n },\n matchesTypes: ['Url', 'text/uri-list']\n}), _defineProperty(_nativeTypesConfig, NativeTypes.TEXT, {\n exposeProperties: {\n text: function text(dataTransfer, matchesTypes) {\n return getDataFromDataTransfer(dataTransfer, matchesTypes, '');\n },\n dataTransfer: function dataTransfer(_dataTransfer4) {\n return _dataTransfer4;\n }\n },\n matchesTypes: ['Text', 'text/plain']\n}), _nativeTypesConfig);","export function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) {\n var result = typesToTry.reduce(function (resultSoFar, typeToTry) {\n return resultSoFar || dataTransfer.getData(typeToTry);\n }, '');\n return result != null ? result : defaultValue;\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nexport var NativeDragSource = /*#__PURE__*/function () {\n function NativeDragSource(config) {\n _classCallCheck(this, NativeDragSource);\n\n _defineProperty(this, \"item\", void 0);\n\n _defineProperty(this, \"config\", void 0);\n\n this.config = config;\n this.item = {};\n this.initializeExposedProperties();\n }\n\n _createClass(NativeDragSource, [{\n key: \"initializeExposedProperties\",\n value: function initializeExposedProperties() {\n var _this = this;\n\n Object.keys(this.config.exposeProperties).forEach(function (property) {\n Object.defineProperty(_this.item, property, {\n configurable: true,\n enumerable: true,\n get: function get() {\n // eslint-disable-next-line no-console\n console.warn(\"Browser doesn't allow reading \\\"\".concat(property, \"\\\" until the drop event.\"));\n return null;\n }\n });\n });\n }\n }, {\n key: \"loadDataTransfer\",\n value: function loadDataTransfer(dataTransfer) {\n var _this2 = this;\n\n if (dataTransfer) {\n var newProperties = {};\n Object.keys(this.config.exposeProperties).forEach(function (property) {\n newProperties[property] = {\n value: _this2.config.exposeProperties[property](dataTransfer, _this2.config.matchesTypes),\n configurable: true,\n enumerable: true\n };\n });\n Object.defineProperties(this.item, newProperties);\n }\n }\n }, {\n key: \"canDrag\",\n value: function canDrag() {\n return true;\n }\n }, {\n key: \"beginDrag\",\n value: function beginDrag() {\n return this.item;\n }\n }, {\n key: \"isDragging\",\n value: function isDragging(monitor, handle) {\n return handle === monitor.getSourceId();\n }\n }, {\n key: \"endDrag\",\n value: function endDrag() {// empty\n }\n }]);\n\n return NativeDragSource;\n}();","import { nativeTypesConfig } from './nativeTypesConfig';\nimport { NativeDragSource } from './NativeDragSource';\nexport function createNativeDragSource(type, dataTransfer) {\n var result = new NativeDragSource(nativeTypesConfig[type]);\n result.loadDataTransfer(dataTransfer);\n return result;\n}\nexport function matchNativeItemType(dataTransfer) {\n if (!dataTransfer) {\n return null;\n }\n\n var dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []);\n return Object.keys(nativeTypesConfig).filter(function (nativeItemType) {\n var matchesTypes = nativeTypesConfig[nativeItemType].matchesTypes;\n return matchesTypes.some(function (t) {\n return dataTransferTypes.indexOf(t) > -1;\n });\n })[0] || null;\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nexport var OptionsReader = /*#__PURE__*/function () {\n function OptionsReader(globalContext, options) {\n _classCallCheck(this, OptionsReader);\n\n _defineProperty(this, \"ownerDocument\", null);\n\n _defineProperty(this, \"globalContext\", void 0);\n\n _defineProperty(this, \"optionsArgs\", void 0);\n\n this.globalContext = globalContext;\n this.optionsArgs = options;\n }\n\n _createClass(OptionsReader, [{\n key: \"window\",\n get: function get() {\n if (this.globalContext) {\n return this.globalContext;\n } else if (typeof window !== 'undefined') {\n return window;\n }\n\n return undefined;\n }\n }, {\n key: \"document\",\n get: function get() {\n var _this$globalContext;\n\n if ((_this$globalContext = this.globalContext) !== null && _this$globalContext !== void 0 && _this$globalContext.document) {\n return this.globalContext.document;\n } else if (this.window) {\n return this.window.document;\n } else {\n return undefined;\n }\n }\n }, {\n key: \"rootElement\",\n get: function get() {\n var _this$optionsArgs;\n\n return ((_this$optionsArgs = this.optionsArgs) === null || _this$optionsArgs === void 0 ? void 0 : _this$optionsArgs.rootElement) || this.window;\n }\n }]);\n\n return OptionsReader;\n}();","function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { EnterLeaveCounter } from './EnterLeaveCounter';\nimport { getNodeClientOffset, getEventClientOffset, getDragPreviewOffset } from './OffsetUtils';\nimport { createNativeDragSource, matchNativeItemType } from './NativeDragSources';\nimport * as NativeTypes from './NativeTypes';\nimport { OptionsReader } from './OptionsReader';\nexport var HTML5BackendImpl = /*#__PURE__*/function () {\n // React-Dnd Components\n // Internal State\n function HTML5BackendImpl(manager, globalContext, options) {\n var _this = this;\n\n _classCallCheck(this, HTML5BackendImpl);\n\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"actions\", void 0);\n\n _defineProperty(this, \"monitor\", void 0);\n\n _defineProperty(this, \"registry\", void 0);\n\n _defineProperty(this, \"enterLeaveCounter\", void 0);\n\n _defineProperty(this, \"sourcePreviewNodes\", new Map());\n\n _defineProperty(this, \"sourcePreviewNodeOptions\", new Map());\n\n _defineProperty(this, \"sourceNodes\", new Map());\n\n _defineProperty(this, \"sourceNodeOptions\", new Map());\n\n _defineProperty(this, \"dragStartSourceIds\", null);\n\n _defineProperty(this, \"dropTargetIds\", []);\n\n _defineProperty(this, \"dragEnterTargetIds\", []);\n\n _defineProperty(this, \"currentNativeSource\", null);\n\n _defineProperty(this, \"currentNativeHandle\", null);\n\n _defineProperty(this, \"currentDragSourceNode\", null);\n\n _defineProperty(this, \"altKeyPressed\", false);\n\n _defineProperty(this, \"mouseMoveTimeoutTimer\", null);\n\n _defineProperty(this, \"asyncEndDragFrameId\", null);\n\n _defineProperty(this, \"dragOverTargetIds\", null);\n\n _defineProperty(this, \"lastClientOffset\", null);\n\n _defineProperty(this, \"hoverRafId\", null);\n\n _defineProperty(this, \"getSourceClientOffset\", function (sourceId) {\n var source = _this.sourceNodes.get(sourceId);\n\n return source && getNodeClientOffset(source) || null;\n });\n\n _defineProperty(this, \"endDragNativeItem\", function () {\n if (!_this.isDraggingNativeItem()) {\n return;\n }\n\n _this.actions.endDrag();\n\n if (_this.currentNativeHandle) {\n _this.registry.removeSource(_this.currentNativeHandle);\n }\n\n _this.currentNativeHandle = null;\n _this.currentNativeSource = null;\n });\n\n _defineProperty(this, \"isNodeInDocument\", function (node) {\n // Check the node either in the main document or in the current context\n return Boolean(node && _this.document && _this.document.body && _this.document.body.contains(node));\n });\n\n _defineProperty(this, \"endDragIfSourceWasRemovedFromDOM\", function () {\n var node = _this.currentDragSourceNode;\n\n if (node == null || _this.isNodeInDocument(node)) {\n return;\n }\n\n if (_this.clearCurrentDragSourceNode() && _this.monitor.isDragging()) {\n _this.actions.endDrag();\n }\n });\n\n _defineProperty(this, \"handleTopDragStartCapture\", function () {\n _this.clearCurrentDragSourceNode();\n\n _this.dragStartSourceIds = [];\n });\n\n _defineProperty(this, \"handleTopDragStart\", function (e) {\n if (e.defaultPrevented) {\n return;\n }\n\n var dragStartSourceIds = _this.dragStartSourceIds;\n _this.dragStartSourceIds = null;\n var clientOffset = getEventClientOffset(e); // Avoid crashing if we missed a drop event or our previous drag died\n\n if (_this.monitor.isDragging()) {\n _this.actions.endDrag();\n } // Don't publish the source just yet (see why below)\n\n\n _this.actions.beginDrag(dragStartSourceIds || [], {\n publishSource: false,\n getSourceClientOffset: _this.getSourceClientOffset,\n clientOffset: clientOffset\n });\n\n var dataTransfer = e.dataTransfer;\n var nativeType = matchNativeItemType(dataTransfer);\n\n if (_this.monitor.isDragging()) {\n if (dataTransfer && typeof dataTransfer.setDragImage === 'function') {\n // Use custom drag image if user specifies it.\n // If child drag source refuses drag but parent agrees,\n // use parent's node as drag image. Neither works in IE though.\n var sourceId = _this.monitor.getSourceId();\n\n var sourceNode = _this.sourceNodes.get(sourceId);\n\n var dragPreview = _this.sourcePreviewNodes.get(sourceId) || sourceNode;\n\n if (dragPreview) {\n var _this$getCurrentSourc = _this.getCurrentSourcePreviewNodeOptions(),\n anchorX = _this$getCurrentSourc.anchorX,\n anchorY = _this$getCurrentSourc.anchorY,\n offsetX = _this$getCurrentSourc.offsetX,\n offsetY = _this$getCurrentSourc.offsetY;\n\n var anchorPoint = {\n anchorX: anchorX,\n anchorY: anchorY\n };\n var offsetPoint = {\n offsetX: offsetX,\n offsetY: offsetY\n };\n var dragPreviewOffset = getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint);\n dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);\n }\n }\n\n try {\n // Firefox won't drag without setting data\n dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.setData('application/json', {});\n } catch (err) {// IE doesn't support MIME types in setData\n } // Store drag source node so we can check whether\n // it is removed from DOM and trigger endDrag manually.\n\n\n _this.setCurrentDragSourceNode(e.target); // Now we are ready to publish the drag source.. or are we not?\n\n\n var _this$getCurrentSourc2 = _this.getCurrentSourcePreviewNodeOptions(),\n captureDraggingState = _this$getCurrentSourc2.captureDraggingState;\n\n if (!captureDraggingState) {\n // Usually we want to publish it in the next tick so that browser\n // is able to screenshot the current (not yet dragging) state.\n //\n // It also neatly avoids a situation where render() returns null\n // in the same tick for the source element, and browser freaks out.\n setTimeout(function () {\n return _this.actions.publishDragSource();\n }, 0);\n } else {\n // In some cases the user may want to override this behavior, e.g.\n // to work around IE not supporting custom drag previews.\n //\n // When using a custom drag layer, the only way to prevent\n // the default drag preview from drawing in IE is to screenshot\n // the dragging state in which the node itself has zero opacity\n // and height. In this case, though, returning null from render()\n // will abruptly end the dragging, which is not obvious.\n //\n // This is the reason such behavior is strictly opt-in.\n _this.actions.publishDragSource();\n }\n } else if (nativeType) {\n // A native item (such as URL) dragged from inside the document\n _this.beginDragNativeItem(nativeType);\n } else if (dataTransfer && !dataTransfer.types && (e.target && !e.target.hasAttribute || !e.target.hasAttribute('draggable'))) {\n // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.\n // Just let it drag. It's a native type (URL or text) and will be picked up in\n // dragenter handler.\n return;\n } else {\n // If by this time no drag source reacted, tell browser not to drag.\n e.preventDefault();\n }\n });\n\n _defineProperty(this, \"handleTopDragEndCapture\", function () {\n if (_this.clearCurrentDragSourceNode() && _this.monitor.isDragging()) {\n // Firefox can dispatch this event in an infinite loop\n // if dragend handler does something like showing an alert.\n // Only proceed if we have not handled it already.\n _this.actions.endDrag();\n }\n });\n\n _defineProperty(this, \"handleTopDragEnterCapture\", function (e) {\n _this.dragEnterTargetIds = [];\n\n var isFirstEnter = _this.enterLeaveCounter.enter(e.target);\n\n if (!isFirstEnter || _this.monitor.isDragging()) {\n return;\n }\n\n var dataTransfer = e.dataTransfer;\n var nativeType = matchNativeItemType(dataTransfer);\n\n if (nativeType) {\n // A native item (such as file or URL) dragged from outside the document\n _this.beginDragNativeItem(nativeType, dataTransfer);\n }\n });\n\n _defineProperty(this, \"handleTopDragEnter\", function (e) {\n var dragEnterTargetIds = _this.dragEnterTargetIds;\n _this.dragEnterTargetIds = [];\n\n if (!_this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n return;\n }\n\n _this.altKeyPressed = e.altKey; // If the target changes position as the result of `dragenter`, `dragover` might still\n // get dispatched despite target being no longer there. The easy solution is to check\n // whether there actually is a target before firing `hover`.\n\n if (dragEnterTargetIds.length > 0) {\n _this.actions.hover(dragEnterTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n }\n\n var canDrop = dragEnterTargetIds.some(function (targetId) {\n return _this.monitor.canDropOnTarget(targetId);\n });\n\n if (canDrop) {\n // IE requires this to fire dragover events\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = _this.getCurrentDropEffect();\n }\n }\n });\n\n _defineProperty(this, \"handleTopDragOverCapture\", function () {\n _this.dragOverTargetIds = [];\n });\n\n _defineProperty(this, \"handleTopDragOver\", function (e) {\n var dragOverTargetIds = _this.dragOverTargetIds;\n _this.dragOverTargetIds = [];\n\n if (!_this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n // Prevent default \"drop and blow away the whole document\" action.\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n\n return;\n }\n\n _this.altKeyPressed = e.altKey;\n _this.lastClientOffset = getEventClientOffset(e);\n\n if (_this.hoverRafId === null && typeof requestAnimationFrame !== 'undefined') {\n _this.hoverRafId = requestAnimationFrame(function () {\n if (_this.monitor.isDragging()) {\n _this.actions.hover(dragOverTargetIds || [], {\n clientOffset: _this.lastClientOffset\n });\n }\n\n _this.hoverRafId = null;\n });\n }\n\n var canDrop = (dragOverTargetIds || []).some(function (targetId) {\n return _this.monitor.canDropOnTarget(targetId);\n });\n\n if (canDrop) {\n // Show user-specified drop effect.\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = _this.getCurrentDropEffect();\n }\n } else if (_this.isDraggingNativeItem()) {\n // Don't show a nice cursor but still prevent default\n // \"drop and blow away the whole document\" action.\n e.preventDefault();\n } else {\n e.preventDefault();\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n }\n });\n\n _defineProperty(this, \"handleTopDragLeaveCapture\", function (e) {\n if (_this.isDraggingNativeItem()) {\n e.preventDefault();\n }\n\n var isLastLeave = _this.enterLeaveCounter.leave(e.target);\n\n if (!isLastLeave) {\n return;\n }\n\n if (_this.isDraggingNativeItem()) {\n setTimeout(function () {\n return _this.endDragNativeItem();\n }, 0);\n }\n });\n\n _defineProperty(this, \"handleTopDropCapture\", function (e) {\n _this.dropTargetIds = [];\n\n if (_this.isDraggingNativeItem()) {\n var _this$currentNativeSo;\n\n e.preventDefault();\n (_this$currentNativeSo = _this.currentNativeSource) === null || _this$currentNativeSo === void 0 ? void 0 : _this$currentNativeSo.loadDataTransfer(e.dataTransfer);\n } else if (matchNativeItemType(e.dataTransfer)) {\n // Dragging some elements, like
and may still behave like a native drag event,\n // even if the current drag event matches a user-defined type.\n // Stop the default behavior when we're not expecting a native item to be dropped.\n e.preventDefault();\n }\n\n _this.enterLeaveCounter.reset();\n });\n\n _defineProperty(this, \"handleTopDrop\", function (e) {\n var dropTargetIds = _this.dropTargetIds;\n _this.dropTargetIds = [];\n\n _this.actions.hover(dropTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n\n _this.actions.drop({\n dropEffect: _this.getCurrentDropEffect()\n });\n\n if (_this.isDraggingNativeItem()) {\n _this.endDragNativeItem();\n } else if (_this.monitor.isDragging()) {\n _this.actions.endDrag();\n }\n });\n\n _defineProperty(this, \"handleSelectStart\", function (e) {\n var target = e.target; // Only IE requires us to explicitly say\n // we want drag drop operation to start\n\n if (typeof target.dragDrop !== 'function') {\n return;\n } // Inputs and textareas should be selectable\n\n\n if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return;\n } // For other targets, ask IE\n // to enable drag and drop\n\n\n e.preventDefault();\n target.dragDrop();\n });\n\n this.options = new OptionsReader(globalContext, options);\n this.actions = manager.getActions();\n this.monitor = manager.getMonitor();\n this.registry = manager.getRegistry();\n this.enterLeaveCounter = new EnterLeaveCounter(this.isNodeInDocument);\n }\n /**\n * Generate profiling statistics for the HTML5Backend.\n */\n\n\n _createClass(HTML5BackendImpl, [{\n key: \"profile\",\n value: function profile() {\n var _this$dragStartSource, _this$dragOverTargetI;\n\n return {\n sourcePreviewNodes: this.sourcePreviewNodes.size,\n sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,\n sourceNodeOptions: this.sourceNodeOptions.size,\n sourceNodes: this.sourceNodes.size,\n dragStartSourceIds: ((_this$dragStartSource = this.dragStartSourceIds) === null || _this$dragStartSource === void 0 ? void 0 : _this$dragStartSource.length) || 0,\n dropTargetIds: this.dropTargetIds.length,\n dragEnterTargetIds: this.dragEnterTargetIds.length,\n dragOverTargetIds: ((_this$dragOverTargetI = this.dragOverTargetIds) === null || _this$dragOverTargetI === void 0 ? void 0 : _this$dragOverTargetI.length) || 0\n };\n } // public for test\n\n }, {\n key: \"window\",\n get: function get() {\n return this.options.window;\n }\n }, {\n key: \"document\",\n get: function get() {\n return this.options.document;\n }\n /**\n * Get the root element to use for event subscriptions\n */\n\n }, {\n key: \"rootElement\",\n get: function get() {\n return this.options.rootElement;\n }\n }, {\n key: \"setup\",\n value: function setup() {\n var root = this.rootElement;\n\n if (root === undefined) {\n return;\n }\n\n if (root.__isReactDndBackendSetUp) {\n throw new Error('Cannot have two HTML5 backends at the same time.');\n }\n\n root.__isReactDndBackendSetUp = true;\n this.addEventListeners(root);\n }\n }, {\n key: \"teardown\",\n value: function teardown() {\n var root = this.rootElement;\n\n if (root === undefined) {\n return;\n }\n\n root.__isReactDndBackendSetUp = false;\n this.removeEventListeners(this.rootElement);\n this.clearCurrentDragSourceNode();\n\n if (this.asyncEndDragFrameId) {\n var _this$window;\n\n (_this$window = this.window) === null || _this$window === void 0 ? void 0 : _this$window.cancelAnimationFrame(this.asyncEndDragFrameId);\n }\n }\n }, {\n key: \"connectDragPreview\",\n value: function connectDragPreview(sourceId, node, options) {\n var _this2 = this;\n\n this.sourcePreviewNodeOptions.set(sourceId, options);\n this.sourcePreviewNodes.set(sourceId, node);\n return function () {\n _this2.sourcePreviewNodes[\"delete\"](sourceId);\n\n _this2.sourcePreviewNodeOptions[\"delete\"](sourceId);\n };\n }\n }, {\n key: \"connectDragSource\",\n value: function connectDragSource(sourceId, node, options) {\n var _this3 = this;\n\n this.sourceNodes.set(sourceId, node);\n this.sourceNodeOptions.set(sourceId, options);\n\n var handleDragStart = function handleDragStart(e) {\n return _this3.handleDragStart(e, sourceId);\n };\n\n var handleSelectStart = function handleSelectStart(e) {\n return _this3.handleSelectStart(e);\n };\n\n node.setAttribute('draggable', 'true');\n node.addEventListener('dragstart', handleDragStart);\n node.addEventListener('selectstart', handleSelectStart);\n return function () {\n _this3.sourceNodes[\"delete\"](sourceId);\n\n _this3.sourceNodeOptions[\"delete\"](sourceId);\n\n node.removeEventListener('dragstart', handleDragStart);\n node.removeEventListener('selectstart', handleSelectStart);\n node.setAttribute('draggable', 'false');\n };\n }\n }, {\n key: \"connectDropTarget\",\n value: function connectDropTarget(targetId, node) {\n var _this4 = this;\n\n var handleDragEnter = function handleDragEnter(e) {\n return _this4.handleDragEnter(e, targetId);\n };\n\n var handleDragOver = function handleDragOver(e) {\n return _this4.handleDragOver(e, targetId);\n };\n\n var handleDrop = function handleDrop(e) {\n return _this4.handleDrop(e, targetId);\n };\n\n node.addEventListener('dragenter', handleDragEnter);\n node.addEventListener('dragover', handleDragOver);\n node.addEventListener('drop', handleDrop);\n return function () {\n node.removeEventListener('dragenter', handleDragEnter);\n node.removeEventListener('dragover', handleDragOver);\n node.removeEventListener('drop', handleDrop);\n };\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.addEventListener) {\n return;\n }\n\n target.addEventListener('dragstart', this.handleTopDragStart);\n target.addEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.addEventListener('dragend', this.handleTopDragEndCapture, true);\n target.addEventListener('dragenter', this.handleTopDragEnter);\n target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.addEventListener('dragover', this.handleTopDragOver);\n target.addEventListener('dragover', this.handleTopDragOverCapture, true);\n target.addEventListener('drop', this.handleTopDrop);\n target.addEventListener('drop', this.handleTopDropCapture, true);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.removeEventListener) {\n return;\n }\n\n target.removeEventListener('dragstart', this.handleTopDragStart);\n target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.removeEventListener('dragend', this.handleTopDragEndCapture, true);\n target.removeEventListener('dragenter', this.handleTopDragEnter);\n target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.removeEventListener('dragover', this.handleTopDragOver);\n target.removeEventListener('dragover', this.handleTopDragOverCapture, true);\n target.removeEventListener('drop', this.handleTopDrop);\n target.removeEventListener('drop', this.handleTopDropCapture, true);\n }\n }, {\n key: \"getCurrentSourceNodeOptions\",\n value: function getCurrentSourceNodeOptions() {\n var sourceId = this.monitor.getSourceId();\n var sourceNodeOptions = this.sourceNodeOptions.get(sourceId);\n return _objectSpread({\n dropEffect: this.altKeyPressed ? 'copy' : 'move'\n }, sourceNodeOptions || {});\n }\n }, {\n key: \"getCurrentDropEffect\",\n value: function getCurrentDropEffect() {\n if (this.isDraggingNativeItem()) {\n // It makes more sense to default to 'copy' for native resources\n return 'copy';\n }\n\n return this.getCurrentSourceNodeOptions().dropEffect;\n }\n }, {\n key: \"getCurrentSourcePreviewNodeOptions\",\n value: function getCurrentSourcePreviewNodeOptions() {\n var sourceId = this.monitor.getSourceId();\n var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions.get(sourceId);\n return _objectSpread({\n anchorX: 0.5,\n anchorY: 0.5,\n captureDraggingState: false\n }, sourcePreviewNodeOptions || {});\n }\n }, {\n key: \"isDraggingNativeItem\",\n value: function isDraggingNativeItem() {\n var itemType = this.monitor.getItemType();\n return Object.keys(NativeTypes).some(function (key) {\n return NativeTypes[key] === itemType;\n });\n }\n }, {\n key: \"beginDragNativeItem\",\n value: function beginDragNativeItem(type, dataTransfer) {\n this.clearCurrentDragSourceNode();\n this.currentNativeSource = createNativeDragSource(type, dataTransfer);\n this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);\n this.actions.beginDrag([this.currentNativeHandle]);\n }\n }, {\n key: \"setCurrentDragSourceNode\",\n value: function setCurrentDragSourceNode(node) {\n var _this5 = this;\n\n this.clearCurrentDragSourceNode();\n this.currentDragSourceNode = node; // A timeout of > 0 is necessary to resolve Firefox issue referenced\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n\n var MOUSE_MOVE_TIMEOUT = 1000; // Receiving a mouse event in the middle of a dragging operation\n // means it has ended and the drag source node disappeared from DOM,\n // so the browser didn't dispatch the dragend event.\n //\n // We need to wait before we start listening for mousemove events.\n // This is needed because the drag preview needs to be drawn or else it fires an 'mousemove' event\n // immediately in some browsers.\n //\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n //\n\n this.mouseMoveTimeoutTimer = setTimeout(function () {\n var _this5$rootElement;\n\n return (_this5$rootElement = _this5.rootElement) === null || _this5$rootElement === void 0 ? void 0 : _this5$rootElement.addEventListener('mousemove', _this5.endDragIfSourceWasRemovedFromDOM, true);\n }, MOUSE_MOVE_TIMEOUT);\n }\n }, {\n key: \"clearCurrentDragSourceNode\",\n value: function clearCurrentDragSourceNode() {\n if (this.currentDragSourceNode) {\n this.currentDragSourceNode = null;\n\n if (this.rootElement) {\n var _this$window2;\n\n (_this$window2 = this.window) === null || _this$window2 === void 0 ? void 0 : _this$window2.clearTimeout(this.mouseMoveTimeoutTimer || undefined);\n this.rootElement.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);\n }\n\n this.mouseMoveTimeoutTimer = null;\n return true;\n }\n\n return false;\n }\n }, {\n key: \"handleDragStart\",\n value: function handleDragStart(e, sourceId) {\n if (e.defaultPrevented) {\n return;\n }\n\n if (!this.dragStartSourceIds) {\n this.dragStartSourceIds = [];\n }\n\n this.dragStartSourceIds.unshift(sourceId);\n }\n }, {\n key: \"handleDragEnter\",\n value: function handleDragEnter(e, targetId) {\n this.dragEnterTargetIds.unshift(targetId);\n }\n }, {\n key: \"handleDragOver\",\n value: function handleDragOver(e, targetId) {\n if (this.dragOverTargetIds === null) {\n this.dragOverTargetIds = [];\n }\n\n this.dragOverTargetIds.unshift(targetId);\n }\n }, {\n key: \"handleDrop\",\n value: function handleDrop(e, targetId) {\n this.dropTargetIds.unshift(targetId);\n }\n }]);\n\n return HTML5BackendImpl;\n}();","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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\n/**\n * This HOC decorates a virtualized component and responds to arrow-key events by scrolling one row or column at a time.\n */\n\nvar ArrowKeyStepper = (_temp = _class = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(ArrowKeyStepper, _React$PureComponent);\n\n function ArrowKeyStepper() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ArrowKeyStepper);\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(ArrowKeyStepper)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n scrollToColumn: 0,\n scrollToRow: 0,\n instanceProps: {\n prevScrollToColumn: 0,\n prevScrollToRow: 0\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_columnStartIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_columnStopIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_rowStartIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_rowStopIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_onKeyDown\", function (event) {\n var _this$props = _this.props,\n columnCount = _this$props.columnCount,\n disabled = _this$props.disabled,\n mode = _this$props.mode,\n rowCount = _this$props.rowCount;\n\n if (disabled) {\n return;\n }\n\n var _this$_getScrollState = _this._getScrollState(),\n scrollToColumnPrevious = _this$_getScrollState.scrollToColumn,\n scrollToRowPrevious = _this$_getScrollState.scrollToRow;\n\n var _this$_getScrollState2 = _this._getScrollState(),\n scrollToColumn = _this$_getScrollState2.scrollToColumn,\n scrollToRow = _this$_getScrollState2.scrollToRow; // The above cases all prevent default event event behavior.\n // This is to keep the grid from scrolling after the snap-to update.\n\n\n switch (event.key) {\n case 'ArrowDown':\n scrollToRow = mode === 'cells' ? Math.min(scrollToRow + 1, rowCount - 1) : Math.min(_this._rowStopIndex + 1, rowCount - 1);\n break;\n\n case 'ArrowLeft':\n scrollToColumn = mode === 'cells' ? Math.max(scrollToColumn - 1, 0) : Math.max(_this._columnStartIndex - 1, 0);\n break;\n\n case 'ArrowRight':\n scrollToColumn = mode === 'cells' ? Math.min(scrollToColumn + 1, columnCount - 1) : Math.min(_this._columnStopIndex + 1, columnCount - 1);\n break;\n\n case 'ArrowUp':\n scrollToRow = mode === 'cells' ? Math.max(scrollToRow - 1, 0) : Math.max(_this._rowStartIndex - 1, 0);\n break;\n }\n\n if (scrollToColumn !== scrollToColumnPrevious || scrollToRow !== scrollToRowPrevious) {\n event.preventDefault();\n\n _this._updateScrollState({\n scrollToColumn: scrollToColumn,\n scrollToRow: scrollToRow\n });\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onSectionRendered\", function (_ref) {\n var columnStartIndex = _ref.columnStartIndex,\n columnStopIndex = _ref.columnStopIndex,\n rowStartIndex = _ref.rowStartIndex,\n rowStopIndex = _ref.rowStopIndex;\n _this._columnStartIndex = columnStartIndex;\n _this._columnStopIndex = columnStopIndex;\n _this._rowStartIndex = rowStartIndex;\n _this._rowStopIndex = rowStopIndex;\n });\n\n return _this;\n }\n\n _createClass(ArrowKeyStepper, [{\n key: \"setScrollIndexes\",\n value: function setScrollIndexes(_ref2) {\n var scrollToColumn = _ref2.scrollToColumn,\n scrollToRow = _ref2.scrollToRow;\n this.setState({\n scrollToRow: scrollToRow,\n scrollToColumn: scrollToColumn\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n className = _this$props2.className,\n children = _this$props2.children;\n\n var _this$_getScrollState3 = this._getScrollState(),\n scrollToColumn = _this$_getScrollState3.scrollToColumn,\n scrollToRow = _this$_getScrollState3.scrollToRow;\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n onKeyDown: this._onKeyDown\n }, children({\n onSectionRendered: this._onSectionRendered,\n scrollToColumn: scrollToColumn,\n scrollToRow: scrollToRow\n }));\n }\n }, {\n key: \"_getScrollState\",\n value: function _getScrollState() {\n return this.props.isControlled ? this.props : this.state;\n }\n }, {\n key: \"_updateScrollState\",\n value: function _updateScrollState(_ref3) {\n var scrollToColumn = _ref3.scrollToColumn,\n scrollToRow = _ref3.scrollToRow;\n var _this$props3 = this.props,\n isControlled = _this$props3.isControlled,\n onScrollToChange = _this$props3.onScrollToChange;\n\n if (typeof onScrollToChange === 'function') {\n onScrollToChange({\n scrollToColumn: scrollToColumn,\n scrollToRow: scrollToRow\n });\n }\n\n if (!isControlled) {\n this.setState({\n scrollToColumn: scrollToColumn,\n scrollToRow: scrollToRow\n });\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.isControlled) {\n return {};\n }\n\n if (nextProps.scrollToColumn !== prevState.instanceProps.prevScrollToColumn || nextProps.scrollToRow !== prevState.instanceProps.prevScrollToRow) {\n return _objectSpread({}, prevState, {\n scrollToColumn: nextProps.scrollToColumn,\n scrollToRow: nextProps.scrollToRow,\n instanceProps: {\n prevScrollToColumn: nextProps.scrollToColumn,\n prevScrollToRow: nextProps.scrollToRow\n }\n });\n }\n\n return {};\n }\n }]);\n\n return ArrowKeyStepper;\n}(React.PureComponent), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n \"children\": PropTypes.func.isRequired,\n \"className\": PropTypes.string,\n \"columnCount\": PropTypes.number.isRequired,\n \"disabled\": PropTypes.bool.isRequired,\n \"isControlled\": PropTypes.bool.isRequired,\n \"mode\": PropTypes.oneOf([\"cells\", \"edges\"]).isRequired,\n \"onScrollToChange\": PropTypes.func,\n \"rowCount\": PropTypes.number.isRequired,\n \"scrollToColumn\": PropTypes.number.isRequired,\n \"scrollToRow\": PropTypes.number.isRequired\n}), _temp);\n\n_defineProperty(ArrowKeyStepper, \"defaultProps\", {\n disabled: false,\n isControlled: false,\n mode: 'edges',\n scrollToColumn: 0,\n scrollToRow: 0\n});\n\npolyfill(ArrowKeyStepper);\nexport default ArrowKeyStepper;\nimport PropTypes from \"prop-types\";","import { HTML5BackendImpl } from './HTML5BackendImpl';\nimport * as NativeTypes from './NativeTypes';\nexport { getEmptyImage } from './getEmptyImage';\nexport { NativeTypes };\nexport var HTML5Backend = function createBackend(manager, context, options) {\n return new HTML5BackendImpl(manager, context, options);\n};","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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport * as React from 'react';\nimport createDetectElementResize from '../vendor/detectElementResize';\nvar AutoSizer = (_temp = _class = /*#__PURE__*/function (_React$Component) {\n _inherits(AutoSizer, _React$Component);\n\n function AutoSizer() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, AutoSizer);\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(AutoSizer)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n height: _this.props.defaultHeight || 0,\n width: _this.props.defaultWidth || 0\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_parentNode\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_autoSizer\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_window\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_detectElementResize\", void 0);\n\n _defineProperty(_assertThisInitialized(_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 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 var height = _this._parentNode.offsetHeight || 0;\n var width = _this._parentNode.offsetWidth || 0;\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 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({\n height: height,\n width: width\n });\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_setRef\", function (autoSizer) {\n _this._autoSizer = autoSizer;\n });\n\n return _this;\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; // Defer requiring resize handler in order to support server-side rendering.\n // See issue #41\n\n this._detectElementResize = createDetectElementResize(nonce, this._window);\n\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 _this$props2 = this.props,\n children = _this$props2.children,\n className = _this$props2.className,\n disableHeight = _this$props2.disableHeight,\n disableWidth = _this$props2.disableWidth,\n style = _this$props2.style;\n var _this$state = this.state,\n height = _this$state.height,\n width = _this$state.width; // 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 = {\n overflow: 'visible'\n };\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 * 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\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n ref: this._setRef,\n style: _objectSpread({}, outerStyle, {}, style)\n }, children(childParams));\n }\n }]);\n\n return AutoSizer;\n}(React.Component), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n /** Function responsible for rendering children.*/\n \"children\": PropTypes.func.isRequired,\n\n /** Optional custom CSS class name to attach to root AutoSizer element. */\n \"className\": PropTypes.string,\n\n /** Default height to use for initial render; useful for SSR */\n \"defaultHeight\": PropTypes.number,\n\n /** Default width to use for initial render; useful for SSR */\n \"defaultWidth\": PropTypes.number,\n\n /** Disable dynamic :height property */\n \"disableHeight\": PropTypes.bool.isRequired,\n\n /** Disable dynamic :width property */\n \"disableWidth\": PropTypes.bool.isRequired,\n\n /** Nonce of the inlined stylesheet for Content Security Policy */\n \"nonce\": PropTypes.string,\n\n /** Callback to be invoked on-resize */\n \"onResize\": PropTypes.func.isRequired,\n\n /** Optional inline style */\n \"style\": PropTypes.object\n}), _temp);\n\n_defineProperty(AutoSizer, \"defaultProps\", {\n onResize: function onResize() {},\n disableHeight: false,\n disableWidth: false,\n style: {}\n});\n\nexport { AutoSizer as default };\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 * 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 */\n\nvar CellMeasurer = (_temp = _class = /*#__PURE__*/function (_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 CellMeasurer from './CellMeasurer';\nimport CellMeasurerCache from './CellMeasurerCache';\nexport default CellMeasurer;\nexport { CellMeasurer, CellMeasurerCache };","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction toVal(mix) {\n var k,\n y,\n str = '';\n\n if (typeof mix === 'string' || typeof mix === 'number') {\n str += mix;\n } else if (_typeof(mix) === 'object') {\n if (Array.isArray(mix)) {\n for (k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (y = toVal(mix[k])) {\n str && (str += ' ');\n str += y;\n }\n }\n }\n } else {\n for (k in mix) {\n if (mix[k]) {\n str && (str += ' ');\n str += k;\n }\n }\n }\n }\n\n return str;\n}\n\nexport default function () {\n var i = 0,\n tmp,\n x,\n str = '';\n\n while (i < arguments.length) {\n if (tmp = arguments[i++]) {\n if (x = toVal(tmp)) {\n str && (str += ' ');\n str += x;\n }\n }\n }\n\n return str;\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 var cachedIndices = {};\n return function (_ref) {\n var callback = _ref.callback,\n indices = _ref.indices;\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 return Array.isArray(value) ? cachedValue.join(',') !== value.join(',') : cachedValue !== value;\n });\n cachedIndices = indices;\n\n if (allInitialized && indexChanged) {\n callback(indices);\n }\n };\n}","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}","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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport clsx from 'clsx';\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport createCallbackMemoizer from '../utils/createCallbackMemoizer';\nimport getScrollbarSize from 'dom-helpers/scrollbarSize'; // @TODO Merge Collection and CollectionView\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 */\n\nvar IS_SCROLLING_TIMEOUT = 150;\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 */\n\nvar SCROLL_POSITION_CHANGE_REASONS = {\n OBSERVED: 'observed',\n REQUESTED: 'requested'\n};\n/**\n * Monitors changes in properties (eg. cellCount) and state (eg. scroll offsets) to determine when rendering needs to occur.\n * This component does not render any visible content itself; it defers to the specified :cellLayoutManager.\n */\n\nvar CollectionView = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(CollectionView, _React$PureComponent); // Invokes callbacks only when their values have changed.\n\n\n function CollectionView() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, CollectionView);\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(CollectionView)).call.apply(_getPrototypeOf2, [this].concat(args))); // If this component is being rendered server-side, getScrollbarSize() will return undefined.\n // We handle this case in componentDidMount()\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n isScrolling: false,\n scrollLeft: 0,\n scrollTop: 0\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_calculateSizeAndPositionDataOnNextUpdate\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"_onSectionRenderedMemoizer\", createCallbackMemoizer());\n\n _defineProperty(_assertThisInitialized(_this), \"_onScrollMemoizer\", createCallbackMemoizer(false));\n\n _defineProperty(_assertThisInitialized(_this), \"_invokeOnSectionRenderedHelper\", function () {\n var _this$props = _this.props,\n cellLayoutManager = _this$props.cellLayoutManager,\n onSectionRendered = _this$props.onSectionRendered;\n\n _this._onSectionRenderedMemoizer({\n callback: onSectionRendered,\n indices: {\n indices: cellLayoutManager.getLastRenderedIndices()\n }\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_setScrollingContainerRef\", function (ref) {\n _this._scrollingContainer = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_updateScrollPositionForScrollToCell\", function () {\n var _this$props2 = _this.props,\n cellLayoutManager = _this$props2.cellLayoutManager,\n height = _this$props2.height,\n scrollToAlignment = _this$props2.scrollToAlignment,\n scrollToCell = _this$props2.scrollToCell,\n width = _this$props2.width;\n var _this$state = _this.state,\n scrollLeft = _this$state.scrollLeft,\n scrollTop = _this$state.scrollTop;\n\n if (scrollToCell >= 0) {\n var scrollPosition = cellLayoutManager.getScrollPositionForCell({\n align: scrollToAlignment,\n cellIndex: scrollToCell,\n height: height,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n width: width\n });\n\n if (scrollPosition.scrollLeft !== scrollLeft || scrollPosition.scrollTop !== scrollTop) {\n _this._setScrollPosition(scrollPosition);\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_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 return;\n } // Prevent pointer events from interrupting a smooth scroll\n\n\n _this._enablePointerEventsAfterDelay(); // 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 scrollTop never exceeds the total height.\n\n\n var _this$props3 = _this.props,\n cellLayoutManager = _this$props3.cellLayoutManager,\n height = _this$props3.height,\n isScrollingChange = _this$props3.isScrollingChange,\n width = _this$props3.width;\n var scrollbarSize = _this._scrollbarSize;\n\n var _cellLayoutManager$ge = cellLayoutManager.getTotalSize(),\n totalHeight = _cellLayoutManager$ge.height,\n totalWidth = _cellLayoutManager$ge.width;\n\n var scrollLeft = Math.max(0, Math.min(totalWidth - width + scrollbarSize, event.target.scrollLeft));\n var scrollTop = Math.max(0, Math.min(totalHeight - height + scrollbarSize, event.target.scrollTop)); // 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\n if (_this.state.scrollLeft !== scrollLeft || _this.state.scrollTop !== scrollTop) {\n // Browsers with cancelable scroll events (eg. Firefox) interrupt scrolling animations if scrollTop/scrollLeft is set.\n // Other browsers (eg. Safari) don't scroll as well without the help under certain conditions (DOM or style changes during scrolling).\n // All things considered, this seems to be the best current work around that I'm aware of.\n // For more information see https://github.com/bvaughn/react-virtualized/pull/124\n var scrollPositionChangeReason = event.cancelable ? SCROLL_POSITION_CHANGE_REASONS.OBSERVED : SCROLL_POSITION_CHANGE_REASONS.REQUESTED; // Synchronously set :isScrolling the first time (since _setNextState will reschedule its animation frame each time it's called)\n\n if (!_this.state.isScrolling) {\n isScrollingChange(true);\n }\n\n _this.setState({\n isScrolling: true,\n scrollLeft: scrollLeft,\n scrollPositionChangeReason: scrollPositionChangeReason,\n scrollTop: scrollTop\n });\n }\n\n _this._invokeOnScrollMemoizer({\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n totalWidth: totalWidth,\n totalHeight: totalHeight\n });\n });\n\n _this._scrollbarSize = getScrollbarSize();\n\n if (_this._scrollbarSize === undefined) {\n _this._scrollbarSizeMeasured = false;\n _this._scrollbarSize = 0;\n } else {\n _this._scrollbarSizeMeasured = true;\n }\n\n return _this;\n }\n /**\n * Forced recompute of cell sizes and positions.\n * This function should be called if cell sizes have changed but nothing else has.\n * Since cell positions are calculated by callbacks, the collection view has no way of detecting when the underlying data has changed.\n */\n\n\n _createClass(CollectionView, [{\n key: \"recomputeCellSizesAndPositions\",\n value: function recomputeCellSizesAndPositions() {\n this._calculateSizeAndPositionDataOnNextUpdate = true;\n this.forceUpdate();\n }\n /* ---------------------------- Component lifecycle methods ---------------------------- */\n\n /**\n * @private\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: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props4 = this.props,\n cellLayoutManager = _this$props4.cellLayoutManager,\n scrollLeft = _this$props4.scrollLeft,\n scrollToCell = _this$props4.scrollToCell,\n scrollTop = _this$props4.scrollTop; // If this component was first rendered server-side, scrollbar size will be undefined.\n // In that event we need to remeasure.\n\n if (!this._scrollbarSizeMeasured) {\n this._scrollbarSize = getScrollbarSize();\n this._scrollbarSizeMeasured = true;\n this.setState({});\n }\n\n if (scrollToCell >= 0) {\n this._updateScrollPositionForScrollToCell();\n } else if (scrollLeft >= 0 || scrollTop >= 0) {\n this._setScrollPosition({\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n });\n } // Update onSectionRendered callback.\n\n\n this._invokeOnSectionRenderedHelper();\n\n var _cellLayoutManager$ge2 = cellLayoutManager.getTotalSize(),\n totalHeight = _cellLayoutManager$ge2.height,\n totalWidth = _cellLayoutManager$ge2.width; // Initialize onScroll callback.\n\n\n this._invokeOnScrollMemoizer({\n scrollLeft: scrollLeft || 0,\n scrollTop: scrollTop || 0,\n totalHeight: totalHeight,\n totalWidth: totalWidth\n });\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this$props5 = this.props,\n height = _this$props5.height,\n scrollToAlignment = _this$props5.scrollToAlignment,\n scrollToCell = _this$props5.scrollToCell,\n width = _this$props5.width;\n var _this$state2 = this.state,\n scrollLeft = _this$state2.scrollLeft,\n scrollPositionChangeReason = _this$state2.scrollPositionChangeReason,\n scrollTop = _this$state2.scrollTop; // 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\n if (scrollPositionChangeReason === SCROLL_POSITION_CHANGE_REASONS.REQUESTED) {\n if (scrollLeft >= 0 && scrollLeft !== prevState.scrollLeft && scrollLeft !== this._scrollingContainer.scrollLeft) {\n this._scrollingContainer.scrollLeft = scrollLeft;\n }\n\n if (scrollTop >= 0 && scrollTop !== prevState.scrollTop && scrollTop !== this._scrollingContainer.scrollTop) {\n this._scrollingContainer.scrollTop = scrollTop;\n }\n } // Update scroll offsets if the current :scrollToCell values requires it\n\n\n if (height !== prevProps.height || scrollToAlignment !== prevProps.scrollToAlignment || scrollToCell !== prevProps.scrollToCell || width !== prevProps.width) {\n this._updateScrollPositionForScrollToCell();\n } // Update onRowsRendered callback if start/stop indices have changed\n\n\n this._invokeOnSectionRenderedHelper();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this._disablePointerEventsTimeoutId) {\n clearTimeout(this._disablePointerEventsTimeoutId);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n autoHeight = _this$props6.autoHeight,\n cellCount = _this$props6.cellCount,\n cellLayoutManager = _this$props6.cellLayoutManager,\n className = _this$props6.className,\n height = _this$props6.height,\n horizontalOverscanSize = _this$props6.horizontalOverscanSize,\n id = _this$props6.id,\n noContentRenderer = _this$props6.noContentRenderer,\n style = _this$props6.style,\n verticalOverscanSize = _this$props6.verticalOverscanSize,\n width = _this$props6.width;\n var _this$state3 = this.state,\n isScrolling = _this$state3.isScrolling,\n scrollLeft = _this$state3.scrollLeft,\n scrollTop = _this$state3.scrollTop; // Memoization reset\n\n if (this._lastRenderedCellCount !== cellCount || this._lastRenderedCellLayoutManager !== cellLayoutManager || this._calculateSizeAndPositionDataOnNextUpdate) {\n this._lastRenderedCellCount = cellCount;\n this._lastRenderedCellLayoutManager = cellLayoutManager;\n this._calculateSizeAndPositionDataOnNextUpdate = false;\n cellLayoutManager.calculateSizeAndPositionData();\n }\n\n var _cellLayoutManager$ge3 = cellLayoutManager.getTotalSize(),\n totalHeight = _cellLayoutManager$ge3.height,\n totalWidth = _cellLayoutManager$ge3.width; // Safely expand the rendered area by the specified overscan amount\n\n\n var left = Math.max(0, scrollLeft - horizontalOverscanSize);\n var top = Math.max(0, scrollTop - verticalOverscanSize);\n var right = Math.min(totalWidth, scrollLeft + width + horizontalOverscanSize);\n var bottom = Math.min(totalHeight, scrollTop + height + verticalOverscanSize);\n var childrenToDisplay = height > 0 && width > 0 ? cellLayoutManager.cellRenderers({\n height: bottom - top,\n isScrolling: isScrolling,\n width: right - left,\n x: left,\n y: top\n }) : [];\n var collectionStyle = {\n boxSizing: 'border-box',\n direction: 'ltr',\n height: autoHeight ? 'auto' : height,\n position: 'relative',\n WebkitOverflowScrolling: 'touch',\n width: width,\n willChange: 'transform'\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\n var verticalScrollBarSize = totalHeight > height ? this._scrollbarSize : 0;\n var horizontalScrollBarSize = totalWidth > width ? this._scrollbarSize : 0; // 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\n collectionStyle.overflowX = totalWidth + verticalScrollBarSize <= width ? 'hidden' : 'auto';\n collectionStyle.overflowY = totalHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: this._setScrollingContainerRef,\n \"aria-label\": this.props['aria-label'],\n className: clsx('ReactVirtualized__Collection', className),\n id: id,\n onScroll: this._onScroll,\n role: \"grid\",\n style: _objectSpread({}, collectionStyle, {}, style),\n tabIndex: 0\n }, cellCount > 0 && /*#__PURE__*/React.createElement(\"div\", {\n className: \"ReactVirtualized__Collection__innerScrollContainer\",\n style: {\n height: totalHeight,\n maxHeight: totalHeight,\n maxWidth: totalWidth,\n overflow: 'hidden',\n pointerEvents: isScrolling ? 'none' : '',\n width: totalWidth\n }\n }, childrenToDisplay), cellCount === 0 && noContentRenderer());\n }\n /* ---------------------------- Helper methods ---------------------------- */\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 Collection.\n * This prevents jerky/stuttery mouse-wheel scrolling.\n */\n\n }, {\n key: \"_enablePointerEventsAfterDelay\",\n value: function _enablePointerEventsAfterDelay() {\n var _this2 = this;\n\n if (this._disablePointerEventsTimeoutId) {\n clearTimeout(this._disablePointerEventsTimeoutId);\n }\n\n this._disablePointerEventsTimeoutId = setTimeout(function () {\n var isScrollingChange = _this2.props.isScrollingChange;\n isScrollingChange(false);\n _this2._disablePointerEventsTimeoutId = null;\n\n _this2.setState({\n isScrolling: false\n });\n }, IS_SCROLLING_TIMEOUT);\n }\n }, {\n key: \"_invokeOnScrollMemoizer\",\n value: function _invokeOnScrollMemoizer(_ref) {\n var _this3 = this;\n\n var scrollLeft = _ref.scrollLeft,\n scrollTop = _ref.scrollTop,\n totalHeight = _ref.totalHeight,\n totalWidth = _ref.totalWidth;\n\n this._onScrollMemoizer({\n callback: function callback(_ref2) {\n var scrollLeft = _ref2.scrollLeft,\n scrollTop = _ref2.scrollTop;\n var _this3$props = _this3.props,\n height = _this3$props.height,\n onScroll = _this3$props.onScroll,\n width = _this3$props.width;\n onScroll({\n clientHeight: height,\n clientWidth: width,\n scrollHeight: totalHeight,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n scrollWidth: totalWidth\n });\n },\n indices: {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n }\n });\n }\n }, {\n key: \"_setScrollPosition\",\n value: function _setScrollPosition(_ref3) {\n var scrollLeft = _ref3.scrollLeft,\n scrollTop = _ref3.scrollTop;\n var newState = {\n scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED\n };\n\n if (scrollLeft >= 0) {\n newState.scrollLeft = scrollLeft;\n }\n\n if (scrollTop >= 0) {\n newState.scrollTop = scrollTop;\n }\n\n if (scrollLeft >= 0 && scrollLeft !== this.state.scrollLeft || scrollTop >= 0 && scrollTop !== this.state.scrollTop) {\n this.setState(newState);\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.cellCount === 0 && (prevState.scrollLeft !== 0 || prevState.scrollTop !== 0)) {\n return {\n scrollLeft: 0,\n scrollTop: 0,\n scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED\n };\n } else if (nextProps.scrollLeft !== prevState.scrollLeft || nextProps.scrollTop !== prevState.scrollTop) {\n return {\n scrollLeft: nextProps.scrollLeft != null ? nextProps.scrollLeft : prevState.scrollLeft,\n scrollTop: nextProps.scrollTop != null ? nextProps.scrollTop : prevState.scrollTop,\n scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED\n };\n }\n\n return null;\n }\n }]);\n\n return CollectionView;\n}(React.PureComponent);\n\n_defineProperty(CollectionView, \"defaultProps\", {\n 'aria-label': 'grid',\n horizontalOverscanSize: 0,\n noContentRenderer: function noContentRenderer() {\n return null;\n },\n onScroll: function onScroll() {\n return null;\n },\n onSectionRendered: function onSectionRendered() {\n return null;\n },\n scrollToAlignment: 'auto',\n scrollToCell: -1,\n style: {},\n verticalOverscanSize: 0\n});\n\npolyfill(CollectionView);\nexport default CollectionView;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\n/**\n * A section of the Window.\n * Window Sections are used to group nearby cells.\n * This enables us to more quickly determine which cells to display in a given region of the Window.\n * Sections have a fixed size and contain 0 to many cells (tracked by their indices).\n */\n\nvar Section = /*#__PURE__*/function () {\n function Section(_ref) {\n var height = _ref.height,\n width = _ref.width,\n x = _ref.x,\n y = _ref.y;\n\n _classCallCheck(this, Section);\n\n this.height = height;\n this.width = width;\n this.x = x;\n this.y = y;\n this._indexMap = {};\n this._indices = [];\n }\n /** Add a cell to this section. */\n\n\n _createClass(Section, [{\n key: \"addCellIndex\",\n value: function addCellIndex(_ref2) {\n var index = _ref2.index;\n\n if (!this._indexMap[index]) {\n this._indexMap[index] = true;\n\n this._indices.push(index);\n }\n }\n /** Get all cell indices that have been added to this section. */\n\n }, {\n key: \"getCellIndices\",\n value: function getCellIndices() {\n return this._indices;\n }\n /** Intended for debugger/test purposes only */\n\n }, {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.x, \",\").concat(this.y, \" \").concat(this.width, \"x\").concat(this.height);\n }\n }]);\n\n return Section;\n}();\n\nexport { Section as default };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\n/**\n * Window Sections are used to group nearby cells.\n * This enables us to more quickly determine which cells to display in a given region of the Window.\n * \n */\n\nimport Section from './Section';\nvar SECTION_SIZE = 100;\n/**\n * Contains 0 to many Sections.\n * Grows (and adds Sections) dynamically as cells are registered.\n * Automatically adds cells to the appropriate Section(s).\n */\n\nvar SectionManager = /*#__PURE__*/function () {\n function SectionManager() {\n var sectionSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SECTION_SIZE;\n\n _classCallCheck(this, SectionManager);\n\n this._sectionSize = sectionSize;\n this._cellMetadata = [];\n this._sections = {};\n }\n /**\n * Gets all cell indices contained in the specified region.\n * A region may encompass 1 or more Sections.\n */\n\n\n _createClass(SectionManager, [{\n key: \"getCellIndices\",\n value: function getCellIndices(_ref) {\n var height = _ref.height,\n width = _ref.width,\n x = _ref.x,\n y = _ref.y;\n var indices = {};\n this.getSections({\n height: height,\n width: width,\n x: x,\n y: y\n }).forEach(function (section) {\n return section.getCellIndices().forEach(function (index) {\n indices[index] = index;\n });\n }); // Object keys are strings; this function returns numbers\n\n return Object.keys(indices).map(function (index) {\n return indices[index];\n });\n }\n /** Get size and position information for the cell specified. */\n\n }, {\n key: \"getCellMetadata\",\n value: function getCellMetadata(_ref2) {\n var index = _ref2.index;\n return this._cellMetadata[index];\n }\n /** Get all Sections overlapping the specified region. */\n\n }, {\n key: \"getSections\",\n value: function getSections(_ref3) {\n var height = _ref3.height,\n width = _ref3.width,\n x = _ref3.x,\n y = _ref3.y;\n var sectionXStart = Math.floor(x / this._sectionSize);\n var sectionXStop = Math.floor((x + width - 1) / this._sectionSize);\n var sectionYStart = Math.floor(y / this._sectionSize);\n var sectionYStop = Math.floor((y + height - 1) / this._sectionSize);\n var sections = [];\n\n for (var sectionX = sectionXStart; sectionX <= sectionXStop; sectionX++) {\n for (var sectionY = sectionYStart; sectionY <= sectionYStop; sectionY++) {\n var key = \"\".concat(sectionX, \".\").concat(sectionY);\n\n if (!this._sections[key]) {\n this._sections[key] = new Section({\n height: this._sectionSize,\n width: this._sectionSize,\n x: sectionX * this._sectionSize,\n y: sectionY * this._sectionSize\n });\n }\n\n sections.push(this._sections[key]);\n }\n }\n\n return sections;\n }\n /** Total number of Sections based on the currently registered cells. */\n\n }, {\n key: \"getTotalSectionCount\",\n value: function getTotalSectionCount() {\n return Object.keys(this._sections).length;\n }\n /** Intended for debugger/test purposes only */\n\n }, {\n key: \"toString\",\n value: function toString() {\n var _this = this;\n\n return Object.keys(this._sections).map(function (index) {\n return _this._sections[index].toString();\n });\n }\n /** Adds a cell to the appropriate Sections and registers it metadata for later retrievable. */\n\n }, {\n key: \"registerCell\",\n value: function registerCell(_ref4) {\n var cellMetadatum = _ref4.cellMetadatum,\n index = _ref4.index;\n this._cellMetadata[index] = cellMetadatum;\n this.getSections(cellMetadatum).forEach(function (section) {\n return section.addCellIndex({\n index: index\n });\n });\n }\n }]);\n\n return SectionManager;\n}();\n\nexport { SectionManager as default };","/**\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 cellOffset Offset (x or y) position for cell\n * @param cellSize Size (width or height) of cell\n * @param containerSize Total size (width or height) of the container\n * @param currentOffset Container's current (x or y) offset\n * @return Offset to use to ensure the specified cell is visible\n */\nexport default function getUpdatedOffsetForIndex(_ref) {\n var _ref$align = _ref.align,\n align = _ref$align === void 0 ? 'auto' : _ref$align,\n cellOffset = _ref.cellOffset,\n cellSize = _ref.cellSize,\n containerSize = _ref.containerSize,\n currentOffset = _ref.currentOffset;\n var maxOffset = cellOffset;\n var minOffset = maxOffset - containerSize + cellSize;\n\n switch (align) {\n case 'start':\n return maxOffset;\n\n case 'end':\n return minOffset;\n\n case 'center':\n return maxOffset - (containerSize - cellSize) / 2;\n\n default:\n return Math.max(minOffset, Math.min(maxOffset, currentOffset));\n }\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _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\";\nimport * as React from 'react';\nimport CollectionView from './CollectionView';\nimport _calculateSizeAndPositionData from './utils/calculateSizeAndPositionData';\nimport getUpdatedOffsetForIndex from '../utils/getUpdatedOffsetForIndex';\n/**\n * Renders scattered or non-linear data.\n * Unlike Grid, which renders checkerboard data, Collection can render arbitrarily positioned- even overlapping- data.\n */\n\nvar Collection = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(Collection, _React$PureComponent);\n\n function Collection(props, context) {\n var _this;\n\n _classCallCheck(this, Collection);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Collection).call(this, props, context));\n _this._cellMetadata = [];\n _this._lastRenderedCellIndices = []; // Cell cache during scroll (for performance)\n\n _this._cellCache = [];\n _this._isScrollingChange = _this._isScrollingChange.bind(_assertThisInitialized(_this));\n _this._setCollectionViewRef = _this._setCollectionViewRef.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Collection, [{\n key: \"forceUpdate\",\n value: function forceUpdate() {\n if (this._collectionView !== undefined) {\n this._collectionView.forceUpdate();\n }\n }\n /** See Collection#recomputeCellSizesAndPositions */\n\n }, {\n key: \"recomputeCellSizesAndPositions\",\n value: function recomputeCellSizesAndPositions() {\n this._cellCache = [];\n\n this._collectionView.recomputeCellSizesAndPositions();\n }\n /** React lifecycle methods */\n\n }, {\n key: \"render\",\n value: function render() {\n var props = _extends({}, this.props);\n\n return /*#__PURE__*/React.createElement(CollectionView, _extends({\n cellLayoutManager: this,\n isScrollingChange: this._isScrollingChange,\n ref: this._setCollectionViewRef\n }, props));\n }\n /** CellLayoutManager interface */\n\n }, {\n key: \"calculateSizeAndPositionData\",\n value: function calculateSizeAndPositionData() {\n var _this$props = this.props,\n cellCount = _this$props.cellCount,\n cellSizeAndPositionGetter = _this$props.cellSizeAndPositionGetter,\n sectionSize = _this$props.sectionSize;\n\n var data = _calculateSizeAndPositionData({\n cellCount: cellCount,\n cellSizeAndPositionGetter: cellSizeAndPositionGetter,\n sectionSize: sectionSize\n });\n\n this._cellMetadata = data.cellMetadata;\n this._sectionManager = data.sectionManager;\n this._height = data.height;\n this._width = data.width;\n }\n /**\n * Returns the most recently rendered set of cell indices.\n */\n\n }, {\n key: \"getLastRenderedIndices\",\n value: function getLastRenderedIndices() {\n return this._lastRenderedCellIndices;\n }\n /**\n * Calculates the minimum amount of change from the current scroll position to ensure the specified cell is (fully) visible.\n */\n\n }, {\n key: \"getScrollPositionForCell\",\n value: function getScrollPositionForCell(_ref) {\n var align = _ref.align,\n cellIndex = _ref.cellIndex,\n height = _ref.height,\n scrollLeft = _ref.scrollLeft,\n scrollTop = _ref.scrollTop,\n width = _ref.width;\n var cellCount = this.props.cellCount;\n\n if (cellIndex >= 0 && cellIndex < cellCount) {\n var cellMetadata = this._cellMetadata[cellIndex];\n scrollLeft = getUpdatedOffsetForIndex({\n align: align,\n cellOffset: cellMetadata.x,\n cellSize: cellMetadata.width,\n containerSize: width,\n currentOffset: scrollLeft,\n targetIndex: cellIndex\n });\n scrollTop = getUpdatedOffsetForIndex({\n align: align,\n cellOffset: cellMetadata.y,\n cellSize: cellMetadata.height,\n containerSize: height,\n currentOffset: scrollTop,\n targetIndex: cellIndex\n });\n }\n\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n }\n }, {\n key: \"getTotalSize\",\n value: function getTotalSize() {\n return {\n height: this._height,\n width: this._width\n };\n }\n }, {\n key: \"cellRenderers\",\n value: function cellRenderers(_ref2) {\n var _this2 = this;\n\n var height = _ref2.height,\n isScrolling = _ref2.isScrolling,\n width = _ref2.width,\n x = _ref2.x,\n y = _ref2.y;\n var _this$props2 = this.props,\n cellGroupRenderer = _this$props2.cellGroupRenderer,\n cellRenderer = _this$props2.cellRenderer; // Store for later calls to getLastRenderedIndices()\n\n this._lastRenderedCellIndices = this._sectionManager.getCellIndices({\n height: height,\n width: width,\n x: x,\n y: y\n });\n return cellGroupRenderer({\n cellCache: this._cellCache,\n cellRenderer: cellRenderer,\n cellSizeAndPositionGetter: function cellSizeAndPositionGetter(_ref3) {\n var index = _ref3.index;\n return _this2._sectionManager.getCellMetadata({\n index: index\n });\n },\n indices: this._lastRenderedCellIndices,\n isScrolling: isScrolling\n });\n }\n }, {\n key: \"_isScrollingChange\",\n value: function _isScrollingChange(isScrolling) {\n if (!isScrolling) {\n this._cellCache = [];\n }\n }\n }, {\n key: \"_setCollectionViewRef\",\n value: function _setCollectionViewRef(ref) {\n this._collectionView = ref;\n }\n }]);\n\n return Collection;\n}(React.PureComponent);\n\n_defineProperty(Collection, \"defaultProps\", {\n 'aria-label': 'grid',\n cellGroupRenderer: defaultCellGroupRenderer\n});\n\nexport { Collection as default };\n\nfunction defaultCellGroupRenderer(_ref4) {\n var cellCache = _ref4.cellCache,\n cellRenderer = _ref4.cellRenderer,\n cellSizeAndPositionGetter = _ref4.cellSizeAndPositionGetter,\n indices = _ref4.indices,\n isScrolling = _ref4.isScrolling;\n return indices.map(function (index) {\n var cellMetadata = cellSizeAndPositionGetter({\n index: index\n });\n var cellRendererProps = {\n index: index,\n isScrolling: isScrolling,\n key: index,\n style: {\n height: cellMetadata.height,\n left: cellMetadata.x,\n position: 'absolute',\n top: cellMetadata.y,\n width: cellMetadata.width\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 complets.\n\n if (isScrolling) {\n if (!(index in cellCache)) {\n cellCache[index] = cellRenderer(cellRendererProps);\n }\n\n return cellCache[index];\n } else {\n return cellRenderer(cellRendererProps);\n }\n }).filter(function (renderedCell) {\n return !!renderedCell;\n });\n}","import SectionManager from '../SectionManager';\nexport default function calculateSizeAndPositionData(_ref) {\n var cellCount = _ref.cellCount,\n cellSizeAndPositionGetter = _ref.cellSizeAndPositionGetter,\n sectionSize = _ref.sectionSize;\n var cellMetadata = [];\n var sectionManager = new SectionManager(sectionSize);\n var height = 0;\n var width = 0;\n\n for (var index = 0; index < cellCount; index++) {\n var cellMetadatum = cellSizeAndPositionGetter({\n index: index\n });\n\n if (cellMetadatum.height == null || isNaN(cellMetadatum.height) || cellMetadatum.width == null || isNaN(cellMetadatum.width) || cellMetadatum.x == null || isNaN(cellMetadatum.x) || cellMetadatum.y == null || isNaN(cellMetadatum.y)) {\n throw Error(\"Invalid metadata returned for cell \".concat(index, \":\\n x:\").concat(cellMetadatum.x, \", y:\").concat(cellMetadatum.y, \", width:\").concat(cellMetadatum.width, \", height:\").concat(cellMetadatum.height));\n }\n\n height = Math.max(height, cellMetadatum.y + cellMetadatum.height);\n width = Math.max(width, cellMetadatum.x + cellMetadatum.width);\n cellMetadata[index] = cellMetadatum;\n sectionManager.registerCell({\n cellMetadatum: cellMetadatum,\n index: index\n });\n }\n\n return {\n cellMetadata: cellMetadata,\n height: height,\n sectionManager: sectionManager,\n width: width\n };\n}","import Collection from './Collection';\nexport default Collection;\nexport { Collection };","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 PropTypes from 'prop-types';\nimport * as React from 'react';\n/**\n * High-order component that auto-calculates column-widths for `Grid` cells.\n */\n\nvar ColumnSizer = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(ColumnSizer, _React$PureComponent);\n\n function ColumnSizer(props, context) {\n var _this;\n\n _classCallCheck(this, ColumnSizer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ColumnSizer).call(this, props, context));\n _this._registerChild = _this._registerChild.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ColumnSizer, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n columnMaxWidth = _this$props.columnMaxWidth,\n columnMinWidth = _this$props.columnMinWidth,\n columnCount = _this$props.columnCount,\n width = _this$props.width;\n\n if (columnMaxWidth !== prevProps.columnMaxWidth || columnMinWidth !== prevProps.columnMinWidth || columnCount !== prevProps.columnCount || width !== prevProps.width) {\n if (this._registeredChild) {\n this._registeredChild.recomputeGridSize();\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n columnMaxWidth = _this$props2.columnMaxWidth,\n columnMinWidth = _this$props2.columnMinWidth,\n columnCount = _this$props2.columnCount,\n width = _this$props2.width;\n var safeColumnMinWidth = columnMinWidth || 1;\n var safeColumnMaxWidth = columnMaxWidth ? Math.min(columnMaxWidth, width) : width;\n var columnWidth = width / columnCount;\n columnWidth = Math.max(safeColumnMinWidth, columnWidth);\n columnWidth = Math.min(safeColumnMaxWidth, columnWidth);\n columnWidth = Math.floor(columnWidth);\n var adjustedWidth = Math.min(width, columnWidth * columnCount);\n return children({\n adjustedWidth: adjustedWidth,\n columnWidth: columnWidth,\n getColumnWidth: function getColumnWidth() {\n return columnWidth;\n },\n registerChild: this._registerChild\n });\n }\n }, {\n key: \"_registerChild\",\n value: function _registerChild(child) {\n if (child && typeof child.recomputeGridSize !== 'function') {\n throw Error('Unexpected child type registered; only Grid/MultiGrid children are supported.');\n }\n\n this._registeredChild = child;\n\n if (this._registeredChild) {\n this._registeredChild.recomputeGridSize();\n }\n }\n }]);\n\n return ColumnSizer;\n}(React.PureComponent);\n\nexport { ColumnSizer as default };\nColumnSizer.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Function responsible for rendering a virtualized Grid.\n * This function should implement the following signature:\n * ({ adjustedWidth, getColumnWidth, registerChild }) => PropTypes.element\n *\n * The specified :getColumnWidth function should be passed to the Grid's :columnWidth property.\n * The :registerChild should be passed to the Grid's :ref property.\n * The :adjustedWidth property is optional; it reflects the lesser of the overall width or the width of all columns.\n */\n children: PropTypes.func.isRequired,\n\n /** Optional maximum allowed column width */\n columnMaxWidth: PropTypes.number,\n\n /** Optional minimum allowed column width */\n columnMinWidth: PropTypes.number,\n\n /** Number of columns in Grid or Table child */\n columnCount: PropTypes.number.isRequired,\n\n /** Width of Grid or Table child */\n width: PropTypes.number.isRequired\n} : {};","/**\n * Helper method that determines when to recalculate row or column metadata.\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; // 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\n if (cellCount !== nextCellsCount || (typeof cellSize === 'number' || typeof nextCellSize === 'number') && cellSize !== nextCellSize) {\n computeMetadataCallback(computeMetadataCallbackProps); // 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\n if (scrollToIndex >= 0 && scrollToIndex === nextScrollToIndex) {\n updateScrollOffsetForScrollToIndex();\n }\n }\n}","// Properly handle server-side rendering.\nvar win;\n\nif (typeof window !== 'undefined') {\n win = window;\n} else if (typeof self !== 'undefined') {\n win = self;\n} else {\n win = {};\n} // requestAnimationFrame() shim by Paul Irish\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n\n\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 _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n/**\n * Just-in-time calculates and caches size and position information for a collection of cells.\n */\n\nvar CellSizeAndPositionManager = /*#__PURE__*/function () {\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 // Measurements for cells up to this index can be trusted; cells afterward should be estimated.\n // Used in deferred mode to track which cells have been queued for measurement.\n function CellSizeAndPositionManager(_ref) {\n var cellCount = _ref.cellCount,\n cellSizeGetter = _ref.cellSizeGetter,\n estimatedCellSize = _ref.estimatedCellSize;\n\n _classCallCheck(this, CellSizeAndPositionManager);\n\n _defineProperty(this, \"_cellSizeAndPositionData\", {});\n\n _defineProperty(this, \"_lastMeasuredIndex\", -1);\n\n _defineProperty(this, \"_lastBatchedIndex\", -1);\n\n _defineProperty(this, \"_cellCount\", void 0);\n\n _defineProperty(this, \"_cellSizeGetter\", void 0);\n\n _defineProperty(this, \"_estimatedCellSize\", void 0);\n\n this._cellSizeGetter = cellSizeGetter;\n this._cellCount = cellCount;\n this._estimatedCellSize = estimatedCellSize;\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 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 * 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 \".concat(index, \" is outside of range 0..\").concat(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({\n index: i\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\n\n if (size === undefined || isNaN(size)) {\n throw Error(\"Invalid size returned for cell \".concat(i, \" of value \").concat(size));\n } else if (size === null) {\n this._cellSizeAndPositionData[i] = {\n offset: offset,\n size: 0\n };\n this._lastBatchedIndex = index;\n } else {\n this._cellSizeAndPositionData[i] = {\n offset: offset,\n size: size\n };\n offset += size;\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 * 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 * 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 === void 0 ? '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 var idealOffset;\n\n switch (align) {\n case 'start':\n idealOffset = maxOffset;\n break;\n\n case 'end':\n idealOffset = minOffset;\n break;\n\n case 'center':\n idealOffset = maxOffset - (containerSize - datum.size) / 2;\n break;\n\n default:\n idealOffset = Math.max(minOffset, Math.min(maxOffset, currentOffset));\n break;\n }\n\n var totalSize = this.getTotalSize();\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 var totalSize = this.getTotalSize();\n\n if (totalSize === 0) {\n return {};\n }\n\n var maxOffset = offset + containerSize;\n\n var start = this._findNearestCell(offset);\n\n var datum = this.getSizeAndPositionOfCell(start);\n offset = datum.offset + datum.size;\n var stop = start;\n\n while (offset < maxOffset && stop < this._cellCount - 1) {\n stop++;\n offset += this.getSizeAndPositionOfCell(stop).size;\n }\n\n return {\n start: start,\n stop: stop\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 * 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 \".concat(offset, \" specified\"));\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\n\n offset = Math.max(0, offset);\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 { CellSizeAndPositionManager as default };","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\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\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport CellSizeAndPositionManager from './CellSizeAndPositionManager';\nimport { getMaxElementSize } from './maxElementSize.js';\n/**\n * Extends CellSizeAndPositionManager and adds scaling behavior for lists that are too large to fit within a browser's native limits.\n */\n\nvar ScalingCellSizeAndPositionManager = /*#__PURE__*/function () {\n function ScalingCellSizeAndPositionManager(_ref) {\n var _ref$maxScrollSize = _ref.maxScrollSize,\n maxScrollSize = _ref$maxScrollSize === void 0 ? getMaxElementSize() : _ref$maxScrollSize,\n params = _objectWithoutProperties(_ref, [\"maxScrollSize\"]);\n\n _classCallCheck(this, ScalingCellSizeAndPositionManager);\n\n _defineProperty(this, \"_cellSizeAndPositionManager\", void 0);\n\n _defineProperty(this, \"_maxScrollSize\", void 0); // Favor composition over inheritance to simplify IE10 support\n\n\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 * 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\n var safeTotalSize = this.getTotalSize();\n\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 /** See CellSizeAndPositionManager#getTotalSize */\n\n }, {\n key: \"getTotalSize\",\n value: function getTotalSize() {\n return Math.min(this._maxScrollSize, this._cellSizeAndPositionManager.getTotalSize());\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 === void 0 ? 'auto' : _ref3$align,\n containerSize = _ref3.containerSize,\n currentOffset = _ref3.currentOffset,\n targetIndex = _ref3.targetIndex;\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 /** See CellSizeAndPositionManager#getVisibleCellRange */\n\n }, {\n key: \"getVisibleCellRange\",\n value: function getVisibleCellRange(_ref4) {\n var containerSize = _ref4.containerSize,\n offset = _ref4.offset;\n offset = this._safeOffsetToOffset({\n containerSize: containerSize,\n offset: offset\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 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\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\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 { ScalingCellSizeAndPositionManager as default };","/**\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 */\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 var cellCount = cellSizeAndPositionManager.getCellCount();\n var hasScrollToIndex = scrollToIndex >= 0 && scrollToIndex < cellCount;\n var sizeHasChanged = size !== previousSize || sizeJustIncreasedFromZero || !previousCellSize || typeof cellSize === 'number' && cellSize !== previousCellSize; // 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\n if (hasScrollToIndex && (sizeHasChanged || scrollToAlignment !== previousScrollToAlignment || scrollToIndex !== previousScrollToIndex)) {\n updateScrollIndexCallback(scrollToIndex); // 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}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\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 * 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 */\n\nexport var DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150;\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 */\n\nvar SCROLL_POSITION_CHANGE_REASONS = {\n OBSERVED: 'observed',\n REQUESTED: 'requested'\n};\n\nvar renderNull = function renderNull() {\n return null;\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 */\n\n\nvar Grid = (_temp = _class = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(Grid, _React$PureComponent); // Invokes onSectionRendered callback only when start/stop row or column indices change\n\n\n function Grid(props) {\n var _this;\n\n _classCallCheck(this, Grid);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Grid).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"_onGridRenderedMemoizer\", createCallbackMemoizer());\n\n _defineProperty(_assertThisInitialized(_this), \"_onScrollMemoizer\", createCallbackMemoizer(false));\n\n _defineProperty(_assertThisInitialized(_this), \"_deferredInvalidateColumnIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_deferredInvalidateRowIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_recomputeScrollLeftFlag\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"_recomputeScrollTopFlag\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"_horizontalScrollBarSize\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_verticalScrollBarSize\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_scrollbarPresenceChanged\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"_scrollingContainer\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_childrenToDisplay\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_columnStartIndex\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_columnStopIndex\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_rowStartIndex\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_rowStopIndex\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_renderedColumnStartIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_renderedColumnStopIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_renderedRowStartIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_renderedRowStopIndex\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_initialScrollTop\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_initialScrollLeft\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_disablePointerEventsTimeoutId\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_styleCache\", {});\n\n _defineProperty(_assertThisInitialized(_this), \"_cellCache\", {});\n\n _defineProperty(_assertThisInitialized(_this), \"_debounceScrollEndedCallback\", function () {\n _this._disablePointerEventsTimeoutId = null; // isScrolling is used to determine if we reset styleCache\n\n _this.setState({\n isScrolling: false,\n needToResetStyleCache: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_invokeOnGridRenderedHelper\", function () {\n var onSectionRendered = _this.props.onSectionRendered;\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 _defineProperty(_assertThisInitialized(_this), \"_setScrollingContainerRef\", function (ref) {\n _this._scrollingContainer = ref;\n });\n\n _defineProperty(_assertThisInitialized(_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 _this.state = {\n instanceProps: {\n columnSizeAndPositionManager: columnSizeAndPositionManager,\n rowSizeAndPositionManager: rowSizeAndPositionManager,\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 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 needToResetStyleCache: false\n };\n\n if (props.scrollToRow > 0) {\n _this._initialScrollTop = _this._getCalculatedScrollTop(props, _this.state);\n }\n\n if (props.scrollToColumn > 0) {\n _this._initialScrollLeft = _this._getCalculatedScrollLeft(props, _this.state);\n }\n\n return _this;\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 === void 0 ? this.props.scrollToAlignment : _ref$alignment,\n _ref$columnIndex = _ref.columnIndex,\n columnIndex = _ref$columnIndex === void 0 ? this.props.scrollToColumn : _ref$columnIndex,\n _ref$rowIndex = _ref.rowIndex,\n rowIndex = _ref$rowIndex === void 0 ? this.props.scrollToRow : _ref$rowIndex;\n\n var offsetProps = _objectSpread({}, 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 * 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 * 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 * 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 === void 0 ? 0 : _ref2$scrollLeft,\n _ref2$scrollTop = _ref2.scrollTop,\n scrollTopParam = _ref2$scrollTop === void 0 ? 0 : _ref2$scrollTop; // 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\n if (scrollTopParam < 0) {\n return;\n } // Prevent pointer events from interrupting a smooth scroll\n\n\n this._debounceScrollEnded();\n\n var _this$props = this.props,\n autoHeight = _this$props.autoHeight,\n autoWidth = _this$props.autoWidth,\n height = _this$props.height,\n width = _this$props.width;\n var instanceProps = this.state.instanceProps; // 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); // 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\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 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 * 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 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 * 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 _this$props2 = this.props,\n columnCount = _this$props2.columnCount,\n rowCount = _this$props2.rowCount;\n var instanceProps = this.state.instanceProps;\n instanceProps.columnSizeAndPositionManager.getSizeAndPositionOfCell(columnCount - 1);\n instanceProps.rowSizeAndPositionManager.getSizeAndPositionOfCell(rowCount - 1);\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 === void 0 ? 0 : _ref4$columnIndex,\n _ref4$rowIndex = _ref4.rowIndex,\n rowIndex = _ref4$rowIndex === void 0 ? 0 : _ref4$rowIndex;\n\n var _this$props3 = this.props,\n scrollToColumn = _this$props3.scrollToColumn,\n scrollToRow = _this$props3.scrollToRow;\n var instanceProps = this.state.instanceProps;\n instanceProps.columnSizeAndPositionManager.resetCell(columnIndex);\n instanceProps.rowSizeAndPositionManager.resetCell(rowIndex); // 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\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); // Clear cell cache in case we are scrolling;\n // Invalid row heights likely mean invalid cached content as well.\n\n this._styleCache = {};\n this._cellCache = {};\n this.forceUpdate();\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 var props = this.props; // 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\n if (columnCount > 1 && columnIndex !== undefined) {\n this._updateScrollLeftForScrollToColumn(_objectSpread({}, props, {\n scrollToColumn: columnIndex\n }));\n }\n\n if (rowIndex !== undefined) {\n this._updateScrollTopForScrollToRow(_objectSpread({}, props, {\n scrollToRow: rowIndex\n }));\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props4 = this.props,\n getScrollbarSize = _this$props4.getScrollbarSize,\n height = _this$props4.height,\n scrollLeft = _this$props4.scrollLeft,\n scrollToColumn = _this$props4.scrollToColumn,\n scrollTop = _this$props4.scrollTop,\n scrollToRow = _this$props4.scrollToRow,\n width = _this$props4.width;\n var instanceProps = this.state.instanceProps; // Reset initial offsets to be ignored in browser\n\n this._initialScrollTop = 0;\n this._initialScrollLeft = 0; // 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(); // If this component was first rendered server-side, scrollbar size will be undefined.\n // In that event we need to remeasure.\n\n\n if (!instanceProps.scrollbarSizeMeasured) {\n this.setState(function (prevState) {\n var stateUpdate = _objectSpread({}, prevState, {\n needToResetStyleCache: false\n });\n\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\n if (stateUpdate) {\n stateUpdate.needToResetStyleCache = false;\n this.setState(stateUpdate);\n }\n } // refs don't work in `react-test-renderer`\n\n\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\n if (this._scrollingContainer.scrollTop !== this.state.scrollTop) {\n this._scrollingContainer.scrollTop = this.state.scrollTop;\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\n\n var sizeIsBiggerThanZero = height > 0 && width > 0;\n\n if (scrollToColumn >= 0 && sizeIsBiggerThanZero) {\n this._updateScrollLeftForScrollToColumn();\n }\n\n if (scrollToRow >= 0 && sizeIsBiggerThanZero) {\n this._updateScrollTopForScrollToRow();\n } // Update onRowsRendered callback\n\n\n this._invokeOnGridRenderedHelper(); // Initialize onScroll callback\n\n\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 * @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 _this$props5 = this.props,\n autoHeight = _this$props5.autoHeight,\n autoWidth = _this$props5.autoWidth,\n columnCount = _this$props5.columnCount,\n height = _this$props5.height,\n rowCount = _this$props5.rowCount,\n scrollToAlignment = _this$props5.scrollToAlignment,\n scrollToColumn = _this$props5.scrollToColumn,\n scrollToRow = _this$props5.scrollToRow,\n width = _this$props5.width;\n var _this$state = this.state,\n scrollLeft = _this$state.scrollLeft,\n scrollPositionChangeReason = _this$state.scrollPositionChangeReason,\n scrollTop = _this$state.scrollTop,\n instanceProps = _this$state.instanceProps; // 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(); // 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\n\n var columnOrRowCountJustIncreasedFromZero = columnCount > 0 && prevProps.columnCount === 0 || rowCount > 0 && prevProps.rowCount === 0; // 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\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\n if (!autoHeight && scrollTop >= 0 && (scrollTop !== this._scrollingContainer.scrollTop || columnOrRowCountJustIncreasedFromZero)) {\n this._scrollingContainer.scrollTop = scrollTop;\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\n\n var sizeJustIncreasedFromZero = (prevProps.width === 0 || prevProps.height === 0) && height > 0 && width > 0; // 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\n if (this._recomputeScrollLeftFlag) {\n this._recomputeScrollLeftFlag = false;\n\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\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 } // Update onRowsRendered callback if start/stop indices have changed\n\n\n this._invokeOnGridRenderedHelper(); // Changes to :scrollLeft or :scrollTop should also notify :onScroll listeners\n\n\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 * 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 _this$props6 = this.props,\n autoContainerWidth = _this$props6.autoContainerWidth,\n autoHeight = _this$props6.autoHeight,\n autoWidth = _this$props6.autoWidth,\n className = _this$props6.className,\n containerProps = _this$props6.containerProps,\n containerRole = _this$props6.containerRole,\n containerStyle = _this$props6.containerStyle,\n height = _this$props6.height,\n id = _this$props6.id,\n noContentRenderer = _this$props6.noContentRenderer,\n role = _this$props6.role,\n style = _this$props6.style,\n tabIndex = _this$props6.tabIndex,\n width = _this$props6.width;\n var _this$state2 = this.state,\n instanceProps = _this$state2.instanceProps,\n needToResetStyleCache = _this$state2.needToResetStyleCache;\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 } // calculate _styleCache here\n // if state.isScrolling (not from _isScrolling) then reset\n\n\n if (!this.state.isScrolling) {\n this._resetStyleCache();\n } // calculate children to render here\n\n\n this._calculateChildrenToRender(this.props, this.state);\n\n var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();\n var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize(); // 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\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 } // 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\n\n gridStyle.overflowX = totalColumnsWidth + verticalScrollBarSize <= width ? 'hidden' : 'auto';\n gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';\n var childrenToDisplay = this._childrenToDisplay;\n var showNoContentRenderer = childrenToDisplay.length === 0 && height > 0 && width > 0;\n return /*#__PURE__*/React.createElement(\"div\", _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: _objectSpread({}, gridStyle, {}, style),\n tabIndex: tabIndex\n }), childrenToDisplay.length > 0 && /*#__PURE__*/React.createElement(\"div\", {\n className: \"ReactVirtualized__Grid__innerScrollContainer\",\n role: containerRole,\n style: _objectSpread({\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), showNoContentRenderer && noContentRenderer());\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 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 = []; // Render only enough columns and rows to cover the visible area of the grid.\n\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 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 }); // Store for _invokeOnGridRenderedHelper()\n\n this._renderedColumnStartIndex = visibleColumnIndices.start;\n this._renderedColumnStopIndex = visibleColumnIndices.stop;\n this._renderedRowStartIndex = visibleRowIndices.start;\n this._renderedRowStopIndex = visibleRowIndices.stop;\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 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 }); // Store for _invokeOnGridRenderedHelper()\n\n var columnStartIndex = overscanColumnIndices.overscanStartIndex;\n var columnStopIndex = overscanColumnIndices.overscanStopIndex;\n var rowStartIndex = overscanRowIndices.overscanStartIndex;\n var rowStopIndex = overscanRowIndices.overscanStopIndex; // Advanced use-cases (eg CellMeasurer) require batched measurements to determine accurate sizes.\n\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 } // 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\n\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 }); // update the indices\n\n this._columnStartIndex = columnStartIndex;\n this._columnStopIndex = columnStopIndex;\n this._rowStartIndex = rowStartIndex;\n this._rowStopIndex = rowStopIndex;\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 if (this._disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(this._disablePointerEventsTimeoutId);\n }\n\n this._disablePointerEventsTimeoutId = requestAnimationTimeout(this._debounceScrollEndedCallback, scrollingResetTimeInterval);\n }\n }, {\n key: \"_handleInvalidatedGridSize\",\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 this._deferredInvalidateColumnIndex = null;\n this._deferredInvalidateRowIndex = null;\n this.recomputeGridSize({\n columnIndex: columnIndex,\n rowIndex: rowIndex\n });\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 _this3$props = _this3.props,\n height = _this3$props.height,\n onScroll = _this3$props.onScroll,\n width = _this3$props.width;\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; // If isScrolling is defined in props, use it to override the value in state\n // This is a performance optimization for WindowScroller + Grid\n\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 this._scrollbarPresenceChanged = false;\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 * 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 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\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 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; // 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 = {}; // Copy over the visible cell styles so avoid unnecessary re-render.\n\n for (var rowIndex = this._rowStartIndex; rowIndex <= this._rowStopIndex; rowIndex++) {\n for (var columnIndex = this._columnStartIndex; columnIndex <= this._columnStopIndex; columnIndex++) {\n var key = \"\".concat(rowIndex, \"-\").concat(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\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; // 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; // Initially we should not clearStyleCache\n\n newState.needToResetStyleCache = false;\n\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 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 } // If scrolling is controlled outside this component, clear cache when scrolling stops\n\n\n if (nextProps.autoHeight && nextProps.isScrolling === false && instanceProps.prevIsScrolling === true) {\n Object.assign(newState, {\n isScrolling: false\n });\n }\n\n var maybeStateA;\n var maybeStateB;\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 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; // getting scrollBarSize (moved from componentWillMount)\n\n instanceProps.scrollbarSize = nextProps.getScrollbarSize();\n\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 return _objectSpread({}, 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 * 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 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\n return {};\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 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 return instanceProps.columnSizeAndPositionManager.getUpdatedOffsetForIndex({\n align: scrollToAlignment,\n containerSize: width - scrollBarSize,\n currentOffset: scrollLeft,\n targetIndex: targetIndex\n });\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\n return {};\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 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 return instanceProps.rowSizeAndPositionManager.getUpdatedOffsetForIndex({\n align: scrollToAlignment,\n containerSize: height - scrollBarSize,\n currentOffset: scrollTop,\n targetIndex: targetIndex\n });\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\n return {};\n }\n }]);\n\n return Grid;\n}(React.PureComponent), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n \"aria-label\": PropTypes.string.isRequired,\n \"aria-readonly\": PropTypes.bool,\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 * 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 * 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 /** 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 /** 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 /** Optional custom CSS class name to attach to root Grid element. */\n \"className\": PropTypes.string,\n\n /** Number of columns in grid. */\n \"columnCount\": PropTypes.number.isRequired,\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 /** Unfiltered props for the Grid container. */\n \"containerProps\": PropTypes.object,\n\n /** ARIA role for the cell-container. */\n \"containerRole\": PropTypes.string.isRequired,\n\n /** Optional inline style applied to inner cell-container */\n \"containerStyle\": PropTypes.object.isRequired,\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 * 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 * 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 /** Exposed for testing purposes only. */\n \"getScrollbarSize\": PropTypes.func.isRequired,\n\n /** Height of Grid; this property determines the number of visible (vs virtualized) rows. */\n \"height\": PropTypes.number.isRequired,\n\n /** Optional custom id to attach to root Grid element. */\n \"id\": PropTypes.string,\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 * 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 /** 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 * 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 * 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 /** Callback invoked with information about the section of the Grid that was just rendered. */\n \"onSectionRendered\": PropTypes.func.isRequired,\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 * 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 * 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 /** ARIA role for the grid element. */\n \"role\": PropTypes.string.isRequired,\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 /** Number of rows in grid. */\n \"rowCount\": PropTypes.number.isRequired,\n\n /** Wait this amount of time after the last scroll event before resetting Grid `pointer-events`. */\n \"scrollingResetTimeInterval\": PropTypes.number.isRequired,\n\n /** Horizontal offset. */\n \"scrollLeft\": PropTypes.number,\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 /** Column index to ensure visible (by forcefully scrolling if necessary) */\n \"scrollToColumn\": PropTypes.number.isRequired,\n\n /** Vertical offset. */\n \"scrollTop\": PropTypes.number,\n\n /** Row index to ensure visible (by forcefully scrolling if necessary) */\n \"scrollToRow\": PropTypes.number.isRequired,\n\n /** Optional inline style */\n \"style\": PropTypes.object.isRequired,\n\n /** Tab index for focus */\n \"tabIndex\": PropTypes.number,\n\n /** Width of Grid; this property determines the number of visible (vs virtualized) columns. */\n \"width\": PropTypes.number.isRequired\n}), _temp);\n\n_defineProperty(Grid, \"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});\n\npolyfill(Grid);\nexport default Grid;\nimport { bpfrpt_proptype_CellRenderer } from \"./types\";\nimport { bpfrpt_proptype_CellRangeRenderer } from \"./types\";\nimport { bpfrpt_proptype_CellSize } from \"./types\";\nimport { bpfrpt_proptype_NoContentRenderer } from \"./types\";\nimport { bpfrpt_proptype_OverscanIndicesGetter } from \"./types\";\nimport { bpfrpt_proptype_Alignment } from \"./types\";\nimport PropTypes from \"prop-types\";","import { caf, raf } from './animationFrame';\nvar bpfrpt_proptype_AnimationTimeoutId = process.env.NODE_ENV === 'production' ? null : {\n \"id\": PropTypes.number.isRequired\n};\nexport var cancelAnimationTimeout = function cancelAnimationTimeout(frame) {\n return caf(frame.id);\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 */\n\nexport var requestAnimationTimeout = function requestAnimationTimeout(callback, delay) {\n var start; // wait for end of processing current event handler, because event handler may be long\n\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 return frame;\n};\nimport PropTypes from \"prop-types\";\nexport { bpfrpt_proptype_AnimationTimeoutId };","export var SCROLL_DIRECTION_BACKWARD = -1;\nexport var SCROLL_DIRECTION_FORWARD = 1;\nexport var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';\nexport var SCROLL_DIRECTION_VERTICAL = 'vertical';\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}","/**\n * Default implementation of cellRangeRenderer used by Grid.\n * This renderer supports cell-caching while the user is scrolling.\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 var renderedCells = []; // 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\n var areOffsetsAdjusted = columnSizeAndPositionManager.areOffsetsAdjusted() || rowSizeAndPositionManager.areOffsetsAdjusted();\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 = \"\".concat(rowIndex, \"-\").concat(columnIndex);\n var style = void 0; // Cache style objects so shallow-compare doesn't re-render unnecessarily.\n\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 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 var renderedCell = void 0; // 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\n if ((isScrollingOptOut || isScrolling) && !horizontalOffsetAdjustment && !verticalOffsetAdjustment) {\n if (!cellCache[key]) {\n cellCache[key] = cellRenderer(cellRendererParams);\n }\n\n renderedCell = cellCache[key]; // 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 console.warn('Rendered cell should include style property for positioning.');\n }\n }\n }\n}","export var SCROLL_DIRECTION_BACKWARD = -1;\nexport var SCROLL_DIRECTION_FORWARD = 1;\nexport var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';\nexport var SCROLL_DIRECTION_VERTICAL = 'vertical';\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; // 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\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}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _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\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport createCallbackMemoizer from '../utils/createCallbackMemoizer';\n/**\n * Higher-order component that manages lazy-loading for \"infinite\" data.\n * This component decorates a virtual component and just-in-time prefetches rows as a user scrolls.\n * It is intended as a convenience component; fork it if you'd like finer-grained control over data-loading.\n */\n\nvar InfiniteLoader = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(InfiniteLoader, _React$PureComponent);\n\n function InfiniteLoader(props, context) {\n var _this;\n\n _classCallCheck(this, InfiniteLoader);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(InfiniteLoader).call(this, props, context));\n _this._loadMoreRowsMemoizer = createCallbackMemoizer();\n _this._onRowsRendered = _this._onRowsRendered.bind(_assertThisInitialized(_this));\n _this._registerChild = _this._registerChild.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(InfiniteLoader, [{\n key: \"resetLoadMoreRowsCache\",\n value: function resetLoadMoreRowsCache(autoReload) {\n this._loadMoreRowsMemoizer = createCallbackMemoizer();\n\n if (autoReload) {\n this._doStuff(this._lastRenderedStartIndex, this._lastRenderedStopIndex);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n return children({\n onRowsRendered: this._onRowsRendered,\n registerChild: this._registerChild\n });\n }\n }, {\n key: \"_loadUnloadedRanges\",\n value: function _loadUnloadedRanges(unloadedRanges) {\n var _this2 = this;\n\n var loadMoreRows = this.props.loadMoreRows;\n unloadedRanges.forEach(function (unloadedRange) {\n var promise = loadMoreRows(unloadedRange);\n\n if (promise) {\n promise.then(function () {\n // Refresh the visible rows if any of them have just been loaded.\n // Otherwise they will remain in their unloaded visual state.\n if (isRangeVisible({\n lastRenderedStartIndex: _this2._lastRenderedStartIndex,\n lastRenderedStopIndex: _this2._lastRenderedStopIndex,\n startIndex: unloadedRange.startIndex,\n stopIndex: unloadedRange.stopIndex\n })) {\n if (_this2._registeredChild) {\n forceUpdateReactVirtualizedComponent(_this2._registeredChild, _this2._lastRenderedStartIndex);\n }\n }\n });\n }\n });\n }\n }, {\n key: \"_onRowsRendered\",\n value: function _onRowsRendered(_ref) {\n var startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n this._lastRenderedStartIndex = startIndex;\n this._lastRenderedStopIndex = stopIndex;\n\n this._doStuff(startIndex, stopIndex);\n }\n }, {\n key: \"_doStuff\",\n value: function _doStuff(startIndex, stopIndex) {\n var _ref2,\n _this3 = this;\n\n var _this$props = this.props,\n isRowLoaded = _this$props.isRowLoaded,\n minimumBatchSize = _this$props.minimumBatchSize,\n rowCount = _this$props.rowCount,\n threshold = _this$props.threshold;\n var unloadedRanges = scanForUnloadedRanges({\n isRowLoaded: isRowLoaded,\n minimumBatchSize: minimumBatchSize,\n rowCount: rowCount,\n startIndex: Math.max(0, startIndex - threshold),\n stopIndex: Math.min(rowCount - 1, stopIndex + threshold)\n }); // For memoize comparison\n\n var squashedUnloadedRanges = (_ref2 = []).concat.apply(_ref2, _toConsumableArray(unloadedRanges.map(function (_ref3) {\n var startIndex = _ref3.startIndex,\n stopIndex = _ref3.stopIndex;\n return [startIndex, stopIndex];\n })));\n\n this._loadMoreRowsMemoizer({\n callback: function callback() {\n _this3._loadUnloadedRanges(unloadedRanges);\n },\n indices: {\n squashedUnloadedRanges: squashedUnloadedRanges\n }\n });\n }\n }, {\n key: \"_registerChild\",\n value: function _registerChild(registeredChild) {\n this._registeredChild = registeredChild;\n }\n }]);\n\n return InfiniteLoader;\n}(React.PureComponent);\n/**\n * Determines if the specified start/stop range is visible based on the most recently rendered range.\n */\n\n\n_defineProperty(InfiniteLoader, \"defaultProps\", {\n minimumBatchSize: 10,\n rowCount: 0,\n threshold: 15\n});\n\nexport { InfiniteLoader as default };\nInfiniteLoader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Function responsible for rendering a virtualized component.\n * This function should implement the following signature:\n * ({ onRowsRendered, registerChild }) => PropTypes.element\n *\n * The specified :onRowsRendered function should be passed through to the child's :onRowsRendered property.\n * The :registerChild callback should be set as the virtualized component's :ref.\n */\n children: PropTypes.func.isRequired,\n\n /**\n * Function responsible for tracking the loaded state of each row.\n * It should implement the following signature: ({ index: number }): boolean\n */\n isRowLoaded: PropTypes.func.isRequired,\n\n /**\n * Callback to be invoked when more rows must be loaded.\n * It should implement the following signature: ({ startIndex, stopIndex }): Promise\n * The returned Promise should be resolved once row data has finished loading.\n * It will be used to determine when to refresh the list with the newly-loaded data.\n * This callback may be called multiple times in reaction to a single scroll event.\n */\n loadMoreRows: PropTypes.func.isRequired,\n\n /**\n * Minimum number of rows to be loaded at a time.\n * This property can be used to batch requests to reduce HTTP requests.\n */\n minimumBatchSize: PropTypes.number.isRequired,\n\n /**\n * Number of rows in list; can be arbitrary high number if actual number is unknown.\n */\n rowCount: PropTypes.number.isRequired,\n\n /**\n * Threshold at which to pre-fetch data.\n * A threshold X means that data will start loading when a user scrolls within X rows.\n * This value defaults to 15.\n */\n threshold: PropTypes.number.isRequired\n} : {};\nexport function isRangeVisible(_ref4) {\n var lastRenderedStartIndex = _ref4.lastRenderedStartIndex,\n lastRenderedStopIndex = _ref4.lastRenderedStopIndex,\n startIndex = _ref4.startIndex,\n stopIndex = _ref4.stopIndex;\n return !(startIndex > lastRenderedStopIndex || stopIndex < lastRenderedStartIndex);\n}\n/**\n * Returns all of the ranges within a larger range that contain unloaded rows.\n */\n\nexport function scanForUnloadedRanges(_ref5) {\n var isRowLoaded = _ref5.isRowLoaded,\n minimumBatchSize = _ref5.minimumBatchSize,\n rowCount = _ref5.rowCount,\n startIndex = _ref5.startIndex,\n stopIndex = _ref5.stopIndex;\n var unloadedRanges = [];\n var rangeStartIndex = null;\n var rangeStopIndex = null;\n\n for (var index = startIndex; index <= stopIndex; index++) {\n var loaded = isRowLoaded({\n index: index\n });\n\n if (!loaded) {\n rangeStopIndex = index;\n\n if (rangeStartIndex === null) {\n rangeStartIndex = index;\n }\n } else if (rangeStopIndex !== null) {\n unloadedRanges.push({\n startIndex: rangeStartIndex,\n stopIndex: rangeStopIndex\n });\n rangeStartIndex = rangeStopIndex = null;\n }\n } // If :rangeStopIndex is not null it means we haven't ran out of unloaded rows.\n // Scan forward to try filling our :minimumBatchSize.\n\n\n if (rangeStopIndex !== null) {\n var potentialStopIndex = Math.min(Math.max(rangeStopIndex, rangeStartIndex + minimumBatchSize - 1), rowCount - 1);\n\n for (var _index = rangeStopIndex + 1; _index <= potentialStopIndex; _index++) {\n if (!isRowLoaded({\n index: _index\n })) {\n rangeStopIndex = _index;\n } else {\n break;\n }\n }\n\n unloadedRanges.push({\n startIndex: rangeStartIndex,\n stopIndex: rangeStopIndex\n });\n } // Check to see if our first range ended prematurely.\n // In this case we should scan backwards to try filling our :minimumBatchSize.\n\n\n if (unloadedRanges.length) {\n var firstUnloadedRange = unloadedRanges[0];\n\n while (firstUnloadedRange.stopIndex - firstUnloadedRange.startIndex + 1 < minimumBatchSize && firstUnloadedRange.startIndex > 0) {\n var _index2 = firstUnloadedRange.startIndex - 1;\n\n if (!isRowLoaded({\n index: _index2\n })) {\n firstUnloadedRange.startIndex = _index2;\n } else {\n break;\n }\n }\n }\n\n return unloadedRanges;\n}\n/**\n * Since RV components use shallowCompare we need to force a render (even though props haven't changed).\n * However InfiniteLoader may wrap a Grid or it may wrap a Table or List.\n * In the first case the built-in React forceUpdate() method is sufficient to force a re-render,\n * But in the latter cases we need to use the RV-specific forceUpdateGrid() method.\n * Else the inner Grid will not be re-rendered and visuals may be stale.\n *\n * Additionally, while a Grid is scrolling the cells can be cached,\n * So it's important to invalidate that cache by recalculating sizes\n * before forcing a rerender.\n */\n\nexport function forceUpdateReactVirtualizedComponent(component) {\n var currentIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var recomputeSize = typeof component.recomputeGridSize === 'function' ? component.recomputeGridSize : component.recomputeRowHeights;\n\n if (recomputeSize) {\n recomputeSize.call(component, currentIndex);\n } else {\n component.forceUpdate();\n }\n}","import InfiniteLoader from './InfiniteLoader';\nexport default InfiniteLoader;\nexport { InfiniteLoader };","import _extends from \"@babel/runtime/helpers/extends\";\nimport _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 Grid, { accessibilityOverscanIndicesGetter } from '../Grid';\nimport * as React from 'react';\nimport clsx from 'clsx';\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 = (_temp = _class = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(List, _React$PureComponent);\n\n function List() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, List);\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(List)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"Grid\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_cellRenderer\", function (_ref) {\n var parent = _ref.parent,\n rowIndex = _ref.rowIndex,\n style = _ref.style,\n isScrolling = _ref.isScrolling,\n isVisible = _ref.isVisible,\n key = _ref.key;\n var rowRenderer = _this.props.rowRenderer; // 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 widthDescriptor = Object.getOwnPropertyDescriptor(style, 'width');\n\n if (widthDescriptor && widthDescriptor.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 });\n\n _defineProperty(_assertThisInitialized(_this), \"_setRef\", function (ref) {\n _this.Grid = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScroll\", function (_ref2) {\n var clientHeight = _ref2.clientHeight,\n scrollHeight = _ref2.scrollHeight,\n scrollTop = _ref2.scrollTop;\n var onScroll = _this.props.onScroll;\n onScroll({\n clientHeight: clientHeight,\n scrollHeight: scrollHeight,\n scrollTop: scrollTop\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onSectionRendered\", function (_ref3) {\n var rowOverscanStartIndex = _ref3.rowOverscanStartIndex,\n rowOverscanStopIndex = _ref3.rowOverscanStopIndex,\n rowStartIndex = _ref3.rowStartIndex,\n rowStopIndex = _ref3.rowStopIndex;\n var onRowsRendered = _this.props.onRowsRendered;\n onRowsRendered({\n overscanStartIndex: rowOverscanStartIndex,\n overscanStopIndex: rowOverscanStopIndex,\n startIndex: rowStartIndex,\n stopIndex: rowStopIndex\n });\n });\n\n return _this;\n }\n\n _createClass(List, [{\n key: \"forceUpdateGrid\",\n value: function forceUpdateGrid() {\n if (this.Grid) {\n this.Grid.forceUpdate();\n }\n }\n /** See Grid#getOffsetForCell */\n\n }, {\n key: \"getOffsetForRow\",\n value: function getOffsetForRow(_ref4) {\n var alignment = _ref4.alignment,\n index = _ref4.index;\n\n if (this.Grid) {\n var _this$Grid$getOffsetF = this.Grid.getOffsetForCell({\n alignment: alignment,\n rowIndex: index,\n columnIndex: 0\n }),\n scrollTop = _this$Grid$getOffsetF.scrollTop;\n\n return scrollTop;\n }\n\n return 0;\n }\n /** CellMeasurer compatibility */\n\n }, {\n key: \"invalidateCellSizeAfterRender\",\n value: function invalidateCellSizeAfterRender(_ref5) {\n var columnIndex = _ref5.columnIndex,\n rowIndex = _ref5.rowIndex;\n\n if (this.Grid) {\n this.Grid.invalidateCellSizeAfterRender({\n rowIndex: rowIndex,\n columnIndex: columnIndex\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 /** CellMeasurer compatibility */\n\n }, {\n key: \"recomputeGridSize\",\n value: function recomputeGridSize() {\n var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref6$columnIndex = _ref6.columnIndex,\n columnIndex = _ref6$columnIndex === void 0 ? 0 : _ref6$columnIndex,\n _ref6$rowIndex = _ref6.rowIndex,\n rowIndex = _ref6$rowIndex === void 0 ? 0 : _ref6$rowIndex;\n\n if (this.Grid) {\n this.Grid.recomputeGridSize({\n rowIndex: rowIndex,\n columnIndex: columnIndex\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 /** 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({\n 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 _this$props = this.props,\n className = _this$props.className,\n noRowsRenderer = _this$props.noRowsRenderer,\n scrollToIndex = _this$props.scrollToIndex,\n width = _this$props.width;\n var classNames = clsx('ReactVirtualized__List', className);\n return /*#__PURE__*/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), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n \"aria-label\": PropTypes.string,\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 /** Optional CSS class name */\n \"className\": PropTypes.string,\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 /** Height constraint for list (determines how many actual rows are rendered) */\n \"height\": PropTypes.number.isRequired,\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 /** Callback invoked with information about the slice of rows that were just rendered. */\n \"onRowsRendered\": PropTypes.func.isRequired,\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 /** 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 * 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 /** 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 /** 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 /** Number of rows in list. */\n \"rowCount\": PropTypes.number.isRequired,\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 /** Row index to ensure visible (by forcefully scrolling if necessary) */\n \"scrollToIndex\": PropTypes.number.isRequired,\n\n /** Vertical offset. */\n \"scrollTop\": PropTypes.number,\n\n /** Optional inline style */\n \"style\": PropTypes.object.isRequired,\n\n /** Tab index for focus */\n \"tabIndex\": PropTypes.number,\n\n /** Width of list */\n \"width\": PropTypes.number.isRequired\n}), _temp);\n\n_defineProperty(List, \"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});\n\nexport { List as default };\nimport { bpfrpt_proptype_NoContentRenderer } from \"../Grid\";\nimport { bpfrpt_proptype_Alignment } from \"../Grid\";\nimport { bpfrpt_proptype_CellSize } from \"../Grid\";\nimport { bpfrpt_proptype_OverscanIndicesGetter } from \"../Grid\";\nimport { bpfrpt_proptype_RowRenderer } from \"./types\";\nimport PropTypes from \"prop-types\";","/**\n * Binary Search Bounds\n * https://github.com/mikolalysenko/binary-search-bounds\n * Mikola Lysenko\n *\n * Inlined because of Content Security Policy issue caused by the use of `new Function(...)` syntax.\n * Issue reported here: https://github.com/mikolalysenko/binary-search-bounds/issues/5\n **/\nfunction _GEA(a, l, h, y) {\n var i = h + 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (x >= y) {\n i = m;\n h = m - 1;\n } else {\n l = m + 1;\n }\n }\n\n return i;\n}\n\nfunction _GEP(a, l, h, y, c) {\n var i = h + 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (c(x, y) >= 0) {\n i = m;\n h = m - 1;\n } else {\n l = m + 1;\n }\n }\n\n return i;\n}\n\nfunction dispatchBsearchGE(a, y, c, l, h) {\n if (typeof c === 'function') {\n return _GEP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);\n } else {\n return _GEA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);\n }\n}\n\nfunction _GTA(a, l, h, y) {\n var i = h + 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (x > y) {\n i = m;\n h = m - 1;\n } else {\n l = m + 1;\n }\n }\n\n return i;\n}\n\nfunction _GTP(a, l, h, y, c) {\n var i = h + 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (c(x, y) > 0) {\n i = m;\n h = m - 1;\n } else {\n l = m + 1;\n }\n }\n\n return i;\n}\n\nfunction dispatchBsearchGT(a, y, c, l, h) {\n if (typeof c === 'function') {\n return _GTP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);\n } else {\n return _GTA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);\n }\n}\n\nfunction _LTA(a, l, h, y) {\n var i = l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (x < y) {\n i = m;\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return i;\n}\n\nfunction _LTP(a, l, h, y, c) {\n var i = l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (c(x, y) < 0) {\n i = m;\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return i;\n}\n\nfunction dispatchBsearchLT(a, y, c, l, h) {\n if (typeof c === 'function') {\n return _LTP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);\n } else {\n return _LTA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);\n }\n}\n\nfunction _LEA(a, l, h, y) {\n var i = l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (x <= y) {\n i = m;\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return i;\n}\n\nfunction _LEP(a, l, h, y, c) {\n var i = l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (c(x, y) <= 0) {\n i = m;\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return i;\n}\n\nfunction dispatchBsearchLE(a, y, c, l, h) {\n if (typeof c === 'function') {\n return _LEP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);\n } else {\n return _LEA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);\n }\n}\n\nfunction _EQA(a, l, h, y) {\n l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n\n if (x === y) {\n return m;\n } else if (x <= y) {\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return -1;\n}\n\nfunction _EQP(a, l, h, y, c) {\n l - 1;\n\n while (l <= h) {\n var m = l + h >>> 1,\n x = a[m];\n var p = c(x, y);\n\n if (p === 0) {\n return m;\n } else if (p <= 0) {\n l = m + 1;\n } else {\n h = m - 1;\n }\n }\n\n return -1;\n}\n\nfunction dispatchBsearchEQ(a, y, c, l, h) {\n if (typeof c === 'function') {\n return _EQP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);\n } else {\n return _EQA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);\n }\n}\n\nexport default {\n ge: dispatchBsearchGE,\n gt: dispatchBsearchGT,\n lt: dispatchBsearchLT,\n le: dispatchBsearchLE,\n eq: dispatchBsearchEQ\n};","/**\n * Binary Search Bounds\n * https://github.com/mikolalysenko/interval-tree-1d\n * Mikola Lysenko\n *\n * Inlined because of Content Security Policy issue caused by the use of `new Function(...)` syntax in an upstream dependency.\n * Issue reported here: https://github.com/mikolalysenko/binary-search-bounds/issues/5\n **/\nimport bounds from './binarySearchBounds';\nvar NOT_FOUND = 0;\nvar SUCCESS = 1;\nvar EMPTY = 2;\n\nfunction IntervalTreeNode(mid, left, right, leftPoints, rightPoints) {\n this.mid = mid;\n this.left = left;\n this.right = right;\n this.leftPoints = leftPoints;\n this.rightPoints = rightPoints;\n this.count = (left ? left.count : 0) + (right ? right.count : 0) + leftPoints.length;\n}\n\nvar proto = IntervalTreeNode.prototype;\n\nfunction copy(a, b) {\n a.mid = b.mid;\n a.left = b.left;\n a.right = b.right;\n a.leftPoints = b.leftPoints;\n a.rightPoints = b.rightPoints;\n a.count = b.count;\n}\n\nfunction rebuild(node, intervals) {\n var ntree = createIntervalTree(intervals);\n node.mid = ntree.mid;\n node.left = ntree.left;\n node.right = ntree.right;\n node.leftPoints = ntree.leftPoints;\n node.rightPoints = ntree.rightPoints;\n node.count = ntree.count;\n}\n\nfunction rebuildWithInterval(node, interval) {\n var intervals = node.intervals([]);\n intervals.push(interval);\n rebuild(node, intervals);\n}\n\nfunction rebuildWithoutInterval(node, interval) {\n var intervals = node.intervals([]);\n var idx = intervals.indexOf(interval);\n\n if (idx < 0) {\n return NOT_FOUND;\n }\n\n intervals.splice(idx, 1);\n rebuild(node, intervals);\n return SUCCESS;\n}\n\nproto.intervals = function (result) {\n result.push.apply(result, this.leftPoints);\n\n if (this.left) {\n this.left.intervals(result);\n }\n\n if (this.right) {\n this.right.intervals(result);\n }\n\n return result;\n};\n\nproto.insert = function (interval) {\n var weight = this.count - this.leftPoints.length;\n this.count += 1;\n\n if (interval[1] < this.mid) {\n if (this.left) {\n if (4 * (this.left.count + 1) > 3 * (weight + 1)) {\n rebuildWithInterval(this, interval);\n } else {\n this.left.insert(interval);\n }\n } else {\n this.left = createIntervalTree([interval]);\n }\n } else if (interval[0] > this.mid) {\n if (this.right) {\n if (4 * (this.right.count + 1) > 3 * (weight + 1)) {\n rebuildWithInterval(this, interval);\n } else {\n this.right.insert(interval);\n }\n } else {\n this.right = createIntervalTree([interval]);\n }\n } else {\n var l = bounds.ge(this.leftPoints, interval, compareBegin);\n var r = bounds.ge(this.rightPoints, interval, compareEnd);\n this.leftPoints.splice(l, 0, interval);\n this.rightPoints.splice(r, 0, interval);\n }\n};\n\nproto.remove = function (interval) {\n var weight = this.count - this.leftPoints;\n\n if (interval[1] < this.mid) {\n if (!this.left) {\n return NOT_FOUND;\n }\n\n var rw = this.right ? this.right.count : 0;\n\n if (4 * rw > 3 * (weight - 1)) {\n return rebuildWithoutInterval(this, interval);\n }\n\n var r = this.left.remove(interval);\n\n if (r === EMPTY) {\n this.left = null;\n this.count -= 1;\n return SUCCESS;\n } else if (r === SUCCESS) {\n this.count -= 1;\n }\n\n return r;\n } else if (interval[0] > this.mid) {\n if (!this.right) {\n return NOT_FOUND;\n }\n\n var lw = this.left ? this.left.count : 0;\n\n if (4 * lw > 3 * (weight - 1)) {\n return rebuildWithoutInterval(this, interval);\n }\n\n var r = this.right.remove(interval);\n\n if (r === EMPTY) {\n this.right = null;\n this.count -= 1;\n return SUCCESS;\n } else if (r === SUCCESS) {\n this.count -= 1;\n }\n\n return r;\n } else {\n if (this.count === 1) {\n if (this.leftPoints[0] === interval) {\n return EMPTY;\n } else {\n return NOT_FOUND;\n }\n }\n\n if (this.leftPoints.length === 1 && this.leftPoints[0] === interval) {\n if (this.left && this.right) {\n var p = this;\n var n = this.left;\n\n while (n.right) {\n p = n;\n n = n.right;\n }\n\n if (p === this) {\n n.right = this.right;\n } else {\n var l = this.left;\n var r = this.right;\n p.count -= n.count;\n p.right = n.left;\n n.left = l;\n n.right = r;\n }\n\n copy(this, n);\n this.count = (this.left ? this.left.count : 0) + (this.right ? this.right.count : 0) + this.leftPoints.length;\n } else if (this.left) {\n copy(this, this.left);\n } else {\n copy(this, this.right);\n }\n\n return SUCCESS;\n }\n\n for (var l = bounds.ge(this.leftPoints, interval, compareBegin); l < this.leftPoints.length; ++l) {\n if (this.leftPoints[l][0] !== interval[0]) {\n break;\n }\n\n if (this.leftPoints[l] === interval) {\n this.count -= 1;\n this.leftPoints.splice(l, 1);\n\n for (var r = bounds.ge(this.rightPoints, interval, compareEnd); r < this.rightPoints.length; ++r) {\n if (this.rightPoints[r][1] !== interval[1]) {\n break;\n } else if (this.rightPoints[r] === interval) {\n this.rightPoints.splice(r, 1);\n return SUCCESS;\n }\n }\n }\n }\n\n return NOT_FOUND;\n }\n};\n\nfunction reportLeftRange(arr, hi, cb) {\n for (var i = 0; i < arr.length && arr[i][0] <= hi; ++i) {\n var r = cb(arr[i]);\n\n if (r) {\n return r;\n }\n }\n}\n\nfunction reportRightRange(arr, lo, cb) {\n for (var i = arr.length - 1; i >= 0 && arr[i][1] >= lo; --i) {\n var r = cb(arr[i]);\n\n if (r) {\n return r;\n }\n }\n}\n\nfunction reportRange(arr, cb) {\n for (var i = 0; i < arr.length; ++i) {\n var r = cb(arr[i]);\n\n if (r) {\n return r;\n }\n }\n}\n\nproto.queryPoint = function (x, cb) {\n if (x < this.mid) {\n if (this.left) {\n var r = this.left.queryPoint(x, cb);\n\n if (r) {\n return r;\n }\n }\n\n return reportLeftRange(this.leftPoints, x, cb);\n } else if (x > this.mid) {\n if (this.right) {\n var r = this.right.queryPoint(x, cb);\n\n if (r) {\n return r;\n }\n }\n\n return reportRightRange(this.rightPoints, x, cb);\n } else {\n return reportRange(this.leftPoints, cb);\n }\n};\n\nproto.queryInterval = function (lo, hi, cb) {\n if (lo < this.mid && this.left) {\n var r = this.left.queryInterval(lo, hi, cb);\n\n if (r) {\n return r;\n }\n }\n\n if (hi > this.mid && this.right) {\n var r = this.right.queryInterval(lo, hi, cb);\n\n if (r) {\n return r;\n }\n }\n\n if (hi < this.mid) {\n return reportLeftRange(this.leftPoints, hi, cb);\n } else if (lo > this.mid) {\n return reportRightRange(this.rightPoints, lo, cb);\n } else {\n return reportRange(this.leftPoints, cb);\n }\n};\n\nfunction compareNumbers(a, b) {\n return a - b;\n}\n\nfunction compareBegin(a, b) {\n var d = a[0] - b[0];\n\n if (d) {\n return d;\n }\n\n return a[1] - b[1];\n}\n\nfunction compareEnd(a, b) {\n var d = a[1] - b[1];\n\n if (d) {\n return d;\n }\n\n return a[0] - b[0];\n}\n\nfunction createIntervalTree(intervals) {\n if (intervals.length === 0) {\n return null;\n }\n\n var pts = [];\n\n for (var i = 0; i < intervals.length; ++i) {\n pts.push(intervals[i][0], intervals[i][1]);\n }\n\n pts.sort(compareNumbers);\n var mid = pts[pts.length >> 1];\n var leftIntervals = [];\n var rightIntervals = [];\n var centerIntervals = [];\n\n for (var i = 0; i < intervals.length; ++i) {\n var s = intervals[i];\n\n if (s[1] < mid) {\n leftIntervals.push(s);\n } else if (mid < s[0]) {\n rightIntervals.push(s);\n } else {\n centerIntervals.push(s);\n }\n } //Split center intervals\n\n\n var leftPoints = centerIntervals;\n var rightPoints = centerIntervals.slice();\n leftPoints.sort(compareBegin);\n rightPoints.sort(compareEnd);\n return new IntervalTreeNode(mid, createIntervalTree(leftIntervals), createIntervalTree(rightIntervals), leftPoints, rightPoints);\n} //User friendly wrapper that makes it possible to support empty trees\n\n\nfunction IntervalTree(root) {\n this.root = root;\n}\n\nvar tproto = IntervalTree.prototype;\n\ntproto.insert = function (interval) {\n if (this.root) {\n this.root.insert(interval);\n } else {\n this.root = new IntervalTreeNode(interval[0], null, null, [interval], [interval]);\n }\n};\n\ntproto.remove = function (interval) {\n if (this.root) {\n var r = this.root.remove(interval);\n\n if (r === EMPTY) {\n this.root = null;\n }\n\n return r !== NOT_FOUND;\n }\n\n return false;\n};\n\ntproto.queryPoint = function (p, cb) {\n if (this.root) {\n return this.root.queryPoint(p, cb);\n }\n};\n\ntproto.queryInterval = function (lo, hi, cb) {\n if (lo <= hi && this.root) {\n return this.root.queryInterval(lo, hi, cb);\n }\n};\n\nObject.defineProperty(tproto, 'count', {\n get: function get() {\n if (this.root) {\n return this.root.count;\n }\n\n return 0;\n }\n});\nObject.defineProperty(tproto, 'intervals', {\n get: function get() {\n if (this.root) {\n return this.root.intervals([]);\n }\n\n return [];\n }\n});\nexport default function createWrapper(intervals) {\n if (!intervals || intervals.length === 0) {\n return new IntervalTree(null);\n }\n\n return new IntervalTree(createIntervalTree(intervals));\n}","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport createIntervalTree from '../vendor/intervalTree'; // Position cache requirements:\n// O(log(n)) lookup of cells to render for a given viewport size\n// O(1) lookup of shortest measured column (so we know when to enter phase 1)\n\nvar PositionCache = /*#__PURE__*/function () {\n function PositionCache() {\n _classCallCheck(this, PositionCache);\n\n _defineProperty(this, \"_columnSizeMap\", {});\n\n _defineProperty(this, \"_intervalTree\", createIntervalTree());\n\n _defineProperty(this, \"_leftMap\", {});\n }\n\n _createClass(PositionCache, [{\n key: \"estimateTotalHeight\",\n value: function estimateTotalHeight(cellCount, columnCount, defaultCellHeight) {\n var unmeasuredCellCount = cellCount - this.count;\n return this.tallestColumnSize + Math.ceil(unmeasuredCellCount / columnCount) * defaultCellHeight;\n } // Render all cells visible within the viewport range defined.\n\n }, {\n key: \"range\",\n value: function range(scrollTop, clientHeight, renderCallback) {\n var _this = this;\n\n this._intervalTree.queryInterval(scrollTop, scrollTop + clientHeight, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n top = _ref2[0],\n _ = _ref2[1],\n index = _ref2[2];\n\n return renderCallback(index, _this._leftMap[index], top);\n });\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(index, left, top, height) {\n this._intervalTree.insert([top, top + height, index]);\n\n this._leftMap[index] = left;\n var columnSizeMap = this._columnSizeMap;\n var columnHeight = columnSizeMap[left];\n\n if (columnHeight === undefined) {\n columnSizeMap[left] = top + height;\n } else {\n columnSizeMap[left] = Math.max(columnHeight, top + height);\n }\n }\n }, {\n key: \"count\",\n get: function get() {\n return this._intervalTree.count;\n }\n }, {\n key: \"shortestColumnSize\",\n get: function get() {\n var columnSizeMap = this._columnSizeMap;\n var size = 0;\n\n for (var i in columnSizeMap) {\n var height = columnSizeMap[i];\n size = size === 0 ? height : Math.min(size, height);\n }\n\n return size;\n }\n }, {\n key: \"tallestColumnSize\",\n get: function get() {\n var columnSizeMap = this._columnSizeMap;\n var size = 0;\n\n for (var i in columnSizeMap) {\n var height = columnSizeMap[i];\n size = Math.max(size, height);\n }\n\n return size;\n }\n }]);\n\n return PositionCache;\n}();\n\nexport { PositionCache as default };","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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport clsx from 'clsx';\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport PositionCache from './PositionCache';\nimport { requestAnimationTimeout, cancelAnimationTimeout } from '../utils/requestAnimationTimeout';\nvar emptyObject = {};\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 */\n\nexport var DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150;\n/**\n * This component efficiently displays arbitrarily positioned cells using windowing techniques.\n * Cell position is determined by an injected `cellPositioner` property.\n * Windowing is vertical; this component does not support horizontal scrolling.\n *\n * Rendering occurs in two phases:\n * 1) First pass uses estimated cell sizes (provided by the cache) to determine how many cells to measure in a batch.\n * Batch size is chosen using a fast, naive layout algorithm that stacks images in order until the viewport has been filled.\n * After measurement is complete (componentDidMount or componentDidUpdate) this component evaluates positioned cells\n * in order to determine if another measurement pass is required (eg if actual cell sizes were less than estimated sizes).\n * All measurements are permanently cached (keyed by `keyMapper`) for performance purposes.\n * 2) Second pass uses the external `cellPositioner` to layout cells.\n * At this time the positioner has access to cached size measurements for all cells.\n * The positions it returns are cached by Masonry for fast access later.\n * Phase one is repeated if the user scrolls beyond the current layout's bounds.\n * If the layout is invalidated due to eg a resize, cached positions can be cleared using `recomputeCellPositions()`.\n *\n * Animation constraints:\n * Simple animations are supported (eg translate/slide into place on initial reveal).\n * More complex animations are not (eg flying from one position to another on resize).\n *\n * Layout constraints:\n * This component supports multi-column layout.\n * The height of each item may vary.\n * The width of each item must not exceed the width of the column it is \"in\".\n * The left position of all items within a column must align.\n * (Items may not span multiple columns.)\n */\n\nvar Masonry = (_temp = _class = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(Masonry, _React$PureComponent);\n\n function Masonry() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Masonry);\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(Masonry)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n isScrolling: false,\n scrollTop: 0\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_debounceResetIsScrollingId\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_invalidateOnUpdateStartIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_invalidateOnUpdateStopIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_positionCache\", new PositionCache());\n\n _defineProperty(_assertThisInitialized(_this), \"_startIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_startIndexMemoized\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_stopIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_stopIndexMemoized\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_debounceResetIsScrollingCallback\", function () {\n _this.setState({\n isScrolling: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_setScrollingContainerRef\", function (ref) {\n _this._scrollingContainer = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScroll\", function (event) {\n var height = _this.props.height;\n var eventScrollTop = event.currentTarget.scrollTop; // 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 scrollTop = Math.min(Math.max(0, _this._getEstimatedTotalHeight() - height), eventScrollTop); // On iOS, we can arrive at negative offsets by swiping past the start or end.\n // Avoid re-rendering in this case as it can cause problems; see #532 for more.\n\n if (eventScrollTop !== scrollTop) {\n return;\n } // Prevent pointer events from interrupting a smooth scroll\n\n\n _this._debounceResetIsScrolling(); // 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\n\n if (_this.state.scrollTop !== scrollTop) {\n _this.setState({\n isScrolling: true,\n scrollTop: scrollTop\n });\n }\n });\n\n return _this;\n }\n\n _createClass(Masonry, [{\n key: \"clearCellPositions\",\n value: function clearCellPositions() {\n this._positionCache = new PositionCache();\n this.forceUpdate();\n } // HACK This method signature was intended for Grid\n\n }, {\n key: \"invalidateCellSizeAfterRender\",\n value: function invalidateCellSizeAfterRender(_ref) {\n var index = _ref.rowIndex;\n\n if (this._invalidateOnUpdateStartIndex === null) {\n this._invalidateOnUpdateStartIndex = index;\n this._invalidateOnUpdateStopIndex = index;\n } else {\n this._invalidateOnUpdateStartIndex = Math.min(this._invalidateOnUpdateStartIndex, index);\n this._invalidateOnUpdateStopIndex = Math.max(this._invalidateOnUpdateStopIndex, index);\n }\n }\n }, {\n key: \"recomputeCellPositions\",\n value: function recomputeCellPositions() {\n var stopIndex = this._positionCache.count - 1;\n this._positionCache = new PositionCache();\n\n this._populatePositionCache(0, stopIndex);\n\n this.forceUpdate();\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this._checkInvalidateOnUpdate();\n\n this._invokeOnScrollCallback();\n\n this._invokeOnCellsRenderedCallback();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n this._checkInvalidateOnUpdate();\n\n this._invokeOnScrollCallback();\n\n this._invokeOnCellsRenderedCallback();\n\n if (this.props.scrollTop !== prevProps.scrollTop) {\n this._debounceResetIsScrolling();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this._debounceResetIsScrollingId) {\n cancelAnimationTimeout(this._debounceResetIsScrollingId);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n autoHeight = _this$props.autoHeight,\n cellCount = _this$props.cellCount,\n cellMeasurerCache = _this$props.cellMeasurerCache,\n cellRenderer = _this$props.cellRenderer,\n className = _this$props.className,\n height = _this$props.height,\n id = _this$props.id,\n keyMapper = _this$props.keyMapper,\n overscanByPixels = _this$props.overscanByPixels,\n role = _this$props.role,\n style = _this$props.style,\n tabIndex = _this$props.tabIndex,\n width = _this$props.width,\n rowDirection = _this$props.rowDirection;\n var _this$state = this.state,\n isScrolling = _this$state.isScrolling,\n scrollTop = _this$state.scrollTop;\n var children = [];\n\n var estimateTotalHeight = this._getEstimatedTotalHeight();\n\n var shortestColumnSize = this._positionCache.shortestColumnSize;\n var measuredCellCount = this._positionCache.count;\n var startIndex = 0;\n var stopIndex;\n\n this._positionCache.range(Math.max(0, scrollTop - overscanByPixels), height + overscanByPixels * 2, function (index, left, top) {\n var _style;\n\n if (typeof stopIndex === 'undefined') {\n startIndex = index;\n stopIndex = index;\n } else {\n startIndex = Math.min(startIndex, index);\n stopIndex = Math.max(stopIndex, index);\n }\n\n children.push(cellRenderer({\n index: index,\n isScrolling: isScrolling,\n key: keyMapper(index),\n parent: _this2,\n style: (_style = {\n height: cellMeasurerCache.getHeight(index)\n }, _defineProperty(_style, rowDirection === 'ltr' ? 'left' : 'right', left), _defineProperty(_style, \"position\", 'absolute'), _defineProperty(_style, \"top\", top), _defineProperty(_style, \"width\", cellMeasurerCache.getWidth(index)), _style)\n }));\n }); // We need to measure additional cells for this layout\n\n\n if (shortestColumnSize < scrollTop + height + overscanByPixels && measuredCellCount < cellCount) {\n var batchSize = Math.min(cellCount - measuredCellCount, Math.ceil((scrollTop + height + overscanByPixels - shortestColumnSize) / cellMeasurerCache.defaultHeight * width / cellMeasurerCache.defaultWidth));\n\n for (var _index = measuredCellCount; _index < measuredCellCount + batchSize; _index++) {\n stopIndex = _index;\n children.push(cellRenderer({\n index: _index,\n isScrolling: isScrolling,\n key: keyMapper(_index),\n parent: this,\n style: {\n width: cellMeasurerCache.getWidth(_index)\n }\n }));\n }\n }\n\n this._startIndex = startIndex;\n this._stopIndex = stopIndex;\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: this._setScrollingContainerRef,\n \"aria-label\": this.props['aria-label'],\n className: clsx('ReactVirtualized__Masonry', className),\n id: id,\n onScroll: this._onScroll,\n role: role,\n style: _objectSpread({\n boxSizing: 'border-box',\n direction: 'ltr',\n height: autoHeight ? 'auto' : height,\n overflowX: 'hidden',\n overflowY: estimateTotalHeight < height ? 'hidden' : 'auto',\n position: 'relative',\n width: width,\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform'\n }, style),\n tabIndex: tabIndex\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"ReactVirtualized__Masonry__innerScrollContainer\",\n style: {\n width: '100%',\n height: estimateTotalHeight,\n maxWidth: '100%',\n maxHeight: estimateTotalHeight,\n overflow: 'hidden',\n pointerEvents: isScrolling ? 'none' : '',\n position: 'relative'\n }\n }, children));\n }\n }, {\n key: \"_checkInvalidateOnUpdate\",\n value: function _checkInvalidateOnUpdate() {\n if (typeof this._invalidateOnUpdateStartIndex === 'number') {\n var startIndex = this._invalidateOnUpdateStartIndex;\n var stopIndex = this._invalidateOnUpdateStopIndex;\n this._invalidateOnUpdateStartIndex = null;\n this._invalidateOnUpdateStopIndex = null; // Query external layout logic for position of newly-measured cells\n\n this._populatePositionCache(startIndex, stopIndex);\n\n this.forceUpdate();\n }\n }\n }, {\n key: \"_debounceResetIsScrolling\",\n value: function _debounceResetIsScrolling() {\n var scrollingResetTimeInterval = this.props.scrollingResetTimeInterval;\n\n if (this._debounceResetIsScrollingId) {\n cancelAnimationTimeout(this._debounceResetIsScrollingId);\n }\n\n this._debounceResetIsScrollingId = requestAnimationTimeout(this._debounceResetIsScrollingCallback, scrollingResetTimeInterval);\n }\n }, {\n key: \"_getEstimatedTotalHeight\",\n value: function _getEstimatedTotalHeight() {\n var _this$props2 = this.props,\n cellCount = _this$props2.cellCount,\n cellMeasurerCache = _this$props2.cellMeasurerCache,\n width = _this$props2.width;\n var estimatedColumnCount = Math.max(1, Math.floor(width / cellMeasurerCache.defaultWidth));\n return this._positionCache.estimateTotalHeight(cellCount, estimatedColumnCount, cellMeasurerCache.defaultHeight);\n }\n }, {\n key: \"_invokeOnScrollCallback\",\n value: function _invokeOnScrollCallback() {\n var _this$props3 = this.props,\n height = _this$props3.height,\n onScroll = _this$props3.onScroll;\n var scrollTop = this.state.scrollTop;\n\n if (this._onScrollMemoized !== scrollTop) {\n onScroll({\n clientHeight: height,\n scrollHeight: this._getEstimatedTotalHeight(),\n scrollTop: scrollTop\n });\n this._onScrollMemoized = scrollTop;\n }\n }\n }, {\n key: \"_invokeOnCellsRenderedCallback\",\n value: function _invokeOnCellsRenderedCallback() {\n if (this._startIndexMemoized !== this._startIndex || this._stopIndexMemoized !== this._stopIndex) {\n var onCellsRendered = this.props.onCellsRendered;\n onCellsRendered({\n startIndex: this._startIndex,\n stopIndex: this._stopIndex\n });\n this._startIndexMemoized = this._startIndex;\n this._stopIndexMemoized = this._stopIndex;\n }\n }\n }, {\n key: \"_populatePositionCache\",\n value: function _populatePositionCache(startIndex, stopIndex) {\n var _this$props4 = this.props,\n cellMeasurerCache = _this$props4.cellMeasurerCache,\n cellPositioner = _this$props4.cellPositioner;\n\n for (var _index2 = startIndex; _index2 <= stopIndex; _index2++) {\n var _cellPositioner = cellPositioner(_index2),\n left = _cellPositioner.left,\n top = _cellPositioner.top;\n\n this._positionCache.setPosition(_index2, left, top, cellMeasurerCache.getHeight(_index2));\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.scrollTop !== undefined && prevState.scrollTop !== nextProps.scrollTop) {\n return {\n isScrolling: true,\n scrollTop: nextProps.scrollTop\n };\n }\n\n return null;\n }\n }]);\n\n return Masonry;\n}(React.PureComponent), _defineProperty(_class, \"propTypes\", process.env.NODE_ENV === 'production' ? null : {\n \"autoHeight\": PropTypes.bool.isRequired,\n \"cellCount\": PropTypes.number.isRequired,\n \"cellMeasurerCache\": function cellMeasurerCache() {\n return (typeof CellMeasurerCache === \"function\" ? PropTypes.instanceOf(CellMeasurerCache).isRequired : PropTypes.any.isRequired).apply(this, arguments);\n },\n \"cellPositioner\": function cellPositioner() {\n return (typeof Positioner === \"function\" ? PropTypes.instanceOf(Positioner).isRequired : PropTypes.any.isRequired).apply(this, arguments);\n },\n \"cellRenderer\": function cellRenderer() {\n return (typeof CellRenderer === \"function\" ? PropTypes.instanceOf(CellRenderer).isRequired : PropTypes.any.isRequired).apply(this, arguments);\n },\n \"className\": PropTypes.string,\n \"height\": PropTypes.number.isRequired,\n \"id\": PropTypes.string,\n \"keyMapper\": function keyMapper() {\n return (typeof KeyMapper === \"function\" ? PropTypes.instanceOf(KeyMapper).isRequired : PropTypes.any.isRequired).apply(this, arguments);\n },\n \"onCellsRendered\": function onCellsRendered() {\n return (typeof OnCellsRenderedCallback === \"function\" ? PropTypes.instanceOf(OnCellsRenderedCallback) : PropTypes.any).apply(this, arguments);\n },\n \"onScroll\": function onScroll() {\n return (typeof OnScrollCallback === \"function\" ? PropTypes.instanceOf(OnScrollCallback) : PropTypes.any).apply(this, arguments);\n },\n \"overscanByPixels\": PropTypes.number.isRequired,\n \"role\": PropTypes.string.isRequired,\n \"scrollingResetTimeInterval\": PropTypes.number.isRequired,\n \"style\": function style(props, propName, componentName) {\n if (!Object.prototype.hasOwnProperty.call(props, propName)) {\n throw new Error(\"Prop `\".concat(propName, \"` has type 'any' or 'mixed', but was not provided to `\").concat(componentName, \"`. Pass undefined or any other value.\"));\n }\n },\n \"tabIndex\": PropTypes.number.isRequired,\n \"width\": PropTypes.number.isRequired,\n \"rowDirection\": PropTypes.string.isRequired,\n \"scrollTop\": PropTypes.number\n}), _temp);\n\n_defineProperty(Masonry, \"defaultProps\", {\n autoHeight: false,\n keyMapper: identity,\n onCellsRendered: noop,\n onScroll: noop,\n overscanByPixels: 20,\n role: 'grid',\n scrollingResetTimeInterval: DEFAULT_SCROLLING_RESET_TIME_INTERVAL,\n style: emptyObject,\n tabIndex: 0,\n rowDirection: 'ltr'\n});\n\nfunction identity(value) {\n return value;\n}\n\nfunction noop() {}\n\nvar bpfrpt_proptype_CellMeasurerCache = process.env.NODE_ENV === 'production' ? null : {\n \"defaultHeight\": PropTypes.number.isRequired,\n \"defaultWidth\": PropTypes.number.isRequired,\n \"getHeight\": PropTypes.func.isRequired,\n \"getWidth\": PropTypes.func.isRequired\n};\npolyfill(Masonry);\nexport default Masonry;\nvar bpfrpt_proptype_Positioner = process.env.NODE_ENV === 'production' ? null : PropTypes.func;\nimport PropTypes from \"prop-types\";\nexport { bpfrpt_proptype_CellMeasurerCache };\nexport { bpfrpt_proptype_Positioner };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\n/**\n * Caches measurements for a given cell.\n */\nvar CellMeasurerCacheDecorator = /*#__PURE__*/function () {\n function CellMeasurerCacheDecorator() {\n var _this = this;\n\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, CellMeasurerCacheDecorator);\n\n _defineProperty(this, \"_cellMeasurerCache\", void 0);\n\n _defineProperty(this, \"_columnIndexOffset\", void 0);\n\n _defineProperty(this, \"_rowIndexOffset\", void 0);\n\n _defineProperty(this, \"columnWidth\", function (_ref) {\n var index = _ref.index;\n\n _this._cellMeasurerCache.columnWidth({\n index: index + _this._columnIndexOffset\n });\n });\n\n _defineProperty(this, \"rowHeight\", function (_ref2) {\n var index = _ref2.index;\n\n _this._cellMeasurerCache.rowHeight({\n index: index + _this._rowIndexOffset\n });\n });\n\n var cellMeasurerCache = params.cellMeasurerCache,\n _params$columnIndexOf = params.columnIndexOffset,\n columnIndexOffset = _params$columnIndexOf === void 0 ? 0 : _params$columnIndexOf,\n _params$rowIndexOffse = params.rowIndexOffset,\n rowIndexOffset = _params$rowIndexOffse === void 0 ? 0 : _params$rowIndexOffse;\n this._cellMeasurerCache = cellMeasurerCache;\n this._columnIndexOffset = columnIndexOffset;\n this._rowIndexOffset = rowIndexOffset;\n }\n\n _createClass(CellMeasurerCacheDecorator, [{\n key: \"clear\",\n value: function clear(rowIndex, columnIndex) {\n this._cellMeasurerCache.clear(rowIndex + this._rowIndexOffset, columnIndex + this._columnIndexOffset);\n }\n }, {\n key: \"clearAll\",\n value: function clearAll() {\n this._cellMeasurerCache.clearAll();\n }\n }, {\n key: \"hasFixedHeight\",\n value: function hasFixedHeight() {\n return this._cellMeasurerCache.hasFixedHeight();\n }\n }, {\n key: \"hasFixedWidth\",\n value: function hasFixedWidth() {\n return this._cellMeasurerCache.hasFixedWidth();\n }\n }, {\n key: \"getHeight\",\n value: function getHeight(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return this._cellMeasurerCache.getHeight(rowIndex + this._rowIndexOffset, columnIndex + this._columnIndexOffset);\n }\n }, {\n key: \"getWidth\",\n value: function getWidth(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return this._cellMeasurerCache.getWidth(rowIndex + this._rowIndexOffset, columnIndex + this._columnIndexOffset);\n }\n }, {\n key: \"has\",\n value: function has(rowIndex) {\n var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return this._cellMeasurerCache.has(rowIndex + this._rowIndexOffset, columnIndex + this._columnIndexOffset);\n }\n }, {\n key: \"set\",\n value: function set(rowIndex, columnIndex, width, height) {\n this._cellMeasurerCache.set(rowIndex + this._rowIndexOffset, columnIndex + this._columnIndexOffset, width, height);\n }\n }, {\n key: \"defaultHeight\",\n get: function get() {\n return this._cellMeasurerCache.defaultHeight;\n }\n }, {\n key: \"defaultWidth\",\n get: function get() {\n return this._cellMeasurerCache.defaultWidth;\n }\n }]);\n\n return CellMeasurerCacheDecorator;\n}();\n\nexport { CellMeasurerCacheDecorator as default };","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport CellMeasurerCacheDecorator from './CellMeasurerCacheDecorator';\nimport Grid from '../Grid';\nvar SCROLLBAR_SIZE_BUFFER = 20;\n/**\n * Renders 1, 2, or 4 Grids depending on configuration.\n * A main (body) Grid will always be rendered.\n * Optionally, 1-2 Grids for sticky header rows will also be rendered.\n * If no sticky columns, only 1 sticky header Grid will be rendered.\n * If sticky columns, 2 sticky header Grids will be rendered.\n */\n\nvar MultiGrid = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(MultiGrid, _React$PureComponent);\n\n function MultiGrid(props, context) {\n var _this;\n\n _classCallCheck(this, MultiGrid);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MultiGrid).call(this, props, context));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n scrollLeft: 0,\n scrollTop: 0,\n scrollbarSize: 0,\n showHorizontalScrollbar: false,\n showVerticalScrollbar: false\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_deferredInvalidateColumnIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_deferredInvalidateRowIndex\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_bottomLeftGridRef\", function (ref) {\n _this._bottomLeftGrid = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_bottomRightGridRef\", function (ref) {\n _this._bottomRightGrid = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_cellRendererBottomLeftGrid\", function (_ref) {\n var rowIndex = _ref.rowIndex,\n rest = _objectWithoutProperties(_ref, [\"rowIndex\"]);\n\n var _this$props = _this.props,\n cellRenderer = _this$props.cellRenderer,\n fixedRowCount = _this$props.fixedRowCount,\n rowCount = _this$props.rowCount;\n\n if (rowIndex === rowCount - fixedRowCount) {\n return /*#__PURE__*/React.createElement(\"div\", {\n key: rest.key,\n style: _objectSpread({}, rest.style, {\n height: SCROLLBAR_SIZE_BUFFER\n })\n });\n } else {\n return cellRenderer(_objectSpread({}, rest, {\n parent: _assertThisInitialized(_this),\n rowIndex: rowIndex + fixedRowCount\n }));\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_cellRendererBottomRightGrid\", function (_ref2) {\n var columnIndex = _ref2.columnIndex,\n rowIndex = _ref2.rowIndex,\n rest = _objectWithoutProperties(_ref2, [\"columnIndex\", \"rowIndex\"]);\n\n var _this$props2 = _this.props,\n cellRenderer = _this$props2.cellRenderer,\n fixedColumnCount = _this$props2.fixedColumnCount,\n fixedRowCount = _this$props2.fixedRowCount;\n return cellRenderer(_objectSpread({}, rest, {\n columnIndex: columnIndex + fixedColumnCount,\n parent: _assertThisInitialized(_this),\n rowIndex: rowIndex + fixedRowCount\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_cellRendererTopRightGrid\", function (_ref3) {\n var columnIndex = _ref3.columnIndex,\n rest = _objectWithoutProperties(_ref3, [\"columnIndex\"]);\n\n var _this$props3 = _this.props,\n cellRenderer = _this$props3.cellRenderer,\n columnCount = _this$props3.columnCount,\n fixedColumnCount = _this$props3.fixedColumnCount;\n\n if (columnIndex === columnCount - fixedColumnCount) {\n return /*#__PURE__*/React.createElement(\"div\", {\n key: rest.key,\n style: _objectSpread({}, rest.style, {\n width: SCROLLBAR_SIZE_BUFFER\n })\n });\n } else {\n return cellRenderer(_objectSpread({}, rest, {\n columnIndex: columnIndex + fixedColumnCount,\n parent: _assertThisInitialized(_this)\n }));\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_columnWidthRightGrid\", function (_ref4) {\n var index = _ref4.index;\n var _this$props4 = _this.props,\n columnCount = _this$props4.columnCount,\n fixedColumnCount = _this$props4.fixedColumnCount,\n columnWidth = _this$props4.columnWidth;\n var _this$state = _this.state,\n scrollbarSize = _this$state.scrollbarSize,\n showHorizontalScrollbar = _this$state.showHorizontalScrollbar; // An extra cell is added to the count\n // This gives the smaller Grid extra room for offset,\n // In case the main (bottom right) Grid has a scrollbar\n // If no scrollbar, the extra space is overflow:hidden anyway\n\n if (showHorizontalScrollbar && index === columnCount - fixedColumnCount) {\n return scrollbarSize;\n }\n\n return typeof columnWidth === 'function' ? columnWidth({\n index: index + fixedColumnCount\n }) : columnWidth;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScroll\", function (scrollInfo) {\n var scrollLeft = scrollInfo.scrollLeft,\n scrollTop = scrollInfo.scrollTop;\n\n _this.setState({\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n });\n\n var onScroll = _this.props.onScroll;\n\n if (onScroll) {\n onScroll(scrollInfo);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScrollbarPresenceChange\", function (_ref5) {\n var horizontal = _ref5.horizontal,\n size = _ref5.size,\n vertical = _ref5.vertical;\n var _this$state2 = _this.state,\n showHorizontalScrollbar = _this$state2.showHorizontalScrollbar,\n showVerticalScrollbar = _this$state2.showVerticalScrollbar;\n\n if (horizontal !== showHorizontalScrollbar || vertical !== showVerticalScrollbar) {\n _this.setState({\n scrollbarSize: size,\n showHorizontalScrollbar: horizontal,\n showVerticalScrollbar: vertical\n });\n\n var onScrollbarPresenceChange = _this.props.onScrollbarPresenceChange;\n\n if (typeof onScrollbarPresenceChange === 'function') {\n onScrollbarPresenceChange({\n horizontal: horizontal,\n size: size,\n vertical: vertical\n });\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScrollLeft\", function (scrollInfo) {\n var scrollLeft = scrollInfo.scrollLeft;\n\n _this._onScroll({\n scrollLeft: scrollLeft,\n scrollTop: _this.state.scrollTop\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onScrollTop\", function (scrollInfo) {\n var scrollTop = scrollInfo.scrollTop;\n\n _this._onScroll({\n scrollTop: scrollTop,\n scrollLeft: _this.state.scrollLeft\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_rowHeightBottomGrid\", function (_ref6) {\n var index = _ref6.index;\n var _this$props5 = _this.props,\n fixedRowCount = _this$props5.fixedRowCount,\n rowCount = _this$props5.rowCount,\n rowHeight = _this$props5.rowHeight;\n var _this$state3 = _this.state,\n scrollbarSize = _this$state3.scrollbarSize,\n showVerticalScrollbar = _this$state3.showVerticalScrollbar; // An extra cell is added to the count\n // This gives the smaller Grid extra room for offset,\n // In case the main (bottom right) Grid has a scrollbar\n // If no scrollbar, the extra space is overflow:hidden anyway\n\n if (showVerticalScrollbar && index === rowCount - fixedRowCount) {\n return scrollbarSize;\n }\n\n return typeof rowHeight === 'function' ? rowHeight({\n index: index + fixedRowCount\n }) : rowHeight;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_topLeftGridRef\", function (ref) {\n _this._topLeftGrid = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_topRightGridRef\", function (ref) {\n _this._topRightGrid = ref;\n });\n\n var deferredMeasurementCache = props.deferredMeasurementCache,\n _fixedColumnCount = props.fixedColumnCount,\n _fixedRowCount = props.fixedRowCount;\n\n _this._maybeCalculateCachedStyles(true);\n\n if (deferredMeasurementCache) {\n _this._deferredMeasurementCacheBottomLeftGrid = _fixedRowCount > 0 ? new CellMeasurerCacheDecorator({\n cellMeasurerCache: deferredMeasurementCache,\n columnIndexOffset: 0,\n rowIndexOffset: _fixedRowCount\n }) : deferredMeasurementCache;\n _this._deferredMeasurementCacheBottomRightGrid = _fixedColumnCount > 0 || _fixedRowCount > 0 ? new CellMeasurerCacheDecorator({\n cellMeasurerCache: deferredMeasurementCache,\n columnIndexOffset: _fixedColumnCount,\n rowIndexOffset: _fixedRowCount\n }) : deferredMeasurementCache;\n _this._deferredMeasurementCacheTopRightGrid = _fixedColumnCount > 0 ? new CellMeasurerCacheDecorator({\n cellMeasurerCache: deferredMeasurementCache,\n columnIndexOffset: _fixedColumnCount,\n rowIndexOffset: 0\n }) : deferredMeasurementCache;\n }\n\n return _this;\n }\n\n _createClass(MultiGrid, [{\n key: \"forceUpdateGrids\",\n value: function forceUpdateGrids() {\n this._bottomLeftGrid && this._bottomLeftGrid.forceUpdate();\n this._bottomRightGrid && this._bottomRightGrid.forceUpdate();\n this._topLeftGrid && this._topLeftGrid.forceUpdate();\n this._topRightGrid && this._topRightGrid.forceUpdate();\n }\n /** See Grid#invalidateCellSizeAfterRender */\n\n }, {\n key: \"invalidateCellSizeAfterRender\",\n value: function invalidateCellSizeAfterRender() {\n var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref7$columnIndex = _ref7.columnIndex,\n columnIndex = _ref7$columnIndex === void 0 ? 0 : _ref7$columnIndex,\n _ref7$rowIndex = _ref7.rowIndex,\n rowIndex = _ref7$rowIndex === void 0 ? 0 : _ref7$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 /** See Grid#measureAllCells */\n\n }, {\n key: \"measureAllCells\",\n value: function measureAllCells() {\n this._bottomLeftGrid && this._bottomLeftGrid.measureAllCells();\n this._bottomRightGrid && this._bottomRightGrid.measureAllCells();\n this._topLeftGrid && this._topLeftGrid.measureAllCells();\n this._topRightGrid && this._topRightGrid.measureAllCells();\n }\n /** See Grid#recomputeGridSize */\n\n }, {\n key: \"recomputeGridSize\",\n value: function recomputeGridSize() {\n var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref8$columnIndex = _ref8.columnIndex,\n columnIndex = _ref8$columnIndex === void 0 ? 0 : _ref8$columnIndex,\n _ref8$rowIndex = _ref8.rowIndex,\n rowIndex = _ref8$rowIndex === void 0 ? 0 : _ref8$rowIndex;\n\n var _this$props6 = this.props,\n fixedColumnCount = _this$props6.fixedColumnCount,\n fixedRowCount = _this$props6.fixedRowCount;\n var adjustedColumnIndex = Math.max(0, columnIndex - fixedColumnCount);\n var adjustedRowIndex = Math.max(0, rowIndex - fixedRowCount);\n this._bottomLeftGrid && this._bottomLeftGrid.recomputeGridSize({\n columnIndex: columnIndex,\n rowIndex: adjustedRowIndex\n });\n this._bottomRightGrid && this._bottomRightGrid.recomputeGridSize({\n columnIndex: adjustedColumnIndex,\n rowIndex: adjustedRowIndex\n });\n this._topLeftGrid && this._topLeftGrid.recomputeGridSize({\n columnIndex: columnIndex,\n rowIndex: rowIndex\n });\n this._topRightGrid && this._topRightGrid.recomputeGridSize({\n columnIndex: adjustedColumnIndex,\n rowIndex: rowIndex\n });\n this._leftGridWidth = null;\n this._topGridHeight = null;\n\n this._maybeCalculateCachedStyles(true);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props7 = this.props,\n scrollLeft = _this$props7.scrollLeft,\n scrollTop = _this$props7.scrollTop;\n\n if (scrollLeft > 0 || scrollTop > 0) {\n var newState = {};\n\n if (scrollLeft > 0) {\n newState.scrollLeft = scrollLeft;\n }\n\n if (scrollTop > 0) {\n newState.scrollTop = scrollTop;\n }\n\n this.setState(newState);\n }\n\n this._handleInvalidatedGridSize();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this._handleInvalidatedGridSize();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props8 = this.props,\n onScroll = _this$props8.onScroll,\n onSectionRendered = _this$props8.onSectionRendered,\n onScrollbarPresenceChange = _this$props8.onScrollbarPresenceChange,\n scrollLeftProp = _this$props8.scrollLeft,\n scrollToColumn = _this$props8.scrollToColumn,\n scrollTopProp = _this$props8.scrollTop,\n scrollToRow = _this$props8.scrollToRow,\n rest = _objectWithoutProperties(_this$props8, [\"onScroll\", \"onSectionRendered\", \"onScrollbarPresenceChange\", \"scrollLeft\", \"scrollToColumn\", \"scrollTop\", \"scrollToRow\"]);\n\n this._prepareForRender(); // Don't render any of our Grids if there are no cells.\n // This mirrors what Grid does,\n // And prevents us from recording inaccurage measurements when used with CellMeasurer.\n\n\n if (this.props.width === 0 || this.props.height === 0) {\n return null;\n } // scrollTop and scrollLeft props are explicitly filtered out and ignored\n\n\n var _this$state4 = this.state,\n scrollLeft = _this$state4.scrollLeft,\n scrollTop = _this$state4.scrollTop;\n return /*#__PURE__*/React.createElement(\"div\", {\n style: this._containerOuterStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n style: this._containerTopStyle\n }, this._renderTopLeftGrid(rest), this._renderTopRightGrid(_objectSpread({}, rest, {\n onScroll: onScroll,\n scrollLeft: scrollLeft\n }))), /*#__PURE__*/React.createElement(\"div\", {\n style: this._containerBottomStyle\n }, this._renderBottomLeftGrid(_objectSpread({}, rest, {\n onScroll: onScroll,\n scrollTop: scrollTop\n })), this._renderBottomRightGrid(_objectSpread({}, rest, {\n onScroll: onScroll,\n onSectionRendered: onSectionRendered,\n scrollLeft: scrollLeft,\n scrollToColumn: scrollToColumn,\n scrollToRow: scrollToRow,\n scrollTop: scrollTop\n }))));\n }\n }, {\n key: \"_getBottomGridHeight\",\n value: function _getBottomGridHeight(props) {\n var height = props.height;\n\n var topGridHeight = this._getTopGridHeight(props);\n\n return height - topGridHeight;\n }\n }, {\n key: \"_getLeftGridWidth\",\n value: function _getLeftGridWidth(props) {\n var fixedColumnCount = props.fixedColumnCount,\n columnWidth = props.columnWidth;\n\n if (this._leftGridWidth == null) {\n if (typeof columnWidth === 'function') {\n var leftGridWidth = 0;\n\n for (var index = 0; index < fixedColumnCount; index++) {\n leftGridWidth += columnWidth({\n index: index\n });\n }\n\n this._leftGridWidth = leftGridWidth;\n } else {\n this._leftGridWidth = columnWidth * fixedColumnCount;\n }\n }\n\n return this._leftGridWidth;\n }\n }, {\n key: \"_getRightGridWidth\",\n value: function _getRightGridWidth(props) {\n var width = props.width;\n\n var leftGridWidth = this._getLeftGridWidth(props);\n\n return width - leftGridWidth;\n }\n }, {\n key: \"_getTopGridHeight\",\n value: function _getTopGridHeight(props) {\n var fixedRowCount = props.fixedRowCount,\n rowHeight = props.rowHeight;\n\n if (this._topGridHeight == null) {\n if (typeof rowHeight === 'function') {\n var topGridHeight = 0;\n\n for (var index = 0; index < fixedRowCount; index++) {\n topGridHeight += rowHeight({\n index: index\n });\n }\n\n this._topGridHeight = topGridHeight;\n } else {\n this._topGridHeight = rowHeight * fixedRowCount;\n }\n }\n\n return this._topGridHeight;\n }\n }, {\n key: \"_handleInvalidatedGridSize\",\n value: function _handleInvalidatedGridSize() {\n if (typeof this._deferredInvalidateColumnIndex === 'number') {\n var columnIndex = this._deferredInvalidateColumnIndex;\n var rowIndex = this._deferredInvalidateRowIndex;\n this._deferredInvalidateColumnIndex = null;\n this._deferredInvalidateRowIndex = null;\n this.recomputeGridSize({\n columnIndex: columnIndex,\n rowIndex: rowIndex\n });\n this.forceUpdate();\n }\n }\n /**\n * Avoid recreating inline styles each render; this bypasses Grid's shallowCompare.\n * This method recalculates styles only when specific props change.\n */\n\n }, {\n key: \"_maybeCalculateCachedStyles\",\n value: function _maybeCalculateCachedStyles(resetAll) {\n var _this$props9 = this.props,\n columnWidth = _this$props9.columnWidth,\n enableFixedColumnScroll = _this$props9.enableFixedColumnScroll,\n enableFixedRowScroll = _this$props9.enableFixedRowScroll,\n height = _this$props9.height,\n fixedColumnCount = _this$props9.fixedColumnCount,\n fixedRowCount = _this$props9.fixedRowCount,\n rowHeight = _this$props9.rowHeight,\n style = _this$props9.style,\n styleBottomLeftGrid = _this$props9.styleBottomLeftGrid,\n styleBottomRightGrid = _this$props9.styleBottomRightGrid,\n styleTopLeftGrid = _this$props9.styleTopLeftGrid,\n styleTopRightGrid = _this$props9.styleTopRightGrid,\n width = _this$props9.width;\n var sizeChange = resetAll || height !== this._lastRenderedHeight || width !== this._lastRenderedWidth;\n var leftSizeChange = resetAll || columnWidth !== this._lastRenderedColumnWidth || fixedColumnCount !== this._lastRenderedFixedColumnCount;\n var topSizeChange = resetAll || fixedRowCount !== this._lastRenderedFixedRowCount || rowHeight !== this._lastRenderedRowHeight;\n\n if (resetAll || sizeChange || style !== this._lastRenderedStyle) {\n this._containerOuterStyle = _objectSpread({\n height: height,\n overflow: 'visible',\n // Let :focus outline show through\n width: width\n }, style);\n }\n\n if (resetAll || sizeChange || topSizeChange) {\n this._containerTopStyle = {\n height: this._getTopGridHeight(this.props),\n position: 'relative',\n width: width\n };\n this._containerBottomStyle = {\n height: height - this._getTopGridHeight(this.props),\n overflow: 'visible',\n // Let :focus outline show through\n position: 'relative',\n width: width\n };\n }\n\n if (resetAll || styleBottomLeftGrid !== this._lastRenderedStyleBottomLeftGrid) {\n this._bottomLeftGridStyle = _objectSpread({\n left: 0,\n overflowX: 'hidden',\n overflowY: enableFixedColumnScroll ? 'auto' : 'hidden',\n position: 'absolute'\n }, styleBottomLeftGrid);\n }\n\n if (resetAll || leftSizeChange || styleBottomRightGrid !== this._lastRenderedStyleBottomRightGrid) {\n this._bottomRightGridStyle = _objectSpread({\n left: this._getLeftGridWidth(this.props),\n position: 'absolute'\n }, styleBottomRightGrid);\n }\n\n if (resetAll || styleTopLeftGrid !== this._lastRenderedStyleTopLeftGrid) {\n this._topLeftGridStyle = _objectSpread({\n left: 0,\n overflowX: 'hidden',\n overflowY: 'hidden',\n position: 'absolute',\n top: 0\n }, styleTopLeftGrid);\n }\n\n if (resetAll || leftSizeChange || styleTopRightGrid !== this._lastRenderedStyleTopRightGrid) {\n this._topRightGridStyle = _objectSpread({\n left: this._getLeftGridWidth(this.props),\n overflowX: enableFixedRowScroll ? 'auto' : 'hidden',\n overflowY: 'hidden',\n position: 'absolute',\n top: 0\n }, styleTopRightGrid);\n }\n\n this._lastRenderedColumnWidth = columnWidth;\n this._lastRenderedFixedColumnCount = fixedColumnCount;\n this._lastRenderedFixedRowCount = fixedRowCount;\n this._lastRenderedHeight = height;\n this._lastRenderedRowHeight = rowHeight;\n this._lastRenderedStyle = style;\n this._lastRenderedStyleBottomLeftGrid = styleBottomLeftGrid;\n this._lastRenderedStyleBottomRightGrid = styleBottomRightGrid;\n this._lastRenderedStyleTopLeftGrid = styleTopLeftGrid;\n this._lastRenderedStyleTopRightGrid = styleTopRightGrid;\n this._lastRenderedWidth = width;\n }\n }, {\n key: \"_prepareForRender\",\n value: function _prepareForRender() {\n if (this._lastRenderedColumnWidth !== this.props.columnWidth || this._lastRenderedFixedColumnCount !== this.props.fixedColumnCount) {\n this._leftGridWidth = null;\n }\n\n if (this._lastRenderedFixedRowCount !== this.props.fixedRowCount || this._lastRenderedRowHeight !== this.props.rowHeight) {\n this._topGridHeight = null;\n }\n\n this._maybeCalculateCachedStyles();\n\n this._lastRenderedColumnWidth = this.props.columnWidth;\n this._lastRenderedFixedColumnCount = this.props.fixedColumnCount;\n this._lastRenderedFixedRowCount = this.props.fixedRowCount;\n this._lastRenderedRowHeight = this.props.rowHeight;\n }\n }, {\n key: \"_renderBottomLeftGrid\",\n value: function _renderBottomLeftGrid(props) {\n var enableFixedColumnScroll = props.enableFixedColumnScroll,\n fixedColumnCount = props.fixedColumnCount,\n fixedRowCount = props.fixedRowCount,\n rowCount = props.rowCount,\n hideBottomLeftGridScrollbar = props.hideBottomLeftGridScrollbar;\n var showVerticalScrollbar = this.state.showVerticalScrollbar;\n\n if (!fixedColumnCount) {\n return null;\n }\n\n var additionalRowCount = showVerticalScrollbar ? 1 : 0,\n height = this._getBottomGridHeight(props),\n width = this._getLeftGridWidth(props),\n scrollbarSize = this.state.showVerticalScrollbar ? this.state.scrollbarSize : 0,\n gridWidth = hideBottomLeftGridScrollbar ? width + scrollbarSize : width;\n\n var bottomLeftGrid = /*#__PURE__*/React.createElement(Grid, _extends({}, props, {\n cellRenderer: this._cellRendererBottomLeftGrid,\n className: this.props.classNameBottomLeftGrid,\n columnCount: fixedColumnCount,\n deferredMeasurementCache: this._deferredMeasurementCacheBottomLeftGrid,\n height: height,\n onScroll: enableFixedColumnScroll ? this._onScrollTop : undefined,\n ref: this._bottomLeftGridRef,\n rowCount: Math.max(0, rowCount - fixedRowCount) + additionalRowCount,\n rowHeight: this._rowHeightBottomGrid,\n style: this._bottomLeftGridStyle,\n tabIndex: null,\n width: gridWidth\n }));\n\n if (hideBottomLeftGridScrollbar) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"BottomLeftGrid_ScrollWrapper\",\n style: _objectSpread({}, this._bottomLeftGridStyle, {\n height: height,\n width: width,\n overflowY: 'hidden'\n })\n }, bottomLeftGrid);\n }\n\n return bottomLeftGrid;\n }\n }, {\n key: \"_renderBottomRightGrid\",\n value: function _renderBottomRightGrid(props) {\n var columnCount = props.columnCount,\n fixedColumnCount = props.fixedColumnCount,\n fixedRowCount = props.fixedRowCount,\n rowCount = props.rowCount,\n scrollToColumn = props.scrollToColumn,\n scrollToRow = props.scrollToRow;\n return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {\n cellRenderer: this._cellRendererBottomRightGrid,\n className: this.props.classNameBottomRightGrid,\n columnCount: Math.max(0, columnCount - fixedColumnCount),\n columnWidth: this._columnWidthRightGrid,\n deferredMeasurementCache: this._deferredMeasurementCacheBottomRightGrid,\n height: this._getBottomGridHeight(props),\n onScroll: this._onScroll,\n onScrollbarPresenceChange: this._onScrollbarPresenceChange,\n ref: this._bottomRightGridRef,\n rowCount: Math.max(0, rowCount - fixedRowCount),\n rowHeight: this._rowHeightBottomGrid,\n scrollToColumn: scrollToColumn - fixedColumnCount,\n scrollToRow: scrollToRow - fixedRowCount,\n style: this._bottomRightGridStyle,\n width: this._getRightGridWidth(props)\n }));\n }\n }, {\n key: \"_renderTopLeftGrid\",\n value: function _renderTopLeftGrid(props) {\n var fixedColumnCount = props.fixedColumnCount,\n fixedRowCount = props.fixedRowCount;\n\n if (!fixedColumnCount || !fixedRowCount) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {\n className: this.props.classNameTopLeftGrid,\n columnCount: fixedColumnCount,\n height: this._getTopGridHeight(props),\n ref: this._topLeftGridRef,\n rowCount: fixedRowCount,\n style: this._topLeftGridStyle,\n tabIndex: null,\n width: this._getLeftGridWidth(props)\n }));\n }\n }, {\n key: \"_renderTopRightGrid\",\n value: function _renderTopRightGrid(props) {\n var columnCount = props.columnCount,\n enableFixedRowScroll = props.enableFixedRowScroll,\n fixedColumnCount = props.fixedColumnCount,\n fixedRowCount = props.fixedRowCount,\n scrollLeft = props.scrollLeft,\n hideTopRightGridScrollbar = props.hideTopRightGridScrollbar;\n var _this$state5 = this.state,\n showHorizontalScrollbar = _this$state5.showHorizontalScrollbar,\n scrollbarSize = _this$state5.scrollbarSize;\n\n if (!fixedRowCount) {\n return null;\n }\n\n var additionalColumnCount = showHorizontalScrollbar ? 1 : 0,\n height = this._getTopGridHeight(props),\n width = this._getRightGridWidth(props),\n additionalHeight = showHorizontalScrollbar ? scrollbarSize : 0;\n\n var gridHeight = height,\n style = this._topRightGridStyle;\n\n if (hideTopRightGridScrollbar) {\n gridHeight = height + additionalHeight;\n style = _objectSpread({}, this._topRightGridStyle, {\n left: 0\n });\n }\n\n var topRightGrid = /*#__PURE__*/React.createElement(Grid, _extends({}, props, {\n cellRenderer: this._cellRendererTopRightGrid,\n className: this.props.classNameTopRightGrid,\n columnCount: Math.max(0, columnCount - fixedColumnCount) + additionalColumnCount,\n columnWidth: this._columnWidthRightGrid,\n deferredMeasurementCache: this._deferredMeasurementCacheTopRightGrid,\n height: gridHeight,\n onScroll: enableFixedRowScroll ? this._onScrollLeft : undefined,\n ref: this._topRightGridRef,\n rowCount: fixedRowCount,\n scrollLeft: scrollLeft,\n style: style,\n tabIndex: null,\n width: width\n }));\n\n if (hideTopRightGridScrollbar) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"TopRightGrid_ScrollWrapper\",\n style: _objectSpread({}, this._topRightGridStyle, {\n height: height,\n width: width,\n overflowX: 'hidden'\n })\n }, topRightGrid);\n }\n\n return topRightGrid;\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.scrollLeft !== prevState.scrollLeft || nextProps.scrollTop !== prevState.scrollTop) {\n return {\n scrollLeft: nextProps.scrollLeft != null && nextProps.scrollLeft >= 0 ? nextProps.scrollLeft : prevState.scrollLeft,\n scrollTop: nextProps.scrollTop != null && nextProps.scrollTop >= 0 ? nextProps.scrollTop : prevState.scrollTop\n };\n }\n\n return null;\n }\n }]);\n\n return MultiGrid;\n}(React.PureComponent);\n\n_defineProperty(MultiGrid, \"defaultProps\", {\n classNameBottomLeftGrid: '',\n classNameBottomRightGrid: '',\n classNameTopLeftGrid: '',\n classNameTopRightGrid: '',\n enableFixedColumnScroll: false,\n enableFixedRowScroll: false,\n fixedColumnCount: 0,\n fixedRowCount: 0,\n scrollToColumn: -1,\n scrollToRow: -1,\n style: {},\n styleBottomLeftGrid: {},\n styleBottomRightGrid: {},\n styleTopLeftGrid: {},\n styleTopRightGrid: {},\n hideTopRightGridScrollbar: false,\n hideBottomLeftGridScrollbar: false\n});\n\npolyfill(MultiGrid);\nexport default MultiGrid;","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 PropTypes from 'prop-types';\nimport * as React from 'react';\n/**\n * HOC that simplifies the process of synchronizing scrolling between two or more virtualized components.\n */\n\nvar ScrollSync = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(ScrollSync, _React$PureComponent);\n\n function ScrollSync(props, context) {\n var _this;\n\n _classCallCheck(this, ScrollSync);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ScrollSync).call(this, props, context));\n _this.state = {\n clientHeight: 0,\n clientWidth: 0,\n scrollHeight: 0,\n scrollLeft: 0,\n scrollTop: 0,\n scrollWidth: 0\n };\n _this._onScroll = _this._onScroll.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ScrollSync, [{\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n var _this$state = this.state,\n clientHeight = _this$state.clientHeight,\n clientWidth = _this$state.clientWidth,\n scrollHeight = _this$state.scrollHeight,\n scrollLeft = _this$state.scrollLeft,\n scrollTop = _this$state.scrollTop,\n scrollWidth = _this$state.scrollWidth;\n return children({\n clientHeight: clientHeight,\n clientWidth: clientWidth,\n onScroll: this._onScroll,\n scrollHeight: scrollHeight,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n scrollWidth: scrollWidth\n });\n }\n }, {\n key: \"_onScroll\",\n value: function _onScroll(_ref) {\n var clientHeight = _ref.clientHeight,\n clientWidth = _ref.clientWidth,\n scrollHeight = _ref.scrollHeight,\n scrollLeft = _ref.scrollLeft,\n scrollTop = _ref.scrollTop,\n scrollWidth = _ref.scrollWidth;\n this.setState({\n clientHeight: clientHeight,\n clientWidth: clientWidth,\n scrollHeight: scrollHeight,\n scrollLeft: scrollLeft,\n scrollTop: scrollTop,\n scrollWidth: scrollWidth\n });\n }\n }]);\n\n return ScrollSync;\n}(React.PureComponent);\n\nexport { ScrollSync as default };\nScrollSync.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Function responsible for rendering 2 or more virtualized components.\n * This function should implement the following signature:\n * ({ onScroll, scrollLeft, scrollTop }) => PropTypes.element\n */\n children: PropTypes.func.isRequired\n} : {};","var SortDirection = {\n /**\n * Sort items in ascending order.\n * This means arranging from the lowest value to the highest (e.g. a-z, 0-9).\n */\n ASC: 'ASC',\n\n /**\n * Sort items in descending order.\n * This means arranging from the highest value to the lowest (e.g. z-a, 9-0).\n */\n DESC: 'DESC'\n};\nexport default SortDirection;","import clsx from 'clsx';\nimport * as React from 'react';\nimport SortDirection from './SortDirection';\n/**\n * Displayed beside a header to indicate that a Table is currently sorted by this column.\n */\n\nexport default function SortIndicator(_ref) {\n var sortDirection = _ref.sortDirection;\n var classNames = clsx('ReactVirtualized__Table__sortableHeaderIcon', {\n 'ReactVirtualized__Table__sortableHeaderIcon--ASC': sortDirection === SortDirection.ASC,\n 'ReactVirtualized__Table__sortableHeaderIcon--DESC': sortDirection === SortDirection.DESC\n });\n return /*#__PURE__*/React.createElement(\"svg\", {\n className: classNames,\n width: 18,\n height: 18,\n viewBox: \"0 0 24 24\"\n }, sortDirection === SortDirection.ASC ? /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7 14l5-5 5 5z\"\n }) : /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7 10l5 5 5-5z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n }));\n}","import * as React from 'react';\nimport SortIndicator from './SortIndicator';\n/**\n * Default table header renderer.\n */\n\nexport default function defaultHeaderRenderer(_ref) {\n var dataKey = _ref.dataKey,\n label = _ref.label,\n sortBy = _ref.sortBy,\n sortDirection = _ref.sortDirection;\n var showSortIndicator = sortBy === dataKey;\n var children = [/*#__PURE__*/React.createElement(\"span\", {\n className: \"ReactVirtualized__Table__headerTruncatedText\",\n key: \"label\",\n title: typeof label === 'string' ? label : null\n }, label)];\n\n if (showSortIndicator) {\n children.push( /*#__PURE__*/React.createElement(SortIndicator, {\n key: \"SortIndicator\",\n sortDirection: sortDirection\n }));\n }\n\n return children;\n}\ndefaultHeaderRenderer.propTypes = process.env.NODE_ENV === 'production' ? null : bpfrpt_proptype_HeaderRendererParams === PropTypes.any ? {} : bpfrpt_proptype_HeaderRendererParams;\nimport { bpfrpt_proptype_HeaderRendererParams } from \"./types\";\nimport PropTypes from \"prop-types\";","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport defaultHeaderRenderer from './defaultHeaderRenderer';\nimport defaultCellRenderer from './defaultCellRenderer';\nimport defaultCellDataGetter from './defaultCellDataGetter';\nimport SortDirection from './SortDirection';\n/**\n * Describes the header and cell contents of a table column.\n */\n\nvar Column = /*#__PURE__*/function (_React$Component) {\n _inherits(Column, _React$Component);\n\n function Column() {\n _classCallCheck(this, Column);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Column).apply(this, arguments));\n }\n\n return Column;\n}(React.Component);\n\n_defineProperty(Column, \"defaultProps\", {\n cellDataGetter: defaultCellDataGetter,\n cellRenderer: defaultCellRenderer,\n defaultSortDirection: SortDirection.ASC,\n flexGrow: 0,\n flexShrink: 1,\n headerRenderer: defaultHeaderRenderer,\n style: {}\n});\n\nexport { Column as default };\nColumn.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Optional aria-label value to set on the column header */\n 'aria-label': PropTypes.string,\n\n /**\n * Callback responsible for returning a cell's data, given its :dataKey\n * ({ columnData: any, dataKey: string, rowData: any }): any\n */\n cellDataGetter: PropTypes.func,\n\n /**\n * Callback responsible for rendering a cell's contents.\n * ({ cellData: any, columnData: any, dataKey: string, rowData: any, rowIndex: number }): node\n */\n cellRenderer: PropTypes.func,\n\n /** Optional CSS class to apply to cell */\n className: PropTypes.string,\n\n /** Optional additional data passed to this column's :cellDataGetter */\n columnData: PropTypes.object,\n\n /** Uniquely identifies the row-data attribute corresponding to this cell */\n dataKey: PropTypes.any.isRequired,\n\n /** Optional direction to be used when clicked the first time */\n defaultSortDirection: PropTypes.oneOf([SortDirection.ASC, SortDirection.DESC]),\n\n /** If sort is enabled for the table at large, disable it for this column */\n disableSort: PropTypes.bool,\n\n /** Flex grow style; defaults to 0 */\n flexGrow: PropTypes.number,\n\n /** Flex shrink style; defaults to 1 */\n flexShrink: PropTypes.number,\n\n /** Optional CSS class to apply to this column's header */\n headerClassName: PropTypes.string,\n\n /**\n * Optional callback responsible for rendering a column header contents.\n * ({ columnData: object, dataKey: string, disableSort: boolean, label: node, sortBy: string, sortDirection: string }): PropTypes.node\n */\n headerRenderer: PropTypes.func.isRequired,\n\n /** Optional inline style to apply to this column's header */\n headerStyle: PropTypes.object,\n\n /** Optional id to set on the column header */\n id: PropTypes.string,\n\n /** Header label for this column */\n label: PropTypes.node,\n\n /** Maximum width of column; this property will only be used if :flexGrow is > 0. */\n maxWidth: PropTypes.number,\n\n /** Minimum width of column. */\n minWidth: PropTypes.number,\n\n /** Optional inline style to apply to cell */\n style: PropTypes.object,\n\n /** Flex basis (width) for this column; This value can grow or shrink based on :flexGrow and :flexShrink properties. */\n width: PropTypes.number.isRequired\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport clsx from 'clsx';\nimport * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport Grid, { accessibilityOverscanIndicesGetter } from '../Grid';\nimport defaultRowRenderer from './defaultRowRenderer';\nimport defaultHeaderRowRenderer from './defaultHeaderRowRenderer';\nimport SortDirection from './SortDirection';\n/**\n * Table component with fixed headers and virtualized rows for improved performance with large data sets.\n * This component expects explicit width, height, and padding parameters.\n */\n\nvar Table = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(Table, _React$PureComponent);\n\n function Table(props) {\n var _this;\n\n _classCallCheck(this, Table);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Table).call(this, props));\n _this.state = {\n scrollbarWidth: 0\n };\n _this._createColumn = _this._createColumn.bind(_assertThisInitialized(_this));\n _this._createRow = _this._createRow.bind(_assertThisInitialized(_this));\n _this._onScroll = _this._onScroll.bind(_assertThisInitialized(_this));\n _this._onSectionRendered = _this._onSectionRendered.bind(_assertThisInitialized(_this));\n _this._setRef = _this._setRef.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Table, [{\n key: \"forceUpdateGrid\",\n value: function forceUpdateGrid() {\n if (this.Grid) {\n this.Grid.forceUpdate();\n }\n }\n /** See Grid#getOffsetForCell */\n\n }, {\n key: \"getOffsetForRow\",\n value: function getOffsetForRow(_ref) {\n var alignment = _ref.alignment,\n index = _ref.index;\n\n if (this.Grid) {\n var _this$Grid$getOffsetF = this.Grid.getOffsetForCell({\n alignment: alignment,\n rowIndex: index\n }),\n scrollTop = _this$Grid$getOffsetF.scrollTop;\n\n return scrollTop;\n }\n\n return 0;\n }\n /** CellMeasurer compatibility */\n\n }, {\n key: \"invalidateCellSizeAfterRender\",\n value: function invalidateCellSizeAfterRender(_ref2) {\n var columnIndex = _ref2.columnIndex,\n rowIndex = _ref2.rowIndex;\n\n if (this.Grid) {\n this.Grid.invalidateCellSizeAfterRender({\n rowIndex: rowIndex,\n columnIndex: columnIndex\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 /** CellMeasurer compatibility */\n\n }, {\n key: \"recomputeGridSize\",\n value: function recomputeGridSize() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$columnIndex = _ref3.columnIndex,\n columnIndex = _ref3$columnIndex === void 0 ? 0 : _ref3$columnIndex,\n _ref3$rowIndex = _ref3.rowIndex,\n rowIndex = _ref3$rowIndex === void 0 ? 0 : _ref3$rowIndex;\n\n if (this.Grid) {\n this.Grid.recomputeGridSize({\n rowIndex: rowIndex,\n columnIndex: columnIndex\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 });\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({\n 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: \"getScrollbarWidth\",\n value: function getScrollbarWidth() {\n if (this.Grid) {\n var _Grid = findDOMNode(this.Grid);\n\n var clientWidth = _Grid.clientWidth || 0;\n var offsetWidth = _Grid.offsetWidth || 0;\n return offsetWidth - clientWidth;\n }\n\n return 0;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this._setScrollbarWidth();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this._setScrollbarWidth();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n disableHeader = _this$props.disableHeader,\n gridClassName = _this$props.gridClassName,\n gridStyle = _this$props.gridStyle,\n headerHeight = _this$props.headerHeight,\n headerRowRenderer = _this$props.headerRowRenderer,\n height = _this$props.height,\n id = _this$props.id,\n noRowsRenderer = _this$props.noRowsRenderer,\n rowClassName = _this$props.rowClassName,\n rowStyle = _this$props.rowStyle,\n scrollToIndex = _this$props.scrollToIndex,\n style = _this$props.style,\n width = _this$props.width;\n var scrollbarWidth = this.state.scrollbarWidth;\n var availableRowsHeight = disableHeader ? height : height - headerHeight;\n var rowClass = typeof rowClassName === 'function' ? rowClassName({\n index: -1\n }) : rowClassName;\n var rowStyleObject = typeof rowStyle === 'function' ? rowStyle({\n index: -1\n }) : rowStyle; // Precompute and cache column styles before rendering rows and columns to speed things up\n\n this._cachedColumnStyles = [];\n React.Children.toArray(children).forEach(function (column, index) {\n var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style);\n\n _this2._cachedColumnStyles[index] = _objectSpread({\n overflow: 'hidden'\n }, flexStyles);\n }); // Note that we specify :rowCount, :scrollbarWidth, :sortBy, and :sortDirection as properties on Grid even though these have nothing to do with Grid.\n // This is done because Grid is a pure component and won't update unless its properties or state has changed.\n // Any property that should trigger a re-render of Grid then is specified here to avoid a stale display.\n\n return /*#__PURE__*/React.createElement(\"div\", {\n \"aria-label\": this.props['aria-label'],\n \"aria-labelledby\": this.props['aria-labelledby'],\n \"aria-colcount\": React.Children.toArray(children).length,\n \"aria-rowcount\": this.props.rowCount,\n className: clsx('ReactVirtualized__Table', className),\n id: id,\n role: \"grid\",\n style: style\n }, !disableHeader && headerRowRenderer({\n className: clsx('ReactVirtualized__Table__headerRow', rowClass),\n columns: this._getHeaderColumns(),\n style: _objectSpread({\n height: headerHeight,\n overflow: 'hidden',\n paddingRight: scrollbarWidth,\n width: width\n }, rowStyleObject)\n }), /*#__PURE__*/React.createElement(Grid, _extends({}, this.props, {\n \"aria-readonly\": null,\n autoContainerWidth: true,\n className: clsx('ReactVirtualized__Table__Grid', gridClassName),\n cellRenderer: this._createRow,\n columnWidth: width,\n columnCount: 1,\n height: availableRowsHeight,\n id: undefined,\n noContentRenderer: noRowsRenderer,\n onScroll: this._onScroll,\n onSectionRendered: this._onSectionRendered,\n ref: this._setRef,\n role: \"rowgroup\",\n scrollbarWidth: scrollbarWidth,\n scrollToRow: scrollToIndex,\n style: _objectSpread({}, gridStyle, {\n overflowX: 'hidden'\n })\n })));\n }\n }, {\n key: \"_createColumn\",\n value: function _createColumn(_ref4) {\n var column = _ref4.column,\n columnIndex = _ref4.columnIndex,\n isScrolling = _ref4.isScrolling,\n parent = _ref4.parent,\n rowData = _ref4.rowData,\n rowIndex = _ref4.rowIndex;\n var onColumnClick = this.props.onColumnClick;\n var _column$props = column.props,\n cellDataGetter = _column$props.cellDataGetter,\n cellRenderer = _column$props.cellRenderer,\n className = _column$props.className,\n columnData = _column$props.columnData,\n dataKey = _column$props.dataKey,\n id = _column$props.id;\n var cellData = cellDataGetter({\n columnData: columnData,\n dataKey: dataKey,\n rowData: rowData\n });\n var renderedCell = cellRenderer({\n cellData: cellData,\n columnData: columnData,\n columnIndex: columnIndex,\n dataKey: dataKey,\n isScrolling: isScrolling,\n parent: parent,\n rowData: rowData,\n rowIndex: rowIndex\n });\n\n var onClick = function onClick(event) {\n onColumnClick && onColumnClick({\n columnData: columnData,\n dataKey: dataKey,\n event: event\n });\n };\n\n var style = this._cachedColumnStyles[columnIndex];\n var title = typeof renderedCell === 'string' ? renderedCell : null; // Avoid using object-spread syntax with multiple objects here,\n // Since it results in an extra method call to 'babel-runtime/helpers/extends'\n // See PR https://github.com/bvaughn/react-virtualized/pull/942\n\n return /*#__PURE__*/React.createElement(\"div\", {\n \"aria-colindex\": columnIndex + 1,\n \"aria-describedby\": id,\n className: clsx('ReactVirtualized__Table__rowColumn', className),\n key: 'Row' + rowIndex + '-' + 'Col' + columnIndex,\n onClick: onClick,\n role: \"gridcell\",\n style: style,\n title: title\n }, renderedCell);\n }\n }, {\n key: \"_createHeader\",\n value: function _createHeader(_ref5) {\n var column = _ref5.column,\n index = _ref5.index;\n var _this$props2 = this.props,\n headerClassName = _this$props2.headerClassName,\n headerStyle = _this$props2.headerStyle,\n onHeaderClick = _this$props2.onHeaderClick,\n sort = _this$props2.sort,\n sortBy = _this$props2.sortBy,\n sortDirection = _this$props2.sortDirection;\n var _column$props2 = column.props,\n columnData = _column$props2.columnData,\n dataKey = _column$props2.dataKey,\n defaultSortDirection = _column$props2.defaultSortDirection,\n disableSort = _column$props2.disableSort,\n headerRenderer = _column$props2.headerRenderer,\n id = _column$props2.id,\n label = _column$props2.label;\n var sortEnabled = !disableSort && sort;\n var classNames = clsx('ReactVirtualized__Table__headerColumn', headerClassName, column.props.headerClassName, {\n ReactVirtualized__Table__sortableHeaderColumn: sortEnabled\n });\n\n var style = this._getFlexStyleForColumn(column, _objectSpread({}, headerStyle, {}, column.props.headerStyle));\n\n var renderedHeader = headerRenderer({\n columnData: columnData,\n dataKey: dataKey,\n disableSort: disableSort,\n label: label,\n sortBy: sortBy,\n sortDirection: sortDirection\n });\n var headerOnClick, headerOnKeyDown, headerTabIndex, headerAriaSort, headerAriaLabel;\n\n if (sortEnabled || onHeaderClick) {\n // If this is a sortable header, clicking it should update the table data's sorting.\n var isFirstTimeSort = sortBy !== dataKey; // If this is the firstTime sort of this column, use the column default sort order.\n // Otherwise, invert the direction of the sort.\n\n var newSortDirection = isFirstTimeSort ? defaultSortDirection : sortDirection === SortDirection.DESC ? SortDirection.ASC : SortDirection.DESC;\n\n var onClick = function onClick(event) {\n sortEnabled && sort({\n defaultSortDirection: defaultSortDirection,\n event: event,\n sortBy: dataKey,\n sortDirection: newSortDirection\n });\n onHeaderClick && onHeaderClick({\n columnData: columnData,\n dataKey: dataKey,\n event: event\n });\n };\n\n var onKeyDown = function onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n onClick(event);\n }\n };\n\n headerAriaLabel = column.props['aria-label'] || label || dataKey;\n headerAriaSort = 'none';\n headerTabIndex = 0;\n headerOnClick = onClick;\n headerOnKeyDown = onKeyDown;\n }\n\n if (sortBy === dataKey) {\n headerAriaSort = sortDirection === SortDirection.ASC ? 'ascending' : 'descending';\n } // Avoid using object-spread syntax with multiple objects here,\n // Since it results in an extra method call to 'babel-runtime/helpers/extends'\n // See PR https://github.com/bvaughn/react-virtualized/pull/942\n\n\n return /*#__PURE__*/React.createElement(\"div\", {\n \"aria-label\": headerAriaLabel,\n \"aria-sort\": headerAriaSort,\n className: classNames,\n id: id,\n key: 'Header-Col' + index,\n onClick: headerOnClick,\n onKeyDown: headerOnKeyDown,\n role: \"columnheader\",\n style: style,\n tabIndex: headerTabIndex\n }, renderedHeader);\n }\n }, {\n key: \"_createRow\",\n value: function _createRow(_ref6) {\n var _this3 = this;\n\n var index = _ref6.rowIndex,\n isScrolling = _ref6.isScrolling,\n key = _ref6.key,\n parent = _ref6.parent,\n style = _ref6.style;\n var _this$props3 = this.props,\n children = _this$props3.children,\n onRowClick = _this$props3.onRowClick,\n onRowDoubleClick = _this$props3.onRowDoubleClick,\n onRowRightClick = _this$props3.onRowRightClick,\n onRowMouseOver = _this$props3.onRowMouseOver,\n onRowMouseOut = _this$props3.onRowMouseOut,\n rowClassName = _this$props3.rowClassName,\n rowGetter = _this$props3.rowGetter,\n rowRenderer = _this$props3.rowRenderer,\n rowStyle = _this$props3.rowStyle;\n var scrollbarWidth = this.state.scrollbarWidth;\n var rowClass = typeof rowClassName === 'function' ? rowClassName({\n index: index\n }) : rowClassName;\n var rowStyleObject = typeof rowStyle === 'function' ? rowStyle({\n index: index\n }) : rowStyle;\n var rowData = rowGetter({\n index: index\n });\n var columns = React.Children.toArray(children).map(function (column, columnIndex) {\n return _this3._createColumn({\n column: column,\n columnIndex: columnIndex,\n isScrolling: isScrolling,\n parent: parent,\n rowData: rowData,\n rowIndex: index,\n scrollbarWidth: scrollbarWidth\n });\n });\n var className = clsx('ReactVirtualized__Table__row', rowClass);\n\n var flattenedStyle = _objectSpread({}, style, {\n height: this._getRowHeight(index),\n overflow: 'hidden',\n paddingRight: scrollbarWidth\n }, rowStyleObject);\n\n return rowRenderer({\n className: className,\n columns: columns,\n index: index,\n isScrolling: isScrolling,\n key: key,\n onRowClick: onRowClick,\n onRowDoubleClick: onRowDoubleClick,\n onRowRightClick: onRowRightClick,\n onRowMouseOver: onRowMouseOver,\n onRowMouseOut: onRowMouseOut,\n rowData: rowData,\n style: flattenedStyle\n });\n }\n /**\n * Determines the flex-shrink, flex-grow, and width values for a cell (header or column).\n */\n\n }, {\n key: \"_getFlexStyleForColumn\",\n value: function _getFlexStyleForColumn(column) {\n var customStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var flexValue = \"\".concat(column.props.flexGrow, \" \").concat(column.props.flexShrink, \" \").concat(column.props.width, \"px\");\n\n var style = _objectSpread({}, customStyle, {\n flex: flexValue,\n msFlex: flexValue,\n WebkitFlex: flexValue\n });\n\n if (column.props.maxWidth) {\n style.maxWidth = column.props.maxWidth;\n }\n\n if (column.props.minWidth) {\n style.minWidth = column.props.minWidth;\n }\n\n return style;\n }\n }, {\n key: \"_getHeaderColumns\",\n value: function _getHeaderColumns() {\n var _this4 = this;\n\n var _this$props4 = this.props,\n children = _this$props4.children,\n disableHeader = _this$props4.disableHeader;\n var items = disableHeader ? [] : React.Children.toArray(children);\n return items.map(function (column, index) {\n return _this4._createHeader({\n column: column,\n index: index\n });\n });\n }\n }, {\n key: \"_getRowHeight\",\n value: function _getRowHeight(rowIndex) {\n var rowHeight = this.props.rowHeight;\n return typeof rowHeight === 'function' ? rowHeight({\n index: rowIndex\n }) : rowHeight;\n }\n }, {\n key: \"_onScroll\",\n value: function _onScroll(_ref7) {\n var clientHeight = _ref7.clientHeight,\n scrollHeight = _ref7.scrollHeight,\n scrollTop = _ref7.scrollTop;\n var onScroll = this.props.onScroll;\n onScroll({\n clientHeight: clientHeight,\n scrollHeight: scrollHeight,\n scrollTop: scrollTop\n });\n }\n }, {\n key: \"_onSectionRendered\",\n value: function _onSectionRendered(_ref8) {\n var rowOverscanStartIndex = _ref8.rowOverscanStartIndex,\n rowOverscanStopIndex = _ref8.rowOverscanStopIndex,\n rowStartIndex = _ref8.rowStartIndex,\n rowStopIndex = _ref8.rowStopIndex;\n var onRowsRendered = this.props.onRowsRendered;\n onRowsRendered({\n overscanStartIndex: rowOverscanStartIndex,\n overscanStopIndex: rowOverscanStopIndex,\n startIndex: rowStartIndex,\n stopIndex: rowStopIndex\n });\n }\n }, {\n key: \"_setRef\",\n value: function _setRef(ref) {\n this.Grid = ref;\n }\n }, {\n key: \"_setScrollbarWidth\",\n value: function _setScrollbarWidth() {\n var scrollbarWidth = this.getScrollbarWidth();\n this.setState({\n scrollbarWidth: scrollbarWidth\n });\n }\n }]);\n\n return Table;\n}(React.PureComponent);\n\n_defineProperty(Table, \"defaultProps\", {\n disableHeader: false,\n estimatedRowSize: 30,\n headerHeight: 0,\n headerStyle: {},\n noRowsRenderer: function noRowsRenderer() {\n return null;\n },\n onRowsRendered: function onRowsRendered() {\n return null;\n },\n onScroll: function onScroll() {\n return null;\n },\n overscanIndicesGetter: accessibilityOverscanIndicesGetter,\n overscanRowCount: 10,\n rowRenderer: defaultRowRenderer,\n headerRowRenderer: defaultHeaderRowRenderer,\n rowStyle: {},\n scrollToAlignment: 'auto',\n scrollToIndex: -1,\n style: {}\n});\n\nexport { Table as default };","/**\n * Default accessor for returning a cell value for a given attribute.\n * This function expects to operate on either a vanilla Object or an Immutable Map.\n * You should override the column's cellDataGetter if your data is some other type of object.\n */\nexport default function defaultCellDataGetter(_ref) {\n var dataKey = _ref.dataKey,\n rowData = _ref.rowData;\n\n if (typeof rowData.get === 'function') {\n return rowData.get(dataKey);\n } else {\n return rowData[dataKey];\n }\n}","/**\n * Default cell renderer that displays an attribute as a simple string\n * You should override the column's cellRenderer if your data is some other type of object.\n */\nexport default function defaultCellRenderer(_ref) {\n var cellData = _ref.cellData;\n\n if (cellData == null) {\n return '';\n } else {\n return String(cellData);\n }\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\n/**\n * Default row renderer for Table.\n */\n\nexport default function defaultRowRenderer(_ref) {\n var className = _ref.className,\n columns = _ref.columns,\n index = _ref.index,\n key = _ref.key,\n onRowClick = _ref.onRowClick,\n onRowDoubleClick = _ref.onRowDoubleClick,\n onRowMouseOut = _ref.onRowMouseOut,\n onRowMouseOver = _ref.onRowMouseOver,\n onRowRightClick = _ref.onRowRightClick,\n rowData = _ref.rowData,\n style = _ref.style;\n var a11yProps = {\n 'aria-rowindex': index + 1\n };\n\n if (onRowClick || onRowDoubleClick || onRowMouseOut || onRowMouseOver || onRowRightClick) {\n a11yProps['aria-label'] = 'row';\n a11yProps.tabIndex = 0;\n\n if (onRowClick) {\n a11yProps.onClick = function (event) {\n return onRowClick({\n event: event,\n index: index,\n rowData: rowData\n });\n };\n }\n\n if (onRowDoubleClick) {\n a11yProps.onDoubleClick = function (event) {\n return onRowDoubleClick({\n event: event,\n index: index,\n rowData: rowData\n });\n };\n }\n\n if (onRowMouseOut) {\n a11yProps.onMouseOut = function (event) {\n return onRowMouseOut({\n event: event,\n index: index,\n rowData: rowData\n });\n };\n }\n\n if (onRowMouseOver) {\n a11yProps.onMouseOver = function (event) {\n return onRowMouseOver({\n event: event,\n index: index,\n rowData: rowData\n });\n };\n }\n\n if (onRowRightClick) {\n a11yProps.onContextMenu = function (event) {\n return onRowRightClick({\n event: event,\n index: index,\n rowData: rowData\n });\n };\n }\n }\n\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, a11yProps, {\n className: className,\n key: key,\n role: \"row\",\n style: style\n }), columns);\n}","import * as React from 'react';\nexport default function defaultHeaderRowRenderer(_ref) {\n var className = _ref.className,\n columns = _ref.columns,\n style = _ref.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n role: \"row\",\n style: style\n }, columns);\n}","import createMultiSort from './createMultiSort';\nimport defaultCellDataGetter from './defaultCellDataGetter';\nimport defaultCellRenderer from './defaultCellRenderer';\nimport defaultHeaderRowRenderer from './defaultHeaderRowRenderer.js';\nimport defaultHeaderRenderer from './defaultHeaderRenderer';\nimport defaultRowRenderer from './defaultRowRenderer';\nimport Column from './Column';\nimport SortDirection from './SortDirection';\nimport SortIndicator from './SortIndicator';\nimport Table from './Table';\nexport default Table;\nexport { createMultiSort, defaultCellDataGetter, defaultCellRenderer, defaultHeaderRowRenderer, defaultHeaderRenderer, defaultRowRenderer, Column, SortDirection, SortIndicator, Table };","import { requestAnimationTimeout, cancelAnimationTimeout } from '../../utils/requestAnimationTimeout';\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 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 document.body.style.pointerEvents = 'none';\n }\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\n mountedInstances.push(component);\n}\nexport function unregisterScrollListener(component, element) {\n mountedInstances = mountedInstances.filter(function (instance) {\n return instance !== component;\n });\n\n if (!mountedInstances.length) {\n element.removeEventListener('scroll', onScrollWindow);\n\n if (disablePointerEventsTimeoutId) {\n cancelAnimationTimeout(disablePointerEventsTimeoutId);\n enablePointerEventsIfDisabled();\n }\n }\n}","/**\n * Gets the dimensions of the element, accounting for API differences between\n * `window` and other DOM elements.\n */\n// TODO Move this into WindowScroller and import from there\nvar isWindow = function isWindow(element) {\n return element === window;\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 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 * 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 */\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\n var _elementRect = getBoundingBox(element);\n\n var _containerRect = getBoundingBox(container);\n\n return {\n top: _elementRect.top + scrollOffset.top - _containerRect.top,\n left: _elementRect.left + scrollOffset.left - _containerRect.left\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 */\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 _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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\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 * 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 */\n\nexport var IS_SCROLLING_TIMEOUT = 150;\n\nvar getWindow = function getWindow() {\n return typeof window !== 'undefined' ? window : undefined;\n};\n\nvar WindowScroller = (_temp = _class = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(WindowScroller, _React$PureComponent);\n\n function WindowScroller() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, WindowScroller);\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(WindowScroller)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"_window\", getWindow());\n\n _defineProperty(_assertThisInitialized(_this), \"_isMounted\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"_positionFromTop\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_positionFromLeft\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_detectElementResize\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_child\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"state\", _objectSpread({}, getDimensions(_this.props.scrollElement, _this.props), {\n isScrolling: false,\n scrollLeft: 0,\n scrollTop: 0\n }));\n\n _defineProperty(_assertThisInitialized(_this), \"_registerChild\", function (element) {\n if (element && !(element instanceof Element)) {\n console.warn('WindowScroller registerChild expects to be passed Element or null');\n }\n\n _this._child = element;\n\n _this.updatePosition();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onChildScroll\", function (_ref) {\n var scrollTop = _ref.scrollTop;\n\n if (_this.state.scrollTop === scrollTop) {\n return;\n }\n\n var scrollElement = _this.props.scrollElement;\n\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 });\n\n _defineProperty(_assertThisInitialized(_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 });\n\n _defineProperty(_assertThisInitialized(_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 });\n\n _defineProperty(_assertThisInitialized(_this), \"_onResize\", function () {\n _this.updatePosition();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"__handleWindowScrollEvent\", function () {\n if (!_this._isMounted) {\n return;\n }\n\n var onScroll = _this.props.onScroll;\n var scrollElement = _this.props.scrollElement;\n\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 });\n\n _defineProperty(_assertThisInitialized(_this), \"__resetIsScrolling\", function () {\n _this.setState({\n isScrolling: false\n });\n });\n\n return _this;\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 _this$state = this.state,\n height = _this$state.height,\n width = _this$state.width;\n var thisNode = this._child || ReactDOM.findDOMNode(this);\n\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\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 this._detectElementResize = createDetectElementResize();\n this.updatePosition(scrollElement);\n\n if (scrollElement) {\n registerScrollListener(this, scrollElement);\n\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 if (prevScrollElement !== scrollElement && prevScrollElement != null && scrollElement != null) {\n this.updatePosition(scrollElement);\n unregisterScrollListener(this, prevScrollElement);\n registerScrollListener(this, scrollElement);\n\n this._unregisterResizeListener(prevScrollElement);\n\n this._registerResizeListener(scrollElement);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var scrollElement = this.props.scrollElement;\n\n if (scrollElement) {\n unregisterScrollListener(this, scrollElement);\n\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 _this$state2 = this.state,\n isScrolling = _this$state2.isScrolling,\n scrollTop = _this$state2.scrollTop,\n scrollLeft = _this$state2.scrollLeft,\n height = _this$state2.height,\n width = _this$state2.width;\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\n return WindowScroller;\n}(React.PureComponent), _defineProperty(_class, \"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 /** Callback to be invoked on-resize: ({ height, width }) */\n \"onResize\": PropTypes.func.isRequired,\n\n /** Callback to be invoked on-scroll: ({ scrollLeft, scrollTop }) */\n \"onScroll\": PropTypes.func.isRequired,\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 /** Height used for server-side rendering */\n \"serverHeight\": PropTypes.number.isRequired,\n\n /** Width used for server-side rendering */\n \"serverWidth\": PropTypes.number.isRequired\n}), _temp);\n\n_defineProperty(WindowScroller, \"defaultProps\", {\n onResize: function onResize() {},\n onScroll: function onScroll() {},\n scrollingResetTimeInterval: IS_SCROLLING_TIMEOUT,\n scrollElement: getWindow(),\n serverHeight: 0,\n serverWidth: 0\n});\n\nexport { WindowScroller as default };\nimport PropTypes from \"prop-types\";","import WindowScroller, { IS_SCROLLING_TIMEOUT } from './WindowScroller';\nexport default WindowScroller;\nexport { WindowScroller, IS_SCROLLING_TIMEOUT };","var _excluded = [\"scaffoldBlockPxWidth\", \"toggleChildrenVisibility\", \"connectDragPreview\", \"connectDragSource\", \"isDragging\", \"canDrop\", \"canDrag\", \"node\", \"title\", \"subtitle\", \"draggedNode\", \"path\", \"treeIndex\", \"isSearchMatch\", \"isSearchFocus\", \"buttons\", \"className\", \"style\", \"didDrop\", \"treeId\", \"isOver\", \"parentNode\", \"rowDirection\"],\n _excluded2 = [\"children\", \"listIndex\", \"swapFrom\", \"swapLength\", \"swapDepth\", \"scaffoldBlockPxWidth\", \"lowerSiblingCounts\", \"connectDropTarget\", \"isOver\", \"draggedNode\", \"canDrop\", \"treeIndex\", \"treeId\", \"getPrevRow\", \"node\", \"path\", \"rowDirection\"],\n _excluded3 = [\"children\", \"connectDropTarget\", \"treeId\", \"drop\"];\n\nfunction _ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _ownKeys(Object(source), !0).forEach(function (key) { _defineProperty2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : _ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray2(arr) { return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2(); }\n\nfunction _nonIterableSpread2() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray2(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray2(o, minLen); }\n\nfunction _iterableToArray2(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles2(arr) { if (Array.isArray(arr)) return _arrayLikeToArray2(arr); }\n\nfunction _arrayLikeToArray2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction __defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass2(Constructor, protoProps, staticProps) { if (protoProps) __defineProperties(Constructor.prototype, protoProps); if (staticProps) __defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits2(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf2(subClass, superClass); }\n\nfunction _setPrototypeOf2(o, p) { _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf2(o, p); }\n\nfunction _createSuper2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct2(); return function _createSuperInternal() { var Super = _getPrototypeOf2(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf2(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn2(this, result); }; }\n\nfunction _possibleConstructorReturn2(self, call) { if (call && (_typeof2(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized2(self); }\n\nfunction _assertThisInitialized2(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct2() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf2(o) { _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf2(o); }\n\nfunction _typeof2(obj) { \"@babel/helpers - typeof\"; return _typeof2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof2(obj); }\n\nimport isEqual from 'lodash.isequal';\nimport React, { Component, Children, cloneElement } from 'react';\nimport { DragSource, DropTarget, DndContext, DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\nimport { List, AutoSizer } from 'react-virtualized';\nimport withScrolling, { createScrollingComponent, createVerticalStrength, createHorizontalStrength } from '@nosferatu500/react-dnd-scrollzone';\nimport { findDOMNode } from 'react-dom';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof2(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n } // Binding \"this\" is important for shallow renderer support.\n\n\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n} // React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\n\n\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {\n return Component;\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n\n\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var componentName = Component.displayName || Component.name;\n var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') + '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://fb.me/react-async-component-lifecycle-hooks');\n } // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n } // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n\n\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n/**\n * Performs a depth-first traversal over all of the node descendants,\n * incrementing currentIndex by 1 for each\n */\n\n\nfunction getNodeDataAtTreeIndexOrNextIndex(_ref) {\n var targetIndex = _ref.targetIndex,\n node = _ref.node,\n currentIndex = _ref.currentIndex,\n getNodeKey = _ref.getNodeKey,\n _ref$path = _ref.path,\n path = _ref$path === void 0 ? [] : _ref$path,\n _ref$lowerSiblingCoun = _ref.lowerSiblingCounts,\n lowerSiblingCounts = _ref$lowerSiblingCoun === void 0 ? [] : _ref$lowerSiblingCoun,\n _ref$ignoreCollapsed = _ref.ignoreCollapsed,\n ignoreCollapsed = _ref$ignoreCollapsed === void 0 ? true : _ref$ignoreCollapsed,\n _ref$isPseudoRoot = _ref.isPseudoRoot,\n isPseudoRoot = _ref$isPseudoRoot === void 0 ? false : _ref$isPseudoRoot; // The pseudo-root is not considered in the path\n\n var selfPath = !isPseudoRoot ? [].concat(_toConsumableArray(path), [getNodeKey({\n node: node,\n treeIndex: currentIndex\n })]) : []; // Return target node when found\n\n if (currentIndex === targetIndex) {\n return {\n node: node,\n lowerSiblingCounts: lowerSiblingCounts,\n path: selfPath\n };\n } // Add one and continue for nodes with no children or hidden children\n\n\n if (!node.children || ignoreCollapsed && node.expanded !== true) {\n return {\n nextIndex: currentIndex + 1\n };\n } // Iterate over each child and their descendants and return the\n // target node if childIndex reaches the targetIndex\n\n\n var childIndex = currentIndex + 1;\n var childCount = node.children.length;\n\n for (var i = 0; i < childCount; i += 1) {\n var result = getNodeDataAtTreeIndexOrNextIndex({\n ignoreCollapsed: ignoreCollapsed,\n getNodeKey: getNodeKey,\n targetIndex: targetIndex,\n node: node.children[i],\n currentIndex: childIndex,\n lowerSiblingCounts: [].concat(_toConsumableArray(lowerSiblingCounts), [childCount - i - 1]),\n path: selfPath\n });\n\n if (result.node) {\n return result;\n }\n\n childIndex = result.nextIndex;\n } // If the target node is not found, return the farthest traversed index\n\n\n return {\n nextIndex: childIndex\n };\n}\n\nfunction getDescendantCount(_ref2) {\n var node = _ref2.node,\n _ref2$ignoreCollapsed = _ref2.ignoreCollapsed,\n ignoreCollapsed = _ref2$ignoreCollapsed === void 0 ? true : _ref2$ignoreCollapsed;\n return getNodeDataAtTreeIndexOrNextIndex({\n getNodeKey: function getNodeKey() {},\n ignoreCollapsed: ignoreCollapsed,\n node: node,\n currentIndex: 0,\n targetIndex: -1\n }).nextIndex - 1;\n}\n/**\n * Walk all descendants of the given node, depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\n\n\nfunction walkDescendants(_ref3) {\n var callback = _ref3.callback,\n getNodeKey = _ref3.getNodeKey,\n ignoreCollapsed = _ref3.ignoreCollapsed,\n _ref3$isPseudoRoot = _ref3.isPseudoRoot,\n isPseudoRoot = _ref3$isPseudoRoot === void 0 ? false : _ref3$isPseudoRoot,\n node = _ref3.node,\n _ref3$parentNode = _ref3.parentNode,\n parentNode = _ref3$parentNode === void 0 ? null : _ref3$parentNode,\n currentIndex = _ref3.currentIndex,\n _ref3$path = _ref3.path,\n path = _ref3$path === void 0 ? [] : _ref3$path,\n _ref3$lowerSiblingCou = _ref3.lowerSiblingCounts,\n lowerSiblingCounts = _ref3$lowerSiblingCou === void 0 ? [] : _ref3$lowerSiblingCou; // The pseudo-root is not considered in the path\n\n var selfPath = isPseudoRoot ? [] : [].concat(_toConsumableArray(path), [getNodeKey({\n node: node,\n treeIndex: currentIndex\n })]);\n var selfInfo = isPseudoRoot ? null : {\n node: node,\n parentNode: parentNode,\n path: selfPath,\n lowerSiblingCounts: lowerSiblingCounts,\n treeIndex: currentIndex\n };\n\n if (!isPseudoRoot) {\n var callbackResult = callback(selfInfo); // Cut walk short if the callback returned false\n\n if (callbackResult === false) {\n return false;\n }\n } // Return self on nodes with no children or hidden children\n\n\n if (!node.children || node.expanded !== true && ignoreCollapsed && !isPseudoRoot) {\n return currentIndex;\n } // Get all descendants\n\n\n var childIndex = currentIndex;\n var childCount = node.children.length;\n\n if (typeof node.children !== 'function') {\n for (var i = 0; i < childCount; i += 1) {\n childIndex = walkDescendants({\n callback: callback,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n node: node.children[i],\n parentNode: isPseudoRoot ? null : node,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [].concat(_toConsumableArray(lowerSiblingCounts), [childCount - i - 1]),\n path: selfPath\n }); // Cut walk short if the callback returned false\n\n if (childIndex === false) {\n return false;\n }\n }\n }\n\n return childIndex;\n}\n/**\n * Perform a change on the given node and all its descendants, traversing the tree depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\n\n\nfunction mapDescendants(_ref4) {\n var callback = _ref4.callback,\n getNodeKey = _ref4.getNodeKey,\n ignoreCollapsed = _ref4.ignoreCollapsed,\n _ref4$isPseudoRoot = _ref4.isPseudoRoot,\n isPseudoRoot = _ref4$isPseudoRoot === void 0 ? false : _ref4$isPseudoRoot,\n node = _ref4.node,\n _ref4$parentNode = _ref4.parentNode,\n parentNode = _ref4$parentNode === void 0 ? null : _ref4$parentNode,\n currentIndex = _ref4.currentIndex,\n _ref4$path = _ref4.path,\n path = _ref4$path === void 0 ? [] : _ref4$path,\n _ref4$lowerSiblingCou = _ref4.lowerSiblingCounts,\n lowerSiblingCounts = _ref4$lowerSiblingCou === void 0 ? [] : _ref4$lowerSiblingCou;\n\n var nextNode = _objectSpread2({}, node); // The pseudo-root is not considered in the path\n\n\n var selfPath = isPseudoRoot ? [] : [].concat(_toConsumableArray(path), [getNodeKey({\n node: nextNode,\n treeIndex: currentIndex\n })]);\n var selfInfo = {\n node: nextNode,\n parentNode: parentNode,\n path: selfPath,\n lowerSiblingCounts: lowerSiblingCounts,\n treeIndex: currentIndex\n }; // Return self on nodes with no children or hidden children\n\n if (!nextNode.children || nextNode.expanded !== true && ignoreCollapsed && !isPseudoRoot) {\n return {\n treeIndex: currentIndex,\n node: callback(selfInfo)\n };\n } // Get all descendants\n\n\n var childIndex = currentIndex;\n var childCount = nextNode.children.length;\n\n if (typeof nextNode.children !== 'function') {\n nextNode.children = nextNode.children.map(function (child, i) {\n var mapResult = mapDescendants({\n callback: callback,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n node: child,\n parentNode: isPseudoRoot ? null : nextNode,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [].concat(_toConsumableArray(lowerSiblingCounts), [childCount - i - 1]),\n path: selfPath\n });\n childIndex = mapResult.treeIndex;\n return mapResult.node;\n });\n }\n\n return {\n node: callback(selfInfo),\n treeIndex: childIndex\n };\n}\n/**\n * Count all the visible (expanded) descendants in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n *\n * @return {number} count\n */\n\n\nfunction getVisibleNodeCount(_ref5) {\n var treeData = _ref5.treeData;\n\n var traverse = function traverse(node) {\n if (!node.children || node.expanded !== true || typeof node.children === 'function') {\n return 1;\n }\n\n return 1 + node.children.reduce(function (total, currentNode) {\n return total + traverse(currentNode);\n }, 0);\n };\n\n return treeData.reduce(function (total, currentNode) {\n return total + traverse(currentNode);\n }, 0);\n}\n/**\n * Get the th visible node in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} targetIndex - The index of the node to search for\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }|null} node - The node at targetIndex, or null if not found\n */\n\n\nfunction getVisibleNodeInfoAtIndex(_ref6) {\n var treeData = _ref6.treeData,\n targetIndex = _ref6.index,\n getNodeKey = _ref6.getNodeKey;\n\n if (!treeData || treeData.length < 1) {\n return null;\n } // Call the tree traversal with a pseudo-root node\n\n\n var result = getNodeDataAtTreeIndexOrNextIndex({\n targetIndex: targetIndex,\n getNodeKey: getNodeKey,\n node: {\n children: treeData,\n expanded: true\n },\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: [],\n isPseudoRoot: true\n });\n\n if (result.node) {\n return result;\n }\n\n return null;\n}\n/**\n * Walk descendants depth-first and call a callback on each\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return void\n */\n\n\nfunction walk(_ref7) {\n var treeData = _ref7.treeData,\n getNodeKey = _ref7.getNodeKey,\n callback = _ref7.callback,\n _ref7$ignoreCollapsed = _ref7.ignoreCollapsed,\n ignoreCollapsed = _ref7$ignoreCollapsed === void 0 ? true : _ref7$ignoreCollapsed;\n\n if (!treeData || treeData.length < 1) {\n return;\n }\n\n walkDescendants({\n callback: callback,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n isPseudoRoot: true,\n node: {\n children: treeData\n },\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n });\n}\n/**\n * Perform a depth-first transversal of the descendants and\n * make a change to every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\n\n\nfunction map(_ref8) {\n var treeData = _ref8.treeData,\n getNodeKey = _ref8.getNodeKey,\n callback = _ref8.callback,\n _ref8$ignoreCollapsed = _ref8.ignoreCollapsed,\n ignoreCollapsed = _ref8$ignoreCollapsed === void 0 ? true : _ref8$ignoreCollapsed;\n\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n return mapDescendants({\n callback: callback,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n isPseudoRoot: true,\n node: {\n children: treeData\n },\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n }).node.children;\n}\n/**\n * Expand or close every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {?boolean} expanded - Whether the node is expanded or not\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\n\n\nfunction toggleExpandedForAll(_ref9) {\n var treeData = _ref9.treeData,\n _ref9$expanded = _ref9.expanded,\n expanded = _ref9$expanded === void 0 ? true : _ref9$expanded;\n return map({\n treeData: treeData,\n callback: function callback(_ref10) {\n var node = _ref10.node;\n return _objectSpread2(_objectSpread2({}, node), {}, {\n expanded: expanded\n });\n },\n getNodeKey: function getNodeKey(_ref11) {\n var treeIndex = _ref11.treeIndex;\n return treeIndex;\n },\n ignoreCollapsed: false\n });\n}\n/**\n * Replaces node at path with object, or callback-defined object\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be changed\n * @param {function|any} newNode - Node to replace the node at the path with, or a function producing the new node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\n\n\nfunction changeNodeAtPath(_ref12) {\n var treeData = _ref12.treeData,\n path = _ref12.path,\n newNode = _ref12.newNode,\n getNodeKey = _ref12.getNodeKey,\n _ref12$ignoreCollapse = _ref12.ignoreCollapsed,\n ignoreCollapsed = _ref12$ignoreCollapse === void 0 ? true : _ref12$ignoreCollapse;\n var RESULT_MISS = 'RESULT_MISS';\n\n var traverse = function traverse(_ref13) {\n var _ref13$isPseudoRoot = _ref13.isPseudoRoot,\n isPseudoRoot = _ref13$isPseudoRoot === void 0 ? false : _ref13$isPseudoRoot,\n node = _ref13.node,\n currentTreeIndex = _ref13.currentTreeIndex,\n pathIndex = _ref13.pathIndex;\n\n if (!isPseudoRoot && getNodeKey({\n node: node,\n treeIndex: currentTreeIndex\n }) !== path[pathIndex]) {\n return RESULT_MISS;\n }\n\n if (pathIndex >= path.length - 1) {\n // If this is the final location in the path, return its changed form\n return typeof newNode === 'function' ? newNode({\n node: node,\n treeIndex: currentTreeIndex\n }) : newNode;\n }\n\n if (!node.children) {\n // If this node is part of the path, but has no children, return the unchanged node\n throw new Error('Path referenced children of node with no children.');\n }\n\n var nextTreeIndex = currentTreeIndex + 1;\n\n for (var i = 0; i < node.children.length; i += 1) {\n var _result = traverse({\n node: node.children[i],\n currentTreeIndex: nextTreeIndex,\n pathIndex: pathIndex + 1\n }); // If the result went down the correct path\n\n\n if (_result !== RESULT_MISS) {\n if (_result) {\n // If the result was truthy (in this case, an object),\n // pass it to the next level of recursion up\n return _objectSpread2(_objectSpread2({}, node), {}, {\n children: [].concat(_toConsumableArray(node.children.slice(0, i)), [_result], _toConsumableArray(node.children.slice(i + 1)))\n });\n } // If the result was falsy (returned from the newNode function), then\n // delete the node from the array.\n\n\n return _objectSpread2(_objectSpread2({}, node), {}, {\n children: [].concat(_toConsumableArray(node.children.slice(0, i)), _toConsumableArray(node.children.slice(i + 1)))\n });\n }\n\n nextTreeIndex += 1 + getDescendantCount({\n node: node.children[i],\n ignoreCollapsed: ignoreCollapsed\n });\n }\n\n return RESULT_MISS;\n }; // Use a pseudo-root node in the beginning traversal\n\n\n var result = traverse({\n node: {\n children: treeData\n },\n currentTreeIndex: -1,\n pathIndex: -1,\n isPseudoRoot: true\n });\n\n if (result === RESULT_MISS) {\n throw new Error('No node found at the given path.');\n }\n\n return result.children;\n}\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The tree data with the node removed\n */\n\n\nfunction removeNodeAtPath(_ref14) {\n var treeData = _ref14.treeData,\n path = _ref14.path,\n getNodeKey = _ref14.getNodeKey,\n _ref14$ignoreCollapse = _ref14.ignoreCollapsed,\n ignoreCollapsed = _ref14$ignoreCollapse === void 0 ? true : _ref14$ignoreCollapse;\n return changeNodeAtPath({\n treeData: treeData,\n path: path,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n newNode: null // Delete the node\n\n });\n}\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node removed\n * @return {Object} result.node - The node that was removed\n * @return {number} result.treeIndex - The previous treeIndex of the removed node\n */\n\n\nfunction removeNode(_ref15) {\n var treeData = _ref15.treeData,\n path = _ref15.path,\n getNodeKey = _ref15.getNodeKey,\n _ref15$ignoreCollapse = _ref15.ignoreCollapsed,\n ignoreCollapsed = _ref15$ignoreCollapse === void 0 ? true : _ref15$ignoreCollapse;\n var removedNode = null;\n var removedTreeIndex = null;\n var nextTreeData = changeNodeAtPath({\n treeData: treeData,\n path: path,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n newNode: function newNode(_ref16) {\n var node = _ref16.node,\n treeIndex = _ref16.treeIndex; // Store the target node and delete it from the tree\n\n removedNode = node;\n removedTreeIndex = treeIndex;\n return null;\n }\n });\n return {\n treeData: nextTreeData,\n node: removedNode,\n treeIndex: removedTreeIndex\n };\n}\n/**\n * Gets the node at the specified path\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object|null} nodeInfo - The node info at the given path, or null if not found\n */\n\n\nfunction getNodeAtPath(_ref17) {\n var treeData = _ref17.treeData,\n path = _ref17.path,\n getNodeKey = _ref17.getNodeKey,\n _ref17$ignoreCollapse = _ref17.ignoreCollapsed,\n ignoreCollapsed = _ref17$ignoreCollapse === void 0 ? true : _ref17$ignoreCollapse;\n var foundNodeInfo = null;\n\n try {\n changeNodeAtPath({\n treeData: treeData,\n path: path,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n newNode: function newNode(_ref18) {\n var node = _ref18.node,\n treeIndex = _ref18.treeIndex;\n foundNodeInfo = {\n node: node,\n treeIndex: treeIndex\n };\n return node;\n }\n });\n } catch (err) {// Ignore the error -- the null return will be explanation enough\n }\n\n return foundNodeInfo;\n}\n/**\n * Adds the node to the specified parent and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {!Object} newNode - The node to insert\n * @param {number|string} parentKey - The key of the to-be parentNode of the node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parentNode specified by parentPath\n * @param {boolean=} addAsFirstChild - If true, adds new node as first child of tree\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The updated tree data\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n */\n\n\nfunction addNodeUnderParent(_ref19) {\n var treeData = _ref19.treeData,\n newNode = _ref19.newNode,\n _ref19$parentKey = _ref19.parentKey,\n parentKey = _ref19$parentKey === void 0 ? null : _ref19$parentKey,\n getNodeKey = _ref19.getNodeKey,\n _ref19$ignoreCollapse = _ref19.ignoreCollapsed,\n ignoreCollapsed = _ref19$ignoreCollapse === void 0 ? true : _ref19$ignoreCollapse,\n _ref19$expandParent = _ref19.expandParent,\n expandParent = _ref19$expandParent === void 0 ? false : _ref19$expandParent,\n _ref19$addAsFirstChil = _ref19.addAsFirstChild,\n addAsFirstChild = _ref19$addAsFirstChil === void 0 ? false : _ref19$addAsFirstChil;\n\n if (parentKey === null) {\n return addAsFirstChild ? {\n treeData: [newNode].concat(_toConsumableArray(treeData || [])),\n treeIndex: 0\n } : {\n treeData: [].concat(_toConsumableArray(treeData || []), [newNode]),\n treeIndex: (treeData || []).length\n };\n }\n\n var insertedTreeIndex = null;\n var hasBeenAdded = false;\n var changedTreeData = map({\n treeData: treeData,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n callback: function callback(_ref20) {\n var node = _ref20.node,\n treeIndex = _ref20.treeIndex,\n path = _ref20.path;\n var key = path ? path[path.length - 1] : null; // Return nodes that are not the parent as-is\n\n if (hasBeenAdded || key !== parentKey) {\n return node;\n }\n\n hasBeenAdded = true;\n\n var parentNode = _objectSpread2({}, node);\n\n if (expandParent) {\n parentNode.expanded = true;\n } // If no children exist yet, just add the single newNode\n\n\n if (!parentNode.children) {\n insertedTreeIndex = treeIndex + 1;\n return _objectSpread2(_objectSpread2({}, parentNode), {}, {\n children: [newNode]\n });\n }\n\n if (typeof parentNode.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n }\n\n var nextTreeIndex = treeIndex + 1;\n\n for (var i = 0; i < parentNode.children.length; i += 1) {\n nextTreeIndex += 1 + getDescendantCount({\n node: parentNode.children[i],\n ignoreCollapsed: ignoreCollapsed\n });\n }\n\n insertedTreeIndex = nextTreeIndex;\n var children = addAsFirstChild ? [newNode].concat(_toConsumableArray(parentNode.children)) : [].concat(_toConsumableArray(parentNode.children), [newNode]);\n return _objectSpread2(_objectSpread2({}, parentNode), {}, {\n children: children\n });\n }\n });\n\n if (!hasBeenAdded) {\n throw new Error('No node found with the given key.');\n }\n\n return {\n treeData: changedTreeData,\n treeIndex: insertedTreeIndex\n };\n}\n\nfunction addNodeAtDepthAndIndex(_ref21) {\n var targetDepth = _ref21.targetDepth,\n minimumTreeIndex = _ref21.minimumTreeIndex,\n newNode = _ref21.newNode,\n ignoreCollapsed = _ref21.ignoreCollapsed,\n expandParent = _ref21.expandParent,\n _ref21$isPseudoRoot = _ref21.isPseudoRoot,\n isPseudoRoot = _ref21$isPseudoRoot === void 0 ? false : _ref21$isPseudoRoot,\n isLastChild = _ref21.isLastChild,\n node = _ref21.node,\n currentIndex = _ref21.currentIndex,\n currentDepth = _ref21.currentDepth,\n getNodeKey = _ref21.getNodeKey,\n _ref21$path = _ref21.path,\n path = _ref21$path === void 0 ? [] : _ref21$path;\n\n var selfPath = function selfPath(n) {\n return isPseudoRoot ? [] : [].concat(_toConsumableArray(path), [getNodeKey({\n node: n,\n treeIndex: currentIndex\n })]);\n }; // If the current position is the only possible place to add, add it\n\n\n if (currentIndex >= minimumTreeIndex - 1 || isLastChild && !(node.children && node.children.length)) {\n if (typeof node.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n } else {\n var extraNodeProps = expandParent ? {\n expanded: true\n } : {};\n\n var _nextNode = _objectSpread2(_objectSpread2(_objectSpread2({}, node), extraNodeProps), {}, {\n children: node.children ? [newNode].concat(_toConsumableArray(node.children)) : [newNode]\n });\n\n return {\n node: _nextNode,\n nextIndex: currentIndex + 2,\n insertedTreeIndex: currentIndex + 1,\n parentPath: selfPath(_nextNode),\n parentNode: isPseudoRoot ? null : _nextNode\n };\n }\n } // If this is the target depth for the insertion,\n // i.e., where the newNode can be added to the current node's children\n\n\n if (currentDepth >= targetDepth - 1) {\n // Skip over nodes with no children or hidden children\n if (!node.children || typeof node.children === 'function' || node.expanded !== true && ignoreCollapsed && !isPseudoRoot) {\n return {\n node: node,\n nextIndex: currentIndex + 1\n };\n } // Scan over the children to see if there's a place among them that fulfills\n // the minimumTreeIndex requirement\n\n\n var _childIndex = currentIndex + 1;\n\n var _insertedTreeIndex = null;\n var insertIndex = null;\n\n for (var i = 0; i < node.children.length; i += 1) {\n // If a valid location is found, mark it as the insertion location and\n // break out of the loop\n if (_childIndex >= minimumTreeIndex) {\n _insertedTreeIndex = _childIndex;\n insertIndex = i;\n break;\n } // Increment the index by the child itself plus the number of descendants it has\n\n\n _childIndex += 1 + getDescendantCount({\n node: node.children[i],\n ignoreCollapsed: ignoreCollapsed\n });\n } // If no valid indices to add the node were found\n\n\n if (insertIndex === null) {\n // If the last position in this node's children is less than the minimum index\n // and there are more children on the level of this node, return without insertion\n if (_childIndex < minimumTreeIndex && !isLastChild) {\n return {\n node: node,\n nextIndex: _childIndex\n };\n } // Use the last position in the children array to insert the newNode\n\n\n _insertedTreeIndex = _childIndex;\n insertIndex = node.children.length;\n } // Insert the newNode at the insertIndex\n\n\n var _nextNode2 = _objectSpread2(_objectSpread2({}, node), {}, {\n children: [].concat(_toConsumableArray(node.children.slice(0, insertIndex)), [newNode], _toConsumableArray(node.children.slice(insertIndex)))\n }); // Return node with successful insert result\n\n\n return {\n node: _nextNode2,\n nextIndex: _childIndex,\n insertedTreeIndex: _insertedTreeIndex,\n parentPath: selfPath(_nextNode2),\n parentNode: isPseudoRoot ? null : _nextNode2\n };\n } // Skip over nodes with no children or hidden children\n\n\n if (!node.children || typeof node.children === 'function' || node.expanded !== true && ignoreCollapsed && !isPseudoRoot) {\n return {\n node: node,\n nextIndex: currentIndex + 1\n };\n } // Get all descendants\n\n\n var insertedTreeIndex = null;\n var pathFragment = null;\n var parentNode = null;\n var childIndex = currentIndex + 1;\n var newChildren = node.children;\n\n if (typeof newChildren !== 'function') {\n newChildren = newChildren.map(function (child, i) {\n if (insertedTreeIndex !== null) {\n return child;\n }\n\n var mapResult = addNodeAtDepthAndIndex({\n targetDepth: targetDepth,\n minimumTreeIndex: minimumTreeIndex,\n newNode: newNode,\n ignoreCollapsed: ignoreCollapsed,\n expandParent: expandParent,\n isLastChild: isLastChild && i === newChildren.length - 1,\n node: child,\n currentIndex: childIndex,\n currentDepth: currentDepth + 1,\n getNodeKey: getNodeKey,\n path: [] // Cannot determine the parent path until the children have been processed\n\n });\n\n if ('insertedTreeIndex' in mapResult) {\n insertedTreeIndex = mapResult.insertedTreeIndex;\n parentNode = mapResult.parentNode;\n pathFragment = mapResult.parentPath;\n }\n\n childIndex = mapResult.nextIndex;\n return mapResult.node;\n });\n }\n\n var nextNode = _objectSpread2(_objectSpread2({}, node), {}, {\n children: newChildren\n });\n\n var result = {\n node: nextNode,\n nextIndex: childIndex\n };\n\n if (insertedTreeIndex !== null) {\n result.insertedTreeIndex = insertedTreeIndex;\n result.parentPath = [].concat(_toConsumableArray(selfPath(nextNode)), _toConsumableArray(pathFragment));\n result.parentNode = parentNode;\n }\n\n return result;\n}\n/**\n * Insert a node into the tree at the given depth, after the minimum index\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} depth - The depth to insert the node at (the first level of the array being depth 0)\n * @param {!number} minimumTreeIndex - The lowest possible treeIndex to insert the node at\n * @param {!Object} newNode - The node to insert into the tree\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parent of the inserted node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node added\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n * @return {number[]|string[]} result.path - Array of keys leading to the node location after insertion\n * @return {Object} result.parentNode - The parent node of the inserted node\n */\n\n\nfunction insertNode(_ref22) {\n var treeData = _ref22.treeData,\n targetDepth = _ref22.depth,\n minimumTreeIndex = _ref22.minimumTreeIndex,\n newNode = _ref22.newNode,\n _ref22$getNodeKey = _ref22.getNodeKey,\n getNodeKey = _ref22$getNodeKey === void 0 ? function () {} : _ref22$getNodeKey,\n _ref22$ignoreCollapse = _ref22.ignoreCollapsed,\n ignoreCollapsed = _ref22$ignoreCollapse === void 0 ? true : _ref22$ignoreCollapse,\n _ref22$expandParent = _ref22.expandParent,\n expandParent = _ref22$expandParent === void 0 ? false : _ref22$expandParent;\n\n if (!treeData && targetDepth === 0) {\n return {\n treeData: [newNode],\n treeIndex: 0,\n path: [getNodeKey({\n node: newNode,\n treeIndex: 0\n })],\n parentNode: null\n };\n }\n\n var insertResult = addNodeAtDepthAndIndex({\n targetDepth: targetDepth,\n minimumTreeIndex: minimumTreeIndex,\n newNode: newNode,\n ignoreCollapsed: ignoreCollapsed,\n expandParent: expandParent,\n getNodeKey: getNodeKey,\n isPseudoRoot: true,\n isLastChild: true,\n node: {\n children: treeData\n },\n currentIndex: -1,\n currentDepth: -1\n });\n\n if (!('insertedTreeIndex' in insertResult)) {\n throw new Error('No suitable position found to insert.');\n }\n\n var treeIndex = insertResult.insertedTreeIndex;\n return {\n treeData: insertResult.node.children,\n treeIndex: treeIndex,\n path: [].concat(_toConsumableArray(insertResult.parentPath), [getNodeKey({\n node: newNode,\n treeIndex: treeIndex\n })]),\n parentNode: insertResult.parentNode\n };\n}\n/**\n * Get tree data flattened.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }}[] nodes - The node array\n */\n\n\nfunction getFlatDataFromTree(_ref23) {\n var treeData = _ref23.treeData,\n getNodeKey = _ref23.getNodeKey,\n _ref23$ignoreCollapse = _ref23.ignoreCollapsed,\n ignoreCollapsed = _ref23$ignoreCollapse === void 0 ? true : _ref23$ignoreCollapse;\n\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n var flattened = [];\n walk({\n treeData: treeData,\n getNodeKey: getNodeKey,\n ignoreCollapsed: ignoreCollapsed,\n callback: function callback(nodeInfo) {\n flattened.push(nodeInfo);\n }\n });\n return flattened;\n}\n/**\n * Generate a tree structure from flat data.\n *\n * @param {!Object[]} flatData\n * @param {!function=} getKey - Function to get the key from the nodeData\n * @param {!function=} getParentKey - Function to get the parent key from the nodeData\n * @param {string|number=} rootKey - The value returned by `getParentKey` that corresponds to the root node.\n * For example, if your nodes have id 1-99, you might use rootKey = 0\n *\n * @return {Object[]} treeData - The flat data represented as a tree\n */\n\n\nfunction getTreeFromFlatData(_ref24) {\n var flatData = _ref24.flatData,\n _ref24$getKey = _ref24.getKey,\n getKey = _ref24$getKey === void 0 ? function (node) {\n return node.id;\n } : _ref24$getKey,\n _ref24$getParentKey = _ref24.getParentKey,\n getParentKey = _ref24$getParentKey === void 0 ? function (node) {\n return node.parentId;\n } : _ref24$getParentKey,\n _ref24$rootKey = _ref24.rootKey,\n rootKey = _ref24$rootKey === void 0 ? '0' : _ref24$rootKey;\n\n if (!flatData) {\n return [];\n }\n\n var childrenToParents = {};\n flatData.forEach(function (child) {\n var parentKey = getParentKey(child);\n\n if (parentKey in childrenToParents) {\n childrenToParents[parentKey].push(child);\n } else {\n childrenToParents[parentKey] = [child];\n }\n });\n\n if (!(rootKey in childrenToParents)) {\n return [];\n }\n\n var trav = function trav(parent) {\n var parentKey = getKey(parent);\n\n if (parentKey in childrenToParents) {\n return _objectSpread2(_objectSpread2({}, parent), {}, {\n children: childrenToParents[parentKey].map(function (child) {\n return trav(child);\n })\n });\n }\n\n return _objectSpread2({}, parent);\n };\n\n return childrenToParents[rootKey].map(function (child) {\n return trav(child);\n });\n}\n/**\n * Check if a node is a descendant of another node.\n *\n * @param {!Object} older - Potential ancestor of younger node\n * @param {!Object} younger - Potential descendant of older node\n *\n * @return {boolean}\n */\n\n\nfunction isDescendant(older, younger) {\n return !!older.children && typeof older.children !== 'function' && older.children.some(function (child) {\n return child === younger || isDescendant(child, younger);\n });\n}\n/**\n * Get the maximum depth of the children (the depth of the root node is 0).\n *\n * @param {!Object} node - Node in the tree\n * @param {?number} depth - The current depth\n *\n * @return {number} maxDepth - The deepest depth in the tree\n */\n\n\nfunction getDepth(node) {\n var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!node.children) {\n return depth;\n }\n\n if (typeof node.children === 'function') {\n return depth + 1;\n }\n\n return node.children.reduce(function (deepest, child) {\n return Math.max(deepest, getDepth(child, depth + 1));\n }, depth);\n}\n/**\n * Find nodes matching a search query in the tree,\n *\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {!Object[]} treeData - Tree data\n * @param {?string|number} searchQuery - Function returning a boolean to indicate whether the node is a match or not\n * @param {!function} searchMethod - Function returning a boolean to indicate whether the node is a match or not\n * @param {?number} searchFocusOffset - The offset of the match to focus on\n * (e.g., 0 focuses on the first match, 1 on the second)\n * @param {boolean=} expandAllMatchPaths - If true, expands the paths to any matched node\n * @param {boolean=} expandFocusMatchPaths - If true, expands the path to the focused node\n *\n * @return {Object[]} matches - An array of objects containing the matching `node`s, their `path`s and `treeIndex`s\n * @return {Object[]} treeData - The original tree data with all relevant nodes expanded.\n * If expandAllMatchPaths and expandFocusMatchPaths are both false,\n * it will be the same as the original tree data.\n */\n\n\nfunction find(_ref25) {\n var getNodeKey = _ref25.getNodeKey,\n treeData = _ref25.treeData,\n searchQuery = _ref25.searchQuery,\n searchMethod = _ref25.searchMethod,\n searchFocusOffset = _ref25.searchFocusOffset,\n _ref25$expandAllMatch = _ref25.expandAllMatchPaths,\n expandAllMatchPaths = _ref25$expandAllMatch === void 0 ? false : _ref25$expandAllMatch,\n _ref25$expandFocusMat = _ref25.expandFocusMatchPaths,\n expandFocusMatchPaths = _ref25$expandFocusMat === void 0 ? true : _ref25$expandFocusMat;\n var matchCount = 0;\n\n var trav = function trav(_ref26) {\n var _ref26$isPseudoRoot = _ref26.isPseudoRoot,\n isPseudoRoot = _ref26$isPseudoRoot === void 0 ? false : _ref26$isPseudoRoot,\n node = _ref26.node,\n currentIndex = _ref26.currentIndex,\n _ref26$path = _ref26.path,\n path = _ref26$path === void 0 ? [] : _ref26$path;\n var matches = [];\n var isSelfMatch = false;\n var hasFocusMatch = false; // The pseudo-root is not considered in the path\n\n var selfPath = isPseudoRoot ? [] : [].concat(_toConsumableArray(path), [getNodeKey({\n node: node,\n treeIndex: currentIndex\n })]);\n var extraInfo = isPseudoRoot ? null : {\n path: selfPath,\n treeIndex: currentIndex\n }; // Nodes with with children that aren't lazy\n\n var hasChildren = node.children && typeof node.children !== 'function' && node.children.length > 0; // Examine the current node to see if it is a match\n\n if (!isPseudoRoot && searchMethod(_objectSpread2(_objectSpread2({}, extraInfo), {}, {\n node: node,\n searchQuery: searchQuery\n }))) {\n if (matchCount === searchFocusOffset) {\n hasFocusMatch = true;\n } // Keep track of the number of matching nodes, so we know when the searchFocusOffset\n // is reached\n\n\n matchCount += 1; // We cannot add this node to the matches right away, as it may be changed\n // during the search of the descendants. The entire node is used in\n // comparisons between nodes inside the `matches` and `treeData` results\n // of this method (`find`)\n\n isSelfMatch = true;\n }\n\n var childIndex = currentIndex;\n\n var newNode = _objectSpread2({}, node);\n\n if (hasChildren) {\n // Get all descendants\n newNode.children = newNode.children.map(function (child) {\n var mapResult = trav({\n node: child,\n currentIndex: childIndex + 1,\n path: selfPath\n }); // Ignore hidden nodes by only advancing the index counter to the returned treeIndex\n // if the child is expanded.\n //\n // The child could have been expanded from the start,\n // or expanded due to a matching node being found in its descendants\n\n if (mapResult.node.expanded) {\n childIndex = mapResult.treeIndex;\n } else {\n childIndex += 1;\n }\n\n if (mapResult.matches.length > 0 || mapResult.hasFocusMatch) {\n matches = [].concat(_toConsumableArray(matches), _toConsumableArray(mapResult.matches));\n\n if (mapResult.hasFocusMatch) {\n hasFocusMatch = true;\n } // Expand the current node if it has descendants matching the search\n // and the settings are set to do so.\n\n\n if (expandAllMatchPaths && mapResult.matches.length > 0 || (expandAllMatchPaths || expandFocusMatchPaths) && mapResult.hasFocusMatch) {\n newNode.expanded = true;\n }\n }\n\n return mapResult.node;\n });\n } // Cannot assign a treeIndex to hidden nodes\n\n\n if (!isPseudoRoot && !newNode.expanded) {\n matches = matches.map(function (match) {\n return _objectSpread2(_objectSpread2({}, match), {}, {\n treeIndex: null\n });\n });\n } // Add this node to the matches if it fits the search criteria.\n // This is performed at the last minute so newNode can be sent in its final form.\n\n\n if (isSelfMatch) {\n matches = [_objectSpread2(_objectSpread2({}, extraInfo), {}, {\n node: newNode\n })].concat(_toConsumableArray(matches));\n }\n\n return {\n node: matches.length > 0 ? newNode : node,\n matches: matches,\n hasFocusMatch: hasFocusMatch,\n treeIndex: childIndex\n };\n };\n\n var result = trav({\n node: {\n children: treeData\n },\n isPseudoRoot: true,\n currentIndex: -1\n });\n return {\n matches: result.matches,\n treeData: result.node.children\n };\n} // very simple className utility for creating a classname string...\n// Falsy arguments are ignored:\n//\n// const active = true\n// const className = classnames(\n// \"class1\",\n// !active && \"class2\",\n// active && \"class3\"\n// ); // returns -> class1 class3\";\n//\n\n\nfunction classnames() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n // Use Boolean constructor as a filter callback\n // Allows for loose type truthy/falsey checks\n // Boolean(\"\") === false;\n // Boolean(false) === false;\n // Boolean(undefined) === false;\n // Boolean(null) === false;\n // Boolean(0) === false;\n // Boolean(\"classname\") === true;\n return classes.filter(Boolean).join(' ');\n}\n\nvar NodeRendererDefault = /*#__PURE__*/function (_Component2) {\n _inherits2(NodeRendererDefault, _Component2);\n\n var _super2 = _createSuper2(NodeRendererDefault);\n\n function NodeRendererDefault() {\n _classCallCheck2(this, NodeRendererDefault);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass2(NodeRendererDefault, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n scaffoldBlockPxWidth = _this$props.scaffoldBlockPxWidth,\n toggleChildrenVisibility = _this$props.toggleChildrenVisibility,\n connectDragPreview = _this$props.connectDragPreview,\n connectDragSource = _this$props.connectDragSource,\n isDragging = _this$props.isDragging,\n canDrop = _this$props.canDrop,\n canDrag = _this$props.canDrag,\n node = _this$props.node,\n title = _this$props.title,\n subtitle = _this$props.subtitle,\n draggedNode = _this$props.draggedNode,\n path = _this$props.path,\n treeIndex = _this$props.treeIndex,\n isSearchMatch = _this$props.isSearchMatch,\n isSearchFocus = _this$props.isSearchFocus,\n buttons = _this$props.buttons,\n className = _this$props.className,\n style = _this$props.style,\n didDrop = _this$props.didDrop,\n treeId = _this$props.treeId,\n isOver = _this$props.isOver,\n parentNode = _this$props.parentNode,\n rowDirection = _this$props.rowDirection,\n otherProps = _objectWithoutProperties(_this$props, _excluded);\n\n var nodeTitle = title || node.title;\n var nodeSubtitle = subtitle || node.subtitle;\n var rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n var handle;\n\n if (canDrag) {\n if (typeof node.children === 'function' && node.expanded) {\n // Show a loading symbol on the handle when the children are expanded\n // and yet still defined by a function (a callback to fetch the children)\n handle = /*#__PURE__*/React.createElement(\"div\", {\n className: \"rst__loadingHandle\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rst__loadingCircle\"\n }, _toConsumableArray2(new Array(12)).map(function (_, index) {\n return /*#__PURE__*/React.createElement(\"div\", {\n // eslint-disable-next-line react/no-array-index-key\n key: index,\n className: classnames('rst__loadingCirclePoint', rowDirectionClass)\n });\n })));\n } else {\n // Show the handle used to initiate a drag-and-drop\n handle = connectDragSource( /*#__PURE__*/React.createElement(\"div\", {\n className: \"rst__moveHandle\"\n }), {\n dropEffect: 'copy'\n });\n }\n }\n\n var isDraggedDescendant = draggedNode && isDescendant(draggedNode, node);\n var isLandingPadActive = !didDrop && isDragging;\n var buttonStyle = {\n left: -0.5 * scaffoldBlockPxWidth\n };\n\n if (rowDirection === 'rtl') {\n buttonStyle = {\n right: -0.5 * scaffoldBlockPxWidth\n };\n }\n\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n style: {\n height: '100%'\n }\n }, otherProps), toggleChildrenVisibility && node.children && (node.children.length > 0 || typeof node.children === 'function') && /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": node.expanded ? 'Collapse' : 'Expand',\n className: classnames(node.expanded ? 'rst__collapseButton' : 'rst__expandButton', rowDirectionClass),\n style: buttonStyle,\n onClick: function onClick() {\n return toggleChildrenVisibility({\n node: node,\n path: path,\n treeIndex: treeIndex\n });\n }\n }), node.expanded && !isDragging && /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: scaffoldBlockPxWidth\n },\n className: classnames('rst__lineChildren', rowDirectionClass)\n })), /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__rowWrapper', rowDirectionClass)\n }, connectDragPreview( /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__row', isLandingPadActive && 'rst__rowLandingPad', isLandingPadActive && !canDrop && 'rst__rowCancelPad', isSearchMatch && 'rst__rowSearchMatch', isSearchFocus && 'rst__rowSearchFocus', rowDirectionClass, className),\n style: _objectSpread({\n opacity: isDraggedDescendant ? 0.5 : 1\n }, style)\n }, handle, /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__rowContents', !canDrag && 'rst__rowContentsDragDisabled', rowDirectionClass)\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__rowLabel', rowDirectionClass)\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: classnames('rst__rowTitle', node.subtitle && 'rst__rowTitleWithSubtitle')\n }, typeof nodeTitle === 'function' ? nodeTitle({\n node: node,\n path: path,\n treeIndex: treeIndex\n }) : nodeTitle), nodeSubtitle && /*#__PURE__*/React.createElement(\"span\", {\n className: \"rst__rowSubtitle\"\n }, typeof nodeSubtitle === 'function' ? nodeSubtitle({\n node: node,\n path: path,\n treeIndex: treeIndex\n }) : nodeSubtitle)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"rst__rowToolbar\"\n }, buttons.map(function (btn, index) {\n return /*#__PURE__*/React.createElement(\"div\", {\n key: index // eslint-disable-line react/no-array-index-key\n ,\n className: \"rst__toolbarButton\"\n }, btn);\n })))))));\n }\n }]);\n\n return NodeRendererDefault;\n}(Component);\n\nNodeRendererDefault.defaultProps = {\n isSearchMatch: false,\n isSearchFocus: false,\n canDrag: false,\n toggleChildrenVisibility: null,\n buttons: [],\n className: '',\n style: {},\n parentNode: null,\n draggedNode: null,\n canDrop: false,\n title: null,\n subtitle: null,\n rowDirection: 'ltr'\n};\n\nvar PlaceholderRendererDefault = function PlaceholderRendererDefault(_ref27) {\n var isOver = _ref27.isOver,\n canDrop = _ref27.canDrop;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__placeholder', canDrop && 'rst__placeholderLandingPad', canDrop && !isOver && 'rst__placeholderCancelPad')\n });\n};\n\nPlaceholderRendererDefault.defaultProps = {\n isOver: false,\n canDrop: false\n};\n\nvar TreeNode = /*#__PURE__*/function (_Component3) {\n _inherits2(TreeNode, _Component3);\n\n var _super3 = _createSuper2(TreeNode);\n\n function TreeNode() {\n _classCallCheck2(this, TreeNode);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass2(TreeNode, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n listIndex = _this$props2.listIndex,\n swapFrom = _this$props2.swapFrom,\n swapLength = _this$props2.swapLength,\n swapDepth = _this$props2.swapDepth,\n scaffoldBlockPxWidth = _this$props2.scaffoldBlockPxWidth,\n lowerSiblingCounts = _this$props2.lowerSiblingCounts,\n connectDropTarget = _this$props2.connectDropTarget,\n isOver = _this$props2.isOver,\n draggedNode = _this$props2.draggedNode,\n canDrop = _this$props2.canDrop,\n treeIndex = _this$props2.treeIndex,\n treeId = _this$props2.treeId,\n getPrevRow = _this$props2.getPrevRow,\n node = _this$props2.node,\n path = _this$props2.path,\n rowDirection = _this$props2.rowDirection,\n otherProps = _objectWithoutProperties(_this$props2, _excluded2);\n\n var rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null; // Construct the scaffold representing the structure of the tree\n\n var scaffoldBlockCount = lowerSiblingCounts.length;\n var scaffold = [];\n lowerSiblingCounts.forEach(function (lowerSiblingCount, i) {\n var lineClass = '';\n\n if (lowerSiblingCount > 0) {\n // At this level in the tree, the nodes had sibling nodes further down\n if (listIndex === 0) {\n // Top-left corner of the tree\n // +-----+\n // | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom';\n } else if (i === scaffoldBlockCount - 1) {\n // Last scaffold block in the row, right before the row content\n // +--+--+\n // | | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineFullVertical';\n } else {\n // Simply connecting the line extending down to the next sibling on this level\n // +--+--+\n // | | |\n // | | |\n // | | |\n // +--+--+\n lineClass = 'rst__lineFullVertical';\n }\n } else if (listIndex === 0) {\n // Top-left corner of the tree, but has no siblings\n // +-----+\n // | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfHorizontalRight';\n } else if (i === scaffoldBlockCount - 1) {\n // The last or only node in this level of the tree\n // +--+--+\n // | | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfVerticalTop rst__lineHalfHorizontalRight';\n }\n\n scaffold.push( /*#__PURE__*/React.createElement(\"div\", {\n key: \"pre_\".concat(1 + i),\n style: {\n width: scaffoldBlockPxWidth\n },\n className: classnames('rst__lineBlock', lineClass, rowDirectionClass)\n }));\n\n if (treeIndex !== listIndex && i === swapDepth) {\n // This row has been shifted, and is at the depth of\n // the line pointing to the new destination\n var highlightLineClass = '';\n\n if (listIndex === swapFrom + swapLength - 1) {\n // This block is on the bottom (target) line\n // This block points at the target block (where the row will go when released)\n highlightLineClass = 'rst__highlightBottomLeftCorner';\n } else if (treeIndex === swapFrom) {\n // This block is on the top (source) line\n highlightLineClass = 'rst__highlightTopLeftCorner';\n } else {\n // This block is between the bottom and top\n highlightLineClass = 'rst__highlightLineVertical';\n }\n\n var _style;\n\n if (rowDirection === 'rtl') {\n _style = {\n width: scaffoldBlockPxWidth,\n right: scaffoldBlockPxWidth * i\n };\n } else {\n // Default ltr\n _style = {\n width: scaffoldBlockPxWidth,\n left: scaffoldBlockPxWidth * i\n };\n }\n\n scaffold.push( /*#__PURE__*/React.createElement(\"div\", {\n // eslint-disable-next-line react/no-array-index-key\n key: i,\n style: _style,\n className: classnames('rst__absoluteLineBlock', highlightLineClass, rowDirectionClass)\n }));\n }\n });\n var style;\n\n if (rowDirection === 'rtl') {\n style = {\n right: scaffoldBlockPxWidth * scaffoldBlockCount\n };\n } else {\n // Default ltr\n style = {\n left: scaffoldBlockPxWidth * scaffoldBlockCount\n };\n }\n\n return connectDropTarget( /*#__PURE__*/React.createElement(\"div\", _extends({}, otherProps, {\n className: classnames('rst__node', rowDirectionClass)\n }), scaffold, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rst__nodeContent\",\n style: style\n }, Children.map(children, function (child) {\n return /*#__PURE__*/cloneElement(child, {\n isOver: isOver,\n canDrop: canDrop,\n draggedNode: draggedNode\n });\n }))));\n }\n }]);\n\n return TreeNode;\n}(Component);\n\nTreeNode.defaultProps = {\n swapFrom: null,\n swapDepth: null,\n swapLength: null,\n canDrop: false,\n draggedNode: null,\n rowDirection: 'ltr'\n};\n\nvar TreePlaceholder = /*#__PURE__*/function (_Component4) {\n _inherits2(TreePlaceholder, _Component4);\n\n var _super4 = _createSuper2(TreePlaceholder);\n\n function TreePlaceholder() {\n _classCallCheck2(this, TreePlaceholder);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass2(TreePlaceholder, [{\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n children = _this$props3.children,\n connectDropTarget = _this$props3.connectDropTarget,\n treeId = _this$props3.treeId,\n drop = _this$props3.drop,\n otherProps = _objectWithoutProperties(_this$props3, _excluded3);\n\n return connectDropTarget( /*#__PURE__*/React.createElement(\"div\", null, Children.map(children, function (child) {\n return /*#__PURE__*/cloneElement(child, _objectSpread({}, otherProps));\n })));\n }\n }]);\n\n return TreePlaceholder;\n}(Component);\n\nTreePlaceholder.defaultProps = {\n canDrop: false,\n draggedNode: null\n};\n\nfunction defaultGetNodeKey(_ref) {\n var treeIndex = _ref.treeIndex;\n return treeIndex;\n} // Cheap hack to get the text of a react object\n\n\nfunction getReactElementText(parent) {\n if (typeof parent === 'string') {\n return parent;\n }\n\n if (parent === null || _typeof(parent) !== 'object' || !parent.props || !parent.props.children || typeof parent.props.children !== 'string' && _typeof(parent.props.children) !== 'object') {\n return '';\n }\n\n if (typeof parent.props.children === 'string') {\n return parent.props.children;\n }\n\n return parent.props.children.map(function (child) {\n return getReactElementText(child);\n }).join('');\n} // Search for a query string inside a node property\n\n\nfunction stringSearch(key, searchQuery, node, path, treeIndex) {\n if (typeof node[key] === 'function') {\n // Search within text after calling its function to generate the text\n return String(node[key]({\n node: node,\n path: path,\n treeIndex: treeIndex\n })).indexOf(searchQuery) > -1;\n }\n\n if (_typeof(node[key]) === 'object') {\n // Search within text inside react elements\n return getReactElementText(node[key]).indexOf(searchQuery) > -1;\n } // Search within string\n\n\n return node[key] && String(node[key]).indexOf(searchQuery) > -1;\n}\n\nfunction defaultSearchMethod(_ref2) {\n var node = _ref2.node,\n path = _ref2.path,\n treeIndex = _ref2.treeIndex,\n searchQuery = _ref2.searchQuery;\n return stringSearch('title', searchQuery, node, path, treeIndex) || stringSearch('subtitle', searchQuery, node, path, treeIndex);\n}\n\nvar memoize = function memoize(f) {\n var savedArgsArray = [];\n var savedKeysArray = [];\n var savedResult = null;\n return function (args) {\n var keysArray = Object.keys(args).sort();\n var argsArray = keysArray.map(function (key) {\n return args[key];\n }); // If the arguments for the last insert operation are different than this time,\n // recalculate the result\n\n if (argsArray.length !== savedArgsArray.length || argsArray.some(function (arg, index) {\n return arg !== savedArgsArray[index];\n }) || keysArray.some(function (key, index) {\n return key !== savedKeysArray[index];\n })) {\n savedArgsArray = argsArray;\n savedKeysArray = keysArray;\n savedResult = f(args);\n }\n\n return savedResult;\n };\n};\n\nvar memoizedInsertNode = memoize(insertNode);\nvar memoizedGetFlatDataFromTree = memoize(getFlatDataFromTree);\nvar memoizedGetDescendantCount = memoize(getDescendantCount);\n\nvar DndManager = /*#__PURE__*/function () {\n function DndManager(treeRef) {\n _classCallCheck2(this, DndManager);\n\n this.treeRef = treeRef;\n }\n\n _createClass2(DndManager, [{\n key: \"startDrag\",\n get: function get() {\n return this.treeRef.startDrag;\n }\n }, {\n key: \"dragHover\",\n get: function get() {\n return this.treeRef.dragHover;\n }\n }, {\n key: \"endDrag\",\n get: function get() {\n return this.treeRef.endDrag;\n }\n }, {\n key: \"drop\",\n get: function get() {\n return this.treeRef.drop;\n }\n }, {\n key: \"treeId\",\n get: function get() {\n return this.treeRef.treeId;\n }\n }, {\n key: \"dndType\",\n get: function get() {\n return this.treeRef.dndType;\n }\n }, {\n key: \"treeData\",\n get: function get() {\n return this.treeRef.state.draggingTreeData || this.treeRef.props.treeData;\n }\n }, {\n key: \"getNodeKey\",\n get: function get() {\n return this.treeRef.props.getNodeKey;\n }\n }, {\n key: \"customCanDrop\",\n get: function get() {\n return this.treeRef.props.canDrop;\n }\n }, {\n key: \"maxDepth\",\n get: function get() {\n return this.treeRef.props.maxDepth;\n }\n }, {\n key: \"getTargetDepth\",\n value: function getTargetDepth(dropTargetProps, monitor, component) {\n var dropTargetDepth = 0;\n var rowAbove = dropTargetProps.getPrevRow();\n\n if (rowAbove) {\n var path = rowAbove.path;\n var aboveNodeCannotHaveChildren = !this.treeRef.canNodeHaveChildren(rowAbove.node);\n\n if (aboveNodeCannotHaveChildren) {\n path = path.slice(0, path.length - 1);\n } // Limit the length of the path to the deepest possible\n\n\n dropTargetDepth = Math.min(path.length, dropTargetProps.path.length);\n }\n\n var blocksOffset;\n var dragSourceInitialDepth = (monitor.getItem().path || []).length; // When adding node from external source\n\n if (monitor.getItem().treeId !== this.treeId) {\n // Ignore the tree depth of the source, if it had any to begin with\n dragSourceInitialDepth = 0;\n\n if (component) {\n var relativePosition = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node\n\n var leftShift = monitor.getSourceClientOffset().x - relativePosition.left;\n blocksOffset = Math.round(leftShift / dropTargetProps.scaffoldBlockPxWidth);\n } else {\n blocksOffset = dropTargetProps.path.length;\n }\n } else {\n // handle row direction support\n var direction = dropTargetProps.rowDirection === 'rtl' ? -1 : 1;\n blocksOffset = Math.round(direction * monitor.getDifferenceFromInitialOffset().x / dropTargetProps.scaffoldBlockPxWidth);\n }\n\n var targetDepth = Math.min(dropTargetDepth, Math.max(0, dragSourceInitialDepth + blocksOffset - 1)); // If a maxDepth is defined, constrain the target depth\n\n if (typeof this.maxDepth !== 'undefined' && this.maxDepth !== null) {\n var draggedNode = monitor.getItem().node;\n var draggedChildDepth = getDepth(draggedNode);\n targetDepth = Math.max(0, Math.min(targetDepth, this.maxDepth - draggedChildDepth - 1));\n }\n\n return targetDepth;\n }\n }, {\n key: \"canDrop\",\n value: function canDrop(dropTargetProps, monitor) {\n if (!monitor.isOver()) {\n return false;\n }\n\n var rowAbove = dropTargetProps.getPrevRow();\n var abovePath = rowAbove ? rowAbove.path : [];\n var aboveNode = rowAbove ? rowAbove.node : {};\n var targetDepth = this.getTargetDepth(dropTargetProps, monitor, null); // Cannot drop if we're adding to the children of the row above and\n // the row above is a function\n\n if (targetDepth >= abovePath.length && typeof aboveNode.children === 'function') {\n return false;\n }\n\n if (typeof this.customCanDrop === 'function') {\n var _monitor$getItem = monitor.getItem(),\n node = _monitor$getItem.node;\n\n var addedResult = memoizedInsertNode({\n treeData: this.treeData,\n newNode: node,\n depth: targetDepth,\n getNodeKey: this.getNodeKey,\n minimumTreeIndex: dropTargetProps.listIndex,\n expandParent: true\n });\n return this.customCanDrop({\n node: node,\n prevPath: monitor.getItem().path,\n prevParent: monitor.getItem().parentNode,\n prevTreeIndex: monitor.getItem().treeIndex,\n // Equals -1 when dragged from external tree\n nextPath: addedResult.path,\n nextParent: addedResult.parentNode,\n nextTreeIndex: addedResult.treeIndex\n });\n }\n\n return true;\n }\n }, {\n key: \"wrapSource\",\n value: function wrapSource(el) {\n var _this7 = this;\n\n var nodeDragSource = {\n beginDrag: function beginDrag(props) {\n _this7.startDrag(props);\n\n return {\n node: props.node,\n parentNode: props.parentNode,\n path: props.path,\n treeIndex: props.treeIndex,\n treeId: props.treeId\n };\n },\n endDrag: function endDrag(props, monitor) {\n _this7.endDrag(monitor.getDropResult());\n },\n isDragging: function isDragging(props, monitor) {\n var dropTargetNode = monitor.getItem().node;\n var draggedNode = props.node;\n return draggedNode === dropTargetNode;\n }\n };\n\n function nodeDragSourcePropInjection(connect, monitor) {\n return {\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging(),\n didDrop: monitor.didDrop()\n };\n }\n\n return DragSource(this.dndType, nodeDragSource, nodeDragSourcePropInjection)(el);\n }\n }, {\n key: \"wrapTarget\",\n value: function wrapTarget(el) {\n var _this8 = this;\n\n var nodeDropTarget = {\n drop: function drop(dropTargetProps, monitor, component) {\n var result = {\n node: monitor.getItem().node,\n path: monitor.getItem().path,\n treeIndex: monitor.getItem().treeIndex,\n treeId: _this8.treeId,\n minimumTreeIndex: dropTargetProps.treeIndex,\n depth: _this8.getTargetDepth(dropTargetProps, monitor, component)\n };\n\n _this8.drop(result);\n\n return result;\n },\n hover: function hover(dropTargetProps, monitor, component) {\n var targetDepth = _this8.getTargetDepth(dropTargetProps, monitor, component);\n\n var draggedNode = monitor.getItem().node;\n var needsRedraw = // Redraw if hovered above different nodes\n dropTargetProps.node !== draggedNode || // Or hovered above the same node but at a different depth\n targetDepth !== dropTargetProps.path.length - 1;\n\n if (!needsRedraw) {\n return;\n } // throttle `dragHover` work to available animation frames\n\n\n cancelAnimationFrame(_this8.rafId);\n _this8.rafId = requestAnimationFrame(function () {\n var item = monitor.getItem(); // skip if drag already ended before the animation frame\n\n if (!item || !monitor.isOver()) {\n return;\n }\n\n _this8.dragHover({\n node: draggedNode,\n path: item.path,\n minimumTreeIndex: dropTargetProps.listIndex,\n depth: targetDepth\n });\n });\n },\n canDrop: this.canDrop.bind(this)\n };\n\n function nodeDropTargetPropInjection(connect, monitor) {\n var dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return DropTarget(this.dndType, nodeDropTarget, nodeDropTargetPropInjection)(el);\n }\n }, {\n key: \"wrapPlaceholder\",\n value: function wrapPlaceholder(el) {\n var _this9 = this;\n\n var placeholderDropTarget = {\n drop: function drop(dropTargetProps, monitor) {\n var _monitor$getItem2 = monitor.getItem(),\n node = _monitor$getItem2.node,\n path = _monitor$getItem2.path,\n treeIndex = _monitor$getItem2.treeIndex;\n\n var result = {\n node: node,\n path: path,\n treeIndex: treeIndex,\n treeId: _this9.treeId,\n minimumTreeIndex: 0,\n depth: 0\n };\n\n _this9.drop(result);\n\n return result;\n }\n };\n\n function placeholderPropInjection(connect, monitor) {\n var dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return DropTarget(this.dndType, placeholderDropTarget, placeholderPropInjection)(el);\n }\n }]);\n\n return DndManager;\n}();\n/* eslint-disable import/prefer-default-export */\n\n\nfunction slideRows(rows, fromIndex, toIndex) {\n var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var rowsWithoutMoved = [].concat(_toConsumableArray2(rows.slice(0, fromIndex)), _toConsumableArray2(rows.slice(fromIndex + count)));\n return [].concat(_toConsumableArray2(rowsWithoutMoved.slice(0, toIndex)), _toConsumableArray2(rows.slice(fromIndex, fromIndex + count)), _toConsumableArray2(rowsWithoutMoved.slice(toIndex)));\n}\n\nvar treeIdCounter = 1;\n\nvar mergeTheme = function mergeTheme(props) {\n var merged = _objectSpread2(_objectSpread2({}, props), {}, {\n style: _objectSpread2(_objectSpread2({}, props.theme.style), props.style),\n innerStyle: _objectSpread2(_objectSpread2({}, props.theme.innerStyle), props.innerStyle),\n reactVirtualizedListProps: _objectSpread2(_objectSpread2({}, props.theme.reactVirtualizedListProps), props.reactVirtualizedListProps)\n });\n\n var overridableDefaults = {\n nodeContentRenderer: NodeRendererDefault,\n placeholderRenderer: PlaceholderRendererDefault,\n rowHeight: 62,\n scaffoldBlockPxWidth: 44,\n slideRegionSize: 100,\n treeNodeRenderer: TreeNode\n };\n Object.keys(overridableDefaults).forEach(function (propKey) {\n // If prop has been specified, do not change it\n // If prop is specified in theme, use the theme setting\n // If all else fails, fall back to the default\n if (props[propKey] === null) {\n merged[propKey] = typeof props.theme[propKey] !== 'undefined' ? props.theme[propKey] : overridableDefaults[propKey];\n }\n });\n return merged;\n};\n\nvar ReactSortableTree = /*#__PURE__*/function (_Component) {\n _inherits(ReactSortableTree, _Component);\n\n var _super = _createSuper(ReactSortableTree);\n\n function ReactSortableTree(props) {\n var _this;\n\n _classCallCheck(this, ReactSortableTree);\n\n _this = _super.call(this, props);\n\n var _mergeTheme = mergeTheme(props),\n dndType = _mergeTheme.dndType,\n nodeContentRenderer = _mergeTheme.nodeContentRenderer,\n treeNodeRenderer = _mergeTheme.treeNodeRenderer,\n isVirtualized = _mergeTheme.isVirtualized,\n slideRegionSize = _mergeTheme.slideRegionSize;\n\n _this.dndManager = new DndManager(_assertThisInitialized(_this)); // Wrapping classes for use with react-dnd\n\n _this.treeId = \"rst__\".concat(treeIdCounter);\n treeIdCounter += 1;\n _this.dndType = dndType || _this.treeId;\n _this.nodeContentRenderer = _this.dndManager.wrapSource(nodeContentRenderer);\n _this.treePlaceholderRenderer = _this.dndManager.wrapPlaceholder(TreePlaceholder);\n _this.treeNodeRenderer = _this.dndManager.wrapTarget(treeNodeRenderer); // Prepare scroll-on-drag options for this list\n\n if (isVirtualized) {\n _this.scrollZoneVirtualList = (createScrollingComponent || withScrolling)(List);\n _this.vStrength = createVerticalStrength(slideRegionSize);\n _this.hStrength = createHorizontalStrength(slideRegionSize);\n }\n\n _this.state = {\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n searchMatches: [],\n searchFocusTreeIndex: null,\n dragging: false,\n // props that need to be used in gDSFP or static functions will be stored here\n instanceProps: {\n treeData: [],\n ignoreOneTreeUpdate: false,\n searchQuery: null,\n searchFocusOffset: null\n }\n };\n _this.toggleChildrenVisibility = _this.toggleChildrenVisibility.bind(_assertThisInitialized(_this));\n _this.moveNode = _this.moveNode.bind(_assertThisInitialized(_this));\n _this.startDrag = _this.startDrag.bind(_assertThisInitialized(_this));\n _this.dragHover = _this.dragHover.bind(_assertThisInitialized(_this));\n _this.endDrag = _this.endDrag.bind(_assertThisInitialized(_this));\n _this.drop = _this.drop.bind(_assertThisInitialized(_this));\n _this.handleDndMonitorChange = _this.handleDndMonitorChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ReactSortableTree, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n ReactSortableTree.loadLazyChildren(this.props, this.state);\n var stateUpdate = ReactSortableTree.search(this.props, this.state, true, true, false);\n this.setState(stateUpdate); // Hook into react-dnd state changes to detect when the drag ends\n // TODO: This is very brittle, so it needs to be replaced if react-dnd\n // offers a more official way to detect when a drag ends\n\n this.clearMonitorSubscription = this.props.dragDropManager.getMonitor().subscribeToStateChange(this.handleDndMonitorChange);\n }\n }, {\n key: \"componentDidUpdate\",\n value: // listen to dragging\n function componentDidUpdate(prevProps, prevState) {\n // if it is not the same then call the onDragStateChanged\n if (this.state.dragging !== prevState.dragging) {\n if (this.props.onDragStateChanged) {\n this.props.onDragStateChanged({\n isDragging: this.state.dragging,\n draggedNode: this.state.draggedNode\n });\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearMonitorSubscription();\n }\n }, {\n key: \"getRows\",\n value: function getRows(treeData) {\n return memoizedGetFlatDataFromTree({\n ignoreCollapsed: true,\n getNodeKey: this.props.getNodeKey,\n treeData: treeData\n });\n }\n }, {\n key: \"handleDndMonitorChange\",\n value: function handleDndMonitorChange() {\n var _this2 = this;\n\n var monitor = this.props.dragDropManager.getMonitor(); // If the drag ends and the tree is still in a mid-drag state,\n // it means that the drag was canceled or the dragSource dropped\n // elsewhere, and we should reset the state of this tree\n\n if (!monitor.isDragging() && this.state.draggingTreeData) {\n setTimeout(function () {\n _this2.endDrag();\n });\n }\n }\n }, {\n key: \"toggleChildrenVisibility\",\n value: function toggleChildrenVisibility(_ref) {\n var targetNode = _ref.node,\n path = _ref.path;\n var instanceProps = this.state.instanceProps;\n var treeData = changeNodeAtPath({\n treeData: instanceProps.treeData,\n path: path,\n newNode: function newNode(_ref2) {\n var node = _ref2.node;\n return _objectSpread2(_objectSpread2({}, node), {}, {\n expanded: !node.expanded\n });\n },\n getNodeKey: this.props.getNodeKey\n });\n this.props.onChange(treeData);\n this.props.onVisibilityToggle({\n treeData: treeData,\n node: targetNode,\n expanded: !targetNode.expanded,\n path: path\n });\n }\n }, {\n key: \"moveNode\",\n value: function moveNode(_ref3) {\n var node = _ref3.node,\n prevPath = _ref3.path,\n prevTreeIndex = _ref3.treeIndex,\n depth = _ref3.depth,\n minimumTreeIndex = _ref3.minimumTreeIndex;\n\n var _insertNode = insertNode({\n treeData: this.state.draggingTreeData,\n newNode: node,\n depth: depth,\n minimumTreeIndex: minimumTreeIndex,\n expandParent: true,\n getNodeKey: this.props.getNodeKey\n }),\n treeData = _insertNode.treeData,\n treeIndex = _insertNode.treeIndex,\n path = _insertNode.path,\n nextParentNode = _insertNode.parentNode;\n\n this.props.onChange(treeData);\n this.props.onMoveNode({\n treeData: treeData,\n node: node,\n treeIndex: treeIndex,\n path: path,\n nextPath: path,\n nextTreeIndex: treeIndex,\n prevPath: prevPath,\n prevTreeIndex: prevTreeIndex,\n nextParentNode: nextParentNode\n });\n } // returns the new state after search\n\n }, {\n key: \"startDrag\",\n value: function startDrag(_ref4) {\n var _this3 = this;\n\n var path = _ref4.path;\n this.setState(function (prevState) {\n var _removeNode = removeNode({\n treeData: prevState.instanceProps.treeData,\n path: path,\n getNodeKey: _this3.props.getNodeKey\n }),\n draggingTreeData = _removeNode.treeData,\n draggedNode = _removeNode.node,\n draggedMinimumTreeIndex = _removeNode.treeIndex;\n\n return {\n draggingTreeData: draggingTreeData,\n draggedNode: draggedNode,\n draggedDepth: path.length - 1,\n draggedMinimumTreeIndex: draggedMinimumTreeIndex,\n dragging: true\n };\n });\n }\n }, {\n key: \"dragHover\",\n value: function dragHover(_ref5) {\n var _this4 = this;\n\n var draggedNode = _ref5.node,\n draggedDepth = _ref5.depth,\n draggedMinimumTreeIndex = _ref5.minimumTreeIndex; // Ignore this hover if it is at the same position as the last hover\n\n if (this.state.draggedDepth === draggedDepth && this.state.draggedMinimumTreeIndex === draggedMinimumTreeIndex) {\n return;\n }\n\n this.setState(function (_ref6) {\n var draggingTreeData = _ref6.draggingTreeData,\n instanceProps = _ref6.instanceProps; // Fall back to the tree data if something is being dragged in from\n // an external element\n\n var newDraggingTreeData = draggingTreeData || instanceProps.treeData;\n var addedResult = memoizedInsertNode({\n treeData: newDraggingTreeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey: _this4.props.getNodeKey\n });\n\n var rows = _this4.getRows(addedResult.treeData);\n\n var expandedParentPath = rows[addedResult.treeIndex].path;\n return {\n draggedNode: draggedNode,\n draggedDepth: draggedDepth,\n draggedMinimumTreeIndex: draggedMinimumTreeIndex,\n draggingTreeData: changeNodeAtPath({\n treeData: newDraggingTreeData,\n path: expandedParentPath.slice(0, -1),\n newNode: function newNode(_ref7) {\n var node = _ref7.node;\n return _objectSpread2(_objectSpread2({}, node), {}, {\n expanded: true\n });\n },\n getNodeKey: _this4.props.getNodeKey\n }),\n // reset the scroll focus so it doesn't jump back\n // to a search result while dragging\n searchFocusTreeIndex: null,\n dragging: true\n };\n });\n }\n }, {\n key: \"endDrag\",\n value: function endDrag(dropResult) {\n var _this5 = this;\n\n var instanceProps = this.state.instanceProps;\n\n var resetTree = function resetTree() {\n return _this5.setState({\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n dragging: false\n });\n }; // Drop was cancelled\n\n\n if (!dropResult) {\n resetTree();\n } else if (dropResult.treeId !== this.treeId) {\n // The node was dropped in an external drop target or tree\n var node = dropResult.node,\n path = dropResult.path,\n treeIndex = dropResult.treeIndex;\n var shouldCopy = this.props.shouldCopyOnOutsideDrop;\n\n if (typeof shouldCopy === 'function') {\n shouldCopy = shouldCopy({\n node: node,\n prevTreeIndex: treeIndex,\n prevPath: path\n });\n }\n\n var treeData = this.state.draggingTreeData || instanceProps.treeData; // If copying is enabled, a drop outside leaves behind a copy in the\n // source tree\n\n if (shouldCopy) {\n treeData = changeNodeAtPath({\n treeData: instanceProps.treeData,\n // use treeData unaltered by the drag operation\n path: path,\n newNode: function newNode(_ref8) {\n var copyNode = _ref8.node;\n return _objectSpread2({}, copyNode);\n },\n // create a shallow copy of the node\n getNodeKey: this.props.getNodeKey\n });\n }\n\n this.props.onChange(treeData);\n this.props.onMoveNode({\n treeData: treeData,\n node: node,\n treeIndex: null,\n path: null,\n nextPath: null,\n nextTreeIndex: null,\n prevPath: path,\n prevTreeIndex: treeIndex\n });\n }\n }\n }, {\n key: \"drop\",\n value: function drop(dropResult) {\n this.moveNode(dropResult);\n }\n }, {\n key: \"canNodeHaveChildren\",\n value: function canNodeHaveChildren(node) {\n var canNodeHaveChildren = this.props.canNodeHaveChildren;\n\n if (canNodeHaveChildren) {\n return canNodeHaveChildren(node);\n }\n\n return true;\n } // Load any children in the tree that are given by a function\n // calls the onChange callback on the new treeData\n\n }, {\n key: \"renderRow\",\n value: function renderRow(row, _ref9) {\n var listIndex = _ref9.listIndex,\n style = _ref9.style,\n getPrevRow = _ref9.getPrevRow,\n matchKeys = _ref9.matchKeys,\n swapFrom = _ref9.swapFrom,\n swapDepth = _ref9.swapDepth,\n swapLength = _ref9.swapLength;\n var node = row.node,\n parentNode = row.parentNode,\n path = row.path,\n lowerSiblingCounts = row.lowerSiblingCounts,\n treeIndex = row.treeIndex;\n\n var _mergeTheme2 = mergeTheme(this.props),\n canDrag = _mergeTheme2.canDrag,\n generateNodeProps = _mergeTheme2.generateNodeProps,\n scaffoldBlockPxWidth = _mergeTheme2.scaffoldBlockPxWidth,\n searchFocusOffset = _mergeTheme2.searchFocusOffset,\n rowDirection = _mergeTheme2.rowDirection;\n\n var TreeNodeRenderer = this.treeNodeRenderer;\n var NodeContentRenderer = this.nodeContentRenderer;\n var nodeKey = path[path.length - 1];\n var isSearchMatch = (nodeKey in matchKeys);\n var isSearchFocus = isSearchMatch && matchKeys[nodeKey] === searchFocusOffset;\n var callbackParams = {\n node: node,\n parentNode: parentNode,\n path: path,\n lowerSiblingCounts: lowerSiblingCounts,\n treeIndex: treeIndex,\n isSearchMatch: isSearchMatch,\n isSearchFocus: isSearchFocus\n };\n var nodeProps = !generateNodeProps ? {} : generateNodeProps(callbackParams);\n var rowCanDrag = typeof canDrag !== 'function' ? canDrag : canDrag(callbackParams);\n var sharedProps = {\n treeIndex: treeIndex,\n scaffoldBlockPxWidth: scaffoldBlockPxWidth,\n node: node,\n path: path,\n treeId: this.treeId,\n rowDirection: rowDirection\n };\n return /*#__PURE__*/React.createElement(TreeNodeRenderer, _extends({\n style: style,\n key: nodeKey,\n listIndex: listIndex,\n getPrevRow: getPrevRow,\n lowerSiblingCounts: lowerSiblingCounts,\n swapFrom: swapFrom,\n swapLength: swapLength,\n swapDepth: swapDepth\n }, sharedProps), /*#__PURE__*/React.createElement(NodeContentRenderer, _extends({\n parentNode: parentNode,\n isSearchMatch: isSearchMatch,\n isSearchFocus: isSearchFocus,\n canDrag: rowCanDrag,\n toggleChildrenVisibility: this.toggleChildrenVisibility\n }, sharedProps, nodeProps)));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this6 = this;\n\n var _mergeTheme3 = mergeTheme(this.props),\n dragDropManager = _mergeTheme3.dragDropManager,\n style = _mergeTheme3.style,\n className = _mergeTheme3.className,\n cssNonce = _mergeTheme3.cssNonce,\n innerStyle = _mergeTheme3.innerStyle,\n rowHeight = _mergeTheme3.rowHeight,\n isVirtualized = _mergeTheme3.isVirtualized,\n placeholderRenderer = _mergeTheme3.placeholderRenderer,\n reactVirtualizedListProps = _mergeTheme3.reactVirtualizedListProps,\n getNodeKey = _mergeTheme3.getNodeKey,\n rowDirection = _mergeTheme3.rowDirection;\n\n var _this$state = this.state,\n searchMatches = _this$state.searchMatches,\n searchFocusTreeIndex = _this$state.searchFocusTreeIndex,\n draggedNode = _this$state.draggedNode,\n draggedDepth = _this$state.draggedDepth,\n draggedMinimumTreeIndex = _this$state.draggedMinimumTreeIndex,\n instanceProps = _this$state.instanceProps;\n var treeData = this.state.draggingTreeData || instanceProps.treeData;\n var rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n var rows;\n var swapFrom = null;\n var swapLength = null;\n\n if (draggedNode && draggedMinimumTreeIndex !== null) {\n var addedResult = memoizedInsertNode({\n treeData: treeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey: getNodeKey\n });\n var swapTo = draggedMinimumTreeIndex;\n swapFrom = addedResult.treeIndex;\n swapLength = 1 + memoizedGetDescendantCount({\n node: draggedNode\n });\n rows = slideRows(this.getRows(addedResult.treeData), swapFrom, swapTo, swapLength);\n } else {\n rows = this.getRows(treeData);\n } // Get indices for rows that match the search conditions\n\n\n var matchKeys = {};\n searchMatches.forEach(function (_ref10, i) {\n var path = _ref10.path;\n matchKeys[path[path.length - 1]] = i;\n }); // Seek to the focused search result if there is one specified\n\n var scrollToInfo = searchFocusTreeIndex !== null ? {\n scrollToIndex: searchFocusTreeIndex\n } : {};\n var containerStyle = style;\n var list;\n\n if (rows.length < 1) {\n var Placeholder = this.treePlaceholderRenderer;\n var PlaceholderContent = placeholderRenderer;\n list = /*#__PURE__*/React.createElement(Placeholder, {\n treeId: this.treeId,\n drop: this.drop\n }, /*#__PURE__*/React.createElement(PlaceholderContent, null));\n } else if (isVirtualized) {\n containerStyle = _objectSpread2({\n height: '100%'\n }, containerStyle);\n var ScrollZoneVirtualList = this.scrollZoneVirtualList; // Render list with react-virtualized\n\n list = /*#__PURE__*/React.createElement(AutoSizer, {\n nonce: cssNonce\n }, function (_ref11) {\n var height = _ref11.height,\n width = _ref11.width;\n return /*#__PURE__*/React.createElement(ScrollZoneVirtualList, _extends({}, scrollToInfo, {\n dragDropManager: dragDropManager,\n verticalStrength: _this6.vStrength,\n horizontalStrength: _this6.hStrength,\n speed: 30,\n scrollToAlignment: \"start\",\n className: \"rst__virtualScrollOverride\",\n width: width,\n onScroll: function onScroll(_ref12) {\n var scrollTop = _ref12.scrollTop;\n _this6.scrollTop = scrollTop;\n },\n height: height,\n style: innerStyle,\n rowCount: rows.length,\n estimatedRowSize: typeof rowHeight !== 'function' ? rowHeight : undefined,\n rowHeight: typeof rowHeight !== 'function' ? rowHeight : function (_ref13) {\n var index = _ref13.index;\n return rowHeight({\n index: index,\n treeIndex: index,\n node: rows[index].node,\n path: rows[index].path\n });\n },\n rowRenderer: function rowRenderer(_ref14) {\n var index = _ref14.index,\n rowStyle = _ref14.style;\n return _this6.renderRow(rows[index], {\n listIndex: index,\n style: rowStyle,\n getPrevRow: function getPrevRow() {\n return rows[index - 1] || null;\n },\n matchKeys: matchKeys,\n swapFrom: swapFrom,\n swapDepth: draggedDepth,\n swapLength: swapLength\n });\n }\n }, reactVirtualizedListProps));\n });\n } else {\n // Render list without react-virtualized\n list = rows.map(function (row, index) {\n return _this6.renderRow(row, {\n listIndex: index,\n style: {\n height: typeof rowHeight !== 'function' ? rowHeight : rowHeight({\n index: index,\n treeIndex: index,\n node: row.node,\n path: row.path\n })\n },\n getPrevRow: function getPrevRow() {\n return rows[index - 1] || null;\n },\n matchKeys: matchKeys,\n swapFrom: swapFrom,\n swapDepth: draggedDepth,\n swapLength: swapLength\n });\n });\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classnames('rst__tree', className, rowDirectionClass),\n style: containerStyle\n }, list);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var instanceProps = prevState.instanceProps;\n var newState = {};\n var isTreeDataEqual = isEqual(instanceProps.treeData, nextProps.treeData); // make sure we have the most recent version of treeData\n\n instanceProps.treeData = nextProps.treeData;\n\n if (!isTreeDataEqual) {\n if (instanceProps.ignoreOneTreeUpdate) {\n instanceProps.ignoreOneTreeUpdate = false;\n } else {\n newState.searchFocusTreeIndex = null;\n ReactSortableTree.loadLazyChildren(nextProps, prevState);\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, false, false, false));\n }\n\n newState.draggingTreeData = null;\n newState.draggedNode = null;\n newState.draggedMinimumTreeIndex = null;\n newState.draggedDepth = null;\n newState.dragging = false;\n } else if (!isEqual(instanceProps.searchQuery, nextProps.searchQuery)) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, false));\n } else if (instanceProps.searchFocusOffset !== nextProps.searchFocusOffset) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, true));\n }\n\n instanceProps.searchQuery = nextProps.searchQuery;\n instanceProps.searchFocusOffset = nextProps.searchFocusOffset;\n newState.instanceProps = _objectSpread2(_objectSpread2({}, instanceProps), newState.instanceProps);\n return newState;\n }\n }, {\n key: \"search\",\n value: function search(props, state, seekIndex, expand, singleSearch) {\n var onChange = props.onChange,\n getNodeKey = props.getNodeKey,\n searchFinishCallback = props.searchFinishCallback,\n searchQuery = props.searchQuery,\n searchMethod = props.searchMethod,\n searchFocusOffset = props.searchFocusOffset,\n onlyExpandSearchedNodes = props.onlyExpandSearchedNodes;\n var instanceProps = state.instanceProps; // Skip search if no conditions are specified\n\n if (!searchQuery && !searchMethod) {\n if (searchFinishCallback) {\n searchFinishCallback([]);\n }\n\n return {\n searchMatches: []\n };\n }\n\n var newState = {\n instanceProps: {}\n }; // if onlyExpandSearchedNodes collapse the tree and search\n\n var _find = find({\n getNodeKey: getNodeKey,\n treeData: onlyExpandSearchedNodes ? toggleExpandedForAll({\n treeData: instanceProps.treeData,\n expanded: false\n }) : instanceProps.treeData,\n searchQuery: searchQuery,\n searchMethod: searchMethod || defaultSearchMethod,\n searchFocusOffset: searchFocusOffset,\n expandAllMatchPaths: expand && !singleSearch,\n expandFocusMatchPaths: !!expand\n }),\n expandedTreeData = _find.treeData,\n searchMatches = _find.matches; // Update the tree with data leaving all paths leading to matching nodes open\n\n\n if (expand) {\n newState.instanceProps.ignoreOneTreeUpdate = true; // Prevents infinite loop\n\n onChange(expandedTreeData);\n }\n\n if (searchFinishCallback) {\n searchFinishCallback(searchMatches);\n }\n\n var searchFocusTreeIndex = null;\n\n if (seekIndex && searchFocusOffset !== null && searchFocusOffset < searchMatches.length) {\n searchFocusTreeIndex = searchMatches[searchFocusOffset].treeIndex;\n }\n\n newState.searchMatches = searchMatches;\n newState.searchFocusTreeIndex = searchFocusTreeIndex;\n return newState;\n }\n }, {\n key: \"loadLazyChildren\",\n value: function loadLazyChildren(props, state) {\n var instanceProps = state.instanceProps;\n walk({\n treeData: instanceProps.treeData,\n getNodeKey: props.getNodeKey,\n callback: function callback(_ref15) {\n var node = _ref15.node,\n path = _ref15.path,\n lowerSiblingCounts = _ref15.lowerSiblingCounts,\n treeIndex = _ref15.treeIndex; // If the node has children defined by a function, and is either expanded\n // or set to load even before expansion, run the function.\n\n if (node.children && typeof node.children === 'function' && (node.expanded || props.loadCollapsedLazyChildren)) {\n // Call the children fetching function\n node.children({\n node: node,\n path: path,\n lowerSiblingCounts: lowerSiblingCounts,\n treeIndex: treeIndex,\n // Provide a helper to append the new data when it is received\n done: function done(childrenArray) {\n return props.onChange(changeNodeAtPath({\n treeData: instanceProps.treeData,\n path: path,\n newNode: function newNode(_ref16) {\n var oldNode = _ref16.node;\n return (// Only replace the old node if it's the one we set off to find children\n // for in the first place\n oldNode === node ? _objectSpread2(_objectSpread2({}, oldNode), {}, {\n children: childrenArray\n }) : oldNode\n );\n },\n getNodeKey: props.getNodeKey\n }));\n }\n });\n }\n }\n });\n }\n }]);\n\n return ReactSortableTree;\n}(Component);\n\nReactSortableTree.defaultProps = {\n canDrag: true,\n canDrop: null,\n canNodeHaveChildren: function canNodeHaveChildren() {\n return true;\n },\n className: '',\n cssNonce: null,\n dndType: null,\n generateNodeProps: null,\n getNodeKey: defaultGetNodeKey,\n innerStyle: {},\n isVirtualized: true,\n maxDepth: null,\n treeNodeRenderer: null,\n nodeContentRenderer: null,\n onMoveNode: function onMoveNode() {},\n onVisibilityToggle: function onVisibilityToggle() {},\n placeholderRenderer: null,\n reactVirtualizedListProps: {},\n rowHeight: null,\n scaffoldBlockPxWidth: null,\n searchFinishCallback: null,\n searchFocusOffset: null,\n searchMethod: null,\n searchQuery: null,\n shouldCopyOnOutsideDrop: false,\n slideRegionSize: null,\n style: {},\n theme: {},\n onDragStateChanged: function onDragStateChanged() {},\n onlyExpandSearchedNodes: false,\n rowDirection: 'ltr'\n};\npolyfill(ReactSortableTree);\n\nvar SortableTreeWithoutDndContext = function SortableTreeWithoutDndContext(props) {\n return /*#__PURE__*/React.createElement(DndContext.Consumer, null, function (_ref17) {\n var dragDropManager = _ref17.dragDropManager;\n return dragDropManager === undefined ? null : /*#__PURE__*/React.createElement(ReactSortableTree, _extends({}, props, {\n dragDropManager: dragDropManager\n }));\n });\n};\n\nvar SortableTree = function SortableTree(props) {\n return /*#__PURE__*/React.createElement(DndProvider, {\n backend: HTML5Backend\n }, /*#__PURE__*/React.createElement(SortableTreeWithoutDndContext, props));\n}; // Export the tree component without the react-dnd DragDropContext,\n\n\nexport default SortableTree;\nexport { SortableTreeWithoutDndContext, addNodeUnderParent, changeNodeAtPath, defaultGetNodeKey, defaultSearchMethod, find, getDepth, getDescendantCount, getFlatDataFromTree, getNodeAtPath, getTreeFromFlatData, getVisibleNodeCount, getVisibleNodeInfoAtIndex, insertNode, isDescendant, map, removeNode, removeNodeAtPath, toggleExpandedForAll, walk };","import { invariant } from '@react-dnd/invariant';\nimport { registerSource, DragSourceMonitorImpl, SourceConnector } from '../internals';\nimport { checkDecoratorArguments, isPlainObject, isValidType } from './utils';\nimport { decorateHandler } from './decorateHandler';\nimport { createSourceFactory } from './createSourceFactory';\n/**\n * Decorates a component as a dragsource\n * @param type The dragsource type\n * @param spec The drag source specification\n * @param collect The props collector function\n * @param options DnD options\n */\n\nexport function DragSource(type, spec, collect) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n checkDecoratorArguments('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n\n if (typeof type !== 'function') {\n invariant(isValidType(type), 'Expected \"type\" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', type);\n\n getType = function getType() {\n return type;\n };\n }\n\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', spec);\n var createSource = createSourceFactory(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);\n return function decorateSource(DecoratedComponent) {\n return decorateHandler({\n containerDisplayName: 'DragSource',\n createHandler: createSource,\n registerHandler: registerSource,\n createConnector: function createConnector(backend) {\n return new SourceConnector(backend);\n },\n createMonitor: function createMonitor(manager) {\n return new DragSourceMonitorImpl(manager);\n },\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options\n });\n };\n}","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar definePropertyModule = require('../internals/object-define-property');\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","/* eslint-disable no-proto -- safe */\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var global = require('../internals/global');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar TypeError = global.TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw TypeError('Incorrect invocation');\n};\n","module.exports = function (module) {\n if (!module.webpackPolyfill) {\n module.deprecate = function () {};\n\n module.paths = []; // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n return hasSymbols() && !!Symbol.toStringTag;\n};","'use strict';\n\nvar reactIs = require('react-is');\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n\n\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\n\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;","/**\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {{resolveAll?: Resolver}[]} constructs\n * @param {Event[]} events\n * @param {TokenizeContext} context\n * @returns {Event[]}\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Resolver[]} */\n var called = [];\n var index = -1;\n\n while (++index < constructs.length) {\n var resolve = constructs[index].resolveAll;\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context);\n called.push(resolve);\n }\n }\n\n return events;\n}","'use strict';\n\nvar encodeCache = {}; // Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\n\nfunction getEncodeCache(exclude) {\n var i,\n ch,\n cache = encodeCache[exclude];\n\n if (cache) {\n return cache;\n }\n\n cache = encodeCache[exclude] = [];\n\n for (i = 0; i < 128; i++) {\n ch = String.fromCharCode(i);\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch);\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));\n }\n }\n\n for (i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i];\n }\n\n return cache;\n} // Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\n\n\nfunction encode(string, exclude, keepEscaped) {\n var i,\n l,\n code,\n nextCode,\n cache,\n result = '';\n\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude;\n exclude = encode.defaultChars;\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true;\n }\n\n cache = getEncodeCache(exclude);\n\n for (i = 0, l = string.length; i < l; i++) {\n code = string.charCodeAt(i);\n\n if (keepEscaped && code === 0x25\n /* % */\n && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3);\n i += 2;\n continue;\n }\n }\n\n if (code < 128) {\n result += cache[code];\n continue;\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n nextCode = string.charCodeAt(i + 1);\n\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1]);\n i++;\n continue;\n }\n }\n\n result += '%EF%BF%BD';\n continue;\n }\n\n result += encodeURIComponent(string[i]);\n }\n\n return result;\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\";\nencode.componentChars = \"-_.!~*'()\";\nmodule.exports = encode;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"Chart\", {\n enumerable: true,\n get: function get() {\n return _chart[\"default\"];\n }\n});\nexports.defaults = exports.Scatter = exports.Bubble = exports.Polar = exports.Radar = exports.HorizontalBar = exports.Bar = exports.Line = exports.Pie = exports.Doughnut = exports[\"default\"] = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _chart = _interopRequireDefault(require(\"chart.js\"));\n\nvar _isEqual = _interopRequireDefault(require(\"lodash/isEqual\"));\n\nvar _keyBy = _interopRequireDefault(require(\"lodash/keyBy\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar NODE_ENV = typeof process !== 'undefined' && process.env && process.env.NODE_ENV;\n\nvar ChartComponent = /*#__PURE__*/function (_React$Component) {\n _inherits(ChartComponent, _React$Component);\n\n var _super = _createSuper(ChartComponent);\n\n function ChartComponent() {\n var _this;\n\n _classCallCheck(this, ChartComponent);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"handleOnClick\", function (event) {\n var instance = _this.chartInstance;\n var _this$props = _this.props,\n getDatasetAtEvent = _this$props.getDatasetAtEvent,\n getElementAtEvent = _this$props.getElementAtEvent,\n getElementsAtEvent = _this$props.getElementsAtEvent,\n onElementsClick = _this$props.onElementsClick;\n getDatasetAtEvent && getDatasetAtEvent(instance.getDatasetAtEvent(event), event);\n getElementAtEvent && getElementAtEvent(instance.getElementAtEvent(event), event);\n getElementsAtEvent && getElementsAtEvent(instance.getElementsAtEvent(event), event);\n onElementsClick && onElementsClick(instance.getElementsAtEvent(event), event); // Backward compatibility\n });\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", function (element) {\n _this.element = element;\n });\n\n _this.chartInstance = undefined;\n return _this;\n }\n\n _createClass(ChartComponent, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.renderChart();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (this.props.redraw) {\n this.destroyChart();\n this.renderChart();\n return;\n }\n\n this.updateChart();\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n var _this$props2 = this.props,\n redraw = _this$props2.redraw,\n type = _this$props2.type,\n options = _this$props2.options,\n plugins = _this$props2.plugins,\n legend = _this$props2.legend,\n height = _this$props2.height,\n width = _this$props2.width;\n\n if (nextProps.redraw === true) {\n return true;\n }\n\n if (height !== nextProps.height || width !== nextProps.width) {\n return true;\n }\n\n if (type !== nextProps.type) {\n return true;\n }\n\n if (!(0, _isEqual[\"default\"])(legend, nextProps.legend)) {\n return true;\n }\n\n if (!(0, _isEqual[\"default\"])(options, nextProps.options)) {\n return true;\n }\n\n var nextData = this.transformDataProp(nextProps);\n\n if (!(0, _isEqual[\"default\"])(this.shadowDataProp, nextData)) {\n return true;\n }\n\n return !(0, _isEqual[\"default\"])(plugins, nextProps.plugins);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.destroyChart();\n }\n }, {\n key: \"transformDataProp\",\n value: function transformDataProp(props) {\n var data = props.data;\n\n if (typeof data == 'function') {\n var node = this.element;\n return data(node);\n } else {\n return data;\n }\n } // Chart.js directly mutates the data.dataset objects by adding _meta proprerty\n // this makes impossible to compare the current and next data changes\n // therefore we memoize the data prop while sending a fake to Chart.js for mutation.\n // see https://github.com/chartjs/Chart.js/blob/master/src/core/core.controller.js#L615-L617\n\n }, {\n key: \"memoizeDataProps\",\n value: function memoizeDataProps() {\n if (!this.props.data) {\n return;\n }\n\n var data = this.transformDataProp(this.props);\n this.shadowDataProp = _objectSpread(_objectSpread({}, data), {}, {\n datasets: data.datasets && data.datasets.map(function (set) {\n return _objectSpread({}, set);\n })\n });\n this.saveCurrentDatasets(); // to remove the dataset metadata from this chart when the chart is destroyed\n\n return data;\n }\n }, {\n key: \"checkDatasets\",\n value: function checkDatasets(datasets) {\n var isDev = NODE_ENV !== 'production' && NODE_ENV !== 'prod';\n var usingCustomKeyProvider = this.props.datasetKeyProvider !== ChartComponent.getLabelAsKey;\n var multipleDatasets = datasets.length > 1;\n\n if (isDev && multipleDatasets && !usingCustomKeyProvider) {\n var shouldWarn = false;\n datasets.forEach(function (dataset) {\n if (!dataset.label) {\n shouldWarn = true;\n }\n });\n\n if (shouldWarn) {\n console.error('[react-chartjs-2] Warning: Each dataset needs a unique key. By default, the \"label\" property on each dataset is used. Alternatively, you may provide a \"datasetKeyProvider\" as a prop that returns a unique key.');\n }\n }\n }\n }, {\n key: \"getCurrentDatasets\",\n value: function getCurrentDatasets() {\n return this.chartInstance && this.chartInstance.config.data && this.chartInstance.config.data.datasets || [];\n }\n }, {\n key: \"saveCurrentDatasets\",\n value: function saveCurrentDatasets() {\n var _this2 = this;\n\n this.datasets = this.datasets || {};\n var currentDatasets = this.getCurrentDatasets();\n currentDatasets.forEach(function (d) {\n _this2.datasets[_this2.props.datasetKeyProvider(d)] = d;\n });\n }\n }, {\n key: \"updateChart\",\n value: function updateChart() {\n var _this3 = this;\n\n var options = this.props.options;\n var data = this.memoizeDataProps(this.props);\n if (!this.chartInstance) return;\n\n if (options) {\n this.chartInstance.options = _chart[\"default\"].helpers.configMerge(this.chartInstance.options, options);\n } // Pipe datasets to chart instance datasets enabling\n // seamless transitions\n\n\n var currentDatasets = this.getCurrentDatasets();\n var nextDatasets = data.datasets || [];\n this.checkDatasets(currentDatasets);\n var currentDatasetsIndexed = (0, _keyBy[\"default\"])(currentDatasets, this.props.datasetKeyProvider); // We can safely replace the dataset array, as long as we retain the _meta property\n // on each dataset.\n\n this.chartInstance.config.data.datasets = nextDatasets.map(function (next) {\n var current = currentDatasetsIndexed[_this3.props.datasetKeyProvider(next)];\n\n if (current && current.type === next.type && next.data) {\n // Be robust to no data. Relevant for other update mechanisms as in chartjs-plugin-streaming.\n // The data array must be edited in place. As chart.js adds listeners to it.\n current.data.splice(next.data.length);\n next.data.forEach(function (point, pid) {\n current.data[pid] = next.data[pid];\n });\n\n var _data = next.data,\n otherProps = _objectWithoutProperties(next, [\"data\"]); // Merge properties. Notice a weakness here. If a property is removed\n // from next, it will be retained by current and never disappears.\n // Workaround is to set value to null or undefined in next.\n\n\n return _objectSpread(_objectSpread({}, current), otherProps);\n } else {\n return next;\n }\n });\n\n var datasets = data.datasets,\n rest = _objectWithoutProperties(data, [\"datasets\"]);\n\n this.chartInstance.config.data = _objectSpread(_objectSpread({}, this.chartInstance.config.data), rest);\n this.chartInstance.update();\n }\n }, {\n key: \"renderChart\",\n value: function renderChart() {\n var _this$props3 = this.props,\n options = _this$props3.options,\n legend = _this$props3.legend,\n type = _this$props3.type,\n plugins = _this$props3.plugins;\n var node = this.element;\n var data = this.memoizeDataProps();\n\n if (typeof legend !== 'undefined' && !(0, _isEqual[\"default\"])(ChartComponent.defaultProps.legend, legend)) {\n options.legend = legend;\n }\n\n this.chartInstance = new _chart[\"default\"](node, {\n type: type,\n data: data,\n options: options,\n plugins: plugins\n });\n }\n }, {\n key: \"destroyChart\",\n value: function destroyChart() {\n if (!this.chartInstance) {\n return;\n } // Put all of the datasets that have existed in the chart back on the chart\n // so that the metadata associated with this chart get destroyed.\n // This allows the datasets to be used in another chart. This can happen,\n // for example, in a tabbed UI where the chart gets created each time the\n // tab gets switched to the chart and uses the same data).\n\n\n this.saveCurrentDatasets();\n var datasets = Object.values(this.datasets);\n this.chartInstance.config.data.datasets = datasets;\n this.chartInstance.destroy();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n height = _this$props4.height,\n width = _this$props4.width,\n id = _this$props4.id;\n return /*#__PURE__*/_react[\"default\"].createElement(\"canvas\", {\n ref: this.ref,\n height: height,\n width: width,\n id: id,\n onClick: this.handleOnClick\n });\n }\n }]);\n\n return ChartComponent;\n}(_react[\"default\"].Component);\n\n_defineProperty(ChartComponent, \"getLabelAsKey\", function (d) {\n return d.label;\n});\n\n_defineProperty(ChartComponent, \"propTypes\", {\n data: _propTypes[\"default\"].oneOfType([_propTypes[\"default\"].object, _propTypes[\"default\"].func]).isRequired,\n getDatasetAtEvent: _propTypes[\"default\"].func,\n getElementAtEvent: _propTypes[\"default\"].func,\n getElementsAtEvent: _propTypes[\"default\"].func,\n height: _propTypes[\"default\"].number,\n legend: _propTypes[\"default\"].object,\n onElementsClick: _propTypes[\"default\"].func,\n options: _propTypes[\"default\"].object,\n plugins: _propTypes[\"default\"].arrayOf(_propTypes[\"default\"].object),\n redraw: _propTypes[\"default\"].bool,\n type: function type(props, propName, componentName) {\n if (!_chart[\"default\"].controllers[props[propName]]) {\n return new Error('Invalid chart type `' + props[propName] + '` supplied to' + ' `' + componentName + '`.');\n }\n },\n width: _propTypes[\"default\"].number,\n datasetKeyProvider: _propTypes[\"default\"].func\n});\n\n_defineProperty(ChartComponent, \"defaultProps\", {\n legend: {\n display: true,\n position: 'bottom'\n },\n type: 'doughnut',\n height: 150,\n width: 300,\n redraw: false,\n options: {},\n datasetKeyProvider: ChartComponent.getLabelAsKey\n});\n\nvar _default = ChartComponent;\nexports[\"default\"] = _default;\n\nvar Doughnut = /*#__PURE__*/function (_React$Component2) {\n _inherits(Doughnut, _React$Component2);\n\n var _super2 = _createSuper(Doughnut);\n\n function Doughnut() {\n _classCallCheck(this, Doughnut);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(Doughnut, [{\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref) {\n return _this4.chartInstance = _ref && _ref.chartInstance;\n },\n type: \"doughnut\"\n }));\n }\n }]);\n\n return Doughnut;\n}(_react[\"default\"].Component);\n\nexports.Doughnut = Doughnut;\n\nvar Pie = /*#__PURE__*/function (_React$Component3) {\n _inherits(Pie, _React$Component3);\n\n var _super3 = _createSuper(Pie);\n\n function Pie() {\n _classCallCheck(this, Pie);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(Pie, [{\n key: \"render\",\n value: function render() {\n var _this5 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref2) {\n return _this5.chartInstance = _ref2 && _ref2.chartInstance;\n },\n type: \"pie\"\n }));\n }\n }]);\n\n return Pie;\n}(_react[\"default\"].Component);\n\nexports.Pie = Pie;\n\nvar Line = /*#__PURE__*/function (_React$Component4) {\n _inherits(Line, _React$Component4);\n\n var _super4 = _createSuper(Line);\n\n function Line() {\n _classCallCheck(this, Line);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass(Line, [{\n key: \"render\",\n value: function render() {\n var _this6 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref3) {\n return _this6.chartInstance = _ref3 && _ref3.chartInstance;\n },\n type: \"line\"\n }));\n }\n }]);\n\n return Line;\n}(_react[\"default\"].Component);\n\nexports.Line = Line;\n\nvar Bar = /*#__PURE__*/function (_React$Component5) {\n _inherits(Bar, _React$Component5);\n\n var _super5 = _createSuper(Bar);\n\n function Bar() {\n _classCallCheck(this, Bar);\n\n return _super5.apply(this, arguments);\n }\n\n _createClass(Bar, [{\n key: \"render\",\n value: function render() {\n var _this7 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref4) {\n return _this7.chartInstance = _ref4 && _ref4.chartInstance;\n },\n type: \"bar\"\n }));\n }\n }]);\n\n return Bar;\n}(_react[\"default\"].Component);\n\nexports.Bar = Bar;\n\nvar HorizontalBar = /*#__PURE__*/function (_React$Component6) {\n _inherits(HorizontalBar, _React$Component6);\n\n var _super6 = _createSuper(HorizontalBar);\n\n function HorizontalBar() {\n _classCallCheck(this, HorizontalBar);\n\n return _super6.apply(this, arguments);\n }\n\n _createClass(HorizontalBar, [{\n key: \"render\",\n value: function render() {\n var _this8 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref5) {\n return _this8.chartInstance = _ref5 && _ref5.chartInstance;\n },\n type: \"horizontalBar\"\n }));\n }\n }]);\n\n return HorizontalBar;\n}(_react[\"default\"].Component);\n\nexports.HorizontalBar = HorizontalBar;\n\nvar Radar = /*#__PURE__*/function (_React$Component7) {\n _inherits(Radar, _React$Component7);\n\n var _super7 = _createSuper(Radar);\n\n function Radar() {\n _classCallCheck(this, Radar);\n\n return _super7.apply(this, arguments);\n }\n\n _createClass(Radar, [{\n key: \"render\",\n value: function render() {\n var _this9 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref6) {\n return _this9.chartInstance = _ref6 && _ref6.chartInstance;\n },\n type: \"radar\"\n }));\n }\n }]);\n\n return Radar;\n}(_react[\"default\"].Component);\n\nexports.Radar = Radar;\n\nvar Polar = /*#__PURE__*/function (_React$Component8) {\n _inherits(Polar, _React$Component8);\n\n var _super8 = _createSuper(Polar);\n\n function Polar() {\n _classCallCheck(this, Polar);\n\n return _super8.apply(this, arguments);\n }\n\n _createClass(Polar, [{\n key: \"render\",\n value: function render() {\n var _this10 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref7) {\n return _this10.chartInstance = _ref7 && _ref7.chartInstance;\n },\n type: \"polarArea\"\n }));\n }\n }]);\n\n return Polar;\n}(_react[\"default\"].Component);\n\nexports.Polar = Polar;\n\nvar Bubble = /*#__PURE__*/function (_React$Component9) {\n _inherits(Bubble, _React$Component9);\n\n var _super9 = _createSuper(Bubble);\n\n function Bubble() {\n _classCallCheck(this, Bubble);\n\n return _super9.apply(this, arguments);\n }\n\n _createClass(Bubble, [{\n key: \"render\",\n value: function render() {\n var _this11 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref8) {\n return _this11.chartInstance = _ref8 && _ref8.chartInstance;\n },\n type: \"bubble\"\n }));\n }\n }]);\n\n return Bubble;\n}(_react[\"default\"].Component);\n\nexports.Bubble = Bubble;\n\nvar Scatter = /*#__PURE__*/function (_React$Component10) {\n _inherits(Scatter, _React$Component10);\n\n var _super10 = _createSuper(Scatter);\n\n function Scatter() {\n _classCallCheck(this, Scatter);\n\n return _super10.apply(this, arguments);\n }\n\n _createClass(Scatter, [{\n key: \"render\",\n value: function render() {\n var _this12 = this;\n\n return /*#__PURE__*/_react[\"default\"].createElement(ChartComponent, _extends({}, this.props, {\n ref: function ref(_ref9) {\n return _this12.chartInstance = _ref9 && _ref9.chartInstance;\n },\n type: \"scatter\"\n }));\n }\n }]);\n\n return Scatter;\n}(_react[\"default\"].Component);\n\nexports.Scatter = Scatter;\nvar defaults = _chart[\"default\"].defaults;\nexports.defaults = defaults;","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nexport var deserializerMiddleware = function deserializerMiddleware(options, deserializer) {\n return function (next, context) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(args) {\n var _yield$next, response, parsed, hint;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return next(args);\n\n case 2:\n _yield$next = _context.sent;\n response = _yield$next.response;\n _context.prev = 4;\n _context.next = 7;\n return deserializer(response, options);\n\n case 7:\n parsed = _context.sent;\n return _context.abrupt(\"return\", {\n response: response,\n output: parsed\n });\n\n case 11:\n _context.prev = 11;\n _context.t0 = _context[\"catch\"](4);\n Object.defineProperty(_context.t0, \"$response\", {\n value: response\n });\n\n if (!('$metadata' in _context.t0)) {\n hint = \"Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.\";\n _context.t0.message += \"\\n \" + hint;\n }\n\n throw _context.t0;\n\n case 16:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[4, 11]]);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nexport var serializerMiddleware = function serializerMiddleware(options, serializer) {\n return function (next, context) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(args) {\n var _context$endpointV;\n\n var endpoint, request;\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n endpoint = (_context$endpointV = context.endpointV2) !== null && _context$endpointV !== void 0 && _context$endpointV.url && options.urlParser ? /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", options.urlParser(context.endpointV2.url));\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n })) : options.endpoint;\n\n if (endpoint) {\n _context2.next = 3;\n break;\n }\n\n throw new Error(\"No valid endpoint provider available.\");\n\n case 3:\n _context2.next = 5;\n return serializer(args.input, _objectSpread(_objectSpread({}, options), {}, {\n endpoint: endpoint\n }));\n\n case 5:\n request = _context2.sent;\n return _context2.abrupt(\"return\", next(_objectSpread(_objectSpread({}, args), {}, {\n request: request\n })));\n\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};","import { deserializerMiddleware } from \"./deserializerMiddleware\";\nimport { serializerMiddleware } from \"./serializerMiddleware\";\nexport var deserializerMiddlewareOption = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true\n};\nexport var serializerMiddlewareOption = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true\n};\nexport function getSerdePlugin(config, serializer, deserializer) {\n return {\n applyToStack: function applyToStack(commandStack) {\n commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n }\n };\n}","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export var ALGORITHM_QUERY_PARAM = \"X-Amz-Algorithm\";\nexport var CREDENTIAL_QUERY_PARAM = \"X-Amz-Credential\";\nexport var AMZ_DATE_QUERY_PARAM = \"X-Amz-Date\";\nexport var SIGNED_HEADERS_QUERY_PARAM = \"X-Amz-SignedHeaders\";\nexport var EXPIRES_QUERY_PARAM = \"X-Amz-Expires\";\nexport var SIGNATURE_QUERY_PARAM = \"X-Amz-Signature\";\nexport var TOKEN_QUERY_PARAM = \"X-Amz-Security-Token\";\nexport var REGION_SET_PARAM = \"X-Amz-Region-Set\";\nexport var AUTH_HEADER = \"authorization\";\nexport var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nexport var DATE_HEADER = \"date\";\nexport var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];\nexport var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();\nexport var SHA256_HEADER = \"x-amz-content-sha256\";\nexport var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\nexport var HOST_HEADER = \"host\";\nexport var ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n \"cache-control\": true,\n connection: true,\n expect: true,\n from: true,\n \"keep-alive\": true,\n \"max-forwards\": true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n \"transfer-encoding\": true,\n upgrade: true,\n \"user-agent\": true,\n \"x-amzn-trace-id\": true\n};\nexport var PROXY_HEADER_PATTERN = /^proxy-/;\nexport var SEC_HEADER_PATTERN = /^sec-/;\nexport var UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i];\nexport var ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256\";\nexport var ALGORITHM_IDENTIFIER_V4A = \"AWS4-ECDSA-P256-SHA256\";\nexport var EVENT_ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256-PAYLOAD\";\nexport var UNSIGNED_PAYLOAD = \"UNSIGNED-PAYLOAD\";\nexport var MAX_CACHE_SIZE = 50;\nexport var KEY_TYPE_IDENTIFIER = \"aws4_request\";\nexport var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { toUint8Array } from \"@aws-sdk/util-utf8\";\nimport { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from \"./constants\";\nvar signingKeyCache = {};\nvar cacheQueue = [];\nexport var createScope = function createScope(shortDate, region, service) {\n return \"\".concat(shortDate, \"/\").concat(region, \"/\").concat(service, \"/\").concat(KEY_TYPE_IDENTIFIER);\n};\nexport var getSigningKey = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(sha256Constructor, credentials, shortDate, region, service) {\n var credsHash, cacheKey, key, _i, _arr, signable;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);\n\n case 2:\n credsHash = _context.sent;\n cacheKey = \"\".concat(shortDate, \":\").concat(region, \":\").concat(service, \":\").concat(toHex(credsHash), \":\").concat(credentials.sessionToken);\n\n if (!(cacheKey in signingKeyCache)) {\n _context.next = 6;\n break;\n }\n\n return _context.abrupt(\"return\", signingKeyCache[cacheKey]);\n\n case 6:\n cacheQueue.push(cacheKey);\n\n while (cacheQueue.length > MAX_CACHE_SIZE) {\n delete signingKeyCache[cacheQueue.shift()];\n }\n\n key = \"AWS4\".concat(credentials.secretAccessKey);\n _i = 0, _arr = [shortDate, region, service, KEY_TYPE_IDENTIFIER];\n\n case 10:\n if (!(_i < _arr.length)) {\n _context.next = 18;\n break;\n }\n\n signable = _arr[_i];\n _context.next = 14;\n return hmac(sha256Constructor, key, signable);\n\n case 14:\n key = _context.sent;\n\n case 15:\n _i++;\n _context.next = 10;\n break;\n\n case 18:\n return _context.abrupt(\"return\", signingKeyCache[cacheKey] = key);\n\n case 19:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function getSigningKey(_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n}();\nexport var clearCredentialCache = function clearCredentialCache() {\n cacheQueue.length = 0;\n Object.keys(signingKeyCache).forEach(function (cacheKey) {\n delete signingKeyCache[cacheKey];\n });\n};\n\nvar hmac = function hmac(ctor, secret, data) {\n var hash = new ctor(secret);\n hash.update(toUint8Array(data));\n return hash.digest();\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from \"./constants\";\nexport var getCanonicalHeaders = function getCanonicalHeaders(_ref, unsignableHeaders, signableHeaders) {\n var headers = _ref.headers;\n var canonical = {};\n\n var _iterator = _createForOfIteratorHelper(Object.keys(headers).sort()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var headerName = _step.value;\n\n if (headers[headerName] == undefined) {\n continue;\n }\n\n var canonicalHeaderName = headerName.toLowerCase();\n\n if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders !== null && unsignableHeaders !== void 0 && unsignableHeaders.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {\n if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {\n continue;\n }\n }\n\n canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, \" \");\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return canonical;\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\nimport { SIGNATURE_HEADER } from \"./constants\";\nexport var getCanonicalQuery = function getCanonicalQuery(_ref) {\n var _ref$query = _ref.query,\n query = _ref$query === void 0 ? {} : _ref$query;\n var keys = [];\n var serialized = {};\n\n var _iterator = _createForOfIteratorHelper(Object.keys(query).sort()),\n _step;\n\n try {\n var _loop = function _loop() {\n var key = _step.value;\n\n if (key.toLowerCase() === SIGNATURE_HEADER) {\n return \"continue\";\n }\n\n keys.push(key);\n var value = query[key];\n\n if (typeof value === \"string\") {\n serialized[key] = \"\".concat(escapeUri(key), \"=\").concat(escapeUri(value));\n } else if (Array.isArray(value)) {\n serialized[key] = value.slice(0).sort().reduce(function (encoded, value) {\n return encoded.concat([\"\".concat(escapeUri(key), \"=\").concat(escapeUri(value))]);\n }, []).join(\"&\");\n }\n };\n\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _ret = _loop();\n\n if (_ret === \"continue\") continue;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return keys.map(function (key) {\n return serialized[key];\n }).filter(function (serialized) {\n return serialized;\n }).join(\"&\");\n};","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { isArrayBuffer } from \"@aws-sdk/is-array-buffer\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { toUint8Array } from \"@aws-sdk/util-utf8\";\nimport { SHA256_HEADER, UNSIGNED_PAYLOAD } from \"./constants\";\nexport var getPayloadHash = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref, hashConstructor) {\n var headers, body, _i, _Object$keys, headerName, hashCtor;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n headers = _ref.headers, body = _ref.body;\n _i = 0, _Object$keys = Object.keys(headers);\n\n case 2:\n if (!(_i < _Object$keys.length)) {\n _context.next = 9;\n break;\n }\n\n headerName = _Object$keys[_i];\n\n if (!(headerName.toLowerCase() === SHA256_HEADER)) {\n _context.next = 6;\n break;\n }\n\n return _context.abrupt(\"return\", headers[headerName]);\n\n case 6:\n _i++;\n _context.next = 2;\n break;\n\n case 9:\n if (!(body == undefined)) {\n _context.next = 13;\n break;\n }\n\n return _context.abrupt(\"return\", \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\");\n\n case 13:\n if (!(typeof body === \"string\" || ArrayBuffer.isView(body) || isArrayBuffer(body))) {\n _context.next = 21;\n break;\n }\n\n hashCtor = new hashConstructor();\n hashCtor.update(toUint8Array(body));\n _context.t0 = toHex;\n _context.next = 19;\n return hashCtor.digest();\n\n case 19:\n _context.t1 = _context.sent;\n return _context.abrupt(\"return\", (0, _context.t0)(_context.t1));\n\n case 21:\n return _context.abrupt(\"return\", UNSIGNED_PAYLOAD);\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function getPayloadHash(_x, _x2) {\n return _ref2.apply(this, arguments);\n };\n}();","export var isArrayBuffer = function isArrayBuffer(arg) {\n return typeof ArrayBuffer === \"function\" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === \"[object ArrayBuffer]\";\n};","export var hasHeader = function hasHeader(soughtHeader, headers) {\n soughtHeader = soughtHeader.toLowerCase();\n\n for (var _i = 0, _Object$keys = Object.keys(headers); _i < _Object$keys.length; _i++) {\n var headerName = _Object$keys[_i];\n\n if (soughtHeader === headerName.toLowerCase()) {\n return true;\n }\n }\n\n return false;\n};\nexport var getHeaderValue = function getHeaderValue(soughtHeader, headers) {\n soughtHeader = soughtHeader.toLowerCase();\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(headers); _i2 < _Object$keys2.length; _i2++) {\n var headerName = _Object$keys2[_i2];\n\n if (soughtHeader === headerName.toLowerCase()) {\n return headers[headerName];\n }\n }\n\n return undefined;\n};\nexport var deleteHeader = function deleteHeader(soughtHeader, headers) {\n soughtHeader = soughtHeader.toLowerCase();\n\n for (var _i3 = 0, _Object$keys3 = Object.keys(headers); _i3 < _Object$keys3.length; _i3++) {\n var headerName = _Object$keys3[_i3];\n\n if (soughtHeader === headerName.toLowerCase()) {\n delete headers[headerName];\n }\n }\n};","var _excluded = [\"headers\", \"query\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nexport var cloneRequest = function cloneRequest(_ref) {\n var headers = _ref.headers,\n query = _ref.query,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n return _objectSpread(_objectSpread({}, rest), {}, {\n headers: _objectSpread({}, headers),\n query: query ? cloneQuery(query) : undefined\n });\n};\nexport var cloneQuery = function cloneQuery(query) {\n return Object.keys(query).reduce(function (carry, paramName) {\n var param = query[paramName];\n return _objectSpread(_objectSpread({}, carry), {}, _defineProperty({}, paramName, Array.isArray(param) ? _toConsumableArray(param) : param));\n }, {});\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { cloneRequest } from \"./cloneRequest\";\nexport var moveHeadersToQuery = function moveHeadersToQuery(request) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _ref = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request),\n headers = _ref.headers,\n _ref$query = _ref.query,\n query = _ref$query === void 0 ? {} : _ref$query;\n\n for (var _i = 0, _Object$keys = Object.keys(headers); _i < _Object$keys.length; _i++) {\n var _options$unhoistableH;\n\n var name = _Object$keys[_i];\n var lname = name.toLowerCase();\n\n if (lname.slice(0, 6) === \"x-amz-\" && !((_options$unhoistableH = options.unhoistableHeaders) !== null && _options$unhoistableH !== void 0 && _options$unhoistableH.has(lname))) {\n query[name] = headers[name];\n delete headers[name];\n }\n }\n\n return _objectSpread(_objectSpread({}, request), {}, {\n headers: headers,\n query: query\n });\n};","import { cloneRequest } from \"./cloneRequest\";\nimport { GENERATED_HEADERS } from \"./constants\";\nexport var prepareRequest = function prepareRequest(request) {\n request = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request);\n\n for (var _i = 0, _Object$keys = Object.keys(request.headers); _i < _Object$keys.length; _i++) {\n var headerName = _Object$keys[_i];\n\n if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName];\n }\n }\n\n return request;\n};","export var iso8601 = function iso8601(time) {\n return toDate(time).toISOString().replace(/\\.\\d{3}Z$/, \"Z\");\n};\nexport var toDate = function toDate(time) {\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n\n if (typeof time === \"string\") {\n if (Number(time)) {\n return new Date(Number(time) * 1000);\n }\n\n return new Date(time);\n }\n\n return time;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { normalizeProvider } from \"@aws-sdk/util-middleware\";\nimport { toUint8Array } from \"@aws-sdk/util-utf8\";\nimport { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EVENT_ALGORITHM_IDENTIFIER, EXPIRES_QUERY_PARAM, MAX_PRESIGNED_TTL, SHA256_HEADER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM } from \"./constants\";\nimport { createScope, getSigningKey as _getSigningKey } from \"./credentialDerivation\";\nimport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\nimport { getCanonicalQuery } from \"./getCanonicalQuery\";\nimport { getPayloadHash } from \"./getPayloadHash\";\nimport { hasHeader } from \"./headerUtil\";\nimport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\nimport { prepareRequest } from \"./prepareRequest\";\nimport { iso8601 } from \"./utilDate\";\nexport var SignatureV4 = /*#__PURE__*/function () {\n function SignatureV4(_ref) {\n var applyChecksum = _ref.applyChecksum,\n credentials = _ref.credentials,\n region = _ref.region,\n service = _ref.service,\n sha256 = _ref.sha256,\n _ref$uriEscapePath = _ref.uriEscapePath,\n uriEscapePath = _ref$uriEscapePath === void 0 ? true : _ref$uriEscapePath;\n\n _classCallCheck(this, SignatureV4);\n\n this.service = service;\n this.sha256 = sha256;\n this.uriEscapePath = uriEscapePath;\n this.applyChecksum = typeof applyChecksum === \"boolean\" ? applyChecksum : true;\n this.regionProvider = normalizeProvider(region);\n this.credentialProvider = normalizeProvider(credentials);\n }\n\n _createClass(SignatureV4, [{\n key: \"presign\",\n value: function () {\n var _presign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(originalRequest) {\n var options,\n _options$signingDate,\n signingDate,\n _options$expiresIn,\n expiresIn,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n credentials,\n region,\n _formatDate,\n longDate,\n shortDate,\n scope,\n request,\n canonicalHeaders,\n _args = arguments;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _options$signingDate = options.signingDate, signingDate = _options$signingDate === void 0 ? new Date() : _options$signingDate, _options$expiresIn = options.expiresIn, expiresIn = _options$expiresIn === void 0 ? 3600 : _options$expiresIn, unsignableHeaders = options.unsignableHeaders, unhoistableHeaders = options.unhoistableHeaders, signableHeaders = options.signableHeaders, signingRegion = options.signingRegion, signingService = options.signingService;\n _context.next = 4;\n return this.credentialProvider();\n\n case 4:\n credentials = _context.sent;\n this.validateResolvedCredentials(credentials);\n\n if (!(signingRegion !== null && signingRegion !== void 0)) {\n _context.next = 10;\n break;\n }\n\n _context.t0 = signingRegion;\n _context.next = 13;\n break;\n\n case 10:\n _context.next = 12;\n return this.regionProvider();\n\n case 12:\n _context.t0 = _context.sent;\n\n case 13:\n region = _context.t0;\n _formatDate = formatDate(signingDate), longDate = _formatDate.longDate, shortDate = _formatDate.shortDate;\n\n if (!(expiresIn > MAX_PRESIGNED_TTL)) {\n _context.next = 17;\n break;\n }\n\n return _context.abrupt(\"return\", Promise.reject(\"Signature version 4 presigned URLs\" + \" must have an expiration date less than one week in\" + \" the future\"));\n\n case 17:\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n request = moveHeadersToQuery(prepareRequest(originalRequest), {\n unhoistableHeaders: unhoistableHeaders\n });\n\n if (credentials.sessionToken) {\n request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;\n }\n\n request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;\n request.query[CREDENTIAL_QUERY_PARAM] = \"\".concat(credentials.accessKeyId, \"/\").concat(scope);\n request.query[AMZ_DATE_QUERY_PARAM] = longDate;\n request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);\n canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);\n _context.t1 = this;\n _context.t2 = longDate;\n _context.t3 = scope;\n _context.t4 = this.getSigningKey(credentials, region, shortDate, signingService);\n _context.t5 = this;\n _context.t6 = request;\n _context.t7 = canonicalHeaders;\n _context.next = 35;\n return getPayloadHash(originalRequest, this.sha256);\n\n case 35:\n _context.t8 = _context.sent;\n _context.t9 = _context.t5.createCanonicalRequest.call(_context.t5, _context.t6, _context.t7, _context.t8);\n _context.next = 39;\n return _context.t1.getSignature.call(_context.t1, _context.t2, _context.t3, _context.t4, _context.t9);\n\n case 39:\n request.query[SIGNATURE_QUERY_PARAM] = _context.sent;\n return _context.abrupt(\"return\", request);\n\n case 41:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function presign(_x) {\n return _presign.apply(this, arguments);\n }\n\n return presign;\n }()\n }, {\n key: \"sign\",\n value: function () {\n var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(toSign, options) {\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(typeof toSign === \"string\")) {\n _context2.next = 4;\n break;\n }\n\n return _context2.abrupt(\"return\", this.signString(toSign, options));\n\n case 4:\n if (!(toSign.headers && toSign.payload)) {\n _context2.next = 8;\n break;\n }\n\n return _context2.abrupt(\"return\", this.signEvent(toSign, options));\n\n case 8:\n return _context2.abrupt(\"return\", this.signRequest(toSign, options));\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function sign(_x2, _x3) {\n return _sign.apply(this, arguments);\n }\n\n return sign;\n }()\n }, {\n key: \"signEvent\",\n value: function () {\n var _signEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2, _ref3) {\n var headers, payload, _ref3$signingDate, signingDate, priorSignature, signingRegion, signingService, region, _formatDate2, shortDate, longDate, scope, hashedPayload, hash, hashedHeaders, stringToSign;\n\n return _regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n headers = _ref2.headers, payload = _ref2.payload;\n _ref3$signingDate = _ref3.signingDate, signingDate = _ref3$signingDate === void 0 ? new Date() : _ref3$signingDate, priorSignature = _ref3.priorSignature, signingRegion = _ref3.signingRegion, signingService = _ref3.signingService;\n\n if (!(signingRegion !== null && signingRegion !== void 0)) {\n _context3.next = 6;\n break;\n }\n\n _context3.t0 = signingRegion;\n _context3.next = 9;\n break;\n\n case 6:\n _context3.next = 8;\n return this.regionProvider();\n\n case 8:\n _context3.t0 = _context3.sent;\n\n case 9:\n region = _context3.t0;\n _formatDate2 = formatDate(signingDate), shortDate = _formatDate2.shortDate, longDate = _formatDate2.longDate;\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n _context3.next = 14;\n return getPayloadHash({\n headers: {},\n body: payload\n }, this.sha256);\n\n case 14:\n hashedPayload = _context3.sent;\n hash = new this.sha256();\n hash.update(headers);\n _context3.t1 = toHex;\n _context3.next = 20;\n return hash.digest();\n\n case 20:\n _context3.t2 = _context3.sent;\n hashedHeaders = (0, _context3.t1)(_context3.t2);\n stringToSign = [EVENT_ALGORITHM_IDENTIFIER, longDate, scope, priorSignature, hashedHeaders, hashedPayload].join(\"\\n\");\n return _context3.abrupt(\"return\", this.signString(stringToSign, {\n signingDate: signingDate,\n signingRegion: region,\n signingService: signingService\n }));\n\n case 24:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function signEvent(_x4, _x5) {\n return _signEvent.apply(this, arguments);\n }\n\n return signEvent;\n }()\n }, {\n key: \"signString\",\n value: function () {\n var _signString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(stringToSign) {\n var _ref4,\n _ref4$signingDate,\n signingDate,\n signingRegion,\n signingService,\n credentials,\n region,\n _formatDate3,\n shortDate,\n hash,\n _args4 = arguments;\n\n return _regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _ref4 = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {}, _ref4$signingDate = _ref4.signingDate, signingDate = _ref4$signingDate === void 0 ? new Date() : _ref4$signingDate, signingRegion = _ref4.signingRegion, signingService = _ref4.signingService;\n _context4.next = 3;\n return this.credentialProvider();\n\n case 3:\n credentials = _context4.sent;\n this.validateResolvedCredentials(credentials);\n\n if (!(signingRegion !== null && signingRegion !== void 0)) {\n _context4.next = 9;\n break;\n }\n\n _context4.t0 = signingRegion;\n _context4.next = 12;\n break;\n\n case 9:\n _context4.next = 11;\n return this.regionProvider();\n\n case 11:\n _context4.t0 = _context4.sent;\n\n case 12:\n region = _context4.t0;\n _formatDate3 = formatDate(signingDate), shortDate = _formatDate3.shortDate;\n _context4.t1 = this.sha256;\n _context4.next = 17;\n return this.getSigningKey(credentials, region, shortDate, signingService);\n\n case 17:\n _context4.t2 = _context4.sent;\n hash = new _context4.t1(_context4.t2);\n hash.update(toUint8Array(stringToSign));\n _context4.t3 = toHex;\n _context4.next = 23;\n return hash.digest();\n\n case 23:\n _context4.t4 = _context4.sent;\n return _context4.abrupt(\"return\", (0, _context4.t3)(_context4.t4));\n\n case 25:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function signString(_x6) {\n return _signString.apply(this, arguments);\n }\n\n return signString;\n }()\n }, {\n key: \"signRequest\",\n value: function () {\n var _signRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(requestToSign) {\n var _ref5,\n _ref5$signingDate,\n signingDate,\n signableHeaders,\n unsignableHeaders,\n signingRegion,\n signingService,\n credentials,\n region,\n request,\n _formatDate4,\n longDate,\n shortDate,\n scope,\n payloadHash,\n canonicalHeaders,\n signature,\n _args5 = arguments;\n\n return _regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n _ref5 = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {}, _ref5$signingDate = _ref5.signingDate, signingDate = _ref5$signingDate === void 0 ? new Date() : _ref5$signingDate, signableHeaders = _ref5.signableHeaders, unsignableHeaders = _ref5.unsignableHeaders, signingRegion = _ref5.signingRegion, signingService = _ref5.signingService;\n _context5.next = 3;\n return this.credentialProvider();\n\n case 3:\n credentials = _context5.sent;\n this.validateResolvedCredentials(credentials);\n\n if (!(signingRegion !== null && signingRegion !== void 0)) {\n _context5.next = 9;\n break;\n }\n\n _context5.t0 = signingRegion;\n _context5.next = 12;\n break;\n\n case 9:\n _context5.next = 11;\n return this.regionProvider();\n\n case 11:\n _context5.t0 = _context5.sent;\n\n case 12:\n region = _context5.t0;\n request = prepareRequest(requestToSign);\n _formatDate4 = formatDate(signingDate), longDate = _formatDate4.longDate, shortDate = _formatDate4.shortDate;\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n request.headers[AMZ_DATE_HEADER] = longDate;\n\n if (credentials.sessionToken) {\n request.headers[TOKEN_HEADER] = credentials.sessionToken;\n }\n\n _context5.next = 20;\n return getPayloadHash(request, this.sha256);\n\n case 20:\n payloadHash = _context5.sent;\n\n if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n request.headers[SHA256_HEADER] = payloadHash;\n }\n\n canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n _context5.next = 25;\n return this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash));\n\n case 25:\n signature = _context5.sent;\n request.headers[AUTH_HEADER] = \"\".concat(ALGORITHM_IDENTIFIER, \" \") + \"Credential=\".concat(credentials.accessKeyId, \"/\").concat(scope, \", \") + \"SignedHeaders=\".concat(getCanonicalHeaderList(canonicalHeaders), \", \") + \"Signature=\".concat(signature);\n return _context5.abrupt(\"return\", request);\n\n case 28:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function signRequest(_x7) {\n return _signRequest.apply(this, arguments);\n }\n\n return signRequest;\n }()\n }, {\n key: \"createCanonicalRequest\",\n value: function createCanonicalRequest(request, canonicalHeaders, payloadHash) {\n var sortedHeaders = Object.keys(canonicalHeaders).sort();\n return \"\".concat(request.method, \"\\n\").concat(this.getCanonicalPath(request), \"\\n\").concat(getCanonicalQuery(request), \"\\n\").concat(sortedHeaders.map(function (name) {\n return \"\".concat(name, \":\").concat(canonicalHeaders[name]);\n }).join(\"\\n\"), \"\\n\\n\").concat(sortedHeaders.join(\";\"), \"\\n\").concat(payloadHash);\n }\n }, {\n key: \"createStringToSign\",\n value: function () {\n var _createStringToSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(longDate, credentialScope, canonicalRequest) {\n var hash, hashedRequest;\n return _regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n hash = new this.sha256();\n hash.update(toUint8Array(canonicalRequest));\n _context6.next = 4;\n return hash.digest();\n\n case 4:\n hashedRequest = _context6.sent;\n return _context6.abrupt(\"return\", \"\".concat(ALGORITHM_IDENTIFIER, \"\\n\").concat(longDate, \"\\n\").concat(credentialScope, \"\\n\").concat(toHex(hashedRequest)));\n\n case 6:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function createStringToSign(_x8, _x9, _x10) {\n return _createStringToSign.apply(this, arguments);\n }\n\n return createStringToSign;\n }()\n }, {\n key: \"getCanonicalPath\",\n value: function getCanonicalPath(_ref6) {\n var path = _ref6.path;\n\n if (this.uriEscapePath) {\n var normalizedPathSegments = [];\n\n var _iterator = _createForOfIteratorHelper(path.split(\"/\")),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pathSegment = _step.value;\n if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) continue;\n if (pathSegment === \".\") continue;\n\n if (pathSegment === \"..\") {\n normalizedPathSegments.pop();\n } else {\n normalizedPathSegments.push(pathSegment);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var normalizedPath = \"\".concat(path !== null && path !== void 0 && path.startsWith(\"/\") ? \"/\" : \"\").concat(normalizedPathSegments.join(\"/\")).concat(normalizedPathSegments.length > 0 && path !== null && path !== void 0 && path.endsWith(\"/\") ? \"/\" : \"\");\n var doubleEncoded = encodeURIComponent(normalizedPath);\n return doubleEncoded.replace(/%2F/g, \"/\");\n }\n\n return path;\n }\n }, {\n key: \"getSignature\",\n value: function () {\n var _getSignature = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(longDate, credentialScope, keyPromise, canonicalRequest) {\n var stringToSign, hash;\n return _regeneratorRuntime.wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.createStringToSign(longDate, credentialScope, canonicalRequest);\n\n case 2:\n stringToSign = _context7.sent;\n _context7.t0 = this.sha256;\n _context7.next = 6;\n return keyPromise;\n\n case 6:\n _context7.t1 = _context7.sent;\n hash = new _context7.t0(_context7.t1);\n hash.update(toUint8Array(stringToSign));\n _context7.t2 = toHex;\n _context7.next = 12;\n return hash.digest();\n\n case 12:\n _context7.t3 = _context7.sent;\n return _context7.abrupt(\"return\", (0, _context7.t2)(_context7.t3));\n\n case 14:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7, this);\n }));\n\n function getSignature(_x11, _x12, _x13, _x14) {\n return _getSignature.apply(this, arguments);\n }\n\n return getSignature;\n }()\n }, {\n key: \"getSigningKey\",\n value: function getSigningKey(credentials, region, shortDate, service) {\n return _getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);\n }\n }, {\n key: \"validateResolvedCredentials\",\n value: function validateResolvedCredentials(credentials) {\n if (_typeof(credentials) !== \"object\" || typeof credentials.accessKeyId !== \"string\" || typeof credentials.secretAccessKey !== \"string\") {\n throw new Error(\"Resolved credential object is not valid\");\n }\n }\n }]);\n\n return SignatureV4;\n}();\n\nvar formatDate = function formatDate(now) {\n var longDate = iso8601(now).replace(/[\\-:]/g, \"\");\n return {\n longDate: longDate,\n shortDate: longDate.slice(0, 8)\n };\n};\n\nvar getCanonicalHeaderList = function getCanonicalHeaderList(headers) {\n return Object.keys(headers).sort().join(\";\");\n};","var alphabetByEncoding = {};\nvar alphabetByValue = new Array(64);\n\nfor (var i = 0, start = \"A\".charCodeAt(0), limit = \"Z\".charCodeAt(0); i + start <= limit; i++) {\n var _char = String.fromCharCode(i + start);\n\n alphabetByEncoding[_char] = i;\n alphabetByValue[i] = _char;\n}\n\nfor (var _i = 0, _start = \"a\".charCodeAt(0), _limit = \"z\".charCodeAt(0); _i + _start <= _limit; _i++) {\n var _char2 = String.fromCharCode(_i + _start);\n\n var index = _i + 26;\n alphabetByEncoding[_char2] = index;\n alphabetByValue[index] = _char2;\n}\n\nfor (var _i2 = 0; _i2 < 10; _i2++) {\n alphabetByEncoding[_i2.toString(10)] = _i2 + 52;\n\n var _char3 = _i2.toString(10);\n\n var _index = _i2 + 52;\n\n alphabetByEncoding[_char3] = _index;\n alphabetByValue[_index] = _char3;\n}\n\nalphabetByEncoding[\"+\"] = 62;\nalphabetByValue[62] = \"+\";\nalphabetByEncoding[\"/\"] = 63;\nalphabetByValue[63] = \"/\";\nvar bitsPerLetter = 6;\nvar bitsPerByte = 8;\nvar maxLetterValue = 63;\nexport { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue };","import { alphabetByEncoding, bitsPerByte, bitsPerLetter } from \"./constants.browser\";\nexport var fromBase64 = function fromBase64(input) {\n var totalByteLength = input.length / 4 * 3;\n\n if (input.slice(-2) === \"==\") {\n totalByteLength -= 2;\n } else if (input.slice(-1) === \"=\") {\n totalByteLength--;\n }\n\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n if (!(input[j] in alphabetByEncoding)) {\n throw new TypeError(\"Invalid character \".concat(input[j], \" in base64 string.\"));\n }\n\n bits |= alphabetByEncoding[input[j]] << (limit - j) * bitsPerLetter;\n bitLength += bitsPerLetter;\n } else {\n bits >>= bitsPerLetter;\n }\n }\n\n var chunkOffset = i / 4 * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & 255 << offset) >> offset);\n }\n }\n\n return new Uint8Array(out);\n};","import { alphabetByValue, bitsPerByte, bitsPerLetter, maxLetterValue } from \"./constants.browser\";\nexport function toBase64(input) {\n var str = \"\";\n\n for (var i = 0; i < input.length; i += 3) {\n var bits = 0;\n var bitLength = 0;\n\n for (var j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {\n bits |= input[j] << (limit - j - 1) * bitsPerByte;\n bitLength += bitsPerByte;\n }\n\n var bitClusterCount = Math.ceil(bitLength / bitsPerLetter);\n bits <<= bitClusterCount * bitsPerLetter - bitLength;\n\n for (var k = 1; k <= bitClusterCount; k++) {\n var offset = (bitClusterCount - k) * bitsPerLetter;\n str += alphabetByValue[(bits & maxLetterValue << offset) >> offset];\n }\n\n str += \"==\".slice(0, 4 - bitClusterCount);\n }\n\n return str;\n}","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; // TODO: Remove String()\n\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function invariant(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n\n throw error;\n }\n};\n\nmodule.exports = invariant;","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","var global = require('../internals/global');\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar Object = global.Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","var $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external');\nvar isExtensible = require('../internals/object-is-extensible');\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar REQUIRED = false;\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + id++, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!hasOwn(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar enable = function () {\n meta.enable = function () { /* empty */ };\n REQUIRED = true;\n var getOwnPropertyNames = getOwnPropertyNamesModule.f;\n var splice = uncurryThis([].splice);\n var test = {};\n test[METADATA] = 1;\n\n // prevent exposing of metadata key\n if (getOwnPropertyNames(test).length) {\n getOwnPropertyNamesModule.f = function (it) {\n var result = getOwnPropertyNames(it);\n for (var i = 0, length = result.length; i < length; i++) {\n if (result[i] === METADATA) {\n splice(result, i, 1);\n break;\n }\n } return result;\n };\n\n $({ target: 'Object', stat: true, forced: true }, {\n getOwnPropertyNames: getOwnPropertyNamesExternalModule.f\n });\n }\n};\n\nvar meta = module.exports = {\n enable: enable,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n","'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar undefined;\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError; // eslint-disable-next-line consistent-return\n\nvar getEvalledConstructor = function getEvalledConstructor(expressionSyntax) {\n try {\n return $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n } catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nif ($gOPD) {\n try {\n $gOPD({}, '');\n } catch (e) {\n $gOPD = null; // this is IE 8, which has a broken gOPD\n }\n}\n\nvar throwTypeError = function throwTypeError() {\n throw new $TypeError();\n};\n\nvar ThrowTypeError = $gOPD ? function () {\n try {\n // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n arguments.callee; // IE 8 does not throw here\n\n return throwTypeError;\n } catch (calleeThrows) {\n try {\n // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n return $gOPD(arguments, 'callee').get;\n } catch (gOPDthrows) {\n return throwTypeError;\n }\n }\n}() : throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) {\n return x.__proto__;\n}; // eslint-disable-line no-proto\n\n\nvar needsEval = {};\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\nvar INTRINSICS = {\n '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n '%Array%': Array,\n '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n '%AsyncFromSyncIteratorPrototype%': undefined,\n '%AsyncFunction%': needsEval,\n '%AsyncGenerator%': needsEval,\n '%AsyncGeneratorFunction%': needsEval,\n '%AsyncIteratorPrototype%': needsEval,\n '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n '%Boolean%': Boolean,\n '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n '%Date%': Date,\n '%decodeURI%': decodeURI,\n '%decodeURIComponent%': decodeURIComponent,\n '%encodeURI%': encodeURI,\n '%encodeURIComponent%': encodeURIComponent,\n '%Error%': Error,\n '%eval%': eval,\n // eslint-disable-line no-eval\n '%EvalError%': EvalError,\n '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n '%Function%': $Function,\n '%GeneratorFunction%': needsEval,\n '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n '%isFinite%': isFinite,\n '%isNaN%': isNaN,\n '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n '%JSON%': (typeof JSON === \"undefined\" ? \"undefined\" : _typeof(JSON)) === 'object' ? JSON : undefined,\n '%Map%': typeof Map === 'undefined' ? undefined : Map,\n '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n '%Math%': Math,\n '%Number%': Number,\n '%Object%': Object,\n '%parseFloat%': parseFloat,\n '%parseInt%': parseInt,\n '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n '%RangeError%': RangeError,\n '%ReferenceError%': ReferenceError,\n '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n '%RegExp%': RegExp,\n '%Set%': typeof Set === 'undefined' ? undefined : Set,\n '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n '%String%': String,\n '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n '%Symbol%': hasSymbols ? Symbol : undefined,\n '%SyntaxError%': $SyntaxError,\n '%ThrowTypeError%': ThrowTypeError,\n '%TypedArray%': TypedArray,\n '%TypeError%': $TypeError,\n '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n '%URIError%': URIError,\n '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n var value;\n\n if (name === '%AsyncFunction%') {\n value = getEvalledConstructor('async function () {}');\n } else if (name === '%GeneratorFunction%') {\n value = getEvalledConstructor('function* () {}');\n } else if (name === '%AsyncGeneratorFunction%') {\n value = getEvalledConstructor('async function* () {}');\n } else if (name === '%AsyncGenerator%') {\n var fn = doEval('%AsyncGeneratorFunction%');\n\n if (fn) {\n value = fn.prototype;\n }\n } else if (name === '%AsyncIteratorPrototype%') {\n var gen = doEval('%AsyncGenerator%');\n\n if (gen) {\n value = getProto(gen.prototype);\n }\n }\n\n INTRINSICS[name] = value;\n return value;\n};\n\nvar LEGACY_ALIASES = {\n '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n '%ArrayPrototype%': ['Array', 'prototype'],\n '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n '%ArrayProto_values%': ['Array', 'prototype', 'values'],\n '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n '%BooleanPrototype%': ['Boolean', 'prototype'],\n '%DataViewPrototype%': ['DataView', 'prototype'],\n '%DatePrototype%': ['Date', 'prototype'],\n '%ErrorPrototype%': ['Error', 'prototype'],\n '%EvalErrorPrototype%': ['EvalError', 'prototype'],\n '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n '%FunctionPrototype%': ['Function', 'prototype'],\n '%Generator%': ['GeneratorFunction', 'prototype'],\n '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n '%JSONParse%': ['JSON', 'parse'],\n '%JSONStringify%': ['JSON', 'stringify'],\n '%MapPrototype%': ['Map', 'prototype'],\n '%NumberPrototype%': ['Number', 'prototype'],\n '%ObjectPrototype%': ['Object', 'prototype'],\n '%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n '%PromisePrototype%': ['Promise', 'prototype'],\n '%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n '%Promise_all%': ['Promise', 'all'],\n '%Promise_reject%': ['Promise', 'reject'],\n '%Promise_resolve%': ['Promise', 'resolve'],\n '%RangeErrorPrototype%': ['RangeError', 'prototype'],\n '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n '%RegExpPrototype%': ['RegExp', 'prototype'],\n '%SetPrototype%': ['Set', 'prototype'],\n '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n '%StringPrototype%': ['String', 'prototype'],\n '%SymbolPrototype%': ['Symbol', 'prototype'],\n '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n '%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n '%TypeErrorPrototype%': ['TypeError', 'prototype'],\n '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n '%URIErrorPrototype%': ['URIError', 'prototype'],\n '%WeakMapPrototype%': ['WeakMap', 'prototype'],\n '%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\n\nvar hasOwn = require('has');\n\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\n\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g;\n/** Used to match backslashes in property paths. */\n\nvar stringToPath = function stringToPath(string) {\n var first = $strSlice(string, 0, 1);\n var last = $strSlice(string, -1);\n\n if (first === '%' && last !== '%') {\n throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n } else if (last === '%' && first !== '%') {\n throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n }\n\n var result = [];\n $replace(string, rePropName, function (match, number, quote, subString) {\n result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n });\n return result;\n};\n/* end adaptation */\n\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n var intrinsicName = name;\n var alias;\n\n if (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n alias = LEGACY_ALIASES[intrinsicName];\n intrinsicName = '%' + alias[0] + '%';\n }\n\n if (hasOwn(INTRINSICS, intrinsicName)) {\n var value = INTRINSICS[intrinsicName];\n\n if (value === needsEval) {\n value = doEval(intrinsicName);\n }\n\n if (typeof value === 'undefined' && !allowMissing) {\n throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n }\n\n return {\n alias: alias,\n name: intrinsicName,\n value: value\n };\n }\n\n throw new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n if (typeof name !== 'string' || name.length === 0) {\n throw new $TypeError('intrinsic name must be a non-empty string');\n }\n\n if (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n throw new $TypeError('\"allowMissing\" argument must be a boolean');\n }\n\n var parts = stringToPath(name);\n var intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n var intrinsicRealName = intrinsic.name;\n var value = intrinsic.value;\n var skipFurtherCaching = false;\n var alias = intrinsic.alias;\n\n if (alias) {\n intrinsicBaseName = alias[0];\n $spliceApply(parts, $concat([0, 1], alias));\n }\n\n for (var i = 1, isOwn = true; i < parts.length; i += 1) {\n var part = parts[i];\n var first = $strSlice(part, 0, 1);\n var last = $strSlice(part, -1);\n\n if ((first === '\"' || first === \"'\" || first === '`' || last === '\"' || last === \"'\" || last === '`') && first !== last) {\n throw new $SyntaxError('property names with quotes must have matching quotes');\n }\n\n if (part === 'constructor' || !isOwn) {\n skipFurtherCaching = true;\n }\n\n intrinsicBaseName += '.' + part;\n intrinsicRealName = '%' + intrinsicBaseName + '%';\n\n if (hasOwn(INTRINSICS, intrinsicRealName)) {\n value = INTRINSICS[intrinsicRealName];\n } else if (value != null) {\n if (!(part in value)) {\n if (!allowMissing) {\n throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n }\n\n return void undefined;\n }\n\n if ($gOPD && i + 1 >= parts.length) {\n var desc = $gOPD(value, part);\n isOwn = !!desc; // By convention, when a data property is converted to an accessor\n // property to emulate a data property that does not suffer from\n // the override mistake, that accessor's getter is marked with\n // an `originalValue` property. Here, when we detect this, we\n // uphold the illusion by pretending to see that original data\n // property, i.e., returning the value rather than the getter\n // itself.\n\n if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n value = desc.get;\n } else {\n value = value[part];\n }\n } else {\n isOwn = hasOwn(value, part);\n value = value[part];\n }\n\n if (isOwn && !skipFurtherCaching) {\n INTRINSICS[intrinsicRealName] = value;\n }\n }\n }\n\n return value;\n};","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n\n\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;","'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar keys = require('object-keys');\n\nvar hasSymbols = typeof Symbol === 'function' && _typeof(Symbol('foo')) === 'symbol';\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function isFunction(fn) {\n return typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function arePropertyDescriptorsSupported() {\n var obj = {};\n\n try {\n origDefineProperty(obj, 'x', {\n enumerable: false,\n value: obj\n }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\n for (var _ in obj) {\n // jscs:ignore disallowUnusedVariables\n return false;\n }\n\n return obj.x === obj;\n } catch (e) {\n /* this is IE 8. */\n return false;\n }\n};\n\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function defineProperty(object, name, value, predicate) {\n if (name in object && (!isFunction(predicate) || !predicate())) {\n return;\n }\n\n if (supportsDescriptors) {\n origDefineProperty(object, name, {\n configurable: true,\n enumerable: false,\n value: value,\n writable: true\n });\n } else {\n object[name] = value;\n }\n};\n\nvar defineProperties = function defineProperties(object, map) {\n var predicates = arguments.length > 2 ? arguments[2] : {};\n var props = keys(map);\n\n if (hasSymbols) {\n props = concat.call(props, Object.getOwnPropertySymbols(map));\n }\n\n for (var i = 0; i < props.length; i += 1) {\n defineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n }\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\nmodule.exports = defineProperties;","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('./complex-types').Action} Action\n * @typedef {import('./complex-types').Index} Index\n * @typedef {import('./complex-types').ActionTuple} ActionTuple\n * @typedef {import('./complex-types').VisitorResult} VisitorResult\n * @typedef {import('./complex-types').Visitor} Visitor\n */\nimport { convert } from 'unist-util-is';\nimport { color } from './color.js';\n/**\n * Continue traversing as normal\n */\n\nexport var CONTINUE = true;\n/**\n * Do not traverse this node’s children\n */\n\nexport var SKIP = 'skip';\n/**\n * Stop traversing immediately\n */\n\nexport var EXIT = false;\n/**\n * Visit children of tree which pass a test\n *\n * @param tree Abstract syntax tree to walk\n * @param test Test node, optional\n * @param visitor Function to run for each node\n * @param reverse Visit the tree in reverse order, defaults to false\n */\n\nexport var visitParents =\n/**\n * @type {(\n * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) &\n * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void)\n * )}\n */\n\n/**\n * @param {Node} tree\n * @param {Test} test\n * @param {import('./complex-types').Visitor} visitor\n * @param {boolean} [reverse]\n */\nfunction visitParents(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor; // @ts-expect-error no visitor given, so `visitor` is test.\n\n visitor = test;\n test = null;\n }\n\n var is = convert(test);\n var step = reverse ? -1 : 1;\n factory(tree, null, [])();\n /**\n * @param {Node} node\n * @param {number?} index\n * @param {Array.} parents\n */\n\n function factory(node, index, parents) {\n /** @type {Object.} */\n // @ts-expect-error: hush\n var value = _typeof(node) === 'object' && node !== null ? node : {};\n /** @type {string|undefined} */\n\n var name;\n\n if (typeof value.type === 'string') {\n name = typeof value.tagName === 'string' ? value.tagName : typeof value.name === 'string' ? value.name : undefined;\n Object.defineProperty(visit, 'name', {\n value: 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'\n });\n }\n\n return visit;\n\n function visit() {\n /** @type {ActionTuple} */\n var result = [];\n /** @type {ActionTuple} */\n\n var subresult;\n /** @type {number} */\n\n var offset;\n /** @type {Array.} */\n\n var grandparents;\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents));\n\n if (result[0] === EXIT) {\n return result;\n }\n } // @ts-expect-error looks like a parent.\n\n\n if (node.children && result[0] !== SKIP) {\n // @ts-expect-error looks like a parent.\n offset = (reverse ? node.children.length : -1) + step; // @ts-expect-error looks like a parent.\n\n grandparents = parents.concat(node); // @ts-expect-error looks like a parent.\n\n while (offset > -1 && offset < node.children.length) {\n // @ts-expect-error looks like a parent.\n subresult = factory(node.children[offset], offset, grandparents)();\n\n if (subresult[0] === EXIT) {\n return subresult;\n }\n\n offset = typeof subresult[1] === 'number' ? subresult[1] : offset + step;\n }\n }\n\n return result;\n }\n }\n};\n/**\n * @param {VisitorResult} value\n * @returns {ActionTuple}\n */\n\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value;\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value];\n }\n\n return [value];\n}","import { useLayoutEffect } from 'react';\nvar index = useLayoutEffect;\nexport default index;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { memoize } from \"@aws-sdk/property-provider\";\nimport { SignatureV4 } from \"@aws-sdk/signature-v4\";\nimport { normalizeProvider } from \"@aws-sdk/util-middleware\";\nvar CREDENTIAL_EXPIRE_WINDOW = 300000;\nexport var resolveAwsAuthConfig = function resolveAwsAuthConfig(input) {\n var normalizedCreds = input.credentials ? normalizeCredentialProvider(input.credentials) : input.credentialDefaultProvider(input);\n var _input$signingEscapeP = input.signingEscapePath,\n signingEscapePath = _input$signingEscapeP === void 0 ? true : _input$signingEscapeP,\n _input$systemClockOff = input.systemClockOffset,\n systemClockOffset = _input$systemClockOff === void 0 ? input.systemClockOffset || 0 : _input$systemClockOff,\n sha256 = input.sha256;\n var signer;\n\n if (input.signer) {\n signer = normalizeProvider(input.signer);\n } else if (input.regionInfoProvider) {\n signer = function signer() {\n return normalizeProvider(input.region)().then( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(region) {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.t1 = input;\n _context.t2 = region;\n _context.next = 4;\n return input.useFipsEndpoint();\n\n case 4:\n _context.t3 = _context.sent;\n _context.next = 7;\n return input.useDualstackEndpoint();\n\n case 7:\n _context.t4 = _context.sent;\n _context.t5 = {\n useFipsEndpoint: _context.t3,\n useDualstackEndpoint: _context.t4\n };\n _context.next = 11;\n return _context.t1.regionInfoProvider.call(_context.t1, _context.t2, _context.t5);\n\n case 11:\n _context.t0 = _context.sent;\n\n if (_context.t0) {\n _context.next = 14;\n break;\n }\n\n _context.t0 = {};\n\n case 14:\n _context.t6 = _context.t0;\n _context.t7 = region;\n return _context.abrupt(\"return\", [_context.t6, _context.t7]);\n\n case 17:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()).then(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n regionInfo = _ref3[0],\n region = _ref3[1];\n\n var signingRegion = regionInfo.signingRegion,\n signingService = regionInfo.signingService;\n input.signingRegion = input.signingRegion || signingRegion || region;\n input.signingName = input.signingName || signingService || input.serviceId;\n\n var params = _objectSpread(_objectSpread({}, input), {}, {\n credentials: normalizedCreds,\n region: input.signingRegion,\n service: input.signingName,\n sha256: sha256,\n uriEscapePath: signingEscapePath\n });\n\n var SignerCtor = input.signerConstructor || SignatureV4;\n return new SignerCtor(params);\n });\n };\n } else {\n signer = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(authScheme) {\n var signingRegion, signingService, params, SignerCtor;\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.t0 = Object;\n _context2.t1 = {};\n _context2.t2 = input.signingName || input.defaultSigningName;\n _context2.next = 5;\n return normalizeProvider(input.region)();\n\n case 5:\n _context2.t3 = _context2.sent;\n _context2.t4 = {};\n _context2.t5 = {\n name: \"sigv4\",\n signingName: _context2.t2,\n signingRegion: _context2.t3,\n properties: _context2.t4\n };\n _context2.t6 = authScheme;\n authScheme = _context2.t0.assign.call(_context2.t0, _context2.t1, _context2.t5, _context2.t6);\n signingRegion = authScheme.signingRegion;\n signingService = authScheme.signingName;\n input.signingRegion = input.signingRegion || signingRegion;\n input.signingName = input.signingName || signingService || input.serviceId;\n params = _objectSpread(_objectSpread({}, input), {}, {\n credentials: normalizedCreds,\n region: input.signingRegion,\n service: input.signingName,\n sha256: sha256,\n uriEscapePath: signingEscapePath\n });\n SignerCtor = input.signerConstructor || SignatureV4;\n return _context2.abrupt(\"return\", new SignerCtor(params));\n\n case 17:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function signer(_x2) {\n return _ref4.apply(this, arguments);\n };\n }();\n }\n\n return _objectSpread(_objectSpread({}, input), {}, {\n systemClockOffset: systemClockOffset,\n signingEscapePath: signingEscapePath,\n credentials: normalizedCreds,\n signer: signer\n });\n};\nexport var resolveSigV4AuthConfig = function resolveSigV4AuthConfig(input) {\n var normalizedCreds = input.credentials ? normalizeCredentialProvider(input.credentials) : input.credentialDefaultProvider(input);\n var _input$signingEscapeP2 = input.signingEscapePath,\n signingEscapePath = _input$signingEscapeP2 === void 0 ? true : _input$signingEscapeP2,\n _input$systemClockOff2 = input.systemClockOffset,\n systemClockOffset = _input$systemClockOff2 === void 0 ? input.systemClockOffset || 0 : _input$systemClockOff2,\n sha256 = input.sha256;\n var signer;\n\n if (input.signer) {\n signer = normalizeProvider(input.signer);\n } else {\n signer = normalizeProvider(new SignatureV4({\n credentials: normalizedCreds,\n region: input.region,\n service: input.signingName,\n sha256: sha256,\n uriEscapePath: signingEscapePath\n }));\n }\n\n return _objectSpread(_objectSpread({}, input), {}, {\n systemClockOffset: systemClockOffset,\n signingEscapePath: signingEscapePath,\n credentials: normalizedCreds,\n signer: signer\n });\n};\n\nvar normalizeCredentialProvider = function normalizeCredentialProvider(credentials) {\n if (typeof credentials === \"function\") {\n return memoize(credentials, function (credentials) {\n return credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW;\n }, function (credentials) {\n return credentials.expiration !== undefined;\n });\n }\n\n return normalizeProvider(credentials);\n};","export var getSkewCorrectedDate = function getSkewCorrectedDate(systemClockOffset) {\n return new Date(Date.now() + systemClockOffset);\n};","import { isClockSkewed } from \"./isClockSkewed\";\nexport var getUpdatedSystemClockOffset = function getUpdatedSystemClockOffset(clockTime, currentSystemClockOffset) {\n var clockTimeInMs = Date.parse(clockTime);\n\n if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {\n return clockTimeInMs - Date.now();\n }\n\n return currentSystemClockOffset;\n};","import { getSkewCorrectedDate } from \"./getSkewCorrectedDate\";\nexport var isClockSkewed = function isClockSkewed(clockTime, systemClockOffset) {\n return Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;\n};","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { HttpRequest, HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { getSkewCorrectedDate } from \"./utils/getSkewCorrectedDate\";\nimport { getUpdatedSystemClockOffset } from \"./utils/getUpdatedSystemClockOffset\";\nexport var awsAuthMiddleware = function awsAuthMiddleware(options) {\n return function (next, context) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(args) {\n var _context$endpointV, _context$endpointV$pr, _context$endpointV$pr2, _authScheme$signingRe;\n\n var authScheme, multiRegionOverride, signer, output, dateHeader;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (HttpRequest.isInstance(args.request)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\", next(args));\n\n case 2:\n authScheme = (_context$endpointV = context.endpointV2) === null || _context$endpointV === void 0 ? void 0 : (_context$endpointV$pr = _context$endpointV.properties) === null || _context$endpointV$pr === void 0 ? void 0 : (_context$endpointV$pr2 = _context$endpointV$pr.authSchemes) === null || _context$endpointV$pr2 === void 0 ? void 0 : _context$endpointV$pr2[0];\n multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === \"sigv4a\" ? authScheme === null || authScheme === void 0 ? void 0 : (_authScheme$signingRe = authScheme.signingRegionSet) === null || _authScheme$signingRe === void 0 ? void 0 : _authScheme$signingRe.join(\",\") : undefined;\n _context.next = 6;\n return options.signer(authScheme);\n\n case 6:\n signer = _context.sent;\n _context.t0 = next;\n _context.t1 = _objectSpread;\n _context.t2 = _objectSpread({}, args);\n _context.t3 = {};\n _context.next = 13;\n return signer.sign(args.request, {\n signingDate: getSkewCorrectedDate(options.systemClockOffset),\n signingRegion: multiRegionOverride || context[\"signing_region\"],\n signingService: context[\"signing_service\"]\n });\n\n case 13:\n _context.t4 = _context.sent;\n _context.t5 = {\n request: _context.t4\n };\n _context.t6 = (0, _context.t1)(_context.t2, _context.t3, _context.t5);\n _context.next = 18;\n return (0, _context.t0)(_context.t6)[\"catch\"](function (error) {\n var _error$ServerTime;\n\n var serverTime = (_error$ServerTime = error.ServerTime) !== null && _error$ServerTime !== void 0 ? _error$ServerTime : getDateHeader(error.$response);\n\n if (serverTime) {\n options.systemClockOffset = getUpdatedSystemClockOffset(serverTime, options.systemClockOffset);\n }\n\n throw error;\n });\n\n case 18:\n output = _context.sent;\n dateHeader = getDateHeader(output.response);\n\n if (dateHeader) {\n options.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, options.systemClockOffset);\n }\n\n return _context.abrupt(\"return\", output);\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};\n\nvar getDateHeader = function getDateHeader(response) {\n var _response$headers$dat, _response$headers, _response$headers2;\n\n return HttpResponse.isInstance(response) ? (_response$headers$dat = (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.date) !== null && _response$headers$dat !== void 0 ? _response$headers$dat : (_response$headers2 = response.headers) === null || _response$headers2 === void 0 ? void 0 : _response$headers2.Date : undefined;\n};\n\nexport var awsAuthMiddlewareOptions = {\n name: \"awsAuthMiddleware\",\n tags: [\"SIGNATURE\", \"AWSAUTH\"],\n relation: \"after\",\n toMiddleware: \"retryMiddleware\",\n override: true\n};\nexport var getAwsAuthPlugin = function getAwsAuthPlugin(options) {\n return {\n applyToStack: function applyToStack(clientStack) {\n clientStack.addRelativeTo(awsAuthMiddleware(options), awsAuthMiddlewareOptions);\n }\n };\n};\nexport var getSigV4AuthPlugin = getAwsAuthPlugin;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nexport function parseQueryString(querystring) {\n var query = {};\n querystring = querystring.replace(/^\\?/, \"\");\n\n if (querystring) {\n var _iterator = _createForOfIteratorHelper(querystring.split(\"&\")),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pair = _step.value;\n\n var _pair$split = pair.split(\"=\"),\n _pair$split2 = _slicedToArray(_pair$split, 2),\n key = _pair$split2[0],\n _pair$split2$ = _pair$split2[1],\n value = _pair$split2$ === void 0 ? null : _pair$split2$;\n\n key = decodeURIComponent(key);\n\n if (value) {\n value = decodeURIComponent(value);\n }\n\n if (!(key in query)) {\n query[key] = value;\n } else if (Array.isArray(query[key])) {\n query[key].push(value);\n } else {\n query[key] = [query[key], value];\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n return query;\n}","import { parseQueryString } from \"@aws-sdk/querystring-parser\";\nexport var parseUrl = function parseUrl(url) {\n if (typeof url === \"string\") {\n return parseUrl(new URL(url));\n }\n\n var hostname = url.hostname,\n pathname = url.pathname,\n port = url.port,\n protocol = url.protocol,\n search = url.search;\n var query;\n\n if (search) {\n query = parseQueryString(search);\n }\n\n return {\n hostname: hostname,\n port: port ? parseInt(port) : undefined,\n protocol: protocol,\n path: pathname,\n query: query\n };\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * MIT License\n * \n * Copyright (c) 2014-present, Lee Byron and other contributors.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar DELETE = 'delete'; // Constants describing the size of trie nodes.\n\nvar SHIFT = 5; // Resulted in best performance after ______?\n\nvar SIZE = 1 << SHIFT;\nvar MASK = SIZE - 1; // A consistent shared value representing \"not set\" which equals nothing other\n// than itself, and nothing that could be provided externally.\n\nvar NOT_SET = {}; // Boolean references, Rough equivalent of `bool &`.\n\nfunction MakeRef() {\n return {\n value: false\n };\n}\n\nfunction SetRef(ref) {\n if (ref) {\n ref.value = true;\n }\n} // A function which returns a value representing an \"owner\" for transient writes\n// to tries. The return value will only ever equal itself, and will not equal\n// the return of any subsequent call of this function.\n\n\nfunction OwnerID() {}\n\nfunction ensureSize(iter) {\n if (iter.size === undefined) {\n iter.size = iter.__iterate(returnTrue);\n }\n\n return iter.size;\n}\n\nfunction wrapIndex(iter, index) {\n // This implements \"is array index\" which the ECMAString spec defines as:\n //\n // A String property name P is an array index if and only if\n // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal\n // to 2^32−1.\n //\n // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects\n if (typeof index !== 'number') {\n var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32\n\n if ('' + uint32Index !== index || uint32Index === 4294967295) {\n return NaN;\n }\n\n index = uint32Index;\n }\n\n return index < 0 ? ensureSize(iter) + index : index;\n}\n\nfunction returnTrue() {\n return true;\n}\n\nfunction wholeSlice(begin, end, size) {\n return (begin === 0 && !isNeg(begin) || size !== undefined && begin <= -size) && (end === undefined || size !== undefined && end >= size);\n}\n\nfunction resolveBegin(begin, size) {\n return resolveIndex(begin, size, 0);\n}\n\nfunction resolveEnd(end, size) {\n return resolveIndex(end, size, size);\n}\n\nfunction resolveIndex(index, size, defaultIndex) {\n // Sanitize indices using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n return index === undefined ? defaultIndex : isNeg(index) ? size === Infinity ? size : Math.max(0, size + index) | 0 : size === undefined || size === index ? index : Math.min(size, index) | 0;\n}\n\nfunction isNeg(value) {\n // Account for -0 which is negative, but not less than 0.\n return value < 0 || value === 0 && 1 / value === -Infinity;\n}\n\nvar IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@';\n\nfunction isCollection(maybeCollection) {\n return Boolean(maybeCollection && maybeCollection[IS_COLLECTION_SYMBOL]);\n}\n\nvar IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@';\n\nfunction isKeyed(maybeKeyed) {\n return Boolean(maybeKeyed && maybeKeyed[IS_KEYED_SYMBOL]);\n}\n\nvar IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@';\n\nfunction isIndexed(maybeIndexed) {\n return Boolean(maybeIndexed && maybeIndexed[IS_INDEXED_SYMBOL]);\n}\n\nfunction isAssociative(maybeAssociative) {\n return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n}\n\nvar Collection = function Collection(value) {\n return isCollection(value) ? value : Seq(value);\n};\n\nvar KeyedCollection = /*@__PURE__*/function (Collection) {\n function KeyedCollection(value) {\n return isKeyed(value) ? value : KeyedSeq(value);\n }\n\n if (Collection) KeyedCollection.__proto__ = Collection;\n KeyedCollection.prototype = Object.create(Collection && Collection.prototype);\n KeyedCollection.prototype.constructor = KeyedCollection;\n return KeyedCollection;\n}(Collection);\n\nvar IndexedCollection = /*@__PURE__*/function (Collection) {\n function IndexedCollection(value) {\n return isIndexed(value) ? value : IndexedSeq(value);\n }\n\n if (Collection) IndexedCollection.__proto__ = Collection;\n IndexedCollection.prototype = Object.create(Collection && Collection.prototype);\n IndexedCollection.prototype.constructor = IndexedCollection;\n return IndexedCollection;\n}(Collection);\n\nvar SetCollection = /*@__PURE__*/function (Collection) {\n function SetCollection(value) {\n return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);\n }\n\n if (Collection) SetCollection.__proto__ = Collection;\n SetCollection.prototype = Object.create(Collection && Collection.prototype);\n SetCollection.prototype.constructor = SetCollection;\n return SetCollection;\n}(Collection);\n\nCollection.Keyed = KeyedCollection;\nCollection.Indexed = IndexedCollection;\nCollection.Set = SetCollection;\nvar IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@';\n\nfunction isSeq(maybeSeq) {\n return Boolean(maybeSeq && maybeSeq[IS_SEQ_SYMBOL]);\n}\n\nvar IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@';\n\nfunction isRecord(maybeRecord) {\n return Boolean(maybeRecord && maybeRecord[IS_RECORD_SYMBOL]);\n}\n\nfunction isImmutable(maybeImmutable) {\n return isCollection(maybeImmutable) || isRecord(maybeImmutable);\n}\n\nvar IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@';\n\nfunction isOrdered(maybeOrdered) {\n return Boolean(maybeOrdered && maybeOrdered[IS_ORDERED_SYMBOL]);\n}\n\nvar ITERATE_KEYS = 0;\nvar ITERATE_VALUES = 1;\nvar ITERATE_ENTRIES = 2;\nvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\nvar Iterator = function Iterator(next) {\n this.next = next;\n};\n\nIterator.prototype.toString = function toString() {\n return '[Iterator]';\n};\n\nIterator.KEYS = ITERATE_KEYS;\nIterator.VALUES = ITERATE_VALUES;\nIterator.ENTRIES = ITERATE_ENTRIES;\n\nIterator.prototype.inspect = Iterator.prototype.toSource = function () {\n return this.toString();\n};\n\nIterator.prototype[ITERATOR_SYMBOL] = function () {\n return this;\n};\n\nfunction iteratorValue(type, k, v, iteratorResult) {\n var value = type === 0 ? k : type === 1 ? v : [k, v];\n iteratorResult ? iteratorResult.value = value : iteratorResult = {\n value: value,\n done: false\n };\n return iteratorResult;\n}\n\nfunction iteratorDone() {\n return {\n value: undefined,\n done: true\n };\n}\n\nfunction hasIterator(maybeIterable) {\n if (Array.isArray(maybeIterable)) {\n // IE11 trick as it does not support `Symbol.iterator`\n return true;\n }\n\n return !!getIteratorFn(maybeIterable);\n}\n\nfunction isIterator(maybeIterator) {\n return maybeIterator && typeof maybeIterator.next === 'function';\n}\n\nfunction getIterator(iterable) {\n var iteratorFn = getIteratorFn(iterable);\n return iteratorFn && iteratorFn.call(iterable);\n}\n\nfunction getIteratorFn(iterable) {\n var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);\n\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n}\n\nfunction isEntriesIterable(maybeIterable) {\n var iteratorFn = getIteratorFn(maybeIterable);\n return iteratorFn && iteratorFn === maybeIterable.entries;\n}\n\nfunction isKeysIterable(maybeIterable) {\n var iteratorFn = getIteratorFn(maybeIterable);\n return iteratorFn && iteratorFn === maybeIterable.keys;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction isArrayLike(value) {\n if (Array.isArray(value) || typeof value === 'string') {\n return true;\n }\n\n return value && _typeof(value) === 'object' && Number.isInteger(value.length) && value.length >= 0 && (value.length === 0 ? // Only {length: 0} is considered Array-like.\n Object.keys(value).length === 1 : // An object is only Array-like if it has a property where the last value\n // in the array-like may be found (which could be undefined).\n value.hasOwnProperty(value.length - 1));\n}\n\nvar Seq = /*@__PURE__*/function (Collection) {\n function Seq(value) {\n return value === null || value === undefined ? emptySequence() : isImmutable(value) ? value.toSeq() : seqFromValue(value);\n }\n\n if (Collection) Seq.__proto__ = Collection;\n Seq.prototype = Object.create(Collection && Collection.prototype);\n Seq.prototype.constructor = Seq;\n\n Seq.prototype.toSeq = function toSeq() {\n return this;\n };\n\n Seq.prototype.toString = function toString() {\n return this.__toString('Seq {', '}');\n };\n\n Seq.prototype.cacheResult = function cacheResult() {\n if (!this._cache && this.__iterateUncached) {\n this._cache = this.entrySeq().toArray();\n this.size = this._cache.length;\n }\n\n return this;\n }; // abstract __iterateUncached(fn, reverse)\n\n\n Seq.prototype.__iterate = function __iterate(fn, reverse) {\n var cache = this._cache;\n\n if (cache) {\n var size = cache.length;\n var i = 0;\n\n while (i !== size) {\n var entry = cache[reverse ? size - ++i : i++];\n\n if (fn(entry[1], entry[0], this) === false) {\n break;\n }\n }\n\n return i;\n }\n\n return this.__iterateUncached(fn, reverse);\n }; // abstract __iteratorUncached(type, reverse)\n\n\n Seq.prototype.__iterator = function __iterator(type, reverse) {\n var cache = this._cache;\n\n if (cache) {\n var size = cache.length;\n var i = 0;\n return new Iterator(function () {\n if (i === size) {\n return iteratorDone();\n }\n\n var entry = cache[reverse ? size - ++i : i++];\n return iteratorValue(type, entry[0], entry[1]);\n });\n }\n\n return this.__iteratorUncached(type, reverse);\n };\n\n return Seq;\n}(Collection);\n\nvar KeyedSeq = /*@__PURE__*/function (Seq) {\n function KeyedSeq(value) {\n return value === null || value === undefined ? emptySequence().toKeyedSeq() : isCollection(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : isRecord(value) ? value.toSeq() : keyedSeqFromValue(value);\n }\n\n if (Seq) KeyedSeq.__proto__ = Seq;\n KeyedSeq.prototype = Object.create(Seq && Seq.prototype);\n KeyedSeq.prototype.constructor = KeyedSeq;\n\n KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq() {\n return this;\n };\n\n return KeyedSeq;\n}(Seq);\n\nvar IndexedSeq = /*@__PURE__*/function (Seq) {\n function IndexedSeq(value) {\n return value === null || value === undefined ? emptySequence() : isCollection(value) ? isKeyed(value) ? value.entrySeq() : value.toIndexedSeq() : isRecord(value) ? value.toSeq().entrySeq() : indexedSeqFromValue(value);\n }\n\n if (Seq) IndexedSeq.__proto__ = Seq;\n IndexedSeq.prototype = Object.create(Seq && Seq.prototype);\n IndexedSeq.prototype.constructor = IndexedSeq;\n\n IndexedSeq.of = function\n /*...values*/\n of() {\n return IndexedSeq(arguments);\n };\n\n IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq() {\n return this;\n };\n\n IndexedSeq.prototype.toString = function toString() {\n return this.__toString('Seq [', ']');\n };\n\n return IndexedSeq;\n}(Seq);\n\nvar SetSeq = /*@__PURE__*/function (Seq) {\n function SetSeq(value) {\n return (isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)).toSetSeq();\n }\n\n if (Seq) SetSeq.__proto__ = Seq;\n SetSeq.prototype = Object.create(Seq && Seq.prototype);\n SetSeq.prototype.constructor = SetSeq;\n\n SetSeq.of = function\n /*...values*/\n of() {\n return SetSeq(arguments);\n };\n\n SetSeq.prototype.toSetSeq = function toSetSeq() {\n return this;\n };\n\n return SetSeq;\n}(Seq);\n\nSeq.isSeq = isSeq;\nSeq.Keyed = KeyedSeq;\nSeq.Set = SetSeq;\nSeq.Indexed = IndexedSeq;\nSeq.prototype[IS_SEQ_SYMBOL] = true; // #pragma Root Sequences\n\nvar ArraySeq = /*@__PURE__*/function (IndexedSeq) {\n function ArraySeq(array) {\n this._array = array;\n this.size = array.length;\n }\n\n if (IndexedSeq) ArraySeq.__proto__ = IndexedSeq;\n ArraySeq.prototype = Object.create(IndexedSeq && IndexedSeq.prototype);\n ArraySeq.prototype.constructor = ArraySeq;\n\n ArraySeq.prototype.get = function get(index, notSetValue) {\n return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n };\n\n ArraySeq.prototype.__iterate = function __iterate(fn, reverse) {\n var array = this._array;\n var size = array.length;\n var i = 0;\n\n while (i !== size) {\n var ii = reverse ? size - ++i : i++;\n\n if (fn(array[ii], ii, this) === false) {\n break;\n }\n }\n\n return i;\n };\n\n ArraySeq.prototype.__iterator = function __iterator(type, reverse) {\n var array = this._array;\n var size = array.length;\n var i = 0;\n return new Iterator(function () {\n if (i === size) {\n return iteratorDone();\n }\n\n var ii = reverse ? size - ++i : i++;\n return iteratorValue(type, ii, array[ii]);\n });\n };\n\n return ArraySeq;\n}(IndexedSeq);\n\nvar ObjectSeq = /*@__PURE__*/function (KeyedSeq) {\n function ObjectSeq(object) {\n var keys = Object.keys(object);\n this._object = object;\n this._keys = keys;\n this.size = keys.length;\n }\n\n if (KeyedSeq) ObjectSeq.__proto__ = KeyedSeq;\n ObjectSeq.prototype = Object.create(KeyedSeq && KeyedSeq.prototype);\n ObjectSeq.prototype.constructor = ObjectSeq;\n\n ObjectSeq.prototype.get = function get(key, notSetValue) {\n if (notSetValue !== undefined && !this.has(key)) {\n return notSetValue;\n }\n\n return this._object[key];\n };\n\n ObjectSeq.prototype.has = function has(key) {\n return hasOwnProperty.call(this._object, key);\n };\n\n ObjectSeq.prototype.__iterate = function __iterate(fn, reverse) {\n var object = this._object;\n var keys = this._keys;\n var size = keys.length;\n var i = 0;\n\n while (i !== size) {\n var key = keys[reverse ? size - ++i : i++];\n\n if (fn(object[key], key, this) === false) {\n break;\n }\n }\n\n return i;\n };\n\n ObjectSeq.prototype.__iterator = function __iterator(type, reverse) {\n var object = this._object;\n var keys = this._keys;\n var size = keys.length;\n var i = 0;\n return new Iterator(function () {\n if (i === size) {\n return iteratorDone();\n }\n\n var key = keys[reverse ? size - ++i : i++];\n return iteratorValue(type, key, object[key]);\n });\n };\n\n return ObjectSeq;\n}(KeyedSeq);\n\nObjectSeq.prototype[IS_ORDERED_SYMBOL] = true;\n\nvar CollectionSeq = /*@__PURE__*/function (IndexedSeq) {\n function CollectionSeq(collection) {\n this._collection = collection;\n this.size = collection.length || collection.size;\n }\n\n if (IndexedSeq) CollectionSeq.__proto__ = IndexedSeq;\n CollectionSeq.prototype = Object.create(IndexedSeq && IndexedSeq.prototype);\n CollectionSeq.prototype.constructor = CollectionSeq;\n\n CollectionSeq.prototype.__iterateUncached = function __iterateUncached(fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var collection = this._collection;\n var iterator = getIterator(collection);\n var iterations = 0;\n\n if (isIterator(iterator)) {\n var step;\n\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n }\n\n return iterations;\n };\n\n CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached(type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var collection = this._collection;\n var iterator = getIterator(collection);\n\n if (!isIterator(iterator)) {\n return new Iterator(iteratorDone);\n }\n\n var iterations = 0;\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, iterations++, step.value);\n });\n };\n\n return CollectionSeq;\n}(IndexedSeq); // # pragma Helper functions\n\n\nvar EMPTY_SEQ;\n\nfunction emptySequence() {\n return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n}\n\nfunction keyedSeqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value);\n\n if (seq) {\n return seq.fromEntrySeq();\n }\n\n if (_typeof(value) === 'object') {\n return new ObjectSeq(value);\n }\n\n throw new TypeError('Expected Array or collection object of [k, v] entries, or keyed object: ' + value);\n}\n\nfunction indexedSeqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value);\n\n if (seq) {\n return seq;\n }\n\n throw new TypeError('Expected Array or collection object of values: ' + value);\n}\n\nfunction seqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value);\n\n if (seq) {\n return isEntriesIterable(value) ? seq.fromEntrySeq() : isKeysIterable(value) ? seq.toSetSeq() : seq;\n }\n\n if (_typeof(value) === 'object') {\n return new ObjectSeq(value);\n }\n\n throw new TypeError('Expected Array or collection object of values, or keyed object: ' + value);\n}\n\nfunction maybeIndexedSeqFromValue(value) {\n return isArrayLike(value) ? new ArraySeq(value) : hasIterator(value) ? new CollectionSeq(value) : undefined;\n}\n\nvar IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@';\n\nfunction isMap(maybeMap) {\n return Boolean(maybeMap && maybeMap[IS_MAP_SYMBOL]);\n}\n\nfunction isOrderedMap(maybeOrderedMap) {\n return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n}\n\nfunction isValueObject(maybeValue) {\n return Boolean(maybeValue && typeof maybeValue.equals === 'function' && typeof maybeValue.hashCode === 'function');\n}\n/**\n * An extension of the \"same-value\" algorithm as [described for use by ES6 Map\n * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)\n *\n * NaN is considered the same as NaN, however -0 and 0 are considered the same\n * value, which is different from the algorithm described by\n * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).\n *\n * This is extended further to allow Objects to describe the values they\n * represent, by way of `valueOf` or `equals` (and `hashCode`).\n *\n * Note: because of this extension, the key equality of Immutable.Map and the\n * value equality of Immutable.Set will differ from ES6 Map and Set.\n *\n * ### Defining custom values\n *\n * The easiest way to describe the value an object represents is by implementing\n * `valueOf`. For example, `Date` represents a value by returning a unix\n * timestamp for `valueOf`:\n *\n * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...\n * var date2 = new Date(1234567890000);\n * date1.valueOf(); // 1234567890000\n * assert( date1 !== date2 );\n * assert( Immutable.is( date1, date2 ) );\n *\n * Note: overriding `valueOf` may have other implications if you use this object\n * where JavaScript expects a primitive, such as implicit string coercion.\n *\n * For more complex types, especially collections, implementing `valueOf` may\n * not be performant. An alternative is to implement `equals` and `hashCode`.\n *\n * `equals` takes another object, presumably of similar type, and returns true\n * if it is equal. Equality is symmetrical, so the same result should be\n * returned if this and the argument are flipped.\n *\n * assert( a.equals(b) === b.equals(a) );\n *\n * `hashCode` returns a 32bit integer number representing the object which will\n * be used to determine how to store the value object in a Map or Set. You must\n * provide both or neither methods, one must not exist without the other.\n *\n * Also, an important relationship between these methods must be upheld: if two\n * values are equal, they *must* return the same hashCode. If the values are not\n * equal, they might have the same hashCode; this is called a hash collision,\n * and while undesirable for performance reasons, it is acceptable.\n *\n * if (a.equals(b)) {\n * assert( a.hashCode() === b.hashCode() );\n * }\n *\n * All Immutable collections are Value Objects: they implement `equals()`\n * and `hashCode()`.\n */\n\n\nfunction is(valueA, valueB) {\n if (valueA === valueB || valueA !== valueA && valueB !== valueB) {\n return true;\n }\n\n if (!valueA || !valueB) {\n return false;\n }\n\n if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') {\n valueA = valueA.valueOf();\n valueB = valueB.valueOf();\n\n if (valueA === valueB || valueA !== valueA && valueB !== valueB) {\n return true;\n }\n\n if (!valueA || !valueB) {\n return false;\n }\n }\n\n return !!(isValueObject(valueA) && isValueObject(valueB) && valueA.equals(valueB));\n}\n\nvar imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) {\n a |= 0; // int\n\n b |= 0; // int\n\n var c = a & 0xffff;\n var d = b & 0xffff; // Shift by 0 fixes the sign on the high part.\n\n return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0; // int\n}; // v8 has an optimization for storing 31-bit signed numbers.\n// Values which have either 00 or 11 as the high order bits qualify.\n// This function drops the highest order bit in a signed number, maintaining\n// the sign bit.\n\nfunction smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}\n\nvar defaultValueOf = Object.prototype.valueOf;\n\nfunction hash(o) {\n if (o == null) {\n return hashNullish(o);\n }\n\n if (typeof o.hashCode === 'function') {\n // Drop any high bits from accidentally long hash codes.\n return smi(o.hashCode(o));\n }\n\n var v = valueOf(o);\n\n if (v == null) {\n return hashNullish(v);\n }\n\n switch (_typeof(v)) {\n case 'boolean':\n // The hash values for built-in constants are a 1 value for each 5-byte\n // shift region expect for the first, which encodes the value. This\n // reduces the odds of a hash collision for these common values.\n return v ? 0x42108421 : 0x42108420;\n\n case 'number':\n return hashNumber(v);\n\n case 'string':\n return v.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(v) : hashString(v);\n\n case 'object':\n case 'function':\n return hashJSObj(v);\n\n case 'symbol':\n return hashSymbol(v);\n\n default:\n if (typeof v.toString === 'function') {\n return hashString(v.toString());\n }\n\n throw new Error('Value type ' + _typeof(v) + ' cannot be hashed.');\n }\n}\n\nfunction hashNullish(nullish) {\n return nullish === null ? 0x42108422 :\n /* undefined */\n 0x42108423;\n} // Compress arbitrarily large numbers into smi hashes.\n\n\nfunction hashNumber(n) {\n if (n !== n || n === Infinity) {\n return 0;\n }\n\n var hash = n | 0;\n\n if (hash !== n) {\n hash ^= n * 0xffffffff;\n }\n\n while (n > 0xffffffff) {\n n /= 0xffffffff;\n hash ^= n;\n }\n\n return smi(hash);\n}\n\nfunction cachedHashString(string) {\n var hashed = stringHashCache[string];\n\n if (hashed === undefined) {\n hashed = hashString(string);\n\n if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n STRING_HASH_CACHE_SIZE = 0;\n stringHashCache = {};\n }\n\n STRING_HASH_CACHE_SIZE++;\n stringHashCache[string] = hashed;\n }\n\n return hashed;\n} // http://jsperf.com/hashing-strings\n\n\nfunction hashString(string) {\n // This is the hash from JVM\n // The hash code for a string is computed as\n // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n // where s[i] is the ith character of the string and n is the length of\n // the string. We \"mod\" the result to make it between 0 (inclusive) and 2^31\n // (exclusive) by dropping high bits.\n var hashed = 0;\n\n for (var ii = 0; ii < string.length; ii++) {\n hashed = 31 * hashed + string.charCodeAt(ii) | 0;\n }\n\n return smi(hashed);\n}\n\nfunction hashSymbol(sym) {\n var hashed = symbolMap[sym];\n\n if (hashed !== undefined) {\n return hashed;\n }\n\n hashed = nextHash();\n symbolMap[sym] = hashed;\n return hashed;\n}\n\nfunction hashJSObj(obj) {\n var hashed;\n\n if (usingWeakMap) {\n hashed = weakMap.get(obj);\n\n if (hashed !== undefined) {\n return hashed;\n }\n }\n\n hashed = obj[UID_HASH_KEY];\n\n if (hashed !== undefined) {\n return hashed;\n }\n\n if (!canDefineProperty) {\n hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\n if (hashed !== undefined) {\n return hashed;\n }\n\n hashed = getIENodeHash(obj);\n\n if (hashed !== undefined) {\n return hashed;\n }\n }\n\n hashed = nextHash();\n\n if (usingWeakMap) {\n weakMap.set(obj, hashed);\n } else if (isExtensible !== undefined && isExtensible(obj) === false) {\n throw new Error('Non-extensible objects are not allowed as keys.');\n } else if (canDefineProperty) {\n Object.defineProperty(obj, UID_HASH_KEY, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: hashed\n });\n } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n // Since we can't define a non-enumerable property on the object\n // we'll hijack one of the less-used non-enumerable properties to\n // save our hash on it. Since this is a function it will not show up in\n // `JSON.stringify` which is what we want.\n obj.propertyIsEnumerable = function () {\n return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n };\n\n obj.propertyIsEnumerable[UID_HASH_KEY] = hashed;\n } else if (obj.nodeType !== undefined) {\n // At this point we couldn't get the IE `uniqueID` to use as a hash\n // and we couldn't use a non-enumerable property to exploit the\n // dontEnum bug so we simply add the `UID_HASH_KEY` on the node\n // itself.\n obj[UID_HASH_KEY] = hashed;\n } else {\n throw new Error('Unable to set a non-enumerable property on object.');\n }\n\n return hashed;\n} // Get references to ES5 object methods.\n\n\nvar isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test.\n\nvar canDefineProperty = function () {\n try {\n Object.defineProperty({}, '@', {});\n return true;\n } catch (e) {\n return false;\n }\n}(); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it\n// and avoid memory leaks from the IE cloneNode bug.\n\n\nfunction getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n}\n\nfunction valueOf(obj) {\n return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' ? obj.valueOf(obj) : obj;\n}\n\nfunction nextHash() {\n var nextHash = ++_objHashUID;\n\n if (_objHashUID & 0x40000000) {\n _objHashUID = 0;\n }\n\n return nextHash;\n} // If possible, use a WeakMap.\n\n\nvar usingWeakMap = typeof WeakMap === 'function';\nvar weakMap;\n\nif (usingWeakMap) {\n weakMap = new WeakMap();\n}\n\nvar symbolMap = Object.create(null);\nvar _objHashUID = 0;\nvar UID_HASH_KEY = '__immutablehash__';\n\nif (typeof Symbol === 'function') {\n UID_HASH_KEY = Symbol(UID_HASH_KEY);\n}\n\nvar STRING_HASH_CACHE_MIN_STRLEN = 16;\nvar STRING_HASH_CACHE_MAX_SIZE = 255;\nvar STRING_HASH_CACHE_SIZE = 0;\nvar stringHashCache = {};\n\nvar ToKeyedSequence = /*@__PURE__*/function (KeyedSeq) {\n function ToKeyedSequence(indexed, useKeys) {\n this._iter = indexed;\n this._useKeys = useKeys;\n this.size = indexed.size;\n }\n\n if (KeyedSeq) ToKeyedSequence.__proto__ = KeyedSeq;\n ToKeyedSequence.prototype = Object.create(KeyedSeq && KeyedSeq.prototype);\n ToKeyedSequence.prototype.constructor = ToKeyedSequence;\n\n ToKeyedSequence.prototype.get = function get(key, notSetValue) {\n return this._iter.get(key, notSetValue);\n };\n\n ToKeyedSequence.prototype.has = function has(key) {\n return this._iter.has(key);\n };\n\n ToKeyedSequence.prototype.valueSeq = function valueSeq() {\n return this._iter.valueSeq();\n };\n\n ToKeyedSequence.prototype.reverse = function reverse() {\n var this$1$1 = this;\n var reversedSequence = reverseFactory(this, true);\n\n if (!this._useKeys) {\n reversedSequence.valueSeq = function () {\n return this$1$1._iter.toSeq().reverse();\n };\n }\n\n return reversedSequence;\n };\n\n ToKeyedSequence.prototype.map = function map(mapper, context) {\n var this$1$1 = this;\n var mappedSequence = mapFactory(this, mapper, context);\n\n if (!this._useKeys) {\n mappedSequence.valueSeq = function () {\n return this$1$1._iter.toSeq().map(mapper, context);\n };\n }\n\n return mappedSequence;\n };\n\n ToKeyedSequence.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n return this._iter.__iterate(function (v, k) {\n return fn(v, k, this$1$1);\n }, reverse);\n };\n\n ToKeyedSequence.prototype.__iterator = function __iterator(type, reverse) {\n return this._iter.__iterator(type, reverse);\n };\n\n return ToKeyedSequence;\n}(KeyedSeq);\n\nToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true;\n\nvar ToIndexedSequence = /*@__PURE__*/function (IndexedSeq) {\n function ToIndexedSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n if (IndexedSeq) ToIndexedSequence.__proto__ = IndexedSeq;\n ToIndexedSequence.prototype = Object.create(IndexedSeq && IndexedSeq.prototype);\n ToIndexedSequence.prototype.constructor = ToIndexedSequence;\n\n ToIndexedSequence.prototype.includes = function includes(value) {\n return this._iter.includes(value);\n };\n\n ToIndexedSequence.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n var i = 0;\n reverse && ensureSize(this);\n return this._iter.__iterate(function (v) {\n return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1);\n }, reverse);\n };\n\n ToIndexedSequence.prototype.__iterator = function __iterator(type, reverse) {\n var this$1$1 = this;\n\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n var i = 0;\n reverse && ensureSize(this);\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, reverse ? this$1$1.size - ++i : i++, step.value, step);\n });\n };\n\n return ToIndexedSequence;\n}(IndexedSeq);\n\nvar ToSetSequence = /*@__PURE__*/function (SetSeq) {\n function ToSetSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n if (SetSeq) ToSetSequence.__proto__ = SetSeq;\n ToSetSequence.prototype = Object.create(SetSeq && SetSeq.prototype);\n ToSetSequence.prototype.constructor = ToSetSequence;\n\n ToSetSequence.prototype.has = function has(key) {\n return this._iter.includes(key);\n };\n\n ToSetSequence.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n return this._iter.__iterate(function (v) {\n return fn(v, v, this$1$1);\n }, reverse);\n };\n\n ToSetSequence.prototype.__iterator = function __iterator(type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, step.value, step.value, step);\n });\n };\n\n return ToSetSequence;\n}(SetSeq);\n\nvar FromEntriesSequence = /*@__PURE__*/function (KeyedSeq) {\n function FromEntriesSequence(entries) {\n this._iter = entries;\n this.size = entries.size;\n }\n\n if (KeyedSeq) FromEntriesSequence.__proto__ = KeyedSeq;\n FromEntriesSequence.prototype = Object.create(KeyedSeq && KeyedSeq.prototype);\n FromEntriesSequence.prototype.constructor = FromEntriesSequence;\n\n FromEntriesSequence.prototype.entrySeq = function entrySeq() {\n return this._iter.toSeq();\n };\n\n FromEntriesSequence.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n return this._iter.__iterate(function (entry) {\n // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n if (entry) {\n validateEntry(entry);\n var indexedCollection = isCollection(entry);\n return fn(indexedCollection ? entry.get(1) : entry[1], indexedCollection ? entry.get(0) : entry[0], this$1$1);\n }\n }, reverse);\n };\n\n FromEntriesSequence.prototype.__iterator = function __iterator(type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n return new Iterator(function () {\n while (true) {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value; // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n\n if (entry) {\n validateEntry(entry);\n var indexedCollection = isCollection(entry);\n return iteratorValue(type, indexedCollection ? entry.get(0) : entry[0], indexedCollection ? entry.get(1) : entry[1], step);\n }\n }\n });\n };\n\n return FromEntriesSequence;\n}(KeyedSeq);\n\nToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\nfunction flipFactory(collection) {\n var flipSequence = makeSequence(collection);\n flipSequence._iter = collection;\n flipSequence.size = collection.size;\n\n flipSequence.flip = function () {\n return collection;\n };\n\n flipSequence.reverse = function () {\n var reversedSequence = collection.reverse.apply(this); // super.reverse()\n\n reversedSequence.flip = function () {\n return collection.reverse();\n };\n\n return reversedSequence;\n };\n\n flipSequence.has = function (key) {\n return collection.includes(key);\n };\n\n flipSequence.includes = function (key) {\n return collection.has(key);\n };\n\n flipSequence.cacheResult = cacheResultThrough;\n\n flipSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n return collection.__iterate(function (v, k) {\n return fn(k, v, this$1$1) !== false;\n }, reverse);\n };\n\n flipSequence.__iteratorUncached = function (type, reverse) {\n if (type === ITERATE_ENTRIES) {\n var iterator = collection.__iterator(type, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n\n if (!step.done) {\n var k = step.value[0];\n step.value[0] = step.value[1];\n step.value[1] = k;\n }\n\n return step;\n });\n }\n\n return collection.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n };\n\n return flipSequence;\n}\n\nfunction mapFactory(collection, mapper, context) {\n var mappedSequence = makeSequence(collection);\n mappedSequence.size = collection.size;\n\n mappedSequence.has = function (key) {\n return collection.has(key);\n };\n\n mappedSequence.get = function (key, notSetValue) {\n var v = collection.get(key, NOT_SET);\n return v === NOT_SET ? notSetValue : mapper.call(context, v, key, collection);\n };\n\n mappedSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n return collection.__iterate(function (v, k, c) {\n return fn(mapper.call(context, v, k, c), k, this$1$1) !== false;\n }, reverse);\n };\n\n mappedSequence.__iteratorUncached = function (type, reverse) {\n var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var key = entry[0];\n return iteratorValue(type, key, mapper.call(context, entry[1], key, collection), step);\n });\n };\n\n return mappedSequence;\n}\n\nfunction reverseFactory(collection, useKeys) {\n var this$1$1 = this;\n var reversedSequence = makeSequence(collection);\n reversedSequence._iter = collection;\n reversedSequence.size = collection.size;\n\n reversedSequence.reverse = function () {\n return collection;\n };\n\n if (collection.flip) {\n reversedSequence.flip = function () {\n var flipSequence = flipFactory(collection);\n\n flipSequence.reverse = function () {\n return collection.flip();\n };\n\n return flipSequence;\n };\n }\n\n reversedSequence.get = function (key, notSetValue) {\n return collection.get(useKeys ? key : -1 - key, notSetValue);\n };\n\n reversedSequence.has = function (key) {\n return collection.has(useKeys ? key : -1 - key);\n };\n\n reversedSequence.includes = function (value) {\n return collection.includes(value);\n };\n\n reversedSequence.cacheResult = cacheResultThrough;\n\n reversedSequence.__iterate = function (fn, reverse) {\n var this$1$1 = this;\n var i = 0;\n reverse && ensureSize(collection);\n return collection.__iterate(function (v, k) {\n return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1);\n }, !reverse);\n };\n\n reversedSequence.__iterator = function (type, reverse) {\n var i = 0;\n reverse && ensureSize(collection);\n\n var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n return iteratorValue(type, useKeys ? entry[0] : reverse ? this$1$1.size - ++i : i++, entry[1], step);\n });\n };\n\n return reversedSequence;\n}\n\nfunction filterFactory(collection, predicate, context, useKeys) {\n var filterSequence = makeSequence(collection);\n\n if (useKeys) {\n filterSequence.has = function (key) {\n var v = collection.get(key, NOT_SET);\n return v !== NOT_SET && !!predicate.call(context, v, key, collection);\n };\n\n filterSequence.get = function (key, notSetValue) {\n var v = collection.get(key, NOT_SET);\n return v !== NOT_SET && predicate.call(context, v, key, collection) ? v : notSetValue;\n };\n }\n\n filterSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n var iterations = 0;\n\n collection.__iterate(function (v, k, c) {\n if (predicate.call(context, v, k, c)) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$1$1);\n }\n }, reverse);\n\n return iterations;\n };\n\n filterSequence.__iteratorUncached = function (type, reverse) {\n var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);\n\n var iterations = 0;\n return new Iterator(function () {\n while (true) {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var key = entry[0];\n var value = entry[1];\n\n if (predicate.call(context, value, key, collection)) {\n return iteratorValue(type, useKeys ? key : iterations++, value, step);\n }\n }\n });\n };\n\n return filterSequence;\n}\n\nfunction countByFactory(collection, grouper, context) {\n var groups = Map().asMutable();\n\n collection.__iterate(function (v, k) {\n groups.update(grouper.call(context, v, k, collection), 0, function (a) {\n return a + 1;\n });\n });\n\n return groups.asImmutable();\n}\n\nfunction groupByFactory(collection, grouper, context) {\n var isKeyedIter = isKeyed(collection);\n var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable();\n\n collection.__iterate(function (v, k) {\n groups.update(grouper.call(context, v, k, collection), function (a) {\n return a = a || [], a.push(isKeyedIter ? [k, v] : v), a;\n });\n });\n\n var coerce = collectionClass(collection);\n return groups.map(function (arr) {\n return reify(collection, coerce(arr));\n }).asImmutable();\n}\n\nfunction sliceFactory(collection, begin, end, useKeys) {\n var originalSize = collection.size;\n\n if (wholeSlice(begin, end, originalSize)) {\n return collection;\n }\n\n var resolvedBegin = resolveBegin(begin, originalSize);\n var resolvedEnd = resolveEnd(end, originalSize); // begin or end will be NaN if they were provided as negative numbers and\n // this collection's size is unknown. In that case, cache first so there is\n // a known size and these do not resolve to NaN.\n\n if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys);\n } // Note: resolvedEnd is undefined when the original sequence's length is\n // unknown and this slice did not supply an end and should contain all\n // elements after resolvedBegin.\n // In that case, resolvedSize will be NaN and sliceSize will remain undefined.\n\n\n var resolvedSize = resolvedEnd - resolvedBegin;\n var sliceSize;\n\n if (resolvedSize === resolvedSize) {\n sliceSize = resolvedSize < 0 ? 0 : resolvedSize;\n }\n\n var sliceSeq = makeSequence(collection); // If collection.size is undefined, the size of the realized sliceSeq is\n // unknown at this point unless the number of items to slice is 0\n\n sliceSeq.size = sliceSize === 0 ? sliceSize : collection.size && sliceSize || undefined;\n\n if (!useKeys && isSeq(collection) && sliceSize >= 0) {\n sliceSeq.get = function (index, notSetValue) {\n index = wrapIndex(this, index);\n return index >= 0 && index < sliceSize ? collection.get(index + resolvedBegin, notSetValue) : notSetValue;\n };\n }\n\n sliceSeq.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n\n if (sliceSize === 0) {\n return 0;\n }\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var skipped = 0;\n var isSkipping = true;\n var iterations = 0;\n\n collection.__iterate(function (v, k) {\n if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$1$1) !== false && iterations !== sliceSize;\n }\n });\n\n return iterations;\n };\n\n sliceSeq.__iteratorUncached = function (type, reverse) {\n if (sliceSize !== 0 && reverse) {\n return this.cacheResult().__iterator(type, reverse);\n } // Don't bother instantiating parent iterator if taking 0.\n\n\n if (sliceSize === 0) {\n return new Iterator(iteratorDone);\n }\n\n var iterator = collection.__iterator(type, reverse);\n\n var skipped = 0;\n var iterations = 0;\n return new Iterator(function () {\n while (skipped++ < resolvedBegin) {\n iterator.next();\n }\n\n if (++iterations > sliceSize) {\n return iteratorDone();\n }\n\n var step = iterator.next();\n\n if (useKeys || type === ITERATE_VALUES || step.done) {\n return step;\n }\n\n if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations - 1, undefined, step);\n }\n\n return iteratorValue(type, iterations - 1, step.value[1], step);\n });\n };\n\n return sliceSeq;\n}\n\nfunction takeWhileFactory(collection, predicate, context) {\n var takeSequence = makeSequence(collection);\n\n takeSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var iterations = 0;\n\n collection.__iterate(function (v, k, c) {\n return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1);\n });\n\n return iterations;\n };\n\n takeSequence.__iteratorUncached = function (type, reverse) {\n var this$1$1 = this;\n\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);\n\n var iterating = true;\n return new Iterator(function () {\n if (!iterating) {\n return iteratorDone();\n }\n\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var k = entry[0];\n var v = entry[1];\n\n if (!predicate.call(context, v, k, this$1$1)) {\n iterating = false;\n return iteratorDone();\n }\n\n return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n });\n };\n\n return takeSequence;\n}\n\nfunction skipWhileFactory(collection, predicate, context, useKeys) {\n var skipSequence = makeSequence(collection);\n\n skipSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var isSkipping = true;\n var iterations = 0;\n\n collection.__iterate(function (v, k, c) {\n if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$1$1);\n }\n });\n\n return iterations;\n };\n\n skipSequence.__iteratorUncached = function (type, reverse) {\n var this$1$1 = this;\n\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);\n\n var skipping = true;\n var iterations = 0;\n return new Iterator(function () {\n var step;\n var k;\n var v;\n\n do {\n step = iterator.next();\n\n if (step.done) {\n if (useKeys || type === ITERATE_VALUES) {\n return step;\n }\n\n if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations++, undefined, step);\n }\n\n return iteratorValue(type, iterations++, step.value[1], step);\n }\n\n var entry = step.value;\n k = entry[0];\n v = entry[1];\n skipping && (skipping = predicate.call(context, v, k, this$1$1));\n } while (skipping);\n\n return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n });\n };\n\n return skipSequence;\n}\n\nfunction concatFactory(collection, values) {\n var isKeyedCollection = isKeyed(collection);\n var iters = [collection].concat(values).map(function (v) {\n if (!isCollection(v)) {\n v = isKeyedCollection ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n } else if (isKeyedCollection) {\n v = KeyedCollection(v);\n }\n\n return v;\n }).filter(function (v) {\n return v.size !== 0;\n });\n\n if (iters.length === 0) {\n return collection;\n }\n\n if (iters.length === 1) {\n var singleton = iters[0];\n\n if (singleton === collection || isKeyedCollection && isKeyed(singleton) || isIndexed(collection) && isIndexed(singleton)) {\n return singleton;\n }\n }\n\n var concatSeq = new ArraySeq(iters);\n\n if (isKeyedCollection) {\n concatSeq = concatSeq.toKeyedSeq();\n } else if (!isIndexed(collection)) {\n concatSeq = concatSeq.toSetSeq();\n }\n\n concatSeq = concatSeq.flatten(true);\n concatSeq.size = iters.reduce(function (sum, seq) {\n if (sum !== undefined) {\n var size = seq.size;\n\n if (size !== undefined) {\n return sum + size;\n }\n }\n }, 0);\n return concatSeq;\n}\n\nfunction flattenFactory(collection, depth, useKeys) {\n var flatSequence = makeSequence(collection);\n\n flatSequence.__iterateUncached = function (fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var iterations = 0;\n var stopped = false;\n\n function flatDeep(iter, currentDepth) {\n iter.__iterate(function (v, k) {\n if ((!depth || currentDepth < depth) && isCollection(v)) {\n flatDeep(v, currentDepth + 1);\n } else {\n iterations++;\n\n if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) {\n stopped = true;\n }\n }\n\n return !stopped;\n }, reverse);\n }\n\n flatDeep(collection, 0);\n return iterations;\n };\n\n flatSequence.__iteratorUncached = function (type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = collection.__iterator(type, reverse);\n\n var stack = [];\n var iterations = 0;\n return new Iterator(function () {\n while (iterator) {\n var step = iterator.next();\n\n if (step.done !== false) {\n iterator = stack.pop();\n continue;\n }\n\n var v = step.value;\n\n if (type === ITERATE_ENTRIES) {\n v = v[1];\n }\n\n if ((!depth || stack.length < depth) && isCollection(v)) {\n stack.push(iterator);\n iterator = v.__iterator(type, reverse);\n } else {\n return useKeys ? step : iteratorValue(type, iterations++, v, step);\n }\n }\n\n return iteratorDone();\n });\n };\n\n return flatSequence;\n}\n\nfunction flatMapFactory(collection, mapper, context) {\n var coerce = collectionClass(collection);\n return collection.toSeq().map(function (v, k) {\n return coerce(mapper.call(context, v, k, collection));\n }).flatten(true);\n}\n\nfunction interposeFactory(collection, separator) {\n var interposedSequence = makeSequence(collection);\n interposedSequence.size = collection.size && collection.size * 2 - 1;\n\n interposedSequence.__iterateUncached = function (fn, reverse) {\n var this$1$1 = this;\n var iterations = 0;\n\n collection.__iterate(function (v) {\n return (!iterations || fn(separator, iterations++, this$1$1) !== false) && fn(v, iterations++, this$1$1) !== false;\n }, reverse);\n\n return iterations;\n };\n\n interposedSequence.__iteratorUncached = function (type, reverse) {\n var iterator = collection.__iterator(ITERATE_VALUES, reverse);\n\n var iterations = 0;\n var step;\n return new Iterator(function () {\n if (!step || iterations % 2) {\n step = iterator.next();\n\n if (step.done) {\n return step;\n }\n }\n\n return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n });\n };\n\n return interposedSequence;\n}\n\nfunction sortFactory(collection, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n\n var isKeyedCollection = isKeyed(collection);\n var index = 0;\n var entries = collection.toSeq().map(function (v, k) {\n return [k, v, index++, mapper ? mapper(v, k, collection) : v];\n }).valueSeq().toArray();\n entries.sort(function (a, b) {\n return comparator(a[3], b[3]) || a[2] - b[2];\n }).forEach(isKeyedCollection ? function (v, i) {\n entries[i].length = 2;\n } : function (v, i) {\n entries[i] = v[1];\n });\n return isKeyedCollection ? KeyedSeq(entries) : isIndexed(collection) ? IndexedSeq(entries) : SetSeq(entries);\n}\n\nfunction maxFactory(collection, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n\n if (mapper) {\n var entry = collection.toSeq().map(function (v, k) {\n return [v, mapper(v, k, collection)];\n }).reduce(function (a, b) {\n return maxCompare(comparator, a[1], b[1]) ? b : a;\n });\n return entry && entry[0];\n }\n\n return collection.reduce(function (a, b) {\n return maxCompare(comparator, a, b) ? b : a;\n });\n}\n\nfunction maxCompare(comparator, a, b) {\n var comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but\n // they are not equal and b is in fact a nullish value.\n\n return comp === 0 && b !== a && (b === undefined || b === null || b !== b) || comp > 0;\n}\n\nfunction zipWithFactory(keyIter, zipper, iters, zipAll) {\n var zipSequence = makeSequence(keyIter);\n var sizes = new ArraySeq(iters).map(function (i) {\n return i.size;\n });\n zipSequence.size = zipAll ? sizes.max() : sizes.min(); // Note: this a generic base implementation of __iterate in terms of\n // __iterator which may be more generically useful in the future.\n\n zipSequence.__iterate = function (fn, reverse) {\n /* generic:\n var iterator = this.__iterator(ITERATE_ENTRIES, reverse);\n var step;\n var iterations = 0;\n while (!(step = iterator.next()).done) {\n iterations++;\n if (fn(step.value[1], step.value[0], this) === false) {\n break;\n }\n }\n return iterations;\n */\n // indexed:\n var iterator = this.__iterator(ITERATE_VALUES, reverse);\n\n var step;\n var iterations = 0;\n\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n\n return iterations;\n };\n\n zipSequence.__iteratorUncached = function (type, reverse) {\n var iterators = iters.map(function (i) {\n return i = Collection(i), getIterator(reverse ? i.reverse() : i);\n });\n var iterations = 0;\n var isDone = false;\n return new Iterator(function () {\n var steps;\n\n if (!isDone) {\n steps = iterators.map(function (i) {\n return i.next();\n });\n isDone = zipAll ? steps.every(function (s) {\n return s.done;\n }) : steps.some(function (s) {\n return s.done;\n });\n }\n\n if (isDone) {\n return iteratorDone();\n }\n\n return iteratorValue(type, iterations++, zipper.apply(null, steps.map(function (s) {\n return s.value;\n })));\n });\n };\n\n return zipSequence;\n} // #pragma Helper Functions\n\n\nfunction reify(iter, seq) {\n return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq);\n}\n\nfunction validateEntry(entry) {\n if (entry !== Object(entry)) {\n throw new TypeError('Expected [K, V] tuple: ' + entry);\n }\n}\n\nfunction collectionClass(collection) {\n return isKeyed(collection) ? KeyedCollection : isIndexed(collection) ? IndexedCollection : SetCollection;\n}\n\nfunction makeSequence(collection) {\n return Object.create((isKeyed(collection) ? KeyedSeq : isIndexed(collection) ? IndexedSeq : SetSeq).prototype);\n}\n\nfunction cacheResultThrough() {\n if (this._iter.cacheResult) {\n this._iter.cacheResult();\n\n this.size = this._iter.size;\n return this;\n }\n\n return Seq.prototype.cacheResult.call(this);\n}\n\nfunction defaultComparator(a, b) {\n if (a === undefined && b === undefined) {\n return 0;\n }\n\n if (a === undefined) {\n return 1;\n }\n\n if (b === undefined) {\n return -1;\n }\n\n return a > b ? 1 : a < b ? -1 : 0;\n}\n\nfunction arrCopy(arr, offset) {\n offset = offset || 0;\n var len = Math.max(0, arr.length - offset);\n var newArr = new Array(len);\n\n for (var ii = 0; ii < len; ii++) {\n newArr[ii] = arr[ii + offset];\n }\n\n return newArr;\n}\n\nfunction invariant(condition, error) {\n if (!condition) {\n throw new Error(error);\n }\n}\n\nfunction assertNotInfinite(size) {\n invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n}\n\nfunction coerceKeyPath(keyPath) {\n if (isArrayLike(keyPath) && typeof keyPath !== 'string') {\n return keyPath;\n }\n\n if (isOrdered(keyPath)) {\n return keyPath.toArray();\n }\n\n throw new TypeError('Invalid keyPath: expected Ordered Collection or Array: ' + keyPath);\n}\n\nvar toString = Object.prototype.toString;\n\nfunction isPlainObject(value) {\n // The base prototype's toString deals with Argument objects and native namespaces like Math\n if (!value || _typeof(value) !== 'object' || toString.call(value) !== '[object Object]') {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto === null) {\n return true;\n } // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc)\n\n\n var parentProto = proto;\n var nextProto = Object.getPrototypeOf(proto);\n\n while (nextProto !== null) {\n parentProto = nextProto;\n nextProto = Object.getPrototypeOf(parentProto);\n }\n\n return parentProto === proto;\n}\n/**\n * Returns true if the value is a potentially-persistent data structure, either\n * provided by Immutable.js or a plain Array or Object.\n */\n\n\nfunction isDataStructure(value) {\n return _typeof(value) === 'object' && (isImmutable(value) || Array.isArray(value) || isPlainObject(value));\n}\n\nfunction quoteString(value) {\n try {\n return typeof value === 'string' ? JSON.stringify(value) : String(value);\n } catch (_ignoreError) {\n return JSON.stringify(value);\n }\n}\n\nfunction has(collection, key) {\n return isImmutable(collection) ? collection.has(key) : isDataStructure(collection) && hasOwnProperty.call(collection, key);\n}\n\nfunction get(collection, key, notSetValue) {\n return isImmutable(collection) ? collection.get(key, notSetValue) : !has(collection, key) ? notSetValue : typeof collection.get === 'function' ? collection.get(key) : collection[key];\n}\n\nfunction shallowCopy(from) {\n if (Array.isArray(from)) {\n return arrCopy(from);\n }\n\n var to = {};\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n\n return to;\n}\n\nfunction remove(collection, key) {\n if (!isDataStructure(collection)) {\n throw new TypeError('Cannot update non-data-structure value: ' + collection);\n }\n\n if (isImmutable(collection)) {\n if (!collection.remove) {\n throw new TypeError('Cannot update immutable value without .remove() method: ' + collection);\n }\n\n return collection.remove(key);\n }\n\n if (!hasOwnProperty.call(collection, key)) {\n return collection;\n }\n\n var collectionCopy = shallowCopy(collection);\n\n if (Array.isArray(collectionCopy)) {\n collectionCopy.splice(key, 1);\n } else {\n delete collectionCopy[key];\n }\n\n return collectionCopy;\n}\n\nfunction set(collection, key, value) {\n if (!isDataStructure(collection)) {\n throw new TypeError('Cannot update non-data-structure value: ' + collection);\n }\n\n if (isImmutable(collection)) {\n if (!collection.set) {\n throw new TypeError('Cannot update immutable value without .set() method: ' + collection);\n }\n\n return collection.set(key, value);\n }\n\n if (hasOwnProperty.call(collection, key) && value === collection[key]) {\n return collection;\n }\n\n var collectionCopy = shallowCopy(collection);\n collectionCopy[key] = value;\n return collectionCopy;\n}\n\nfunction updateIn$1(collection, keyPath, notSetValue, updater) {\n if (!updater) {\n updater = notSetValue;\n notSetValue = undefined;\n }\n\n var updatedValue = updateInDeeply(isImmutable(collection), collection, coerceKeyPath(keyPath), 0, notSetValue, updater);\n return updatedValue === NOT_SET ? notSetValue : updatedValue;\n}\n\nfunction updateInDeeply(inImmutable, existing, keyPath, i, notSetValue, updater) {\n var wasNotSet = existing === NOT_SET;\n\n if (i === keyPath.length) {\n var existingValue = wasNotSet ? notSetValue : existing;\n var newValue = updater(existingValue);\n return newValue === existingValue ? existing : newValue;\n }\n\n if (!wasNotSet && !isDataStructure(existing)) {\n throw new TypeError('Cannot update within non-data-structure value in path [' + keyPath.slice(0, i).map(quoteString) + ']: ' + existing);\n }\n\n var key = keyPath[i];\n var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET);\n var nextUpdated = updateInDeeply(nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), nextExisting, keyPath, i + 1, notSetValue, updater);\n return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? remove(existing, key) : set(wasNotSet ? inImmutable ? emptyMap() : {} : existing, key, nextUpdated);\n}\n\nfunction setIn$1(collection, keyPath, value) {\n return updateIn$1(collection, keyPath, NOT_SET, function () {\n return value;\n });\n}\n\nfunction setIn(keyPath, v) {\n return setIn$1(this, keyPath, v);\n}\n\nfunction removeIn(collection, keyPath) {\n return updateIn$1(collection, keyPath, function () {\n return NOT_SET;\n });\n}\n\nfunction deleteIn(keyPath) {\n return removeIn(this, keyPath);\n}\n\nfunction update$1(collection, key, notSetValue, updater) {\n return updateIn$1(collection, [key], notSetValue, updater);\n}\n\nfunction update(key, notSetValue, updater) {\n return arguments.length === 1 ? key(this) : update$1(this, key, notSetValue, updater);\n}\n\nfunction updateIn(keyPath, notSetValue, updater) {\n return updateIn$1(this, keyPath, notSetValue, updater);\n}\n\nfunction merge$1() {\n var iters = [],\n len = arguments.length;\n\n while (len--) {\n iters[len] = arguments[len];\n }\n\n return mergeIntoKeyedWith(this, iters);\n}\n\nfunction mergeWith$1(merger) {\n var iters = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n iters[len] = arguments[len + 1];\n }\n\n if (typeof merger !== 'function') {\n throw new TypeError('Invalid merger function: ' + merger);\n }\n\n return mergeIntoKeyedWith(this, iters, merger);\n}\n\nfunction mergeIntoKeyedWith(collection, collections, merger) {\n var iters = [];\n\n for (var ii = 0; ii < collections.length; ii++) {\n var collection$1 = KeyedCollection(collections[ii]);\n\n if (collection$1.size !== 0) {\n iters.push(collection$1);\n }\n }\n\n if (iters.length === 0) {\n return collection;\n }\n\n if (collection.toSeq().size === 0 && !collection.__ownerID && iters.length === 1) {\n return collection.constructor(iters[0]);\n }\n\n return collection.withMutations(function (collection) {\n var mergeIntoCollection = merger ? function (value, key) {\n update$1(collection, key, NOT_SET, function (oldVal) {\n return oldVal === NOT_SET ? value : merger(oldVal, value, key);\n });\n } : function (value, key) {\n collection.set(key, value);\n };\n\n for (var ii = 0; ii < iters.length; ii++) {\n iters[ii].forEach(mergeIntoCollection);\n }\n });\n}\n\nfunction merge(collection) {\n var sources = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n sources[len] = arguments[len + 1];\n }\n\n return mergeWithSources(collection, sources);\n}\n\nfunction mergeWith(merger, collection) {\n var sources = [],\n len = arguments.length - 2;\n\n while (len-- > 0) {\n sources[len] = arguments[len + 2];\n }\n\n return mergeWithSources(collection, sources, merger);\n}\n\nfunction mergeDeep$1(collection) {\n var sources = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n sources[len] = arguments[len + 1];\n }\n\n return mergeDeepWithSources(collection, sources);\n}\n\nfunction mergeDeepWith$1(merger, collection) {\n var sources = [],\n len = arguments.length - 2;\n\n while (len-- > 0) {\n sources[len] = arguments[len + 2];\n }\n\n return mergeDeepWithSources(collection, sources, merger);\n}\n\nfunction mergeDeepWithSources(collection, sources, merger) {\n return mergeWithSources(collection, sources, deepMergerWith(merger));\n}\n\nfunction mergeWithSources(collection, sources, merger) {\n if (!isDataStructure(collection)) {\n throw new TypeError('Cannot merge into non-data-structure value: ' + collection);\n }\n\n if (isImmutable(collection)) {\n return typeof merger === 'function' && collection.mergeWith ? collection.mergeWith.apply(collection, [merger].concat(sources)) : collection.merge ? collection.merge.apply(collection, sources) : collection.concat.apply(collection, sources);\n }\n\n var isArray = Array.isArray(collection);\n var merged = collection;\n var Collection = isArray ? IndexedCollection : KeyedCollection;\n var mergeItem = isArray ? function (value) {\n // Copy on write\n if (merged === collection) {\n merged = shallowCopy(merged);\n }\n\n merged.push(value);\n } : function (value, key) {\n var hasVal = hasOwnProperty.call(merged, key);\n var nextVal = hasVal && merger ? merger(merged[key], value, key) : value;\n\n if (!hasVal || nextVal !== merged[key]) {\n // Copy on write\n if (merged === collection) {\n merged = shallowCopy(merged);\n }\n\n merged[key] = nextVal;\n }\n };\n\n for (var i = 0; i < sources.length; i++) {\n Collection(sources[i]).forEach(mergeItem);\n }\n\n return merged;\n}\n\nfunction deepMergerWith(merger) {\n function deepMerger(oldValue, newValue, key) {\n return isDataStructure(oldValue) && isDataStructure(newValue) && areMergeable(oldValue, newValue) ? mergeWithSources(oldValue, [newValue], deepMerger) : merger ? merger(oldValue, newValue, key) : newValue;\n }\n\n return deepMerger;\n}\n/**\n * It's unclear what the desired behavior is for merging two collections that\n * fall into separate categories between keyed, indexed, or set-like, so we only\n * consider them mergeable if they fall into the same category.\n */\n\n\nfunction areMergeable(oldDataStructure, newDataStructure) {\n var oldSeq = Seq(oldDataStructure);\n var newSeq = Seq(newDataStructure); // This logic assumes that a sequence can only fall into one of the three\n // categories mentioned above (since there's no `isSetLike()` method).\n\n return isIndexed(oldSeq) === isIndexed(newSeq) && isKeyed(oldSeq) === isKeyed(newSeq);\n}\n\nfunction mergeDeep() {\n var iters = [],\n len = arguments.length;\n\n while (len--) {\n iters[len] = arguments[len];\n }\n\n return mergeDeepWithSources(this, iters);\n}\n\nfunction mergeDeepWith(merger) {\n var iters = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n iters[len] = arguments[len + 1];\n }\n\n return mergeDeepWithSources(this, iters, merger);\n}\n\nfunction mergeIn(keyPath) {\n var iters = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n iters[len] = arguments[len + 1];\n }\n\n return updateIn$1(this, keyPath, emptyMap(), function (m) {\n return mergeWithSources(m, iters);\n });\n}\n\nfunction mergeDeepIn(keyPath) {\n var iters = [],\n len = arguments.length - 1;\n\n while (len-- > 0) {\n iters[len] = arguments[len + 1];\n }\n\n return updateIn$1(this, keyPath, emptyMap(), function (m) {\n return mergeDeepWithSources(m, iters);\n });\n}\n\nfunction withMutations(fn) {\n var mutable = this.asMutable();\n fn(mutable);\n return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n}\n\nfunction asMutable() {\n return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n}\n\nfunction asImmutable() {\n return this.__ensureOwner();\n}\n\nfunction wasAltered() {\n return this.__altered;\n}\n\nvar Map = /*@__PURE__*/function (KeyedCollection) {\n function Map(value) {\n return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function (map) {\n var iter = KeyedCollection(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v, k) {\n return map.set(k, v);\n });\n });\n }\n\n if (KeyedCollection) Map.__proto__ = KeyedCollection;\n Map.prototype = Object.create(KeyedCollection && KeyedCollection.prototype);\n Map.prototype.constructor = Map;\n\n Map.of = function of() {\n var keyValues = [],\n len = arguments.length;\n\n while (len--) {\n keyValues[len] = arguments[len];\n }\n\n return emptyMap().withMutations(function (map) {\n for (var i = 0; i < keyValues.length; i += 2) {\n if (i + 1 >= keyValues.length) {\n throw new Error('Missing value for key: ' + keyValues[i]);\n }\n\n map.set(keyValues[i], keyValues[i + 1]);\n }\n });\n };\n\n Map.prototype.toString = function toString() {\n return this.__toString('Map {', '}');\n }; // @pragma Access\n\n\n Map.prototype.get = function get(k, notSetValue) {\n return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;\n }; // @pragma Modification\n\n\n Map.prototype.set = function set(k, v) {\n return updateMap(this, k, v);\n };\n\n Map.prototype.remove = function remove(k) {\n return updateMap(this, k, NOT_SET);\n };\n\n Map.prototype.deleteAll = function deleteAll(keys) {\n var collection = Collection(keys);\n\n if (collection.size === 0) {\n return this;\n }\n\n return this.withMutations(function (map) {\n collection.forEach(function (key) {\n return map.remove(key);\n });\n });\n };\n\n Map.prototype.clear = function clear() {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n this._root = null;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyMap();\n }; // @pragma Composition\n\n\n Map.prototype.sort = function sort(comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator));\n };\n\n Map.prototype.sortBy = function sortBy(mapper, comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator, mapper));\n };\n\n Map.prototype.map = function map(mapper, context) {\n var this$1$1 = this;\n return this.withMutations(function (map) {\n map.forEach(function (value, key) {\n map.set(key, mapper.call(context, value, key, this$1$1));\n });\n });\n }; // @pragma Mutability\n\n\n Map.prototype.__iterator = function __iterator(type, reverse) {\n return new MapIterator(this, type, reverse);\n };\n\n Map.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n var iterations = 0;\n this._root && this._root.iterate(function (entry) {\n iterations++;\n return fn(entry[1], entry[0], this$1$1);\n }, reverse);\n return iterations;\n };\n\n Map.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n if (this.size === 0) {\n return emptyMap();\n }\n\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n\n return makeMap(this.size, this._root, ownerID, this.__hash);\n };\n\n return Map;\n}(KeyedCollection);\n\nMap.isMap = isMap;\nvar MapPrototype = Map.prototype;\nMapPrototype[IS_MAP_SYMBOL] = true;\nMapPrototype[DELETE] = MapPrototype.remove;\nMapPrototype.removeAll = MapPrototype.deleteAll;\nMapPrototype.setIn = setIn;\nMapPrototype.removeIn = MapPrototype.deleteIn = deleteIn;\nMapPrototype.update = update;\nMapPrototype.updateIn = updateIn;\nMapPrototype.merge = MapPrototype.concat = merge$1;\nMapPrototype.mergeWith = mergeWith$1;\nMapPrototype.mergeDeep = mergeDeep;\nMapPrototype.mergeDeepWith = mergeDeepWith;\nMapPrototype.mergeIn = mergeIn;\nMapPrototype.mergeDeepIn = mergeDeepIn;\nMapPrototype.withMutations = withMutations;\nMapPrototype.wasAltered = wasAltered;\nMapPrototype.asImmutable = asImmutable;\nMapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable;\n\nMapPrototype['@@transducer/step'] = function (result, arr) {\n return result.set(arr[0], arr[1]);\n};\n\nMapPrototype['@@transducer/result'] = function (obj) {\n return obj.asImmutable();\n}; // #pragma Trie Nodes\n\n\nvar ArrayMapNode = function ArrayMapNode(ownerID, entries) {\n this.ownerID = ownerID;\n this.entries = entries;\n};\n\nArrayMapNode.prototype.get = function get(shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n\n return notSetValue;\n};\n\nArrayMapNode.prototype.update = function update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n var entries = this.entries;\n var idx = 0;\n var len = entries.length;\n\n for (; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && entries.length === 1) {\n return; // undefined\n }\n\n if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n return createNodes(ownerID, entries, key, value);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new ArrayMapNode(ownerID, newEntries);\n};\n\nvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n this.ownerID = ownerID;\n this.bitmap = bitmap;\n this.nodes = nodes;\n};\n\nBitmapIndexedNode.prototype.get = function get(shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK);\n var bitmap = this.bitmap;\n return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue);\n};\n\nBitmapIndexedNode.prototype.update = function update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var bit = 1 << keyHashFrag;\n var bitmap = this.bitmap;\n var exists = (bitmap & bit) !== 0;\n\n if (!exists && value === NOT_SET) {\n return this;\n }\n\n var idx = popCount(bitmap & bit - 1);\n var nodes = this.nodes;\n var node = exists ? nodes[idx] : undefined;\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n if (newNode === node) {\n return this;\n }\n\n if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n }\n\n if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n return nodes[idx ^ 1];\n }\n\n if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n return newNode;\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n var newNodes = exists ? newNode ? setAt(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.bitmap = newBitmap;\n this.nodes = newNodes;\n return this;\n }\n\n return new BitmapIndexedNode(ownerID, newBitmap, newNodes);\n};\n\nvar HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) {\n this.ownerID = ownerID;\n this.count = count;\n this.nodes = nodes;\n};\n\nHashArrayMapNode.prototype.get = function get(shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var node = this.nodes[idx];\n return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n};\n\nHashArrayMapNode.prototype.update = function update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var removed = value === NOT_SET;\n var nodes = this.nodes;\n var node = nodes[idx];\n\n if (removed && !node) {\n return this;\n }\n\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n if (newNode === node) {\n return this;\n }\n\n var newCount = this.count;\n\n if (!node) {\n newCount++;\n } else if (!newNode) {\n newCount--;\n\n if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n return packNodes(ownerID, nodes, newCount, idx);\n }\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newNodes = setAt(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.count = newCount;\n this.nodes = newNodes;\n return this;\n }\n\n return new HashArrayMapNode(ownerID, newCount, newNodes);\n};\n\nvar HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entries = entries;\n};\n\nHashCollisionNode.prototype.get = function get(shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n\n return notSetValue;\n};\n\nHashCollisionNode.prototype.update = function update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var removed = value === NOT_SET;\n\n if (keyHash !== this.keyHash) {\n if (removed) {\n return this;\n }\n\n SetRef(didAlter);\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n }\n\n var entries = this.entries;\n var idx = 0;\n var len = entries.length;\n\n for (; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && len === 2) {\n return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new HashCollisionNode(ownerID, this.keyHash, newEntries);\n};\n\nvar ValueNode = function ValueNode(ownerID, keyHash, entry) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entry = entry;\n};\n\nValueNode.prototype.get = function get(shift, keyHash, key, notSetValue) {\n return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n};\n\nValueNode.prototype.update = function update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n var keyMatch = is(key, this.entry[0]);\n\n if (keyMatch ? value === this.entry[1] : removed) {\n return this;\n }\n\n SetRef(didAlter);\n\n if (removed) {\n SetRef(didChangeSize);\n return; // undefined\n }\n\n if (keyMatch) {\n if (ownerID && ownerID === this.ownerID) {\n this.entry[1] = value;\n return this;\n }\n\n return new ValueNode(ownerID, this.keyHash, [key, value]);\n }\n\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n}; // #pragma Iterators\n\n\nArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) {\n var entries = this.entries;\n\n for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n return false;\n }\n }\n};\n\nBitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) {\n var nodes = this.nodes;\n\n for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n var node = nodes[reverse ? maxIndex - ii : ii];\n\n if (node && node.iterate(fn, reverse) === false) {\n return false;\n }\n }\n}; // eslint-disable-next-line no-unused-vars\n\n\nValueNode.prototype.iterate = function (fn, reverse) {\n return fn(this.entry);\n};\n\nvar MapIterator = /*@__PURE__*/function (Iterator) {\n function MapIterator(map, type, reverse) {\n this._type = type;\n this._reverse = reverse;\n this._stack = map._root && mapIteratorFrame(map._root);\n }\n\n if (Iterator) MapIterator.__proto__ = Iterator;\n MapIterator.prototype = Object.create(Iterator && Iterator.prototype);\n MapIterator.prototype.constructor = MapIterator;\n\n MapIterator.prototype.next = function next() {\n var type = this._type;\n var stack = this._stack;\n\n while (stack) {\n var node = stack.node;\n var index = stack.index++;\n var maxIndex = void 0;\n\n if (node.entry) {\n if (index === 0) {\n return mapIteratorValue(type, node.entry);\n }\n } else if (node.entries) {\n maxIndex = node.entries.length - 1;\n\n if (index <= maxIndex) {\n return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n }\n } else {\n maxIndex = node.nodes.length - 1;\n\n if (index <= maxIndex) {\n var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\n if (subNode) {\n if (subNode.entry) {\n return mapIteratorValue(type, subNode.entry);\n }\n\n stack = this._stack = mapIteratorFrame(subNode, stack);\n }\n\n continue;\n }\n }\n\n stack = this._stack = this._stack.__prev;\n }\n\n return iteratorDone();\n };\n\n return MapIterator;\n}(Iterator);\n\nfunction mapIteratorValue(type, entry) {\n return iteratorValue(type, entry[0], entry[1]);\n}\n\nfunction mapIteratorFrame(node, prev) {\n return {\n node: node,\n index: 0,\n __prev: prev\n };\n}\n\nfunction makeMap(size, root, ownerID, hash) {\n var map = Object.create(MapPrototype);\n map.size = size;\n map._root = root;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n}\n\nvar EMPTY_MAP;\n\nfunction emptyMap() {\n return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n}\n\nfunction updateMap(map, k, v) {\n var newRoot;\n var newSize;\n\n if (!map._root) {\n if (v === NOT_SET) {\n return map;\n }\n\n newSize = 1;\n newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n } else {\n var didChangeSize = MakeRef();\n var didAlter = MakeRef();\n newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n\n if (!didAlter.value) {\n return map;\n }\n\n newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n }\n\n if (map.__ownerID) {\n map.size = newSize;\n map._root = newRoot;\n map.__hash = undefined;\n map.__altered = true;\n return map;\n }\n\n return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n}\n\nfunction updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (!node) {\n if (value === NOT_SET) {\n return node;\n }\n\n SetRef(didAlter);\n SetRef(didChangeSize);\n return new ValueNode(ownerID, keyHash, [key, value]);\n }\n\n return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n}\n\nfunction isLeafNode(node) {\n return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n}\n\nfunction mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n if (node.keyHash === keyHash) {\n return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n }\n\n var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var newNode;\n var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : (newNode = new ValueNode(ownerID, keyHash, entry), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes);\n}\n\nfunction createNodes(ownerID, entries, key, value) {\n if (!ownerID) {\n ownerID = new OwnerID();\n }\n\n var node = new ValueNode(ownerID, hash(key), [key, value]);\n\n for (var ii = 0; ii < entries.length; ii++) {\n var entry = entries[ii];\n node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n }\n\n return node;\n}\n\nfunction packNodes(ownerID, nodes, count, excluding) {\n var bitmap = 0;\n var packedII = 0;\n var packedNodes = new Array(count);\n\n for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {\n var node = nodes[ii];\n\n if (node !== undefined && ii !== excluding) {\n bitmap |= bit;\n packedNodes[packedII++] = node;\n }\n }\n\n return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n}\n\nfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n var count = 0;\n var expandedNodes = new Array(SIZE);\n\n for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n }\n\n expandedNodes[including] = node;\n return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n}\n\nfunction popCount(x) {\n x -= x >> 1 & 0x55555555;\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x += x >> 8;\n x += x >> 16;\n return x & 0x7f;\n}\n\nfunction setAt(array, idx, val, canEdit) {\n var newArray = canEdit ? array : arrCopy(array);\n newArray[idx] = val;\n return newArray;\n}\n\nfunction spliceIn(array, idx, val, canEdit) {\n var newLen = array.length + 1;\n\n if (canEdit && idx + 1 === newLen) {\n array[idx] = val;\n return array;\n }\n\n var newArray = new Array(newLen);\n var after = 0;\n\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n newArray[ii] = val;\n after = -1;\n } else {\n newArray[ii] = array[ii + after];\n }\n }\n\n return newArray;\n}\n\nfunction spliceOut(array, idx, canEdit) {\n var newLen = array.length - 1;\n\n if (canEdit && idx === newLen) {\n array.pop();\n return array;\n }\n\n var newArray = new Array(newLen);\n var after = 0;\n\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n after = 1;\n }\n\n newArray[ii] = array[ii + after];\n }\n\n return newArray;\n}\n\nvar MAX_ARRAY_MAP_SIZE = SIZE / 4;\nvar MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\nvar MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\nvar IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@';\n\nfunction isList(maybeList) {\n return Boolean(maybeList && maybeList[IS_LIST_SYMBOL]);\n}\n\nvar List = /*@__PURE__*/function (IndexedCollection) {\n function List(value) {\n var empty = emptyList();\n\n if (value === null || value === undefined) {\n return empty;\n }\n\n if (isList(value)) {\n return value;\n }\n\n var iter = IndexedCollection(value);\n var size = iter.size;\n\n if (size === 0) {\n return empty;\n }\n\n assertNotInfinite(size);\n\n if (size > 0 && size < SIZE) {\n return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n }\n\n return empty.withMutations(function (list) {\n list.setSize(size);\n iter.forEach(function (v, i) {\n return list.set(i, v);\n });\n });\n }\n\n if (IndexedCollection) List.__proto__ = IndexedCollection;\n List.prototype = Object.create(IndexedCollection && IndexedCollection.prototype);\n List.prototype.constructor = List;\n\n List.of = function\n /*...values*/\n of() {\n return this(arguments);\n };\n\n List.prototype.toString = function toString() {\n return this.__toString('List [', ']');\n }; // @pragma Access\n\n\n List.prototype.get = function get(index, notSetValue) {\n index = wrapIndex(this, index);\n\n if (index >= 0 && index < this.size) {\n index += this._origin;\n var node = listNodeFor(this, index);\n return node && node.array[index & MASK];\n }\n\n return notSetValue;\n }; // @pragma Modification\n\n\n List.prototype.set = function set(index, value) {\n return updateList(this, index, value);\n };\n\n List.prototype.remove = function remove(index) {\n return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n };\n\n List.prototype.insert = function insert(index, value) {\n return this.splice(index, 0, value);\n };\n\n List.prototype.clear = function clear() {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = this._origin = this._capacity = 0;\n this._level = SHIFT;\n this._root = this._tail = this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyList();\n };\n\n List.prototype.push = function\n /*...values*/\n push() {\n var values = arguments;\n var oldSize = this.size;\n return this.withMutations(function (list) {\n setListBounds(list, 0, oldSize + values.length);\n\n for (var ii = 0; ii < values.length; ii++) {\n list.set(oldSize + ii, values[ii]);\n }\n });\n };\n\n List.prototype.pop = function pop() {\n return setListBounds(this, 0, -1);\n };\n\n List.prototype.unshift = function\n /*...values*/\n unshift() {\n var values = arguments;\n return this.withMutations(function (list) {\n setListBounds(list, -values.length);\n\n for (var ii = 0; ii < values.length; ii++) {\n list.set(ii, values[ii]);\n }\n });\n };\n\n List.prototype.shift = function shift() {\n return setListBounds(this, 1);\n }; // @pragma Composition\n\n\n List.prototype.concat = function\n /*...collections*/\n concat() {\n var arguments$1 = arguments;\n var seqs = [];\n\n for (var i = 0; i < arguments.length; i++) {\n var argument = arguments$1[i];\n var seq = IndexedCollection(typeof argument !== 'string' && hasIterator(argument) ? argument : [argument]);\n\n if (seq.size !== 0) {\n seqs.push(seq);\n }\n }\n\n if (seqs.length === 0) {\n return this;\n }\n\n if (this.size === 0 && !this.__ownerID && seqs.length === 1) {\n return this.constructor(seqs[0]);\n }\n\n return this.withMutations(function (list) {\n seqs.forEach(function (seq) {\n return seq.forEach(function (value) {\n return list.push(value);\n });\n });\n });\n };\n\n List.prototype.setSize = function setSize(size) {\n return setListBounds(this, 0, size);\n };\n\n List.prototype.map = function map(mapper, context) {\n var this$1$1 = this;\n return this.withMutations(function (list) {\n for (var i = 0; i < this$1$1.size; i++) {\n list.set(i, mapper.call(context, list.get(i), i, this$1$1));\n }\n });\n }; // @pragma Iteration\n\n\n List.prototype.slice = function slice(begin, end) {\n var size = this.size;\n\n if (wholeSlice(begin, end, size)) {\n return this;\n }\n\n return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n };\n\n List.prototype.__iterator = function __iterator(type, reverse) {\n var index = reverse ? this.size : 0;\n var values = iterateList(this, reverse);\n return new Iterator(function () {\n var value = values();\n return value === DONE ? iteratorDone() : iteratorValue(type, reverse ? --index : index++, value);\n });\n };\n\n List.prototype.__iterate = function __iterate(fn, reverse) {\n var index = reverse ? this.size : 0;\n var values = iterateList(this, reverse);\n var value;\n\n while ((value = values()) !== DONE) {\n if (fn(value, reverse ? --index : index++, this) === false) {\n break;\n }\n }\n\n return index;\n };\n\n List.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n if (this.size === 0) {\n return emptyList();\n }\n\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n\n return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n };\n\n return List;\n}(IndexedCollection);\n\nList.isList = isList;\nvar ListPrototype = List.prototype;\nListPrototype[IS_LIST_SYMBOL] = true;\nListPrototype[DELETE] = ListPrototype.remove;\nListPrototype.merge = ListPrototype.concat;\nListPrototype.setIn = setIn;\nListPrototype.deleteIn = ListPrototype.removeIn = deleteIn;\nListPrototype.update = update;\nListPrototype.updateIn = updateIn;\nListPrototype.mergeIn = mergeIn;\nListPrototype.mergeDeepIn = mergeDeepIn;\nListPrototype.withMutations = withMutations;\nListPrototype.wasAltered = wasAltered;\nListPrototype.asImmutable = asImmutable;\nListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable;\n\nListPrototype['@@transducer/step'] = function (result, arr) {\n return result.push(arr);\n};\n\nListPrototype['@@transducer/result'] = function (obj) {\n return obj.asImmutable();\n};\n\nvar VNode = function VNode(array, ownerID) {\n this.array = array;\n this.ownerID = ownerID;\n}; // TODO: seems like these methods are very similar\n\n\nVNode.prototype.removeBefore = function removeBefore(ownerID, level, index) {\n if (index === level ? 1 << level : this.array.length === 0) {\n return this;\n }\n\n var originIndex = index >>> level & MASK;\n\n if (originIndex >= this.array.length) {\n return new VNode([], ownerID);\n }\n\n var removingFirst = originIndex === 0;\n var newChild;\n\n if (level > 0) {\n var oldChild = this.array[originIndex];\n newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\n if (newChild === oldChild && removingFirst) {\n return this;\n }\n }\n\n if (removingFirst && !newChild) {\n return this;\n }\n\n var editable = editableVNode(this, ownerID);\n\n if (!removingFirst) {\n for (var ii = 0; ii < originIndex; ii++) {\n editable.array[ii] = undefined;\n }\n }\n\n if (newChild) {\n editable.array[originIndex] = newChild;\n }\n\n return editable;\n};\n\nVNode.prototype.removeAfter = function removeAfter(ownerID, level, index) {\n if (index === (level ? 1 << level : 0) || this.array.length === 0) {\n return this;\n }\n\n var sizeIndex = index - 1 >>> level & MASK;\n\n if (sizeIndex >= this.array.length) {\n return this;\n }\n\n var newChild;\n\n if (level > 0) {\n var oldChild = this.array[sizeIndex];\n newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\n if (newChild === oldChild && sizeIndex === this.array.length - 1) {\n return this;\n }\n }\n\n var editable = editableVNode(this, ownerID);\n editable.array.splice(sizeIndex + 1);\n\n if (newChild) {\n editable.array[sizeIndex] = newChild;\n }\n\n return editable;\n};\n\nvar DONE = {};\n\nfunction iterateList(list, reverse) {\n var left = list._origin;\n var right = list._capacity;\n var tailPos = getTailOffset(right);\n var tail = list._tail;\n return iterateNodeOrLeaf(list._root, list._level, 0);\n\n function iterateNodeOrLeaf(node, level, offset) {\n return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset);\n }\n\n function iterateLeaf(node, offset) {\n var array = offset === tailPos ? tail && tail.array : node && node.array;\n var from = offset > left ? 0 : left - offset;\n var to = right - offset;\n\n if (to > SIZE) {\n to = SIZE;\n }\n\n return function () {\n if (from === to) {\n return DONE;\n }\n\n var idx = reverse ? --to : from++;\n return array && array[idx];\n };\n }\n\n function iterateNode(node, level, offset) {\n var values;\n var array = node && node.array;\n var from = offset > left ? 0 : left - offset >> level;\n var to = (right - offset >> level) + 1;\n\n if (to > SIZE) {\n to = SIZE;\n }\n\n return function () {\n while (true) {\n if (values) {\n var value = values();\n\n if (value !== DONE) {\n return value;\n }\n\n values = null;\n }\n\n if (from === to) {\n return DONE;\n }\n\n var idx = reverse ? --to : from++;\n values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));\n }\n };\n }\n}\n\nfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n var list = Object.create(ListPrototype);\n list.size = capacity - origin;\n list._origin = origin;\n list._capacity = capacity;\n list._level = level;\n list._root = root;\n list._tail = tail;\n list.__ownerID = ownerID;\n list.__hash = hash;\n list.__altered = false;\n return list;\n}\n\nvar EMPTY_LIST;\n\nfunction emptyList() {\n return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n}\n\nfunction updateList(list, index, value) {\n index = wrapIndex(list, index);\n\n if (index !== index) {\n return list;\n }\n\n if (index >= list.size || index < 0) {\n return list.withMutations(function (list) {\n index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n });\n }\n\n index += list._origin;\n var newTail = list._tail;\n var newRoot = list._root;\n var didAlter = MakeRef();\n\n if (index >= getTailOffset(list._capacity)) {\n newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n } else {\n newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n }\n\n if (!didAlter.value) {\n return list;\n }\n\n if (list.__ownerID) {\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n\n return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n}\n\nfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n var idx = index >>> level & MASK;\n var nodeHas = node && idx < node.array.length;\n\n if (!nodeHas && value === undefined) {\n return node;\n }\n\n var newNode;\n\n if (level > 0) {\n var lowerNode = node && node.array[idx];\n var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\n if (newLowerNode === lowerNode) {\n return node;\n }\n\n newNode = editableVNode(node, ownerID);\n newNode.array[idx] = newLowerNode;\n return newNode;\n }\n\n if (nodeHas && node.array[idx] === value) {\n return node;\n }\n\n if (didAlter) {\n SetRef(didAlter);\n }\n\n newNode = editableVNode(node, ownerID);\n\n if (value === undefined && idx === newNode.array.length - 1) {\n newNode.array.pop();\n } else {\n newNode.array[idx] = value;\n }\n\n return newNode;\n}\n\nfunction editableVNode(node, ownerID) {\n if (ownerID && node && ownerID === node.ownerID) {\n return node;\n }\n\n return new VNode(node ? node.array.slice() : [], ownerID);\n}\n\nfunction listNodeFor(list, rawIndex) {\n if (rawIndex >= getTailOffset(list._capacity)) {\n return list._tail;\n }\n\n if (rawIndex < 1 << list._level + SHIFT) {\n var node = list._root;\n var level = list._level;\n\n while (node && level > 0) {\n node = node.array[rawIndex >>> level & MASK];\n level -= SHIFT;\n }\n\n return node;\n }\n}\n\nfunction setListBounds(list, begin, end) {\n // Sanitize begin & end using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n if (begin !== undefined) {\n begin |= 0;\n }\n\n if (end !== undefined) {\n end |= 0;\n }\n\n var owner = list.__ownerID || new OwnerID();\n var oldOrigin = list._origin;\n var oldCapacity = list._capacity;\n var newOrigin = oldOrigin + begin;\n var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\n if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n return list;\n } // If it's going to end after it starts, it's empty.\n\n\n if (newOrigin >= newCapacity) {\n return list.clear();\n }\n\n var newLevel = list._level;\n var newRoot = list._root; // New origin might need creating a higher root.\n\n var offsetShift = 0;\n\n while (newOrigin + offsetShift < 0) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n newLevel += SHIFT;\n offsetShift += 1 << newLevel;\n }\n\n if (offsetShift) {\n newOrigin += offsetShift;\n oldOrigin += offsetShift;\n newCapacity += offsetShift;\n oldCapacity += offsetShift;\n }\n\n var oldTailOffset = getTailOffset(oldCapacity);\n var newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root.\n\n while (newTailOffset >= 1 << newLevel + SHIFT) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n newLevel += SHIFT;\n } // Locate or create the new tail.\n\n\n var oldTail = list._tail;\n var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; // Merge Tail into tree.\n\n if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n newRoot = editableVNode(newRoot, owner);\n var node = newRoot;\n\n for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n var idx = oldTailOffset >>> level & MASK;\n node = node.array[idx] = editableVNode(node.array[idx], owner);\n }\n\n node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;\n } // If the size has been reduced, there's a chance the tail needs to be trimmed.\n\n\n if (newCapacity < oldCapacity) {\n newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n } // If the new origin is within the tail, then we do not need a root.\n\n\n if (newOrigin >= newTailOffset) {\n newOrigin -= newTailOffset;\n newCapacity -= newTailOffset;\n newLevel = SHIFT;\n newRoot = null;\n newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); // Otherwise, if the root has been trimmed, garbage collect.\n } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n offsetShift = 0; // Identify the new top root node of the subtree of the old root.\n\n while (newRoot) {\n var beginIndex = newOrigin >>> newLevel & MASK;\n\n if (beginIndex !== newTailOffset >>> newLevel & MASK) {\n break;\n }\n\n if (beginIndex) {\n offsetShift += (1 << newLevel) * beginIndex;\n }\n\n newLevel -= SHIFT;\n newRoot = newRoot.array[beginIndex];\n } // Trim the new sides of the new root.\n\n\n if (newRoot && newOrigin > oldOrigin) {\n newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n }\n\n if (newRoot && newTailOffset < oldTailOffset) {\n newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n }\n\n if (offsetShift) {\n newOrigin -= offsetShift;\n newCapacity -= offsetShift;\n }\n }\n\n if (list.__ownerID) {\n list.size = newCapacity - newOrigin;\n list._origin = newOrigin;\n list._capacity = newCapacity;\n list._level = newLevel;\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n\n return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n}\n\nfunction getTailOffset(size) {\n return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT;\n}\n\nvar OrderedMap = /*@__PURE__*/function (Map) {\n function OrderedMap(value) {\n return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function (map) {\n var iter = KeyedCollection(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v, k) {\n return map.set(k, v);\n });\n });\n }\n\n if (Map) OrderedMap.__proto__ = Map;\n OrderedMap.prototype = Object.create(Map && Map.prototype);\n OrderedMap.prototype.constructor = OrderedMap;\n\n OrderedMap.of = function\n /*...values*/\n of() {\n return this(arguments);\n };\n\n OrderedMap.prototype.toString = function toString() {\n return this.__toString('OrderedMap {', '}');\n }; // @pragma Access\n\n\n OrderedMap.prototype.get = function get(k, notSetValue) {\n var index = this._map.get(k);\n\n return index !== undefined ? this._list.get(index)[1] : notSetValue;\n }; // @pragma Modification\n\n\n OrderedMap.prototype.clear = function clear() {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n\n this._map.clear();\n\n this._list.clear();\n\n this.__altered = true;\n return this;\n }\n\n return emptyOrderedMap();\n };\n\n OrderedMap.prototype.set = function set(k, v) {\n return updateOrderedMap(this, k, v);\n };\n\n OrderedMap.prototype.remove = function remove(k) {\n return updateOrderedMap(this, k, NOT_SET);\n };\n\n OrderedMap.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n return this._list.__iterate(function (entry) {\n return entry && fn(entry[1], entry[0], this$1$1);\n }, reverse);\n };\n\n OrderedMap.prototype.__iterator = function __iterator(type, reverse) {\n return this._list.fromEntrySeq().__iterator(type, reverse);\n };\n\n OrderedMap.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newMap = this._map.__ensureOwner(ownerID);\n\n var newList = this._list.__ensureOwner(ownerID);\n\n if (!ownerID) {\n if (this.size === 0) {\n return emptyOrderedMap();\n }\n\n this.__ownerID = ownerID;\n this.__altered = false;\n this._map = newMap;\n this._list = newList;\n return this;\n }\n\n return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n };\n\n return OrderedMap;\n}(Map);\n\nOrderedMap.isOrderedMap = isOrderedMap;\nOrderedMap.prototype[IS_ORDERED_SYMBOL] = true;\nOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\nfunction makeOrderedMap(map, list, ownerID, hash) {\n var omap = Object.create(OrderedMap.prototype);\n omap.size = map ? map.size : 0;\n omap._map = map;\n omap._list = list;\n omap.__ownerID = ownerID;\n omap.__hash = hash;\n omap.__altered = false;\n return omap;\n}\n\nvar EMPTY_ORDERED_MAP;\n\nfunction emptyOrderedMap() {\n return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n}\n\nfunction updateOrderedMap(omap, k, v) {\n var map = omap._map;\n var list = omap._list;\n var i = map.get(k);\n var has = i !== undefined;\n var newMap;\n var newList;\n\n if (v === NOT_SET) {\n // removed\n if (!has) {\n return omap;\n }\n\n if (list.size >= SIZE && list.size >= map.size * 2) {\n newList = list.filter(function (entry, idx) {\n return entry !== undefined && i !== idx;\n });\n newMap = newList.toKeyedSeq().map(function (entry) {\n return entry[0];\n }).flip().toMap();\n\n if (omap.__ownerID) {\n newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n }\n } else {\n newMap = map.remove(k);\n newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n }\n } else if (has) {\n if (v === list.get(i)[1]) {\n return omap;\n }\n\n newMap = map;\n newList = list.set(i, [k, v]);\n } else {\n newMap = map.set(k, list.size);\n newList = list.set(list.size, [k, v]);\n }\n\n if (omap.__ownerID) {\n omap.size = newMap.size;\n omap._map = newMap;\n omap._list = newList;\n omap.__hash = undefined;\n omap.__altered = true;\n return omap;\n }\n\n return makeOrderedMap(newMap, newList);\n}\n\nvar IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@';\n\nfunction isStack(maybeStack) {\n return Boolean(maybeStack && maybeStack[IS_STACK_SYMBOL]);\n}\n\nvar Stack = /*@__PURE__*/function (IndexedCollection) {\n function Stack(value) {\n return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().pushAll(value);\n }\n\n if (IndexedCollection) Stack.__proto__ = IndexedCollection;\n Stack.prototype = Object.create(IndexedCollection && IndexedCollection.prototype);\n Stack.prototype.constructor = Stack;\n\n Stack.of = function\n /*...values*/\n of() {\n return this(arguments);\n };\n\n Stack.prototype.toString = function toString() {\n return this.__toString('Stack [', ']');\n }; // @pragma Access\n\n\n Stack.prototype.get = function get(index, notSetValue) {\n var head = this._head;\n index = wrapIndex(this, index);\n\n while (head && index--) {\n head = head.next;\n }\n\n return head ? head.value : notSetValue;\n };\n\n Stack.prototype.peek = function peek() {\n return this._head && this._head.value;\n }; // @pragma Modification\n\n\n Stack.prototype.push = function\n /*...values*/\n push() {\n var arguments$1 = arguments;\n\n if (arguments.length === 0) {\n return this;\n }\n\n var newSize = this.size + arguments.length;\n var head = this._head;\n\n for (var ii = arguments.length - 1; ii >= 0; ii--) {\n head = {\n value: arguments$1[ii],\n next: head\n };\n }\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pushAll = function pushAll(iter) {\n iter = IndexedCollection(iter);\n\n if (iter.size === 0) {\n return this;\n }\n\n if (this.size === 0 && isStack(iter)) {\n return iter;\n }\n\n assertNotInfinite(iter.size);\n var newSize = this.size;\n var head = this._head;\n\n iter.__iterate(function (value) {\n newSize++;\n head = {\n value: value,\n next: head\n };\n },\n /* reverse */\n true);\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pop = function pop() {\n return this.slice(1);\n };\n\n Stack.prototype.clear = function clear() {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n this._head = undefined;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyStack();\n };\n\n Stack.prototype.slice = function slice(begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n\n var resolvedBegin = resolveBegin(begin, this.size);\n var resolvedEnd = resolveEnd(end, this.size);\n\n if (resolvedEnd !== this.size) {\n // super.slice(begin, end);\n return IndexedCollection.prototype.slice.call(this, begin, end);\n }\n\n var newSize = this.size - resolvedBegin;\n var head = this._head;\n\n while (resolvedBegin--) {\n head = head.next;\n }\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n }; // @pragma Mutability\n\n\n Stack.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n if (this.size === 0) {\n return emptyStack();\n }\n\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n\n return makeStack(this.size, this._head, ownerID, this.__hash);\n }; // @pragma Iteration\n\n\n Stack.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n\n if (reverse) {\n return new ArraySeq(this.toArray()).__iterate(function (v, k) {\n return fn(v, k, this$1$1);\n }, reverse);\n }\n\n var iterations = 0;\n var node = this._head;\n\n while (node) {\n if (fn(node.value, iterations++, this) === false) {\n break;\n }\n\n node = node.next;\n }\n\n return iterations;\n };\n\n Stack.prototype.__iterator = function __iterator(type, reverse) {\n if (reverse) {\n return new ArraySeq(this.toArray()).__iterator(type, reverse);\n }\n\n var iterations = 0;\n var node = this._head;\n return new Iterator(function () {\n if (node) {\n var value = node.value;\n node = node.next;\n return iteratorValue(type, iterations++, value);\n }\n\n return iteratorDone();\n });\n };\n\n return Stack;\n}(IndexedCollection);\n\nStack.isStack = isStack;\nvar StackPrototype = Stack.prototype;\nStackPrototype[IS_STACK_SYMBOL] = true;\nStackPrototype.shift = StackPrototype.pop;\nStackPrototype.unshift = StackPrototype.push;\nStackPrototype.unshiftAll = StackPrototype.pushAll;\nStackPrototype.withMutations = withMutations;\nStackPrototype.wasAltered = wasAltered;\nStackPrototype.asImmutable = asImmutable;\nStackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable;\n\nStackPrototype['@@transducer/step'] = function (result, arr) {\n return result.unshift(arr);\n};\n\nStackPrototype['@@transducer/result'] = function (obj) {\n return obj.asImmutable();\n};\n\nfunction makeStack(size, head, ownerID, hash) {\n var map = Object.create(StackPrototype);\n map.size = size;\n map._head = head;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n}\n\nvar EMPTY_STACK;\n\nfunction emptyStack() {\n return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n}\n\nvar IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@';\n\nfunction isSet(maybeSet) {\n return Boolean(maybeSet && maybeSet[IS_SET_SYMBOL]);\n}\n\nfunction isOrderedSet(maybeOrderedSet) {\n return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n}\n\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (!isCollection(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {\n return false;\n }\n\n if (a.size === 0 && b.size === 0) {\n return true;\n }\n\n var notAssociative = !isAssociative(a);\n\n if (isOrdered(a)) {\n var entries = a.entries();\n return b.every(function (v, k) {\n var entry = entries.next().value;\n return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n }) && entries.next().done;\n }\n\n var flipped = false;\n\n if (a.size === undefined) {\n if (b.size === undefined) {\n if (typeof a.cacheResult === 'function') {\n a.cacheResult();\n }\n } else {\n flipped = true;\n var _ = a;\n a = b;\n b = _;\n }\n }\n\n var allEqual = true;\n\n var bSize = b.__iterate(function (v, k) {\n if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n allEqual = false;\n return false;\n }\n });\n\n return allEqual && a.size === bSize;\n}\n\nfunction mixin(ctor, methods) {\n var keyCopier = function keyCopier(key) {\n ctor.prototype[key] = methods[key];\n };\n\n Object.keys(methods).forEach(keyCopier);\n Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n return ctor;\n}\n\nfunction toJS(value) {\n if (!value || _typeof(value) !== 'object') {\n return value;\n }\n\n if (!isCollection(value)) {\n if (!isDataStructure(value)) {\n return value;\n }\n\n value = Seq(value);\n }\n\n if (isKeyed(value)) {\n var result$1 = {};\n\n value.__iterate(function (v, k) {\n result$1[k] = toJS(v);\n });\n\n return result$1;\n }\n\n var result = [];\n\n value.__iterate(function (v) {\n result.push(toJS(v));\n });\n\n return result;\n}\n\nvar Set = /*@__PURE__*/function (SetCollection) {\n function Set(value) {\n return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function (set) {\n var iter = SetCollection(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v) {\n return set.add(v);\n });\n });\n }\n\n if (SetCollection) Set.__proto__ = SetCollection;\n Set.prototype = Object.create(SetCollection && SetCollection.prototype);\n Set.prototype.constructor = Set;\n\n Set.of = function\n /*...values*/\n of() {\n return this(arguments);\n };\n\n Set.fromKeys = function fromKeys(value) {\n return this(KeyedCollection(value).keySeq());\n };\n\n Set.intersect = function intersect(sets) {\n sets = Collection(sets).toArray();\n return sets.length ? SetPrototype.intersect.apply(Set(sets.pop()), sets) : emptySet();\n };\n\n Set.union = function union(sets) {\n sets = Collection(sets).toArray();\n return sets.length ? SetPrototype.union.apply(Set(sets.pop()), sets) : emptySet();\n };\n\n Set.prototype.toString = function toString() {\n return this.__toString('Set {', '}');\n }; // @pragma Access\n\n\n Set.prototype.has = function has(value) {\n return this._map.has(value);\n }; // @pragma Modification\n\n\n Set.prototype.add = function add(value) {\n return updateSet(this, this._map.set(value, value));\n };\n\n Set.prototype.remove = function remove(value) {\n return updateSet(this, this._map.remove(value));\n };\n\n Set.prototype.clear = function clear() {\n return updateSet(this, this._map.clear());\n }; // @pragma Composition\n\n\n Set.prototype.map = function map(mapper, context) {\n var this$1$1 = this; // keep track if the set is altered by the map function\n\n var didChanges = false;\n var newMap = updateSet(this, this._map.mapEntries(function (ref) {\n var v = ref[1];\n var mapped = mapper.call(context, v, v, this$1$1);\n\n if (mapped !== v) {\n didChanges = true;\n }\n\n return [mapped, mapped];\n }, context));\n return didChanges ? newMap : this;\n };\n\n Set.prototype.union = function union() {\n var iters = [],\n len = arguments.length;\n\n while (len--) {\n iters[len] = arguments[len];\n }\n\n iters = iters.filter(function (x) {\n return x.size !== 0;\n });\n\n if (iters.length === 0) {\n return this;\n }\n\n if (this.size === 0 && !this.__ownerID && iters.length === 1) {\n return this.constructor(iters[0]);\n }\n\n return this.withMutations(function (set) {\n for (var ii = 0; ii < iters.length; ii++) {\n SetCollection(iters[ii]).forEach(function (value) {\n return set.add(value);\n });\n }\n });\n };\n\n Set.prototype.intersect = function intersect() {\n var iters = [],\n len = arguments.length;\n\n while (len--) {\n iters[len] = arguments[len];\n }\n\n if (iters.length === 0) {\n return this;\n }\n\n iters = iters.map(function (iter) {\n return SetCollection(iter);\n });\n var toRemove = [];\n this.forEach(function (value) {\n if (!iters.every(function (iter) {\n return iter.includes(value);\n })) {\n toRemove.push(value);\n }\n });\n return this.withMutations(function (set) {\n toRemove.forEach(function (value) {\n set.remove(value);\n });\n });\n };\n\n Set.prototype.subtract = function subtract() {\n var iters = [],\n len = arguments.length;\n\n while (len--) {\n iters[len] = arguments[len];\n }\n\n if (iters.length === 0) {\n return this;\n }\n\n iters = iters.map(function (iter) {\n return SetCollection(iter);\n });\n var toRemove = [];\n this.forEach(function (value) {\n if (iters.some(function (iter) {\n return iter.includes(value);\n })) {\n toRemove.push(value);\n }\n });\n return this.withMutations(function (set) {\n toRemove.forEach(function (value) {\n set.remove(value);\n });\n });\n };\n\n Set.prototype.sort = function sort(comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator));\n };\n\n Set.prototype.sortBy = function sortBy(mapper, comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator, mapper));\n };\n\n Set.prototype.wasAltered = function wasAltered() {\n return this._map.wasAltered();\n };\n\n Set.prototype.__iterate = function __iterate(fn, reverse) {\n var this$1$1 = this;\n return this._map.__iterate(function (k) {\n return fn(k, k, this$1$1);\n }, reverse);\n };\n\n Set.prototype.__iterator = function __iterator(type, reverse) {\n return this._map.__iterator(type, reverse);\n };\n\n Set.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newMap = this._map.__ensureOwner(ownerID);\n\n if (!ownerID) {\n if (this.size === 0) {\n return this.__empty();\n }\n\n this.__ownerID = ownerID;\n this._map = newMap;\n return this;\n }\n\n return this.__make(newMap, ownerID);\n };\n\n return Set;\n}(SetCollection);\n\nSet.isSet = isSet;\nvar SetPrototype = Set.prototype;\nSetPrototype[IS_SET_SYMBOL] = true;\nSetPrototype[DELETE] = SetPrototype.remove;\nSetPrototype.merge = SetPrototype.concat = SetPrototype.union;\nSetPrototype.withMutations = withMutations;\nSetPrototype.asImmutable = asImmutable;\nSetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable;\n\nSetPrototype['@@transducer/step'] = function (result, arr) {\n return result.add(arr);\n};\n\nSetPrototype['@@transducer/result'] = function (obj) {\n return obj.asImmutable();\n};\n\nSetPrototype.__empty = emptySet;\nSetPrototype.__make = makeSet;\n\nfunction updateSet(set, newMap) {\n if (set.__ownerID) {\n set.size = newMap.size;\n set._map = newMap;\n return set;\n }\n\n return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);\n}\n\nfunction makeSet(map, ownerID) {\n var set = Object.create(SetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n}\n\nvar EMPTY_SET;\n\nfunction emptySet() {\n return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n}\n/**\n * Returns a lazy seq of nums from start (inclusive) to end\n * (exclusive), by step, where start defaults to 0, step to 1, and end to\n * infinity. When start is equal to end, returns empty list.\n */\n\n\nvar Range = /*@__PURE__*/function (IndexedSeq) {\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n return new Range(start, end, step);\n }\n\n invariant(step !== 0, 'Cannot step a Range by 0');\n start = start || 0;\n\n if (end === undefined) {\n end = Infinity;\n }\n\n step = step === undefined ? 1 : Math.abs(step);\n\n if (end < start) {\n step = -step;\n }\n\n this._start = start;\n this._end = end;\n this._step = step;\n this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\n if (this.size === 0) {\n if (EMPTY_RANGE) {\n return EMPTY_RANGE;\n }\n\n EMPTY_RANGE = this;\n }\n }\n\n if (IndexedSeq) Range.__proto__ = IndexedSeq;\n Range.prototype = Object.create(IndexedSeq && IndexedSeq.prototype);\n Range.prototype.constructor = Range;\n\n Range.prototype.toString = function toString() {\n if (this.size === 0) {\n return 'Range []';\n }\n\n return 'Range [ ' + this._start + '...' + this._end + (this._step !== 1 ? ' by ' + this._step : '') + ' ]';\n };\n\n Range.prototype.get = function get(index, notSetValue) {\n return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n };\n\n Range.prototype.includes = function includes(searchValue) {\n var possibleIndex = (searchValue - this._start) / this._step;\n return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n };\n\n Range.prototype.slice = function slice(begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n\n begin = resolveBegin(begin, this.size);\n end = resolveEnd(end, this.size);\n\n if (end <= begin) {\n return new Range(0, 0);\n }\n\n return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n };\n\n Range.prototype.indexOf = function indexOf(searchValue) {\n var offsetValue = searchValue - this._start;\n\n if (offsetValue % this._step === 0) {\n var index = offsetValue / this._step;\n\n if (index >= 0 && index < this.size) {\n return index;\n }\n }\n\n return -1;\n };\n\n Range.prototype.lastIndexOf = function lastIndexOf(searchValue) {\n return this.indexOf(searchValue);\n };\n\n Range.prototype.__iterate = function __iterate(fn, reverse) {\n var size = this.size;\n var step = this._step;\n var value = reverse ? this._start + (size - 1) * step : this._start;\n var i = 0;\n\n while (i !== size) {\n if (fn(value, reverse ? size - ++i : i++, this) === false) {\n break;\n }\n\n value += reverse ? -step : step;\n }\n\n return i;\n };\n\n Range.prototype.__iterator = function __iterator(type, reverse) {\n var size = this.size;\n var step = this._step;\n var value = reverse ? this._start + (size - 1) * step : this._start;\n var i = 0;\n return new Iterator(function () {\n if (i === size) {\n return iteratorDone();\n }\n\n var v = value;\n value += reverse ? -step : step;\n return iteratorValue(type, reverse ? size - ++i : i++, v);\n });\n };\n\n Range.prototype.equals = function equals(other) {\n return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);\n };\n\n return Range;\n}(IndexedSeq);\n\nvar EMPTY_RANGE;\n\nfunction getIn$1(collection, searchKeyPath, notSetValue) {\n var keyPath = coerceKeyPath(searchKeyPath);\n var i = 0;\n\n while (i !== keyPath.length) {\n collection = get(collection, keyPath[i++], NOT_SET);\n\n if (collection === NOT_SET) {\n return notSetValue;\n }\n }\n\n return collection;\n}\n\nfunction getIn(searchKeyPath, notSetValue) {\n return getIn$1(this, searchKeyPath, notSetValue);\n}\n\nfunction hasIn$1(collection, keyPath) {\n return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET;\n}\n\nfunction hasIn(searchKeyPath) {\n return hasIn$1(this, searchKeyPath);\n}\n\nfunction toObject() {\n assertNotInfinite(this.size);\n var object = {};\n\n this.__iterate(function (v, k) {\n object[k] = v;\n });\n\n return object;\n} // Note: all of these methods are deprecated.\n\n\nCollection.isIterable = isCollection;\nCollection.isKeyed = isKeyed;\nCollection.isIndexed = isIndexed;\nCollection.isAssociative = isAssociative;\nCollection.isOrdered = isOrdered;\nCollection.Iterator = Iterator;\nmixin(Collection, {\n // ### Conversion to other types\n toArray: function toArray() {\n assertNotInfinite(this.size);\n var array = new Array(this.size || 0);\n var useTuples = isKeyed(this);\n var i = 0;\n\n this.__iterate(function (v, k) {\n // Keyed collections produce an array of tuples.\n array[i++] = useTuples ? [k, v] : v;\n });\n\n return array;\n },\n toIndexedSeq: function toIndexedSeq() {\n return new ToIndexedSequence(this);\n },\n toJS: function toJS$1() {\n return toJS(this);\n },\n toKeyedSeq: function toKeyedSeq() {\n return new ToKeyedSequence(this, true);\n },\n toMap: function toMap() {\n // Use Late Binding here to solve the circular dependency.\n return Map(this.toKeyedSeq());\n },\n toObject: toObject,\n toOrderedMap: function toOrderedMap() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedMap(this.toKeyedSeq());\n },\n toOrderedSet: function toOrderedSet() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n },\n toSet: function toSet() {\n // Use Late Binding here to solve the circular dependency.\n return Set(isKeyed(this) ? this.valueSeq() : this);\n },\n toSetSeq: function toSetSeq() {\n return new ToSetSequence(this);\n },\n toSeq: function toSeq() {\n return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n },\n toStack: function toStack() {\n // Use Late Binding here to solve the circular dependency.\n return Stack(isKeyed(this) ? this.valueSeq() : this);\n },\n toList: function toList() {\n // Use Late Binding here to solve the circular dependency.\n return List(isKeyed(this) ? this.valueSeq() : this);\n },\n // ### Common JavaScript methods and properties\n toString: function toString() {\n return '[Collection]';\n },\n __toString: function __toString(head, tail) {\n if (this.size === 0) {\n return head + tail;\n }\n\n return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n },\n // ### ES6 Collection methods (ES6 Array and Map)\n concat: function concat() {\n var values = [],\n len = arguments.length;\n\n while (len--) {\n values[len] = arguments[len];\n }\n\n return reify(this, concatFactory(this, values));\n },\n includes: function includes(searchValue) {\n return this.some(function (value) {\n return is(value, searchValue);\n });\n },\n entries: function entries() {\n return this.__iterator(ITERATE_ENTRIES);\n },\n every: function every(predicate, context) {\n assertNotInfinite(this.size);\n var returnValue = true;\n\n this.__iterate(function (v, k, c) {\n if (!predicate.call(context, v, k, c)) {\n returnValue = false;\n return false;\n }\n });\n\n return returnValue;\n },\n filter: function filter(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, true));\n },\n find: function find(predicate, context, notSetValue) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[1] : notSetValue;\n },\n forEach: function forEach(sideEffect, context) {\n assertNotInfinite(this.size);\n return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n },\n join: function join(separator) {\n assertNotInfinite(this.size);\n separator = separator !== undefined ? '' + separator : ',';\n var joined = '';\n var isFirst = true;\n\n this.__iterate(function (v) {\n isFirst ? isFirst = false : joined += separator;\n joined += v !== null && v !== undefined ? v.toString() : '';\n });\n\n return joined;\n },\n keys: function keys() {\n return this.__iterator(ITERATE_KEYS);\n },\n map: function map(mapper, context) {\n return reify(this, mapFactory(this, mapper, context));\n },\n reduce: function reduce$1(reducer, initialReduction, context) {\n return reduce(this, reducer, initialReduction, context, arguments.length < 2, false);\n },\n reduceRight: function reduceRight(reducer, initialReduction, context) {\n return reduce(this, reducer, initialReduction, context, arguments.length < 2, true);\n },\n reverse: function reverse() {\n return reify(this, reverseFactory(this, true));\n },\n slice: function slice(begin, end) {\n return reify(this, sliceFactory(this, begin, end, true));\n },\n some: function some(predicate, context) {\n return !this.every(not(predicate), context);\n },\n sort: function sort(comparator) {\n return reify(this, sortFactory(this, comparator));\n },\n values: function values() {\n return this.__iterator(ITERATE_VALUES);\n },\n // ### More sequential methods\n butLast: function butLast() {\n return this.slice(0, -1);\n },\n isEmpty: function isEmpty() {\n return this.size !== undefined ? this.size === 0 : !this.some(function () {\n return true;\n });\n },\n count: function count(predicate, context) {\n return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n },\n countBy: function countBy(grouper, context) {\n return countByFactory(this, grouper, context);\n },\n equals: function equals(other) {\n return deepEqual(this, other);\n },\n entrySeq: function entrySeq() {\n var collection = this;\n\n if (collection._cache) {\n // We cache as an entries array, so we can just return the cache!\n return new ArraySeq(collection._cache);\n }\n\n var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq();\n\n entriesSequence.fromEntrySeq = function () {\n return collection.toSeq();\n };\n\n return entriesSequence;\n },\n filterNot: function filterNot(predicate, context) {\n return this.filter(not(predicate), context);\n },\n findEntry: function findEntry(predicate, context, notSetValue) {\n var found = notSetValue;\n\n this.__iterate(function (v, k, c) {\n if (predicate.call(context, v, k, c)) {\n found = [k, v];\n return false;\n }\n });\n\n return found;\n },\n findKey: function findKey(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry && entry[0];\n },\n findLast: function findLast(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n },\n findLastEntry: function findLastEntry(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);\n },\n findLastKey: function findLastKey(predicate, context) {\n return this.toKeyedSeq().reverse().findKey(predicate, context);\n },\n first: function first(notSetValue) {\n return this.find(returnTrue, null, notSetValue);\n },\n flatMap: function flatMap(mapper, context) {\n return reify(this, flatMapFactory(this, mapper, context));\n },\n flatten: function flatten(depth) {\n return reify(this, flattenFactory(this, depth, true));\n },\n fromEntrySeq: function fromEntrySeq() {\n return new FromEntriesSequence(this);\n },\n get: function get(searchKey, notSetValue) {\n return this.find(function (_, key) {\n return is(key, searchKey);\n }, undefined, notSetValue);\n },\n getIn: getIn,\n groupBy: function groupBy(grouper, context) {\n return groupByFactory(this, grouper, context);\n },\n has: function has(searchKey) {\n return this.get(searchKey, NOT_SET) !== NOT_SET;\n },\n hasIn: hasIn,\n isSubset: function isSubset(iter) {\n iter = typeof iter.includes === 'function' ? iter : Collection(iter);\n return this.every(function (value) {\n return iter.includes(value);\n });\n },\n isSuperset: function isSuperset(iter) {\n iter = typeof iter.isSubset === 'function' ? iter : Collection(iter);\n return iter.isSubset(this);\n },\n keyOf: function keyOf(searchValue) {\n return this.findKey(function (value) {\n return is(value, searchValue);\n });\n },\n keySeq: function keySeq() {\n return this.toSeq().map(keyMapper).toIndexedSeq();\n },\n last: function last(notSetValue) {\n return this.toSeq().reverse().first(notSetValue);\n },\n lastKeyOf: function lastKeyOf(searchValue) {\n return this.toKeyedSeq().reverse().keyOf(searchValue);\n },\n max: function max(comparator) {\n return maxFactory(this, comparator);\n },\n maxBy: function maxBy(mapper, comparator) {\n return maxFactory(this, comparator, mapper);\n },\n min: function min(comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n },\n minBy: function minBy(mapper, comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n },\n rest: function rest() {\n return this.slice(1);\n },\n skip: function skip(amount) {\n return amount === 0 ? this : this.slice(Math.max(0, amount));\n },\n skipLast: function skipLast(amount) {\n return amount === 0 ? this : this.slice(0, -Math.max(0, amount));\n },\n skipWhile: function skipWhile(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, true));\n },\n skipUntil: function skipUntil(predicate, context) {\n return this.skipWhile(not(predicate), context);\n },\n sortBy: function sortBy(mapper, comparator) {\n return reify(this, sortFactory(this, comparator, mapper));\n },\n take: function take(amount) {\n return this.slice(0, Math.max(0, amount));\n },\n takeLast: function takeLast(amount) {\n return this.slice(-Math.max(0, amount));\n },\n takeWhile: function takeWhile(predicate, context) {\n return reify(this, takeWhileFactory(this, predicate, context));\n },\n takeUntil: function takeUntil(predicate, context) {\n return this.takeWhile(not(predicate), context);\n },\n update: function update(fn) {\n return fn(this);\n },\n valueSeq: function valueSeq() {\n return this.toIndexedSeq();\n },\n // ### Hashable Object\n hashCode: function hashCode() {\n return this.__hash || (this.__hash = hashCollection(this));\n } // ### Internal\n // abstract __iterate(fn, reverse)\n // abstract __iterator(type, reverse)\n\n});\nvar CollectionPrototype = Collection.prototype;\nCollectionPrototype[IS_COLLECTION_SYMBOL] = true;\nCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values;\nCollectionPrototype.toJSON = CollectionPrototype.toArray;\nCollectionPrototype.__toStringMapper = quoteString;\n\nCollectionPrototype.inspect = CollectionPrototype.toSource = function () {\n return this.toString();\n};\n\nCollectionPrototype.chain = CollectionPrototype.flatMap;\nCollectionPrototype.contains = CollectionPrototype.includes;\nmixin(KeyedCollection, {\n // ### More sequential methods\n flip: function flip() {\n return reify(this, flipFactory(this));\n },\n mapEntries: function mapEntries(mapper, context) {\n var this$1$1 = this;\n var iterations = 0;\n return reify(this, this.toSeq().map(function (v, k) {\n return mapper.call(context, [k, v], iterations++, this$1$1);\n }).fromEntrySeq());\n },\n mapKeys: function mapKeys(mapper, context) {\n var this$1$1 = this;\n return reify(this, this.toSeq().flip().map(function (k, v) {\n return mapper.call(context, k, v, this$1$1);\n }).flip());\n }\n});\nvar KeyedCollectionPrototype = KeyedCollection.prototype;\nKeyedCollectionPrototype[IS_KEYED_SYMBOL] = true;\nKeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries;\nKeyedCollectionPrototype.toJSON = toObject;\n\nKeyedCollectionPrototype.__toStringMapper = function (v, k) {\n return quoteString(k) + ': ' + quoteString(v);\n};\n\nmixin(IndexedCollection, {\n // ### Conversion to other types\n toKeyedSeq: function toKeyedSeq() {\n return new ToKeyedSequence(this, false);\n },\n // ### ES6 Collection methods (ES6 Array and Map)\n filter: function filter(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, false));\n },\n findIndex: function findIndex(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n indexOf: function indexOf(searchValue) {\n var key = this.keyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n lastIndexOf: function lastIndexOf(searchValue) {\n var key = this.lastKeyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n reverse: function reverse() {\n return reify(this, reverseFactory(this, false));\n },\n slice: function slice(begin, end) {\n return reify(this, sliceFactory(this, begin, end, false));\n },\n splice: function splice(index, removeNum\n /*, ...values*/\n ) {\n var numArgs = arguments.length;\n removeNum = Math.max(removeNum || 0, 0);\n\n if (numArgs === 0 || numArgs === 2 && !removeNum) {\n return this;\n } // If index is negative, it should resolve relative to the size of the\n // collection. However size may be expensive to compute if not cached, so\n // only call count() if the number is in fact negative.\n\n\n index = resolveBegin(index, index < 0 ? this.count() : this.size);\n var spliced = this.slice(0, index);\n return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n },\n // ### More collection methods\n findLastIndex: function findLastIndex(predicate, context) {\n var entry = this.findLastEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n first: function first(notSetValue) {\n return this.get(0, notSetValue);\n },\n flatten: function flatten(depth) {\n return reify(this, flattenFactory(this, depth, false));\n },\n get: function get(index, notSetValue) {\n index = wrapIndex(this, index);\n return index < 0 || this.size === Infinity || this.size !== undefined && index > this.size ? notSetValue : this.find(function (_, key) {\n return key === index;\n }, undefined, notSetValue);\n },\n has: function has(index) {\n index = wrapIndex(this, index);\n return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n },\n interpose: function interpose(separator) {\n return reify(this, interposeFactory(this, separator));\n },\n interleave: function\n /*...collections*/\n interleave() {\n var collections = [this].concat(arrCopy(arguments));\n var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections);\n var interleaved = zipped.flatten(true);\n\n if (zipped.size) {\n interleaved.size = zipped.size * collections.length;\n }\n\n return reify(this, interleaved);\n },\n keySeq: function keySeq() {\n return Range(0, this.size);\n },\n last: function last(notSetValue) {\n return this.get(-1, notSetValue);\n },\n skipWhile: function skipWhile(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, false));\n },\n zip: function\n /*, ...collections */\n zip() {\n var collections = [this].concat(arrCopy(arguments));\n return reify(this, zipWithFactory(this, defaultZipper, collections));\n },\n zipAll: function\n /*, ...collections */\n zipAll() {\n var collections = [this].concat(arrCopy(arguments));\n return reify(this, zipWithFactory(this, defaultZipper, collections, true));\n },\n zipWith: function zipWith(zipper\n /*, ...collections */\n ) {\n var collections = arrCopy(arguments);\n collections[0] = this;\n return reify(this, zipWithFactory(this, zipper, collections));\n }\n});\nvar IndexedCollectionPrototype = IndexedCollection.prototype;\nIndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true;\nIndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true;\nmixin(SetCollection, {\n // ### ES6 Collection methods (ES6 Array and Map)\n get: function get(value, notSetValue) {\n return this.has(value) ? value : notSetValue;\n },\n includes: function includes(value) {\n return this.has(value);\n },\n // ### More sequential methods\n keySeq: function keySeq() {\n return this.valueSeq();\n }\n});\nvar SetCollectionPrototype = SetCollection.prototype;\nSetCollectionPrototype.has = CollectionPrototype.includes;\nSetCollectionPrototype.contains = SetCollectionPrototype.includes;\nSetCollectionPrototype.keys = SetCollectionPrototype.values; // Mixin subclasses\n\nmixin(KeyedSeq, KeyedCollectionPrototype);\nmixin(IndexedSeq, IndexedCollectionPrototype);\nmixin(SetSeq, SetCollectionPrototype); // #pragma Helper functions\n\nfunction reduce(collection, reducer, reduction, context, useFirst, reverse) {\n assertNotInfinite(collection.size);\n\n collection.__iterate(function (v, k, c) {\n if (useFirst) {\n useFirst = false;\n reduction = v;\n } else {\n reduction = reducer.call(context, reduction, v, k, c);\n }\n }, reverse);\n\n return reduction;\n}\n\nfunction keyMapper(v, k) {\n return k;\n}\n\nfunction entryMapper(v, k) {\n return [k, v];\n}\n\nfunction not(predicate) {\n return function () {\n return !predicate.apply(this, arguments);\n };\n}\n\nfunction neg(predicate) {\n return function () {\n return -predicate.apply(this, arguments);\n };\n}\n\nfunction defaultZipper() {\n return arrCopy(arguments);\n}\n\nfunction defaultNegComparator(a, b) {\n return a < b ? 1 : a > b ? -1 : 0;\n}\n\nfunction hashCollection(collection) {\n if (collection.size === Infinity) {\n return 0;\n }\n\n var ordered = isOrdered(collection);\n var keyed = isKeyed(collection);\n var h = ordered ? 1 : 0;\n\n var size = collection.__iterate(keyed ? ordered ? function (v, k) {\n h = 31 * h + hashMerge(hash(v), hash(k)) | 0;\n } : function (v, k) {\n h = h + hashMerge(hash(v), hash(k)) | 0;\n } : ordered ? function (v) {\n h = 31 * h + hash(v) | 0;\n } : function (v) {\n h = h + hash(v) | 0;\n });\n\n return murmurHashOfSize(size, h);\n}\n\nfunction murmurHashOfSize(size, h) {\n h = imul(h, 0xcc9e2d51);\n h = imul(h << 15 | h >>> -15, 0x1b873593);\n h = imul(h << 13 | h >>> -13, 5);\n h = (h + 0xe6546b64 | 0) ^ size;\n h = imul(h ^ h >>> 16, 0x85ebca6b);\n h = imul(h ^ h >>> 13, 0xc2b2ae35);\n h = smi(h ^ h >>> 16);\n return h;\n}\n\nfunction hashMerge(a, b) {\n return a ^ b + 0x9e3779b9 + (a << 6) + (a >> 2) | 0; // int\n}\n\nvar OrderedSet = /*@__PURE__*/function (Set) {\n function OrderedSet(value) {\n return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function (set) {\n var iter = SetCollection(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v) {\n return set.add(v);\n });\n });\n }\n\n if (Set) OrderedSet.__proto__ = Set;\n OrderedSet.prototype = Object.create(Set && Set.prototype);\n OrderedSet.prototype.constructor = OrderedSet;\n\n OrderedSet.of = function\n /*...values*/\n of() {\n return this(arguments);\n };\n\n OrderedSet.fromKeys = function fromKeys(value) {\n return this(KeyedCollection(value).keySeq());\n };\n\n OrderedSet.prototype.toString = function toString() {\n return this.__toString('OrderedSet {', '}');\n };\n\n return OrderedSet;\n}(Set);\n\nOrderedSet.isOrderedSet = isOrderedSet;\nvar OrderedSetPrototype = OrderedSet.prototype;\nOrderedSetPrototype[IS_ORDERED_SYMBOL] = true;\nOrderedSetPrototype.zip = IndexedCollectionPrototype.zip;\nOrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith;\nOrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll;\nOrderedSetPrototype.__empty = emptyOrderedSet;\nOrderedSetPrototype.__make = makeOrderedSet;\n\nfunction makeOrderedSet(map, ownerID) {\n var set = Object.create(OrderedSetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n}\n\nvar EMPTY_ORDERED_SET;\n\nfunction emptyOrderedSet() {\n return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n}\n\nfunction throwOnInvalidDefaultValues(defaultValues) {\n if (isRecord(defaultValues)) {\n throw new Error('Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.');\n }\n\n if (isImmutable(defaultValues)) {\n throw new Error('Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.');\n }\n\n if (defaultValues === null || _typeof(defaultValues) !== 'object') {\n throw new Error('Can not call `Record` with a non-object as default values. Use a plain javascript object instead.');\n }\n}\n\nvar Record = function Record(defaultValues, name) {\n var hasInitialized;\n throwOnInvalidDefaultValues(defaultValues);\n\n var RecordType = function Record(values) {\n var this$1$1 = this;\n\n if (values instanceof RecordType) {\n return values;\n }\n\n if (!(this instanceof RecordType)) {\n return new RecordType(values);\n }\n\n if (!hasInitialized) {\n hasInitialized = true;\n var keys = Object.keys(defaultValues);\n var indices = RecordTypePrototype._indices = {}; // Deprecated: left to attempt not to break any external code which\n // relies on a ._name property existing on record instances.\n // Use Record.getDescriptiveName() instead\n\n RecordTypePrototype._name = name;\n RecordTypePrototype._keys = keys;\n RecordTypePrototype._defaultValues = defaultValues;\n\n for (var i = 0; i < keys.length; i++) {\n var propName = keys[i];\n indices[propName] = i;\n\n if (RecordTypePrototype[propName]) {\n /* eslint-disable no-console */\n (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.warn && console.warn('Cannot define ' + recordName(this) + ' with property \"' + propName + '\" since that property name is part of the Record API.');\n /* eslint-enable no-console */\n } else {\n setProp(RecordTypePrototype, propName);\n }\n }\n }\n\n this.__ownerID = undefined;\n this._values = List().withMutations(function (l) {\n l.setSize(this$1$1._keys.length);\n KeyedCollection(values).forEach(function (v, k) {\n l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v);\n });\n });\n return this;\n };\n\n var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n RecordTypePrototype.constructor = RecordType;\n\n if (name) {\n RecordType.displayName = name;\n }\n\n return RecordType;\n};\n\nRecord.prototype.toString = function toString() {\n var str = recordName(this) + ' { ';\n var keys = this._keys;\n var k;\n\n for (var i = 0, l = keys.length; i !== l; i++) {\n k = keys[i];\n str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k));\n }\n\n return str + ' }';\n};\n\nRecord.prototype.equals = function equals(other) {\n return this === other || other && recordSeq(this).equals(recordSeq(other));\n};\n\nRecord.prototype.hashCode = function hashCode() {\n return recordSeq(this).hashCode();\n}; // @pragma Access\n\n\nRecord.prototype.has = function has(k) {\n return this._indices.hasOwnProperty(k);\n};\n\nRecord.prototype.get = function get(k, notSetValue) {\n if (!this.has(k)) {\n return notSetValue;\n }\n\n var index = this._indices[k];\n\n var value = this._values.get(index);\n\n return value === undefined ? this._defaultValues[k] : value;\n}; // @pragma Modification\n\n\nRecord.prototype.set = function set(k, v) {\n if (this.has(k)) {\n var newValues = this._values.set(this._indices[k], v === this._defaultValues[k] ? undefined : v);\n\n if (newValues !== this._values && !this.__ownerID) {\n return makeRecord(this, newValues);\n }\n }\n\n return this;\n};\n\nRecord.prototype.remove = function remove(k) {\n return this.set(k);\n};\n\nRecord.prototype.clear = function clear() {\n var newValues = this._values.clear().setSize(this._keys.length);\n\n return this.__ownerID ? this : makeRecord(this, newValues);\n};\n\nRecord.prototype.wasAltered = function wasAltered() {\n return this._values.wasAltered();\n};\n\nRecord.prototype.toSeq = function toSeq() {\n return recordSeq(this);\n};\n\nRecord.prototype.toJS = function toJS$1() {\n return toJS(this);\n};\n\nRecord.prototype.entries = function entries() {\n return this.__iterator(ITERATE_ENTRIES);\n};\n\nRecord.prototype.__iterator = function __iterator(type, reverse) {\n return recordSeq(this).__iterator(type, reverse);\n};\n\nRecord.prototype.__iterate = function __iterate(fn, reverse) {\n return recordSeq(this).__iterate(fn, reverse);\n};\n\nRecord.prototype.__ensureOwner = function __ensureOwner(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newValues = this._values.__ensureOwner(ownerID);\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._values = newValues;\n return this;\n }\n\n return makeRecord(this, newValues, ownerID);\n};\n\nRecord.isRecord = isRecord;\nRecord.getDescriptiveName = recordName;\nvar RecordPrototype = Record.prototype;\nRecordPrototype[IS_RECORD_SYMBOL] = true;\nRecordPrototype[DELETE] = RecordPrototype.remove;\nRecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn;\nRecordPrototype.getIn = getIn;\nRecordPrototype.hasIn = CollectionPrototype.hasIn;\nRecordPrototype.merge = merge$1;\nRecordPrototype.mergeWith = mergeWith$1;\nRecordPrototype.mergeIn = mergeIn;\nRecordPrototype.mergeDeep = mergeDeep;\nRecordPrototype.mergeDeepWith = mergeDeepWith;\nRecordPrototype.mergeDeepIn = mergeDeepIn;\nRecordPrototype.setIn = setIn;\nRecordPrototype.update = update;\nRecordPrototype.updateIn = updateIn;\nRecordPrototype.withMutations = withMutations;\nRecordPrototype.asMutable = asMutable;\nRecordPrototype.asImmutable = asImmutable;\nRecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries;\nRecordPrototype.toJSON = RecordPrototype.toObject = CollectionPrototype.toObject;\n\nRecordPrototype.inspect = RecordPrototype.toSource = function () {\n return this.toString();\n};\n\nfunction makeRecord(likeRecord, values, ownerID) {\n var record = Object.create(Object.getPrototypeOf(likeRecord));\n record._values = values;\n record.__ownerID = ownerID;\n return record;\n}\n\nfunction recordName(record) {\n return record.constructor.displayName || record.constructor.name || 'Record';\n}\n\nfunction recordSeq(record) {\n return keyedSeqFromValue(record._keys.map(function (k) {\n return [k, record.get(k)];\n }));\n}\n\nfunction setProp(prototype, name) {\n try {\n Object.defineProperty(prototype, name, {\n get: function get() {\n return this.get(name);\n },\n set: function set(value) {\n invariant(this.__ownerID, 'Cannot set on an immutable record.');\n this.set(name, value);\n }\n });\n } catch (error) {// Object.defineProperty failed. Probably IE8.\n }\n}\n/**\n * Returns a lazy Seq of `value` repeated `times` times. When `times` is\n * undefined, returns an infinite sequence of `value`.\n */\n\n\nvar Repeat = /*@__PURE__*/function (IndexedSeq) {\n function Repeat(value, times) {\n if (!(this instanceof Repeat)) {\n return new Repeat(value, times);\n }\n\n this._value = value;\n this.size = times === undefined ? Infinity : Math.max(0, times);\n\n if (this.size === 0) {\n if (EMPTY_REPEAT) {\n return EMPTY_REPEAT;\n }\n\n EMPTY_REPEAT = this;\n }\n }\n\n if (IndexedSeq) Repeat.__proto__ = IndexedSeq;\n Repeat.prototype = Object.create(IndexedSeq && IndexedSeq.prototype);\n Repeat.prototype.constructor = Repeat;\n\n Repeat.prototype.toString = function toString() {\n if (this.size === 0) {\n return 'Repeat []';\n }\n\n return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n };\n\n Repeat.prototype.get = function get(index, notSetValue) {\n return this.has(index) ? this._value : notSetValue;\n };\n\n Repeat.prototype.includes = function includes(searchValue) {\n return is(this._value, searchValue);\n };\n\n Repeat.prototype.slice = function slice(begin, end) {\n var size = this.size;\n return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n };\n\n Repeat.prototype.reverse = function reverse() {\n return this;\n };\n\n Repeat.prototype.indexOf = function indexOf(searchValue) {\n if (is(this._value, searchValue)) {\n return 0;\n }\n\n return -1;\n };\n\n Repeat.prototype.lastIndexOf = function lastIndexOf(searchValue) {\n if (is(this._value, searchValue)) {\n return this.size;\n }\n\n return -1;\n };\n\n Repeat.prototype.__iterate = function __iterate(fn, reverse) {\n var size = this.size;\n var i = 0;\n\n while (i !== size) {\n if (fn(this._value, reverse ? size - ++i : i++, this) === false) {\n break;\n }\n }\n\n return i;\n };\n\n Repeat.prototype.__iterator = function __iterator(type, reverse) {\n var this$1$1 = this;\n var size = this.size;\n var i = 0;\n return new Iterator(function () {\n return i === size ? iteratorDone() : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value);\n });\n };\n\n Repeat.prototype.equals = function equals(other) {\n return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other);\n };\n\n return Repeat;\n}(IndexedSeq);\n\nvar EMPTY_REPEAT;\n\nfunction fromJS(value, converter) {\n return fromJSWith([], converter || defaultConverter, value, '', converter && converter.length > 2 ? [] : undefined, {\n '': value\n });\n}\n\nfunction fromJSWith(stack, converter, value, key, keyPath, parentValue) {\n if (typeof value !== 'string' && !isImmutable(value) && (isArrayLike(value) || hasIterator(value) || isPlainObject(value))) {\n if (~stack.indexOf(value)) {\n throw new TypeError('Cannot convert circular structure to Immutable');\n }\n\n stack.push(value);\n keyPath && key !== '' && keyPath.push(key);\n var converted = converter.call(parentValue, key, Seq(value).map(function (v, k) {\n return fromJSWith(stack, converter, v, k, keyPath, value);\n }), keyPath && keyPath.slice());\n stack.pop();\n keyPath && keyPath.pop();\n return converted;\n }\n\n return value;\n}\n\nfunction defaultConverter(k, v) {\n // Effectively the opposite of \"Collection.toSeq()\"\n return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();\n}\n\nvar version = \"4.0.0\";\nvar Immutable = {\n version: version,\n Collection: Collection,\n // Note: Iterable is deprecated\n Iterable: Collection,\n Seq: Seq,\n Map: Map,\n OrderedMap: OrderedMap,\n List: List,\n Stack: Stack,\n Set: Set,\n OrderedSet: OrderedSet,\n Record: Record,\n Range: Range,\n Repeat: Repeat,\n is: is,\n fromJS: fromJS,\n hash: hash,\n isImmutable: isImmutable,\n isCollection: isCollection,\n isKeyed: isKeyed,\n isIndexed: isIndexed,\n isAssociative: isAssociative,\n isOrdered: isOrdered,\n isValueObject: isValueObject,\n isPlainObject: isPlainObject,\n isSeq: isSeq,\n isList: isList,\n isMap: isMap,\n isOrderedMap: isOrderedMap,\n isStack: isStack,\n isSet: isSet,\n isOrderedSet: isOrderedSet,\n isRecord: isRecord,\n get: get,\n getIn: getIn$1,\n has: has,\n hasIn: hasIn$1,\n merge: merge,\n mergeDeep: mergeDeep$1,\n mergeWith: mergeWith,\n mergeDeepWith: mergeDeepWith$1,\n remove: remove,\n removeIn: removeIn,\n set: set,\n setIn: setIn$1,\n update: update$1,\n updateIn: updateIn$1\n}; // Note: Iterable is deprecated\n\nvar Iterable = Collection;\nexport default Immutable;\nexport { Collection, Iterable, List, Map, OrderedMap, OrderedSet, Range, Record, Repeat, Seq, Set, Stack, fromJS, get, getIn$1 as getIn, has, hasIn$1 as hasIn, hash, is, isAssociative, isCollection, isImmutable, isIndexed, isKeyed, isList, isMap, isOrdered, isOrderedMap, isOrderedSet, isPlainObject, isRecord, isSeq, isSet, isStack, isValueObject, merge, mergeDeep$1 as mergeDeep, mergeDeepWith$1 as mergeDeepWith, mergeWith, remove, removeIn, set, setIn$1 as setIn, update$1 as update, updateIn$1 as updateIn, version };","function isUndefined(value) {\n return value === undefined;\n}\n\nfunction isNull(value) {\n return value === null;\n}\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\n\nfunction isObject(value) {\n return value === Object(value);\n}\n\nfunction isArray(value) {\n return Array.isArray(value);\n}\n\nfunction isDate(value) {\n return value instanceof Date;\n}\n\nfunction isBlob(value, isReactNative) {\n return isReactNative ? isObject(value) && !isUndefined(value.uri) : isObject(value) && typeof value.size === 'number' && typeof value.type === 'string' && typeof value.slice === 'function';\n}\n\nfunction isFile(value, isReactNative) {\n return isBlob(value, isReactNative) && typeof value.name === 'string' && (isObject(value.lastModifiedDate) || typeof value.lastModified === 'number');\n}\n\nfunction initCfg(value) {\n return isUndefined(value) ? false : value;\n}\n\nfunction serialize(obj, cfg, fd, pre) {\n cfg = cfg || {};\n fd = fd || new FormData();\n cfg.indices = initCfg(cfg.indices);\n cfg.nullsAsUndefineds = initCfg(cfg.nullsAsUndefineds);\n cfg.booleansAsIntegers = initCfg(cfg.booleansAsIntegers);\n cfg.allowEmptyArrays = initCfg(cfg.allowEmptyArrays);\n cfg.noFilesWithArrayNotation = initCfg(cfg.noFilesWithArrayNotation);\n cfg.dotsForObjectNotation = initCfg(cfg.dotsForObjectNotation);\n var isReactNative = typeof fd.getParts === 'function';\n\n if (isUndefined(obj)) {\n return fd;\n } else if (isNull(obj)) {\n if (!cfg.nullsAsUndefineds) {\n fd.append(pre, '');\n }\n } else if (isBoolean(obj)) {\n if (cfg.booleansAsIntegers) {\n fd.append(pre, obj ? 1 : 0);\n } else {\n fd.append(pre, obj);\n }\n } else if (isArray(obj)) {\n if (obj.length) {\n obj.forEach(function (value, index) {\n var key = pre + '[' + (cfg.indices ? index : '') + ']';\n\n if (cfg.noFilesWithArrayNotation && isFile(value, isReactNative)) {\n key = pre;\n }\n\n serialize(value, cfg, fd, key);\n });\n } else if (cfg.allowEmptyArrays) {\n fd.append(pre + '[]', '');\n }\n } else if (isDate(obj)) {\n fd.append(pre, obj.toISOString());\n } else if (isObject(obj) && !isBlob(obj, isReactNative)) {\n Object.keys(obj).forEach(function (prop) {\n var value = obj[prop];\n\n if (isArray(value)) {\n while (prop.length > 2 && prop.lastIndexOf('[]') === prop.length - 2) {\n prop = prop.substring(0, prop.length - 2);\n }\n }\n\n var key = pre ? cfg.dotsForObjectNotation ? pre + '.' + prop : pre + '[' + prop + ']' : prop;\n serialize(value, cfg, fd, key);\n });\n } else {\n fd.append(pre, obj);\n }\n\n return fd;\n}\n\nmodule.exports = {\n serialize: serialize\n};","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var classof = require('../internals/classof-raw');\nvar global = require('../internals/global');\n\nmodule.exports = classof(global.process) == 'process';\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) redefine(target, key, src[key], options);\n return target;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar replace = uncurryThis(''.replace);\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n *\n * @typedef {string} Type\n * @typedef {Object} Props\n *\n * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test\n */\n\n/**\n * Check if a node passes a test\n *\n * @callback TestFunctionAnything\n * @param {Node} node\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean|void}\n */\n\n/**\n * Check if a node passes a certain node test\n *\n * @template {Node} X\n * @callback TestFunctionPredicate\n * @param {Node} node\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {node is X}\n */\n\n/**\n * @callback AssertAnything\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean}\n */\n\n/**\n * Check if a node passes a certain node test\n *\n * @template {Node} Y\n * @callback AssertPredicate\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {node is Y}\n */\nexport var is =\n/**\n * Check if a node passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @type {(\n * ((node: unknown, test: T['type']|Partial|TestFunctionPredicate|Array.|TestFunctionPredicate>, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => node is T) &\n * ((node?: unknown, test?: Test, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => boolean)\n * )}\n */\n\n/**\n * Check if a node passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @param {unknown} [node] Node to check\n * @param {Test} [test]\n * When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * When `array`, checks any one of the subtests pass.\n * @param {number|null|undefined} [index] Position of `node` in `parent`\n * @param {Parent|null|undefined} [parent] Parent of `node`\n * @param {unknown} [context] Context object to invoke `test` with\n * @returns {boolean} Whether test passed and `node` is a `Node` (object with `type` set to non-empty `string`).\n */\n// eslint-disable-next-line max-params\nfunction is(node, test, index, parent, context) {\n var check = convert(test);\n\n if (index !== undefined && index !== null && (typeof index !== 'number' || index < 0 || index === Number.POSITIVE_INFINITY)) {\n throw new Error('Expected positive finite index');\n }\n\n if (parent !== undefined && parent !== null && (!is(parent) || !parent.children)) {\n throw new Error('Expected parent node');\n }\n\n if ((parent === undefined || parent === null) !== (index === undefined || index === null)) {\n throw new Error('Expected both parent and index');\n } // @ts-expect-error Looks like a node.\n\n\n return node && node.type && typeof node.type === 'string' ? Boolean(check.call(context, node, index, parent)) : false;\n};\nexport var convert =\n/**\n * @type {(\n * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n\n/**\n * Generate an assertion from a check.\n * @param {Test} [test]\n * When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * When `array`, checks any one of the subtests pass.\n * @returns {AssertAnything}\n */\nfunction convert(test) {\n if (test === undefined || test === null) {\n return ok;\n }\n\n if (typeof test === 'string') {\n return typeFactory(test);\n }\n\n if (_typeof(test) === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test);\n }\n\n if (typeof test === 'function') {\n return castFactory(test);\n }\n\n throw new Error('Expected function, string, or object as test');\n};\n/**\n * @param {Array.} tests\n * @returns {AssertAnything}\n */\n\nfunction anyFactory(tests) {\n /** @type {Array.} */\n var checks = [];\n var index = -1;\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index]);\n }\n\n return castFactory(any);\n /**\n * @this {unknown}\n * @param {unknown[]} parameters\n * @returns {boolean}\n */\n\n function any() {\n var index = -1;\n\n for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {\n parameters[_key] = arguments[_key];\n }\n\n while (++index < checks.length) {\n var _checks$index;\n\n if ((_checks$index = checks[index]).call.apply(_checks$index, [this].concat(parameters))) return true;\n }\n\n return false;\n }\n}\n/**\n * Utility to assert each property in `test` is represented in `node`, and each\n * values are strictly equal.\n *\n * @param {Props} check\n * @returns {AssertAnything}\n */\n\n\nfunction propsFactory(check) {\n return castFactory(all);\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n\n function all(node) {\n /** @type {string} */\n var key;\n\n for (key in check) {\n // @ts-expect-error: hush, it sure works as an index.\n if (node[key] !== check[key]) return false;\n }\n\n return true;\n }\n}\n/**\n * Utility to convert a string into a function which checks a given node’s type\n * for said string.\n *\n * @param {Type} check\n * @returns {AssertAnything}\n */\n\n\nfunction typeFactory(check) {\n return castFactory(type);\n /**\n * @param {Node} node\n */\n\n function type(node) {\n return node && node.type === check;\n }\n}\n/**\n * Utility to convert a string into a function which checks a given node’s type\n * for said string.\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\n\n\nfunction castFactory(check) {\n return assertion;\n /**\n * @this {unknown}\n * @param {Array.} parameters\n * @returns {boolean}\n */\n\n function assertion() {\n for (var _len2 = arguments.length, parameters = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n parameters[_key2] = arguments[_key2];\n }\n\n // @ts-expect-error: spreading is fine.\n return Boolean(check.call.apply(check, [this].concat(parameters)));\n }\n} // Utility to return true.\n\n\nfunction ok() {\n return true;\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport partitionsInfo from \"./partitions.json\";\nvar selectedPartitionsInfo = partitionsInfo;\nvar selectedUserAgentPrefix = \"\";\nexport var partition = function partition(value) {\n var _selectedPartitionsIn = selectedPartitionsInfo,\n partitions = _selectedPartitionsIn.partitions;\n\n var _iterator = _createForOfIteratorHelper(partitions),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _partition = _step.value;\n var regions = _partition.regions,\n outputs = _partition.outputs;\n\n for (var _i2 = 0, _Object$entries = Object.entries(regions); _i2 < _Object$entries.length; _i2++) {\n var _ref3 = _Object$entries[_i2];\n\n var _ref2 = _slicedToArray(_ref3, 2);\n\n var region = _ref2[0];\n var regionData = _ref2[1];\n\n if (region === value) {\n return _objectSpread(_objectSpread({}, outputs), regionData);\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(partitions),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _partition2 = _step2.value;\n var regionRegex = _partition2.regionRegex,\n _outputs = _partition2.outputs;\n\n if (new RegExp(regionRegex).test(value)) {\n return _objectSpread({}, _outputs);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n var DEFAULT_PARTITION = partitions.find(function (partition) {\n return partition.id === \"aws\";\n });\n\n if (!DEFAULT_PARTITION) {\n throw new Error(\"Provided region was not found in the partition array or regex,\" + \" and default partition with id 'aws' doesn't exist.\");\n }\n\n return _objectSpread({}, DEFAULT_PARTITION.outputs);\n};\nexport var setPartitionInfo = function setPartitionInfo(partitionsInfo) {\n var userAgentPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n selectedPartitionsInfo = partitionsInfo;\n selectedUserAgentPrefix = userAgentPrefix;\n};\nexport var useDefaultPartitionInfo = function useDefaultPartitionInfo() {\n setPartitionInfo(partitionsInfo, \"\");\n};\nexport var getUserAgentPrefix = function getUserAgentPrefix() {\n return selectedUserAgentPrefix;\n};","export var debugId = \"endpoints\";","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nexport function toDebugString(input) {\n if (_typeof(input) !== \"object\" || input == null) {\n return input;\n }\n\n if (\"ref\" in input) {\n return \"$\".concat(toDebugString(input.ref));\n }\n\n if (\"fn\" in input) {\n return \"\".concat(input.fn, \"(\").concat((input.argv || []).map(toDebugString).join(\", \"), \")\");\n }\n\n return JSON.stringify(input, null, 2);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nexport var EndpointError = /*#__PURE__*/function (_Error) {\n _inherits(EndpointError, _Error);\n\n var _super = _createSuper(EndpointError);\n\n function EndpointError(message) {\n var _this;\n\n _classCallCheck(this, EndpointError);\n\n _this = _super.call(this, message);\n _this.name = \"EndpointError\";\n return _this;\n }\n\n return _createClass(EndpointError);\n}( /*#__PURE__*/_wrapNativeSuper(Error));","var IP_V4_REGEX = new RegExp(\"^(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}$\");\nexport var isIpAddress = function isIpAddress(value) {\n return IP_V4_REGEX.test(value) || value.startsWith(\"[\") && value.endsWith(\"]\");\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar VALID_HOST_LABEL_REGEX = new RegExp(\"^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$\");\nexport var isValidHostLabel = function isValidHostLabel(value) {\n var allowSubDomains = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!allowSubDomains) {\n return VALID_HOST_LABEL_REGEX.test(value);\n }\n\n var labels = value.split(\".\");\n\n var _iterator = _createForOfIteratorHelper(labels),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var label = _step.value;\n\n if (!isValidHostLabel(label)) {\n return false;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return true;\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { isIpAddress } from \"../isIpAddress\";\nimport { isValidHostLabel } from \"../isValidHostLabel\";\nexport var isVirtualHostableS3Bucket = function isVirtualHostableS3Bucket(value) {\n var allowSubDomains = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (allowSubDomains) {\n var _iterator = _createForOfIteratorHelper(value.split(\".\")),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var label = _step.value;\n\n if (!isVirtualHostableS3Bucket(label)) {\n return false;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return true;\n }\n\n if (!isValidHostLabel(value)) {\n return false;\n }\n\n if (value.length < 3 || value.length > 63) {\n return false;\n }\n\n if (value !== value.toLowerCase()) {\n return false;\n }\n\n if (isIpAddress(value)) {\n return false;\n }\n\n return true;\n};","function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nexport var parseArn = function parseArn(value) {\n var segments = value.split(\":\");\n if (segments.length < 6) return null;\n\n var _segments = _toArray(segments),\n arn = _segments[0],\n partition = _segments[1],\n service = _segments[2],\n region = _segments[3],\n accountId = _segments[4],\n resourceId = _segments.slice(5);\n\n if (arn !== \"arn\" || partition === \"\" || service === \"\" || resourceId[0] === \"\") return null;\n return {\n partition: partition,\n service: service,\n region: region,\n accountId: accountId,\n resourceId: resourceId[0].includes(\"/\") ? resourceId[0].split(\"/\") : resourceId\n };\n};","export var booleanEquals = function booleanEquals(value1, value2) {\n return value1 === value2;\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { EndpointError } from \"../types\";\nexport var getAttrPathList = function getAttrPathList(path) {\n var parts = path.split(\".\");\n var pathList = [];\n\n var _iterator = _createForOfIteratorHelper(parts),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var part = _step.value;\n var squareBracketIndex = part.indexOf(\"[\");\n\n if (squareBracketIndex !== -1) {\n if (part.indexOf(\"]\") !== part.length - 1) {\n throw new EndpointError(\"Path: '\".concat(path, \"' does not end with ']'\"));\n }\n\n var arrayIndex = part.slice(squareBracketIndex + 1, -1);\n\n if (Number.isNaN(parseInt(arrayIndex))) {\n throw new EndpointError(\"Invalid array index: '\".concat(arrayIndex, \"' in path: '\").concat(path, \"'\"));\n }\n\n if (squareBracketIndex !== 0) {\n pathList.push(part.slice(0, squareBracketIndex));\n }\n\n pathList.push(arrayIndex);\n } else {\n pathList.push(part);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return pathList;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport { EndpointError } from \"../types\";\nimport { getAttrPathList } from \"./getAttrPathList\";\nexport var getAttr = function getAttr(value, path) {\n return getAttrPathList(path).reduce(function (acc, index) {\n if (_typeof(acc) !== \"object\") {\n throw new EndpointError(\"Index '\".concat(index, \"' in '\").concat(path, \"' not found in '\").concat(JSON.stringify(value), \"'\"));\n } else if (Array.isArray(acc)) {\n return acc[parseInt(index)];\n }\n\n return acc[index];\n }, value);\n};","export var HttpAuthLocation;\n\n(function (HttpAuthLocation) {\n HttpAuthLocation[\"HEADER\"] = \"header\";\n HttpAuthLocation[\"QUERY\"] = \"query\";\n})(HttpAuthLocation || (HttpAuthLocation = {}));","export var HostAddressType;\n\n(function (HostAddressType) {\n HostAddressType[\"AAAA\"] = \"AAAA\";\n HostAddressType[\"A\"] = \"A\";\n})(HostAddressType || (HostAddressType = {}));","export var EndpointURLScheme;\n\n(function (EndpointURLScheme) {\n EndpointURLScheme[\"HTTP\"] = \"http\";\n EndpointURLScheme[\"HTTPS\"] = \"https\";\n})(EndpointURLScheme || (EndpointURLScheme = {}));","export var RequestHandlerProtocol;\n\n(function (RequestHandlerProtocol) {\n RequestHandlerProtocol[\"HTTP_0_9\"] = \"http/0.9\";\n RequestHandlerProtocol[\"HTTP_1_0\"] = \"http/1.0\";\n RequestHandlerProtocol[\"TDS_8_0\"] = \"tds/8.0\";\n})(RequestHandlerProtocol || (RequestHandlerProtocol = {}));","var _DEFAULT_PORTS;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { EndpointURLScheme } from \"@aws-sdk/types\";\nimport { isIpAddress } from \"./isIpAddress\";\nvar DEFAULT_PORTS = (_DEFAULT_PORTS = {}, _defineProperty(_DEFAULT_PORTS, EndpointURLScheme.HTTP, 80), _defineProperty(_DEFAULT_PORTS, EndpointURLScheme.HTTPS, 443), _DEFAULT_PORTS);\nexport var parseURL = function parseURL(value) {\n var whatwgURL = function () {\n try {\n if (value instanceof URL) {\n return value;\n }\n\n if (_typeof(value) === \"object\" && \"hostname\" in value) {\n var _hostname = value.hostname,\n port = value.port,\n _value$protocol = value.protocol,\n _protocol = _value$protocol === void 0 ? \"\" : _value$protocol,\n _value$path = value.path,\n path = _value$path === void 0 ? \"\" : _value$path,\n _value$query = value.query,\n query = _value$query === void 0 ? {} : _value$query;\n\n var url = new URL(\"\".concat(_protocol, \"//\").concat(_hostname).concat(port ? \":\".concat(port) : \"\").concat(path));\n url.search = Object.entries(query).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n k = _ref2[0],\n v = _ref2[1];\n\n return \"\".concat(k, \"=\").concat(v);\n }).join(\"&\");\n return url;\n }\n\n return new URL(value);\n } catch (error) {\n return null;\n }\n }();\n\n if (!whatwgURL) {\n console.error(\"Unable to parse \".concat(JSON.stringify(value), \" as a whatwg URL.\"));\n return null;\n }\n\n var urlString = whatwgURL.href;\n var host = whatwgURL.host,\n hostname = whatwgURL.hostname,\n pathname = whatwgURL.pathname,\n protocol = whatwgURL.protocol,\n search = whatwgURL.search;\n\n if (search) {\n return null;\n }\n\n var scheme = protocol.slice(0, -1);\n\n if (!Object.values(EndpointURLScheme).includes(scheme)) {\n return null;\n }\n\n var isIp = isIpAddress(hostname);\n var inputContainsDefaultPort = urlString.includes(\"\".concat(host, \":\").concat(DEFAULT_PORTS[scheme])) || typeof value === \"string\" && value.includes(\"\".concat(host, \":\").concat(DEFAULT_PORTS[scheme]));\n var authority = \"\".concat(host).concat(inputContainsDefaultPort ? \":\".concat(DEFAULT_PORTS[scheme]) : \"\");\n return {\n scheme: scheme,\n authority: authority,\n path: pathname,\n normalizedPath: pathname.endsWith(\"/\") ? pathname : \"\".concat(pathname, \"/\"),\n isIp: isIp\n };\n};","export var isSet = function isSet(value) {\n return value != null;\n};","export var not = function not(value) {\n return !value;\n};","export var stringEquals = function stringEquals(value1, value2) {\n return value1 === value2;\n};","export var substring = function substring(input, start, stop, reverse) {\n if (start >= stop || input.length < stop) {\n return null;\n }\n\n if (!reverse) {\n return input.substring(start, stop);\n }\n\n return input.substring(input.length - stop, input.length - start);\n};","export var uriEncode = function uriEncode(value) {\n return encodeURIComponent(value).replace(/[!*'()]/g, function (c) {\n return \"%\".concat(c.charCodeAt(0).toString(16).toUpperCase());\n });\n};","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getAttr } from \"../lib\";\nexport var evaluateTemplate = function evaluateTemplate(template, options) {\n var evaluatedTemplateArr = [];\n\n var templateContext = _objectSpread(_objectSpread({}, options.endpointParams), options.referenceRecord);\n\n var currentIndex = 0;\n\n while (currentIndex < template.length) {\n var openingBraceIndex = template.indexOf(\"{\", currentIndex);\n\n if (openingBraceIndex === -1) {\n evaluatedTemplateArr.push(template.slice(currentIndex));\n break;\n }\n\n evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));\n var closingBraceIndex = template.indexOf(\"}\", openingBraceIndex);\n\n if (closingBraceIndex === -1) {\n evaluatedTemplateArr.push(template.slice(openingBraceIndex));\n break;\n }\n\n if (template[openingBraceIndex + 1] === \"{\" && template[closingBraceIndex + 1] === \"}\") {\n evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));\n currentIndex = closingBraceIndex + 2;\n }\n\n var parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);\n\n if (parameterName.includes(\"#\")) {\n var _parameterName$split = parameterName.split(\"#\"),\n _parameterName$split2 = _slicedToArray(_parameterName$split, 2),\n refName = _parameterName$split2[0],\n attrName = _parameterName$split2[1];\n\n evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));\n } else {\n evaluatedTemplateArr.push(templateContext[parameterName]);\n }\n\n currentIndex = closingBraceIndex + 1;\n }\n\n return evaluatedTemplateArr.join(\"\");\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nexport var getReferenceValue = function getReferenceValue(_ref, options) {\n var ref = _ref.ref;\n\n var referenceRecord = _objectSpread(_objectSpread({}, options.endpointParams), options.referenceRecord);\n\n return referenceRecord[ref];\n};","import { EndpointError } from \"../types\";\nimport { callFunction } from \"./callFunction\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\nimport { getReferenceValue } from \"./getReferenceValue\";\nexport var evaluateExpression = function evaluateExpression(obj, keyName, options) {\n if (typeof obj === \"string\") {\n return evaluateTemplate(obj, options);\n } else if (obj[\"fn\"]) {\n return callFunction(obj, options);\n } else if (obj[\"ref\"]) {\n return getReferenceValue(obj, options);\n }\n\n throw new EndpointError(\"'\".concat(keyName, \"': \").concat(String(obj), \" is not a string, function or reference.\"));\n};","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport * as lib from \"../lib\";\nimport { evaluateExpression } from \"./evaluateExpression\";\nexport var callFunction = function callFunction(_ref, options) {\n var fn = _ref.fn,\n argv = _ref.argv;\n var evaluatedArgs = argv.map(function (arg) {\n return [\"boolean\", \"number\"].includes(_typeof(arg)) ? arg : evaluateExpression(arg, \"arg\", options);\n });\n return fn.split(\".\").reduce(function (acc, key) {\n return acc[key];\n }, lib).apply(void 0, _toConsumableArray(evaluatedArgs));\n};","var _excluded = [\"assign\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { debugId, toDebugString } from \"../debug\";\nimport { EndpointError } from \"../types\";\nimport { callFunction } from \"./callFunction\";\nexport var evaluateCondition = function evaluateCondition(_ref, options) {\n var _options$logger, _options$logger$debug;\n\n var assign = _ref.assign,\n fnArgs = _objectWithoutProperties(_ref, _excluded);\n\n if (assign && assign in options.referenceRecord) {\n throw new EndpointError(\"'\".concat(assign, \"' is already defined in Reference Record.\"));\n }\n\n var value = callFunction(fnArgs, options);\n (_options$logger = options.logger) === null || _options$logger === void 0 ? void 0 : (_options$logger$debug = _options$logger.debug) === null || _options$logger$debug === void 0 ? void 0 : _options$logger$debug.call(_options$logger, debugId, \"evaluateCondition: \".concat(toDebugString(fnArgs), \" = \").concat(toDebugString(value)));\n return _objectSpread({\n result: value === \"\" ? true : !!value\n }, assign != null && {\n toAssign: {\n name: assign,\n value: value\n }\n });\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { debugId, toDebugString } from \"../debug\";\nimport { evaluateCondition } from \"./evaluateCondition\";\nexport var evaluateConditions = function evaluateConditions() {\n var conditions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var options = arguments.length > 1 ? arguments[1] : undefined;\n var conditionsReferenceRecord = {};\n\n var _iterator = _createForOfIteratorHelper(conditions),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var condition = _step.value;\n\n var _evaluateCondition = evaluateCondition(condition, _objectSpread(_objectSpread({}, options), {}, {\n referenceRecord: _objectSpread(_objectSpread({}, options.referenceRecord), conditionsReferenceRecord)\n })),\n result = _evaluateCondition.result,\n toAssign = _evaluateCondition.toAssign;\n\n if (!result) {\n return {\n result: result\n };\n }\n\n if (toAssign) {\n var _options$logger, _options$logger$debug;\n\n conditionsReferenceRecord[toAssign.name] = toAssign.value;\n (_options$logger = options.logger) === null || _options$logger === void 0 ? void 0 : (_options$logger$debug = _options$logger.debug) === null || _options$logger$debug === void 0 ? void 0 : _options$logger$debug.call(_options$logger, debugId, \"assign: \".concat(toAssign.name, \" := \").concat(toDebugString(toAssign.value)));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return {\n result: true,\n referenceRecord: conditionsReferenceRecord\n };\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { EndpointError } from \"../types\";\nimport { evaluateExpression } from \"./evaluateExpression\";\nexport var getEndpointHeaders = function getEndpointHeaders(headers, options) {\n return Object.entries(headers).reduce(function (acc, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n headerKey = _ref2[0],\n headerVal = _ref2[1];\n\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, headerKey, headerVal.map(function (headerValEntry) {\n var processedExpr = evaluateExpression(headerValEntry, \"Header value entry\", options);\n\n if (typeof processedExpr !== \"string\") {\n throw new EndpointError(\"Header '\".concat(headerKey, \"' value '\").concat(processedExpr, \"' is not a string\"));\n }\n\n return processedExpr;\n })));\n }, {});\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport { EndpointError } from \"../types\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\nimport { getEndpointProperties } from \"./getEndpointProperties\";\nexport var getEndpointProperty = function getEndpointProperty(property, options) {\n if (Array.isArray(property)) {\n return property.map(function (propertyEntry) {\n return getEndpointProperty(propertyEntry, options);\n });\n }\n\n switch (_typeof(property)) {\n case \"string\":\n return evaluateTemplate(property, options);\n\n case \"object\":\n if (property === null) {\n throw new EndpointError(\"Unexpected endpoint property: \".concat(property));\n }\n\n return getEndpointProperties(property, options);\n\n case \"boolean\":\n return property;\n\n default:\n throw new EndpointError(\"Unexpected endpoint property type: \".concat(_typeof(property)));\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { getEndpointProperty } from \"./getEndpointProperty\";\nexport var getEndpointProperties = function getEndpointProperties(properties, options) {\n return Object.entries(properties).reduce(function (acc, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n propertyKey = _ref2[0],\n propertyVal = _ref2[1];\n\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, propertyKey, getEndpointProperty(propertyVal, options)));\n }, {});\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport { EndpointError } from \"../types\";\nimport { evaluateExpression } from \"./evaluateExpression\";\nexport var getEndpointUrl = function getEndpointUrl(endpointUrl, options) {\n var expression = evaluateExpression(endpointUrl, \"Endpoint URL\", options);\n\n if (typeof expression === \"string\") {\n try {\n return new URL(expression);\n } catch (error) {\n console.error(\"Failed to construct URL with \".concat(expression), error);\n throw error;\n }\n }\n\n throw new EndpointError(\"Endpoint URL must be a string, got \".concat(_typeof(expression)));\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { debugId, toDebugString } from \"../debug\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { getEndpointHeaders } from \"./getEndpointHeaders\";\nimport { getEndpointProperties } from \"./getEndpointProperties\";\nimport { getEndpointUrl } from \"./getEndpointUrl\";\nexport var evaluateEndpointRule = function evaluateEndpointRule(endpointRule, options) {\n var _options$logger, _options$logger$debug;\n\n var conditions = endpointRule.conditions,\n endpoint = endpointRule.endpoint;\n\n var _evaluateConditions = evaluateConditions(conditions, options),\n result = _evaluateConditions.result,\n referenceRecord = _evaluateConditions.referenceRecord;\n\n if (!result) {\n return;\n }\n\n var endpointRuleOptions = _objectSpread(_objectSpread({}, options), {}, {\n referenceRecord: _objectSpread(_objectSpread({}, options.referenceRecord), referenceRecord)\n });\n\n var url = endpoint.url,\n properties = endpoint.properties,\n headers = endpoint.headers;\n (_options$logger = options.logger) === null || _options$logger === void 0 ? void 0 : (_options$logger$debug = _options$logger.debug) === null || _options$logger$debug === void 0 ? void 0 : _options$logger$debug.call(_options$logger, debugId, \"Resolving endpoint from template: \".concat(toDebugString(endpoint)));\n return _objectSpread(_objectSpread(_objectSpread({}, headers != undefined && {\n headers: getEndpointHeaders(headers, endpointRuleOptions)\n }), properties != undefined && {\n properties: getEndpointProperties(properties, endpointRuleOptions)\n }), {}, {\n url: getEndpointUrl(url, endpointRuleOptions)\n });\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { EndpointError } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateExpression } from \"./evaluateExpression\";\nexport var evaluateErrorRule = function evaluateErrorRule(errorRule, options) {\n var conditions = errorRule.conditions,\n error = errorRule.error;\n\n var _evaluateConditions = evaluateConditions(conditions, options),\n result = _evaluateConditions.result,\n referenceRecord = _evaluateConditions.referenceRecord;\n\n if (!result) {\n return;\n }\n\n throw new EndpointError(evaluateExpression(error, \"Error\", _objectSpread(_objectSpread({}, options), {}, {\n referenceRecord: _objectSpread(_objectSpread({}, options.referenceRecord), referenceRecord)\n })));\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateRules } from \"./evaluateRules\";\nexport var evaluateTreeRule = function evaluateTreeRule(treeRule, options) {\n var conditions = treeRule.conditions,\n rules = treeRule.rules;\n\n var _evaluateConditions = evaluateConditions(conditions, options),\n result = _evaluateConditions.result,\n referenceRecord = _evaluateConditions.referenceRecord;\n\n if (!result) {\n return;\n }\n\n return evaluateRules(rules, _objectSpread(_objectSpread({}, options), {}, {\n referenceRecord: _objectSpread(_objectSpread({}, options.referenceRecord), referenceRecord)\n }));\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { EndpointError } from \"../types\";\nimport { evaluateEndpointRule } from \"./evaluateEndpointRule\";\nimport { evaluateErrorRule } from \"./evaluateErrorRule\";\nimport { evaluateTreeRule } from \"./evaluateTreeRule\";\nexport var evaluateRules = function evaluateRules(rules, options) {\n var _iterator = _createForOfIteratorHelper(rules),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var rule = _step.value;\n\n if (rule.type === \"endpoint\") {\n var endpointOrUndefined = evaluateEndpointRule(rule, options);\n\n if (endpointOrUndefined) {\n return endpointOrUndefined;\n }\n } else if (rule.type === \"error\") {\n evaluateErrorRule(rule, options);\n } else if (rule.type === \"tree\") {\n var _endpointOrUndefined = evaluateTreeRule(rule, options);\n\n if (_endpointOrUndefined) {\n return _endpointOrUndefined;\n }\n } else {\n throw new EndpointError(\"Unknown endpoint rule: \".concat(rule));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n throw new EndpointError(\"Rules evaluation failed\");\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { debugId, toDebugString } from \"./debug\";\nimport { EndpointError } from \"./types\";\nimport { evaluateRules } from \"./utils\";\nexport var resolveEndpoint = function resolveEndpoint(ruleSetObject, options) {\n var _options$logger, _options$logger$debug, _options$endpointPara, _options$logger2, _options$logger2$debu;\n\n var endpointParams = options.endpointParams,\n logger = options.logger;\n var parameters = ruleSetObject.parameters,\n rules = ruleSetObject.rules;\n (_options$logger = options.logger) === null || _options$logger === void 0 ? void 0 : (_options$logger$debug = _options$logger.debug) === null || _options$logger$debug === void 0 ? void 0 : _options$logger$debug.call(_options$logger, debugId, \"Initial EndpointParams: \".concat(toDebugString(endpointParams)));\n var paramsWithDefault = Object.entries(parameters).filter(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n v = _ref2[1];\n\n return v[\"default\"] != null;\n }).map(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n k = _ref4[0],\n v = _ref4[1];\n\n return [k, v[\"default\"]];\n });\n\n if (paramsWithDefault.length > 0) {\n var _iterator = _createForOfIteratorHelper(paramsWithDefault),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _endpointParams$param;\n\n var _ref7 = _step.value;\n\n var _ref6 = _slicedToArray(_ref7, 2);\n\n var paramKey = _ref6[0];\n var paramDefaultValue = _ref6[1];\n endpointParams[paramKey] = (_endpointParams$param = endpointParams[paramKey]) !== null && _endpointParams$param !== void 0 ? _endpointParams$param : paramDefaultValue;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n var requiredParams = Object.entries(parameters).filter(function (_ref8) {\n var _ref9 = _slicedToArray(_ref8, 2),\n v = _ref9[1];\n\n return v.required;\n }).map(function (_ref10) {\n var _ref11 = _slicedToArray(_ref10, 1),\n k = _ref11[0];\n\n return k;\n });\n\n var _iterator2 = _createForOfIteratorHelper(requiredParams),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var requiredParam = _step2.value;\n\n if (endpointParams[requiredParam] == null) {\n throw new EndpointError(\"Missing required parameter: '\".concat(requiredParam, \"'\"));\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n var endpoint = evaluateRules(rules, {\n endpointParams: endpointParams,\n logger: logger,\n referenceRecord: {}\n });\n\n if ((_options$endpointPara = options.endpointParams) !== null && _options$endpointPara !== void 0 && _options$endpointPara.Endpoint) {\n try {\n var givenEndpoint = new URL(options.endpointParams.Endpoint);\n var protocol = givenEndpoint.protocol,\n port = givenEndpoint.port;\n endpoint.url.protocol = protocol;\n endpoint.url.port = port;\n } catch (e) {}\n }\n\n (_options$logger2 = options.logger) === null || _options$logger2 === void 0 ? void 0 : (_options$logger2$debu = _options$logger2.debug) === null || _options$logger2$debu === void 0 ? void 0 : _options$logger2$debu.call(_options$logger2, debugId, \"Resolved endpoint: \".concat(toDebugString(endpoint)));\n return endpoint;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nexport var ProviderError = /*#__PURE__*/function (_Error) {\n _inherits(ProviderError, _Error);\n\n var _super = _createSuper(ProviderError);\n\n function ProviderError(message) {\n var _this;\n\n var tryNextLink = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n _classCallCheck(this, ProviderError);\n\n _this = _super.call(this, message);\n _this.tryNextLink = tryNextLink;\n _this.name = \"ProviderError\";\n Object.setPrototypeOf(_assertThisInitialized(_this), ProviderError.prototype);\n return _this;\n }\n\n _createClass(ProviderError, null, [{\n key: \"from\",\n value: function from(error) {\n var tryNextLink = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return Object.assign(new this(error.message, tryNextLink), error);\n }\n }]);\n\n return ProviderError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { ProviderError } from \"./ProviderError\";\nexport var CredentialsProviderError = /*#__PURE__*/function (_ProviderError) {\n _inherits(CredentialsProviderError, _ProviderError);\n\n var _super = _createSuper(CredentialsProviderError);\n\n function CredentialsProviderError(message) {\n var _this;\n\n var tryNextLink = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n _classCallCheck(this, CredentialsProviderError);\n\n _this = _super.call(this, message, tryNextLink);\n _this.tryNextLink = tryNextLink;\n _this.name = \"CredentialsProviderError\";\n Object.setPrototypeOf(_assertThisInitialized(_this), CredentialsProviderError.prototype);\n return _this;\n }\n\n return _createClass(CredentialsProviderError);\n}(ProviderError);","export var fromStatic = function fromStatic(staticValue) {\n return function () {\n return Promise.resolve(staticValue);\n };\n};","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nexport var memoize = function memoize(provider, isExpired, requiresRefresh) {\n var resolved;\n var pending;\n var hasResult;\n var isConstant = false;\n\n var coalesceProvider = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!pending) {\n pending = provider();\n }\n\n _context.prev = 1;\n _context.next = 4;\n return pending;\n\n case 4:\n resolved = _context.sent;\n hasResult = true;\n isConstant = false;\n\n case 7:\n _context.prev = 7;\n pending = undefined;\n return _context.finish(7);\n\n case 10:\n return _context.abrupt(\"return\", resolved);\n\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[1,, 7, 10]]);\n }));\n\n return function coalesceProvider() {\n return _ref.apply(this, arguments);\n };\n }();\n\n if (isExpired === undefined) {\n return /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(options) {\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(!hasResult || options !== null && options !== void 0 && options.forceRefresh)) {\n _context2.next = 4;\n break;\n }\n\n _context2.next = 3;\n return coalesceProvider();\n\n case 3:\n resolved = _context2.sent;\n\n case 4:\n return _context2.abrupt(\"return\", resolved);\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x) {\n return _ref2.apply(this, arguments);\n };\n }();\n }\n\n return /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {\n return _regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n if (!(!hasResult || options !== null && options !== void 0 && options.forceRefresh)) {\n _context3.next = 4;\n break;\n }\n\n _context3.next = 3;\n return coalesceProvider();\n\n case 3:\n resolved = _context3.sent;\n\n case 4:\n if (!isConstant) {\n _context3.next = 6;\n break;\n }\n\n return _context3.abrupt(\"return\", resolved);\n\n case 6:\n if (!(requiresRefresh && !requiresRefresh(resolved))) {\n _context3.next = 9;\n break;\n }\n\n isConstant = true;\n return _context3.abrupt(\"return\", resolved);\n\n case 9:\n if (!isExpired(resolved)) {\n _context3.next = 13;\n break;\n }\n\n _context3.next = 12;\n return coalesceProvider();\n\n case 12:\n return _context3.abrupt(\"return\", resolved);\n\n case 13:\n return _context3.abrupt(\"return\", resolved);\n\n case 14:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function (_x2) {\n return _ref3.apply(this, arguments);\n };\n }();\n};","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import { useRef, useCallback } from 'react';\n\nvar updateRef = function updateRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n return;\n }\n\n ref.current = value;\n};\n\nvar useComposedRef = function useComposedRef(libRef, userRef) {\n var prevUserRef = useRef();\n return useCallback(function (instance) {\n libRef.current = instance;\n\n if (prevUserRef.current) {\n updateRef(prevUserRef.current, null);\n }\n\n prevUserRef.current = userRef;\n\n if (!userRef) {\n return;\n }\n\n updateRef(userRef, instance);\n }, [userRef]);\n};\n\nexport default useComposedRef;","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { useLayoutEffect, forwardRef, useRef, createElement } from 'react';\nimport useLatest from 'use-latest';\nimport useComposedRef from 'use-composed-ref';\nvar HIDDEN_TEXTAREA_STYLE = {\n 'min-height': '0',\n 'max-height': 'none',\n height: '0',\n visibility: 'hidden',\n overflow: 'hidden',\n position: 'absolute',\n 'z-index': '-1000',\n top: '0',\n right: '0'\n};\n\nvar forceHiddenStyles = function forceHiddenStyles(node) {\n Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function (key) {\n node.style.setProperty(key, HIDDEN_TEXTAREA_STYLE[key], 'important');\n });\n}; // TODO: use labelled tuples once they are avaiable:\n// export type CalculatedNodeHeights = [height: number, rowHeight: number];\n// https://github.com/microsoft/TypeScript/issues/28259\n\n\nvar hiddenTextarea = null;\n\nvar getHeight = function getHeight(node, sizingData) {\n var height = node.scrollHeight;\n\n if (sizingData.sizingStyle.boxSizing === 'border-box') {\n // border-box: add border, since height = content + padding + border\n return height + sizingData.borderSize;\n } // remove padding, since height = content\n\n\n return height - sizingData.paddingSize;\n};\n\nfunction calculateNodeHeight(sizingData, value, minRows, maxRows) {\n if (minRows === void 0) {\n minRows = 1;\n }\n\n if (maxRows === void 0) {\n maxRows = Infinity;\n }\n\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement('textarea');\n hiddenTextarea.setAttribute('tabindex', '-1');\n hiddenTextarea.setAttribute('aria-hidden', 'true');\n forceHiddenStyles(hiddenTextarea);\n }\n\n if (hiddenTextarea.parentNode === null) {\n document.body.appendChild(hiddenTextarea);\n }\n\n var paddingSize = sizingData.paddingSize,\n borderSize = sizingData.borderSize,\n sizingStyle = sizingData.sizingStyle;\n var boxSizing = sizingStyle.boxSizing;\n Object.keys(sizingStyle).forEach(function (_key) {\n var key = _key;\n hiddenTextarea.style[key] = sizingStyle[key];\n });\n forceHiddenStyles(hiddenTextarea);\n hiddenTextarea.value = value;\n var height = getHeight(hiddenTextarea, sizingData); // Double set and calc due to Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1795904\n\n hiddenTextarea.value = value;\n height = getHeight(hiddenTextarea, sizingData); // measure height of a textarea with a single row\n\n hiddenTextarea.value = 'x';\n var rowHeight = hiddenTextarea.scrollHeight - paddingSize;\n var minHeight = rowHeight * minRows;\n\n if (boxSizing === 'border-box') {\n minHeight = minHeight + paddingSize + borderSize;\n }\n\n height = Math.max(minHeight, height);\n var maxHeight = rowHeight * maxRows;\n\n if (boxSizing === 'border-box') {\n maxHeight = maxHeight + paddingSize + borderSize;\n }\n\n height = Math.min(maxHeight, height);\n return [height, rowHeight];\n}\n\nvar noop = function noop() {};\n\nvar pick = function pick(props, obj) {\n return props.reduce(function (acc, prop) {\n acc[prop] = obj[prop];\n return acc;\n }, {});\n};\n\nvar SIZING_STYLE = ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'boxSizing', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'letterSpacing', 'lineHeight', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', // non-standard\n'tabSize', 'textIndent', // non-standard\n'textRendering', 'textTransform', 'width', 'wordBreak'];\nvar isIE = !!document.documentElement.currentStyle;\n\nvar getSizingData = function getSizingData(node) {\n var style = window.getComputedStyle(node);\n\n if (style === null) {\n return null;\n }\n\n var sizingStyle = pick(SIZING_STYLE, style);\n var boxSizing = sizingStyle.boxSizing; // probably node is detached from DOM, can't read computed dimensions\n\n if (boxSizing === '') {\n return null;\n } // IE (Edge has already correct behaviour) returns content width as computed width\n // so we need to add manually padding and border widths\n\n\n if (isIE && boxSizing === 'border-box') {\n sizingStyle.width = parseFloat(sizingStyle.width) + parseFloat(sizingStyle.borderRightWidth) + parseFloat(sizingStyle.borderLeftWidth) + parseFloat(sizingStyle.paddingRight) + parseFloat(sizingStyle.paddingLeft) + 'px';\n }\n\n var paddingSize = parseFloat(sizingStyle.paddingBottom) + parseFloat(sizingStyle.paddingTop);\n var borderSize = parseFloat(sizingStyle.borderBottomWidth) + parseFloat(sizingStyle.borderTopWidth);\n return {\n sizingStyle: sizingStyle,\n paddingSize: paddingSize,\n borderSize: borderSize\n };\n};\n\nfunction useListener(target, type, listener) {\n var latestListener = useLatest(listener);\n useLayoutEffect(function () {\n var handler = function handler(ev) {\n return latestListener.current(ev);\n };\n\n target.addEventListener(type, handler);\n return function () {\n return target.removeEventListener(type, handler);\n };\n }, []);\n}\n\nvar useWindowResizeListener = function useWindowResizeListener(listener) {\n useListener(window, 'resize', listener);\n};\n\nvar useFontsLoadedListener = function useFontsLoadedListener(listener) {\n useListener(document.fonts, 'loadingdone', listener);\n};\n\nvar _excluded = [\"cacheMeasurements\", \"maxRows\", \"minRows\", \"onChange\", \"onHeightChange\"];\n\nvar TextareaAutosize = function TextareaAutosize(_ref, userRef) {\n var cacheMeasurements = _ref.cacheMeasurements,\n maxRows = _ref.maxRows,\n minRows = _ref.minRows,\n _ref$onChange = _ref.onChange,\n onChange = _ref$onChange === void 0 ? noop : _ref$onChange,\n _ref$onHeightChange = _ref.onHeightChange,\n onHeightChange = _ref$onHeightChange === void 0 ? noop : _ref$onHeightChange,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n if (process.env.NODE_ENV !== 'production' && props.style) {\n if ('maxHeight' in props.style) {\n throw new Error('Using `style.maxHeight` for is not supported. Please use `maxRows`.');\n }\n\n if ('minHeight' in props.style) {\n throw new Error('Using `style.minHeight` for is not supported. Please use `minRows`.');\n }\n }\n\n var isControlled = props.value !== undefined;\n var libRef = useRef(null);\n var ref = useComposedRef(libRef, userRef);\n var heightRef = useRef(0);\n var measurementsCacheRef = useRef();\n\n var resizeTextarea = function resizeTextarea() {\n var node = libRef.current;\n var nodeSizingData = cacheMeasurements && measurementsCacheRef.current ? measurementsCacheRef.current : getSizingData(node);\n\n if (!nodeSizingData) {\n return;\n }\n\n measurementsCacheRef.current = nodeSizingData;\n\n var _calculateNodeHeight = calculateNodeHeight(nodeSizingData, node.value || node.placeholder || 'x', minRows, maxRows),\n height = _calculateNodeHeight[0],\n rowHeight = _calculateNodeHeight[1];\n\n if (heightRef.current !== height) {\n heightRef.current = height;\n node.style.setProperty('height', height + \"px\", 'important');\n onHeightChange(height, {\n rowHeight: rowHeight\n });\n }\n };\n\n var handleChange = function handleChange(event) {\n if (!isControlled) {\n resizeTextarea();\n }\n\n onChange(event);\n };\n\n {\n useLayoutEffect(resizeTextarea);\n useWindowResizeListener(resizeTextarea);\n useFontsLoadedListener(resizeTextarea);\n }\n return /*#__PURE__*/createElement(\"textarea\", _extends({}, props, {\n onChange: handleChange,\n ref: ref\n }));\n};\n\nvar index = /* #__PURE__ */forwardRef(TextareaAutosize);\nexport default index;","import * as React from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\n\nvar useLatest = function useLatest(value) {\n var ref = React.useRef(value);\n useIsomorphicLayoutEffect(function () {\n ref.current = value;\n });\n return ref;\n};\n\nexport { useLatest as default };","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","/**\n * Map of named character references.\n *\n * @type {Record}\n */\nexport var characterEntities = {\n AEli: 'Æ',\n AElig: 'Æ',\n AM: '&',\n AMP: '&',\n Aacut: 'Á',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acir: 'Â',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrav: 'À',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '',\n Arin: 'Å',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atild: 'Ã',\n Atilde: 'Ã',\n Aum: 'Ä',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COP: '©',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedi: 'Ç',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ET: 'Ð',\n ETH: 'Ð',\n Eacut: 'É',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecir: 'Ê',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrav: 'È',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Eum: 'Ë',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n G: '>',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacut: 'Í',\n Iacute: 'Í',\n Icir: 'Î',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrav: 'Ì',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '',\n InvisibleTimes: '',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Ium: 'Ï',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n L: '<',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '',\n NegativeThickSpace: '',\n NegativeThinSpace: '',\n NegativeVeryThinSpace: '',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntild: 'Ñ',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacut: 'Ó',\n Oacute: 'Ó',\n Ocir: 'Ô',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograv: 'Ò',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslas: 'Ø',\n Oslash: 'Ø',\n Otild: 'Õ',\n Otilde: 'Õ',\n Otimes: '⨷',\n Oum: 'Ö',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUO: '\"',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n RE: '®',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THOR: 'Þ',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: ' ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacut: 'Ú',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucir: 'Û',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrav: 'Ù',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uum: 'Ü',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacut: 'Ý',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacut: 'á',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acir: 'â',\n acirc: 'â',\n acut: '´',\n acute: '´',\n acy: 'а',\n aeli: 'æ',\n aelig: 'æ',\n af: '',\n afr: '𝔞',\n agrav: 'à',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n am: '&',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n arin: 'å',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atild: 'ã',\n atilde: 'ã',\n aum: 'ä',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvba: '¦',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedi: 'ç',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedi: '¸',\n cedil: '¸',\n cemptyv: '⦲',\n cen: '¢',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n cop: '©',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curre: '¤',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n de: '°',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divid: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacut: 'é',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: 'ê',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrav: 'è',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n et: 'ð',\n eth: 'ð',\n eum: 'ë',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac1: '¼',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac3: '¾',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n g: '>',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacut: 'í',\n iacute: 'í',\n ic: '',\n icir: 'î',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexc: '¡',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrav: 'ì',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n \"in\": '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n \"int\": '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iques: '¿',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '',\n itilde: 'ĩ',\n iukcy: 'і',\n ium: 'ï',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laqu: '«',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n l: '<',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n mac: '¯',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micr: 'µ',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middo: '·',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbs: ' ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n no: '¬',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntild: 'ñ',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacut: 'ó',\n oacute: 'ó',\n oast: '⊛',\n ocir: 'ô',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograv: 'ò',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: 'º',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslas: 'ø',\n oslash: 'ø',\n osol: '⊘',\n otild: 'õ',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n oum: 'ö',\n ouml: 'ö',\n ovbar: '⌽',\n par: '¶',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusm: '±',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n poun: '£',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quo: '\"',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raqu: '»',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n re: '®',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sec: '§',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n sh: '',\n shy: '',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup: '⊃',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szli: 'ß',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thor: 'þ',\n thorn: 'þ',\n tilde: '˜',\n time: '×',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacut: 'ú',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucir: 'û',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrav: 'ù',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n um: '¨',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uum: 'ü',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacut: 'ý',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n ye: '¥',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yum: 'ÿ',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '',\n zwnj: ''\n};","import { characterEntities } from 'character-entities';\nvar own = {}.hasOwnProperty;\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\n\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false;\n}","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a character code represents whitespace, punctuation, or\n * something else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * Note that eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * @returns {number|undefined}\n */\n\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n\n if (unicodePunctuation(code)) {\n return 2;\n }\n}","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nexport function resolveHostHeaderConfig(input) {\n return input;\n}\nexport var hostHeaderMiddleware = function hostHeaderMiddleware(options) {\n return function (next) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(args) {\n var request, _ref2, _ref2$handlerProtocol, handlerProtocol, host;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (HttpRequest.isInstance(args.request)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\", next(args));\n\n case 2:\n request = args.request;\n _ref2 = options.requestHandler.metadata || {}, _ref2$handlerProtocol = _ref2.handlerProtocol, handlerProtocol = _ref2$handlerProtocol === void 0 ? \"\" : _ref2$handlerProtocol;\n\n if (handlerProtocol.indexOf(\"h2\") >= 0 && !request.headers[\":authority\"]) {\n delete request.headers[\"host\"];\n request.headers[\":authority\"] = \"\";\n } else if (!request.headers[\"host\"]) {\n host = request.hostname;\n if (request.port != null) host += \":\".concat(request.port);\n request.headers[\"host\"] = host;\n }\n\n return _context.abrupt(\"return\", next(args));\n\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};\nexport var hostHeaderMiddlewareOptions = {\n name: \"hostHeaderMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"HOST\"],\n override: true\n};\nexport var getHostHeaderPlugin = function getHostHeaderPlugin(options) {\n return {\n applyToStack: function applyToStack(clientStack) {\n clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);\n }\n };\n};","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n'use strict';\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {};\n var opt = options || {};\n var pairs = str.split(';');\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('='); // skip things that don't look like key=value\n\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim(); // only assign once\n\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim(); // quoted values\n\n if (val[0] === '\"') {\n val = val.slice(1, -1);\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid');\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n\n case 'lax':\n str += '; SameSite=Lax';\n break;\n\n case 'strict':\n str += '; SameSite=Strict';\n break;\n\n case 'none':\n str += '; SameSite=None';\n break;\n\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}","export var asSdkError = function asSdkError(error) {\n if (error instanceof Error) return error;\n if (error instanceof Object) return Object.assign(new Error(), error);\n if (typeof error === \"string\") return new Error(error);\n return new Error(\"AWS SDK error wrapper for \".concat(error));\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar _excluded = [\"rateLimiter\"];\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { DefaultRateLimiter, RETRY_MODES } from \"@aws-sdk/util-retry\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nexport var AdaptiveRetryStrategy = /*#__PURE__*/function (_StandardRetryStrateg) {\n _inherits(AdaptiveRetryStrategy, _StandardRetryStrateg);\n\n var _super = _createSuper(AdaptiveRetryStrategy);\n\n function AdaptiveRetryStrategy(maxAttemptsProvider, options) {\n var _this;\n\n _classCallCheck(this, AdaptiveRetryStrategy);\n\n var _ref = options !== null && options !== void 0 ? options : {},\n rateLimiter = _ref.rateLimiter,\n superOptions = _objectWithoutProperties(_ref, _excluded);\n\n _this = _super.call(this, maxAttemptsProvider, superOptions);\n _this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter();\n _this.mode = RETRY_MODES.ADAPTIVE;\n return _this;\n }\n\n _createClass(AdaptiveRetryStrategy, [{\n key: \"retry\",\n value: function () {\n var _retry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(next, args) {\n var _this2 = this;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", _get(_getPrototypeOf(AdaptiveRetryStrategy.prototype), \"retry\", this).call(this, next, args, {\n beforeRequest: function () {\n var _beforeRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", _this2.rateLimiter.getSendToken());\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function beforeRequest() {\n return _beforeRequest.apply(this, arguments);\n }\n\n return beforeRequest;\n }(),\n afterRequest: function afterRequest(response) {\n _this2.rateLimiter.updateClientSendingRate(response);\n }\n }));\n\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function retry(_x, _x2) {\n return _retry.apply(this, arguments);\n }\n\n return retry;\n }()\n }]);\n\n return AdaptiveRetryStrategy;\n}(StandardRetryStrategy);","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeProvider } from \"@aws-sdk/util-middleware\";\nimport { AdaptiveRetryStrategy, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, RETRY_MODES, StandardRetryStrategy } from \"@aws-sdk/util-retry\";\nexport var ENV_MAX_ATTEMPTS = \"AWS_MAX_ATTEMPTS\";\nexport var CONFIG_MAX_ATTEMPTS = \"max_attempts\";\nexport var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {\n environmentVariableSelector: function environmentVariableSelector(env) {\n var value = env[ENV_MAX_ATTEMPTS];\n if (!value) return undefined;\n var maxAttempt = parseInt(value);\n\n if (Number.isNaN(maxAttempt)) {\n throw new Error(\"Environment variable \".concat(ENV_MAX_ATTEMPTS, \" mast be a number, got \\\"\").concat(value, \"\\\"\"));\n }\n\n return maxAttempt;\n },\n configFileSelector: function configFileSelector(profile) {\n var value = profile[CONFIG_MAX_ATTEMPTS];\n if (!value) return undefined;\n var maxAttempt = parseInt(value);\n\n if (Number.isNaN(maxAttempt)) {\n throw new Error(\"Shared config file entry \".concat(CONFIG_MAX_ATTEMPTS, \" mast be a number, got \\\"\").concat(value, \"\\\"\"));\n }\n\n return maxAttempt;\n },\n \"default\": DEFAULT_MAX_ATTEMPTS\n};\nexport var resolveRetryConfig = function resolveRetryConfig(input) {\n var _input$maxAttempts;\n\n var _retryStrategy = input.retryStrategy;\n var maxAttempts = normalizeProvider((_input$maxAttempts = input.maxAttempts) !== null && _input$maxAttempts !== void 0 ? _input$maxAttempts : DEFAULT_MAX_ATTEMPTS);\n return _objectSpread(_objectSpread({}, input), {}, {\n maxAttempts: maxAttempts,\n retryStrategy: function () {\n var _retryStrategy2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var retryMode;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!_retryStrategy) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\", _retryStrategy);\n\n case 2:\n _context.next = 4;\n return normalizeProvider(input.retryMode)();\n\n case 4:\n retryMode = _context.sent;\n\n if (!(retryMode === RETRY_MODES.ADAPTIVE)) {\n _context.next = 7;\n break;\n }\n\n return _context.abrupt(\"return\", new AdaptiveRetryStrategy(maxAttempts));\n\n case 7:\n return _context.abrupt(\"return\", new StandardRetryStrategy(maxAttempts));\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function retryStrategy() {\n return _retryStrategy2.apply(this, arguments);\n }\n\n return retryStrategy;\n }()\n });\n};\nexport var ENV_RETRY_MODE = \"AWS_RETRY_MODE\";\nexport var CONFIG_RETRY_MODE = \"retry_mode\";\nexport var NODE_RETRY_MODE_CONFIG_OPTIONS = {\n environmentVariableSelector: function environmentVariableSelector(env) {\n return env[ENV_RETRY_MODE];\n },\n configFileSelector: function configFileSelector(profile) {\n return profile[CONFIG_RETRY_MODE];\n },\n \"default\": DEFAULT_RETRY_MODE\n};","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { HttpRequest, HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { isServerError, isThrottlingError, isTransientError } from \"@aws-sdk/service-error-classification\";\nimport { INVOCATION_ID_HEADER, REQUEST_HEADER } from \"@aws-sdk/util-retry\";\nimport { v4 } from \"uuid\";\nimport { asSdkError } from \"./util\";\nexport var retryMiddleware = function retryMiddleware(options) {\n return function (next, context) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(args) {\n var retryStrategy, maxAttempts, retryToken, lastError, attempts, totalRetryDelay, request, _yield$next, response, output, _retryStrategy;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return options.retryStrategy();\n\n case 2:\n retryStrategy = _context2.sent;\n _context2.next = 5;\n return options.maxAttempts();\n\n case 5:\n maxAttempts = _context2.sent;\n\n if (!isRetryStrategyV2(retryStrategy)) {\n _context2.next = 37;\n break;\n }\n\n retryStrategy = retryStrategy;\n _context2.next = 10;\n return retryStrategy.acquireInitialRetryToken(context[\"partition_id\"]);\n\n case 10:\n retryToken = _context2.sent;\n lastError = new Error();\n attempts = 0;\n totalRetryDelay = 0;\n request = args.request;\n\n if (HttpRequest.isInstance(request)) {\n request.headers[INVOCATION_ID_HEADER] = v4();\n }\n\n case 16:\n if (!true) {\n _context2.next = 35;\n break;\n }\n\n _context2.prev = 17;\n\n if (HttpRequest.isInstance(request)) {\n request.headers[REQUEST_HEADER] = \"attempt=\".concat(attempts + 1, \"; max=\").concat(maxAttempts);\n }\n\n _context2.next = 21;\n return next(args);\n\n case 21:\n _yield$next = _context2.sent;\n response = _yield$next.response;\n output = _yield$next.output;\n retryStrategy.recordSuccess(retryToken);\n output.$metadata.attempts = attempts + 1;\n output.$metadata.totalRetryDelay = totalRetryDelay;\n return _context2.abrupt(\"return\", {\n response: response,\n output: output\n });\n\n case 30:\n _context2.prev = 30;\n _context2.t0 = _context2[\"catch\"](17);\n return _context2.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var retryErrorInfo, delay;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n retryErrorInfo = getRetyErrorInto(_context2.t0);\n lastError = asSdkError(_context2.t0);\n _context.prev = 2;\n _context.next = 5;\n return retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);\n\n case 5:\n retryToken = _context.sent;\n _context.next = 14;\n break;\n\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](2);\n\n if (!lastError.$metadata) {\n lastError.$metadata = {};\n }\n\n lastError.$metadata.attempts = attempts + 1;\n lastError.$metadata.totalRetryDelay = totalRetryDelay;\n throw lastError;\n\n case 14:\n attempts = retryToken.getRetryCount();\n delay = retryToken.getRetryDelay();\n totalRetryDelay += delay;\n _context.next = 19;\n return new Promise(function (resolve) {\n return setTimeout(resolve, delay);\n });\n\n case 19:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[2, 8]]);\n })(), \"t1\", 33);\n\n case 33:\n _context2.next = 16;\n break;\n\n case 35:\n _context2.next = 40;\n break;\n\n case 37:\n retryStrategy = retryStrategy;\n if ((_retryStrategy = retryStrategy) !== null && _retryStrategy !== void 0 && _retryStrategy.mode) context.userAgent = [].concat(_toConsumableArray(context.userAgent || []), [[\"cfg/retry-mode\", retryStrategy.mode]]);\n return _context2.abrupt(\"return\", retryStrategy.retry(next, args));\n\n case 40:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, null, [[17, 30]]);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};\n\nvar isRetryStrategyV2 = function isRetryStrategyV2(retryStrategy) {\n return typeof retryStrategy.acquireInitialRetryToken !== \"undefined\" && typeof retryStrategy.refreshRetryTokenForRetry !== \"undefined\" && typeof retryStrategy.recordSuccess !== \"undefined\";\n};\n\nvar getRetyErrorInto = function getRetyErrorInto(error) {\n var errorInfo = {\n errorType: getRetryErrorType(error)\n };\n var retryAfterHint = getRetryAfterHint(error.$response);\n\n if (retryAfterHint) {\n errorInfo.retryAfterHint = retryAfterHint;\n }\n\n return errorInfo;\n};\n\nvar getRetryErrorType = function getRetryErrorType(error) {\n if (isThrottlingError(error)) return \"THROTTLING\";\n if (isTransientError(error)) return \"TRANSIENT\";\n if (isServerError(error)) return \"SERVER_ERROR\";\n return \"CLIENT_ERROR\";\n};\n\nexport var retryMiddlewareOptions = {\n name: \"retryMiddleware\",\n tags: [\"RETRY\"],\n step: \"finalizeRequest\",\n priority: \"high\",\n override: true\n};\nexport var getRetryPlugin = function getRetryPlugin(options) {\n return {\n applyToStack: function applyToStack(clientStack) {\n clientStack.add(retryMiddleware(options), retryMiddlewareOptions);\n }\n };\n};\nexport var getRetryAfterHint = function getRetryAfterHint(response) {\n if (!HttpResponse.isInstance(response)) return;\n var retryAfterHeaderName = Object.keys(response.headers).find(function (key) {\n return key.toLowerCase() === \"retry-after\";\n });\n if (!retryAfterHeaderName) return;\n var retryAfter = response.headers[retryAfterHeaderName];\n var retryAfterSeconds = Number(retryAfter);\n if (!Number.isNaN(retryAfterSeconds)) return new Date(retryAfterSeconds * 1000);\n var retryAfterDate = new Date(retryAfter);\n return retryAfterDate;\n};","function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\nexport function buildQueryString(query) {\n var parts = [];\n\n var _iterator = _createForOfIteratorHelper(Object.keys(query).sort()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var key = _step.value;\n var value = query[key];\n key = escapeUri(key);\n\n if (Array.isArray(value)) {\n for (var i = 0, iLen = value.length; i < iLen; i++) {\n parts.push(\"\".concat(key, \"=\").concat(escapeUri(value[i])));\n }\n } else {\n var qsEntry = key;\n\n if (value || typeof value === \"string\") {\n qsEntry += \"=\".concat(escapeUri(value));\n }\n\n parts.push(qsEntry);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return parts.join(\"&\");\n}","export function requestTimeout() {\n var timeoutInMs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return new Promise(function (resolve, reject) {\n if (timeoutInMs) {\n setTimeout(function () {\n var timeoutError = new Error(\"Request did not complete within \".concat(timeoutInMs, \" ms\"));\n timeoutError.name = \"TimeoutError\";\n reject(timeoutError);\n }, timeoutInMs);\n }\n });\n}","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { buildQueryString } from \"@aws-sdk/querystring-builder\";\nimport { requestTimeout } from \"./request-timeout\";\nexport var FetchHttpHandler = /*#__PURE__*/function () {\n function FetchHttpHandler(options) {\n _classCallCheck(this, FetchHttpHandler);\n\n if (typeof options === \"function\") {\n this.configProvider = options().then(function (opts) {\n return opts || {};\n });\n } else {\n this.config = options !== null && options !== void 0 ? options : {};\n this.configProvider = Promise.resolve(this.config);\n }\n }\n\n _createClass(FetchHttpHandler, [{\n key: \"destroy\",\n value: function destroy() {}\n }, {\n key: \"handle\",\n value: function () {\n var _handle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(request) {\n var _ref,\n abortSignal,\n requestTimeoutInMs,\n abortError,\n path,\n queryString,\n port,\n method,\n url,\n body,\n requestOptions,\n fetchRequest,\n raceOfPromises,\n _args = arguments;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _ref = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, abortSignal = _ref.abortSignal;\n\n if (this.config) {\n _context.next = 5;\n break;\n }\n\n _context.next = 4;\n return this.configProvider;\n\n case 4:\n this.config = _context.sent;\n\n case 5:\n requestTimeoutInMs = this.config.requestTimeout;\n\n if (!(abortSignal !== null && abortSignal !== void 0 && abortSignal.aborted)) {\n _context.next = 10;\n break;\n }\n\n abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n return _context.abrupt(\"return\", Promise.reject(abortError));\n\n case 10:\n path = request.path;\n\n if (request.query) {\n queryString = buildQueryString(request.query);\n\n if (queryString) {\n path += \"?\".concat(queryString);\n }\n }\n\n port = request.port, method = request.method;\n url = \"\".concat(request.protocol, \"//\").concat(request.hostname).concat(port ? \":\".concat(port) : \"\").concat(path);\n body = method === \"GET\" || method === \"HEAD\" ? undefined : request.body;\n requestOptions = {\n body: body,\n headers: new Headers(request.headers),\n method: method\n };\n\n if (typeof AbortController !== \"undefined\") {\n requestOptions[\"signal\"] = abortSignal;\n }\n\n fetchRequest = new Request(url, requestOptions);\n raceOfPromises = [fetch(fetchRequest).then(function (response) {\n var fetchHeaders = response.headers;\n var transformedHeaders = {};\n\n var _iterator = _createForOfIteratorHelper(fetchHeaders.entries()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pair = _step.value;\n transformedHeaders[pair[0]] = pair[1];\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var hasReadableStream = response.body !== undefined;\n\n if (!hasReadableStream) {\n return response.blob().then(function (body) {\n return {\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: body\n })\n };\n });\n }\n\n return {\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: response.body\n })\n };\n }), requestTimeout(requestTimeoutInMs)];\n\n if (abortSignal) {\n raceOfPromises.push(new Promise(function (resolve, reject) {\n abortSignal.onabort = function () {\n var abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n };\n }));\n }\n\n return _context.abrupt(\"return\", Promise.race(raceOfPromises));\n\n case 21:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function handle(_x) {\n return _handle.apply(this, arguments);\n }\n\n return handle;\n }()\n }]);\n\n return FetchHttpHandler;\n}();","import _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { fromBase64 } from \"@aws-sdk/util-base64\";\nexport var streamCollector = function streamCollector(stream) {\n if (typeof Blob === \"function\" && stream instanceof Blob) {\n return collectBlob(stream);\n }\n\n return collectStream(stream);\n};\n\nfunction collectBlob(_x) {\n return _collectBlob.apply(this, arguments);\n}\n\nfunction _collectBlob() {\n _collectBlob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {\n var base64, arrayBuffer;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return readToBase64(blob);\n\n case 2:\n base64 = _context.sent;\n arrayBuffer = fromBase64(base64);\n return _context.abrupt(\"return\", new Uint8Array(arrayBuffer));\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _collectBlob.apply(this, arguments);\n}\n\nfunction collectStream(_x2) {\n return _collectStream.apply(this, arguments);\n}\n\nfunction _collectStream() {\n _collectStream = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(stream) {\n var res, reader, isDone, _yield$reader$read, done, value, prior;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n res = new Uint8Array(0);\n reader = stream.getReader();\n isDone = false;\n\n case 3:\n if (isDone) {\n _context2.next = 13;\n break;\n }\n\n _context2.next = 6;\n return reader.read();\n\n case 6:\n _yield$reader$read = _context2.sent;\n done = _yield$reader$read.done;\n value = _yield$reader$read.value;\n\n if (value) {\n prior = res;\n res = new Uint8Array(prior.length + value.length);\n res.set(prior);\n res.set(value, prior.length);\n }\n\n isDone = done;\n _context2.next = 3;\n break;\n\n case 13:\n return _context2.abrupt(\"return\", res);\n\n case 14:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _collectStream.apply(this, arguments);\n}\n\nfunction readToBase64(blob) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n\n reader.onloadend = function () {\n var _reader$result;\n\n if (reader.readyState !== 2) {\n return reject(new Error(\"Reader aborted too early\"));\n }\n\n var result = (_reader$result = reader.result) !== null && _reader$result !== void 0 ? _reader$result : \"\";\n var commaIndex = result.indexOf(\",\");\n var dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n resolve(result.substring(dataOffset));\n };\n\n reader.onabort = function () {\n return reject(new Error(\"Read aborted\"));\n };\n\n reader.onerror = function () {\n return reject(reader.error);\n };\n\n reader.readAsDataURL(blob);\n });\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nexport function resolveUserAgentConfig(input) {\n return _objectSpread(_objectSpread({}, input), {}, {\n customUserAgent: typeof input.customUserAgent === \"string\" ? [[input.customUserAgent]] : input.customUserAgent\n });\n}","export var USER_AGENT = \"user-agent\";\nexport var X_AMZ_USER_AGENT = \"x-amz-user-agent\";\nexport var SPACE = \" \";\nexport var UA_ESCAPE_REGEX = /[^\\!\\#\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w]/g;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport { getUserAgentPrefix } from \"@aws-sdk/util-endpoints\";\nimport { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from \"./constants\";\nexport var userAgentMiddleware = function userAgentMiddleware(options) {\n return function (next, context) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(args) {\n var _context$userAgent, _options$customUserAg;\n\n var request, headers, userAgent, defaultUserAgent, customUserAgent, prefix, sdkUserAgentValue, normalUAValue;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n request = args.request;\n\n if (HttpRequest.isInstance(request)) {\n _context.next = 3;\n break;\n }\n\n return _context.abrupt(\"return\", next(args));\n\n case 3:\n headers = request.headers;\n userAgent = (context === null || context === void 0 ? void 0 : (_context$userAgent = context.userAgent) === null || _context$userAgent === void 0 ? void 0 : _context$userAgent.map(escapeUserAgent)) || [];\n _context.next = 7;\n return options.defaultUserAgentProvider();\n\n case 7:\n defaultUserAgent = _context.sent.map(escapeUserAgent);\n customUserAgent = (options === null || options === void 0 ? void 0 : (_options$customUserAg = options.customUserAgent) === null || _options$customUserAg === void 0 ? void 0 : _options$customUserAg.map(escapeUserAgent)) || [];\n prefix = getUserAgentPrefix();\n sdkUserAgentValue = (prefix ? [prefix] : []).concat([].concat(_toConsumableArray(defaultUserAgent), _toConsumableArray(userAgent), _toConsumableArray(customUserAgent))).join(SPACE);\n normalUAValue = [].concat(_toConsumableArray(defaultUserAgent.filter(function (section) {\n return section.startsWith(\"aws-sdk-\");\n })), _toConsumableArray(customUserAgent)).join(SPACE);\n\n if (options.runtime !== \"browser\") {\n if (normalUAValue) {\n headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? \"\".concat(headers[USER_AGENT], \" \").concat(normalUAValue) : normalUAValue;\n }\n\n headers[USER_AGENT] = sdkUserAgentValue;\n } else {\n headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;\n }\n\n return _context.abrupt(\"return\", next(_objectSpread(_objectSpread({}, args), {}, {\n request: request\n })));\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n };\n};\n\nvar escapeUserAgent = function escapeUserAgent(_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n name = _ref3[0],\n version = _ref3[1];\n\n var prefixSeparatorIndex = name.indexOf(\"/\");\n var prefix = name.substring(0, prefixSeparatorIndex);\n var uaName = name.substring(prefixSeparatorIndex + 1);\n\n if (prefix === \"api\") {\n uaName = uaName.toLowerCase();\n }\n\n return [prefix, uaName, version].filter(function (item) {\n return item && item.length > 0;\n }).map(function (item) {\n return item === null || item === void 0 ? void 0 : item.replace(UA_ESCAPE_REGEX, \"_\");\n }).join(\"/\");\n};\n\nexport var getUserAgentMiddlewareOptions = {\n name: \"getUserAgentMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"SET_USER_AGENT\", \"USER_AGENT\"],\n override: true\n};\nexport var getUserAgentPlugin = function getUserAgentPlugin(config) {\n return {\n applyToStack: function applyToStack(clientStack) {\n clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);\n }\n };\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {object & {type: string, position?: Position|undefined}} NodeLike\n */\n\n/**\n * Stringify one point, a position (start and end points), or a node’s\n * positional information.\n *\n * @param {Node|NodeLike|Position|Point|null} [value]\n * @returns {string}\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || _typeof(value) !== 'object') {\n return '';\n } // Node.\n\n\n if ('position' in value || 'type' in value) {\n return position(value.position);\n } // Position.\n\n\n if ('start' in value || 'end' in value) {\n return position(value);\n } // Point.\n\n\n if ('line' in value || 'column' in value) {\n return point(value);\n } // ?\n\n\n return '';\n}\n/**\n * @param {Point|undefined} point\n * @returns {string}\n */\n\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column);\n}\n/**\n * @param {Position|undefined} pos\n * @returns {string}\n */\n\n\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end);\n}\n/**\n * @param {number|undefined} value\n * @returns {number}\n */\n\n\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {object & {type: string, position?: Position|undefined}} NodeLike\n */\nimport { stringifyPosition } from 'unist-util-stringify-position';\nexport var VFileMessage = /*#__PURE__*/function (_Error) {\n _inherits(VFileMessage, _Error);\n\n var _super = _createSuper(VFileMessage);\n\n /**\n * Constructor of a message for `reason` at `place` from `origin`.\n * When an error is passed in as `reason`, copies the `stack`.\n *\n * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).\n * @param {string} [origin] Place in code the message originates from (`string`, optional).\n */\n function VFileMessage(reason, place, origin) {\n var _this;\n\n _classCallCheck(this, VFileMessage);\n\n /** @type {[string|null, string|null]} */\n var parts = [null, null];\n /** @type {Position} */\n\n var position = {\n // @ts-expect-error: we always follows the structure of `position`.\n start: {\n line: null,\n column: null\n },\n // @ts-expect-error: \"\n end: {\n line: null,\n column: null\n }\n };\n _this = _super.call(this);\n\n if (typeof place === 'string') {\n origin = place;\n place = undefined;\n }\n\n if (typeof origin === 'string') {\n var index = origin.indexOf(':');\n\n if (index === -1) {\n parts[1] = origin;\n } else {\n parts[0] = origin.slice(0, index);\n parts[1] = origin.slice(index + 1);\n }\n }\n\n if (place) {\n // Node.\n if ('type' in place || 'position' in place) {\n if (place.position) {\n position = place.position;\n }\n } // Position.\n else if ('start' in place || 'end' in place) {\n position = place;\n } // Point.\n else if ('line' in place || 'column' in place) {\n position.start = place;\n }\n } // Fields from `Error`\n\n\n _this.name = stringifyPosition(place) || '1:1';\n _this.message = _typeof(reason) === 'object' ? reason.message : reason;\n _this.stack = _typeof(reason) === 'object' ? reason.stack : '';\n /**\n * Reason for message.\n * @type {string}\n */\n\n _this.reason = _this.message;\n /**\n * If true, marks associated file as no longer processable.\n * @type {boolean?}\n */\n // eslint-disable-next-line no-unused-expressions\n\n _this.fatal;\n /**\n * Starting line of error.\n * @type {number?}\n */\n\n _this.line = position.start.line;\n /**\n * Starting column of error.\n * @type {number?}\n */\n\n _this.column = position.start.column;\n /**\n * Namespace of warning.\n * @type {string?}\n */\n\n _this.source = parts[0];\n /**\n * Category of message.\n * @type {string?}\n */\n\n _this.ruleId = parts[1];\n /**\n * Full range information, when available.\n * Has start and end properties, both set to an object with line and column, set to number?.\n * @type {Position?}\n */\n\n _this.position = position; // The following fields are “well known”.\n // Not standard.\n // Feel free to add other non-standard fields to your messages.\n\n /* eslint-disable no-unused-expressions */\n\n /**\n * You can use this to specify the source value that’s being reported, which\n * is deemed incorrect.\n * @type {string?}\n */\n\n _this.actual;\n /**\n * You can use this to suggest values that should be used instead of\n * `actual`, one or more values that are deemed as acceptable.\n * @type {Array?}\n */\n\n _this.expected;\n /**\n * You may add a file property with a path of a file (used throughout the VFile ecosystem).\n * @type {string?}\n */\n\n _this.file;\n /**\n * You may add a url property with a link to documentation for the message.\n * @type {string?}\n */\n\n _this.url;\n /**\n * You may add a note property with a long form description of the message (supported by vfile-reporter).\n * @type {string?}\n */\n\n _this.note;\n /* eslint-enable no-unused-expressions */\n\n return _this;\n }\n\n return _createClass(VFileMessage);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\nVFileMessage.prototype.file = '';\nVFileMessage.prototype.name = '';\nVFileMessage.prototype.reason = '';\nVFileMessage.prototype.message = '';\nVFileMessage.prototype.stack = '';\nVFileMessage.prototype.fatal = null;\nVFileMessage.prototype.column = null;\nVFileMessage.prototype.line = null;\nVFileMessage.prototype.source = null;\nVFileMessage.prototype.ruleId = null;\nVFileMessage.prototype.position = null;","// A derivative work based on:\n// .\n// Which is licensed:\n//\n// MIT License\n//\n// Copyright (c) 2013 James Halliday\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A derivative work based on:\n//\n// Parts of that are extracted from Node’s internal `path` module:\n// .\n// Which is licensed:\n//\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport var path = {\n basename: basename,\n dirname: dirname,\n extname: extname,\n join: join,\n sep: '/'\n};\n/* eslint-disable max-depth, complexity */\n\n/**\n * @param {string} path\n * @param {string} [ext]\n * @returns {string}\n */\n\nfunction basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') {\n throw new TypeError('\"ext\" argument must be a string');\n }\n\n assertPath(path);\n var start = 0;\n var end = -1;\n var index = path.length;\n /** @type {boolean|undefined} */\n\n var seenNonSlash;\n\n if (ext === undefined || ext.length === 0 || ext.length > path.length) {\n while (index--) {\n if (path.charCodeAt(index) === 47\n /* `/` */\n ) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1;\n break;\n }\n } else if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // path component.\n seenNonSlash = true;\n end = index + 1;\n }\n }\n\n return end < 0 ? '' : path.slice(start, end);\n }\n\n if (ext === path) {\n return '';\n }\n\n var firstNonSlashEnd = -1;\n var extIndex = ext.length - 1;\n\n while (index--) {\n if (path.charCodeAt(index) === 47\n /* `/` */\n ) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd < 0) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching.\n seenNonSlash = true;\n firstNonSlashEnd = index + 1;\n }\n\n if (extIndex > -1) {\n // Try to match the explicit extension.\n if (path.charCodeAt(index) === ext.charCodeAt(extIndex--)) {\n if (extIndex < 0) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = index;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIndex = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) {\n end = firstNonSlashEnd;\n } else if (end < 0) {\n end = path.length;\n }\n\n return path.slice(start, end);\n}\n/**\n * @param {string} path\n * @returns {string}\n */\n\n\nfunction dirname(path) {\n assertPath(path);\n\n if (path.length === 0) {\n return '.';\n }\n\n var end = -1;\n var index = path.length;\n /** @type {boolean|undefined} */\n\n var unmatchedSlash; // Prefix `--` is important to not run on `0`.\n\n while (--index) {\n if (path.charCodeAt(index) === 47\n /* `/` */\n ) {\n if (unmatchedSlash) {\n end = index;\n break;\n }\n } else if (!unmatchedSlash) {\n // We saw the first non-path separator\n unmatchedSlash = true;\n }\n }\n\n return end < 0 ? path.charCodeAt(0) === 47\n /* `/` */\n ? '/' : '.' : end === 1 && path.charCodeAt(0) === 47\n /* `/` */\n ? '//' : path.slice(0, end);\n}\n/**\n * @param {string} path\n * @returns {string}\n */\n\n\nfunction extname(path) {\n assertPath(path);\n var index = path.length;\n var end = -1;\n var startPart = 0;\n var startDot = -1; // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find.\n\n var preDotState = 0;\n /** @type {boolean|undefined} */\n\n var unmatchedSlash;\n\n while (index--) {\n var code = path.charCodeAt(index);\n\n if (code === 47\n /* `/` */\n ) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (unmatchedSlash) {\n startPart = index + 1;\n break;\n }\n\n continue;\n }\n\n if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // extension.\n unmatchedSlash = true;\n end = index + 1;\n }\n\n if (code === 46\n /* `.` */\n ) {\n // If this is our first dot, mark it as the start of our extension.\n if (startDot < 0) {\n startDot = index;\n } else if (preDotState !== 1) {\n preDotState = 1;\n }\n } else if (startDot > -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension.\n preDotState = -1;\n }\n }\n\n if (startDot < 0 || end < 0 || // We saw a non-dot character immediately before the dot.\n preDotState === 0 || // The (right-most) trimmed path component is exactly `..`.\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n\n return path.slice(startDot, end);\n}\n/**\n * @param {Array} segments\n * @returns {string}\n */\n\n\nfunction join() {\n var index = -1;\n /** @type {string|undefined} */\n\n var joined;\n\n for (var _len = arguments.length, segments = new Array(_len), _key = 0; _key < _len; _key++) {\n segments[_key] = arguments[_key];\n }\n\n while (++index < segments.length) {\n assertPath(segments[index]);\n\n if (segments[index]) {\n joined = joined === undefined ? segments[index] : joined + '/' + segments[index];\n }\n }\n\n return joined === undefined ? '.' : normalize(joined);\n}\n/**\n * Note: `normalize` is not exposed as `path.normalize`, so some code is\n * manually removed from it.\n *\n * @param {string} path\n * @returns {string}\n */\n\n\nfunction normalize(path) {\n assertPath(path);\n var absolute = path.charCodeAt(0) === 47;\n /* `/` */\n // Normalize the path according to POSIX rules.\n\n var value = normalizeString(path, !absolute);\n\n if (value.length === 0 && !absolute) {\n value = '.';\n }\n\n if (value.length > 0 && path.charCodeAt(path.length - 1) === 47\n /* / */\n ) {\n value += '/';\n }\n\n return absolute ? '/' + value : value;\n}\n/**\n * Resolve `.` and `..` elements in a path with directory names.\n *\n * @param {string} path\n * @param {boolean} allowAboveRoot\n * @returns {string}\n */\n\n\nfunction normalizeString(path, allowAboveRoot) {\n var result = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var index = -1;\n /** @type {number|undefined} */\n\n var code;\n /** @type {number} */\n\n var lastSlashIndex;\n\n while (++index <= path.length) {\n if (index < path.length) {\n code = path.charCodeAt(index);\n } else if (code === 47\n /* `/` */\n ) {\n break;\n } else {\n code = 47;\n /* `/` */\n }\n\n if (code === 47\n /* `/` */\n ) {\n if (lastSlash === index - 1 || dots === 1) {// Empty.\n } else if (lastSlash !== index - 1 && dots === 2) {\n if (result.length < 2 || lastSegmentLength !== 2 || result.charCodeAt(result.length - 1) !== 46\n /* `.` */\n || result.charCodeAt(result.length - 2) !== 46\n /* `.` */\n ) {\n if (result.length > 2) {\n lastSlashIndex = result.lastIndexOf('/');\n\n if (lastSlashIndex !== result.length - 1) {\n if (lastSlashIndex < 0) {\n result = '';\n lastSegmentLength = 0;\n } else {\n result = result.slice(0, lastSlashIndex);\n lastSegmentLength = result.length - 1 - result.lastIndexOf('/');\n }\n\n lastSlash = index;\n dots = 0;\n continue;\n }\n } else if (result.length > 0) {\n result = '';\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n\n if (allowAboveRoot) {\n result = result.length > 0 ? result + '/..' : '..';\n lastSegmentLength = 2;\n }\n } else {\n if (result.length > 0) {\n result += '/' + path.slice(lastSlash + 1, index);\n } else {\n result = path.slice(lastSlash + 1, index);\n }\n\n lastSegmentLength = index - lastSlash - 1;\n }\n\n lastSlash = index;\n dots = 0;\n } else if (code === 46\n /* `.` */\n && dots > -1) {\n dots++;\n } else {\n dots = -1;\n }\n }\n\n return result;\n}\n/**\n * @param {string} path\n */\n\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n/* eslint-enable max-depth, complexity */","// Somewhat based on:\n// .\n// But I don’t think one tiny line of code can be copyrighted. 😅\nexport var proc = {\n cwd: cwd\n};\n\nfunction cwd() {\n return '/';\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef URL\n * @property {string} hash\n * @property {string} host\n * @property {string} hostname\n * @property {string} href\n * @property {string} origin\n * @property {string} password\n * @property {string} pathname\n * @property {string} port\n * @property {string} protocol\n * @property {string} search\n * @property {any} searchParams\n * @property {string} username\n * @property {() => string} toString\n * @property {() => string} toJSON\n */\n\n/**\n * @param {unknown} fileURLOrPath\n * @returns {fileURLOrPath is URL}\n */\n// From: \nexport function isUrl(fileURLOrPath) {\n return fileURLOrPath !== null && _typeof(fileURLOrPath) === 'object' && // @ts-expect-error: indexable.\n fileURLOrPath.href && // @ts-expect-error: indexable.\n fileURLOrPath.origin;\n}","/// \nimport { isUrl } from './minurl.shared.js'; // See: \n\n/**\n * @param {string|URL} path\n */\n\nexport function urlToPath(path) {\n if (typeof path === 'string') {\n path = new URL(path);\n } else if (!isUrl(path)) {\n /** @type {NodeJS.ErrnoException} */\n var error = new TypeError('The \"path\" argument must be of type string or an instance of URL. Received `' + path + '`');\n error.code = 'ERR_INVALID_ARG_TYPE';\n throw error;\n }\n\n if (path.protocol !== 'file:') {\n /** @type {NodeJS.ErrnoException} */\n var _error = new TypeError('The URL must be of scheme file');\n\n _error.code = 'ERR_INVALID_URL_SCHEME';\n throw _error;\n }\n\n return getPathFromURLPosix(path);\n}\n/**\n * @param {URL} url\n */\n\nfunction getPathFromURLPosix(url) {\n if (url.hostname !== '') {\n /** @type {NodeJS.ErrnoException} */\n var error = new TypeError('File URL host must be \"localhost\" or empty on darwin');\n error.code = 'ERR_INVALID_FILE_URL_HOST';\n throw error;\n }\n\n var pathname = url.pathname;\n var index = -1;\n\n while (++index < pathname.length) {\n if (pathname.charCodeAt(index) === 37\n /* `%` */\n && pathname.charCodeAt(index + 1) === 50\n /* `2` */\n ) {\n var third = pathname.charCodeAt(index + 2);\n\n if (third === 70\n /* `F` */\n || third === 102\n /* `f` */\n ) {\n /** @type {NodeJS.ErrnoException} */\n var _error2 = new TypeError('File URL path must not include encoded / characters');\n\n _error2.code = 'ERR_INVALID_FILE_URL_PATH';\n throw _error2;\n }\n }\n }\n\n return decodeURIComponent(pathname);\n}\n\nexport { isUrl } from './minurl.shared.js';","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {Record & {type: string, position?: Position|undefined}} NodeLike\n * @typedef {import('./minurl.shared.js').URL} URL\n * @typedef {import('..').VFileData} VFileData\n * @typedef {import('..').VFileValue} VFileValue\n *\n * @typedef {'ascii'|'utf8'|'utf-8'|'utf16le'|'ucs2'|'ucs-2'|'base64'|'base64url'|'latin1'|'binary'|'hex'} BufferEncoding\n * Encodings supported by the buffer class.\n * This is a copy of the typing from Node, copied to prevent Node globals from\n * being needed.\n * Copied from: \n *\n * @typedef {VFileValue|VFileOptions|VFile|URL} VFileCompatible\n * Things that can be passed to the constructor.\n *\n * @typedef VFileCoreOptions\n * @property {VFileValue} [value]\n * @property {string} [cwd]\n * @property {Array} [history]\n * @property {string|URL} [path]\n * @property {string} [basename]\n * @property {string} [stem]\n * @property {string} [extname]\n * @property {string} [dirname]\n * @property {VFileData} [data]\n *\n * @typedef Map\n * Raw source map, see:\n * .\n * @property {number} version\n * @property {Array} sources\n * @property {Array} names\n * @property {string|undefined} [sourceRoot]\n * @property {Array|undefined} [sourcesContent]\n * @property {string} mappings\n * @property {string} file\n *\n * @typedef {{[key: string]: unknown} & VFileCoreOptions} VFileOptions\n * Configuration: a bunch of keys that will be shallow copied over to the new\n * file.\n *\n * @typedef {Record} VFileReporterSettings\n * @typedef {(files: Array, options: T) => string} VFileReporter\n */\nimport buffer from 'is-buffer';\nimport { VFileMessage } from 'vfile-message';\nimport { path } from './minpath.js';\nimport { proc } from './minproc.js';\nimport { urlToPath, isUrl } from './minurl.js'; // Order of setting (least specific to most), we need this because otherwise\n// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n// stem can be set.\n\nvar order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'];\nexport var VFile = /*#__PURE__*/function () {\n /**\n * Create a new virtual file.\n *\n * If `options` is `string` or `Buffer`, treats it as `{value: options}`.\n * If `options` is a `VFile`, shallow copies its data over to the new file.\n * All other given fields are set on the newly created `VFile`.\n *\n * Path related properties are set in the following order (least specific to\n * most specific): `history`, `path`, `basename`, `stem`, `extname`,\n * `dirname`.\n *\n * It’s not possible to set either `dirname` or `extname` without setting\n * either `history`, `path`, `basename`, or `stem` as well.\n *\n * @param {VFileCompatible} [value]\n */\n function VFile(value) {\n _classCallCheck(this, VFile);\n\n /** @type {VFileOptions} */\n var options;\n\n if (!value) {\n options = {};\n } else if (typeof value === 'string' || buffer(value)) {\n // @ts-expect-error Looks like a buffer.\n options = {\n value: value\n };\n } else if (isUrl(value)) {\n options = {\n path: value\n };\n } else {\n // @ts-expect-error Looks like file or options.\n options = value;\n }\n /**\n * Place to store custom information.\n * It’s OK to store custom data directly on the file, moving it to `data`\n * gives a little more privacy.\n * @type {VFileData}\n */\n\n\n this.data = {};\n /**\n * List of messages associated with the file.\n * @type {Array}\n */\n\n this.messages = [];\n /**\n * List of file paths the file moved between.\n * @type {Array}\n */\n\n this.history = [];\n /**\n * Base of `path`.\n * Defaults to `process.cwd()` (`/` in browsers).\n * @type {string}\n */\n\n this.cwd = proc.cwd();\n /* eslint-disable no-unused-expressions */\n\n /**\n * Raw value.\n * @type {VFileValue}\n */\n\n this.value; // The below are non-standard, they are “well-known”.\n // As in, used in several tools.\n\n /**\n * Whether a file was saved to disk.\n * This is used by vfile reporters.\n * @type {boolean}\n */\n\n this.stored;\n /**\n * Sometimes files have a non-string representation.\n * This can be stored in the `result` field.\n * One example is when turning markdown into React nodes.\n * This is used by unified to store non-string results.\n * @type {unknown}\n */\n\n this.result;\n /**\n * Sometimes files have a source map associated with them.\n * This can be stored in the `map` field.\n * This should be a `RawSourceMap` type from the `source-map` module.\n * @type {Map|undefined}\n */\n\n this.map;\n /* eslint-enable no-unused-expressions */\n // Set path related properties in the correct order.\n\n var index = -1;\n\n while (++index < order.length) {\n var _prop = order[index]; // Note: we specifically use `in` instead of `hasOwnProperty` to accept\n // `vfile`s too.\n\n if (_prop in options && options[_prop] !== undefined) {\n // @ts-expect-error: TS is confused by the different types for `history`.\n this[_prop] = _prop === 'history' ? _toConsumableArray(options[_prop]) : options[_prop];\n }\n }\n /** @type {string} */\n\n\n var prop; // Set non-path related properties.\n\n for (prop in options) {\n // @ts-expect-error: fine to set other things.\n if (!order.includes(prop)) this[prop] = options[prop];\n }\n }\n /**\n * Access full path (`~/index.min.js`).\n *\n * @returns {string}\n */\n\n\n _createClass(VFile, [{\n key: \"path\",\n get: function get() {\n return this.history[this.history.length - 1];\n }\n /**\n * Set full path (`~/index.min.js`).\n * Cannot be nullified.\n *\n * @param {string|URL} path\n */\n ,\n set: function set(path) {\n if (isUrl(path)) {\n path = urlToPath(path);\n }\n\n assertNonEmpty(path, 'path');\n\n if (this.path !== path) {\n this.history.push(path);\n }\n }\n /**\n * Access parent path (`~`).\n */\n\n }, {\n key: \"dirname\",\n get: function get() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined;\n }\n /**\n * Set parent path (`~`).\n * Cannot be set if there's no `path` yet.\n */\n ,\n set: function set(dirname) {\n assertPath(this.basename, 'dirname');\n this.path = path.join(dirname || '', this.basename);\n }\n /**\n * Access basename (including extname) (`index.min.js`).\n */\n\n }, {\n key: \"basename\",\n get: function get() {\n return typeof this.path === 'string' ? path.basename(this.path) : undefined;\n }\n /**\n * Set basename (`index.min.js`).\n * Cannot contain path separators.\n * Cannot be nullified either (use `file.path = file.dirname` instead).\n */\n ,\n set: function set(basename) {\n assertNonEmpty(basename, 'basename');\n assertPart(basename, 'basename');\n this.path = path.join(this.dirname || '', basename);\n }\n /**\n * Access extname (including dot) (`.js`).\n */\n\n }, {\n key: \"extname\",\n get: function get() {\n return typeof this.path === 'string' ? path.extname(this.path) : undefined;\n }\n /**\n * Set extname (including dot) (`.js`).\n * Cannot be set if there's no `path` yet and cannot contain path separators.\n */\n ,\n set: function set(extname) {\n assertPart(extname, 'extname');\n assertPath(this.dirname, 'extname');\n\n if (extname) {\n if (extname.charCodeAt(0) !== 46\n /* `.` */\n ) {\n throw new Error('`extname` must start with `.`');\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots');\n }\n }\n\n this.path = path.join(this.dirname, this.stem + (extname || ''));\n }\n /**\n * Access stem (w/o extname) (`index.min`).\n */\n\n }, {\n key: \"stem\",\n get: function get() {\n return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined;\n }\n /**\n * Set stem (w/o extname) (`index.min`).\n * Cannot be nullified, and cannot contain path separators.\n */\n ,\n set: function set(stem) {\n assertNonEmpty(stem, 'stem');\n assertPart(stem, 'stem');\n this.path = path.join(this.dirname || '', stem + (this.extname || ''));\n }\n /**\n * Serialize the file.\n *\n * @param {BufferEncoding} [encoding='utf8'] If `file.value` is a buffer, `encoding` is used to serialize buffers.\n * @returns {string}\n */\n\n }, {\n key: \"toString\",\n value: function toString(encoding) {\n return (this.value || '').toString(encoding);\n }\n /**\n * Create a message and associates it w/ the file.\n *\n * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).\n * @param {string} [origin] Place in code the message originates from (`string`, optional).\n * @returns {VFileMessage}\n */\n\n }, {\n key: \"message\",\n value: function message(reason, place, origin) {\n var message = new VFileMessage(reason, place, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n this.messages.push(message);\n return message;\n }\n /**\n * Info: create a message, associate it with the file, and mark the fatality\n * as `null`.\n * Calls `message()` internally.\n *\n * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).\n * @param {string} [origin] Place in code the message originates from (`string`, optional).\n * @returns {VFileMessage}\n */\n\n }, {\n key: \"info\",\n value: function info(reason, place, origin) {\n var message = this.message(reason, place, origin);\n message.fatal = null;\n return message;\n }\n /**\n * Fail: create a message, associate it with the file, mark the fatality as\n * `true`.\n * Note: fatal errors mean a file is no longer processable.\n * Calls `message()` internally.\n *\n * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).\n * @param {string} [origin] Place in code the message originates from (`string`, optional).\n * @returns {never}\n */\n\n }, {\n key: \"fail\",\n value: function fail(reason, place, origin) {\n var message = this.message(reason, place, origin);\n message.fatal = true;\n throw message;\n }\n }]);\n\n return VFile;\n}();\n/**\n * Assert that `part` is not a path (as in, does not contain `path.sep`).\n *\n * @param {string|undefined} part\n * @param {string} name\n * @returns {void}\n */\n\nfunction assertPart(part, name) {\n if (part && part.includes(path.sep)) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}\n/**\n * Assert that `part` is not empty.\n *\n * @param {string|undefined} part\n * @param {string} name\n * @returns {asserts part is string}\n */\n\n\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}\n/**\n * Assert `path` exists.\n *\n * @param {string|undefined} path\n * @param {string} name\n * @returns {asserts path is string}\n */\n\n\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too');\n }\n}","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error;\n }\n}","export default function isPlainObject(value) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * @typedef {(error?: Error|null|undefined, ...output: Array) => void} Callback\n * @typedef {(...input: Array) => any} Middleware\n *\n * @typedef {(...input: Array) => void} Run\n * Call all middleware.\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add `fn` (middleware) to the list.\n * @typedef {{run: Run, use: Use}} Pipeline\n * Middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n */\nexport function trough() {\n /** @type {Array} */\n var fns = [];\n /** @type {Pipeline} */\n\n var pipeline = {\n run: run,\n use: use\n };\n return pipeline;\n /** @type {Run} */\n\n function run() {\n for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {\n values[_key] = arguments[_key];\n }\n\n var middlewareIndex = -1;\n /** @type {Callback} */\n\n var callback = values.pop();\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback);\n }\n\n next.apply(void 0, [null].concat(_toConsumableArray(values)));\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error|null|undefined} error\n * @param {Array} output\n */\n\n function next(error) {\n var fn = fns[++middlewareIndex];\n var index = -1;\n\n if (error) {\n callback(error);\n return;\n } // Copy non-nullish input into values.\n\n\n for (var _len2 = arguments.length, output = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n output[_key2 - 1] = arguments[_key2];\n }\n\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index];\n }\n } // Save the newly created `output` for the next call.\n\n\n values = output; // Next or done.\n\n if (fn) {\n wrap(fn, next).apply(void 0, output);\n } else {\n callback.apply(void 0, [null].concat(output));\n }\n }\n }\n /** @type {Use} */\n\n\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError('Expected `middelware` to be a function, not ' + middelware);\n }\n\n fns.push(middelware);\n return pipeline;\n }\n}\n/**\n * Wrap `middleware`.\n * Can be sync or async; return a promise, receive a callback, or return new\n * values and errors.\n *\n * @param {Middleware} middleware\n * @param {Callback} callback\n */\n\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n var called;\n return wrapped;\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array} parameters\n * @returns {void}\n */\n\n function wrapped() {\n for (var _len3 = arguments.length, parameters = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n parameters[_key3] = arguments[_key3];\n }\n\n var fnExpectsCallback = middleware.length > parameters.length;\n /** @type {any} */\n\n var result;\n\n if (fnExpectsCallback) {\n parameters.push(done);\n }\n\n try {\n result = middleware.apply(this, parameters);\n } catch (error) {\n var exception =\n /** @type {Error} */\n error; // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n\n if (fnExpectsCallback && called) {\n throw exception;\n }\n\n return done(exception);\n }\n\n if (!fnExpectsCallback) {\n if (result instanceof Promise) {\n result.then(then, done);\n } else if (result instanceof Error) {\n done(result);\n } else {\n then(result);\n }\n }\n }\n /**\n * Call `callback`, only once.\n * @type {Callback}\n */\n\n\n function done(error) {\n if (!called) {\n called = true;\n\n for (var _len4 = arguments.length, output = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n output[_key4 - 1] = arguments[_key4];\n }\n\n callback.apply(void 0, [error].concat(output));\n }\n }\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n\n\n function then(value) {\n done(null, value);\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('vfile').VFileCompatible} VFileCompatible\n * @typedef {import('vfile').VFileValue} VFileValue\n * @typedef {import('..').Processor} Processor\n * @typedef {import('..').Plugin} Plugin\n * @typedef {import('..').Preset} Preset\n * @typedef {import('..').Pluggable} Pluggable\n * @typedef {import('..').PluggableList} PluggableList\n * @typedef {import('..').Transformer} Transformer\n * @typedef {import('..').Parser} Parser\n * @typedef {import('..').Compiler} Compiler\n * @typedef {import('..').RunCallback} RunCallback\n * @typedef {import('..').ProcessCallback} ProcessCallback\n *\n * @typedef Context\n * @property {Node} tree\n * @property {VFile} file\n */\nimport { bail } from 'bail';\nimport isBuffer from 'is-buffer';\nimport extend from 'extend';\nimport isPlainObj from 'is-plain-obj';\nimport { trough } from 'trough';\nimport { VFile } from 'vfile'; // Expose a frozen processor.\n\nexport var unified = base().freeze();\nvar own = {}.hasOwnProperty; // Function to create the first processor.\n\n/**\n * @returns {Processor}\n */\n\nfunction base() {\n var transformers = trough();\n /** @type {Processor['attachers']} */\n\n var attachers = [];\n /** @type {Record} */\n\n var namespace = {};\n /** @type {boolean|undefined} */\n\n var frozen;\n var freezeIndex = -1; // Data management.\n // @ts-expect-error: overloads are handled.\n\n processor.data = data;\n processor.Parser = undefined;\n processor.Compiler = undefined; // Lock.\n\n processor.freeze = freeze; // Plugins.\n\n processor.attachers = attachers; // @ts-expect-error: overloads are handled.\n\n processor.use = use; // API.\n\n processor.parse = parse;\n processor.stringify = stringify; // @ts-expect-error: overloads are handled.\n\n processor.run = run;\n processor.runSync = runSync; // @ts-expect-error: overloads are handled.\n\n processor.process = process;\n processor.processSync = processSync; // Expose.\n\n return processor; // Create a new processor based on the processor in the current scope.\n\n /** @type {Processor} */\n\n function processor() {\n var destination = base();\n var index = -1;\n\n while (++index < attachers.length) {\n destination.use.apply(destination, _toConsumableArray(attachers[index]));\n }\n\n destination.data(extend(true, {}, namespace));\n return destination;\n }\n /**\n * @param {string|Record} [key]\n * @param {unknown} [value]\n * @returns {unknown}\n */\n\n\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen);\n namespace[key] = value;\n return processor;\n } // Get `key`.\n\n\n return own.call(namespace, key) && namespace[key] || null;\n } // Set space.\n\n\n if (key) {\n assertUnfrozen('data', frozen);\n namespace = key;\n return processor;\n } // Get space.\n\n\n return namespace;\n }\n /** @type {Processor['freeze']} */\n\n\n function freeze() {\n if (frozen) {\n return processor;\n }\n\n while (++freezeIndex < attachers.length) {\n var _attachers$freezeInde = _toArray(attachers[freezeIndex]),\n attacher = _attachers$freezeInde[0],\n options = _attachers$freezeInde.slice(1);\n\n if (options[0] === false) {\n continue;\n }\n\n if (options[0] === true) {\n options[0] = undefined;\n }\n /** @type {Transformer|void} */\n\n\n var transformer = attacher.call.apply(attacher, [processor].concat(_toConsumableArray(options)));\n\n if (typeof transformer === 'function') {\n transformers.use(transformer);\n }\n }\n\n frozen = true;\n freezeIndex = Number.POSITIVE_INFINITY;\n return processor;\n }\n /**\n * @param {Pluggable|null|undefined} [value]\n * @param {...unknown} options\n * @returns {Processor}\n */\n\n\n function use(value) {\n for (var _len = arguments.length, options = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n options[_key - 1] = arguments[_key];\n }\n\n /** @type {Record|undefined} */\n var settings;\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) {// Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(void 0, [value].concat(options));\n } else if (_typeof(value) === 'object') {\n if (Array.isArray(value)) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`');\n }\n\n if (settings) {\n namespace.settings = Object.assign(namespace.settings || {}, settings);\n }\n\n return processor;\n /**\n * @param {import('..').Pluggable} value\n * @returns {void}\n */\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value);\n } else if (_typeof(value) === 'object') {\n if (Array.isArray(value)) {\n var _value = _toArray(value),\n plugin = _value[0],\n _options = _value.slice(1);\n\n addPlugin.apply(void 0, [plugin].concat(_toConsumableArray(_options)));\n } else {\n addPreset(value);\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`');\n }\n }\n /**\n * @param {Preset} result\n * @returns {void}\n */\n\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = Object.assign(settings || {}, result.settings);\n }\n }\n /**\n * @param {PluggableList|null|undefined} [plugins]\n * @returns {void}\n */\n\n\n function addList(plugins) {\n var index = -1;\n\n if (plugins === null || plugins === undefined) {// Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n var thing = plugins[index];\n add(thing);\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`');\n }\n }\n /**\n * @param {Plugin} plugin\n * @param {...unknown} [value]\n * @returns {void}\n */\n\n\n function addPlugin(plugin, value) {\n var index = -1;\n /** @type {Processor['attachers'][number]|undefined} */\n\n var entry;\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entry = attachers[index];\n break;\n }\n }\n\n if (entry) {\n if (isPlainObj(entry[1]) && isPlainObj(value)) {\n value = extend(true, entry[1], value);\n }\n\n entry[1] = value;\n } else {\n // @ts-expect-error: fine.\n attachers.push(Array.prototype.slice.call(arguments));\n }\n }\n }\n /** @type {Processor['parse']} */\n\n\n function parse(doc) {\n processor.freeze();\n var file = vfile(doc);\n var Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n // @ts-expect-error: `newable` checks this.\n return new Parser(String(file), file).parse();\n } // @ts-expect-error: `newable` checks this.\n\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }\n /** @type {Processor['stringify']} */\n\n\n function stringify(node, doc) {\n processor.freeze();\n var file = vfile(doc);\n var Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler, 'compile')) {\n // @ts-expect-error: `newable` checks this.\n return new Compiler(node, file).compile();\n } // @ts-expect-error: `newable` checks this.\n\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }\n /**\n * @param {Node} node\n * @param {VFileCompatible|RunCallback} [doc]\n * @param {RunCallback} [callback]\n * @returns {Promise|void}\n */\n\n\n function run(node, doc, callback) {\n assertNode(node);\n processor.freeze();\n\n if (!callback && typeof doc === 'function') {\n callback = doc;\n doc = undefined;\n }\n\n if (!callback) {\n return new Promise(executor);\n }\n\n executor(null, callback);\n /**\n * @param {null|((node: Node) => void)} resolve\n * @param {(error: Error) => void} reject\n * @returns {void}\n */\n\n function executor(resolve, reject) {\n // @ts-expect-error: `doc` can’t be a callback anymore, we checked.\n transformers.run(node, vfile(doc), done);\n /**\n * @param {Error|null} error\n * @param {Node} tree\n * @param {VFile} file\n * @returns {void}\n */\n\n function done(error, tree, file) {\n tree = tree || node;\n\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n // @ts-expect-error: `callback` is defined if `resolve` is not.\n callback(null, tree, file);\n }\n }\n }\n }\n /** @type {Processor['runSync']} */\n\n\n function runSync(node, file) {\n /** @type {Node|undefined} */\n var result;\n /** @type {boolean|undefined} */\n\n var complete;\n processor.run(node, file, done);\n assertDone('runSync', 'run', complete); // @ts-expect-error: we either bailed on an error or have a tree.\n\n return result;\n /**\n * @param {Error|null} [error]\n * @param {Node} [tree]\n * @returns {void}\n */\n\n function done(error, tree) {\n bail(error);\n result = tree;\n complete = true;\n }\n }\n /**\n * @param {VFileCompatible} doc\n * @param {ProcessCallback} [callback]\n * @returns {Promise|undefined}\n */\n\n\n function process(doc, callback) {\n processor.freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!callback) {\n return new Promise(executor);\n }\n\n executor(null, callback);\n /**\n * @param {null|((file: VFile) => void)} resolve\n * @param {(error?: Error|null|undefined) => void} reject\n * @returns {void}\n */\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n processor.run(processor.parse(file), file, function (error, tree, file) {\n if (error || !tree || !file) {\n done(error);\n } else {\n /** @type {unknown} */\n var result = processor.stringify(tree, file);\n\n if (result === undefined || result === null) {// Empty.\n } else if (looksLikeAVFileValue(result)) {\n file.value = result;\n } else {\n file.result = result;\n }\n\n done(error, file);\n }\n });\n /**\n * @param {Error|null|undefined} [error]\n * @param {VFile|undefined} [file]\n * @returns {void}\n */\n\n function done(error, file) {\n if (error || !file) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n // @ts-expect-error: `callback` is defined if `resolve` is not.\n callback(null, file);\n }\n }\n }\n }\n /** @type {Processor['processSync']} */\n\n\n function processSync(doc) {\n /** @type {boolean|undefined} */\n var complete;\n processor.freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n var file = vfile(doc);\n processor.process(file, done);\n assertDone('processSync', 'process', complete);\n return file;\n /**\n * @param {Error|null|undefined} [error]\n * @returns {void}\n */\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }\n}\n/**\n * Check if `value` is a constructor.\n *\n * @param {unknown} value\n * @param {string} name\n * @returns {boolean}\n */\n\n\nfunction newable(value, name) {\n return typeof value === 'function' && // Prototypes do exist.\n // type-coverage:ignore-next-line\n value.prototype && ( // A function with keys in its prototype is probably a constructor.\n // Classes’ prototype methods are not enumerable, so we check if some value\n // exists in the prototype.\n // type-coverage:ignore-next-line\n keys(value.prototype) || name in value.prototype);\n}\n/**\n * Check if `value` is an object with keys.\n *\n * @param {Record} value\n * @returns {boolean}\n */\n\n\nfunction keys(value) {\n /** @type {string} */\n var key;\n\n for (key in value) {\n if (own.call(value, key)) {\n return true;\n }\n }\n\n return false;\n}\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\n\n\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `Parser`');\n }\n}\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\n\n\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `Compiler`');\n }\n}\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\n\n\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error('Cannot call `' + name + '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.');\n }\n}\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\n\n\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`'); // Fine.\n }\n}\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\n\n\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead');\n }\n}\n/**\n * @param {VFileCompatible} [value]\n * @returns {VFile}\n */\n\n\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value);\n}\n/**\n * @param {VFileCompatible} [value]\n * @returns {value is VFile}\n */\n\n\nfunction looksLikeAVFile(value) {\n return Boolean(value && _typeof(value) === 'object' && 'message' in value && 'messages' in value);\n}\n/**\n * @param {unknown} [value]\n * @returns {value is VFileValue}\n */\n\n\nfunction looksLikeAVFileValue(value) {\n return typeof value === 'string' || isBuffer(value);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef Options\n * @property {boolean} [includeImageAlt=true]\n */\n\n/**\n * Get the text content of a node.\n * Prefer the node’s plain-text fields, otherwise serialize its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} node\n * @param {Options} [options]\n * @returns {string}\n */\nexport function toString(node, options) {\n var _ref = options || {},\n _ref$includeImageAlt = _ref.includeImageAlt,\n includeImageAlt = _ref$includeImageAlt === void 0 ? true : _ref$includeImageAlt;\n\n return one(node, includeImageAlt);\n}\n/**\n * @param {unknown} node\n * @param {boolean} includeImageAlt\n * @returns {string}\n */\n\nfunction one(node, includeImageAlt) {\n return node && _typeof(node) === 'object' && ( // @ts-ignore looks like a literal.\n node.value || ( // @ts-ignore looks like an image.\n includeImageAlt ? node.alt : '') || // @ts-ignore looks like a parent.\n 'children' in node && all(node.children, includeImageAlt) || Array.isArray(node) && all(node, includeImageAlt)) || '';\n}\n/**\n * @param {Array.} values\n * @param {boolean} includeImageAlt\n * @returns {string}\n */\n\n\nfunction all(values, includeImageAlt) {\n /** @type {Array.} */\n var result = [];\n var index = -1;\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt);\n }\n\n return result.join('');\n}","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\n\nexport var content = {\n tokenize: initializeContent\n};\n/** @type {Initializer} */\n\nfunction initializeContent(effects) {\n var contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n\n var previous;\n return contentStart;\n /** @type {State} */\n\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return factorySpace(effects, contentStart, 'linePrefix');\n }\n /** @type {State} */\n\n\n function paragraphInitial(code) {\n effects.enter('paragraph');\n return lineStart(code);\n }\n /** @type {State} */\n\n\n function lineStart(code) {\n var token = effects.enter('chunkText', {\n contentType: 'text',\n previous: previous\n });\n\n if (previous) {\n previous.next = token;\n }\n\n previous = token;\n return data(code);\n }\n /** @type {State} */\n\n\n function data(code) {\n if (code === null) {\n effects.exit('chunkText');\n effects.exit('paragraph');\n effects.consume(code);\n return;\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit('chunkText');\n return lineStart;\n } // Data.\n\n\n effects.consume(code);\n return data;\n }\n}","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Point} Point\n */\n\n/**\n * @typedef {Record} StackState\n * @typedef {[Construct, StackState]} StackItem\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {InitialConstruct} */\n\nexport var document = {\n tokenize: initializeDocument\n};\n/** @type {Construct} */\n\nvar containerConstruct = {\n tokenize: tokenizeContainer\n};\n/** @type {Initializer} */\n\nfunction initializeDocument(effects) {\n var self = this;\n /** @type {StackItem[]} */\n\n var stack = [];\n var continued = 0;\n /** @type {TokenizeContext|undefined} */\n\n var childFlow;\n /** @type {Token|undefined} */\n\n var childToken;\n /** @type {number} */\n\n var lineStartOffset;\n return start;\n /** @type {State} */\n\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n var item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n } // Done.\n\n\n return checkNewContainers(code);\n }\n /** @type {State} */\n\n\n function documentContinue(code) {\n continued++; // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n\n if (childFlow) {\n closeFlow();\n } // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n\n\n var indexBeforeExits = self.events.length;\n var indexBeforeFlow = indexBeforeExits;\n /** @type {Point|undefined} */\n\n var point; // Find the flow chunk.\n\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === 'chunkFlow') {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n\n exitContainers(continued); // Fix positions.\n\n var index = indexBeforeExits;\n\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point);\n index++;\n } // Inject the exits earlier (they’re still also at the end).\n\n\n splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); // Discard the duplicate exits.\n\n self.events.length = index;\n return checkNewContainers(code);\n }\n\n return start(code);\n }\n /** @type {State} */\n\n\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n } // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n\n\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n } // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n\n\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n } // Check if there is a new container.\n\n\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n /** @type {State} */\n\n\n function thereIsANewContainer(code) {\n if (childFlow) closeFlow();\n exitContainers(continued);\n return documentContinued(code);\n }\n /** @type {State} */\n\n\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n /** @type {State} */\n\n\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n /** @type {State} */\n\n\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]); // Try another.\n\n return documentContinued(code);\n }\n /** @type {State} */\n\n\n function flowStart(code) {\n if (code === null) {\n if (childFlow) closeFlow();\n exitContainers(0);\n effects.consume(code);\n return;\n }\n\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter('chunkFlow', {\n contentType: 'flow',\n previous: childToken,\n _tokenizer: childFlow\n });\n return flowContinue(code);\n }\n /** @type {State} */\n\n\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit('chunkFlow'), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit('chunkFlow')); // Get ready for the next line.\n\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n\n effects.consume(code);\n return flowContinue;\n }\n /**\n * @param {Token} token\n * @param {boolean} [eof]\n * @returns {void}\n */\n\n\n function writeToChild(token, eof) {\n var stream = self.sliceStream(token);\n if (eof) stream.push(null);\n token.previous = childToken;\n if (childToken) childToken.next = token;\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream); // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n\n if (self.parser.lazy[token.start.line]) {\n var index = childFlow.events.length;\n\n while (index--) {\n if ( // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && ( // …and either is not ended yet…\n !childFlow.events[index][1].end || // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n } // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n\n\n var indexBeforeExits = self.events.length;\n var indexBeforeFlow = indexBeforeExits;\n /** @type {boolean|undefined} */\n\n var seen;\n /** @type {Point|undefined} */\n\n var point; // Find the previous chunk (the one before the lazy line).\n\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === 'chunkFlow') {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n\n seen = true;\n }\n }\n\n exitContainers(continued); // Fix positions.\n\n index = indexBeforeExits;\n\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point);\n index++;\n } // Inject the exits earlier (they’re still also at the end).\n\n\n splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); // Discard the duplicate exits.\n\n self.events.length = index;\n }\n }\n /**\n * @param {number} size\n * @returns {void}\n */\n\n\n function exitContainers(size) {\n var index = stack.length; // Exit open containers.\n\n while (index-- > size) {\n var entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n\n stack.length = size;\n }\n\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeContainer(effects, ok, nok) {\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), 'linePrefix', this.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4);\n}","/**\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Event} Event\n */\nimport { splice } from 'micromark-util-chunked';\n/**\n * Tokenize subcontent.\n *\n * @param {Event[]} events\n * @returns {boolean}\n */\n\nexport function subtokenize(events) {\n /** @type {Record} */\n var jumps = {};\n var index = -1;\n /** @type {Event} */\n\n var event;\n /** @type {number|undefined} */\n\n var lineIndex;\n /** @type {number} */\n\n var otherIndex;\n /** @type {Event} */\n\n var otherEvent;\n /** @type {Event[]} */\n\n var parameters;\n /** @type {Event[]} */\n\n var subevents;\n /** @type {boolean|undefined} */\n\n var more;\n\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n\n event = events[index]; // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n\n if (index && event[1].type === 'chunkFlow' && events[index - 1][1].type === 'listItemPrefix') {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === 'lineEndingBlank') {\n otherIndex += 2;\n }\n\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === 'content') {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === 'content') {\n break;\n }\n\n if (subevents[otherIndex][1].type === 'chunkText') {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n } // Enter.\n\n\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n } // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n\n while (otherIndex--) {\n otherEvent = events[otherIndex];\n\n if (otherEvent[1].type === 'lineEnding' || otherEvent[1].type === 'lineEndingBlank') {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank';\n }\n\n otherEvent[1].type = 'lineEnding';\n lineIndex = otherIndex;\n }\n } else {\n break;\n }\n }\n\n if (lineIndex) {\n // Fix position.\n event[1].end = Object.assign({}, events[lineIndex][1].start); // Switch container exit w/ line endings.\n\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n splice(events, lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n return !more;\n}\n/**\n * Tokenize embedded tokens.\n *\n * @param {Event[]} events\n * @param {number} eventIndex\n * @returns {Record}\n */\n\nfunction subcontent(events, eventIndex) {\n var token = events[eventIndex][1];\n var context = events[eventIndex][2];\n var startPosition = eventIndex - 1;\n /** @type {number[]} */\n\n var startPositions = [];\n var tokenizer = token._tokenizer || context.parser[token.contentType](token.start);\n var childEvents = tokenizer.events;\n /** @type {[number, number][]} */\n\n var jumps = [];\n /** @type {Record} */\n\n var gaps = {};\n /** @type {Chunk[]} */\n\n var stream;\n /** @type {Token|undefined} */\n\n var previous;\n var index = -1;\n /** @type {Token|undefined} */\n\n var current = token;\n var adjust = 0;\n var start = 0;\n var breaks = [start]; // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n\n while (current) {\n // Find the position of the event for this token.\n while (events[++startPosition][1] !== current) {// Empty.\n }\n\n startPositions.push(startPosition);\n\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n\n if (!current.next) {\n stream.push(null);\n }\n\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n\n tokenizer.write(stream);\n\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n } // Unravel the next token.\n\n\n previous = current;\n current = current.next;\n } // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n\n\n current = token;\n\n while (++index < childEvents.length) {\n if ( // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start); // Help GC.\n\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n } // Help GC.\n\n\n tokenizer.events = []; // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n } // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n\n\n index = breaks.length;\n\n while (index--) {\n var slice = childEvents.slice(breaks[index], breaks[index + 1]);\n\n var _start = startPositions.pop();\n\n jumps.unshift([_start, _start + slice.length - 1]);\n splice(events, _start, 2, slice);\n }\n\n index = -1;\n\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n\n return gaps;\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\n\nexport var content = {\n tokenize: tokenizeContent,\n resolve: resolveContent\n};\n/** @type {Construct} */\n\nvar continuationConstruct = {\n tokenize: tokenizeContinuation,\n partial: true\n};\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\n\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeContent(effects, ok) {\n /** @type {Token} */\n var previous;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('content');\n previous = effects.enter('chunkContent', {\n contentType: 'content'\n });\n return data(code);\n }\n /** @type {State} */\n\n\n function data(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n } // Data.\n\n\n effects.consume(code);\n return data;\n }\n /** @type {State} */\n\n\n function contentEnd(code) {\n effects.exit('chunkContent');\n effects.exit('content');\n return ok(code);\n }\n /** @type {State} */\n\n\n function contentContinue(code) {\n effects.consume(code);\n effects.exit('chunkContent');\n previous.next = effects.enter('chunkContent', {\n contentType: 'content',\n previous: previous\n });\n previous = previous.next;\n return data;\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeContinuation(effects, ok, nok) {\n var self = this;\n return startLookahead;\n /** @type {State} */\n\n function startLookahead(code) {\n effects.exit('chunkContent');\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return factorySpace(effects, prefixed, 'linePrefix');\n }\n /** @type {State} */\n\n\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n var tail = self.events[self.events.length - 1];\n\n if (!self.parser.constructs.disable[\"null\"].includes('codeIndented') && tail && tail[1].type === 'linePrefix' && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\n\n/** @type {InitialConstruct} */\nexport var flow = {\n tokenize: initializeFlow\n};\n/** @type {Initializer} */\n\nfunction initializeFlow(effects) {\n var self = this;\n var initial = effects.attempt( // Try to parse a blank line.\n blankLine, atBlankEnding, // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), 'linePrefix')));\n return initial;\n /** @type {State} */\n\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n\n effects.enter('lineEndingBlank');\n effects.consume(code);\n effects.exit('lineEndingBlank');\n self.currentConstruct = undefined;\n return initial;\n }\n /** @type {State} */\n\n\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nexport var resolver = {\n resolveAll: createResolver()\n};\nexport var string = initializeFactory('string');\nexport var text = initializeFactory('text');\n/**\n * @param {'string'|'text'} field\n * @returns {InitialConstruct}\n */\n\nfunction initializeFactory(field) {\n return {\n tokenize: initializeText,\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined)\n };\n /** @type {Initializer} */\n\n function initializeText(effects) {\n var self = this;\n var constructs = this.parser.constructs[field];\n var text = effects.attempt(constructs, start, notText);\n return start;\n /** @type {State} */\n\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n /** @type {State} */\n\n\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n\n effects.enter('data');\n effects.consume(code);\n return data;\n }\n /** @type {State} */\n\n\n function data(code) {\n if (atBreak(code)) {\n effects.exit('data');\n return text(code);\n } // Data.\n\n\n effects.consume(code);\n return data;\n }\n /**\n * @param {Code} code\n * @returns {boolean}\n */\n\n\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n\n var list = constructs[code];\n var index = -1;\n\n if (list) {\n while (++index < list.length) {\n var item = list[index];\n\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n\n return false;\n }\n }\n}\n/**\n * @param {Resolver} [extraResolver]\n * @returns {Resolver}\n */\n\n\nfunction createResolver(extraResolver) {\n return resolveAllText;\n /** @type {Resolver} */\n\n function resolveAllText(events, context) {\n var index = -1;\n /** @type {number|undefined} */\n\n var enter; // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === 'data') {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== 'data') {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n\n enter = undefined;\n }\n }\n\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\n\n\nfunction resolveAllLineSuffixes(events, context) {\n var eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === 'lineEnding') && events[eventIndex - 1][1].type === 'data') {\n var data = events[eventIndex - 1][1];\n var chunks = context.sliceStream(data);\n var index = chunks.length;\n var bufferIndex = -1;\n var size = 0;\n /** @type {boolean|undefined} */\n\n var tabs = void 0;\n\n while (index--) {\n var chunk = chunks[index];\n\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n\n if (bufferIndex) break;\n bufferIndex = -1;\n } // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {// Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n if (size) {\n var token = {\n type: eventIndex === events.length || tabs || size < 2 ? 'lineSuffix' : 'hardBreakTrailing',\n start: {\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size,\n _index: data.start._index + index,\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex\n },\n end: Object.assign({}, data.end)\n };\n data.end = Object.assign({}, token.start);\n\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n events.splice(eventIndex, 0, ['enter', token, context], ['exit', token, context]);\n eventIndex += 2;\n }\n }\n\n eventIndex++;\n }\n }\n\n return events;\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n */\n\n/**\n * @typedef Info\n * @property {() => void} restore\n * @property {number} from\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * @param {Info} info\n * @returns {void}\n */\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * @param {InitialConstruct} initialize\n * @param {Omit} [from]\n * @returns {TokenizeContext}\n */\n\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n var point = Object.assign(from ? Object.assign({}, from) : {\n line: 1,\n column: 1,\n offset: 0\n }, {\n _index: 0,\n _bufferIndex: -1\n });\n /** @type {Record} */\n\n var columnStart = {};\n /** @type {Construct[]} */\n\n var resolveAllConstructs = [];\n /** @type {Chunk[]} */\n\n var chunks = [];\n /** @type {Token[]} */\n\n var stack = [];\n /** @type {boolean|undefined} */\n\n var consumed = true;\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n\n var effects = {\n consume: consume,\n enter: enter,\n exit: exit,\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n\n var context = {\n previous: null,\n code: null,\n containerState: {},\n events: [],\n parser: parser,\n sliceStream: sliceStream,\n sliceSerialize: sliceSerialize,\n now: now,\n defineSkip: defineSkip,\n write: write\n };\n /**\n * The state function.\n *\n * @type {State|void}\n */\n\n var state = initialize.tokenize.call(context, effects);\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n\n var expectedCode;\n\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n\n return context;\n /** @type {TokenizeContext['write']} */\n\n function write(slice) {\n chunks = push(chunks, slice);\n main(); // Exit if we’re not done, resolve might change stuff.\n\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n\n addResult(initialize, 0); // Otherwise, resolve, and exit.\n\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n } //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n\n\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n /** @type {TokenizeContext['sliceStream']} */\n\n\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n /** @type {TokenizeContext['now']} */\n\n\n function now() {\n return Object.assign({}, point);\n }\n /** @type {TokenizeContext['defineSkip']} */\n\n\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n } //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {void}\n */\n\n\n function main() {\n /** @type {number} */\n var chunkIndex;\n\n while (point._index < chunks.length) {\n var chunk = chunks[point._index]; // If we’re in a buffer chunk, loop through it.\n\n if (typeof chunk === 'string') {\n chunkIndex = point._index;\n\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * @returns {void}\n */\n\n\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n /** @type {Effects['consume']} */\n\n\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n } // Not in a string chunk.\n\n\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++; // At end of string chunk.\n // @ts-expect-error Points w/ non-negative `_bufferIndex` reference\n // strings.\n\n if (point._bufferIndex === chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n } // Expose the previous character.\n\n\n context.previous = code; // Mark as consumed.\n\n consumed = true;\n }\n /** @type {Effects['enter']} */\n\n\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n var token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n /** @type {Effects['exit']} */\n\n\n function exit(type) {\n var token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n\n\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n\n\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * @param {Record} [fields]\n */\n\n\n function constructFactory(onreturn, fields) {\n return hook;\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Construct|Construct[]|ConstructRecord} constructs\n * @param {State} returnState\n * @param {State} [bogusState]\n * @returns {State}\n */\n\n function hook(constructs, returnState, bogusState) {\n /** @type {Construct[]} */\n var listOfConstructs;\n /** @type {number} */\n\n var constructIndex;\n /** @type {Construct} */\n\n var currentConstruct;\n /** @type {Info} */\n\n var info;\n return Array.isArray(constructs) ?\n /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs // @ts-expect-error Looks like a construct.\n ? handleListOfConstructs([constructs]) : handleMapOfConstructs(constructs);\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * @returns {State}\n */\n\n function handleMapOfConstructs(map) {\n return start;\n /** @type {State} */\n\n function start(code) {\n var def = code !== null && map[code];\n var all = code !== null && map[\"null\"];\n var list = [].concat(_toConsumableArray(Array.isArray(def) ? def : def ? [def] : []), _toConsumableArray(Array.isArray(all) ? all : all ? [all] : []));\n return handleListOfConstructs(list)(code);\n }\n }\n /**\n * Handle a list of construct.\n *\n * @param {Construct[]} list\n * @returns {State}\n */\n\n\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n\n if (list.length === 0) {\n return bogusState;\n }\n\n return handleConstruct(list[constructIndex]);\n }\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * @returns {State}\n */\n\n\n function handleConstruct(construct) {\n return start;\n /** @type {State} */\n\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n if (construct.name && context.parser.constructs.disable[\"null\"].includes(construct.name)) {\n return nok(code);\n }\n\n return construct.tokenize.call( // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n /** @type {State} */\n\n\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n /** @type {State} */\n\n\n function nok(code) {\n consumed = true;\n info.restore();\n\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n\n return bogusState;\n }\n }\n }\n /**\n * @param {Construct} construct\n * @param {number} from\n * @returns {void}\n */\n\n\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n /**\n * Store state.\n *\n * @returns {Info}\n */\n\n\n function store() {\n var startPoint = now();\n var startPrevious = context.previous;\n var startCurrentConstruct = context.currentConstruct;\n var startEventsIndex = context.events.length;\n var startStack = Array.from(stack);\n return {\n restore: restore,\n from: startEventsIndex\n };\n /**\n * Restore state.\n *\n * @returns {void}\n */\n\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {void}\n */\n\n\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {Chunk[]} chunks\n * @param {Pick} token\n * @returns {Chunk[]}\n */\n\nfunction sliceChunks(chunks, token) {\n var startIndex = token.start._index;\n var startBufferIndex = token.start._bufferIndex;\n var endIndex = token.end._index;\n var endBufferIndex = token.end._bufferIndex;\n /** @type {Chunk[]} */\n\n var view;\n\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n\n if (startBufferIndex > -1) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view[0] = view[0].slice(startBufferIndex);\n }\n\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n\n return view;\n}\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {Chunk[]} chunks\n * @param {boolean} [expandTabs=false]\n * @returns {string}\n */\n\n\nfunction serializeChunks(chunks, expandTabs) {\n var index = -1;\n /** @type {string[]} */\n\n var result = [];\n /** @type {boolean|undefined} */\n\n var atTab;\n\n while (++index < chunks.length) {\n var chunk = chunks[index];\n /** @type {string} */\n\n var value = void 0;\n\n if (typeof chunk === 'string') {\n value = chunk;\n } else switch (chunk) {\n case -5:\n {\n value = '\\r';\n break;\n }\n\n case -4:\n {\n value = '\\n';\n break;\n }\n\n case -3:\n {\n value = '\\r' + '\\n';\n break;\n }\n\n case -2:\n {\n value = expandTabs ? ' ' : '\\t';\n break;\n }\n\n case -1:\n {\n if (!expandTabs && atTab) continue;\n value = ' ';\n break;\n }\n\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n\n atTab = chunk === -2;\n result.push(value);\n }\n\n return result.join('');\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeThematicBreak(effects, ok, nok) {\n var size = 0;\n /** @type {NonNullable} */\n\n var marker;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('thematicBreak');\n marker = code;\n return atBreak(code);\n }\n /** @type {State} */\n\n\n function atBreak(code) {\n if (code === marker) {\n effects.enter('thematicBreakSequence');\n return sequence(code);\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, 'whitespace')(code);\n }\n\n if (size < 3 || code !== null && !markdownLineEnding(code)) {\n return nok(code);\n }\n\n effects.exit('thematicBreak');\n return ok(code);\n }\n /** @type {State} */\n\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n\n effects.exit('thematicBreakSequence');\n return atBreak(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\n\n/**\n * @typedef {Record & {marker: Code, type: string, size: number}} ListContainerState\n * @typedef {TokenizeContext & {containerState: ListContainerState}} TokenizeContextWithState\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n/** @type {Construct} */\n\nexport var list = {\n name: 'list',\n tokenize: tokenizeListStart,\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd\n};\n/** @type {Construct} */\n\nvar listItemPrefixWhitespaceConstruct = {\n tokenize: tokenizeListItemPrefixWhitespace,\n partial: true\n};\n/** @type {Construct} */\n\nvar indentConstruct = {\n tokenize: tokenizeIndent,\n partial: true\n};\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeListStart(effects, ok, nok) {\n var self = this;\n var tail = self.events[self.events.length - 1];\n var initialSize = tail && tail[1].type === 'linePrefix' ? tail[2].sliceSerialize(tail[1], true).length : 0;\n var size = 0;\n return start;\n /** @type {State} */\n\n function start(code) {\n var kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? 'listUnordered' : 'listOrdered');\n\n if (kind === 'listUnordered' ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n\n if (kind === 'listUnordered') {\n effects.enter('listItemPrefix');\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n\n if (!self.interrupt || code === 49) {\n effects.enter('listItemPrefix');\n effects.enter('listItemValue');\n return inside(code);\n }\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit('listItemValue');\n return atMarker(code);\n }\n\n return nok(code);\n }\n /**\n * @type {State}\n **/\n\n\n function atMarker(code) {\n effects.enter('listItemMarker');\n effects.consume(code);\n effects.exit('listItemMarker');\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine, // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n /** @type {State} */\n\n\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n /** @type {State} */\n\n\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter('listItemPrefixWhitespace');\n effects.consume(code);\n effects.exit('listItemPrefixWhitespace');\n return endOfPrefix;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit('listItemPrefix'), true).length;\n return ok(code);\n }\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\n\nfunction tokenizeListContinuation(effects, ok, nok) {\n var self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n /** @type {State} */\n\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine; // We have a blank line.\n // Still, try to consume at most the items size.\n\n return factorySpace(effects, ok, 'listItemIndent', self.containerState.size + 1)(code);\n }\n /** @type {State} */\n\n\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n /** @type {State} */\n\n\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true; // As we’re closing flow, we’re no longer interrupting.\n\n self.interrupt = undefined;\n return factorySpace(effects, effects.attempt(list, ok, nok), 'linePrefix', self.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4)(code);\n }\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\n\nfunction tokenizeIndent(effects, ok, nok) {\n var self = this;\n return factorySpace(effects, afterPrefix, 'listItemIndent', self.containerState.size + 1);\n /** @type {State} */\n\n function afterPrefix(code) {\n var tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'listItemIndent' && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n/**\n * @type {Exiter}\n * @this {TokenizeContextWithState}\n */\n\n\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\n\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n var self = this;\n return factorySpace(effects, afterPrefix, 'listItemPrefixWhitespace', self.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4 + 1);\n /** @type {State} */\n\n function afterPrefix(code) {\n var tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === 'listItemPrefixWhitespace' ? ok(code) : nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var blockQuote = {\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart,\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit: exit\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n if (code === 62) {\n var state = self.containerState;\n\n if (!state.open) {\n effects.enter('blockQuote', {\n _container: true\n });\n state.open = true;\n }\n\n effects.enter('blockQuotePrefix');\n effects.enter('blockQuoteMarker');\n effects.consume(code);\n effects.exit('blockQuoteMarker');\n return after;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter('blockQuotePrefixWhitespace');\n effects.consume(code);\n effects.exit('blockQuotePrefixWhitespace');\n effects.exit('blockQuotePrefix');\n return ok;\n }\n\n effects.exit('blockQuotePrefix');\n return ok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n return factorySpace(effects, effects.attempt(blockQuote, ok, nok), 'linePrefix', this.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4);\n}\n/** @type {Exiter} */\n\n\nfunction exit(effects) {\n effects.exit('blockQuote');\n}","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} literalType\n * @param {string} literalMarkerType\n * @param {string} rawType\n * @param {string} stringType\n * @param {number} [max=Infinity]\n * @returns {State}\n */\n// eslint-disable-next-line max-params\n\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n var limit = max || Number.POSITIVE_INFINITY;\n var balance = 0;\n return start;\n /** @type {State} */\n\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return destinationEnclosedBefore;\n }\n\n if (code === null || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return destinationRaw(code);\n }\n /** @type {State} */\n\n\n function destinationEnclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n\n effects.enter(stringType);\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return destinationEnclosed(code);\n }\n /** @type {State} */\n\n\n function destinationEnclosed(code) {\n if (code === 62) {\n effects.exit('chunkString');\n effects.exit(stringType);\n return destinationEnclosedBefore(code);\n }\n\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n\n effects.consume(code);\n return code === 92 ? destinationEnclosedEscape : destinationEnclosed;\n }\n /** @type {State} */\n\n\n function destinationEnclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return destinationEnclosed;\n }\n\n return destinationEnclosed(code);\n }\n /** @type {State} */\n\n\n function destinationRaw(code) {\n if (code === 40) {\n if (++balance > limit) return nok(code);\n effects.consume(code);\n return destinationRaw;\n }\n\n if (code === 41) {\n if (!balance--) {\n effects.exit('chunkString');\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n\n effects.consume(code);\n return destinationRaw;\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n if (balance) return nok(code);\n effects.exit('chunkString');\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n\n if (asciiControl(code)) return nok(code);\n effects.consume(code);\n return code === 92 ? destinationRawEscape : destinationRaw;\n }\n /** @type {State} */\n\n\n function destinationRawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return destinationRaw;\n }\n\n return destinationRaw(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').State} State\n */\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * @this {TokenizeContext}\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} markerType\n * @param {string} stringType\n * @returns {State}\n */\n// eslint-disable-next-line max-params\n\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n var self = this;\n var size = 0;\n /** @type {boolean} */\n\n var data;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n /** @type {State} */\n\n\n function atBreak(code) {\n if (code === null || code === 91 || code === 93 && !data ||\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook */\n\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs || size > 999) {\n return nok(code);\n }\n\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return atBreak;\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return label(code);\n }\n /** @type {State} */\n\n\n function label(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit('chunkString');\n return atBreak(code);\n }\n\n effects.consume(code);\n data = data || !markdownSpace(code);\n return code === 92 ? labelEscape : label;\n }\n /** @type {State} */\n\n\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return label;\n }\n\n return label(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} markerType\n * @param {string} stringType\n * @returns {State}\n */\n// eslint-disable-next-line max-params\n\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable} */\n var marker;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return atFirstTitleBreak;\n }\n /** @type {State} */\n\n\n function atFirstTitleBreak(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n effects.enter(stringType);\n return atTitleBreak(code);\n }\n /** @type {State} */\n\n\n function atTitleBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return atFirstTitleBreak(marker);\n }\n\n if (code === null) {\n return nok(code);\n } // Note: blank lines can’t exist in content.\n\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return factorySpace(effects, atTitleBreak, 'linePrefix');\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return title(code);\n }\n /** @type {State} */\n\n\n function title(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit('chunkString');\n return atTitleBreak(code);\n }\n\n effects.consume(code);\n return code === 92 ? titleEscape : title;\n }\n /** @type {State} */\n\n\n function titleEscape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return title;\n }\n\n return title(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * @param {Effects} effects\n * @param {State} ok\n */\n\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n var seen;\n return start;\n /** @type {State} */\n\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n seen = true;\n return start;\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? 'linePrefix' : 'lineSuffix')(code);\n }\n\n return ok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { markdownLineEnding, markdownLineEndingOrSpace } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n/** @type {Construct} */\n\nvar titleConstruct = {\n tokenize: tokenizeTitle,\n partial: true\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeDefinition(effects, ok, nok) {\n var self = this;\n /** @type {string} */\n\n var identifier;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('definition');\n return factoryLabel.call(self, effects, labelAfter, nok, 'definitionLabel', 'definitionLabelMarker', 'definitionLabelString')(code);\n }\n /** @type {State} */\n\n\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker'); // Note: blank lines can’t exist in content.\n\n return factoryWhitespace(effects, factoryDestination(effects, effects.attempt(titleConstruct, factorySpace(effects, after, 'whitespace'), factorySpace(effects, after, 'whitespace')), nok, 'definitionDestination', 'definitionDestinationLiteral', 'definitionDestinationLiteralMarker', 'definitionDestinationRaw', 'definitionDestinationString'));\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('definition');\n\n if (!self.parser.defined.includes(identifier)) {\n self.parser.defined.push(identifier);\n }\n\n return ok(code);\n }\n\n return nok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeTitle(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, before)(code) : nok(code);\n }\n /** @type {State} */\n\n\n function before(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, factorySpace(effects, after, 'whitespace'), nok, 'definitionTitle', 'definitionTitleMarker', 'definitionTitleString')(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n/** @type {Construct} */\n\nvar indentedContent = {\n tokenize: tokenizeIndentedContent,\n partial: true\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeCodeIndented(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeIndented');\n return factorySpace(effects, afterStartPrefix, 'linePrefix', 4 + 1)(code);\n }\n /** @type {State} */\n\n\n function afterStartPrefix(code) {\n var tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'linePrefix' && tail[2].sliceSerialize(tail[1], true).length >= 4 ? afterPrefix(code) : nok(code);\n }\n /** @type {State} */\n\n\n function afterPrefix(code) {\n if (code === null) {\n return after(code);\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(indentedContent, afterPrefix, after)(code);\n }\n\n effects.enter('codeFlowValue');\n return content(code);\n }\n /** @type {State} */\n\n\n function content(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue');\n return afterPrefix(code);\n }\n\n effects.consume(code);\n return content;\n }\n /** @type {State} */\n\n\n function after(code) {\n effects.exit('codeIndented');\n return ok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeIndentedContent(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return start;\n }\n\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code);\n }\n /** @type {State} */\n\n\n function afterPrefix(code) {\n var tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'linePrefix' && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? start(code) : nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\n\nexport var headingAtx = {\n name: 'headingAtx',\n tokenize: tokenizeHeadingAtx,\n resolve: resolveHeadingAtx\n};\n/** @type {Resolver} */\n\nfunction resolveHeadingAtx(events, context) {\n var contentEnd = events.length - 2;\n var contentStart = 3;\n /** @type {Token} */\n\n var content;\n /** @type {Token} */\n\n var text; // Prefix whitespace, part of the opening.\n\n if (events[contentStart][1].type === 'whitespace') {\n contentStart += 2;\n } // Suffix whitespace, part of the closing.\n\n\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === 'whitespace') {\n contentEnd -= 2;\n }\n\n if (events[contentEnd][1].type === 'atxHeadingSequence' && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === 'whitespace')) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n\n if (contentEnd > contentStart) {\n content = {\n type: 'atxHeadingText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n text = {\n type: 'chunkText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n // @ts-expect-error Constants are fine to assign.\n contentType: 'text'\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n var self = this;\n var size = 0;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('atxHeading');\n effects.enter('atxHeadingSequence');\n return fenceOpenInside(code);\n }\n /** @type {State} */\n\n\n function fenceOpenInside(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return fenceOpenInside;\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingSequence');\n return self.interrupt ? ok(code) : headingBreak(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function headingBreak(code) {\n if (code === 35) {\n effects.enter('atxHeadingSequence');\n return sequence(code);\n }\n\n if (code === null || markdownLineEnding(code)) {\n effects.exit('atxHeading');\n return ok(code);\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, headingBreak, 'whitespace')(code);\n }\n\n effects.enter('atxHeadingText');\n return data(code);\n }\n /** @type {State} */\n\n\n function sequence(code) {\n if (code === 35) {\n effects.consume(code);\n return sequence;\n }\n\n effects.exit('atxHeadingSequence');\n return headingBreak(code);\n }\n /** @type {State} */\n\n\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingText');\n return headingBreak(code);\n }\n\n effects.consume(code);\n return data;\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var setextUnderline = {\n name: 'setextUnderline',\n tokenize: tokenizeSetextUnderline,\n resolveTo: resolveToSetextUnderline\n};\n/** @type {Resolver} */\n\nfunction resolveToSetextUnderline(events, context) {\n var index = events.length;\n /** @type {number|undefined} */\n\n var content;\n /** @type {number|undefined} */\n\n var text;\n /** @type {number|undefined} */\n\n var definition; // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === 'content') {\n content = index;\n break;\n }\n\n if (events[index][1].type === 'paragraph') {\n text = index;\n }\n } // Exit\n else {\n if (events[index][1].type === 'content') {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1);\n }\n\n if (!definition && events[index][1].type === 'definition') {\n definition = index;\n }\n }\n }\n\n var heading = {\n type: 'setextHeading',\n start: Object.assign({}, events[text][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }; // Change the paragraph to setext heading text.\n\n events[text][1].type = 'setextHeadingText'; // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n\n if (definition) {\n events.splice(text, 0, ['enter', heading, context]);\n events.splice(definition + 1, 0, ['exit', events[content][1], context]);\n events[content][1].end = Object.assign({}, events[definition][1].end);\n } else {\n events[content][1] = heading;\n } // Add the heading exit at the end.\n\n\n events.push(['exit', heading, context]);\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n var self = this;\n var index = self.events.length;\n /** @type {NonNullable} */\n\n var marker;\n /** @type {boolean} */\n\n var paragraph; // Find an opening.\n\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== 'lineEnding' && self.events[index][1].type !== 'linePrefix' && self.events[index][1].type !== 'content') {\n paragraph = self.events[index][1].type === 'paragraph';\n break;\n }\n }\n\n return start;\n /** @type {State} */\n\n function start(code) {\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter('setextHeadingLine');\n effects.enter('setextHeadingLineSequence');\n marker = code;\n return closingSequence(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code);\n return closingSequence;\n }\n\n effects.exit('setextHeadingLineSequence');\n return factorySpace(effects, closingSequenceEnd, 'lineSuffix')(code);\n }\n /** @type {State} */\n\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('setextHeadingLine');\n return ok(code);\n }\n\n return nok(code);\n }\n}","/**\n * List of lowercase HTML tag names which when parsing HTML (flow), result\n * in more relaxed rules (condition 6): because they are known blocks, the\n * HTML-like syntax doesn’t have to be strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * .\n */\nexport var htmlBlockNames = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'section', 'source', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul'];\n/**\n * List of lowercase HTML tag names which when parsing HTML (flow), result in\n * HTML that can include lines w/o exiting, until a closing tag also in this\n * list is found (condition 1).\n *\n * This module is copied from:\n * .\n *\n * Note that `textarea` is not available in `CommonMark@0.29` but has been\n * merged to the primary branch and is slated to be released in the next release\n * of CommonMark.\n */\n\nexport var htmlRawNames = ['pre', 'script', 'style', 'textarea'];","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { asciiAlpha, asciiAlphanumeric, markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\n/** @type {Construct} */\n\nexport var htmlFlow = {\n name: 'htmlFlow',\n tokenize: tokenizeHtmlFlow,\n resolveTo: resolveToHtmlFlow,\n concrete: true\n};\n/** @type {Construct} */\n\nvar nextBlankConstruct = {\n tokenize: tokenizeNextBlank,\n partial: true\n};\n/** @type {Resolver} */\n\nfunction resolveToHtmlFlow(events) {\n var index = events.length;\n\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') {\n break;\n }\n }\n\n if (index > 1 && events[index - 2][1].type === 'linePrefix') {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start; // Add the prefix start to the HTML line token.\n\n events[index + 1][1].start = events[index - 2][1].start; // Remove the line prefix.\n\n events.splice(index - 2, 2);\n }\n\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n var self = this;\n /** @type {number} */\n\n var kind;\n /** @type {boolean} */\n\n var startTag;\n /** @type {string} */\n\n var buffer;\n /** @type {number} */\n\n var index;\n /** @type {Code} */\n\n var marker;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('htmlFlow');\n effects.enter('htmlFlowData');\n effects.consume(code);\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationStart;\n }\n\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n\n if (code === 63) {\n effects.consume(code);\n kind = 3; // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code);\n buffer = String.fromCharCode(code);\n startTag = true;\n return tagName;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function declarationStart(code) {\n if (code === 45) {\n effects.consume(code);\n kind = 2;\n return commentOpenInside;\n }\n\n if (code === 91) {\n effects.consume(code);\n kind = 5;\n buffer = 'CDATA[';\n index = 0;\n return cdataOpenInside;\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code);\n kind = 4;\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function cdataOpenInside(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code);\n return index === buffer.length ? self.interrupt ? ok : continuation : cdataOpenInside;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n if (code !== 47 && startTag && htmlRawNames.includes(buffer.toLowerCase())) {\n kind = 1;\n return self.interrupt ? ok(code) : continuation(code);\n }\n\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n kind = 6;\n\n if (code === 47) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n return self.interrupt ? ok(code) : continuation(code);\n }\n\n kind = 7; // Do not support complete HTML when interrupting\n\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : startTag ? completeAttributeNameBefore(code) : completeClosingTagAfter(code);\n }\n\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n return self.interrupt ? ok : continuation;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n\n return completeEnd(code);\n }\n /** @type {State} */\n\n\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n\n return completeEnd(code);\n }\n /** @type {State} */\n\n\n function completeAttributeName(code) {\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n\n return completeAttributeNameAfter(code);\n }\n /** @type {State} */\n\n\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n\n return completeAttributeNameBefore(code);\n }\n /** @type {State} */\n\n\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return completeAttributeValueQuoted;\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n\n marker = null;\n return completeAttributeValueUnquoted(code);\n }\n /** @type {State} */\n\n\n function completeAttributeValueQuoted(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n if (code === marker) {\n effects.consume(code);\n return completeAttributeValueQuotedAfter;\n }\n\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n /** @type {State} */\n\n\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n /** @type {State} */\n\n\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function completeAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n\n return code === null || markdownLineEnding(code) ? continuation(code) : nok(code);\n }\n /** @type {State} */\n\n\n function continuation(code) {\n if (code === 45 && kind === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n\n if (code === 60 && kind === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n\n if (code === 62 && kind === 4) {\n effects.consume(code);\n return continuationClose;\n }\n\n if (code === 63 && kind === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n\n if (code === 93 && kind === 5) {\n effects.consume(code);\n return continuationCharacterDataInside;\n }\n\n if (markdownLineEnding(code) && (kind === 6 || kind === 7)) {\n return effects.check(nextBlankConstruct, continuationClose, continuationAtLineEnding)(code);\n }\n\n if (code === null || markdownLineEnding(code)) {\n return continuationAtLineEnding(code);\n }\n\n effects.consume(code);\n return continuation;\n }\n /** @type {State} */\n\n\n function continuationAtLineEnding(code) {\n effects.exit('htmlFlowData');\n return htmlContinueStart(code);\n }\n /** @type {State} */\n\n\n function htmlContinueStart(code) {\n if (code === null) {\n return done(code);\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt({\n tokenize: htmlLineEnd,\n partial: true\n }, htmlContinueStart, done)(code);\n }\n\n effects.enter('htmlFlowData');\n return continuation(code);\n }\n /** @type {Tokenizer} */\n\n\n function htmlLineEnd(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return lineStart;\n }\n /** @type {State} */\n\n\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n }\n /** @type {State} */\n\n\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n\n return continuation(code);\n }\n /** @type {State} */\n\n\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n\n return continuation(code);\n }\n /** @type {State} */\n\n\n function continuationRawEndTag(code) {\n if (code === 62 && htmlRawNames.includes(buffer.toLowerCase())) {\n effects.consume(code);\n return continuationClose;\n }\n\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n\n return continuation(code);\n }\n /** @type {State} */\n\n\n function continuationCharacterDataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n\n return continuation(code);\n }\n /** @type {State} */\n\n\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n } // More dashes.\n\n\n if (code === 45 && kind === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n\n return continuation(code);\n }\n /** @type {State} */\n\n\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData');\n return done(code);\n }\n\n effects.consume(code);\n return continuationClose;\n }\n /** @type {State} */\n\n\n function done(code) {\n effects.exit('htmlFlow');\n return ok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeNextBlank(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.exit('htmlFlowData');\n effects.enter('lineEndingBlank');\n effects.consume(code);\n effects.exit('lineEndingBlank');\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeCodeFenced(effects, ok, nok) {\n var self = this;\n /** @type {Construct} */\n\n var closingFenceConstruct = {\n tokenize: tokenizeClosingFence,\n partial: true\n };\n /** @type {Construct} */\n\n var nonLazyLine = {\n tokenize: tokenizeNonLazyLine,\n partial: true\n };\n var tail = this.events[this.events.length - 1];\n var initialPrefix = tail && tail[1].type === 'linePrefix' ? tail[2].sliceSerialize(tail[1], true).length : 0;\n var sizeOpen = 0;\n /** @type {NonNullable} */\n\n var marker;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeFenced');\n effects.enter('codeFencedFence');\n effects.enter('codeFencedFenceSequence');\n marker = code;\n return sequenceOpen(code);\n }\n /** @type {State} */\n\n\n function sequenceOpen(code) {\n if (code === marker) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n\n effects.exit('codeFencedFenceSequence');\n return sizeOpen < 3 ? nok(code) : factorySpace(effects, infoOpen, 'whitespace')(code);\n }\n /** @type {State} */\n\n\n function infoOpen(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code);\n }\n\n effects.enter('codeFencedFenceInfo');\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return info(code);\n }\n /** @type {State} */\n\n\n function info(code) {\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('chunkString');\n effects.exit('codeFencedFenceInfo');\n return factorySpace(effects, infoAfter, 'whitespace')(code);\n }\n\n if (code === 96 && code === marker) return nok(code);\n effects.consume(code);\n return info;\n }\n /** @type {State} */\n\n\n function infoAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code);\n }\n\n effects.enter('codeFencedFenceMeta');\n effects.enter('chunkString', {\n contentType: 'string'\n });\n return meta(code);\n }\n /** @type {State} */\n\n\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString');\n effects.exit('codeFencedFenceMeta');\n return openAfter(code);\n }\n\n if (code === 96 && code === marker) return nok(code);\n effects.consume(code);\n return meta;\n }\n /** @type {State} */\n\n\n function openAfter(code) {\n effects.exit('codeFencedFence');\n return self.interrupt ? ok(code) : contentStart(code);\n }\n /** @type {State} */\n\n\n function contentStart(code) {\n if (code === null) {\n return after(code);\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(nonLazyLine, effects.attempt(closingFenceConstruct, after, initialPrefix ? factorySpace(effects, contentStart, 'linePrefix', initialPrefix + 1) : contentStart), after)(code);\n }\n\n effects.enter('codeFlowValue');\n return contentContinue(code);\n }\n /** @type {State} */\n\n\n function contentContinue(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue');\n return contentStart(code);\n }\n\n effects.consume(code);\n return contentContinue;\n }\n /** @type {State} */\n\n\n function after(code) {\n effects.exit('codeFenced');\n return ok(code);\n }\n /** @type {Tokenizer} */\n\n\n function tokenizeNonLazyLine(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return lineStart;\n }\n /** @type {State} */\n\n\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n }\n /** @type {Tokenizer} */\n\n\n function tokenizeClosingFence(effects, ok, nok) {\n var size = 0;\n return factorySpace(effects, closingSequenceStart, 'linePrefix', this.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4);\n /** @type {State} */\n\n function closingSequenceStart(code) {\n effects.enter('codeFencedFence');\n effects.enter('codeFencedFenceSequence');\n return closingSequence(code);\n }\n /** @type {State} */\n\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return closingSequence;\n }\n\n if (size < sizeOpen) return nok(code);\n effects.exit('codeFencedFenceSequence');\n return factorySpace(effects, closingSequenceEnd, 'whitespace')(code);\n }\n /** @type {State} */\n\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence');\n return ok(code);\n }\n\n return nok(code);\n }\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeCharacterReference(effects, ok, nok) {\n var self = this;\n var size = 0;\n /** @type {number} */\n\n var max;\n /** @type {(code: Code) => code is number} */\n\n var test;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('characterReference');\n effects.enter('characterReferenceMarker');\n effects.consume(code);\n effects.exit('characterReferenceMarker');\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric');\n effects.consume(code);\n effects.exit('characterReferenceMarkerNumeric');\n return numeric;\n }\n\n effects.enter('characterReferenceValue');\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n /** @type {State} */\n\n\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal');\n effects.consume(code);\n effects.exit('characterReferenceMarkerHexadecimal');\n effects.enter('characterReferenceValue');\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n\n effects.enter('characterReferenceValue');\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n /** @type {State} */\n\n\n function value(code) {\n /** @type {Token} */\n var token;\n\n if (code === 59 && size) {\n token = effects.exit('characterReferenceValue');\n\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n effects.enter('characterReferenceMarker');\n effects.consume(code);\n effects.exit('characterReferenceMarker');\n effects.exit('characterReference');\n return ok;\n }\n\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n\n return nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('characterEscape');\n effects.enter('escapeMarker');\n effects.consume(code);\n effects.exit('escapeMarker');\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue');\n effects.consume(code);\n effects.exit('characterEscapeValue');\n effects.exit('characterEscape');\n return ok;\n }\n\n return nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { factorySpace } from 'micromark-factory-space';\n\n/** @type {Construct} */\nexport var lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return factorySpace(effects, ok, 'linePrefix');\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\n\nexport var labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n};\n/** @type {Construct} */\n\nvar resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\n\nvar fullReferenceConstruct = {\n tokenize: tokenizeFullReference\n};\n/** @type {Construct} */\n\nvar collapsedReferenceConstruct = {\n tokenize: tokenizeCollapsedReference\n};\n/** @type {Resolver} */\n\nfunction resolveAllLabelEnd(events) {\n var index = -1;\n /** @type {Token} */\n\n var token;\n\n while (++index < events.length) {\n token = events[index][1];\n\n if (token.type === 'labelImage' || token.type === 'labelLink' || token.type === 'labelEnd') {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2);\n token.type = 'data';\n index++;\n }\n }\n\n return events;\n}\n/** @type {Resolver} */\n\n\nfunction resolveToLabelEnd(events, context) {\n var index = events.length;\n var offset = 0;\n /** @type {Token} */\n\n var token;\n /** @type {number|undefined} */\n\n var open;\n /** @type {number|undefined} */\n\n var close;\n /** @type {Event[]} */\n\n var media; // Find an opening.\n\n while (index--) {\n token = events[index][1];\n\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === 'link' || token.type === 'labelLink' && token._inactive) {\n break;\n } // Mark other link openings as inactive, as we can’t have links in\n // links.\n\n\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === 'labelImage' || token.type === 'labelLink') && !token._balanced) {\n open = index;\n\n if (token.type !== 'labelLink') {\n offset = 2;\n break;\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index;\n }\n }\n\n var group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n var label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n };\n var text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n };\n media = [['enter', group, context], ['enter', label, context]]; // Opening marker.\n\n media = push(media, events.slice(open + 1, open + offset + 3)); // Text open.\n\n media = push(media, [['enter', text, context]]); // Between.\n\n media = push(media, resolveAll(context.parser.constructs.insideSpan[\"null\"], events.slice(open + offset + 4, close - 3), context)); // Text close, marker close, label close.\n\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]); // Reference, resource, or so.\n\n media = push(media, events.slice(close + 1)); // Media close.\n\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeLabelEnd(effects, ok, nok) {\n var self = this;\n var index = self.events.length;\n /** @type {Token} */\n\n var labelStart;\n /** @type {boolean} */\n\n var defined; // Find an opening.\n\n while (index--) {\n if ((self.events[index][1].type === 'labelImage' || self.events[index][1].type === 'labelLink') && !self.events[index][1]._balanced) {\n labelStart = self.events[index][1];\n break;\n }\n }\n\n return start;\n /** @type {State} */\n\n function start(code) {\n if (!labelStart) {\n return nok(code);\n } // It’s a balanced bracket, but contains a link.\n\n\n if (labelStart._inactive) return balanced(code);\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter('labelEnd');\n effects.enter('labelMarker');\n effects.consume(code);\n effects.exit('labelMarker');\n effects.exit('labelEnd');\n return afterLabelEnd;\n }\n /** @type {State} */\n\n\n function afterLabelEnd(code) {\n // Resource: `[asd](fgh)`.\n if (code === 40) {\n return effects.attempt(resourceConstruct, ok, defined ? ok : balanced)(code);\n } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?\n\n\n if (code === 91) {\n return effects.attempt(fullReferenceConstruct, ok, defined ? effects.attempt(collapsedReferenceConstruct, ok, balanced) : balanced)(code);\n } // Shortcut reference: `[asd]`?\n\n\n return defined ? ok(code) : balanced(code);\n }\n /** @type {State} */\n\n\n function balanced(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeResource(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('resource');\n effects.enter('resourceMarker');\n effects.consume(code);\n effects.exit('resourceMarker');\n return factoryWhitespace(effects, open);\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 41) {\n return end(code);\n }\n\n return factoryDestination(effects, destinationAfter, nok, 'resourceDestination', 'resourceDestinationLiteral', 'resourceDestinationLiteralMarker', 'resourceDestinationRaw', 'resourceDestinationString', 32)(code);\n }\n /** @type {State} */\n\n\n function destinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, between)(code) : end(code);\n }\n /** @type {State} */\n\n\n function between(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, factoryWhitespace(effects, end), nok, 'resourceTitle', 'resourceTitleMarker', 'resourceTitleString')(code);\n }\n\n return end(code);\n }\n /** @type {State} */\n\n\n function end(code) {\n if (code === 41) {\n effects.enter('resourceMarker');\n effects.consume(code);\n effects.exit('resourceMarker');\n effects.exit('resource');\n return ok;\n }\n\n return nok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeFullReference(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n return factoryLabel.call(self, effects, afterLabel, nok, 'reference', 'referenceMarker', 'referenceString')(code);\n }\n /** @type {State} */\n\n\n function afterLabel(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeCollapsedReference(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('reference');\n effects.enter('referenceMarker');\n effects.consume(code);\n effects.exit('referenceMarker');\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 93) {\n effects.enter('referenceMarker');\n effects.consume(code);\n effects.exit('referenceMarker');\n effects.exit('reference');\n return ok;\n }\n\n return nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { labelEnd } from './label-end.js';\n/** @type {Construct} */\n\nexport var labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('labelImage');\n effects.enter('labelImageMarker');\n effects.consume(code);\n effects.exit('labelImageMarker');\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker');\n effects.consume(code);\n effects.exit('labelMarker');\n effects.exit('labelImage');\n return after;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function after(code) {\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook */\n\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Point} Point\n */\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\n\nexport var attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n};\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n\nfunction resolveAllAttention(events, context) {\n var index = -1;\n /** @type {number} */\n\n var open;\n /** @type {Token} */\n\n var group;\n /** @type {Token} */\n\n var text;\n /** @type {Token} */\n\n var openingSequence;\n /** @type {Token} */\n\n var closingSequence;\n /** @type {number} */\n\n var use;\n /** @type {Event[]} */\n\n var nextEvents;\n /** @type {number} */\n\n var offset; // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n open = index; // Now walk back to find an opener.\n\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open && // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n } // Number of markers to use from the sequence.\n\n\n use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n var start = Object.assign({}, events[open][1].end);\n var end = Object.assign({}, events[index][1].start);\n movePoint(start, -use);\n movePoint(end, use);\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: start,\n end: Object.assign({}, events[open][1].end)\n };\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end: end\n };\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n };\n events[open][1].end = Object.assign({}, openingSequence.start);\n events[index][1].start = Object.assign({}, closingSequence.end);\n nextEvents = []; // If there are more markers in the opening, add them before.\n\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n } // Opening.\n\n\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]); // Between.\n\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan[\"null\"], events.slice(open + 1, index), context)); // Closing.\n\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]); // If there are more markers in the closing, add them after.\n\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n } else {\n offset = 0;\n }\n\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n } // Remove remaining sequences.\n\n\n index = -1;\n\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n\n return events;\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeAttention(effects, ok) {\n var attentionMarkers = this.parser.constructs.attentionMarkers[\"null\"];\n var previous = this.previous;\n var before = classifyCharacter(previous);\n /** @type {NonNullable} */\n\n var marker;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('attentionSequence');\n marker = code;\n return sequence(code);\n }\n /** @type {State} */\n\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n return sequence;\n }\n\n var token = effects.exit('attentionSequence');\n var after = classifyCharacter(code);\n var open = !after || after === 2 && before || attentionMarkers.includes(code);\n var close = !before || before === 2 && after || attentionMarkers.includes(previous);\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {void}\n */\n\n\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { asciiAlpha, asciiAlphanumeric, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeAutolink(effects, ok, nok) {\n var size = 1;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('autolink');\n effects.enter('autolinkMarker');\n effects.consume(code);\n effects.exit('autolinkMarker');\n effects.enter('autolinkProtocol');\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n\n return asciiAtext(code) ? emailAtext(code) : nok(code);\n }\n /** @type {State} */\n\n\n function schemeOrEmailAtext(code) {\n return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code) ? schemeInsideOrEmailAtext(code) : emailAtext(code);\n }\n /** @type {State} */\n\n\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n return urlInside;\n }\n\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n\n return emailAtext(code);\n }\n /** @type {State} */\n\n\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol');\n return end(code);\n }\n\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n\n effects.consume(code);\n return urlInside;\n }\n /** @type {State} */\n\n\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n /** @type {State} */\n\n\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n\n if (code === 62) {\n // Exit, then change the type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail';\n return end(code);\n }\n\n return emailValue(code);\n }\n /** @type {State} */\n\n\n function emailValue(code) {\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n effects.consume(code);\n return code === 45 ? emailValue : emailLabel;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function end(code) {\n effects.enter('autolinkMarker');\n effects.consume(code);\n effects.exit('autolinkMarker');\n effects.exit('autolink');\n return ok;\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlpha, asciiAlphanumeric, markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeHtmlText(effects, ok, nok) {\n var self = this;\n /** @type {NonNullable|undefined} */\n\n var marker;\n /** @type {string} */\n\n var buffer;\n /** @type {number} */\n\n var index;\n /** @type {State} */\n\n var returnState;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('htmlText');\n effects.enter('htmlTextData');\n effects.consume(code);\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpen;\n }\n\n if (code === 91) {\n effects.consume(code);\n buffer = 'CDATA[';\n index = 0;\n return cdataOpen;\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function commentOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentStart;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function commentStart(code) {\n if (code === null || code === 62) {\n return nok(code);\n }\n\n if (code === 45) {\n effects.consume(code);\n return commentStartDash;\n }\n\n return comment(code);\n }\n /** @type {State} */\n\n\n function commentStartDash(code) {\n if (code === null || code === 62) {\n return nok(code);\n }\n\n return comment(code);\n }\n /** @type {State} */\n\n\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n\n if (markdownLineEnding(code)) {\n returnState = comment;\n return atLineEnding(code);\n }\n\n effects.consume(code);\n return comment;\n }\n /** @type {State} */\n\n\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return end;\n }\n\n return comment(code);\n }\n /** @type {State} */\n\n\n function cdataOpen(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code);\n return index === buffer.length ? cdata : cdataOpen;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return atLineEnding(code);\n }\n\n effects.consume(code);\n return cdata;\n }\n /** @type {State} */\n\n\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n\n return cdata(code);\n }\n /** @type {State} */\n\n\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n\n return cdata(code);\n }\n /** @type {State} */\n\n\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return atLineEnding(code);\n }\n\n effects.consume(code);\n return declaration;\n }\n /** @type {State} */\n\n\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return atLineEnding(code);\n }\n\n effects.consume(code);\n return instruction;\n }\n /** @type {State} */\n\n\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n /** @type {State} */\n\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function tagClose(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n\n return tagCloseBetween(code);\n }\n /** @type {State} */\n\n\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return atLineEnding(code);\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n\n return end(code);\n }\n /** @type {State} */\n\n\n function tagOpen(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return atLineEnding(code);\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n\n return end(code);\n }\n /** @type {State} */\n\n\n function tagOpenAttributeName(code) {\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n\n return tagOpenAttributeNameAfter(code);\n }\n /** @type {State} */\n\n\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return atLineEnding(code);\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n\n return tagOpenBetween(code);\n }\n /** @type {State} */\n\n\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return atLineEnding(code);\n }\n\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueUnquoted;\n }\n /** @type {State} */\n\n\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n return tagOpenAttributeValueQuotedAfter;\n }\n\n if (code === null) {\n return nok(code);\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return atLineEnding(code);\n }\n\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n /** @type {State} */\n\n\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 62 || code === 47 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n\n return nok(code);\n }\n /** @type {State} */\n\n\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n\n if (code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n } // We can’t have blank lines in content, so no need to worry about empty\n // tokens.\n\n /** @type {State} */\n\n\n function atLineEnding(code) {\n effects.exit('htmlTextData');\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return factorySpace(effects, afterPrefix, 'linePrefix', self.parser.constructs.disable[\"null\"].includes('codeIndented') ? undefined : 4);\n }\n /** @type {State} */\n\n\n function afterPrefix(code) {\n effects.enter('htmlTextData');\n return returnState(code);\n }\n /** @type {State} */\n\n\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit('htmlTextData');\n effects.exit('htmlText');\n return ok;\n }\n\n return nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { labelEnd } from './label-end.js';\n/** @type {Construct} */\n\nexport var labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n var self = this;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('labelLink');\n effects.enter('labelMarker');\n effects.consume(code);\n effects.exit('labelMarker');\n effects.exit('labelLink');\n return after;\n }\n /** @type {State} */\n\n\n function after(code) {\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook. */\n\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n/** @type {Tokenizer} */\n\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('hardBreakEscape');\n effects.enter('escapeMarker');\n effects.consume(code);\n return open;\n }\n /** @type {State} */\n\n\n function open(code) {\n if (markdownLineEnding(code)) {\n effects.exit('escapeMarker');\n effects.exit('hardBreakEscape');\n return ok(code);\n }\n\n return nok(code);\n }\n}","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\n\nexport var codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous: previous\n};\n/** @type {Resolver} */\n\nfunction resolveCodeText(events) {\n var tailExitIndex = events.length - 4;\n var headEnterIndex = 3;\n /** @type {number} */\n\n var index;\n /** @type {number|undefined} */\n\n var enter; // If we start and end with an EOL or a space.\n\n if ((events[headEnterIndex][1].type === 'lineEnding' || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === 'lineEnding' || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex; // And we have data.\n\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding';\n events[tailExitIndex][1].type = 'codeTextPadding';\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n } // Merge adjacent spaces and data.\n\n\n index = headEnterIndex - 1;\n tailExitIndex++;\n\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === 'lineEnding') {\n events[enter][1].type = 'codeTextData';\n\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n\n enter = undefined;\n }\n }\n\n return events;\n}\n/** @type {Previous} */\n\n\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === 'characterEscape';\n}\n/** @type {Tokenizer} */\n\n\nfunction tokenizeCodeText(effects, ok, nok) {\n var self = this;\n var sizeOpen = 0;\n /** @type {number} */\n\n var size;\n /** @type {Token} */\n\n var token;\n return start;\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeText');\n effects.enter('codeTextSequence');\n return openingSequence(code);\n }\n /** @type {State} */\n\n\n function openingSequence(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return openingSequence;\n }\n\n effects.exit('codeTextSequence');\n return gap(code);\n }\n /** @type {State} */\n\n\n function gap(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n } // Closing fence?\n // Could also be data.\n\n\n if (code === 96) {\n token = effects.enter('codeTextSequence');\n size = 0;\n return closingSequence(code);\n } // Tabs don’t work, and virtual spaces don’t make sense.\n\n\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return gap;\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding');\n effects.consume(code);\n effects.exit('lineEnding');\n return gap;\n } // Data.\n\n\n effects.enter('codeTextData');\n return data(code);\n } // In code.\n\n /** @type {State} */\n\n\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit('codeTextData');\n return gap(code);\n }\n\n effects.consume(code);\n return data;\n } // Closing fence.\n\n /** @type {State} */\n\n\n function closingSequence(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return closingSequence;\n } // Done!\n\n\n if (size === sizeOpen) {\n effects.exit('codeTextSequence');\n effects.exit('codeText');\n return ok(code);\n } // More or less accents: mark as data.\n\n\n token.type = 'codeTextData';\n return data(code);\n }\n}","var _document, _flowInitial, _flow, _string, _text;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n/** @type {Extension['document']} */\n\nexport var document = (_document = {}, _defineProperty(_document, 42, list), _defineProperty(_document, 43, list), _defineProperty(_document, 45, list), _defineProperty(_document, 48, list), _defineProperty(_document, 49, list), _defineProperty(_document, 50, list), _defineProperty(_document, 51, list), _defineProperty(_document, 52, list), _defineProperty(_document, 53, list), _defineProperty(_document, 54, list), _defineProperty(_document, 55, list), _defineProperty(_document, 56, list), _defineProperty(_document, 57, list), _defineProperty(_document, 62, blockQuote), _document);\n/** @type {Extension['contentInitial']} */\n\nexport var contentInitial = _defineProperty({}, 91, definition);\n/** @type {Extension['flowInitial']} */\n\nexport var flowInitial = (_flowInitial = {}, _defineProperty(_flowInitial, -2, codeIndented), _defineProperty(_flowInitial, -1, codeIndented), _defineProperty(_flowInitial, 32, codeIndented), _flowInitial);\n/** @type {Extension['flow']} */\n\nexport var flow = (_flow = {}, _defineProperty(_flow, 35, headingAtx), _defineProperty(_flow, 42, thematicBreak), _defineProperty(_flow, 45, [setextUnderline, thematicBreak]), _defineProperty(_flow, 60, htmlFlow), _defineProperty(_flow, 61, setextUnderline), _defineProperty(_flow, 95, thematicBreak), _defineProperty(_flow, 96, codeFenced), _defineProperty(_flow, 126, codeFenced), _flow);\n/** @type {Extension['string']} */\n\nexport var string = (_string = {}, _defineProperty(_string, 38, characterReference), _defineProperty(_string, 92, characterEscape), _string);\n/** @type {Extension['text']} */\n\nexport var text = (_text = {}, _defineProperty(_text, -5, lineEnding), _defineProperty(_text, -4, lineEnding), _defineProperty(_text, -3, lineEnding), _defineProperty(_text, 33, labelStartImage), _defineProperty(_text, 38, characterReference), _defineProperty(_text, 42, attention), _defineProperty(_text, 60, [autolink, htmlText]), _defineProperty(_text, 91, labelStartLink), _defineProperty(_text, 92, [hardBreakEscape, characterEscape]), _defineProperty(_text, 93, labelEnd), _defineProperty(_text, 95, attention), _defineProperty(_text, 96, codeText), _text);\n/** @type {Extension['insideSpan']} */\n\nexport var insideSpan = {\n \"null\": [attention, resolveText]\n};\n/** @type {Extension['attentionMarkers']} */\n\nexport var attentionMarkers = {\n \"null\": [42, 95]\n};\n/** @type {Extension['disable']} */\n\nexport var disable = {\n \"null\": []\n};","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding} [encoding]\n * @param {boolean} [end=false]\n * @returns {Chunk[]}\n */\nvar search = /[\\0\\t\\n\\r]/g;\n/**\n * @returns {Preprocessor}\n */\n\nexport function preprocess() {\n var column = 1;\n var buffer = '';\n /** @type {boolean|undefined} */\n\n var start = true;\n /** @type {boolean|undefined} */\n\n var atCarriageReturn;\n return preprocessor;\n /** @type {Preprocessor} */\n\n function preprocessor(value, encoding, end) {\n /** @type {Chunk[]} */\n var chunks = [];\n /** @type {RegExpMatchArray|null} */\n\n var match;\n /** @type {number} */\n\n var next;\n /** @type {number} */\n\n var startPosition;\n /** @type {number} */\n\n var endPosition;\n /** @type {Code} */\n\n var code; // @ts-expect-error `Buffer` does allow an encoding.\n\n value = buffer + value.toString(encoding);\n startPosition = 0;\n buffer = '';\n\n if (start) {\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n\n start = undefined;\n }\n\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n match = search.exec(value);\n endPosition = match && match.index !== undefined ? match.index : value.length;\n code = value.charCodeAt(endPosition);\n\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n\n case 9:\n {\n next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n\n while (column++ < next) {\n chunks.push(-1);\n }\n\n break;\n }\n\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n\n startPosition = endPosition + 1;\n }\n\n if (end) {\n if (atCarriageReturn) chunks.push(-5);\n if (buffer) chunks.push(buffer);\n chunks.push(null);\n }\n\n return chunks;\n }\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist').Point} Point\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Content} Content\n * @typedef {Root|Content} Node\n * @typedef {Extract} Parent\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n *\n * @typedef {UnistParent & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @typedef _CompileDataFields\n * @property {boolean|undefined} expectingFirstListItemValue\n * @property {boolean|undefined} flowCodeInside\n * @property {boolean|undefined} setextHeadingSlurpLineEnding\n * @property {boolean|undefined} atHardBreak\n * @property {'collapsed'|'full'} referenceType\n * @property {boolean|undefined} inReference\n * @property {'characterReferenceMarkerHexadecimal'|'characterReferenceMarkerNumeric'} characterReferenceType\n *\n * @typedef {Record & Partial<_CompileDataFields>} CompileData\n *\n * @typedef {(tree: Root) => Root|void} Transform\n * @typedef {(this: CompileContext, token: Token) => void} Handle\n * @typedef {Record} Handles\n * Token types mapping to handles\n * @typedef {Record|Array> & {canContainEols: Array, transforms: Array, enter: Handles, exit: Handles}} NormalizedExtension\n * @typedef {Partial} Extension\n * An mdast extension changes how markdown tokens are turned into mdast.\n *\n * @typedef {(this: Omit, left: Token|undefined, right: Token) => void} OnEnterError\n * @typedef {(this: Omit, left: Token, right: Token) => void} OnExitError\n *\n * @typedef CompileContext\n * mdast compiler context\n * @property {Array} stack\n * @property {Array<[Token, OnEnterError|undefined]>} tokenStack\n * @property {(key: string, value?: unknown) => void} setData\n * Set data into the key-value store.\n * @property {(key: K) => CompileData[K]} getData\n * Get data from the key-value store.\n * @property {(this: CompileContext) => void} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: N, token: Token, onError?: OnEnterError) => N} enter\n * Enter a token.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit\n * Exit a token.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {NormalizedExtension} config\n * Configuration.\n *\n * @typedef {{mdastExtensions?: Array>}} FromMarkdownOptions\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n */\nimport { toString } from 'mdast-util-to-string';\nimport { parse } from 'micromark/lib/parse.js';\nimport { preprocess } from 'micromark/lib/preprocess.js';\nimport { postprocess } from 'micromark/lib/postprocess.js';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nvar own = {}.hasOwnProperty;\n/**\n * @param value Markdown to parse (`string` or `Buffer`).\n * @param [encoding] Character encoding to understand `value` as when it’s a `Buffer` (`string`, default: `'utf8'`).\n * @param [options] Configuration\n */\n\nexport var fromMarkdown =\n/**\n * @type {(\n * ((value: Value, encoding: Encoding, options?: Options) => Root) &\n * ((value: Value, options?: Options) => Root)\n * )}\n */\n\n/**\n * @param {Value} value\n * @param {Encoding} [encoding]\n * @param {Options} [options]\n * @returns {Root}\n */\nfunction fromMarkdown(value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding;\n encoding = undefined;\n }\n\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n};\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options} [options]\n */\n\nfunction compiler() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n /** @type {NormalizedExtension} */\n // @ts-expect-error: our base has all required fields, so the result will too.\n var config = configure({\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n }, options.mdastExtensions || []);\n /** @type {CompileData} */\n\n var data = {};\n return compile;\n /**\n * @param {Array} events\n * @returns {Root}\n */\n\n function compile(events) {\n /** @type {Root} */\n var tree = {\n type: 'root',\n children: []\n };\n /** @type {CompileContext['stack']} */\n\n var stack = [tree];\n /** @type {CompileContext['tokenStack']} */\n\n var tokenStack = [];\n /** @type {Array} */\n\n var listStack = [];\n /** @type {Omit} */\n\n var context = {\n stack: stack,\n tokenStack: tokenStack,\n config: config,\n enter: enter,\n exit: exit,\n buffer: buffer,\n resume: resume,\n setData: setData,\n getData: getData\n };\n var index = -1;\n\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (events[index][1].type === 'listOrdered' || events[index][1].type === 'listUnordered') {\n if (events[index][0] === 'enter') {\n listStack.push(index);\n } else {\n var tail = listStack.pop();\n index = prepareList(events, tail, index);\n }\n }\n }\n\n index = -1;\n\n while (++index < events.length) {\n var handler = config[events[index][0]];\n\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(Object.assign({\n sliceSerialize: events[index][2].sliceSerialize\n }, context), events[index][1]);\n }\n }\n\n if (tokenStack.length > 0) {\n var _tail = tokenStack[tokenStack.length - 1];\n\n var _handler = _tail[1] || defaultOnError;\n\n _handler.call(context, undefined, _tail[0]);\n } // Figure out `root` position.\n\n\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n index = -1;\n\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n\n return tree;\n }\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n\n\n function prepareList(events, start, length) {\n var index = start - 1;\n var containerBalance = -1;\n var listSpread = false;\n /** @type {Token|undefined} */\n\n var listItem;\n /** @type {number|undefined} */\n\n var lineIndex;\n /** @type {number|undefined} */\n\n var firstBlankLineIndex;\n /** @type {boolean|undefined} */\n\n var atMarker;\n\n while (++index <= length) {\n var event = events[index];\n\n if (event[1].type === 'listUnordered' || event[1].type === 'listOrdered' || event[1].type === 'blockQuote') {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n\n atMarker = undefined;\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n\n atMarker = undefined;\n }\n } else if (event[1].type === 'linePrefix' || event[1].type === 'listItemValue' || event[1].type === 'listItemMarker' || event[1].type === 'listItemPrefix' || event[1].type === 'listItemPrefixWhitespace') {// Empty.\n } else {\n atMarker = undefined;\n }\n\n if (!containerBalance && event[0] === 'enter' && event[1].type === 'listItemPrefix' || containerBalance === -1 && event[0] === 'exit' && (event[1].type === 'listUnordered' || event[1].type === 'listOrdered')) {\n if (listItem) {\n var tailIndex = index;\n lineIndex = undefined;\n\n while (tailIndex--) {\n var tailEvent = events[tailIndex];\n\n if (tailEvent[1].type === 'lineEnding' || tailEvent[1].type === 'lineEndingBlank') {\n if (tailEvent[0] === 'exit') continue;\n\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank';\n listSpread = true;\n }\n\n tailEvent[1].type = 'lineEnding';\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === 'linePrefix' || tailEvent[1].type === 'blockQuotePrefix' || tailEvent[1].type === 'blockQuotePrefixWhitespace' || tailEvent[1].type === 'blockQuoteMarker' || tailEvent[1].type === 'listItemIndent') {// Empty\n } else {\n break;\n }\n }\n\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n // @ts-expect-error Patched.\n listItem._spread = true;\n } // Fix position.\n\n\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]);\n index++;\n length++;\n } // Create a new list item.\n\n\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n // @ts-expect-error Patched\n _spread: false,\n start: Object.assign({}, event[1].start)\n }; // @ts-expect-error: `listItem` is most definitely defined, TS...\n\n events.splice(index, 0, ['enter', listItem, event[2]]);\n index++;\n length++;\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n } // @ts-expect-error Patched.\n\n\n events[start][1]._spread = listSpread;\n return length;\n }\n /**\n * @type {CompileContext['setData']}\n * @param [value]\n */\n\n\n function setData(key, value) {\n data[key] = value;\n }\n /**\n * @type {CompileContext['getData']}\n * @template {string} K\n * @param {K} key\n * @returns {CompileData[K]}\n */\n\n\n function getData(key) {\n return data[key];\n }\n /**\n * @param {Point} d\n * @returns {Point}\n */\n\n\n function point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n }\n /**\n * @param {(token: Token) => Node} create\n * @param {Handle} [and]\n * @returns {Handle}\n */\n\n\n function opener(create, and) {\n return open;\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n /** @type {CompileContext['buffer']} */\n\n\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n /**\n * @type {CompileContext['enter']}\n * @template {Node} N\n * @this {CompileContext}\n * @param {N} node\n * @param {Token} token\n * @param {OnEnterError} [errorHandler]\n * @returns {N}\n */\n\n\n function enter(node, token, errorHandler) {\n var parent = this.stack[this.stack.length - 1]; // @ts-expect-error: Assume `Node` can exist as a child of `parent`.\n\n parent.children.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler]); // @ts-expect-error: `end` will be patched later.\n\n node.position = {\n start: point(token.start)\n };\n return node;\n }\n /**\n * @param {Handle} [and]\n * @returns {Handle}\n */\n\n\n function closer(and) {\n return close;\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n /**\n * @type {CompileContext['exit']}\n * @this {CompileContext}\n * @param {Token} token\n * @param {OnExitError} [onExitError]\n * @returns {Node}\n */\n\n\n function exit(token, onExitError) {\n var node = this.stack.pop();\n var open = this.tokenStack.pop();\n\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n var handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n\n node.position.end = point(token.end);\n return node;\n }\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n\n\n function resume() {\n return toString(this.stack.pop());\n } //\n // Handlers.\n //\n\n /** @type {Handle} */\n\n\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true);\n }\n /** @type {Handle} */\n\n\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n var ancestor =\n /** @type {List} */\n this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n setData('expectingFirstListItemValue');\n }\n }\n /** @type {Handle} */\n\n\n function onexitcodefencedfenceinfo() {\n var data = this.resume();\n var node =\n /** @type {Code} */\n this.stack[this.stack.length - 1];\n node.lang = data;\n }\n /** @type {Handle} */\n\n\n function onexitcodefencedfencemeta() {\n var data = this.resume();\n var node =\n /** @type {Code} */\n this.stack[this.stack.length - 1];\n node.meta = data;\n }\n /** @type {Handle} */\n\n\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return;\n this.buffer();\n setData('flowCodeInside', true);\n }\n /** @type {Handle} */\n\n\n function onexitcodefenced() {\n var data = this.resume();\n var node =\n /** @type {Code} */\n this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n setData('flowCodeInside');\n }\n /** @type {Handle} */\n\n\n function onexitcodeindented() {\n var data = this.resume();\n var node =\n /** @type {Code} */\n this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n /** @type {Handle} */\n\n\n function onexitdefinitionlabelstring(token) {\n // Discard label, use the source content instead.\n var label = this.resume();\n var node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n /** @type {Handle} */\n\n\n function onexitdefinitiontitlestring() {\n var data = this.resume();\n var node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1];\n node.title = data;\n }\n /** @type {Handle} */\n\n\n function onexitdefinitiondestinationstring() {\n var data = this.resume();\n var node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1];\n node.url = data;\n }\n /** @type {Handle} */\n\n\n function onexitatxheadingsequence(token) {\n var node =\n /** @type {Heading} */\n this.stack[this.stack.length - 1];\n\n if (!node.depth) {\n var depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n /** @type {Handle} */\n\n\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true);\n }\n /** @type {Handle} */\n\n\n function onexitsetextheadinglinesequence(token) {\n var node =\n /** @type {Heading} */\n this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2;\n }\n /** @type {Handle} */\n\n\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding');\n }\n /** @type {Handle} */\n\n\n function onenterdata(token) {\n var parent =\n /** @type {Parent} */\n this.stack[this.stack.length - 1];\n /** @type {Node} */\n\n var tail = parent.children[parent.children.length - 1];\n\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text(); // @ts-expect-error: we’ll add `end` later.\n\n tail.position = {\n start: point(token.start)\n }; // @ts-expect-error: Assume `parent` accepts `text`.\n\n parent.children.push(tail);\n }\n\n this.stack.push(tail);\n }\n /** @type {Handle} */\n\n\n function onexitdata(token) {\n var tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n /** @type {Handle} */\n\n\n function onexitlineending(token) {\n var context = this.stack[this.stack.length - 1]; // If we’re at a hard break, include the line ending in there.\n\n if (getData('atHardBreak')) {\n var tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n setData('atHardBreak');\n return;\n }\n\n if (!getData('setextHeadingSlurpLineEnding') && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n /** @type {Handle} */\n\n\n function onexithardbreak() {\n setData('atHardBreak', true);\n }\n /** @type {Handle} */\n\n\n function onexithtmlflow() {\n var data = this.resume();\n var node =\n /** @type {HTML} */\n this.stack[this.stack.length - 1];\n node.value = data;\n }\n /** @type {Handle} */\n\n\n function onexithtmltext() {\n var data = this.resume();\n var node =\n /** @type {HTML} */\n this.stack[this.stack.length - 1];\n node.value = data;\n }\n /** @type {Handle} */\n\n\n function onexitcodetext() {\n var data = this.resume();\n var node =\n /** @type {InlineCode} */\n this.stack[this.stack.length - 1];\n node.value = data;\n }\n /** @type {Handle} */\n\n\n function onexitlink() {\n var context =\n /** @type {Link & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1]; // To do: clean.\n\n if (getData('inReference')) {\n context.type += 'Reference'; // @ts-expect-error: mutate.\n\n context.referenceType = getData('referenceType') || 'shortcut'; // @ts-expect-error: mutate.\n\n delete context.url;\n delete context.title;\n } else {\n // @ts-expect-error: mutate.\n delete context.identifier; // @ts-expect-error: mutate.\n\n delete context.label;\n }\n\n setData('referenceType');\n }\n /** @type {Handle} */\n\n\n function onexitimage() {\n var context =\n /** @type {Image & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1]; // To do: clean.\n\n if (getData('inReference')) {\n context.type += 'Reference'; // @ts-expect-error: mutate.\n\n context.referenceType = getData('referenceType') || 'shortcut'; // @ts-expect-error: mutate.\n\n delete context.url;\n delete context.title;\n } else {\n // @ts-expect-error: mutate.\n delete context.identifier; // @ts-expect-error: mutate.\n\n delete context.label;\n }\n\n setData('referenceType');\n }\n /** @type {Handle} */\n\n\n function onexitlabeltext(token) {\n var ancestor =\n /** @type {(Link|Image) & {identifier: string, label: string}} */\n this.stack[this.stack.length - 2];\n var string = this.sliceSerialize(token);\n ancestor.label = decodeString(string);\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n /** @type {Handle} */\n\n\n function onexitlabel() {\n var fragment =\n /** @type {Fragment} */\n this.stack[this.stack.length - 1];\n var value = this.resume();\n var node =\n /** @type {(Link|Image) & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1]; // Assume a reference.\n\n setData('inReference', true);\n\n if (node.type === 'link') {\n // @ts-expect-error: Assume static phrasing content.\n node.children = fragment.children;\n } else {\n node.alt = value;\n }\n }\n /** @type {Handle} */\n\n\n function onexitresourcedestinationstring() {\n var data = this.resume();\n var node =\n /** @type {Link|Image} */\n this.stack[this.stack.length - 1];\n node.url = data;\n }\n /** @type {Handle} */\n\n\n function onexitresourcetitlestring() {\n var data = this.resume();\n var node =\n /** @type {Link|Image} */\n this.stack[this.stack.length - 1];\n node.title = data;\n }\n /** @type {Handle} */\n\n\n function onexitresource() {\n setData('inReference');\n }\n /** @type {Handle} */\n\n\n function onenterreference() {\n setData('referenceType', 'collapsed');\n }\n /** @type {Handle} */\n\n\n function onexitreferencestring(token) {\n var label = this.resume();\n var node =\n /** @type {LinkReference|ImageReference} */\n this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n setData('referenceType', 'full');\n }\n /** @type {Handle} */\n\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type);\n }\n /** @type {Handle} */\n\n\n function onexitcharacterreferencevalue(token) {\n var data = this.sliceSerialize(token);\n var type = getData('characterReferenceType');\n /** @type {string} */\n\n var value;\n\n if (type) {\n value = decodeNumericCharacterReference(data, type === 'characterReferenceMarkerNumeric' ? 10 : 16);\n setData('characterReferenceType');\n } else {\n // @ts-expect-error `decodeNamedCharacterReference` can return false for\n // invalid named character references, but everything we’ve tokenized is\n // valid.\n value = decodeNamedCharacterReference(data);\n }\n\n var tail = this.stack.pop();\n tail.value += value;\n tail.position.end = point(token.end);\n }\n /** @type {Handle} */\n\n\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n var node =\n /** @type {Link} */\n this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n /** @type {Handle} */\n\n\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n var node =\n /** @type {Link} */\n this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n } //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n\n\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n };\n }\n /** @returns {Code} */\n\n\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n };\n }\n /** @returns {InlineCode} */\n\n\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n };\n }\n /** @returns {Definition} */\n\n\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n };\n }\n /** @returns {Emphasis} */\n\n\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n };\n }\n /** @returns {Heading} */\n\n\n function heading() {\n // @ts-expect-error `depth` will be set later.\n return {\n type: 'heading',\n depth: undefined,\n children: []\n };\n }\n /** @returns {Break} */\n\n\n function hardBreak() {\n return {\n type: 'break'\n };\n }\n /** @returns {HTML} */\n\n\n function html() {\n return {\n type: 'html',\n value: ''\n };\n }\n /** @returns {Image} */\n\n\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n };\n }\n /** @returns {Link} */\n\n\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n };\n }\n /**\n * @param {Token} token\n * @returns {List}\n */\n\n\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n // @ts-expect-error Patched.\n spread: token._spread,\n children: []\n };\n }\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n\n\n function listItem(token) {\n return {\n type: 'listItem',\n // @ts-expect-error Patched.\n spread: token._spread,\n checked: null,\n children: []\n };\n }\n /** @returns {Paragraph} */\n\n\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n };\n }\n /** @returns {Strong} */\n\n\n function strong() {\n return {\n type: 'strong',\n children: []\n };\n }\n /** @returns {Text} */\n\n\n function text() {\n return {\n type: 'text',\n value: ''\n };\n }\n /** @returns {ThematicBreak} */\n\n\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n };\n }\n}\n/**\n * @param {Extension} combined\n * @param {Array>} extensions\n * @returns {Extension}\n */\n\n\nfunction configure(combined, extensions) {\n var index = -1;\n\n while (++index < extensions.length) {\n var value = extensions[index];\n\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n\n return combined;\n}\n/**\n * @param {Extension} combined\n * @param {Extension} extension\n * @returns {void}\n */\n\n\nfunction extension(combined, extension) {\n /** @type {string} */\n var key;\n\n for (key in extension) {\n if (own.call(extension, key)) {\n var list = key === 'canContainEols' || key === 'transforms';\n var maybe = own.call(combined, key) ? combined[key] : undefined;\n /* c8 ignore next */\n\n var left = maybe || (combined[key] = list ? [] : {});\n var right = extension[key];\n\n if (right) {\n if (list) {\n // @ts-expect-error: `left` is an array.\n combined[key] = [].concat(_toConsumableArray(left), _toConsumableArray(right));\n } else {\n Object.assign(left, right);\n }\n }\n }\n }\n}\n/** @type {OnEnterError} */\n\n\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n } else {\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n }\n}","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * @param {Event[]} events\n * @returns {Event[]}\n */\n\nexport function postprocess(events) {\n while (!subtokenize(events)) {// Empty\n }\n\n return events;\n}","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').Create} Create\n */\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { text, string } from './initialize/text.js';\nimport { createTokenizer } from './create-tokenizer.js';\nimport * as defaultConstructs from './constructs.js';\n/**\n * @param {ParseOptions} [options]\n * @returns {ParseContext}\n */\n\nexport function parse() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n /** @type {FullNormalizedExtension} */\n // @ts-expect-error `defaultConstructs` is full, so the result will be too.\n var constructs = combineExtensions( // @ts-expect-error Same as above.\n [defaultConstructs].concat(options.extensions || []));\n /** @type {ParseContext} */\n\n var parser = {\n defined: [],\n lazy: {},\n constructs: constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n };\n return parser;\n /**\n * @param {InitialConstruct} initial\n */\n\n function create(initial) {\n return creator;\n /** @type {Create} */\n\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","import remarkParse from './lib/index.js';\nexport default remarkParse;","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} Options\n */\nimport { fromMarkdown } from 'mdast-util-from-markdown';\n/** @type {import('unified').Plugin<[Options?] | void[], string, Root>} */\n\nexport default function remarkParse(options) {\n var _this = this;\n\n /** @type {import('unified').ParserFunction} */\n var parser = function parser(doc) {\n // Assume options.\n var settings =\n /** @type {Options} */\n _this.data('settings');\n\n return fromMarkdown(doc, Object.assign({}, settings, options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: _this.data('micromarkExtensions') || [],\n mdastExtensions: _this.data('fromMarkdownExtensions') || []\n }));\n };\n\n Object.assign(this, {\n Parser: parser\n });\n}","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist').Literal} Literal\n * @typedef {Object.} Props\n * @typedef {Array.|string} ChildrenOrValue\n *\n * @typedef {(, C extends Node[]>(type: T, props: P, children: C) => {type: T, children: C} & P)} BuildParentWithProps\n * @typedef {(>(type: T, props: P, value: string) => {type: T, value: string} & P)} BuildLiteralWithProps\n * @typedef {(>(type: T, props: P) => {type: T} & P)} BuildVoidWithProps\n * @typedef {((type: T, children: C) => {type: T, children: C})} BuildParent\n * @typedef {((type: T, value: string) => {type: T, value: string})} BuildLiteral\n * @typedef {((type: T) => {type: T})} BuildVoid\n */\nexport var u =\n/**\n* @type {BuildVoid & BuildVoidWithProps & BuildLiteral & BuildLiteralWithProps & BuildParent & BuildParentWithProps}\n*/\n\n/**\n * @param {string} type Type of node\n * @param {Props|ChildrenOrValue} [props] Additional properties for node (or `children` or `value`)\n * @param {ChildrenOrValue} [value] `children` or `value` of node\n * @returns {Node}\n */\nfunction u(type, props, value) {\n /** @type {Node} */\n var node = {\n type: String(type)\n };\n\n if ((value === undefined || value === null) && (typeof props === 'string' || Array.isArray(props))) {\n value = props;\n } else {\n Object.assign(node, props);\n }\n\n if (Array.isArray(value)) {\n node.children = value;\n } else if (value !== undefined && value !== null) {\n node.value = String(value);\n }\n\n return node;\n};","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n * @typedef {import('./complex-types').Visitor} Visitor\n */\nimport { visitParents, CONTINUE, SKIP, EXIT } from 'unist-util-visit-parents';\nexport { CONTINUE, SKIP, EXIT };\n/**\n * Visit children of tree which pass a test\n *\n * @param tree Abstract syntax tree to walk\n * @param test Test, optional\n * @param visitor Function to run for each node\n * @param reverse Fisit the tree in reverse, defaults to false\n */\n\nexport var visit =\n/**\n * @type {(\n * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) &\n * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void)\n * )}\n */\n\n/**\n * @param {Node} tree\n * @param {Test} test\n * @param {import('./complex-types').Visitor} visitor\n * @param {boolean} [reverse]\n */\nfunction visit(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor;\n visitor = test;\n test = null;\n }\n\n visitParents(tree, test, overload, reverse);\n /**\n * @param {Node} node\n * @param {Array.} parents\n */\n\n function overload(node, parents) {\n var parent = parents[parents.length - 1];\n return visitor(node, parent ? parent.children.indexOf(node) : null, parent);\n }\n};","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {Record & {type: string, position?: PositionLike|undefined}} NodeLike\n * @typedef {import('unist').Point} Point\n *\n * @typedef {Partial} PointLike\n *\n * @typedef PositionLike\n * @property {PointLike} [start]\n * @property {PointLike} [end]\n */\nexport var pointStart = point('start');\nexport var pointEnd = point('end');\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike|Node} [node]\n * @returns {Position}\n */\n\nexport function position(node) {\n return {\n start: pointStart(node),\n end: pointEnd(node)\n };\n}\n/**\n * Get the positional info of `node`.\n *\n * @param {'start'|'end'} type\n */\n\nfunction point(type) {\n return point;\n /**\n * Get the positional info of `node`.\n *\n * @param {NodeLike|Node} [node]\n * @returns {Point}\n */\n\n function point(node) {\n var point = node && node.position && node.position[type] || {};\n return {\n line: point.line || null,\n column: point.column || null,\n offset: point.offset > -1 ? point.offset : null\n };\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n */\n\n/**\n * @typedef {CONTINUE|SKIP|EXIT} Action Union of the action types\n * @typedef {number} Index Move to the sibling at index next (after node itself is completely traversed). Useful if mutating the tree, such as removing the node the visitor is currently on, or any of its previous siblings (or next siblings, in case of reverse) Results less than 0 or greater than or equal to children.length stop traversing the parent\n * @typedef {[(Action|null|undefined|void)?, (Index|null|undefined)?]} ActionTuple List with one or two values, the first an action, the second an index.\n * @typedef {null|undefined|Action|Index|ActionTuple|void} VisitorResult Any value that can be returned from a visitor\n */\n\n/**\n * Invoked when a node (matching test, if given) is found.\n * Visitors are free to transform node.\n * They can also transform the parent of node (the last of ancestors).\n * Replacing node itself, if `SKIP` is not returned, still causes its descendants to be visited.\n * If adding or removing previous siblings (or next siblings, in case of reverse) of node,\n * visitor should return a new index (number) to specify the sibling to traverse after node is traversed.\n * Adding or removing next siblings of node (or previous siblings, in case of reverse)\n * is handled as expected without needing to return a new index.\n * Removing the children property of an ancestor still results in them being traversed.\n *\n * @template {Node} V\n * @callback Visitor\n * @param {V} node Found node\n * @param {Array.} ancestors Ancestors of node\n * @returns {VisitorResult}\n */\nimport { convert } from 'unist-util-is';\nimport { color } from './color.js';\n/**\n * Continue traversing as normal\n */\n\nexport var CONTINUE = true;\n/**\n * Do not traverse this node’s children\n */\n\nexport var SKIP = 'skip';\n/**\n * Stop traversing immediately\n */\n\nexport var EXIT = false;\nexport var visitParents =\n/**\n * @type {(\n * ((tree: Node, test: T['type']|Partial|import('unist-util-is').TestFunctionPredicate|Array.|import('unist-util-is').TestFunctionPredicate>, visitor: Visitor, reverse?: boolean) => void) &\n * ((tree: Node, test: Test, visitor: Visitor, reverse?: boolean) => void) &\n * ((tree: Node, visitor: Visitor, reverse?: boolean) => void)\n * )}\n */\n\n/**\n * Visit children of tree which pass a test\n *\n * @param {Node} tree Abstract syntax tree to walk\n * @param {Test} test test Test node\n * @param {Visitor} visitor Function to run for each node\n * @param {boolean} [reverse] Fisit the tree in reverse, defaults to false\n */\nfunction visitParents(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor; // @ts-ignore no visitor given, so `visitor` is test.\n\n visitor = test;\n test = null;\n }\n\n var is = convert(test);\n var step = reverse ? -1 : 1;\n factory(tree, null, [])();\n /**\n * @param {Node} node\n * @param {number?} index\n * @param {Array.} parents\n */\n\n function factory(node, index, parents) {\n /** @type {Object.} */\n var value = _typeof(node) === 'object' && node !== null ? node : {};\n /** @type {string} */\n\n var name;\n\n if (typeof value.type === 'string') {\n name = typeof value.tagName === 'string' ? value.tagName : typeof value.name === 'string' ? value.name : undefined;\n Object.defineProperty(visit, 'name', {\n value: 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'\n });\n }\n\n return visit;\n\n function visit() {\n /** @type {ActionTuple} */\n var result = [];\n /** @type {ActionTuple} */\n\n var subresult;\n /** @type {number} */\n\n var offset;\n /** @type {Array.} */\n\n var grandparents;\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents));\n\n if (result[0] === EXIT) {\n return result;\n }\n }\n\n if (node.children && result[0] !== SKIP) {\n // @ts-ignore looks like a parent.\n offset = (reverse ? node.children.length : -1) + step; // @ts-ignore looks like a parent.\n\n grandparents = parents.concat(node); // @ts-ignore looks like a parent.\n\n while (offset > -1 && offset < node.children.length) {\n subresult = factory(node.children[offset], offset, grandparents)();\n\n if (subresult[0] === EXIT) {\n return subresult;\n }\n\n offset = typeof subresult[1] === 'number' ? subresult[1] : offset + step;\n }\n }\n\n return result;\n }\n }\n};\n/**\n * @param {VisitorResult} value\n * @returns {ActionTuple}\n */\n\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value;\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value];\n }\n\n return [value];\n}","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * Invoked when a node (matching test, if given) is found.\n * Visitors are free to transform node.\n * They can also transform the parent of node (the last of ancestors).\n * Replacing node itself, if `SKIP` is not returned, still causes its descendants to be visited.\n * If adding or removing previous siblings (or next siblings, in case of reverse) of node,\n * visitor should return a new index (number) to specify the sibling to traverse after node is traversed.\n * Adding or removing next siblings of node (or previous siblings, in case of reverse)\n * is handled as expected without needing to return a new index.\n * Removing the children property of an ancestor still results in them being traversed.\n *\n * @template {Node} V\n * @callback Visitor\n * @param {V} node Found node\n * @param {number|null} index Position of `node` in `parent`\n * @param {Parent|null} parent Parent of `node`\n * @returns {VisitorResult}\n */\nimport { visitParents, CONTINUE, SKIP, EXIT } from 'unist-util-visit-parents';\nexport { CONTINUE, SKIP, EXIT };\nexport var visit =\n/**\n * @type {(\n * ((tree: Node, test: T['type']|Partial|import('unist-util-is').TestFunctionPredicate|Array.|import('unist-util-is').TestFunctionPredicate>, visitor: Visitor, reverse?: boolean) => void) &\n * ((tree: Node, test: Test, visitor: Visitor, reverse?: boolean) => void) &\n * ((tree: Node, visitor: Visitor, reverse?: boolean) => void)\n * )}\n */\n\n/**\n * Visit children of tree which pass a test\n *\n * @param {Node} tree Abstract syntax tree to walk\n * @param {Test} test test Test node\n * @param {Visitor} visitor Function to run for each node\n * @param {boolean} [reverse] Fisit the tree in reverse, defaults to false\n */\nfunction visit(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor;\n visitor = test;\n test = null;\n }\n\n visitParents(tree, test, overload, reverse);\n /**\n * @param {Node} node\n * @param {Array.} parents\n */\n\n function overload(node, parents) {\n var parent = parents[parents.length - 1];\n return visitor(node, parent ? parent.children.indexOf(node) : null, parent);\n }\n};","/**\n * @typedef {import('mdast').Root|import('mdast').Content} Node\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('unist-util-visit').Visitor} DefinitionVisitor\n */\nimport { visit } from 'unist-util-visit';\nvar own = {}.hasOwnProperty;\n/**\n *\n * @param {Node} node\n */\n\nexport function definitions(node) {\n /** @type {Object.} */\n var cache = Object.create(null);\n\n if (!node || !node.type) {\n throw new Error('mdast-util-definitions expected node');\n }\n\n visit(node, 'definition', ondefinition);\n return getDefinition;\n /** @type {DefinitionVisitor} */\n\n function ondefinition(definition) {\n var id = clean(definition.identifier);\n\n if (id && !own.call(cache, id)) {\n cache[id] = definition;\n }\n }\n /**\n * Get a node from the bound definition-cache.\n *\n * @param {string} identifier\n * @returns {Definition|null}\n */\n\n\n function getDefinition(identifier) {\n var id = clean(identifier);\n return id && own.call(cache, id) ? cache[id] : null;\n }\n}\n/**\n * @param {string} [value]\n * @returns {string}\n */\n\nfunction clean(value) {\n return String(value || '').toUpperCase();\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * @typedef {import('mdast').Root|import('mdast').Parent['children'][number]} MdastNode\n * @typedef {import('./index.js').H} H\n * @typedef {import('./index.js').Handler} Handler\n * @typedef {import('./index.js').Content} Content\n */\nimport { u } from 'unist-builder';\nvar own = {}.hasOwnProperty;\n/**\n * Transform an unknown node.\n * @type {Handler}\n * @param {MdastNode} node\n */\n\nfunction unknown(h, node) {\n var data = node.data || {};\n\n if ('value' in node && !(own.call(data, 'hName') || own.call(data, 'hProperties') || own.call(data, 'hChildren'))) {\n return h.augment(node, u('text', node.value));\n }\n\n return h(node, 'div', all(h, node));\n}\n/**\n * @type {Handler}\n * @param {MdastNode} node\n */\n\n\nexport function one(h, node, parent) {\n var type = node && node.type;\n /** @type {Handler} */\n\n var fn; // Fail on non-nodes.\n\n if (!type) {\n throw new Error('Expected node, got `' + node + '`');\n }\n\n if (own.call(h.handlers, type)) {\n fn = h.handlers[type];\n } else if (h.passThrough && h.passThrough.includes(type)) {\n fn = returnNode;\n } else {\n fn = h.unknownHandler;\n }\n\n return (typeof fn === 'function' ? fn : unknown)(h, node, parent);\n}\n/**\n * @type {Handler}\n * @param {MdastNode} node\n */\n\nfunction returnNode(h, node) {\n // @ts-expect-error: Pass through custom node.\n return 'children' in node ? _objectSpread(_objectSpread({}, node), {}, {\n children: all(h, node)\n }) : node;\n}\n/**\n * @param {H} h\n * @param {MdastNode} parent\n */\n\n\nexport function all(h, parent) {\n /** @type {Array} */\n var values = [];\n\n if ('children' in parent) {\n var nodes = parent.children;\n var index = -1;\n\n while (++index < nodes.length) {\n var result = one(h, nodes[index], parent);\n\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = result.value.replace(/^\\s+/, '');\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n var head = result.children[0];\n\n if (head && head.type === 'text') {\n head.value = head.value.replace(/^\\s+/, '');\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push.apply(values, _toConsumableArray(result));\n } else {\n values.push(result);\n }\n }\n }\n }\n\n return values;\n}","/**\n * @typedef {import('./index.js').Content} Content\n */\nimport { u } from 'unist-builder';\n/**\n * Wrap `nodes` with line feeds between each entry.\n * Optionally adds line feeds at the start and end.\n *\n * @param {Array} nodes\n * @param {boolean} [loose=false]\n * @returns {Array}\n */\n\nexport function wrap(nodes, loose) {\n /** @type {Array} */\n var result = [];\n var index = -1;\n\n if (loose) {\n result.push(u('text', '\\n'));\n }\n\n while (++index < nodes.length) {\n if (index) result.push(u('text', '\\n'));\n result.push(nodes[index]);\n }\n\n if (loose && nodes.length > 0) {\n result.push(u('text', '\\n'));\n }\n\n return result;\n}","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { sanitizeUri } from 'micromark-util-sanitize-uri';\nimport { u } from 'unist-builder';\n/**\n * @type {Handler}\n * @param {FootnoteReference} node\n */\n\nexport function footnoteReference(h, node) {\n var id = String(node.identifier);\n var safeId = sanitizeUri(id.toLowerCase());\n var index = h.footnoteOrder.indexOf(id);\n /** @type {number} */\n\n var counter;\n\n if (index === -1) {\n h.footnoteOrder.push(id);\n h.footnoteCounts[id] = 1;\n counter = h.footnoteOrder.length;\n } else {\n h.footnoteCounts[id]++;\n counter = index + 1;\n }\n\n var reuseCounter = h.footnoteCounts[id];\n return h(node, 'sup', [h(node.position, 'a', {\n href: '#' + h.clobberPrefix + 'fn-' + safeId,\n id: h.clobberPrefix + 'fnref-' + safeId + (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: 'footnote-label'\n }, [u('text', String(counter))])]);\n}","/**\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('./index.js').Handler} Handler\n * @typedef {import('./index.js').Content} Content\n */\nimport { u } from 'unist-builder';\nimport { all } from './traverse.js';\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @type {Handler}\n * @param {ImageReference|LinkReference} node\n * @returns {Content|Array}\n */\n\nexport function revert(h, node) {\n var subtype = node.referenceType;\n var suffix = ']';\n\n if (subtype === 'collapsed') {\n suffix += '[]';\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']';\n }\n\n if (node.type === 'imageReference') {\n return u('text', '![' + node.alt + suffix);\n }\n\n var contents = all(h, node);\n var head = contents[0];\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value;\n } else {\n contents.unshift(u('text', '['));\n }\n\n var tail = contents[contents.length - 1];\n\n if (tail && tail.type === 'text') {\n tail.value += suffix;\n } else {\n contents.push(u('text', suffix));\n }\n\n return contents;\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').List} List\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n * @typedef {import('../index.js').Content} Content\n */\nimport { u } from 'unist-builder';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {ListItem} node\n * @param {List} parent\n */\n\nexport function listItem(h, node, parent) {\n var result = all(h, node);\n var loose = parent ? listLoose(parent) : listItemLoose(node);\n /** @type {Properties} */\n\n var props = {};\n /** @type {Array} */\n\n var wrapped = [];\n\n if (typeof node.checked === 'boolean') {\n /** @type {Element} */\n var paragraph;\n\n if (result[0] && result[0].type === 'element' && result[0].tagName === 'p') {\n paragraph = result[0];\n } else {\n paragraph = h(null, 'p', []);\n result.unshift(paragraph);\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift(u('text', ' '));\n }\n\n paragraph.children.unshift(h(null, 'input', {\n type: 'checkbox',\n checked: node.checked,\n disabled: true\n })); // According to github-markdown-css, this class hides bullet.\n // See: .\n\n props.className = ['task-list-item'];\n }\n\n var index = -1;\n\n while (++index < result.length) {\n var child = result[index]; // Add eols before nodes, except if this is a loose, first paragraph.\n\n if (loose || index !== 0 || child.type !== 'element' || child.tagName !== 'p') {\n wrapped.push(u('text', '\\n'));\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n wrapped.push.apply(wrapped, _toConsumableArray(child.children));\n } else {\n wrapped.push(child);\n }\n }\n\n var tail = result[result.length - 1]; // Add a final eol.\n\n if (tail && (loose || !('tagName' in tail) || tail.tagName !== 'p')) {\n wrapped.push(u('text', '\\n'));\n }\n\n return h(node, 'li', props, wrapped);\n}\n/**\n * @param {List} node\n * @return {Boolean}\n */\n\nfunction listLoose(node) {\n var loose = node.spread;\n var children = node.children;\n var index = -1;\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index]);\n }\n\n return Boolean(loose);\n}\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\n\n\nfunction listItemLoose(node) {\n var spread = node.spread;\n return spread === undefined || spread === null ? node.children.length > 1 : spread;\n}","import { blockquote } from './blockquote.js';\nimport { hardBreak } from './break.js';\nimport { code } from './code.js';\nimport { strikethrough } from './delete.js';\nimport { emphasis } from './emphasis.js';\nimport { footnoteReference } from './footnote-reference.js';\nimport { footnote } from './footnote.js';\nimport { heading } from './heading.js';\nimport { html } from './html.js';\nimport { imageReference } from './image-reference.js';\nimport { image } from './image.js';\nimport { inlineCode } from './inline-code.js';\nimport { linkReference } from './link-reference.js';\nimport { link } from './link.js';\nimport { listItem } from './list-item.js';\nimport { list } from './list.js';\nimport { paragraph } from './paragraph.js';\nimport { root } from './root.js';\nimport { strong } from './strong.js';\nimport { table } from './table.js';\nimport { text } from './text.js';\nimport { thematicBreak } from './thematic-break.js';\nexport var handlers = {\n blockquote: blockquote,\n \"break\": hardBreak,\n code: code,\n \"delete\": strikethrough,\n emphasis: emphasis,\n footnoteReference: footnoteReference,\n footnote: footnote,\n heading: heading,\n html: html,\n imageReference: imageReference,\n image: image,\n inlineCode: inlineCode,\n linkReference: linkReference,\n link: link,\n listItem: listItem,\n list: list,\n paragraph: paragraph,\n root: root,\n strong: strong,\n table: table,\n text: text,\n thematicBreak: thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}; // Return nothing for nodes that are ignored.\n\nfunction ignore() {\n return null;\n}","/**\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { wrap } from '../wrap.js';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Blockquote} node\n */\n\nexport function blockquote(h, node) {\n return h(node, 'blockquote', wrap(all(h, node), true));\n}","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\n/**\n * @type {Handler}\n * @param {Break} node\n * @returns {Array}\n */\n\nexport function hardBreak(h, node) {\n return [h(node, 'br'), u('text', '\\n')];\n}","/**\n * @typedef {import('mdast').Code} Code\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\n/**\n * @type {Handler}\n * @param {Code} node\n */\n\nexport function code(h, node) {\n var value = node.value ? node.value + '\\n' : ''; // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n\n var lang = node.lang && node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/);\n /** @type {Properties} */\n\n var props = {};\n\n if (lang) {\n props.className = ['language-' + lang];\n }\n\n var code = h(node, 'code', props, [u('text', value)]);\n\n if (node.meta) {\n code.data = {\n meta: node.meta\n };\n }\n\n return h(node.position, 'pre', [code]);\n}","/**\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Delete} node\n */\n\nexport function strikethrough(h, node) {\n return h(node, 'del', all(h, node));\n}","/**\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Emphasis} node\n */\n\nexport function emphasis(h, node) {\n return h(node, 'em', all(h, node));\n}","/**\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../index.js').Handler} Handler\n *\n * @todo\n * `footnote` (or “inline note”) are a pandoc footnotes feature (`^[a note]`)\n * that does not exist in GFM.\n * We still have support for it, so that things remain working with\n * `micromark-extension-footnote` and `mdast-util-footnote`, but in the future\n * we might be able to remove it?\n */\nimport { footnoteReference } from './footnote-reference.js';\n/**\n * @type {Handler}\n * @param {Footnote} node\n */\n\nexport function footnote(h, node) {\n var footnoteById = h.footnoteById;\n var no = 1;\n\n while (no in footnoteById) {\n no++;\n }\n\n var identifier = String(no);\n footnoteById[identifier] = {\n type: 'footnoteDefinition',\n identifier: identifier,\n children: [{\n type: 'paragraph',\n children: node.children\n }],\n position: node.position\n };\n return footnoteReference(h, {\n type: 'footnoteReference',\n identifier: identifier,\n position: node.position\n });\n}","/**\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Heading} node\n */\n\nexport function heading(h, node) {\n return h(node, 'h' + node.depth, all(h, node));\n}","/**\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\n/**\n * Return either a `raw` node in dangerous mode, otherwise nothing.\n *\n * @type {Handler}\n * @param {HTML} node\n */\n\nexport function html(h, node) {\n return h.dangerous ? h.augment(node, u('raw', node.value)) : null;\n}","/**\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport normalize from 'mdurl/encode.js';\nimport { revert } from '../revert.js';\n/**\n * @type {Handler}\n * @param {ImageReference} node\n */\n\nexport function imageReference(h, node) {\n var def = h.definition(node.identifier);\n\n if (!def) {\n return revert(h, node);\n }\n /** @type {Properties} */\n\n\n var props = {\n src: normalize(def.url || ''),\n alt: node.alt\n };\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title;\n }\n\n return h(node, 'img', props);\n}","/**\n * @typedef {import('mdast').Image} Image\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport normalize from 'mdurl/encode.js';\n/**\n * @type {Handler}\n * @param {Image} node\n */\n\nexport function image(h, node) {\n /** @type {Properties} */\n var props = {\n src: normalize(node.url),\n alt: node.alt\n };\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title;\n }\n\n return h(node, 'img', props);\n}","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\n/**\n * @type {Handler}\n * @param {InlineCode} node\n */\n\nexport function inlineCode(h, node) {\n return h(node, 'code', [u('text', node.value.replace(/\\r?\\n|\\r/g, ' '))]);\n}","/**\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport normalize from 'mdurl/encode.js';\nimport { revert } from '../revert.js';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {LinkReference} node\n */\n\nexport function linkReference(h, node) {\n var def = h.definition(node.identifier);\n\n if (!def) {\n return revert(h, node);\n }\n /** @type {Properties} */\n\n\n var props = {\n href: normalize(def.url || '')\n };\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title;\n }\n\n return h(node, 'a', props, all(h, node));\n}","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport normalize from 'mdurl/encode.js';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Link} node\n */\n\nexport function link(h, node) {\n /** @type {Properties} */\n var props = {\n href: normalize(node.url)\n };\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title;\n }\n\n return h(node, 'a', props, all(h, node));\n}","/**\n * @typedef {import('mdast').List} List\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { wrap } from '../wrap.js';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {List} node\n * @returns {Element}\n */\n\nexport function list(h, node) {\n /** @type {Properties} */\n var props = {};\n var name = node.ordered ? 'ol' : 'ul';\n var items = all(h, node);\n var index = -1;\n\n if (typeof node.start === 'number' && node.start !== 1) {\n props.start = node.start;\n } // Like GitHub, add a class for custom styling.\n\n\n while (++index < items.length) {\n var item = items[index];\n\n if (item.type === 'element' && item.tagName === 'li' && item.properties && Array.isArray(item.properties.className) && item.properties.className.includes('task-list-item')) {\n props.className = ['contains-task-list'];\n break;\n }\n }\n\n return h(node, name, props, wrap(items, true));\n}","/**\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Paragraph} node\n */\n\nexport function paragraph(h, node) {\n return h(node, 'p', all(h, node));\n}","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\nimport { all } from '../traverse.js';\nimport { wrap } from '../wrap.js';\n/**\n * @type {Handler}\n * @param {Root} node\n */\n\nexport function root(h, node) {\n // @ts-expect-error `root`s are also fine.\n return h.augment(node, u('root', wrap(all(h, node))));\n}","/**\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Strong} node\n */\n\nexport function strong(h, node) {\n return h(node, 'strong', all(h, node));\n}","/**\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n * @typedef {import('../index.js').Content} Content\n */\nimport { pointStart, pointEnd } from 'unist-util-position';\nimport { wrap } from '../wrap.js';\nimport { all } from '../traverse.js';\n/**\n * @type {Handler}\n * @param {Table} node\n */\n\nexport function table(h, node) {\n var rows = node.children;\n var index = -1;\n var align = node.align || [];\n /** @type {Array} */\n\n var result = [];\n\n while (++index < rows.length) {\n var row = rows[index].children;\n var name = index === 0 ? 'th' : 'td';\n /** @type {Array} */\n\n var out = [];\n var cellIndex = -1;\n var length = node.align ? align.length : row.length;\n\n while (++cellIndex < length) {\n var cell = row[cellIndex];\n out.push(h(cell, name, {\n align: align[cellIndex]\n }, cell ? all(h, cell) : []));\n }\n\n result[index] = h(rows[index], 'tr', wrap(out, true));\n }\n\n return h(node, 'table', wrap([h(result[0].position, 'thead', wrap([result[0]], true))].concat(result[1] ? h({\n start: pointStart(result[1]),\n end: pointEnd(result[result.length - 1])\n }, 'tbody', wrap(result.slice(1), true)) : []), true));\n}","/**\n * @typedef {import('mdast').Text} Text\n * @typedef {import('../index.js').Handler} Handler\n */\nimport { u } from 'unist-builder';\n/**\n * @type {Handler}\n * @param {Text} node\n */\n\nexport function text(h, node) {\n return h.augment(node, u('text', String(node.value).replace(/[ \\t]*(\\r?\\n|\\r)[ \\t]*/g, '$1')));\n}","/**\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n */\n\n/**\n * @type {Handler}\n * @param {ThematicBreak} [node]\n * @returns {Element}\n */\nexport function thematicBreak(h, node) {\n return h(node, 'hr');\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * @typedef {import('mdast').Root|import('mdast').Parent['children'][number]} MdastNode\n * @typedef {import('hast').Root|import('hast').Parent['children'][number]} HastNode\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').ElementContent} Content\n * @typedef {import('unist-util-position').PositionLike} PositionLike\n *\n * @typedef EmbeddedHastFields\n * @property {string} [hName] Defines the tag name of an element\n * @property {Properties} [hProperties] Defines the properties of an element\n * @property {Array} [hChildren] Defines the (hast) children of an element\n *\n * @typedef {Record & EmbeddedHastFields} Data unist data with embedded hast fields\n *\n * @typedef {MdastNode & {data?: Data}} NodeWithData unist node with embedded hast data\n *\n * @callback Handler\n * @param {H} h Handle context\n * @param {any} node mdast node to handle\n * @param {Parent|null} parent Parent of `node`\n * @returns {Content|Array|null|undefined} hast node\n *\n * @callback HFunctionProps\n * @param {MdastNode|PositionLike|null|undefined} node mdast node or unist position\n * @param {string} tagName HTML tag name\n * @param {Properties} props Properties\n * @param {Array?} [children] hast content\n * @returns {Element}\n *\n * @callback HFunctionNoProps\n * @param {MdastNode|PositionLike|null|undefined} node mdast node or unist position\n * @param {string} tagName HTML tag name\n * @param {Array?} [children] hast content\n * @returns {Element}\n *\n * @typedef HFields\n * @property {boolean} dangerous Whether HTML is allowed\n * @property {string} clobberPrefix Prefix to use to prevent DOM clobbering\n * @property {string} footnoteLabel Label to use to introduce the footnote section\n * @property {string} footnoteBackLabel Label to use to go back to a footnote call from the footnote section\n * @property {(identifier: string) => Definition|null} definition Definition cache\n * @property {Record} footnoteById Footnote cache\n * @property {Array} footnoteOrder Order in which footnotes occur\n * @property {Record} footnoteCounts Counts the same footnote was used\n * @property {Handlers} handlers Applied handlers\n * @property {Handler} unknownHandler Handler for any none not in `passThrough` or otherwise handled\n * @property {(left: NodeWithData|PositionLike|null|undefined, right: Content) => Content} augment Like `h` but lower-level and usable on non-elements.\n * @property {Array} passThrough List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n * @property {boolean} [allowDangerousHtml=false]\n * Whether to allow `html` nodes and inject them as `raw` HTML\n * @property {string} [clobberPrefix='user-content-']\n * Prefix to use before the `id` attribute to prevent it from *clobbering*.\n * attributes.\n * DOM clobbering is this:\n *\n * ```html\n *
\n * \n * ```\n *\n * Elements by their ID are made available in browsers on the `window` object.\n * Using a prefix prevents this from being a problem.\n * @property {string} [footnoteLabel='Footnotes']\n * Label to use for the footnotes section.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {string} [footnoteBackLabel='Back to content']\n * Label to use from backreferences back to their footnote call.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {Handlers} [handlers]\n * Object mapping mdast nodes to functions handling them\n * @property {Array} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast\n * @property {Handler} [unknownHandler]\n * Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n * Map of node types to handlers\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} H\n * Handle context\n */\nimport { u } from 'unist-builder';\nimport { visit } from 'unist-util-visit';\nimport { pointStart, pointEnd } from 'unist-util-position';\nimport { generated } from 'unist-util-generated';\nimport { definitions } from 'mdast-util-definitions';\nimport { one } from './traverse.js';\nimport { footer } from './footer.js';\nimport { handlers } from './handlers/index.js';\nvar own = {}.hasOwnProperty;\n/**\n * Factory to transform.\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {H} `h` function\n */\n\nfunction factory(tree, options) {\n var settings = options || {};\n var dangerous = settings.allowDangerousHtml || false;\n /** @type {Record} */\n\n var footnoteById = {};\n h.dangerous = dangerous;\n h.clobberPrefix = settings.clobberPrefix === undefined || settings.clobberPrefix === null ? 'user-content-' : settings.clobberPrefix;\n h.footnoteLabel = settings.footnoteLabel || 'Footnotes';\n h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content';\n h.definition = definitions(tree);\n h.footnoteById = footnoteById;\n /** @type {Array} */\n\n h.footnoteOrder = [];\n /** @type {Record} */\n\n h.footnoteCounts = {};\n h.augment = augment;\n h.handlers = _objectSpread(_objectSpread({}, handlers), settings.handlers);\n h.unknownHandler = settings.unknownHandler;\n h.passThrough = settings.passThrough;\n visit(tree, 'footnoteDefinition', function (definition) {\n var id = String(definition.identifier).toUpperCase(); // Mimick CM behavior of link definitions.\n // See: .\n\n if (!own.call(footnoteById, id)) {\n footnoteById[id] = definition;\n }\n }); // @ts-expect-error Hush, it’s fine!\n\n return h;\n /**\n * Finalise the created `right`, a hast node, from `left`, an mdast node.\n * @param {(NodeWithData|PositionLike)?} left\n * @param {Content} right\n * @returns {Content}\n */\n\n function augment(left, right) {\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (left && 'data' in left && left.data) {\n /** @type {Data} */\n var data = left.data;\n\n if (data.hName) {\n if (right.type !== 'element') {\n right = {\n type: 'element',\n tagName: '',\n properties: {},\n children: []\n };\n }\n\n right.tagName = data.hName;\n }\n\n if (right.type === 'element' && data.hProperties) {\n right.properties = _objectSpread(_objectSpread({}, right.properties), data.hProperties);\n }\n\n if ('children' in right && right.children && data.hChildren) {\n right.children = data.hChildren;\n }\n }\n\n if (left) {\n var ctx = 'type' in left ? left : {\n position: left\n };\n\n if (!generated(ctx)) {\n right.position = {\n start: pointStart(ctx),\n end: pointEnd(ctx)\n };\n }\n }\n\n return right;\n }\n /**\n * Create an element for `node`.\n *\n * @type {HFunctionProps}\n */\n\n\n function h(node, tagName, props, children) {\n if (Array.isArray(props)) {\n children = props;\n props = {};\n } // @ts-expect-error augmenting an element yields an element.\n\n\n return augment(node, {\n type: 'element',\n tagName: tagName,\n properties: props || {},\n children: children || []\n });\n }\n}\n/**\n * Transform `tree` (an mdast node) to a hast node.\n *\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {HastNode|null|undefined} hast node\n */\n\n\nexport function toHast(tree, options) {\n var h = factory(tree, options);\n var node = one(h, tree, null);\n var foot = footer(h);\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push(u('text', '\\n'), foot);\n }\n\n return Array.isArray(node) ? {\n type: 'root',\n children: node\n } : node;\n}\nexport { handlers as defaultHandlers } from './handlers/index.js';","/**\n * @typedef {Object} PointLike\n * @property {number} [line]\n * @property {number} [column]\n * @property {number} [offset]\n *\n * @typedef {Object} PositionLike\n * @property {PointLike} [start]\n * @property {PointLike} [end]\n *\n * @typedef {Object} NodeLike\n * @property {PositionLike} [position]\n */\n\n/**\n * Check if `node` is *generated*.\n *\n * @param {NodeLike} [node]\n * @returns {boolean}\n */\nexport function generated(node) {\n return !node || !node.position || !node.position.start || !node.position.start.line || !node.position.start.column || !node.position.end || !node.position.end.line || !node.position.end.column;\n}","/**\n * @typedef {import('mdast').BlockContent} BlockContent\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('./index.js').H} H\n */\nimport { sanitizeUri } from 'micromark-util-sanitize-uri';\nimport { u } from 'unist-builder';\nimport { all } from './traverse.js';\nimport { wrap } from './wrap.js';\n/**\n * @param {H} h\n */\n\nexport function footer(h) {\n var index = -1;\n /** @type {Array} */\n\n var listItems = [];\n\n while (++index < h.footnoteOrder.length) {\n var def = h.footnoteById[h.footnoteOrder[index].toUpperCase()];\n\n if (!def) {\n continue;\n }\n\n var content = all(h, def);\n var id = String(def.identifier);\n var safeId = sanitizeUri(id.toLowerCase());\n var referenceIndex = 0;\n /** @type {Array} */\n\n var backReferences = [];\n\n while (++referenceIndex <= h.footnoteCounts[id]) {\n /** @type {Element} */\n var backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + h.clobberPrefix + 'fnref-' + safeId + (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: h.footnoteBackLabel\n },\n children: [{\n type: 'text',\n value: '↩'\n }]\n };\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{\n type: 'text',\n value: String(referenceIndex)\n }]\n });\n }\n\n if (backReferences.length > 0) {\n backReferences.push({\n type: 'text',\n value: ' '\n });\n }\n\n backReferences.push(backReference);\n }\n\n var tail = content[content.length - 1];\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n var _tail$children;\n\n var tailTail = tail.children[tail.children.length - 1];\n\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' ';\n } else {\n tail.children.push({\n type: 'text',\n value: ' '\n });\n }\n\n (_tail$children = tail.children).push.apply(_tail$children, backReferences);\n } else {\n content.push.apply(content, backReferences);\n }\n /** @type {Element} */\n\n\n var listItem = {\n type: 'element',\n tagName: 'li',\n properties: {\n id: h.clobberPrefix + 'fn-' + safeId\n },\n children: wrap(content, true)\n };\n\n if (def.position) {\n listItem.position = def.position;\n }\n\n listItems.push(listItem);\n }\n\n if (listItems.length === 0) {\n return null;\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {\n dataFootnotes: true,\n className: ['footnotes']\n },\n children: [{\n type: 'element',\n tagName: 'h2',\n properties: {\n id: 'footnote-label',\n className: ['sr-only']\n },\n children: [u('text', h.footnoteLabel)]\n }, {\n type: 'text',\n value: '\\n'\n }, {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: wrap(listItems, true)\n }, {\n type: 'text',\n value: '\\n'\n }]\n };\n}","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\nimport { toHast } from 'mdast-util-to-hast'; // Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\n\nvar remarkRehype =\n/** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\nfunction remarkRehype(destination, options) {\n return destination && 'run' in destination ? bridge(destination, options) : mutate(destination || options);\n};\n\nexport default remarkRehype;\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\n\nfunction bridge(destination, options) {\n return function (node, file, next) {\n destination.run(toHast(node, options), file, function (error) {\n next(error);\n });\n };\n}\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\n\n\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return function (node) {\n return toHast(node, options);\n };\n}","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\nexport var Schema = /*#__PURE__*/_createClass(\n/**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\nfunction Schema(property, normal, space) {\n _classCallCheck(this, Schema);\n\n this.property = property;\n this.normal = normal;\n\n if (space) {\n this.space = space;\n }\n});\n/** @type {Properties} */\n\nSchema.prototype.property = {};\n/** @type {Normal} */\n\nSchema.prototype.normal = {};\n/** @type {string|null} */\n\nSchema.prototype.space = null;","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\nimport { Schema } from './schema.js';\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\n\nexport function merge(definitions, space) {\n /** @type {Properties} */\n var property = {};\n /** @type {Normal} */\n\n var normal = {};\n var index = -1;\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property);\n Object.assign(normal, definitions[index].normal);\n }\n\n return new Schema(property, normal, space);\n}","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase();\n}","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nexport var Info = /*#__PURE__*/_createClass(\n/**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\nfunction Info(property, attribute) {\n _classCallCheck(this, Info);\n\n /** @type {string} */\n this.property = property;\n /** @type {string} */\n\n this.attribute = attribute;\n});\n/** @type {string|null} */\n\nInfo.prototype.space = null;\nInfo.prototype[\"boolean\"] = false;\nInfo.prototype.booleanish = false;\nInfo.prototype.overloadedBoolean = false;\nInfo.prototype.number = false;\nInfo.prototype.commaSeparated = false;\nInfo.prototype.spaceSeparated = false;\nInfo.prototype.commaOrSpaceSeparated = false;\nInfo.prototype.mustUseProperty = false;\nInfo.prototype.defined = false;","var powers = 0;\n\nvar _boolean = increment();\n\nexport { _boolean as boolean };\nexport var booleanish = increment();\nexport var overloadedBoolean = increment();\nexport var number = increment();\nexport var spaceSeparated = increment();\nexport var commaSeparated = increment();\nexport var commaOrSpaceSeparated = increment();\n\nfunction increment() {\n return Math.pow(2, ++powers);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { Info } from './info.js';\nimport * as types from './types.js';\n/** @type {Array} */\n// @ts-expect-error: hush.\n\nvar checks = Object.keys(types);\nexport var DefinedInfo = /*#__PURE__*/function (_Info) {\n _inherits(DefinedInfo, _Info);\n\n var _super = _createSuper(DefinedInfo);\n\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n function DefinedInfo(property, attribute, mask, space) {\n var _this;\n\n _classCallCheck(this, DefinedInfo);\n\n var index = -1;\n _this = _super.call(this, property, attribute);\n mark(_assertThisInitialized(_this), 'space', space);\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n var check = checks[index];\n mark(_assertThisInitialized(_this), checks[index], (mask & types[check]) === types[check]);\n }\n }\n\n return _this;\n }\n\n return _createClass(DefinedInfo);\n}(Info);\nDefinedInfo.prototype.defined = true;\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\n\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value;\n }\n}","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\nimport { normalize } from '../normalize.js';\nimport { Schema } from './schema.js';\nimport { DefinedInfo } from './defined-info.js';\nvar own = {}.hasOwnProperty;\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\n\nexport function create(definition) {\n /** @type {Properties} */\n var property = {};\n /** @type {Normal} */\n\n var normal = {};\n /** @type {string} */\n\n var prop;\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n var value = definition.properties[prop];\n var info = new DefinedInfo(prop, definition.transform(definition.attributes || {}, prop), value, definition.space);\n\n if (definition.mustUseProperty && definition.mustUseProperty.includes(prop)) {\n info.mustUseProperty = true;\n }\n\n property[prop] = info;\n normal[normalize(prop)] = prop;\n normal[normalize(info.attribute)] = prop;\n }\n }\n\n return new Schema(property, normal, definition.space);\n}","import { create } from './util/create.js';\nexport var xlink = create({\n space: 'xlink',\n transform: function transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase();\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n});","import { create } from './util/create.js';\nexport var xml = create({\n space: 'xml',\n transform: function transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase();\n },\n properties: {\n xmlLang: null,\n xmlBase: null,\n xmlSpace: null\n }\n});","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute;\n}","import { caseSensitiveTransform } from './case-sensitive-transform.js';\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\n\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase());\n}","import { create } from './util/create.js';\nimport { caseInsensitiveTransform } from './util/case-insensitive-transform.js';\nexport var xmlns = create({\n space: 'xmlns',\n attributes: {\n xmlnsxlink: 'xmlns:xlink'\n },\n transform: caseInsensitiveTransform,\n properties: {\n xmlns: null,\n xmlnsXLink: null\n }\n});","import { booleanish, number, spaceSeparated } from './util/types.js';\nimport { create } from './util/create.js';\nexport var aria = create({\n transform: function transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase();\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n});","import { boolean as _boolean, overloadedBoolean, booleanish, number, spaceSeparated, commaSeparated } from './util/types.js';\nimport { create } from './util/create.js';\nimport { caseInsensitiveTransform } from './util/case-insensitive-transform.js';\nexport var html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: _boolean,\n allowPaymentRequest: _boolean,\n allowUserMedia: _boolean,\n alt: null,\n as: null,\n async: _boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: _boolean,\n autoPlay: _boolean,\n capture: _boolean,\n charSet: null,\n checked: _boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: _boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n \"default\": _boolean,\n defer: _boolean,\n dir: null,\n dirName: null,\n disabled: _boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: _boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: _boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: _boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: _boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: _boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: _boolean,\n muted: _boolean,\n name: null,\n nonce: null,\n noModule: _boolean,\n noValidate: _boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforePrint: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: _boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: _boolean,\n poster: null,\n preload: null,\n readOnly: _boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: _boolean,\n reversed: _boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: _boolean,\n seamless: _boolean,\n selected: _boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: _boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null,\n // Several. Use CSS `text-align` instead,\n aLink: null,\n // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated,\n // ``. List of URIs to archives\n axis: null,\n // `` and ` `. Use `scope` on ` `\n background: null,\n // ``. Use CSS `background-image` instead\n bgColor: null,\n // `` and table elements. Use CSS `background-color` instead\n border: number,\n // ``. Use CSS `border-width` instead,\n borderColor: null,\n // ``. Use CSS `border-color` instead,\n bottomMargin: number,\n // ``\n cellPadding: null,\n // ``\n cellSpacing: null,\n // ``\n \"char\": null,\n // Several table elements. When `align=char`, sets the character to align on\n charOff: null,\n // Several table elements. When `char`, offsets the alignment\n classId: null,\n // ``\n clear: null,\n // ` `. Use CSS `clear` instead\n code: null,\n // ``\n codeBase: null,\n // ``\n codeType: null,\n // ``\n color: null,\n // `` and ` `. Use CSS instead\n compact: _boolean,\n // Lists. Use CSS to reduce space between items instead\n declare: _boolean,\n // ``\n event: null,\n // `\n if (val === '') return true;\n if (val === 'false') return false;\n if (val === 'true') return true;\n return val;\n}\n\nif (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {\n var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];\n attrs.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n attr = _ref2[0],\n key = _ref2[1];\n\n var val = coerce(getAttrConfig(attr));\n\n if (val !== undefined && val !== null) {\n initial[key] = val;\n }\n });\n}\n\nvar _default = {\n familyPrefix: DEFAULT_FAMILY_PREFIX,\n replacementClass: DEFAULT_REPLACEMENT_CLASS,\n autoReplaceSvg: true,\n autoAddCss: true,\n autoA11y: true,\n searchPseudoElements: false,\n observeMutations: true,\n mutateApproach: 'async',\n keepOriginalSource: true,\n measurePerformance: false,\n showMissingIcons: true\n};\n\nvar _config = _objectSpread({}, _default, initial);\n\nif (!_config.autoReplaceSvg) _config.observeMutations = false;\n\nvar config = _objectSpread({}, _config);\n\nWINDOW.FontAwesomeConfig = config;\nvar w = WINDOW || {};\nif (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};\nif (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};\nif (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};\nif (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];\nvar namespace = w[NAMESPACE_IDENTIFIER];\nvar functions = [];\n\nvar listener = function listener() {\n DOCUMENT.removeEventListener('DOMContentLoaded', listener);\n loaded = 1;\n functions.map(function (fn) {\n return fn();\n });\n};\n\nvar loaded = false;\n\nif (IS_DOM) {\n loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);\n if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);\n}\n\nfunction domready(fn) {\n if (!IS_DOM) return;\n loaded ? setTimeout(fn, 0) : functions.push(fn);\n}\n\nvar PENDING = 'pending';\nvar SETTLED = 'settled';\nvar FULFILLED = 'fulfilled';\nvar REJECTED = 'rejected';\n\nvar NOOP = function NOOP() {};\n\nvar isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';\nvar asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;\nvar asyncQueue = [];\nvar asyncTimer;\n\nfunction asyncFlush() {\n // run promise callbacks\n for (var i = 0; i < asyncQueue.length; i++) {\n asyncQueue[i][0](asyncQueue[i][1]);\n } // reset async asyncQueue\n\n\n asyncQueue = [];\n asyncTimer = false;\n}\n\nfunction asyncCall(callback, arg) {\n asyncQueue.push([callback, arg]);\n\n if (!asyncTimer) {\n asyncTimer = true;\n asyncSetTimer(asyncFlush, 0);\n }\n}\n\nfunction invokeResolver(resolver, promise) {\n function resolvePromise(value) {\n resolve(promise, value);\n }\n\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch (e) {\n rejectPromise(e);\n }\n}\n\nfunction invokeCallback(subscriber) {\n var owner = subscriber.owner;\n var settled = owner._state;\n var value = owner._data;\n var callback = subscriber[settled];\n var promise = subscriber.then;\n\n if (typeof callback === 'function') {\n settled = FULFILLED;\n\n try {\n value = callback(value);\n } catch (e) {\n reject(promise, e);\n }\n }\n\n if (!handleThenable(promise, value)) {\n if (settled === FULFILLED) {\n resolve(promise, value);\n }\n\n if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n}\n\nfunction handleThenable(promise, value) {\n var resolved;\n\n try {\n if (promise === value) {\n throw new TypeError('A promises callback cannot return that same promise.');\n }\n\n if (value && (typeof value === 'function' || _typeof(value) === 'object')) {\n // then should be retrieved only once\n var then = value.then;\n\n if (typeof then === 'function') {\n then.call(value, function (val) {\n if (!resolved) {\n resolved = true;\n\n if (value === val) {\n fulfill(promise, val);\n } else {\n resolve(promise, val);\n }\n }\n }, function (reason) {\n if (!resolved) {\n resolved = true;\n reject(promise, reason);\n }\n });\n return true;\n }\n }\n } catch (e) {\n if (!resolved) {\n reject(promise, e);\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction resolve(promise, value) {\n if (promise === value || !handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n}\n\nfunction fulfill(promise, value) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = value;\n asyncCall(publishFulfillment, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state === PENDING) {\n promise._state = SETTLED;\n promise._data = reason;\n asyncCall(publishRejection, promise);\n }\n}\n\nfunction publish(promise) {\n promise._then = promise._then.forEach(invokeCallback);\n}\n\nfunction publishFulfillment(promise) {\n promise._state = FULFILLED;\n publish(promise);\n}\n\nfunction publishRejection(promise) {\n promise._state = REJECTED;\n publish(promise);\n\n if (!promise._handled && isNode) {\n global.process.emit('unhandledRejection', promise._data, promise);\n }\n}\n\nfunction notifyRejectionHandled(promise) {\n global.process.emit('rejectionHandled', promise);\n}\n/**\n * @class\n */\n\n\nfunction P(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('Promise resolver ' + resolver + ' is not a function');\n }\n\n if (this instanceof P === false) {\n throw new TypeError('Failed to construct \\'Promise\\': Please use the \\'new\\' operator, this object constructor cannot be called as a function.');\n }\n\n this._then = [];\n invokeResolver(resolver, this);\n}\n\nP.prototype = {\n constructor: P,\n _state: PENDING,\n _then: null,\n _data: undefined,\n _handled: false,\n then: function then(onFulfillment, onRejection) {\n var subscriber = {\n owner: this,\n then: new this.constructor(NOOP),\n fulfilled: onFulfillment,\n rejected: onRejection\n };\n\n if ((onRejection || onFulfillment) && !this._handled) {\n this._handled = true;\n\n if (this._state === REJECTED && isNode) {\n asyncCall(notifyRejectionHandled, this);\n }\n }\n\n if (this._state === FULFILLED || this._state === REJECTED) {\n // already resolved, call callback async\n asyncCall(invokeCallback, subscriber);\n } else {\n // subscribe\n this._then.push(subscriber);\n }\n\n return subscriber.then;\n },\n \"catch\": function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nP.all = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.all().');\n }\n\n return new P(function (resolve, reject) {\n var results = [];\n var remaining = 0;\n\n function resolver(index) {\n remaining++;\n return function (value) {\n results[index] = value;\n\n if (! --remaining) {\n resolve(results);\n }\n };\n }\n\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n results[i] = promise;\n }\n }\n\n if (!remaining) {\n resolve(results);\n }\n });\n};\n\nP.race = function (promises) {\n if (!Array.isArray(promises)) {\n throw new TypeError('You must pass an array to Promise.race().');\n }\n\n return new P(function (resolve, reject) {\n for (var i = 0, promise; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolve, reject);\n } else {\n resolve(promise);\n }\n }\n });\n};\n\nP.resolve = function (value) {\n if (value && _typeof(value) === 'object' && value.constructor === P) {\n return value;\n }\n\n return new P(function (resolve) {\n resolve(value);\n });\n};\n\nP.reject = function (reason) {\n return new P(function (resolve, reject) {\n reject(reason);\n });\n};\n\nvar picked = typeof Promise === 'function' ? Promise : P;\nvar d = UNITS_IN_GRID;\nvar meaninglessTransform = {\n size: 16,\n x: 0,\n y: 0,\n rotate: 0,\n flipX: false,\n flipY: false\n};\n\nfunction isReserved(name) {\n return ~RESERVED_CLASSES.indexOf(name);\n}\n\nfunction insertCss(css) {\n if (!css || !IS_DOM) {\n return;\n }\n\n var style = DOCUMENT.createElement('style');\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n var headChildren = DOCUMENT.head.childNodes;\n var beforeChild = null;\n\n for (var i = headChildren.length - 1; i > -1; i--) {\n var child = headChildren[i];\n var tagName = (child.tagName || '').toUpperCase();\n\n if (['STYLE', 'LINK'].indexOf(tagName) > -1) {\n beforeChild = child;\n }\n }\n\n DOCUMENT.head.insertBefore(style, beforeChild);\n return css;\n}\n\nvar idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nfunction nextUniqueId() {\n var size = 12;\n var id = '';\n\n while (size-- > 0) {\n id += idPool[Math.random() * 62 | 0];\n }\n\n return id;\n}\n\nfunction toArray(obj) {\n var array = [];\n\n for (var i = (obj || []).length >>> 0; i--;) {\n array[i] = obj[i];\n }\n\n return array;\n}\n\nfunction classArray(node) {\n if (node.classList) {\n return toArray(node.classList);\n } else {\n return (node.getAttribute('class') || '').split(' ').filter(function (i) {\n return i;\n });\n }\n}\n\nfunction getIconName(familyPrefix, cls) {\n var parts = cls.split('-');\n var prefix = parts[0];\n var iconName = parts.slice(1).join('-');\n\n if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {\n return iconName;\n } else {\n return null;\n }\n}\n\nfunction htmlEscape(str) {\n return \"\".concat(str).replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n}\n\nfunction joinAttributes(attributes) {\n return Object.keys(attributes || {}).reduce(function (acc, attributeName) {\n return acc + \"\".concat(attributeName, \"=\\\"\").concat(htmlEscape(attributes[attributeName]), \"\\\" \");\n }, '').trim();\n}\n\nfunction joinStyles(styles) {\n return Object.keys(styles || {}).reduce(function (acc, styleName) {\n return acc + \"\".concat(styleName, \": \").concat(styles[styleName], \";\");\n }, '');\n}\n\nfunction transformIsMeaningful(transform) {\n return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;\n}\n\nfunction transformForSvg(_ref) {\n var transform = _ref.transform,\n containerWidth = _ref.containerWidth,\n iconWidth = _ref.iconWidth;\n var outer = {\n transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n };\n var innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n var innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n var innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n var inner = {\n transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n };\n var path = {\n transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n };\n return {\n outer: outer,\n inner: inner,\n path: path\n };\n}\n\nfunction transformForCss(_ref2) {\n var transform = _ref2.transform,\n _ref2$width = _ref2.width,\n width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,\n _ref2$height = _ref2.height,\n height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,\n _ref2$startCentered = _ref2.startCentered,\n startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;\n var val = '';\n\n if (startCentered && IS_IE) {\n val += \"translate(\".concat(transform.x / d - width / 2, \"em, \").concat(transform.y / d - height / 2, \"em) \");\n } else if (startCentered) {\n val += \"translate(calc(-50% + \".concat(transform.x / d, \"em), calc(-50% + \").concat(transform.y / d, \"em)) \");\n } else {\n val += \"translate(\".concat(transform.x / d, \"em, \").concat(transform.y / d, \"em) \");\n }\n\n val += \"scale(\".concat(transform.size / d * (transform.flipX ? -1 : 1), \", \").concat(transform.size / d * (transform.flipY ? -1 : 1), \") \");\n val += \"rotate(\".concat(transform.rotate, \"deg) \");\n return val;\n}\n\nvar ALL_SPACE = {\n x: 0,\n y: 0,\n width: '100%',\n height: '100%'\n};\n\nfunction fillBlack(_abstract) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (_abstract.attributes && (_abstract.attributes.fill || force)) {\n _abstract.attributes.fill = 'black';\n }\n\n return _abstract;\n}\n\nfunction deGroup(_abstract2) {\n if (_abstract2.tag === 'g') {\n return _abstract2.children;\n } else {\n return [_abstract2];\n }\n}\n\nfunction makeIconMasking(_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n mask = _ref.mask,\n explicitMaskId = _ref.maskId,\n transform = _ref.transform;\n var mainWidth = main.width,\n mainPath = main.icon;\n var maskWidth = mask.width,\n maskPath = mask.icon;\n var trans = transformForSvg({\n transform: transform,\n containerWidth: maskWidth,\n iconWidth: mainWidth\n });\n var maskRect = {\n tag: 'rect',\n attributes: _objectSpread({}, ALL_SPACE, {\n fill: 'white'\n })\n };\n var maskInnerGroupChildrenMixin = mainPath.children ? {\n children: mainPath.children.map(fillBlack)\n } : {};\n var maskInnerGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [fillBlack(_objectSpread({\n tag: mainPath.tag,\n attributes: _objectSpread({}, mainPath.attributes, trans.path)\n }, maskInnerGroupChildrenMixin))]\n };\n var maskOuterGroup = {\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [maskInnerGroup]\n };\n var maskId = \"mask-\".concat(explicitMaskId || nextUniqueId());\n var clipId = \"clip-\".concat(explicitMaskId || nextUniqueId());\n var maskTag = {\n tag: 'mask',\n attributes: _objectSpread({}, ALL_SPACE, {\n id: maskId,\n maskUnits: 'userSpaceOnUse',\n maskContentUnits: 'userSpaceOnUse'\n }),\n children: [maskRect, maskOuterGroup]\n };\n var defs = {\n tag: 'defs',\n children: [{\n tag: 'clipPath',\n attributes: {\n id: clipId\n },\n children: deGroup(maskPath)\n }, maskTag]\n };\n children.push(defs, {\n tag: 'rect',\n attributes: _objectSpread({\n fill: 'currentColor',\n 'clip-path': \"url(#\".concat(clipId, \")\"),\n mask: \"url(#\".concat(maskId, \")\")\n }, ALL_SPACE)\n });\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction makeIconStandard(_ref) {\n var children = _ref.children,\n attributes = _ref.attributes,\n main = _ref.main,\n transform = _ref.transform,\n styles = _ref.styles;\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n if (transformIsMeaningful(transform)) {\n var trans = transformForSvg({\n transform: transform,\n containerWidth: main.width,\n iconWidth: main.width\n });\n children.push({\n tag: 'g',\n attributes: _objectSpread({}, trans.outer),\n children: [{\n tag: 'g',\n attributes: _objectSpread({}, trans.inner),\n children: [{\n tag: main.icon.tag,\n children: main.icon.children,\n attributes: _objectSpread({}, main.icon.attributes, trans.path)\n }]\n }]\n });\n } else {\n children.push(main.icon);\n }\n\n return {\n children: children,\n attributes: attributes\n };\n}\n\nfunction asIcon(_ref) {\n var children = _ref.children,\n main = _ref.main,\n mask = _ref.mask,\n attributes = _ref.attributes,\n styles = _ref.styles,\n transform = _ref.transform;\n\n if (transformIsMeaningful(transform) && main.found && !mask.found) {\n var width = main.width,\n height = main.height;\n var offset = {\n x: width / height / 2,\n y: 0.5\n };\n attributes['style'] = joinStyles(_objectSpread({}, styles, {\n 'transform-origin': \"\".concat(offset.x + transform.x / 16, \"em \").concat(offset.y + transform.y / 16, \"em\")\n }));\n }\n\n return [{\n tag: 'svg',\n attributes: attributes,\n children: children\n }];\n}\n\nfunction asSymbol(_ref) {\n var prefix = _ref.prefix,\n iconName = _ref.iconName,\n children = _ref.children,\n attributes = _ref.attributes,\n symbol = _ref.symbol;\n var id = symbol === true ? \"\".concat(prefix, \"-\").concat(config.familyPrefix, \"-\").concat(iconName) : symbol;\n return [{\n tag: 'svg',\n attributes: {\n style: 'display: none;'\n },\n children: [{\n tag: 'symbol',\n attributes: _objectSpread({}, attributes, {\n id: id\n }),\n children: children\n }]\n }];\n}\n\nfunction makeInlineSvgAbstract(params) {\n var _params$icons = params.icons,\n main = _params$icons.main,\n mask = _params$icons.mask,\n prefix = params.prefix,\n iconName = params.iconName,\n transform = params.transform,\n symbol = params.symbol,\n title = params.title,\n maskId = params.maskId,\n titleId = params.titleId,\n extra = params.extra,\n _params$watchable = params.watchable,\n watchable = _params$watchable === void 0 ? false : _params$watchable;\n\n var _ref = mask.found ? mask : main,\n width = _ref.width,\n height = _ref.height;\n\n var isUploadedIcon = prefix === 'fak';\n var widthClass = isUploadedIcon ? '' : \"fa-w-\".concat(Math.ceil(width / height * 16));\n var attrClass = [config.replacementClass, iconName ? \"\".concat(config.familyPrefix, \"-\").concat(iconName) : '', widthClass].filter(function (c) {\n return extra.classes.indexOf(c) === -1;\n }).filter(function (c) {\n return c !== '' || !!c;\n }).concat(extra.classes).join(' ');\n var content = {\n children: [],\n attributes: _objectSpread({}, extra.attributes, {\n 'data-prefix': prefix,\n 'data-icon': iconName,\n 'class': attrClass,\n 'role': extra.attributes.role || 'img',\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'viewBox': \"0 0 \".concat(width, \" \").concat(height)\n })\n };\n var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {\n width: \"\".concat(width / height * 16 * 0.0625, \"em\")\n } : {};\n\n if (watchable) {\n content.attributes[DATA_FA_I2SVG] = '';\n }\n\n if (title) content.children.push({\n tag: 'title',\n attributes: {\n id: content.attributes['aria-labelledby'] || \"title-\".concat(titleId || nextUniqueId())\n },\n children: [title]\n });\n\n var args = _objectSpread({}, content, {\n prefix: prefix,\n iconName: iconName,\n main: main,\n mask: mask,\n maskId: maskId,\n transform: transform,\n symbol: symbol,\n styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)\n });\n\n var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),\n children = _ref2.children,\n attributes = _ref2.attributes;\n\n args.children = children;\n args.attributes = attributes;\n\n if (symbol) {\n return asSymbol(args);\n } else {\n return asIcon(args);\n }\n}\n\nfunction makeLayersTextAbstract(params) {\n var content = params.content,\n width = params.width,\n height = params.height,\n transform = params.transform,\n title = params.title,\n extra = params.extra,\n _params$watchable2 = params.watchable,\n watchable = _params$watchable2 === void 0 ? false : _params$watchable2;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n if (watchable) {\n attributes[DATA_FA_I2SVG] = '';\n }\n\n var styles = _objectSpread({}, extra.styles);\n\n if (transformIsMeaningful(transform)) {\n styles['transform'] = transformForCss({\n transform: transform,\n startCentered: true,\n width: width,\n height: height\n });\n styles['-webkit-transform'] = styles['transform'];\n }\n\n var styleString = joinStyles(styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n \"class\": 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\n\nfunction makeLayersCounterAbstract(params) {\n var content = params.content,\n title = params.title,\n extra = params.extra;\n\n var attributes = _objectSpread({}, extra.attributes, title ? {\n 'title': title\n } : {}, {\n 'class': extra.classes.join(' ')\n });\n\n var styleString = joinStyles(extra.styles);\n\n if (styleString.length > 0) {\n attributes['style'] = styleString;\n }\n\n var val = [];\n val.push({\n tag: 'span',\n attributes: attributes,\n children: [content]\n });\n\n if (title) {\n val.push({\n tag: 'span',\n attributes: {\n \"class\": 'sr-only'\n },\n children: [title]\n });\n }\n\n return val;\n}\n\nvar noop$1 = function noop() {};\n\nvar p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {\n mark: noop$1,\n measure: noop$1\n};\nvar preamble = \"FA \\\"5.15.4\\\"\";\n\nvar begin = function begin(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" begins\"));\n return function () {\n return end(name);\n };\n};\n\nvar end = function end(name) {\n p.mark(\"\".concat(preamble, \" \").concat(name, \" ends\"));\n p.measure(\"\".concat(preamble, \" \").concat(name), \"\".concat(preamble, \" \").concat(name, \" begins\"), \"\".concat(preamble, \" \").concat(name, \" ends\"));\n};\n\nvar perf = {\n begin: begin,\n end: end\n};\n/**\n * Internal helper to bind a function known to have 4 arguments\n * to a given context.\n */\n\nvar bindInternal4 = function bindInternal4(func, thisContext) {\n return function (a, b, c, d) {\n return func.call(thisContext, a, b, c, d);\n };\n};\n/**\n * # Reduce\n *\n * A fast object `.reduce()` implementation.\n *\n * @param {Object} subject The object to reduce over.\n * @param {Function} fn The reducer function.\n * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].\n * @param {Object} thisContext The context for the reducer.\n * @return {mixed} The final result.\n */\n\n\nvar reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {\n var keys = Object.keys(subject),\n length = keys.length,\n iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,\n i,\n key,\n result;\n\n if (initialValue === undefined) {\n i = 1;\n result = subject[keys[0]];\n } else {\n i = 0;\n result = initialValue;\n }\n\n for (; i < length; i++) {\n key = keys[i];\n result = iterator(result, subject[key], key, subject);\n }\n\n return result;\n};\n\nfunction toHex(unicode) {\n var result = '';\n\n for (var i = 0; i < unicode.length; i++) {\n var hex = unicode.charCodeAt(i).toString(16);\n result += ('000' + hex).slice(-4);\n }\n\n return result;\n}\n\nfunction defineIcons(prefix, icons) {\n var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var _params$skipHooks = params.skipHooks,\n skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;\n var normalized = Object.keys(icons).reduce(function (acc, iconName) {\n var icon = icons[iconName];\n var expanded = !!icon.icon;\n\n if (expanded) {\n acc[icon.iconName] = icon.icon;\n } else {\n acc[iconName] = icon;\n }\n\n return acc;\n }, {});\n\n if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {\n namespace.hooks.addPack(prefix, normalized);\n } else {\n namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);\n }\n /**\n * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction\n * of new styles we needed to differentiate between them. Prefix `fa` is now an alias\n * for `fas` so we'll easy the upgrade process for our users by automatically defining\n * this as well.\n */\n\n\n if (prefix === 'fas') {\n defineIcons('fa', icons);\n }\n}\n\nvar styles = namespace.styles,\n shims = namespace.shims;\nvar _byUnicode = {};\nvar _byLigature = {};\nvar _byOldName = {};\n\nvar build = function build() {\n var lookup = function lookup(reducer) {\n return reduce(styles, function (o, style, prefix) {\n o[prefix] = reduce(style, reducer, {});\n return o;\n }, {});\n };\n\n _byUnicode = lookup(function (acc, icon, iconName) {\n if (icon[3]) {\n acc[icon[3]] = iconName;\n }\n\n return acc;\n });\n _byLigature = lookup(function (acc, icon, iconName) {\n var ligatures = icon[2];\n acc[iconName] = iconName;\n ligatures.forEach(function (ligature) {\n acc[ligature] = iconName;\n });\n return acc;\n });\n var hasRegular = ('far' in styles);\n _byOldName = reduce(shims, function (acc, shim) {\n var oldName = shim[0];\n var prefix = shim[1];\n var iconName = shim[2];\n\n if (prefix === 'far' && !hasRegular) {\n prefix = 'fas';\n }\n\n acc[oldName] = {\n prefix: prefix,\n iconName: iconName\n };\n return acc;\n }, {});\n};\n\nbuild();\n\nfunction byUnicode(prefix, unicode) {\n return (_byUnicode[prefix] || {})[unicode];\n}\n\nfunction byLigature(prefix, ligature) {\n return (_byLigature[prefix] || {})[ligature];\n}\n\nfunction byOldName(name) {\n return _byOldName[name] || {\n prefix: null,\n iconName: null\n };\n}\n\nvar styles$1 = namespace.styles;\n\nvar emptyCanonicalIcon = function emptyCanonicalIcon() {\n return {\n prefix: null,\n iconName: null,\n rest: []\n };\n};\n\nfunction getCanonicalIcon(values) {\n return values.reduce(function (acc, cls) {\n var iconName = getIconName(config.familyPrefix, cls);\n\n if (styles$1[cls]) {\n acc.prefix = cls;\n } else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {\n acc.prefix = cls;\n } else if (iconName) {\n var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};\n acc.iconName = shim.iconName || iconName;\n acc.prefix = shim.prefix || acc.prefix;\n } else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {\n acc.rest.push(cls);\n }\n\n return acc;\n }, emptyCanonicalIcon());\n}\n\nfunction iconFromMapping(mapping, prefix, iconName) {\n if (mapping && mapping[prefix] && mapping[prefix][iconName]) {\n return {\n prefix: prefix,\n iconName: iconName,\n icon: mapping[prefix][iconName]\n };\n }\n}\n\nfunction toHtml(abstractNodes) {\n var tag = abstractNodes.tag,\n _abstractNodes$attrib = abstractNodes.attributes,\n attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,\n _abstractNodes$childr = abstractNodes.children,\n children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;\n\n if (typeof abstractNodes === 'string') {\n return htmlEscape(abstractNodes);\n } else {\n return \"<\".concat(tag, \" \").concat(joinAttributes(attributes), \">\").concat(children.map(toHtml).join(''), \"\").concat(tag, \">\");\n }\n}\n\nvar noop$2 = function noop() {};\n\nfunction isWatched(node) {\n var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;\n return typeof i2svg === 'string';\n}\n\nfunction getMutator() {\n if (config.autoReplaceSvg === true) {\n return mutators.replace;\n }\n\n var mutator = mutators[config.autoReplaceSvg];\n return mutator || mutators.replace;\n}\n\nvar mutators = {\n replace: function replace(mutation) {\n var node = mutation[0];\n var _abstract3 = mutation[1];\n\n var newOuterHTML = _abstract3.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n\n if (node.parentNode && node.outerHTML) {\n node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? \"\") : '');\n } else if (node.parentNode) {\n var newNode = document.createElement('span');\n node.parentNode.replaceChild(newNode, node);\n newNode.outerHTML = newOuterHTML;\n }\n },\n nest: function nest(mutation) {\n var node = mutation[0];\n var _abstract4 = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.\n // Short-circuit to the standard replacement\n\n if (~classArray(node).indexOf(config.replacementClass)) {\n return mutators.replace(mutation);\n }\n\n var forSvg = new RegExp(\"\".concat(config.familyPrefix, \"-.*\"));\n delete _abstract4[0].attributes.style;\n delete _abstract4[0].attributes.id;\n\n var splitClasses = _abstract4[0].attributes[\"class\"].split(' ').reduce(function (acc, cls) {\n if (cls === config.replacementClass || cls.match(forSvg)) {\n acc.toSvg.push(cls);\n } else {\n acc.toNode.push(cls);\n }\n\n return acc;\n }, {\n toNode: [],\n toSvg: []\n });\n\n _abstract4[0].attributes[\"class\"] = splitClasses.toSvg.join(' ');\n\n var newInnerHTML = _abstract4.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n\n node.setAttribute('class', splitClasses.toNode.join(' '));\n node.setAttribute(DATA_FA_I2SVG, '');\n node.innerHTML = newInnerHTML;\n }\n};\n\nfunction performOperationSync(op) {\n op();\n}\n\nfunction perform(mutations, callback) {\n var callbackFunction = typeof callback === 'function' ? callback : noop$2;\n\n if (mutations.length === 0) {\n callbackFunction();\n } else {\n var frame = performOperationSync;\n\n if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {\n frame = WINDOW.requestAnimationFrame || performOperationSync;\n }\n\n frame(function () {\n var mutator = getMutator();\n var mark = perf.begin('mutate');\n mutations.map(mutator);\n mark();\n callbackFunction();\n });\n }\n}\n\nvar disabled = false;\n\nfunction disableObservation() {\n disabled = true;\n}\n\nfunction enableObservation() {\n disabled = false;\n}\n\nvar mo = null;\n\nfunction observe(options) {\n if (!MUTATION_OBSERVER) {\n return;\n }\n\n if (!config.observeMutations) {\n return;\n }\n\n var treeCallback = options.treeCallback,\n nodeCallback = options.nodeCallback,\n pseudoElementsCallback = options.pseudoElementsCallback,\n _options$observeMutat = options.observeMutationsRoot,\n observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;\n mo = new MUTATION_OBSERVER(function (objects) {\n if (disabled) return;\n toArray(objects).forEach(function (mutationRecord) {\n if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {\n if (config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target);\n }\n\n treeCallback(mutationRecord.target);\n }\n\n if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {\n pseudoElementsCallback(mutationRecord.target.parentNode);\n }\n\n if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {\n if (mutationRecord.attributeName === 'class') {\n var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),\n prefix = _getCanonicalIcon.prefix,\n iconName = _getCanonicalIcon.iconName;\n\n if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);\n if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);\n } else {\n nodeCallback(mutationRecord.target);\n }\n }\n });\n });\n if (!IS_DOM) return;\n mo.observe(observeMutationsRoot, {\n childList: true,\n attributes: true,\n characterData: true,\n subtree: true\n });\n}\n\nfunction disconnect() {\n if (!mo) return;\n mo.disconnect();\n}\n\nfunction styleParser(node) {\n var style = node.getAttribute('style');\n var val = [];\n\n if (style) {\n val = style.split(';').reduce(function (acc, style) {\n var styles = style.split(':');\n var prop = styles[0];\n var value = styles.slice(1);\n\n if (prop && value.length > 0) {\n acc[prop] = value.join(':').trim();\n }\n\n return acc;\n }, {});\n }\n\n return val;\n}\n\nfunction classParser(node) {\n var existingPrefix = node.getAttribute('data-prefix');\n var existingIconName = node.getAttribute('data-icon');\n var innerText = node.innerText !== undefined ? node.innerText.trim() : '';\n var val = getCanonicalIcon(classArray(node));\n\n if (existingPrefix && existingIconName) {\n val.prefix = existingPrefix;\n val.iconName = existingIconName;\n }\n\n if (val.prefix && innerText.length > 1) {\n val.iconName = byLigature(val.prefix, node.innerText);\n } else if (val.prefix && innerText.length === 1) {\n val.iconName = byUnicode(val.prefix, toHex(node.innerText));\n }\n\n return val;\n}\n\nvar parseTransformString = function parseTransformString(transformString) {\n var transform = {\n size: 16,\n x: 0,\n y: 0,\n flipX: false,\n flipY: false,\n rotate: 0\n };\n\n if (!transformString) {\n return transform;\n } else {\n return transformString.toLowerCase().split(' ').reduce(function (acc, n) {\n var parts = n.toLowerCase().split('-');\n var first = parts[0];\n var rest = parts.slice(1).join('-');\n\n if (first && rest === 'h') {\n acc.flipX = true;\n return acc;\n }\n\n if (first && rest === 'v') {\n acc.flipY = true;\n return acc;\n }\n\n rest = parseFloat(rest);\n\n if (isNaN(rest)) {\n return acc;\n }\n\n switch (first) {\n case 'grow':\n acc.size = acc.size + rest;\n break;\n\n case 'shrink':\n acc.size = acc.size - rest;\n break;\n\n case 'left':\n acc.x = acc.x - rest;\n break;\n\n case 'right':\n acc.x = acc.x + rest;\n break;\n\n case 'up':\n acc.y = acc.y - rest;\n break;\n\n case 'down':\n acc.y = acc.y + rest;\n break;\n\n case 'rotate':\n acc.rotate = acc.rotate + rest;\n break;\n }\n\n return acc;\n }, transform);\n }\n};\n\nfunction transformParser(node) {\n return parseTransformString(node.getAttribute('data-fa-transform'));\n}\n\nfunction symbolParser(node) {\n var symbol = node.getAttribute('data-fa-symbol');\n return symbol === null ? false : symbol === '' ? true : symbol;\n}\n\nfunction attributesParser(node) {\n var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {\n if (acc.name !== 'class' && acc.name !== 'style') {\n acc[attr.name] = attr.value;\n }\n\n return acc;\n }, {});\n var title = node.getAttribute('title');\n var titleId = node.getAttribute('data-fa-title-id');\n\n if (config.autoA11y) {\n if (title) {\n extraAttributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n extraAttributes['aria-hidden'] = 'true';\n extraAttributes['focusable'] = 'false';\n }\n }\n\n return extraAttributes;\n}\n\nfunction maskParser(node) {\n var mask = node.getAttribute('data-fa-mask');\n\n if (!mask) {\n return emptyCanonicalIcon();\n } else {\n return getCanonicalIcon(mask.split(' ').map(function (i) {\n return i.trim();\n }));\n }\n}\n\nfunction blankMeta() {\n return {\n iconName: null,\n title: null,\n titleId: null,\n prefix: null,\n transform: meaninglessTransform,\n symbol: false,\n mask: null,\n maskId: null,\n extra: {\n classes: [],\n styles: {},\n attributes: {}\n }\n };\n}\n\nfunction parseMeta(node) {\n var _classParser = classParser(node),\n iconName = _classParser.iconName,\n prefix = _classParser.prefix,\n extraClasses = _classParser.rest;\n\n var extraStyles = styleParser(node);\n var transform = transformParser(node);\n var symbol = symbolParser(node);\n var extraAttributes = attributesParser(node);\n var mask = maskParser(node);\n return {\n iconName: iconName,\n title: node.getAttribute('title'),\n titleId: node.getAttribute('data-fa-title-id'),\n prefix: prefix,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: node.getAttribute('data-fa-mask-id'),\n extra: {\n classes: extraClasses,\n styles: extraStyles,\n attributes: extraAttributes\n }\n };\n}\n\nfunction MissingIcon(error) {\n this.name = 'MissingIcon';\n this.message = error || 'Icon unavailable';\n this.stack = new Error().stack;\n}\n\nMissingIcon.prototype = Object.create(Error.prototype);\nMissingIcon.prototype.constructor = MissingIcon;\nvar FILL = {\n fill: 'currentColor'\n};\nvar ANIMATION_BASE = {\n attributeType: 'XML',\n repeatCount: 'indefinite',\n dur: '2s'\n};\nvar RING = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'\n })\n};\n\nvar OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'opacity'\n});\n\nvar DOT = {\n tag: 'circle',\n attributes: _objectSpread({}, FILL, {\n cx: '256',\n cy: '364',\n r: '28'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, ANIMATION_BASE, {\n attributeName: 'r',\n values: '28;14;28;28;14;28;'\n })\n }, {\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;1;1;0;1;'\n })\n }]\n};\nvar QUESTION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '1',\n d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '1;0;0;0;0;1;'\n })\n }]\n};\nvar EXCLAMATION = {\n tag: 'path',\n attributes: _objectSpread({}, FILL, {\n opacity: '0',\n d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'\n }),\n children: [{\n tag: 'animate',\n attributes: _objectSpread({}, OPACITY_ANIMATE, {\n values: '0;0;1;1;0;0;'\n })\n }]\n};\nvar missing = {\n tag: 'g',\n children: [RING, DOT, QUESTION, EXCLAMATION]\n};\nvar styles$2 = namespace.styles;\n\nfunction asFoundIcon(icon) {\n var width = icon[0];\n var height = icon[1];\n\n var _icon$slice = icon.slice(4),\n _icon$slice2 = _slicedToArray(_icon$slice, 1),\n vectorData = _icon$slice2[0];\n\n var element = null;\n\n if (Array.isArray(vectorData)) {\n element = {\n tag: 'g',\n attributes: {\n \"class\": \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.GROUP)\n },\n children: [{\n tag: 'path',\n attributes: {\n \"class\": \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.SECONDARY),\n fill: 'currentColor',\n d: vectorData[0]\n }\n }, {\n tag: 'path',\n attributes: {\n \"class\": \"\".concat(config.familyPrefix, \"-\").concat(DUOTONE_CLASSES.PRIMARY),\n fill: 'currentColor',\n d: vectorData[1]\n }\n }]\n };\n } else {\n element = {\n tag: 'path',\n attributes: {\n fill: 'currentColor',\n d: vectorData\n }\n };\n }\n\n return {\n found: true,\n width: width,\n height: height,\n icon: element\n };\n}\n\nfunction findIcon(iconName, prefix) {\n return new picked(function (resolve, reject) {\n var val = {\n found: false,\n width: 512,\n height: 512,\n icon: missing\n };\n\n if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {\n var icon = styles$2[prefix][iconName];\n return resolve(asFoundIcon(icon));\n }\n\n if (iconName && prefix && !config.showMissingIcons) {\n reject(new MissingIcon(\"Icon is missing for prefix \".concat(prefix, \" with icon name \").concat(iconName)));\n } else {\n resolve(val);\n }\n });\n}\n\nvar styles$3 = namespace.styles;\n\nfunction generateSvgReplacementMutation(node, nodeMeta) {\n var iconName = nodeMeta.iconName,\n title = nodeMeta.title,\n titleId = nodeMeta.titleId,\n prefix = nodeMeta.prefix,\n transform = nodeMeta.transform,\n symbol = nodeMeta.symbol,\n mask = nodeMeta.mask,\n maskId = nodeMeta.maskId,\n extra = nodeMeta.extra;\n return new picked(function (resolve, reject) {\n picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n main = _ref2[0],\n mask = _ref2[1];\n\n resolve([node, makeInlineSvgAbstract({\n icons: {\n main: main,\n mask: mask\n },\n prefix: prefix,\n iconName: iconName,\n transform: transform,\n symbol: symbol,\n mask: mask,\n maskId: maskId,\n title: title,\n titleId: titleId,\n extra: extra,\n watchable: true\n })]);\n });\n });\n}\n\nfunction generateLayersText(node, nodeMeta) {\n var title = nodeMeta.title,\n transform = nodeMeta.transform,\n extra = nodeMeta.extra;\n var width = null;\n var height = null;\n\n if (IS_IE) {\n var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);\n var boundingClientRect = node.getBoundingClientRect();\n width = boundingClientRect.width / computedFontSize;\n height = boundingClientRect.height / computedFontSize;\n }\n\n if (config.autoA11y && !title) {\n extra.attributes['aria-hidden'] = 'true';\n }\n\n return picked.resolve([node, makeLayersTextAbstract({\n content: node.innerHTML,\n width: width,\n height: height,\n transform: transform,\n title: title,\n extra: extra,\n watchable: true\n })]);\n}\n\nfunction generateMutation(node) {\n var nodeMeta = parseMeta(node);\n\n if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {\n return generateLayersText(node, nodeMeta);\n } else {\n return generateSvgReplacementMutation(node, nodeMeta);\n }\n}\n\nfunction onTree(root) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (!IS_DOM) return;\n var htmlClassList = DOCUMENT.documentElement.classList;\n\n var hclAdd = function hclAdd(suffix) {\n return htmlClassList.add(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var hclRemove = function hclRemove(suffix) {\n return htmlClassList.remove(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n };\n\n var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);\n var prefixesDomQuery = [\".\".concat(LAYERS_TEXT_CLASSNAME, \":not([\").concat(DATA_FA_I2SVG, \"])\")].concat(prefixes.map(function (p) {\n return \".\".concat(p, \":not([\").concat(DATA_FA_I2SVG, \"])\");\n })).join(', ');\n\n if (prefixesDomQuery.length === 0) {\n return;\n }\n\n var candidates = [];\n\n try {\n candidates = toArray(root.querySelectorAll(prefixesDomQuery));\n } catch (e) {// noop\n }\n\n if (candidates.length > 0) {\n hclAdd('pending');\n hclRemove('complete');\n } else {\n return;\n }\n\n var mark = perf.begin('onTree');\n var mutations = candidates.reduce(function (acc, node) {\n try {\n var mutation = generateMutation(node);\n\n if (mutation) {\n acc.push(mutation);\n }\n } catch (e) {\n if (!PRODUCTION) {\n if (e instanceof MissingIcon) {\n console.error(e);\n }\n }\n }\n\n return acc;\n }, []);\n return new picked(function (resolve, reject) {\n picked.all(mutations).then(function (resolvedMutations) {\n perform(resolvedMutations, function () {\n hclAdd('active');\n hclAdd('complete');\n hclRemove('pending');\n if (typeof callback === 'function') callback();\n mark();\n resolve();\n });\n })[\"catch\"](function () {\n mark();\n reject();\n });\n });\n}\n\nfunction onNode(node) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n generateMutation(node).then(function (mutation) {\n if (mutation) {\n perform([mutation], callback);\n }\n });\n}\n\nfunction replaceForPosition(node, position) {\n var pendingAttribute = \"\".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));\n return new picked(function (resolve, reject) {\n if (node.getAttribute(pendingAttribute) !== null) {\n // This node is already being processed\n return resolve();\n }\n\n var children = toArray(node.children);\n var alreadyProcessedPseudoElement = children.filter(function (c) {\n return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;\n })[0];\n var styles = WINDOW.getComputedStyle(node, position);\n var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);\n var fontWeight = styles.getPropertyValue('font-weight');\n var content = styles.getPropertyValue('content');\n\n if (alreadyProcessedPseudoElement && !fontFamily) {\n // If we've already processed it but the current computed style does not result in a font-family,\n // that probably means that a class name that was previously present to make the icon has been\n // removed. So we now should delete the icon.\n node.removeChild(alreadyProcessedPseudoElement);\n return resolve();\n } else if (fontFamily && content !== 'none' && content !== '') {\n var _content = styles.getPropertyValue('content');\n\n var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];\n var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);\n var iconName = byUnicode(prefix, hexValue);\n var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't\n // already done so with the same prefix and iconName\n\n if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {\n node.setAttribute(pendingAttribute, iconIdentifier);\n\n if (alreadyProcessedPseudoElement) {\n // Delete the old one, since we're replacing it with a new one\n node.removeChild(alreadyProcessedPseudoElement);\n }\n\n var meta = blankMeta();\n var extra = meta.extra;\n extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;\n findIcon(iconName, prefix).then(function (main) {\n var _abstract5 = makeInlineSvgAbstract(_objectSpread({}, meta, {\n icons: {\n main: main,\n mask: emptyCanonicalIcon()\n },\n prefix: prefix,\n iconName: iconIdentifier,\n extra: extra,\n watchable: true\n }));\n\n var element = DOCUMENT.createElement('svg');\n\n if (position === ':before') {\n node.insertBefore(element, node.firstChild);\n } else {\n node.appendChild(element);\n }\n\n element.outerHTML = _abstract5.map(function (a) {\n return toHtml(a);\n }).join('\\n');\n node.removeAttribute(pendingAttribute);\n resolve();\n })[\"catch\"](reject);\n } else {\n resolve();\n }\n } else {\n resolve();\n }\n });\n}\n\nfunction replace(node) {\n return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);\n}\n\nfunction processable(node) {\n return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');\n}\n\nfunction searchPseudoElements(root) {\n if (!IS_DOM) return;\n return new picked(function (resolve, reject) {\n var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);\n var end = perf.begin('searchPseudoElements');\n disableObservation();\n picked.all(operations).then(function () {\n end();\n enableObservation();\n resolve();\n })[\"catch\"](function () {\n end();\n enableObservation();\n reject();\n });\n });\n}\n\nvar baseStyles = \"svg:not(:root).svg-inline--fa {\\n overflow: visible;\\n}\\n\\n.svg-inline--fa {\\n display: inline-block;\\n font-size: inherit;\\n height: 1em;\\n overflow: visible;\\n vertical-align: -0.125em;\\n}\\n.svg-inline--fa.fa-lg {\\n vertical-align: -0.225em;\\n}\\n.svg-inline--fa.fa-w-1 {\\n width: 0.0625em;\\n}\\n.svg-inline--fa.fa-w-2 {\\n width: 0.125em;\\n}\\n.svg-inline--fa.fa-w-3 {\\n width: 0.1875em;\\n}\\n.svg-inline--fa.fa-w-4 {\\n width: 0.25em;\\n}\\n.svg-inline--fa.fa-w-5 {\\n width: 0.3125em;\\n}\\n.svg-inline--fa.fa-w-6 {\\n width: 0.375em;\\n}\\n.svg-inline--fa.fa-w-7 {\\n width: 0.4375em;\\n}\\n.svg-inline--fa.fa-w-8 {\\n width: 0.5em;\\n}\\n.svg-inline--fa.fa-w-9 {\\n width: 0.5625em;\\n}\\n.svg-inline--fa.fa-w-10 {\\n width: 0.625em;\\n}\\n.svg-inline--fa.fa-w-11 {\\n width: 0.6875em;\\n}\\n.svg-inline--fa.fa-w-12 {\\n width: 0.75em;\\n}\\n.svg-inline--fa.fa-w-13 {\\n width: 0.8125em;\\n}\\n.svg-inline--fa.fa-w-14 {\\n width: 0.875em;\\n}\\n.svg-inline--fa.fa-w-15 {\\n width: 0.9375em;\\n}\\n.svg-inline--fa.fa-w-16 {\\n width: 1em;\\n}\\n.svg-inline--fa.fa-w-17 {\\n width: 1.0625em;\\n}\\n.svg-inline--fa.fa-w-18 {\\n width: 1.125em;\\n}\\n.svg-inline--fa.fa-w-19 {\\n width: 1.1875em;\\n}\\n.svg-inline--fa.fa-w-20 {\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-pull-left {\\n margin-right: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-pull-right {\\n margin-left: 0.3em;\\n width: auto;\\n}\\n.svg-inline--fa.fa-border {\\n height: 1.5em;\\n}\\n.svg-inline--fa.fa-li {\\n width: 2em;\\n}\\n.svg-inline--fa.fa-fw {\\n width: 1.25em;\\n}\\n\\n.fa-layers svg.svg-inline--fa {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.fa-layers {\\n display: inline-block;\\n height: 1em;\\n position: relative;\\n text-align: center;\\n vertical-align: -0.125em;\\n width: 1em;\\n}\\n.fa-layers svg.svg-inline--fa {\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter, .fa-layers-text {\\n display: inline-block;\\n position: absolute;\\n text-align: center;\\n}\\n\\n.fa-layers-text {\\n left: 50%;\\n top: 50%;\\n -webkit-transform: translate(-50%, -50%);\\n transform: translate(-50%, -50%);\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n}\\n\\n.fa-layers-counter {\\n background-color: #ff253a;\\n border-radius: 1em;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n color: #fff;\\n height: 1.5em;\\n line-height: 1;\\n max-width: 5em;\\n min-width: 1.5em;\\n overflow: hidden;\\n padding: 0.25em;\\n right: 0;\\n text-overflow: ellipsis;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-bottom-right {\\n bottom: 0;\\n right: 0;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom right;\\n transform-origin: bottom right;\\n}\\n\\n.fa-layers-bottom-left {\\n bottom: 0;\\n left: 0;\\n right: auto;\\n top: auto;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: bottom left;\\n transform-origin: bottom left;\\n}\\n\\n.fa-layers-top-right {\\n right: 0;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top right;\\n transform-origin: top right;\\n}\\n\\n.fa-layers-top-left {\\n left: 0;\\n right: auto;\\n top: 0;\\n -webkit-transform: scale(0.25);\\n transform: scale(0.25);\\n -webkit-transform-origin: top left;\\n transform-origin: top left;\\n}\\n\\n.fa-lg {\\n font-size: 1.3333333333em;\\n line-height: 0.75em;\\n vertical-align: -0.0667em;\\n}\\n\\n.fa-xs {\\n font-size: 0.75em;\\n}\\n\\n.fa-sm {\\n font-size: 0.875em;\\n}\\n\\n.fa-1x {\\n font-size: 1em;\\n}\\n\\n.fa-2x {\\n font-size: 2em;\\n}\\n\\n.fa-3x {\\n font-size: 3em;\\n}\\n\\n.fa-4x {\\n font-size: 4em;\\n}\\n\\n.fa-5x {\\n font-size: 5em;\\n}\\n\\n.fa-6x {\\n font-size: 6em;\\n}\\n\\n.fa-7x {\\n font-size: 7em;\\n}\\n\\n.fa-8x {\\n font-size: 8em;\\n}\\n\\n.fa-9x {\\n font-size: 9em;\\n}\\n\\n.fa-10x {\\n font-size: 10em;\\n}\\n\\n.fa-fw {\\n text-align: center;\\n width: 1.25em;\\n}\\n\\n.fa-ul {\\n list-style-type: none;\\n margin-left: 2.5em;\\n padding-left: 0;\\n}\\n.fa-ul > li {\\n position: relative;\\n}\\n\\n.fa-li {\\n left: -2em;\\n position: absolute;\\n text-align: center;\\n width: 2em;\\n line-height: inherit;\\n}\\n\\n.fa-border {\\n border: solid 0.08em #eee;\\n border-radius: 0.1em;\\n padding: 0.2em 0.25em 0.15em;\\n}\\n\\n.fa-pull-left {\\n float: left;\\n}\\n\\n.fa-pull-right {\\n float: right;\\n}\\n\\n.fa.fa-pull-left,\\n.fas.fa-pull-left,\\n.far.fa-pull-left,\\n.fal.fa-pull-left,\\n.fab.fa-pull-left {\\n margin-right: 0.3em;\\n}\\n.fa.fa-pull-right,\\n.fas.fa-pull-right,\\n.far.fa-pull-right,\\n.fal.fa-pull-right,\\n.fab.fa-pull-right {\\n margin-left: 0.3em;\\n}\\n\\n.fa-spin {\\n -webkit-animation: fa-spin 2s infinite linear;\\n animation: fa-spin 2s infinite linear;\\n}\\n\\n.fa-pulse {\\n -webkit-animation: fa-spin 1s infinite steps(8);\\n animation: fa-spin 1s infinite steps(8);\\n}\\n\\n@-webkit-keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes fa-spin {\\n 0% {\\n -webkit-transform: rotate(0deg);\\n transform: rotate(0deg);\\n }\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n.fa-rotate-90 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\\\";\\n -webkit-transform: rotate(90deg);\\n transform: rotate(90deg);\\n}\\n\\n.fa-rotate-180 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\\\";\\n -webkit-transform: rotate(180deg);\\n transform: rotate(180deg);\\n}\\n\\n.fa-rotate-270 {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\\\";\\n -webkit-transform: rotate(270deg);\\n transform: rotate(270deg);\\n}\\n\\n.fa-flip-horizontal {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\\\";\\n -webkit-transform: scale(-1, 1);\\n transform: scale(-1, 1);\\n}\\n\\n.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(1, -1);\\n transform: scale(1, -1);\\n}\\n\\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\\n -ms-filter: \\\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\\\";\\n -webkit-transform: scale(-1, -1);\\n transform: scale(-1, -1);\\n}\\n\\n:root .fa-rotate-90,\\n:root .fa-rotate-180,\\n:root .fa-rotate-270,\\n:root .fa-flip-horizontal,\\n:root .fa-flip-vertical,\\n:root .fa-flip-both {\\n -webkit-filter: none;\\n filter: none;\\n}\\n\\n.fa-stack {\\n display: inline-block;\\n height: 2em;\\n position: relative;\\n width: 2.5em;\\n}\\n\\n.fa-stack-1x,\\n.fa-stack-2x {\\n bottom: 0;\\n left: 0;\\n margin: auto;\\n position: absolute;\\n right: 0;\\n top: 0;\\n}\\n\\n.svg-inline--fa.fa-stack-1x {\\n height: 1em;\\n width: 1.25em;\\n}\\n.svg-inline--fa.fa-stack-2x {\\n height: 2em;\\n width: 2.5em;\\n}\\n\\n.fa-inverse {\\n color: #fff;\\n}\\n\\n.sr-only {\\n border: 0;\\n clip: rect(0, 0, 0, 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.sr-only-focusable:active, .sr-only-focusable:focus {\\n clip: auto;\\n height: auto;\\n margin: 0;\\n overflow: visible;\\n position: static;\\n width: auto;\\n}\\n\\n.svg-inline--fa .fa-primary {\\n fill: var(--fa-primary-color, currentColor);\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa .fa-secondary {\\n fill: var(--fa-secondary-color, currentColor);\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-primary {\\n opacity: 0.4;\\n opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\\n opacity: 1;\\n opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa mask .fa-primary,\\n.svg-inline--fa mask .fa-secondary {\\n fill: black;\\n}\\n\\n.fad.fa-inverse {\\n color: #fff;\\n}\";\n\nfunction css() {\n var dfp = DEFAULT_FAMILY_PREFIX;\n var drc = DEFAULT_REPLACEMENT_CLASS;\n var fp = config.familyPrefix;\n var rc = config.replacementClass;\n var s = baseStyles;\n\n if (fp !== dfp || rc !== drc) {\n var dPatt = new RegExp(\"\\\\.\".concat(dfp, \"\\\\-\"), 'g');\n var customPropPatt = new RegExp(\"\\\\--\".concat(dfp, \"\\\\-\"), 'g');\n var rPatt = new RegExp(\"\\\\.\".concat(drc), 'g');\n s = s.replace(dPatt, \".\".concat(fp, \"-\")).replace(customPropPatt, \"--\".concat(fp, \"-\")).replace(rPatt, \".\".concat(rc));\n }\n\n return s;\n}\n\nvar Library = /*#__PURE__*/function () {\n function Library() {\n _classCallCheck(this, Library);\n\n this.definitions = {};\n }\n\n _createClass(Library, [{\n key: \"add\",\n value: function add() {\n var _this = this;\n\n for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {\n definitions[_key] = arguments[_key];\n }\n\n var additions = definitions.reduce(this._pullDefinitions, {});\n Object.keys(additions).forEach(function (key) {\n _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);\n defineIcons(key, additions[key]);\n build();\n });\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.definitions = {};\n }\n }, {\n key: \"_pullDefinitions\",\n value: function _pullDefinitions(additions, definition) {\n var normalized = definition.prefix && definition.iconName && definition.icon ? {\n 0: definition\n } : definition;\n Object.keys(normalized).map(function (key) {\n var _normalized$key = normalized[key],\n prefix = _normalized$key.prefix,\n iconName = _normalized$key.iconName,\n icon = _normalized$key.icon;\n if (!additions[prefix]) additions[prefix] = {};\n additions[prefix][iconName] = icon;\n });\n return additions;\n }\n }]);\n\n return Library;\n}();\n\nfunction ensureCss() {\n if (config.autoAddCss && !_cssInserted) {\n insertCss(css());\n _cssInserted = true;\n }\n}\n\nfunction apiObject(val, abstractCreator) {\n Object.defineProperty(val, 'abstract', {\n get: abstractCreator\n });\n Object.defineProperty(val, 'html', {\n get: function get() {\n return val[\"abstract\"].map(function (a) {\n return toHtml(a);\n });\n }\n });\n Object.defineProperty(val, 'node', {\n get: function get() {\n if (!IS_DOM) return;\n var container = DOCUMENT.createElement('div');\n container.innerHTML = val.html;\n return container.children;\n }\n });\n return val;\n}\n\nfunction findIconDefinition(iconLookup) {\n var _iconLookup$prefix = iconLookup.prefix,\n prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,\n iconName = iconLookup.iconName;\n if (!iconName) return;\n return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);\n}\n\nfunction resolveIcons(next) {\n return function (maybeIconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});\n var mask = params.mask;\n\n if (mask) {\n mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});\n }\n\n return next(iconDefinition, _objectSpread({}, params, {\n mask: mask\n }));\n };\n}\n\nvar library = new Library();\n\nvar noAuto = function noAuto() {\n config.autoReplaceSvg = false;\n config.observeMutations = false;\n disconnect();\n};\n\nvar _cssInserted = false;\nvar dom = {\n i2svg: function i2svg() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (IS_DOM) {\n ensureCss();\n var _params$node = params.node,\n node = _params$node === void 0 ? DOCUMENT : _params$node,\n _params$callback = params.callback,\n callback = _params$callback === void 0 ? function () {} : _params$callback;\n\n if (config.searchPseudoElements) {\n searchPseudoElements(node);\n }\n\n return onTree(node, callback);\n } else {\n return picked.reject('Operation requires a DOM of some kind.');\n }\n },\n css: css,\n insertCss: function insertCss$$1() {\n if (!_cssInserted) {\n insertCss(css());\n _cssInserted = true;\n }\n },\n watch: function watch() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var autoReplaceSvgRoot = params.autoReplaceSvgRoot,\n observeMutationsRoot = params.observeMutationsRoot;\n\n if (config.autoReplaceSvg === false) {\n config.autoReplaceSvg = true;\n }\n\n config.observeMutations = true;\n domready(function () {\n autoReplace({\n autoReplaceSvgRoot: autoReplaceSvgRoot\n });\n observe({\n treeCallback: onTree,\n nodeCallback: onNode,\n pseudoElementsCallback: searchPseudoElements,\n observeMutationsRoot: observeMutationsRoot\n });\n });\n }\n};\nvar parse = {\n transform: function transform(transformString) {\n return parseTransformString(transformString);\n }\n};\nvar icon = resolveIcons(function (iconDefinition) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform = params.transform,\n transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,\n _params$symbol = params.symbol,\n symbol = _params$symbol === void 0 ? false : _params$symbol,\n _params$mask = params.mask,\n mask = _params$mask === void 0 ? null : _params$mask,\n _params$maskId = params.maskId,\n maskId = _params$maskId === void 0 ? null : _params$maskId,\n _params$title = params.title,\n title = _params$title === void 0 ? null : _params$title,\n _params$titleId = params.titleId,\n titleId = _params$titleId === void 0 ? null : _params$titleId,\n _params$classes = params.classes,\n classes = _params$classes === void 0 ? [] : _params$classes,\n _params$attributes = params.attributes,\n attributes = _params$attributes === void 0 ? {} : _params$attributes,\n _params$styles = params.styles,\n styles = _params$styles === void 0 ? {} : _params$styles;\n if (!iconDefinition) return;\n var prefix = iconDefinition.prefix,\n iconName = iconDefinition.iconName,\n icon = iconDefinition.icon;\n return apiObject(_objectSpread({\n type: 'icon'\n }, iconDefinition), function () {\n ensureCss();\n\n if (config.autoA11y) {\n if (title) {\n attributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n } else {\n attributes['aria-hidden'] = 'true';\n attributes['focusable'] = 'false';\n }\n }\n\n return makeInlineSvgAbstract({\n icons: {\n main: asFoundIcon(icon),\n mask: mask ? asFoundIcon(mask.icon) : {\n found: false,\n width: null,\n height: null,\n icon: {}\n }\n },\n prefix: prefix,\n iconName: iconName,\n transform: _objectSpread({}, meaninglessTransform, transform),\n symbol: symbol,\n title: title,\n maskId: maskId,\n titleId: titleId,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: classes\n }\n });\n });\n});\n\nvar text = function text(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$transform2 = params.transform,\n transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,\n _params$title2 = params.title,\n title = _params$title2 === void 0 ? null : _params$title2,\n _params$classes2 = params.classes,\n classes = _params$classes2 === void 0 ? [] : _params$classes2,\n _params$attributes2 = params.attributes,\n attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,\n _params$styles2 = params.styles,\n styles = _params$styles2 === void 0 ? {} : _params$styles2;\n return apiObject({\n type: 'text',\n content: content\n }, function () {\n ensureCss();\n return makeLayersTextAbstract({\n content: content,\n transform: _objectSpread({}, meaninglessTransform, transform),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-text\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\n\nvar counter = function counter(content) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$title3 = params.title,\n title = _params$title3 === void 0 ? null : _params$title3,\n _params$classes3 = params.classes,\n classes = _params$classes3 === void 0 ? [] : _params$classes3,\n _params$attributes3 = params.attributes,\n attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,\n _params$styles3 = params.styles,\n styles = _params$styles3 === void 0 ? {} : _params$styles3;\n return apiObject({\n type: 'counter',\n content: content\n }, function () {\n ensureCss();\n return makeLayersCounterAbstract({\n content: content.toString(),\n title: title,\n extra: {\n attributes: attributes,\n styles: styles,\n classes: [\"\".concat(config.familyPrefix, \"-layers-counter\")].concat(_toConsumableArray(classes))\n }\n });\n });\n};\n\nvar layer = function layer(assembler) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _params$classes4 = params.classes,\n classes = _params$classes4 === void 0 ? [] : _params$classes4;\n return apiObject({\n type: 'layer'\n }, function () {\n ensureCss();\n var children = [];\n assembler(function (args) {\n Array.isArray(args) ? args.map(function (a) {\n children = children.concat(a[\"abstract\"]);\n }) : children = children.concat(args[\"abstract\"]);\n });\n return [{\n tag: 'span',\n attributes: {\n \"class\": [\"\".concat(config.familyPrefix, \"-layers\")].concat(_toConsumableArray(classes)).join(' ')\n },\n children: children\n }];\n });\n};\n\nvar api = {\n noAuto: noAuto,\n config: config,\n dom: dom,\n library: library,\n parse: parse,\n findIconDefinition: findIconDefinition,\n icon: icon,\n text: text,\n counter: counter,\n layer: layer,\n toHtml: toHtml\n};\n\nvar autoReplace = function autoReplace() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _params$autoReplaceSv = params.autoReplaceSvgRoot,\n autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;\n if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({\n node: autoReplaceSvgRoot\n });\n};\n\nexport { icon, noAuto, config, toHtml, layer, text, counter, library, dom, parse, findIconDefinition };","\"use strict\";\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createHorizontalStrength = createHorizontalStrength;\nexports.createVerticalStrength = createVerticalStrength;\nexports.createScrollingComponent = createScrollingComponent;\nexports[\"default\"] = createScrollingComponentWithConsumer;\nexports.defaultVerticalStrength = exports.defaultHorizontalStrength = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _lodash = _interopRequireDefault(require(\"lodash.throttle\"));\n\nvar _raf = _interopRequireDefault(require(\"raf\"));\n\nvar _reactDisplayName = _interopRequireDefault(require(\"react-display-name\"));\n\nvar _reactDnd = require(\"react-dnd\");\n\nvar _hoistNonReactStatics = _interopRequireDefault(require(\"hoist-non-react-statics\"));\n\nvar _util = require(\"./util\");\n\nvar _excluded = [\"strengthMultiplier\", \"verticalStrength\", \"horizontalStrength\", \"onScrollChange\"];\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\n\nfunction _interopRequireWildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar DEFAULT_BUFFER = 150;\n\nfunction createHorizontalStrength(_buffer) {\n return function defaultHorizontalStrength(_ref, point) {\n var x = _ref.x,\n w = _ref.w,\n y = _ref.y,\n h = _ref.h;\n var buffer = Math.min(w / 2, _buffer);\n var inRange = point.x >= x && point.x <= x + w;\n var inBox = inRange && point.y >= y && point.y <= y + h;\n\n if (inBox) {\n if (point.x < x + buffer) {\n return (point.x - x - buffer) / buffer;\n }\n\n if (point.x > x + w - buffer) {\n return -(x + w - point.x - buffer) / buffer;\n }\n }\n\n return 0;\n };\n}\n\nfunction createVerticalStrength(_buffer) {\n return function defaultVerticalStrength(_ref2, point) {\n var y = _ref2.y,\n h = _ref2.h,\n x = _ref2.x,\n w = _ref2.w;\n var buffer = Math.min(h / 2, _buffer);\n var inRange = point.y >= y && point.y <= y + h;\n var inBox = inRange && point.x >= x && point.x <= x + w;\n\n if (inBox) {\n if (point.y < y + buffer) {\n return (point.y - y - buffer) / buffer;\n }\n\n if (point.y > y + h - buffer) {\n return -(y + h - point.y - buffer) / buffer;\n }\n }\n\n return 0;\n };\n}\n\nvar defaultHorizontalStrength = createHorizontalStrength(DEFAULT_BUFFER);\nexports.defaultHorizontalStrength = defaultHorizontalStrength;\nvar defaultVerticalStrength = createVerticalStrength(DEFAULT_BUFFER);\nexports.defaultVerticalStrength = defaultVerticalStrength;\n\nfunction createScrollingComponent(WrappedComponent) {\n var ScrollingComponent = /*#__PURE__*/function (_Component) {\n _inherits(ScrollingComponent, _Component);\n\n var _super = _createSuper(ScrollingComponent); // Update scaleX and scaleY every 100ms or so\n // and start scrolling if necessary\n // eslint-disable-next-line react/static-property-placement\n // eslint-disable-next-line react/static-property-placement\n // eslint-disable-next-line react/static-property-placement\n\n\n function ScrollingComponent(props, ctx) {\n var _this;\n\n _classCallCheck(this, ScrollingComponent);\n\n _this = _super.call(this, props, ctx);\n\n _defineProperty(_assertThisInitialized(_this), \"updateScrolling\", (0, _lodash[\"default\"])(function (evt) {\n var _this$container$getBo = _this.container.getBoundingClientRect(),\n x = _this$container$getBo.left,\n y = _this$container$getBo.top,\n w = _this$container$getBo.width,\n h = _this$container$getBo.height;\n\n var box = {\n x: x,\n y: y,\n w: w,\n h: h\n };\n var coords = (0, _util.getCoords)(evt); // calculate strength\n\n var _this$props = _this.props,\n horizontalStrength = _this$props.horizontalStrength,\n verticalStrength = _this$props.verticalStrength;\n _this.scaleX = horizontalStrength(box, coords);\n _this.scaleY = verticalStrength(box, coords); // start scrolling if we need to\n\n if (!_this.frame && (_this.scaleX || _this.scaleY)) {\n _this.startScrolling();\n }\n }, 100, {\n trailing: false\n }));\n\n _defineProperty(_assertThisInitialized(_this), \"handleEvent\", function (evt) {\n if (_this.dragging && !_this.attached) {\n _this.attach();\n\n _this.updateScrolling(evt);\n }\n });\n\n _this.wrappedInstance = /*#__PURE__*/_react[\"default\"].createRef();\n _this.scaleX = 0;\n _this.scaleY = 0;\n _this.frame = null;\n _this.attached = false;\n _this.dragging = false;\n return _this;\n }\n\n _createClass(ScrollingComponent, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this; // eslint-disable-next-line react/no-find-dom-node\n\n\n this.container = this.wrappedInstance.current;\n\n if (this.container && typeof this.container.addEventListener === 'function') {\n this.container.addEventListener('dragover', this.handleEvent);\n } // touchmove events don't seem to work across siblings, so we unfortunately\n // have to attach the listeners to the body\n\n\n window.document.body.addEventListener('touchmove', this.handleEvent);\n var dragDropManager = this.props.dragDropManager;\n this.clearMonitorSubscription = dragDropManager.getMonitor().subscribeToStateChange(function () {\n return _this2.handleMonitorChange();\n });\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.container && typeof this.container.removeEventListener === 'function') {\n this.container.removeEventListener('dragover', this.handleEvent);\n }\n\n window.document.body.removeEventListener('touchmove', this.handleEvent);\n this.clearMonitorSubscription();\n this.stopScrolling();\n }\n }, {\n key: \"handleMonitorChange\",\n value: function handleMonitorChange() {\n var dragDropManager = this.props.dragDropManager;\n var isDragging = dragDropManager.getMonitor().isDragging();\n\n if (!this.dragging && isDragging) {\n this.dragging = true;\n } else if (this.dragging && !isDragging) {\n this.dragging = false;\n this.stopScrolling();\n }\n }\n }, {\n key: \"attach\",\n value: function attach() {\n this.attached = true;\n window.document.body.addEventListener('dragover', this.updateScrolling);\n window.document.body.addEventListener('touchmove', this.updateScrolling);\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.attached = false;\n window.document.body.removeEventListener('dragover', this.updateScrolling);\n window.document.body.removeEventListener('touchmove', this.updateScrolling);\n }\n }, {\n key: \"startScrolling\",\n value: function startScrolling() {\n var _this3 = this;\n\n var i = 0;\n\n var tick = function tick() {\n var scaleX = _this3.scaleX,\n scaleY = _this3.scaleY,\n container = _this3.container;\n var _this3$props = _this3.props,\n strengthMultiplier = _this3$props.strengthMultiplier,\n onScrollChange = _this3$props.onScrollChange; // stop scrolling if there's nothing to do\n\n if (strengthMultiplier === 0 || scaleX + scaleY === 0) {\n _this3.stopScrolling();\n\n return;\n } // there's a bug in safari where it seems like we can't get\n // mousemove events from a container that also emits a scroll\n // event that same frame. So we double the strengthMultiplier and only adjust\n // the scroll position at 30fps\n\n\n i += 1;\n\n if (i % 2) {\n var scrollLeft = container.scrollLeft,\n scrollTop = container.scrollTop,\n scrollWidth = container.scrollWidth,\n scrollHeight = container.scrollHeight,\n clientWidth = container.clientWidth,\n clientHeight = container.clientHeight;\n var newLeft = scaleX ? container.scrollLeft = (0, _util.intBetween)(0, scrollWidth - clientWidth, scrollLeft + scaleX * strengthMultiplier) : scrollLeft;\n var newTop = scaleY ? container.scrollTop = (0, _util.intBetween)(0, scrollHeight - clientHeight, scrollTop + scaleY * strengthMultiplier) : scrollTop;\n onScrollChange(newLeft, newTop);\n }\n\n _this3.frame = (0, _raf[\"default\"])(tick);\n };\n\n tick();\n }\n }, {\n key: \"stopScrolling\",\n value: function stopScrolling() {\n this.detach();\n this.scaleX = 0;\n this.scaleY = 0;\n\n if (this.frame) {\n _raf[\"default\"].cancel(this.frame);\n\n this.frame = null;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n strengthMultiplier = _this$props2.strengthMultiplier,\n verticalStrength = _this$props2.verticalStrength,\n horizontalStrength = _this$props2.horizontalStrength,\n onScrollChange = _this$props2.onScrollChange,\n props = _objectWithoutProperties(_this$props2, _excluded);\n\n return /*#__PURE__*/_react[\"default\"].createElement(WrappedComponent, _extends({\n ref: this.wrappedInstance // eslint-disable-next-line react/jsx-props-no-spreading\n\n }, props));\n }\n }]);\n\n return ScrollingComponent;\n }(_react.Component);\n\n _defineProperty(ScrollingComponent, \"displayName\", \"Scrolling(\".concat((0, _reactDisplayName[\"default\"])(WrappedComponent), \")\"));\n\n _defineProperty(ScrollingComponent, \"propTypes\", {\n // eslint-disable-next-line react/forbid-prop-types\n dragDropManager: _propTypes[\"default\"].object.isRequired,\n onScrollChange: _propTypes[\"default\"].func,\n verticalStrength: _propTypes[\"default\"].func,\n horizontalStrength: _propTypes[\"default\"].func,\n strengthMultiplier: _propTypes[\"default\"].number\n });\n\n _defineProperty(ScrollingComponent, \"defaultProps\", {\n onScrollChange: _util.noop,\n verticalStrength: defaultVerticalStrength,\n horizontalStrength: defaultHorizontalStrength,\n strengthMultiplier: 30\n });\n\n return (0, _hoistNonReactStatics[\"default\"])(ScrollingComponent, WrappedComponent);\n}\n\nfunction createScrollingComponentWithConsumer(WrappedComponent) {\n var ScrollingComponent = createScrollingComponent(WrappedComponent);\n return function (props) {\n return /*#__PURE__*/_react[\"default\"].createElement(_reactDnd.DndContext.Consumer, null, function (_ref3) {\n var dragDropManager = _ref3.dragDropManager;\n return dragDropManager === undefined ? null // eslint-disable-next-line react/jsx-props-no-spreading\n : /*#__PURE__*/_react[\"default\"].createElement(ScrollingComponent, _extends({}, props, {\n dragDropManager: dragDropManager\n }));\n });\n };\n}","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.21.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar TypeError = global.TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw TypeError(tryToString(argument) + ' is not iterable');\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineProperty = require('../internals/object-define-property').f;\nvar defineIterator = require('../internals/define-iterator');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n","var global = require('../internals/global');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nvar TypeError = global.TypeError;\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aCallable(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar FunctionName = require('../internals/function-name');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefineAll = require('../internals/redefine-all');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar arrayFill = require('../internals/array-fill');\nvar arraySlice = require('../internals/array-slice-simple');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];\nvar $DataView = global[DATA_VIEW];\nvar DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar Array = global.Array;\nvar RangeError = global.RangeError;\nvar fill = uncurryThis(arrayFill);\nvar reverse = uncurryThis([].reverse);\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key) {\n defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = arraySlice(bytes, start, start + count);\n return isLittleEndian ? pack : reverse(pack);\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = conversion(+value);\n for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n var byteLength = toIndex(length);\n setInternalState(this, {\n bytes: fill(Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) this.byteLength = byteLength;\n };\n\n ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, DataViewPrototype);\n anInstance(buffer, ArrayBufferPrototype);\n var bufferLength = getInternalState(buffer).byteLength;\n var offset = toIntegerOrInfinity(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n DataViewPrototype = $DataView[PROTOTYPE];\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength');\n addGetter($DataView, 'buffer');\n addGetter($DataView, 'byteLength');\n addGetter($DataView, 'byteOffset');\n }\n\n redefineAll(DataViewPrototype, {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);\n }\n });\n} else {\n var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;\n /* eslint-disable no-new -- required for testing */\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1);\n }) || fails(function () {\n new NativeArrayBuffer();\n new NativeArrayBuffer(1.5);\n new NativeArrayBuffer(NaN);\n return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;\n })) {\n /* eslint-enable no-new -- required for testing */\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n return new NativeArrayBuffer(toIndex(length));\n };\n\n $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;\n\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf(DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = uncurryThis(DataViewPrototype.setInt8);\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll(DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isForced = require('../internals/is-forced');\nvar redefine = require('../internals/redefine');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var Constructor = NativeConstructor;\n var exported = {};\n\n var fixMethod = function (KEY) {\n var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);\n redefine(NativePrototype, KEY,\n KEY == 'add' ? function add(value) {\n uncurriedNativeMethod(this, value === 0 ? 0 : value);\n return this;\n } : KEY == 'delete' ? function (key) {\n return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : KEY == 'get' ? function get(key) {\n return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : KEY == 'has' ? function has(key) {\n return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);\n } : function set(key, value) {\n uncurriedNativeMethod(this, key === 0 ? 0 : key, value);\n return this;\n }\n );\n };\n\n var REPLACE = isForced(\n CONSTRUCTOR_NAME,\n !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {\n new NativeConstructor().entries().next();\n }))\n );\n\n if (REPLACE) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.enable();\n } else if (isForced(CONSTRUCTOR_NAME, true)) {\n var instance = new Constructor();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n // eslint-disable-next-line no-new -- required for testing\n var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new NativeConstructor();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n\n if (!ACCEPT_ITERABLES) {\n Constructor = wrapper(function (dummy, iterable) {\n anInstance(dummy, NativePrototype);\n var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);\n if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n return that;\n });\n Constructor.prototype = NativePrototype;\n NativePrototype.constructor = Constructor;\n }\n\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n\n // weak collections should not contains .clear method\n if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;\n }\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: Constructor != NativeConstructor }, exported);\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","var fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible');\n\n// eslint-disable-next-line es/no-object-isextensible -- safe\nvar $isExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });\n\n// `Object.isExtensible` method\n// https://tc39.es/ecma262/#sec-object.isextensible\nmodule.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {\n if (!isObject(it)) return false;\n if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;\n return $isExtensible ? $isExtensible(it) : true;\n} : $isExtensible;\n","var isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","// eslint-disable-next-line es/no-math-expm1 -- safe\nvar $expm1 = Math.expm1;\nvar exp = Math.exp;\n\n// `Math.expm1` method implementation\n// https://tc39.es/ecma262/#sec-math.expm1\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;\n} : $expm1;\n","// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\n// Forced replacement object prototype accessors methods\nmodule.exports = IS_PURE || !fails(function () {\n // This feature detection crashes old WebKit\n // https://github.com/zloirock/core-js/issues/232\n if (WEBKIT && WEBKIT < 535) return;\n var key = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call -- required for testing\n __defineSetter__.call(null, key, function () { /* empty */ });\n delete global[key];\n});\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\nvar nativeExec = RegExp.prototype.exec;\nvar patchedExec = nativeExec;\nvar charAt = uncurryThis(''.charAt);\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n call(nativeExec, re1, 'a');\n call(nativeExec, re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = call(patchedExec, raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = call(regexpFlags, re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = replace(flags, 'y', '');\n if (indexOf(flags, 'g') === -1) {\n flags += 'g';\n }\n\n strCopy = stringSlice(str, re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = call(nativeExec, sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = stringSlice(match.input, charsAdded);\n match[0] = stringSlice(match[0], charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n call(nativeReplace, match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar redefine = require('../internals/redefine');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () { execCalled = true; return null; };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var uncurriedNativeMethod = uncurryThis(nativeMethod);\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };\n }\n return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n redefine(String.prototype, KEY, methods[0]);\n redefine(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar regexpExec = require('../internals/regexp-exec');\n\nvar TypeError = global.TypeError;\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (isCallable(exec)) {\n var result = call(exec, R, S);\n if (result !== null) anObject(result);\n return result;\n }\n if (classof(R) === 'RegExp') return call(regexpExec, R, S);\n throw TypeError('RegExp#exec called on incompatible receiver');\n};\n","var ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\n\n// a part of `TypedArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#typedarray-species-create\nmodule.exports = function (originalArray) {\n return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));\n};\n","'use strict';\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\n\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\nmodule.exports = Cancel;","'use strict';\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nmodule.exports = function hasSymbols() {\n if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {\n return false;\n }\n\n if (_typeof(Symbol.iterator) === 'symbol') {\n return true;\n }\n\n var obj = {};\n var sym = Symbol('test');\n var symObj = Object(sym);\n\n if (typeof sym === 'string') {\n return false;\n }\n\n if (Object.prototype.toString.call(sym) !== '[object Symbol]') {\n return false;\n }\n\n if (Object.prototype.toString.call(symObj) !== '[object Symbol]') {\n return false;\n } // temp disabled per https://github.com/ljharb/object.assign/issues/17\n // if (sym instanceof Symbol) { return false; }\n // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n // if (!(symObj instanceof Symbol)) { return false; }\n // if (typeof Symbol.prototype.toString !== 'function') { return false; }\n // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\n var symVal = 42;\n obj[sym] = symVal;\n\n for (sym in obj) {\n return false;\n } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\n\n if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {\n return false;\n }\n\n if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) {\n return false;\n }\n\n var syms = Object.getOwnPropertySymbols(obj);\n\n if (syms.length !== 1 || syms[0] !== sym) {\n return false;\n }\n\n if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {\n return false;\n }\n\n if (typeof Object.getOwnPropertyDescriptor === 'function') {\n var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\n if (descriptor.value !== symVal || descriptor.enumerable !== true) {\n return false;\n }\n }\n\n return true;\n};","'use strict';\n\nvar bind = require('function-bind');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n try {\n $defineProperty({}, 'a', {\n value: 1\n });\n } catch (e) {\n // IE 8 has a broken defineProperty\n $defineProperty = null;\n }\n}\n\nmodule.exports = function callBind(originalFunction) {\n var func = $reflectApply(bind, $call, arguments);\n\n if ($gOPD && $defineProperty) {\n var desc = $gOPD(func, 'length');\n\n if (desc.configurable) {\n // original length, plus the receiver, minus any additional arguments (after the receiver)\n $defineProperty(func, 'length', {\n value: 1 + $max(0, originalFunction.length - (arguments.length - 1))\n });\n }\n }\n\n return func;\n};\n\nvar applyBind = function applyBind() {\n return $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n $defineProperty(module.exports, 'apply', {\n value: applyBind\n });\n} else {\n module.exports.apply = applyBind;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/*\n * JavaScript Load Image Meta\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Image metadata handling implementation\n * based on the help and contribution of\n * Achim Stöhr.\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require, Promise, DataView, Uint8Array, ArrayBuffer */\n;\n\n(function (factory) {\n 'use strict';\n\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['./load-image'], factory);\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n factory(require('./load-image'));\n } else {\n // Browser globals:\n factory(window.loadImage);\n }\n})(function (loadImage) {\n 'use strict';\n\n var global = loadImage.global;\n var originalTransform = loadImage.transform;\n var blobSlice = global.Blob && (Blob.prototype.slice || Blob.prototype.webkitSlice || Blob.prototype.mozSlice);\n\n var bufferSlice = global.ArrayBuffer && ArrayBuffer.prototype.slice || function (begin, end) {\n // Polyfill for IE10, which does not support ArrayBuffer.slice\n // eslint-disable-next-line no-param-reassign\n end = end || this.byteLength - begin;\n var arr1 = new Uint8Array(this, begin, end);\n var arr2 = new Uint8Array(end);\n arr2.set(arr1);\n return arr2.buffer;\n };\n\n var metaDataParsers = {\n jpeg: {\n 0xffe1: [],\n // APP1 marker\n 0xffed: [] // APP13 marker\n\n }\n };\n /**\n * Parses image metadata and calls the callback with an object argument\n * with the following property:\n * - imageHead: The complete image head as ArrayBuffer\n * The options argument accepts an object and supports the following\n * properties:\n * - maxMetaDataSize: Defines the maximum number of bytes to parse.\n * - disableImageHead: Disables creating the imageHead property.\n *\n * @param {Blob} file Blob object\n * @param {Function} [callback] Callback function\n * @param {object} [options] Parsing options\n * @param {object} [data] Result data object\n * @returns {Promise|undefined} Returns Promise if no callback given.\n */\n\n function parseMetaData(file, callback, options, data) {\n var that = this;\n /**\n * Promise executor\n *\n * @param {Function} resolve Resolution function\n * @param {Function} reject Rejection function\n * @returns {undefined} Undefined\n */\n\n function executor(resolve, reject) {\n if (!(global.DataView && blobSlice && file && file.size >= 12 && file.type === 'image/jpeg')) {\n // Nothing to parse\n return resolve(data);\n } // 256 KiB should contain all EXIF/ICC/IPTC segments:\n\n\n var maxMetaDataSize = options.maxMetaDataSize || 262144;\n\n if (!loadImage.readFile(blobSlice.call(file, 0, maxMetaDataSize), function (buffer) {\n // Note on endianness:\n // Since the marker and length bytes in JPEG files are always\n // stored in big endian order, we can leave the endian parameter\n // of the DataView methods undefined, defaulting to big endian.\n var dataView = new DataView(buffer); // Check for the JPEG marker (0xffd8):\n\n if (dataView.getUint16(0) !== 0xffd8) {\n return reject(new Error('Invalid JPEG file: Missing JPEG marker.'));\n }\n\n var offset = 2;\n var maxOffset = dataView.byteLength - 4;\n var headLength = offset;\n var markerBytes;\n var markerLength;\n var parsers;\n var i;\n\n while (offset < maxOffset) {\n markerBytes = dataView.getUint16(offset); // Search for APPn (0xffeN) and COM (0xfffe) markers,\n // which contain application-specific metadata like\n // Exif, ICC and IPTC data and text comments:\n\n if (markerBytes >= 0xffe0 && markerBytes <= 0xffef || markerBytes === 0xfffe) {\n // The marker bytes (2) are always followed by\n // the length bytes (2), indicating the length of the\n // marker segment, which includes the length bytes,\n // but not the marker bytes, so we add 2:\n markerLength = dataView.getUint16(offset + 2) + 2;\n\n if (offset + markerLength > dataView.byteLength) {\n // eslint-disable-next-line no-console\n console.log('Invalid JPEG metadata: Invalid segment size.');\n break;\n }\n\n parsers = metaDataParsers.jpeg[markerBytes];\n\n if (parsers && !options.disableMetaDataParsers) {\n for (i = 0; i < parsers.length; i += 1) {\n parsers[i].call(that, dataView, offset, markerLength, data, options);\n }\n }\n\n offset += markerLength;\n headLength = offset;\n } else {\n // Not an APPn or COM marker, probably safe to\n // assume that this is the end of the metadata\n break;\n }\n } // Meta length must be longer than JPEG marker (2)\n // plus APPn marker (2), followed by length bytes (2):\n\n\n if (!options.disableImageHead && headLength > 6) {\n data.imageHead = bufferSlice.call(buffer, 0, headLength);\n }\n\n resolve(data);\n }, reject, 'readAsArrayBuffer')) {\n // No support for the FileReader interface, nothing to parse\n resolve(data);\n }\n }\n\n options = options || {}; // eslint-disable-line no-param-reassign\n\n if (global.Promise && typeof callback !== 'function') {\n options = callback || {}; // eslint-disable-line no-param-reassign\n\n data = options; // eslint-disable-line no-param-reassign\n\n return new Promise(executor);\n }\n\n data = data || {}; // eslint-disable-line no-param-reassign\n\n return executor(callback, callback);\n }\n /**\n * Replaces the head of a JPEG Blob\n *\n * @param {Blob} blob Blob object\n * @param {ArrayBuffer} oldHead Old JPEG head\n * @param {ArrayBuffer} newHead New JPEG head\n * @returns {Blob} Combined Blob\n */\n\n\n function replaceJPEGHead(blob, oldHead, newHead) {\n if (!blob || !oldHead || !newHead) return null;\n return new Blob([newHead, blobSlice.call(blob, oldHead.byteLength)], {\n type: 'image/jpeg'\n });\n }\n /**\n * Replaces the image head of a JPEG blob with the given one.\n * Returns a Promise or calls the callback with the new Blob.\n *\n * @param {Blob} blob Blob object\n * @param {ArrayBuffer} head New JPEG head\n * @param {Function} [callback] Callback function\n * @returns {Promise|undefined} Combined Blob\n */\n\n\n function replaceHead(blob, head, callback) {\n var options = {\n maxMetaDataSize: 1024,\n disableMetaDataParsers: true\n };\n\n if (!callback && global.Promise) {\n return parseMetaData(blob, options).then(function (data) {\n return replaceJPEGHead(blob, data.imageHead, head);\n });\n }\n\n parseMetaData(blob, function (data) {\n callback(replaceJPEGHead(blob, data.imageHead, head));\n }, options);\n }\n\n loadImage.transform = function (img, options, callback, file, data) {\n if (loadImage.requiresMetaData(options)) {\n data = data || {}; // eslint-disable-line no-param-reassign\n\n parseMetaData(file, function (result) {\n if (result !== data) {\n // eslint-disable-next-line no-console\n if (global.console) console.log(result);\n result = data; // eslint-disable-line no-param-reassign\n }\n\n originalTransform.call(loadImage, img, options, callback, file, result);\n }, options, data);\n } else {\n originalTransform.apply(loadImage, arguments);\n }\n };\n\n loadImage.blobSlice = blobSlice;\n loadImage.bufferSlice = bufferSlice;\n loadImage.replaceHead = replaceHead;\n loadImage.parseMetaData = parseMetaData;\n loadImage.metaDataParsers = metaDataParsers;\n});","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n'use strict';\n/* eslint-disable no-unused-vars */\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined');\n }\n\n return Object(val);\n}\n\nfunction shouldUseNative() {\n try {\n if (!Object.assign) {\n return false;\n } // Detect buggy property enumeration order in older V8 versions.\n // https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\n\n var test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\n test1[5] = 'de';\n\n if (Object.getOwnPropertyNames(test1)[0] === '5') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test2 = {};\n\n for (var i = 0; i < 10; i++) {\n test2['_' + String.fromCharCode(i)] = i;\n }\n\n var order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n return test2[n];\n });\n\n if (order2.join('') !== '0123456789') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test3 = {};\n 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n test3[letter] = letter;\n });\n\n if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {\n return false;\n }\n\n return true;\n } catch (err) {\n // We don't expect any of the above to throw, but better to be safe.\n return false;\n }\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n var from;\n var to = toObject(target);\n var symbols;\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s]);\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from);\n\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]];\n }\n }\n }\n }\n\n return to;\n};","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _utils = require('./utils');\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nvar _animateScroll = require('./animate-scroll');\n\nvar _animateScroll2 = _interopRequireDefault(_animateScroll);\n\nvar _scrollEvents = require('./scroll-events');\n\nvar _scrollEvents2 = _interopRequireDefault(_scrollEvents);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nvar __mapped = {};\n\nvar __activeLink = void 0;\n\nexports[\"default\"] = {\n unmount: function unmount() {\n __mapped = {};\n },\n register: function register(name, element) {\n __mapped[name] = element;\n },\n unregister: function unregister(name) {\n delete __mapped[name];\n },\n get: function get(name) {\n return __mapped[name] || document.getElementById(name) || document.getElementsByName(name)[0] || document.getElementsByClassName(name)[0];\n },\n setActiveLink: function setActiveLink(link) {\n return __activeLink = link;\n },\n getActiveLink: function getActiveLink() {\n return __activeLink;\n },\n scrollTo: function scrollTo(to, props) {\n var target = this.get(to);\n\n if (!target) {\n console.warn(\"target Element not found\");\n return;\n }\n\n props = _extends({}, props, {\n absolute: false\n });\n var containerId = props.containerId;\n var container = props.container;\n var containerElement = void 0;\n\n if (containerId) {\n containerElement = document.getElementById(containerId);\n } else if (container && container.nodeType) {\n containerElement = container;\n } else {\n containerElement = document;\n }\n\n props.absolute = true;\n var horizontal = props.horizontal;\n var scrollOffset = _utils2[\"default\"].scrollOffset(containerElement, target, horizontal) + (props.offset || 0);\n /*\r\n * if animate is not provided just scroll into the view\r\n */\n\n if (!props.smooth) {\n if (_scrollEvents2[\"default\"].registered['begin']) {\n _scrollEvents2[\"default\"].registered['begin'](to, target);\n }\n\n if (containerElement === document) {\n if (props.horizontal) {\n window.scrollTo(scrollOffset, 0);\n } else {\n window.scrollTo(0, scrollOffset);\n }\n } else {\n containerElement.scrollTop = scrollOffset;\n }\n\n if (_scrollEvents2[\"default\"].registered['end']) {\n _scrollEvents2[\"default\"].registered['end'](to, target);\n }\n\n return;\n }\n /*\r\n * Animate scrolling\r\n */\n\n\n _animateScroll2[\"default\"].animateTopScroll(scrollOffset, props, to, target);\n }\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar updateHash = function updateHash(hash, historyUpdate) {\n var hashVal = hash.indexOf(\"#\") === 0 ? hash.substring(1) : hash;\n var hashToUpdate = hashVal ? \"#\" + hashVal : \"\";\n var curLoc = window && window.location;\n var urlToPush = hashToUpdate ? curLoc.pathname + curLoc.search + hashToUpdate : curLoc.pathname + curLoc.search;\n historyUpdate ? history.pushState(history.state, \"\", urlToPush) : history.replaceState(history.state, \"\", urlToPush);\n};\n\nvar getHash = function getHash() {\n return window.location.hash.replace(/^#/, \"\");\n};\n\nvar filterElementInContainer = function filterElementInContainer(container) {\n return function (element) {\n return container.contains ? container != element && container.contains(element) : !!(container.compareDocumentPosition(element) & 16);\n };\n};\n\nvar isPositioned = function isPositioned(element) {\n return getComputedStyle(element).position !== \"static\";\n};\n\nvar getElementOffsetInfoUntil = function getElementOffsetInfoUntil(element, predicate) {\n var offsetTop = element.offsetTop;\n var currentOffsetParent = element.offsetParent;\n\n while (currentOffsetParent && !predicate(currentOffsetParent)) {\n offsetTop += currentOffsetParent.offsetTop;\n currentOffsetParent = currentOffsetParent.offsetParent;\n }\n\n return {\n offsetTop: offsetTop,\n offsetParent: currentOffsetParent\n };\n};\n\nvar scrollOffset = function scrollOffset(c, t, horizontal) {\n if (horizontal) {\n return c === document ? t.getBoundingClientRect().left + (window.scrollX || window.pageXOffset) : getComputedStyle(c).position !== \"static\" ? t.offsetLeft : t.offsetLeft - c.offsetLeft;\n } else {\n if (c === document) {\n return t.getBoundingClientRect().top + (window.scrollY || window.pageYOffset);\n } // The offsetParent of an element, according to MDN, is its nearest positioned\n // (an element whose position is anything other than static) ancestor. The offsetTop\n // of an element is taken with respect to its offsetParent which may not neccessarily\n // be its parentElement except the parent itself is positioned.\n // So if containerElement is positioned, then it must be an offsetParent somewhere\n // If it happens that targetElement is a descendant of the containerElement, and there\n // is not intermediate positioned element between the two of them, i.e.\n // targetElement\"s offsetParent is the same as the containerElement, then the\n // distance between the two will be the offsetTop of the targetElement.\n // If, on the other hand, there are intermediate positioned elements between the\n // two entities, the distance between the targetElement and the containerElement\n // will be the accumulation of the offsetTop of the element and that of its\n // subsequent offsetParent until the containerElement is reached, since it\n // will also be an offsetParent at some point due to the fact that it is positioned.\n // If the containerElement is not positioned, then it can\"t be an offsetParent,\n // which means that the offsetTop of the targetElement would not be with respect to it.\n // However, if the two of them happen to have the same offsetParent, then\n // the distance between them will be the difference between their offsetTop\n // since they are both taken with respect to the same entity.\n // The last resort would be to accumulate their offsetTop until a common\n // offsetParent is reached (usually the document) and taking the difference\n // between the accumulated offsetTops\n\n\n if (isPositioned(c)) {\n if (t.offsetParent !== c) {\n var isContainerElementOrDocument = function isContainerElementOrDocument(e) {\n return e === c || e === document;\n };\n\n var _getElementOffsetInfo = getElementOffsetInfoUntil(t, isContainerElementOrDocument),\n offsetTop = _getElementOffsetInfo.offsetTop,\n offsetParent = _getElementOffsetInfo.offsetParent;\n\n if (offsetParent !== c) {\n throw new Error(\"Seems containerElement is not an ancestor of the Element\");\n }\n\n return offsetTop;\n }\n\n return t.offsetTop;\n }\n\n if (t.offsetParent === c.offsetParent) {\n return t.offsetTop - c.offsetTop;\n }\n\n var isDocument = function isDocument(e) {\n return e === document;\n };\n\n return getElementOffsetInfoUntil(t, isDocument).offsetTop - getElementOffsetInfoUntil(c, isDocument).offsetTop;\n }\n};\n\nexports[\"default\"] = {\n updateHash: updateHash,\n getHash: getHash,\n filterElementInContainer: filterElementInContainer,\n scrollOffset: scrollOffset\n};","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\n\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `ListCache`.\n\n\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\nmodule.exports = ListCache;","var eq = require('./eq');\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\n\nfunction assocIndexOf(array, key) {\n var length = array.length;\n\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n\n return -1;\n}\n\nmodule.exports = assocIndexOf;","var root = require('./_root');\n/** Built-in value references. */\n\n\nvar _Symbol = root.Symbol;\nmodule.exports = _Symbol;","var getNative = require('./_getNative');\n/* Built-in method references that are verified to be native. */\n\n\nvar nativeCreate = getNative(Object, 'create');\nmodule.exports = nativeCreate;","var isKeyable = require('./_isKeyable');\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n\n\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;\n}\n\nmodule.exports = getMapData;","var isSymbol = require('./isSymbol');\n/** Used as references for various `Number` constants. */\n\n\nvar INFINITY = 1 / 0;\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n\nmodule.exports = toKey;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport { useEffect } from 'react';\nimport { useCollector } from './useCollector.js';\nimport { useDragDropManager } from './useDragDropManager.js';\n/**\n * useDragLayer Hook\n * @param collector The property collector\n */\n\nexport function useDragLayer(collect) {\n var dragDropManager = useDragDropManager();\n var monitor = dragDropManager.getMonitor();\n\n var _useCollector = useCollector(monitor, collect),\n _useCollector2 = _slicedToArray(_useCollector, 2),\n collected = _useCollector2[0],\n updateCollected = _useCollector2[1];\n\n useEffect(function () {\n return monitor.subscribeToOffsetChange(updateCollected);\n });\n useEffect(function () {\n return monitor.subscribeToStateChange(updateCollected);\n });\n return collected;\n}","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nvar characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n/**\n * Utility to decode markdown strings (which occur in places such as fenced\n * code info strings, destinations, labels, and titles).\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * @returns {string}\n */\n\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\n\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n } // Reference.\n\n\n var head = $2.charCodeAt(0);\n\n if (head === 35) {\n var _head = $2.charCodeAt(1);\n\n var hex = _head === 120 || _head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n */\nexport function decodeNumericCharacterReference(value, base) {\n var code = Number.parseInt(value, base);\n\n if ( // C0 except for HT, LF, FF, CR, space\n code < 9 || code === 11 || code > 13 && code < 32 || // Control character (DEL) of the basic block and C1 controls.\n code > 126 && code < 160 || // Lone high surrogates and low surrogates.\n code > 55295 && code < 57344 || // Noncharacters.\n code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || // Out of range\n code > 1114111) {\n return \"\\uFFFD\";\n }\n\n return String.fromCharCode(code);\n}","/**\n * Detect Element Resize.\n * https://github.com/sdecima/javascript-detect-element-resize\n * Sebastian Decima\n *\n * Forked from version 0.5.3; includes the following modifications:\n * 1) Guard against unsafe 'window' and 'document' references (to support SSR).\n * 2) Defer initialization code via a top-level function wrapper (to support SSR).\n * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.\n * 4) Add nonce for style element.\n * 5) Added support for injecting custom window object\n **/\nexport default function createDetectElementResize(nonce, hostWindow) {\n // Check `document` and `window` in case of server-side rendering\n var _window;\n\n if (typeof hostWindow !== 'undefined') {\n _window = hostWindow;\n } else if (typeof window !== 'undefined') {\n _window = window;\n } else if (typeof self !== 'undefined') {\n _window = self;\n } else {\n _window = global;\n }\n\n var attachEvent = typeof _window.document !== 'undefined' && _window.document.attachEvent;\n\n if (!attachEvent) {\n var requestFrame = function () {\n var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function (fn) {\n return _window.setTimeout(fn, 20);\n };\n\n return function (fn) {\n return raf(fn);\n };\n }();\n\n var cancelFrame = function () {\n var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout;\n return function (id) {\n return cancel(id);\n };\n }();\n\n var resetTriggers = function resetTriggers(element) {\n var triggers = element.__resizeTriggers__,\n expand = triggers.firstElementChild,\n contract = triggers.lastElementChild,\n expandChild = expand.firstElementChild;\n contract.scrollLeft = contract.scrollWidth;\n contract.scrollTop = contract.scrollHeight;\n expandChild.style.width = expand.offsetWidth + 1 + 'px';\n expandChild.style.height = expand.offsetHeight + 1 + 'px';\n expand.scrollLeft = expand.scrollWidth;\n expand.scrollTop = expand.scrollHeight;\n };\n\n var checkTriggers = function checkTriggers(element) {\n return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;\n };\n\n var scrollListener = function scrollListener(e) {\n // Don't measure (which forces) reflow for scrolls that happen inside of children!\n if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {\n return;\n }\n\n var element = this;\n resetTriggers(this);\n\n if (this.__resizeRAF__) {\n cancelFrame(this.__resizeRAF__);\n }\n\n this.__resizeRAF__ = requestFrame(function () {\n if (checkTriggers(element)) {\n element.__resizeLast__.width = element.offsetWidth;\n element.__resizeLast__.height = element.offsetHeight;\n\n element.__resizeListeners__.forEach(function (fn) {\n fn.call(element, e);\n });\n }\n });\n };\n /* Detect CSS Animations support to detect element display/re-attach */\n\n\n var animation = false,\n keyframeprefix = '',\n animationstartevent = 'animationstart',\n domPrefixes = 'Webkit Moz O ms'.split(' '),\n startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n pfx = '';\n {\n var elm = _window.document.createElement('fakeelement');\n\n if (elm.style.animationName !== undefined) {\n animation = true;\n }\n\n if (animation === false) {\n for (var i = 0; i < domPrefixes.length; i++) {\n if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {\n pfx = domPrefixes[i];\n keyframeprefix = '-' + pfx.toLowerCase() + '-';\n animationstartevent = startEvents[i];\n animation = true;\n break;\n }\n }\n }\n }\n var animationName = 'resizeanim';\n var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n }\n\n var createStyles = function createStyles(doc) {\n if (!doc.getElementById('detectElementResize')) {\n //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n head = doc.head || doc.getElementsByTagName('head')[0],\n style = doc.createElement('style');\n style.id = 'detectElementResize';\n style.type = 'text/css';\n\n if (nonce != null) {\n style.setAttribute('nonce', nonce);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(doc.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n };\n\n var addResizeListener = function addResizeListener(element, fn) {\n if (attachEvent) {\n element.attachEvent('onresize', fn);\n } else {\n if (!element.__resizeTriggers__) {\n var doc = element.ownerDocument;\n\n var elementStyle = _window.getComputedStyle(element);\n\n if (elementStyle && elementStyle.position == 'static') {\n element.style.position = 'relative';\n }\n\n createStyles(doc);\n element.__resizeLast__ = {};\n element.__resizeListeners__ = [];\n (element.__resizeTriggers__ = doc.createElement('div')).className = 'resize-triggers';\n var resizeTriggersHtml = '