react-virtuoso 4.18.1 → 4.18.2
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.d.ts +9 -7
- package/dist/index.mjs +1600 -1614
- package/package.json +42 -48
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),R=require("react"),co=require("react-dom"),we=0,jt=1,Zt=2,Bn=4;function cn(t){return()=>t}function uo(t){t()}function oe(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 Xt(){}function ve(t,e){return e(t),t}function mo(t,e){return e(t)}function tt(...t){return t}function Y(t,e){return t(jt,e)}function N(t,e){t(we,e)}function Me(t){t(Zt)}function rt(t){return t(Bn)}function F(t,e){return Y(t,ao(e,we))}function Et(t,e){const n=t(jt,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 zn(t,e){return t===e}function J(t=zn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>oe(e,t)}function Ft(t){return e=>()=>{e(t)}}function I(t,...e){const n=po(...e);return((o,r)=>{switch(o){case Zt:Me(t);return;case jt:return Y(t,n(r))}})}function Lt(t,e){return n=>o=>{n(e=t(e,o))}}function Dt(t){return e=>n=>{t>0?t--:e(n)}}function Pt(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=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);Y(s,u=>{const d=n;n=n|l,e[i]=u,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==null?void 0:e();return function(r,s){switch(r){case jt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Xt);case Zt:o(),n=null;return}}}function C(t){let e=t;const n=$();return((o,r)=>{switch(o){case we:e=r;break;case jt:{r(e);break}case Bn:return e}return n(o,r)})}function ht(t,e){return ve(C(e),n=>F(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case we:t.slice().forEach(o=>{o(n)});return;case Zt:t.splice(0,t.length);return;case jt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function bt(t){return ve($(),e=>F(t,e))}function U(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(u=>n(u)));return i&&e.set(s,l),l};return n(t)}function ut(...t){const e=$(),n=new Array(t.length);let o=0;const r=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);Y(s,u=>{n[i]=u,o=o|l,o===r&&N(e,n)})}),function(s,i){switch(s){case Zt:{Me(e);return}case jt:return o===r&&i(n),Y(e,i)}}}function G(t,e=zn){return I(t,J(e))}function ze(...t){return function(e,n){switch(e){case Zt:return;case jt:return fo(...t.map(o=>Y(o,n)))}}}var xt=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(xt||{});const Io={0:"debug",3:"error",1:"log",2:"warn"},So=()=>typeof globalThis>"u"?window:globalThis,At=U(()=>{const t=C(3);return{log:C((n,o,r=1)=>{var i;const s=(i=So().VIRTUOSO_LOG_LEVEL)!=null?i:rt(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 Vt(t,e,n){return je(t,e,n).callbackRef}function je(t,e,n){const o=R.useRef(null);let r=i=>{};const s=R.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const u=i[0].target;u.offsetParent!==null&&t(u)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s==null||s.observe(i),o.current=i):(o.current&&(s==null||s.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function On(t,e,n,o,r,s,i,l,u){const d=R.useCallback(m=>{const S=To(m.children,e,l?"offsetWidth":"offsetHeight",r);let h=m.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const T=h.lastElementChild.dataset.viewportType==="window";let w;T&&(w=h.ownerDocument.defaultView);const H=i?l?i.scrollLeft:i.scrollTop:T?l?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:l?h.scrollLeft:h.scrollTop,g=i?l?i.scrollWidth:i.scrollHeight:T?l?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,f=i?l?i.offsetWidth:i.offsetHeight:T?l?w.innerWidth:w.innerHeight:l?h.offsetWidth:h.offsetHeight;o({scrollHeight:g,scrollTop:Math.max(H,0),viewportHeight:f}),s==null||s(l?dn("column-gap",getComputedStyle(m).columnGap,r):dn("row-gap",getComputedStyle(m).rowGap,r)),S!==null&&t(S)},[t,e,r,s,i,o,l]);return je(d,n,u)}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 u=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},xt.ERROR),m===d)continue;const S=s[s.length-1];s.length===0||S.size!==m||S.endIndex!==u-1?s.push({endIndex:u,size:m,startIndex:u}):s[s.length-1].endIndex++}return s}function dn(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,xt.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}function Ae(t,e,n){const o=R.useRef(null),r=R.useCallback(u=>{if(!(u!=null&&u.offsetParent))return;const d=u.getBoundingClientRect(),m=d.width;let S,h;if(e){const T=e.getBoundingClientRect(),w=d.top-T.top;h=T.height-Math.max(0,w),S=w+e.scrollTop}else{const T=i.current.ownerDocument.defaultView;h=T.innerHeight-Math.max(0,d.top),S=d.top+T.scrollY}o.current={offsetTop:S,visibleHeight:h,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=je(r,!0,n),l=R.useCallback(()=>{r(i.current)},[r,i]);return R.useEffect(()=>{var u;if(e){e.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(e),()=>{e.removeEventListener("scroll",l),d.unobserve(e)}}else{const d=(u=i.current)==null?void 0:u.ownerDocument.defaultView;return d==null||d.addEventListener("scroll",l),d==null||d.addEventListener("resize",l),()=>{d==null||d.removeEventListener("scroll",l),d==null||d.removeEventListener("resize",l)}}},[l,e,i]),s}const It=U(()=>{const t=$(),e=$(),n=C(0),o=$(),r=C(0),s=$(),i=$(),l=C(0),u=C(0),d=C(0),m=C(0),S=$(),h=$(),T=C(!1),w=C(!1),H=C(!1);return F(I(t,B(({scrollTop:g})=>g)),e),F(I(t,B(({scrollHeight:g})=>g)),i),F(e,r),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:u,footerHeight:m,headerHeight:l,horizontalDirection:w,scrollBy:h,scrollContainerState:t,scrollHeight:i,scrollingInProgress:T,scrollTo:S,scrollTop:e,skipAnimationFrameInResizeObserver:H,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),re={lvl:0};function Fn(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:u}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=u}return s.push({end:1/0,start:o,value:r}),s}function X(t){return t===re}function se(t,e){if(!X(t))return e===t.k?t.v:e<t.k?se(t.l,e):se(t.r,e)}function Bt(t,e,n="k"){if(X(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=Bt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return Bt(t.l,e,n)}function yt(t,e,n){return X(t)?Gn(e,n,1):e===t.k?dt(t,{k:e,v:n}):e<t.k?fn(dt(t,{l:yt(t.l,e,n)})):fn(dt(t,{r:yt(t.r,e,n)}))}function qt(){return re}function Yt(t,e,n){if(X(t))return[];const o=Bt(t,e)[0];return Co(Fe(t,o,n))}function Oe(t,e){if(X(t))return re;const{k:n,l:o,r}=t;if(e===n){if(X(o))return r;if(X(r))return o;{const[s,i]=Vn(o);return Ie(dt(t,{k:s,l:Ln(o),v:i}))}}else return e<n?Ie(dt(t,{l:Oe(o,e)})):Ie(dt(t,{r:Oe(r,e)}))}function Nt(t){return X(t)?[]:[...Nt(t.l),{k:t.k,v:t.v},...Nt(t.r)]}function Fe(t,e,n){if(X(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(Fe(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Fe(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(dt(t,{lvl:n-1}));if(!X(e)&&!X(e.r))return dt(e.r,{l:dt(e,{r:e.r.l}),lvl:n,r:dt(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(Re(t))return Le(dt(t,{lvl:n-1}));if(!X(o)&&!X(o.l)){const r=o.l,s=Re(r)?o.lvl-1:o.lvl;return dt(r,{l:dt(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Le(dt(o,{l:r.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function dt(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 Ln(t){return X(t.r)?t.l:Ie(dt(t,{r:Ln(t.r)}))}function Re(t){return X(t)||t.lvl>t.r.lvl}function Vn(t){return X(t.r)?[t.k,t.v]:Vn(t.r)}function Gn(t,e,n,o=re,r=re){return{k:t,l:o,lvl:n,r,v:e}}function fn(t){return Le(Pn(t))}function Pn(t){const{l:e}=t;return!X(e)&&e.lvl===t.lvl?dt(e,{r:dt(t,{l:e.r})}):t}function Le(t){const{lvl:e,r:n}=t;return!X(n)&&!X(n.r)&&n.lvl===e&&n.r.lvl===e?dt(n,{l:dt(t,{r:n.l}),lvl:e+1}):t}function Co(t){return Fn(t,({k:e,v:n})=>({index:e,value:n}))}function Mn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function ie(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const We=U(()=>({recalcInProgress:C(!1)}),[],{singleton:!0});function jn(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 wo(t,e,n,o){const r=Te(t,e,o),s=Te(t,n,o,r);return t.slice(r,s+1)}function zt(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!X(t.groupOffsetTree)}function _e({index:t},e){return e===t?0:e<t?-1:1}function vo(){return{groupIndices:[],groupOffsetTree:qt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:qt()}}function yo(t,e){let n=X(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),X(t)){t=yt(t,0,s);continue}const l=Yt(t,i-1,r+1);if(l.some(zo(o)))continue;let u=!1,d=!1;for(const{end:m,start:S,value:h}of l)u?(r>=S||s===h)&&(t=Oe(t,S)):(d=h!==s,u=!0),m>r&&r>=S&&h!==s&&(t=yt(t,r+1,h));d&&(t=yt(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 le(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=jn(e,t,_e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function An(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function Wn(t,e,n){if(bo(t))return e.groupIndices[t.groupIndex]+1;{const o=t.index==="LAST"?n:t.index;let r=An(o,e);return r=Math.max(0,r,Math.min(n,r)),r}}function Ho(t,e,n,o=0){return o>0&&(e=Math.max(e,jn(t,o,_e).offset)),Fn(wo(t,e,n,Ro),Bo)}function Eo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,xt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&X(s)&&e.length===2){const h=e[0].size,T=e[1].size;i=n.reduce((w,H)=>yt(yt(w,H,h),H+1,T),i)}else[i,l]=yo(i,e);if(i===s)return t;const{lastIndex:u,lastOffset:d,lastSize:m,offsetTree:S}=Ve(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,T)=>yt(h,T,le(T,S,r)),qt()),lastIndex:u,lastOffset:d,lastSize:m,offsetTree:S,sizeTree:i}}function ko(t){return Nt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s?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,u=0;if(e!==0){u=Te(r,e-1,_e),l=r[u].offset;const m=Bt(n,e-1);s=m[0],i=m[1],r.length&&r[u].size===Bt(n,e)[1]&&(u-=1),r=r.slice(0,u+1)}else r=[];for(const{start:d,value:m}of Yt(n,e,1/0)){const S=d-s,h=S*i+l+S*o;r.push({index:d,offset:h,size:m}),s=d,l=h,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Bo(t){return{index:t.index,value:t}}function zo(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 Oo={offsetHeight:"height",offsetWidth:"width"},Gt=U(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=ht(o,0),s=$(),i=$(),l=C(0),u=C([]),d=C(void 0),m=C(void 0),S=C(void 0),h=C(void 0),T=C((c,p)=>zt(c,Oo[p])),w=C(void 0),H=C(0),g=vo(),f=ht(I(n,D(u,t,H),Lt(Eo,g),J()),g),a=ht(I(u,J(),Lt((c,p)=>({current:p,prev:c.current}),{current:[],prev:[]}),B(({prev:c})=>c)),[]);F(I(u,P(c=>c.length>0),D(f,H),B(([c,p,v])=>{const O=c.reduce((k,A,W)=>yt(k,A,le(A,p.offsetTree,v)||W),qt());return{...p,groupIndices:c,groupOffsetTree:O}})),f),F(I(o,D(f),P(([c,{lastIndex:p}])=>c<p),B(([c,{lastIndex:p,lastSize:v}])=>[{endIndex:p,size:v,startIndex:c}])),n),F(d,m);const x=ht(I(d,B(c=>c===void 0)),!0);F(I(m,P(c=>c!==void 0&&X(rt(f).sizeTree)),B(c=>{const p=rt(S),v=rt(u).length>0;return p?v?[{endIndex:0,size:p,startIndex:0},{endIndex:1,size:c,startIndex:1}]:[]:[{endIndex:0,size:c,startIndex:0}]})),n),F(I(h,P(c=>c!==void 0&&c.length>0&&X(rt(f).sizeTree)),B(c=>{const p=[];let v=c[0],O=0;for(let k=1;k<c.length;k++){const A=c[k];A!==v&&(p.push({endIndex:k-1,size:v,startIndex:O}),v=A,O=k)}return p.push({endIndex:c.length-1,size:v,startIndex:O}),p})),n),F(I(u,D(S,m),P(([,c,p])=>c!==void 0&&p!==void 0),B(([c,p,v])=>{const O=[];for(let k=0;k<c.length;k++){const A=c[k],W=c[k+1];O.push({startIndex:A,endIndex:A,size:p}),W!==void 0&&O.push({startIndex:A+1,endIndex:W-1,size:v})}return O})),n);const b=bt(I(n,D(f),Lt(({sizes:c},[p,v])=>({changed:v!==c,sizes:v}),{changed:!1,sizes:g}),B(c=>c.changed)));Y(I(l,Lt((c,p)=>({diff:c.prev-p,prev:p}),{diff:0,prev:0}),B(c=>c.diff)),c=>{const{groupIndices:p}=rt(f);if(c>0)N(e,!0),N(s,c+mn(c,p));else if(c<0){const v=rt(a);v.length>0&&(c-=mn(-c,v)),N(i,c)}}),Y(I(l,D(t)),([c,p])=>{c<0&&p("`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},xt.ERROR)});const y=bt(s);F(I(s,D(f),B(([c,p])=>{const v=p.groupIndices.length>0,O=[],k=p.lastSize;if(v){const A=se(p.sizeTree,0);let W=0,K=0;for(;W<c;){const M=p.groupIndices[K],et=p.groupIndices.length===K+1?1/0:p.groupIndices[K+1]-M-1;O.push({endIndex:M,size:A,startIndex:M}),O.push({endIndex:M+1+et-1,size:k,startIndex:M+1}),K++,W+=et+1}const L=Nt(p.sizeTree);return W!==c&&L.shift(),L.reduce((M,{k:et,v:wt})=>{let ft=M.ranges;return M.prevSize!==0&&(ft=[...M.ranges,{endIndex:et+c-1,size:M.prevSize,startIndex:M.prevIndex}]),{prevIndex:et+c,prevSize:wt,ranges:ft}},{prevIndex:c,prevSize:0,ranges:O}).ranges}return Nt(p.sizeTree).reduce((A,{k:W,v:K})=>({prevIndex:W+c,prevSize:K,ranges:[...A.ranges,{endIndex:W+c-1,size:A.prevSize,startIndex:A.prevIndex}]}),{prevIndex:0,prevSize:k,ranges:[]}).ranges})),n);const z=bt(I(i,D(f,H),B(([c,{offsetTree:p},v])=>{const O=-c;return le(O,p,v)})));return F(I(i,D(f,H),B(([c,p,v])=>{if(p.groupIndices.length>0){if(X(p.sizeTree))return p;let k=qt();const A=rt(a);let W=0,K=0,L=0;for(;W<-c;){L=A[K];const M=A[K+1]-L-1;K++,W+=M+1}if(k=Nt(p.sizeTree).reduce((M,{k:et,v:wt})=>yt(M,Math.max(0,et+c),wt),k),W!==-c){const M=se(p.sizeTree,L);k=yt(k,0,M);const et=Bt(p.sizeTree,-c+1)[1];k=yt(k,1,et)}return{...p,sizeTree:k,...Ve(p.offsetTree,0,k,v)}}else{const k=Nt(p.sizeTree).reduce((A,{k:W,v:K})=>yt(A,Math.max(0,W+c),K),qt());return{...p,sizeTree:k,...Ve(p.offsetTree,0,k,v)}}})),f),{beforeUnshiftWith:y,data:w,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:S,gap:H,groupIndices:u,heightEstimates:h,itemSize:T,listRefresh:b,shiftWith:i,shiftWithOffset:z,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:s}},tt(At,We),{singleton:!0});function Fo(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const _n=U(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=bt(I(s,B(Fo)));return F(I(l,B(u=>u.totalCount)),n),F(I(l,B(u=>u.groupIndices)),t),F(I(ut(r,e,o),P(([u,d])=>ye(d)),B(([u,d,m])=>Bt(d.groupOffsetTree,Math.max(u-m,0),"v")[0]),J(),B(u=>[u])),i),{groupCounts:s,topItemsIndexes:i}},tt(Gt,It)),Wt=U(([{log:t}])=>{const e=C(!1),n=bt(I(e,P(o=>o),J()));return Y(e,o=>{o&&rt(t)("props updated",{},xt.DEBUG)}),{didMount:n,propsReady:e}},tt(At),{singleton:!0}),Lo=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||!Lo)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const de=U(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:u,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:S},{log:h}])=>{const T=$(),w=$(),H=C(0);let g=null,f=null,a=null;function x(){g&&(g(),g=null),a&&(a(),a=null),f&&(clearTimeout(f),f=null),N(u,!1)}return F(I(T,D(n,S,o,H,l,i,h),D(t,s,r),B(([[b,y,z,c,p,v,O,k],A,W,K])=>{const L=Nn(b),{align:St,behavior:M,offset:et}=L,wt=c-1,ft=Wn(L,y,wt);let Tt=le(ft,y.offsetTree,A)+v;St==="end"?(Tt+=W+Bt(y.sizeTree,ft)[1]-z+K,ft===wt&&(Tt+=O)):St==="center"?Tt+=(W+Bt(y.sizeTree,ft)[1]-z+K)/2:Tt-=p,et&&(Tt+=et);const Mt=pt=>{x(),pt?(k("retrying to scroll to",{location:b},xt.DEBUG),N(T,b)):(N(w,!0),k("list did not change, scroll successful",{},xt.DEBUG))};if(x(),M==="smooth"){let pt=!1;a=Y(e,Ut=>{pt=pt||Ut}),g=Et(m,()=>{Mt(pt)})}else g=Et(I(e,Vo(150)),Mt);return f=setTimeout(()=>{x()},1200),N(u,!0),k("scrolling from index to",{behavior:M,index:ft,top:Tt},xt.DEBUG),{behavior:M,top:Tt}})),d),{scrollTargetReached:w,scrollToIndex:T,topListHeight:H}},tt(Gt,It,At),{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 fe=U(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=C(!0),u=C(0),d=C(!0);return F(I(i,D(u),P(([m,S])=>!!S),Ft(!1)),l),F(I(i,D(u),P(([m,S])=>!!S),Ft(!1)),d),Y(I(ut(e,i),D(l,n,t,d),P(([[,m],S,{sizeTree:h},T,w])=>m&&(!X(h)||Pe(T))&&!S&&!w),D(u)),([,m])=>{Et(r,()=>{N(d,!0)}),Ne(4,()=>{Et(o,()=>{N(l,!0)}),N(s,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:u,scrolledToInitialItem:l}},tt(Gt,It,de,Wt),{singleton:!0});function Dn(t,e){return Math.abs(t-e)<1.01}const ce="up",ee="down",Go="none",Po={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Mo=0,me=U(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=C(!1),l=C(!0),u=$(),d=$(),m=C(4),S=C(Mo),h=ht(I(ze(I(G(r),Dt(1),Ft(!0)),I(G(r),Dt(1),Ft(!1),an(100))),J()),!1),T=ht(I(ze(I(n,Ft(!0)),I(n,Ft(!1),an(200))),J()),!1);F(I(ut(G(r),G(S)),B(([a,x])=>a<=x),J()),l),F(I(l,Pt(50)),d);const w=bt(I(ut(o,G(s),G(e),G(t),G(m)),Lt((a,[{scrollHeight:x,scrollTop:b},y,z,c,p])=>{const v=b+y-x>-p,O={scrollHeight:x,scrollTop:b,viewportHeight:y};if(v){let A,W;return b>a.state.scrollTop?(A="SCROLLED_DOWN",W=a.state.scrollTop-b):(A="SIZE_DECREASED",W=a.state.scrollTop-b||a.scrollTopDelta),{atBottom:!0,atBottomBecause:A,scrollTopDelta:W,state:O}}let k;return O.scrollHeight>a.state.scrollHeight?k="SIZE_INCREASED":y<a.state.viewportHeight?k="VIEWPORT_HEIGHT_DECREASING":b<a.state.scrollTop?k="SCROLLING_UPWARDS":k="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:k,state:O}},Po),J((a,x)=>a&&a.atBottom===x.atBottom))),H=ht(I(o,Lt((a,{scrollHeight:x,scrollTop:b,viewportHeight:y})=>{if(Dn(a.scrollHeight,x))return{changed:!1,jump:0,scrollHeight:x,scrollTop:b};{const z=x-(b+y)<1;return a.scrollTop!==b&&z?{changed:!0,jump:a.scrollTop-b,scrollHeight:x,scrollTop:b}:{changed:!0,jump:0,scrollHeight:x,scrollTop:b}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(a=>a.changed),B(a=>a.jump)),0);F(I(w,B(a=>a.atBottom)),i),F(I(i,Pt(50)),u);const g=C(ee);F(I(o,B(({scrollTop:a})=>a),J(),Lt((a,x)=>rt(T)?{direction:a.direction,prevScrollTop:x}:{direction:x<a.prevScrollTop?ce:ee,prevScrollTop:x},{direction:ee,prevScrollTop:0}),B(a=>a.direction)),g),F(I(o,Pt(50),Ft(Go)),g);const f=C(0);return F(I(h,P(a=>!a),Ft(0)),f),F(I(r,Pt(100),D(h),P(([a,x])=>x),Lt(([a,x],[b])=>[x,b],[0,0]),B(([a,x])=>x-a)),f),{atBottomState:w,atBottomStateChange:u,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:S,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:H,scrollDirection:g,scrollVelocity:f}},tt(It)),ue="top",ae="bottom",pn="none";function hn(t,e,n){return typeof t=="number"?n===ce&&e===ue||n===ee&&e===ae?t:0:n===ce?e===ue?t.main:t.reverse:e===ae?t.main:t.reverse}function gn(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const $e=U(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=C(0),l=C(0),u=C(0),d=ht(I(ut(G(o),G(r),G(n),G(s,ie),G(u),G(i),G(e),G(t),G(l)),B(([m,S,h,[T,w],H,g,f,a,x])=>{const b=m-a,y=g+f,z=Math.max(h-b,0);let c=pn;const p=gn(x,ue),v=gn(x,ae);return T-=a,T+=h+f,w+=h+f,w-=a,T>m+y-p&&(c=ce),w<m-z+S+v&&(c=ee),c!==pn?[Math.max(b-h-hn(H,ue,c)-p,0),b-z-f+S+hn(H,ae,c)+v]:null}),P(m=>m!=null),J(ie)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:u,topListHeight:i,visibleRange:d}},tt(It),{singleton:!0});function jo(t,e,n){if(ye(e)){const o=An(t,e);return[{index:Bt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:t,offset:0,size:0}]}const He={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:u}=r;let d=0,m=0;if(t.length>0){d=t[0].offset;const H=t[t.length-1];m=H.offset+H.size}const S=n-i,h=l+S*u+(S-1)*o,T=d,w=h-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((H,g)=>g.size+H,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,u=De(e,l),d=Array.from({length:l}).map((m,S)=>({data:s[S+u],index:S+u,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=Yt(e.groupOffsetTree,o,r);let l,u=0;for(const d of t){(!l||l.end<d.index)&&(l=i.shift(),u=e.groupIndices.indexOf(l.start));let m;d.index===l.start?m={index:u,type:"group"}:m={groupIndex:u,index:d.index-(u+1)+n},s.push({...m,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function In(t,e){var n;return t===void 0?0:typeof t=="number"?t:(n=t[e])!=null?n:0}const $t=U(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:u},{initialTopMostItemIndex:d,scrolledToInitialItem:m},{topListHeight:S},h,{didMount:T},{recalcInProgress:w}])=>{const H=C([]),g=C(0),f=$(),a=C(0);F(s.topItemsIndexes,H);const x=ht(I(ut(T,w,G(u,ie),G(r),G(o),G(d),m,G(H),G(e),G(n),G(a),t),P(([c,p,,v,,,,,,,,O])=>{const k=O&&O.length!==v;return c&&!p&&!k}),B(([,,[c,p],v,O,k,A,W,K,L,St,M])=>{var q,at,gt,Ct;const et=O,{offsetTree:wt,sizeTree:ft}=et,Tt=rt(g);if(v===0)return{...He,totalCount:v};if(c===0&&p===0)return Tt===0?{...He,totalCount:v}:$n(Tt,k,O,K,L,M||[]);if(X(ft))return Tt>0?null:Se(jo(De(k,v),et,M),[],v,L,et,K);const Mt=[];if(W.length>0){const st=W[0],it=W[W.length-1];let mt=0;for(const lt of Yt(ft,st,it)){const Z=lt.value,nt=Math.max(lt.start,st),vt=Math.min(lt.end,it);for(let ct=nt;ct<=vt;ct++)Mt.push({data:M==null?void 0:M[ct],index:ct,offset:mt,size:Z}),mt+=Z}}if(!A)return Se([],Mt,v,L,et,K);const pt=W.length>0?W[W.length-1]+1:0,Ut=Ho(wt,c,p,pt);if(Ut.length===0)return null;const Qt=v-1,Ot=ve([],st=>{for(const it of Ut){const mt=it.value;let lt=mt.offset,Z=it.start;const nt=mt.size;if(mt.offset<c){Z+=Math.floor((c-mt.offset+L)/(nt+L));const ct=Z-it.start;lt+=ct*nt+ct*L}Z<pt&&(lt+=(pt-Z)*nt,Z=pt);const vt=Math.min(it.end,Qt);for(let ct=Z;ct<=vt&&!(lt>=p);ct++)st.push({data:M==null?void 0:M[ct],index:ct,offset:lt,size:nt}),lt+=nt+L}}),te=In(St,ue),E=In(St,ae);if(Ot.length>0&&(te>0||E>0)){const st=Ot[0],it=Ot[Ot.length-1];if(te>0&&st.index>pt){const mt=Math.min(te,st.index-pt),lt=[];let Z=st.offset;for(let nt=st.index-1;nt>=st.index-mt;nt--){const ct=(at=(q=Yt(ft,nt,nt)[0])==null?void 0:q.value)!=null?at:st.size;Z-=ct+L,lt.unshift({data:M==null?void 0:M[nt],index:nt,offset:Z,size:ct})}Ot.unshift(...lt)}if(E>0&&it.index<Qt){const mt=Math.min(E,Qt-it.index);let lt=it.offset+it.size+L;for(let Z=it.index+1;Z<=it.index+mt;Z++){const vt=(Ct=(gt=Yt(ft,Z,Z)[0])==null?void 0:gt.value)!=null?Ct:it.size;Ot.push({data:M==null?void 0:M[Z],index:Z,offset:lt,size:vt}),lt+=vt+L}}}return Se(Ot,Mt,v,L,et,K)}),P(c=>c!==null),J()),He);F(I(t,P(Pe),B(c=>c==null?void 0:c.length)),r),F(I(x,B(c=>c.topListHeight)),S),F(S,l),F(I(x,B(c=>[c.top,c.bottom])),i),F(I(x,B(c=>c.items)),f);const b=bt(I(x,P(({items:c})=>c.length>0),D(r,t),P(([{items:c},p])=>c[c.length-1].originalIndex===p-1),B(([,c,p])=>[c-1,p]),J(ie),B(([c])=>c))),y=bt(I(x,Pt(200),P(({items:c,topItems:p})=>c.length>0&&c[0].originalIndex===p.length),B(({items:c})=>c[0].index),J())),z=bt(I(x,P(({items:c})=>c.length>0),B(({items:c})=>{let p=0,v=c.length-1;for(;c[p].type==="group"&&p<v;)p++;for(;c[v].type==="group"&&v>p;)v--;return{endIndex:c[v].index,startIndex:c[p].index}}),J(Mn)));return{endReached:b,initialItemCount:g,itemsRendered:f,listState:x,minOverscanItemCount:a,rangeChanged:z,startReached:y,topItemsIndexes:H,...h}},tt(Gt,_n,$e,fe,de,me,Wt,We),{singleton:!0}),Un=U(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=ht(I(ut(n,t,o,e,r),B(([l,u,d,m,S])=>l+u+d+m+S.offsetBottom+S.bottom)),0);return F(G(i),s),{totalListHeight:i,totalListHeightChanged:s}},tt(It,$t),{singleton:!0}),Ao=U(([{viewportHeight:t},{totalListHeight:e}])=>{const n=C(!1),o=ht(I(ut(n,t,e),P(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),Pt(0),J()),0);return{alignToBottom:n,paddingTopAddition:o}},tt(It,Un),{singleton:!0}),Kn=U(()=>({context:C(null)})),Wo=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n!=null?n:"start",behavior:o}:t>s?{...r,align:n!=null?n:"end",behavior:o}:null,qn=U(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:u},{scrollToIndex:d}])=>{const m=$();return F(I(m,D(e,u,n,s,r,o,l),D(t),B(([[S,h,T,w,H,g,f,a],x])=>{const{align:b,behavior:y,calculateViewLocation:z=Wo,done:c,...p}=S,v=Wn(S,h,w-1),O=le(v,h.offsetTree,x)+H+g,k=O+Bt(h.sizeTree,v)[1],A=a+g,W=a+T-f,K=z({itemBottom:k,itemTop:O,locationParams:{align:b,behavior:y,...p},viewportBottom:W,viewportTop:A});return K?c&&Et(I(i,P(L=>!L),Dt(rt(i)?1:2)),c):c==null||c(),K}),P(S=>S!==null)),d),{scrollIntoView:m}},tt(Gt,It,de,$t,At),{singleton:!0});function Sn(t){return t?t==="smooth"?"smooth":"auto":!1}const _o=(t,e)=>typeof t=="function"?Sn(t(e)):e&&Sn(t),No=U(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:u,propsReady:d},{log:m},{scrollingInProgress:S},{context:h},{scrollIntoView:T}])=>{const w=C(!1),H=$();let g=null;function f(y){N(i,{align:"end",behavior:y,index:"LAST"})}Y(I(ut(I(G(e),Dt(1)),u),D(G(w),s,l,S),B(([[y,z],c,p,v,O])=>{let k=z&&v,A="auto";return k&&(A=_o(c,p||O),k=k&&!!A),{followOutputBehavior:A,shouldFollow:k,totalCount:y}}),P(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:z})=>{g&&(g(),g=null),rt(n)?requestAnimationFrame(()=>{rt(m)("following output to ",{totalCount:z},xt.DEBUG),f(y)}):g=Et(t,()=>{rt(m)("following output to ",{totalCount:z},xt.DEBUG),f(y),g=null})});function a(y){const z=Et(r,c=>{y&&!c.atBottom&&c.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(rt(m)("scrolling to bottom due to increased size",{},xt.DEBUG),f("auto"))});setTimeout(z,100)}Y(I(ut(G(w),e,d),P(([y,,z])=>y&&z),Lt(({value:y},[,z])=>({refreshed:y===z,value:z}),{refreshed:!1,value:0}),P(({refreshed:y})=>y),D(w,e)),([,y])=>{rt(l)&&a(y!==!1)}),Y(H,()=>{a(rt(w)!==!1)}),Y(ut(G(w),r),([y,z])=>{y&&!z.atBottom&&z.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const x=C(null),b=$();return F(ze(I(G(o),B(y=>{var z;return(z=y==null?void 0:y.length)!=null?z:0})),I(G(e))),b),Y(I(ut(I(b,Dt(1)),u),D(G(x),l,S,h),B(([[y,z],c,p,v,O])=>z&&p&&(c==null?void 0:c({context:O,totalCount:y,scrollingInProgress:v}))),P(y=>!!y),Pt(0)),y=>{g&&(g(),g=null),rt(n)?requestAnimationFrame(()=>{rt(m)("scrolling into view",{}),N(T,y)}):g=Et(t,()=>{rt(m)("scrolling into view",{}),N(T,y),g=null})}),{autoscrollToBottom:H,followOutput:w,scrollIntoViewOnChange:x}},tt(Gt,me,de,fe,Wt,At,It,Kn,qn)),Do=U(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(F(I(l,D(s),P(([,u])=>u!==0),D(r,o,e,n,t),B(([[,u],d,m,S,h,T=[]])=>$n(u,d,m,S,h,T))),i),{}),tt(Gt,fe,$t,Wt),{singleton:!0}),$o=U(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=C(0);return Y(I(t,D(o),P(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{Et(I(n,Dt(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{N(e,r)})})}),{initialScrollTop:o}},tt(Wt,It,$t),{singleton:!0}),Yn=U(([{scrollVelocity:t}])=>{const e=C(!1),n=$(),o=C(!1);return F(I(t,D(o,e,n),P(([r,s])=>!!s),B(([r,s,i,l])=>{const{enter:u,exit:d}=s;if(i){if(d(r,l))return!1}else if(u(r,l))return!0;return i}),J()),e),Y(I(ut(e,t,n),D(o)),([[r,s,i],l])=>{r&&l&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},tt(me),{singleton:!0}),Ue=U(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=C(!1),i=C(void 0);return F(I(ut(n,o),B(([{scrollHeight:l,scrollTop:u,viewportHeight:d},{offsetTop:m}])=>({scrollHeight:l,scrollTop:Math.max(0,u-m),viewportHeight:d}))),t),F(I(e,D(o),B(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},tt(It)),Uo=U(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:u}])=>{const d=$(),m=C(void 0),S=C(null),h=C(null);return F(l,S),F(u,h),Y(I(d,D(e,o,i,S,h,n)),([T,w,H,g,f,a,x])=>{const b=ko(w.sizeTree);g&&f!==null&&a!==null&&(H=f.scrollTop-a.offsetTop),H-=x,T({ranges:b,scrollTop:H})}),F(I(m,P(Pe),B(Ko)),r),F(I(s,D(m),P(([,T])=>T!==void 0),J(),B(([,T])=>T.ranges)),t),{getState:d,restoreStateFrom:m}},tt(Gt,It,fe,Wt,Ue));function Ko(t){return{align:"start",index:0,offset:t.scrollTop}}const qo=U(([{topItemsIndexes:t}])=>{const e=C(0);return F(I(e,P(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},tt($t));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=U(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:u},{beforeUnshiftWith:d,gap:m,shiftWithOffset:S,sizes:h},{log:T},{recalcInProgress:w}])=>{const H=bt(I(u,D(i),Lt(([,f,a,x],[{bottom:b,items:y,offsetBottom:z,totalCount:c},p])=>{const v=b+z;let O=0;return a===c&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(O=v-x,O!==0&&(O+=p))),[O,y,c,v]},[0,[],0,0]),P(([f])=>f!==0),D(o,l,n,r,T,w),P(([,f,a,x,,,b])=>!b&&!x&&f!==0&&a===ce),B(([[f],,,,,a])=>(a("Upward scrolling compensation",{amount:f},xt.DEBUG),f))));function g(f){f>0?(N(e,{behavior:"auto",top:-f}),N(t,0)):(N(t,0),N(e,{behavior:"auto",top:-f}))}return Y(I(H,D(t,s)),([f,a,x])=>{x&&Yo()?N(t,a-f):g(-f)}),Y(I(ut(ht(s,!1),t,w),P(([f,a,x])=>!f&&!x&&a!==0),B(([f,a])=>a),Pt(1)),g),F(I(S,B(f=>({top:-f}))),e),Y(I(d,D(h,m),B(([f,{groupIndices:a,lastSize:x,sizeTree:b},y])=>{function z(c){return c*(x+y)}if(a.length===0)return z(f);{let c=0;const p=se(b,0);let v=0,O=0;for(;v<f;){v++,c+=p;let k=a.length===O+1?1/0:a[O+1]-a[O]-1;v+k>f&&(c-=p,k=f-v+1),v+=k,c+=z(k),O++}return c}})),f=>{N(t,f),requestAnimationFrame(()=>{N(e,{top:f}),requestAnimationFrame(()=>{N(t,0),N(w,!1)})})}),{deviation:t}},tt(It,me,$t,Gt,At,We)),Xo=U(([t,e,n,o,r,s,i,l,u,d,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...u,...d,...m}),tt($e,Do,Wt,Yn,Un,$o,Ao,Ue,qn,At,Kn)),Xn=U(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:u,sizeRanges:d,sizes:m,statefulTotalCount:S,totalCount:h,trackItemSizes:T},{initialItemFinalLocationReached:w,initialTopMostItemIndex:H,scrolledToInitialItem:g},f,a,x,b,{scrollToIndex:y},z,{topItemCount:c},{groupCounts:p},v])=>{const{listState:O,minOverscanItemCount:k,topItemsIndexes:A,rangeChanged:W,...K}=b;return F(W,v.scrollSeekRangeChanged),F(I(v.windowViewportRect,B(L=>L.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:p,heightEstimates:l,initialItemFinalLocationReached:w,initialTopMostItemIndex:H,scrolledToInitialItem:g,sizeRanges:d,topItemCount:c,topItemsIndexes:A,totalCount:h,...x,groupIndices:i,itemSize:u,listState:O,minOverscanItemCount:k,scrollToIndex:y,statefulTotalCount:S,trackItemSizes:T,rangeChanged:W,...K,...v,...f,sizes:m,...a}},tt(Gt,fe,It,Uo,No,$t,de,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"?R.useLayoutEffect:R.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=R.createContext({});function u(f,a){f.propsReady&&N(f.propsReady,!1);for(const x of o){const b=f[e.required[x]];N(b,a[x])}for(const x of r)if(x in a){const b=f[e.optional[x]];N(b,a[x])}f.propsReady&&N(f.propsReady,!0)}function d(f){return s.reduce((a,x)=>(a[x]=b=>{const y=f[e.methods[x]];N(y,b)},a),{})}function m(f){return i.reduce((a,x)=>(a[x]=ho(f[e.events[x]]),a),{})}const S=R.forwardRef((f,a)=>{const{children:x,...b}=f,[y]=R.useState(()=>ve(xo(t),p=>{u(p,b)})),[z]=R.useState(un(m,y));ge(()=>{for(const p of i)p in b&&Y(z[p],b[p]);return()=>{Object.values(z).map(Me)}},[b,z,y]),ge(()=>{u(y,b)}),R.useImperativeHandle(a,cn(d(y)));const c=n;return V.jsx(l.Provider,{value:y,children:n?V.jsx(c,{...Jo([...o,...r,...i],b),children:x}):x})}),h=f=>{const a=R.useContext(l);return R.useCallback(x=>{N(a[f],x)},[a,f])},T=f=>{const x=R.useContext(l)[f],b=R.useCallback(y=>Y(x,y),[x]);return R.useSyncExternalStore(b,()=>rt(x),()=>rt(x))},w=f=>{const x=R.useContext(l)[f],[b,y]=R.useState(un(rt,x));return ge(()=>Y(x,z=>{z!==b&&y(cn(z))}),[x,b]),b},H=R.version.startsWith("18")?T:w;return{Component:S,useEmitter:(f,a)=>{const b=R.useContext(l)[f];ge(()=>Y(b,a),[a,b])},useEmitterValue:H,usePublisher:h}}const pe=R.createContext(void 0),qe=R.createContext(void 0),Jn=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Ee(t){return"self"in t}function Qo(t){return"body"in t}function Qn(t,e,n,o=Xt,r,s){const i=R.useRef(null),l=R.useRef(null),u=R.useRef(null),d=R.useCallback(h=>{let T,w,H;const g=h.target;if(Qo(g)||Ee(g)){const a=Ee(g)?g:g.defaultView;H=s?a.scrollX:a.scrollY,T=s?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,w=s?a.innerWidth:a.innerHeight}else H=s?g.scrollLeft:g.scrollTop,T=s?g.scrollWidth:g.scrollHeight,w=s?g.offsetWidth:g.offsetHeight;const f=()=>{t({scrollHeight:T,scrollTop:Math.max(H,0),viewportHeight:w})};h.suppressFlushSync?f():co.flushSync(f),l.current!==null&&(H===l.current||H<=0||H===T-w)&&(l.current=null,e(!0),u.current&&(clearTimeout(u.current),u.current=null))},[t,e,s]);R.useEffect(()=>{const h=r||i.current;return o(r||i.current),d({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",d,{passive:!0}),()=>{o(null),h.removeEventListener("scroll",d)}},[i,d,n,o,r]);function m(h){const T=i.current;if(!T||(s?"offsetWidth"in T&&T.offsetWidth===0:"offsetHeight"in T&&T.offsetHeight===0))return;const w=h.behavior==="smooth";let H,g,f;Ee(T)?(g=Math.max(zt(T.document.documentElement,s?"width":"height"),s?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight),H=s?T.innerWidth:T.innerHeight,f=s?window.scrollX:window.scrollY):(g=T[s?"scrollWidth":"scrollHeight"],H=zt(T,s?"width":"height"),f=T[s?"scrollLeft":"scrollTop"]);const a=g-H;if(h.top=Math.ceil(Math.max(Math.min(a,h.top),0)),Dn(H,g)||h.top===f){t({scrollHeight:g,scrollTop:f,viewportHeight:H}),w&&e(!0);return}w?(l.current=h.top,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,l.current=null,e(!0)},1e3)):l.current=null,s&&(h={behavior:h.behavior,left:h.top}),T.scrollTo(h)}function S(h){s&&(h={behavior:h.behavior,left:h.top}),i.current.scrollBy(h)}return{scrollByCallback:S,scrollerRef:i,scrollToCallback:m}}const ke="-webkit-sticky",Tn="sticky",Ye=Zn(()=>{if(typeof document>"u")return Tn;const t=document.createElement("div");return t.style.position=ke,t.style.position===ke?ke:Tn});function Ze(t){return t}const tr=U(()=>{const t=C(l=>`Item ${l}`),e=C(l=>`Group ${l}`),n=C({}),o=C(Ze),r=C("div"),s=C(Xt),i=(l,u=null)=>ht(I(n,B(d=>d[l]),J()),u);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=U(([t,e])=>({...t,...e}),tt(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%"},Cn=R.memo(function({showTopList:e=!1}){const n=j("listState"),o=Rt("sizeRanges"),r=j("useWindowScroll"),s=j("customScrollParent"),i=Rt("windowScrollContainerState"),l=Rt("scrollContainerState"),u=s||r?i:l,d=j("itemContent"),m=j("context"),S=j("groupContent"),h=j("trackItemSizes"),T=j("itemSize"),w=j("log"),H=Rt("gap"),g=j("horizontalDirection"),{callbackRef:f}=On(o,T,h,e?Xt:u,w,H,s,g,j("skipAnimationFrameInResizeObserver")),[a,x]=R.useState(0);Qe("deviation",L=>{a!==L&&x(L)});const b=j("EmptyPlaceholder"),y=j("ScrollSeekPlaceholder")||nr,z=j("ListComponent"),c=j("ItemComponent"),p=j("GroupComponent"),v=j("computeItemKey"),O=j("isSeeking"),k=j("groupIndices").length>0,A=j("alignToBottom"),W=j("initialItemFinalLocationReached"),K=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:a!==0?a:A?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:a!==0?a:A?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...W?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&b?V.jsx(b,{...Q(b,m)}):V.jsx(z,{...Q(z,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:K,children:(e?n.topItems:n.items).map(L=>{const St=L.originalIndex,M=v(St+n.firstItemIndex,L.data,m);return O?R.createElement(y,{...Q(y,m),height:L.size,index:L.index,key:M,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?R.createElement(p,{...Q(p,m),"data-index":St,"data-item-index":L.index,"data-known-size":L.size,key:M,style:or},S(L.index,m)):R.createElement(c,{...Q(c,m),...eo(c,L.data),"data-index":St,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:M,style:g?rr:to},k?d(L.index,L.groupIndex,L.data,m):d(L.index,L.data,m))})})}),sr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ir={outline:"none",overflowX:"auto",position:"relative"},Jt=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),lr={position:Ye(),top:0,width:"100%",zIndex:1};function Q(t,e){if(typeof t!="string")return{context:e}}function eo(t,e){return{item:typeof t=="string"?void 0:e}}const cr=R.memo(function(){const e=j("HeaderComponent"),n=Rt("headerHeight"),o=j("HeaderFooterTag"),r=Vt(R.useMemo(()=>i=>{n(zt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?V.jsx(o,{ref:r,children:V.jsx(e,{...Q(e,s)})}):null}),ur=R.memo(function(){const e=j("FooterComponent"),n=Rt("footerHeight"),o=j("HeaderFooterTag"),r=Vt(R.useMemo(()=>i=>{n(zt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?V.jsx(o,{ref:r,children:V.jsx(e,{...Q(e,s)})}):null});function Xe({useEmitter:t,useEmitterValue:e,usePublisher:n}){return R.memo(function({children:s,style:i,context:l,...u}){const d=n("scrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("scrollerRef"),T=e("horizontalDirection")||!1,{scrollByCallback:w,scrollerRef:H,scrollToCallback:g}=Qn(d,S,m,h,void 0,T);t("scrollTo",g),t("scrollBy",w);const f=T?ir:sr;return V.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:H,style:{...f,...i},tabIndex:0,...u,...Q(m,l),children:s})})}function Je({useEmitter:t,useEmitterValue:e,usePublisher:n}){return R.memo(function({children:s,style:i,context:l,...u}){const d=n("windowScrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("totalListHeight"),T=e("deviation"),w=e("customScrollParent"),H=R.useRef(null),g=e("scrollerRef"),{scrollByCallback:f,scrollerRef:a,scrollToCallback:x}=Qn(d,S,m,g,w);return Jn(()=>{var b;return a.current=w||((b=H.current)==null?void 0:b.ownerDocument.defaultView),()=>{a.current=null}},[a,w]),t("windowScrollTo",x),t("scrollBy",f),V.jsx(m,{ref:H,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h!==0?{height:h+T}:{}},...u,...Q(m,l),children:s})})}const ar=({children:t})=>{const e=R.useContext(pe),n=Rt("viewportHeight"),o=Rt("fixedItemHeight"),r=j("alignToBottom"),s=j("horizontalDirection"),i=R.useMemo(()=>oe(n,u=>zt(u,s?"width":"height")),[n,s]),l=Vt(i,!0,j("skipAnimationFrameInResizeObserver"));return R.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:Jt(r),children:t})},dr=({children:t})=>{const e=R.useContext(pe),n=Rt("windowViewportRect"),o=Rt("fixedItemHeight"),r=j("customScrollParent"),s=Ae(n,r,j("skipAnimationFrameInResizeObserver")),i=j("alignToBottom");return R.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Jt(i),children:t})},fr=({children:t})=>{const e=j("TopItemListComponent")||"div",n=j("headerHeight"),o={...lr,marginTop:`${n}px`},r=j("context");return V.jsx(e,{style:o,...Q(e,r),children:t})},mr=R.memo(function(e){const n=j("useWindowScroll"),o=j("topItemsIndexes").length>0,r=j("customScrollParent"),s=j("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(Cn,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(cr,{}),V.jsx(Cn,{}),V.jsx(ur,{})]})]})}),{Component:no,useEmitter:Qe,useEmitterValue:j,usePublisher:Rt}=Ke(er,{required:{},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:j,usePublisher:Rt}),hr=Je({useEmitter:Qe,useEmitterValue:j,usePublisher:Rt}),gr=no,xr=no,Ir=U(()=>{const t=C(d=>V.jsxs("td",{children:["Item $",d]})),e=C(null),n=C(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=C(null),r=C(null),s=C({}),i=C(Ze),l=C(Xt),u=(d,m=null)=>ht(I(s,B(S=>S[d]),J()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:u("EmptyPlaceholder"),FillerRow:u("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:u("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:u("ScrollSeekPlaceholder"),TableBodyComponent:u("TableBody","tbody"),TableComponent:u("Table","table"),TableFooterComponent:u("TableFoot","tfoot"),TableHeadComponent:u("TableHead","thead"),TableRowComponent:u("TableRow","tr"),GroupComponent:u("Group","tr")}}),Sr=U(([t,e])=>({...t,...e}),tt(Xn,Ir)),Tr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),Cr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),wr={overflowAnchor:"none"},wn={position:Ye(),zIndex:2,overflowAnchor:"none"},vn=R.memo(function({showTopList:e=!1}){const n=_("listState"),o=_("computeItemKey"),r=_("firstItemIndex"),s=_("context"),i=_("isSeeking"),l=_("fixedHeaderHeight"),u=_("groupIndices").length>0,d=_("itemContent"),m=_("groupContent"),S=_("ScrollSeekPlaceholder")||Tr,h=_("GroupComponent"),T=_("TableRowComponent"),w=(e?n.topItems:[]).reduce((g,f,a)=>(a===0?g.push(f.size):g.push(g[a-1]+f.size),g),[]),H=(e?n.topItems:n.items).map(g=>{const f=g.originalIndex,a=o(f+r,g.data,s),x=e?f===0?0:w[f-1]:0;return i?R.createElement(S,{...Q(S,s),height:g.size,index:g.index,key:a,type:g.type||"item"}):g.type==="group"?R.createElement(h,{...Q(h,s),"data-index":f,"data-item-index":g.index,"data-known-size":g.size,key:a,style:{...wn,top:l}},m(g.index,s)):R.createElement(T,{...Q(T,s),...eo(T,g.data),"data-index":f,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:a,style:e?{...wn,top:l+x}:wr},u?d(g.index,g.groupIndex,g.data,s):d(g.index,g.data,s))});return V.jsx(V.Fragment,{children:H})}),vr=R.memo(function(){const e=_("listState"),n=_("topItemsIndexes").length>0,o=kt("sizeRanges"),r=_("useWindowScroll"),s=_("customScrollParent"),i=kt("windowScrollContainerState"),l=kt("scrollContainerState"),u=s||r?i:l,d=_("trackItemSizes"),m=_("itemSize"),S=_("log"),{callbackRef:h,ref:T}=On(o,m,d,u,S,void 0,s,!1,_("skipAnimationFrameInResizeObserver")),[w,H]=R.useState(0);tn("deviation",k=>{w!==k&&(T.current.style.marginTop=`${k}px`,H(k))});const g=_("EmptyPlaceholder"),f=_("FillerRow")||Cr,a=_("TableBodyComponent"),x=_("paddingTopAddition"),b=_("statefulTotalCount"),y=_("context");if(b===0&&g)return V.jsx(g,{...Q(g,y)});const z=(n?e.topItems:[]).reduce((k,A)=>k+A.size,0),c=e.offsetTop+x+w-z,p=e.offsetBottom,v=c>0?V.jsx(f,{context:y,height:c},"padding-top"):null,O=p>0?V.jsx(f,{context:y,height:p},"padding-bottom"):null;return V.jsxs(a,{"data-testid":"virtuoso-item-list",ref:h,...Q(a,y),children:[v,n&&V.jsx(vn,{showTopList:!0}),V.jsx(vn,{}),O]})}),yr=({children:t})=>{const e=R.useContext(pe),n=kt("viewportHeight"),o=kt("fixedItemHeight"),r=Vt(R.useMemo(()=>oe(n,s=>zt(s,"height")),[n]),!0,_("skipAnimationFrameInResizeObserver"));return R.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:Jt(!1),children:t})},br=({children:t})=>{const e=R.useContext(pe),n=kt("windowViewportRect"),o=kt("fixedItemHeight"),r=_("customScrollParent"),s=Ae(n,r,_("skipAnimationFrameInResizeObserver"));return R.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:s,style:Jt(!1),children:t})},Rr=R.memo(function(e){const n=_("useWindowScroll"),o=_("customScrollParent"),r=kt("fixedHeaderHeight"),s=kt("fixedFooterHeight"),i=_("fixedHeaderContent"),l=_("fixedFooterContent"),u=_("context"),d=Vt(R.useMemo(()=>oe(r,a=>zt(a,"height")),[r]),!0,_("skipAnimationFrameInResizeObserver")),m=Vt(R.useMemo(()=>oe(s,a=>zt(a,"height")),[s]),!0,_("skipAnimationFrameInResizeObserver")),S=o||n?Er:Hr,h=o||n?br:yr,T=_("TableComponent"),w=_("TableHeadComponent"),H=_("TableFooterComponent"),g=i?V.jsx(w,{ref:d,style:{position:"sticky",top:0,zIndex:2},...Q(w,u),children:i()},"TableHead"):null,f=l?V.jsx(H,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...Q(H,u),children:l()},"TableFoot"):null;return V.jsx(S,{...e,...Q(S,u),children:V.jsx(h,{children:V.jsxs(T,{style:{borderSpacing:0,overflowAnchor:"none"},...Q(T,u),children:[g,V.jsx(vr,{},"TableBody"),f]})})})}),{Component:oo,useEmitter:tn,useEmitterValue:_,usePublisher:kt}=Ke(Sr,{required:{},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),Hr=Xe({useEmitter:tn,useEmitterValue:_,usePublisher:kt}),Er=Je({useEmitter:tn,useEmitterValue:_,usePublisher:kt}),kr=oo,Br=oo,yn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},zr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:bn,floor:Ce,max:ne,min:Be,round:Rn}=Math;function Hn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Or(t){return{...zr,items:t}}function xe(t,e){return t&&t.width===e.width&&t.height===e.height}function Fr(t,e){return t&&t.column===e.column&&t.row===e.row}const Lr=U(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:u,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:S},h,T,{didMount:w,propsReady:H},{customScrollParent:g,useWindowScroll:f,windowScrollContainerState:a,windowScrollTo:x,windowViewportRect:b},y])=>{const z=C(0),c=C(0),p=C(yn),v=C({height:0,width:0}),O=C({height:0,width:0}),k=$(),A=$(),W=C(0),K=C(null),L=C({column:0,row:0}),St=$(),M=$(),et=C(!1),wt=C(0),ft=C(!0),Tt=C(!1),Mt=C(!1);Y(I(w,D(wt),P(([E,q])=>!!q)),()=>{N(ft,!1)}),Y(I(ut(w,ft,O,v,wt,Tt),P(([E,q,at,gt,,Ct])=>E&&!q&&at.height!==0&>.height!==0&&!Ct)),([,,,,E])=>{N(Tt,!0),Ne(1,()=>{N(k,E)}),Et(I(d),()=>{N(e,[0,0]),N(ft,!0)})}),F(I(M,P(E=>E!=null&&E.scrollTop>0),Ft(0)),c),Y(I(w,D(M),P(([,E])=>E!=null)),([,E])=>{E&&(N(v,E.viewport),N(O,E.item),N(L,E.gap),E.scrollTop>0&&(N(et,!0),Et(I(d,Dt(1)),q=>{N(et,!1)}),N(u,{top:E.scrollTop})))}),F(I(v,B(({height:E})=>E)),S),F(I(ut(G(v,xe),G(O,xe),G(L,(E,q)=>E&&E.column===q.column&&E.row===q.row),G(d)),B(([E,q,at,gt])=>({gap:at,item:q,scrollTop:gt,viewport:E}))),St),F(I(ut(G(z),o,G(L,Fr),G(O,xe),G(v,xe),G(K),G(c),G(et),G(ft),G(wt)),P(([,,,,,,,E])=>!E),B(([E,[q,at],gt,Ct,st,it,mt,,lt,Z])=>{const{column:nt,row:vt}=gt,{height:ct,width:be}=Ct,{width:en}=st;if(mt===0&&(E===0||en===0))return yn;if(be===0){const ln=De(Z,E),lo=ln+Math.max(mt-1,0);return Or(Hn(ln,lo,it))}const he=ro(en,be,nt);let Kt,_t;lt?q===0&&at===0&&mt>0?(Kt=0,_t=mt-1):(Kt=he*Ce((q+vt)/(ct+vt)),_t=he*bn((at+vt)/(ct+vt))-1,_t=Be(E-1,ne(_t,he-1)),Kt=Be(_t,ne(0,Kt))):(Kt=0,_t=-1);const nn=Hn(Kt,_t,it),{bottom:on,top:rn}=En(st,gt,Ct,nn),sn=bn(E/he),io=sn*ct+(sn-1)*vt-on;return{bottom:on,itemHeight:ct,items:nn,itemWidth:be,offsetBottom:io,offsetTop:rn,top:rn}})),p),F(I(K,P(E=>E!==null),B(E=>E.length)),z),F(I(ut(v,O,p,L),P(([E,q,{items:at}])=>at.length>0&&q.height!==0&&E.height!==0),B(([E,q,{items:at},gt])=>{const{bottom:Ct,top:st}=En(E,gt,q,at);return[st,Ct]}),J(ie)),e);const pt=C(!1);F(I(d,D(pt),B(([E,q])=>q||E!==0)),pt);const Ut=bt(I(ut(p,z),P(([{items:E}])=>E.length>0),D(pt),P(([[E,q],at])=>{const Ct=E.items[E.items.length-1].index===q-1;return(at||E.bottom>0&&E.itemHeight>0&&E.offsetBottom===0&&E.items.length===q)&&Ct}),B(([[,E]])=>E-1),J())),Qt=bt(I(G(p),P(({items:E})=>E.length>0&&E[0].index===0),Ft(0),J())),Ot=bt(I(G(p),D(et),P(([{items:E},q])=>E.length>0&&!q),B(([{items:E}])=>({endIndex:E[E.length-1].index,startIndex:E[0].index})),J(Mn),Pt(0)));F(Ot,T.scrollSeekRangeChanged),F(I(k,D(v,O,z,L),B(([E,q,at,gt,Ct])=>{const st=Nn(E),{align:it,behavior:mt,offset:lt}=st;let Z=st.index;Z==="LAST"&&(Z=gt-1),Z=ne(0,Z,Be(gt-1,Z));let nt=Ge(q,Ct,at,Z);return it==="end"?nt=Rn(nt-q.height+at.height):it==="center"&&(nt=Rn(nt-q.height/2+at.height/2)),lt&&(nt+=lt),{behavior:mt,top:nt}})),u);const te=ht(I(p,B(E=>E.offsetBottom+E.bottom)),0);return F(I(b,B(E=>({height:E.visibleHeight,width:E.visibleWidth}))),v),{customScrollParent:g,data:K,deviation:W,footerHeight:r,gap:L,headerHeight:s,increaseViewportBy:t,initialItemCount:c,itemDimensions:O,overscan:n,restoreStateFrom:M,scrollBy:i,scrollContainerState:l,scrollHeight:A,scrollTo:u,scrollToIndex:k,scrollTop:d,smoothScrollTargetReached:m,totalCount:z,useWindowScroll:f,viewportDimensions:v,windowScrollContainerState:a,windowScrollTo:x,windowViewportRect:b,...T,gridState:p,horizontalDirection:Mt,initialTopMostItemIndex:wt,totalListHeight:te,...h,endReached:Ut,propsReady:H,rangeChanged:Ot,startReached:Qt,stateChanged:St,stateRestoreInProgress:et,...y}},tt($e,It,me,Yn,Wt,Ue,At));function ro(t,e,n){return ne(1,Ce((t+n)/(Ce(e)+n)))}function En(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=Ce(o/r),i=s*n.height+ne(0,s-1)*e.row;return i>0?i+e.row:i}const Vr=U(()=>{const t=C(S=>`Item ${S}`),e=C({}),n=C(null),o=C("virtuoso-grid-item"),r=C("virtuoso-grid-list"),s=C(Ze),i=C("div"),l=C(Xt),u=(S,h=null)=>ht(I(e,B(T=>T[S]),J()),h),d=C(!1),m=C(!1);return F(G(m),d),{components:e,computeItemKey:s,context:n,FooterComponent:u("Footer"),HeaderComponent:u("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:u("Item","div"),itemContent:t,listClassName:r,ListComponent:u("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:u("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),Gr=U(([t,e])=>({...t,...e}),tt(Lr,Vr)),Pr=R.memo(function(){const e=ot("gridState"),n=ot("listClassName"),o=ot("itemClassName"),r=ot("itemContent"),s=ot("computeItemKey"),i=ot("isSeeking"),l=Ht("scrollHeight"),u=ot("ItemComponent"),d=ot("ListComponent"),m=ot("ScrollSeekPlaceholder"),S=ot("context"),h=Ht("itemDimensions"),T=Ht("gap"),w=ot("log"),H=ot("stateRestoreInProgress"),g=Ht("reportReadyState"),f=Vt(R.useMemo(()=>a=>{const x=a.parentElement.parentElement.scrollHeight;l(x);const b=a.firstChild;if(b){const{height:y,width:z}=b.getBoundingClientRect();h({height:y,width:z})}T({column:kn("column-gap",getComputedStyle(a).columnGap,w),row:kn("row-gap",getComputedStyle(a).rowGap,w)})},[l,h,T,w]),!0,!1);return Jn(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),H?null:V.jsx(d,{className:n,ref:f,...Q(d,S),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const x=s(a.index,a.data,S);return i?V.jsx(m,{...Q(m,S),height:e.itemHeight,index:a.index,width:e.itemWidth},x):R.createElement(u,{...Q(u,S),className:o,"data-index":a.index,key:x},r(a.index,a.data,S))})})}),Mr=R.memo(function(){const e=ot("HeaderComponent"),n=Ht("headerHeight"),o=ot("headerFooterTag"),r=Vt(R.useMemo(()=>i=>{n(zt(i,"height"))},[n]),!0,!1),s=ot("context");return e?V.jsx(o,{ref:r,children:V.jsx(e,{...Q(e,s)})}):null}),jr=R.memo(function(){const e=ot("FooterComponent"),n=Ht("footerHeight"),o=ot("headerFooterTag"),r=Vt(R.useMemo(()=>i=>{n(zt(i,"height"))},[n]),!0,!1),s=ot("context");return e?V.jsx(o,{ref:r,children:V.jsx(e,{...Q(e,s)})}):null}),Ar=({children:t})=>{const e=R.useContext(qe),n=Ht("itemDimensions"),o=Ht("viewportDimensions"),r=Vt(R.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return R.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:Jt(!1),children:t})},Wr=({children:t})=>{const e=R.useContext(qe),n=Ht("windowViewportRect"),o=Ht("itemDimensions"),r=ot("customScrollParent"),s=Ae(n,r,!1);return R.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:s,style:Jt(!1),children:t})},_r=R.memo(function({...e}){const n=ot("useWindowScroll"),o=ot("customScrollParent"),r=o||n?$r:Dr,s=o||n?Wr:Ar,i=ot("context");return V.jsx(r,{...e,...Q(r,i),children:V.jsxs(s,{children:[V.jsx(Mr,{}),V.jsx(Pr,{}),V.jsx(jr,{})]})})}),{Component:Nr,useEmitter:so,useEmitterValue:ot,usePublisher:Ht}=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:ot,usePublisher:Ht}),$r=Je({useEmitter:so,useEmitterValue:ot,usePublisher:Ht});function kn(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,xt.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}const Ur=Nr;exports.GroupedTableVirtuoso=Br;exports.GroupedVirtuoso=xr;exports.LogLevel=xt;exports.TableVirtuoso=kr;exports.Virtuoso=gr;exports.VirtuosoGrid=Ur;exports.VirtuosoGridMockContext=qe;exports.VirtuosoMockContext=pe;
|
|
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={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(([{scrollHeight:l,scrollTop:c,viewportHeight:d},{offsetTop:m}])=>({scrollHeight:l,scrollTop:Math.max(0,c-m),viewportHeight:d}))),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({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({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({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.d.ts
CHANGED
|
@@ -703,7 +703,7 @@ export declare type ItemContent<Data, Context> = (index: number, data: Data, con
|
|
|
703
703
|
*/
|
|
704
704
|
export declare type ItemProps<Data> = Pick<default_2.ComponentProps<'div'>, 'children' | 'style'> & {
|
|
705
705
|
'data-index': number;
|
|
706
|
-
'data-item-group-index'?: number;
|
|
706
|
+
'data-item-group-index'?: number | undefined;
|
|
707
707
|
'data-item-index': number;
|
|
708
708
|
'data-known-size': number;
|
|
709
709
|
item: Data;
|
|
@@ -782,16 +782,18 @@ export declare interface LocationOptions {
|
|
|
782
782
|
*
|
|
783
783
|
* @group Common
|
|
784
784
|
*/
|
|
785
|
-
export declare
|
|
785
|
+
export declare const LogLevel: {
|
|
786
786
|
/** Detailed debugging information including item measurements */
|
|
787
|
-
DEBUG
|
|
787
|
+
readonly DEBUG: 0;
|
|
788
788
|
/** General informational messages */
|
|
789
|
-
INFO
|
|
789
|
+
readonly INFO: 1;
|
|
790
790
|
/** Warning messages for potential issues */
|
|
791
|
-
WARN
|
|
791
|
+
readonly WARN: 2;
|
|
792
792
|
/** Error messages for failures (default level) */
|
|
793
|
-
ERROR
|
|
794
|
-
}
|
|
793
|
+
readonly ERROR: 3;
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
export declare type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
795
797
|
|
|
796
798
|
/**
|
|
797
799
|
* Represents a regular data item (not a group header) in the list.
|