@pdanpdan/virtual-scroll 0.8.0 → 0.9.1
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/README.md +104 -11
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +299 -32
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +954 -898
- package/dist/index.mjs.map +1 -1
- package/dist/virtual-scroll.css +1 -1
- package/package.json +1 -1
- package/src/components/VirtualScroll.vue +301 -209
- package/src/components/VirtualScrollbar.vue +8 -8
- package/src/composables/useVirtualScroll.ts +277 -524
- package/src/composables/useVirtualScrollSizes.ts +459 -0
- package/src/composables/useVirtualScrollbar.ts +30 -35
- package/src/index.ts +1 -0
- package/src/types.ts +25 -2
- package/src/utils/scroll.ts +14 -14
- package/src/utils/virtual-scroll-logic.ts +316 -3
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.VirtualScroll={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let n={items:[],currentIndex:0,currentColIndex:0,currentEndIndex:0,currentEndColIndex:0,scrollOffset:{x:0,y:0},displayScrollOffset:{x:0,y:0},viewportSize:{width:0,height:0},displayViewportSize:{width:0,height:0},totalSize:{width:0,height:0},isScrolling:!1,isProgrammaticScroll:!1,range:{start:0,end:0},columnRange:{start:0,end:0,padStart:0,padEnd:0}};var r=class{tree;values;constructor(e){this.tree=new Float64Array(e+1),this.values=new Float64Array(e)}update(e,t){if(!(e<0||e>=this.values.length))for(this.values[e]=this.values[e]+t,e++;e<this.tree.length;)this.tree[e]=this.tree[e]+t,e+=e&-e}query(e){let t=0;for(;e>0;)t+=this.tree[e]||0,e-=e&-e;return t}set(e,t){e<0||e>=this.values.length||(this.values[e]=t)}get length(){return this.values.length}get(e){return this.values[e]||0}getValues(){return this.values}findLowerBound(e){let t=0,n=this.tree.length,r=1<<Math.floor(Math.log2(n-1));for(;r>0;){let i=t+r;if(i<n){let n=this.tree[i]||0;n<=e&&(t=i,e-=n)}r>>=1}return t}rebuild(){this.tree.fill(0);for(let e=0;e<this.values.length;e++)this.tree[e+1]=this.values[e]||0;for(let e=1;e<this.tree.length;e++){let t=e+(e&-e);t<this.tree.length&&(this.tree[t]=this.tree[t]+this.tree[e])}}resize(e){if(e===this.values.length)return;let t=new Float64Array(e);t.set(this.values.subarray(0,Math.min(e,this.values.length))),this.values=t,this.tree=new Float64Array(e+1),this.rebuild()}shift(e){if(e===0)return;let t=this.values.length,n=new Float64Array(t);e>0?n.set(this.values.subarray(0,Math.min(t-e,this.values.length)),e):n.set(this.values.subarray(-e)),this.values=n,this.rebuild()}};let i=1e7;function a(e){return e===null||e===document.documentElement||typeof window<`u`&&e===window}function o(e){return typeof e==`object`&&!!e&&`tagName`in e&&e.tagName===`BODY`}function s(e){return a(e)||o(e)}function c(e){return e!=null&&`getBoundingClientRect`in e}function l(e){return e!=null&&`scrollLeft`in e}function u(e,t){a(e)?window.scrollTo(t):e!=null&&l(e)&&(typeof e.scrollTo==`function`?e.scrollTo(t):(t.left!==void 0&&(e.scrollLeft=t.left),t.top!==void 0&&(e.scrollTop=t.top)))}function d(e){return typeof e==`object`&&!!e&&(`align`in e||`behavior`in e||`isCorrection`in e)}function f(e,t){return typeof e==`object`&&e?e.x||0:(t===`horizontal`||t===`both`)&&e||0}function p(e,t){return typeof e==`object`&&e?e.y||0:(t===`vertical`||t===`both`)&&e||0}function m({scrollPos:e,containerSize:t,count:n,bufferBefore:r,bufferAfter:i,gap:a,fixedSize:o,findLowerBound:s,query:c}){let l=0,u=n,d=e+t;if(o!==null){let t=o+a;l=Math.floor(e/t),u=Math.ceil(d/t)}else l=s(e),u=s(d),u<n&&c(u)<d&&u++;return{start:Math.max(0,l-r),end:Math.min(n,u+i)}}function h(e,t){let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1;e[a]>t?(i=e[a],r=a-1):n=a+1}return i}function g(e,t){let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1;e[a]<t?(i=e[a],n=a+1):r=a-1}return i}function _({align:e,targetPos:t,itemSize:n,scrollPos:r,viewSize:i,stickyOffsetStart:a,stickyOffsetEnd:o}){let s=t-a,c=t-(i-o-n);return e===`start`?{target:s,effectiveAlign:`start`}:e===`center`?{target:t-a-(i-a-o-n)/2,effectiveAlign:`center`}:e===`end`?{target:c,effectiveAlign:`end`}:x(t,n,r,i,a,o)?{target:r,effectiveAlign:`auto`}:n<=i-a-o?t<r+a?{target:s,effectiveAlign:`start`}:{target:c,effectiveAlign:`end`}:Math.abs(s-r)<Math.abs(c-r)?{target:s,effectiveAlign:`start`}:{target:c,effectiveAlign:`end`}}function v(e,t,n,r){return e<=0?0:t===null?Math.max(0,r(e)-n):Math.max(0,e*(t+n)-n)}function y({index:e,align:t,viewSize:n,scrollPos:r,fixedSize:i,gap:a,query:o,getSize:s,stickyIndices:c,stickyStart:l,stickyEnd:u=0}){let d=l;if(c&&c.length>0){let t=g(c,e);t!==void 0&&(d+=v(1,i,0,()=>s(t)))}let f=i===null?o(e):e*(i+a),p=i===null?s(e)-a:i,{target:m,effectiveAlign:h}=_({align:t,targetPos:f,itemSize:p,scrollPos:r,viewSize:n,stickyOffsetStart:d,stickyOffsetEnd:u});return{target:m,itemSize:p,effectiveAlign:h}}function b(e,t,n,r,i,a){if(e<=t)return{isActive:!1,offset:0};let o=h(i,r);if(o===void 0)return{isActive:!0,offset:0};let s=a(o);return e>=s?{isActive:!1,offset:0}:{isActive:!0,offset:Math.max(0,Math.min(n,s-e))-n}}function x(e,t,n,r,i=0,a=0){let o=n+i,s=n+r-a;return t<=r-i-a?e>=o-.5&&e+t<=s+.5:e<=o+.5&&e+t>=s-.5}function S(e,t,n){return(e-t)*n}function C(e,t,n){return e/n+t}function ee({rowIndex:e,colIndex:t,options:n,direction:r,viewportWidth:a,viewportHeight:o,totalWidth:s,totalHeight:c,gap:l,columnGap:u,fixedSize:f,fixedWidth:p,relativeScrollX:m,relativeScrollY:h,getItemSizeY:g,getItemSizeX:_,getItemQueryY:v,getItemQueryX:b,getColumnSize:x,getColumnQuery:S,scaleX:C,scaleY:ee,hostOffsetX:te,hostOffsetY:w,stickyIndices:ne,stickyStartX:re=0,stickyStartY:T=0,stickyEndX:ie=0,stickyEndY:ae=0,flowPaddingStartX:E=0,flowPaddingStartY:D=0,paddingStartX:O=0,paddingStartY:k=0,paddingEndX:oe=0,paddingEndY:A=0}){let j;j=d(n)?n.align:n;let M=(j&&typeof j==`object`?j.x:j)||`auto`,N=(j&&typeof j==`object`?j.y:j)||`auto`,P=m,F=h,I=0,L=0,R=`auto`,se=`auto`,ce=C===1?s:i,z=ee===1?c:i,B=Math.max(0,te+ce-a),le=Math.max(0,w+z-o),V=(B-te)*C,H=(le-w)*ee,ue=E+re+O,de=D+T+k;if(e!=null){let t=y({index:e,align:N,viewSize:o,scrollPos:h,fixedSize:f,gap:l,query:v,getSize:g,stickyIndices:ne,stickyStart:T+k,stickyEnd:ae+A});F=t.target+de,L=t.itemSize,se=t.effectiveAlign}if(t!=null){let e=r===`both`,n=y({index:t,align:M,viewSize:a,scrollPos:m,fixedSize:e?p:f,gap:e||r===`horizontal`?u:l,query:e?S:b,getSize:e?x:_,stickyIndices:ne,stickyStart:re+O,stickyEnd:ie+oe});P=n.target+ue,I=n.itemSize,R=n.effectiveAlign}return P=Math.max(0,Math.min(P,V)),F=Math.max(0,Math.min(F,H)),{targetX:P,targetY:F,itemWidth:I,itemHeight:L,effectiveAlignX:R,effectiveAlignY:se}}function te({direction:e,relativeScrollX:t,relativeScrollY:n,usableWidth:r,usableHeight:i,itemsLength:a,bufferBefore:o,bufferAfter:s,gap:c,columnGap:l,fixedSize:u,findLowerBoundY:d,findLowerBoundX:f,queryY:p,queryX:h}){let g=e===`vertical`||e===`both`;return m({scrollPos:g?n:t,containerSize:g?i:r,count:a,bufferBefore:o,bufferAfter:s,gap:g?c:l,fixedSize:u,findLowerBound:g?d:f,query:g?p:h})}function w({columnCount:e,relativeScrollX:t,usableWidth:n,colBuffer:r,fixedWidth:i,columnGap:a,findLowerBound:o,query:s,totalColsQuery:c}){if(!e)return{start:0,end:0,padStart:0,padEnd:0};let{start:l,end:u}=m({scrollPos:t,containerSize:n,count:e,bufferBefore:r,bufferAfter:r,gap:a,fixedSize:i,findLowerBound:o,query:s}),d=l,f=u,p=i===null?s(d):d*(i+a),h=i===null?Math.max(0,c()-a):e*(i+a)-a,g=i===null?s(f)-(f>0?a:0):f*(i+a)-(f>0?a:0);return{start:d,end:f,padStart:p,padEnd:Math.max(0,h-g)}}function ne({index:e,isSticky:t,direction:n,relativeScrollX:r,relativeScrollY:i,originalX:a,originalY:o,width:s,height:c,stickyIndices:l,fixedSize:u,gap:d,columnGap:f,getItemQueryY:p,getItemQueryX:m}){let h=!1,g=!1,_={x:0,y:0};if(!t)return{isStickyActiveX:h,isStickyActiveY:g,isStickyActive:!1,stickyOffset:_};if(n===`vertical`||n===`both`){let t=b(i,o,c,e,l,e=>u===null?p(e):e*(u+d));g=t.isActive,_.y=t.offset}if(n===`horizontal`){let t=b(r,a,s,e,l,e=>u===null?m(e):e*(u+f));t.isActive&&(h=!0,_.x=t.offset)}return{isStickyActiveX:h,isStickyActiveY:g,isStickyActive:h||g,stickyOffset:_}}function re({index:e,direction:t,fixedSize:n,gap:r,columnGap:i,usableWidth:a,usableHeight:o,totalWidth:s,queryY:c,queryX:l,getSizeY:u,getSizeX:d,columnRange:f}){let p=0,m=0,h=0,g=0;return t===`horizontal`?(p=n===null?l(e):e*(n+i),h=n===null?d(e)-i:n,g=o):t===`both`&&f?(m=n===null?c(e):e*(n+r),g=n===null?u(e)-r:n,p=f.padStart,h=Math.max(0,s-f.padStart-f.padEnd)):(m=n===null?c(e):e*(n+r),g=n===null?u(e)-r:n,h=t===`both`?s:a),{height:g,width:h,x:p,y:m}}function T({item:e,direction:t,itemSize:n,containerTag:r,paddingStartX:i,paddingStartY:a,isHydrated:o,isRtl:s}){let c=t===`vertical`,l=t===`horizontal`,u=t===`both`,d=n==null||n===0,f={blockSize:l?`100%`:d?`auto`:`${e.size.height}px`};if(c&&r===`table`?f.minInlineSize=`100%`:f.inlineSize=c?`100%`:d?`auto`:`${e.size.width}px`,d&&(c||(f.minInlineSize=`1px`),l||(f.minBlockSize=`1px`)),o){let t=e.isStickyActiveY??(e.isStickyActive&&(c||u)),n=e.isStickyActiveX??(e.isStickyActive&&l),r=s?-(n?e.stickyOffset.x:e.offset.x):n?e.stickyOffset.x:e.offset.x,o=t?e.stickyOffset.y:e.offset.y;e.isStickyActive||e.isStickyActiveX||e.isStickyActiveY?(f.insetBlockStart=t?`${a}px`:`auto`,f.insetInlineStart=n?`${i}px`:`auto`,f.transform=`translate(${r}px, ${o}px)`):f.transform=`translate(${r}px, ${e.offset.y}px)`}return f}function ie({direction:e,itemsLength:t,columnCount:n,fixedSize:r,fixedWidth:i,gap:a,columnGap:o,usableWidth:s,usableHeight:c,queryY:l,queryX:u,queryColumn:d}){let f=e===`both`,p=e===`horizontal`,m=0,h=0;return f?(m=v(n,i,o,d),h=v(t,r,a,l)):p?(m=v(t,r,o,u),h=c):(m=s,h=v(t,r,a,l)),{width:f?Math.max(m,s):m,height:f?Math.max(h,c):h}}function ae(e){let n=(0,t.computed)(()=>(0,t.toValue)(e)),a=(0,t.ref)(0),o=(0,t.ref)(0),m=(0,t.ref)(!1),h=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)(!1),b=(0,t.ref)(0),x=(0,t.ref)(0),T=(0,t.reactive)({x:0,y:0}),ae=(0,t.reactive)({x:0,y:0}),E,D=(0,t.ref)(!1),O=(0,t.ref)(0),k=(0,t.ref)(0),oe=null,A=()=>{if(typeof window>`u`)return;let e=n.value.container||n.value.hostRef||window,t=c(e)?e:document.documentElement;(!oe||!(`direction`in oe))&&(oe=window.getComputedStyle(t));let r=oe.direction===`rtl`;y.value!==r&&(y.value=r)},j=new r(n.value.items?.length||0),M=new r(n.value.items?.length||0),N=new r(n.value.columnCount||0),P=(0,t.ref)(0),F=new Uint8Array,I=new Uint8Array,L=new Uint8Array,R=(0,t.ref)(null),se=(0,t.ref)(!1),ce=[],z=(0,t.computed)(()=>[`vertical`,`horizontal`,`both`].includes(n.value.direction)?n.value.direction:`vertical`),B=(0,t.computed)(()=>n.value.itemSize===void 0||n.value.itemSize===null||n.value.itemSize===0),le=(0,t.computed)(()=>n.value.columnWidth===void 0||n.value.columnWidth===null||n.value.columnWidth===0),V=(0,t.computed)(()=>typeof n.value.itemSize==`number`&&n.value.itemSize>0?n.value.itemSize:null),H=(0,t.computed)(()=>typeof n.value.columnWidth==`number`&&n.value.columnWidth>0?n.value.columnWidth:null),ue=(0,t.computed)(()=>n.value.defaultItemSize||V.value||40),de=(0,t.computed)(()=>[...n.value.stickyIndices||[]].sort((e,t)=>e-t)),fe=(0,t.computed)(()=>new Set(de.value)),U=(0,t.computed)(()=>f(n.value.scrollPaddingStart,n.value.direction)),pe=(0,t.computed)(()=>f(n.value.scrollPaddingEnd,n.value.direction)),me=(0,t.computed)(()=>p(n.value.scrollPaddingStart,n.value.direction)),he=(0,t.computed)(()=>p(n.value.scrollPaddingEnd,n.value.direction)),W=(0,t.computed)(()=>f(n.value.stickyStart,n.value.direction)),G=(0,t.computed)(()=>f(n.value.stickyEnd,n.value.direction)),K=(0,t.computed)(()=>p(n.value.stickyStart,n.value.direction)),ge=(0,t.computed)(()=>p(n.value.stickyEnd,n.value.direction)),q=(0,t.computed)(()=>f(n.value.flowPaddingStart,n.value.direction)),_e=(0,t.computed)(()=>f(n.value.flowPaddingEnd,n.value.direction)),J=(0,t.computed)(()=>p(n.value.flowPaddingStart,n.value.direction)),ve=(0,t.computed)(()=>p(n.value.flowPaddingEnd,n.value.direction)),ye=(0,t.computed)(()=>b.value-(z.value===`vertical`?0:W.value+G.value)),be=(0,t.computed)(()=>x.value-(z.value===`horizontal`?0:K.value+ge.value)),xe=(0,t.computed)(()=>{if(P.value,!h.value&&n.value.ssrRange&&!v.value){let{start:e=0,end:t=0,colStart:r=0,colEnd:i=0}=n.value.ssrRange,a=n.value.columnCount||0,o=n.value.gap||0,s=n.value.columnGap||0,c=0,l=0;if(z.value===`both`){if(a>0){let e=i||a,t=N.query(e)-N.query(r);c=Math.max(0,t-(e>r?s:0))}if(V.value!==null){let n=t-e;l=Math.max(0,n*(V.value+o)-(n>0?o:0))}else{let n=M.query(t)-M.query(e);l=Math.max(0,n-(t>e?o:0))}}else if(z.value===`horizontal`){if(V.value!==null){let n=t-e;c=Math.max(0,n*(V.value+s)-(n>0?s:0))}else{let n=j.query(t)-j.query(e);c=Math.max(0,n-(t>e?s:0))}l=be.value}else if(c=ye.value,V.value!==null){let n=t-e;l=Math.max(0,n*(V.value+o)-(n>0?o:0))}else{let n=M.query(t)-M.query(e);l=Math.max(0,n-(t>e?o:0))}return{width:Math.max(c,ye.value),height:Math.max(l,be.value)}}return ie({direction:z.value,itemsLength:n.value.items.length,columnCount:n.value.columnCount||0,fixedSize:V.value,fixedWidth:H.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,usableWidth:ye.value,usableHeight:be.value,queryY:e=>M.query(e),queryX:e=>j.query(e),queryColumn:e=>N.query(e)})}),Se=(0,t.computed)(()=>s(n.value.container)),Ce=(0,t.computed)(()=>xe.value.width+U.value+pe.value),we=(0,t.computed)(()=>xe.value.height+me.value+he.value),Y=(0,t.computed)(()=>q.value+W.value+G.value+_e.value+Ce.value),X=(0,t.computed)(()=>J.value+K.value+ge.value+ve.value+we.value),Te=(0,t.reactive)({x:(0,t.computed)(()=>Math.max(0,T.x-(q.value+W.value))),y:(0,t.computed)(()=>Math.max(0,T.y-(J.value+K.value)))}),Ee=(0,t.computed)(()=>Se.value?Y.value:Math.min(Y.value,i)),De=(0,t.computed)(()=>Se.value?X.value:Math.min(X.value,i)),Oe=(0,t.computed)(()=>Se.value?Ce.value:Math.max(0,Ee.value-(q.value+W.value+G.value+_e.value))),ke=(0,t.computed)(()=>Se.value?we.value:Math.max(0,De.value-(J.value+K.value+ge.value+ve.value))),Z=(0,t.computed)(()=>{if(Se.value||Y.value<=1e7)return 1;let e=Y.value-b.value,t=Ee.value-b.value;return t>0?e/t:1}),Ae=(0,t.computed)(()=>{if(Se.value||X.value<=1e7)return 1;let e=X.value-x.value,t=De.value-x.value;return t>0?e/t:1}),je=(0,t.computed)(()=>{if(z.value===`vertical`)return 0;let e=q.value+W.value+U.value;return O.value-e}),Q=(0,t.computed)(()=>{if(z.value===`horizontal`)return 0;let e=J.value+K.value+me.value;return k.value-e}),Me=e=>{P.value;let t=n.value.columnGap||0,r=n.value.columnWidth;if(typeof r==`number`&&r>0)return r;if(Array.isArray(r)&&r.length>0){let t=r[e%r.length];return t!=null&&t>0?t:n.value.defaultColumnWidth||100}if(typeof r==`function`)return r(e);let i=N.get(e);return i>0?i-t:n.value.defaultColumnWidth||100},Ne=e=>{if(P.value,z.value===`horizontal`)return be.value;let t=n.value.gap||0,r=n.value.itemSize;if(typeof r==`number`&&r>0)return r;if(typeof r==`function`){let t=n.value.items[e];return t===void 0?n.value.defaultItemSize||40:r(t,e)}let i=M.get(e);return i>0?i-t:n.value.defaultItemSize||40};function Pe(e,t,r){let i=typeof r==`object`&&r&&`isCorrection`in r?r.isCorrection:!1,s=n.value.container||window,{targetX:c,targetY:l,effectiveAlignX:f,effectiveAlignY:p}=ee({rowIndex:e,colIndex:t,options:r,direction:z.value,viewportWidth:b.value,viewportHeight:x.value,totalWidth:Y.value,totalHeight:X.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:V.value,fixedWidth:H.value,relativeScrollX:je.value,relativeScrollY:Q.value,getItemSizeY:e=>M.get(e),getItemSizeX:e=>j.get(e),getItemQueryY:e=>M.query(e),getItemQueryX:e=>j.query(e),getColumnSize:e=>N.get(e),getColumnQuery:e=>N.query(e),scaleX:Z.value,scaleY:Ae.value,hostOffsetX:Te.x,hostOffsetY:Te.y,stickyIndices:de.value,stickyStartX:W.value,stickyStartY:K.value,stickyEndX:G.value,stickyEndY:ge.value,flowPaddingStartX:q.value,flowPaddingStartY:J.value,paddingStartX:U.value,paddingStartY:me.value,paddingEndX:pe.value,paddingEndY:he.value});if(!i){let n=d(r)?r.behavior:void 0;R.value={rowIndex:e,colIndex:t,options:{align:{x:f,y:p},...n==null?{}:{behavior:n}}}}let m=C(c,Te.x,Z.value),h=C(l,Te.y,Ae.value),g=y.value?-m:m,_=h,v;d(r)&&(v=r.behavior);let S=i?`auto`:v||`smooth`;D.value=!0;let te={behavior:S};if(t!=null&&(te.left=y.value?g:Math.max(0,g)),e!=null&&(te.top=Math.max(0,_)),u(s,te),(S===`auto`||S===void 0)&&(t!=null&&(a.value=y.value?g:Math.max(0,g),O.value=c),e!=null&&(o.value=Math.max(0,_),k.value=l),R.value)){let e=R.value.options;d(e)?e.behavior=`auto`:R.value.options={align:e,behavior:`auto`}}}let Fe=(e,t,r)=>{let i=n.value.container||window;D.value=!0,R.value=null;let s=e==null?null:Math.max(0,Math.min(e,Y.value-b.value)),c=t==null?null:Math.max(0,Math.min(t,X.value-x.value));s!==null&&(O.value=s),c!==null&&(k.value=c);let l=typeof window<`u`&&i===window?window.scrollX:i.scrollLeft,d=typeof window<`u`&&i===window?window.scrollY:i.scrollTop,f=s===null?null:C(s,Te.x,Z.value),p=c===null?null:C(c,Te.y,Ae.value),m=f===null?l:y.value?-f:f,h=p===null?d:p,g={behavior:r?.behavior||`auto`};e!=null&&(g.left=m),t!=null&&(g.top=h),u(i,g),(r?.behavior===`auto`||r?.behavior===void 0)&&(e!=null&&(a.value=m),t!=null&&(o.value=h))},Ie=(e,t)=>{if(j.resize(e),M.resize(e),N.resize(t),I.length!==e){let t=new Uint8Array(e);t.set(I.subarray(0,Math.min(e,I.length))),I=t}if(L.length!==e){let t=new Uint8Array(e);t.set(L.subarray(0,Math.min(e,L.length))),L=t}if(F.length!==t){let e=new Uint8Array(t);e.set(F.subarray(0,Math.min(t,F.length))),F=e}},Le=()=>{let e=n.value.items.length,t=n.value.columnCount||0,r=n.value.gap||0,i=n.value.columnGap||0,a=n.value.columnWidth,o=!1,s=!1;if(t>0)for(let e=0;e<t;e++){let t=N.get(e),r=F[e]===1;if(!le.value||!r&&t===0){let r=0;r=typeof a==`number`&&a>0?a:Array.isArray(a)&&a.length>0?a[e%a.length]||n.value.defaultColumnWidth||100:typeof a==`function`?a(e):n.value.defaultColumnWidth||100;let s=r+i;Math.abs(t-s)>.5?(N.set(e,s),F[e]=le.value?0:1,o=!0):le.value||(F[e]=1)}}for(let t=0;t<e;t++){let e=n.value.items[t],a=j.get(t),o=M.get(t),c=I[t]===1,l=L[t]===1;if(z.value===`horizontal`){if(!B.value||!c&&a===0){let r=(typeof n.value.itemSize==`function`?n.value.itemSize(e,t):ue.value)+i;Math.abs(a-r)>.5?(j.set(t,r),I[t]=B.value?0:1,s=!0):B.value||(I[t]=1)}}else a!==0&&(j.set(t,0),I[t]=0,s=!0);if(z.value!==`horizontal`){if(!B.value||!l&&o===0){let i=(typeof n.value.itemSize==`function`?n.value.itemSize(e,t):ue.value)+r;Math.abs(o-i)>.5?(M.set(t,i),L[t]=B.value?0:1,s=!0):B.value||(L[t]=1)}}else o!==0&&(M.set(t,0),L[t]=0,s=!0)}o&&N.rebuild(),s&&(j.rebuild(),M.rebuild())},$=()=>{let e=n.value.items,r=e.length;Ie(r,n.value.columnCount||0);let i=0;if(n.value.restoreScrollOnPrepend&&ce.length>0&&r>ce.length){let t=ce[0];if(t!==void 0){for(let n=1;n<=r-ce.length;n++)if(e[n]===t){i=n;break}}}if(i>0){j.shift(i),M.shift(i),R.value&&R.value.rowIndex!==null&&R.value.rowIndex!==void 0&&(R.value.rowIndex+=i);let a=new Uint8Array(r),o=new Uint8Array(r);a.set(I.subarray(0,Math.min(r-i,I.length)),i),o.set(L.subarray(0,Math.min(r-i,L.length)),i),I=a,L=o;let s=n.value.gap||0,c=n.value.columnGap||0,l=0,u=0;for(let t=0;t<i;t++){let r=typeof n.value.itemSize==`function`?n.value.itemSize(e[t],t):ue.value;z.value===`horizontal`?l+=r+c:u+=r+s}(l>0||u>0)&&(0,t.nextTick)(()=>{Fe(l>0?je.value+l:null,u>0?Q.value+u:null,{behavior:`auto`,isCorrection:!0})})}Le(),ce=[...e],se.value=!0,P.value++},Re=()=>{if(typeof window>`u`)return;let e=n.value.container||window,t=t=>{let n=t.getBoundingClientRect();if(e===window)return{x:y.value?document.documentElement.clientWidth-n.right-window.scrollX:n.left+window.scrollX,y:n.top+window.scrollY};if(e===t)return{x:0,y:0};if(c(e)){let t=e.getBoundingClientRect();return{x:y.value?t.right-n.right-e.scrollLeft:n.left-t.left+e.scrollLeft,y:n.top-t.top+e.scrollTop}}return{x:0,y:0}};if(n.value.hostElement){let e=t(n.value.hostElement);(Math.abs(T.x-e.x)>.1||Math.abs(T.y-e.y)>.1)&&(T.x=e.x,T.y=e.y)}if(n.value.hostRef){let e=t(n.value.hostRef);(Math.abs(ae.x-e.x)>.1||Math.abs(ae.y-e.y)>.1)&&(ae.x=e.x,ae.y=e.y)}};(0,t.watch)([()=>n.value.items,()=>n.value.items.length,()=>n.value.direction,()=>n.value.columnCount,()=>n.value.columnWidth,()=>n.value.itemSize,()=>n.value.gap,()=>n.value.columnGap,()=>n.value.defaultItemSize,()=>n.value.defaultColumnWidth],$,{immediate:!0}),(0,t.watch)(()=>[n.value.container,n.value.hostElement],()=>{Re()}),(0,t.watch)(y,(e,t)=>{if(t===void 0||e===t||!v.value)return;if(z.value===`vertical`){Re();return}let n=S(t?Math.abs(a.value):a.value,T.x,Z.value);Re(),Fe(n,null,{behavior:`auto`})},{flush:`sync`}),(0,t.watch)([Z,Ae],()=>{!v.value||m.value||D.value||Fe(O.value,k.value,{behavior:`auto`})}),(0,t.watch)([()=>n.value.items.length,()=>n.value.columnCount],([e,n],[r,i])=>{(0,t.nextTick)(()=>{let t=Math.max(0,Y.value-b.value),a=Math.max(0,X.value-x.value);O.value>t||k.value>a?Fe(Math.min(O.value,t),Math.min(k.value,a),{behavior:`auto`}):(e!==r&&Ae.value!==1||n!==i&&Z.value!==1)&&Fe(O.value,k.value,{behavior:`auto`}),Re()})});let ze=e=>{let t=n.value.gap||0,r=n.value.columnGap||0,i=V.value;if(z.value===`horizontal`){let t=(i||0)+r;return i!==null&&t>0?Math.floor(e/t):j.findLowerBound(e)}let a=(i||0)+t;return i!==null&&a>0?Math.floor(e/a):M.findLowerBound(e)},Be=e=>z.value===`both`?N.findLowerBound(e):z.value===`horizontal`?ze(e):0,Ve=(0,t.computed)(()=>{if(P.value,(!h.value||_.value)&&n.value.ssrRange)return{start:n.value.ssrRange.start,end:n.value.ssrRange.end};let e=n.value.ssrRange&&!m.value?0:n.value.bufferBefore??5,t=n.value.bufferAfter??5;return te({direction:z.value,relativeScrollX:je.value,relativeScrollY:Q.value,usableWidth:ye.value,usableHeight:be.value,itemsLength:n.value.items.length,bufferBefore:e,bufferAfter:t,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:V.value,findLowerBoundY:e=>M.findLowerBound(e),findLowerBoundX:e=>j.findLowerBound(e),queryY:e=>M.query(e),queryX:e=>j.query(e)})}),He=(0,t.computed)(()=>{P.value;let e=je.value+W.value,t=Q.value+K.value;return ze(z.value===`horizontal`?e:t)}),Ue=(0,t.computed)(()=>{P.value;let e=n.value.columnCount||0;if(!e)return{start:0,end:0,padStart:0,padEnd:0};if((!h.value||_.value)&&n.value.ssrRange){let{colStart:t=0,colEnd:r=0}=n.value.ssrRange,i=Math.max(0,t),a=Math.min(e,r||e),o=n.value.columnGap||0,s=H.value===null?N.query(i):i*(H.value+o),c=H.value===null?Math.max(0,N.query(e)-o):e*(H.value+o)-o,l=H.value===null?N.query(a)-(a>0?o:0):a*(H.value+o)-(a>0?o:0);return{start:i,end:a,padStart:s,padEnd:Math.max(0,c-l)}}let t=n.value.ssrRange&&!m.value?0:2;return w({columnCount:e,relativeScrollX:je.value,usableWidth:ye.value,colBuffer:t,fixedWidth:H.value,columnGap:n.value.columnGap||0,findLowerBound:e=>N.findLowerBound(e),query:e=>N.query(e),totalColsQuery:()=>N.query(e)})}),We=[],Ge=(0,t.computed)(()=>{P.value;let{start:e,end:t}=Ve.value,r=[],i=V.value,a=n.value.gap||0,o=n.value.columnGap||0,s=de.value,c=fe.value,l=[];if(h.value||!n.value.ssrRange){let t=He.value,n=g(s,t);n!==void 0&&n<e&&l.push(n)}for(let n=e;n<t;n++)l.push(n);let u=n.value.ssrRange?.start||0,d=n.value.ssrRange?.colStart||0,f=0,p=0;!h.value&&n.value.ssrRange&&(p=z.value===`horizontal`?0:i===null?M.query(u):u*(i+a),z.value===`horizontal`?f=i===null?j.query(d):d*(i+o):z.value===`both`&&(f=N.query(d)));let m=new Map(We.map(e=>[e.index,e])),_=-1,v=0,y=-1,b=0,x=e=>e===_+1?(v+=j.get(_),_=e,v):(v=j.query(e),_=e,v),S=e=>e===y+1?(b+=M.get(y),y=e,b):(b=M.query(e),y=e,b),C=q.value+W.value+U.value,ee=J.value+K.value+me.value,te=q.value+W.value,w=J.value+K.value,T=Ue.value;for(let e of l){let t=n.value.items[e];if(t===void 0)continue;let{x:i,y:a,width:o,height:l}=re({index:e,direction:z.value,fixedSize:V.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,usableWidth:ye.value,usableHeight:be.value,totalWidth:xe.value.width,queryY:S,queryX:x,getSizeY:e=>M.get(e),getSizeX:e=>j.get(e),columnRange:T}),u=c.has(e),d=i,g=a,{isStickyActive:_,isStickyActiveX:v,isStickyActiveY:y,stickyOffset:b}=ne({index:e,isSticky:u,direction:z.value,relativeScrollX:je.value,relativeScrollY:Q.value,originalX:d,originalY:g,width:o,height:l,stickyIndices:s,fixedSize:V.value,fixedWidth:H.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,getItemQueryY:S,getItemQueryX:x}),ie=h.value?O.value/Z.value+(i+C-O.value)-te:i-f,ae=h.value?k.value/Ae.value+(a+ee-k.value)-w:a-p,E=m.get(e);E&&E.item===t&&E.offset.x===ie&&E.offset.y===ae&&E.size.width===o&&E.size.height===l&&E.isSticky===u&&E.isStickyActive===_&&E.isStickyActiveX===v&&E.isStickyActiveY===y&&E.stickyOffset.x===b.x&&E.stickyOffset.y===b.y?r.push(E):r.push({item:t,index:e,offset:{x:ie,y:ae},size:{width:o,height:l},originalX:d,originalY:g,isSticky:u,isStickyActive:_,isStickyActiveX:v,isStickyActiveY:y,stickyOffset:b})}return We=r,r}),Ke=(0,t.computed)(()=>{P.value;let e=je.value+W.value,t=Q.value+K.value,n=je.value+(b.value-G.value)-1,r=Q.value+(x.value-ge.value)-1,i=Be(e),s=ze(t),c=ze(z.value===`horizontal`?n:r),l=Be(n);return{items:Ge.value,currentIndex:s,currentColIndex:i,currentEndIndex:c,currentEndColIndex:l,scrollOffset:{x:O.value,y:k.value},displayScrollOffset:{x:y.value?Math.abs(a.value+ae.x):Math.max(0,a.value-ae.x),y:Math.max(0,o.value-ae.y)},viewportSize:{width:b.value,height:x.value},displayViewportSize:{width:b.value,height:x.value},totalSize:{width:Y.value,height:X.value},isScrolling:m.value,isProgrammaticScroll:D.value,range:Ve.value,columnRange:Ue.value}}),qe=()=>{D.value=!1,R.value=null},Je=e=>{let t=e.target;typeof window>`u`||(A(),t===window||t===document?(a.value=window.scrollX,o.value=window.scrollY,b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight):l(t)&&(a.value=t.scrollLeft,o.value=t.scrollTop,b.value=t.clientWidth,x.value=t.clientHeight),O.value=S(y.value?Math.abs(a.value):a.value,Te.x,Z.value),k.value=S(o.value,Te.y,Ae.value),m.value||=(D.value||(R.value=null),!0),clearTimeout(E),E=setTimeout(()=>{m.value=!1,D.value=!1},250))},Ye=e=>{let t=!1,r=0,i=0,a=n.value.gap||0,o=n.value.columnGap||0,s=je.value,c=Q.value,l=ze(z.value===`horizontal`?s:c),u=Be(s),d=z.value===`horizontal`,f=z.value===`both`,p=new Set,m=new Set,h=(e,i)=>{if(e>=0&&e<(n.value.columnCount||0)&&!m.has(e)){m.add(e);let n=N.get(e),a=i+o;if(!F[e]||Math.abs(n-a)>.1){let i=a-n;Math.abs(i)>.1&&(N.update(e,i),t=!0,e<u&&(r+=i)),F[e]=1}}};for(let{index:s,inlineSize:c,blockSize:u,element:m}of e){if(c<=0&&u<=0)continue;let e=B.value||typeof n.value.itemSize==`function`;if(s>=0&&!p.has(s)&&e&&u>0){if(p.add(s),d&&c>0){let e=j.get(s),n=c+o;if(!I[s]||Math.abs(n-e)>.1){let i=n-e;j.update(s,i),I[s]=1,t=!0,s<l&&(r+=i)}}if(!d){let e=M.get(s),n=u+a;if(!L[s]||Math.abs(n-e)>.1){let r=n-e;M.update(s,r),L[s]=1,t=!0,s<l&&(i+=r)}}}let g=le.value||typeof n.value.columnWidth==`function`;if(f&&m&&n.value.columnCount&&g&&(c>0||m.dataset.colIndex===void 0)){let e=m.dataset.colIndex;if(e!=null)h(Number.parseInt(e,10),c);else{let e=Array.from(m.querySelectorAll(`[data-col-index]`));for(let t of e)h(Number.parseInt(t.dataset.colIndex,10),t.getBoundingClientRect().width)}}}if(t&&(P.value++,!(R.value!==null||D.value)&&(r!==0||i!==0))){let e=q.value+W.value+U.value,t=J.value+K.value+me.value;Fe(r===0?null:s+r+e,i===0?null:c+i+t,{behavior:`auto`})}},Xe=(e,t,n,r)=>{Ye([{index:e,inlineSize:t,blockSize:n,element:r}])};function Ze(){if(R.value&&!_.value){let{rowIndex:e,colIndex:t,options:r}=R.value;if(d(r)&&r.behavior===`smooth`&&m.value)return;let i=n.value.container||window,a=typeof window<`u`&&i===window?window.scrollX:i.scrollLeft,o=typeof window<`u`&&i===window?window.scrollY:i.scrollTop,s=y.value?Math.abs(a):a,c=o,l=S(s,0,Z.value),u=S(c,0,Ae.value),{targetX:f,targetY:p}=ee({rowIndex:e,colIndex:t,options:r,direction:z.value,viewportWidth:b.value,viewportHeight:x.value,totalWidth:Ce.value,totalHeight:we.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:V.value,fixedWidth:H.value,relativeScrollX:l,relativeScrollY:u,getItemSizeY:e=>M.get(e),getItemSizeX:e=>j.get(e),getItemQueryY:e=>M.query(e),getItemQueryX:e=>j.query(e),getColumnSize:e=>N.get(e),getColumnQuery:e=>N.query(e),scaleX:Z.value,scaleY:Ae.value,hostOffsetX:Te.x,hostOffsetY:Te.y,stickyIndices:de.value,stickyStartX:W.value,stickyStartY:K.value,stickyEndX:G.value,stickyEndY:ge.value,flowPaddingStartX:q.value,flowPaddingStartY:J.value,paddingStartX:U.value,paddingStartY:me.value,paddingEndX:pe.value,paddingEndY:he.value}),h=t==null||Math.abs(l-f)<2,g=e==null||Math.abs(u-p)<2,_=t==null||t===void 0||F[t]===1,v=e==null||e===void 0||L[e]===1;h&&g?_&&v&&!m.value&&!D.value&&(R.value=null):Pe(e,t,d(r)?{...r,isCorrection:!0}:{align:r,isCorrection:!0})}}(0,t.watch)([P,b,x],Ze),(0,t.watch)(m,e=>{e||Ze()});let Qe=null,$e=null,et,tt=e=>{if(typeof window>`u`)return;let t=e||window,n=t===window||c(t)&&t===document.documentElement?document:t;if(n.addEventListener(`scroll`,Je,{passive:!0}),oe=null,A(),c(t)&&($e=new MutationObserver(()=>A()),$e.observe(t,{attributes:!0,attributeFilter:[`dir`,`style`]})),et=setInterval(A,1e3),t===window){b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight,a.value=window.scrollX,o.value=window.scrollY;let e=()=>{A(),b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight,Re()};return window.addEventListener(`resize`,e),()=>{n.removeEventListener(`scroll`,Je),window.removeEventListener(`resize`,e),$e?.disconnect(),clearInterval(et),oe=null}}else return b.value=t.clientWidth,x.value=t.clientHeight,a.value=t.scrollLeft,o.value=t.scrollTop,Qe=new ResizeObserver(()=>{A(),b.value=t.clientWidth,x.value=t.clientHeight,Re()}),Qe.observe(t),()=>{n.removeEventListener(`scroll`,Je),Qe?.disconnect(),$e?.disconnect(),clearInterval(et),oe=null}},nt;return(0,t.getCurrentInstance)()&&((0,t.onMounted)(()=>{v.value=!0,A(),(0,t.watch)(()=>n.value.container,e=>{nt?.(),nt=tt(e||null)},{immediate:!0}),Re(),(0,t.nextTick)(()=>{if(Re(),n.value.ssrRange||n.value.initialScrollIndex!==void 0){let e=n.value.initialScrollIndex===void 0?n.value.ssrRange?.start:n.value.initialScrollIndex,r=n.value.initialScrollAlign||`start`;e!=null&&Pe(e,n.value.ssrRange?.colStart,{align:r,behavior:`auto`}),h.value=!0,_.value=!0,(0,t.nextTick)(()=>{_.value=!1})}else h.value=!0})}),(0,t.onUnmounted)(()=>{nt?.()})),{renderedItems:Ge,totalWidth:Y,totalHeight:X,renderedWidth:Ee,renderedHeight:De,scrollDetails:Ke,getRowHeight:Ne,getColumnWidth:Me,getRowOffset:e=>J.value+K.value+me.value+M.query(e),getColumnOffset:e=>q.value+W.value+U.value+N.query(e),getItemOffset:e=>z.value===`horizontal`?q.value+W.value+U.value+j.query(e):J.value+K.value+me.value+M.query(e),getItemSize:e=>{if(z.value===`horizontal`)return Math.max(0,j.get(e)-(n.value.columnGap||0));let t=n.value.itemSize;if(typeof t==`number`&&t>0)return t;if(typeof t==`function`){let r=n.value.items[e];return r===void 0?n.value.defaultItemSize||40:t(r,e)}return Math.max(0,M.get(e)-(n.value.gap||0))},scrollToIndex:Pe,scrollToOffset:Fe,stopProgrammaticScroll:qe,updateItemSize:Xe,updateItemSizes:Ye,updateHostOffset:Re,updateDirection:A,columnRange:Ue,refresh:()=>{j.resize(0),M.resize(0),N.resize(0),F.fill(0),I.fill(0),L.fill(0),$()},isHydrated:h,isWindowContainer:Se,isRtl:y,scaleX:Z,scaleY:Ae,componentOffset:Te,renderedVirtualWidth:Oe,renderedVirtualHeight:ke}}function E(e){let n=(0,t.computed)(()=>(0,t.toValue)(e.axis)),r=(0,t.computed)(()=>(0,t.toValue)(e.totalSize)),i=(0,t.computed)(()=>(0,t.toValue)(e.position)),a=(0,t.computed)(()=>(0,t.toValue)(e.viewportSize)),o=(0,t.computed)(()=>(0,t.toValue)(e.containerId)),s=(0,t.computed)(()=>!!(0,t.toValue)(e.isRtl)),c=(0,t.computed)(()=>n.value===`horizontal`),l=(0,t.computed)(()=>r.value<=0?0:Math.min(1,a.value/r.value)),u=(0,t.computed)(()=>{let e=r.value-a.value;return e<=0?0:Math.max(0,Math.min(1,i.value/e))}),d=(0,t.computed)(()=>{let e=a.value>0?32/a.value:.1;return Math.max(Math.min(e,.1),l.value)*100}),f=(0,t.computed)(()=>u.value*(100-d.value)),p=(0,t.computed)(()=>c.value?{inlineSize:`${d.value}%`,insetInlineStart:`${f.value}%`}:{blockSize:`${d.value}%`,insetBlockStart:`${f.value}%`}),m=(0,t.computed)(()=>{let e=a.value,t=`var(--vs-scrollbar-has-cross-gap, var(--vsi-scrollbar-has-cross-gap, 0)) * var(--vs-scrollbar-cross-gap, var(--vsi-scrollbar-size, 8px))`;return c.value?{inlineSize:`calc(${Math.max(0,e-4)}px - ${t})`}:{blockSize:`calc(${Math.max(0,e-4)}px - ${t})`}}),h=(0,t.ref)(!1),g=0,_=0;function v(t){let n=t.currentTarget;if(t.target!==n)return;let i=n.getBoundingClientRect(),o=c.value?i.width:i.height,l=0;l=c.value?s.value?i.right-t.clientX:t.clientX-i.left:t.clientY-i.top;let u=d.value/100*o,f=(l-u/2)/(o-u),p=r.value-a.value,m=f*p;m>p-1&&(m=p),e.scrollToOffset(Math.max(0,Math.min(p,m)))}function y(e){h.value=!0,g=c.value?s.value?-e.clientX:e.clientX:e.clientY,_=i.value,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function b(t){if(!h.value)return;let n=t.currentTarget.parentElement;if(!n)return;let i=(c.value?s.value?-t.clientX:t.clientX:t.clientY)-g,o=n.getBoundingClientRect(),l=c.value?o.width:o.height,u=l-d.value/100*l;if(u<=0)return;let f=r.value-a.value,p=_+i/u*f;p>f-1&&(p=f),e.scrollToOffset(Math.max(0,Math.min(f,p)))}function x(e){h.value&&(h.value=!1,e.currentTarget.releasePointerCapture(e.pointerId))}return(0,t.getCurrentInstance)()&&(0,t.onUnmounted)(()=>{h.value=!1}),{viewportPercent:l,positionPercent:u,thumbSizePercent:d,thumbPositionPercent:f,trackStyle:m,thumbStyle:p,trackProps:(0,t.computed)(()=>({class:[`virtual-scrollbar-track`,`virtual-scrollbar-track--${c.value?`horizontal`:`vertical`}`],style:m.value,role:`scrollbar`,"aria-label":(0,t.toValue)(e.ariaLabel),"aria-orientation":n.value,"aria-valuenow":Math.round(i.value),"aria-valuemin":0,"aria-valuemax":Math.round(r.value-a.value),"aria-controls":o.value,tabindex:-1,onMousedown:v})),thumbProps:(0,t.computed)(()=>({class:[`virtual-scrollbar-thumb`,`virtual-scrollbar-thumb--${c.value?`horizontal`:`vertical`}`,{"virtual-scrollbar-thumb--active":h.value}],style:p.value,onPointerdown:y,onPointermove:b,onPointerup:x,onPointercancel:x})),isDragging:h}}var D=(0,t.defineComponent)({__name:`VirtualScrollbar`,props:{axis:{default:`vertical`},totalSize:{},position:{},viewportSize:{},scrollToOffset:{},containerId:{},isRtl:{type:Boolean,default:!1},ariaLabel:{}},emits:[`scrollToOffset`],setup(e,{emit:n}){let r=e,i=n,{trackProps:a,thumbProps:o}=E({axis:()=>r.axis,totalSize:()=>r.totalSize,position:()=>r.position,viewportSize:()=>r.viewportSize,containerId:()=>r.containerId,isRtl:()=>r.isRtl,scrollToOffset:e=>{r.scrollToOffset?.(e),i(`scrollToOffset`,e)}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,(0,t.normalizeProps)((0,t.guardReactiveProps)((0,t.unref)(a))),[(0,t.createElementVNode)(`div`,(0,t.normalizeProps)((0,t.guardReactiveProps)((0,t.unref)(o))),null,16)],16))}}),O={key:0,class:`virtual-scroll-scrollbar-container`,"aria-hidden":`true`},k={key:0,class:`virtual-scroll-debug-info`},oe=.95,A=.1,j=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`VirtualScroll`,props:{containerTag:{default:`div`},wrapperTag:{default:`div`},itemTag:{default:`div`},stickyHeader:{type:Boolean,default:!1},stickyFooter:{type:Boolean,default:!1},virtualScrollbar:{type:Boolean,default:!1},items:{},itemSize:{},direction:{default:`vertical`},bufferBefore:{default:5},bufferAfter:{default:5},container:{},ssrRange:{},columnCount:{default:0},columnWidth:{},scrollPaddingStart:{default:0},scrollPaddingEnd:{default:0},gap:{default:0},columnGap:{default:0},stickyIndices:{default:()=>[]},loadDistance:{default:200},loading:{type:Boolean,default:!1},restoreScrollOnPrepend:{type:Boolean,default:!1},initialScrollIndex:{},initialScrollAlign:{},defaultItemSize:{},defaultColumnWidth:{},debug:{type:Boolean,default:!1},role:{},ariaLabel:{},ariaLabelledby:{},itemRole:{default:void 0}},emits:[`scroll`,`load`,`visibleRangeChange`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=(0,t.useSlots)(),s=(0,t.ref)(null),c=(0,t.ref)(null),l=(0,t.ref)(null),u=(0,t.ref)(null),d=new Map,m=(0,t.useId)(),h=(0,t.computed)(()=>`vs-container-${m}`),g=(0,t.ref)(0),_=(0,t.ref)(0),v=(0,t.computed)(()=>i.container===void 0?s.value:i.container),y=(0,t.computed)(()=>{let e=v.value;return e===s.value||typeof window<`u`&&(e===window||e===null)}),b=(0,t.computed)(()=>(i.items.length,{items:i.items,itemSize:i.itemSize,direction:i.direction,bufferBefore:i.bufferBefore,bufferAfter:i.bufferAfter,container:v.value,hostElement:c.value,hostRef:s.value,ssrRange:i.ssrRange,columnCount:i.columnCount,columnWidth:i.columnWidth,scrollPaddingStart:{x:f(i.scrollPaddingStart,i.direction),y:p(i.scrollPaddingStart,i.direction)},scrollPaddingEnd:{x:f(i.scrollPaddingEnd,i.direction),y:p(i.scrollPaddingEnd,i.direction)},flowPaddingStart:{x:0,y:i.stickyHeader?0:g.value},flowPaddingEnd:{x:0,y:i.stickyFooter?0:_.value},stickyStart:{x:0,y:i.stickyHeader&&y.value?g.value:0},stickyEnd:{x:0,y:i.stickyFooter&&y.value?_.value:0},gap:i.gap,columnGap:i.columnGap,stickyIndices:i.stickyIndices,loadDistance:i.loadDistance,loading:i.loading,restoreScrollOnPrepend:i.restoreScrollOnPrepend,initialScrollIndex:i.initialScrollIndex,initialScrollAlign:i.initialScrollAlign,defaultItemSize:i.defaultItemSize,defaultColumnWidth:i.defaultColumnWidth,debug:i.debug})),{isHydrated:x,isRtl:C,columnRange:ee,renderedItems:te,scrollDetails:w,renderedHeight:ne,renderedWidth:re,getColumnWidth:ie,getRowHeight:j,scrollToIndex:M,scrollToOffset:N,updateHostOffset:P,updateItemSizes:F,updateDirection:I,getItemOffset:L,getRowOffset:R,getColumnOffset:se,getItemSize:ce,refresh:z,stopProgrammaticScroll:B,scaleX:le,scaleY:V,isWindowContainer:H,componentOffset:ue,renderedVirtualWidth:de,renderedVirtualHeight:fe}=ae(b),U=(0,t.computed)(()=>le.value!==1||V.value!==1),pe=(0,t.computed)(()=>H.value?!1:i.virtualScrollbar===!0||le.value!==1||V.value!==1);function me(e){let{displayViewportSize:t}=w.value;e>=ne.value-t.height-.5?N(null,1/0):N(null,S(e,ue.y,V.value))}function he(e){let{displayViewportSize:t}=w.value;e>=re.value-t.width-.5?N(1/0,null):N(S(e,ue.x,le.value),null)}let W=E({axis:`vertical`,totalSize:ne,position:(0,t.computed)(()=>w.value.displayScrollOffset.y),viewportSize:(0,t.computed)(()=>w.value.displayViewportSize.height),scrollToOffset:me,containerId:h,isRtl:C}),G=E({axis:`horizontal`,totalSize:re,position:(0,t.computed)(()=>w.value.displayScrollOffset.x),viewportSize:(0,t.computed)(()=>w.value.displayViewportSize.width),scrollToOffset:he,containerId:h,isRtl:C}),K=(0,t.computed)(()=>i.direction===`both`?{...ee.value,padStart:0,padEnd:0}:ee.value);function ge(){z(),I(),(0,t.nextTick)(()=>{let e=[];for(let[t,n]of d.entries())n&&e.push({index:t,inlineSize:n.offsetWidth,blockSize:n.offsetHeight,element:n});e.length>0&&F(e)})}(0,t.watch)(w,(e,t)=>{!x.value||!e||(a(`scroll`,e),(!t||!t.range||!t.columnRange||e.range.start!==t.range.start||e.range.end!==t.range.end||e.columnRange.start!==t.columnRange.start||e.columnRange.end!==t.columnRange.end)&&a(`visibleRangeChange`,{start:e.range.start,end:e.range.end,colStart:e.columnRange.start,colEnd:e.columnRange.end}),!i.loading&&(i.direction!==`horizontal`&&e.totalSize&&e.totalSize.height-(e.scrollOffset.y+e.viewportSize.height)<=i.loadDistance&&a(`load`,`vertical`),i.direction!==`vertical`&&e.totalSize&&e.totalSize.width-(e.scrollOffset.x+e.viewportSize.width)<=i.loadDistance&&a(`load`,`horizontal`)))}),(0,t.watch)(x,e=>{e&&w.value?.range&&w.value?.columnRange&&a(`visibleRangeChange`,{start:w.value.range.start,end:w.value.range.end,colStart:w.value.columnRange.start,colEnd:w.value.columnRange.end})},{once:!0});let q=typeof window>`u`?null:new ResizeObserver(P),_e=typeof window>`u`?null:new ResizeObserver(e=>{let t=[];for(let n of e){let e=n.target,r=Number(e.dataset.index),i=e.dataset.colIndex,a=n.contentRect.width,o=n.contentRect.height;n.borderBoxSize&&n.borderBoxSize.length>0?(a=n.borderBoxSize[0].inlineSize,o=n.borderBoxSize[0].blockSize):(a=e.offsetWidth,o=e.offsetHeight),i===void 0?Number.isNaN(r)||t.push({index:r,inlineSize:a,blockSize:o,element:e}):t.push({index:-1,inlineSize:a,blockSize:o,element:e})}t.length>0&&F(t)}),J=typeof window>`u`?null:new ResizeObserver(()=>{g.value=l.value?.offsetHeight||0,_.value=u.value?.offsetHeight||0,P()});function ve(e,n){(0,t.watch)(e,(e,t)=>{t&&J?.unobserve(t),e?J?.observe(e):n.value=0},{immediate:!0})}ve(l,g),ve(u,_),(0,t.onMounted)(()=>{s.value&&q?.observe(s.value);for(let e of d.values())_e?.observe(e),i.direction===`both`&&e.querySelectorAll(`[data-col-index]`).forEach(e=>_e?.observe(e))}),(0,t.watch)([s,c],([e],[t])=>{t&&q?.unobserve(t),e&&q?.observe(e)}),(0,t.watch)([s,U],([e,t],[n,r])=>{let i=e!==n||t!==r;n&&i&&n.removeEventListener(`wheel`,Z),e&&i&&e.addEventListener(`wheel`,Z,{passive:!t})},{immediate:!0});function ye(e,t){if(e)d.set(t,e),_e?.observe(e),i.direction===`both`&&e.querySelectorAll(`[data-col-index]`).forEach(e=>_e?.observe(e));else{let e=d.get(t);e&&(_e?.unobserve(e),i.direction===`both`&&e.querySelectorAll(`[data-col-index]`).forEach(e=>_e?.unobserve(e)),d.delete(t))}}let be=(0,t.ref)(!1),xe={x:0,y:0},Se={x:0,y:0},Ce={x:0,y:0},we=0,Y={x:0,y:0},X=null;function Te(){let e=()=>{Y.x*=oe,Y.y*=oe;let t=w.value.scrollOffset.x,n=w.value.scrollOffset.y;N(t+Y.x*16,n+Y.y*16,{behavior:`auto`}),Math.abs(Y.x)>A||Math.abs(Y.y)>A?X=requestAnimationFrame(e):Ee()};X=requestAnimationFrame(e)}function Ee(){X!==null&&(cancelAnimationFrame(X),X=null),Y={x:0,y:0}}function De(e){B(),Ee(),U.value&&(e.pointerType===`mouse`&&e.button!==0||(be.value=!0,xe={x:e.clientX,y:e.clientY},Ce={x:e.clientX,y:e.clientY},we=performance.now(),Se={x:w.value.scrollOffset.x,y:w.value.scrollOffset.y},e.currentTarget.setPointerCapture(e.pointerId)))}function Oe(e){if(!be.value)return;let t=performance.now(),n=t-we;if(n>0){let t=(Ce.x-e.clientX)/n,r=(Ce.y-e.clientY)/n;Y.x=Y.x*.2+t*.8,Y.y=Y.y*.2+r*.8}Ce={x:e.clientX,y:e.clientY},we=t;let r=xe.x-e.clientX,i=xe.y-e.clientY;requestAnimationFrame(()=>{N(Se.x+r,Se.y+i,{behavior:`auto`})})}function ke(e){be.value&&(be.value=!1,e.currentTarget.releasePointerCapture(e.pointerId),(Math.abs(Y.x)>A||Math.abs(Y.y)>A)&&(Math.abs(Y.x)>4*Math.abs(Y.y)?Y.y=0:Math.abs(Y.y)>4*Math.abs(Y.x)&&(Y.x=0),Te()))}function Z(e){let{scrollOffset:t}=w.value;if(B(),U.value){e.preventDefault();let n=e.deltaX,r=e.deltaY;e.shiftKey&&n===0&&(n=r,r=0),N(t.x+n,t.y+r,{behavior:`auto`})}}function Ae(e){let{viewportSize:t,scrollOffset:n}=w.value,r=i.direction!==`vertical`,a=i.direction!==`horizontal`,o=b.value.stickyStart,s=b.value.stickyEnd;switch(e.key){case`Home`:e.preventDefault(),B(),M(0,0,{behavior:Math.max(n.x,n.y)>10*(i.direction===`horizontal`?t.width:t.height)?`auto`:`smooth`,align:`start`});break;case`End`:{e.preventDefault(),B();let r=i.items.length-1,a=(i.columnCount||0)>0?i.columnCount-1:0,{totalSize:o}=w.value,s=Math.max(o.width-n.x-t.width,o.height-n.y-t.height)>10*(i.direction===`horizontal`?t.width:t.height)?`auto`:`smooth`;i.direction===`both`?M(r,a,{behavior:s,align:`end`}):M(i.direction===`vertical`?r:0,i.direction===`horizontal`?r:0,{behavior:s,align:`end`});break}case`ArrowUp`:{if(e.preventDefault(),B(),!a)return;let{currentIndex:t,scrollOffset:n}=w.value,r=n.y+o.y+b.value.scrollPaddingStart.y;R(t)<r-1?M(t,null,{align:`start`}):t>0&&M(t-1,null,{align:`start`});break}case`ArrowDown`:{if(e.preventDefault(),B(),!a)return;let{currentEndIndex:r}=w.value,o=n.y+t.height-(s.y+b.value.scrollPaddingEnd.y);R(r)+j(r)>o+1?M(r,null,{align:`end`}):r<i.items.length-1&&M(r+1,null,{align:`end`});break}case`ArrowLeft`:{if(e.preventDefault(),B(),!r)return;let{currentColIndex:a,currentEndColIndex:c}=w.value;if(C.value){let e=n.x+t.width-(s.x+b.value.scrollPaddingEnd.x);(i.columnCount?se(c)+ie(c):L(c)+ce(c))>e+1?M(null,c,{align:`end`}):c<(i.columnCount?i.columnCount-1:i.items.length-1)&&M(null,c+1,{align:`end`})}else{let e=n.x+o.x+b.value.scrollPaddingStart.x;(i.columnCount?se(a):L(a))<e-1?M(null,a,{align:`start`}):a>0&&M(null,a-1,{align:`start`})}break}case`ArrowRight`:{if(e.preventDefault(),B(),!r)return;let{currentColIndex:a,currentEndColIndex:c}=w.value;if(C.value){let e=n.x+o.x+b.value.scrollPaddingStart.x;(i.columnCount?se(a):L(a))<e-1?M(null,a,{align:`start`}):a>0&&M(null,a-1,{align:`start`})}else{let e=n.x+t.width-(s.x+b.value.scrollPaddingEnd.x);(i.columnCount?se(c)+ie(c):L(c)+ce(c))>e+1?M(null,c,{align:`end`}):c<(i.columnCount?i.columnCount-1:i.items.length-1)&&M(null,c+1,{align:`end`})}break}case`PageUp`:e.preventDefault(),B(),N(!a&&r?n.x-t.width:null,a?n.y-t.height:null);break;case`PageDown`:e.preventDefault(),B(),N(!a&&r?n.x+t.width:null,a?n.y+t.height:null);break}}(0,t.onUnmounted)(()=>{q?.disconnect(),_e?.disconnect(),J?.disconnect()});let je=(0,t.computed)(()=>{let e={...i.direction===`vertical`?{}:{whiteSpace:`nowrap`}};return(pe.value||!H.value)&&(e.overflow=`auto`),U.value&&(e.touchAction=`none`),H.value?e:i.containerTag===`table`?{...e,display:`block`,minInlineSize:i.direction===`vertical`?`100%`:`auto`}:e}),Q=(0,t.computed)(()=>{if(i.direction===`horizontal`)return null;let{displayViewportSize:e,displayScrollOffset:t}=w.value;if(ne.value<=e.height)return null;let n={axis:`vertical`,totalSize:ne.value,position:t.y,viewportSize:e.height,scrollToOffset:me,containerId:h.value,isRtl:C.value,ariaLabel:`Vertical scroll`};return{axis:`vertical`,positionPercent:W.positionPercent.value,viewportPercent:W.viewportPercent.value,thumbSizePercent:W.thumbSizePercent.value,thumbPositionPercent:W.thumbPositionPercent.value,trackProps:W.trackProps.value,thumbProps:W.thumbProps.value,scrollbarProps:n,isDragging:W.isDragging.value}}),Me=(0,t.computed)(()=>{if(i.direction===`vertical`)return null;let{displayViewportSize:e,displayScrollOffset:t}=w.value;if(re.value<=e.width)return null;let n={axis:`horizontal`,totalSize:re.value,position:t.x,viewportSize:e.width,scrollToOffset:he,containerId:h.value,isRtl:C.value,ariaLabel:`Horizontal scroll`};return{axis:`horizontal`,positionPercent:G.positionPercent.value,viewportPercent:G.viewportPercent.value,thumbSizePercent:G.thumbSizePercent.value,thumbPositionPercent:G.thumbPositionPercent.value,trackProps:G.trackProps.value,thumbProps:G.thumbProps.value,scrollbarProps:n,isDragging:G.isDragging.value}}),Ne=(0,t.computed)(()=>{let e=i.direction===`horizontal`,t=i.direction===`vertical`,n=i.direction===`both`,r={inlineSize:t?`100%`:`${de.value}px`,blockSize:e?`100%`:`${fe.value}px`};return x.value||(r.display=`flex`,r.flexDirection=e?`row`:`column`,(e||n)&&i.columnGap&&(r.columnGap=`${i.columnGap}px`),(t||n)&&i.gap&&(r.rowGap=`${i.gap}px`)),r}),Pe=(0,t.computed)(()=>{let e=i.direction===`horizontal`;return{display:e?`inline-block`:`block`,...e?{blockSize:`100%`,verticalAlign:`top`}:{inlineSize:`100%`}}}),Fe=(0,t.computed)(()=>({inlineSize:i.direction===`vertical`?`1px`:`${de.value}px`,blockSize:i.direction===`horizontal`?`1px`:`${fe.value}px`}));function Ie(e){let t=T({containerTag:i.containerTag||`div`,direction:i.direction,isHydrated:x.value,item:e,itemSize:i.itemSize,paddingStartX:b.value.scrollPaddingStart.x,paddingStartY:b.value.scrollPaddingStart.y,isRtl:C.value});return!x.value&&i.direction===`both`&&(t.display=`flex`,i.columnGap&&(t.columnGap=`${i.columnGap}px`)),t}let Le=(0,t.computed)(()=>i.debug),$=(0,t.computed)(()=>i.containerTag===`table`),Re=(0,t.computed)(()=>$.value?`thead`:`div`),ze=(0,t.computed)(()=>$.value?`tfoot`:`div`),Be=(0,t.computed)(()=>i.role?i.role:$.value?null:i.direction===`both`?`grid`:`list`),Ve=(0,t.computed)(()=>Be.value===`grid`||$.value),He=(0,t.computed)(()=>$.value?null:i.ariaLabel||i.ariaLabelledby?`region`:`none`),Ue=(0,t.computed)(()=>$.value?null:Be.value),We=(0,t.computed)(()=>{if(Ve.value)return`row`;let e=Be.value;return e===`tree`?`treeitem`:e===`listbox`?`option`:e===`menu`?`menuitem`:`listitem`}),Ge=(0,t.computed)(()=>i.itemRole==null?We.value:i.itemRole),Ke=(0,t.computed)(()=>i.role===`grid`||!i.role&&i.direction===`both`?`gridcell`:$.value?`cell`:null),qe=(0,t.computed)(()=>{let e=Ge.value;return e==null||e!==`none`&&e!==`presentation`}),Je=(0,t.computed)(()=>({"aria-label":i.ariaLabel,"aria-labelledby":i.ariaLabelledby,"aria-busy":i.loading?`true`:void 0})),Ye=(0,t.computed)(()=>{let e={},t=Be.value;return t&&[`grid`,`tree`,`listbox`,`menu`,`tablist`].includes(t)&&(e[`aria-orientation`]=i.direction===`both`?void 0:i.direction),Ve.value&&(e[`aria-rowcount`]=i.items.length,i.columnCount>0&&(e[`aria-colcount`]=i.columnCount)),e});function Xe(e){let t={};Ve.value?t[`aria-rowindex`]=e+1:(t[`aria-setsize`]=i.items.length,t[`aria-posinset`]=e+1);let n=Ge.value;return n!==null&&(t.role=n===`none`||n===`presentation`?We.value:n),t}function Ze(e){let t=Ke.value;if(!t)return{};let n={role:t};return Ve.value&&(n[`aria-colindex`]=e+1),n}return n({...(0,t.toRefs)(i),scrollDetails:w,columnRange:ee,getColumnWidth:ie,getRowHeight:j,getCellAriaProps:Ze,getItemAriaProps:Xe,getRowOffset:R,getColumnOffset:se,getItemOffset:L,getItemSize:ce,scrollToIndex:M,scrollToOffset:N,refresh:ge,stopProgrammaticScroll:()=>{B(),Ee()},updateDirection:I,isRtl:C,isHydrated:x,scaleX:le,scaleY:V,renderedWidth:re,renderedHeight:ne,componentOffset:ue,scrollbarPropsVertical:Q,scrollbarPropsHorizontal:Me}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.containerTag),(0,t.mergeProps)({id:h.value,ref_key:`hostRef`,ref:s,class:[`virtual-scroll-container`,[`virtual-scroll--${e.direction}`,{"virtual-scroll--hydrated":(0,t.unref)(x),"virtual-scroll--window":(0,t.unref)(H),"virtual-scroll--table":$.value,"virtual-scroll--hide-scrollbar":pe.value}]],style:je.value,tabindex:`0`,role:$.value?void 0:He.value},$.value?{...Je.value,...Ye.value}:Je.value,{onKeydown:Ae,onPointerdown:De,onPointermove:Oe,onPointerup:ke,onPointercancel:ke}),{default:(0,t.withCtx)(()=>[pe.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,O,[(0,t.createElementVNode)(`div`,{class:`virtual-scroll-scrollbar-viewport`,style:(0,t.normalizeStyle)({inlineSize:`${(0,t.unref)(w).displayViewportSize.width}px`,blockSize:`${(0,t.unref)(w).displayViewportSize.height}px`,"--vsi-scrollbar-has-cross-gap":e.direction===`both`?1:0})},[o.scrollbar&&Q.value?(0,t.renderSlot)(n.$slots,`scrollbar`,(0,t.normalizeProps)((0,t.mergeProps)({key:0},Q.value)),void 0,!0):Q.value?((0,t.openBlock)(),(0,t.createBlock)(D,(0,t.normalizeProps)((0,t.mergeProps)({key:1},Q.value.scrollbarProps)),null,16)):(0,t.createCommentVNode)(``,!0),o.scrollbar&&Me.value?(0,t.renderSlot)(n.$slots,`scrollbar`,(0,t.normalizeProps)((0,t.mergeProps)({key:2},Me.value)),void 0,!0):Me.value?((0,t.openBlock)(),(0,t.createBlock)(D,(0,t.normalizeProps)((0,t.mergeProps)({key:3},Me.value.scrollbarProps)),null,16)):(0,t.createCommentVNode)(``,!0)],4)])):(0,t.createCommentVNode)(``,!0),o.header?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(Re.value),{key:1,ref_key:`headerRef`,ref:l,class:(0,t.normalizeClass)([`virtual-scroll-header`,{"virtual-scroll--sticky":e.stickyHeader}]),role:$.value?void 0:`none`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`header`,{},void 0,!0)]),_:3},8,[`class`,`role`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.wrapperTag),(0,t.mergeProps)({ref_key:`wrapperRef`,ref:c,class:`virtual-scroll-wrapper`,style:Ne.value,role:$.value?void 0:Ue.value},$.value?{}:Ye.value),{default:(0,t.withCtx)(()=>[$.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.itemTag),{key:0,class:`virtual-scroll-spacer`,style:(0,t.normalizeStyle)(Fe.value)},{default:(0,t.withCtx)(()=>[...r[0]||=[(0,t.createElementVNode)(`td`,{style:{padding:`0`,border:`none`,"block-size":`inherit`}},null,-1)]]),_:1},8,[`style`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(te),r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.itemTag),(0,t.mergeProps)({key:r.index,ref_for:!0,ref:e=>ye(e,r.index),"data-index":r.index,class:[`virtual-scroll-item`,{"virtual-scroll--sticky":r.isStickyActive,"virtual-scroll--debug":Le.value}],style:Ie(r)},{ref_for:!0},qe.value?Xe(r.index):{role:`none`}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`item`,{item:r.item,index:r.index,getItemAriaProps:Xe,columnRange:K.value,getColumnWidth:(0,t.unref)(ie),getCellAriaProps:Ze,gap:i.gap,columnGap:i.columnGap,isSticky:r.isSticky,isStickyActive:r.isStickyActive,isStickyActiveX:r.isStickyActiveX,isStickyActiveY:r.isStickyActiveY,offset:r.offset},void 0,!0),Le.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,k,` #`+(0,t.toDisplayString)(r.index)+` (`+(0,t.toDisplayString)(Math.round(r.offset.x))+`, `+(0,t.toDisplayString)(Math.round(r.offset.y))+`) `,1)):(0,t.createCommentVNode)(``,!0)]),_:2},1040,[`data-index`,`class`,`style`]))),128))]),_:3},16,[`style`,`role`])),e.loading&&o.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`virtual-scroll-loading`,style:(0,t.normalizeStyle)(Pe.value),"aria-live":`polite`,"aria-atomic":`true`},[(0,t.renderSlot)(n.$slots,`loading`,{},void 0,!0)],4)):(0,t.createCommentVNode)(``,!0),o.footer?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(ze.value),{key:3,ref_key:`footerRef`,ref:u,class:(0,t.normalizeClass)([`virtual-scroll-footer`,{"virtual-scroll--sticky":e.stickyFooter}]),role:$.value?void 0:`none`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`footer`,{},void 0,!0)]),_:3},8,[`class`,`role`])):(0,t.createCommentVNode)(``,!0)]),_:3},16,[`id`,`class`,`style`,`role`]))}}),[[`__scopeId`,`data-v-184bc0a9`]]);e.BROWSER_MAX_SIZE=i,e.DEFAULT_BUFFER=5,e.DEFAULT_COLUMN_WIDTH=100,e.DEFAULT_ITEM_SIZE=40,e.EMPTY_SCROLL_DETAILS=n,e.FenwickTree=r,e.VirtualScroll=j,e.VirtualScrollbar=D,e.calculateColumnRange=w,e.calculateItemPosition=re,e.calculateItemStyle=T,e.calculateRange=te,e.calculateScrollTarget=ee,e.calculateStickyItem=ne,e.calculateTotalSize=ie,e.displayToVirtual=S,e.findPrevStickyIndex=g,e.getPaddingX=f,e.getPaddingY=p,e.isBody=o,e.isElement=c,e.isItemVisible=x,e.isScrollToIndexOptions=d,e.isScrollableElement=l,e.isWindow=a,e.isWindowLike=s,e.scrollTo=u,e.useVirtualScroll=ae,e.useVirtualScrollbar=E,e.virtualToDisplay=C});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.VirtualScroll={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let n={items:[],currentIndex:0,currentColIndex:0,currentEndIndex:0,currentEndColIndex:0,scrollOffset:{x:0,y:0},displayScrollOffset:{x:0,y:0},viewportSize:{width:0,height:0},displayViewportSize:{width:0,height:0},totalSize:{width:0,height:0},isScrolling:!1,isProgrammaticScroll:!1,range:{start:0,end:0},columnRange:{start:0,end:0,padStart:0,padEnd:0}},r=1e7;function i(e){return e===null||e===document.documentElement||typeof window<`u`&&e===window}function a(e){return typeof e==`object`&&!!e&&`tagName`in e&&e.tagName===`BODY`}function o(e){return i(e)||a(e)}function s(e){return e!=null&&`getBoundingClientRect`in e}function c(e){return e!=null&&`scrollLeft`in e}function l(e,t){i(e)?window.scrollTo(t):e!=null&&c(e)&&(typeof e.scrollTo==`function`?e.scrollTo(t):(t.left!==void 0&&(e.scrollLeft=t.left),t.top!==void 0&&(e.scrollTop=t.top)))}function u(e){return typeof e==`object`&&!!e&&(`align`in e||`behavior`in e||`isCorrection`in e)}function d(e,t){return typeof e==`object`&&e?e.x||0:(t===`horizontal`||t===`both`)&&e||0}function f(e,t){return typeof e==`object`&&e?e.y||0:(t===`vertical`||t===`both`)&&e||0}function p({scrollPos:e,containerSize:t,count:n,bufferBefore:r,bufferAfter:i,gap:a,fixedSize:o,findLowerBound:s,query:c}){let l=0,u=n,d=e+t;if(o!==null){let t=o+a;l=Math.floor(e/t),u=Math.ceil(d/t)}else l=s(e),u=s(d),u<n&&c(u)<d&&u++;return{start:Math.max(0,l-r),end:Math.min(n,u+i)}}function m(e,t){let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1;e[a]>t?(i=e[a],r=a-1):n=a+1}return i}function h(e,t){let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1;e[a]<t?(i=e[a],n=a+1):r=a-1}return i}function g({align:e,targetPos:t,itemSize:n,scrollPos:r,viewSize:i,stickyOffsetStart:a,stickyOffsetEnd:o}){let s=t-a,c=t-(i-o-n);return e===`start`?{target:s,effectiveAlign:`start`}:e===`center`?{target:t-a-(i-a-o-n)/2,effectiveAlign:`center`}:e===`end`?{target:c,effectiveAlign:`end`}:S(t,n,r,i,a,o)?{target:r,effectiveAlign:`auto`}:n<=i-a-o?t<r+a?{target:s,effectiveAlign:`start`}:{target:c,effectiveAlign:`end`}:Math.abs(s-r)<Math.abs(c-r)?{target:s,effectiveAlign:`start`}:{target:c,effectiveAlign:`end`}}function _(e,t,n,r){return e<=0?0:t===null?Math.max(0,r(e)-n):Math.max(0,e*(t+n)-n)}function v(e,t,n,r,i){let a=t-e;return a<=0?0:n===null?Math.max(0,i(t)-i(e)-r):Math.max(0,a*(n+r)-r)}function y(e,t,n,r){return t===null?r(e):e*(t+n)}function b({index:e,align:t,viewSize:n,scrollPos:r,fixedSize:i,gap:a,query:o,getSize:s,stickyIndices:c,stickyStart:l,stickyEnd:u=0}){let d=l;if(c&&c.length>0){let t=h(c,e);t!==void 0&&(d+=_(1,i,0,()=>s(t)))}let f=i===null?o(e):e*(i+a),p=i===null?s(e)-a:i,{target:m,effectiveAlign:v}=g({align:t,targetPos:f,itemSize:p,scrollPos:r,viewSize:n,stickyOffsetStart:d,stickyOffsetEnd:u});return{target:m,itemSize:p,effectiveAlign:v}}function x(e,t,n,r,i,a,o){if(e<=t)return{isActive:!1,offset:0};let s=o===void 0?m(i,r):o;if(s===void 0)return{isActive:!0,offset:0};let c=a(s);return e>=c?{isActive:!1,offset:0}:{isActive:!0,offset:Math.max(0,Math.min(n,c-e))-n}}function S(e,t,n,r,i=0,a=0){let o=n+i,s=n+r-a;return t<=r-i-a?e>=o-.5&&e+t<=s+.5:e<=o+.5&&e+t>=s-.5}function C(e,t,n){if(e||t<=1e7)return 1;let i=Math.min(t,r),a=t-n,o=i-n;return o>0?a/o:1}function w(e,t){return e?t:Math.min(t,r)}function T(e,t,n){return(e-t)*n}function E(e,t,n){return e/n+t}function D({rowIndex:e,colIndex:t,options:n,direction:i,viewportWidth:a,viewportHeight:o,totalWidth:s,totalHeight:c,gap:l,columnGap:d,fixedSize:f,fixedWidth:p,relativeScrollX:m,relativeScrollY:h,getItemSizeY:g,getItemSizeX:_,getItemQueryY:v,getItemQueryX:y,getColumnSize:x,getColumnQuery:S,scaleX:C,scaleY:w,hostOffsetX:T,hostOffsetY:E,stickyIndices:D,stickyStartX:ee=0,stickyStartY:O=0,stickyEndX:te=0,stickyEndY:ne=0,flowPaddingStartX:k=0,flowPaddingStartY:A=0,paddingStartX:j=0,paddingStartY:re=0,paddingEndX:M=0,paddingEndY:N=0}){let P;P=u(n)?n.align:n;let ie=(P&&typeof P==`object`?P.x:P)||`auto`,F=(P&&typeof P==`object`?P.y:P)||`auto`,ae=m,oe=h,se=0,ce=0,le=`auto`,ue=`auto`,de=C===1?s:r,I=w===1?c:r,fe=Math.max(0,T+de-a),pe=Math.max(0,E+I-o),L=(fe-T)*C,R=(pe-E)*w,me=k+ee+j,z=A+O+re;if(e!=null){let t=b({index:e,align:F,viewSize:o,scrollPos:h,fixedSize:f,gap:l,query:v,getSize:g,stickyIndices:D,stickyStart:O+re,stickyEnd:ne+N});oe=t.target+z,ce=t.itemSize,ue=t.effectiveAlign}if(t!=null){let e=i===`both`,n=b({index:t,align:ie,viewSize:a,scrollPos:m,fixedSize:e?p:f,gap:e||i===`horizontal`?d:l,query:e?S:y,getSize:e?x:_,stickyIndices:D,stickyStart:ee+j,stickyEnd:te+M});ae=n.target+me,se=n.itemSize,le=n.effectiveAlign}return ae=Math.max(0,Math.min(ae,L)),oe=Math.max(0,Math.min(oe,R)),{targetX:ae,targetY:oe,itemWidth:se,itemHeight:ce,effectiveAlignX:le,effectiveAlignY:ue}}function ee({direction:e,relativeScrollX:t,relativeScrollY:n,usableWidth:r,usableHeight:i,itemsLength:a,bufferBefore:o,bufferAfter:s,gap:c,columnGap:l,fixedSize:u,findLowerBoundY:d,findLowerBoundX:f,queryY:m,queryX:h}){let g=e===`vertical`||e===`both`;return p({scrollPos:g?n:t,containerSize:g?i:r,count:a,bufferBefore:o,bufferAfter:s,gap:g?c:l,fixedSize:u,findLowerBound:g?d:f,query:g?m:h})}function O({columnCount:e,relativeScrollX:t,usableWidth:n,colBuffer:r,fixedWidth:i,columnGap:a,findLowerBound:o,query:s,totalColsQuery:c}){if(!e)return{start:0,end:0,padStart:0,padEnd:0};let{start:l,end:u}=p({scrollPos:t,containerSize:n,count:e,bufferBefore:r,bufferAfter:r,gap:a,fixedSize:i,findLowerBound:o,query:s}),d=l,f=u,m=i===null?s(d):d*(i+a),h=i===null?Math.max(0,c()-a):e*(i+a)-a,g=i===null?s(f)-(f>0?a:0):f*(i+a)-(f>0?a:0);return{start:d,end:f,padStart:m,padEnd:Math.max(0,h-g)}}function te({index:e,isSticky:t,direction:n,relativeScrollX:r,relativeScrollY:i,originalX:a,originalY:o,width:s,height:c,stickyIndices:l,fixedSize:u,gap:d,columnGap:f,getItemQueryY:p,getItemQueryX:m,nextStickyIndex:h}){let g=!1,_=!1,v={x:0,y:0};if(!t)return{isStickyActiveX:g,isStickyActiveY:_,isStickyActive:!1,stickyOffset:v};if(n===`vertical`||n===`both`){let t=x(i,o,c,e,l,e=>u===null?p(e):e*(u+d),h);_=t.isActive,v.y=t.offset}if(n===`horizontal`){let t=x(r,a,s,e,l,e=>u===null?m(e):e*(u+f),h);t.isActive&&(g=!0,v.x=t.offset)}return{isStickyActiveX:g,isStickyActiveY:_,isStickyActive:g||_,stickyOffset:v}}function ne({index:e,direction:t,fixedSize:n,gap:r,columnGap:i,usableWidth:a,usableHeight:o,totalWidth:s,queryY:c,queryX:l,getSizeY:u,getSizeX:d,columnRange:f}){let p=0,m=0,h=0,g=0;return t===`horizontal`?(p=n===null?l(e):e*(n+i),h=n===null?d(e)-i:n,g=o):t===`both`&&f?(m=n===null?c(e):e*(n+r),g=n===null?u(e)-r:n,p=f.padStart,h=Math.max(0,s-f.padStart-f.padEnd)):(m=n===null?c(e):e*(n+r),g=n===null?u(e)-r:n,h=t===`both`?s:a),{height:g,width:h,x:p,y:m}}function k({item:e,direction:t,itemSize:n,containerTag:r,paddingStartX:i,paddingStartY:a,isHydrated:o,isRtl:s}){let c=t===`vertical`,l=t===`horizontal`,u=t===`both`,d=n==null||n===0,f={blockSize:l?`100%`:d?`auto`:`${e.size.height}px`};if(c&&r===`table`?f.minInlineSize=`100%`:f.inlineSize=c?`100%`:d?`auto`:`${e.size.width}px`,d&&(c||(f.minInlineSize=`1px`),l||(f.minBlockSize=`1px`)),o){let t=e.isStickyActiveY??(e.isStickyActive&&(c||u)),n=e.isStickyActiveX??(e.isStickyActive&&l),r=s?-(n?e.stickyOffset.x:e.offset.x):n?e.stickyOffset.x:e.offset.x,o=t?e.stickyOffset.y:e.offset.y;e.isStickyActive||e.isStickyActiveX||e.isStickyActiveY?(f.insetBlockStart=t?`${a}px`:`auto`,f.insetInlineStart=n?`${i}px`:`auto`,f.transform=`translate(${r}px, ${o}px)`):f.transform=`translate(${r}px, ${e.offset.y}px)`}return f}function A(e,t,n,r,i,a,o,s,c){let l=t.start||0,u=t.colStart||0,d=0,f=e===`horizontal`?0:y(l,n,i,o);return e===`horizontal`?d=y(u,n,a,s):e===`both`&&(d=y(u,r,a,c)),{x:d,y:f}}function j(e,t){if(e.length===0||t.length<=e.length)return 0;let n=e[0];if(n===void 0)return 0;let r=t.length-e.length;for(let e=1;e<=r;e++)if(t[e]===n)return e;return 0}function re({direction:e,itemsLength:t,columnCount:n,fixedSize:r,fixedWidth:i,gap:a,columnGap:o,usableWidth:s,usableHeight:c,queryY:l,queryX:u,queryColumn:d}){let f=e===`both`,p=e===`horizontal`,m=0,h=0;return f?(m=_(n,i,o,d),h=_(t,r,a,l)):p?(m=_(t,r,o,u),h=c):(m=s,h=_(t,r,a,l)),{width:f?Math.max(m,s):m,height:f?Math.max(h,c):h}}function M(e,t,n=16){let r={x:e.x*t,y:e.y*t};return{nextVelocity:r,delta:{x:r.x*n,y:r.y*n}}}function N(e,t,n){return n<=0?{x:0,y:0}:{x:(e.x-t.x)/n,y:(e.y-t.y)/n}}function P(e,t,n,r,i,a,o,s,c,l){let u=e;if(e===`auto`)if(t===`start`)u=`end`;else if(t===`end`)u=`start`;else return null;if(u===`start`){let e=s(n);if(e>a)return null;let t=c(n)+e-i;return{index:Math.min(o-1,t/e>=.5?n:n+1),align:`start`}}if(u===`end`){let e=s(r);if(e>a)return null;let t=i+a-c(r);return{index:Math.max(0,t/e>=.5?r:r-1),align:`end`}}if(u===`center`){let e=i+a/2,t=Math.max(0,Math.min(o-1,l(e)));return s(t)>a?null:{index:t,align:`center`}}return null}function ie(e,t,n,r){let i=(t||0)+n;return t!==null&&i>0?Math.floor(e/i):r(e)}var F=class{tree;values;constructor(e){this.tree=new Float64Array(e+1),this.values=new Float64Array(e)}update(e,t){if(!(e<0||e>=this.values.length))for(this.values[e]=this.values[e]+t,e++;e<this.tree.length;)this.tree[e]=this.tree[e]+t,e+=e&-e}query(e){let t=0;for(;e>0;)t+=this.tree[e]||0,e-=e&-e;return t}set(e,t){e<0||e>=this.values.length||(this.values[e]=t)}get length(){return this.values.length}get(e){return this.values[e]||0}getValues(){return this.values}findLowerBound(e){let t=0,n=this.tree.length,r=1<<Math.floor(Math.log2(n-1));for(;r>0;){let i=t+r;if(i<n){let n=this.tree[i]||0;n<=e&&(t=i,e-=n)}r>>=1}return t}rebuild(){this.tree.fill(0);for(let e=0;e<this.values.length;e++)this.tree[e+1]=this.values[e]||0;for(let e=1;e<this.tree.length;e++){let t=e+(e&-e);t<this.tree.length&&(this.tree[t]=this.tree[t]+this.tree[e])}}resize(e){if(e===this.values.length)return;let t=new Float64Array(e);t.set(this.values.subarray(0,Math.min(e,this.values.length))),this.values=t,this.tree=new Float64Array(e+1),this.rebuild()}shift(e){if(e===0)return;let t=this.values.length,n=new Float64Array(t);e>0?n.set(this.values.subarray(0,Math.min(t-e,this.values.length)),e):n.set(this.values.subarray(-e)),this.values=n,this.rebuild()}};function ae(e){let n=(0,t.computed)(()=>(0,t.toValue)(e)),r=new F(n.value.props.items?.length||0),i=new F(n.value.props.items?.length||0),a=new F(n.value.props.columnCount||0),o=(0,t.shallowRef)(new Uint8Array),s=(0,t.shallowRef)(new Uint8Array),c=(0,t.shallowRef)(new Uint8Array),l=(0,t.ref)(0),u=(0,t.ref)(!1),d=[],f=(e,t)=>typeof n.value.props.itemSize==`function`?n.value.props.itemSize(e,t):n.value.defaultSize,p=(e,t,r,i,a,o)=>{if(l.value,typeof t==`number`&&t>0)return t;if(o&&Array.isArray(t)&&t.length>0){let n=t[e%t.length];return n!=null&&n>0?n:r}if(typeof t==`function`){let i=n.value.props.items[e];return o&&n.value.direction!==`both`||!o?i===void 0?r:t(i,e):t(e)}let s=a.get(e);return s>0?s-i:r},m=(e,t)=>{if(r.resize(e),i.resize(e),a.resize(t),s.value.length!==e){let t=new Uint8Array(e);t.set(s.value.subarray(0,Math.min(e,s.value.length))),s.value=t}if(c.value.length!==e){let t=new Uint8Array(e);t.set(c.value.subarray(0,Math.min(e,c.value.length))),c.value=t}if(o.value.length!==t){let e=new Uint8Array(t);e.set(o.value.subarray(0,Math.min(t,o.value.length))),o.value=e}},h=(e,t,n,r,i,a,o,s,c)=>{let l=!1;if(c){for(let r=0;r<e;r++)t.get(r)!==0&&(t.set(r,0),n[r]=0,l=!0);return l}for(let c=0;c<e;c++){let e=t.get(c),u=n[c]===1;if(!o||!u&&e===0){let u=p(c,r,i,a,t,s)+a;Math.abs(e-u)>.5?(t.set(c,u),n[c]=o?0:1,l=!0):o||(n[c]=1)}}return l},g=()=>{let e=n.value.props,t=e.items.length,l=e.columnCount||0,u=e.gap||0,d=e.columnGap||0,f=e.columnWidth,p=e.itemSize,m=e.defaultColumnWidth||100,g=e.defaultItemSize||n.value.defaultSize,_=h(l,a,o.value,f,m,d,n.value.isDynamicColumnWidth,!0,!1),v=h(t,r,s.value,p,g,d,n.value.isDynamicItemSize,!0,n.value.direction!==`horizontal`),y=h(t,i,c.value,p,g,u,n.value.isDynamicItemSize,!1,n.value.direction===`horizontal`);_&&a.rebuild(),v&&r.rebuild(),y&&i.rebuild()},_=(e,t,n,r,i,a,o)=>{let s=n.get(e),c=t+i,l=!1;if(!r[e]||Math.abs(c-s)>.1){let t=c-s;n.update(e,t),r[e]=1,l=!0,e<a&&s>0&&(o.val+=t)}return l},v=e=>{let t=n.value.props,a=t.items,o=a.length;m(o,t.columnCount||0);let p=t.restoreScrollOnPrepend?j(d,a):0;if(p>0){r.shift(p),i.shift(p);let l=new Uint8Array(o),u=new Uint8Array(o);l.set(s.value.subarray(0,Math.min(o-p,s.value.length)),p),u.set(c.value.subarray(0,Math.min(o-p,c.value.length)),p),s.value=l,c.value=u;let d=t.gap||0,m=t.columnGap||0,h=0,g=0;for(let e=0;e<p;e++){let t=f(a[e],e);n.value.direction===`horizontal`?h+=t+m:g+=t+d}(h>0||g>0)&&e&&e(h,g)}g(),d=[...a],u.value=!0,l.value++};return{itemSizesX:r,itemSizesY:i,columnSizes:a,measuredItemsX:s,measuredItemsY:c,measuredColumns:o,treeUpdateFlag:l,sizesInitialized:u,getItemBaseSize:f,getSizeAt:p,initializeSizes:v,updateItemSizes:(e,t,u,d,f,p)=>{let m=!1,h={val:0},g={val:0},v=n.value.props,y=v.gap||0,b=v.columnGap||0,x=t(n.value.direction===`horizontal`?d:f),S=u(d),C=n.value.direction===`horizontal`,w=n.value.direction===`both`,T=new Set,E=new Set,D=(e,t)=>{e>=0&&e<(v.columnCount||0)&&!E.has(e)&&(E.add(e),_(e,t,a,o.value,b,S,h)&&(m=!0))};for(let{index:t,inlineSize:a,blockSize:o,element:l}of e){if(a<=0&&o<=0)continue;let e=n.value.isDynamicItemSize||typeof v.itemSize==`function`;t>=0&&!T.has(t)&&e&&o>0&&(T.add(t),C&&a>0&&_(t,a,r,s.value,b,x,h)&&(m=!0),C||_(t,o,i,c.value,y,x,g)&&(m=!0));let u=n.value.isDynamicColumnWidth||typeof v.columnWidth==`function`;if(w&&l&&v.columnCount&&u&&(a>0||l.dataset.colIndex===void 0)){let e=l.dataset.colIndex;if(e!=null)D(Number.parseInt(e,10),a);else{let e=Array.from(l.querySelectorAll(`[data-col-index]`));for(let t of e)D(Number.parseInt(t.dataset.colIndex,10),t.getBoundingClientRect().width)}}}m&&(l.value++,(h.val!==0||g.val!==0)&&p(h.val,g.val))},refresh:e=>{r.resize(0),i.resize(0),a.resize(0),o.value.fill(0),s.value.fill(0),c.value.fill(0),v(e)}}}function oe(e){let n=(0,t.computed)(()=>(0,t.toValue)(e)),r=(0,t.ref)(0),i=(0,t.ref)(0),a=(0,t.ref)(!1),p=(0,t.ref)(!1),m=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.ref)(!1),b=(0,t.ref)(0),x=(0,t.ref)(0),S=(0,t.reactive)({x:0,y:0}),k=(0,t.reactive)({x:0,y:0}),j,M=(0,t.ref)(!1),N=(0,t.ref)(0),F=(0,t.ref)(0),oe=0,se=0,ce=null,le=null,ue=null,de=()=>{if(typeof window>`u`)return;let e=n.value.container||n.value.hostRef||window,t=s(e)?e:document.documentElement;ue=window.getComputedStyle(t);let r=ue.direction===`rtl`;_.value!==r&&(_.value=r)},I=(0,t.computed)(()=>[`vertical`,`horizontal`,`both`].includes(n.value.direction)?n.value.direction:`vertical`),fe=(0,t.computed)(()=>n.value.itemSize===void 0||n.value.itemSize===null||n.value.itemSize===0),pe=(0,t.computed)(()=>n.value.columnWidth===void 0||n.value.columnWidth===null||n.value.columnWidth===0),L=(0,t.computed)(()=>typeof n.value.itemSize==`number`&&n.value.itemSize>0?n.value.itemSize:null),R=(0,t.computed)(()=>typeof n.value.columnWidth==`number`&&n.value.columnWidth>0?n.value.columnWidth:null),me=(0,t.computed)(()=>n.value.defaultItemSize||L.value||40),{itemSizesX:z,itemSizesY:B,columnSizes:V,measuredColumns:he,measuredItemsY:ge,treeUpdateFlag:_e,getSizeAt:ve,initializeSizes:ye,updateItemSizes:be,refresh:xe}=ae((0,t.computed)(()=>({props:n.value,isDynamicItemSize:fe.value,isDynamicColumnWidth:pe.value,defaultSize:me.value,fixedItemSize:L.value,direction:I.value}))),H=(0,t.ref)(null),Se=(0,t.computed)(()=>[...n.value.stickyIndices||[]].sort((e,t)=>e-t)),Ce=(0,t.computed)(()=>new Set(Se.value)),we=(0,t.computed)(()=>d(n.value.scrollPaddingStart,n.value.direction)),Te=(0,t.computed)(()=>d(n.value.scrollPaddingEnd,n.value.direction)),U=(0,t.computed)(()=>f(n.value.scrollPaddingStart,n.value.direction)),Ee=(0,t.computed)(()=>f(n.value.scrollPaddingEnd,n.value.direction)),W=(0,t.computed)(()=>d(n.value.stickyStart,n.value.direction)),De=(0,t.computed)(()=>d(n.value.stickyEnd,n.value.direction)),G=(0,t.computed)(()=>f(n.value.stickyStart,n.value.direction)),Oe=(0,t.computed)(()=>f(n.value.stickyEnd,n.value.direction)),K=(0,t.computed)(()=>d(n.value.flowPaddingStart,n.value.direction)),ke=(0,t.computed)(()=>d(n.value.flowPaddingEnd,n.value.direction)),q=(0,t.computed)(()=>f(n.value.flowPaddingStart,n.value.direction)),Ae=(0,t.computed)(()=>f(n.value.flowPaddingEnd,n.value.direction)),je=(0,t.computed)(()=>b.value-(I.value===`vertical`?0:W.value+De.value)),J=(0,t.computed)(()=>x.value-(I.value===`horizontal`?0:G.value+Oe.value)),Me=(0,t.computed)(()=>(_e.value,re({direction:I.value,itemsLength:n.value.items.length,columnCount:n.value.columnCount||0,fixedSize:L.value,fixedWidth:R.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,usableWidth:je.value,usableHeight:J.value,queryY:e=>B.query(e),queryX:e=>z.query(e),queryColumn:e=>V.query(e)}))),Ne=(0,t.computed)(()=>o(n.value.container)),Pe=(0,t.computed)(()=>Me.value.width+we.value+Te.value),Fe=(0,t.computed)(()=>Me.value.height+U.value+Ee.value),Ie=(0,t.computed)(()=>K.value+W.value+De.value+ke.value+Pe.value),Le=(0,t.computed)(()=>q.value+G.value+Oe.value+Ae.value+Fe.value),Y=(0,t.reactive)({x:(0,t.computed)(()=>Math.max(0,S.x-(K.value+W.value))),y:(0,t.computed)(()=>Math.max(0,S.y-(q.value+G.value)))}),Re=(0,t.computed)(()=>w(Ne.value,Ie.value)),ze=(0,t.computed)(()=>w(Ne.value,Le.value)),Be=(0,t.computed)(()=>w(Ne.value,Pe.value)),Ve=(0,t.computed)(()=>w(Ne.value,Fe.value)),X=(0,t.computed)(()=>C(Ne.value,Ie.value,b.value)),Z=(0,t.computed)(()=>C(Ne.value,Le.value,x.value)),He=(0,t.computed)(()=>{if(I.value===`vertical`)return 0;let e=K.value+W.value+we.value;return N.value-e}),Ue=(0,t.computed)(()=>{if(I.value===`horizontal`)return 0;let e=q.value+G.value+U.value;return F.value-e}),We=e=>I.value===`both`?ve(e,n.value.columnWidth,n.value.defaultColumnWidth||100,n.value.columnGap||0,V,!0):ve(e,n.value.itemSize,n.value.defaultItemSize||40,n.value.columnGap||0,z,!0),Ge=e=>I.value===`horizontal`?J.value:ve(e,n.value.itemSize,n.value.defaultItemSize||40,n.value.gap||0,B,!1);function Q(e,t,a){let o=typeof a==`object`&&a&&`isCorrection`in a?a.isCorrection:!1,s=n.value.container||window,{targetX:c,targetY:d,effectiveAlignX:f,effectiveAlignY:p}=D({rowIndex:e,colIndex:t,options:a,direction:I.value,viewportWidth:b.value,viewportHeight:x.value,totalWidth:Ie.value,totalHeight:Le.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:L.value,fixedWidth:R.value,relativeScrollX:He.value,relativeScrollY:Ue.value,getItemSizeY:e=>B.get(e),getItemSizeX:e=>z.get(e),getItemQueryY:e=>B.query(e),getItemQueryX:e=>z.query(e),getColumnSize:e=>V.get(e),getColumnQuery:e=>V.query(e),scaleX:X.value,scaleY:Z.value,hostOffsetX:Y.x,hostOffsetY:Y.y,stickyIndices:Se.value,stickyStartX:W.value,stickyStartY:G.value,stickyEndX:De.value,stickyEndY:Oe.value,flowPaddingStartX:K.value,flowPaddingStartY:q.value,paddingStartX:we.value,paddingStartY:U.value,paddingEndX:Te.value,paddingEndY:Ee.value});if(!o){let n=u(a)?a.behavior:void 0;H.value={rowIndex:e,colIndex:t,options:{align:{x:f,y:p},...n==null?{}:{behavior:n}}}}let m=E(c,Y.x,X.value),h=E(d,Y.y,Z.value),g=_.value?-m:m,v=h,y;u(a)&&(y=a.behavior);let S=o?`auto`:y||`smooth`;M.value=!0;let C={behavior:S};if(t!=null&&(C.left=_.value?g:Math.max(0,g)),e!=null&&(C.top=Math.max(0,v)),l(s,C),(S===`auto`||S===void 0)&&(t!=null&&(r.value=_.value?g:Math.max(0,g),N.value=c),e!=null&&(i.value=Math.max(0,v),F.value=d),H.value)){let e=H.value.options;u(e)&&(e.behavior=`auto`)}}let Ke=(e,t,a)=>{let o=n.value.container||window;M.value=!0,H.value=null;let s=e==null?null:Math.max(0,Math.min(e,Ie.value-b.value)),c=t==null?null:Math.max(0,Math.min(t,Le.value-x.value));s!==null&&(N.value=s),c!==null&&(F.value=c);let u=typeof window<`u`&&o===window?window.scrollX:o.scrollLeft,d=typeof window<`u`&&o===window?window.scrollY:o.scrollTop,f=s===null?null:E(s,Y.x,X.value),p=c===null?null:E(c,Y.y,Z.value),m=f===null?u:_.value?-f:f,h=p===null?d:p,g={behavior:a?.behavior||`auto`};e!=null&&(g.left=m),t!=null&&(g.top=h),l(o,g),(a?.behavior===`auto`||a?.behavior===void 0)&&(e!=null&&(r.value=m),t!=null&&(i.value=h))},qe=(e,n)=>{(0,t.nextTick)(()=>{Ke(e>0?He.value+e:null,n>0?Ue.value+n:null,{behavior:`auto`,isCorrection:!0})})},Je=()=>ye(qe),$=()=>{if(typeof window>`u`)return;let e=n.value.container||window,t=t=>{let n=t.getBoundingClientRect();if(e===window)return{x:_.value?document.documentElement.clientWidth-n.right-window.scrollX:n.left+window.scrollX,y:n.top+window.scrollY};if(e===t)return{x:0,y:0};if(s(e)){let t=e.getBoundingClientRect();return{x:_.value?t.right-n.right-e.scrollLeft:n.left-t.left+e.scrollLeft,y:n.top-t.top+e.scrollTop}}return{x:0,y:0}};if(n.value.hostElement){let e=t(n.value.hostElement);(Math.abs(S.x-e.x)>.1||Math.abs(S.y-e.y)>.1)&&(S.x=e.x,S.y=e.y)}if(n.value.hostRef){let e=t(n.value.hostRef);(Math.abs(k.x-e.x)>.1||Math.abs(k.y-e.y)>.1)&&(k.x=e.x,k.y=e.y)}};(0,t.watch)([()=>n.value.items,()=>n.value.items.length,()=>n.value.direction,()=>n.value.columnCount,()=>n.value.columnWidth,()=>n.value.itemSize,()=>n.value.gap,()=>n.value.columnGap,()=>n.value.defaultItemSize,()=>n.value.defaultColumnWidth],Je,{immediate:!0}),(0,t.watch)(()=>[n.value.container,n.value.hostElement],()=>{$()}),(0,t.watch)(_,(e,t)=>{if(t===void 0||e===t||!g.value)return;if(I.value===`vertical`){$();return}let n=T(t?Math.abs(r.value):r.value,S.x,X.value);$(),Ke(n,null,{behavior:`auto`})},{flush:`sync`}),(0,t.watch)([X,Z],()=>{!g.value||a.value||M.value||Ke(N.value,F.value,{behavior:`auto`})}),(0,t.watch)([()=>n.value.items.length,()=>n.value.columnCount],([e,n],[r,i])=>{(0,t.nextTick)(()=>{let t=Math.max(0,Ie.value-b.value),a=Math.max(0,Le.value-x.value);N.value>t||F.value>a?Ke(Math.min(N.value,t),Math.min(F.value,a),{behavior:`auto`}):(e!==r&&Z.value!==1||n!==i&&X.value!==1)&&Ke(N.value,F.value,{behavior:`auto`}),$()})});let Ye=e=>{let t=I.value===`horizontal`;return ie(e,L.value,t?n.value.columnGap||0:n.value.gap||0,e=>t?z.findLowerBound(e):B.findLowerBound(e))},Xe=e=>I.value===`both`?ie(e,R.value,n.value.columnGap||0,e=>V.findLowerBound(e)):I.value===`horizontal`?Ye(e):0,Ze=(0,t.computed)(()=>{if(_e.value,(!p.value||m.value)&&n.value.ssrRange)return{start:n.value.ssrRange.start,end:n.value.ssrRange.end};let e=n.value.ssrRange&&!a.value?0:n.value.bufferBefore??5,t=n.value.bufferAfter??5;return ee({direction:I.value,relativeScrollX:He.value,relativeScrollY:Ue.value,usableWidth:je.value,usableHeight:J.value,itemsLength:n.value.items.length,bufferBefore:e,bufferAfter:t,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:L.value,findLowerBoundY:e=>B.findLowerBound(e),findLowerBoundX:e=>z.findLowerBound(e),queryY:e=>B.query(e),queryX:e=>z.query(e)})}),Qe=(0,t.computed)(()=>{_e.value;let e=He.value+W.value,t=Ue.value+G.value;return Ye(I.value===`horizontal`?e:t)}),$e=(0,t.computed)(()=>{_e.value;let e=n.value.columnCount||0;if(!e)return{start:0,end:0,padStart:0,padEnd:0};if((!p.value||m.value)&&n.value.ssrRange){let{colStart:t=0,colEnd:r=0}=n.value.ssrRange,i=Math.max(0,t),a=Math.min(e,r||e);return O({columnCount:e,relativeScrollX:y(i,R.value,n.value.columnGap||0,e=>V.query(e)),usableWidth:v(i,a,R.value,n.value.columnGap||0,e=>V.query(e)),colBuffer:0,fixedWidth:R.value,columnGap:n.value.columnGap||0,findLowerBound:e=>V.findLowerBound(e),query:e=>V.query(e),totalColsQuery:()=>V.query(e)})}let t=n.value.ssrRange&&!a.value?0:2;return O({columnCount:e,relativeScrollX:He.value,usableWidth:je.value,colBuffer:t,fixedWidth:R.value,columnGap:n.value.columnGap||0,findLowerBound:e=>V.findLowerBound(e),query:e=>V.query(e),totalColsQuery:()=>V.query(e)})}),et=[],tt=(0,t.computed)(()=>{_e.value;let{start:e,end:t}=Ze.value,r=[],i=Se.value,a=Ce.value,o=[];if(p.value||!n.value.ssrRange){let t=Qe.value,n=h(i,t);n!==void 0&&n<e&&o.push(n)}for(let n=e;n<t;n++)o.push(n);let{x:s,y:c}=!p.value&&n.value.ssrRange?A(I.value,n.value.ssrRange,L.value,R.value,n.value.gap||0,n.value.columnGap||0,e=>B.query(e),e=>z.query(e),e=>V.query(e)):{x:0,y:0},l=new Map;for(let e of et)l.set(e.index,e);let u=-1,d=0,f=-1,m=0,g=e=>e===u+1?(d+=z.get(u),u=e,d):(d=z.query(e),u=e,d),_=e=>e===f+1?(m+=B.get(f),f=e,m):(m=B.query(e),f=e,m),v=K.value+W.value+we.value,y=q.value+G.value+U.value,b=K.value+W.value,x=q.value+G.value,S=$e.value,C=0;for(let e of o){let t=n.value.items[e];if(t===void 0)continue;let{x:o,y:u,width:d,height:f}=ne({index:e,direction:I.value,fixedSize:L.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,usableWidth:je.value,usableHeight:J.value,totalWidth:Me.value.width,queryY:_,queryX:g,getSizeY:e=>B.get(e),getSizeX:e=>z.get(e),columnRange:S}),m=a.has(e),h=o,w=u;for(;C<i.length&&i[C]<=e;)C++;let T=C<i.length?i[C]:void 0,{isStickyActive:E,isStickyActiveX:D,isStickyActiveY:ee,stickyOffset:O}=te({index:e,isSticky:m,direction:I.value,relativeScrollX:He.value,relativeScrollY:Ue.value,originalX:h,originalY:w,width:d,height:f,stickyIndices:i,fixedSize:L.value,fixedWidth:R.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,getItemQueryY:e=>B.query(e),getItemQueryX:e=>z.query(e),nextStickyIndex:T}),k=p.value?N.value/X.value+(o+v-N.value)-b:o-s,A=p.value?F.value/Z.value+(u+y-F.value)-x:u-c,j=l.get(e);j&&j.item===t&&j.offset.x===k&&j.offset.y===A&&j.size.width===d&&j.size.height===f&&j.isSticky===m&&j.isStickyActive===E&&j.isStickyActiveX===D&&j.isStickyActiveY===ee&&j.stickyOffset.x===O.x&&j.stickyOffset.y===O.y?r.push(j):r.push({item:t,index:e,offset:{x:k,y:A},size:{width:d,height:f},originalX:h,originalY:w,isSticky:m,isStickyActive:E,isStickyActiveX:D,isStickyActiveY:ee,stickyOffset:O})}return et=r,r}),nt=(0,t.computed)(()=>{_e.value;let e=He.value+W.value,t=Ue.value+G.value,n=He.value+(b.value-De.value)-1,o=Ue.value+(x.value-Oe.value)-1,s=Xe(e),c=Ye(t),l=Ye(I.value===`horizontal`?n:o),u=Xe(n);return{items:tt.value,currentIndex:c,currentColIndex:s,currentEndIndex:l,currentEndColIndex:u,scrollOffset:{x:N.value,y:F.value},displayScrollOffset:{x:_.value?Math.abs(r.value+k.x):Math.max(0,r.value-k.x),y:Math.max(0,i.value-k.y)},viewportSize:{width:b.value,height:x.value},displayViewportSize:{width:b.value,height:x.value},totalSize:{width:Ie.value,height:Le.value},isScrolling:a.value,isProgrammaticScroll:M.value,range:Ze.value,columnRange:$e.value}}),rt=()=>{M.value=!1,H.value=null},it=e=>{let t=e.target;if(typeof window>`u`)return;de(),t===window||t===document?(r.value=window.scrollX,i.value=window.scrollY,b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight):c(t)&&(r.value=t.scrollLeft,i.value=t.scrollTop,b.value=t.clientWidth,x.value=t.clientHeight);let o=T(_.value?Math.abs(r.value):r.value,Y.x,X.value),s=T(i.value,Y.y,Z.value);Math.abs(o-oe)>.5&&(ce=o>oe?`end`:`start`,oe=o),Math.abs(s-se)>.5&&(le=s>se?`end`:`start`,se=s),N.value=o,F.value=s,M.value||(H.value=null),a.value||=!0,clearTimeout(j),j=setTimeout(()=>{let e=M.value;if(a.value=!1,M.value=!1,n.value.snap&&!e){let e=n.value.snap,t=e===!0?`auto`:e,r=nt.value,i=n.value.items.length,a=r.currentIndex,o=r.currentColIndex,s=`start`,c=`start`,l=!1;if(I.value!==`horizontal`){let e=P(t,le,r.currentIndex,r.currentEndIndex,Ue.value,x.value,i,e=>B.get(e),e=>B.query(e),Ye);e&&(a=e.index,s=e.align,l=!0)}if(I.value!==`vertical`){let e=I.value===`both`,a=e?n.value.columnCount||0:i,s=P(t,ce,r.currentColIndex,r.currentEndColIndex,He.value,b.value,a,t=>e?V.get(t):z.get(t),t=>e?V.query(t):z.query(t),Xe);s&&(o=s.index,c=s.align,l=!0)}l&&Q(a,o,{align:{x:c,y:s},behavior:`smooth`})}},250)},at=e=>{be(e,Ye,Xe,He.value,Ue.value,(e,t)=>{H.value!==null||M.value||qe(e,t)})},ot=(e,t,n,r)=>{at([{index:e,inlineSize:t,blockSize:n,element:r}])};function st(){if(H.value&&!m.value){let{rowIndex:e,colIndex:t,options:r}=H.value;if(u(r)&&r.behavior===`smooth`&&a.value)return;let i=n.value.container||window,o=typeof window<`u`&&i===window?window.scrollX:i.scrollLeft,s=typeof window<`u`&&i===window?window.scrollY:i.scrollTop,c=_.value?Math.abs(o):o,l=s,d=T(c,0,X.value),f=T(l,0,Z.value),{targetX:p,targetY:m}=D({rowIndex:e,colIndex:t,options:r,direction:I.value,viewportWidth:b.value,viewportHeight:x.value,totalWidth:Pe.value,totalHeight:Fe.value,gap:n.value.gap||0,columnGap:n.value.columnGap||0,fixedSize:L.value,fixedWidth:R.value,relativeScrollX:d,relativeScrollY:f,getItemSizeY:e=>B.get(e),getItemSizeX:e=>z.get(e),getItemQueryY:e=>B.query(e),getItemQueryX:e=>z.query(e),getColumnSize:e=>V.get(e),getColumnQuery:e=>V.query(e),scaleX:X.value,scaleY:Z.value,hostOffsetX:Y.x,hostOffsetY:Y.y,stickyIndices:Se.value,stickyStartX:W.value,stickyStartY:G.value,stickyEndX:De.value,stickyEndY:Oe.value,flowPaddingStartX:K.value,flowPaddingStartY:q.value,paddingStartX:we.value,paddingStartY:U.value,paddingEndX:Te.value,paddingEndY:Ee.value}),h=t==null||Math.abs(d-p)<2,g=e==null||Math.abs(f-m)<2,v=t==null||t===void 0||he.value[t]===1,y=e==null||e===void 0||ge.value[e]===1;h&&g?v&&y&&!a.value&&!M.value&&(H.value=null):Q(e,t,u(r)?{...r,isCorrection:!0}:{align:r,isCorrection:!0})}}(0,t.watch)([_e,b,x],st),(0,t.watch)(a,e=>{e||st()});let ct=null,lt=null,ut,dt=e=>{if(typeof window>`u`)return;let t=e||window,n=t===window||s(t)&&t===document.documentElement?document:t;if(n.addEventListener(`scroll`,it,{passive:!0}),ue=null,de(),s(t)&&(lt=new MutationObserver(()=>de()),lt.observe(t,{attributes:!0,attributeFilter:[`dir`,`style`]})),ut=setInterval(de,1e3),t===window){b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight,r.value=window.scrollX,i.value=window.scrollY;let e=()=>{de(),b.value=document.documentElement.clientWidth,x.value=document.documentElement.clientHeight,$()};return window.addEventListener(`resize`,e),()=>{n.removeEventListener(`scroll`,it),window.removeEventListener(`resize`,e),lt?.disconnect(),clearInterval(ut),ue=null}}else return b.value=t.clientWidth,x.value=t.clientHeight,r.value=t.scrollLeft,i.value=t.scrollTop,ct=new ResizeObserver(()=>{de(),b.value=t.clientWidth,x.value=t.clientHeight,$()}),ct.observe(t),()=>{n.removeEventListener(`scroll`,it),ct?.disconnect(),lt?.disconnect(),clearInterval(ut),ue=null}},ft;return(0,t.getCurrentInstance)()&&((0,t.onMounted)(()=>{g.value=!0,de(),(0,t.watch)(()=>n.value.container,e=>{ft?.(),ft=dt(e||null)},{immediate:!0}),$(),(0,t.nextTick)(()=>{if($(),n.value.ssrRange||n.value.initialScrollIndex!==void 0){let e=n.value.initialScrollIndex===void 0?n.value.ssrRange?.start:n.value.initialScrollIndex,r=n.value.initialScrollAlign||`start`;e!=null&&Q(e,n.value.ssrRange?.colStart,{align:r,behavior:`auto`}),p.value=!0,m.value=!0,(0,t.nextTick)(()=>{m.value=!1})}else p.value=!0})}),(0,t.onUnmounted)(()=>{ft?.()})),{renderedItems:tt,totalWidth:Ie,totalHeight:Le,renderedWidth:Re,renderedHeight:ze,scrollDetails:nt,getRowHeight:Ge,getColumnWidth:We,getRowOffset:e=>q.value+G.value+U.value+y(e,L.value,n.value.gap||0,e=>B.query(e)),getColumnOffset:e=>{let t=K.value+W.value+we.value;return I.value===`both`?t+y(e,R.value,n.value.columnGap||0,e=>V.query(e)):t+y(e,L.value,n.value.columnGap||0,e=>z.query(e))},getItemOffset:e=>I.value===`horizontal`?K.value+W.value+we.value+y(e,L.value,n.value.columnGap||0,e=>z.query(e)):q.value+G.value+U.value+y(e,L.value,n.value.gap||0,e=>B.query(e)),getItemSize:e=>I.value===`horizontal`?We(e):Ge(e),scrollToIndex:Q,scrollToOffset:Ke,stopProgrammaticScroll:rt,updateItemSize:ot,updateItemSizes:at,updateHostOffset:$,updateDirection:de,columnRange:$e,refresh:()=>{xe(qe)},isHydrated:p,isWindowContainer:Ne,isRtl:_,scaleX:X,scaleY:Z,componentOffset:Y,renderedVirtualWidth:Be,renderedVirtualHeight:Ve,getRowIndexAt:Ye,getColIndexAt:Xe}}function se(e){let n=(0,t.computed)(()=>(0,t.toValue)(e)),r=(0,t.computed)(()=>n.value.axis===`horizontal`),i=(0,t.computed)(()=>n.value.totalSize<=0?0:Math.min(1,n.value.viewportSize/n.value.totalSize)),a=(0,t.computed)(()=>{let e=n.value.totalSize-n.value.viewportSize;return e<=0?0:Math.max(0,Math.min(1,n.value.position/e))}),o=(0,t.computed)(()=>{let e=n.value.viewportSize>0?32/n.value.viewportSize:.1;return Math.max(Math.min(e,.1),i.value)*100}),s=(0,t.computed)(()=>a.value*(100-o.value)),c=(0,t.computed)(()=>r.value?{inlineSize:`${o.value}%`,insetInlineStart:`${s.value}%`}:{blockSize:`${o.value}%`,insetBlockStart:`${s.value}%`}),l=(0,t.computed)(()=>{let e=n.value.viewportSize,t=`var(--vs-scrollbar-has-cross-gap, var(--vsi-scrollbar-has-cross-gap, 0)) * var(--vs-scrollbar-cross-gap, var(--vsi-scrollbar-size, 8px))`;return r.value?{inlineSize:`calc(${Math.max(0,e-4)}px - ${t})`}:{blockSize:`calc(${Math.max(0,e-4)}px - ${t})`}}),u=(0,t.ref)(!1),d=0,f=0;function p(e){let t=e.currentTarget;if(e.target!==t)return;let i=t.getBoundingClientRect(),a=r.value?i.width:i.height,s=0;s=r.value?n.value.isRtl?i.right-e.clientX:e.clientX-i.left:e.clientY-i.top;let c=o.value/100*a,l=(s-c/2)/(a-c),u=n.value.totalSize-n.value.viewportSize,d=l*u;d>u-1&&(d=u),n.value.scrollToOffset(Math.max(0,Math.min(u,d)))}function m(e){u.value=!0,d=r.value?n.value.isRtl?-e.clientX:e.clientX:e.clientY,f=n.value.position,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function h(e){if(!u.value)return;let t=e.currentTarget.parentElement;if(!t)return;let i=(r.value?n.value.isRtl?-e.clientX:e.clientX:e.clientY)-d,a=t.getBoundingClientRect(),s=r.value?a.width:a.height,c=s-o.value/100*s;if(c<=0)return;let l=n.value.totalSize-n.value.viewportSize,p=f+i/c*l;p>l-1&&(p=l),n.value.scrollToOffset(Math.max(0,Math.min(l,p)))}function g(e){u.value&&(u.value=!1,e.currentTarget.releasePointerCapture(e.pointerId))}return(0,t.getCurrentInstance)()&&(0,t.onUnmounted)(()=>{u.value=!1}),{viewportPercent:i,positionPercent:a,thumbSizePercent:o,thumbPositionPercent:s,trackStyle:l,thumbStyle:c,trackProps:(0,t.computed)(()=>({class:[`virtual-scrollbar-track`,`virtual-scrollbar-track--${r.value?`horizontal`:`vertical`}`],style:l.value,role:`scrollbar`,"aria-label":n.value.ariaLabel,"aria-orientation":n.value.axis,"aria-valuenow":Math.round(n.value.position),"aria-valuemin":0,"aria-valuemax":Math.round(n.value.totalSize-n.value.viewportSize),"aria-controls":n.value.containerId,tabindex:-1,onMousedown:p})),thumbProps:(0,t.computed)(()=>({class:[`virtual-scrollbar-thumb`,`virtual-scrollbar-thumb--${r.value?`horizontal`:`vertical`}`,{"virtual-scrollbar-thumb--active":u.value}],style:c.value,onPointerdown:m,onPointermove:h,onPointerup:g,onPointercancel:g})),isDragging:u}}var ce=(0,t.defineComponent)({__name:`VirtualScrollbar`,props:{axis:{default:`vertical`},totalSize:{},position:{},viewportSize:{},scrollToOffset:{},containerId:{},isRtl:{type:Boolean,default:!1},ariaLabel:{}},emits:[`scrollToOffset`],setup(e,{emit:n}){let r=e,i=n,{trackProps:a,thumbProps:o}=se(()=>({axis:r.axis,totalSize:r.totalSize,position:r.position,viewportSize:r.viewportSize,containerId:r.containerId,isRtl:r.isRtl,scrollToOffset:e=>{r.scrollToOffset?.(e),i(`scrollToOffset`,e)}}));return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,(0,t.normalizeProps)((0,t.guardReactiveProps)((0,t.unref)(a))),[(0,t.createElementVNode)(`div`,(0,t.normalizeProps)((0,t.guardReactiveProps)((0,t.unref)(o))),null,16)],16))}}),le={key:0,class:`virtual-scroll-scrollbar-container`,"aria-hidden":`true`},ue={key:0,class:`virtual-scroll-debug-info`},de=.95,I=.1,fe=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`VirtualScroll`,props:{containerTag:{default:`div`},wrapperTag:{default:`div`},itemTag:{default:`div`},stickyHeader:{type:Boolean,default:!1},stickyFooter:{type:Boolean,default:!1},virtualScrollbar:{type:Boolean,default:!1},items:{},itemSize:{},direction:{default:`vertical`},bufferBefore:{default:5},bufferAfter:{default:5},container:{},ssrRange:{},columnCount:{default:0},columnWidth:{},scrollPaddingStart:{default:0},scrollPaddingEnd:{default:0},gap:{default:0},columnGap:{default:0},stickyIndices:{default:()=>[]},loadDistance:{default:200},loading:{type:Boolean,default:!1},restoreScrollOnPrepend:{type:Boolean,default:!1},initialScrollIndex:{},initialScrollAlign:{},defaultItemSize:{},defaultColumnWidth:{},debug:{type:Boolean,default:!1},role:{},ariaLabel:{},ariaLabelledby:{},itemRole:{default:void 0},snap:{type:[Boolean,String]}},emits:[`scroll`,`load`,`visibleRangeChange`],setup(e,{expose:n,emit:r}){let i=e,a=r,s=(0,t.useSlots)(),c=(0,t.ref)(null),l=(0,t.ref)(null),u=(0,t.ref)(null),p=(0,t.ref)(null),m=new Map,h=(0,t.useId)(),g=(0,t.computed)(()=>`vs-container-${h}`),_=(0,t.ref)(0),v=(0,t.ref)(0),y=(0,t.computed)(()=>i.container===void 0?c.value:i.container),b=(0,t.computed)(()=>{let e=y.value;return e===c.value||o(e)}),x=(0,t.computed)(()=>(i.items.length,{items:i.items,itemSize:i.itemSize,direction:i.direction,bufferBefore:i.bufferBefore,bufferAfter:i.bufferAfter,container:y.value,hostElement:l.value,hostRef:c.value,ssrRange:i.ssrRange,columnCount:i.columnCount,columnWidth:i.columnWidth,scrollPaddingStart:{x:d(i.scrollPaddingStart,i.direction),y:f(i.scrollPaddingStart,i.direction)},scrollPaddingEnd:{x:d(i.scrollPaddingEnd,i.direction),y:f(i.scrollPaddingEnd,i.direction)},flowPaddingStart:{x:0,y:i.stickyHeader?0:_.value},flowPaddingEnd:{x:0,y:i.stickyFooter?0:v.value},stickyStart:{x:0,y:i.stickyHeader&&b.value?_.value:0},stickyEnd:{x:0,y:i.stickyFooter&&b.value?v.value:0},gap:i.gap,columnGap:i.columnGap,stickyIndices:i.stickyIndices,loadDistance:i.loadDistance,loading:i.loading,restoreScrollOnPrepend:i.restoreScrollOnPrepend,initialScrollIndex:i.initialScrollIndex,initialScrollAlign:i.initialScrollAlign,defaultItemSize:i.defaultItemSize,defaultColumnWidth:i.defaultColumnWidth,debug:i.debug,snap:i.snap})),{isHydrated:S,isRtl:C,columnRange:w,renderedItems:E,scrollDetails:D,renderedHeight:ee,renderedWidth:O,getColumnWidth:te,getRowHeight:ne,scrollToIndex:A,scrollToOffset:j,updateHostOffset:re,updateItemSizes:P,updateDirection:ie,getItemOffset:F,getRowOffset:ae,getColumnOffset:fe,getItemSize:pe,refresh:L,stopProgrammaticScroll:R,scaleX:me,scaleY:z,isWindowContainer:B,componentOffset:V,renderedVirtualWidth:he,renderedVirtualHeight:ge,getRowIndexAt:_e,getColIndexAt:ve}=oe(x),ye=(0,t.computed)(()=>me.value!==1||z.value!==1),be=(0,t.computed)(()=>B.value?!1:i.virtualScrollbar===!0||me.value!==1||z.value!==1);function xe(e){let{displayViewportSize:t}=D.value;e>=ee.value-t.height-.5?j(null,1/0):j(null,T(e,V.y,z.value))}function H(e){let{displayViewportSize:t}=D.value;e>=O.value-t.width-.5?j(1/0,null):j(T(e,V.x,me.value),null)}let Se=se((0,t.computed)(()=>({axis:`vertical`,totalSize:ee.value,position:D.value.displayScrollOffset.y,viewportSize:D.value.displayViewportSize.height,scrollToOffset:xe,containerId:g.value,isRtl:C.value}))),Ce=se((0,t.computed)(()=>({axis:`horizontal`,totalSize:O.value,position:D.value.displayScrollOffset.x,viewportSize:D.value.displayViewportSize.width,scrollToOffset:H,containerId:g.value,isRtl:C.value}))),we=(0,t.computed)(()=>i.direction===`both`?{...w.value,padStart:0,padEnd:0}:w.value);function Te(){L(),ie(),(0,t.nextTick)(()=>{let e=[];for(let[t,n]of m.entries())n&&e.push({index:t,inlineSize:n.offsetWidth,blockSize:n.offsetHeight,element:n});e.length>0&&P(e)})}(0,t.watch)(D,(e,t)=>{!S.value||!e||(a(`scroll`,e),(!t||!t.range||!t.columnRange||e.range.start!==t.range.start||e.range.end!==t.range.end||e.columnRange.start!==t.columnRange.start||e.columnRange.end!==t.columnRange.end)&&a(`visibleRangeChange`,{start:e.range.start,end:e.range.end,colStart:e.columnRange.start,colEnd:e.columnRange.end}),!i.loading&&(i.direction!==`horizontal`&&e.totalSize&&e.totalSize.height-(e.scrollOffset.y+e.viewportSize.height)<=i.loadDistance&&a(`load`,`vertical`),i.direction!==`vertical`&&e.totalSize&&e.totalSize.width-(e.scrollOffset.x+e.viewportSize.width)<=i.loadDistance&&a(`load`,`horizontal`)))}),(0,t.watch)(S,e=>{e&&D.value?.range&&D.value?.columnRange&&a(`visibleRangeChange`,{start:D.value.range.start,end:D.value.range.end,colStart:D.value.columnRange.start,colEnd:D.value.columnRange.end})},{once:!0});let U=typeof window>`u`?null:new ResizeObserver(re),Ee=typeof window>`u`?null:new ResizeObserver(e=>{let t=[];for(let n of e){let e=n.target,r=Number(e.dataset.index),i=e.dataset.colIndex,a=n.contentRect.width,o=n.contentRect.height;n.borderBoxSize&&n.borderBoxSize.length>0?(a=n.borderBoxSize[0].inlineSize,o=n.borderBoxSize[0].blockSize):(a=e.offsetWidth,o=e.offsetHeight),i===void 0?Number.isNaN(r)||t.push({index:r,inlineSize:a,blockSize:o,element:e}):t.push({index:-1,inlineSize:a,blockSize:o,element:e})}t.length>0&&P(t)}),W=typeof window>`u`?null:new ResizeObserver(()=>{_.value=u.value?.offsetHeight||0,v.value=p.value?.offsetHeight||0,re()});function De(e,n){(0,t.watch)(e,(e,t)=>{t&&W?.unobserve(t),e?W?.observe(e):n.value=0},{immediate:!0})}De(u,_),De(p,v),(0,t.onMounted)(()=>{c.value&&U?.observe(c.value);for(let e of m.values())G(e,!0)}),(0,t.watch)([c,l],([e],[t])=>{t&&U?.unobserve(t),e&&U?.observe(e)}),(0,t.watch)([c,ye],([e,t],[n,r])=>{let i=e!==n||t!==r;n&&i&&n.removeEventListener(`wheel`,Y),e&&i&&e.addEventListener(`wheel`,Y,{passive:!t})},{immediate:!0});function G(e,t){let n=t?`observe`:`unobserve`;Ee?.[n](e),i.direction===`both`&&e.children.length>0&&e.querySelectorAll(`[data-col-index]`).forEach(e=>Ee?.[n](e))}function Oe(e,t){if(e){let n=e;m.set(t,n),G(n,!0)}else{let e=m.get(t);e&&(G(e,!1),m.delete(t))}}let K=(0,t.ref)(!1),ke={x:0,y:0},q={x:0,y:0},Ae={x:0,y:0},je=0,J={x:0,y:0},Me=null;function Ne(){let e=()=>{let{nextVelocity:t,delta:n}=M(J,de);J.x=t.x,J.y=t.y;let{x:r,y:i}=D.value.scrollOffset;j(r+n.x,i+n.y,{behavior:`auto`}),Math.abs(J.x)>I||Math.abs(J.y)>I?Me=requestAnimationFrame(e):Pe()};Me=requestAnimationFrame(e)}function Pe(){Me!==null&&(cancelAnimationFrame(Me),Me=null),J={x:0,y:0}}function Fe(e){R(),Pe(),ye.value&&(e.pointerType===`mouse`&&e.button!==0||(K.value=!0,ke={x:e.clientX,y:e.clientY},Ae={x:e.clientX,y:e.clientY},je=performance.now(),q={x:D.value.scrollOffset.x,y:D.value.scrollOffset.y},e.currentTarget.setPointerCapture(e.pointerId)))}function Ie(e){if(!K.value)return;let t=performance.now(),n=t-je;if(n>0){let t=N(Ae,{x:e.clientX,y:e.clientY},n);J.x=J.x*.2+t.x*.8,J.y=J.y*.2+t.y*.8}Ae={x:e.clientX,y:e.clientY},je=t;let r=ke.x-e.clientX,i=ke.y-e.clientY;requestAnimationFrame(()=>{j(q.x+r,q.y+i,{behavior:`auto`})})}function Le(e){K.value&&(K.value=!1,e.currentTarget.releasePointerCapture(e.pointerId),(Math.abs(J.x)>I||Math.abs(J.y)>I)&&(Math.abs(J.x)>4*Math.abs(J.y)?J.y=0:Math.abs(J.y)>4*Math.abs(J.x)&&(J.x=0),Ne()))}function Y(e){let{scrollOffset:t}=D.value;if(R(),ye.value){e.preventDefault();let{deltaX:n,deltaY:r}=e;e.shiftKey&&n===0&&(n=r,r=0),j(t.x+n,t.y+r,{behavior:`auto`})}}function Re(e){let{viewportSize:t,scrollOffset:n}=D.value,r=i.direction!==`vertical`,a=i.direction!==`horizontal`,o=x.value,s=o.stickyStart,c=o.stickyEnd,l=o.scrollPaddingStart,u=o.scrollPaddingEnd,d=i.snap===!0?`auto`:i.snap,f=d&&d!==`auto`?d:null,p=e=>{let r=(e?n.x:n.y)+(e?t.width:t.height)/2;return e?ve(r):_e(r)},{currentIndex:m,currentEndIndex:h,currentColIndex:g,currentEndColIndex:_}=D.value,v=(e,t)=>{let n=!e,r=e?m:g,a=e?h:_,o=Math.max(1,a-r),s=e?i.items.length-1:i.columnCount?i.columnCount-1:i.items.length-1;return t?f===`center`?Math.min(s,p(n)+o):f===`end`?Math.min(s,a+o):a:f===`center`?Math.max(0,p(n)-o):f===`start`?Math.max(0,r-o):r},y=(e,r)=>{let a=!e;if(f===`center`){let t=p(a),n=a&&i.columnCount?i.columnCount-1:i.items.length-1,o=r?Math.min(n,t+1):Math.max(0,t-1);A(e?o:null,a?o:null,{align:`center`});return}if(e)if(r)if(f===`start`)A(Math.min(i.items.length-1,m+1),null,{align:`start`});else{let e=f||`end`,r=n.y+t.height-(c.y+u.y);ae(h)+ne(h)>r+1?A(h,null,{align:e}):h<i.items.length-1&&A(h+1,null,{align:e})}else if(f===`end`)A(Math.max(0,h-1),null,{align:`end`});else{let e=f||`start`,t=n.y+s.y+l.y;ae(m)<t-1?A(m,null,{align:e}):m>0&&A(m-1,null,{align:e})}else{let e=i.columnCount?i.columnCount-1:i.items.length-1;if(C.value?!r:r)if(f===`start`)A(null,Math.min(e,g+1),{align:`start`});else{let r=f||`end`,a=n.x+t.width-(c.x+u.x);(i.columnCount?fe(_)+te(_):F(_)+pe(_))>a+1?A(null,_,{align:r}):_<e&&A(null,_+1,{align:r})}else if(f===`end`)A(null,Math.max(0,_-1),{align:`end`});else{let e=f||`start`,t=n.x+s.x+l.x;(i.columnCount?fe(g):F(g))<t-1?A(null,g,{align:e}):g>0&&A(null,g-1,{align:e})}}};switch(e.key){case`Home`:e.preventDefault(),R(),A(0,0,{behavior:Math.max(n.x,n.y)>10*(i.direction===`horizontal`?t.width:t.height)?`auto`:`smooth`,align:`start`});break;case`End`:{e.preventDefault(),R();let r=i.items.length-1,a=(i.columnCount||0)>0?i.columnCount-1:0,{totalSize:o}=D.value,s=Math.max(o.width-n.x-t.width,o.height-n.y-t.height)>10*(i.direction===`horizontal`?t.width:t.height)?`auto`:`smooth`;i.direction===`both`?A(r,a,{behavior:s,align:`end`}):A(i.direction===`vertical`?r:0,i.direction===`horizontal`?r:0,{behavior:s,align:`end`});break}case`ArrowUp`:e.preventDefault(),R(),a&&y(!0,!1);break;case`ArrowDown`:e.preventDefault(),R(),a&&y(!0,!0);break;case`ArrowLeft`:e.preventDefault(),R(),r&&y(!1,!1);break;case`ArrowRight`:e.preventDefault(),R(),r&&y(!1,!0);break;case`PageUp`:e.preventDefault(),R(),i.direction===`horizontal`?A(null,v(!1,!1),{align:f||`end`}):A(v(!0,!1),null,{align:f||`end`});break;case`PageDown`:e.preventDefault(),R(),i.direction===`horizontal`?A(null,v(!1,!0),{align:f||`start`}):A(v(!0,!0),null,{align:f||`start`});break}}(0,t.onUnmounted)(()=>{U?.disconnect(),Ee?.disconnect(),W?.disconnect()});let ze=(0,t.computed)(()=>{let e={...i.direction===`vertical`?{}:{whiteSpace:`nowrap`}};return(be.value||!B.value)&&(e.overflow=`auto`),ye.value&&(e.touchAction=`none`),B.value?e:i.containerTag===`table`?{...e,display:`block`,minInlineSize:i.direction===`vertical`?`100%`:`auto`}:e});function Be(e,t,n,r,i,a){return t<=r?null:{axis:e,positionPercent:a.positionPercent.value,viewportPercent:a.viewportPercent.value,thumbSizePercent:a.thumbSizePercent.value,thumbPositionPercent:a.thumbPositionPercent.value,trackProps:a.trackProps.value,thumbProps:a.thumbProps.value,scrollbarProps:{axis:e,totalSize:t,position:n,viewportSize:r,scrollToOffset:i,containerId:g.value,isRtl:C.value,ariaLabel:`${e===`vertical`?`Vertical`:`Horizontal`} scroll`},isDragging:a.isDragging.value}}let Ve=(0,t.computed)(()=>{if(i.direction===`horizontal`)return null;let{displayViewportSize:e,displayScrollOffset:t}=D.value;return Be(`vertical`,ee.value,t.y,e.height,xe,Se)}),X=(0,t.computed)(()=>{if(i.direction===`vertical`)return null;let{displayViewportSize:e,displayScrollOffset:t}=D.value;return Be(`horizontal`,O.value,t.x,e.width,H,Ce)}),Z=(0,t.computed)(()=>{let e=i.direction===`horizontal`,t=i.direction===`vertical`,n=i.direction===`both`,r={inlineSize:t?`100%`:`${he.value}px`,blockSize:e?`100%`:`${ge.value}px`};return S.value||(r.display=`flex`,r.flexDirection=e?`row`:`column`,(e||n)&&i.columnGap&&(r.columnGap=`${i.columnGap}px`),(t||n)&&i.gap&&(r.rowGap=`${i.gap}px`)),r}),He=(0,t.computed)(()=>{let e=i.direction===`horizontal`;return{display:e?`inline-block`:`block`,...e?{blockSize:`100%`,verticalAlign:`top`}:{inlineSize:`100%`}}}),Ue=(0,t.computed)(()=>({inlineSize:i.direction===`vertical`?`1px`:`${he.value}px`,blockSize:i.direction===`horizontal`?`1px`:`${ge.value}px`}));function We(e){let t=k({containerTag:i.containerTag||`div`,direction:i.direction,isHydrated:S.value,item:e,itemSize:i.itemSize,paddingStartX:x.value.scrollPaddingStart.x,paddingStartY:x.value.scrollPaddingStart.y,isRtl:C.value});return!S.value&&i.direction===`both`&&(t.display=`flex`,i.columnGap&&(t.columnGap=`${i.columnGap}px`)),t}let Ge=(0,t.computed)(()=>i.debug),Q=(0,t.computed)(()=>i.containerTag===`table`),Ke=(0,t.computed)(()=>Q.value?`thead`:`div`),qe=(0,t.computed)(()=>Q.value?`tfoot`:`div`),Je=(0,t.computed)(()=>i.role?i.role:Q.value?null:i.direction===`both`?`grid`:`list`),$=(0,t.computed)(()=>Je.value===`grid`||Q.value),Ye=(0,t.computed)(()=>Q.value?null:i.ariaLabel||i.ariaLabelledby?`region`:`none`),Xe=(0,t.computed)(()=>Q.value?null:Je.value),Ze=(0,t.computed)(()=>{if($.value)return`row`;let e=Je.value;return e===`tree`?`treeitem`:e===`listbox`?`option`:e===`menu`?`menuitem`:`listitem`}),Qe=(0,t.computed)(()=>i.itemRole==null?Ze.value:i.itemRole),$e=(0,t.computed)(()=>i.role===`grid`||!i.role&&i.direction===`both`?`gridcell`:Q.value?`cell`:null),et=(0,t.computed)(()=>{let e=Qe.value;return e==null||e!==`none`&&e!==`presentation`}),tt=(0,t.computed)(()=>({"aria-label":i.ariaLabel,"aria-labelledby":i.ariaLabelledby,"aria-busy":i.loading?`true`:void 0})),nt=(0,t.computed)(()=>{let e={},t=Je.value;return t&&[`grid`,`tree`,`listbox`,`menu`,`tablist`].includes(t)&&(e[`aria-orientation`]=i.direction===`both`?void 0:i.direction),$.value&&(e[`aria-rowcount`]=i.items.length,i.columnCount>0&&(e[`aria-colcount`]=i.columnCount)),e});function rt(e){let t={};$.value?t[`aria-rowindex`]=e+1:(t[`aria-setsize`]=i.items.length,t[`aria-posinset`]=e+1);let n=Qe.value;return n!==null&&(t.role=n===`none`||n===`presentation`?Ze.value:n),t}function it(e){let t=$e.value;if(!t)return{};let n={role:t};return $.value&&(n[`aria-colindex`]=e+1),n}return n({...(0,t.toRefs)(i),scrollDetails:D,columnRange:w,getColumnWidth:te,getRowHeight:ne,getCellAriaProps:it,getItemAriaProps:rt,getRowOffset:ae,getColumnOffset:fe,getItemOffset:F,getItemSize:pe,getRowIndexAt:_e,getColIndexAt:ve,scrollToIndex:A,scrollToOffset:j,refresh:Te,stopProgrammaticScroll:()=>{R(),Pe()},updateDirection:ie,isRtl:C,isHydrated:S,scaleX:me,scaleY:z,renderedWidth:O,renderedHeight:ee,componentOffset:V,scrollbarPropsVertical:Ve,scrollbarPropsHorizontal:X}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.containerTag),(0,t.mergeProps)({id:g.value,ref_key:`hostRef`,ref:c,class:[`virtual-scroll-container`,[`virtual-scroll--${e.direction}`,{"virtual-scroll--hydrated":(0,t.unref)(S),"virtual-scroll--window":(0,t.unref)(B),"virtual-scroll--table":Q.value,"virtual-scroll--hide-scrollbar":be.value}]],style:ze.value,tabindex:`0`,role:Q.value?void 0:Ye.value},Q.value?{...tt.value,...nt.value}:tt.value,{onKeydown:Re,onPointerdown:Fe,onPointermove:Ie,onPointerup:Le,onPointercancel:Le}),{default:(0,t.withCtx)(()=>[be.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,le,[(0,t.createElementVNode)(`div`,{class:`virtual-scroll-scrollbar-viewport`,style:(0,t.normalizeStyle)({inlineSize:`${(0,t.unref)(D).displayViewportSize.width}px`,blockSize:`${(0,t.unref)(D).displayViewportSize.height}px`,"--vsi-scrollbar-has-cross-gap":e.direction===`both`?1:0})},[s.scrollbar&&Ve.value?(0,t.renderSlot)(n.$slots,`scrollbar`,(0,t.normalizeProps)((0,t.mergeProps)({key:0},Ve.value)),void 0,!0):Ve.value?((0,t.openBlock)(),(0,t.createBlock)(ce,(0,t.normalizeProps)((0,t.mergeProps)({key:1},Ve.value.scrollbarProps)),null,16)):(0,t.createCommentVNode)(``,!0),s.scrollbar&&X.value?(0,t.renderSlot)(n.$slots,`scrollbar`,(0,t.normalizeProps)((0,t.mergeProps)({key:2},X.value)),void 0,!0):X.value?((0,t.openBlock)(),(0,t.createBlock)(ce,(0,t.normalizeProps)((0,t.mergeProps)({key:3},X.value.scrollbarProps)),null,16)):(0,t.createCommentVNode)(``,!0)],4)])):(0,t.createCommentVNode)(``,!0),s.header?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(Ke.value),{key:1,ref_key:`headerRef`,ref:u,class:(0,t.normalizeClass)([`virtual-scroll-header`,{"virtual-scroll--sticky":e.stickyHeader}]),role:Q.value?void 0:`none`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`header`,{},void 0,!0)]),_:3},8,[`class`,`role`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.wrapperTag),(0,t.mergeProps)({ref_key:`wrapperRef`,ref:l,class:`virtual-scroll-wrapper`,style:Z.value,role:Q.value?void 0:Xe.value},Q.value?{}:nt.value),{default:(0,t.withCtx)(()=>[Q.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.itemTag),{key:0,class:`virtual-scroll-spacer`,style:(0,t.normalizeStyle)(Ue.value)},{default:(0,t.withCtx)(()=>[...r[0]||=[(0,t.createElementVNode)(`td`,{style:{padding:`0`,border:`none`,"block-size":`inherit`}},null,-1)]]),_:1},8,[`style`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(E),r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.itemTag),(0,t.mergeProps)({key:r.index,ref_for:!0,ref:e=>Oe(e,r.index),"data-index":r.index,class:[`virtual-scroll-item`,{"virtual-scroll--sticky":r.isStickyActive,"virtual-scroll--debug":Ge.value}],style:We(r)},{ref_for:!0},et.value?rt(r.index):{role:`none`}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`item`,{item:r.item,index:r.index,getItemAriaProps:rt,columnRange:we.value,getColumnWidth:(0,t.unref)(te),getCellAriaProps:it,gap:i.gap,columnGap:i.columnGap,isSticky:r.isSticky,isStickyActive:r.isStickyActive,isStickyActiveX:r.isStickyActiveX,isStickyActiveY:r.isStickyActiveY,offset:r.offset},void 0,!0),Ge.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ue,` #`+(0,t.toDisplayString)(r.index)+` (`+(0,t.toDisplayString)(Math.round(r.offset.x))+`, `+(0,t.toDisplayString)(Math.round(r.offset.y))+`) `,1)):(0,t.createCommentVNode)(``,!0)]),_:2},1040,[`data-index`,`class`,`style`]))),128))]),_:3},16,[`style`,`role`])),e.loading&&s.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`virtual-scroll-loading`,style:(0,t.normalizeStyle)(He.value),"aria-live":`polite`,"aria-atomic":`true`},[(0,t.renderSlot)(n.$slots,`loading`,{},void 0,!0)],4)):(0,t.createCommentVNode)(``,!0),s.footer?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(qe.value),{key:3,ref_key:`footerRef`,ref:p,class:(0,t.normalizeClass)([`virtual-scroll-footer`,{"virtual-scroll--sticky":e.stickyFooter}]),role:Q.value?void 0:`none`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`footer`,{},void 0,!0)]),_:3},8,[`class`,`role`])):(0,t.createCommentVNode)(``,!0)]),_:3},16,[`id`,`class`,`style`,`role`]))}}),[[`__scopeId`,`data-v-55dd91b2`]]);e.BROWSER_MAX_SIZE=r,e.DEFAULT_BUFFER=5,e.DEFAULT_COLUMN_WIDTH=100,e.DEFAULT_ITEM_SIZE=40,e.EMPTY_SCROLL_DETAILS=n,e.FenwickTree=F,e.VirtualScroll=fe,e.VirtualScrollbar=ce,e.calculateAxisSize=_,e.calculateColumnRange=O,e.calculateIndexAt=ie,e.calculateInertiaStep=M,e.calculateInstantaneousVelocity=N,e.calculateItemPosition=ne,e.calculateItemStyle=k,e.calculateOffsetAt=y,e.calculatePrependCount=j,e.calculateRange=ee,e.calculateRangeSize=v,e.calculateRenderedSize=w,e.calculateSSROffsets=A,e.calculateScale=C,e.calculateScrollTarget=D,e.calculateStickyItem=te,e.calculateTotalSize=re,e.displayToVirtual=T,e.findPrevStickyIndex=h,e.getPaddingX=d,e.getPaddingY=f,e.isBody=a,e.isElement=s,e.isItemVisible=S,e.isScrollToIndexOptions=u,e.isScrollableElement=c,e.isWindow=i,e.isWindowLike=o,e.resolveSnap=P,e.scrollTo=l,e.useVirtualScroll=oe,e.useVirtualScrollSizes=ae,e.useVirtualScrollbar=se,e.virtualToDisplay=E});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|