) => {\n this.props.onReset?.(...args)\n this.reset()\n }\n\n reset() {\n this.setState(initialState)\n }\n\n componentDidCatch(error: Error, info: React.ErrorInfo) {\n this.props.onError?.(error, info)\n }\n\n componentDidUpdate(\n prevProps: ErrorBoundaryProps,\n prevState: ErrorBoundaryState,\n ) {\n const {error} = this.state\n const {resetKeys} = this.props\n\n // There's an edge case where if the thing that triggered the error\n // happens to *also* be in the resetKeys array, we'd end up resetting\n // the error boundary immediately. This would likely trigger a second\n // error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call\n // of cDU after the error is set\n\n if (\n error !== null &&\n prevState.error !== null &&\n changedArray(prevProps.resetKeys, resetKeys)\n ) {\n this.props.onResetKeysChange?.(prevProps.resetKeys, resetKeys)\n this.reset()\n }\n }\n\n render() {\n const {error} = this.state\n\n const {fallbackRender, FallbackComponent, fallback} = this.props\n\n if (error !== null) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary,\n }\n if (React.isValidElement(fallback)) {\n return fallback\n } else if (typeof fallbackRender === 'function') {\n return fallbackRender(props)\n } else if (FallbackComponent) {\n return \n } else {\n throw new Error(\n 'react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop',\n )\n }\n }\n\n return this.props.children\n }\n}\n\nfunction withErrorBoundary(\n Component: React.ComponentType
,\n errorBoundaryProps: ErrorBoundaryProps,\n): React.ComponentType
{\n const Wrapped: React.ComponentType
= props => {\n return (\n \n \n \n )\n }\n\n // Format for display in DevTools\n const name = Component.displayName || Component.name || 'Unknown'\n Wrapped.displayName = `withErrorBoundary(${name})`\n\n return Wrapped\n}\n\nfunction useErrorHandler(givenError?: unknown): (error: unknown) => void {\n const [error, setError] = React.useState(null)\n if (givenError != null) throw givenError\n if (error != null) throw error\n return setError\n}\n\nexport {ErrorBoundary, withErrorBoundary, useErrorHandler}\nexport type {\n FallbackProps,\n ErrorBoundaryPropsWithComponent,\n ErrorBoundaryPropsWithRender,\n ErrorBoundaryPropsWithFallback,\n ErrorBoundaryProps,\n}\n\n/*\neslint\n @typescript-eslint/sort-type-union-intersection-members: \"off\",\n @typescript-eslint/no-throw-literal: \"off\",\n @typescript-eslint/prefer-nullish-coalescing: \"off\"\n*/\n","/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */\n\nvar hasElementType = typeof Element !== 'undefined';\nvar hasMap = typeof Map === 'function';\nvar hasSet = typeof Set === 'function';\nvar hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;\n\n// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js\n\nfunction equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.3\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n // START: Modifications:\n // Apply guards for `Object.create(null)` handling. See:\n // - https://github.com/FormidableLabs/react-fast-compare/issues/64\n // - https://github.com/epoberezkin/fast-deep-equal/issues/49\n if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();\n // END: Modifications\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function isEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (((error.message || '').match(/stack|recursion/i))) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('react-fast-compare cannot handle circular refs');\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(\"react-list\", [\"prop-types\", \"react\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(require(\"prop-types\"), require(\"react\"));\n } else {\n var mod = {\n exports: {}\n };\n factory(global.PropTypes, global.React);\n global.ReactList = mod.exports;\n }\n})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function (_propTypes, _react) {\n \"use strict\";\n\n _propTypes = _interopRequireDefault(_propTypes);\n _react = _interopRequireWildcard(_react);\n\n var _class, _temp;\n\n function _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\n function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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\n function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n function _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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\n function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n function _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\n function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\n function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n function _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\n function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n function _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 var CLIENT_SIZE_KEYS = {\n x: 'clientWidth',\n y: 'clientHeight'\n };\n var CLIENT_START_KEYS = {\n x: 'clientTop',\n y: 'clientLeft'\n };\n var INNER_SIZE_KEYS = {\n x: 'innerWidth',\n y: 'innerHeight'\n };\n var OFFSET_SIZE_KEYS = {\n x: 'offsetWidth',\n y: 'offsetHeight'\n };\n var OFFSET_START_KEYS = {\n x: 'offsetLeft',\n y: 'offsetTop'\n };\n var OVERFLOW_KEYS = {\n x: 'overflowX',\n y: 'overflowY'\n };\n var SCROLL_SIZE_KEYS = {\n x: 'scrollWidth',\n y: 'scrollHeight'\n };\n var SCROLL_START_KEYS = {\n x: 'scrollLeft',\n y: 'scrollTop'\n };\n var SIZE_KEYS = {\n x: 'width',\n y: 'height'\n };\n\n var NOOP = function NOOP() {}; // If a browser doesn't support the `options` argument to\n // add/removeEventListener, we need to check, otherwise we will\n // accidentally set `capture` with a truthy value.\n\n\n var PASSIVE = function () {\n if (typeof window === 'undefined') return false;\n var hasSupport = false;\n\n try {\n document.createElement('div').addEventListener('test', NOOP, {\n get passive() {\n hasSupport = true;\n return false;\n }\n\n });\n } catch (e) {// noop\n }\n\n return hasSupport;\n }() ? {\n passive: true\n } : false;\n var UNSTABLE_MESSAGE = 'ReactList failed to reach a stable state.';\n var MAX_SYNC_UPDATES = 40;\n\n var isEqualSubset = function isEqualSubset(a, b) {\n for (var key in b) {\n if (a[key] !== b[key]) return false;\n }\n\n return true;\n };\n\n var defaultScrollParentGetter = function defaultScrollParentGetter(component) {\n var axis = component.props.axis;\n var el = component.getEl();\n var overflowKey = OVERFLOW_KEYS[axis];\n\n while (el = el.parentElement) {\n switch (window.getComputedStyle(el)[overflowKey]) {\n case 'auto':\n case 'scroll':\n case 'overlay':\n return el;\n }\n }\n\n return window;\n };\n\n var defaultScrollParentViewportSizeGetter = function defaultScrollParentViewportSizeGetter(component) {\n var axis = component.props.axis;\n var scrollParent = component.scrollParent;\n return scrollParent === window ? window[INNER_SIZE_KEYS[axis]] : scrollParent[CLIENT_SIZE_KEYS[axis]];\n };\n\n var constrain = function constrain(props, state) {\n var length = props.length,\n minSize = props.minSize,\n type = props.type;\n var from = state.from,\n size = state.size,\n itemsPerRow = state.itemsPerRow;\n size = Math.max(size, minSize);\n var mod = size % itemsPerRow;\n if (mod) size += itemsPerRow - mod;\n if (size > length) size = length;\n from = type === 'simple' || !from ? 0 : Math.max(Math.min(from, length - size), 0);\n\n if (mod = from % itemsPerRow) {\n from -= mod;\n size += mod;\n }\n\n if (from === state.from && size == state.size) return state;\n return _objectSpread(_objectSpread({}, state), {}, {\n from: from,\n size: size\n });\n };\n\n module.exports = (_temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(ReactList, _Component);\n\n var _super = _createSuper(ReactList);\n\n _createClass(ReactList, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n var newState = constrain(props, state);\n return newState === state ? null : newState;\n }\n }]);\n\n function ReactList(props) {\n var _this;\n\n _classCallCheck(this, ReactList);\n\n _this = _super.call(this, props);\n _this.state = constrain(props, {\n itemsPerRow: 1,\n from: props.initialIndex,\n size: 0\n });\n _this.cache = {};\n _this.cachedScrollPosition = null;\n _this.prevPrevState = {};\n _this.unstable = false;\n _this.updateCounter = 0;\n return _this;\n }\n\n _createClass(ReactList, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateFrameAndClearCache = this.updateFrameAndClearCache.bind(this);\n window.addEventListener('resize', this.updateFrameAndClearCache);\n this.updateFrame(this.scrollTo.bind(this, this.props.initialIndex));\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this2 = this;\n\n // Viewport scroll is no longer useful if axis changes\n if (this.props.axis !== prevProps.axis) this.clearSizeCache(); // If the list has reached an unstable state, prevent an infinite loop.\n\n if (this.unstable) return;\n\n if (++this.updateCounter > MAX_SYNC_UPDATES) {\n this.unstable = true;\n return console.error(UNSTABLE_MESSAGE);\n }\n\n if (!this.updateCounterTimeoutId) {\n this.updateCounterTimeoutId = setTimeout(function () {\n _this2.updateCounter = 0;\n delete _this2.updateCounterTimeoutId;\n }, 0);\n }\n\n this.updateFrame();\n }\n }, {\n key: \"maybeSetState\",\n value: function maybeSetState(b, cb) {\n if (isEqualSubset(this.state, b)) return cb();\n this.setState(b, cb);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.updateFrameAndClearCache);\n this.scrollParent.removeEventListener('scroll', this.updateFrameAndClearCache, PASSIVE);\n this.scrollParent.removeEventListener('mousewheel', NOOP, PASSIVE);\n }\n }, {\n key: \"getOffset\",\n value: function getOffset(el) {\n var axis = this.props.axis;\n var offset = el[CLIENT_START_KEYS[axis]] || 0;\n var offsetKey = OFFSET_START_KEYS[axis];\n\n do {\n offset += el[offsetKey] || 0;\n } while (el = el.offsetParent);\n\n return offset;\n }\n }, {\n key: \"getEl\",\n value: function getEl() {\n return this.el || this.items;\n }\n }, {\n key: \"getScrollPosition\",\n value: function getScrollPosition() {\n // Cache scroll position as this causes a forced synchronous layout.\n if (typeof this.cachedScrollPosition === 'number') {\n return this.cachedScrollPosition;\n }\n\n var scrollParent = this.scrollParent;\n var axis = this.props.axis;\n var scrollKey = SCROLL_START_KEYS[axis];\n var actual = scrollParent === window ? // Firefox always returns document.body[scrollKey] as 0 and Chrome/Safari\n // always return document.documentElement[scrollKey] as 0, so take\n // whichever has a value.\n document.body[scrollKey] || document.documentElement[scrollKey] : scrollParent[scrollKey];\n var max = this.getScrollSize() - this.props.scrollParentViewportSizeGetter(this);\n var scroll = Math.max(0, Math.min(actual, max));\n var el = this.getEl();\n this.cachedScrollPosition = this.getOffset(scrollParent) + scroll - this.getOffset(el);\n return this.cachedScrollPosition;\n }\n }, {\n key: \"setScroll\",\n value: function setScroll(offset) {\n var scrollParent = this.scrollParent;\n var axis = this.props.axis;\n offset += this.getOffset(this.getEl());\n if (scrollParent === window) return window.scrollTo(0, offset);\n offset -= this.getOffset(this.scrollParent);\n scrollParent[SCROLL_START_KEYS[axis]] = offset;\n }\n }, {\n key: \"getScrollSize\",\n value: function getScrollSize() {\n var scrollParent = this.scrollParent;\n var _document = document,\n body = _document.body,\n documentElement = _document.documentElement;\n var key = SCROLL_SIZE_KEYS[this.props.axis];\n return scrollParent === window ? Math.max(body[key], documentElement[key]) : scrollParent[key];\n }\n }, {\n key: \"hasDeterminateSize\",\n value: function hasDeterminateSize() {\n var _this$props = this.props,\n itemSizeGetter = _this$props.itemSizeGetter,\n type = _this$props.type;\n return type === 'uniform' || itemSizeGetter;\n }\n }, {\n key: \"getStartAndEnd\",\n value: function getStartAndEnd() {\n var threshold = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.threshold;\n var scroll = this.getScrollPosition();\n var start = Math.max(0, scroll - threshold);\n var end = scroll + this.props.scrollParentViewportSizeGetter(this) + threshold;\n\n if (this.hasDeterminateSize()) {\n end = Math.min(end, this.getSpaceBefore(this.props.length));\n }\n\n return {\n start: start,\n end: end\n };\n }\n }, {\n key: \"getItemSizeAndItemsPerRow\",\n value: function getItemSizeAndItemsPerRow() {\n var _this$props2 = this.props,\n axis = _this$props2.axis,\n useStaticSize = _this$props2.useStaticSize;\n var _this$state = this.state,\n itemSize = _this$state.itemSize,\n itemsPerRow = _this$state.itemsPerRow;\n\n if (useStaticSize && itemSize && itemsPerRow) {\n return {\n itemSize: itemSize,\n itemsPerRow: itemsPerRow\n };\n }\n\n var itemEls = this.items.children;\n if (!itemEls.length) return {};\n var firstEl = itemEls[0]; // Firefox has a problem where it will return a *slightly* (less than\n // thousandths of a pixel) different size for the same element between\n // renders. This can cause an infinite render loop, so only change the\n // itemSize when it is significantly different.\n\n var firstElSize = firstEl[OFFSET_SIZE_KEYS[axis]];\n var delta = Math.abs(firstElSize - itemSize);\n if (isNaN(delta) || delta >= 1) itemSize = firstElSize;\n if (!itemSize) return {};\n var startKey = OFFSET_START_KEYS[axis];\n var firstStart = firstEl[startKey];\n itemsPerRow = 1;\n\n for (var item = itemEls[itemsPerRow]; item && item[startKey] === firstStart; item = itemEls[itemsPerRow]) {\n ++itemsPerRow;\n }\n\n return {\n itemSize: itemSize,\n itemsPerRow: itemsPerRow\n };\n }\n }, {\n key: \"clearSizeCache\",\n value: function clearSizeCache() {\n this.cachedScrollPosition = null;\n } // Called by 'scroll' and 'resize' events, clears scroll position cache.\n\n }, {\n key: \"updateFrameAndClearCache\",\n value: function updateFrameAndClearCache(cb) {\n this.clearSizeCache();\n return this.updateFrame(cb);\n }\n }, {\n key: \"updateFrame\",\n value: function updateFrame(cb) {\n this.updateScrollParent();\n if (typeof cb != 'function') cb = NOOP;\n\n switch (this.props.type) {\n case 'simple':\n return this.updateSimpleFrame(cb);\n\n case 'variable':\n return this.updateVariableFrame(cb);\n\n case 'uniform':\n return this.updateUniformFrame(cb);\n }\n }\n }, {\n key: \"updateScrollParent\",\n value: function updateScrollParent() {\n var prev = this.scrollParent;\n this.scrollParent = this.props.scrollParentGetter(this);\n if (prev === this.scrollParent) return;\n\n if (prev) {\n prev.removeEventListener('scroll', this.updateFrameAndClearCache);\n prev.removeEventListener('mousewheel', NOOP);\n } // If we have a new parent, cached parent dimensions are no longer useful.\n\n\n this.clearSizeCache();\n this.scrollParent.addEventListener('scroll', this.updateFrameAndClearCache, PASSIVE); // You have to attach mousewheel listener to the scrollable element.\n // Just an empty listener. After that onscroll events will be fired synchronously.\n\n this.scrollParent.addEventListener('mousewheel', NOOP, PASSIVE);\n }\n }, {\n key: \"updateSimpleFrame\",\n value: function updateSimpleFrame(cb) {\n var _this$getStartAndEnd = this.getStartAndEnd(),\n end = _this$getStartAndEnd.end;\n\n var itemEls = this.items.children;\n var elEnd = 0;\n\n if (itemEls.length) {\n var axis = this.props.axis;\n var firstItemEl = itemEls[0];\n var lastItemEl = itemEls[itemEls.length - 1];\n elEnd = this.getOffset(lastItemEl) + lastItemEl[OFFSET_SIZE_KEYS[axis]] - this.getOffset(firstItemEl);\n }\n\n if (elEnd > end) return cb();\n var _this$props3 = this.props,\n pageSize = _this$props3.pageSize,\n length = _this$props3.length;\n var size = Math.min(this.state.size + pageSize, length);\n this.maybeSetState({\n size: size\n }, cb);\n }\n }, {\n key: \"updateVariableFrame\",\n value: function updateVariableFrame(cb) {\n if (!this.props.itemSizeGetter) this.cacheSizes();\n\n var _this$getStartAndEnd2 = this.getStartAndEnd(),\n start = _this$getStartAndEnd2.start,\n end = _this$getStartAndEnd2.end;\n\n var _this$props4 = this.props,\n length = _this$props4.length,\n pageSize = _this$props4.pageSize;\n var space = 0;\n var from = 0;\n var size = 0;\n var maxFrom = length - 1;\n\n while (from < maxFrom) {\n var itemSize = this.getSizeOfItem(from);\n if (itemSize == null || space + itemSize > start) break;\n space += itemSize;\n ++from;\n }\n\n var maxSize = length - from;\n\n while (size < maxSize && space < end) {\n var _itemSize = this.getSizeOfItem(from + size);\n\n if (_itemSize == null) {\n size = Math.min(size + pageSize, maxSize);\n break;\n }\n\n space += _itemSize;\n ++size;\n }\n\n this.maybeSetState(constrain(this.props, {\n from: from,\n itemsPerRow: 1,\n size: size\n }), cb);\n }\n }, {\n key: \"updateUniformFrame\",\n value: function updateUniformFrame(cb) {\n var _this$getItemSizeAndI = this.getItemSizeAndItemsPerRow(),\n itemSize = _this$getItemSizeAndI.itemSize,\n itemsPerRow = _this$getItemSizeAndI.itemsPerRow;\n\n if (!itemSize || !itemsPerRow) return cb();\n\n var _this$getStartAndEnd3 = this.getStartAndEnd(),\n start = _this$getStartAndEnd3.start,\n end = _this$getStartAndEnd3.end;\n\n var _constrain = constrain(this.props, {\n from: Math.floor(start / itemSize) * itemsPerRow,\n size: (Math.ceil((end - start) / itemSize) + 1) * itemsPerRow,\n itemsPerRow: itemsPerRow\n }),\n from = _constrain.from,\n size = _constrain.size;\n\n return this.maybeSetState({\n itemsPerRow: itemsPerRow,\n from: from,\n itemSize: itemSize,\n size: size\n }, cb);\n }\n }, {\n key: \"getSpaceBefore\",\n value: function getSpaceBefore(index) {\n var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (cache[index] != null) return cache[index]; // Try the static itemSize.\n\n var _this$state2 = this.state,\n itemSize = _this$state2.itemSize,\n itemsPerRow = _this$state2.itemsPerRow;\n\n if (itemSize) {\n return cache[index] = Math.floor(index / itemsPerRow) * itemSize;\n } // Find the closest space to index there is a cached value for.\n\n\n var from = index;\n\n while (from > 0 && cache[--from] == null) {\n ;\n } // Finally, accumulate sizes of items from - index.\n\n\n var space = cache[from] || 0;\n\n for (var i = from; i < index; ++i) {\n cache[i] = space;\n\n var _itemSize2 = this.getSizeOfItem(i);\n\n if (_itemSize2 == null) break;\n space += _itemSize2;\n }\n\n return cache[index] = space;\n }\n }, {\n key: \"cacheSizes\",\n value: function cacheSizes() {\n var cache = this.cache;\n var from = this.state.from;\n var itemEls = this.items.children;\n var sizeKey = OFFSET_SIZE_KEYS[this.props.axis];\n\n for (var i = 0, l = itemEls.length; i < l; ++i) {\n cache[from + i] = itemEls[i][sizeKey];\n }\n }\n }, {\n key: \"getSizeOfItem\",\n value: function getSizeOfItem(index) {\n var cache = this.cache,\n items = this.items;\n var _this$props5 = this.props,\n axis = _this$props5.axis,\n itemSizeGetter = _this$props5.itemSizeGetter,\n itemSizeEstimator = _this$props5.itemSizeEstimator,\n type = _this$props5.type;\n var _this$state3 = this.state,\n from = _this$state3.from,\n itemSize = _this$state3.itemSize,\n size = _this$state3.size; // Try the static itemSize.\n\n if (itemSize) return itemSize; // Try the itemSizeGetter.\n\n if (itemSizeGetter) return itemSizeGetter(index); // Try the cache.\n\n if (index in cache) return cache[index]; // Try the DOM.\n\n if (type === 'simple' && index >= from && index < from + size && items) {\n var itemEl = items.children[index - from];\n if (itemEl) return itemEl[OFFSET_SIZE_KEYS[axis]];\n } // Try the itemSizeEstimator.\n\n\n if (itemSizeEstimator) return itemSizeEstimator(index, cache);\n }\n }, {\n key: \"scrollTo\",\n value: function scrollTo(index) {\n if (index != null) this.setScroll(this.getSpaceBefore(index));\n }\n }, {\n key: \"scrollAround\",\n value: function scrollAround(index) {\n var current = this.getScrollPosition();\n var bottom = this.getSpaceBefore(index);\n var top = bottom - this.props.scrollParentViewportSizeGetter(this) + this.getSizeOfItem(index);\n var min = Math.min(top, bottom);\n var max = Math.max(top, bottom);\n if (current <= min) return this.setScroll(min);\n if (current > max) return this.setScroll(max);\n }\n }, {\n key: \"getVisibleRange\",\n value: function getVisibleRange() {\n var _this$state4 = this.state,\n from = _this$state4.from,\n size = _this$state4.size;\n\n var _this$getStartAndEnd4 = this.getStartAndEnd(0),\n start = _this$getStartAndEnd4.start,\n end = _this$getStartAndEnd4.end;\n\n var cache = {};\n var first, last;\n\n for (var i = from; i < from + size; ++i) {\n var itemStart = this.getSpaceBefore(i, cache);\n var itemEnd = itemStart + this.getSizeOfItem(i);\n if (first == null && itemEnd > start) first = i;\n if (first != null && itemStart < end) last = i;\n }\n\n return [first, last];\n }\n }, {\n key: \"renderItems\",\n value: function renderItems() {\n var _this3 = this;\n\n var _this$props6 = this.props,\n itemRenderer = _this$props6.itemRenderer,\n itemsRenderer = _this$props6.itemsRenderer;\n var _this$state5 = this.state,\n from = _this$state5.from,\n size = _this$state5.size;\n var items = [];\n\n for (var i = 0; i < size; ++i) {\n items.push(itemRenderer(from + i, i));\n }\n\n return itemsRenderer(items, function (c) {\n return _this3.items = c;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$props7 = this.props,\n axis = _this$props7.axis,\n length = _this$props7.length,\n type = _this$props7.type,\n useTranslate3d = _this$props7.useTranslate3d;\n var _this$state6 = this.state,\n from = _this$state6.from,\n itemsPerRow = _this$state6.itemsPerRow;\n var items = this.renderItems();\n if (type === 'simple') return items;\n var style = {\n position: 'relative'\n };\n var cache = {};\n var bottom = Math.ceil(length / itemsPerRow) * itemsPerRow;\n var size = this.getSpaceBefore(bottom, cache);\n\n if (size) {\n style[SIZE_KEYS[axis]] = size;\n if (axis === 'x') style.overflowX = 'hidden';\n }\n\n var offset = this.getSpaceBefore(from, cache);\n var x = axis === 'x' ? offset : 0;\n var y = axis === 'y' ? offset : 0;\n var transform = useTranslate3d ? \"translate3d(\".concat(x, \"px, \").concat(y, \"px, 0)\") : \"translate(\".concat(x, \"px, \").concat(y, \"px)\");\n var listStyle = {\n msTransform: transform,\n WebkitTransform: transform,\n transform: transform\n };\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: style,\n ref: function ref(c) {\n return _this4.el = c;\n }\n }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: listStyle\n }, items));\n }\n }]);\n\n return ReactList;\n }(_react.Component), _defineProperty(_class, \"displayName\", 'ReactList'), _defineProperty(_class, \"propTypes\", {\n axis: _propTypes[\"default\"].oneOf(['x', 'y']),\n initialIndex: _propTypes[\"default\"].number,\n itemRenderer: _propTypes[\"default\"].func,\n itemSizeEstimator: _propTypes[\"default\"].func,\n itemSizeGetter: _propTypes[\"default\"].func,\n itemsRenderer: _propTypes[\"default\"].func,\n length: _propTypes[\"default\"].number,\n minSize: _propTypes[\"default\"].number,\n pageSize: _propTypes[\"default\"].number,\n scrollParentGetter: _propTypes[\"default\"].func,\n scrollParentViewportSizeGetter: _propTypes[\"default\"].func,\n threshold: _propTypes[\"default\"].number,\n type: _propTypes[\"default\"].oneOf(['simple', 'variable', 'uniform']),\n useStaticSize: _propTypes[\"default\"].bool,\n useTranslate3d: _propTypes[\"default\"].bool\n }), _defineProperty(_class, \"defaultProps\", {\n axis: 'y',\n itemRenderer: function itemRenderer(index, key) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n key: key\n }, index);\n },\n itemsRenderer: function itemsRenderer(items, ref) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n ref: ref\n }, items);\n },\n length: 0,\n minSize: 1,\n pageSize: 10,\n scrollParentGetter: defaultScrollParentGetter,\n scrollParentViewportSizeGetter: defaultScrollParentViewportSizeGetter,\n threshold: 100,\n type: 'simple',\n useStaticSize: false,\n useTranslate3d: false\n }), _temp);\n});\n","Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = undefined;var _extends = Object.assign || function (target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i];for (var key in source) {if (Object.prototype.hasOwnProperty.call(source, key)) {target[key] = source[key];}}}return target;};var _createClass = function () {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);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _class,_temp,_jsxFileName = 'src/DrawerLayout.js';\nvar _react = require('react');var _react2 = _interopRequireDefault(_react);\nvar _reactNative = require('react-native');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}function _possibleConstructorReturn(self, call) {if (!self) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;}function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;}\n\n\n\n\n\n\n\n\n\n\nvar MIN_SWIPE_DISTANCE = 3;\nvar DEVICE_WIDTH = parseFloat(_reactNative.Dimensions.get('window').width);\nvar THRESHOLD = DEVICE_WIDTH / 2;\nvar VX_MAX = 0.1;\n\nvar IDLE = 'Idle';\nvar DRAGGING = 'Dragging';\nvar SETTLING = 'Settling';var\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nDrawerLayout = (_temp = _class = function (_Component) {_inherits(DrawerLayout, _Component);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n function DrawerLayout(props, context) {_classCallCheck(this, DrawerLayout);var _this = _possibleConstructorReturn(this, (DrawerLayout.__proto__ || Object.getPrototypeOf(DrawerLayout)).call(this,\n props, context));_this.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n _onOverlayClick = function (e) {\n e.stopPropagation();\n if (!_this._isLockedClosed() && !_this._isLockedOpen()) {\n _this.closeDrawer();\n }\n };_this.\n\n _emitStateChanged = function (newState) {\n if (_this.props.onDrawerStateChanged) {\n _this.props.onDrawerStateChanged(newState);\n }\n };_this.\n\n openDrawer = function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _this._emitStateChanged(SETTLING);\n _reactNative.Animated.spring(_this.state.openValue, _extends({\n toValue: 1,\n bounciness: 0,\n restSpeedThreshold: 0.1,\n useNativeDriver: _this.props.useNativeAnimations },\n options)).\n start(function () {\n if (_this.props.onDrawerOpen) {\n _this.props.onDrawerOpen();\n }\n _this._emitStateChanged(IDLE);\n });\n };_this.\n\n closeDrawer = function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _this._emitStateChanged(SETTLING);\n _reactNative.Animated.spring(_this.state.openValue, _extends({\n toValue: 0,\n bounciness: 0,\n restSpeedThreshold: 1,\n useNativeDriver: _this.props.useNativeAnimations },\n options)).\n start(function () {\n if (_this.props.onDrawerClose) {\n _this.props.onDrawerClose();\n }\n _this._emitStateChanged(IDLE);\n });\n };_this.\n\n _handleDrawerOpen = function () {\n if (_this.props.onDrawerOpen) {\n _this.props.onDrawerOpen();\n }\n };_this.\n\n _handleDrawerClose = function () {\n if (_this.props.onDrawerClose) {\n _this.props.onDrawerClose();\n }\n };_this.\n\n _shouldSetPanResponder = function (\n e, _ref)\n\n {var moveX = _ref.moveX,dx = _ref.dx,dy = _ref.dy;\n if (!dx || !dy || Math.abs(dx) < MIN_SWIPE_DISTANCE) {\n return false;\n }\n\n if (_this._isLockedClosed() || _this._isLockedOpen()) {\n return false;\n }\n\n if (_this.getDrawerPosition() === 'left') {\n var overlayArea = DEVICE_WIDTH - (\n DEVICE_WIDTH - _this.props.drawerWidth);\n\n if (_this._lastOpenValue === 1) {\n if (\n dx < 0 && Math.abs(dx) > Math.abs(dy) * 3 ||\n moveX > overlayArea)\n {\n _this._isClosing = true;\n _this._closingAnchorValue = _this._getOpenValueForX(moveX);\n return true;\n }\n } else {\n if (moveX <= 35 && dx > 0) {\n _this._isClosing = false;\n return true;\n }\n\n return false;\n }\n } else {\n var _overlayArea = DEVICE_WIDTH - _this.props.drawerWidth;\n\n if (_this._lastOpenValue === 1) {\n if (\n dx > 0 && Math.abs(dx) > Math.abs(dy) * 3 ||\n moveX < _overlayArea)\n {\n _this._isClosing = true;\n _this._closingAnchorValue = _this._getOpenValueForX(moveX);\n return true;\n }\n } else {\n if (moveX >= DEVICE_WIDTH - 35 && dx < 0) {\n _this._isClosing = false;\n return true;\n }\n\n return false;\n }\n }\n };_this.\n\n _panResponderGrant = function () {\n _this._emitStateChanged(DRAGGING);\n };_this.\n\n _panResponderMove = function (e, _ref2) {var moveX = _ref2.moveX;\n var openValue = _this._getOpenValueForX(moveX);\n\n if (_this._isClosing) {\n openValue = 1 - (_this._closingAnchorValue - openValue);\n }\n\n if (openValue > 1) {\n openValue = 1;\n } else if (openValue < 0) {\n openValue = 0;\n }\n\n _this.state.openValue.setValue(openValue);\n };_this.\n\n _panResponderRelease = function (\n e, _ref3)\n\n {var moveX = _ref3.moveX,vx = _ref3.vx;\n var previouslyOpen = _this._isClosing;\n var isWithinVelocityThreshold = vx < VX_MAX && vx > -VX_MAX;\n\n if (_this.getDrawerPosition() === 'left') {\n if (\n vx > 0 && moveX > THRESHOLD ||\n vx >= VX_MAX ||\n isWithinVelocityThreshold &&\n previouslyOpen &&\n moveX > THRESHOLD)\n {\n _this.openDrawer({ velocity: vx });\n } else if (\n vx < 0 && moveX < THRESHOLD ||\n vx < -VX_MAX ||\n isWithinVelocityThreshold && !previouslyOpen)\n {\n _this.closeDrawer({ velocity: vx });\n } else if (previouslyOpen) {\n _this.openDrawer();\n } else {\n _this.closeDrawer();\n }\n } else {\n if (\n vx < 0 && moveX < THRESHOLD ||\n vx <= -VX_MAX ||\n isWithinVelocityThreshold &&\n previouslyOpen &&\n moveX < THRESHOLD)\n {\n _this.openDrawer({ velocity: -1 * vx });\n } else if (\n vx > 0 && moveX > THRESHOLD ||\n vx > VX_MAX ||\n isWithinVelocityThreshold && !previouslyOpen)\n {\n _this.closeDrawer({ velocity: -1 * vx });\n } else if (previouslyOpen) {\n _this.openDrawer();\n } else {\n _this.closeDrawer();\n }\n }\n };_this.\n\n _isLockedClosed = function () {\n return _this.props.drawerLockMode === 'locked-closed' &&\n !_this.state.drawerShown;\n };_this.\n\n _isLockedOpen = function () {\n return _this.props.drawerLockMode === 'locked-open' &&\n _this.state.drawerShown;\n };_this.state = { accessibilityViewIsModal: false, drawerShown: false, openValue: new _reactNative.Animated.Value(0) };return _this;}_createClass(DrawerLayout, [{ key: 'getDrawerPosition', value: function getDrawerPosition() {var drawerPosition = this.props.drawerPosition;var rtl = _reactNative.I18nManager.isRTL;return rtl ? drawerPosition === 'left' ? 'right' : 'left' : drawerPosition;} }, { key: 'componentWillMount', value: function componentWillMount() {var _this2 = this;var openValue = this.state.openValue;openValue.addListener(function (_ref4) {var value = _ref4.value;var drawerShown = value > 0;var accessibilityViewIsModal = drawerShown;if (drawerShown !== _this2.state.drawerShown) {_this2.setState({ drawerShown: drawerShown, accessibilityViewIsModal: accessibilityViewIsModal });}if (_this2.props.keyboardDismissMode === 'on-drag') {_reactNative.Keyboard.dismiss();}_this2._lastOpenValue = value;if (_this2.props.onDrawerSlide) {_this2.props.onDrawerSlide({ nativeEvent: { offset: value } });}});this._panResponder = _reactNative.PanResponder.create({ onMoveShouldSetPanResponder: this._shouldSetPanResponder, onPanResponderGrant: this._panResponderGrant, onPanResponderMove: this._panResponderMove, onPanResponderTerminationRequest: function onPanResponderTerminationRequest() {return false;}, onPanResponderRelease: this._panResponderRelease, onPanResponderTerminate: function onPanResponderTerminate() {} });} }, { key: 'render', value: function render() {var _state = this.state,accessibilityViewIsModal = _state.accessibilityViewIsModal,drawerShown = _state.drawerShown,openValue = _state.openValue;var _props = this.props,drawerBackgroundColor = _props.drawerBackgroundColor,drawerWidth = _props.drawerWidth,drawerPosition = _props.drawerPosition;var dynamicDrawerStyles = { backgroundColor: drawerBackgroundColor, width: drawerWidth, left: drawerPosition === 'left' ? 0 : null, right: drawerPosition === 'right' ? 0 : null };var outputRange = void 0;if (this.getDrawerPosition() === 'left') {outputRange = [-drawerWidth, 0];} else {outputRange = [drawerWidth, 0];}var drawerTranslateX = openValue.interpolate({ inputRange: [0, 1], outputRange: outputRange, extrapolate: 'clamp' });var animatedDrawerStyles = { transform: [{ translateX: drawerTranslateX }] };var overlayOpacity = openValue.interpolate({ inputRange: [0, 1], outputRange: [0, 0.7], extrapolate: 'clamp' });var animatedOverlayStyles = { opacity: overlayOpacity };var pointerEvents = drawerShown ? 'auto' : 'none';return _react2.default.createElement(_reactNative.View, _extends({ style: { flex: 1, backgroundColor: 'transparent' } }, this._panResponder.panHandlers, { __source: { fileName: _jsxFileName, lineNumber: 177 } }), _react2.default.createElement(_reactNative.Animated.View, { style: styles.main, __source: { fileName: _jsxFileName, lineNumber: 181 } }, this.props.children), _react2.default.createElement(_reactNative.TouchableWithoutFeedback, { pointerEvents: pointerEvents, onPress: this._onOverlayClick, __source: { fileName: _jsxFileName, lineNumber: 184 } }, _react2.default.createElement(_reactNative.Animated.View, { pointerEvents: pointerEvents, style: [styles.overlay, animatedOverlayStyles], __source: { fileName: _jsxFileName, lineNumber: 188 } })), _react2.default.createElement(_reactNative.Animated.View, { accessibilityViewIsModal: accessibilityViewIsModal, style: [styles.drawer, dynamicDrawerStyles, animatedDrawerStyles], __source: { fileName: _jsxFileName, lineNumber: 193 } }, this.props.renderNavigationView()));} }, { key: '_getOpenValueForX', value: function _getOpenValueForX(\n\n x) {var\n drawerWidth = this.props.drawerWidth;\n\n if (this.getDrawerPosition() === 'left') {\n return x / drawerWidth;\n }\n\n\n return (DEVICE_WIDTH - x) / drawerWidth;\n } }]);return DrawerLayout;}(_react.Component), _class.defaultProps = { drawerWidth: 0, drawerPosition: 'left', useNativeAnimations: false }, _class.positions = { Left: 'left', Right: 'right' }, _temp);exports.default = DrawerLayout;\n\n\nvar styles = _reactNative.StyleSheet.create({\n drawer: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n zIndex: 1001 },\n\n main: {\n flex: 1,\n zIndex: 0 },\n\n overlay: {\n backgroundColor: '#000',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 1000 } });","Object.defineProperty(exports,\"__esModule\",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;icentsLength?opts.precision:centsLength;cents=(cents+centsValue).slice(-centsSliced);}var unitToApply=opts.unit[opts.unit.length-1]===' '?opts.unit.substring(0,opts.unit.length-1):opts.unit;var output=unitToApply+masked+opts.separator+cents+opts.suffixUnit;return output.replace(clearSeparator,\"\");};VMasker.toPattern=function(value,opts){var pattern=typeof opts==='object'?opts.pattern:opts,patternChars=pattern.replace(/\\W/g,''),output=pattern.split(\"\"),values=value.toString().replace(/\\W/g,\"\"),charsValues=values.replace(/\\W/g,''),index=0,i,outputLength=output.length,placeholder=typeof opts==='object'?opts.placeholder:undefined;for(i=0;i=values.length){if(patternChars.length==charsValues.length){return output.join(\"\");}else if(placeholder!==undefined&&patternChars.length>charsValues.length){return addPlaceholdersToOutput(output,i,placeholder).join(\"\");}else{break;}}else{if(output[i]===DIGIT&&values[index].match(/[0-9]/)||output[i]===ALPHA&&values[index].match(/[a-zA-Z]/)||output[i]===ALPHANUM&&values[index].match(/[0-9a-zA-Z]/)){output[i]=values[index++];}else if(output[i]===DIGIT||output[i]===ALPHA||output[i]===ALPHANUM){if(placeholder!==undefined){return addPlaceholdersToOutput(output,i,placeholder).join(\"\");}else{return output.slice(0,i).join(\"\");}}}}return output.join(\"\").substr(0,i);};VMasker.toNumber=function(value){return value.toString().replace(/(?!^-)[^0-9]/g,\"\");};VMasker.toAlphaNumeric=function(value){return value.toString().replace(/[^a-z0-9 ]+/i,\"\");};return VMasker;});","Object.defineProperty(exports,\"__esModule\",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=9;}else{return numbers.length>=9;}}();if(use9DigitMask){mask=PHONE_9_MASK;}if(mergedSettings.withDDD){mask=''+mergedSettings.dddMask+mask;}return mask;}}],[{key:'getType',value:function getType(){return'cel-phone';}}]);return CelPhoneMask;}(_base2.default);exports.default=CelPhoneMask;","Object.defineProperty(exports,\"__esModule\",{value:true});exports.validateCnpj=exports.CNPJ_MASK=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i0?cnpj.charAt(i-1)*valida[i]:0;dig2+=cnpj.charAt(i)*valida[i];}dig1=dig1%11<2?0:11-dig1%11;dig2=dig2%11<2?0:11-dig2%11;return dig1*10+dig2==digito;};var customMaskOptions={mask:CNPJ_MASK};var CnpjMask=function(_BaseMask){_inherits(CnpjMask,_BaseMask);function CnpjMask(){_classCallCheck(this,CnpjMask);return _possibleConstructorReturn(this,(CnpjMask.__proto__||Object.getPrototypeOf(CnpjMask)).apply(this,arguments));}_createClass(CnpjMask,[{key:'getValue',value:function getValue(value,settings){return _custom2.default.shared.getValue(value,customMaskOptions);}},{key:'getRawValue',value:function getRawValue(maskedValue,settings){return _get(CnpjMask.prototype.__proto__||Object.getPrototypeOf(CnpjMask.prototype),'removeNotNumbers',this).call(this,maskedValue);}},{key:'validate',value:function validate(value,settings){var isEmpty=(value||'').trim().length===0;return!isEmpty&&validateCnpj(value);}},{key:'getMask',value:function getMask(value,settings){return CNPJ_MASK;}}],[{key:'getType',value:function getType(){return'cnpj';}}]);return CnpjMask;}(_base2.default);exports.default=CnpjMask;","Object.defineProperty(exports,\"__esModule\",{value:true});exports.validateCPF=exports.CPF_MASK=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){return text.substring(0,index)+string+text.substring(index,text.length);}else{return string+text;}}}],[{key:'getType',value:function getType(){return'money';}}]);return MoneyMask;}(_base2.default);exports.default=MoneyMask;","Object.defineProperty(exports,\"__esModule\",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i