react-virtuoso 4.18.4 → 4.18.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +126 -126
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),co=require("react-dom"),Ce=0,Pt=1,qt=2,On=4;function cn(t){return()=>t}function uo(t){t()}function ne(t,e){return n=>t(e(n))}function un(t,e){return()=>t(e)}function ao(t,e){return n=>t(e,n)}function Pe(t){return t!==void 0}function fo(...t){return()=>{t.map(uo)}}function Yt(){}function we(t,e){return e(t),t}function mo(t,e){return e(t)}function ot(...t){return t}function Y(t,e){return t(Pt,e)}function j(t,e){t(Ce,e)}function We(t){t(qt)}function it(t){return t(On)}function L(t,e){return Y(t,ao(e,Ce))}function yt(t,e){const n=t(Pt,o=>{n(),e(o)});return n}function an(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function kn(t,e){return t===e}function et(t=kn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function W(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>ne(e,t)}function Bt(t){return e=>()=>{e(t)}}function x(t,...e){const n=po(...e);return((o,r)=>{switch(o){case qt:We(t);return;case Pt:return Y(t,n(r))}})}function Ot(t,e){return n=>o=>{n(e=t(e,o))}}function _t(t){return e=>n=>{t>0?t--:e(n)}}function zt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function D(...t){const e=new Array(t.length);let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{const d=n;n|=l,e[i]=c,d!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function po(...t){return e=>t.reduceRight(mo,e)}function ho(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Pt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Yt);case qt:o(),n=null;return}}}function v(t){let e=t;const n=$();return((o,r)=>{switch(o){case Ce:e=r;break;case Pt:{r(e);break}case On:return e}return n(o,r)})}function ht(t,e){return we(v(e),n=>L(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case qt:t.splice(0,t.length);return;case Pt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function vt(t){return we($(),e=>L(t,e))}function K(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:go(),singleton:n}}const go=()=>Symbol();function xo(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function at(...t){const e=$(),n=new Array(t.length);let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{n[i]=c,o|=l,o===r&&j(e,n)})}),function(s,i){switch(s){case qt:{We(e);return}case Pt:return o===r&&i(n),Y(e,i)}}}function P(t,e=kn){return x(t,et(e))}function ke(...t){return function(e,n){switch(e){case qt:return;case Pt:return fo(...t.map(o=>Y(o,n)))}}}const dt={DEBUG:0,INFO:1,WARN:2,ERROR:3},Io={[dt.DEBUG]:"debug",[dt.ERROR]:"error",[dt.INFO]:"log",[dt.WARN]:"warn"},So=()=>typeof globalThis>"u"?window:globalThis,Wt=K(()=>{const t=v(dt.ERROR);return{log:v((n,o,r=dt.INFO)=>{const s=So().VIRTUOSO_LOG_LEVEL??it(t);r>=s&&console[Io[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function kt(t,e,n){return Ae(t,e,n).callbackRef}function Ae(t,e,n){const o=b.useRef(null);let r=i=>{};const s=b.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Ln(t,e,n,o,r,s,i,l,c){const d=b.useCallback(m=>{const I=To(m.children,e,l?"offsetWidth":"offsetHeight",r);let p=m.parentElement;for(;p.dataset.virtuosoScroller===void 0;)p=p.parentElement;const T=p.lastElementChild.dataset.viewportType==="window";let w;T&&(w=p.ownerDocument.defaultView);const E=i?l?i.scrollLeft:i.scrollTop:T?l?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:l?p.scrollLeft:p.scrollTop,h=i?l?i.scrollWidth:i.scrollHeight:T?l?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:l?p.scrollWidth:p.scrollHeight,f=i?l?i.offsetWidth:i.offsetHeight:T?l?w.innerWidth:w.innerHeight:l?p.offsetWidth:p.offsetHeight;o({scrollHeight:h,scrollTop:Math.max(E,0),viewportHeight:f}),s?.(l?dn("column-gap",getComputedStyle(m).columnGap,r):dn("row-gap",getComputedStyle(m).rowGap,r)),I!==null&&t(I)},[t,e,r,s,i,o,l]);return Ae(d,n,c)}function To(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),d=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},dt.ERROR),m===d)continue;const I=s[s.length-1];s.length===0||I.size!==m||I.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function dn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}function Me(t,e,n){const o=b.useRef(null),r=b.useCallback(c=>{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let I,p;if(e){const T=e.getBoundingClientRect(),w=d.top-T.top;p=T.height-Math.max(0,w),I=w+e.scrollTop}else{const T=i.current.ownerDocument.defaultView;p=T.innerHeight-Math.max(0,d.top),I=d.top+T.scrollY}o.current={listHeight:d.height,offsetTop:I,visibleHeight:p,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=Ae(r,!0,n),l=b.useCallback(()=>{r(i.current)},[r,i]);return b.useEffect(()=>{if(e){e.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(e),()=>{e.removeEventListener("scroll",l),d.unobserve(e)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,e,i]),s}const xt=K(()=>{const t=$(),e=$(),n=v(0),o=$(),r=v(0),s=$(),i=$(),l=v(0),c=v(0),d=v(0),m=v(0),I=$(),p=$(),T=v(!1),w=v(!1),E=v(!1);return L(x(t,B(({scrollTop:h})=>h)),e),L(x(t,B(({scrollHeight:h})=>h)),i),L(e,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:w,scrollBy:p,scrollContainerState:t,scrollHeight:i,scrollingInProgress:T,scrollTo:I,scrollTop:e,skipAnimationFrameInResizeObserver:E,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),oe={lvl:0};function zn(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function J(t){return t===oe}function re(t,e){if(!J(t))return e===t.k?t.v:e<t.k?re(t.l,e):re(t.r,e)}function Rt(t,e,n="k"){if(J(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=Rt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return Rt(t.l,e,n)}function Tt(t,e,n){return J(t)?Gn(e,n,1):e===t.k?ft(t,{k:e,v:n}):e<t.k?fn(ft(t,{l:Tt(t.l,e,n)})):fn(ft(t,{r:Tt(t.r,e,n)}))}function Ut(){return oe}function Kt(t,e,n){if(J(t))return[];const o=Rt(t,e)[0];return vo(ze(t,o,n))}function Le(t,e){if(J(t))return oe;const{k:n,l:o,r}=t;if(e===n){if(J(o))return r;if(J(r))return o;const[s,i]=Vn(o);return Ie(ft(t,{k:s,l:Fn(o),v:i}))}return e<n?Ie(ft(t,{l:Le(o,e)})):Ie(ft(t,{r:Le(r,e)}))}function jt(t){return J(t)?[]:[...jt(t.l),{k:t.k,v:t.v},...jt(t.r)]}function ze(t,e,n){if(J(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(ze(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(ze(s,e,n))),l}function Ie(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Re(e))return Pn(ft(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return ft(e.r,{l:ft(e,{r:e.r.l}),lvl:n,r:ft(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Re(t))return Fe(ft(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=Re(r)?o.lvl-1:o.lvl;return ft(r,{l:ft(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Fe(ft(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function ft(t,e){return Gn(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function Fn(t){return J(t.r)?t.l:Ie(ft(t,{r:Fn(t.r)}))}function Re(t){return J(t)||t.lvl>t.r.lvl}function Vn(t){return J(t.r)?[t.k,t.v]:Vn(t.r)}function Gn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function fn(t){return Fe(Pn(t))}function Pn(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?ft(e,{r:ft(t,{l:e.r})}):t}function Fe(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?ft(n,{l:ft(t,{r:n.l}),lvl:e+1}):t}function vo(t){return zn(t,({k:e,v:n})=>({index:e,value:n}))}function Wn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function se(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const je=K(()=>({recalcInProgress:v(!1)}),[],{singleton:!0});function An(t,e,n){return t[Te(t,e,n)]}function Te(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Co(t,e,n,o){const r=Te(t,e,o),s=Te(t,n,o,r);return t.slice(r,s+1)}function Et(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!J(t.groupOffsetTree)}function _e({index:t},e){return e===t?0:e<t?-1:1}function wo(){return{groupIndices:[],groupOffsetTree:Ut(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ut()}}function yo(t,e){let n=J(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),J(t)){t=Tt(t,0,s);continue}const l=Kt(t,i-1,r+1);if(l.some(ko(o)))continue;let c=!1,d=!1;for(const{end:m,start:I,value:p}of l)c?(r>=I||s===p)&&(t=Le(t,I)):(d=p!==s,c=!0),m>r&&r>=I&&p!==s&&(t=Tt(t,r+1,p));d&&(t=Tt(t,i,s))}return[t,n]}function bo(t){return typeof t.groupIndex<"u"}function Ro({offset:t},e){return e===t?0:e<t?-1:1}function ie(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=An(e,t,_e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function Mn(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function jn(t,e,n){if(bo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=Mn(o,e);return r=Math.max(0,r,Math.min(n,r)),r}function Eo(t,e,n,o=0){return o>0&&(e=Math.max(e,An(t,o,_e).offset)),zn(Co(t,e,n,Ro),Oo)}function Ho(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,dt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const p=e[0].size,T=e[1].size;i=n.reduce((w,E)=>Tt(Tt(w,E,p),E+1,T),i)}else[i,l]=yo(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:I}=Ve(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((p,T)=>Tt(p,T,ie(T,I,r)),Ut()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:I,sizeTree:i}}function Bo(t){return jt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function mn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function Ve(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e!==0){c=Te(r,e-1,_e),l=r[c].offset;const m=Rt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===Rt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:d,value:m}of Kt(n,e,1/0)){const I=d-s,p=I*i+l+I*o;r.push({index:d,offset:p,size:m}),s=d,l=p,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Oo(t){return{index:t.index,value:t}}function ko(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const Lo={offsetHeight:"height",offsetWidth:"width"},Lt=K(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=ht(o,0),s=$(),i=$(),l=v(0),c=v([]),d=v(void 0),m=v(void 0),I=v(void 0),p=v(void 0),T=v((u,g)=>Et(u,Lo[g])),w=v(void 0),E=v(0),h=wo(),f=ht(x(n,D(c,t,E),Ot(Ho,h),et()),h),a=ht(x(c,et(),Ot((u,g)=>({current:g,prev:u.current}),{current:[],prev:[]}),B(({prev:u})=>u)),[]);L(x(c,W(u=>u.length>0),D(f,E),B(([u,g,C])=>{const z=u.reduce((O,G,_)=>Tt(O,G,ie(G,g.offsetTree,C)||_),Ut());return{...g,groupIndices:u,groupOffsetTree:z}})),f),L(x(o,D(f),W(([u,{lastIndex:g}])=>u<g),B(([u,{lastIndex:g,lastSize:C}])=>[{endIndex:g,size:C,startIndex:u}])),n),L(d,m);const S=ht(x(d,B(u=>u===void 0)),!0);L(x(m,W(u=>u!==void 0&&J(it(f).sizeTree)),B(u=>{const g=it(I),C=it(c).length>0;return g!==void 0&&g!==0?C?[{endIndex:0,size:g,startIndex:0},{endIndex:1,size:u,startIndex:1}]:[]:[{endIndex:0,size:u,startIndex:0}]})),n),L(x(p,W(u=>u!==void 0&&u.length>0&&J(it(f).sizeTree)),B(u=>{const g=[];let C=u[0],z=0;for(let O=1;O<u.length;O++){const G=u[O];G!==C&&(g.push({endIndex:O-1,size:C,startIndex:z}),C=G,z=O)}return g.push({endIndex:u.length-1,size:C,startIndex:z}),g})),n),L(x(c,D(I,m),W(([,u,g])=>u!==void 0&&g!==void 0),B(([u,g,C])=>{const z=[];for(let O=0;O<u.length;O++){const G=u[O],_=u[O+1];z.push({startIndex:G,endIndex:G,size:g}),_!==void 0&&z.push({startIndex:G+1,endIndex:_-1,size:C})}return z})),n);const H=vt(x(n,D(f),Ot(({sizes:u},[g,C])=>({changed:C!==u,sizes:C}),{changed:!1,sizes:h}),B(u=>u.changed)));Y(x(l,Ot((u,g)=>({diff:u.prev-g,prev:g}),{diff:0,prev:0}),B(u=>u.diff)),u=>{const{groupIndices:g}=it(f);if(u>0)j(e,!0),j(s,u+mn(u,g));else if(u<0){const C=it(a);C.length>0&&(u-=mn(-u,C)),j(i,u)}}),Y(x(l,D(t)),([u,g])=>{u<0&&g("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},dt.ERROR)});const y=vt(s);L(x(s,D(f),B(([u,g])=>{const C=g.groupIndices.length>0,z=[],O=g.lastSize;if(C){const G=re(g.sizeTree,0);let _=0,Z=0;for(;_<u;){const q=g.groupIndices[Z],Q=g.groupIndices.length===Z+1?1/0:g.groupIndices[Z+1]-q-1;z.push({endIndex:q,size:G,startIndex:q}),z.push({endIndex:q+1+Q-1,size:O,startIndex:q+1}),Z++,_+=Q+1}const F=jt(g.sizeTree);return _!==u&&F.shift(),F.reduce((q,{k:Q,v:gt})=>{let ut=q.ranges;return q.prevSize!==0&&(ut=[...q.ranges,{endIndex:Q+u-1,size:q.prevSize,startIndex:q.prevIndex}]),{prevIndex:Q+u,prevSize:gt,ranges:ut}},{prevIndex:u,prevSize:0,ranges:z}).ranges}return jt(g.sizeTree).reduce((G,{k:_,v:Z})=>({prevIndex:_+u,prevSize:Z,ranges:[...G.ranges,{endIndex:_+u-1,size:G.prevSize,startIndex:G.prevIndex}]}),{prevIndex:0,prevSize:O,ranges:[]}).ranges})),n);const k=vt(x(i,D(f,E),B(([u,{offsetTree:g},C])=>{const z=-u;return ie(z,g,C)})));return L(x(i,D(f,E),B(([u,g,C])=>{if(g.groupIndices.length>0){if(J(g.sizeTree))return g;let G=Ut();const _=it(a);let Z=0,F=0,mt=0;for(;Z<-u;){mt=_[F];const Q=_[F+1]-mt-1;F++,Z+=Q+1}if(G=jt(g.sizeTree).reduce((Q,{k:gt,v:ut})=>Tt(Q,Math.max(0,gt+u),ut),G),Z!==-u){const Q=re(g.sizeTree,mt);G=Tt(G,0,Q);const gt=Rt(g.sizeTree,-u+1)[1];G=Tt(G,1,gt)}return{...g,sizeTree:G,...Ve(g.offsetTree,0,G,C)}}const O=jt(g.sizeTree).reduce((G,{k:_,v:Z})=>Tt(G,Math.max(0,_+u),Z),Ut());return{...g,sizeTree:O,...Ve(g.offsetTree,0,O,C)}})),f),{beforeUnshiftWith:y,data:w,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:I,gap:E,groupIndices:c,heightEstimates:p,itemSize:T,listRefresh:H,shiftWith:i,shiftWithOffset:k,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:S,unshiftWith:s}},ot(Wt,je),{singleton:!0});function zo(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const _n=K(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=vt(x(s,B(zo)));return L(x(l,B(c=>c.totalCount)),n),L(x(l,B(c=>c.groupIndices)),t),L(x(at(r,e,o),W(([c,d])=>ye(d)),B(([c,d,m])=>Rt(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),et(),B(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},ot(Lt,xt)),At=K(([{log:t}])=>{const e=v(!1),n=vt(x(e,W(o=>o),et()));return Y(e,o=>{o&&it(t)("props updated",{},dt.DEBUG)}),{didMount:n,propsReady:e}},ot(Wt),{singleton:!0}),Fo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Nn(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Fo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ae=K(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:I},{log:p}])=>{const T=$(),w=$(),E=v(0);let h=null,f=null,a=null;function S(){h!==null&&(h(),h=null),a!==null&&(a(),a=null),f&&(clearTimeout(f),f=null),j(c,!1)}return L(x(T,D(n,I,o,E,l,i,p),D(t,s,r),B(([[H,y,k,u,g,C,z,O],G,_,Z])=>{const F=Nn(H),{align:mt,behavior:q,offset:Q}=F,gt=u-1,ut=jn(F,y,gt);let It=ie(ut,y.offsetTree,G)+C;mt==="end"?(It+=_+Rt(y.sizeTree,ut)[1]-k+Z,ut===gt&&(It+=z)):mt==="center"?It+=(_+Rt(y.sizeTree,ut)[1]-k+Z)/2:It-=g,Q!==void 0&&Q!==0&&(It+=Q);const Ft=pt=>{S(),pt?(O("retrying to scroll to",{location:H},dt.DEBUG),j(T,H)):(j(w,!0),O("list did not change, scroll successful",{},dt.DEBUG))};if(S(),q==="smooth"){let pt=!1;a=Y(e,Dt=>{pt=pt||Dt}),h=yt(m,()=>{Ft(pt)})}else h=yt(x(e,Vo(150)),Ft);return f=setTimeout(()=>{S()},1200),j(c,!0),O("scrolling from index to",{behavior:q,index:ut,top:It},dt.DEBUG),{behavior:q,top:It}})),d),{scrollTargetReached:w,scrollToIndex:T,topListHeight:E}},ot(Lt,xt,Wt),{singleton:!0});function Vo(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ne(t,e){t===0?e():requestAnimationFrame(()=>{Ne(t-1,e)})}function De(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const de=K(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=v(!0),c=v(0),d=v(!0);return L(x(i,D(c),W(([m,I])=>I!==0),Bt(!1)),l),L(x(i,D(c),W(([m,I])=>I!==0),Bt(!1)),d),Y(x(at(e,i),D(l,n,t,d),W(([[,m],I,{sizeTree:p},T,w])=>m&&(!J(p)||Pe(T))&&!I&&!w),D(c)),([,m])=>{yt(r,()=>{j(d,!0)}),Ne(4,()=>{yt(o,()=>{j(l,!0)}),j(s,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},ot(Lt,xt,ae,At),{singleton:!0});function Dn(t,e){return Math.abs(t-e)<1.01}const le="up",te="down",Go="none",Po={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Wo=0,fe=K(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=v(!1),l=v(!0),c=$(),d=$(),m=v(4),I=v(Wo),p=ht(x(ke(x(P(r),_t(1),Bt(!0)),x(P(r),_t(1),Bt(!1),an(100))),et()),!1),T=ht(x(ke(x(n,Bt(!0)),x(n,Bt(!1),an(200))),et()),!1);L(x(at(P(r),P(I)),B(([a,S])=>a<=S),et()),l),L(x(l,zt(50)),d);const w=vt(x(at(o,P(s),P(e),P(t),P(m)),Ot((a,[{scrollHeight:S,scrollTop:H},y,k,u,g])=>{const C=H+y-S>-g,z={scrollHeight:S,scrollTop:H,viewportHeight:y};if(C){let G,_;return H>a.state.scrollTop?(G="SCROLLED_DOWN",_=a.state.scrollTop-H):(G="SIZE_DECREASED",_=a.state.scrollTop-H||a.scrollTopDelta),{atBottom:!0,atBottomBecause:G,scrollTopDelta:_,state:z}}let O;return z.scrollHeight>a.state.scrollHeight?O="SIZE_INCREASED":y<a.state.viewportHeight?O="VIEWPORT_HEIGHT_DECREASING":H<a.state.scrollTop?O="SCROLLING_UPWARDS":O="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:O,state:z}},Po),et((a,S)=>a!==void 0&&a.atBottom===S.atBottom))),E=ht(x(o,Ot((a,{scrollHeight:S,scrollTop:H,viewportHeight:y})=>{if(!Dn(a.scrollHeight,S)){const k=S-(H+y)<1;return a.scrollTop!==H&&k?{changed:!0,jump:a.scrollTop-H,scrollHeight:S,scrollTop:H}:{changed:!0,jump:0,scrollHeight:S,scrollTop:H}}return{changed:!1,jump:0,scrollHeight:S,scrollTop:H}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),W(a=>a.changed),B(a=>a.jump)),0);L(x(w,B(a=>a.atBottom)),i),L(x(i,zt(50)),c);const h=v(te);L(x(o,B(({scrollTop:a})=>a),et(),Ot((a,S)=>it(T)?{direction:a.direction,prevScrollTop:S}:{direction:S<a.prevScrollTop?le:te,prevScrollTop:S},{direction:te,prevScrollTop:0}),B(a=>a.direction)),h),L(x(o,zt(50),Bt(Go)),h);const f=v(0);return L(x(p,W(a=>!a),Bt(0)),f),L(x(r,zt(100),D(p),W(([a,S])=>S),Ot(([a,S],[H])=>[S,H],[0,0]),B(([a,S])=>S-a)),f),{atBottomState:w,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:I,isAtBottom:i,isAtTop:l,isScrolling:p,lastJumpDueToItemResize:E,scrollDirection:h,scrollVelocity:f}},ot(xt)),ce="top",ue="bottom",pn="none";function hn(t,e,n){return typeof t=="number"?n===le&&e===ce||n===te&&e===ue?t:0:n===le?e===ce?t.main:t.reverse:e===ue?t.main:t.reverse}function gn(t,e){return typeof t=="number"?t:t[e]??0}const $e=K(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=v(0),l=v(0),c=v(0),d=ht(x(at(P(o),P(r),P(n),P(s,se),P(c),P(i),P(e),P(t),P(l)),B(([m,I,p,[T,w],E,h,f,a,S])=>{const H=m-a,y=h+f,k=Math.max(p-H,0);let u=pn;const g=gn(S,ce),C=gn(S,ue);return T-=a,T+=p+f,w+=p+f,w-=a,T>m+y-g&&(u=le),w<m-k+I+C&&(u=te),u!==pn?[Math.max(H-p-hn(E,ce,u)-g,0),H-k-f+I+hn(E,ue,u)+C]:null}),W(m=>m!==null),et(se)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:d}},ot(xt),{singleton:!0});function Ao(t,e,n){if(ye(e)){const o=Mn(t,e);return[{index:Rt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n?.[0],index:o,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const Ee={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Se(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let d=0,m=0;if(t.length>0){d=t[0].offset;const E=t[t.length-1];m=E.offset+E.size}const I=n-i,p=l+I*c+(I-1)*o,T=d,w=p-m;return{bottom:m,firstItemIndex:s,items:xn(t,r,s),offsetBottom:w,offsetTop:d,top:T,topItems:xn(e,r,s),topListHeight:e.reduce((E,h)=>h.size+E,0),totalCount:n}}function $n(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=De(e,l),d=Array.from({length:l}).map((m,I)=>({data:s[I+c],index:I+c,offset:0,size:0}));return Se(d,[],l,r,n,o)}function xn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=Kt(e.groupOffsetTree,o,r);let l,c=0;for(const d of t){(!l||l.end<d.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;d.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:d.index-(c+1)+n},s.push({...m,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function In(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Nt=K(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:d,scrolledToInitialItem:m},{topListHeight:I},p,{didMount:T},{recalcInProgress:w}])=>{const E=v([]),h=v(0),f=$(),a=v(0);L(s.topItemsIndexes,E);const S=ht(x(at(T,w,P(c,se),P(r),P(o),P(d),m,P(E),P(e),P(n),P(a),t),W(([u,g,,C,,,,,,,,z])=>{const O=z!==void 0&&z.length!==C;return u&&!g&&!O}),B(([,,[u,g],C,z,O,G,_,Z,F,mt,q])=>{const Q=z,{offsetTree:gt,sizeTree:ut}=Q,It=it(h);if(C===0)return{...Ee,totalCount:C};if(u===0&&g===0)return It===0?{...Ee,totalCount:C}:$n(It,O,z,Z,F,q||[]);if(J(ut))return It>0?null:Se(Ao(De(O,C),Q,q),[],C,F,Q,Z);const Ft=[];if(_.length>0){const N=_[0],U=_[_.length-1];let rt=0;for(const tt of Kt(ut,N,U)){const X=tt.value,lt=Math.max(tt.start,N),St=Math.min(tt.end,U);for(let ct=lt;ct<=St;ct++)Ft.push({data:q?.[ct],index:ct,offset:rt,size:X}),rt+=X}}if(!G)return Se([],Ft,C,F,Q,Z);const pt=_.length>0?_[_.length-1]+1:0,Dt=Eo(gt,u,g,pt);if(Dt.length===0)return null;const Xt=C-1,Ht=we([],N=>{for(const U of Dt){const rt=U.value;let tt=rt.offset,X=U.start;const lt=rt.size;if(rt.offset<u){X+=Math.floor((u-rt.offset+F)/(lt+F));const ct=X-U.start;tt+=ct*lt+ct*F}X<pt&&(tt+=(pt-X)*lt,X=pt);const St=Math.min(U.end,Xt);for(let ct=X;ct<=St&&!(tt>=g);ct++)N.push({data:q?.[ct],index:ct,offset:tt,size:lt}),tt+=lt+F}}),Jt=In(mt,ce),R=In(mt,ue);if(Ht.length>0&&(Jt>0||R>0)){const N=Ht[0],U=Ht[Ht.length-1];if(Jt>0&&N.index>pt){const rt=Math.min(Jt,N.index-pt),tt=[];let X=N.offset;for(let lt=N.index-1;lt>=N.index-rt;lt--){const ct=Kt(ut,lt,lt)[0]?.value??N.size;X-=ct+F,tt.unshift({data:q?.[lt],index:lt,offset:X,size:ct})}Ht.unshift(...tt)}if(R>0&&U.index<Xt){const rt=Math.min(R,Xt-U.index);let tt=U.offset+U.size+F;for(let X=U.index+1;X<=U.index+rt;X++){const St=Kt(ut,X,X)[0]?.value??U.size;Ht.push({data:q?.[X],index:X,offset:tt,size:St}),tt+=St+F}}}return Se(Ht,Ft,C,F,Q,Z)}),W(u=>u!==null),et()),Ee);L(x(t,W(Pe),B(u=>u?.length)),r),L(x(S,B(u=>u.topListHeight)),I),L(I,l),L(x(S,B(u=>[u.top,u.bottom])),i),L(x(S,B(u=>u.items)),f);const H=vt(x(S,W(({items:u})=>u.length>0),D(r,t),W(([{items:u},g])=>u[u.length-1].originalIndex===g-1),B(([,u,g])=>[u-1,g]),et(se),B(([u])=>u))),y=vt(x(S,zt(200),W(({items:u,topItems:g})=>u.length>0&&u[0].originalIndex===g.length),B(({items:u})=>u[0].index),et())),k=vt(x(S,W(({items:u})=>u.length>0),B(({items:u})=>{let g=0,C=u.length-1;for(;u[g].type==="group"&&g<C;)g++;for(;u[C].type==="group"&&C>g;)C--;return{endIndex:u[C].index,startIndex:u[g].index}}),et(Wn)));return{endReached:H,initialItemCount:h,itemsRendered:f,listState:S,minOverscanItemCount:a,rangeChanged:k,startReached:y,topItemsIndexes:E,...p}},ot(Lt,_n,$e,de,ae,fe,At,je),{singleton:!0}),Un=K(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=ht(x(at(n,t,o,e,r),B(([l,c,d,m,I])=>l+c+d+m+I.offsetBottom+I.bottom)),0);return L(P(i),s),{totalListHeight:i,totalListHeightChanged:s}},ot(xt,Nt),{singleton:!0}),Mo=K(([{viewportHeight:t},{totalListHeight:e}])=>{const n=v(!1),o=ht(x(at(n,t,e),W(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),zt(0),et()),0);return{alignToBottom:n,paddingTopAddition:o}},ot(xt,Un),{singleton:!0}),Kn=K(()=>({context:v(null)})),jo=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n??"start",...o!==void 0?{behavior:o}:{}}:t>s?{...r,align:n??"end",...o!==void 0?{behavior:o}:{}}:null,qn=K(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=$();return L(x(m,D(e,c,n,s,r,o,l),D(t),B(([[I,p,T,w,E,h,f,a],S])=>{const{calculateViewLocation:H=jo,done:y,...k}=I,u=jn(I,p,w-1),g=ie(u,p.offsetTree,S)+E+h,C=g+Rt(p.sizeTree,u)[1],z=a+h,O=a+T-f,G=H({itemBottom:C,itemTop:g,locationParams:k,viewportBottom:O,viewportTop:z});return G!==null?y&&yt(x(i,W(_=>!_),_t(it(i)?1:2)),y):y?.(),G}),W(I=>I!==null)),d),{scrollIntoView:m}},ot(Lt,xt,ae,Nt,Wt),{singleton:!0});function Sn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const _o=(t,e)=>typeof t=="function"?Sn(t(e)):e&&Sn(t),No=K(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:I},{context:p},{scrollIntoView:T}])=>{const w=v(!1),E=$();let h=null;function f(y){j(i,{align:"end",behavior:y,index:"LAST"})}Y(x(at(x(P(e),_t(1)),c),D(P(w),s,l,I),B(([[y,k],u,g,C,z])=>{let O=k&&C,G="auto";return O&&(G=_o(u,g||z),O=O&&G!==!1),{followOutputBehavior:G,shouldFollow:O,totalCount:y}}),W(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:k})=>{h!==null&&(h(),h=null),it(n)!==void 0?requestAnimationFrame(()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y)}):h=yt(t,()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y),h=null})});function a(y){const k=yt(r,u=>{y&&!u.atBottom&&u.notAtBottomBecause==="SIZE_INCREASED"&&h===null&&(it(m)("scrolling to bottom due to increased size",{},dt.DEBUG),f("auto"))});setTimeout(k,100)}Y(x(at(P(w),e,d),W(([y,,k])=>y!==!1&&k),Ot(({value:y},[,k])=>({refreshed:y===k,value:k}),{refreshed:!1,value:0}),W(({refreshed:y})=>y),D(w,e)),([,y])=>{it(l)&&a(y!==!1)}),Y(E,()=>{a(it(w)!==!1)}),Y(at(P(w),r),([y,k])=>{y!==!1&&!k.atBottom&&k.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const S=v(null),H=$();return L(ke(x(P(o),B(y=>y?.length??0)),x(P(e))),H),Y(x(at(x(H,_t(1)),c),D(P(S),l,I,p),B(([[y,k],u,g,C,z])=>k&&g&&u?.({context:z,totalCount:y,scrollingInProgress:C})),W(y=>!!y),zt(0)),y=>{h!==null&&(h(),h=null),it(n)!==void 0?requestAnimationFrame(()=>{it(m)("scrolling into view",{}),j(T,y)}):h=yt(t,()=>{it(m)("scrolling into view",{}),j(T,y),h=null})}),{autoscrollToBottom:E,followOutput:w,scrollIntoViewOnChange:S}},ot(Lt,fe,ae,de,At,Wt,xt,Kn,qn)),Do=K(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(L(x(l,D(s),W(([,c])=>c!==0),D(r,o,e,n,t),B(([[,c],d,m,I,p,T=[]])=>$n(c,d,m,I,p,T))),i),{}),ot(Lt,de,Nt,At),{singleton:!0}),$o=K(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=v(0);return Y(x(t,D(o),W(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{yt(x(n,_t(1),W(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{j(e,r)})})}),{initialScrollTop:o}},ot(At,xt,Nt),{singleton:!0}),Yn=K(([{scrollVelocity:t}])=>{const e=v(!1),n=$(),o=v(!1);return L(x(t,D(o,e,n),W(([r,s])=>s!==!1&&s!==void 0),B(([r,s,i,l])=>{const{enter:c,exit:d}=s;if(i){if(d(r,l))return!1}else if(c(r,l))return!0;return i}),et()),e),Y(x(at(e,t,n),D(o)),([[r,s,i],l])=>{r&&l!==!1&&l!==void 0&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},ot(fe),{singleton:!0}),Ue=K(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=v(!1),i=v(void 0);return L(x(at(n,o),B(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),L(x(e,D(o),B(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},ot(xt)),Uo=K(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=$(),m=v(void 0),I=v(null),p=v(null);return L(l,I),L(c,p),Y(x(d,D(e,o,i,I,p,n)),([T,w,E,h,f,a,S])=>{const H=Bo(w.sizeTree);h&&f!==null&&a!==null&&(E=f.scrollTop-a.offsetTop),E-=S,T({ranges:H,scrollTop:E})}),L(x(m,W(Pe),B(Ko)),r),L(x(s,D(m),W(([,T])=>T!==void 0),et(),B(([,T])=>T.ranges)),t),{getState:d,restoreStateFrom:m}},ot(Lt,xt,de,At,Ue));function Ko(t){return{align:"start",index:0,offset:t.scrollTop}}const qo=K(([{topItemsIndexes:t}])=>{const e=v(0);return L(x(e,W(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},ot(Nt));function Zn(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const Yo=Zn(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Zo=K(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:I,sizes:p},{log:T},{recalcInProgress:w}])=>{const E=vt(x(c,D(i),Ot(([,f,a,S],[{bottom:H,items:y,offsetBottom:k,totalCount:u},g])=>{const C=H+k;let z=0;return a===u&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(z=C-S,z!==0&&(z+=g))),[z,y,u,C]},[0,[],0,0]),W(([f])=>f!==0),D(o,l,n,r,T,w),W(([,f,a,S,,,H])=>!H&&!S&&f!==0&&a===le),B(([[f],,,,,a])=>(a("Upward scrolling compensation",{amount:f},dt.DEBUG),f))));function h(f){f>0?(j(e,{behavior:"auto",top:-f}),j(t,0)):(j(t,0),j(e,{behavior:"auto",top:-f}))}return Y(x(E,D(t,s)),([f,a,S])=>{S&&Yo()?j(t,a-f):h(-f)}),Y(x(at(ht(s,!1),t,w),W(([f,a,S])=>!f&&!S&&a!==0),B(([f,a])=>a),zt(1)),h),L(x(I,B(f=>({top:-f}))),e),Y(x(d,D(p,m),B(([f,{groupIndices:a,lastSize:S,sizeTree:H},y])=>{function k(O){return O*(S+y)}if(a.length===0)return k(f);let u=0;const g=re(H,0);let C=0,z=0;for(;C<f;){C++,u+=g;let O=a.length===z+1?1/0:a[z+1]-a[z]-1;C+O>f&&(u-=g,O=f-C+1),C+=O,u+=k(O),z++}return u})),f=>{j(t,f),requestAnimationFrame(()=>{j(e,{top:f}),requestAnimationFrame(()=>{j(t,0),j(w,!1)})})}),{deviation:t}},ot(xt,fe,Nt,Lt,Wt,je)),Xo=K(([t,e,n,o,r,s,i,l,c,d,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...d,...m}),ot($e,Do,At,Yn,Un,$o,Mo,Ue,qn,Wt,Kn)),Xn=K(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:I,totalCount:p,trackItemSizes:T},{initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h},f,a,S,H,{scrollToIndex:y},k,{topItemCount:u},{groupCounts:g},C])=>{const{listState:z,minOverscanItemCount:O,topItemsIndexes:G,rangeChanged:_,...Z}=H;return L(_,C.scrollSeekRangeChanged),L(x(C.windowViewportRect,B(F=>F.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:g,heightEstimates:l,initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h,sizeRanges:d,topItemCount:u,topItemsIndexes:G,totalCount:p,...S,groupIndices:i,itemSize:c,listState:z,minOverscanItemCount:O,scrollToIndex:y,statefulTotalCount:I,trackItemSizes:T,rangeChanged:_,...Z,...C,...f,sizes:m,...a}},ot(Lt,de,xt,Uo,No,Nt,ae,Zo,qo,_n,Xo));function Jo(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const ge=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Ke(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=b.createContext({});function c(f,a){f.propsReady!==void 0&&j(f.propsReady,!1);for(const S of o){const H=f[e.required[S]];j(H,a[S])}for(const S of r)if(S in a){const H=f[e.optional[S]];j(H,a[S])}f.propsReady!==void 0&&j(f.propsReady,!0)}function d(f){return s.reduce((a,S)=>(a[S]=H=>{const y=f[e.methods[S]];j(y,H)},a),{})}function m(f){return i.reduce((a,S)=>(a[S]=ho(f[e.events[S]]),a),{})}const I=b.forwardRef(function(a,S){const{children:H,...y}=a,[k]=b.useState(()=>we(xo(t),C=>{c(C,y)})),[u]=b.useState(un(m,k));ge(()=>{for(const C of i)C in y&&Y(u[C],y[C]);return()=>{Object.values(u).map(We)}},[y,u,k]),ge(()=>{c(k,y)}),b.useImperativeHandle(S,cn(d(k)));const g=n;return V.jsx(l.Provider,{value:k,children:n!==void 0?V.jsx(g,{...Jo([...o,...r,...i],y),children:H}):H})}),p=f=>{const a=b.useContext(l);return b.useCallback(S=>{j(a[f],S)},[a,f])},T=f=>{const S=b.useContext(l)[f],H=b.useCallback(y=>Y(S,y),[S]);return b.useSyncExternalStore(H,()=>it(S),()=>it(S))},w=f=>{const S=b.useContext(l)[f],[H,y]=b.useState(un(it,S));return ge(()=>Y(S,k=>{k!==H&&y(cn(k))}),[S,H]),H},E=b.version.startsWith("18")?T:w;return{Component:I,useEmitter:(f,a)=>{const H=b.useContext(l)[f];ge(()=>Y(H,a),[a,H])},useEmitterValue:E,usePublisher:p}}const me=b.createContext(void 0),qe=b.createContext(void 0),He="-webkit-sticky",Tn="sticky",Ye=Zn(()=>{if(typeof document>"u")return Tn;const t=document.createElement("div");return t.style.position=He,t.style.position===He?He:Tn}),Jn=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Be(t){return"self"in t}function Qo(t){return"body"in t}function Qn(t,e,n,o=Yt,r,s){const i=b.useRef(null),l=b.useRef(null),c=b.useRef(null),d=b.useCallback(p=>{let T,w,E;const h=p.target;if(Qo(h)||Be(h)){const a=Be(h)?h:h.defaultView;E=s===!0?a.scrollX:a.scrollY,T=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,w=s===!0?a.innerWidth:a.innerHeight}else E=s===!0?h.scrollLeft:h.scrollTop,T=s===!0?h.scrollWidth:h.scrollHeight,w=s===!0?h.offsetWidth:h.offsetHeight;const f=()=>{t({scrollHeight:T,scrollTop:Math.max(E,0),viewportHeight:w})};p.suppressFlushSync===!0?f():co.flushSync(f),l.current!==null&&(E===l.current||E<=0||E===T-w)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);b.useEffect(()=>{const p=r||i.current;return o(r||i.current),d({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",d,{passive:!0}),()=>{o(null),p.removeEventListener("scroll",d)}},[i,d,n,o,r]);function m(p){const T=i.current;if(!T||(s===!0?"offsetWidth"in T&&T.offsetWidth===0:"offsetHeight"in T&&T.offsetHeight===0))return;const w=p.behavior==="smooth";let E,h,f;Be(T)?(h=Math.max(Et(T.document.documentElement,s===!0?"width":"height"),s===!0?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight),E=s===!0?T.innerWidth:T.innerHeight,f=s===!0?window.scrollX:window.scrollY):(h=T[s===!0?"scrollWidth":"scrollHeight"],E=Et(T,s===!0?"width":"height"),f=T[s===!0?"scrollLeft":"scrollTop"]);const a=h-E;if(p.top=Math.ceil(Math.max(Math.min(a,p.top),0)),Dn(E,h)||p.top===f){t({scrollHeight:h,scrollTop:f,viewportHeight:E}),w&&e(!0);return}w?(l.current=p.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(p={...p.behavior!==void 0?{behavior:p.behavior}:{},left:p.top}),T.scrollTo(p)}function I(p){s===!0&&(p={...p.behavior!==void 0?{behavior:p.behavior}:{},...p.top!==void 0?{left:p.top}:{}}),i.current.scrollBy(p)}return{scrollByCallback:I,scrollerRef:i,scrollToCallback:m}}function Ze(t){return t}const tr=K(()=>{const t=v(l=>`Item ${l}`),e=v(l=>`Group ${l}`),n=v({}),o=v(Ze),r=v("div"),s=v(Yt),i=(l,c=null)=>ht(x(n,B(d=>d[l]),et()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),er=K(([t,e])=>({...t,...e}),ot(Xn,tr)),nr=({height:t})=>V.jsx("div",{style:{height:t}}),or={overflowAnchor:"none",position:Ye(),zIndex:1},to={overflowAnchor:"none"},rr={...to,display:"inline-block",height:"100%"},vn=b.memo(function({showTopList:e=!1}){const n=A("listState"),o=Ct("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,d=A("itemContent"),m=A("context"),I=A("groupContent"),p=A("trackItemSizes"),T=A("itemSize"),w=A("log"),E=Ct("gap"),h=A("horizontalDirection"),{callbackRef:f}=Ln(o,T,p,e?Yt:c,w,E,s,h,A("skipAnimationFrameInResizeObserver")),[a,S]=b.useState(0);Qe("deviation",F=>{a!==F&&S(F)});const H=A("EmptyPlaceholder"),y=A("ScrollSeekPlaceholder")??nr,k=A("ListComponent"),u=A("ItemComponent"),g=A("GroupComponent"),C=A("computeItemKey"),z=A("isSeeking"),O=A("groupIndices").length>0,G=A("alignToBottom"),_=A("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...h?{display:"inline-block",height:"100%",marginLeft:a!==0?a:G?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:a!==0?a:G?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},..._?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&H!==null&&H!==void 0?V.jsx(H,{...nt(H,m)}):V.jsx(k,{...nt(k,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:Z,children:(e?n.topItems:n.items).map(F=>{const mt=F.originalIndex,q=C(mt+n.firstItemIndex,F.data,m);return z?b.createElement(y,{...nt(y,m),height:F.size,index:F.index,key:q,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?b.createElement(g,{...nt(g,m),"data-index":mt,"data-item-index":F.index,"data-known-size":F.size,key:q,style:or},I(F.index,m)):b.createElement(u,{...nt(u,m),...eo(u,F.data),"data-index":mt,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:q,style:h?rr:to},O?d(F.index,F.groupIndex,F.data,m):d(F.index,F.data,m))})})}),sr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ir={outline:"none",overflowX:"auto",position:"relative"},Zt=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),lr={position:Ye(),top:0,width:"100%",zIndex:1};function nt(t,e){if(typeof t!="string")return{context:e}}function eo(t,e){return{item:typeof t=="string"?void 0:e}}const cr=b.memo(function(){const e=A("HeaderComponent"),n=Ct("headerHeight"),o=A("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),ur=b.memo(function(){const e=A("FooterComponent"),n=Ct("footerHeight"),o=A("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null});function Xe({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("scrollContainerState"),m=e("ScrollerComponent"),I=n("smoothScrollTargetReached"),p=e("scrollerRef"),T=e("horizontalDirection")||!1,{scrollByCallback:w,scrollerRef:E,scrollToCallback:h}=Qn(d,I,m,p,void 0,T);t("scrollTo",h),t("scrollBy",w);const f=T?ir:sr;return V.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:E,style:{...f,...i},tabIndex:0,...c,...nt(m,l),children:s})})}function Je({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("windowScrollContainerState"),m=e("ScrollerComponent"),I=n("smoothScrollTargetReached"),p=e("totalListHeight"),T=e("deviation"),w=e("customScrollParent"),E=b.useRef(null),h=e("scrollerRef"),{scrollByCallback:f,scrollerRef:a,scrollToCallback:S}=Qn(d,I,m,h,w);return Jn(()=>(a.current=w||E.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,w]),t("windowScrollTo",S),t("scrollBy",f),V.jsx(m,{ref:E,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...p!==0?{height:p+T}:void 0},...c,...nt(m,l),children:s})})}const ar=({children:t})=>{const e=b.useContext(me),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=A("alignToBottom"),s=A("horizontalDirection"),i=b.useMemo(()=>ne(n,c=>Et(c,s?"width":"height")),[n,s]),l=kt(i,!0,A("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:Zt(r),children:t})},dr=({children:t})=>{const e=b.useContext(me),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=A("customScrollParent"),s=Me(n,r,A("skipAnimationFrameInResizeObserver")),i=A("alignToBottom");return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Zt(i),children:t})},fr=({children:t})=>{const e=A("TopItemListComponent")??"div",n=A("headerHeight"),o={...lr,marginTop:`${n}px`},r=A("context");return V.jsx(e,{style:o,...nt(e,r),children:t})},mr=b.memo(function(e){const n=A("useWindowScroll"),o=A("topItemsIndexes").length>0,r=A("customScrollParent"),s=A("context"),i=r||n?hr:pr,l=r||n?dr:ar;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(fr,{children:V.jsx(vn,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(cr,{}),V.jsx(vn,{}),V.jsx(ur,{})]})]})}),{Component:no,useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}=Ke(er,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},mr),pr=Xe({useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}),hr=Je({useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}),gr=no,xr=no,Ir=K(()=>{const t=v(d=>V.jsxs("td",{children:["Item $",d]})),e=v(null),n=v(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=v(null),r=v(null),s=v({}),i=v(Ze),l=v(Yt),c=(d,m=null)=>ht(x(s,B(I=>I[d]),et()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Sr=K(([t,e])=>({...t,...e}),ot(Xn,Ir)),Tr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),vr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),Cr={overflowAnchor:"none"},Cn={position:Ye(),zIndex:2,overflowAnchor:"none"},wn=b.memo(function({showTopList:e=!1}){const n=M("listState"),o=M("computeItemKey"),r=M("firstItemIndex"),s=M("context"),i=M("isSeeking"),l=M("fixedHeaderHeight"),c=M("groupIndices").length>0,d=M("itemContent"),m=M("groupContent"),I=M("ScrollSeekPlaceholder")??Tr,p=M("GroupComponent"),T=M("TableRowComponent"),w=(e?n.topItems:[]).reduce((h,f,a)=>(a===0?h.push(f.size):h.push(h[a-1]+f.size),h),[]);return(e?n.topItems:n.items).map(h=>{const f=h.originalIndex,a=o(f+r,h.data,s),S=e?f===0?0:w[f-1]:0;return i?b.createElement(I,{...nt(I,s),height:h.size,index:h.index,key:a,type:h.type||"item"}):h.type==="group"?b.createElement(p,{...nt(p,s),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,key:a,style:{...Cn,top:l}},m(h.index,s)):b.createElement(T,{...nt(T,s),...eo(T,h.data),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,"data-item-group-index":h.groupIndex,key:a,style:e?{...Cn,top:l+S}:Cr},c?d(h.index,h.groupIndex,h.data,s):d(h.index,h.data,s))})}),wr=b.memo(function(){const e=M("listState"),n=M("topItemsIndexes").length>0,o=bt("sizeRanges"),r=M("useWindowScroll"),s=M("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),c=s||r?i:l,d=M("trackItemSizes"),m=M("itemSize"),I=M("log"),{callbackRef:p,ref:T}=Ln(o,m,d,c,I,void 0,s,!1,M("skipAnimationFrameInResizeObserver")),[w,E]=b.useState(0);tn("deviation",O=>{w!==O&&(T.current.style.marginTop=`${O}px`,E(O))});const h=M("EmptyPlaceholder"),f=M("FillerRow")??vr,a=M("TableBodyComponent"),S=M("paddingTopAddition"),H=M("statefulTotalCount"),y=M("context");if(H===0&&h!==null&&h!==void 0)return V.jsx(h,{...nt(h,y)});const k=(n?e.topItems:[]).reduce((O,G)=>O+G.size,0),u=e.offsetTop+S+w-k,g=e.offsetBottom,C=u>0?V.jsx(f,{context:y,height:u},"padding-top"):null,z=g>0?V.jsx(f,{context:y,height:g},"padding-bottom"):null;return V.jsxs(a,{"data-testid":"virtuoso-item-list",ref:p,...nt(a,y),children:[C,n&&V.jsx(wn,{showTopList:!0}),V.jsx(wn,{}),z]})}),yr=({children:t})=>{const e=b.useContext(me),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=kt(b.useMemo(()=>ne(n,s=>Et(s,"height")),[n]),!0,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:Zt(!1),children:t})},br=({children:t})=>{const e=b.useContext(me),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=M("customScrollParent"),s=Me(n,r,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Zt(!1),children:t})},Rr=b.memo(function(e){const n=M("useWindowScroll"),o=M("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=M("fixedHeaderContent"),l=M("fixedFooterContent"),c=M("context"),d=kt(b.useMemo(()=>ne(r,a=>Et(a,"height")),[r]),!0,M("skipAnimationFrameInResizeObserver")),m=kt(b.useMemo(()=>ne(s,a=>Et(a,"height")),[s]),!0,M("skipAnimationFrameInResizeObserver")),I=o||n?Hr:Er,p=o||n?br:yr,T=M("TableComponent"),w=M("TableHeadComponent"),E=M("TableFooterComponent"),h=i?V.jsx(w,{ref:d,style:{position:"sticky",top:0,zIndex:2},...nt(w,c),children:i()},"TableHead"):null,f=l?V.jsx(E,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...nt(E,c),children:l()},"TableFoot"):null;return V.jsx(I,{...e,...nt(I,c),children:V.jsx(p,{children:V.jsxs(T,{style:{borderSpacing:0,overflowAnchor:"none"},...nt(T,c),children:[h,V.jsx(wr,{},"TableBody"),f]})})})}),{Component:oo,useEmitter:tn,useEmitterValue:M,usePublisher:bt}=Ke(Sr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Rr),Er=Xe({useEmitter:tn,useEmitterValue:M,usePublisher:bt}),Hr=Je({useEmitter:tn,useEmitterValue:M,usePublisher:bt}),Br=oo,Or=oo,yn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},kr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:bn,floor:ve,max:ee,min:Oe,round:Rn}=Math;function En(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Lr(t){return{...kr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function zr(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const Fr=K(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:I},p,T,{didMount:w,propsReady:E},{customScrollParent:h,useWindowScroll:f,windowScrollContainerState:a,windowScrollTo:S,windowViewportRect:H},y])=>{const k=v(0),u=v(0),g=v(yn),C=v({height:0,width:0}),z=v({height:0,width:0}),O=$(),G=$(),_=v(0),Z=v(null),F=v({column:0,row:0}),mt=$(),q=$(),Q=v(!1),gt=v(0),ut=v(!0),It=v(!1),Ft=v(!1);Y(x(w,D(gt),W(([R,N])=>N!==0)),()=>{j(ut,!1)}),Y(x(at(w,ut,z,C,gt,It),W(([R,N,U,rt,,tt])=>R&&!N&&U.height!==0&&rt.height!==0&&!tt)),([,,,,R])=>{j(It,!0),Ne(1,()=>{j(O,R)}),yt(x(d),()=>{j(e,[0,0]),j(ut,!0)})}),L(x(q,W(R=>R!=null&&R.scrollTop>0),Bt(0)),u),Y(x(w,D(q),W(([,R])=>R!=null)),([,R])=>{R&&(j(C,R.viewport),j(z,R.item),j(F,R.gap),R.scrollTop>0&&(j(Q,!0),yt(x(d,_t(1)),N=>{j(Q,!1)}),j(c,{top:R.scrollTop})))}),L(x(C,B(({height:R})=>R)),I),L(x(at(P(C,xe),P(z,xe),P(F,(R,N)=>R!==void 0&&R.column===N.column&&R.row===N.row),P(d)),B(([R,N,U,rt])=>({gap:U,item:N,scrollTop:rt,viewport:R}))),mt),L(x(at(P(k),o,P(F,zr),P(z,xe),P(C,xe),P(Z),P(u),P(Q),P(ut),P(gt)),W(([,,,,,,,R])=>!R),B(([R,[N,U],rt,tt,X,lt,St,,ct,Vt])=>{const{column:Gt,row:Qt}=rt,{height:pe,width:be}=tt,{width:en}=X;if(St===0&&(R===0||en===0))return yn;if(be===0){const ln=De(Vt,R),lo=ln+Math.max(St-1,0);return Lr(En(ln,lo,lt))}const he=ro(en,be,Gt);let $t,Mt;ct?N===0&&U===0&&St>0?($t=0,Mt=St-1):($t=he*ve((N+Qt)/(pe+Qt)),Mt=he*bn((U+Qt)/(pe+Qt))-1,Mt=Oe(R-1,ee(Mt,he-1)),$t=Oe(Mt,ee(0,$t))):($t=0,Mt=-1);const nn=En($t,Mt,lt),{bottom:on,top:rn}=Hn(X,rt,tt,nn),sn=bn(R/he),io=sn*pe+(sn-1)*Qt-on;return{bottom:on,itemHeight:pe,items:nn,itemWidth:be,offsetBottom:io,offsetTop:rn,top:rn}})),g),L(x(Z,W(R=>R!==null),B(R=>R.length)),k),L(x(at(C,z,g,F),W(([R,N,{items:U}])=>U.length>0&&N.height!==0&&R.height!==0),B(([R,N,{items:U},rt])=>{const{bottom:tt,top:X}=Hn(R,rt,N,U);return[X,tt]}),et(se)),e);const pt=v(!1);L(x(d,D(pt),B(([R,N])=>N||R!==0)),pt);const Dt=vt(x(at(g,k),W(([{items:R}])=>R.length>0),D(pt),W(([[R,N],U])=>{const tt=R.items[R.items.length-1].index===N-1;return(U||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===N)&&tt}),B(([[,R]])=>R-1),et())),Xt=vt(x(P(g),W(({items:R})=>R.length>0&&R[0].index===0),Bt(0),et())),Ht=vt(x(P(g),D(Q),W(([{items:R},N])=>R.length>0&&!N),B(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),et(Wn),zt(0)));L(Ht,T.scrollSeekRangeChanged),L(x(O,D(C,z,k,F),B(([R,N,U,rt,tt])=>{const X=Nn(R),{align:lt,behavior:St,offset:ct}=X;let Vt=X.index;Vt==="LAST"&&(Vt=rt-1),Vt=ee(0,Vt,Oe(rt-1,Vt));let Gt=Ge(N,tt,U,Vt);return lt==="end"?Gt=Rn(Gt-N.height+U.height):lt==="center"&&(Gt=Rn(Gt-N.height/2+U.height/2)),ct!==void 0&&ct!==0&&(Gt+=ct),{behavior:St,top:Gt}})),c);const Jt=ht(x(g,B(R=>R.offsetBottom+R.bottom)),0);return L(x(H,B(R=>({height:R.visibleHeight,width:R.visibleWidth}))),C),{customScrollParent:h,data:Z,deviation:_,footerHeight:r,gap:F,headerHeight:s,increaseViewportBy:t,initialItemCount:u,itemDimensions:z,overscan:n,restoreStateFrom:q,scrollBy:i,scrollContainerState:l,scrollHeight:G,scrollTo:c,scrollToIndex:O,scrollTop:d,smoothScrollTargetReached:m,totalCount:k,useWindowScroll:f,viewportDimensions:C,windowScrollContainerState:a,windowScrollTo:S,windowViewportRect:H,...T,gridState:g,horizontalDirection:Ft,initialTopMostItemIndex:gt,totalListHeight:Jt,...p,endReached:Dt,propsReady:E,rangeChanged:Ht,startReached:Xt,stateChanged:mt,stateRestoreInProgress:Q,...y}},ot($e,xt,fe,Yn,At,Ue,Wt));function ro(t,e,n){return ee(1,ve((t+n)/(ve(e)+n)))}function Hn(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Ge(t,e,n,o[0].index);return{bottom:Ge(t,e,n,o[o.length-1].index)+r,top:s}}function Ge(t,e,n,o){const r=ro(t.width,n.width,e.column),s=ve(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const Vr=K(()=>{const t=v(I=>`Item ${I}`),e=v({}),n=v(null),o=v("virtuoso-grid-item"),r=v("virtuoso-grid-list"),s=v(Ze),i=v("div"),l=v(Yt),c=(I,p=null)=>ht(x(e,B(T=>T[I]),et()),p),d=v(!1),m=v(!1);return L(P(m),d),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Gr=K(([t,e])=>({...t,...e}),ot(Fr,Vr)),Pr=b.memo(function(){const e=st("gridState"),n=st("listClassName"),o=st("itemClassName"),r=st("itemContent"),s=st("computeItemKey"),i=st("isSeeking"),l=wt("scrollHeight"),c=st("ItemComponent"),d=st("ListComponent"),m=st("ScrollSeekPlaceholder"),I=st("context"),p=wt("itemDimensions"),T=wt("gap"),w=st("log"),E=st("stateRestoreInProgress"),h=wt("reportReadyState"),f=kt(b.useMemo(()=>a=>{const S=a.parentElement.parentElement.scrollHeight;l(S);const H=a.firstChild;if(H!==null){const{height:y,width:k}=H.getBoundingClientRect();p({height:y,width:k})}T({column:Bn("column-gap",getComputedStyle(a).columnGap,w),row:Bn("row-gap",getComputedStyle(a).rowGap,w)})},[l,p,T,w]),!0,!1);return Jn(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),E?null:V.jsx(d,{className:n,ref:f,...nt(d,I),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const S=s(a.index,a.data,I);return i?V.jsx(m,{...nt(m,I),height:e.itemHeight,index:a.index,width:e.itemWidth},S):b.createElement(c,{...nt(c,I),className:o,"data-index":a.index,key:S},r(a.index,a.data,I))})})}),Wr=b.memo(function(){const e=st("HeaderComponent"),n=wt("headerHeight"),o=st("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=st("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),Ar=b.memo(function(){const e=st("FooterComponent"),n=wt("footerHeight"),o=st("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=st("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),Mr=({children:t})=>{const e=b.useContext(qe),n=wt("itemDimensions"),o=wt("viewportDimensions"),r=kt(b.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return b.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),V.jsx("div",{ref:r,style:Zt(!1),children:t})},jr=({children:t})=>{const e=b.useContext(qe),n=wt("windowViewportRect"),o=wt("itemDimensions"),r=st("customScrollParent"),s=Me(n,r,!1);return b.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:s,style:Zt(!1),children:t})},_r=b.memo(function({...e}){const n=st("useWindowScroll"),o=st("customScrollParent"),r=o||n?$r:Dr,s=o||n?jr:Mr,i=st("context");return V.jsx(r,{...e,...nt(r,i),children:V.jsxs(s,{children:[V.jsx(Wr,{}),V.jsx(Pr,{}),V.jsx(Ar,{})]})})}),{Component:Nr,useEmitter:so,useEmitterValue:st,usePublisher:wt}=Ke(Gr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},_r),Dr=Xe({useEmitter:so,useEmitterValue:st,usePublisher:wt}),$r=Je({useEmitter:so,useEmitterValue:st,usePublisher:wt});function Bn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Ur=Nr;exports.GroupedTableVirtuoso=Or;exports.GroupedVirtuoso=xr;exports.LogLevel=dt;exports.TableVirtuoso=Br;exports.Virtuoso=gr;exports.VirtuosoGrid=Ur;exports.VirtuosoGridMockContext=qe;exports.VirtuosoMockContext=me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),co=require("react-dom"),Ce=0,Pt=1,qt=2,On=4;function cn(t){return()=>t}function uo(t){t()}function ne(t,e){return n=>t(e(n))}function un(t,e){return()=>t(e)}function ao(t,e){return n=>t(e,n)}function Pe(t){return t!==void 0}function fo(...t){return()=>{t.map(uo)}}function Yt(){}function we(t,e){return e(t),t}function mo(t,e){return e(t)}function ot(...t){return t}function Y(t,e){return t(Pt,e)}function j(t,e){t(Ce,e)}function We(t){t(qt)}function it(t){return t(On)}function L(t,e){return Y(t,ao(e,Ce))}function yt(t,e){const n=t(Pt,o=>{n(),e(o)});return n}function an(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function kn(t,e){return t===e}function et(t=kn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function W(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>ne(e,t)}function Bt(t){return e=>()=>{e(t)}}function x(t,...e){const n=po(...e);return((o,r)=>{switch(o){case qt:We(t);return;case Pt:return Y(t,n(r))}})}function Ot(t,e){return n=>o=>{n(e=t(e,o))}}function _t(t){return e=>n=>{t>0?t--:e(n)}}function zt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function D(...t){const e=new Array(t.length);let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{const d=n;n|=l,e[i]=c,d!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function po(...t){return e=>t.reduceRight(mo,e)}function ho(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Pt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Yt);case qt:o(),n=null;return}}}function v(t){let e=t;const n=$();return((o,r)=>{switch(o){case Ce:e=r;break;case Pt:{r(e);break}case On:return e}return n(o,r)})}function ht(t,e){return we(v(e),n=>L(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case qt:t.splice(0,t.length);return;case Pt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function vt(t){return we($(),e=>L(t,e))}function K(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:go(),singleton:n}}const go=()=>Symbol();function xo(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function at(...t){const e=$(),n=new Array(t.length);let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;Y(s,c=>{n[i]=c,o|=l,o===r&&j(e,n)})}),function(s,i){switch(s){case qt:{We(e);return}case Pt:return o===r&&i(n),Y(e,i)}}}function P(t,e=kn){return x(t,et(e))}function ke(...t){return function(e,n){switch(e){case qt:return;case Pt:return fo(...t.map(o=>Y(o,n)))}}}const dt={DEBUG:0,INFO:1,WARN:2,ERROR:3},Io={[dt.DEBUG]:"debug",[dt.ERROR]:"error",[dt.INFO]:"log",[dt.WARN]:"warn"},So=()=>typeof globalThis>"u"?window:globalThis,Wt=K(()=>{const t=v(dt.ERROR);return{log:v((n,o,r=dt.INFO)=>{const s=So().VIRTUOSO_LOG_LEVEL??it(t);r>=s&&console[Io[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function kt(t,e,n){return Ae(t,e,n).callbackRef}function Ae(t,e,n){const o=b.useRef(null);let r=i=>{};const s=b.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Ln(t,e,n,o,r,s,i,l,c){const d=b.useCallback(m=>{const I=To(m.children,e,l?"offsetWidth":"offsetHeight",r);let p=m.parentElement;for(;p.dataset.virtuosoScroller===void 0;)p=p.parentElement;const T=p.lastElementChild.dataset.viewportType==="window";let w;T&&(w=p.ownerDocument.defaultView);const E=i?l?i.scrollLeft:i.scrollTop:T?l?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:l?p.scrollLeft:p.scrollTop,h=i?l?i.scrollWidth:i.scrollHeight:T?l?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:l?p.scrollWidth:p.scrollHeight,f=i?l?i.offsetWidth:i.offsetHeight:T?l?w.innerWidth:w.innerHeight:l?p.offsetWidth:p.offsetHeight;o({scrollHeight:h,scrollTop:Math.max(E,0),viewportHeight:f}),s?.(l?dn("column-gap",getComputedStyle(m).columnGap,r):dn("row-gap",getComputedStyle(m).rowGap,r)),I!==null&&t(I)},[t,e,r,s,i,o,l]);return Ae(d,n,c)}function To(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),d=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},dt.ERROR),m===d)continue;const I=s[s.length-1];s.length===0||I.size!==m||I.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function dn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}function Me(t,e,n){const o=b.useRef(null),r=b.useCallback(c=>{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let I,p;if(e){const T=e.getBoundingClientRect(),w=d.top-T.top;p=T.height-Math.max(0,w),I=w+e.scrollTop}else{const T=i.current.ownerDocument.defaultView;p=T.innerHeight-Math.max(0,d.top),I=d.top+T.scrollY}o.current={listHeight:d.height,offsetTop:I,visibleHeight:p,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=Ae(r,!0,n),l=b.useCallback(()=>{r(i.current)},[r,i]);return b.useEffect(()=>{if(e){e.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(e),()=>{e.removeEventListener("scroll",l),d.unobserve(e)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,e,i]),s}const xt=K(()=>{const t=$(),e=$(),n=v(0),o=$(),r=v(0),s=$(),i=$(),l=v(0),c=v(0),d=v(0),m=v(0),I=$(),p=$(),T=v(!1),w=v(!1),E=v(!1);return L(x(t,B(({scrollTop:h})=>h)),e),L(x(t,B(({scrollHeight:h})=>h)),i),L(e,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:w,scrollBy:p,scrollContainerState:t,scrollHeight:i,scrollingInProgress:T,scrollTo:I,scrollTop:e,skipAnimationFrameInResizeObserver:E,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),oe={lvl:0};function zn(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function J(t){return t===oe}function re(t,e){if(!J(t))return e===t.k?t.v:e<t.k?re(t.l,e):re(t.r,e)}function Rt(t,e,n="k"){if(J(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=Rt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return Rt(t.l,e,n)}function Tt(t,e,n){return J(t)?Gn(e,n,1):e===t.k?ft(t,{k:e,v:n}):e<t.k?fn(ft(t,{l:Tt(t.l,e,n)})):fn(ft(t,{r:Tt(t.r,e,n)}))}function Ut(){return oe}function Kt(t,e,n){if(J(t))return[];const o=Rt(t,e)[0];return vo(ze(t,o,n))}function Le(t,e){if(J(t))return oe;const{k:n,l:o,r}=t;if(e===n){if(J(o))return r;if(J(r))return o;const[s,i]=Vn(o);return Ie(ft(t,{k:s,l:Fn(o),v:i}))}return e<n?Ie(ft(t,{l:Le(o,e)})):Ie(ft(t,{r:Le(r,e)}))}function jt(t){return J(t)?[]:[...jt(t.l),{k:t.k,v:t.v},...jt(t.r)]}function ze(t,e,n){if(J(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(ze(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(ze(s,e,n))),l}function Ie(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Re(e))return Pn(ft(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return ft(e.r,{l:ft(e,{r:e.r.l}),lvl:n,r:ft(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Re(t))return Fe(ft(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=Re(r)?o.lvl-1:o.lvl;return ft(r,{l:ft(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Fe(ft(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function ft(t,e){return Gn(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function Fn(t){return J(t.r)?t.l:Ie(ft(t,{r:Fn(t.r)}))}function Re(t){return J(t)||t.lvl>t.r.lvl}function Vn(t){return J(t.r)?[t.k,t.v]:Vn(t.r)}function Gn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function fn(t){return Fe(Pn(t))}function Pn(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?ft(e,{r:ft(t,{l:e.r})}):t}function Fe(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?ft(n,{l:ft(t,{r:n.l}),lvl:e+1}):t}function vo(t){return zn(t,({k:e,v:n})=>({index:e,value:n}))}function Wn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function se(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const je=K(()=>({recalcInProgress:v(!1)}),[],{singleton:!0});function An(t,e,n){return t[Te(t,e,n)]}function Te(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Co(t,e,n,o){const r=Te(t,e,o),s=Te(t,n,o,r);return t.slice(r,s+1)}function Et(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!J(t.groupOffsetTree)}function _e({index:t},e){return e===t?0:e<t?-1:1}function wo(){return{groupIndices:[],groupOffsetTree:Ut(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ut()}}function yo(t,e){let n=J(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),J(t)){t=Tt(t,0,s);continue}const l=Kt(t,i-1,r+1);if(l.some(ko(o)))continue;let c=!1,d=!1;for(const{end:m,start:I,value:p}of l)c?(r>=I||s===p)&&(t=Le(t,I)):(d=p!==s,c=!0),m>r&&r>=I&&p!==s&&(t=Tt(t,r+1,p));d&&(t=Tt(t,i,s))}return[t,n]}function bo(t){return typeof t.groupIndex<"u"}function Ro({offset:t},e){return e===t?0:e<t?-1:1}function ie(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=An(e,t,_e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function Mn(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function jn(t,e,n){if(bo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=Mn(o,e);return r=Math.max(0,r,Math.min(n,r)),r}function Eo(t,e,n,o=0){return o>0&&(e=Math.max(e,An(t,o,_e).offset)),zn(Co(t,e,n,Ro),Oo)}function Ho(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,dt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const p=e[0].size,T=e[1].size;i=n.reduce((w,E)=>Tt(Tt(w,E,p),E+1,T),i)}else[i,l]=yo(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:I}=Ve(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((p,T)=>Tt(p,T,ie(T,I,r)),Ut()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:I,sizeTree:i}}function Bo(t){return jt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function mn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function Ve(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e!==0){c=Te(r,e-1,_e),l=r[c].offset;const m=Rt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===Rt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:d,value:m}of Kt(n,e,1/0)){const I=d-s,p=I*i+l+I*o;r.push({index:d,offset:p,size:m}),s=d,l=p,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Oo(t){return{index:t.index,value:t}}function ko(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const Lo={offsetHeight:"height",offsetWidth:"width"},Lt=K(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=ht(o,0),s=$(),i=$(),l=v(0),c=v([]),d=v(void 0),m=v(void 0),I=v(void 0),p=v(void 0),T=v((u,g)=>Et(u,Lo[g])),w=v(void 0),E=v(0),h=wo(),f=ht(x(n,D(c,t,E),Ot(Ho,h),et()),h),a=ht(x(c,et(),Ot((u,g)=>({current:g,prev:u.current}),{current:[],prev:[]}),B(({prev:u})=>u)),[]);L(x(c,W(u=>u.length>0),D(f,E),B(([u,g,C])=>{const z=u.reduce((O,G,_)=>Tt(O,G,ie(G,g.offsetTree,C)||_),Ut());return{...g,groupIndices:u,groupOffsetTree:z}})),f),L(x(o,D(f),W(([u,{lastIndex:g}])=>u<g),B(([u,{lastIndex:g,lastSize:C}])=>[{endIndex:g,size:C,startIndex:u}])),n),L(d,m);const S=ht(x(d,B(u=>u===void 0)),!0);L(x(m,W(u=>u!==void 0&&J(it(f).sizeTree)),B(u=>{const g=it(I),C=it(c).length>0;return g!==void 0&&g!==0?C?[{endIndex:0,size:g,startIndex:0},{endIndex:1,size:u,startIndex:1}]:[]:[{endIndex:0,size:u,startIndex:0}]})),n),L(x(p,W(u=>u!==void 0&&u.length>0&&J(it(f).sizeTree)),B(u=>{const g=[];let C=u[0],z=0;for(let O=1;O<u.length;O++){const G=u[O];G!==C&&(g.push({endIndex:O-1,size:C,startIndex:z}),C=G,z=O)}return g.push({endIndex:u.length-1,size:C,startIndex:z}),g})),n),L(x(c,D(I,m),W(([,u,g])=>u!==void 0&&g!==void 0),B(([u,g,C])=>{const z=[];for(let O=0;O<u.length;O++){const G=u[O],_=u[O+1];z.push({startIndex:G,endIndex:G,size:g}),_!==void 0&&z.push({startIndex:G+1,endIndex:_-1,size:C})}return z})),n);const H=vt(x(n,D(f),Ot(({sizes:u},[g,C])=>({changed:C!==u,sizes:C}),{changed:!1,sizes:h}),B(u=>u.changed)));Y(x(l,Ot((u,g)=>({diff:u.prev-g,prev:g}),{diff:0,prev:0}),B(u=>u.diff)),u=>{const{groupIndices:g}=it(f);if(u>0)j(e,!0),j(s,u+mn(u,g));else if(u<0){const C=it(a);C.length>0&&(u-=mn(-u,C)),j(i,u)}}),Y(x(l,D(t)),([u,g])=>{u<0&&g("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},dt.ERROR)});const y=vt(s);L(x(s,D(f),B(([u,g])=>{const C=g.groupIndices.length>0,z=[],O=g.lastSize;if(C){const G=re(g.sizeTree,0);let _=0,Z=0;for(;_<u;){const q=g.groupIndices[Z],Q=g.groupIndices.length===Z+1?1/0:g.groupIndices[Z+1]-q-1;z.push({endIndex:q,size:G,startIndex:q}),z.push({endIndex:q+1+Q-1,size:O,startIndex:q+1}),Z++,_+=Q+1}const F=jt(g.sizeTree);return _!==u&&F.shift(),F.reduce((q,{k:Q,v:gt})=>{let ut=q.ranges;return q.prevSize!==0&&(ut=[...q.ranges,{endIndex:Q+u-1,size:q.prevSize,startIndex:q.prevIndex}]),{prevIndex:Q+u,prevSize:gt,ranges:ut}},{prevIndex:u,prevSize:0,ranges:z}).ranges}return jt(g.sizeTree).reduce((G,{k:_,v:Z})=>({prevIndex:_+u,prevSize:Z,ranges:[...G.ranges,{endIndex:_+u-1,size:G.prevSize,startIndex:G.prevIndex}]}),{prevIndex:0,prevSize:O,ranges:[]}).ranges})),n);const k=vt(x(i,D(f,E),B(([u,{offsetTree:g},C])=>{const z=-u;return ie(z,g,C)})));return L(x(i,D(f,E),B(([u,g,C])=>{if(g.groupIndices.length>0){if(J(g.sizeTree))return g;let G=Ut();const _=it(a);let Z=0,F=0,mt=0;for(;Z<-u;){mt=_[F];const Q=_[F+1]-mt-1;F++,Z+=Q+1}if(G=jt(g.sizeTree).reduce((Q,{k:gt,v:ut})=>Tt(Q,Math.max(0,gt+u),ut),G),Z!==-u){const Q=re(g.sizeTree,mt);G=Tt(G,0,Q);const gt=Rt(g.sizeTree,-u+1)[1];G=Tt(G,1,gt)}return{...g,sizeTree:G,...Ve(g.offsetTree,0,G,C)}}const O=jt(g.sizeTree).reduce((G,{k:_,v:Z})=>Tt(G,Math.max(0,_+u),Z),Ut());return{...g,sizeTree:O,...Ve(g.offsetTree,0,O,C)}})),f),{beforeUnshiftWith:y,data:w,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:I,gap:E,groupIndices:c,heightEstimates:p,itemSize:T,listRefresh:H,shiftWith:i,shiftWithOffset:k,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:S,unshiftWith:s}},ot(Wt,je),{singleton:!0});function zo(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const _n=K(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=vt(x(s,B(zo)));return L(x(l,B(c=>c.totalCount)),n),L(x(l,B(c=>c.groupIndices)),t),L(x(at(r,e,o),W(([c,d])=>ye(d)),B(([c,d,m])=>Rt(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),et(),B(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},ot(Lt,xt)),At=K(([{log:t}])=>{const e=v(!1),n=vt(x(e,W(o=>o),et()));return Y(e,o=>{o&&it(t)("props updated",{},dt.DEBUG)}),{didMount:n,propsReady:e}},ot(Wt),{singleton:!0}),Fo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Nn(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Fo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ae=K(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:I},{log:p}])=>{const T=$(),w=$(),E=v(0);let h=null,f=null,a=null;function S(){h!==null&&(h(),h=null),a!==null&&(a(),a=null),f&&(clearTimeout(f),f=null),j(c,!1)}return L(x(T,D(n,I,o,E,l,i,p),D(t,s,r),B(([[H,y,k,u,g,C,z,O],G,_,Z])=>{const F=Nn(H),{align:mt,behavior:q,offset:Q}=F,gt=u-1,ut=jn(F,y,gt);let It=ie(ut,y.offsetTree,G)+C;mt==="end"?(It+=_+Rt(y.sizeTree,ut)[1]-k+Z,ut===gt&&(It+=z)):mt==="center"?It+=(_+Rt(y.sizeTree,ut)[1]-k+Z)/2:It-=g,Q!==void 0&&Q!==0&&(It+=Q);const Ft=pt=>{S(),pt?(O("retrying to scroll to",{location:H},dt.DEBUG),j(T,H)):(j(w,!0),O("list did not change, scroll successful",{},dt.DEBUG))};if(S(),q==="smooth"){let pt=!1;a=Y(e,Dt=>{pt=pt||Dt}),h=yt(m,()=>{Ft(pt)})}else h=yt(x(e,Vo(150)),Ft);return f=setTimeout(()=>{S()},1200),j(c,!0),O("scrolling from index to",{behavior:q,index:ut,top:It},dt.DEBUG),{behavior:q,top:It}})),d),{scrollTargetReached:w,scrollToIndex:T,topListHeight:E}},ot(Lt,xt,Wt),{singleton:!0});function Vo(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ne(t,e){t===0?e():requestAnimationFrame(()=>{Ne(t-1,e)})}function De(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const de=K(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=v(!0),c=v(0),d=v(!0);return L(x(i,D(c),W(([m,I])=>I!==0),Bt(!1)),l),L(x(i,D(c),W(([m,I])=>I!==0),Bt(!1)),d),Y(x(at(e,i),D(l,n,t,d),W(([[,m],I,{sizeTree:p},T,w])=>m&&(!J(p)||Pe(T))&&!I&&!w),D(c)),([,m])=>{yt(r,()=>{j(d,!0)}),Ne(4,()=>{yt(o,()=>{j(l,!0)}),j(s,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},ot(Lt,xt,ae,At),{singleton:!0});function Dn(t,e){return Math.abs(t-e)<1.01}const le="up",te="down",Go="none",Po={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Wo=0,fe=K(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=v(!1),l=v(!0),c=$(),d=$(),m=v(4),I=v(Wo),p=ht(x(ke(x(P(r),_t(1),Bt(!0)),x(P(r),_t(1),Bt(!1),an(100))),et()),!1),T=ht(x(ke(x(n,Bt(!0)),x(n,Bt(!1),an(200))),et()),!1);L(x(at(P(r),P(I)),B(([a,S])=>a<=S),et()),l),L(x(l,zt(50)),d);const w=vt(x(at(o,P(s),P(e),P(t),P(m)),Ot((a,[{scrollHeight:S,scrollTop:H},y,k,u,g])=>{const C=H+y-S>-g,z={scrollHeight:S,scrollTop:H,viewportHeight:y};if(C){let G,_;return H>a.state.scrollTop?(G="SCROLLED_DOWN",_=a.state.scrollTop-H):(G="SIZE_DECREASED",_=a.state.scrollTop-H||a.scrollTopDelta),{atBottom:!0,atBottomBecause:G,scrollTopDelta:_,state:z}}let O;return z.scrollHeight>a.state.scrollHeight?O="SIZE_INCREASED":y<a.state.viewportHeight?O="VIEWPORT_HEIGHT_DECREASING":H<a.state.scrollTop?O="SCROLLING_UPWARDS":O="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:O,state:z}},Po),et((a,S)=>a!==void 0&&a.atBottom===S.atBottom))),E=ht(x(o,Ot((a,{scrollHeight:S,scrollTop:H,viewportHeight:y})=>{if(!Dn(a.scrollHeight,S)){const k=S-(H+y)<1;return a.scrollTop!==H&&k?{changed:!0,jump:a.scrollTop-H,scrollHeight:S,scrollTop:H}:{changed:!0,jump:0,scrollHeight:S,scrollTop:H}}return{changed:!1,jump:0,scrollHeight:S,scrollTop:H}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),W(a=>a.changed),B(a=>a.jump)),0);L(x(w,B(a=>a.atBottom)),i),L(x(i,zt(50)),c);const h=v(te);L(x(o,B(({scrollTop:a})=>a),et(),Ot((a,S)=>it(T)?{direction:a.direction,prevScrollTop:S}:{direction:S<a.prevScrollTop?le:te,prevScrollTop:S},{direction:te,prevScrollTop:0}),B(a=>a.direction)),h),L(x(o,zt(50),Bt(Go)),h);const f=v(0);return L(x(p,W(a=>!a),Bt(0)),f),L(x(r,zt(100),D(p),W(([a,S])=>S),Ot(([a,S],[H])=>[S,H],[0,0]),B(([a,S])=>S-a)),f),{atBottomState:w,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:I,isAtBottom:i,isAtTop:l,isScrolling:p,lastJumpDueToItemResize:E,scrollDirection:h,scrollVelocity:f}},ot(xt)),ce="top",ue="bottom",pn="none";function hn(t,e,n){return typeof t=="number"?n===le&&e===ce||n===te&&e===ue?t:0:n===le?e===ce?t.main:t.reverse:e===ue?t.main:t.reverse}function gn(t,e){return typeof t=="number"?t:t[e]??0}const $e=K(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=v(0),l=v(0),c=v(0),d=ht(x(at(P(o),P(r),P(n),P(s,se),P(c),P(i),P(e),P(t),P(l)),B(([m,I,p,[T,w],E,h,f,a,S])=>{const H=m-a,y=h+f,k=Math.max(p-H,0);let u=pn;const g=gn(S,ce),C=gn(S,ue);return T-=a,T+=p+f,w+=p+f,w-=a,T>m+y-g&&(u=le),w<m-k+I+C&&(u=te),u!==pn?[Math.max(H-p-hn(E,ce,u)-g,0),H-k-f+I+hn(E,ue,u)+C]:null}),W(m=>m!==null),et(se)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:d}},ot(xt),{singleton:!0});function Ao(t,e,n){if(ye(e)){const o=Mn(t,e);return[{index:Rt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n?.[0],index:o,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const Ee={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Se(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let d=0,m=0;if(t.length>0){d=t[0].offset;const E=t[t.length-1];m=E.offset+E.size}const I=n-i,p=l+I*c+(I-1)*o,T=d,w=p-m;return{bottom:m,firstItemIndex:s,items:xn(t,r,s),offsetBottom:w,offsetTop:d,top:T,topItems:xn(e,r,s),topListHeight:e.reduce((E,h)=>h.size+E,0),totalCount:n}}function $n(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=De(e,l),d=Array.from({length:l}).map((m,I)=>({data:s[I+c],index:I+c,offset:0,size:0}));return Se(d,[],l,r,n,o)}function xn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=Kt(e.groupOffsetTree,o,r);let l,c=0;for(const d of t){(!l||l.end<d.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;d.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:d.index-(c+1)+n},s.push({...m,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function In(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Nt=K(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:d,scrolledToInitialItem:m},{topListHeight:I},p,{didMount:T},{recalcInProgress:w}])=>{const E=v([]),h=v(0),f=$(),a=v(0);L(s.topItemsIndexes,E);const S=ht(x(at(T,w,P(c,se),P(r),P(o),P(d),m,P(E),P(e),P(n),P(a),t),W(([u,g,,C,,,,,,,,z])=>{const O=z!==void 0&&z.length!==C;return u&&!g&&!O}),B(([,,[u,g],C,z,O,G,_,Z,F,mt,q])=>{const Q=z,{offsetTree:gt,sizeTree:ut}=Q,It=it(h);if(C===0)return{...Ee,totalCount:C};if(u===0&&g===0)return It===0?{...Ee,totalCount:C}:$n(It,O,z,Z,F,q||[]);if(J(ut))return It>0?null:Se(Ao(De(O,C),Q,q),[],C,F,Q,Z);const Ft=[];if(_.length>0){const N=_[0],U=_[_.length-1];let rt=0;for(const tt of Kt(ut,N,U)){const X=tt.value,lt=Math.max(tt.start,N),St=Math.min(tt.end,U);for(let ct=lt;ct<=St;ct++)Ft.push({data:q?.[ct],index:ct,offset:rt,size:X}),rt+=X}}if(!G)return Se([],Ft,C,F,Q,Z);const pt=_.length>0?_[_.length-1]+1:0,Dt=Eo(gt,u,g,pt);if(Dt.length===0)return null;const Xt=C-1,Ht=we([],N=>{for(const U of Dt){const rt=U.value;let tt=rt.offset,X=U.start;const lt=rt.size;if(rt.offset<u){X+=Math.floor((u-rt.offset+F)/(lt+F));const ct=X-U.start;tt+=ct*lt+ct*F}X<pt&&(tt+=(pt-X)*lt,X=pt);const St=Math.min(U.end,Xt);for(let ct=X;ct<=St&&!(tt>=g);ct++)N.push({data:q?.[ct],index:ct,offset:tt,size:lt}),tt+=lt+F}}),Jt=In(mt,ce),R=In(mt,ue);if(Ht.length>0&&(Jt>0||R>0)){const N=Ht[0],U=Ht[Ht.length-1];if(Jt>0&&N.index>pt){const rt=Math.min(Jt,N.index-pt),tt=[];let X=N.offset;for(let lt=N.index-1;lt>=N.index-rt;lt--){const ct=Kt(ut,lt,lt)[0]?.value??N.size;X-=ct+F,tt.unshift({data:q?.[lt],index:lt,offset:X,size:ct})}Ht.unshift(...tt)}if(R>0&&U.index<Xt){const rt=Math.min(R,Xt-U.index);let tt=U.offset+U.size+F;for(let X=U.index+1;X<=U.index+rt;X++){const St=Kt(ut,X,X)[0]?.value??U.size;Ht.push({data:q?.[X],index:X,offset:tt,size:St}),tt+=St+F}}}return Se(Ht,Ft,C,F,Q,Z)}),W(u=>u!==null),et()),Ee);L(x(t,W(Pe),B(u=>u?.length)),r),L(x(S,B(u=>u.topListHeight)),I),L(I,l),L(x(S,B(u=>[u.top,u.bottom])),i),L(x(S,B(u=>u.items)),f);const H=vt(x(S,W(({items:u})=>u.length>0),D(r,t),W(([{items:u},g])=>u[u.length-1].originalIndex===g-1),B(([,u,g])=>[u-1,g]),et(se),B(([u])=>u))),y=vt(x(S,zt(200),W(({items:u,topItems:g})=>u.length>0&&u[0].originalIndex===g.length),B(({items:u})=>u[0].index),et())),k=vt(x(S,W(({items:u})=>u.length>0),B(({items:u})=>{let g=0,C=u.length-1;for(;u[g].type==="group"&&g<C;)g++;for(;u[C].type==="group"&&C>g;)C--;return{endIndex:u[C].index,startIndex:u[g].index}}),et(Wn)));return{endReached:H,initialItemCount:h,itemsRendered:f,listState:S,minOverscanItemCount:a,rangeChanged:k,startReached:y,topItemsIndexes:E,...p}},ot(Lt,_n,$e,de,ae,fe,At,je),{singleton:!0}),Un=K(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=ht(x(at(n,t,o,e,r),B(([l,c,d,m,I])=>l+c+d+m+I.offsetBottom+I.bottom)),0);return L(P(i),s),{totalListHeight:i,totalListHeightChanged:s}},ot(xt,Nt),{singleton:!0}),Mo=K(([{viewportHeight:t},{totalListHeight:e}])=>{const n=v(!1),o=ht(x(at(n,t,e),W(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),zt(0),et()),0);return{alignToBottom:n,paddingTopAddition:o}},ot(xt,Un),{singleton:!0}),Kn=K(()=>({context:v(null)})),jo=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n??"start",...o!==void 0?{behavior:o}:{}}:t>s?{...r,align:n??"end",...o!==void 0?{behavior:o}:{}}:null,qn=K(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=$();return L(x(m,D(e,c,n,s,r,o,l),D(t),B(([[I,p,T,w,E,h,f,a],S])=>{const{calculateViewLocation:H=jo,done:y,...k}=I,u=jn(I,p,w-1),g=ie(u,p.offsetTree,S)+E+h,C=g+Rt(p.sizeTree,u)[1],z=a+h,O=a+T-f,G=H({itemBottom:C,itemTop:g,locationParams:k,viewportBottom:O,viewportTop:z});return G!==null?y&&yt(x(i,W(_=>!_),_t(it(i)?1:2)),y):y?.(),G}),W(I=>I!==null)),d),{scrollIntoView:m}},ot(Lt,xt,ae,Nt,Wt),{singleton:!0});function Sn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const _o=(t,e)=>typeof t=="function"?Sn(t(e)):e&&Sn(t),No=K(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:I},{context:p},{scrollIntoView:T}])=>{const w=v(!1),E=$();let h=null;function f(y){j(i,{align:"end",behavior:y,index:"LAST"})}Y(x(at(x(P(e),_t(1)),c),D(P(w),s,l,I),B(([[y,k],u,g,C,z])=>{let O=k&&C,G="auto";return O&&(G=_o(u,g||z),O=O&&G!==!1),{followOutputBehavior:G,shouldFollow:O,totalCount:y}}),W(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:k})=>{h!==null&&(h(),h=null),it(n)!==void 0?requestAnimationFrame(()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y)}):h=yt(t,()=>{it(m)("following output to ",{totalCount:k},dt.DEBUG),f(y),h=null})});function a(y){const k=yt(r,u=>{y&&!u.atBottom&&u.notAtBottomBecause==="SIZE_INCREASED"&&h===null&&(it(m)("scrolling to bottom due to increased size",{},dt.DEBUG),f("auto"))});setTimeout(k,100)}Y(x(at(P(w),e,d),W(([y,,k])=>y!==!1&&k),Ot(({value:y},[,k])=>({refreshed:y===k,value:k}),{refreshed:!1,value:0}),W(({refreshed:y})=>y),D(w,e)),([,y])=>{it(l)&&a(y!==!1)}),Y(E,()=>{a(it(w)!==!1)}),Y(at(P(w),r),([y,k])=>{y!==!1&&!k.atBottom&&k.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const S=v(null),H=$();return L(ke(x(P(o),B(y=>y?.length??0)),x(P(e))),H),Y(x(at(x(H,_t(1)),c),D(P(S),l,I,p),B(([[y,k],u,g,C,z])=>k&&g&&u?.({context:z,totalCount:y,scrollingInProgress:C})),W(y=>!!y),zt(0)),y=>{h!==null&&(h(),h=null),it(n)!==void 0?requestAnimationFrame(()=>{it(m)("scrolling into view",{}),j(T,y)}):h=yt(t,()=>{it(m)("scrolling into view",{}),j(T,y),h=null})}),{autoscrollToBottom:E,followOutput:w,scrollIntoViewOnChange:S}},ot(Lt,fe,ae,de,At,Wt,xt,Kn,qn)),Do=K(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(L(x(l,D(s),W(([,c])=>c!==0),D(r,o,e,n,t),B(([[,c],d,m,I,p,T=[]])=>$n(c,d,m,I,p,T))),i),{}),ot(Lt,de,Nt,At),{singleton:!0}),$o=K(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=v(0);return Y(x(t,D(o),W(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{yt(x(n,_t(1),W(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{j(e,r)})})}),{initialScrollTop:o}},ot(At,xt,Nt),{singleton:!0}),Yn=K(([{scrollVelocity:t}])=>{const e=v(!1),n=$(),o=v(!1);return L(x(t,D(o,e,n),W(([r,s])=>s!==!1&&s!==void 0),B(([r,s,i,l])=>{const{enter:c,exit:d}=s;if(i){if(d(r,l))return!1}else if(c(r,l))return!0;return i}),et()),e),Y(x(at(e,t,n),D(o)),([[r,s,i],l])=>{r&&l!==!1&&l!==void 0&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},ot(fe),{singleton:!0}),Ue=K(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=v(!1),i=v(void 0);return L(x(at(n,o),B(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),L(x(e,D(o),B(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},ot(xt)),Uo=K(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=$(),m=v(void 0),I=v(null),p=v(null);return L(l,I),L(c,p),Y(x(d,D(e,o,i,I,p,n)),([T,w,E,h,f,a,S])=>{const H=Bo(w.sizeTree);h&&f!==null&&a!==null&&(E=f.scrollTop-a.offsetTop),E-=S,T({ranges:H,scrollTop:E})}),L(x(m,W(Pe),B(Ko)),r),L(x(s,D(m),W(([,T])=>T!==void 0),et(),B(([,T])=>T.ranges)),t),{getState:d,restoreStateFrom:m}},ot(Lt,xt,de,At,Ue));function Ko(t){return{align:"start",index:0,offset:t.scrollTop}}const qo=K(([{topItemsIndexes:t}])=>{const e=v(0);return L(x(e,W(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},ot(Nt));function Zn(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const Yo=Zn(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Zo=K(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:I,sizes:p},{log:T},{recalcInProgress:w}])=>{const E=vt(x(c,D(i),Ot(([,f,a,S],[{bottom:H,items:y,offsetBottom:k,totalCount:u},g])=>{const C=H+k;let z=0;return a===u&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(z=C-S,z!==0&&(z+=g))),[z,y,u,C]},[0,[],0,0]),W(([f])=>f!==0),D(o,l,n,r,T,w),W(([,f,a,S,,,H])=>!H&&!S&&f!==0&&a===le),B(([[f],,,,,a])=>(a("Upward scrolling compensation",{amount:f},dt.DEBUG),f))));function h(f){f>0?(j(e,{behavior:"auto",top:-f}),j(t,0)):(j(t,0),j(e,{behavior:"auto",top:-f}))}return Y(x(E,D(t,s)),([f,a,S])=>{S&&Yo()?j(t,a-f):h(-f)}),Y(x(at(ht(s,!1),t,w),W(([f,a,S])=>!f&&!S&&a!==0),B(([f,a])=>a),zt(1)),h),L(x(I,B(f=>({top:-f}))),e),Y(x(d,D(p,m),B(([f,{groupIndices:a,lastSize:S,sizeTree:H},y])=>{function k(O){return O*(S+y)}if(a.length===0)return k(f);let u=0;const g=re(H,0);let C=0,z=0;for(;C<f;){C++,u+=g;let O=a.length===z+1?1/0:a[z+1]-a[z]-1;C+O>f&&(u-=g,O=f-C+1),C+=O,u+=k(O),z++}return u})),f=>{j(t,f),requestAnimationFrame(()=>{j(e,{top:f}),requestAnimationFrame(()=>{j(t,0),j(w,!1)})})}),{deviation:t}},ot(xt,fe,Nt,Lt,Wt,je)),Xo=K(([t,e,n,o,r,s,i,l,c,d,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...d,...m}),ot($e,Do,At,Yn,Un,$o,Mo,Ue,qn,Wt,Kn)),Xn=K(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:I,totalCount:p,trackItemSizes:T},{initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h},f,a,S,H,{scrollToIndex:y},k,{topItemCount:u},{groupCounts:g},C])=>{const{listState:z,minOverscanItemCount:O,topItemsIndexes:G,rangeChanged:_,...Z}=H;return L(_,C.scrollSeekRangeChanged),L(x(C.windowViewportRect,B(F=>F.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:g,heightEstimates:l,initialItemFinalLocationReached:w,initialTopMostItemIndex:E,scrolledToInitialItem:h,sizeRanges:d,topItemCount:u,topItemsIndexes:G,totalCount:p,...S,groupIndices:i,itemSize:c,listState:z,minOverscanItemCount:O,scrollToIndex:y,statefulTotalCount:I,trackItemSizes:T,rangeChanged:_,...Z,...C,...f,sizes:m,...a}},ot(Lt,de,xt,Uo,No,Nt,ae,Zo,qo,_n,Xo));function Jo(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const ge=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Ke(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=b.createContext({});function c(f,a){f.propsReady!==void 0&&j(f.propsReady,!1);for(const S of o){const H=f[e.required[S]];j(H,a[S])}for(const S of r)if(S in a){const H=f[e.optional[S]];j(H,a[S])}f.propsReady!==void 0&&j(f.propsReady,!0)}function d(f){return s.reduce((a,S)=>(a[S]=H=>{const y=f[e.methods[S]];j(y,H)},a),{})}function m(f){return i.reduce((a,S)=>(a[S]=ho(f[e.events[S]]),a),{})}const I=b.forwardRef(function(a,S){const{children:H,...y}=a,[k]=b.useState(()=>we(xo(t),C=>{c(C,y)})),[u]=b.useState(un(m,k));ge(()=>{for(const C of i)C in y&&Y(u[C],y[C]);return()=>{Object.values(u).map(We)}},[y,u,k]),ge(()=>{c(k,y)}),b.useImperativeHandle(S,cn(d(k)));const g=n;return V.jsx(l.Provider,{value:k,children:n!==void 0?V.jsx(g,{...Jo([...o,...r,...i],y),children:H}):H})}),p=f=>{const a=b.useContext(l);return b.useCallback(S=>{j(a[f],S)},[a,f])},T=f=>{const S=b.useContext(l)[f],H=b.useCallback(y=>Y(S,y),[S]);return b.useSyncExternalStore(H,()=>it(S),()=>it(S))},w=f=>{const S=b.useContext(l)[f],[H,y]=b.useState(un(it,S));return ge(()=>Y(S,k=>{k!==H&&y(cn(k))}),[S,H]),H},E=parseInt(b.version)>=18?T:w;return{Component:I,useEmitter:(f,a)=>{const H=b.useContext(l)[f];ge(()=>Y(H,a),[a,H])},useEmitterValue:E,usePublisher:p}}const me=b.createContext(void 0),qe=b.createContext(void 0),He="-webkit-sticky",Tn="sticky",Ye=Zn(()=>{if(typeof document>"u")return Tn;const t=document.createElement("div");return t.style.position=He,t.style.position===He?He:Tn}),Jn=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Be(t){return"self"in t}function Qo(t){return"body"in t}function Qn(t,e,n,o=Yt,r,s){const i=b.useRef(null),l=b.useRef(null),c=b.useRef(null),d=b.useCallback(p=>{let T,w,E;const h=p.target;if(Qo(h)||Be(h)){const a=Be(h)?h:h.defaultView;E=s===!0?a.scrollX:a.scrollY,T=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,w=s===!0?a.innerWidth:a.innerHeight}else E=s===!0?h.scrollLeft:h.scrollTop,T=s===!0?h.scrollWidth:h.scrollHeight,w=s===!0?h.offsetWidth:h.offsetHeight;const f=()=>{t({scrollHeight:T,scrollTop:Math.max(E,0),viewportHeight:w})};p.suppressFlushSync===!0?f():co.flushSync(f),l.current!==null&&(E===l.current||E<=0||E===T-w)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);b.useEffect(()=>{const p=r||i.current;return o(r||i.current),d({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",d,{passive:!0}),()=>{o(null),p.removeEventListener("scroll",d)}},[i,d,n,o,r]);function m(p){const T=i.current;if(!T||(s===!0?"offsetWidth"in T&&T.offsetWidth===0:"offsetHeight"in T&&T.offsetHeight===0))return;const w=p.behavior==="smooth";let E,h,f;Be(T)?(h=Math.max(Et(T.document.documentElement,s===!0?"width":"height"),s===!0?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight),E=s===!0?T.innerWidth:T.innerHeight,f=s===!0?window.scrollX:window.scrollY):(h=T[s===!0?"scrollWidth":"scrollHeight"],E=Et(T,s===!0?"width":"height"),f=T[s===!0?"scrollLeft":"scrollTop"]);const a=h-E;if(p.top=Math.ceil(Math.max(Math.min(a,p.top),0)),Dn(E,h)||p.top===f){t({scrollHeight:h,scrollTop:f,viewportHeight:E}),w&&e(!0);return}w?(l.current=p.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(p={...p.behavior!==void 0?{behavior:p.behavior}:{},left:p.top}),T.scrollTo(p)}function I(p){s===!0&&(p={...p.behavior!==void 0?{behavior:p.behavior}:{},...p.top!==void 0?{left:p.top}:{}}),i.current.scrollBy(p)}return{scrollByCallback:I,scrollerRef:i,scrollToCallback:m}}function Ze(t){return t}const tr=K(()=>{const t=v(l=>`Item ${l}`),e=v(l=>`Group ${l}`),n=v({}),o=v(Ze),r=v("div"),s=v(Yt),i=(l,c=null)=>ht(x(n,B(d=>d[l]),et()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),er=K(([t,e])=>({...t,...e}),ot(Xn,tr)),nr=({height:t})=>V.jsx("div",{style:{height:t}}),or={overflowAnchor:"none",position:Ye(),zIndex:1},to={overflowAnchor:"none"},rr={...to,display:"inline-block",height:"100%"},vn=b.memo(function({showTopList:e=!1}){const n=A("listState"),o=Ct("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,d=A("itemContent"),m=A("context"),I=A("groupContent"),p=A("trackItemSizes"),T=A("itemSize"),w=A("log"),E=Ct("gap"),h=A("horizontalDirection"),{callbackRef:f}=Ln(o,T,p,e?Yt:c,w,E,s,h,A("skipAnimationFrameInResizeObserver")),[a,S]=b.useState(0);Qe("deviation",F=>{a!==F&&S(F)});const H=A("EmptyPlaceholder"),y=A("ScrollSeekPlaceholder")??nr,k=A("ListComponent"),u=A("ItemComponent"),g=A("GroupComponent"),C=A("computeItemKey"),z=A("isSeeking"),O=A("groupIndices").length>0,G=A("alignToBottom"),_=A("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...h?{display:"inline-block",height:"100%",marginLeft:a!==0?a:G?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:a!==0?a:G?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},..._?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&H!==null&&H!==void 0?V.jsx(H,{...nt(H,m)}):V.jsx(k,{...nt(k,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:Z,children:(e?n.topItems:n.items).map(F=>{const mt=F.originalIndex,q=C(mt+n.firstItemIndex,F.data,m);return z?b.createElement(y,{...nt(y,m),height:F.size,index:F.index,key:q,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?b.createElement(g,{...nt(g,m),"data-index":mt,"data-item-index":F.index,"data-known-size":F.size,key:q,style:or},I(F.index,m)):b.createElement(u,{...nt(u,m),...eo(u,F.data),"data-index":mt,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:q,style:h?rr:to},O?d(F.index,F.groupIndex,F.data,m):d(F.index,F.data,m))})})}),sr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ir={outline:"none",overflowX:"auto",position:"relative"},Zt=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),lr={position:Ye(),top:0,width:"100%",zIndex:1};function nt(t,e){if(typeof t!="string")return{context:e}}function eo(t,e){return{item:typeof t=="string"?void 0:e}}const cr=b.memo(function(){const e=A("HeaderComponent"),n=Ct("headerHeight"),o=A("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),ur=b.memo(function(){const e=A("FooterComponent"),n=Ct("footerHeight"),o=A("HeaderFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null});function Xe({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("scrollContainerState"),m=e("ScrollerComponent"),I=n("smoothScrollTargetReached"),p=e("scrollerRef"),T=e("horizontalDirection")||!1,{scrollByCallback:w,scrollerRef:E,scrollToCallback:h}=Qn(d,I,m,p,void 0,T);t("scrollTo",h),t("scrollBy",w);const f=T?ir:sr;return V.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:E,style:{...f,...i},tabIndex:0,...c,...nt(m,l),children:s})})}function Je({useEmitter:t,useEmitterValue:e,usePublisher:n}){return b.memo(function({children:s,style:i,context:l,...c}){const d=n("windowScrollContainerState"),m=e("ScrollerComponent"),I=n("smoothScrollTargetReached"),p=e("totalListHeight"),T=e("deviation"),w=e("customScrollParent"),E=b.useRef(null),h=e("scrollerRef"),{scrollByCallback:f,scrollerRef:a,scrollToCallback:S}=Qn(d,I,m,h,w);return Jn(()=>(a.current=w||E.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,w]),t("windowScrollTo",S),t("scrollBy",f),V.jsx(m,{ref:E,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...p!==0?{height:p+T}:void 0},...c,...nt(m,l),children:s})})}const ar=({children:t})=>{const e=b.useContext(me),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=A("alignToBottom"),s=A("horizontalDirection"),i=b.useMemo(()=>ne(n,c=>Et(c,s?"width":"height")),[n,s]),l=kt(i,!0,A("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:Zt(r),children:t})},dr=({children:t})=>{const e=b.useContext(me),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=A("customScrollParent"),s=Me(n,r,A("skipAnimationFrameInResizeObserver")),i=A("alignToBottom");return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Zt(i),children:t})},fr=({children:t})=>{const e=A("TopItemListComponent")??"div",n=A("headerHeight"),o={...lr,marginTop:`${n}px`},r=A("context");return V.jsx(e,{style:o,...nt(e,r),children:t})},mr=b.memo(function(e){const n=A("useWindowScroll"),o=A("topItemsIndexes").length>0,r=A("customScrollParent"),s=A("context"),i=r||n?hr:pr,l=r||n?dr:ar;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(fr,{children:V.jsx(vn,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(cr,{}),V.jsx(vn,{}),V.jsx(ur,{})]})]})}),{Component:no,useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}=Ke(er,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},mr),pr=Xe({useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}),hr=Je({useEmitter:Qe,useEmitterValue:A,usePublisher:Ct}),gr=no,xr=no,Ir=K(()=>{const t=v(d=>V.jsxs("td",{children:["Item $",d]})),e=v(null),n=v(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=v(null),r=v(null),s=v({}),i=v(Ze),l=v(Yt),c=(d,m=null)=>ht(x(s,B(I=>I[d]),et()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Sr=K(([t,e])=>({...t,...e}),ot(Xn,Ir)),Tr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),vr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),Cr={overflowAnchor:"none"},Cn={position:Ye(),zIndex:2,overflowAnchor:"none"},wn=b.memo(function({showTopList:e=!1}){const n=M("listState"),o=M("computeItemKey"),r=M("firstItemIndex"),s=M("context"),i=M("isSeeking"),l=M("fixedHeaderHeight"),c=M("groupIndices").length>0,d=M("itemContent"),m=M("groupContent"),I=M("ScrollSeekPlaceholder")??Tr,p=M("GroupComponent"),T=M("TableRowComponent"),w=(e?n.topItems:[]).reduce((h,f,a)=>(a===0?h.push(f.size):h.push(h[a-1]+f.size),h),[]);return(e?n.topItems:n.items).map(h=>{const f=h.originalIndex,a=o(f+r,h.data,s),S=e?f===0?0:w[f-1]:0;return i?b.createElement(I,{...nt(I,s),height:h.size,index:h.index,key:a,type:h.type||"item"}):h.type==="group"?b.createElement(p,{...nt(p,s),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,key:a,style:{...Cn,top:l}},m(h.index,s)):b.createElement(T,{...nt(T,s),...eo(T,h.data),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,"data-item-group-index":h.groupIndex,key:a,style:e?{...Cn,top:l+S}:Cr},c?d(h.index,h.groupIndex,h.data,s):d(h.index,h.data,s))})}),wr=b.memo(function(){const e=M("listState"),n=M("topItemsIndexes").length>0,o=bt("sizeRanges"),r=M("useWindowScroll"),s=M("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),c=s||r?i:l,d=M("trackItemSizes"),m=M("itemSize"),I=M("log"),{callbackRef:p,ref:T}=Ln(o,m,d,c,I,void 0,s,!1,M("skipAnimationFrameInResizeObserver")),[w,E]=b.useState(0);tn("deviation",O=>{w!==O&&(T.current.style.marginTop=`${O}px`,E(O))});const h=M("EmptyPlaceholder"),f=M("FillerRow")??vr,a=M("TableBodyComponent"),S=M("paddingTopAddition"),H=M("statefulTotalCount"),y=M("context");if(H===0&&h!==null&&h!==void 0)return V.jsx(h,{...nt(h,y)});const k=(n?e.topItems:[]).reduce((O,G)=>O+G.size,0),u=e.offsetTop+S+w-k,g=e.offsetBottom,C=u>0?V.jsx(f,{context:y,height:u},"padding-top"):null,z=g>0?V.jsx(f,{context:y,height:g},"padding-bottom"):null;return V.jsxs(a,{"data-testid":"virtuoso-item-list",ref:p,...nt(a,y),children:[C,n&&V.jsx(wn,{showTopList:!0}),V.jsx(wn,{}),z]})}),yr=({children:t})=>{const e=b.useContext(me),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=kt(b.useMemo(()=>ne(n,s=>Et(s,"height")),[n]),!0,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:Zt(!1),children:t})},br=({children:t})=>{const e=b.useContext(me),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=M("customScrollParent"),s=Me(n,r,M("skipAnimationFrameInResizeObserver"));return b.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Zt(!1),children:t})},Rr=b.memo(function(e){const n=M("useWindowScroll"),o=M("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=M("fixedHeaderContent"),l=M("fixedFooterContent"),c=M("context"),d=kt(b.useMemo(()=>ne(r,a=>Et(a,"height")),[r]),!0,M("skipAnimationFrameInResizeObserver")),m=kt(b.useMemo(()=>ne(s,a=>Et(a,"height")),[s]),!0,M("skipAnimationFrameInResizeObserver")),I=o||n?Hr:Er,p=o||n?br:yr,T=M("TableComponent"),w=M("TableHeadComponent"),E=M("TableFooterComponent"),h=i?V.jsx(w,{ref:d,style:{position:"sticky",top:0,zIndex:2},...nt(w,c),children:i()},"TableHead"):null,f=l?V.jsx(E,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...nt(E,c),children:l()},"TableFoot"):null;return V.jsx(I,{...e,...nt(I,c),children:V.jsx(p,{children:V.jsxs(T,{style:{borderSpacing:0,overflowAnchor:"none"},...nt(T,c),children:[h,V.jsx(wr,{},"TableBody"),f]})})})}),{Component:oo,useEmitter:tn,useEmitterValue:M,usePublisher:bt}=Ke(Sr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Rr),Er=Xe({useEmitter:tn,useEmitterValue:M,usePublisher:bt}),Hr=Je({useEmitter:tn,useEmitterValue:M,usePublisher:bt}),Br=oo,Or=oo,yn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},kr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:bn,floor:ve,max:ee,min:Oe,round:Rn}=Math;function En(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Lr(t){return{...kr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function zr(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const Fr=K(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:I},p,T,{didMount:w,propsReady:E},{customScrollParent:h,useWindowScroll:f,windowScrollContainerState:a,windowScrollTo:S,windowViewportRect:H},y])=>{const k=v(0),u=v(0),g=v(yn),C=v({height:0,width:0}),z=v({height:0,width:0}),O=$(),G=$(),_=v(0),Z=v(null),F=v({column:0,row:0}),mt=$(),q=$(),Q=v(!1),gt=v(0),ut=v(!0),It=v(!1),Ft=v(!1);Y(x(w,D(gt),W(([R,N])=>N!==0)),()=>{j(ut,!1)}),Y(x(at(w,ut,z,C,gt,It),W(([R,N,U,rt,,tt])=>R&&!N&&U.height!==0&&rt.height!==0&&!tt)),([,,,,R])=>{j(It,!0),Ne(1,()=>{j(O,R)}),yt(x(d),()=>{j(e,[0,0]),j(ut,!0)})}),L(x(q,W(R=>R!=null&&R.scrollTop>0),Bt(0)),u),Y(x(w,D(q),W(([,R])=>R!=null)),([,R])=>{R&&(j(C,R.viewport),j(z,R.item),j(F,R.gap),R.scrollTop>0&&(j(Q,!0),yt(x(d,_t(1)),N=>{j(Q,!1)}),j(c,{top:R.scrollTop})))}),L(x(C,B(({height:R})=>R)),I),L(x(at(P(C,xe),P(z,xe),P(F,(R,N)=>R!==void 0&&R.column===N.column&&R.row===N.row),P(d)),B(([R,N,U,rt])=>({gap:U,item:N,scrollTop:rt,viewport:R}))),mt),L(x(at(P(k),o,P(F,zr),P(z,xe),P(C,xe),P(Z),P(u),P(Q),P(ut),P(gt)),W(([,,,,,,,R])=>!R),B(([R,[N,U],rt,tt,X,lt,St,,ct,Vt])=>{const{column:Gt,row:Qt}=rt,{height:pe,width:be}=tt,{width:en}=X;if(St===0&&(R===0||en===0))return yn;if(be===0){const ln=De(Vt,R),lo=ln+Math.max(St-1,0);return Lr(En(ln,lo,lt))}const he=ro(en,be,Gt);let $t,Mt;ct?N===0&&U===0&&St>0?($t=0,Mt=St-1):($t=he*ve((N+Qt)/(pe+Qt)),Mt=he*bn((U+Qt)/(pe+Qt))-1,Mt=Oe(R-1,ee(Mt,he-1)),$t=Oe(Mt,ee(0,$t))):($t=0,Mt=-1);const nn=En($t,Mt,lt),{bottom:on,top:rn}=Hn(X,rt,tt,nn),sn=bn(R/he),io=sn*pe+(sn-1)*Qt-on;return{bottom:on,itemHeight:pe,items:nn,itemWidth:be,offsetBottom:io,offsetTop:rn,top:rn}})),g),L(x(Z,W(R=>R!==null),B(R=>R.length)),k),L(x(at(C,z,g,F),W(([R,N,{items:U}])=>U.length>0&&N.height!==0&&R.height!==0),B(([R,N,{items:U},rt])=>{const{bottom:tt,top:X}=Hn(R,rt,N,U);return[X,tt]}),et(se)),e);const pt=v(!1);L(x(d,D(pt),B(([R,N])=>N||R!==0)),pt);const Dt=vt(x(at(g,k),W(([{items:R}])=>R.length>0),D(pt),W(([[R,N],U])=>{const tt=R.items[R.items.length-1].index===N-1;return(U||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===N)&&tt}),B(([[,R]])=>R-1),et())),Xt=vt(x(P(g),W(({items:R})=>R.length>0&&R[0].index===0),Bt(0),et())),Ht=vt(x(P(g),D(Q),W(([{items:R},N])=>R.length>0&&!N),B(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),et(Wn),zt(0)));L(Ht,T.scrollSeekRangeChanged),L(x(O,D(C,z,k,F),B(([R,N,U,rt,tt])=>{const X=Nn(R),{align:lt,behavior:St,offset:ct}=X;let Vt=X.index;Vt==="LAST"&&(Vt=rt-1),Vt=ee(0,Vt,Oe(rt-1,Vt));let Gt=Ge(N,tt,U,Vt);return lt==="end"?Gt=Rn(Gt-N.height+U.height):lt==="center"&&(Gt=Rn(Gt-N.height/2+U.height/2)),ct!==void 0&&ct!==0&&(Gt+=ct),{behavior:St,top:Gt}})),c);const Jt=ht(x(g,B(R=>R.offsetBottom+R.bottom)),0);return L(x(H,B(R=>({height:R.visibleHeight,width:R.visibleWidth}))),C),{customScrollParent:h,data:Z,deviation:_,footerHeight:r,gap:F,headerHeight:s,increaseViewportBy:t,initialItemCount:u,itemDimensions:z,overscan:n,restoreStateFrom:q,scrollBy:i,scrollContainerState:l,scrollHeight:G,scrollTo:c,scrollToIndex:O,scrollTop:d,smoothScrollTargetReached:m,totalCount:k,useWindowScroll:f,viewportDimensions:C,windowScrollContainerState:a,windowScrollTo:S,windowViewportRect:H,...T,gridState:g,horizontalDirection:Ft,initialTopMostItemIndex:gt,totalListHeight:Jt,...p,endReached:Dt,propsReady:E,rangeChanged:Ht,startReached:Xt,stateChanged:mt,stateRestoreInProgress:Q,...y}},ot($e,xt,fe,Yn,At,Ue,Wt));function ro(t,e,n){return ee(1,ve((t+n)/(ve(e)+n)))}function Hn(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Ge(t,e,n,o[0].index);return{bottom:Ge(t,e,n,o[o.length-1].index)+r,top:s}}function Ge(t,e,n,o){const r=ro(t.width,n.width,e.column),s=ve(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const Vr=K(()=>{const t=v(I=>`Item ${I}`),e=v({}),n=v(null),o=v("virtuoso-grid-item"),r=v("virtuoso-grid-list"),s=v(Ze),i=v("div"),l=v(Yt),c=(I,p=null)=>ht(x(e,B(T=>T[I]),et()),p),d=v(!1),m=v(!1);return L(P(m),d),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Gr=K(([t,e])=>({...t,...e}),ot(Fr,Vr)),Pr=b.memo(function(){const e=st("gridState"),n=st("listClassName"),o=st("itemClassName"),r=st("itemContent"),s=st("computeItemKey"),i=st("isSeeking"),l=wt("scrollHeight"),c=st("ItemComponent"),d=st("ListComponent"),m=st("ScrollSeekPlaceholder"),I=st("context"),p=wt("itemDimensions"),T=wt("gap"),w=st("log"),E=st("stateRestoreInProgress"),h=wt("reportReadyState"),f=kt(b.useMemo(()=>a=>{const S=a.parentElement.parentElement.scrollHeight;l(S);const H=a.firstChild;if(H!==null){const{height:y,width:k}=H.getBoundingClientRect();p({height:y,width:k})}T({column:Bn("column-gap",getComputedStyle(a).columnGap,w),row:Bn("row-gap",getComputedStyle(a).rowGap,w)})},[l,p,T,w]),!0,!1);return Jn(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),E?null:V.jsx(d,{className:n,ref:f,...nt(d,I),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const S=s(a.index,a.data,I);return i?V.jsx(m,{...nt(m,I),height:e.itemHeight,index:a.index,width:e.itemWidth},S):b.createElement(c,{...nt(c,I),className:o,"data-index":a.index,key:S},r(a.index,a.data,I))})})}),Wr=b.memo(function(){const e=st("HeaderComponent"),n=wt("headerHeight"),o=st("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=st("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),Ar=b.memo(function(){const e=st("FooterComponent"),n=wt("footerHeight"),o=st("headerFooterTag"),r=kt(b.useMemo(()=>i=>{n(Et(i,"height"))},[n]),!0,!1),s=st("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...nt(e,s)})}):null}),Mr=({children:t})=>{const e=b.useContext(qe),n=wt("itemDimensions"),o=wt("viewportDimensions"),r=kt(b.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return b.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),V.jsx("div",{ref:r,style:Zt(!1),children:t})},jr=({children:t})=>{const e=b.useContext(qe),n=wt("windowViewportRect"),o=wt("itemDimensions"),r=st("customScrollParent"),s=Me(n,r,!1);return b.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:s,style:Zt(!1),children:t})},_r=b.memo(function({...e}){const n=st("useWindowScroll"),o=st("customScrollParent"),r=o||n?$r:Dr,s=o||n?jr:Mr,i=st("context");return V.jsx(r,{...e,...nt(r,i),children:V.jsxs(s,{children:[V.jsx(Wr,{}),V.jsx(Pr,{}),V.jsx(Ar,{})]})})}),{Component:Nr,useEmitter:so,useEmitterValue:st,usePublisher:wt}=Ke(Gr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},_r),Dr=Xe({useEmitter:so,useEmitterValue:st,usePublisher:wt}),$r=Je({useEmitter:so,useEmitterValue:st,usePublisher:wt});function Bn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,dt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Ur=Nr;exports.GroupedTableVirtuoso=Or;exports.GroupedVirtuoso=xr;exports.LogLevel=dt;exports.TableVirtuoso=Br;exports.Virtuoso=gr;exports.VirtuosoGrid=Ur;exports.VirtuosoGridMockContext=qe;exports.VirtuosoMockContext=me;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as W, jsxs as Dt } from "react/jsx-runtime";
|
|
2
2
|
import E, { createElement as Nt } from "react";
|
|
3
3
|
import ao from "react-dom";
|
|
4
|
-
const we = 0,
|
|
4
|
+
const we = 0, Gt = 1, Zt = 2, kn = 4;
|
|
5
5
|
function un(t) {
|
|
6
6
|
return () => t;
|
|
7
7
|
}
|
|
@@ -37,7 +37,7 @@ function ot(...t) {
|
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
39
|
function Y(t, e) {
|
|
40
|
-
return t(
|
|
40
|
+
return t(Gt, e);
|
|
41
41
|
}
|
|
42
42
|
function _(t, e) {
|
|
43
43
|
t(we, e);
|
|
@@ -52,7 +52,7 @@ function L(t, e) {
|
|
|
52
52
|
return Y(t, mo(e, we));
|
|
53
53
|
}
|
|
54
54
|
function yt(t, e) {
|
|
55
|
-
const n = t(
|
|
55
|
+
const n = t(Gt, (o) => {
|
|
56
56
|
n(), e(o);
|
|
57
57
|
});
|
|
58
58
|
return n;
|
|
@@ -74,7 +74,7 @@ function et(t = Ln) {
|
|
|
74
74
|
t(e, o) || (e = o, n(o));
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function G(t) {
|
|
78
78
|
return (e) => (n) => {
|
|
79
79
|
t(n) && e(n);
|
|
80
80
|
};
|
|
@@ -94,7 +94,7 @@ function I(t, ...e) {
|
|
|
94
94
|
case Zt:
|
|
95
95
|
Me(t);
|
|
96
96
|
return;
|
|
97
|
-
case
|
|
97
|
+
case Gt:
|
|
98
98
|
return Y(t, n(r));
|
|
99
99
|
}
|
|
100
100
|
});
|
|
@@ -142,7 +142,7 @@ function Io(t) {
|
|
|
142
142
|
const o = () => e?.();
|
|
143
143
|
return function(r, s) {
|
|
144
144
|
switch (r) {
|
|
145
|
-
case
|
|
145
|
+
case Gt:
|
|
146
146
|
return s ? n === s ? void 0 : (o(), n = s, e = Y(t, s), e) : (o(), Xt);
|
|
147
147
|
case Zt:
|
|
148
148
|
o(), n = null;
|
|
@@ -158,7 +158,7 @@ function v(t) {
|
|
|
158
158
|
case we:
|
|
159
159
|
e = r;
|
|
160
160
|
break;
|
|
161
|
-
case
|
|
161
|
+
case Gt: {
|
|
162
162
|
r(e);
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
@@ -183,7 +183,7 @@ function U() {
|
|
|
183
183
|
case Zt:
|
|
184
184
|
t.splice(0, t.length);
|
|
185
185
|
return;
|
|
186
|
-
case
|
|
186
|
+
case Gt:
|
|
187
187
|
return t.push(n), () => {
|
|
188
188
|
const o = t.indexOf(n);
|
|
189
189
|
o > -1 && t.splice(o, 1);
|
|
@@ -227,7 +227,7 @@ function at(...t) {
|
|
|
227
227
|
Me(e);
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
230
|
-
case
|
|
230
|
+
case Gt:
|
|
231
231
|
return o === r && i(n), Y(e, i);
|
|
232
232
|
}
|
|
233
233
|
};
|
|
@@ -240,7 +240,7 @@ function ze(...t) {
|
|
|
240
240
|
switch (e) {
|
|
241
241
|
case Zt:
|
|
242
242
|
return;
|
|
243
|
-
case
|
|
243
|
+
case Gt:
|
|
244
244
|
return po(...t.map((o) => Y(o, n)));
|
|
245
245
|
}
|
|
246
246
|
};
|
|
@@ -259,7 +259,7 @@ const ft = {
|
|
|
259
259
|
[ft.ERROR]: "error",
|
|
260
260
|
[ft.INFO]: "log",
|
|
261
261
|
[ft.WARN]: "warn"
|
|
262
|
-
}, vo = () => typeof globalThis > "u" ? window : globalThis,
|
|
262
|
+
}, vo = () => typeof globalThis > "u" ? window : globalThis, Wt = j(
|
|
263
263
|
() => {
|
|
264
264
|
const t = v(ft.ERROR);
|
|
265
265
|
return {
|
|
@@ -453,7 +453,7 @@ function Rt(t, e, n = "k") {
|
|
|
453
453
|
return Rt(t.l, e, n);
|
|
454
454
|
}
|
|
455
455
|
function Tt(t, e, n) {
|
|
456
|
-
return J(t) ?
|
|
456
|
+
return J(t) ? Gn(e, n, 1) : e === t.k ? dt(t, { k: e, v: n }) : e < t.k ? mn(dt(t, { l: Tt(t.l, e, n) })) : mn(dt(t, { r: Tt(t.r, e, n) }));
|
|
457
457
|
}
|
|
458
458
|
function qt() {
|
|
459
459
|
return se;
|
|
@@ -494,7 +494,7 @@ function Se(t) {
|
|
|
494
494
|
return t;
|
|
495
495
|
if (n > o.lvl + 1) {
|
|
496
496
|
if (Ee(e))
|
|
497
|
-
return
|
|
497
|
+
return Wn(dt(t, { lvl: n - 1 }));
|
|
498
498
|
if (!J(e) && !J(e.r))
|
|
499
499
|
return dt(e.r, {
|
|
500
500
|
l: dt(e, { r: e.r.l }),
|
|
@@ -522,7 +522,7 @@ function Se(t) {
|
|
|
522
522
|
throw new Error("Unexpected empty nodes");
|
|
523
523
|
}
|
|
524
524
|
function dt(t, e) {
|
|
525
|
-
return
|
|
525
|
+
return Gn(
|
|
526
526
|
e.k !== void 0 ? e.k : t.k,
|
|
527
527
|
e.v !== void 0 ? e.v : t.v,
|
|
528
528
|
e.lvl !== void 0 ? e.lvl : t.lvl,
|
|
@@ -539,13 +539,13 @@ function Ee(t) {
|
|
|
539
539
|
function Pn(t) {
|
|
540
540
|
return J(t.r) ? [t.k, t.v] : Pn(t.r);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Gn(t, e, n, o = se, r = se) {
|
|
543
543
|
return { k: t, l: o, lvl: n, r, v: e };
|
|
544
544
|
}
|
|
545
545
|
function mn(t) {
|
|
546
|
-
return Pe(
|
|
546
|
+
return Pe(Wn(t));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Wn(t) {
|
|
549
549
|
const { l: e } = t;
|
|
550
550
|
return !J(e) && e.lvl === t.lvl ? dt(e, { r: dt(t, { l: e.r }) }) : t;
|
|
551
551
|
}
|
|
@@ -671,7 +671,7 @@ function Oo(t, [e, n, o, r]) {
|
|
|
671
671
|
[i, l] = Ro(i, e);
|
|
672
672
|
if (i === s)
|
|
673
673
|
return t;
|
|
674
|
-
const { lastIndex: c, lastOffset: d, lastSize: m, offsetTree: x } =
|
|
674
|
+
const { lastIndex: c, lastOffset: d, lastSize: m, offsetTree: x } = Ge(t.offsetTree, l, i, r);
|
|
675
675
|
return {
|
|
676
676
|
groupIndices: n,
|
|
677
677
|
groupOffsetTree: n.reduce((p, T) => Tt(p, T, ce(T, x, r)), qt()),
|
|
@@ -694,7 +694,7 @@ function pn(t, e) {
|
|
|
694
694
|
n += e[o + 1] - e[o] - 1, o++;
|
|
695
695
|
return o - (n === t ? 0 : 1);
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Ge(t, e, n, o) {
|
|
698
698
|
let r = t, s = 0, i = 0, l = 0, c = 0;
|
|
699
699
|
if (e !== 0) {
|
|
700
700
|
c = ve(r, e - 1, $e), l = r[c].offset;
|
|
@@ -747,7 +747,7 @@ const Fo = {
|
|
|
747
747
|
L(
|
|
748
748
|
I(
|
|
749
749
|
c,
|
|
750
|
-
|
|
750
|
+
G((u) => u.length > 0),
|
|
751
751
|
$(f, R),
|
|
752
752
|
B(([u, g, C]) => {
|
|
753
753
|
const z = u.reduce((O, V, N) => Tt(O, V, ce(V, g.offsetTree, C) || N), qt());
|
|
@@ -763,7 +763,7 @@ const Fo = {
|
|
|
763
763
|
I(
|
|
764
764
|
o,
|
|
765
765
|
$(f),
|
|
766
|
-
|
|
766
|
+
G(([u, { lastIndex: g }]) => u < g),
|
|
767
767
|
B(([u, { lastIndex: g, lastSize: C }]) => [
|
|
768
768
|
{
|
|
769
769
|
endIndex: g,
|
|
@@ -784,7 +784,7 @@ const Fo = {
|
|
|
784
784
|
L(
|
|
785
785
|
I(
|
|
786
786
|
m,
|
|
787
|
-
|
|
787
|
+
G((u) => u !== void 0 && J(it(f).sizeTree)),
|
|
788
788
|
B((u) => {
|
|
789
789
|
const g = it(x), C = it(c).length > 0;
|
|
790
790
|
return g !== void 0 && g !== 0 ? C ? [
|
|
@@ -797,7 +797,7 @@ const Fo = {
|
|
|
797
797
|
), L(
|
|
798
798
|
I(
|
|
799
799
|
p,
|
|
800
|
-
|
|
800
|
+
G((u) => u !== void 0 && u.length > 0 && J(it(f).sizeTree)),
|
|
801
801
|
B((u) => {
|
|
802
802
|
const g = [];
|
|
803
803
|
let C = u[0], z = 0;
|
|
@@ -821,7 +821,7 @@ const Fo = {
|
|
|
821
821
|
I(
|
|
822
822
|
c,
|
|
823
823
|
$(x, m),
|
|
824
|
-
|
|
824
|
+
G(([, u, g]) => u !== void 0 && g !== void 0),
|
|
825
825
|
B(([u, g, C]) => {
|
|
826
826
|
const z = [];
|
|
827
827
|
for (let O = 0; O < u.length; O++) {
|
|
@@ -977,14 +977,14 @@ const Fo = {
|
|
|
977
977
|
return {
|
|
978
978
|
...g,
|
|
979
979
|
sizeTree: V,
|
|
980
|
-
...
|
|
980
|
+
...Ge(g.offsetTree, 0, V, C)
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
983
|
const O = _t(g.sizeTree).reduce((V, { k: N, v: Z }) => Tt(V, Math.max(0, N + u), Z), qt());
|
|
984
984
|
return {
|
|
985
985
|
...g,
|
|
986
986
|
sizeTree: O,
|
|
987
|
-
...
|
|
987
|
+
...Ge(g.offsetTree, 0, O, C)
|
|
988
988
|
};
|
|
989
989
|
})
|
|
990
990
|
),
|
|
@@ -1013,7 +1013,7 @@ const Fo = {
|
|
|
1013
1013
|
unshiftWith: s
|
|
1014
1014
|
};
|
|
1015
1015
|
},
|
|
1016
|
-
ot(
|
|
1016
|
+
ot(Wt, De),
|
|
1017
1017
|
{ singleton: !0 }
|
|
1018
1018
|
);
|
|
1019
1019
|
function Vo(t) {
|
|
@@ -1043,7 +1043,7 @@ const Dn = j(
|
|
|
1043
1043
|
), L(
|
|
1044
1044
|
I(
|
|
1045
1045
|
at(r, e, o),
|
|
1046
|
-
|
|
1046
|
+
G(([c, d]) => be(d)),
|
|
1047
1047
|
B(([c, d, m]) => Rt(d.groupOffsetTree, Math.max(c - m, 0), "v")[0]),
|
|
1048
1048
|
et(),
|
|
1049
1049
|
B((c) => [c])
|
|
@@ -1057,7 +1057,7 @@ const Dn = j(
|
|
|
1057
1057
|
const e = v(!1), n = vt(
|
|
1058
1058
|
I(
|
|
1059
1059
|
e,
|
|
1060
|
-
|
|
1060
|
+
G((o) => o),
|
|
1061
1061
|
et()
|
|
1062
1062
|
)
|
|
1063
1063
|
);
|
|
@@ -1065,7 +1065,7 @@ const Dn = j(
|
|
|
1065
1065
|
o && it(t)("props updated", {}, ft.DEBUG);
|
|
1066
1066
|
}), { didMount: n, propsReady: e };
|
|
1067
1067
|
},
|
|
1068
|
-
ot(
|
|
1068
|
+
ot(Wt),
|
|
1069
1069
|
{ singleton: !0 }
|
|
1070
1070
|
), Po = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1071
1071
|
function $n(t) {
|
|
@@ -1118,7 +1118,7 @@ const fe = j(
|
|
|
1118
1118
|
Ft(pt);
|
|
1119
1119
|
});
|
|
1120
1120
|
} else
|
|
1121
|
-
h = yt(I(e,
|
|
1121
|
+
h = yt(I(e, Go(150)), Ft);
|
|
1122
1122
|
return f = setTimeout(() => {
|
|
1123
1123
|
S();
|
|
1124
1124
|
}, 1200), _(c, !0), O("scrolling from index to", { behavior: q, index: ut, top: xt }, ft.DEBUG), { behavior: q, top: xt };
|
|
@@ -1132,10 +1132,10 @@ const fe = j(
|
|
|
1132
1132
|
topListHeight: R
|
|
1133
1133
|
};
|
|
1134
1134
|
},
|
|
1135
|
-
ot(Lt, It,
|
|
1135
|
+
ot(Lt, It, Wt),
|
|
1136
1136
|
{ singleton: !0 }
|
|
1137
1137
|
);
|
|
1138
|
-
function
|
|
1138
|
+
function Go(t) {
|
|
1139
1139
|
return (e) => {
|
|
1140
1140
|
const n = setTimeout(() => {
|
|
1141
1141
|
e(!1);
|
|
@@ -1161,7 +1161,7 @@ const me = j(
|
|
|
1161
1161
|
I(
|
|
1162
1162
|
i,
|
|
1163
1163
|
$(c),
|
|
1164
|
-
|
|
1164
|
+
G(([m, x]) => x !== 0),
|
|
1165
1165
|
Bt(!1)
|
|
1166
1166
|
),
|
|
1167
1167
|
l
|
|
@@ -1169,7 +1169,7 @@ const me = j(
|
|
|
1169
1169
|
I(
|
|
1170
1170
|
i,
|
|
1171
1171
|
$(c),
|
|
1172
|
-
|
|
1172
|
+
G(([m, x]) => x !== 0),
|
|
1173
1173
|
Bt(!1)
|
|
1174
1174
|
),
|
|
1175
1175
|
d
|
|
@@ -1177,7 +1177,7 @@ const me = j(
|
|
|
1177
1177
|
I(
|
|
1178
1178
|
at(e, i),
|
|
1179
1179
|
$(l, n, t, d),
|
|
1180
|
-
|
|
1180
|
+
G(([[, m], x, { sizeTree: p }, T, w]) => m && (!J(p) || Ae(T)) && !x && !w),
|
|
1181
1181
|
$(c)
|
|
1182
1182
|
),
|
|
1183
1183
|
([, m]) => {
|
|
@@ -1201,7 +1201,7 @@ const me = j(
|
|
|
1201
1201
|
function Un(t, e) {
|
|
1202
1202
|
return Math.abs(t - e) < 1.01;
|
|
1203
1203
|
}
|
|
1204
|
-
const ue = "up", ne = "down",
|
|
1204
|
+
const ue = "up", ne = "down", Wo = "none", Ao = {
|
|
1205
1205
|
atBottom: !1,
|
|
1206
1206
|
notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
|
|
1207
1207
|
state: {
|
|
@@ -1284,7 +1284,7 @@ const ue = "up", ne = "down", Go = "none", Ao = {
|
|
|
1284
1284
|
},
|
|
1285
1285
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
1286
1286
|
),
|
|
1287
|
-
|
|
1287
|
+
G((a) => a.changed),
|
|
1288
1288
|
B((a) => a.jump)
|
|
1289
1289
|
),
|
|
1290
1290
|
0
|
|
@@ -1309,12 +1309,12 @@ const ue = "up", ne = "down", Go = "none", Ao = {
|
|
|
1309
1309
|
B((a) => a.direction)
|
|
1310
1310
|
),
|
|
1311
1311
|
h
|
|
1312
|
-
), L(I(o, zt(50), Bt(
|
|
1312
|
+
), L(I(o, zt(50), Bt(Wo)), h);
|
|
1313
1313
|
const f = v(0);
|
|
1314
1314
|
return L(
|
|
1315
1315
|
I(
|
|
1316
1316
|
p,
|
|
1317
|
-
|
|
1317
|
+
G((a) => !a),
|
|
1318
1318
|
Bt(0)
|
|
1319
1319
|
),
|
|
1320
1320
|
f
|
|
@@ -1323,7 +1323,7 @@ const ue = "up", ne = "down", Go = "none", Ao = {
|
|
|
1323
1323
|
r,
|
|
1324
1324
|
zt(100),
|
|
1325
1325
|
$(p),
|
|
1326
|
-
|
|
1326
|
+
G(([a, S]) => S),
|
|
1327
1327
|
Ot(([a, S], [H]) => [S, H], [0, 0]),
|
|
1328
1328
|
B(([a, S]) => S - a)
|
|
1329
1329
|
),
|
|
@@ -1384,7 +1384,7 @@ const je = j(
|
|
|
1384
1384
|
] : null;
|
|
1385
1385
|
}
|
|
1386
1386
|
),
|
|
1387
|
-
|
|
1387
|
+
G((m) => m !== null),
|
|
1388
1388
|
et(le)
|
|
1389
1389
|
),
|
|
1390
1390
|
[0, 0]
|
|
@@ -1518,7 +1518,7 @@ const Ut = j(
|
|
|
1518
1518
|
P(a),
|
|
1519
1519
|
t
|
|
1520
1520
|
),
|
|
1521
|
-
|
|
1521
|
+
G(([u, g, , C, , , , , , , , z]) => {
|
|
1522
1522
|
const O = z !== void 0 && z.length !== C;
|
|
1523
1523
|
return u && !g && !O;
|
|
1524
1524
|
}),
|
|
@@ -1606,7 +1606,7 @@ const Ut = j(
|
|
|
1606
1606
|
}
|
|
1607
1607
|
),
|
|
1608
1608
|
//@ts-expect-error filter needs to be fixed
|
|
1609
|
-
|
|
1609
|
+
G((u) => u !== null),
|
|
1610
1610
|
et()
|
|
1611
1611
|
),
|
|
1612
1612
|
Be
|
|
@@ -1614,7 +1614,7 @@ const Ut = j(
|
|
|
1614
1614
|
L(
|
|
1615
1615
|
I(
|
|
1616
1616
|
t,
|
|
1617
|
-
|
|
1617
|
+
G(Ae),
|
|
1618
1618
|
B((u) => u?.length)
|
|
1619
1619
|
),
|
|
1620
1620
|
r
|
|
@@ -1640,9 +1640,9 @@ const Ut = j(
|
|
|
1640
1640
|
const H = vt(
|
|
1641
1641
|
I(
|
|
1642
1642
|
S,
|
|
1643
|
-
|
|
1643
|
+
G(({ items: u }) => u.length > 0),
|
|
1644
1644
|
$(r, t),
|
|
1645
|
-
|
|
1645
|
+
G(([{ items: u }, g]) => u[u.length - 1].originalIndex === g - 1),
|
|
1646
1646
|
B(([, u, g]) => [u - 1, g]),
|
|
1647
1647
|
et(le),
|
|
1648
1648
|
B(([u]) => u)
|
|
@@ -1651,14 +1651,14 @@ const Ut = j(
|
|
|
1651
1651
|
I(
|
|
1652
1652
|
S,
|
|
1653
1653
|
zt(200),
|
|
1654
|
-
|
|
1654
|
+
G(({ items: u, topItems: g }) => u.length > 0 && u[0].originalIndex === g.length),
|
|
1655
1655
|
B(({ items: u }) => u[0].index),
|
|
1656
1656
|
et()
|
|
1657
1657
|
)
|
|
1658
1658
|
), k = vt(
|
|
1659
1659
|
I(
|
|
1660
1660
|
S,
|
|
1661
|
-
|
|
1661
|
+
G(({ items: u }) => u.length > 0),
|
|
1662
1662
|
B(({ items: u }) => {
|
|
1663
1663
|
let g = 0, C = u.length - 1;
|
|
1664
1664
|
for (; u[g].type === "group" && g < C; )
|
|
@@ -1714,7 +1714,7 @@ const Ut = j(
|
|
|
1714
1714
|
const n = v(!1), o = ht(
|
|
1715
1715
|
I(
|
|
1716
1716
|
at(n, t, e),
|
|
1717
|
-
|
|
1717
|
+
G(([r]) => r),
|
|
1718
1718
|
B(([, r, s]) => Math.max(0, r - s)),
|
|
1719
1719
|
zt(0),
|
|
1720
1720
|
et()
|
|
@@ -1756,7 +1756,7 @@ const Ut = j(
|
|
|
1756
1756
|
return V !== null ? y && yt(
|
|
1757
1757
|
I(
|
|
1758
1758
|
i,
|
|
1759
|
-
|
|
1759
|
+
G((N) => !N),
|
|
1760
1760
|
// skips the initial publish of false, and the cleanup call.
|
|
1761
1761
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
1762
1762
|
$t(it(i) ? 1 : 2)
|
|
@@ -1764,14 +1764,14 @@ const Ut = j(
|
|
|
1764
1764
|
y
|
|
1765
1765
|
) : y?.(), V;
|
|
1766
1766
|
}),
|
|
1767
|
-
|
|
1767
|
+
G((x) => x !== null)
|
|
1768
1768
|
),
|
|
1769
1769
|
d
|
|
1770
1770
|
), {
|
|
1771
1771
|
scrollIntoView: m
|
|
1772
1772
|
};
|
|
1773
1773
|
},
|
|
1774
|
-
ot(Lt, It, fe, Ut,
|
|
1774
|
+
ot(Lt, It, fe, Ut, Wt),
|
|
1775
1775
|
{ singleton: !0 }
|
|
1776
1776
|
);
|
|
1777
1777
|
function Tn(t) {
|
|
@@ -1806,7 +1806,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1806
1806
|
let O = k && C, V = "auto";
|
|
1807
1807
|
return O && (V = $o(u, g || z), O = O && V !== !1), { followOutputBehavior: V, shouldFollow: O, totalCount: y };
|
|
1808
1808
|
}),
|
|
1809
|
-
|
|
1809
|
+
G(({ shouldFollow: y }) => y)
|
|
1810
1810
|
),
|
|
1811
1811
|
({ followOutputBehavior: y, totalCount: k }) => {
|
|
1812
1812
|
h !== null && (h(), h = null), it(n) !== void 0 ? requestAnimationFrame(() => {
|
|
@@ -1825,12 +1825,12 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1825
1825
|
Y(
|
|
1826
1826
|
I(
|
|
1827
1827
|
at(P(w), e, d),
|
|
1828
|
-
|
|
1828
|
+
G(([y, , k]) => y !== !1 && k),
|
|
1829
1829
|
Ot(
|
|
1830
1830
|
({ value: y }, [, k]) => ({ refreshed: y === k, value: k }),
|
|
1831
1831
|
{ refreshed: !1, value: 0 }
|
|
1832
1832
|
),
|
|
1833
|
-
|
|
1833
|
+
G(({ refreshed: y }) => y),
|
|
1834
1834
|
$(w, e)
|
|
1835
1835
|
),
|
|
1836
1836
|
([, y]) => {
|
|
@@ -1856,7 +1856,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1856
1856
|
at(I(H, $t(1)), c),
|
|
1857
1857
|
$(P(S), l, x, p),
|
|
1858
1858
|
B(([[y, k], u, g, C, z]) => k && g && u?.({ context: z, totalCount: y, scrollingInProgress: C })),
|
|
1859
|
-
|
|
1859
|
+
G((y) => !!y),
|
|
1860
1860
|
zt(0)
|
|
1861
1861
|
),
|
|
1862
1862
|
(y) => {
|
|
@@ -1874,7 +1874,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1874
1874
|
fe,
|
|
1875
1875
|
me,
|
|
1876
1876
|
At,
|
|
1877
|
-
|
|
1877
|
+
Wt,
|
|
1878
1878
|
It,
|
|
1879
1879
|
qn,
|
|
1880
1880
|
Yn
|
|
@@ -1884,7 +1884,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1884
1884
|
I(
|
|
1885
1885
|
l,
|
|
1886
1886
|
$(s),
|
|
1887
|
-
|
|
1887
|
+
G(([, c]) => c !== 0),
|
|
1888
1888
|
$(r, o, e, n, t),
|
|
1889
1889
|
B(([[, c], d, m, x, p, T = []]) => Kn(c, d, m, x, p, T))
|
|
1890
1890
|
),
|
|
@@ -1899,7 +1899,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1899
1899
|
I(
|
|
1900
1900
|
t,
|
|
1901
1901
|
$(o),
|
|
1902
|
-
|
|
1902
|
+
G(([, r]) => r !== 0),
|
|
1903
1903
|
B(([, r]) => ({ top: r }))
|
|
1904
1904
|
),
|
|
1905
1905
|
(r) => {
|
|
@@ -1907,7 +1907,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1907
1907
|
I(
|
|
1908
1908
|
n,
|
|
1909
1909
|
$t(1),
|
|
1910
|
-
|
|
1910
|
+
G((s) => s.items.length > 1)
|
|
1911
1911
|
),
|
|
1912
1912
|
() => {
|
|
1913
1913
|
requestAnimationFrame(() => {
|
|
@@ -1929,7 +1929,7 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
1929
1929
|
I(
|
|
1930
1930
|
t,
|
|
1931
1931
|
$(o, e, n),
|
|
1932
|
-
|
|
1932
|
+
G(([r, s]) => s !== !1 && s !== void 0),
|
|
1933
1933
|
B(([r, s, i, l]) => {
|
|
1934
1934
|
const { enter: c, exit: d } = s;
|
|
1935
1935
|
if (i) {
|
|
@@ -2001,11 +2001,11 @@ const $o = (t, e) => typeof t == "function" ? Tn(t(e)) : e && Tn(t), Uo = j(
|
|
|
2001
2001
|
const H = ko(w.sizeTree);
|
|
2002
2002
|
h && f !== null && a !== null && (R = f.scrollTop - a.offsetTop), R -= S, T({ ranges: H, scrollTop: R });
|
|
2003
2003
|
}
|
|
2004
|
-
), L(I(m,
|
|
2004
|
+
), L(I(m, G(Ae), B(Yo)), r), L(
|
|
2005
2005
|
I(
|
|
2006
2006
|
s,
|
|
2007
2007
|
$(m),
|
|
2008
|
-
|
|
2008
|
+
G(([, T]) => T !== void 0),
|
|
2009
2009
|
et(),
|
|
2010
2010
|
B(([, T]) => T.ranges)
|
|
2011
2011
|
),
|
|
@@ -2025,7 +2025,7 @@ const Zo = j(([{ topItemsIndexes: t }]) => {
|
|
|
2025
2025
|
return L(
|
|
2026
2026
|
I(
|
|
2027
2027
|
e,
|
|
2028
|
-
|
|
2028
|
+
G((n) => n >= 0),
|
|
2029
2029
|
B((n) => Array.from({ length: n }).map((o, r) => r))
|
|
2030
2030
|
),
|
|
2031
2031
|
t
|
|
@@ -2056,9 +2056,9 @@ const Xo = Xn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2056
2056
|
},
|
|
2057
2057
|
[0, [], 0, 0]
|
|
2058
2058
|
),
|
|
2059
|
-
|
|
2059
|
+
G(([f]) => f !== 0),
|
|
2060
2060
|
$(o, l, n, r, T, w),
|
|
2061
|
-
|
|
2061
|
+
G(([, f, a, S, , , H]) => !H && !S && f !== 0 && a === ue),
|
|
2062
2062
|
B(([[f], , , , , a]) => (a("Upward scrolling compensation", { amount: f }, ft.DEBUG), f))
|
|
2063
2063
|
)
|
|
2064
2064
|
);
|
|
@@ -2070,7 +2070,7 @@ const Xo = Xn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2070
2070
|
}), Y(
|
|
2071
2071
|
I(
|
|
2072
2072
|
at(ht(s, !1), t, w),
|
|
2073
|
-
|
|
2073
|
+
G(([f, a, S]) => !f && !S && a !== 0),
|
|
2074
2074
|
B(([f, a]) => a),
|
|
2075
2075
|
zt(1)
|
|
2076
2076
|
),
|
|
@@ -2111,7 +2111,7 @@ const Xo = Xn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2111
2111
|
}
|
|
2112
2112
|
), { deviation: t };
|
|
2113
2113
|
},
|
|
2114
|
-
ot(It, pe, Ut, Lt,
|
|
2114
|
+
ot(It, pe, Ut, Lt, Wt, De)
|
|
2115
2115
|
), Qo = j(
|
|
2116
2116
|
([
|
|
2117
2117
|
t,
|
|
@@ -2148,7 +2148,7 @@ const Xo = Xn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2148
2148
|
No,
|
|
2149
2149
|
qe,
|
|
2150
2150
|
Yn,
|
|
2151
|
-
|
|
2151
|
+
Wt,
|
|
2152
2152
|
qn
|
|
2153
2153
|
)
|
|
2154
2154
|
), Jn = j(
|
|
@@ -2286,7 +2286,7 @@ function Ye(t, e, n) {
|
|
|
2286
2286
|
c(k, y);
|
|
2287
2287
|
}), E.useImperativeHandle(S, un(d(k)));
|
|
2288
2288
|
const g = n;
|
|
2289
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ W(l.Provider, { value: k, children: n !== void 0 ? /* @__PURE__ */ W(g, { ...tr([...o, ...r, ...i], y), children: H }) : H });
|
|
2290
2290
|
}), p = (f) => {
|
|
2291
2291
|
const a = E.useContext(l);
|
|
2292
2292
|
return E.useCallback(
|
|
@@ -2313,7 +2313,7 @@ function Ye(t, e, n) {
|
|
|
2313
2313
|
}),
|
|
2314
2314
|
[S, H]
|
|
2315
2315
|
), H;
|
|
2316
|
-
}, R = E.version
|
|
2316
|
+
}, R = parseInt(E.version) >= 18 ? T : w;
|
|
2317
2317
|
return {
|
|
2318
2318
|
Component: x,
|
|
2319
2319
|
useEmitter: (f, a) => {
|
|
@@ -2422,7 +2422,7 @@ const nr = /* @__PURE__ */ j(() => {
|
|
|
2422
2422
|
}), or = /* @__PURE__ */ j(
|
|
2423
2423
|
([t, e]) => ({ ...t, ...e }),
|
|
2424
2424
|
ot(Jn, nr)
|
|
2425
|
-
), rr = ({ height: t }) => /* @__PURE__ */
|
|
2425
|
+
), rr = ({ height: t }) => /* @__PURE__ */ W("div", { style: { height: t } }), sr = { overflowAnchor: "none", position: Ze(), zIndex: 1 }, no = { overflowAnchor: "none" }, ir = { ...no, display: "inline-block", height: "100%" }, Cn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2426
2426
|
const n = A("listState"), o = Ct("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = Ct("windowScrollContainerState"), l = Ct("scrollContainerState"), c = s || r ? i : l, d = A("itemContent"), m = A("context"), x = A("groupContent"), p = A("trackItemSizes"), T = A("itemSize"), w = A("log"), R = Ct("gap"), h = A("horizontalDirection"), { callbackRef: f } = zn(
|
|
2427
2427
|
o,
|
|
2428
2428
|
T,
|
|
@@ -2453,7 +2453,7 @@ const nr = /* @__PURE__ */ j(() => {
|
|
|
2453
2453
|
},
|
|
2454
2454
|
...N ? {} : { visibility: "hidden" }
|
|
2455
2455
|
};
|
|
2456
|
-
return !e && n.totalCount === 0 && H !== null && H !== void 0 ? /* @__PURE__ */
|
|
2456
|
+
return !e && n.totalCount === 0 && H !== null && H !== void 0 ? /* @__PURE__ */ W(H, { ...nt(H, m) }) : /* @__PURE__ */ W(
|
|
2457
2457
|
k,
|
|
2458
2458
|
{
|
|
2459
2459
|
...nt(k, m),
|
|
@@ -2540,7 +2540,7 @@ const ar = /* @__PURE__ */ E.memo(function() {
|
|
|
2540
2540
|
!0,
|
|
2541
2541
|
A("skipAnimationFrameInResizeObserver")
|
|
2542
2542
|
), s = A("context");
|
|
2543
|
-
return e != null ? /* @__PURE__ */
|
|
2543
|
+
return e != null ? /* @__PURE__ */ W(o, { ref: r, children: /* @__PURE__ */ W(e, { ...nt(e, s) }) }) : null;
|
|
2544
2544
|
}), dr = /* @__PURE__ */ E.memo(function() {
|
|
2545
2545
|
const e = A("FooterComponent"), n = Ct("footerHeight"), o = A("HeaderFooterTag"), r = kt(
|
|
2546
2546
|
E.useMemo(
|
|
@@ -2552,7 +2552,7 @@ const ar = /* @__PURE__ */ E.memo(function() {
|
|
|
2552
2552
|
!0,
|
|
2553
2553
|
A("skipAnimationFrameInResizeObserver")
|
|
2554
2554
|
), s = A("context");
|
|
2555
|
-
return e != null ? /* @__PURE__ */
|
|
2555
|
+
return e != null ? /* @__PURE__ */ W(o, { ref: r, children: /* @__PURE__ */ W(e, { ...nt(e, s) }) }) : null;
|
|
2556
2556
|
});
|
|
2557
2557
|
function Je({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2558
2558
|
return E.memo(function({ children: s, style: i, context: l, ...c }) {
|
|
@@ -2564,7 +2564,7 @@ function Je({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2564
2564
|
void 0,
|
|
2565
2565
|
T
|
|
2566
2566
|
);
|
|
2567
|
-
return t("scrollTo", h), t("scrollBy", w), /* @__PURE__ */
|
|
2567
|
+
return t("scrollTo", h), t("scrollBy", w), /* @__PURE__ */ W(
|
|
2568
2568
|
m,
|
|
2569
2569
|
{
|
|
2570
2570
|
"data-testid": "virtuoso-scroller",
|
|
@@ -2590,7 +2590,7 @@ function Qe({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2590
2590
|
);
|
|
2591
2591
|
return to(() => (a.current = w || R.current?.ownerDocument.defaultView, () => {
|
|
2592
2592
|
a.current = null;
|
|
2593
|
-
}), [a, w]), t("windowScrollTo", S), t("scrollBy", f), /* @__PURE__ */
|
|
2593
|
+
}), [a, w]), t("windowScrollTo", S), t("scrollBy", f), /* @__PURE__ */ W(
|
|
2594
2594
|
m,
|
|
2595
2595
|
{
|
|
2596
2596
|
ref: R,
|
|
@@ -2610,7 +2610,7 @@ const fr = ({ children: t }) => {
|
|
|
2610
2610
|
), l = kt(i, !0, A("skipAnimationFrameInResizeObserver"));
|
|
2611
2611
|
return E.useEffect(() => {
|
|
2612
2612
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2613
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2613
|
+
}, [e, n, o]), /* @__PURE__ */ W("div", { "data-viewport-type": "element", ref: l, style: Jt(r), children: t });
|
|
2614
2614
|
}, mr = ({ children: t }) => {
|
|
2615
2615
|
const e = E.useContext(Re), n = Ct("windowViewportRect"), o = Ct("fixedItemHeight"), r = A("customScrollParent"), s = Ne(
|
|
2616
2616
|
n,
|
|
@@ -2619,18 +2619,18 @@ const fr = ({ children: t }) => {
|
|
|
2619
2619
|
), i = A("alignToBottom");
|
|
2620
2620
|
return E.useEffect(() => {
|
|
2621
2621
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2622
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2622
|
+
}, [e, n, o]), /* @__PURE__ */ W("div", { "data-viewport-type": "window", ref: s, style: Jt(i), children: t });
|
|
2623
2623
|
}, pr = ({ children: t }) => {
|
|
2624
2624
|
const e = A("TopItemListComponent") ?? "div", n = A("headerHeight"), o = { ...ur, marginTop: `${n}px` }, r = A("context");
|
|
2625
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ W(e, { style: o, ...nt(e, r), children: t });
|
|
2626
2626
|
}, hr = /* @__PURE__ */ E.memo(function(e) {
|
|
2627
2627
|
const n = A("useWindowScroll"), o = A("topItemsIndexes").length > 0, r = A("customScrollParent"), s = A("context");
|
|
2628
2628
|
return /* @__PURE__ */ Dt(r || n ? Ir : gr, { ...e, context: s, children: [
|
|
2629
|
-
o && /* @__PURE__ */
|
|
2629
|
+
o && /* @__PURE__ */ W(pr, { children: /* @__PURE__ */ W(Cn, { showTopList: !0 }) }),
|
|
2630
2630
|
/* @__PURE__ */ Dt(r || n ? mr : fr, { children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ W(ar, {}),
|
|
2632
|
+
/* @__PURE__ */ W(Cn, {}),
|
|
2633
|
+
/* @__PURE__ */ W(dr, {})
|
|
2634
2634
|
] })
|
|
2635
2635
|
] });
|
|
2636
2636
|
}), {
|
|
@@ -2738,7 +2738,7 @@ const fr = ({ children: t }) => {
|
|
|
2738
2738
|
}), Sr = /* @__PURE__ */ j(
|
|
2739
2739
|
([t, e]) => ({ ...t, ...e }),
|
|
2740
2740
|
ot(Jn, xr)
|
|
2741
|
-
), Tr = ({ height: t }) => /* @__PURE__ */
|
|
2741
|
+
), Tr = ({ height: t }) => /* @__PURE__ */ W("tr", { children: /* @__PURE__ */ W("td", { style: { height: t } }) }), vr = ({ height: t }) => /* @__PURE__ */ W("tr", { children: /* @__PURE__ */ W("td", { style: { border: 0, height: t, padding: 0 } }) }), Cr = { overflowAnchor: "none" }, wn = { position: Ze(), zIndex: 2, overflowAnchor: "none" }, yn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2742
2742
|
const n = M("listState"), o = M("computeItemKey"), r = M("firstItemIndex"), s = M("context"), i = M("isSeeking"), l = M("fixedHeaderHeight"), c = M("groupIndices").length > 0, d = M("itemContent"), m = M("groupContent"), x = M("ScrollSeekPlaceholder") ?? Tr, p = M("GroupComponent"), T = M("TableRowComponent"), w = (e ? n.topItems : []).reduce((h, f, a) => (a === 0 ? h.push(f.size) : h.push(h[a - 1] + f.size), h), []);
|
|
2743
2743
|
return (e ? n.topItems : n.items).map((h) => {
|
|
2744
2744
|
const f = h.originalIndex, a = o(f + r, h.data, s), S = e ? f === 0 ? 0 : w[f - 1] : 0;
|
|
@@ -2797,12 +2797,12 @@ const fr = ({ children: t }) => {
|
|
|
2797
2797
|
});
|
|
2798
2798
|
const h = M("EmptyPlaceholder"), f = M("FillerRow") ?? vr, a = M("TableBodyComponent"), S = M("paddingTopAddition"), H = M("statefulTotalCount"), y = M("context");
|
|
2799
2799
|
if (H === 0 && h !== null && h !== void 0)
|
|
2800
|
-
return /* @__PURE__ */
|
|
2801
|
-
const k = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), u = e.offsetTop + S + w - k, g = e.offsetBottom, C = u > 0 ? /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ W(h, { ...nt(h, y) });
|
|
2801
|
+
const k = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), u = e.offsetTop + S + w - k, g = e.offsetBottom, C = u > 0 ? /* @__PURE__ */ W(f, { context: y, height: u }, "padding-top") : null, z = g > 0 ? /* @__PURE__ */ W(f, { context: y, height: g }, "padding-bottom") : null;
|
|
2802
2802
|
return /* @__PURE__ */ Dt(a, { "data-testid": "virtuoso-item-list", ref: p, ...nt(a, y), children: [
|
|
2803
2803
|
C,
|
|
2804
|
-
n && /* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2804
|
+
n && /* @__PURE__ */ W(yn, { showTopList: !0 }),
|
|
2805
|
+
/* @__PURE__ */ W(yn, {}),
|
|
2806
2806
|
z
|
|
2807
2807
|
] });
|
|
2808
2808
|
}), yr = ({ children: t }) => {
|
|
@@ -2813,7 +2813,7 @@ const fr = ({ children: t }) => {
|
|
|
2813
2813
|
);
|
|
2814
2814
|
return E.useEffect(() => {
|
|
2815
2815
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2816
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2816
|
+
}, [e, n, o]), /* @__PURE__ */ W("div", { "data-viewport-type": "element", ref: r, style: Jt(!1), children: t });
|
|
2817
2817
|
}, br = ({ children: t }) => {
|
|
2818
2818
|
const e = E.useContext(Re), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r = M("customScrollParent"), s = Ne(
|
|
2819
2819
|
n,
|
|
@@ -2822,7 +2822,7 @@ const fr = ({ children: t }) => {
|
|
|
2822
2822
|
);
|
|
2823
2823
|
return E.useEffect(() => {
|
|
2824
2824
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2825
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2825
|
+
}, [e, n, o]), /* @__PURE__ */ W("div", { "data-viewport-type": "window", ref: s, style: Jt(!1), children: t });
|
|
2826
2826
|
}, Rr = /* @__PURE__ */ E.memo(function(e) {
|
|
2827
2827
|
const n = M("useWindowScroll"), o = M("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = M("fixedHeaderContent"), l = M("fixedFooterContent"), c = M("context"), d = kt(
|
|
2828
2828
|
E.useMemo(() => re(r, (a) => Ht(a, "height")), [r]),
|
|
@@ -2832,7 +2832,7 @@ const fr = ({ children: t }) => {
|
|
|
2832
2832
|
E.useMemo(() => re(s, (a) => Ht(a, "height")), [s]),
|
|
2833
2833
|
!0,
|
|
2834
2834
|
M("skipAnimationFrameInResizeObserver")
|
|
2835
|
-
), x = o || n ? Er : Hr, p = o || n ? br : yr, T = M("TableComponent"), w = M("TableHeadComponent"), R = M("TableFooterComponent"), h = i ? /* @__PURE__ */
|
|
2835
|
+
), x = o || n ? Er : Hr, p = o || n ? br : yr, T = M("TableComponent"), w = M("TableHeadComponent"), R = M("TableFooterComponent"), h = i ? /* @__PURE__ */ W(
|
|
2836
2836
|
w,
|
|
2837
2837
|
{
|
|
2838
2838
|
ref: d,
|
|
@@ -2841,7 +2841,7 @@ const fr = ({ children: t }) => {
|
|
|
2841
2841
|
children: i()
|
|
2842
2842
|
},
|
|
2843
2843
|
"TableHead"
|
|
2844
|
-
) : null, f = l ? /* @__PURE__ */
|
|
2844
|
+
) : null, f = l ? /* @__PURE__ */ W(
|
|
2845
2845
|
R,
|
|
2846
2846
|
{
|
|
2847
2847
|
ref: m,
|
|
@@ -2851,9 +2851,9 @@ const fr = ({ children: t }) => {
|
|
|
2851
2851
|
},
|
|
2852
2852
|
"TableFoot"
|
|
2853
2853
|
) : null;
|
|
2854
|
-
return /* @__PURE__ */
|
|
2854
|
+
return /* @__PURE__ */ W(x, { ...e, ...nt(x, c), children: /* @__PURE__ */ W(p, { children: /* @__PURE__ */ Dt(T, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...nt(T, c), children: [
|
|
2855
2855
|
h,
|
|
2856
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ W(wr, {}, "TableBody"),
|
|
2857
2857
|
f
|
|
2858
2858
|
] }) }) });
|
|
2859
2859
|
}), {
|
|
@@ -2966,7 +2966,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
2966
2966
|
I(
|
|
2967
2967
|
w,
|
|
2968
2968
|
$(gt),
|
|
2969
|
-
|
|
2969
|
+
G(([b, D]) => D !== 0)
|
|
2970
2970
|
),
|
|
2971
2971
|
() => {
|
|
2972
2972
|
_(ut, !1);
|
|
@@ -2974,7 +2974,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
2974
2974
|
), Y(
|
|
2975
2975
|
I(
|
|
2976
2976
|
at(w, ut, z, C, gt, xt),
|
|
2977
|
-
|
|
2977
|
+
G(([b, D, K, rt, , tt]) => b && !D && K.height !== 0 && rt.height !== 0 && !tt)
|
|
2978
2978
|
),
|
|
2979
2979
|
([, , , , b]) => {
|
|
2980
2980
|
_(xt, !0), Ue(1, () => {
|
|
@@ -2986,7 +2986,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
2986
2986
|
), L(
|
|
2987
2987
|
I(
|
|
2988
2988
|
q,
|
|
2989
|
-
|
|
2989
|
+
G((b) => b != null && b.scrollTop > 0),
|
|
2990
2990
|
Bt(0)
|
|
2991
2991
|
),
|
|
2992
2992
|
u
|
|
@@ -2994,7 +2994,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
2994
2994
|
I(
|
|
2995
2995
|
w,
|
|
2996
2996
|
$(q),
|
|
2997
|
-
|
|
2997
|
+
G(([, b]) => b != null)
|
|
2998
2998
|
),
|
|
2999
2999
|
([, b]) => {
|
|
3000
3000
|
b && (_(C, b.viewport), _(z, b.item), _(F, b.gap), b.scrollTop > 0 && (_(Q, !0), yt(I(d, $t(1)), (D) => {
|
|
@@ -3037,7 +3037,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3037
3037
|
P(ut),
|
|
3038
3038
|
P(gt)
|
|
3039
3039
|
),
|
|
3040
|
-
|
|
3040
|
+
G(([, , , , , , , b]) => !b),
|
|
3041
3041
|
B(
|
|
3042
3042
|
([
|
|
3043
3043
|
b,
|
|
@@ -3070,14 +3070,14 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3070
3070
|
), L(
|
|
3071
3071
|
I(
|
|
3072
3072
|
Z,
|
|
3073
|
-
|
|
3073
|
+
G((b) => b !== null),
|
|
3074
3074
|
B((b) => b.length)
|
|
3075
3075
|
),
|
|
3076
3076
|
k
|
|
3077
3077
|
), L(
|
|
3078
3078
|
I(
|
|
3079
3079
|
at(C, z, g, F),
|
|
3080
|
-
|
|
3080
|
+
G(([b, D, { items: K }]) => K.length > 0 && D.height !== 0 && b.height !== 0),
|
|
3081
3081
|
B(([b, D, { items: K }, rt]) => {
|
|
3082
3082
|
const { bottom: tt, top: X } = Bn(b, rt, D, K);
|
|
3083
3083
|
return [X, tt];
|
|
@@ -3098,9 +3098,9 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3098
3098
|
const Kt = vt(
|
|
3099
3099
|
I(
|
|
3100
3100
|
at(g, k),
|
|
3101
|
-
|
|
3101
|
+
G(([{ items: b }]) => b.length > 0),
|
|
3102
3102
|
$(pt),
|
|
3103
|
-
|
|
3103
|
+
G(([[b, D], K]) => {
|
|
3104
3104
|
const tt = b.items[b.items.length - 1].index === D - 1;
|
|
3105
3105
|
return (K || b.bottom > 0 && b.itemHeight > 0 && b.offsetBottom === 0 && b.items.length === D) && tt;
|
|
3106
3106
|
}),
|
|
@@ -3110,7 +3110,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3110
3110
|
), Qt = vt(
|
|
3111
3111
|
I(
|
|
3112
3112
|
P(g),
|
|
3113
|
-
|
|
3113
|
+
G(({ items: b }) => b.length > 0 && b[0].index === 0),
|
|
3114
3114
|
Bt(0),
|
|
3115
3115
|
et()
|
|
3116
3116
|
)
|
|
@@ -3118,7 +3118,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3118
3118
|
I(
|
|
3119
3119
|
P(g),
|
|
3120
3120
|
$(Q),
|
|
3121
|
-
|
|
3121
|
+
G(([{ items: b }, D]) => b.length > 0 && !D),
|
|
3122
3122
|
B(([{ items: b }]) => ({
|
|
3123
3123
|
endIndex: b[b.length - 1].index,
|
|
3124
3124
|
startIndex: b[0].index
|
|
@@ -3135,7 +3135,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3135
3135
|
const X = $n(b), { align: lt, behavior: St, offset: ct } = X;
|
|
3136
3136
|
let Vt = X.index;
|
|
3137
3137
|
Vt === "LAST" && (Vt = rt - 1), Vt = oe(0, Vt, Le(rt - 1, Vt));
|
|
3138
|
-
let Pt =
|
|
3138
|
+
let Pt = We(D, tt, K, Vt);
|
|
3139
3139
|
return lt === "end" ? Pt = Hn(Pt - D.height + K.height) : lt === "center" && (Pt = Hn(Pt - D.height / 2 + K.height / 2)), ct !== void 0 && ct !== 0 && (Pt += ct), { behavior: St, top: Pt };
|
|
3140
3140
|
})
|
|
3141
3141
|
),
|
|
@@ -3196,7 +3196,7 @@ const Lr = /* @__PURE__ */ j(
|
|
|
3196
3196
|
...y
|
|
3197
3197
|
};
|
|
3198
3198
|
},
|
|
3199
|
-
ot(je, It, pe, Zn, At, qe,
|
|
3199
|
+
ot(je, It, pe, Zn, At, qe, Wt)
|
|
3200
3200
|
);
|
|
3201
3201
|
function io(t, e, n) {
|
|
3202
3202
|
return oe(1, Ce((t + n) / (Ce(e) + n)));
|
|
@@ -3205,10 +3205,10 @@ function Bn(t, e, n, o) {
|
|
|
3205
3205
|
const { height: r } = n;
|
|
3206
3206
|
if (r === void 0 || o.length === 0)
|
|
3207
3207
|
return { bottom: 0, top: 0 };
|
|
3208
|
-
const s =
|
|
3209
|
-
return { bottom:
|
|
3208
|
+
const s = We(t, e, n, o[0].index);
|
|
3209
|
+
return { bottom: We(t, e, n, o[o.length - 1].index) + r, top: s };
|
|
3210
3210
|
}
|
|
3211
|
-
function
|
|
3211
|
+
function We(t, e, n, o) {
|
|
3212
3212
|
const r = io(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + oe(0, s - 1) * e.row;
|
|
3213
3213
|
return i > 0 ? i + e.row : i;
|
|
3214
3214
|
}
|
|
@@ -3265,7 +3265,7 @@ const zr = /* @__PURE__ */ j(() => {
|
|
|
3265
3265
|
);
|
|
3266
3266
|
return to(() => {
|
|
3267
3267
|
e.itemHeight > 0 && e.itemWidth > 0 && h(!0);
|
|
3268
|
-
}, [e]), R ? null : /* @__PURE__ */
|
|
3268
|
+
}, [e]), R ? null : /* @__PURE__ */ W(
|
|
3269
3269
|
d,
|
|
3270
3270
|
{
|
|
3271
3271
|
className: n,
|
|
@@ -3275,7 +3275,7 @@ const zr = /* @__PURE__ */ j(() => {
|
|
|
3275
3275
|
style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
|
|
3276
3276
|
children: e.items.map((a) => {
|
|
3277
3277
|
const S = s(a.index, a.data, x);
|
|
3278
|
-
return i ? /* @__PURE__ */
|
|
3278
|
+
return i ? /* @__PURE__ */ W(
|
|
3279
3279
|
m,
|
|
3280
3280
|
{
|
|
3281
3281
|
...nt(m, x),
|
|
@@ -3308,8 +3308,8 @@ const zr = /* @__PURE__ */ j(() => {
|
|
|
3308
3308
|
!0,
|
|
3309
3309
|
!1
|
|
3310
3310
|
), s = st("context");
|
|
3311
|
-
return e != null ? /* @__PURE__ */
|
|
3312
|
-
}),
|
|
3311
|
+
return e != null ? /* @__PURE__ */ W(o, { ref: r, children: /* @__PURE__ */ W(e, { ...nt(e, s) }) }) : null;
|
|
3312
|
+
}), Gr = E.memo(function() {
|
|
3313
3313
|
const e = st("FooterComponent"), n = wt("footerHeight"), o = st("headerFooterTag"), r = kt(
|
|
3314
3314
|
E.useMemo(
|
|
3315
3315
|
() => (i) => {
|
|
@@ -3320,8 +3320,8 @@ const zr = /* @__PURE__ */ j(() => {
|
|
|
3320
3320
|
!0,
|
|
3321
3321
|
!1
|
|
3322
3322
|
), s = st("context");
|
|
3323
|
-
return e != null ? /* @__PURE__ */
|
|
3324
|
-
}),
|
|
3323
|
+
return e != null ? /* @__PURE__ */ W(o, { ref: r, children: /* @__PURE__ */ W(e, { ...nt(e, s) }) }) : null;
|
|
3324
|
+
}), Wr = ({ children: t }) => {
|
|
3325
3325
|
const e = E.useContext(Qn), n = wt("itemDimensions"), o = wt("viewportDimensions"), r = kt(
|
|
3326
3326
|
E.useMemo(
|
|
3327
3327
|
() => (s) => {
|
|
@@ -3334,18 +3334,18 @@ const zr = /* @__PURE__ */ j(() => {
|
|
|
3334
3334
|
);
|
|
3335
3335
|
return E.useEffect(() => {
|
|
3336
3336
|
e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
|
|
3337
|
-
}, [e, o, n]), /* @__PURE__ */
|
|
3337
|
+
}, [e, o, n]), /* @__PURE__ */ W("div", { ref: r, style: Jt(!1), children: t });
|
|
3338
3338
|
}, Ar = ({ children: t }) => {
|
|
3339
3339
|
const e = E.useContext(Qn), n = wt("windowViewportRect"), o = wt("itemDimensions"), r = st("customScrollParent"), s = Ne(n, r, !1);
|
|
3340
3340
|
return E.useEffect(() => {
|
|
3341
3341
|
e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
|
|
3342
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
3342
|
+
}, [e, n, o]), /* @__PURE__ */ W("div", { ref: s, style: Jt(!1), children: t });
|
|
3343
3343
|
}, Mr = /* @__PURE__ */ E.memo(function({ ...e }) {
|
|
3344
|
-
const n = st("useWindowScroll"), o = st("customScrollParent"), r = o || n ? Dr : Nr, s = o || n ? Ar :
|
|
3345
|
-
return /* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3344
|
+
const n = st("useWindowScroll"), o = st("customScrollParent"), r = o || n ? Dr : Nr, s = o || n ? Ar : Wr, i = st("context");
|
|
3345
|
+
return /* @__PURE__ */ W(r, { ...e, ...nt(r, i), children: /* @__PURE__ */ Dt(s, { children: [
|
|
3346
|
+
/* @__PURE__ */ W(Pr, {}),
|
|
3347
|
+
/* @__PURE__ */ W(Vr, {}),
|
|
3348
|
+
/* @__PURE__ */ W(Gr, {})
|
|
3349
3349
|
] }) });
|
|
3350
3350
|
}), {
|
|
3351
3351
|
Component: _r,
|