(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6970],{6970:function(e,t,r){var i,n,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var r=0;rr&&(s=r),(l=(o="simple"!==n&&o?Math.max(Math.min(o,r-s),0):0)%a)&&(o-=l,s+=l),o===t.from&&s===t.size)?t:u(u({},t),{},{from:o,size:s})},x=e.default=function(e){var t,l;function u(e){var t,r,n;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,u),r=u,n=[e],r=s(r),(t=function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,o()?Reflect.construct(r,n||[],s(this).constructor):r.apply(this,n))).state=O(e,{itemsPerRow:1,from:e.initialIndex,size:0}),t.cache={},t.cachedScrollPosition=null,t.prevPrevState={},t.unstable=!1,t.updateCounter=0,t}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(u,e),t=[{key:"componentDidMount",value:function(){this.updateFrameAndClearCache=this.updateFrameAndClearCache.bind(this),window.addEventListener("resize",this.updateFrameAndClearCache),this.updateFrame(this.scrollTo.bind(this,this.props.initialIndex))}},{key:"componentDidUpdate",value:function(e){var t=this;if(this.props.axis!==e.axis&&this.clearSizeCache(),!this.unstable){if(++this.updateCounter>40)return this.unstable=!0,console.error("ReactList failed to reach a stable state.");this.updateCounterTimeoutId||(this.updateCounterTimeoutId=setTimeout(function(){t.updateCounter=0,delete t.updateCounterTimeoutId},0)),this.updateFrame()}}},{key:"maybeSetState",value:function(e,t){if(z(this.state,e))return t();this.setState(e,t)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateFrameAndClearCache),this.scrollParent.removeEventListener("scroll",this.updateFrameAndClearCache,P),this.scrollParent.removeEventListener("mousewheel",w,P)}},{key:"getOffset",value:function(e){var t=this.props.axis,r=e[p[t]]||0,i=v[t];do r+=e[i]||0;while(e=e.offsetParent);return r}},{key:"getEl",value:function(){return this.el||this.items}},{key:"getScrollPosition",value:function(){if("number"==typeof this.cachedScrollPosition)return this.cachedScrollPosition;var e=this.scrollParent,t=b[this.props.axis],r=e===window?document.body[t]||document.documentElement[t]:e[t],i=this.getScrollSize()-this.props.scrollParentViewportSizeGetter(this),n=this.getEl();return this.cachedScrollPosition=this.getOffset(e)+Math.max(0,Math.min(r,i))-this.getOffset(n),this.cachedScrollPosition}},{key:"setScroll",value:function(e){var t=this.scrollParent,r=this.props.axis;if(e+=this.getOffset(this.getEl()),t===window)return window.scrollTo(0,e);e-=this.getOffset(this.scrollParent),t[b[r]]=e}},{key:"getScrollSize",value:function(){var e=this.scrollParent,t=document,r=t.body,i=t.documentElement,n=S[this.props.axis];return e===window?Math.max(r[n],i[n]):e[n]}},{key:"hasDeterminateSize",value:function(){var e=this.props,t=e.itemSizeGetter;return"uniform"===e.type||t}},{key:"getStartAndEnd",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.threshold,t=this.getScrollPosition(),r=t+this.props.scrollParentViewportSizeGetter(this)+e;return this.hasDeterminateSize()&&(r=Math.min(r,this.getSpaceBefore(this.props.length))),{start:Math.max(0,t-e),end:r}}},{key:"getItemSizeAndItemsPerRow",value:function(){var e=this.props,t=e.axis,r=e.useStaticSize,i=this.state,n=i.itemSize,o=i.itemsPerRow;if(r&&n&&o)return{itemSize:n,itemsPerRow:o};var s=this.items.children;if(!s.length)return{};var a=s[0],l=a[m[t]],u=Math.abs(l-n);if((isNaN(u)||u>=1)&&(n=l),!n)return{};var c=v[t],h=a[c];o=1;for(var f=s[o];f&&f[c]===h;f=s[o])++o;return{itemSize:n,itemsPerRow:o}}},{key:"clearSizeCache",value:function(){this.cachedScrollPosition=null}},{key:"updateFrameAndClearCache",value:function(e){return this.clearSizeCache(),this.updateFrame(e)}},{key:"updateFrame",value:function(e){switch(this.updateScrollParent(),"function"!=typeof e&&(e=w),this.props.type){case"simple":return this.updateSimpleFrame(e);case"variable":return this.updateVariableFrame(e);case"uniform":return this.updateUniformFrame(e)}}},{key:"updateScrollParent",value:function(){var e=this.scrollParent;this.scrollParent=this.props.scrollParentGetter(this),e!==this.scrollParent&&(e&&(e.removeEventListener("scroll",this.updateFrameAndClearCache),e.removeEventListener("mousewheel",w)),this.clearSizeCache(),this.scrollParent.addEventListener("scroll",this.updateFrameAndClearCache,P),this.scrollParent.addEventListener("mousewheel",w,P))}},{key:"updateSimpleFrame",value:function(e){var t=this.getStartAndEnd().end,r=this.items.children,i=0;if(r.length){var n=this.props.axis,o=r[0],s=r[r.length-1];i=this.getOffset(s)+s[m[n]]-this.getOffset(o)}if(i>t)return e();var a=this.props,l=a.pageSize,u=a.length,c=Math.min(this.state.size+l,u);this.maybeSetState({size:c},e)}},{key:"updateVariableFrame",value:function(e){this.props.itemSizeGetter||this.cacheSizes();for(var t=this.getStartAndEnd(),r=t.start,i=t.end,n=this.props,o=n.length,s=n.pageSize,a=0,l=0,u=0,c=o-1;lr)break;a+=h,++l}for(var f=o-l;u1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t[e])return t[e];var r=this.state,i=r.itemSize,n=r.itemsPerRow;if(i)return t[e]=Math.floor(e/n)*i;for(var o=e;o>0&&null==t[--o];);for(var s=t[o]||0,a=o;a=u&&eo?this.setScroll(o):void 0}},{key:"getVisibleRange",value:function(){for(var e,t,r=this.state,i=r.from,n=r.size,o=this.getStartAndEnd(0),s=o.start,a=o.end,l={},u=i;us&&(e=u),null!=e&&c