import{ai as Ne,Y as c,bl as ze,bm as v,aZ as w,aY as B,b4 as Ee,d as Me,a_ as X,r as ee,e as Le,bn as Ce,a as R,aM as Ie,aW as Be,b9 as te,aL as Re,bo as Te,bp as Oe,__tla as _e}from"./index-327f993b.js";let ae,A,re,le,ne,j,h,oe,T,se,O,P,k,ie,ue,H,ce,de,me,ve,pe,fe,V,ge,he,$e=Promise.all([(()=>{try{return _e}catch{}})()]).then(async()=>{var W=Number.isNaN||function(e){return typeof e=="number"&&e!=e};function ye(e,a){if(e.length!==a.length)return!1;for(var l=0;l{const e=Ne().proxy.$props;return c(()=>{const a=(l,n,r)=>({});return e.perfMode?ze(a):function(l,n){n===void 0&&(n=ye);var r=null;function p(){for(var u=[],d=0;dEe([])},direction:K,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},style:{type:w([Object,String,Array])},useIsScrolling:{type:Boolean,default:!1},width:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:{type:Boolean,default:!1}}),he=B({cache:z,estimatedItemSize:N,layout:_,initScrollOffset:E,total:y,itemSize:x,...$}),M={type:Number,default:6},q={type:Number,default:0},D={type:Number,default:2},pe=B({columnCache:z,columnWidth:x,estimatedColumnWidth:N,estimatedRowHeight:N,initScrollLeft:E,initScrollTop:E,itemKey:{type:w(Function),default:({columnIndex:e,rowIndex:a})=>`${a}:${e}`},rowCache:z,rowHeight:x,totalColumn:y,totalRow:y,hScrollbarSize:M,vScrollbarSize:M,scrollbarStartGap:q,scrollbarEndGap:D,role:String,...$}),V=B({alwaysOn:Boolean,class:String,layout:_,total:y,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize:M,startGap:q,endGap:D,visible:Boolean}),ue=(e,a)=>ee==="ltr"||e===T||e===h,fe=e=>e===T;let b=null;de=function(e=!1){if(b===null||e){const a=document.createElement("div"),l=a.style;l.width="50px",l.height="50px",l.overflow="scroll",l.direction="rtl";const n=document.createElement("div"),r=n.style;return r.width="100px",r.height="100px",a.appendChild(n),document.body.appendChild(a),a.scrollLeft>0?b=H:(a.scrollLeft=1,b=a.scrollLeft===0?k:P),document.body.removeChild(a),b}return b},ie=Me({name:"ElVirtualScrollBar",props:V,emits:["scroll","start-move","stop-move"],setup(e,{emit:a}){const l=c(()=>e.startGap+e.endGap),n=X("virtual-scrollbar"),r=X("scrollbar"),p=ee(),u=ee();let d=null,f=null;const i=Le({isDragging:!1,traveled:0}),o=c(()=>Ce[e.layout]),Z=c(()=>e.clientSize-R(l)),be=c(()=>({position:"absolute",width:`${h===e.layout?Z.value:e.scrollbarSize}px`,height:`${h===e.layout?e.scrollbarSize:Z.value}px`,[Y[e.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),F=c(()=>{const t=e.ratio,s=e.clientSize;if(t>=100)return Number.POSITIVE_INFINITY;if(t>=50)return t*s/100;const g=s/3;return Math.floor(Math.min(Math.max(t*s,20),g))}),Se=c(()=>{if(!Number.isFinite(F.value))return{display:"none"};const t=`${F.value}px`;return function({move:g,size:I,bar:U},xe){const m={},G=`translate${U.axis}(${g}px)`;return m[U.size]=I,m.transform=G,m.msTransform=G,m.webkitTransform=G,xe==="horizontal"?m.height="100%":m.width="100%",m}({bar:o.value,size:t,move:i.traveled},e.layout)}),S=c(()=>Math.floor(e.clientSize-F.value-R(l))),J=()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",L),document.onselectstart=f,f=null;const t=R(u);t&&(t.removeEventListener("touchmove",C),t.removeEventListener("touchend",L))},Q=t=>{t.stopImmediatePropagation(),t.ctrlKey||[1,2].includes(t.button)||(i.isDragging=!0,i[o.value.axis]=t.currentTarget[o.value.offset]-(t[o.value.client]-t.currentTarget.getBoundingClientRect()[o.value.direction]),a("start-move"),(()=>{window.addEventListener("mousemove",C),window.addEventListener("mouseup",L);const s=R(u);s&&(f=document.onselectstart,document.onselectstart=()=>!1,s.addEventListener("touchmove",C),s.addEventListener("touchend",L))})())},L=()=>{i.isDragging=!1,i[o.value.axis]=0,a("stop-move"),J()},C=t=>{const{isDragging:s}=i;if(!s||!u.value||!p.value)return;const g=i[o.value.axis];if(!g)return;Te(d);const I=-1*(p.value.getBoundingClientRect()[o.value.direction]-t[o.value.client])-(u.value[o.value.offset]-g);d=Oe(()=>{i.traveled=Math.max(e.startGap,Math.min(I,S.value)),a("scroll",I,S.value)})},we=t=>{const s=Math.abs(t.target.getBoundingClientRect()[o.value.direction]-t[o.value.client])-u.value[o.value.offset]/2;i.traveled=Math.max(0,Math.min(s,S.value)),a("scroll",s,S.value)};return Ie(()=>e.scrollFrom,t=>{i.isDragging||(i.traveled=Math.ceil(t*S.value))}),Be(()=>{J()}),()=>te("div",{role:"presentation",ref:p,class:[n.b(),e.class,(e.alwaysOn||i.isDragging)&&"always-on"],style:be.value,onMousedown:Re(we,["stop","prevent"]),onTouchstartPrevent:Q},te("div",{ref:u,class:r.e("thumb"),style:Se.value,onMousedown:Q},[]))}})});export{ae as A,A as B,re as C,le as D,ne as E,j as F,h as H,oe as I,T as R,se as S,O as V,$e as __tla,P as a,k as b,ie as c,ue as d,H as e,ce as f,de as g,me as h,ve as i,pe as j,fe as k,V as l,ge as u,he as v};