UNPKG

@sheetxl/studio-vanilla

Version:

SheetXL Studio - Vanilla entry point for integrating SheetXL UI.

16 lines (14 loc) 124 kB
"use strict";/** * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.27 * * (C) 2025-present SheetXL Inc. & Michael T. Ford * License: The license can be found at https://www.sheetxl.com/license. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./Bc1oKNEzl3Kcj4g5.cjs"),Gt=f.reactExports.createContext(),At=f.reactExports.createContext();function jt(o){return f.generateUtilityClass("MuiTableCell",o)}const Ht=f.generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Dt=f.styled("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`size${f.capitalize(t.size)}`],t.padding!=="normal"&&e[`padding${f.capitalize(t.padding)}`],t.align!=="inherit"&&e[`align${f.capitalize(t.align)}`],t.stickyHeader&&e.stickyHeader]}})(f.memoTheme(({theme:o})=>({...o.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:o.vars?`1px solid ${o.vars.palette.TableCell.border}`:`1px solid ${o.palette.mode==="light"?o.lighten(o.alpha(o.palette.divider,1),.88):o.darken(o.alpha(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Ht.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),Re=f.reactExports.forwardRef(function(o,e){const t=f.useDefaultProps({props:o,name:"MuiTableCell"}),{align:r="inherit",className:n,component:i,padding:l,scope:a,size:s,sortDirection:c,variant:d,...h}=t,p=f.reactExports.useContext(Gt),u=f.reactExports.useContext(At),_=u&&u.variant==="head";let m;m=i||(_?"th":"td");let S=a;m==="td"?S=void 0:!S&&_&&(S="col");const y=d||u&&u.variant,x={...t,align:r,component:m,padding:l||(p&&p.padding?p.padding:"normal"),size:s||(p&&p.size?p.size:"medium"),sortDirection:c,stickyHeader:y==="head"&&p&&p.stickyHeader,variant:y},v=(w=>{const{classes:R,variant:b,align:z,padding:T,size:k,stickyHeader:P}=w,O={root:["root",b,P&&"stickyHeader",z!=="inherit"&&`align${f.capitalize(z)}`,T!=="normal"&&`padding${f.capitalize(T)}`,`size${f.capitalize(k)}`]};return f.composeClasses(O,jt,R)})(x);let C=null;return c&&(C=c==="asc"?"ascending":"descending"),f.jsxRuntimeExports.jsx(Dt,{as:m,ref:e,className:f.clsx(v.root,n),"aria-sort":C,scope:S,ownerState:x,...h})});function E(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function K(o){return(K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(o)}function nt(o){var e=(function(t){if(K(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,"string");if(K(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)})(o);return K(e)=="symbol"?e:e+""}function be(o,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,nt(r.key),r)}}function L(o,e,t){return e&&be(o.prototype,e),t&&be(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function A(o,e){if(e&&(K(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t})(o)}function I(o){return(I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(o)}function j(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&f.Bn(o,e)}function g(o,e,t){return(e=nt(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function it(){var o=this.constructor.getDerivedStateFromProps(this.props,this.state);o!=null&&this.setState(o)}function lt(o){this.setState(function(e){return this.constructor.getDerivedStateFromProps(o,e)??null}.bind(this))}function st(o,e){try{var t=this.props,r=this.state;this.props=o,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(t,r)}finally{this.props=t,this.state=r}}function re(o){var e=o.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if(typeof o.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function")return o;var t=null,r=null,n=null;if(typeof e.componentWillMount=="function"?t="componentWillMount":typeof e.UNSAFE_componentWillMount=="function"&&(t="UNSAFE_componentWillMount"),typeof e.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof e.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof e.componentWillUpdate=="function"?n="componentWillUpdate":typeof e.UNSAFE_componentWillUpdate=="function"&&(n="UNSAFE_componentWillUpdate"),t!==null||r!==null||n!==null){var i=o.displayName||o.name,l=typeof o.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+i+" uses "+l+" but also contains the following legacy lifecycles:"+(t!==null?` `+t:"")+(r!==null?` `+r:"")+(n!==null?` `+n:"")+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof o.getDerivedStateFromProps=="function"&&(e.componentWillMount=it,e.componentWillReceiveProps=lt),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=st;var a=e.componentDidUpdate;e.componentDidUpdate=function(s,c,d){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;a.call(this,s,c,h)}}return o}function ze(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function Te(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ze(Object(t),!0).forEach(function(r){g(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):ze(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function at(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(at=function(){return!!o})()}it.__suppressDeprecationWarning=!0,lt.__suppressDeprecationWarning=!0,st.__suppressDeprecationWarning=!0;var Ie=(function(){function o(){var e,t,r,n;E(this,o);for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return t=this,r=o,n=[].concat(l),r=I(r),g(e=A(t,at()?Reflect.construct(r,n||[],I(t).constructor):r.apply(t,n)),"state",{scrollToColumn:0,scrollToRow:0,instanceProps:{prevScrollToColumn:0,prevScrollToRow:0}}),g(e,"_columnStartIndex",0),g(e,"_columnStopIndex",0),g(e,"_rowStartIndex",0),g(e,"_rowStopIndex",0),g(e,"_onKeyDown",function(s){var c=e.props,d=c.columnCount,h=c.disabled,p=c.mode,u=c.rowCount;if(!h){var _=e._getScrollState(),m=_.scrollToColumn,S=_.scrollToRow,y=e._getScrollState(),x=y.scrollToColumn,v=y.scrollToRow;switch(s.key){case"ArrowDown":v=Math.min(p==="cells"?v+1:e._rowStopIndex+1,u-1);break;case"ArrowLeft":x=Math.max(p==="cells"?x-1:e._columnStartIndex-1,0);break;case"ArrowRight":x=Math.min(p==="cells"?x+1:e._columnStopIndex+1,d-1);break;case"ArrowUp":v=Math.max(p==="cells"?v-1:e._rowStartIndex-1,0)}x===m&&v===S||(s.preventDefault(),e._updateScrollState({scrollToColumn:x,scrollToRow:v}))}}),g(e,"_onSectionRendered",function(s){var c=s.columnStartIndex,d=s.columnStopIndex,h=s.rowStartIndex,p=s.rowStopIndex;e._columnStartIndex=c,e._columnStopIndex=d,e._rowStartIndex=h,e._rowStopIndex=p}),e}return j(o,f.reactExports.PureComponent),L(o,[{key:"setScrollIndexes",value:function(e){var t=e.scrollToColumn,r=e.scrollToRow;this.setState({scrollToRow:r,scrollToColumn:t})}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.children,n=this._getScrollState(),i=n.scrollToColumn,l=n.scrollToRow;return f.reactExports.createElement("div",{className:t,onKeyDown:this._onKeyDown},r({onSectionRendered:this._onSectionRendered,scrollToColumn:i,scrollToRow:l}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(e){var t=e.scrollToColumn,r=e.scrollToRow,n=this.props,i=n.isControlled,l=n.onScrollToChange;typeof l=="function"&&l({scrollToColumn:t,scrollToRow:r}),i||this.setState({scrollToColumn:t,scrollToRow:r})}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.isControlled?{}:e.scrollToColumn!==t.instanceProps.prevScrollToColumn||e.scrollToRow!==t.instanceProps.prevScrollToRow?Te(Te({},t),{},{scrollToColumn:e.scrollToColumn,scrollToRow:e.scrollToRow,instanceProps:{prevScrollToColumn:e.scrollToColumn,prevScrollToRow:e.scrollToRow}}):{}}}])})();function ct(o,e){var t,r,n=(t=e!==void 0?e:typeof window<"u"?window:typeof self<"u"?self:global).document!==void 0&&t.document.attachEvent;if(!n){var i=(r=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||function(v){return t.setTimeout(v,20)},function(v){return r(v)}),l=(function(){var v=t.cancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelAnimationFrame||t.clearTimeout;return function(C){return v(C)}})(),a=function(v){var C=v.__resizeTriggers__,w=C.firstElementChild,R=C.lastElementChild,b=w.firstElementChild;R.scrollLeft=R.scrollWidth,R.scrollTop=R.scrollHeight,b.style.width=w.offsetWidth+1+"px",b.style.height=w.offsetHeight+1+"px",w.scrollLeft=w.scrollWidth,w.scrollTop=w.scrollHeight},s=function(v){if(!(v.target.className&&typeof v.target.className.indexOf=="function"&&v.target.className.indexOf("contract-trigger")<0&&v.target.className.indexOf("expand-trigger")<0)){var C=this;a(this),this.__resizeRAF__&&l(this.__resizeRAF__),this.__resizeRAF__=i(function(){var w;((w=C).offsetWidth!=w.__resizeLast__.width||w.offsetHeight!=w.__resizeLast__.height)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(R){R.call(C,v)}))})}},c=!1,d="",h="animationstart",p="Webkit Moz O ms".split(" "),u="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),_=t.document.createElement("fakeelement");if(_.style.animationName!==void 0&&(c=!0),c===!1){for(var m=0;m<p.length;m++)if(_.style[p[m]+"AnimationName"]!==void 0){d="-"+p[m].toLowerCase()+"-",h=u[m],c=!0;break}}var S="resizeanim",y="@"+d+"keyframes "+S+" { from { opacity: 0; } to { opacity: 0; } } ",x=d+"animation: 1ms "+S+"; "}return{addResizeListener:function(v,C){if(n)v.attachEvent("onresize",C);else{if(!v.__resizeTriggers__){var w=v.ownerDocument,R=t.getComputedStyle(v);R&&R.position=="static"&&(v.style.position="relative"),(function(T){if(!T.getElementById("detectElementResize")){var k=(y||"")+".resize-triggers { "+(x||"")+'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%; }',P=T.head||T.getElementsByTagName("head")[0],O=T.createElement("style");O.id="detectElementResize",O.type="text/css",o!=null&&O.setAttribute("nonce",o),O.styleSheet?O.styleSheet.cssText=k:O.appendChild(T.createTextNode(k)),P.appendChild(O)}})(w),v.__resizeLast__={},v.__resizeListeners__=[],(v.__resizeTriggers__=w.createElement("div")).className="resize-triggers";var b=w.createElement("div");b.className="expand-trigger",b.appendChild(w.createElement("div"));var z=w.createElement("div");z.className="contract-trigger",v.__resizeTriggers__.appendChild(b),v.__resizeTriggers__.appendChild(z),v.appendChild(v.__resizeTriggers__),a(v),v.addEventListener("scroll",s,!0),h&&(v.__resizeTriggers__.__animationListener__=function(T){T.animationName==S&&a(v)},v.__resizeTriggers__.addEventListener(h,v.__resizeTriggers__.__animationListener__))}v.__resizeListeners__.push(C)}},removeResizeListener:function(v,C){if(n)v.detachEvent("onresize",C);else if(v.__resizeListeners__.splice(v.__resizeListeners__.indexOf(C),1),!v.__resizeListeners__.length){v.removeEventListener("scroll",s,!0),v.__resizeTriggers__.__animationListener__&&(v.__resizeTriggers__.removeEventListener(h,v.__resizeTriggers__.__animationListener__),v.__resizeTriggers__.__animationListener__=null);try{v.__resizeTriggers__=!v.removeChild(v.__resizeTriggers__)}catch{}}}}}function Oe(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function ke(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oe(Object(t),!0).forEach(function(r){g(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function dt(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dt=function(){return!!o})()}g(Ie,"defaultProps",{disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0}),re(Ie);var ut=(function(){function o(){var e,t,r,n;E(this,o);for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return t=this,r=o,n=[].concat(l),r=I(r),g(e=A(t,dt()?Reflect.construct(r,n||[],I(t).constructor):r.apply(t,n)),"state",{height:e.props.defaultHeight||0,width:e.props.defaultWidth||0}),g(e,"_parentNode",void 0),g(e,"_autoSizer",void 0),g(e,"_window",void 0),g(e,"_detectElementResize",void 0),g(e,"_onResize",function(){var s=e.props,c=s.disableHeight,d=s.disableWidth,h=s.onResize;if(e._parentNode){var p=e._parentNode.offsetHeight||0,u=e._parentNode.offsetWidth||0,_=(e._window||window).getComputedStyle(e._parentNode)||{},m=parseInt(_.paddingLeft,10)||0,S=parseInt(_.paddingRight,10)||0,y=parseInt(_.paddingTop,10)||0,x=parseInt(_.paddingBottom,10)||0,v=p-y-x,C=u-m-S;(!c&&e.state.height!==v||!d&&e.state.width!==C)&&(e.setState({height:p-y-x,width:u-m-S}),h({height:p,width:u}))}}),g(e,"_setRef",function(s){e._autoSizer=s}),e}return j(o,f.reactExports.Component),L(o,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=ct(e,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.disableHeight,i=e.disableWidth,l=e.style,a=this.state,s=a.height,c=a.width,d={overflow:"visible"},h={};return n||(d.height=0,h.height=s),i||(d.width=0,h.width=c),f.reactExports.createElement("div",{className:r,ref:this._setRef,style:ke(ke({},d),l)},t(h))}}])})();function ht(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ht=function(){return!!o})()}g(ut,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}});var Wt=(function(){function o(){var e,t,r,n;E(this,o);for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return t=this,r=o,n=[].concat(l),r=I(r),g(e=A(t,ht()?Reflect.construct(r,n||[],I(t).constructor):r.apply(t,n)),"_child",f.reactExports.createRef()),g(e,"_measure",function(){var s=e.props,c=s.cache,d=s.columnIndex,h=d===void 0?0:d,p=s.parent,u=s.rowIndex,_=u===void 0?e.props.index||0:u,m=e._getCellMeasurements(),S=m.height,y=m.width;S===c.getHeight(_,h)&&y===c.getWidth(_,h)||(c.set(_,h,y,S),p&&typeof p.recomputeGridSize=="function"&&p.recomputeGridSize({columnIndex:h,rowIndex:_}))}),g(e,"_registerChild",function(s){!s||s instanceof Element||console.warn("CellMeasurer registerChild expects to be passed Element or null"),e._child.current=s,s&&e._maybeMeasureCell()}),e}return j(o,f.reactExports.PureComponent),L(o,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var e=this,t=this.props.children,r=typeof t=="function"?t({measure:this._measure,registerChild:this._registerChild}):t;return r===null?r:f.reactExports.cloneElement(r,{ref:function(n){typeof r.ref=="function"?r.ref(n):r.ref&&(r.ref.current=n),e._child.current=n}})}},{key:"_getCellMeasurements",value:function(){var e=this.props.cache,t=this._child.current;if(t&&t.ownerDocument&&t.ownerDocument.defaultView&&t instanceof t.ownerDocument.defaultView.HTMLElement){var r=t.style.width,n=t.style.height;e.hasFixedWidth()||(t.style.width="auto"),e.hasFixedHeight()||(t.style.height="auto");var i=Math.ceil(t.offsetHeight),l=Math.ceil(t.offsetWidth);return r&&(t.style.width=r),n&&(t.style.height=n),{height:i,width:l}}return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var e=this.props,t=e.cache,r=e.columnIndex,n=r===void 0?0:r,i=e.parent,l=e.rowIndex,a=l===void 0?this.props.index||0:l;if(!t.has(a,n)){var s=this._getCellMeasurements(),c=s.height,d=s.width;t.set(a,n,d,c),i&&typeof i.invalidateCellSizeAfterRender=="function"&&i.invalidateCellSizeAfterRender({columnIndex:n,rowIndex:a})}}}])})();function $(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e={};return function(t){var r=t.callback,n=t.indices,i=Object.keys(n),l=!o||i.every(function(s){var c=n[s];return Array.isArray(c)?c.length>0:c>=0}),a=i.length!==Object.keys(e).length||i.some(function(s){var c=e[s],d=n[s];return Array.isArray(d)?c.join(",")!==d.join(","):c!==d});e=n,l&&a&&r(n)}}g(Wt,"__internalCellMeasurerFlag",!1);const Ft=!(typeof window>"u"||!window.document||!window.document.createElement);var ne;function pe(o){if((!ne&&ne!==0||o)&&Ft){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),ne=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return ne}function Pe(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function Me(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pe(Object(t),!0).forEach(function(r){g(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Pe(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function pt(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pt=function(){return!!o})()}var X="requested",le=(function(){function o(){var e,t,r,n;E(this,o);for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return t=this,r=o,n=[].concat(l),r=I(r),g(e=A(t,pt()?Reflect.construct(r,n||[],I(t).constructor):r.apply(t,n)),"state",{isScrolling:!1,scrollLeft:0,scrollTop:0}),g(e,"_calculateSizeAndPositionDataOnNextUpdate",!1),g(e,"_onSectionRenderedMemoizer",$()),g(e,"_onScrollMemoizer",$(!1)),g(e,"_invokeOnSectionRenderedHelper",function(){var s=e.props,c=s.cellLayoutManager,d=s.onSectionRendered;e._onSectionRenderedMemoizer({callback:d,indices:{indices:c.getLastRenderedIndices()}})}),g(e,"_setScrollingContainerRef",function(s){e._scrollingContainer=s}),g(e,"_updateScrollPositionForScrollToCell",function(){var s=e.props,c=s.cellLayoutManager,d=s.height,h=s.scrollToAlignment,p=s.scrollToCell,u=s.width,_=e.state,m=_.scrollLeft,S=_.scrollTop;if(p>=0){var y=c.getScrollPositionForCell({align:h,cellIndex:p,height:d,scrollLeft:m,scrollTop:S,width:u});y.scrollLeft===m&&y.scrollTop===S||e._setScrollPosition(y)}}),g(e,"_onScroll",function(s){if(s.target===e._scrollingContainer){e._enablePointerEventsAfterDelay();var c=e.props,d=c.cellLayoutManager,h=c.height,p=c.isScrollingChange,u=c.width,_=e._scrollbarSize,m=d.getTotalSize(),S=m.height,y=m.width,x=Math.max(0,Math.min(y-u+_,s.target.scrollLeft)),v=Math.max(0,Math.min(S-h+_,s.target.scrollTop));if(e.state.scrollLeft!==x||e.state.scrollTop!==v){var C=s.cancelable?"observed":X;e.state.isScrolling||p(!0),e.setState({isScrolling:!0,scrollLeft:x,scrollPositionChangeReason:C,scrollTop:v})}e._invokeOnScrollMemoizer({scrollLeft:x,scrollTop:v,totalWidth:y,totalHeight:S})}}),e._scrollbarSize=pe(),e._scrollbarSize===void 0?(e._scrollbarSizeMeasured=!1,e._scrollbarSize=0):e._scrollbarSizeMeasured=!0,e}return j(o,f.reactExports.PureComponent),L(o,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var e=this.props,t=e.cellLayoutManager,r=e.scrollLeft,n=e.scrollToCell,i=e.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=pe(),this._scrollbarSizeMeasured=!0,this.setState({})),n>=0?this._updateScrollPositionForScrollToCell():(r>=0||i>=0)&&this._setScrollPosition({scrollLeft:r,scrollTop:i}),this._invokeOnSectionRenderedHelper();var l=t.getTotalSize(),a=l.height,s=l.width;this._invokeOnScrollMemoizer({scrollLeft:r||0,scrollTop:i||0,totalHeight:a,totalWidth:s})}},{key:"componentDidUpdate",value:function(e,t){var r=this.props,n=r.height,i=r.scrollToAlignment,l=r.scrollToCell,a=r.width,s=this.state,c=s.scrollLeft,d=s.scrollPositionChangeReason,h=s.scrollTop;d===X&&(c>=0&&c!==t.scrollLeft&&c!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=c),h>=0&&h!==t.scrollTop&&h!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=h)),n===e.height&&i===e.scrollToAlignment&&l===e.scrollToCell&&a===e.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var e=this.props,t=e.autoHeight,r=e.cellCount,n=e.cellLayoutManager,i=e.className,l=e.height,a=e.horizontalOverscanSize,s=e.id,c=e.noContentRenderer,d=e.style,h=e.verticalOverscanSize,p=e.width,u=this.state,_=u.isScrolling,m=u.scrollLeft,S=u.scrollTop;(this._lastRenderedCellCount!==r||this._lastRenderedCellLayoutManager!==n||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=r,this._lastRenderedCellLayoutManager=n,this._calculateSizeAndPositionDataOnNextUpdate=!1,n.calculateSizeAndPositionData());var y=n.getTotalSize(),x=y.height,v=y.width,C=Math.max(0,m-a),w=Math.max(0,S-h),R=Math.min(v,m+p+a),b=Math.min(x,S+l+h),z=l>0&&p>0?n.cellRenderers({height:b-w,isScrolling:_,width:R-C,x:C,y:w}):[],T={boxSizing:"border-box",direction:"ltr",height:t?"auto":l,position:"relative",WebkitOverflowScrolling:"touch",width:p,willChange:"transform"},k=x>l?this._scrollbarSize:0,P=v>p?this._scrollbarSize:0;return T.overflowX=v+k<=p?"hidden":"auto",T.overflowY=x+P<=l?"hidden":"auto",f.reactExports.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:f.Kt("ReactVirtualized__Collection",i),id:s,onScroll:this._onScroll,role:"grid",style:Me(Me({},T),d),tabIndex:0},r>0&&f.reactExports.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:x,maxHeight:x,maxWidth:v,overflow:"hidden",pointerEvents:_?"none":"",width:v}},z),r===0&&c())}},{key:"_enablePointerEventsAfterDelay",value:function(){var e=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){(0,e.props.isScrollingChange)(!1),e._disablePointerEventsTimeoutId=null,e.setState({isScrolling:!1})},150)}},{key:"_invokeOnScrollMemoizer",value:function(e){var t=this,r=e.scrollLeft,n=e.scrollTop,i=e.totalHeight,l=e.totalWidth;this._onScrollMemoizer({callback:function(a){var s=a.scrollLeft,c=a.scrollTop,d=t.props,h=d.height;(0,d.onScroll)({clientHeight:h,clientWidth:d.width,scrollHeight:i,scrollLeft:s,scrollTop:c,scrollWidth:l})},indices:{scrollLeft:r,scrollTop:n}})}},{key:"_setScrollPosition",value:function(e){var t=e.scrollLeft,r=e.scrollTop,n={scrollPositionChangeReason:X};t>=0&&(n.scrollLeft=t),r>=0&&(n.scrollTop=r),(t>=0&&t!==this.state.scrollLeft||r>=0&&r!==this.state.scrollTop)&&this.setState(n)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.cellCount!==0||t.scrollLeft===0&&t.scrollTop===0?e.scrollLeft!==t.scrollLeft||e.scrollTop!==t.scrollTop?{scrollLeft:e.scrollLeft!=null?e.scrollLeft:t.scrollLeft,scrollTop:e.scrollTop!=null?e.scrollTop:t.scrollTop,scrollPositionChangeReason:X}:null:{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:X}}}])})();g(le,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0}),le.propTypes={},re(le);var Nt=L(function o(e){var t=e.height,r=e.width,n=e.x,i=e.y;E(this,o),this.height=t,this.width=r,this.x=n,this.y=i,this._indexMap={},this._indices=[]},[{key:"addCellIndex",value:function(o){var e=o.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}]),Bt=L(function o(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;E(this,o),this._sectionSize=e,this._cellMetadata=[],this._sections={}},[{key:"getCellIndices",value:function(o){var e=o.height,t=o.width,r=o.x,n=o.y,i={};return this.getSections({height:e,width:t,x:r,y:n}).forEach(function(l){return l.getCellIndices().forEach(function(a){i[a]=a})}),Object.keys(i).map(function(l){return i[l]})}},{key:"getCellMetadata",value:function(o){var e=o.index;return this._cellMetadata[e]}},{key:"getSections",value:function(o){for(var e=o.height,t=o.width,r=o.x,n=o.y,i=Math.floor(r/this._sectionSize),l=Math.floor((r+t-1)/this._sectionSize),a=Math.floor(n/this._sectionSize),s=Math.floor((n+e-1)/this._sectionSize),c=[],d=i;d<=l;d++)for(var h=a;h<=s;h++){var p="".concat(d,".").concat(h);this._sections[p]||(this._sections[p]=new Nt({height:this._sectionSize,width:this._sectionSize,x:d*this._sectionSize,y:h*this._sectionSize})),c.push(this._sections[p])}return c}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var o=this;return Object.keys(this._sections).map(function(e){return o._sections[e].toString()})}},{key:"registerCell",value:function(o){var e=o.cellMetadatum,t=o.index;this._cellMetadata[t]=e,this.getSections(e).forEach(function(r){return r.addCellIndex({index:t})})}}]);function Ee(o){var e=o.align,t=e===void 0?"auto":e,r=o.cellOffset,n=o.cellSize,i=o.containerSize,l=o.currentOffset,a=r,s=a-i+n;switch(t){case"start":return a;case"end":return s;case"center":return a-(i-n)/2;default:return Math.max(s,Math.min(a,l))}}function ft(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ft=function(){return!!o})()}var Le=(function(){function o(e,t){var r,n,i,l;return E(this,o),n=this,l=[e,t],i=I(i=o),(r=A(n,ft()?Reflect.construct(i,l||[],I(n).constructor):i.apply(n,l)))._cellMetadata=[],r._lastRenderedCellIndices=[],r._cellCache=[],r._isScrollingChange=r._isScrollingChange.bind(r),r._setCollectionViewRef=r._setCollectionViewRef.bind(r),r}return j(o,f.reactExports.PureComponent),L(o,[{key:"forceUpdate",value:function(){this._collectionView!==void 0&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var e=f.On({},((function(t){if(t==null)throw new TypeError("Cannot destructure "+t)})(this.props),this.props));return f.reactExports.createElement(le,f.On({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},e))}},{key:"calculateSizeAndPositionData",value:function(){var e=this.props,t=(function(r){for(var n=r.cellCount,i=r.cellSizeAndPositionGetter,l=[],a=new Bt(r.sectionSize),s=0,c=0,d=0;d<n;d++){var h=i({index:d});if(h.height==null||isNaN(h.height)||h.width==null||isNaN(h.width)||h.x==null||isNaN(h.x)||h.y==null||isNaN(h.y))throw Error("Invalid metadata returned for cell ".concat(d,`: x:`).concat(h.x,", y:").concat(h.y,", width:").concat(h.width,", height:").concat(h.height));s=Math.max(s,h.y+h.height),c=Math.max(c,h.x+h.width),l[d]=h,a.registerCell({cellMetadatum:h,index:d})}return{cellMetadata:l,height:s,sectionManager:a,width:c}})({cellCount:e.cellCount,cellSizeAndPositionGetter:e.cellSizeAndPositionGetter,sectionSize:e.sectionSize});this._cellMetadata=t.cellMetadata,this._sectionManager=t.sectionManager,this._height=t.height,this._width=t.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(e){var t=e.align,r=e.cellIndex,n=e.height,i=e.scrollLeft,l=e.scrollTop,a=e.width,s=this.props.cellCount;if(r>=0&&r<s){var c=this._cellMetadata[r];i=Ee({align:t,cellOffset:c.x,cellSize:c.width,containerSize:a,currentOffset:i}),l=Ee({align:t,cellOffset:c.y,cellSize:c.height,containerSize:n,currentOffset:l})}return{scrollLeft:i,scrollTop:l}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(e){var t=this,r=e.height,n=e.isScrolling,i=e.width,l=e.x,a=e.y,s=this.props,c=s.cellGroupRenderer,d=s.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:r,width:i,x:l,y:a}),c({cellCache:this._cellCache,cellRenderer:d,cellSizeAndPositionGetter:function(h){var p=h.index;return t._sectionManager.getCellMetadata({index:p})},indices:this._lastRenderedCellIndices,isScrolling:n})}},{key:"_isScrollingChange",value:function(e){e||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(e){this._collectionView=e}}])})();function gt(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gt=function(){return!!o})()}function Ge(o){var e=o.cellCount,t=o.cellSize,r=o.computeMetadataCallback,n=o.computeMetadataCallbackProps,i=o.nextCellsCount,l=o.nextCellSize,a=o.nextScrollToIndex,s=o.scrollToIndex,c=o.updateScrollOffsetForScrollToIndex;e===i&&(typeof t!="number"&&typeof l!="number"||t===l)||(r(n),s>=0&&s===a&&c())}function J(o,e){if(o==null)return{};var t,r,n=f.ti(o,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);for(r=0;r<i.length;r++)t=i[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(o,t)&&(n[t]=o[t])}return n}g(Le,"defaultProps",{"aria-label":"grid",cellGroupRenderer:function(o){var e=o.cellCache,t=o.cellRenderer,r=o.cellSizeAndPositionGetter,n=o.indices,i=o.isScrolling;return n.map(function(l){var a=r({index:l}),s={index:l,isScrolling:i,key:l,style:{height:a.height,left:a.x,position:"absolute",top:a.y,width:a.width}};return i?(l in e||(e[l]=t(s)),e[l]):t(s)}).filter(function(l){return!!l})}}),Le.propTypes={},(function(){function o(e,t){var r,n,i,l;return E(this,o),n=this,l=[e,t],i=I(i=o),(r=A(n,gt()?Reflect.construct(i,l||[],I(n).constructor):i.apply(n,l)))._registerChild=r._registerChild.bind(r),r}return j(o,f.reactExports.PureComponent),L(o,[{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.columnMaxWidth,n=t.columnMinWidth,i=t.columnCount,l=t.width;r===e.columnMaxWidth&&n===e.columnMinWidth&&i===e.columnCount&&l===e.width||this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.columnMaxWidth,n=e.columnMinWidth,i=e.columnCount,l=e.width,a=n||1,s=r?Math.min(r,l):l,c=l/i;return c=Math.max(a,c),c=Math.min(s,c),c=Math.floor(c),t({adjustedWidth:Math.min(l,c*i),columnWidth:c,getColumnWidth:function(){return c},registerChild:this._registerChild})}},{key:"_registerChild",value:function(e){if(e&&typeof e.recomputeGridSize!="function")throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=e,this._registeredChild&&this._registeredChild.recomputeGridSize()}}])})().propTypes={};var W,Ut=L(function o(e){var t=e.cellCount,r=e.cellSizeGetter,n=e.estimatedCellSize;E(this,o),g(this,"_cellSizeAndPositionData",{}),g(this,"_lastMeasuredIndex",-1),g(this,"_lastBatchedIndex",-1),g(this,"_cellCount",void 0),g(this,"_cellSizeGetter",void 0),g(this,"_estimatedCellSize",void 0),this._cellSizeGetter=r,this._cellCount=t,this._estimatedCellSize=n},[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(o){var e=o.cellCount,t=o.estimatedCellSize,r=o.cellSizeGetter;this._cellCount=e,this._estimatedCellSize=t,this._cellSizeGetter=r}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(o){if(o<0||o>=this._cellCount)throw Error("Requested index ".concat(o," is outside of range 0..").concat(this._cellCount));if(o>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),t=e.offset+e.size,r=this._lastMeasuredIndex+1;r<=o;r++){var n=this._cellSizeGetter({index:r});if(n===void 0||isNaN(n))throw Error("Invalid size returned for cell ".concat(r," of value ").concat(n));n===null?(this._cellSizeAndPositionData[r]={offset:t,size:0},this._lastBatchedIndex=o):(this._cellSizeAndPositionData[r]={offset:t,size:n},t+=n,this._lastMeasuredIndex=o)}return this._cellSizeAndPositionData[o]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var o=this.getSizeAndPositionOfLastMeasuredCell();return o.offset+o.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(o){var e=o.align,t=e===void 0?"auto":e,r=o.containerSize,n=o.currentOffset,i=o.targetIndex;if(r<=0)return 0;var l,a=this.getSizeAndPositionOfCell(i),s=a.offset,c=s-r+a.size;switch(t){case"start":l=s;break;case"end":l=c;break;case"center":l=s-(r-a.size)/2;break;default:l=Math.max(c,Math.min(s,n))}var d=this.getTotalSize();return Math.max(0,Math.min(d-r,l))}},{key:"getVisibleCellRange",value:function(o){var e=o.containerSize,t=o.offset;if(this.getTotalSize()===0)return{};var r=t+e,n=this._findNearestCell(t),i=this.getSizeAndPositionOfCell(n);t=i.offset+i.size;for(var l=n;t<r&&l<this._cellCount-1;)l++,t+=this.getSizeAndPositionOfCell(l).size;return{start:n,stop:l}}},{key:"resetCell",value:function(o){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,o-1)}},{key:"_binarySearch",value:function(o,e,t){for(;e<=o;){var r=e+Math.floor((o-e)/2),n=this.getSizeAndPositionOfCell(r).offset;if(n===t)return r;n<t?e=r+1:n>t&&(o=r-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(o,e){for(var t=1;o<this._cellCount&&this.getSizeAndPositionOfCell(o).offset<e;)o+=t,t*=2;return this._binarySearch(Math.min(o,this._cellCount-1),Math.floor(o/2),e)}},{key:"_findNearestCell",value:function(o){if(isNaN(o))throw Error("Invalid offset ".concat(o," specified"));o=Math.max(0,o);var e=this.getSizeAndPositionOfLastMeasuredCell(),t=Math.max(0,this._lastMeasuredIndex);return e.offset>=o?this._binarySearch(t,0,o):this._exponentialSearch(t,o)}}]),Vt=["maxScrollSize"],Ae=L(function o(e){var t=e.maxScrollSize,r=t===void 0?typeof window<"u"&&window.chrome?16777100:15e5:t,n=J(e,Vt);E(this,o),g(this,"_cellSizeAndPositionManager",void 0),g(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new Ut(n),this._maxScrollSize=r},[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(o){this._cellSizeAndPositionManager.configure(o)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(o){var e=o.containerSize,t=o.offset,r=this._cellSizeAndPositionManager.getTotalSize(),n=this.getTotalSize(),i=this._getOffsetPercentage({containerSize:e,offset:t,totalSize:n});return Math.round(i*(n-r))}},{key:"getSizeAndPositionOfCell",value:function(o){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(o)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(o){var e=o.align,t=e===void 0?"auto":e,r=o.containerSize,n=o.currentOffset,i=o.targetIndex;n=this._safeOffsetToOffset({containerSize:r,offset:n});var l=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:t,containerSize:r,currentOffset:n,targetIndex:i});return this._offsetToSafeOffset({containerSize:r,offset:l})}},{key:"getVisibleCellRange",value:function(o){var e=o.containerSize,t=o.offset;return t=this._safeOffsetToOffset({containerSize:e,offset:t}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:t})}},{key:"resetCell",value:function(o){this._cellSizeAndPositionManager.resetCell(o)}},{key:"_getOffsetPercentage",value:function(o){var e=o.containerSize,t=o.offset,r=o.totalSize;return r<=e?0:t/(r-e)}},{key:"_offsetToSafeOffset",value:function(o){var e=o.containerSize,t=o.offset,r=this._cellSizeAndPositionManager.getTotalSize(),n=this.getTotalSize();if(r===n)return t;var i=this._getOffsetPercentage({containerSize:e,offset:t,totalSize:r});return Math.round(i*(n-e))}},{key:"_safeOffsetToOffset",value:function(o){var e=o.containerSize,t=o.offset,r=this._cellSizeAndPositionManager.getTotalSize(),n=this.getTotalSize();if(r===n)return t;var i=this._getOffsetPercentage({containerSize:e,offset:t,totalSize:n});return Math.round(i*(r-e))}}]);function je(o){var e=o.cellSize,t=o.cellSizeAndPositionManager,r=o.previousCellsCount,n=o.previousCellSize,i=o.previousScrollToAlignment,l=o.previousScrollToIndex,a=o.previousSize,s=o.scrollOffset,c=o.scrollToAlignment,d=o.scrollToIndex,h=o.size,p=o.sizeJustIncreasedFromZero,u=o.updateScrollIndexCallback,_=t.getCellCount(),m=d>=0&&d<_;m&&(h!==a||p||!n||typeof e=="number"&&e!==n||c!==i||d!==l)?u(d):!m&&_>0&&(h<a||_<r)&&s>t.getTotalSize()-h&&u(_-1)}var Kt=(W=typeof window<"u"?window:typeof self<"u"?self:{}).requestAnimationFrame||W.webkitRequestAnimationFrame||W.mozRequestAnimationFrame||W.oRequestAnimationFrame||W.msRequestAnimationFrame||function(o){return W.setTimeout(o,1e3/60)},$t=W.cancelAnimationFrame||W.webkitCancelAnimationFrame||W.mozCancelAnimationFrame||W.oCancelAnimationFrame||W.msCancelAnimationFrame||function(o){W.clearTimeout(o)},He=Kt,qt=$t,q=function(o){return qt(o.id)},xe=function(o,e){var t;Promise.resolve().then(function(){t=Date.now()});var r=function(){Date.now()-t>=e?o.call():n.id=He(r)},n={id:He(r)};return n};function De(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function H(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?De(Object(t),!0).forEach(function(r){g(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):De(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function mt(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mt=function(){return!!o})()}var We="requested",N=(function(){function o(e){var t,r,n,i;E(this,o),r=this,i=[e],n=I(n=o),g(t=A(r,mt()?Reflect.construct(n,i||[],I(r).constructor):n.apply(r,i)),"_onGridRenderedMemoizer",$()),g(t,"_onScrollMemoizer",$(!1)),g(t,"_deferredInvalidateColumnIndex",null),g(t,"_deferredInvalidateRowIndex",null),g(t,"_recomputeScrollLeftFlag",!1),g(t,"_recomputeScrollTopFlag",!1),g(t,"_horizontalScrollBarSize",0),g(t,"_verticalScrollBarSize",0),g(t,"_scrollbarPresenceChanged",!1),g(t,"_scrollingContainer",void 0),g(t,"_childrenToDisplay",void 0),g(t,"_columnStartIndex",void 0),g(t,"_columnStopIndex",void 0),g(t,"_rowStartIndex",void 0),g(t,"_rowStopIndex",void 0),g(t,"_renderedColumnStartIndex",0),g(t,"_renderedColumnStopIndex",0),g(t,"_renderedRowStartIndex",0),g(t,"_renderedRowStopIndex",0),g(t,"_initialScrollTop",void 0),g(t,"_initialScrollLeft",void 0),g(t,"_disablePointerEventsTimeoutId",void 0),g(t,"_styleCache",{}),g(t,"_cellCache",{}),g(t,"_debounceScrollEndedCallback",function(){t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1,needToResetStyleCache:!1})}),g(t,"_invokeOnGridRenderedHelper",function(){var s=t.props.onSectionRendered;t._onGridRenderedMemoizer({callback:s,indices:{columnOverscanStartIndex:t._columnStartIndex,columnOverscanStopIndex:t._columnStopIndex,columnStartIndex:t._renderedColumnStartIndex,columnStopIndex:t._renderedColumnStopIndex,rowOverscanStartIndex:t._rowStartIndex,rowOverscanStopIndex:t._rowStopIndex,rowStartIndex:t._renderedRowStartIndex,rowStopIndex:t._renderedRowStopIndex}})}),g(t,"_setScrollingContainerRef",function(s){t._scrollingContainer=s,typeof t.props.elementRef=="function"?t.props.elementRef(s):K(t.props.elementRef)==="object"&&(t.props.elementRef.current=s)}),g(t,"_onScroll",function(s){s.target===t._scrollingContainer&&t.handleScrollEvent(s.target)});var l=new Ae({cellCount:e.columnCount,cellSizeGetter:function(s){return o._wrapSizeGetter(e.columnWidth)(s)},estimatedCellSize:o._getEstimatedColumnSize(e)}),a=new Ae({cellCount:e.rowCount,cellSizeGetter:function(s){return o._wrapSizeGetter(e.rowHeight)(s)},estimatedCellSize:o._getEstimatedRowSize(e)});return t.state={instanceProps:{columnSizeAndPositionManager:l,rowSizeAndPositionManager:a,prevColumnWidth:e.columnWidth,prevRowHeight:e.rowHeight,prevColumnCount:e.columnCount,prevRowCount:e.rowCount,prevIsScrolling:e.isScrolling===!0,prevScrollToColumn:e.scrollToColumn,prevScrollToRow:e.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:1,scrollDirectionVertical:1,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},e.scrollToRow>0&&(t._initialScrollTop=t._getCalculatedScrollTop(e,t.state)),e.scrollToColumn>0&&(t._initialScrollLeft=t._getCalculatedScrollLeft(e,t.state)),t}return j(o,f.reactExports.PureComponent),L(o,[{key:"getOffsetForCell",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.alignment,r=t===void 0?this.props.scrollToAlignment:t,n=e.columnIndex,i=n===void 0?this.props.scrollToColumn:n,l=e.rowIndex,a=l===void 0?this.props.scrollToRow:l,s=H(H({},this.props),{},{scrollToAlignment:r,scrollToColumn:i,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(s),scrollTop:this._getCalculatedScrollTop(s)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(e){var t=e.scrollLeft,r=t===void 0?0:t,n=e.scrollTop,i=n===void 0?0:n;if(!(i<0)){this._debounceScrollEnded();var l=this.props,a=l.autoHeight,s=l.autoWidth,c=l.height,d=l.width,h=this.state.instanceProps,p=h.scrollbarSize,u=h.rowSizeAndPositionManager.getTotalSize(),_=h.columnSizeAndPositionManager.getTotalSize(),m=Math.min(Math.max(0,_-d+p),r),S=Math.min(Math.max(0,u-c+p),i);if(this.state.scrollLeft!==m||this.state.scrollTop!==S){var y={isScrolling:!0,scrollDirectionHorizontal:m!==this.state.scrollLeft?m>this.state.scrollLeft?1:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:S!==this.state.scrollTop?S>this.state.scrollTop?1:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:"observed"};a||(y.scrollTop=S),s||(y.scrollLeft=m),y.needToResetStyleCache=!1,this.setState(y)}this._invokeOnScrollMemoizer({scrollLeft:m,scrollTop:S,totalColumnsWidth:_,totalRowsHeight:u})}}},{key:"invalidateCellSizeAfterRender",value:function(e){var t=e.columnIndex,r=e.rowIndex;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,t):t,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,r):r}},{key:"measureAllCells",value:function(){var e=this.props,t=e.columnCount,r=e.rowCount,n=this.state.instanceProps;n.columnSizeAndPositionManager.getSizeAndPositionOfCell(t-1),n.rowSizeAndPositionManager.getSizeAndPositionOfCell(r-1)}},{key:"recomputeGridSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.columnIndex,r=t===void 0?0:t,n=e.rowIndex,i=n===void 0?0:n,l=this.props,a=l.scrollToColumn,s=l.scrollToRow,c=this.state.instanceProps;c.columnSizeAndPositionManager.resetCell(r),c.rowSizeAndPositionManager.resetCell(i),this._recomputeScrollLeftFlag=a>=0&&(this.state.scrollDirectionHorizontal===1?r<=a:r>=a),this._recomputeScrollTopFlag=s>=0&&(this.state.scrollDirectionVertical===1?i<=s:i>=s),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(e){var t=e.columnIndex,r=e.rowIndex,n=this.props.columnCount,i=this.props;n>1&&t!==void 0&&this._updateScrollLeftForScrollToColumn(H(H({},i),{},{scrollToColumn:t})),r!==void 0&&this._updateScrollTopForScrollToRow(H(H({},i),{},{scrollToRow:r}))}},{key:"componentDidMount",value:function(){var e=this.props,t=e.getScrollbarSize,r=e.height,n=e.scrollLeft,i=e.scrollToColumn,l=e.scrollTop,a=e.scrollToRow,s=e.width,c=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),c.scrollbarSizeMeasured||this.setState(function(p){var u=H(H({},p),{},{needToResetStyleCache:!1});return u.instanceProps.scrollbarSize=t(),u.instanceProps.scrollbarSizeMeasured=!0,u}),typeof n=="number"&&n>=0||typeof l=="number"&&l>=0){var d=o._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:n,scrollTop:l});d&&(d.needToResetStyleCache=!1,this.setState(d))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var h=r>0&&s>0;i>=0&&h&&this._updateScrollLeftForScrollToColumn(),a>=0&&h&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:n||0,scrollTop:l||0,totalColumnsWidth:c.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:c.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(e,t){var r=this,n=this.props,i=n.autoHeight,l=n.autoWidth,a=n.columnCount,s=n.height,c=n.rowCount,d=n.scrollToAlignment,h=n.scrollToColumn,p=n.scrollToRow,u=n.width,_=this.state,m=_.scrollLeft,S=_.scrollPositionChangeReason,y=_.scrollTop,x=_.instanceProps;this._handleInvalidatedGridSize();var v=a>0&&e.c