@ehfuse/overlay-scrollbar 1.6.24 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var He=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var yt=(h,x)=>{for(var C in x)He(h,C,{get:x[C],enumerable:!0})},xt=(h,x,C,T)=>{if(x&&typeof x=="object"||typeof x=="function")for(let H of gt(x))!vt.call(h,H)&&H!==C&&He(h,H,{get:()=>x[H],enumerable:!(T=bt(x,H))||T.enumerable});return h};var wt=h=>xt(He({},"__esModule",{value:!0}),h);var kt={};yt(kt,{OverlayScrollbar:()=>Le,default:()=>Le});module.exports=wt(kt);var t=require("react");var Tt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],me=(h,x)=>{if(h instanceof HTMLElement&&h.isContentEditable||h.closest('[role="textbox"],[role="searchbox"]'))return!0;let C=h.tagName.toLowerCase();if(C==="input"){let T=(h.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(T)}if(["textarea","select","button"].includes(C)||["svg","path","circle","rect","line","polygon","polyline"].includes(C)||h.getAttribute("contenteditable")==="true")return!0;if(x?.excludeSelectors){for(let T of x.excludeSelectors)if(h.matches(T))return!0}return Mt(h,x)},Mt=(h,x)=>{let C=[...Tt,...x?.excludeClasses||[]],T=h,H=0,$=5;for(;T&&H<=$;){if(C.some(L=>T.classList.contains(L)))return!0;if(T.classList.contains("MuiDialogContent-root"))break;T=T.parentElement,H++}return!1};var E=require("react/jsx-runtime"),St={},Et={},Ct={},Ht={},Lt={},Dt=(0,t.forwardRef)(({className:h="",style:x={},containerStyle:C={},contentStyle:T={},children:H,onScroll:$,thumb:L=St,track:k=Et,arrows:z=Ct,dragScroll:Z=Ht,autoHide:_=Lt,showScrollbar:j=!0,showHorizontalScrollbar:De=!0,detectInnerScroll:Ye=!1},Ge)=>{let Ke=(0,t.useRef)({});(0,t.useEffect)(()=>{Ke.current={children:H,onScroll:$,showScrollbar:j,showHorizontalScrollbar:De,thumb:L,track:k,arrows:z,dragScroll:Z,autoHide:_}});let he=(0,t.useRef)(null),i=(0,t.useRef)(null),J=(0,t.useRef)(null),Q=(0,t.useRef)(null),Ve=(0,t.useRef)(null),I=(0,t.useRef)(null),[ae,v]=(0,t.useState)(!1),[W,ke]=(0,t.useState)(!1),[Re,Ie]=(0,t.useState)(!1),[fe,Ze]=(0,t.useState)({y:0,scrollTop:0}),[ee,We]=(0,t.useState)(0),[je,be]=(0,t.useState)(0),[X,Oe]=(0,t.useState)(!1),[Ae,$e]=(0,t.useState)(!1),[O,ze]=(0,t.useState)(!1),[ge,Je]=(0,t.useState)({x:0,scrollLeft:0}),[ve,Pe]=(0,t.useState)(0),[ye,Ne]=(0,t.useState)(0),[Qe,Fe]=(0,t.useState)(!1),Y=(0,t.useRef)(!1),[P,Be]=(0,t.useState)(!1),[te,et]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=(0,t.useState)(null),[ce,se]=(0,t.useState)(null),[Wt,tt]=(0,t.useState)(!1),[ot,rt]=(0,t.useState)(0),oe=(0,t.useRef)(null),[_e,Ue]=(0,t.useState)(!1),re=(0,t.useRef)(null),U=(0,t.useRef)(null),q=(0,t.useRef)(null),y=(0,t.useMemo)(()=>{let e=L.color??"#606060";return{width:L.width??8,minHeight:L.minHeight??50,radius:L.radius??(L.width??8)/2,color:e,opacity:L.opacity??.6,hoverColor:L.hoverColor??e,hoverOpacity:L.hoverOpacity??1}},[L]),n=(0,t.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"outside",radius:k.radius??y.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,y.radius]),R=(0,t.useMemo)(()=>{let e=z.color??"#808080";return{visible:z.visible??!1,step:z.step??50,color:e,opacity:z.opacity??.6,hoverColor:z.hoverColor??e,hoverOpacity:z.hoverOpacity??1}},[z]),ne=(0,t.useMemo)(()=>({enabled:Z.enabled??!0,excludeClasses:Z.excludeClasses??[],excludeSelectors:Z.excludeSelectors??[]}),[Z]),a=(0,t.useMemo)(()=>({enabled:_.enabled??!0,delay:_.delay??1500,delayOnWheel:_.delayOnWheel??700,initialDelay:_.initialDelay??200}),[_]),[G,nt]=(0,t.useState)(()=>(_.initialDelay??200)>0),f=y.width,lt=n.width,xe=y.minHeight,A=R.visible,ue=R.step,D=(0,t.useCallback)(()=>{if(!i.current)return;let e=document.activeElement;e&&i.current.contains(e)&&e!==i.current||i.current.focus()},[]);(0,t.useImperativeHandle)(Ge,()=>({getScrollContainer:()=>i.current,scrollTo:e=>{i.current&&i.current.scrollTo(e)},get scrollTop(){return i.current?.scrollTop||0},get scrollHeight(){return i.current?.scrollHeight||0},get clientHeight(){return i.current?.clientHeight||0}}),[]);let d=(0,t.useCallback)(()=>{if(I.current){let o=I.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;I.current=null}if(!i.current)return null;if(i.current.scrollHeight>i.current.clientHeight+2||i.current.scrollWidth>i.current.clientWidth+2)return I.current=i.current,i.current;if(!Ye)return null;let e=i.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==i.current&&r.classList.contains("overlay-scrollbar-container"))continue;let c=r.parentElement,l=!1;for(;c&&c!==i.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==i.current){l=!0;break}c=c.parentElement}if(!l&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return I.current=r,r}return null},[]),N=(0,t.useCallback)(()=>d()!==null,[d]),b=(0,t.useCallback)(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),de=(0,t.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),qe=(0,t.useCallback)(()=>{q.current&&(clearTimeout(q.current),q.current=null)},[]),it=(0,t.useCallback)(()=>{de(),!(W||O||P||Y.current)&&(b(),v(!1))},[b,de,W,O,P]),m=(0,t.useCallback)(e=>{a.enabled&&(b(),re.current=setTimeout(()=>{v(!1),re.current=null},e))},[b,a.enabled]),u=(0,t.useCallback)(()=>{let e=d()??i.current;if(!e){v(!1),Oe(!1),Fe(!1),b();return}!a.enabled&&!G&&(v(!0),b());let o=e.clientHeight,r=e.scrollHeight,c=e.scrollTop,l=e.clientWidth,s=e.scrollWidth,g=e.scrollLeft,w=r-o>0,p=s-l>0,K=w||p;Oe(w),Fe(p),K||(v(!1),b());let le=0,S=0;if(he.current){let F=window.getComputedStyle(he.current),B=parseFloat(F.paddingTop)||0;S=parseFloat(F.paddingBottom)||0,le=B+S,rt(S)}if(w){let F=A?f*2+n.margin*4:n.margin*2,B=o-F+le,pe=o/r,V=Math.max(B*pe,xe),Xe=r-o,ht=B-V,ft=Xe>0?c/Xe*ht:0;We(V),be(ft)}else We(0),be(0);let ie=s-l;if(ie>0){let F=l/s,B=Math.max(l*F,50),pe=l-B,V=ie>0?g/ie*pe:0;Pe(B),Ne(V)}else Pe(0),Ne(0)},[d,b,A,f,xe,a.enabled,G]),at=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ke(!0),Ze({y:e.clientY,scrollTop:o.scrollTop}),b(),v(!0),D())},[d,b,D]),we=(0,t.useCallback)(e=>{if(!W)return;let o=d();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,s=e.clientY-fe.y,g=r-ee,w=s/g*l,p=Math.max(0,Math.min(l,fe.scrollTop+w));o.scrollTop=p,u()},[W,fe,ee,u,d]),Te=(0,t.useCallback)(()=>{ke(!1),N()&&m(a.delay)},[N,m,a.delay]),ct=(0,t.useCallback)(e=>{if(!Q.current)return;let r=Q.current.getBoundingClientRect(),c=e.clientY-r.top,l=d();if(!l)return;let s=l.clientHeight,g=l.scrollHeight,p=c/s*(g-s);l.scrollTop=Math.max(0,Math.min(g-s,p)),u(),v(!0),m(a.delay),D()},[u,m,a.delay,d,D]),st=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current)return;let o=Math.max(0,i.current.scrollTop-ue);i.current.scrollTop=o,u(),v(!0),m(a.delay),D()},[u,m,ue,a.delay,D]),ut=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current||!J.current)return;let o=i.current,c=J.current.scrollHeight-o.clientHeight,l=Math.min(c,o.scrollTop+ue);o.scrollTop=l,u(),v(!0),m(a.delay),D()},[u,m,ue,a.delay,D]),dt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ze(!0),Je({x:e.clientX,scrollLeft:o.scrollLeft}),b(),v(!0),D())},[d,b,D]),Me=(0,t.useCallback)(e=>{if(!O)return;let o=d();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,s=e.clientX-ge.x,g=r-ve,w=s/g*l,p=Math.max(0,Math.min(l,ge.scrollLeft+w));o.scrollLeft=p,u()},[O,ge,ve,u,d]),Se=(0,t.useCallback)(()=>{ze(!1),N()&&m(a.delay)},[N,m,a.delay]),pt=(0,t.useCallback)(e=>{if(!Q.current)return;let r=Q.current.getBoundingClientRect(),c=e.clientX-r.left,l=d();if(!l)return;let s=l.clientWidth,g=l.scrollWidth,p=c/s*(g-s);l.scrollLeft=Math.max(0,Math.min(g-s,p)),u(),v(!0),m(a.delay),D()},[u,m,a.delay,d,D]),mt=(0,t.useCallback)(e=>{if(!ne.enabled)return;let o=e.target;if(me(o,ne)||e.button!==0)return;let r=d();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),Y.current=!0,et({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),b()))},[ne,me,d,b]),Ee=(0,t.useCallback)(e=>{if(!Y.current&&!P)return;let o=d();if(!o)return;let r=te.x-e.clientX,c=te.y-e.clientY;if(Math.abs(c)<5&&Math.abs(r)<5)return;Y.current&&(Y.current=!1,Be(!0)),v(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,te.scrollTop+c)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,te.scrollLeft+r));o.scrollTop=l,o.scrollLeft=s,u()},[P,te,d,u]),Ce=(0,t.useCallback)(()=>{let e=P;Y.current=!1,Be(!1),e&&N()&&m(a.delay)},[P,N,m,a.delay]);(0,t.useEffect)(()=>{let e=s=>{if(u(),G){$&&$(s);return}b(),v(!0),qe();let g=_e?a.delayOnWheel:a.delay;m(g),$&&$(s)},o=()=>{Ue(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{Ue(!1)},300),qe(),q.current=setTimeout(()=>{v(!0),q.current=null,m(a.delayOnWheel)},50)},r=[],c=d();c&&r.push(c);let l=i.current;return l&&!c&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(g=>{let w=g;if(w!==l&&w.classList.contains("overlay-scrollbar-container"))return;let p=w.parentElement;for(;p&&p!==l;){if(p.classList.contains("overlay-scrollbar-container")&&p!==l)return;p=p.parentElement}r.push(w)})),r.forEach(s=>{s.addEventListener("scroll",e,{passive:!0}),s.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(s=>{s.removeEventListener("scroll",e),s.removeEventListener("wheel",o)}),oe.current&&clearTimeout(oe.current),q.current&&clearTimeout(q.current)}},[d,u,$,b,m,a,_e,G]),(0,t.useEffect)(()=>{let e=r=>{let c=r.target;if(r.defaultPrevented||c instanceof Element&&me(c,ne))return;let l=d();if(!l)return;let{key:s}=r,{scrollTop:g,scrollHeight:w,clientHeight:p}=l,K=w-p,le=50,S=null;switch(s){case"ArrowUp":r.preventDefault(),S=Math.max(0,g-le);break;case"ArrowDown":r.preventDefault(),S=Math.min(K,g+le);break;case"PageUp":r.preventDefault(),S=Math.max(0,g-p);break;case"PageDown":r.preventDefault(),S=Math.min(K,g+p);break;case"Home":r.preventDefault(),S=0;break;case"End":r.preventDefault(),S=K;break;default:return}if(S!==null){let ie=S/K,F=A?f*2+n.margin*4:n.margin*2,V=(p-F-ee)*ie;be(V),l.scrollTop=S,b(),v(!0),m(a.delay)}},o=i.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[d,A,f,n.margin,ee,b,m,a.delay,ne]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ce)}),[P,Ee,Ce]),(0,t.useEffect)(()=>{if(W)return document.addEventListener("mousemove",we),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Te)}},[W,we,Te]),(0,t.useEffect)(()=>{if(O)return document.addEventListener("mousemove",Me),document.addEventListener("mouseup",Se),()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",Se)}},[O,Me,Se]),(0,t.useEffect)(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),(0,t.useLayoutEffect)(()=>{tt(!0),u(),!a.enabled&&!G&&N()&&v(!0)},[N,u,a.enabled,G]),(0,t.useEffect)(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{nt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{u()}),o=[];return i.current&&o.push(i.current),J.current&&o.push(J.current),I.current&&document.contains(I.current)&&o.push(I.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[u]),(0,t.useEffect)(()=>{if(!i.current)return;let e=new MutationObserver(()=>{I.current=null,u()});return e.observe(i.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let M=Math.max(lt,f);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
1
+ "use strict";var $e=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var Ht=(p,f)=>{for(var E in f)$e(p,E,{get:f[E],enumerable:!0})},Lt=(p,f,E,m)=>{if(f&&typeof f=="object"||typeof f=="function")for(let S of St(f))!Ct.call(p,S)&&S!==E&&$e(p,S,{get:()=>f[S],enumerable:!(m=Et(f,S))||m.enumerable});return p};var Dt=p=>Lt($e({},"__esModule",{value:!0}),p);var Nt={};Ht(Nt,{OverlayScrollbar:()=>ze,default:()=>ze});module.exports=Dt(Nt);var t=require("react");var Rt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Me=(p,f)=>{if(p instanceof HTMLElement&&p.isContentEditable||p.closest('[role="textbox"],[role="searchbox"]'))return!0;let E=p.tagName.toLowerCase();if(E==="input"){let m=(p.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(m)}if(["textarea","select","button"].includes(E)||["svg","path","circle","rect","line","polygon","polyline"].includes(E)||p.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let m of f.excludeSelectors)if(p.matches(m))return!0}return kt(p,f)},kt=(p,f)=>{let E=[...Rt,...f?.excludeClasses||[]],m=p,S=0,O=5;for(;m&&S<=O;){if(E.some(C=>m.classList.contains(C)))return!0;if(m.classList.contains("MuiDialogContent-root"))break;m=m.parentElement,S++}return!1};var W=require("react"),ot=({containerRef:p,config:f})=>{let E=f.enabled??!0,m=f.threshold??80,S=f.maxDistance??m*2,O=f.onRefresh,[C,H]=(0,W.useState)(0),[A,X]=(0,W.useState)(!1),z=(0,W.useRef)(0),ie=(0,W.useRef)(0),$=(0,W.useRef)(!1),Y=(0,W.useRef)(!1),ae=(0,W.useRef)(0),ee=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{ee.current=A},[A]),(0,W.useEffect)(()=>{let R=p.current;if(!R||!(E&&typeof O=="function"))return;let i=k=>{ee.current||k.touches.length===1&&(R.scrollTop>0||($.current=!0,Y.current=!1,z.current=k.touches[0].clientY,ie.current=k.touches[0].clientX))},q=k=>{if(!$.current||ee.current||k.touches.length!==1)return;let L=k.touches[0].clientY-z.current,ce=k.touches[0].clientX-ie.current;if(!Y.current){if(L<=0||R.scrollTop>0){$.current=!1;return}if(L>8&&L>Math.abs(ce))Y.current=!0;else return}k.cancelable&&k.preventDefault();let Z=Math.min(Math.max(L,0)*.5,S);ae.current=Z,H(Z)},N=()=>{if(!$.current||($.current=!1,!Y.current))return;Y.current=!1;let k=ae.current;ae.current=0,k>=m&&!ee.current?(X(!0),H(m),Promise.resolve().then(()=>O()).catch(()=>{}).finally(()=>{X(!1),H(0)})):H(0)};return R.addEventListener("touchstart",i,{passive:!0}),R.addEventListener("touchmove",q,{passive:!1}),R.addEventListener("touchend",N,{passive:!0}),R.addEventListener("touchcancel",N,{passive:!0}),()=>{R.removeEventListener("touchstart",i),R.removeEventListener("touchmove",q),R.removeEventListener("touchend",N),R.removeEventListener("touchcancel",N)}},[p,E,O,m,S]),{pullDistance:C,isRefreshing:A,pullProgress:Math.min(C/m,1),pullThreshold:m}};var w=require("react/jsx-runtime"),It={},Wt={},Ot={},At={},Pt={},$t={},zt=(0,t.forwardRef)(({className:p="",style:f={},containerStyle:E={},contentStyle:m={},children:S,onScroll:O,thumb:C=It,track:H=Wt,arrows:A=Ot,dragScroll:X=At,autoHide:z=Pt,pullToRefresh:ie=$t,showScrollbar:$=!0,showHorizontalScrollbar:Y=!0,detectInnerScroll:ae=!1},ee)=>{let R=(0,t.useRef)({});(0,t.useEffect)(()=>{R.current={children:S,onScroll:O,showScrollbar:$,showHorizontalScrollbar:Y,thumb:C,track:H,arrows:A,dragScroll:X,autoHide:z}});let be=(0,t.useRef)(null),i=(0,t.useRef)(null),q=(0,t.useRef)(null),N=(0,t.useRef)(null),k=(0,t.useRef)(null),L=(0,t.useRef)(null),{pullDistance:ce,isRefreshing:Z,pullProgress:Ee}=ot({containerRef:i,config:ie}),Ne=ie.indicatorColor??"#1976d2",rt=ce>0||Z,[ge,x]=(0,t.useState)(!1),[_,Fe]=(0,t.useState)(!1),[_e,Ue]=(0,t.useState)(!1),[Se,nt]=(0,t.useState)({y:0,scrollTop:0}),[se,Be]=(0,t.useState)(0),[lt,Ce]=(0,t.useState)(0),[te,Xe]=(0,t.useState)(!1),[Ye,qe]=(0,t.useState)(!1),[U,Ge]=(0,t.useState)(!1),[He,it]=(0,t.useState)({x:0,scrollLeft:0}),[Le,je]=(0,t.useState)(0),[De,Ke]=(0,t.useState)(0),[at,Ve]=(0,t.useState)(!1),oe=(0,t.useRef)(!1),[G,Ze]=(0,t.useState)(!1),[ue,ct]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ft,_t]=(0,t.useState)(null),[ve,ye]=(0,t.useState)(null),[Ut,st]=(0,t.useState)(!1),[ut,dt]=(0,t.useState)(0),de=(0,t.useRef)(null),[Je,Qe]=(0,t.useState)(!1),pe=(0,t.useRef)(null),J=(0,t.useRef)(null),Q=(0,t.useRef)(null),T=(0,t.useMemo)(()=>{let e=C.color??"#606060";return{width:C.width??8,minHeight:C.minHeight??50,radius:C.radius??(C.width??8)/2,color:e,opacity:C.opacity??.6,hoverColor:C.hoverColor??e,hoverOpacity:C.hoverOpacity??1}},[C]),n=(0,t.useMemo)(()=>({width:H.width??16,color:H.color??"rgba(128, 128, 128, 0.1)",visible:H.visible??!0,alignment:H.alignment??"outside",radius:H.radius??T.radius??4,margin:H.margin??4,overflowX:H.overflowX??!0,overflowY:H.overflowY??!0}),[H,T.radius]),F=(0,t.useMemo)(()=>{let e=A.color??"#808080";return{visible:A.visible??!1,step:A.step??50,color:e,opacity:A.opacity??.6,hoverColor:A.hoverColor??e,hoverOpacity:A.hoverOpacity??1}},[A]),fe=(0,t.useMemo)(()=>({enabled:X.enabled??!0,excludeClasses:X.excludeClasses??[],excludeSelectors:X.excludeSelectors??[]}),[X]),a=(0,t.useMemo)(()=>({enabled:z.enabled??!0,delay:z.delay??1500,delayOnWheel:z.delayOnWheel??700,initialDelay:z.initialDelay??200}),[z]),[re,pt]=(0,t.useState)(()=>(z.initialDelay??200)>0),g=T.width,ft=n.width,Re=T.minHeight,B=F.visible,xe=F.step,P=(0,t.useCallback)(()=>{if(!i.current)return;let e=document.activeElement;e&&i.current.contains(e)&&e!==i.current||i.current.focus()},[]);(0,t.useImperativeHandle)(ee,()=>({getScrollContainer:()=>i.current,scrollTo:e=>{i.current&&i.current.scrollTo(e)},get scrollTop(){return i.current?.scrollTop||0},get scrollHeight(){return i.current?.scrollHeight||0},get clientHeight(){return i.current?.clientHeight||0}}),[]);let d=(0,t.useCallback)(()=>{if(L.current){let o=L.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;L.current=null}if(!i.current)return null;if(i.current.scrollHeight>i.current.clientHeight+2||i.current.scrollWidth>i.current.clientWidth+2)return L.current=i.current,i.current;if(!ae)return null;let e=i.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==i.current&&r.classList.contains("overlay-scrollbar-container"))continue;let c=r.parentElement,l=!1;for(;c&&c!==i.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==i.current){l=!0;break}c=c.parentElement}if(!l&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return L.current=r,r}return null},[]),j=(0,t.useCallback)(()=>d()!==null,[d]),v=(0,t.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Te=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),et=(0,t.useCallback)(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),ht=(0,t.useCallback)(()=>{Te(),!(_||U||G||oe.current)&&(v(),x(!1))},[v,Te,_,U,G]),b=(0,t.useCallback)(e=>{a.enabled&&(v(),pe.current=setTimeout(()=>{x(!1),pe.current=null},e))},[v,a.enabled]),u=(0,t.useCallback)(()=>{let e=d()??i.current;if(!e){x(!1),Xe(!1),Ve(!1),v();return}!a.enabled&&!re&&(x(!0),v());let o=e.clientHeight,r=e.scrollHeight,c=e.scrollTop,l=e.clientWidth,s=e.scrollWidth,y=e.scrollLeft,M=r-o>0,h=s-l>0,ne=M||h;Xe(M),Ve(h),ne||(x(!1),v());let he=0,I=0;if(be.current){let K=window.getComputedStyle(be.current),V=parseFloat(K.paddingTop)||0;I=parseFloat(K.paddingBottom)||0,he=V+I,dt(I)}if(M){let K=B?g*2+n.margin*4:n.margin*2,V=o-K+he,we=o/r,le=Math.max(V*we,Re),tt=r-o,wt=V-le,Mt=tt>0?c/tt*wt:0;Be(le),Ce(Mt)}else Be(0),Ce(0);let me=s-l;if(me>0){let K=l/s,V=Math.max(l*K,50),we=l-V,le=me>0?y/me*we:0;je(V),Ke(le)}else je(0),Ke(0)},[d,v,B,g,Re,a.enabled,re]),mt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(Fe(!0),nt({y:e.clientY,scrollTop:o.scrollTop}),v(),x(!0),P())},[d,v,P]),ke=(0,t.useCallback)(e=>{if(!_)return;let o=d();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,s=e.clientY-Se.y,y=r-se,M=s/y*l,h=Math.max(0,Math.min(l,Se.scrollTop+M));o.scrollTop=h,u()},[_,Se,se,u,d]),Ie=(0,t.useCallback)(()=>{Fe(!1),j()&&b(a.delay)},[j,b,a.delay]),bt=(0,t.useCallback)(e=>{if(!N.current)return;let r=N.current.getBoundingClientRect(),c=e.clientY-r.top,l=d();if(!l)return;let s=l.clientHeight,y=l.scrollHeight,h=c/s*(y-s);l.scrollTop=Math.max(0,Math.min(y-s,h)),u(),x(!0),b(a.delay),P()},[u,b,a.delay,d,P]),gt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current)return;let o=Math.max(0,i.current.scrollTop-xe);i.current.scrollTop=o,u(),x(!0),b(a.delay),P()},[u,b,xe,a.delay,P]),vt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current||!q.current)return;let o=i.current,c=q.current.scrollHeight-o.clientHeight,l=Math.min(c,o.scrollTop+xe);o.scrollTop=l,u(),x(!0),b(a.delay),P()},[u,b,xe,a.delay,P]),yt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(Ge(!0),it({x:e.clientX,scrollLeft:o.scrollLeft}),v(),x(!0),P())},[d,v,P]),We=(0,t.useCallback)(e=>{if(!U)return;let o=d();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,s=e.clientX-He.x,y=r-Le,M=s/y*l,h=Math.max(0,Math.min(l,He.scrollLeft+M));o.scrollLeft=h,u()},[U,He,Le,u,d]),Oe=(0,t.useCallback)(()=>{Ge(!1),j()&&b(a.delay)},[j,b,a.delay]),xt=(0,t.useCallback)(e=>{if(!N.current)return;let r=N.current.getBoundingClientRect(),c=e.clientX-r.left,l=d();if(!l)return;let s=l.clientWidth,y=l.scrollWidth,h=c/s*(y-s);l.scrollLeft=Math.max(0,Math.min(y-s,h)),u(),x(!0),b(a.delay),P()},[u,b,a.delay,d,P]),Tt=(0,t.useCallback)(e=>{if(!fe.enabled)return;let o=e.target;if(Me(o,fe)||e.button!==0)return;let r=d();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),oe.current=!0,ct({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),v()))},[fe,Me,d,v]),Ae=(0,t.useCallback)(e=>{if(!oe.current&&!G)return;let o=d();if(!o)return;let r=ue.x-e.clientX,c=ue.y-e.clientY;if(Math.abs(c)<5&&Math.abs(r)<5)return;oe.current&&(oe.current=!1,Ze(!0)),x(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,ue.scrollTop+c)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,ue.scrollLeft+r));o.scrollTop=l,o.scrollLeft=s,u()},[G,ue,d,u]),Pe=(0,t.useCallback)(()=>{let e=G;oe.current=!1,Ze(!1),e&&j()&&b(a.delay)},[G,j,b,a.delay]);(0,t.useEffect)(()=>{let e=s=>{if(u(),re){O&&O(s);return}v(),x(!0),et();let y=Je?a.delayOnWheel:a.delay;b(y),O&&O(s)},o=()=>{Qe(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{Qe(!1)},300),et(),Q.current=setTimeout(()=>{x(!0),Q.current=null,b(a.delayOnWheel)},50)},r=[],c=d();c&&r.push(c);let l=i.current;return l&&!c&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(y=>{let M=y;if(M!==l&&M.classList.contains("overlay-scrollbar-container"))return;let h=M.parentElement;for(;h&&h!==l;){if(h.classList.contains("overlay-scrollbar-container")&&h!==l)return;h=h.parentElement}r.push(M)})),r.forEach(s=>{s.addEventListener("scroll",e,{passive:!0}),s.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(s=>{s.removeEventListener("scroll",e),s.removeEventListener("wheel",o)}),de.current&&clearTimeout(de.current),Q.current&&clearTimeout(Q.current)}},[d,u,O,v,b,a,Je,re]),(0,t.useEffect)(()=>{let e=r=>{let c=r.target;if(r.defaultPrevented||c instanceof Element&&Me(c,fe))return;let l=d();if(!l)return;let{key:s}=r,{scrollTop:y,scrollHeight:M,clientHeight:h}=l,ne=M-h,he=50,I=null;switch(s){case"ArrowUp":r.preventDefault(),I=Math.max(0,y-he);break;case"ArrowDown":r.preventDefault(),I=Math.min(ne,y+he);break;case"PageUp":r.preventDefault(),I=Math.max(0,y-h);break;case"PageDown":r.preventDefault(),I=Math.min(ne,y+h);break;case"Home":r.preventDefault(),I=0;break;case"End":r.preventDefault(),I=ne;break;default:return}if(I!==null){let me=I/ne,K=B?g*2+n.margin*4:n.margin*2,le=(h-K-se)*me;Ce(le),l.scrollTop=I,v(),x(!0),b(a.delay)}},o=i.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[d,B,g,n.margin,se,v,b,a.delay,fe]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",Pe),()=>{document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",Pe)}),[G,Ae,Pe]),(0,t.useEffect)(()=>{if(_)return document.addEventListener("mousemove",ke),document.addEventListener("mouseup",Ie),()=>{document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",Ie)}},[_,ke,Ie]),(0,t.useEffect)(()=>{if(U)return document.addEventListener("mousemove",We),document.addEventListener("mouseup",Oe),()=>{document.removeEventListener("mousemove",We),document.removeEventListener("mouseup",Oe)}},[U,We,Oe]),(0,t.useEffect)(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),(0,t.useLayoutEffect)(()=>{st(!0),u(),!a.enabled&&!re&&j()&&x(!0)},[j,u,a.enabled,re]),(0,t.useEffect)(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{pt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{u()}),o=[];return i.current&&o.push(i.current),q.current&&o.push(q.current),L.current&&document.contains(L.current)&&o.push(L.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[u]),(0,t.useEffect)(()=>{if(!i.current)return;let e=new MutationObserver(()=>{L.current=null,u()});return e.observe(i.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let D=Math.max(ft,g);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
2
2
  /* \uBAA8\uB4E0 \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uAE30 */
3
3
  .overlay-scrollbar-container {
4
4
  scrollbar-width: none !important;
@@ -38,5 +38,10 @@
38
38
  .overlay-scrollbar-container .ehfuse-editor-content::-webkit-scrollbar-thumb:hover {
39
39
  background: #a1a1a1 !important;
40
40
  }
41
- `,document.head.appendChild(r),()=>{let c=document.getElementById(e);c&&c.remove()}},[]),(0,E.jsxs)("div",{ref:he,className:`overlay-scrollbar-wrapper ${h}`,onMouseLeave:it,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...x},children:[(0,E.jsx)("div",{ref:i,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:mt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:P?"none":"auto",...C},children:(0,E.jsx)("div",{ref:J,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...T},children:H})}),j&&X&&(n.overflowY??!0)&&(0,E.jsxs)("div",{ref:Q,className:"overlay-scrollbar-track",onMouseEnter:()=>{b(),U.current=setTimeout(()=>{v(!0),U.current=null},100)},onMouseLeave:()=>{de(),W||m(a.delay)},style:{position:"absolute",top:0,right:0,width:`${M}px`,height:"100%",opacity:ae?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,E.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),ct(e)},style:{position:"absolute",top:A?`${y.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-y.width)/2}px`,width:`${y.width}px`,height:A?`calc(100% - ${y.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,E.jsx)("div",{ref:Ve,className:"overlay-scrollbar-thumb",onMouseDown:at,onMouseEnter:()=>Ie(!0),onMouseLeave:()=>Ie(!1),style:{position:"absolute",top:`${(A?f+n.margin*2:n.margin)+je}px`,right:n.alignment==="outside"?"0px":`${(M-f)/2}px`,width:`${f}px`,height:`${Math.max(ee,xe)}px`,backgroundColor:Re||W?y.hoverColor:y.color,opacity:Re||W?y.hoverOpacity:y.opacity,borderRadius:`${y.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),j&&X&&A&&(0,E.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:st,onMouseEnter:()=>se("up"),onMouseLeave:()=>se(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-f)/2}px`,width:`${f}px`,height:`${f}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(f*.75,8)}px`,color:ce==="up"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ae?ce==="up"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),j&&X&&A&&(0,E.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:ut,onMouseEnter:()=>se("down"),onMouseLeave:()=>se(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-f)/2}px`,width:`${f}px`,height:`${f}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(f*.75,8)}px`,color:ce==="down"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ae?ce==="down"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),j&&De&&Qe&&(n.overflowX??!0)&&(0,E.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{b(),U.current=setTimeout(()=>{v(!0),U.current=null},100)},onMouseLeave:()=>{de(),O||m(a.delay)},style:{position:"absolute",bottom:`${ot}px`,left:0,width:"100%",height:`${M}px`,opacity:ae?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,E.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),pt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-f)/2}px`,left:`${n.margin}px`,right:X?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:`${n.margin}px`,height:`${f}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,E.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:dt,onMouseEnter:()=>$e(!0),onMouseLeave:()=>$e(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-f)/2}px`,left:`${n.margin+ye}px`,right:X?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:"auto",maxWidth:X?n.alignment==="outside"?`calc(100% - ${n.margin+ye+M-n.margin}px)`:`calc(100% - ${n.margin+ye+M}px)`:"none",width:`${Math.max(ve,50)}px`,height:`${f}px`,backgroundColor:Ae||O?y.hoverColor:y.color,opacity:Ae||O?y.hoverOpacity:y.opacity,borderRadius:`${y.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Le=Dt;
41
+ /* \uB2F9\uACA8\uC11C \uC0C8\uB85C\uACE0\uCE68 \uC2A4\uD53C\uB108 \uD68C\uC804 */
42
+ @keyframes overlay-scrollbar-ptr-spin {
43
+ from { transform: rotate(0deg); }
44
+ to { transform: rotate(360deg); }
45
+ }
46
+ `,document.head.appendChild(r),()=>{let c=document.getElementById(e);c&&c.remove()}},[]),(0,w.jsxs)("div",{ref:be,className:`overlay-scrollbar-wrapper ${p}`,onMouseLeave:ht,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...f},children:[rt&&(0,w.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${ce-44}px)`,transition:Z?"transform 0.15s ease-out":ce===0?"transform 0.2s ease-out":"none",width:36,height:36,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:Z?1:Math.min(Ee*1.5,1)},children:Z?(0,w.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,w.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ne,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,w.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",style:{transform:`rotate(${Ee*270}deg)`,opacity:Ee>=1?1:.6},children:(0,w.jsx)("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:Ne})})}),(0,w.jsx)("div",{ref:i,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Tt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:G?"none":"auto",...E},children:(0,w.jsx)("div",{ref:q,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...m},children:S})}),$&&te&&(n.overflowY??!0)&&(0,w.jsxs)("div",{ref:N,className:"overlay-scrollbar-track",onMouseEnter:()=>{v(),J.current=setTimeout(()=>{x(!0),J.current=null},100)},onMouseLeave:()=>{Te(),_||b(a.delay)},style:{position:"absolute",top:0,right:0,width:`${D}px`,height:"100%",opacity:ge?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,w.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),bt(e)},style:{position:"absolute",top:B?`${T.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(D-T.width)/2}px`,width:`${T.width}px`,height:B?`calc(100% - ${T.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,w.jsx)("div",{ref:k,className:"overlay-scrollbar-thumb",onMouseDown:mt,onMouseEnter:()=>Ue(!0),onMouseLeave:()=>Ue(!1),style:{position:"absolute",top:`${(B?g+n.margin*2:n.margin)+lt}px`,right:n.alignment==="outside"?"0px":`${(D-g)/2}px`,width:`${g}px`,height:`${Math.max(se,Re)}px`,backgroundColor:_e||_?T.hoverColor:T.color,opacity:_e||_?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),$&&te&&B&&(0,w.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:gt,onMouseEnter:()=>ye("up"),onMouseLeave:()=>ye(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(D-g)/2}px`,width:`${g}px`,height:`${g}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(g*.75,8)}px`,color:ve==="up"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:ge?ve==="up"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),$&&te&&B&&(0,w.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:vt,onMouseEnter:()=>ye("down"),onMouseLeave:()=>ye(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(D-g)/2}px`,width:`${g}px`,height:`${g}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(g*.75,8)}px`,color:ve==="down"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:ge?ve==="down"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),$&&Y&&at&&(n.overflowX??!0)&&(0,w.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{v(),J.current=setTimeout(()=>{x(!0),J.current=null},100)},onMouseLeave:()=>{Te(),U||b(a.delay)},style:{position:"absolute",bottom:`${ut}px`,left:0,width:"100%",height:`${D}px`,opacity:ge?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,w.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),xt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(D-g)/2}px`,left:`${n.margin}px`,right:te?n.alignment==="outside"?`${D-n.margin}px`:`${D}px`:`${n.margin}px`,height:`${g}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,w.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:yt,onMouseEnter:()=>qe(!0),onMouseLeave:()=>qe(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(D-g)/2}px`,left:`${n.margin+De}px`,right:te?n.alignment==="outside"?`${D-n.margin}px`:`${D}px`:"auto",maxWidth:te?n.alignment==="outside"?`calc(100% - ${n.margin+De+D-n.margin}px)`:`calc(100% - ${n.margin+De+D}px)`:"none",width:`${Math.max(Le,50)}px`,height:`${g}px`,backgroundColor:Ye||U?T.hoverColor:T.color,opacity:Ye||U?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ze=zt;
42
47
  //# sourceMappingURL=index.js.map