react-virtuoso 4.18.18 → 4.18.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +67 -67
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),H=require("react"),ho=require("react-dom"),we=0,Gt=1,Xt=2,Pn=4;function fn(t){return()=>t}function go(t){t()}function ne(t,e){return n=>t(e(n))}function mn(t,e){return()=>t(e)}function xo(t,e){return n=>t(e,n)}function Ae(t){return t!==void 0}function Io(...t){return()=>{t.map(go)}}function Jt(){}function ye(t,e){return e(t),t}function So(t,e){return e(t)}function st(...t){return t}function X(t,e){return t(Gt,e)}function j(t,e){t(we,e)}function je(t){t(Xt)}function tt(t){return t(Pn)}function z(t,e){return X(t,xo(e,we))}function Ht(t,e){const n=t(Gt,o=>{n(),e(o)});return n}function pn(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Wn(t,e){return t===e}function ot(t=Wn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function k(t){return e=>ne(e,t)}function Ct(t){return e=>()=>{e(t)}}function I(t,...e){const n=vo(...e);return((o,r)=>{switch(o){case Xt:je(t);return;case Gt:return X(t,n(r))}})}function Et(t,e){return n=>o=>{n(e=t(e,o))}}function $t(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=Array.from({length:t.length});let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;X(s,u=>{const d=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 vo(...t){return e=>t.reduceRight(So,e)}function To(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Gt:return s?n===s?void 0:(o(),n=s,e=X(t,s),e):(o(),Jt);case Xt:o(),n=null;return}}}function y(t){let e=t;const n=$();return((o,r)=>{switch(o){case we:e=r;break;case Gt:{r(e);break}case Pn:return e}return n(o,r)})}function gt(t,e){return ye(y(e),n=>z(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case we:t.slice().forEach(o=>{o(n)});return;case Xt:t.splice(0);return;case Gt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function yt(t){return ye($(),e=>z(t,e))}const Co={singleton:!0};function Y(t,e=[],n=Co){const{singleton:o}=n;return{constructor:t,dependencies:e,id:wo(),singleton:o}}const wo=()=>Symbol("id");function yo(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 mt(...t){const e=$(),n=Array.from({length:t.length});let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;X(s,u=>{n[i]=u,o|=l,o===r&&j(e,n)})}),function(s,i){switch(s){case Xt:{je(e);return}case Gt:return o===r&&i(n),X(e,i)}}}function G(t,e=Wn){return I(t,ot(e))}function ve(...t){return function(e,n){switch(e){case Xt:return;case Gt:return Io(...t.map(o=>X(o,n)))}}}const pt={DEBUG:0,INFO:1,WARN:2,ERROR:3},bo={[pt.DEBUG]:"debug",[pt.ERROR]:"error",[pt.INFO]:"log",[pt.WARN]:"warn"},Ro=()=>typeof globalThis>"u"?window:globalThis,Mt=Y(()=>{const t=y(pt.ERROR);return{log:y((n,o,r=pt.INFO)=>{const s=Ro().VIRTUOSO_LOG_LEVEL??tt(t);r>=s&&console[bo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Eo(t){return"self"in t?t.document.documentElement:t}function Gn(t){const e=Eo(t);return e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl"}function _t(t,e){return Gn(t)?-e:e}function hn(t,e){return Gn(t)?-e:e}function Lt(t,e,n){return _e(t,e,n).callbackRef}function _e(t,e,n){const o=H.useRef(null);let r=i=>{};const s=H.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?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Mn(t,e,n,o,r,s,i,l,u){const d=H.useCallback(f=>{const S=Ho(f.children,e,l?"offsetWidth":"offsetHeight",r);let h=f.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const m=h.lastElementChild?.dataset.viewportType==="window";let v;m&&(v=h.ownerDocument.defaultView);const R=i?l?i.scrollWidth:i.scrollHeight:m?l?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,g=i?l?i.offsetWidth:i.offsetHeight:m?l?v.innerWidth:v.innerHeight:l?h.offsetWidth:h.offsetHeight,T=i?l?_t(i,i.scrollLeft):i.scrollTop:m?l?_t(v,v.scrollX||v.document.documentElement.scrollLeft):v.scrollY||v.document.documentElement.scrollTop:l?_t(h,h.scrollLeft):h.scrollTop;o({scrollHeight:R,scrollTop:Math.max(T,0),viewportHeight:g}),s?.(l?gn("column-gap",getComputedStyle(f).columnGap,r):gn("row-gap",getComputedStyle(f).rowGap,r)),S!==null&&t(S)},[t,e,r,s,i,o,l]);return _e(d,n,u)}function Ho(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,10),d=parseFloat(l.dataset.knownSize),f=e(l,n);if(f===0&&o("Zero-sized element, this should not happen",{child:l},pt.ERROR),f===d)continue;const S=s[s.length-1];s.length===0||S.size!==f||S.endIndex!==u-1?s.push({endIndex:u,size:f,startIndex:u}):s[s.length-1].endIndex++}return s}function gn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,pt.WARN),e==="normal"?0:parseInt(e??"0",10)}const be=typeof document>"u"?H.useEffect:H.useLayoutEffect;function Ne(t,e,n){const o=H.useRef(null),r=H.useCallback(u=>{if(!u?.offsetParent)return;const d=u.getBoundingClientRect(),f=d.width;let S,h;if(e){const m=e.getBoundingClientRect(),v=d.top-m.top;h=m.height-Math.max(0,v),S=v+e.scrollTop}else{const m=i.current.ownerDocument.defaultView;h=m.innerHeight-Math.max(0,d.top),S=d.top+m.scrollY}o.current={listHeight:d.height,offsetTop:S,visibleHeight:h,visibleWidth:f},t(o.current)},[t,e]),{callbackRef:s,ref:i}=_e(r,!0,n),l=H.useCallback(()=>{r(i.current)},[r,i]);return H.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 u=i.current?.ownerDocument.defaultView;return u?.addEventListener("scroll",l),u?.addEventListener("resize",l),()=>{u?.removeEventListener("scroll",l),u?.removeEventListener("resize",l)}},[l,e,i]),s}const It=Y(()=>{const t=$(),e=$(),n=y(0),o=$(),r=$(),s=y(0),i=$(),l=$(),u=y(0),d=y(0),f=y(0),S=y(0),h=$(),m=$(),v=y(!1),R=y(!1),g=y(!1);return z(I(t,k(({scrollTop:T})=>T)),e),z(I(t,k(({scrollHeight:T})=>T)),l),z(e,s),{deviation:n,deviationCommitted:o,fixedFooterHeight:f,fixedHeaderHeight:d,footerHeight:S,headerHeight:u,horizontalDirection:R,scrollBy:m,scrollContainerState:t,scrollHeight:l,scrollingInProgress:v,scrollTo:h,scrollTop:e,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:s,viewportHeight:i}},[],{singleton:!0}),oe={lvl:0};function An(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 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 kt(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=kt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return kt(t.l,e,n)}function St(t,e,n){return J(t)?Nn(e,n,1):e===t.k?ht(t,{k:e,v:n}):e<t.k?xn(ht(t,{l:St(t.l,e,n)})):xn(ht(t,{r:St(t.r,e,n)}))}function Nt(){return oe}function Yt(t,e,n){if(J(t))return[];const o=kt(t,e)[0];return ko(Ve(t,o,n))}function Fe(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]=_n(o);return Ie(ht(t,{k:s,l:jn(o),v:i}))}return e<n?Ie(ht(t,{l:Fe(o,e)})):Ie(ht(t,{r:Fe(r,e)}))}function Dt(t){return J(t)?[]:[...Dt(t.l),{k:t.k,v:t.v},...Dt(t.r)]}function Ve(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(Ve(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Ve(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(ke(e))return Dn(ht(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return ht(e.r,{l:ht(e,{r:e.r.l}),lvl:n,r:ht(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(ke(t))return Pe(ht(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=ke(r)?o.lvl-1:o.lvl;return ht(r,{l:ht(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Pe(ht(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function ht(t,e){return Nn(e.k===void 0?t.k:e.k,e.v===void 0?t.v:e.v,e.lvl===void 0?t.lvl:e.lvl,e.l===void 0?t.l:e.l,e.r===void 0?t.r:e.r)}function jn(t){return J(t.r)?t.l:Ie(ht(t,{r:jn(t.r)}))}function ke(t){return J(t)||t.lvl>t.r.lvl}function _n(t){return J(t.r)?[t.k,t.v]:_n(t.r)}function Nn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function xn(t){return Pe(Dn(t))}function Dn(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?ht(e,{r:ht(t,{l:e.r})}):t}function Pe(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?ht(n,{l:ht(t,{r:n.l}),lvl:e+1}):t}function ko(t){return An(t,({k:e,v:n})=>({index:e,value:n}))}function $n(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function Zt(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const De=Y(()=>({recalcInProgress:y(!1)}),[],{singleton:!0});function Un(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 Bo(t,e,n,o){const r=Te(t,e,o),s=Te(t,n,o,r);return t.slice(r,s+1)}function Bt(t,e){return Math.round(t.getBoundingClientRect()[e])}function Re(t){return!J(t.groupOffsetTree)}function $e({index:t},e){return e===t?0:e<t?-1:1}function In(){return{groupIndices:[],groupOffsetTree:Nt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Nt()}}function Oo(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=St(t,0,s);continue}const l=Yt(t,i-1,r+1);if(l.some(Go(o)))continue;let u=!1,d=!1;for(const{end:f,start:S,value:h}of l)u?(r>=S||s===h)&&(t=Fe(t,S)):(d=h!==s,u=!0),f>r&&r>=S&&h!==s&&(t=St(t,r+1,h));d&&(t=St(t,i,s))}return[t,n]}function Lo(t){return t.groupIndex!==void 0}function zo({offset:t},e){return e===t?0:e<t?-1:1}function se(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=Un(e,t,$e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function Kn(t,e){if(!Re(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function qn(t,e,n){if(Lo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=Kn(o,e);return r=Math.max(0,Math.min(n,r)),r}function Fo(t,e,n,o=0){return o>0&&(e=Math.max(e,Un(t,o,$e).offset)),An(Bo(t,e,n,zo),Wo)}function Vo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,pt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const h=e[0].size,m=e[1].size;i=n.reduce((v,R)=>St(St(v,R,h),R+1,m),i)}else[i,l]=Oo(i,e);if(i===s)return t;const{lastIndex:u,lastOffset:d,lastSize:f,offsetTree:S}=We(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,m)=>St(h,m,se(m,S,r)),Nt()),lastIndex:u,lastOffset:d,lastSize:f,offsetTree:S,sizeTree:i}}function Po(t){return Dt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s===void 0?1/0:s.k-1,size:n,startIndex:e}})}function Sn(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 We(t,e,n,o){let r=t,s=0,i=0,l=0,u=0;if(e===0)r=[];else{u=Te(r,e-1,$e),l=r[u].offset;const f=kt(n,e-1);s=f[0],i=f[1],r.length&&r[u].size===kt(n,e)[1]&&(u-=1),r=r.slice(0,u+1)}for(const{start:d,value:f}of Yt(n,e,1/0)){const S=d-s,h=S*i+l+S*o;r.push({index:d,offset:h,size:f}),s=d,l=h,i=f}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Wo(t){return{index:t.index,value:t}}function Go(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 Mo={offsetHeight:"height",offsetWidth:"width"},zt=Y(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=gt(o,0),s=$(),i=$(),l=y(0),u=y([]),d=y(void 0),f=y(void 0),S=y(void 0),h=y(void 0),m=y((c,p)=>Bt(c,Mo[p])),v=y(void 0),R=y(0),g=In(),T=$(),a=gt(I(ve(n,T),D(u,t,R),Et((c,[p,...b])=>{if(p===null){const[O]=b;return{...In(),groupIndices:O,groupOffsetTree:O.reduce((L,F,M)=>St(L,F,M),Nt())}}return Vo(c,[p,...b])},g),ot()),g),C=gt(I(u,ot(),Et((c,p)=>({current:p,prev:c.current}),{current:[],prev:[]}),k(({prev:c})=>c)),[]);z(I(u,P(c=>c.length>0),D(a,R),k(([c,p,b])=>{const O=c.reduce((L,F,M)=>St(L,F,se(F,p.offsetTree,b)||M),Nt());return{...p,groupIndices:c,groupOffsetTree:O}})),a),z(I(o,D(a),P(([c,{lastIndex:p}])=>c<p),k(([c,{lastIndex:p,lastSize:b}])=>[{endIndex:p,size:b,startIndex:c}])),n),z(d,f);const x=gt(I(d,k(c=>c===void 0)),!0);z(I(f,P(c=>c!==void 0&&J(tt(a).sizeTree)),k(c=>{const p=tt(S),b=tt(u).length>0;return p!==void 0&&p!==0?b?[{endIndex:0,size:p,startIndex:0},{endIndex:1,size:c,startIndex:1}]:[]:[{endIndex:0,size:c,startIndex:0}]})),n),z(I(h,P(c=>c!==void 0&&c.length>0&&J(tt(a).sizeTree)),k(c=>{const p=[];let b=c[0],O=0;for(let L=1;L<c.length;L++){const F=c[L];F!==b&&(p.push({endIndex:L-1,size:b,startIndex:O}),b=F,O=L)}return p.push({endIndex:c.length-1,size:b,startIndex:O}),p})),n),z(I(u,D(S,f),P(([,c,p])=>c!==void 0&&p!==void 0),k(([c,p,b])=>{const O=[];for(let L=0;L<c.length;L++){const F=c[L],M=c[L+1];O.push({startIndex:F,endIndex:F,size:p}),M!==void 0&&O.push({startIndex:F+1,endIndex:M-1,size:b})}return O})),n);const w=yt(I(n,D(a),Et(({sizes:c},[p,b])=>({changed:b!==c,sizes:b}),{changed:!1,sizes:g}),k(c=>c.changed)));X(I(l,Et((c,p)=>({diff:c.prev-p,prev:p}),{diff:0,prev:0}),k(c=>c.diff)),c=>{const{groupIndices:p}=tt(a);if(c>0)j(e,!0),j(s,c+Sn(c,p));else if(c<0){const b=tt(C);b.length>0&&(c-=Sn(-c,b)),j(i,c)}}),X(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},pt.ERROR)});const B=yt(s);z(I(s,D(a),k(([c,p])=>{const b=p.groupIndices.length>0,O=[],L=p.lastSize;if(b){const F=re(p.sizeTree,0);let M=0,Z=0;for(;M<c;){const U=p.groupIndices[Z],ct=p.groupIndices.length===Z+1?1/0:p.groupIndices[Z+1]-U-1;O.push({endIndex:U,size:F,startIndex:U}),O.push({endIndex:U+1+ct-1,size:L,startIndex:U+1}),Z++,M+=ct+1}const W=Dt(p.sizeTree);return M!==c&&W.shift(),W.reduce((U,{k:ct,v:ut})=>{let xt=U.ranges;return U.prevSize!==0&&(xt=[...U.ranges,{endIndex:ct+c-1,size:U.prevSize,startIndex:U.prevIndex}]),{prevIndex:ct+c,prevSize:ut,ranges:xt}},{prevIndex:c,prevSize:0,ranges:O}).ranges}return Dt(p.sizeTree).reduce((F,{k:M,v:Z})=>({prevIndex:M+c,prevSize:Z,ranges:[...F.ranges,{endIndex:M+c-1,size:F.prevSize,startIndex:F.prevIndex}]}),{prevIndex:0,prevSize:L,ranges:[]}).ranges})),n);const _=yt(I(i,D(a,R),k(([c,{offsetTree:p},b])=>{const O=-c;return se(O,p,b)})));return z(I(i,D(a,R),k(([c,p,b])=>{if(p.groupIndices.length>0){if(J(p.sizeTree))return p;let F=Nt();const M=tt(C);let Z=0,W=0,ft=0;for(;Z<-c;){ft=M[W];const ct=M[W+1]-ft-1;W++,Z+=ct+1}if(F=Dt(p.sizeTree).reduce((ct,{k:ut,v:xt})=>St(ct,Math.max(0,ut+c),xt),F),Z!==-c){const ct=re(p.sizeTree,ft);F=St(F,0,ct);const ut=kt(p.sizeTree,-c+1)[1];F=St(F,1,ut)}return{...p,sizeTree:F,...We(p.offsetTree,0,F,b)}}const L=Dt(p.sizeTree).reduce((F,{k:M,v:Z})=>St(F,Math.max(0,M+c),Z),Nt());return{...p,sizeTree:L,...We(p.offsetTree,0,L,b)}})),a),{beforeUnshiftWith:B,data:v,defaultItemSize:f,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:S,gap:R,groupIndices:u,heightEstimates:h,itemSize:m,listRefresh:w,resetSizes:T,shiftWith:i,shiftWithOffset:_,sizeRanges:n,sizes:a,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:s}},st(Mt,De),{singleton:!0});function Ao(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Yn=Y(([{groupIndices:t,resetSizes:e,sizeRanges:n,sizes:o,statefulTotalCount:r,totalCount:s,trackItemSizes:i},{headerHeight:l,scrollTop:u}])=>{const d=$(),f=$(),S=yt(I(d,k(Ao))),h=gt(I(n,D(r,t),P(([,m,v])=>m>v.length),Ct(!0)),!1);return z(I(S,Et(([,m],v)=>[m,v],[{groupIndices:[],totalCount:0},{groupIndices:[],totalCount:0}]),D(o,i,h),P(([[m,v],{sizeTree:R},g,T])=>{const a=m.groupIndices.length>0&&m.totalCount===m.groupIndices.length,C=v.totalCount>v.groupIndices.length;return g&&!T&&a&&C&&!J(R)}),Ct(null)),e),z(I(S,k(m=>m.totalCount)),s),z(I(S,k(m=>m.groupIndices)),t),z(I(mt(u,o,l),P(([m,v])=>Re(v)),k(([m,v,R])=>kt(v.groupOffsetTree,Math.max(m-R,0),"v")[0]),ot(),k(m=>[m])),f),{groupCounts:d,topItemsIndexes:f}},st(zt,It)),At=Y(([{log:t}])=>{const e=y(!1),n=yt(I(e,P(o=>o),ot()));return X(e,o=>{o&&tt(t)("props updated",{},pt.DEBUG)}),{didMount:n,propsReady:e}},st(Mt),{singleton:!0}),jo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Zn(t){const e=typeof t=="number"?{index:t}:{...t};return e.align||(e.align="start"),(!e.behavior||!jo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ue=Y(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:u,scrollTo:d,smoothScrollTargetReached:f,viewportHeight:S},{log:h}])=>{const m=$(),v=$(),R=y(0);let g=null,T=null,a=null;function C(){g!==null&&(g(),g=null),a!==null&&(a(),a=null),T&&(clearTimeout(T),T=null),j(u,!1)}return z(I(m,D(n,S,o,R,l,i,h),D(t,s,r),k(([[x,w,B,_,c,p,b,O],L,F,M])=>{const Z=Zn(x),{align:W,behavior:ft,offset:U}=Z,ct=_-1,ut=qn(Z,w,ct);let xt=se(ut,w.offsetTree,L)+p;W==="end"?(xt+=F+kt(w.sizeTree,ut)[1]-B+M,ut===ct&&(xt+=b)):W==="center"?xt+=(F+kt(w.sizeTree,ut)[1]-B+M)/2:xt-=c,U!==void 0&&U!==0&&(xt+=U);const Ft=vt=>{C(),vt?(O("retrying to scroll to",{location:x},pt.DEBUG),j(m,x)):(j(v,!0),O("list did not change, scroll successful",{},pt.DEBUG))};if(C(),ft==="smooth"){let vt=!1;a=X(e,Ot=>{vt=vt||Ot}),g=Ht(f,()=>{Ft(vt)})}else g=Ht(I(e,_o(150)),Ft);return T=setTimeout(()=>{C()},1200),j(u,!0),O("scrolling from index to",{behavior:ft,index:ut,top:xt},pt.DEBUG),{behavior:ft,top:xt}})),d),{scrollTargetReached:v,scrollToIndex:m,topListHeight:R}},st(zt,It,Mt),{singleton:!0});function _o(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ue(t,e){t===0?e():requestAnimationFrame(()=>{Ue(t-1,e)})}function Ke(t,e){if(t===void 0)return 0;const n=e-1,o=typeof t=="number"?t:t.index==="LAST"?n:t.index;return Math.max(0,Math.min(o,n))}function Ge(t){return t===void 0?!0:typeof t=="number"?t===0:t.index===0&&(t.align===void 0||t.align==="start")&&(t.offset===void 0||t.offset===0)}const ae=Y(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=y(!0),u=y(0),d=y(!0);return z(I(i,D(u),P(([f,S])=>!Ge(S)),Ct(!1)),l),z(I(i,D(u),P(([f,S])=>!Ge(S)),Ct(!1)),d),X(I(mt(e,i),D(l,n,t,d),P(([[,f],S,{sizeTree:h},m,v])=>f&&(!J(h)||Ae(m))&&!S&&!v),D(u)),([,f])=>{if(f===void 0){j(l,!0),j(d,!0);return}Ht(r,()=>{j(d,!0)}),Ue(4,()=>{Ht(o,()=>{j(l,!0)}),j(s,f)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:u,scrolledToInitialItem:l}},st(zt,It,ue,At),{singleton:!0});function Xn(t,e){return Math.abs(t-e)<1.01}const ie="up",te="down",No="none",Do={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},$o=0,de=Y(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=y(!1),l=y(!0),u=$(),d=$(),f=y(4),S=y($o),h=gt(I(ve(I(G(r),$t(1),Ct(!0)),I(G(r),$t(1),Ct(!1),pn(100))),ot()),!1),m=gt(I(ve(I(n,Ct(!0)),I(n,Ct(!1),pn(200))),ot()),!1);z(I(mt(G(r),G(S)),k(([a,C])=>a<=C),ot()),l),z(I(l,Pt(50)),d);const v=yt(I(mt(o,G(s),G(e),G(t),G(f)),Et((a,[{scrollHeight:C,scrollTop:x},w,B,_,c])=>{const p=x+w-C>-c,b={scrollHeight:C,scrollTop:x,viewportHeight:w};if(p){let L,F;return x>a.state.scrollTop?(L="SCROLLED_DOWN",F=a.state.scrollTop-x):(L="SIZE_DECREASED",F=a.state.scrollTop-x||a.scrollTopDelta),{atBottom:!0,atBottomBecause:L,scrollTopDelta:F,state:b}}let O;return b.scrollHeight>a.state.scrollHeight?O="SIZE_INCREASED":w<a.state.viewportHeight?O="VIEWPORT_HEIGHT_DECREASING":x<a.state.scrollTop?O="SCROLLING_UPWARDS":O="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:O,state:b}},Do),ot((a,C)=>a!==void 0&&a.atBottom===C.atBottom))),R=gt(I(o,Et((a,{scrollHeight:C,scrollTop:x,viewportHeight:w})=>{if(!Xn(a.scrollHeight,C)){const B=C-(x+w)<1;return a.scrollTop!==x&&B?{changed:!0,jump:a.scrollTop-x,scrollHeight:C,scrollTop:x}:{changed:!0,jump:0,scrollHeight:C,scrollTop:x}}return{changed:!1,jump:0,scrollHeight:C,scrollTop:x}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(a=>a.changed),k(a=>a.jump)),0);z(I(v,k(a=>a.atBottom)),i),z(I(i,Pt(50)),u);const g=y(te);z(I(o,k(({scrollTop:a})=>a),ot(),Et((a,C)=>tt(m)?{direction:a.direction,prevScrollTop:C}:{direction:C<a.prevScrollTop?ie:te,prevScrollTop:C},{direction:te,prevScrollTop:0}),k(a=>a.direction)),g),z(I(o,Pt(50),Ct(No)),g);const T=y(0);return z(I(h,P(a=>!a),Ct(0)),T),z(I(r,Pt(100),D(h),P(([a,C])=>C),Et(([a,C],[x])=>[C,x],[0,0]),k(([a,C])=>C-a)),T),{atBottomState:v,atBottomStateChange:u,atBottomThreshold:f,atTopStateChange:d,atTopThreshold:S,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:R,scrollDirection:g,scrollVelocity:T}},st(It)),le="top",ce="bottom",vn="none";function Tn(t,e,n){return typeof t=="number"?n===ie&&e===le||n===te&&e===ce?t:0:n===ie?e===le?t.main:t.reverse:e===ce?t.main:t.reverse}function Cn(t,e){return typeof t=="number"?t:t[e]??0}const qe=Y(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=y(0),l=y(0),u=y(0),d=gt(I(mt(G(o),G(r),G(n),G(s,Zt),G(u),G(i),G(e),G(t),G(l)),k(([f,S,h,[m,v],R,g,T,a,C])=>{const x=f-a,w=g+T,B=Math.max(h-x,0);let _=vn;const c=Cn(C,le),p=Cn(C,ce);return m-=a,m+=h+T,v+=h+T,v-=a,m>f+w-c&&(_=ie),v<f-B+S+p&&(_=te),_!==vn?[Math.max(x-h-Tn(R,le,_)-c,0),x-B-T+S+Tn(R,ce,_)+p]:null}),P(f=>f!==null),ot(Zt)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:u,topListHeight:i,visibleRange:d}},st(It),{singleton:!0});function Uo(t,e,n,o){if(Re(e)){const r=o-e.groupIndices.length;if(r<=0)return[{index:e.groupIndices[0],offset:0,size:0}];const s=Kn(Math.min(t,r-1),e);return[{index:kt(e.groupOffsetTree,s)[0],offset:0,size:0},{data:n?.[0],index:s,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const Be={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,f=0;if(t.length>0){d=t[0].offset;const R=t[t.length-1];f=R.offset+R.size}const S=n-i,h=l+S*u+(S-1)*o,m=d,v=h-f;return{bottom:f,firstItemIndex:s,items:wn(t,r,s),offsetBottom:v,offsetTop:d,top:m,topItems:wn(e,r,s),topListHeight:e.reduce((R,g)=>g.size+R,0),totalCount:n}}function Jn(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=s!==void 0,d=s?.length??0,f=Ke(e,u?d:l),S=u?Math.max(0,Math.min(l,d-f)):l,h=Array.from({length:S}).map((m,v)=>({data:s?.[v+f],index:v+f,offset:0,size:0}));return Se(h,[],S,r,n,o)}function wn(t,e,n){if(t.length===0)return[];if(!Re(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 f;d.index===l.start?f={index:u,type:"group"}:f={groupIndex:u,index:d.index-(u+1)+n},s.push({...f,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function yn(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Ut=Y(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:u},{initialTopMostItemIndex:d,scrolledToInitialItem:f},{topListHeight:S},h,{didMount:m},{recalcInProgress:v}])=>{const R=y([]),g=y(0),T=gt(I(o,P(({sizeTree:c})=>!J(c)),Ct(!0)),!1),a=$(),C=y(0);z(s.topItemsIndexes,R);const x=gt(I(mt(m,v,G(u,Zt),G(r),G(o),G(d),f,G(R),G(e),G(n),G(C),t,G(g)),P(([c,p,,b,,,,,,,,O])=>{const L=O!==void 0&&O.length!==b;return c&&!p&&!L}),k(([,,[c,p],b,O,L,F,M,Z,W,ft,U,ct])=>{const ut=O,{offsetTree:xt,sizeTree:Ft}=ut;if(b===0)return{...Be,totalCount:b};if(c===0&&p===0)return ct===0?{...Be,totalCount:b}:Jn(ct,L,O,Z,W,U);if(J(Ft))return ct>0&&!tt(T)?null:Se(Uo(Ke(L,b),ut,U,b),[],b,W,ut,Z);const vt=[];if(M.length>0){const q=M[0],Q=M[M.length-1];let at=0;for(const it of Yt(Ft,q,Q)){const et=it.value,dt=Math.max(it.start,q),Tt=Math.min(it.end,Q);for(let lt=dt;lt<=Tt;lt++)vt.push({data:U?.[lt],index:lt,offset:at,size:et}),at+=et}}if(!F)return Se([],vt,b,W,ut,Z);const Ot=M.length>0?M[M.length-1]+1:0,me=Fo(xt,c,p,Ot);if(me.length===0)return null;const Kt=b-1,Vt=ye([],q=>{for(const Q of me){const at=Q.value;let it=at.offset,et=Q.start;const dt=at.size;if(at.offset<c){et+=Math.floor((c-at.offset+W)/(dt+W));const lt=et-Q.start;it+=lt*dt+lt*W}et<Ot&&(it+=(Ot-et)*dt,et=Ot);const Tt=Math.min(Q.end,Kt);for(let lt=et;lt<=Tt&&!(it>=p);lt++)q.push({data:U?.[lt],index:lt,offset:it,size:dt}),it+=dt+W}}),E=yn(ft,le),K=yn(ft,ce);if(Vt.length>0&&(E>0||K>0)){const q=Vt[0],Q=Vt[Vt.length-1];if(E>0&&q.index>Ot){const at=Math.min(E,q.index-Ot),it=[];let et=q.offset;for(let dt=q.index-1;dt>=q.index-at;dt--){const lt=Yt(Ft,dt,dt)[0]?.value??q.size;et-=lt+W,it.unshift({data:U?.[dt],index:dt,offset:et,size:lt})}Vt.unshift(...it)}if(K>0&&Q.index<Kt){const at=Math.min(K,Kt-Q.index);let it=Q.offset+Q.size+W;for(let et=Q.index+1;et<=Q.index+at;et++){const Tt=Yt(Ft,et,et)[0]?.value??Q.size;Vt.push({data:U?.[et],index:et,offset:it,size:Tt}),it+=Tt+W}}}return Se(Vt,vt,b,W,ut,Z)}),P(c=>c!==null),ot()),Be);z(I(t,P(Ae),k(c=>c?.length)),r),z(I(x,k(c=>c.topListHeight)),S),z(S,l),z(I(x,k(c=>[c.top,c.bottom])),i),z(I(x,k(c=>c.items)),a);const w=yt(I(x,P(({items:c})=>c.length>0),D(r,t),P(([{items:c},p])=>c[c.length-1].originalIndex===p-1),k(([{items:c},p,b])=>{const O=c[c.length-1],L=O.type==="group"?O.index+1:(O.groupIndex??-1)+1;return[p-1-L,b]}),ot(Zt),P(([c])=>c>=0),k(([c])=>c))),B=yt(I(x,Pt(200),P(({items:c,topItems:p})=>c.length>0&&c[0].originalIndex===p.length),k(({items:c})=>c[0].index),ot())),_=yt(I(x,P(({items:c})=>c.length>0),k(({items:c})=>{let p=0,b=c.length-1;for(;c[p].type==="group"&&p<b;)p++;for(;c[b].type==="group"&&b>p;)b--;return{endIndex:c[b].index,startIndex:c[p].index}}),ot($n)));return{endReached:w,initialItemCount:g,itemsRendered:a,listState:x,minOverscanItemCount:C,rangeChanged:_,startReached:B,topItemsIndexes:R,...h}},st(zt,Yn,qe,ae,ue,de,At,De),{singleton:!0}),Qn=Y(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=gt(I(mt(n,t,o,e,r),k(([l,u,d,f,S])=>l+u+d+f+S.offsetBottom+S.bottom)),0);return z(G(i),s),{totalListHeight:i,totalListHeightChanged:s}},st(It,Ut),{singleton:!0}),Ko=Y(([{viewportHeight:t},{totalListHeight:e}])=>{const n=y(!1),o=gt(I(mt(n,t,e),P(([r])=>r),k(([,r,s])=>Math.max(0,r-s)),Pt(0),ot()),0);return{alignToBottom:n,paddingTopAddition:o}},st(It,Qn),{singleton:!0}),to=Y(()=>({context:y(null)})),qo=({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,eo=Y(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:u},{scrollToIndex:d}])=>{const f=$();return z(I(f,D(e,u,n,s,r,o,l),D(t),k(([[S,h,m,v,R,g,T,a],C])=>{const{calculateViewLocation:x=qo,done:w,...B}=S,_=qn(S,h,v-1),c=se(_,h.offsetTree,C)+R+g,p=c+kt(h.sizeTree,_)[1],b=a+g,O=a+m-T,L=x({itemBottom:p,itemTop:c,locationParams:B,viewportBottom:O,viewportTop:b});return L===null?w?.():w&&Ht(I(i,P(F=>!F),$t(tt(i)?1:2)),w),L}),P(S=>S!==null)),d),{scrollIntoView:f}},st(zt,It,ue,Ut,Mt),{singleton:!0});function bn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Yo=(t,e)=>typeof t=="function"?bn(t(e)):e&&bn(t),Zo=Y(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:u,propsReady:d},{log:f},{scrollingInProgress:S},{context:h},{scrollIntoView:m}])=>{const v=y(!1),R=$();let g=null;function T(w){j(i,{align:"end",behavior:w,index:"LAST"})}X(I(mt(I(G(e),$t(1)),u),D(G(v),s,l,S),k(([[w,B],_,c,p,b])=>{let O=B&&p,L="auto";return O&&(L=Yo(_,c||b),O=O&&L!==!1),{followOutputBehavior:L,shouldFollow:O,totalCount:w}}),P(({shouldFollow:w})=>w)),({followOutputBehavior:w,totalCount:B})=>{g!==null&&(g(),g=null),tt(n)===void 0?g=Ht(t,()=>{tt(f)("following output to ",{totalCount:B},pt.DEBUG),T(w),g=null}):requestAnimationFrame(()=>{tt(f)("following output to ",{totalCount:B},pt.DEBUG),T(w)})});function a(w){const B=Ht(r,_=>{w&&!_.atBottom&&_.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(tt(f)("scrolling to bottom due to increased size",{},pt.DEBUG),T("auto"))});setTimeout(B,100)}X(I(mt(G(v),e,d),P(([w,,B])=>w!==!1&&B),Et(({value:w},[,B])=>({refreshed:w===B,value:B}),{refreshed:!1,value:0}),P(({refreshed:w})=>w),D(v,e)),([,w])=>{tt(l)&&a(w!==!1)}),X(R,()=>{a(tt(v)!==!1)}),X(mt(G(v),r),([w,B])=>{w!==!1&&!B.atBottom&&B.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&T("auto")});const C=y(null),x=$();return z(ve(I(G(o),k(w=>w?.length??0)),I(G(e))),x),X(I(mt(I(x,$t(1)),u),D(G(C),l,S,h),k(([[w,B],_,c,p,b])=>B&&c&&_?.({context:b,totalCount:w,scrollingInProgress:p})),P(w=>!!w),Pt(0)),w=>{g!==null&&(g(),g=null),tt(n)===void 0?g=Ht(t,()=>{tt(f)("scrolling into view",{}),j(m,w),g=null}):requestAnimationFrame(()=>{tt(f)("scrolling into view",{}),j(m,w)})}),{autoscrollToBottom:R,followOutput:v,scrollIntoViewOnChange:C}},st(zt,de,ue,ae,At,Mt,It,to,eo)),Xo=Y(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(z(I(l,D(s),P(([,u])=>u!==0),D(r,o,e,n,t),k(([[,u],d,f,S,h,m])=>Jn(u,d,f,S,h,m))),i),{}),st(zt,ae,Ut,At),{singleton:!0}),Jo=Y(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=y(0);return X(I(t,D(o),P(([,r])=>r!==0),k(([,r])=>({top:r}))),r=>{Ht(I(n,$t(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{j(e,r)})})}),{initialScrollTop:o}},st(At,It,Ut),{singleton:!0}),no=Y(([{scrollVelocity:t}])=>{const e=y(!1),n=$(),o=y(!1);return z(I(t,D(o,e,n),P(([r,s])=>s!==!1&&s!==void 0),k(([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}),ot()),e),X(I(mt(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}},st(de),{singleton:!0}),Ye=Y(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=y(!1),i=y(void 0);return z(I(mt(n,o),k(([{scrollTop:l,viewportHeight:u},{offsetTop:d,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,l-d),viewportHeight:u}))),t),z(I(e,D(o),k(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},st(It)),Qo=Y(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:u}])=>{const d=$(),f=y(void 0),S=y(null),h=y(null);return z(l,S),z(u,h),X(I(d,D(e,o,i,S,h,n)),([m,v,R,g,T,a,C])=>{const x=Po(v.sizeTree);g&&T!==null&&a!==null&&(R=T.scrollTop-a.offsetTop),R-=C,m({ranges:x,scrollTop:R})}),z(I(f,P(Ae),k(tr)),r),z(I(s,D(f),P(([,m])=>m!==void 0),ot(),k(([,m])=>m.ranges)),t),{getState:d,restoreStateFrom:f}},st(zt,It,ae,At,Ye));function tr(t){return{align:"start",index:0,offset:t.scrollTop}}const er=Y(([{topItemsIndexes:t}])=>{const e=y(0);return z(I(e,P(n=>n>=0),k(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},st(Ut));function oo(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const nr=oo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),or=Y(([{deviation:t,deviationCommitted:e,scrollBy:n,scrollingInProgress:o,scrollTop:r},{isAtBottom:s,isScrolling:i,lastJumpDueToItemResize:l,scrollDirection:u},{listState:d},{beforeUnshiftWith:f,gap:S,shiftWithOffset:h,sizes:m},{log:v},{recalcInProgress:R}])=>{const g=yt(I(d,D(l),Et(([,x,w,B],[{bottom:_,items:c,offsetBottom:p,totalCount:b},O])=>{const L=_+p;let F=0;return w===b&&x.length>0&&c.length>0&&(c[0].originalIndex===0&&x[0].originalIndex===0||(F=L-B,F!==0&&(F+=O))),[F,c,b,L]},[0,[],0,0]),P(([x])=>x!==0),D(r,u,o,s,v,R),P(([,x,w,B,,,_])=>!_&&!B&&x!==0&&w===ie),k(([[x],,,,,w])=>(w("Upward scrolling compensation",{amount:x},pt.DEBUG),x))));function T(x){x>0?(j(n,{behavior:"auto",top:-x}),j(t,0)):(j(t,0),j(n,{behavior:"auto",top:-x}))}X(I(g,D(t,i)),([x,w,B])=>{B&&nr()?j(t,w-x):T(-x)}),X(I(mt(gt(i,!1),t,R),P(([x,w,B])=>!x&&!B&&w!==0),k(([x,w])=>w),Pt(1)),T),z(I(h,k(x=>({top:-x}))),n);let a=null;function C(){if(a===null)return;const{offset:x}=a;a=null,j(n,{top:x}),requestAnimationFrame(()=>{j(t,0),j(R,!1)})}return X(e,x=>{a===null||!a.acknowledgeable||x===a.offset&&C()}),X(I(f,D(m,S),k(([x,{groupIndices:w,lastSize:B,sizeTree:_},c])=>{function p(M){return M*(B+c)}if(w.length===0)return p(x);let b=0;const O=re(_,0);let L=0,F=0;for(;L<x;){L++,b+=O;let M=w.length===F+1?1/0:w[F+1]-w[F]-1;L+M>x&&(b-=O,M=x-L+1),L+=M,b+=p(M),F++}return b})),x=>{a={acknowledgeable:tt(t)!==x,offset:x},j(t,x),requestAnimationFrame(C)}),{deviation:t}},st(It,de,Ut,zt,Mt,De)),rr=Y(([t,e,n,o,r,s,i,l,u,d,f])=>({...t,...e,...n,...o,...r,...s,...i,...l,...u,...d,...f}),st(qe,Xo,At,no,Qn,Jo,Ko,Ye,eo,Mt,to)),ro=Y(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:u,sizeRanges:d,sizes:f,statefulTotalCount:S,totalCount:h,trackItemSizes:m},{initialItemFinalLocationReached:v,initialTopMostItemIndex:R,scrolledToInitialItem:g},T,a,C,x,{scrollToIndex:w},B,{topItemCount:_},{groupCounts:c},p])=>{const{listState:b,minOverscanItemCount:O,topItemsIndexes:L,rangeChanged:F,...M}=x;return z(F,p.scrollSeekRangeChanged),z(I(mt(p.windowViewportRect,T.headerHeight,T.fixedHeaderHeight),k(([Z,W,ft])=>Math.max(W+ft+1,Z.visibleHeight))),T.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:c,heightEstimates:l,initialItemFinalLocationReached:v,initialTopMostItemIndex:R,scrolledToInitialItem:g,sizeRanges:d,topItemCount:_,topItemsIndexes:L,totalCount:h,...C,groupIndices:i,itemSize:u,listState:b,minOverscanItemCount:O,scrollToIndex:w,statefulTotalCount:S,trackItemSizes:m,rangeChanged:F,...M,...p,...T,sizes:f,...a}},st(zt,ae,It,Qo,Zo,Ut,ue,or,er,Yn,rr));function sr(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"?H.useEffect:H.useLayoutEffect;function Ze(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=H.createContext({});function u(T,a){T.propsReady!==void 0&&j(T.propsReady,!1);for(const C of o){const x=T[e.required[C]];j(x,a[C])}for(const C of r)if(C in a){const x=T[e.optional[C]];j(x,a[C])}T.propsReady!==void 0&&j(T.propsReady,!0)}function d(T){return s.reduce((a,C)=>(a[C]=x=>{const w=T[e.methods[C]];j(w,x)},a),{})}function f(T){return i.reduce((a,C)=>(a[C]=To(T[e.events[C]]),a),{})}const S=H.forwardRef(function(a,C){const{children:x,...w}=a,[B]=H.useState(()=>ye(yo(t),p=>{u(p,w)})),[_]=H.useState(mn(f,B));ge(()=>{for(const p of i)p in w&&X(_[p],w[p]);return()=>{Object.values(_).map(je)}},[w,_,B]),ge(()=>{u(B,w)}),H.useImperativeHandle(C,fn(d(B)));const c=n;return V.jsx(l.Provider,{value:B,children:n===void 0?x:V.jsx(c,{...sr([...o,...r,...i],w),children:x})})}),h=T=>{const a=H.useContext(l);return H.useCallback(C=>{j(a[T],C)},[a,T])},m=T=>{const C=H.useContext(l)[T],x=H.useCallback(w=>X(C,w),[C]);return H.useSyncExternalStore(x,()=>tt(C),()=>tt(C))},v=T=>{const C=H.useContext(l)[T],[x,w]=H.useState(mn(tt,C));return ge(()=>X(C,B=>{B!==x&&w(fn(B))}),[C,x]),x},R=parseInt(H.version,10)>=18?m:v;return{Component:S,useEmitter:(T,a)=>{const x=H.useContext(l)[T];ge(()=>X(x,a),[a,x])},useEmitterValue:R,usePublisher:h}}const fe=H.createContext(void 0),Xe=H.createContext(void 0),Oe="-webkit-sticky",Rn="sticky",Je=oo(()=>{if(typeof document>"u")return Rn;const t=document.createElement("div");return t.style.position=Oe,t.style.position===Oe?Oe:Rn});function Le(t){return"self"in t}function ir(t){return"body"in t}function so(t,e,n,o=Jt,r,s){const i=H.useRef(null),l=H.useRef(null),u=H.useRef(null),d=H.useCallback(h=>{let m,v,R;const g=h.target;if(ir(g)||Le(g)){const a=Le(g)?g:g.defaultView;R=s===!0?_t(a,a.scrollX):a.scrollY,m=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,v=s===!0?a.innerWidth:a.innerHeight}else R=s===!0?_t(g,g.scrollLeft):g.scrollTop,m=s===!0?g.scrollWidth:g.scrollHeight,v=s===!0?g.offsetWidth:g.offsetHeight;const T=()=>{t({scrollHeight:m,scrollTop:Math.max(R,0),viewportHeight:v})};h.suppressFlushSync===!0?T():ho.flushSync(T),l.current!==null&&(R===l.current||R<=0||R===m-v)&&(l.current=null,e(!0),u.current&&(clearTimeout(u.current),u.current=null))},[t,e,s]);H.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 f(h){const m=i.current;if(!m||(s===!0?"offsetWidth"in m&&m.offsetWidth===0:"offsetHeight"in m&&m.offsetHeight===0))return;const v=h.behavior==="smooth";let R,g,T;Le(m)?(g=Math.max(Bt(m.document.documentElement,s===!0?"width":"height"),s===!0?m.document.documentElement.scrollWidth:m.document.documentElement.scrollHeight),R=s===!0?m.innerWidth:m.innerHeight,T=s===!0?_t(m,m.scrollX):m.scrollY):(g=m[s===!0?"scrollWidth":"scrollHeight"],R=Bt(m,s===!0?"width":"height"),T=s===!0?_t(m,m.scrollLeft):m.scrollTop);const a=g-R;if(h.top===void 0){m.scrollTo(h);return}const C=Math.ceil(Math.max(Math.min(a,h.top),0));if(h.top=C,Xn(R,g)||C===T){t({scrollHeight:g,scrollTop:T,viewportHeight:R}),v&&e(!0);return}v?(l.current=C,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(h={...h.behavior===void 0?{}:{behavior:h.behavior},left:hn(m,C)}),m.scrollTo(h)}return{scrollByCallback:H.useCallback(h=>{s===!0&&(h={...h.behavior===void 0?{}:{behavior:h.behavior},...h.top===void 0?{}:{left:hn(i.current,h.top)}}),i.current.scrollBy(h)},[s]),scrollerRef:i,scrollToCallback:f}}function Qe(t){return t}const lr=Y(()=>{const t=y(l=>`Item ${l}`),e=y(l=>`Group ${l}`),n=y({}),o=y(Qe),r=y("div"),s=y(Jt),i=(l,u=null)=>gt(I(n,k(d=>d[l]),ot()),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")}}),cr=Y(([t,e])=>({...t,...e}),st(ro,lr)),ur=({height:t})=>V.jsx("div",{style:{height:t}}),ar={overflowAnchor:"none",position:Je(),zIndex:1},io={overflowAnchor:"none"},dr={...io,display:"inline-block",height:"100%"},En=H.memo(function({showTopList:e=!1}){const n=A("listState"),o=wt("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=wt("windowScrollContainerState"),l=wt("scrollContainerState"),u=s||r?i:l,d=A("itemContent"),f=A("context"),S=A("groupContent"),h=A("trackItemSizes"),m=A("itemSize"),v=A("log"),R=wt("gap"),g=A("horizontalDirection"),{callbackRef:T}=Mn(o,m,h,e?Jt:u,v,R,s,g,A("skipAnimationFrameInResizeObserver")),[a,C]=H.useState(0);on("deviation",W=>{a!==W&&C(W)});const x=wt("deviationCommitted");be(()=>{x(a)},[a,x]);const w=A("EmptyPlaceholder"),B=A("ScrollSeekPlaceholder")??ur,_=A("ListComponent"),c=A("ItemComponent"),p=A("GroupComponent"),b=A("computeItemKey"),O=A("isSeeking"),L=A("groupIndices").length>0,F=A("alignToBottom"),M=A("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginInlineStart:a===0?F?"auto":0:a,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:a===0?F?"auto":0:a,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...M?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&w!==null&&w!==void 0?V.jsx(w,{...rt(w,f)}):V.jsx(_,{...rt(_,f),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:T,style:Z,children:(e?n.topItems:n.items).map(W=>{const ft=W.originalIndex,U=b(ft+n.firstItemIndex,W.data,f);return O?H.createElement(B,{...rt(B,f),height:W.size,index:W.index,key:U,type:W.type||"item",...W.type==="group"?{}:{groupIndex:W.groupIndex}}):W.type==="group"?H.createElement(p,{...rt(p,f),"data-index":ft,"data-item-index":W.index,"data-known-size":W.size,key:U,style:ar},S(W.index,f)):H.createElement(c,{...rt(c,f),...lo(c,W.data),"data-index":ft,"data-item-group-index":W.groupIndex,"data-item-index":W.index,"data-known-size":W.size,key:U,style:g?dr:io},L?d(W.index,W.groupIndex,W.data,f):d(W.index,W.data,f))})})}),fr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mr={outline:"none",overflowX:"auto",position:"relative"},Ee=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),tn=(t,e,n=0)=>({...Ee(t),position:e?"relative":"absolute",top:e?-n:0}),pr={position:Je(),top:0,width:"100%",zIndex:1};function rt(t,e){if(typeof t!="string")return{context:e}}function lo(t,e){return{item:typeof t=="string"?void 0:e}}const hr=H.memo(function(){const e=A("HeaderComponent"),n=wt("headerHeight"),o=A("HeaderFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),gr=H.memo(function(){const e=A("FooterComponent"),n=wt("footerHeight"),o=A("HeaderFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null});function en({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...u}){const d=n("scrollContainerState"),f=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("scrollerRef"),m=e("horizontalDirection")||!1,{scrollByCallback:v,scrollerRef:R,scrollToCallback:g}=so(d,S,f,h,void 0,m);t("scrollTo",g),t("scrollBy",v);const T=m?mr:fr;return V.jsx(f,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:R,style:{...T,...i},tabIndex:0,...u,...rt(f,l),children:s})})}function nn({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...u}){const d=n("windowScrollContainerState"),f=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("totalListHeight"),m=e("deviation"),v=e("customScrollParent"),R=H.useRef(null),g=e("scrollerRef"),{scrollByCallback:T,scrollerRef:a,scrollToCallback:C}=so(d,S,f,g,v);return be(()=>(a.current=v??R.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,v]),t("windowScrollTo",C),t("scrollBy",T),V.jsx(f,{ref:R,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h===0?void 0:{height:h+m}},...u,...rt(f,l),children:s})})}const xr=({children:t})=>{const e=H.useContext(fe),n=wt("viewportHeight"),o=wt("fixedItemHeight"),r=A("alignToBottom"),s=A("horizontalDirection"),i=H.useMemo(()=>ne(n,u=>Bt(u,s?"width":"height")),[n,s]),l=Lt(i,!0,A("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:Ee(r),children:t})},Ir=({children:t})=>{const e=H.useContext(fe),n=wt("windowViewportRect"),o=wt("fixedItemHeight"),r=A("customScrollParent"),s=A("useWindowScroll"),i=A("topListHeight"),l=Ne(n,r,A("skipAnimationFrameInResizeObserver")),u=A("alignToBottom");return H.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:l,style:tn(u,s,i),children:t})},Sr=({children:t})=>{const e=A("TopItemListComponent")??"div",n=A("headerHeight"),o={...pr,marginTop:`${n}px`},r=A("context");return V.jsx(e,{style:o,...rt(e,r),children:t})},vr=H.memo(function(e){const n=A("useWindowScroll"),o=A("topItemsIndexes").length>0,r=A("customScrollParent"),s=A("context"),i=r||n?Cr:Tr,l=r||n?Ir:xr;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(Sr,{children:V.jsx(En,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(hr,{}),V.jsx(En,{}),V.jsx(gr,{})]})]})}),{Component:co,useEmitter:on,useEmitterValue:A,usePublisher:wt}=Ze(cr,{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"}},vr),Tr=en({useEmitter:on,useEmitterValue:A,usePublisher:wt}),Cr=nn({useEmitter:on,useEmitterValue:A,usePublisher:wt}),wr=co,yr=co,br=Y(()=>{const t=y(d=>V.jsxs("td",{children:["Item $",d]})),e=y(null),n=y(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=y(null),r=y(null),s=y({}),i=y(Qe),l=y(Jt),u=(d,f=null)=>gt(I(s,k(S=>S[d]),ot()),f);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")}}),Rr=Y(([t,e])=>({...t,...e}),st(ro,br)),Er=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),Hr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),kr={overflowAnchor:"none"},Hn={position:Je(),zIndex:2,overflowAnchor:"none"},kn=H.memo(function({showTopList:e=!1}){const n=N("listState"),o=N("computeItemKey"),r=N("firstItemIndex"),s=N("context"),i=N("isSeeking"),l=N("fixedHeaderHeight"),u=N("groupIndices").length>0,d=N("itemContent"),f=N("groupContent"),S=N("ScrollSeekPlaceholder")??Er,h=N("GroupComponent"),m=N("TableRowComponent"),v=(e?n.topItems:[]).reduce((g,T,a)=>(a===0?g.push(T.size):g.push(g[a-1]+T.size),g),[]);return(e?n.topItems:n.items).map(g=>{const T=g.originalIndex,a=o(T+r,g.data,s),C=e?T===0?0:v[T-1]:0;return i?H.createElement(S,{...rt(S,s),height:g.size,index:g.index,key:a,type:g.type||"item"}):g.type==="group"?H.createElement(h,{...rt(h,s),"data-index":T,"data-item-index":g.index,"data-known-size":g.size,key:a,style:{...Hn,top:l}},f(g.index,s)):H.createElement(m,{...rt(m,s),...lo(m,g.data),"data-index":T,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:a,style:e?{...Hn,top:l+C}:kr},u?d(g.index,g.groupIndex,g.data,s):d(g.index,g.data,s))})}),Br=H.memo(function(){const e=N("listState"),n=N("topItemsIndexes").length>0,o=bt("sizeRanges"),r=N("useWindowScroll"),s=N("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),u=s||r?i:l,d=N("trackItemSizes"),f=N("itemSize"),S=N("log"),{callbackRef:h,ref:m}=Mn(o,f,d,u,S,void 0,s,!1,N("skipAnimationFrameInResizeObserver")),[v,R]=H.useState(0);rn("deviation",L=>{v!==L&&(m.current.style.marginTop=`${L}px`,R(L))});const g=bt("deviationCommitted");be(()=>{g(v)},[v,g]);const T=N("EmptyPlaceholder"),a=N("FillerRow")??Hr,C=N("TableBodyComponent"),x=N("paddingTopAddition"),w=N("statefulTotalCount"),B=N("context");if(w===0&&T!==null&&T!==void 0)return V.jsx(T,{...rt(T,B)});const _=(n?e.topItems:[]).reduce((L,F)=>L+F.size,0),c=e.offsetTop+x+v-_,p=e.offsetBottom,b=c>0?V.jsx(a,{context:B,height:c},"padding-top"):null,O=p>0?V.jsx(a,{context:B,height:p},"padding-bottom"):null;return V.jsxs(C,{"data-testid":"virtuoso-item-list",ref:h,...rt(C,B),children:[b,n&&V.jsx(kn,{showTopList:!0}),V.jsx(kn,{}),O]})}),Or=({children:t})=>{const e=H.useContext(fe),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=Lt(H.useMemo(()=>ne(n,s=>Bt(s,"height")),[n]),!0,N("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:Ee(!1),children:t})},Lr=({children:t})=>{const e=H.useContext(fe),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=N("customScrollParent"),s=N("useWindowScroll"),i=Ne(n,r,N("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:i,style:tn(!1,s),children:t})},zr=H.memo(function(e){const n=N("useWindowScroll"),o=N("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=N("fixedHeaderContent"),l=N("fixedFooterContent"),u=N("context"),d=Lt(H.useMemo(()=>ne(r,a=>Bt(a,"height")),[r]),!0,N("skipAnimationFrameInResizeObserver")),f=Lt(H.useMemo(()=>ne(s,a=>Bt(a,"height")),[s]),!0,N("skipAnimationFrameInResizeObserver")),S=o||n?Vr:Fr,h=o||n?Lr:Or,m=N("TableComponent"),v=N("TableHeadComponent"),R=N("TableFooterComponent"),g=i?V.jsx(v,{ref:d,style:{position:"sticky",top:0,zIndex:2},...rt(v,u),children:i()},"TableHead"):null,T=l?V.jsx(R,{ref:f,style:{bottom:0,position:"sticky",zIndex:1},...rt(R,u),children:l()},"TableFoot"):null;return V.jsx(S,{...e,...rt(S,u),children:V.jsx(h,{children:V.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...rt(m,u),children:[g,V.jsx(Br,{},"TableBody"),T]})})})}),{Component:uo,useEmitter:rn,useEmitterValue:N,usePublisher:bt}=Ze(Rr,{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",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},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"}},zr),Fr=en({useEmitter:rn,useEmitterValue:N,usePublisher:bt}),Vr=nn({useEmitter:rn,useEmitterValue:N,usePublisher:bt}),Pr=uo,Wr=uo,Bn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Gr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:On,floor:Ce,max:ee,min:ze,round:Ln}=Math;function zn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Mr(t){return{...Gr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function Ar(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const jr=Y(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:u,scrollTop:d,smoothScrollTargetReached:f,viewportHeight:S},h,m,{didMount:v,propsReady:R},{customScrollParent:g,useWindowScroll:T,windowScrollContainerState:a,windowScrollTo:C,windowViewportRect:x},w])=>{const B=y(0),_=y(0),c=y(Bn),p=y({height:0,width:0}),b=y({height:0,width:0}),O=$(),L=$(),F=y(0),M=y(null),Z=y({column:0,row:0}),W=$(),ft=$(),U=y(!1),ct=y(0),ut=y(!0),xt=y(!1),Ft=y(!1);X(I(v,D(ct),P(([E,K])=>!Ge(K))),()=>{j(ut,!1)}),X(I(mt(v,ut,b,p,ct,xt),P(([E,K,q,Q,,at])=>E&&!K&&q.height!==0&&Q.height!==0&&!at)),([,,,,E])=>{if(E===void 0){j(ut,!0);return}j(xt,!0),Ue(1,()=>{j(O,E)}),Ht(I(d),()=>{j(e,[0,0]),j(ut,!0)})}),z(I(ft,P(E=>E!=null&&E.scrollTop>0),Ct(0)),_),X(I(v,D(ft),P(([,E])=>E!=null)),([,E])=>{E&&(j(p,E.viewport),j(b,E.item),j(Z,E.gap),E.scrollTop>0&&(j(U,!0),Ht(I(d,$t(1)),K=>{j(U,!1)}),j(u,{top:E.scrollTop})))}),z(I(p,k(({height:E})=>E)),S),z(I(mt(G(p,xe),G(b,xe),G(Z,(E,K)=>E!==void 0&&E.column===K.column&&E.row===K.row),G(d)),k(([E,K,q,Q])=>({gap:q,item:K,scrollTop:Q,viewport:E}))),W),z(I(mt(G(B),o,G(Z,Ar),G(b,xe),G(p,xe),G(M),G(_),G(U),G(ut),G(ct)),P(([,,,,,,,E])=>!E),k(([E,[K,q],Q,at,it,et,dt,,Tt,lt])=>{const{column:Wt,row:Qt}=Q,{height:pe,width:He}=at,{width:sn}=it;if(dt===0&&(E===0||sn===0))return Bn;if(He===0){const dn=Ke(lt,E),po=dn+Math.max(dt-1,0);return Mr(zn(dn,po,et))}const he=ao(sn,He,Wt);let qt,jt;Tt?K===0&&q===0&&dt>0?(qt=0,jt=dt-1):(qt=he*Ce((K+Qt)/(pe+Qt)),jt=he*On((q+Qt)/(pe+Qt))-1,jt=ze(E-1,ee(jt,he-1)),qt=ze(jt,ee(0,qt))):(qt=0,jt=-1);const ln=zn(qt,jt,et),{bottom:cn,top:un}=Fn(it,Q,at,ln),an=On(E/he),mo=an*pe+(an-1)*Qt-cn;return{bottom:cn,itemHeight:pe,items:ln,itemWidth:He,offsetBottom:mo,offsetTop:un,top:un}})),c),z(I(M,P(E=>E!==null),k(E=>E.length)),B),z(I(mt(p,b,c,Z),P(([E,K,{items:q}])=>q.length>0&&K.height!==0&&E.height!==0),k(([E,K,{items:q},Q])=>{const{bottom:at,top:it}=Fn(E,Q,K,q);return[it,at]}),ot(Zt)),e);const vt=y(!1);z(I(d,D(vt),k(([E,K])=>K||E!==0)),vt);const Ot=yt(I(mt(c,B),P(([{items:E},K])=>{const q=tt(M);return E.length>0&&(q===null||q.length===K)}),D(vt),P(([[E,K],q])=>{const at=E.items[E.items.length-1].index===K-1;return(q||E.bottom>0&&E.itemHeight>0&&E.offsetBottom===0&&E.items.length===K)&&at}),k(([[,E]])=>[E-1,tt(M)]),ot(Zt),k(([E])=>E))),me=yt(I(G(c),P(({items:E})=>E.length>0&&E[0].index===0),Ct(0),ot())),Kt=yt(I(G(c),D(U),P(([{items:E},K])=>E.length>0&&!K),k(([{items:E}])=>({endIndex:E[E.length-1].index,startIndex:E[0].index})),ot($n),Pt(0)));z(Kt,m.scrollSeekRangeChanged),z(I(O,D(p,b,B,Z),k(([E,K,q,Q,at])=>{const it=Zn(E),{align:et,behavior:dt,offset:Tt}=it;let lt=it.index;lt==="LAST"&&(lt=Q-1),lt=ee(0,lt,ze(Q-1,lt));let Wt=Me(K,at,q,lt);return et==="end"?Wt=Ln(Wt-K.height+q.height):et==="center"&&(Wt=Ln(Wt-K.height/2+q.height/2)),Tt!==void 0&&Tt!==0&&(Wt+=Tt),{behavior:dt,top:Wt}})),u);const Vt=gt(I(c,k(E=>E.offsetBottom+E.bottom)),0);return z(I(x,k(E=>({height:E.visibleHeight,width:E.visibleWidth}))),p),{customScrollParent:g,data:M,deviation:F,footerHeight:r,gap:Z,headerHeight:s,increaseViewportBy:t,initialItemCount:_,itemDimensions:b,overscan:n,restoreStateFrom:ft,scrollBy:i,scrollContainerState:l,scrollHeight:L,scrollTo:u,scrollToIndex:O,scrollTop:d,smoothScrollTargetReached:f,totalCount:B,useWindowScroll:T,viewportDimensions:p,windowScrollContainerState:a,windowScrollTo:C,windowViewportRect:x,...m,gridState:c,horizontalDirection:Ft,initialTopMostItemIndex:ct,totalListHeight:Vt,...h,endReached:Ot,propsReady:R,rangeChanged:Kt,startReached:me,stateChanged:W,stateRestoreInProgress:U,...w}},st(qe,It,de,no,At,Ye,Mt));function ao(t,e,n){return ee(1,Ce((t+n)/(Ce(e)+n)))}function Fn(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Me(t,e,n,o[0].index);return{bottom:Me(t,e,n,o[o.length-1].index)+r,top:s}}function Me(t,e,n,o){const r=ao(t.width,n.width,e.column),s=Ce(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const _r=Y(()=>{const t=y(S=>`Item ${S}`),e=y({}),n=y(null),o=y("virtuoso-grid-item"),r=y("virtuoso-grid-list"),s=y(Qe),i=y("div"),l=y(Jt),u=(S,h=null)=>gt(I(e,k(m=>m[S]),ot()),h),d=y(!1),f=y(!1);return z(G(f),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:f,ScrollerComponent:u("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),Nr=Y(([t,e])=>({...t,...e}),st(jr,_r)),Dr=H.memo(function(){const e=nt("gridState"),n=nt("listClassName"),o=nt("itemClassName"),r=nt("itemContent"),s=nt("computeItemKey"),i=nt("isSeeking"),l=Rt("scrollHeight"),u=nt("ItemComponent"),d=nt("ListComponent"),f=nt("ScrollSeekPlaceholder"),S=nt("context"),h=Rt("itemDimensions"),m=Rt("gap"),v=nt("log"),R=nt("stateRestoreInProgress"),g=Rt("reportReadyState"),T=Lt(H.useMemo(()=>a=>{const C=a.parentElement.parentElement.scrollHeight;l(C);const x=a.firstChild;if(x!==null){const{height:w,width:B}=x.getBoundingClientRect();h({height:w,width:B})}m({column:Vn("column-gap",getComputedStyle(a).columnGap,v),row:Vn("row-gap",getComputedStyle(a).rowGap,v)})},[l,h,m,v]),!0,!1);return be(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),R?null:V.jsx(d,{className:n,ref:T,...rt(d,S),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const C=s(a.index,a.data,S);return i?V.jsx(f,{...rt(f,S),height:e.itemHeight,index:a.index,width:e.itemWidth},C):H.createElement(u,{...rt(u,S),className:o,"data-index":a.index,key:C},r(a.index,a.data,S))})})}),$r=H.memo(function(){const e=nt("HeaderComponent"),n=Rt("headerHeight"),o=nt("headerFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,!1),s=nt("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),Ur=H.memo(function(){const e=nt("FooterComponent"),n=Rt("footerHeight"),o=nt("headerFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,!1),s=nt("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),Kr=({children:t})=>{const e=H.useContext(Xe),n=Rt("itemDimensions"),o=Rt("viewportDimensions"),r=Lt(H.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return H.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:Ee(!1),children:t})},qr=({children:t})=>{const e=H.useContext(Xe),n=Rt("windowViewportRect"),o=Rt("itemDimensions"),r=nt("customScrollParent"),s=nt("useWindowScroll"),i=Ne(n,r,!1);return H.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:i,style:tn(!1,s),children:t})},Yr=H.memo(function({...e}){const n=nt("useWindowScroll"),o=nt("customScrollParent"),r=o||n?Jr:Xr,s=o||n?qr:Kr,i=nt("context");return V.jsx(r,{...e,...rt(r,i),children:V.jsxs(s,{children:[V.jsx($r,{}),V.jsx(Dr,{}),V.jsx(Ur,{})]})})}),{Component:Zr,useEmitter:fo,useEmitterValue:nt,usePublisher:Rt}=Ze(Nr,{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"}},Yr),Xr=en({useEmitter:fo,useEmitterValue:nt,usePublisher:Rt}),Jr=nn({useEmitter:fo,useEmitterValue:nt,usePublisher:Rt});function Vn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,pt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Qr=Zr;exports.GroupedTableVirtuoso=Wr;exports.GroupedVirtuoso=yr;exports.LogLevel=pt;exports.TableVirtuoso=Pr;exports.Virtuoso=wr;exports.VirtuosoGrid=Qr;exports.VirtuosoGridMockContext=Xe;exports.VirtuosoMockContext=fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),H=require("react"),ho=require("react-dom"),we=0,Gt=1,Xt=2,Pn=4;function fn(t){return()=>t}function go(t){t()}function ne(t,e){return n=>t(e(n))}function mn(t,e){return()=>t(e)}function xo(t,e){return n=>t(e,n)}function Ae(t){return t!==void 0}function Io(...t){return()=>{t.map(go)}}function Jt(){}function ye(t,e){return e(t),t}function So(t,e){return e(t)}function st(...t){return t}function X(t,e){return t(Gt,e)}function j(t,e){t(we,e)}function je(t){t(Xt)}function tt(t){return t(Pn)}function z(t,e){return X(t,xo(e,we))}function Ht(t,e){const n=t(Gt,o=>{n(),e(o)});return n}function pn(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Wn(t,e){return t===e}function ot(t=Wn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function k(t){return e=>ne(e,t)}function Ct(t){return e=>()=>{e(t)}}function I(t,...e){const n=vo(...e);return((o,r)=>{switch(o){case Xt:je(t);return;case Gt:return X(t,n(r))}})}function Et(t,e){return n=>o=>{n(e=t(e,o))}}function $t(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=Array.from({length:t.length});let n=0,o=null;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;X(s,u=>{const d=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 vo(...t){return e=>t.reduceRight(So,e)}function To(t){let e,n;const o=()=>e?.();return function(r,s){switch(r){case Gt:return s?n===s?void 0:(o(),n=s,e=X(t,s),e):(o(),Jt);case Xt:o(),n=null;return}}}function y(t){let e=t;const n=$();return((o,r)=>{switch(o){case we:e=r;break;case Gt:{r(e);break}case Pn:return e}return n(o,r)})}function gt(t,e){return ye(y(e),n=>z(t,n))}function $(){const t=[];return((e,n)=>{switch(e){case we:t.slice().forEach(o=>{o(n)});return;case Xt:t.splice(0);return;case Gt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}})}function yt(t){return ye($(),e=>z(t,e))}const Co={singleton:!0};function Y(t,e=[],n=Co){const{singleton:o}=n;return{constructor:t,dependencies:e,id:wo(),singleton:o}}const wo=()=>Symbol("id");function yo(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 mt(...t){const e=$(),n=Array.from({length:t.length});let o=0;const r=2**t.length-1;return t.forEach((s,i)=>{const l=2**i;X(s,u=>{n[i]=u,o|=l,o===r&&j(e,n)})}),function(s,i){switch(s){case Xt:{je(e);return}case Gt:return o===r&&i(n),X(e,i)}}}function G(t,e=Wn){return I(t,ot(e))}function ve(...t){return function(e,n){switch(e){case Xt:return;case Gt:return Io(...t.map(o=>X(o,n)))}}}const pt={DEBUG:0,INFO:1,WARN:2,ERROR:3},bo={[pt.DEBUG]:"debug",[pt.ERROR]:"error",[pt.INFO]:"log",[pt.WARN]:"warn"},Ro=()=>typeof globalThis>"u"?window:globalThis,Mt=Y(()=>{const t=y(pt.ERROR);return{log:y((n,o,r=pt.INFO)=>{const s=Ro().VIRTUOSO_LOG_LEVEL??tt(t);r>=s&&console[bo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Eo(t){return"self"in t?t.document.documentElement:t}function Gn(t){const e=Eo(t);return e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl"}function _t(t,e){return Gn(t)?-e:e}function hn(t,e){return Gn(t)?-e:e}function Lt(t,e,n){return _e(t,e,n).callbackRef}function _e(t,e,n){const o=H.useRef(null);let r=i=>{};const s=H.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?.observe(i),o.current=i):(o.current&&s?.unobserve(o.current),o.current=null)},{callbackRef:r,ref:o}}function Mn(t,e,n,o,r,s,i,l,u){const d=H.useCallback(f=>{const S=Ho(f.children,e,l?"offsetWidth":"offsetHeight",r);let h=f.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const m=h.lastElementChild?.dataset.viewportType==="window";let v;m&&(v=h.ownerDocument.defaultView);const R=i?l?i.scrollWidth:i.scrollHeight:m?l?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,g=i?l?i.offsetWidth:i.offsetHeight:m?l?v.innerWidth:v.innerHeight:l?h.offsetWidth:h.offsetHeight,T=i?l?_t(i,i.scrollLeft):i.scrollTop:m?l?_t(v,v.scrollX||v.document.documentElement.scrollLeft):v.scrollY||v.document.documentElement.scrollTop:l?_t(h,h.scrollLeft):h.scrollTop;o({scrollHeight:R,scrollTop:Math.max(T,0),viewportHeight:g}),s?.(l?gn("column-gap",getComputedStyle(f).columnGap,r):gn("row-gap",getComputedStyle(f).rowGap,r)),S!==null&&t(S)},[t,e,r,s,i,o,l]);return _e(d,n,u)}function Ho(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,10),d=parseFloat(l.dataset.knownSize),f=e(l,n);if(f===0&&o("Zero-sized element, this should not happen",{child:l},pt.ERROR),f===d)continue;const S=s[s.length-1];s.length===0||S.size!==f||S.endIndex!==u-1?s.push({endIndex:u,size:f,startIndex:u}):s[s.length-1].endIndex++}return s}function gn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,pt.WARN),e==="normal"?0:parseInt(e??"0",10)}const be=typeof document>"u"?H.useEffect:H.useLayoutEffect;function Ne(t,e,n){const o=H.useRef(null),r=H.useCallback(u=>{if(!u?.offsetParent)return;const d=u.getBoundingClientRect(),f=d.width;let S,h;if(e){const m=e.getBoundingClientRect(),v=d.top-m.top;h=m.height-Math.max(0,v),S=v+e.scrollTop}else{const m=i.current.ownerDocument.defaultView;h=m.innerHeight-Math.max(0,d.top),S=d.top+m.scrollY}o.current={listHeight:d.height,offsetTop:S,visibleHeight:h,visibleWidth:f},t(o.current)},[t,e]),{callbackRef:s,ref:i}=_e(r,!0,n),l=H.useCallback(()=>{r(i.current)},[r,i]);return H.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 u=i.current?.ownerDocument.defaultView;return u?.addEventListener("scroll",l),u?.addEventListener("resize",l),()=>{u?.removeEventListener("scroll",l),u?.removeEventListener("resize",l)}},[l,e,i]),s}const It=Y(()=>{const t=$(),e=$(),n=y(0),o=$(),r=$(),s=y(0),i=$(),l=$(),u=y(0),d=y(0),f=y(0),S=y(0),h=$(),m=$(),v=y(!1),R=y(!1),g=y(!1);return z(I(t,k(({scrollTop:T})=>T)),e),z(I(t,k(({scrollHeight:T})=>T)),l),z(e,s),{deviation:n,deviationCommitted:o,fixedFooterHeight:f,fixedHeaderHeight:d,footerHeight:S,headerHeight:u,horizontalDirection:R,scrollBy:m,scrollContainerState:t,scrollHeight:l,scrollingInProgress:v,scrollTo:h,scrollTop:e,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:s,viewportHeight:i}},[],{singleton:!0}),oe={lvl:0};function An(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 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 kt(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=kt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return kt(t.l,e,n)}function St(t,e,n){return J(t)?Nn(e,n,1):e===t.k?ht(t,{k:e,v:n}):e<t.k?xn(ht(t,{l:St(t.l,e,n)})):xn(ht(t,{r:St(t.r,e,n)}))}function Nt(){return oe}function Yt(t,e,n){if(J(t))return[];const o=kt(t,e)[0];return ko(Ve(t,o,n))}function Fe(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]=_n(o);return Ie(ht(t,{k:s,l:jn(o),v:i}))}return e<n?Ie(ht(t,{l:Fe(o,e)})):Ie(ht(t,{r:Fe(r,e)}))}function Dt(t){return J(t)?[]:[...Dt(t.l),{k:t.k,v:t.v},...Dt(t.r)]}function Ve(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(Ve(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Ve(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(ke(e))return Dn(ht(t,{lvl:n-1}));if(!J(e)&&!J(e.r))return ht(e.r,{l:ht(e,{r:e.r.l}),lvl:n,r:ht(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(ke(t))return Pe(ht(t,{lvl:n-1}));if(!J(o)&&!J(o.l)){const r=o.l,s=ke(r)?o.lvl-1:o.lvl;return ht(r,{l:ht(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Pe(ht(o,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function ht(t,e){return Nn(e.k===void 0?t.k:e.k,e.v===void 0?t.v:e.v,e.lvl===void 0?t.lvl:e.lvl,e.l===void 0?t.l:e.l,e.r===void 0?t.r:e.r)}function jn(t){return J(t.r)?t.l:Ie(ht(t,{r:jn(t.r)}))}function ke(t){return J(t)||t.lvl>t.r.lvl}function _n(t){return J(t.r)?[t.k,t.v]:_n(t.r)}function Nn(t,e,n,o=oe,r=oe){return{k:t,l:o,lvl:n,r,v:e}}function xn(t){return Pe(Dn(t))}function Dn(t){const{l:e}=t;return!J(e)&&e.lvl===t.lvl?ht(e,{r:ht(t,{l:e.r})}):t}function Pe(t){const{lvl:e,r:n}=t;return!J(n)&&!J(n.r)&&n.lvl===e&&n.r.lvl===e?ht(n,{l:ht(t,{r:n.l}),lvl:e+1}):t}function ko(t){return An(t,({k:e,v:n})=>({index:e,value:n}))}function $n(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function Zt(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const De=Y(()=>({recalcInProgress:y(!1)}),[],{singleton:!0});function Un(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 Bo(t,e,n,o){const r=Te(t,e,o),s=Te(t,n,o,r);return t.slice(r,s+1)}function Bt(t,e){return Math.round(t.getBoundingClientRect()[e])}function Re(t){return!J(t.groupOffsetTree)}function $e({index:t},e){return e===t?0:e<t?-1:1}function In(){return{groupIndices:[],groupOffsetTree:Nt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Nt()}}function Oo(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=St(t,0,s);continue}const l=Yt(t,i-1,r+1);if(l.some(Go(o)))continue;let u=!1,d=!1;for(const{end:f,start:S,value:h}of l)u?(r>=S||s===h)&&(t=Fe(t,S)):(d=h!==s,u=!0),f>r&&r>=S&&h!==s&&(t=St(t,r+1,h));d&&(t=St(t,i,s))}return[t,n]}function Lo(t){return t.groupIndex!==void 0}function zo({offset:t},e){return e===t?0:e<t?-1:1}function se(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=Un(e,t,$e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function Kn(t,e){if(!Re(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function qn(t,e,n){if(Lo(t))return e.groupIndices[t.groupIndex]+1;const o=t.index==="LAST"?n:t.index;let r=Kn(o,e);return r=Math.max(0,Math.min(n,r)),r}function Fo(t,e,n,o=0){return o>0&&(e=Math.max(e,Un(t,o,$e).offset)),An(Bo(t,e,n,zo),Wo)}function Vo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,pt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&J(s)&&e.length===2){const h=e[0].size,m=e[1].size;i=n.reduce((v,R)=>St(St(v,R,h),R+1,m),i)}else[i,l]=Oo(i,e);if(i===s)return t;const{lastIndex:u,lastOffset:d,lastSize:f,offsetTree:S}=We(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,m)=>St(h,m,se(m,S,r)),Nt()),lastIndex:u,lastOffset:d,lastSize:f,offsetTree:S,sizeTree:i}}function Po(t){return Dt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s===void 0?1/0:s.k-1,size:n,startIndex:e}})}function Sn(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 We(t,e,n,o){let r=t,s=0,i=0,l=0,u=0;if(e===0)r=[];else{u=Te(r,e-1,$e),l=r[u].offset;const f=kt(n,e-1);s=f[0],i=f[1],r.length&&r[u].size===kt(n,e)[1]&&(u-=1),r=r.slice(0,u+1)}for(const{start:d,value:f}of Yt(n,e,1/0)){const S=d-s,h=S*i+l+S*o;r.push({index:d,offset:h,size:f}),s=d,l=h,i=f}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function Wo(t){return{index:t.index,value:t}}function Go(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 Mo={offsetHeight:"height",offsetWidth:"width"},zt=Y(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=gt(o,0),s=$(),i=$(),l=y(0),u=y([]),d=y(void 0),f=y(void 0),S=y(void 0),h=y(void 0),m=y((c,p)=>Bt(c,Mo[p])),v=y(void 0),R=y(0),g=In(),T=$(),a=gt(I(ve(n,T),D(u,t,R),Et((c,[p,...b])=>{if(p===null){const[O]=b;return{...In(),groupIndices:O,groupOffsetTree:O.reduce((L,F,M)=>St(L,F,M),Nt())}}return Vo(c,[p,...b])},g),ot()),g),C=gt(I(u,ot(),Et((c,p)=>({current:p,prev:c.current}),{current:[],prev:[]}),k(({prev:c})=>c)),[]);z(I(u,P(c=>c.length>0),D(a,R),k(([c,p,b])=>{const O=c.reduce((L,F,M)=>St(L,F,se(F,p.offsetTree,b)||M),Nt());return{...p,groupIndices:c,groupOffsetTree:O}})),a),z(I(o,D(a),P(([c,{lastIndex:p}])=>c<p),k(([c,{lastIndex:p,lastSize:b}])=>[{endIndex:p,size:b,startIndex:c}])),n),z(d,f);const x=gt(I(d,k(c=>c===void 0)),!0);z(I(f,P(c=>c!==void 0&&J(tt(a).sizeTree)),k(c=>{const p=tt(S),b=tt(u).length>0;return p!==void 0&&p!==0?b?[{endIndex:0,size:p,startIndex:0},{endIndex:1,size:c,startIndex:1}]:[]:[{endIndex:0,size:c,startIndex:0}]})),n),z(I(h,P(c=>c!==void 0&&c.length>0&&J(tt(a).sizeTree)),k(c=>{const p=[];let b=c[0],O=0;for(let L=1;L<c.length;L++){const F=c[L];F!==b&&(p.push({endIndex:L-1,size:b,startIndex:O}),b=F,O=L)}return p.push({endIndex:c.length-1,size:b,startIndex:O}),p})),n),z(I(u,D(S,f),P(([,c,p])=>c!==void 0&&p!==void 0),k(([c,p,b])=>{const O=[];for(let L=0;L<c.length;L++){const F=c[L],M=c[L+1];O.push({startIndex:F,endIndex:F,size:p}),M!==void 0&&O.push({startIndex:F+1,endIndex:M-1,size:b})}return O})),n);const w=yt(I(n,D(a),Et(({sizes:c},[p,b])=>({changed:b!==c,sizes:b}),{changed:!1,sizes:g}),k(c=>c.changed)));X(I(l,Et((c,p)=>({diff:c.prev-p,prev:p}),{diff:0,prev:0}),k(c=>c.diff)),c=>{const{groupIndices:p}=tt(a);if(c>0)j(e,!0),j(s,c+Sn(c,p));else if(c<0){const b=tt(C);b.length>0&&(c-=Sn(-c,b)),j(i,c)}}),X(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},pt.ERROR)});const B=yt(s);z(I(s,D(a),k(([c,p])=>{const b=p.groupIndices.length>0,O=[],L=p.lastSize;if(b){const F=re(p.sizeTree,0);let M=0,Z=0;for(;M<c;){const U=p.groupIndices[Z],lt=p.groupIndices.length===Z+1?1/0:p.groupIndices[Z+1]-U-1;O.push({endIndex:U,size:F,startIndex:U}),O.push({endIndex:U+1+lt-1,size:L,startIndex:U+1}),Z++,M+=lt+1}const W=Dt(p.sizeTree);return M!==c&&W.shift(),W.reduce((U,{k:lt,v:ct})=>{let xt=U.ranges;return U.prevSize!==0&&(xt=[...U.ranges,{endIndex:lt+c-1,size:U.prevSize,startIndex:U.prevIndex}]),{prevIndex:lt+c,prevSize:ct,ranges:xt}},{prevIndex:c,prevSize:0,ranges:O}).ranges}return Dt(p.sizeTree).reduce((F,{k:M,v:Z})=>({prevIndex:M+c,prevSize:Z,ranges:[...F.ranges,{endIndex:M+c-1,size:F.prevSize,startIndex:F.prevIndex}]}),{prevIndex:0,prevSize:L,ranges:[]}).ranges})),n);const _=yt(I(i,D(a,R),k(([c,{offsetTree:p},b])=>{const O=-c;return se(O,p,b)})));return z(I(i,D(a,R),k(([c,p,b])=>{if(p.groupIndices.length>0){if(J(p.sizeTree))return p;let F=Nt();const M=tt(C);let Z=0,W=0,ft=0;for(;Z<-c;){ft=M[W];const lt=M[W+1]-ft-1;W++,Z+=lt+1}if(F=Dt(p.sizeTree).reduce((lt,{k:ct,v:xt})=>St(lt,Math.max(0,ct+c),xt),F),Z!==-c){const lt=re(p.sizeTree,ft);F=St(F,0,lt);const ct=kt(p.sizeTree,-c+1)[1];F=St(F,1,ct)}return{...p,sizeTree:F,...We(p.offsetTree,0,F,b)}}const L=Dt(p.sizeTree).reduce((F,{k:M,v:Z})=>St(F,Math.max(0,M+c),Z),Nt());return{...p,sizeTree:L,...We(p.offsetTree,0,L,b)}})),a),{beforeUnshiftWith:B,data:v,defaultItemSize:f,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:S,gap:R,groupIndices:u,heightEstimates:h,itemSize:m,listRefresh:w,resetSizes:T,shiftWith:i,shiftWithOffset:_,sizeRanges:n,sizes:a,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:s}},st(Mt,De),{singleton:!0});function Ao(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Yn=Y(([{groupIndices:t,resetSizes:e,sizeRanges:n,sizes:o,statefulTotalCount:r,totalCount:s,trackItemSizes:i},{headerHeight:l,scrollTop:u}])=>{const d=$(),f=$(),S=yt(I(d,k(Ao))),h=gt(I(n,D(r,t),P(([,m,v])=>m>v.length),Ct(!0)),!1);return z(I(S,Et(([,m],v)=>[m,v],[{groupIndices:[],totalCount:0},{groupIndices:[],totalCount:0}]),D(o,i,h),P(([[m,v],{sizeTree:R},g,T])=>{const a=m.groupIndices.length>0&&m.totalCount===m.groupIndices.length,C=v.totalCount>v.groupIndices.length;return g&&!T&&a&&C&&!J(R)}),Ct(null)),e),z(I(S,k(m=>m.totalCount)),s),z(I(S,k(m=>m.groupIndices)),t),z(I(mt(u,o,l),P(([m,v])=>Re(v)),k(([m,v,R])=>kt(v.groupOffsetTree,Math.max(m-R,0),"v")[0]),ot(),k(m=>[m])),f),{groupCounts:d,topItemsIndexes:f}},st(zt,It)),At=Y(([{log:t}])=>{const e=y(!1),n=yt(I(e,P(o=>o),ot()));return X(e,o=>{o&&tt(t)("props updated",{},pt.DEBUG)}),{didMount:n,propsReady:e}},st(Mt),{singleton:!0}),jo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Zn(t){const e=typeof t=="number"?{index:t}:{...t};return e.align||(e.align="start"),(!e.behavior||!jo)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const ue=Y(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:u,scrollTo:d,smoothScrollTargetReached:f,viewportHeight:S},{log:h}])=>{const m=$(),v=$(),R=y(0);let g=null,T=null,a=null;function C(){g!==null&&(g(),g=null),a!==null&&(a(),a=null),T&&(clearTimeout(T),T=null),j(u,!1)}return z(I(m,D(n,S,o,R,l,i,h),D(t,s,r),k(([[x,w,B,_,c,p,b,O],L,F,M])=>{const Z=Zn(x),{align:W,behavior:ft,offset:U}=Z,lt=_-1,ct=qn(Z,w,lt);let xt=se(ct,w.offsetTree,L)+p;W==="end"?(xt+=F+kt(w.sizeTree,ct)[1]-B+M,ct===lt&&(xt+=b)):W==="center"?xt+=(F+kt(w.sizeTree,ct)[1]-B+M)/2:xt-=c,U!==void 0&&U!==0&&(xt+=U);const Ft=vt=>{C(),vt?(O("retrying to scroll to",{location:x},pt.DEBUG),j(m,x)):(j(v,!0),O("list did not change, scroll successful",{},pt.DEBUG))};if(C(),ft==="smooth"){let vt=!1;a=X(e,Ot=>{vt=vt||Ot}),g=Ht(f,()=>{Ft(vt)})}else g=Ht(I(e,_o(150)),Ft);return T=setTimeout(()=>{C()},1200),j(u,!0),O("scrolling from index to",{behavior:ft,index:ct,top:xt},pt.DEBUG),{behavior:ft,top:xt}})),d),{scrollTargetReached:v,scrollToIndex:m,topListHeight:R}},st(zt,It,Mt),{singleton:!0});function _o(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ue(t,e){t===0?e():requestAnimationFrame(()=>{Ue(t-1,e)})}function Ke(t,e){if(t===void 0)return 0;const n=e-1,o=typeof t=="number"?t:t.index==="LAST"?n:t.index;return Math.max(0,Math.min(o,n))}function Ge(t){return t===void 0?!0:typeof t=="number"?t===0:t.index===0&&(t.align===void 0||t.align==="start")&&(t.offset===void 0||t.offset===0)}const ae=Y(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=y(!0),u=y(0),d=y(!0);return z(I(i,D(u),P(([f,S])=>!Ge(S)),Ct(!1)),l),z(I(i,D(u),P(([f,S])=>!Ge(S)),Ct(!1)),d),X(I(mt(e,i),D(l,n,t,d),P(([[,f],S,{sizeTree:h},m,v])=>f&&(!J(h)||Ae(m))&&!S&&!v),D(u)),([,f])=>{if(f===void 0){j(l,!0),j(d,!0);return}Ht(r,()=>{j(d,!0)}),Ue(4,()=>{Ht(o,()=>{j(l,!0)}),j(s,f)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:u,scrolledToInitialItem:l}},st(zt,It,ue,At),{singleton:!0});function Xn(t,e){return Math.abs(t-e)<1.01}const ie="up",te="down",No="none",Do={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},$o=0,de=Y(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=y(!1),l=y(!0),u=$(),d=$(),f=y(4),S=y($o),h=gt(I(ve(I(G(r),$t(1),Ct(!0)),I(G(r),$t(1),Ct(!1),pn(100))),ot()),!1),m=gt(I(ve(I(n,Ct(!0)),I(n,Ct(!1),pn(200))),ot()),!1);z(I(mt(G(r),G(S)),k(([a,C])=>a<=C),ot()),l),z(I(l,Pt(50)),d);const v=yt(I(mt(o,G(s),G(e),G(t),G(f)),Et((a,[{scrollHeight:C,scrollTop:x},w,B,_,c])=>{const p=x+w-C>-c,b={scrollHeight:C,scrollTop:x,viewportHeight:w};if(p){let L,F;return x>a.state.scrollTop?(L="SCROLLED_DOWN",F=a.state.scrollTop-x):(L="SIZE_DECREASED",F=a.state.scrollTop-x||a.scrollTopDelta),{atBottom:!0,atBottomBecause:L,scrollTopDelta:F,state:b}}let O;return b.scrollHeight>a.state.scrollHeight?O="SIZE_INCREASED":w<a.state.viewportHeight?O="VIEWPORT_HEIGHT_DECREASING":x<a.state.scrollTop?O="SCROLLING_UPWARDS":O="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:O,state:b}},Do),ot((a,C)=>a!==void 0&&a.atBottom===C.atBottom))),R=gt(I(o,Et((a,{scrollHeight:C,scrollTop:x,viewportHeight:w})=>{if(!Xn(a.scrollHeight,C)){const B=C-(x+w)<1;return a.scrollTop!==x&&B?{changed:!0,jump:a.scrollTop-x,scrollHeight:C,scrollTop:x}:{changed:!0,jump:0,scrollHeight:C,scrollTop:x}}return{changed:!1,jump:0,scrollHeight:C,scrollTop:x}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(a=>a.changed),k(a=>a.jump)),0);z(I(v,k(a=>a.atBottom)),i),z(I(i,Pt(50)),u);const g=y(te);z(I(o,k(({scrollTop:a})=>a),ot(),Et((a,C)=>tt(m)?{direction:a.direction,prevScrollTop:C}:{direction:C<a.prevScrollTop?ie:te,prevScrollTop:C},{direction:te,prevScrollTop:0}),k(a=>a.direction)),g),z(I(o,Pt(50),Ct(No)),g);const T=y(0);return z(I(h,P(a=>!a),Ct(0)),T),z(I(r,Pt(100),D(h),P(([a,C])=>C),Et(([a,C],[x])=>[C,x],[0,0]),k(([a,C])=>C-a)),T),{atBottomState:v,atBottomStateChange:u,atBottomThreshold:f,atTopStateChange:d,atTopThreshold:S,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:R,scrollDirection:g,scrollVelocity:T}},st(It)),le="top",ce="bottom",vn="none";function Tn(t,e,n){return typeof t=="number"?n===ie&&e===le||n===te&&e===ce?t:0:n===ie?e===le?t.main:t.reverse:e===ce?t.main:t.reverse}function Cn(t,e){return typeof t=="number"?t:t[e]??0}const qe=Y(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=y(0),l=y(0),u=y(0),d=gt(I(mt(G(o),G(r),G(n),G(s,Zt),G(u),G(i),G(e),G(t),G(l)),k(([f,S,h,[m,v],R,g,T,a,C])=>{const x=f-a,w=g+T,B=Math.max(h-x,0);let _=vn;const c=Cn(C,le),p=Cn(C,ce);return m-=a,m+=h+T,v+=h+T,v-=a,m>f+w-c&&(_=ie),v<f-B+S+p&&(_=te),_!==vn?[Math.max(x-h-Tn(R,le,_)-c,0),x-B-T+S+Tn(R,ce,_)+p]:null}),P(f=>f!==null),ot(Zt)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:u,topListHeight:i,visibleRange:d}},st(It),{singleton:!0});function Uo(t,e,n,o){if(Re(e)){const r=o-e.groupIndices.length;if(r<=0)return[{index:e.groupIndices[0],offset:0,size:0}];const s=Kn(Math.min(t,r-1),e);return[{index:kt(e.groupOffsetTree,s)[0],offset:0,size:0},{data:n?.[0],index:s,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const Be={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,f=0;if(t.length>0){d=t[0].offset;const R=t[t.length-1];f=R.offset+R.size}const S=n-i,h=l+S*u+(S-1)*o,m=d,v=h-f;return{bottom:f,firstItemIndex:s,items:wn(t,r,s),offsetBottom:v,offsetTop:d,top:m,topItems:wn(e,r,s),topListHeight:e.reduce((R,g)=>g.size+R,0),totalCount:n}}function Jn(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=s!==void 0,d=s?.length??0,f=Ke(e,u?d:l),S=u?Math.max(0,Math.min(l,d-f)):l,h=Array.from({length:S}).map((m,v)=>({data:s?.[v+f],index:v+f,offset:0,size:0}));return Se(h,[],S,r,n,o)}function wn(t,e,n){if(t.length===0)return[];if(!Re(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 f;d.index===l.start?f={index:u,type:"group"}:f={groupIndex:u,index:d.index-(u+1)+n},s.push({...f,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function yn(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Ut=Y(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:u},{initialTopMostItemIndex:d,scrolledToInitialItem:f},{topListHeight:S},h,{didMount:m},{recalcInProgress:v}])=>{const R=y([]),g=y(0),T=gt(I(o,P(({sizeTree:c})=>!J(c)),Ct(!0)),!1),a=$(),C=y(0);z(s.topItemsIndexes,R);const x=gt(I(mt(m,v,G(u,Zt),G(r),G(o),G(d),f,G(R),G(e),G(n),G(C),t,G(g)),P(([c,p,,b,,,,,,,,O])=>{const L=O!==void 0&&O.length!==b;return c&&!p&&!L}),k(([,,[c,p],b,O,L,F,M,Z,W,ft,U,lt])=>{const ct=O,{offsetTree:xt,sizeTree:Ft}=ct;if(b===0)return{...Be,totalCount:b};if(c===0&&p===0)return lt===0?{...Be,totalCount:b}:Jn(lt,L,O,Z,W,U);if(J(Ft))return lt>0&&!tt(T)?null:Se(Uo(Ke(L,b),ct,U,b),[],b,W,ct,Z);const vt=[];if(M.length>0){const q=M[0],Q=M[M.length-1];let ut=0;for(const it of Yt(Ft,q,Q)){const et=it.value,dt=Math.max(it.start,q),Tt=Math.min(it.end,Q);for(let at=dt;at<=Tt;at++)vt.push({data:U?.[at],index:at,offset:ut,size:et}),ut+=et}}if(!F)return Se([],vt,b,W,ct,Z);const Ot=M.length>0?M[M.length-1]+1:0,me=Fo(xt,c,p,Ot);if(me.length===0)return null;const Kt=b-1,Vt=ye([],q=>{for(const Q of me){const ut=Q.value;let it=ut.offset,et=Q.start;const dt=ut.size;if(ut.offset<c){et+=Math.floor((c-ut.offset+W)/(dt+W));const at=et-Q.start;it+=at*dt+at*W}et<Ot&&(it+=(Ot-et)*dt,et=Ot);const Tt=Math.min(Q.end,Kt);for(let at=et;at<=Tt&&!(it>=p);at++)q.push({data:U?.[at],index:at,offset:it,size:dt}),it+=dt+W}}),E=yn(ft,le),K=yn(ft,ce);if(Vt.length>0&&(E>0||K>0)){const q=Vt[0],Q=Vt[Vt.length-1];if(E>0&&q.index>Ot){const ut=Math.min(E,q.index-Ot),it=[];let et=q.offset;for(let dt=q.index-1;dt>=q.index-ut;dt--){const at=Yt(Ft,dt,dt)[0]?.value??q.size;et-=at+W,it.unshift({data:U?.[dt],index:dt,offset:et,size:at})}Vt.unshift(...it)}if(K>0&&Q.index<Kt){const ut=Math.min(K,Kt-Q.index);let it=Q.offset+Q.size+W;for(let et=Q.index+1;et<=Q.index+ut;et++){const Tt=Yt(Ft,et,et)[0]?.value??Q.size;Vt.push({data:U?.[et],index:et,offset:it,size:Tt}),it+=Tt+W}}}return Se(Vt,vt,b,W,ct,Z)}),P(c=>c!==null),ot()),Be);z(I(t,P(Ae),k(c=>c?.length)),r),z(I(x,k(c=>c.topListHeight)),S),z(S,l),z(I(x,k(c=>[c.top,c.bottom])),i),z(I(x,k(c=>c.items)),a);const w=yt(I(x,P(({items:c})=>c.length>0),D(r,t),P(([{items:c},p])=>c[c.length-1].originalIndex===p-1),k(([{items:c},p,b])=>{const O=c[c.length-1],L=O.type==="group"?O.index+1:(O.groupIndex??-1)+1;return[p-1-L,b]}),ot(Zt),P(([c])=>c>=0),k(([c])=>c))),B=yt(I(x,Pt(200),P(({items:c,topItems:p})=>c.length>0&&c[0].originalIndex===p.length),k(({items:c})=>c[0].index),ot())),_=yt(I(x,P(({items:c})=>c.length>0),k(({items:c})=>{let p=0,b=c.length-1;for(;c[p].type==="group"&&p<b;)p++;for(;c[b].type==="group"&&b>p;)b--;return{endIndex:c[b].index,startIndex:c[p].index}}),ot($n)));return{endReached:w,initialItemCount:g,itemsRendered:a,listState:x,minOverscanItemCount:C,rangeChanged:_,startReached:B,topItemsIndexes:R,...h}},st(zt,Yn,qe,ae,ue,de,At,De),{singleton:!0}),Qn=Y(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=gt(I(mt(n,t,o,e,r),k(([l,u,d,f,S])=>l+u+d+f+S.offsetBottom+S.bottom)),0);return z(G(i),s),{totalListHeight:i,totalListHeightChanged:s}},st(It,Ut),{singleton:!0}),Ko=Y(([{viewportHeight:t},{totalListHeight:e}])=>{const n=y(!1),o=gt(I(mt(n,t,e),P(([r])=>r),k(([,r,s])=>Math.max(0,r-s)),Pt(0),ot()),0);return{alignToBottom:n,paddingTopAddition:o}},st(It,Qn),{singleton:!0}),to=Y(()=>({context:y(null)})),qo=({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,eo=Y(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:u},{scrollToIndex:d}])=>{const f=$();return z(I(f,D(e,u,n,s,r,o,l),D(t),k(([[S,h,m,v,R,g,T,a],C])=>{const{calculateViewLocation:x=qo,done:w,...B}=S,_=qn(S,h,v-1),c=se(_,h.offsetTree,C)+R+g,p=c+kt(h.sizeTree,_)[1],b=a+g,O=a+m-T,L=x({itemBottom:p,itemTop:c,locationParams:B,viewportBottom:O,viewportTop:b});return L===null?w?.():w&&Ht(I(i,P(F=>!F),$t(tt(i)?1:2)),w),L}),P(S=>S!==null)),d),{scrollIntoView:f}},st(zt,It,ue,Ut,Mt),{singleton:!0});function bn(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Yo=(t,e)=>typeof t=="function"?bn(t(e)):e&&bn(t),Zo=Y(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:u,propsReady:d},{log:f},{scrollingInProgress:S},{context:h},{scrollIntoView:m}])=>{const v=y(!1),R=$();let g=null;function T(w){j(i,{align:"end",behavior:w,index:"LAST"})}X(I(mt(I(G(e),$t(1)),u),D(G(v),s,l,S),k(([[w,B],_,c,p,b])=>{let O=B&&p,L="auto";return O&&(L=Yo(_,c||b),O=O&&L!==!1),{followOutputBehavior:L,shouldFollow:O,totalCount:w}}),P(({shouldFollow:w})=>w)),({followOutputBehavior:w,totalCount:B})=>{g!==null&&(g(),g=null),tt(n)===void 0?g=Ht(t,()=>{tt(f)("following output to ",{totalCount:B},pt.DEBUG),T(w),g=null}):requestAnimationFrame(()=>{tt(f)("following output to ",{totalCount:B},pt.DEBUG),T(w)})});function a(w){const B=Ht(r,_=>{w&&!_.atBottom&&_.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(tt(f)("scrolling to bottom due to increased size",{},pt.DEBUG),T("auto"))});setTimeout(B,100)}X(I(mt(G(v),e,d),P(([w,,B])=>w!==!1&&B),Et(({value:w},[,B])=>({refreshed:w===B,value:B}),{refreshed:!1,value:0}),P(({refreshed:w})=>w),D(v,e)),([,w])=>{tt(l)&&a(w!==!1)}),X(R,()=>{a(tt(v)!==!1)}),X(mt(G(v),r),([w,B])=>{w!==!1&&!B.atBottom&&B.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&T("auto")});const C=y(null),x=$();return z(ve(I(G(o),k(w=>w?.length??0)),I(G(e))),x),X(I(mt(I(x,$t(1)),u),D(G(C),l,S,h),k(([[w,B],_,c,p,b])=>B&&c&&_?.({context:b,totalCount:w,scrollingInProgress:p})),P(w=>!!w),Pt(0)),w=>{g!==null&&(g(),g=null),tt(n)===void 0?g=Ht(t,()=>{tt(f)("scrolling into view",{}),j(m,w),g=null}):requestAnimationFrame(()=>{tt(f)("scrolling into view",{}),j(m,w)})}),{autoscrollToBottom:R,followOutput:v,scrollIntoViewOnChange:C}},st(zt,de,ue,ae,At,Mt,It,to,eo)),Xo=Y(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(z(I(l,D(s),P(([,u])=>u!==0),D(r,o,e,n,t),k(([[,u],d,f,S,h,m])=>Jn(u,d,f,S,h,m))),i),{}),st(zt,ae,Ut,At),{singleton:!0}),Jo=Y(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=y(0);return X(I(t,D(o),P(([,r])=>r!==0),k(([,r])=>({top:r}))),r=>{Ht(I(n,$t(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{j(e,r)})})}),{initialScrollTop:o}},st(At,It,Ut),{singleton:!0}),no=Y(([{scrollVelocity:t}])=>{const e=y(!1),n=$(),o=y(!1);return z(I(t,D(o,e,n),P(([r,s])=>s!==!1&&s!==void 0),k(([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}),ot()),e),X(I(mt(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}},st(de),{singleton:!0}),Ye=Y(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=y(!1),i=y(void 0);return z(I(mt(n,o),k(([{scrollTop:l,viewportHeight:u},{offsetTop:d,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,l-d),viewportHeight:u}))),t),z(I(e,D(o),k(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},st(It)),Qo=Y(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:u}])=>{const d=$(),f=y(void 0),S=y(null),h=y(null);return z(l,S),z(u,h),X(I(d,D(e,o,i,S,h,n)),([m,v,R,g,T,a,C])=>{const x=Po(v.sizeTree);g&&T!==null&&a!==null&&(R=T.scrollTop-a.offsetTop),R-=C,m({ranges:x,scrollTop:R})}),z(I(f,P(Ae),k(tr)),r),z(I(s,D(f),P(([,m])=>m!==void 0),ot(),k(([,m])=>m.ranges)),t),{getState:d,restoreStateFrom:f}},st(zt,It,ae,At,Ye));function tr(t){return{align:"start",index:0,offset:t.scrollTop}}const er=Y(([{topItemsIndexes:t}])=>{const e=y(0);return z(I(e,P(n=>n>=0),k(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},st(Ut));function oo(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const nr=oo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),or=Y(([{deviation:t,deviationCommitted:e,scrollBy:n,scrollingInProgress:o,scrollTop:r},{isAtBottom:s,isScrolling:i,lastJumpDueToItemResize:l,scrollDirection:u},{listState:d},{beforeUnshiftWith:f,gap:S,shiftWithOffset:h,sizes:m},{log:v},{recalcInProgress:R}])=>{const g=yt(I(d,D(l),Et(([,x,w,B],[{bottom:_,items:c,offsetBottom:p,totalCount:b},O])=>{const L=_+p;let F=0;return w===b&&x.length>0&&c.length>0&&(c[0].originalIndex===0&&x[0].originalIndex===0||(F=L-B,F!==0&&(F+=O))),[F,c,b,L]},[0,[],0,0]),P(([x])=>x!==0),D(r,u,o,s,v,R),P(([,x,w,B,,,_])=>!_&&!B&&x!==0&&w===ie),k(([[x],,,,,w])=>(w("Upward scrolling compensation",{amount:x},pt.DEBUG),x))));function T(x){x>0?(j(n,{behavior:"auto",top:-x}),j(t,0)):(j(t,0),j(n,{behavior:"auto",top:-x}))}X(I(g,D(t,i)),([x,w,B])=>{B&&nr()?j(t,w-x):T(-x)}),X(I(mt(gt(i,!1),t,R),P(([x,w,B])=>!x&&!B&&w!==0),k(([x,w])=>w),Pt(1)),T),z(I(h,k(x=>({top:-x}))),n);let a=null;function C(){if(a===null)return;const{offset:x}=a;a=null,j(n,{top:x}),requestAnimationFrame(()=>{j(t,0),j(R,!1)})}return X(e,x=>{a===null||!a.acknowledgeable||x===a.offset&&C()}),X(I(f,D(m,S),k(([x,{groupIndices:w,lastSize:B,sizeTree:_},c])=>{function p(M){return M*(B+c)}if(w.length===0)return p(x);let b=0;const O=re(_,0);let L=0,F=0;for(;L<x;){L++,b+=O;let M=w.length===F+1?1/0:w[F+1]-w[F]-1;L+M>x&&(b-=O,M=x-L+1),L+=M,b+=p(M),F++}return b})),x=>{a={acknowledgeable:tt(t)!==x,offset:x},j(t,x),requestAnimationFrame(C)}),{deviation:t}},st(It,de,Ut,zt,Mt,De)),rr=Y(([t,e,n,o,r,s,i,l,u,d,f])=>({...t,...e,...n,...o,...r,...s,...i,...l,...u,...d,...f}),st(qe,Xo,At,no,Qn,Jo,Ko,Ye,eo,Mt,to)),ro=Y(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:u,sizeRanges:d,sizes:f,statefulTotalCount:S,totalCount:h,trackItemSizes:m},{initialItemFinalLocationReached:v,initialTopMostItemIndex:R,scrolledToInitialItem:g},T,a,C,x,{scrollToIndex:w},B,{topItemCount:_},{groupCounts:c},p])=>{const{listState:b,minOverscanItemCount:O,topItemsIndexes:L,rangeChanged:F,...M}=x;return z(F,p.scrollSeekRangeChanged),z(I(mt(p.windowViewportRect,T.headerHeight,T.fixedHeaderHeight),k(([Z,W,ft])=>Math.max(W+ft+1,Z.visibleHeight))),T.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:c,heightEstimates:l,initialItemFinalLocationReached:v,initialTopMostItemIndex:R,scrolledToInitialItem:g,sizeRanges:d,topItemCount:_,topItemsIndexes:L,totalCount:h,...C,groupIndices:i,itemSize:u,listState:b,minOverscanItemCount:O,scrollToIndex:w,statefulTotalCount:S,trackItemSizes:m,rangeChanged:F,...M,...p,...T,sizes:f,...a}},st(zt,ae,It,Qo,Zo,Ut,ue,or,er,Yn,rr));function sr(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"?H.useEffect:H.useLayoutEffect;function Ze(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=H.createContext({});function u(T,a){T.propsReady!==void 0&&j(T.propsReady,!1);for(const C of o){const x=T[e.required[C]];j(x,a[C])}for(const C of r)if(C in a){const x=T[e.optional[C]];j(x,a[C])}T.propsReady!==void 0&&j(T.propsReady,!0)}function d(T){return s.reduce((a,C)=>(a[C]=x=>{const w=T[e.methods[C]];j(w,x)},a),{})}function f(T){return i.reduce((a,C)=>(a[C]=To(T[e.events[C]]),a),{})}const S=H.forwardRef(function(a,C){const{children:x,...w}=a,[B]=H.useState(()=>ye(yo(t),p=>{u(p,w)})),[_]=H.useState(mn(f,B));ge(()=>{for(const p of i)p in w&&X(_[p],w[p]);return()=>{Object.values(_).map(je)}},[w,_,B]),ge(()=>{u(B,w)}),H.useImperativeHandle(C,fn(d(B)));const c=n;return V.jsx(l.Provider,{value:B,children:n===void 0?x:V.jsx(c,{...sr([...o,...r,...i],w),children:x})})}),h=T=>{const a=H.useContext(l);return H.useCallback(C=>{j(a[T],C)},[a,T])},m=T=>{const C=H.useContext(l)[T],x=H.useCallback(w=>X(C,w),[C]);return H.useSyncExternalStore(x,()=>tt(C),()=>tt(C))},v=T=>{const C=H.useContext(l)[T],[x,w]=H.useState(mn(tt,C));return ge(()=>X(C,B=>{B!==x&&w(fn(B))}),[C,x]),x},R=parseInt(H.version,10)>=18?m:v;return{Component:S,useEmitter:(T,a)=>{const x=H.useContext(l)[T];ge(()=>X(x,a),[a,x])},useEmitterValue:R,usePublisher:h}}const fe=H.createContext(void 0),Xe=H.createContext(void 0),Oe="-webkit-sticky",Rn="sticky",Je=oo(()=>{if(typeof document>"u")return Rn;const t=document.createElement("div");return t.style.position=Oe,t.style.position===Oe?Oe:Rn});function Le(t){return"self"in t}function ir(t){return"body"in t}function so(t,e,n,o=Jt,r,s){const i=H.useRef(null),l=H.useRef(null),u=H.useRef(null),d=H.useCallback(h=>{let m,v,R;const g=h.target;if(ir(g)||Le(g)){const a=Le(g)?g:g.defaultView;R=s===!0?_t(a,a.scrollX):a.scrollY,m=s===!0?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight,v=s===!0?a.innerWidth:a.innerHeight}else R=s===!0?_t(g,g.scrollLeft):g.scrollTop,m=s===!0?g.scrollWidth:g.scrollHeight,v=s===!0?g.offsetWidth:g.offsetHeight;const T=()=>{t({scrollHeight:m,scrollTop:Math.max(R,0),viewportHeight:v})};h.suppressFlushSync===!0?T():ho.flushSync(T),l.current!==null&&(R===l.current||R<=0||R===m-v)&&(l.current=null,e(!0),u.current&&(clearTimeout(u.current),u.current=null))},[t,e,s]);H.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 f(h){const m=i.current;if(!m||(s===!0?"offsetWidth"in m&&m.offsetWidth===0:"offsetHeight"in m&&m.offsetHeight===0))return;const v=h.behavior==="smooth";let R,g,T;Le(m)?(g=Math.max(Bt(m.document.documentElement,s===!0?"width":"height"),s===!0?m.document.documentElement.scrollWidth:m.document.documentElement.scrollHeight),R=s===!0?m.innerWidth:m.innerHeight,T=s===!0?_t(m,m.scrollX):m.scrollY):(g=m[s===!0?"scrollWidth":"scrollHeight"],R=Bt(m,s===!0?"width":"height"),T=s===!0?_t(m,m.scrollLeft):m.scrollTop);const a=g-R;if(h.top===void 0){m.scrollTo(h);return}const C=Math.ceil(Math.max(Math.min(a,h.top),0));if(h.top=C,Xn(R,g)||C===T){t({scrollHeight:g,scrollTop:T,viewportHeight:R}),v&&e(!0);return}v?(l.current=C,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,l.current=null,e(!0)},1e3)):l.current=null,s===!0&&(h={...h.behavior===void 0?{}:{behavior:h.behavior},left:hn(m,C)}),m.scrollTo(h)}return{scrollByCallback:H.useCallback(h=>{s===!0&&(h={...h.behavior===void 0?{}:{behavior:h.behavior},...h.top===void 0?{}:{left:hn(i.current,h.top)}}),i.current.scrollBy(h)},[s]),scrollerRef:i,scrollToCallback:f}}function Qe(t){return t}const lr=Y(()=>{const t=y(l=>`Item ${l}`),e=y(l=>`Group ${l}`),n=y({}),o=y(Qe),r=y("div"),s=y(Jt),i=(l,u=null)=>gt(I(n,k(d=>d[l]),ot()),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")}}),cr=Y(([t,e])=>({...t,...e}),st(ro,lr)),ur=({height:t})=>V.jsx("div",{style:{height:t}}),ar={overflowAnchor:"none",position:Je(),zIndex:1},io={overflowAnchor:"none"},dr={...io,display:"inline-block",height:"100%"},En=H.memo(function({showTopList:e=!1}){const n=A("listState"),o=wt("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=wt("windowScrollContainerState"),l=wt("scrollContainerState"),u=s||r?i:l,d=A("itemContent"),f=A("context"),S=A("groupContent"),h=A("trackItemSizes"),m=A("itemSize"),v=A("log"),R=wt("gap"),g=A("horizontalDirection"),{callbackRef:T}=Mn(o,m,h,e?Jt:u,v,R,s,g,A("skipAnimationFrameInResizeObserver")),[a,C]=H.useState(0);on("deviation",W=>{a!==W&&C(W)});const x=wt("deviationCommitted");be(()=>{x(a)},[a,x]);const w=A("EmptyPlaceholder"),B=A("ScrollSeekPlaceholder")??ur,_=A("ListComponent"),c=A("ItemComponent"),p=A("GroupComponent"),b=A("computeItemKey"),O=A("isSeeking"),L=A("groupIndices").length>0,F=A("alignToBottom"),M=A("initialItemFinalLocationReached"),Z=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginInlineStart:a===0?F?"auto":0:a,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:a===0?F?"auto":0:a,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...M?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&w!==null&&w!==void 0?V.jsx(w,{...rt(w,f)}):V.jsx(_,{...rt(_,f),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:T,style:Z,children:(e?n.topItems:n.items).map(W=>{const ft=W.originalIndex,U=b(ft+n.firstItemIndex,W.data,f);return O?H.createElement(B,{...rt(B,f),height:W.size,index:W.index,key:U,type:W.type||"item",...W.type==="group"?{}:{groupIndex:W.groupIndex}}):W.type==="group"?H.createElement(p,{...rt(p,f),"data-index":ft,"data-item-index":W.index,"data-known-size":W.size,key:U,style:ar},S(W.index,f)):H.createElement(c,{...rt(c,f),...lo(c,W.data),"data-index":ft,"data-item-group-index":W.groupIndex,"data-item-index":W.index,"data-known-size":W.size,key:U,style:g?dr:io},L?d(W.index,W.groupIndex,W.data,f):d(W.index,W.data,f))})})}),fr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mr={outline:"none",overflowX:"auto",position:"relative"},Ee=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),tn=(t,e,n=0)=>({...Ee(t),position:e?"relative":"absolute",top:e?-n:0}),pr={position:Je(),top:0,width:"100%",zIndex:1};function rt(t,e){if(typeof t!="string")return{context:e}}function lo(t,e){return{item:typeof t=="string"?void 0:e}}const hr=H.memo(function(){const e=A("HeaderComponent"),n=wt("headerHeight"),o=A("HeaderFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),gr=H.memo(function(){const e=A("FooterComponent"),n=wt("footerHeight"),o=A("HeaderFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,A("skipAnimationFrameInResizeObserver")),s=A("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null});function en({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...u}){const d=n("scrollContainerState"),f=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("scrollerRef"),m=e("horizontalDirection")||!1,{scrollByCallback:v,scrollerRef:R,scrollToCallback:g}=so(d,S,f,h,void 0,m);t("scrollTo",g),t("scrollBy",v);const T=m?mr:fr;return V.jsx(f,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:R,style:{...T,...i},tabIndex:0,...u,...rt(f,l),children:s})})}function nn({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...u}){const d=n("windowScrollContainerState"),f=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("totalListHeight"),m=e("deviation"),v=e("customScrollParent"),R=H.useRef(null),g=e("scrollerRef"),{scrollByCallback:T,scrollerRef:a,scrollToCallback:C}=so(d,S,f,g,v);return be(()=>(a.current=v??R.current?.ownerDocument.defaultView,()=>{a.current=null}),[a,v]),t("windowScrollTo",C),t("scrollBy",T),V.jsx(f,{ref:R,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h===0?void 0:{height:h+m}},...u,...rt(f,l),children:s})})}const xr=({children:t})=>{const e=H.useContext(fe),n=wt("viewportHeight"),o=wt("fixedItemHeight"),r=A("alignToBottom"),s=A("horizontalDirection"),i=H.useMemo(()=>ne(n,u=>Bt(u,s?"width":"height")),[n,s]),l=Lt(i,!0,A("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:l,style:Ee(r),children:t})},Ir=({children:t})=>{const e=H.useContext(fe),n=wt("windowViewportRect"),o=wt("fixedItemHeight"),r=A("customScrollParent"),s=A("useWindowScroll"),i=A("topListHeight"),l=Ne(n,r,A("skipAnimationFrameInResizeObserver")),u=A("alignToBottom");return H.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:l,style:tn(u,s,i),children:t})},Sr=({children:t})=>{const e=A("TopItemListComponent")??"div",n=A("headerHeight"),o={...pr,marginTop:`${n}px`},r=A("context");return V.jsx(e,{style:o,...rt(e,r),children:t})},vr=H.memo(function(e){const n=A("useWindowScroll"),o=A("topItemsIndexes").length>0,r=A("customScrollParent"),s=A("context"),i=r||n?Cr:Tr,l=r||n?Ir:xr;return V.jsxs(i,{...e,context:s,children:[o&&V.jsx(Sr,{children:V.jsx(En,{showTopList:!0})}),V.jsxs(l,{children:[V.jsx(hr,{}),V.jsx(En,{}),V.jsx(gr,{})]})]})}),{Component:co,useEmitter:on,useEmitterValue:A,usePublisher:wt}=Ze(cr,{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"}},vr),Tr=en({useEmitter:on,useEmitterValue:A,usePublisher:wt}),Cr=nn({useEmitter:on,useEmitterValue:A,usePublisher:wt}),wr=co,yr=co,br=Y(()=>{const t=y(d=>V.jsxs("td",{children:["Item $",d]})),e=y(null),n=y(d=>V.jsxs("td",{colSpan:1e3,children:["Group ",d]})),o=y(null),r=y(null),s=y({}),i=y(Qe),l=y(Jt),u=(d,f=null)=>gt(I(s,k(S=>S[d]),ot()),f);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")}}),Rr=Y(([t,e])=>({...t,...e}),st(ro,br)),Er=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{height:t}})}),Hr=({height:t})=>V.jsx("tr",{children:V.jsx("td",{style:{border:0,height:t,padding:0}})}),kr={overflowAnchor:"none"},Hn={position:Je(),zIndex:2,overflowAnchor:"none"},kn=H.memo(function({showTopList:e=!1}){const n=N("listState"),o=N("computeItemKey"),r=N("firstItemIndex"),s=N("context"),i=N("isSeeking"),l=N("fixedHeaderHeight"),u=N("groupIndices").length>0,d=N("itemContent"),f=N("groupContent"),S=N("ScrollSeekPlaceholder")??Er,h=N("GroupComponent"),m=N("TableRowComponent"),v=(e?n.topItems:[]).reduce((g,T,a)=>(a===0?g.push(T.size):g.push(g[a-1]+T.size),g),[]);return(e?n.topItems:n.items).map(g=>{const T=g.originalIndex,a=o(T+r,g.data,s),C=e?T===0?0:v[T-1]:0;return i?H.createElement(S,{...rt(S,s),height:g.size,index:g.index,key:a,type:g.type||"item"}):g.type==="group"?H.createElement(h,{...rt(h,s),"data-index":T,"data-item-index":g.index,"data-known-size":g.size,key:a,style:{...Hn,top:l}},f(g.index,s)):H.createElement(m,{...rt(m,s),...lo(m,g.data),"data-index":T,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:a,style:e?{...Hn,top:l+C}:kr},u?d(g.index,g.groupIndex,g.data,s):d(g.index,g.data,s))})}),Br=H.memo(function(){const e=N("listState"),n=N("topItemsIndexes").length>0,o=bt("sizeRanges"),r=N("useWindowScroll"),s=N("customScrollParent"),i=bt("windowScrollContainerState"),l=bt("scrollContainerState"),u=s||r?i:l,d=N("trackItemSizes"),f=N("itemSize"),S=N("log"),{callbackRef:h,ref:m}=Mn(o,f,d,u,S,void 0,s,!1,N("skipAnimationFrameInResizeObserver")),[v,R]=H.useState(0);rn("deviation",L=>{v!==L&&(m.current.style.marginTop=`${L}px`,R(L))});const g=bt("deviationCommitted");be(()=>{g(v)},[v,g]);const T=N("EmptyPlaceholder"),a=N("FillerRow")??Hr,C=N("TableBodyComponent"),x=N("paddingTopAddition"),w=N("statefulTotalCount"),B=N("context");if(w===0&&T!==null&&T!==void 0)return V.jsx(T,{...rt(T,B)});const _=(n?e.topItems:[]).reduce((L,F)=>L+F.size,0),c=e.offsetTop+x+v-_,p=e.offsetBottom,b=c>0?V.jsx(a,{context:B,height:c},"padding-top"):null,O=p>0?V.jsx(a,{context:B,height:p},"padding-bottom"):null;return V.jsxs(C,{"data-testid":"virtuoso-item-list",ref:h,...rt(C,B),children:[b,n&&V.jsx(kn,{showTopList:!0}),V.jsx(kn,{}),O]})}),Or=({children:t})=>{const e=H.useContext(fe),n=bt("viewportHeight"),o=bt("fixedItemHeight"),r=Lt(H.useMemo(()=>ne(n,s=>Bt(s,"height")),[n]),!0,N("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),V.jsx("div",{"data-viewport-type":"element",ref:r,style:Ee(!1),children:t})},Lr=({children:t})=>{const e=H.useContext(fe),n=bt("windowViewportRect"),o=bt("fixedItemHeight"),r=N("customScrollParent"),s=N("useWindowScroll"),i=Ne(n,r,N("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(o(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),V.jsx("div",{"data-viewport-type":"window",ref:i,style:tn(!1,s),children:t})},zr=H.memo(function(e){const n=N("useWindowScroll"),o=N("customScrollParent"),r=bt("fixedHeaderHeight"),s=bt("fixedFooterHeight"),i=N("fixedHeaderContent"),l=N("fixedFooterContent"),u=N("context"),d=Lt(H.useMemo(()=>ne(r,a=>Bt(a,"height")),[r]),!0,N("skipAnimationFrameInResizeObserver")),f=Lt(H.useMemo(()=>ne(s,a=>Bt(a,"height")),[s]),!0,N("skipAnimationFrameInResizeObserver")),S=o||n?Vr:Fr,h=o||n?Lr:Or,m=N("TableComponent"),v=N("TableHeadComponent"),R=N("TableFooterComponent"),g=i?V.jsx(v,{ref:d,style:{position:"sticky",top:0,zIndex:2},...rt(v,u),children:i()},"TableHead"):null,T=l?V.jsx(R,{ref:f,style:{bottom:0,position:"sticky",zIndex:1},...rt(R,u),children:l()},"TableFoot"):null;return V.jsx(S,{...e,...rt(S,u),children:V.jsx(h,{children:V.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...rt(m,u),children:[g,V.jsx(Br,{},"TableBody"),T]})})})}),{Component:uo,useEmitter:rn,useEmitterValue:N,usePublisher:bt}=Ze(Rr,{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",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},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"}},zr),Fr=en({useEmitter:rn,useEmitterValue:N,usePublisher:bt}),Vr=nn({useEmitter:rn,useEmitterValue:N,usePublisher:bt}),Pr=uo,Wr=uo,Bn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Gr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:On,floor:Ce,max:ee,min:ze,round:Ln}=Math;function zn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Mr(t){return{...Gr,items:t}}function xe(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function Ar(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const jr=Y(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:u,scrollTop:d,smoothScrollTargetReached:f,viewportHeight:S},h,m,{didMount:v,propsReady:R},{customScrollParent:g,useWindowScroll:T,windowScrollContainerState:a,windowScrollTo:C,windowViewportRect:x},w])=>{const B=y(0),_=y(0),c=y(Bn),p=y({height:0,width:0}),b=y({height:0,width:0}),O=$(),L=$(),F=y(0),M=y(null),Z=y({column:0,row:0}),W=$(),ft=$(),U=y(!1),lt=y(0),ct=y(!0),xt=y(!1),Ft=y(!1);X(I(v,D(lt),P(([E,K])=>!Ge(K))),()=>{j(ct,!1)}),X(I(mt(v,ct,b,p,lt,xt),P(([E,K,q,Q,,ut])=>E&&!K&&q.height!==0&&Q.height!==0&&!ut)),([,,,,E])=>{if(E===void 0){j(ct,!0);return}j(xt,!0),Ue(1,()=>{j(O,E)}),Ht(I(d),()=>{j(e,[0,0]),j(ct,!0)})}),z(I(ft,P(E=>E!=null&&E.scrollTop>0),Ct(0)),_),X(I(v,D(ft),P(([,E])=>E!=null)),([,E])=>{E&&(j(p,E.viewport),j(b,E.item),j(Z,E.gap),E.scrollTop>0&&(j(U,!0),Ht(I(d,$t(1)),K=>{j(U,!1)}),j(u,{top:E.scrollTop})))}),z(I(p,k(({height:E})=>E)),S),z(I(mt(G(p,xe),G(b,xe),G(Z,(E,K)=>E!==void 0&&E.column===K.column&&E.row===K.row),G(d)),k(([E,K,q,Q])=>({gap:q,item:K,scrollTop:Q,viewport:E}))),W),z(I(mt(G(B),o,G(Z,Ar),G(b,xe),G(p,xe),G(M),G(_),G(U),G(ct),G(lt)),P(([,,,,,,,E])=>!E),k(([E,[K,q],Q,ut,it,et,dt,,Tt,at])=>{const{column:Wt,row:Qt}=Q,{height:pe,width:He}=ut,{width:sn}=it;if(dt===0&&(E===0||sn===0))return Bn;if(He===0){const dn=Ke(at,E),po=dn+Math.max(dt-1,0);return Mr(zn(dn,po,et))}const he=ao(sn,He,Wt);let qt,jt;Tt?K===0&&q===0&&dt>0?(qt=0,jt=dt-1):(qt=he*Ce((K+Qt)/(pe+Qt)),jt=he*On((q+Qt)/(pe+Qt))-1,jt=ze(E-1,ee(jt,he-1)),qt=ze(jt,ee(0,qt))):(qt=0,jt=-1);const ln=zn(qt,jt,et),{bottom:cn,top:un}=Fn(it,Q,ut,ln),an=On(E/he),mo=an*pe+(an-1)*Qt-cn;return{bottom:cn,itemHeight:pe,items:ln,itemWidth:He,offsetBottom:mo,offsetTop:un,top:un}})),c),z(I(M,P(E=>E!==null),k(E=>E.length)),B),z(I(mt(p,b,c,Z),P(([E,K,{items:q}])=>q.length>0&&K.height!==0&&E.height!==0),k(([E,K,{items:q},Q])=>{const{bottom:ut,top:it}=Fn(E,Q,K,q);return[it,ut]}),ot(Zt)),e);const vt=y(!1);z(I(d,D(vt),k(([E,K])=>K||E!==0)),vt);const Ot=yt(I(mt(c,B),P(([{items:E},K])=>{const q=tt(M);return E.length>0&&(q===null||q.length===K)}),D(vt),P(([[E,K],q])=>{const ut=E.items[E.items.length-1].index===K-1;return(q||E.bottom>0&&E.itemHeight>0&&E.offsetBottom===0&&E.items.length===K)&&ut}),k(([[,E]])=>[E-1,tt(M)]),ot(Zt),k(([E])=>E))),me=yt(I(G(c),P(({items:E})=>E.length>0&&E[0].index===0),Ct(0),ot())),Kt=yt(I(G(c),D(U),P(([{items:E},K])=>E.length>0&&!K),k(([{items:E}])=>({endIndex:E[E.length-1].index,startIndex:E[0].index})),ot($n),Pt(0)));z(Kt,m.scrollSeekRangeChanged),z(I(O,D(p,b,B,Z),k(([E,K,q,Q,ut])=>{const it=Zn(E),{align:et,behavior:dt,offset:Tt}=it;let at=it.index;at==="LAST"&&(at=Q-1),at=ee(0,ze(Q-1,at));let Wt=Me(K,ut,q,at);return et==="end"?Wt=Ln(Wt-K.height+q.height):et==="center"&&(Wt=Ln(Wt-K.height/2+q.height/2)),Tt!==void 0&&Tt!==0&&(Wt+=Tt),{behavior:dt,top:Wt}})),u);const Vt=gt(I(c,k(E=>E.offsetBottom+E.bottom)),0);return z(I(x,k(E=>({height:E.visibleHeight,width:E.visibleWidth}))),p),{customScrollParent:g,data:M,deviation:F,footerHeight:r,gap:Z,headerHeight:s,increaseViewportBy:t,initialItemCount:_,itemDimensions:b,overscan:n,restoreStateFrom:ft,scrollBy:i,scrollContainerState:l,scrollHeight:L,scrollTo:u,scrollToIndex:O,scrollTop:d,smoothScrollTargetReached:f,totalCount:B,useWindowScroll:T,viewportDimensions:p,windowScrollContainerState:a,windowScrollTo:C,windowViewportRect:x,...m,gridState:c,horizontalDirection:Ft,initialTopMostItemIndex:lt,totalListHeight:Vt,...h,endReached:Ot,propsReady:R,rangeChanged:Kt,startReached:me,stateChanged:W,stateRestoreInProgress:U,...w}},st(qe,It,de,no,At,Ye,Mt));function ao(t,e,n){return ee(1,Ce((t+n)/(Ce(e)+n)))}function Fn(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Me(t,e,n,o[0].index);return{bottom:Me(t,e,n,o[o.length-1].index)+r,top:s}}function Me(t,e,n,o){const r=ao(t.width,n.width,e.column),s=Ce(o/r),i=s*n.height+ee(0,s-1)*e.row;return i>0?i+e.row:i}const _r=Y(()=>{const t=y(S=>`Item ${S}`),e=y({}),n=y(null),o=y("virtuoso-grid-item"),r=y("virtuoso-grid-list"),s=y(Qe),i=y("div"),l=y(Jt),u=(S,h=null)=>gt(I(e,k(m=>m[S]),ot()),h),d=y(!1),f=y(!1);return z(G(f),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:f,ScrollerComponent:u("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),Nr=Y(([t,e])=>({...t,...e}),st(jr,_r)),Dr=H.memo(function(){const e=nt("gridState"),n=nt("listClassName"),o=nt("itemClassName"),r=nt("itemContent"),s=nt("computeItemKey"),i=nt("isSeeking"),l=Rt("scrollHeight"),u=nt("ItemComponent"),d=nt("ListComponent"),f=nt("ScrollSeekPlaceholder"),S=nt("context"),h=Rt("itemDimensions"),m=Rt("gap"),v=nt("log"),R=nt("stateRestoreInProgress"),g=Rt("reportReadyState"),T=Lt(H.useMemo(()=>a=>{const C=a.parentElement.parentElement.scrollHeight;l(C);const x=a.firstChild;if(x!==null){const{height:w,width:B}=x.getBoundingClientRect();h({height:w,width:B})}m({column:Vn("column-gap",getComputedStyle(a).columnGap,v),row:Vn("row-gap",getComputedStyle(a).rowGap,v)})},[l,h,m,v]),!0,!1);return be(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),R?null:V.jsx(d,{className:n,ref:T,...rt(d,S),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(a=>{const C=s(a.index,a.data,S);return i?V.jsx(f,{...rt(f,S),height:e.itemHeight,index:a.index,width:e.itemWidth},C):H.createElement(u,{...rt(u,S),className:o,"data-index":a.index,key:C},r(a.index,a.data,S))})})}),$r=H.memo(function(){const e=nt("HeaderComponent"),n=Rt("headerHeight"),o=nt("headerFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,!1),s=nt("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),Ur=H.memo(function(){const e=nt("FooterComponent"),n=Rt("footerHeight"),o=nt("headerFooterTag"),r=Lt(H.useMemo(()=>i=>{n(Bt(i,"height"))},[n]),!0,!1),s=nt("context");return e!=null?V.jsx(o,{ref:r,children:V.jsx(e,{...rt(e,s)})}):null}),Kr=({children:t})=>{const e=H.useContext(Xe),n=Rt("itemDimensions"),o=Rt("viewportDimensions"),r=Lt(H.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return H.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:Ee(!1),children:t})},qr=({children:t})=>{const e=H.useContext(Xe),n=Rt("windowViewportRect"),o=Rt("itemDimensions"),r=nt("customScrollParent"),s=nt("useWindowScroll"),i=Ne(n,r,!1);return H.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),V.jsx("div",{ref:i,style:tn(!1,s),children:t})},Yr=H.memo(function({...e}){const n=nt("useWindowScroll"),o=nt("customScrollParent"),r=o||n?Jr:Xr,s=o||n?qr:Kr,i=nt("context");return V.jsx(r,{...e,...rt(r,i),children:V.jsxs(s,{children:[V.jsx($r,{}),V.jsx(Dr,{}),V.jsx(Ur,{})]})})}),{Component:Zr,useEmitter:fo,useEmitterValue:nt,usePublisher:Rt}=Ze(Nr,{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"}},Yr),Xr=en({useEmitter:fo,useEmitterValue:nt,usePublisher:Rt}),Jr=nn({useEmitter:fo,useEmitterValue:nt,usePublisher:Rt});function Vn(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,pt.WARN),e==="normal"?0:parseInt(e??"0",10)}const Qr=Zr;exports.GroupedTableVirtuoso=Wr;exports.GroupedVirtuoso=yr;exports.LogLevel=pt;exports.TableVirtuoso=Pr;exports.Virtuoso=wr;exports.VirtuosoGrid=Qr;exports.VirtuosoGridMockContext=Xe;exports.VirtuosoMockContext=fe;
|
package/dist/index.mjs
CHANGED
|
@@ -924,31 +924,31 @@ const _o = {
|
|
|
924
924
|
const F = ie(p.sizeTree, 0);
|
|
925
925
|
let G = 0, Z = 0;
|
|
926
926
|
for (; G < c; ) {
|
|
927
|
-
const K = p.groupIndices[Z],
|
|
927
|
+
const K = p.groupIndices[Z], lt = p.groupIndices.length === Z + 1 ? 1 / 0 : p.groupIndices[Z + 1] - K - 1;
|
|
928
928
|
O.push({
|
|
929
929
|
endIndex: K,
|
|
930
930
|
size: F,
|
|
931
931
|
startIndex: K
|
|
932
932
|
}), O.push({
|
|
933
|
-
endIndex: K + 1 +
|
|
933
|
+
endIndex: K + 1 + lt - 1,
|
|
934
934
|
size: L,
|
|
935
935
|
startIndex: K + 1
|
|
936
|
-
}), Z++, G +=
|
|
936
|
+
}), Z++, G += lt + 1;
|
|
937
937
|
}
|
|
938
938
|
const W = $t(p.sizeTree);
|
|
939
939
|
return G !== c && W.shift(), W.reduce(
|
|
940
|
-
(K, { k:
|
|
940
|
+
(K, { k: lt, v: ct }) => {
|
|
941
941
|
let It = K.ranges;
|
|
942
942
|
return K.prevSize !== 0 && (It = [
|
|
943
943
|
...K.ranges,
|
|
944
944
|
{
|
|
945
|
-
endIndex:
|
|
945
|
+
endIndex: lt + c - 1,
|
|
946
946
|
size: K.prevSize,
|
|
947
947
|
startIndex: K.prevIndex
|
|
948
948
|
}
|
|
949
949
|
]), {
|
|
950
|
-
prevIndex:
|
|
951
|
-
prevSize:
|
|
950
|
+
prevIndex: lt + c,
|
|
951
|
+
prevSize: ct,
|
|
952
952
|
ranges: It
|
|
953
953
|
};
|
|
954
954
|
},
|
|
@@ -998,14 +998,14 @@ const _o = {
|
|
|
998
998
|
let Z = 0, W = 0, ft = 0;
|
|
999
999
|
for (; Z < -c; ) {
|
|
1000
1000
|
ft = G[W];
|
|
1001
|
-
const
|
|
1002
|
-
W++, Z +=
|
|
1001
|
+
const lt = G[W + 1] - ft - 1;
|
|
1002
|
+
W++, Z += lt + 1;
|
|
1003
1003
|
}
|
|
1004
|
-
if (F = $t(p.sizeTree).reduce((
|
|
1005
|
-
const
|
|
1006
|
-
F = xt(F, 0,
|
|
1007
|
-
const
|
|
1008
|
-
F = xt(F, 1,
|
|
1004
|
+
if (F = $t(p.sizeTree).reduce((lt, { k: ct, v: It }) => xt(lt, Math.max(0, ct + c), It), F), Z !== -c) {
|
|
1005
|
+
const lt = ie(p.sizeTree, ft);
|
|
1006
|
+
F = xt(F, 0, lt);
|
|
1007
|
+
const ct = kt(p.sizeTree, -c + 1)[1];
|
|
1008
|
+
F = xt(F, 1, ct);
|
|
1009
1009
|
}
|
|
1010
1010
|
return {
|
|
1011
1011
|
...p,
|
|
@@ -1161,9 +1161,9 @@ const de = Y(
|
|
|
1161
1161
|
F,
|
|
1162
1162
|
G
|
|
1163
1163
|
]) => {
|
|
1164
|
-
const Z = Xn(I), { align: W, behavior: ft, offset: K } = Z,
|
|
1165
|
-
let It = le(
|
|
1166
|
-
W === "end" ? (It += F + kt(w.sizeTree,
|
|
1164
|
+
const Z = Xn(I), { align: W, behavior: ft, offset: K } = Z, lt = N - 1, ct = Yn(Z, w, lt);
|
|
1165
|
+
let It = le(ct, w.offsetTree, L) + p;
|
|
1166
|
+
W === "end" ? (It += F + kt(w.sizeTree, ct)[1] - B + G, ct === lt && (It += b)) : W === "center" ? It += (F + kt(w.sizeTree, ct)[1] - B + G) / 2 : It -= c, K !== void 0 && K !== 0 && (It += K);
|
|
1167
1167
|
const Ft = (vt) => {
|
|
1168
1168
|
C(), vt ? (O("retrying to scroll to", { location: I }, ht.DEBUG), _(m, I)) : (_(v, !0), O("list did not change, scroll successful", {}, ht.DEBUG));
|
|
1169
1169
|
};
|
|
@@ -1178,7 +1178,7 @@ const de = Y(
|
|
|
1178
1178
|
g = Et(S(e, $o(150)), Ft);
|
|
1179
1179
|
return T = setTimeout(() => {
|
|
1180
1180
|
C();
|
|
1181
|
-
}, 1200), _(u, !0), O("scrolling from index to", { behavior: ft, index:
|
|
1181
|
+
}, 1200), _(u, !0), O("scrolling from index to", { behavior: ft, index: ct, top: It }, ht.DEBUG), { behavior: ft, top: It };
|
|
1182
1182
|
}
|
|
1183
1183
|
)
|
|
1184
1184
|
),
|
|
@@ -1613,74 +1613,74 @@ const qt = Y(
|
|
|
1613
1613
|
W,
|
|
1614
1614
|
ft,
|
|
1615
1615
|
K,
|
|
1616
|
-
|
|
1616
|
+
lt
|
|
1617
1617
|
]) => {
|
|
1618
|
-
const
|
|
1618
|
+
const ct = O, { offsetTree: It, sizeTree: Ft } = ct;
|
|
1619
1619
|
if (b === 0)
|
|
1620
1620
|
return { ...Le, totalCount: b };
|
|
1621
1621
|
if (c === 0 && p === 0)
|
|
1622
|
-
return
|
|
1622
|
+
return lt === 0 ? { ...Le, totalCount: b } : Qn(lt, L, O, Z, W, K);
|
|
1623
1623
|
if (J(Ft))
|
|
1624
|
-
return
|
|
1625
|
-
qo(Ye(L, b),
|
|
1624
|
+
return lt > 0 && !tt(T) ? null : ve(
|
|
1625
|
+
qo(Ye(L, b), ct, K, b),
|
|
1626
1626
|
[],
|
|
1627
1627
|
b,
|
|
1628
1628
|
W,
|
|
1629
|
-
|
|
1629
|
+
ct,
|
|
1630
1630
|
Z
|
|
1631
1631
|
);
|
|
1632
1632
|
const vt = [];
|
|
1633
1633
|
if (G.length > 0) {
|
|
1634
1634
|
const q = G[0], Q = G[G.length - 1];
|
|
1635
|
-
let
|
|
1635
|
+
let ut = 0;
|
|
1636
1636
|
for (const it of Xt(Ft, q, Q)) {
|
|
1637
1637
|
const et = it.value, dt = Math.max(it.start, q), Tt = Math.min(it.end, Q);
|
|
1638
|
-
for (let
|
|
1639
|
-
vt.push({ data: K?.[
|
|
1638
|
+
for (let at = dt; at <= Tt; at++)
|
|
1639
|
+
vt.push({ data: K?.[at], index: at, offset: ut, size: et }), ut += et;
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
if (!F)
|
|
1643
|
-
return ve([], vt, b, W,
|
|
1643
|
+
return ve([], vt, b, W, ct, Z);
|
|
1644
1644
|
const Ot = G.length > 0 ? G[G.length - 1] + 1 : 0, pe = Wo(It, c, p, Ot);
|
|
1645
1645
|
if (pe.length === 0)
|
|
1646
1646
|
return null;
|
|
1647
1647
|
const Yt = b - 1, Vt = be([], (q) => {
|
|
1648
1648
|
for (const Q of pe) {
|
|
1649
|
-
const
|
|
1650
|
-
let it =
|
|
1651
|
-
const dt =
|
|
1652
|
-
if (
|
|
1653
|
-
et += Math.floor((c -
|
|
1654
|
-
const
|
|
1655
|
-
it +=
|
|
1649
|
+
const ut = Q.value;
|
|
1650
|
+
let it = ut.offset, et = Q.start;
|
|
1651
|
+
const dt = ut.size;
|
|
1652
|
+
if (ut.offset < c) {
|
|
1653
|
+
et += Math.floor((c - ut.offset + W) / (dt + W));
|
|
1654
|
+
const at = et - Q.start;
|
|
1655
|
+
it += at * dt + at * W;
|
|
1656
1656
|
}
|
|
1657
1657
|
et < Ot && (it += (Ot - et) * dt, et = Ot);
|
|
1658
1658
|
const Tt = Math.min(Q.end, Yt);
|
|
1659
|
-
for (let
|
|
1660
|
-
q.push({ data: K?.[
|
|
1659
|
+
for (let at = et; at <= Tt && !(it >= p); at++)
|
|
1660
|
+
q.push({ data: K?.[at], index: at, offset: it, size: dt }), it += dt + W;
|
|
1661
1661
|
}
|
|
1662
1662
|
}), H = bn(ft, ue), j = bn(ft, ae);
|
|
1663
1663
|
if (Vt.length > 0 && (H > 0 || j > 0)) {
|
|
1664
1664
|
const q = Vt[0], Q = Vt[Vt.length - 1];
|
|
1665
1665
|
if (H > 0 && q.index > Ot) {
|
|
1666
|
-
const
|
|
1666
|
+
const ut = Math.min(H, q.index - Ot), it = [];
|
|
1667
1667
|
let et = q.offset;
|
|
1668
|
-
for (let dt = q.index - 1; dt >= q.index -
|
|
1669
|
-
const
|
|
1670
|
-
et -=
|
|
1668
|
+
for (let dt = q.index - 1; dt >= q.index - ut; dt--) {
|
|
1669
|
+
const at = Xt(Ft, dt, dt)[0]?.value ?? q.size;
|
|
1670
|
+
et -= at + W, it.unshift({ data: K?.[dt], index: dt, offset: et, size: at });
|
|
1671
1671
|
}
|
|
1672
1672
|
Vt.unshift(...it);
|
|
1673
1673
|
}
|
|
1674
1674
|
if (j > 0 && Q.index < Yt) {
|
|
1675
|
-
const
|
|
1675
|
+
const ut = Math.min(j, Yt - Q.index);
|
|
1676
1676
|
let it = Q.offset + Q.size + W;
|
|
1677
|
-
for (let et = Q.index + 1; et <= Q.index +
|
|
1677
|
+
for (let et = Q.index + 1; et <= Q.index + ut; et++) {
|
|
1678
1678
|
const Tt = Xt(Ft, et, et)[0]?.value ?? Q.size;
|
|
1679
1679
|
Vt.push({ data: K?.[et], index: et, offset: it, size: Tt }), it += Tt + W;
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
return ve(Vt, vt, b, W,
|
|
1683
|
+
return ve(Vt, vt, b, W, ct, Z);
|
|
1684
1684
|
}
|
|
1685
1685
|
),
|
|
1686
1686
|
//@ts-expect-error filter needs to be fixed
|
|
@@ -3079,30 +3079,30 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3079
3079
|
{ customScrollParent: g, useWindowScroll: T, windowScrollContainerState: a, windowScrollTo: C, windowViewportRect: I },
|
|
3080
3080
|
w
|
|
3081
3081
|
]) => {
|
|
3082
|
-
const B = y(0), N = y(0), c = y(On), p = y({ height: 0, width: 0 }), b = y({ height: 0, width: 0 }), O = U(), L = U(), F = y(0), G = y(null), Z = y({ column: 0, row: 0 }), W = U(), ft = U(), K = y(!1),
|
|
3082
|
+
const B = y(0), N = y(0), c = y(On), p = y({ height: 0, width: 0 }), b = y({ height: 0, width: 0 }), O = U(), L = U(), F = y(0), G = y(null), Z = y({ column: 0, row: 0 }), W = U(), ft = U(), K = y(!1), lt = y(0), ct = y(!0), It = y(!1), Ft = y(!1);
|
|
3083
3083
|
X(
|
|
3084
3084
|
S(
|
|
3085
3085
|
v,
|
|
3086
|
-
$(
|
|
3086
|
+
$(lt),
|
|
3087
3087
|
V(([H, j]) => !Ae(j))
|
|
3088
3088
|
),
|
|
3089
3089
|
() => {
|
|
3090
|
-
_(
|
|
3090
|
+
_(ct, !1);
|
|
3091
3091
|
}
|
|
3092
3092
|
), X(
|
|
3093
3093
|
S(
|
|
3094
|
-
mt(v,
|
|
3095
|
-
V(([H, j, q, Q, ,
|
|
3094
|
+
mt(v, ct, b, p, lt, It),
|
|
3095
|
+
V(([H, j, q, Q, , ut]) => H && !j && q.height !== 0 && Q.height !== 0 && !ut)
|
|
3096
3096
|
),
|
|
3097
3097
|
([, , , , H]) => {
|
|
3098
3098
|
if (H === void 0) {
|
|
3099
|
-
_(
|
|
3099
|
+
_(ct, !0);
|
|
3100
3100
|
return;
|
|
3101
3101
|
}
|
|
3102
3102
|
_(It, !0), qe(1, () => {
|
|
3103
3103
|
_(O, H);
|
|
3104
3104
|
}), Et(S(d), () => {
|
|
3105
|
-
_(e, [0, 0]), _(
|
|
3105
|
+
_(e, [0, 0]), _(ct, !0);
|
|
3106
3106
|
});
|
|
3107
3107
|
}
|
|
3108
3108
|
), z(
|
|
@@ -3156,8 +3156,8 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3156
3156
|
P(G),
|
|
3157
3157
|
P(N),
|
|
3158
3158
|
P(K),
|
|
3159
|
-
P(
|
|
3160
|
-
P(
|
|
3159
|
+
P(ct),
|
|
3160
|
+
P(lt)
|
|
3161
3161
|
),
|
|
3162
3162
|
V(([, , , , , , , H]) => !H),
|
|
3163
3163
|
k(
|
|
@@ -3165,25 +3165,25 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3165
3165
|
H,
|
|
3166
3166
|
[j, q],
|
|
3167
3167
|
Q,
|
|
3168
|
-
|
|
3168
|
+
ut,
|
|
3169
3169
|
it,
|
|
3170
3170
|
et,
|
|
3171
3171
|
dt,
|
|
3172
3172
|
,
|
|
3173
3173
|
Tt,
|
|
3174
|
-
|
|
3174
|
+
at
|
|
3175
3175
|
]) => {
|
|
3176
|
-
const { column: Pt, row: ee } = Q, { height: he, width: Be } =
|
|
3176
|
+
const { column: Pt, row: ee } = Q, { height: he, width: Be } = ut, { width: ln } = it;
|
|
3177
3177
|
if (dt === 0 && (H === 0 || ln === 0))
|
|
3178
3178
|
return On;
|
|
3179
3179
|
if (Be === 0) {
|
|
3180
|
-
const fn = Ye(
|
|
3180
|
+
const fn = Ye(at, H), go = fn + Math.max(dt - 1, 0);
|
|
3181
3181
|
return Pr(Fn(fn, go, et));
|
|
3182
3182
|
}
|
|
3183
3183
|
const ge = mo(ln, Be, Pt);
|
|
3184
3184
|
let Zt, _t;
|
|
3185
3185
|
Tt ? j === 0 && q === 0 && dt > 0 ? (Zt = 0, _t = dt - 1) : (Zt = ge * we((j + ee) / (he + ee)), _t = ge * Ln((q + ee) / (he + ee)) - 1, _t = Ve(H - 1, oe(_t, ge - 1)), Zt = Ve(_t, oe(0, Zt))) : (Zt = 0, _t = -1);
|
|
3186
|
-
const cn = Fn(Zt, _t, et), { bottom: un, top: an } = Vn(it, Q,
|
|
3186
|
+
const cn = Fn(Zt, _t, et), { bottom: un, top: an } = Vn(it, Q, ut, cn), dn = Ln(H / ge), ho = dn * he + (dn - 1) * ee - un;
|
|
3187
3187
|
return { bottom: un, itemHeight: he, items: cn, itemWidth: Be, offsetBottom: ho, offsetTop: an, top: an };
|
|
3188
3188
|
}
|
|
3189
3189
|
)
|
|
@@ -3201,8 +3201,8 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3201
3201
|
mt(p, b, c, Z),
|
|
3202
3202
|
V(([H, j, { items: q }]) => q.length > 0 && j.height !== 0 && H.height !== 0),
|
|
3203
3203
|
k(([H, j, { items: q }, Q]) => {
|
|
3204
|
-
const { bottom:
|
|
3205
|
-
return [it,
|
|
3204
|
+
const { bottom: ut, top: it } = Vn(H, Q, j, q);
|
|
3205
|
+
return [it, ut];
|
|
3206
3206
|
}),
|
|
3207
3207
|
ot(Jt)
|
|
3208
3208
|
),
|
|
@@ -3228,8 +3228,8 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3228
3228
|
}),
|
|
3229
3229
|
$(vt),
|
|
3230
3230
|
V(([[H, j], q]) => {
|
|
3231
|
-
const
|
|
3232
|
-
return (q || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === j) &&
|
|
3231
|
+
const ut = H.items[H.items.length - 1].index === j - 1;
|
|
3232
|
+
return (q || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === j) && ut;
|
|
3233
3233
|
}),
|
|
3234
3234
|
// Keying on the data array lets replaced data with a previously reported length fire again, matching
|
|
3235
3235
|
// the list. withLatestFrom(data) subscribes after gridState and would still hold the previous array.
|
|
@@ -3261,11 +3261,11 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3261
3261
|
S(
|
|
3262
3262
|
O,
|
|
3263
3263
|
$(p, b, B, Z),
|
|
3264
|
-
k(([H, j, q, Q,
|
|
3264
|
+
k(([H, j, q, Q, ut]) => {
|
|
3265
3265
|
const it = Xn(H), { align: et, behavior: dt, offset: Tt } = it;
|
|
3266
|
-
let
|
|
3267
|
-
|
|
3268
|
-
let Pt = _e(j,
|
|
3266
|
+
let at = it.index;
|
|
3267
|
+
at === "LAST" && (at = Q - 1), at = oe(0, Ve(Q - 1, at));
|
|
3268
|
+
let Pt = _e(j, ut, q, at);
|
|
3269
3269
|
return et === "end" ? Pt = zn(Pt - j.height + q.height) : et === "center" && (Pt = zn(Pt - j.height / 2 + q.height / 2)), Tt !== void 0 && Tt !== 0 && (Pt += Tt), { behavior: dt, top: Pt };
|
|
3270
3270
|
})
|
|
3271
3271
|
),
|
|
@@ -3314,7 +3314,7 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3314
3314
|
// output
|
|
3315
3315
|
gridState: c,
|
|
3316
3316
|
horizontalDirection: Ft,
|
|
3317
|
-
initialTopMostItemIndex:
|
|
3317
|
+
initialTopMostItemIndex: lt,
|
|
3318
3318
|
totalListHeight: Vt,
|
|
3319
3319
|
...h,
|
|
3320
3320
|
endReached: Ot,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-virtuoso",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.19",
|
|
4
4
|
"description": "A virtual scroll React component for efficiently rendering large scrollable lists, grids, tables, and feeds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chat",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@emotion/styled": "^11.10.8",
|
|
48
|
-
"@faker-js/faker": "^
|
|
48
|
+
"@faker-js/faker": "^10.5.0",
|
|
49
49
|
"@ladle/react": "^5.1.1",
|
|
50
50
|
"@microsoft/api-extractor": "^7.57.7",
|
|
51
51
|
"@playwright/test": "^1.60.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react-dom": "^19.2.3",
|
|
63
63
|
"react-router-dom": "^6.14.0",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
|
-
"uuid": "^
|
|
65
|
+
"uuid": "^14.0.1",
|
|
66
66
|
"vite": "^7.3.1",
|
|
67
67
|
"vite-plugin-dts": "^4.5.4",
|
|
68
68
|
"vitest": "^4.1.5"
|