@ehfuse/overlay-scrollbar 1.7.4 → 1.7.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"usePullToRefresh.d.ts","sourceRoot":"","sources":["../../src/hooks/usePullToRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,qBAAqB;IAC3B,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,sBAAsB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,GAAI,2BAG9B,qBAAqB,KAAG,sBA6I1B,CAAC"}
1
+ {"version":3,"file":"usePullToRefresh.d.ts","sourceRoot":"","sources":["../../src/hooks/usePullToRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,qBAAqB;IAC3B,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,sBAAsB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,GAAI,2BAG9B,qBAAqB,KAAG,sBAiK1B,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{useRef as P,useEffect as $,useState as m,useCallback as f,useMemo as xe,forwardRef as It,useImperativeHandle as Wt,useLayoutEffect as Ot}from"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"],Le=(E,k)=>{if(E instanceof HTMLElement&&E.isContentEditable||E.closest('[role="textbox"],[role="searchbox"]'))return!0;let z=E.tagName.toLowerCase();if(z==="input"){let y=(E.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(y)}if(["textarea","select","button"].includes(z)||["svg","path","circle","rect","line","polygon","polyline"].includes(z)||E.getAttribute("contenteditable")==="true")return!0;if(k?.excludeSelectors){for(let y of k.excludeSelectors)if(E.matches(y))return!0}return kt(E,k)},kt=(E,k)=>{let z=[...Rt,...k?.excludeClasses||[]],y=E,_=0,I=5;for(;y&&_<=I;){if(z.some(S=>y.classList.contains(S)))return!0;if(y.classList.contains("MuiDialogContent-root"))break;y=y.parentElement,_++}return!1};import{useEffect as lt,useRef as ue,useState as it}from"react";var at=({containerRef:E,config:k})=>{let z=k.enabled??!0,y=k.threshold??80,_=k.maxDistance??y*2,I=k.onRefresh,[S,C]=it(0),[W,Y]=it(!1),N=ue(0),de=ue(0),A=ue(!1),q=ue(!1),pe=ue(0),te=ue(!1);return lt(()=>{te.current=W},[W]),lt(()=>{let H=E.current;if(!H||!(z&&typeof I=="function"))return;let l=s=>{let w=s instanceof Element?s:null;for(;w&&w!==H;){if(w instanceof HTMLElement&&w.scrollHeight>w.clientHeight+1&&w.scrollTop>0)return!1;w=w.parentElement}return!0},G=s=>{te.current||s.touches.length===1&&(H.scrollTop>0||l(s.target)&&(A.current=!0,q.current=!1,N.current=s.touches[0].clientY,de.current=s.touches[0].clientX))},j=s=>{if(!A.current||te.current||s.touches.length!==1)return;let w=s.touches[0].clientY-N.current,re=s.touches[0].clientX-de.current;if(!q.current){if(w<=0||H.scrollTop>0){A.current=!1;return}if(w>8&&w>Math.abs(re))q.current=!0;else return}s.cancelable&&s.preventDefault();let ne=Math.min(Math.max(w,0)*.5,_);pe.current=ne,C(ne)},oe=()=>{if(!A.current||(A.current=!1,!q.current))return;q.current=!1;let s=pe.current;pe.current=0,s>=y&&!te.current?(Y(!0),C(y),Promise.resolve().then(()=>I()).catch(()=>{}).finally(()=>{Y(!1),C(0)})):C(0)};return H.addEventListener("touchstart",G,{passive:!0}),H.addEventListener("touchmove",j,{passive:!1}),H.addEventListener("touchend",oe,{passive:!0}),H.addEventListener("touchcancel",oe,{passive:!0}),()=>{H.removeEventListener("touchstart",G),H.removeEventListener("touchmove",j),H.removeEventListener("touchend",oe),H.removeEventListener("touchcancel",oe)}},[E,z,I,y,_]),{pullDistance:S,isRefreshing:W,pullProgress:Math.min(S/y,1),pullThreshold:y}};import{jsx as R,jsxs as _e}from"react/jsx-runtime";var Pt={},At={},$t={},zt={},Nt={},Ft={},_t=It(({className:E="",style:k={},containerStyle:z={},contentStyle:y={},children:_,onScroll:I,thumb:S=Pt,track:C=At,arrows:W=$t,dragScroll:Y=zt,autoHide:N=Nt,pullToRefresh:de=Ft,showScrollbar:A=!0,showHorizontalScrollbar:q=!0,detectInnerScroll:pe=!1},te)=>{let H=P({});$(()=>{H.current={children:_,onScroll:I,showScrollbar:A,showHorizontalScrollbar:q,thumb:S,track:C,arrows:W,dragScroll:Y,autoHide:N}});let Te=P(null),l=P(null),G=P(null),j=P(null),oe=P(null),s=P(null),{pullDistance:w,isRefreshing:re,pullProgress:ne}=at({containerRef:l,config:de}),Ue=de.indicatorColor??"#1976d2",st=w>0||re,[we,x]=m(!1),[U,Be]=m(!1),[Xe,Ye]=m(!1),[De,ut]=m({y:0,scrollTop:0}),[fe,qe]=m(0),[dt,Re]=m(0),[le,Ge]=m(!1),[je,Ke]=m(!1),[B,Ve]=m(!1),[ke,pt]=m({x:0,scrollLeft:0}),[Ie,Ze]=m(0),[We,Je]=m(0),[ft,Qe]=m(!1),ie=P(!1),[K,et]=m(!1),[he,ht]=m({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ut,Bt]=m(null),[Me,Ee]=m(null),[Xt,mt]=m(!1),[bt,gt]=m(0),me=P(null),[tt,ot]=m(!1),be=P(null),Q=P(null),ee=P(null),T=xe(()=>{let e=S.color??"#606060";return{width:S.width??8,minHeight:S.minHeight??50,radius:S.radius??(S.width??8)/2,color:e,opacity:S.opacity??.6,hoverColor:S.hoverColor??e,hoverOpacity:S.hoverOpacity??1}},[S]),r=xe(()=>({width:C.width??16,color:C.color??"rgba(128, 128, 128, 0.1)",visible:C.visible??!0,alignment:C.alignment??"outside",radius:C.radius??T.radius??4,margin:C.margin??4,overflowX:C.overflowX??!0,overflowY:C.overflowY??!0}),[C,T.radius]),F=xe(()=>{let e=W.color??"#808080";return{visible:W.visible??!1,step:W.step??50,color:e,opacity:W.opacity??.6,hoverColor:W.hoverColor??e,hoverOpacity:W.hoverOpacity??1}},[W]),ge=xe(()=>({enabled:Y.enabled??!0,excludeClasses:Y.excludeClasses??[],excludeSelectors:Y.excludeSelectors??[]}),[Y]),a=xe(()=>({enabled:N.enabled??!0,delay:N.delay??1500,delayOnWheel:N.delayOnWheel??700,initialDelay:N.initialDelay??200}),[N]),[ae,vt]=m(()=>(N.initialDelay??200)>0),b=T.width,yt=r.width,Oe=T.minHeight,X=F.visible,Se=F.step,O=f(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);Wt(te,()=>({getScrollContainer:()=>l.current,scrollTo:e=>{l.current&&l.current.scrollTo(e)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let d=f(()=>{if(s.current){let t=s.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;s.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return s.current=l.current,l.current;if(!pe)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==l.current&&o.classList.contains("overlay-scrollbar-container"))continue;let i=o.parentElement,n=!1;for(;i&&i!==l.current;){if(i.classList.contains("overlay-scrollbar-container")&&i!==l.current){n=!0;break}i=i.parentElement}if(!n&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return s.current=o,o}return null},[]),V=f(()=>d()!==null,[d]),g=f(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Ce=f(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),rt=f(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),xt=f(()=>{Ce(),!(U||B||K||ie.current)&&(g(),x(!1))},[g,Ce,U,B,K]),h=f(e=>{a.enabled&&(g(),be.current=setTimeout(()=>{x(!1),be.current=null},e))},[g,a.enabled]),u=f(()=>{let e=d()??l.current;if(!e){x(!1),Ge(!1),Qe(!1),g();return}!a.enabled&&!ae&&(x(!0),g());let t=e.clientHeight,o=e.scrollHeight,i=e.scrollTop,n=e.clientWidth,c=e.scrollWidth,v=e.scrollLeft,M=o-t>0,p=c-n>0,ce=M||p;Ge(M),Qe(p),ce||(x(!1),g());let ve=0,D=0;if(Te.current){let Z=window.getComputedStyle(Te.current),J=parseFloat(Z.paddingTop)||0;D=parseFloat(Z.paddingBottom)||0,ve=J+D,gt(D)}if(M){let Z=X?b*2+r.margin*4:r.margin*2,J=t-Z+ve,He=t/o,se=Math.max(J*He,Oe),nt=o-t,Lt=J-se,Dt=nt>0?i/nt*Lt:0;qe(se),Re(Dt)}else qe(0),Re(0);let ye=c-n;if(ye>0){let Z=n/c,J=Math.max(n*Z,50),He=n-J,se=ye>0?v/ye*He:0;Ze(J),Je(se)}else Ze(0),Je(0)},[d,g,X,b,Oe,a.enabled,ae]),Tt=f(e=>{e.preventDefault(),e.stopPropagation();let t=d();t&&(Be(!0),ut({y:e.clientY,scrollTop:t.scrollTop}),g(),x(!0),O())},[d,g,O]),Pe=f(e=>{if(!U)return;let t=d();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,c=e.clientY-De.y,v=o-fe,M=c/v*n,p=Math.max(0,Math.min(n,De.scrollTop+M));t.scrollTop=p,u()},[U,De,fe,u,d]),Ae=f(()=>{Be(!1),V()&&h(a.delay)},[V,h,a.delay]),wt=f(e=>{if(!j.current)return;let o=j.current.getBoundingClientRect(),i=e.clientY-o.top,n=d();if(!n)return;let c=n.clientHeight,v=n.scrollHeight,p=i/c*(v-c);n.scrollTop=Math.max(0,Math.min(v-c,p)),u(),x(!0),h(a.delay),O()},[u,h,a.delay,d,O]),Mt=f(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let t=Math.max(0,l.current.scrollTop-Se);l.current.scrollTop=t,u(),x(!0),h(a.delay),O()},[u,h,Se,a.delay,O]),Et=f(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!G.current)return;let t=l.current,i=G.current.scrollHeight-t.clientHeight,n=Math.min(i,t.scrollTop+Se);t.scrollTop=n,u(),x(!0),h(a.delay),O()},[u,h,Se,a.delay,O]),St=f(e=>{e.preventDefault(),e.stopPropagation();let t=d();t&&(Ve(!0),pt({x:e.clientX,scrollLeft:t.scrollLeft}),g(),x(!0),O())},[d,g,O]),$e=f(e=>{if(!B)return;let t=d();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,c=e.clientX-ke.x,v=o-Ie,M=c/v*n,p=Math.max(0,Math.min(n,ke.scrollLeft+M));t.scrollLeft=p,u()},[B,ke,Ie,u,d]),ze=f(()=>{Ve(!1),V()&&h(a.delay)},[V,h,a.delay]),Ct=f(e=>{if(!j.current)return;let o=j.current.getBoundingClientRect(),i=e.clientX-o.left,n=d();if(!n)return;let c=n.clientWidth,v=n.scrollWidth,p=i/c*(v-c);n.scrollLeft=Math.max(0,Math.min(v-c,p)),u(),x(!0),h(a.delay),O()},[u,h,a.delay,d,O]),Ht=f(e=>{if(!ge.enabled||e.defaultPrevented)return;let t=e.target,o=l.current;if(!o||!o.contains(t)||Le(t,ge)||e.button!==0)return;let i=d();i&&(i.scrollHeight<=i.clientHeight&&i.scrollWidth<=i.clientWidth||(e.preventDefault(),ie.current=!0,ht({x:e.clientX,y:e.clientY,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft||0}),g()))},[ge,Le,d,g]),Ne=f(e=>{if(!ie.current&&!K)return;let t=d();if(!t)return;let o=he.x-e.clientX,i=he.y-e.clientY;if(Math.abs(i)<5&&Math.abs(o)<5)return;ie.current&&(ie.current=!1,et(!0)),x(!0);let n=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,he.scrollTop+i)),c=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,he.scrollLeft+o));t.scrollTop=n,t.scrollLeft=c,u()},[K,he,d,u]),Fe=f(()=>{let e=K;ie.current=!1,et(!1),e&&V()&&h(a.delay)},[K,V,h,a.delay]);$(()=>{let e=c=>{if(u(),ae){I&&I(c);return}g(),x(!0),rt();let v=tt?a.delayOnWheel:a.delay;h(v),I&&I(c)},t=()=>{ot(!0),me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{ot(!1)},300),rt(),ee.current=setTimeout(()=>{x(!0),ee.current=null,h(a.delayOnWheel)},50)},o=[],i=d();i&&o.push(i);let n=l.current;return n&&!i&&(o.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(v=>{let M=v;if(M!==n&&M.classList.contains("overlay-scrollbar-container"))return;let p=M.parentElement;for(;p&&p!==n;){if(p.classList.contains("overlay-scrollbar-container")&&p!==n)return;p=p.parentElement}o.push(M)})),o.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",t)}),me.current&&clearTimeout(me.current),ee.current&&clearTimeout(ee.current)}},[d,u,I,g,h,a,tt,ae]),$(()=>{let e=o=>{let i=o.target;if(o.defaultPrevented||i instanceof Element&&Le(i,ge))return;let n=d();if(!n)return;let{key:c}=o,{scrollTop:v,scrollHeight:M,clientHeight:p}=n,ce=M-p,ve=50,D=null;switch(c){case"ArrowUp":o.preventDefault(),D=Math.max(0,v-ve);break;case"ArrowDown":o.preventDefault(),D=Math.min(ce,v+ve);break;case"PageUp":o.preventDefault(),D=Math.max(0,v-p);break;case"PageDown":o.preventDefault(),D=Math.min(ce,v+p);break;case"Home":o.preventDefault(),D=0;break;case"End":o.preventDefault(),D=ce;break;default:return}if(D!==null){let ye=D/ce,Z=X?b*2+r.margin*4:r.margin*2,se=(p-Z-fe)*ye;Re(se),n.scrollTop=D,g(),x(!0),h(a.delay)}},t=l.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[d,X,b,r.margin,fe,g,h,a.delay,ge]),$(()=>(document.addEventListener("mousemove",Ne),document.addEventListener("mouseup",Fe),()=>{document.removeEventListener("mousemove",Ne),document.removeEventListener("mouseup",Fe)}),[K,Ne,Fe]),$(()=>{if(U)return document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ae),()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ae)}},[U,Pe,Ae]),$(()=>{if(B)return document.addEventListener("mousemove",$e),document.addEventListener("mouseup",ze),()=>{document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",ze)}},[B,$e,ze]),$(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),Ot(()=>{mt(!0),u(),!a.enabled&&!ae&&V()&&x(!0)},[V,u,a.enabled,ae]),$(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{vt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),$(()=>{let e=new ResizeObserver(()=>{u()}),t=[];return l.current&&t.push(l.current),G.current&&t.push(G.current),s.current&&document.contains(s.current)&&t.push(s.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[u]),$(()=>{if(!l.current)return;let e=new MutationObserver(()=>{s.current=null,u()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let L=Math.max(yt,b);return $(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
1
+ import{useRef as $,useEffect as z,useState as h,useCallback as p,useMemo as Te,forwardRef as It,useImperativeHandle as Wt,useLayoutEffect as Ot}from"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"],De=(S,I)=>{if(S instanceof HTMLElement&&S.isContentEditable||S.closest('[role="textbox"],[role="searchbox"]'))return!0;let N=S.tagName.toLowerCase();if(N==="input"){let y=(S.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(y)}if(["textarea","select","button"].includes(N)||["svg","path","circle","rect","line","polygon","polyline"].includes(N)||S.getAttribute("contenteditable")==="true")return!0;if(I?.excludeSelectors){for(let y of I.excludeSelectors)if(S.matches(y))return!0}return kt(S,I)},kt=(S,I)=>{let N=[...Rt,...I?.excludeClasses||[]],y=S,B=0,W=5;for(;y&&B<=W;){if(N.some(C=>y.classList.contains(C)))return!0;if(y.classList.contains("MuiDialogContent-root"))break;y=y.parentElement,B++}return!1};import{useEffect as lt,useRef as oe,useState as it}from"react";var at=({containerRef:S,config:I})=>{let N=I.enabled??!0,y=I.threshold??80,B=I.maxDistance??y*2,W=I.onRefresh,[C,H]=it(0),[O,q]=it(!1),F=oe(0),ue=oe(0),P=oe(!1),G=oe(!1),re=oe(!1),de=oe(0),ne=oe(!1);return lt(()=>{ne.current=O},[O]),lt(()=>{let M=S.current;if(!M||!(N&&typeof W=="function"))return;let Q=v=>{let x=v instanceof Element?v:null;for(;x&&x!==M;){if(x instanceof HTMLElement&&x.scrollHeight>x.clientHeight+1&&x.scrollTop>0)return!1;x=x.parentElement}return!0},j=v=>{P.current=!1,G.current=!1,re.current=!1,!ne.current&&v.touches.length===1&&M.scrollTop===0&&Q(v.target)&&(P.current=!0,F.current=v.touches[0].clientY,ue.current=v.touches[0].clientX)},we=v=>{if(!P.current||ne.current||v.touches.length!==1)return;let x=v.touches[0].clientY-F.current,pe=v.touches[0].clientX-ue.current;if(!G.current){if(x<=0||M.scrollTop>0){P.current=!1;return}if(x>8&&x>Math.abs(pe))G.current=!0,re.current=M.scrollTop<0;else return}!re.current&&v.cancelable&&v.preventDefault();let fe=Math.min(Math.max(x,0)*.5,B);de.current=fe,H(fe)},L=()=>{if(!P.current||(P.current=!1,!G.current))return;G.current=!1,re.current=!1;let v=de.current;de.current=0,v>=y&&!ne.current?(q(!0),H(y),Promise.resolve().then(()=>W()).catch(()=>{}).finally(()=>{q(!1),H(0)})):H(0)};return M.addEventListener("touchstart",j,{passive:!0}),M.addEventListener("touchmove",we,{passive:!1}),M.addEventListener("touchend",L,{passive:!0}),M.addEventListener("touchcancel",L,{passive:!0}),()=>{M.removeEventListener("touchstart",j),M.removeEventListener("touchmove",we),M.removeEventListener("touchend",L),M.removeEventListener("touchcancel",L)}},[S,N,W,y,B]),{pullDistance:C,isRefreshing:O,pullProgress:Math.min(C/y,1),pullThreshold:y}};import{jsx as k,jsxs as Be}from"react/jsx-runtime";var Pt={},At={},$t={},zt={},Nt={},Ft={},_t=It(({className:S="",style:I={},containerStyle:N={},contentStyle:y={},children:B,onScroll:W,thumb:C=Pt,track:H=At,arrows:O=$t,dragScroll:q=zt,autoHide:F=Nt,pullToRefresh:ue=Ft,showScrollbar:P=!0,showHorizontalScrollbar:G=!0,detectInnerScroll:re=!1},de)=>{let ne=$({});z(()=>{ne.current={children:B,onScroll:W,showScrollbar:P,showHorizontalScrollbar:G,thumb:C,track:H,arrows:O,dragScroll:q,autoHide:F}});let M=$(null),l=$(null),Q=$(null),j=$(null),we=$(null),L=$(null),{pullDistance:v,isRefreshing:x,pullProgress:pe}=at({containerRef:l,config:ue}),fe=ue.indicatorColor??"#1976d2",st=v>0||x,[Me,T]=h(!1),[U,Ue]=h(!1),[Xe,Ye]=h(!1),[Re,ut]=h({y:0,scrollTop:0}),[he,qe]=h(0),[dt,ke]=h(0),[le,Ge]=h(!1),[je,Ke]=h(!1),[X,Ve]=h(!1),[Ie,pt]=h({x:0,scrollLeft:0}),[We,Ze]=h(0),[Oe,Je]=h(0),[ft,Qe]=h(!1),ie=$(!1),[K,et]=h(!1),[me,ht]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Bt,Ut]=h(null),[Ee,Se]=h(null),[Xt,mt]=h(!1),[bt,gt]=h(0),be=$(null),[tt,ot]=h(!1),ge=$(null),ee=$(null),te=$(null),w=Te(()=>{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]),r=Te(()=>({width:H.width??16,color:H.color??"rgba(128, 128, 128, 0.1)",visible:H.visible??!0,alignment:H.alignment??"outside",radius:H.radius??w.radius??4,margin:H.margin??4,overflowX:H.overflowX??!0,overflowY:H.overflowY??!0}),[H,w.radius]),_=Te(()=>{let e=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:e,opacity:O.opacity??.6,hoverColor:O.hoverColor??e,hoverOpacity:O.hoverOpacity??1}},[O]),ve=Te(()=>({enabled:q.enabled??!0,excludeClasses:q.excludeClasses??[],excludeSelectors:q.excludeSelectors??[]}),[q]),a=Te(()=>({enabled:F.enabled??!0,delay:F.delay??1500,delayOnWheel:F.delayOnWheel??700,initialDelay:F.initialDelay??200}),[F]),[ae,vt]=h(()=>(F.initialDelay??200)>0),m=w.width,yt=r.width,Pe=w.minHeight,Y=_.visible,Ce=_.step,A=p(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);Wt(de,()=>({getScrollContainer:()=>l.current,scrollTo:e=>{l.current&&l.current.scrollTo(e)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let u=p(()=>{if(L.current){let t=L.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;L.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return L.current=l.current,l.current;if(!re)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==l.current&&o.classList.contains("overlay-scrollbar-container"))continue;let i=o.parentElement,n=!1;for(;i&&i!==l.current;){if(i.classList.contains("overlay-scrollbar-container")&&i!==l.current){n=!0;break}i=i.parentElement}if(!n&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return L.current=o,o}return null},[]),V=p(()=>u()!==null,[u]),b=p(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),He=p(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),rt=p(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),xt=p(()=>{He(),!(U||X||K||ie.current)&&(b(),T(!1))},[b,He,U,X,K]),f=p(e=>{a.enabled&&(b(),ge.current=setTimeout(()=>{T(!1),ge.current=null},e))},[b,a.enabled]),s=p(()=>{let e=u()??l.current;if(!e){T(!1),Ge(!1),Qe(!1),b();return}!a.enabled&&!ae&&(T(!0),b());let t=e.clientHeight,o=e.scrollHeight,i=e.scrollTop,n=e.clientWidth,c=e.scrollWidth,g=e.scrollLeft,E=o-t>0,d=c-n>0,ce=E||d;Ge(E),Qe(d),ce||(T(!1),b());let ye=0,R=0;if(M.current){let Z=window.getComputedStyle(M.current),J=parseFloat(Z.paddingTop)||0;R=parseFloat(Z.paddingBottom)||0,ye=J+R,gt(R)}if(E){let Z=Y?m*2+r.margin*4:r.margin*2,J=t-Z+ye,Le=t/o,se=Math.max(J*Le,Pe),nt=o-t,Lt=J-se,Dt=nt>0?i/nt*Lt:0;qe(se),ke(Dt)}else qe(0),ke(0);let xe=c-n;if(xe>0){let Z=n/c,J=Math.max(n*Z,50),Le=n-J,se=xe>0?g/xe*Le:0;Ze(J),Je(se)}else Ze(0),Je(0)},[u,b,Y,m,Pe,a.enabled,ae]),Tt=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Ue(!0),ut({y:e.clientY,scrollTop:t.scrollTop}),b(),T(!0),A())},[u,b,A]),Ae=p(e=>{if(!U)return;let t=u();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,c=e.clientY-Re.y,g=o-he,E=c/g*n,d=Math.max(0,Math.min(n,Re.scrollTop+E));t.scrollTop=d,s()},[U,Re,he,s,u]),$e=p(()=>{Ue(!1),V()&&f(a.delay)},[V,f,a.delay]),wt=p(e=>{if(!j.current)return;let o=j.current.getBoundingClientRect(),i=e.clientY-o.top,n=u();if(!n)return;let c=n.clientHeight,g=n.scrollHeight,d=i/c*(g-c);n.scrollTop=Math.max(0,Math.min(g-c,d)),s(),T(!0),f(a.delay),A()},[s,f,a.delay,u,A]),Mt=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let t=Math.max(0,l.current.scrollTop-Ce);l.current.scrollTop=t,s(),T(!0),f(a.delay),A()},[s,f,Ce,a.delay,A]),Et=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!Q.current)return;let t=l.current,i=Q.current.scrollHeight-t.clientHeight,n=Math.min(i,t.scrollTop+Ce);t.scrollTop=n,s(),T(!0),f(a.delay),A()},[s,f,Ce,a.delay,A]),St=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Ve(!0),pt({x:e.clientX,scrollLeft:t.scrollLeft}),b(),T(!0),A())},[u,b,A]),ze=p(e=>{if(!X)return;let t=u();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,c=e.clientX-Ie.x,g=o-We,E=c/g*n,d=Math.max(0,Math.min(n,Ie.scrollLeft+E));t.scrollLeft=d,s()},[X,Ie,We,s,u]),Ne=p(()=>{Ve(!1),V()&&f(a.delay)},[V,f,a.delay]),Ct=p(e=>{if(!j.current)return;let o=j.current.getBoundingClientRect(),i=e.clientX-o.left,n=u();if(!n)return;let c=n.clientWidth,g=n.scrollWidth,d=i/c*(g-c);n.scrollLeft=Math.max(0,Math.min(g-c,d)),s(),T(!0),f(a.delay),A()},[s,f,a.delay,u,A]),Ht=p(e=>{if(!ve.enabled||e.defaultPrevented)return;let t=e.target,o=l.current;if(!o||!o.contains(t)||De(t,ve)||e.button!==0)return;let i=u();i&&(i.scrollHeight<=i.clientHeight&&i.scrollWidth<=i.clientWidth||(e.preventDefault(),ie.current=!0,ht({x:e.clientX,y:e.clientY,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft||0}),b()))},[ve,De,u,b]),Fe=p(e=>{if(!ie.current&&!K)return;let t=u();if(!t)return;let o=me.x-e.clientX,i=me.y-e.clientY;if(Math.abs(i)<5&&Math.abs(o)<5)return;ie.current&&(ie.current=!1,et(!0)),T(!0);let n=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,me.scrollTop+i)),c=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,me.scrollLeft+o));t.scrollTop=n,t.scrollLeft=c,s()},[K,me,u,s]),_e=p(()=>{let e=K;ie.current=!1,et(!1),e&&V()&&f(a.delay)},[K,V,f,a.delay]);z(()=>{let e=c=>{if(s(),ae){W&&W(c);return}b(),T(!0),rt();let g=tt?a.delayOnWheel:a.delay;f(g),W&&W(c)},t=()=>{ot(!0),be.current&&clearTimeout(be.current),be.current=setTimeout(()=>{ot(!1)},300),rt(),te.current=setTimeout(()=>{T(!0),te.current=null,f(a.delayOnWheel)},50)},o=[],i=u();i&&o.push(i);let n=l.current;return n&&!i&&(o.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(g=>{let E=g;if(E!==n&&E.classList.contains("overlay-scrollbar-container"))return;let d=E.parentElement;for(;d&&d!==n;){if(d.classList.contains("overlay-scrollbar-container")&&d!==n)return;d=d.parentElement}o.push(E)})),o.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",t)}),be.current&&clearTimeout(be.current),te.current&&clearTimeout(te.current)}},[u,s,W,b,f,a,tt,ae]),z(()=>{let e=o=>{let i=o.target;if(o.defaultPrevented||i instanceof Element&&De(i,ve))return;let n=u();if(!n)return;let{key:c}=o,{scrollTop:g,scrollHeight:E,clientHeight:d}=n,ce=E-d,ye=50,R=null;switch(c){case"ArrowUp":o.preventDefault(),R=Math.max(0,g-ye);break;case"ArrowDown":o.preventDefault(),R=Math.min(ce,g+ye);break;case"PageUp":o.preventDefault(),R=Math.max(0,g-d);break;case"PageDown":o.preventDefault(),R=Math.min(ce,g+d);break;case"Home":o.preventDefault(),R=0;break;case"End":o.preventDefault(),R=ce;break;default:return}if(R!==null){let xe=R/ce,Z=Y?m*2+r.margin*4:r.margin*2,se=(d-Z-he)*xe;ke(se),n.scrollTop=R,b(),T(!0),f(a.delay)}},t=l.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,Y,m,r.margin,he,b,f,a.delay,ve]),z(()=>(document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",_e),()=>{document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",_e)}),[K,Fe,_e]),z(()=>{if(U)return document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",$e),()=>{document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",$e)}},[U,Ae,$e]),z(()=>{if(X)return document.addEventListener("mousemove",ze),document.addEventListener("mouseup",Ne),()=>{document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",Ne)}},[X,ze,Ne]),z(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),Ot(()=>{mt(!0),s(),!a.enabled&&!ae&&V()&&T(!0)},[V,s,a.enabled,ae]),z(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{vt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),z(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return l.current&&t.push(l.current),Q.current&&t.push(Q.current),L.current&&document.contains(L.current)&&t.push(L.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),z(()=>{if(!l.current)return;let e=new MutationObserver(()=>{L.current=null,s()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let D=Math.max(yt,m);return z(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
2
2
  /* \uBAA8\uB4E0 \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uAE30 */
3
3
  .overlay-scrollbar-container {
4
4
  scrollbar-width: none !important;
@@ -43,5 +43,5 @@ import{useRef as P,useEffect as $,useState as m,useCallback as f,useMemo as xe,f
43
43
  from { transform: rotate(0deg); }
44
44
  to { transform: rotate(360deg); }
45
45
  }
46
- `,document.head.appendChild(o),()=>{let i=document.getElementById(e);i&&i.remove()}},[]),_e("div",{ref:Te,className:`overlay-scrollbar-wrapper ${E}`,onMouseLeave:xt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...k},children:[st&&R("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${w-56}px)`,transition:re?"transform 0.15s ease-out":w===0?"transform 0.2s ease-out":"none",width:48,height:48,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:re?1:Math.min(ne*1.5,1)},children:re?R("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:R("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ue,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):R("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${ne*270}deg)`,opacity:ne>=1?1:.6},children:R("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:Ue})})}),R("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Ht,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:K?"none":"auto",...z},children:R("div",{ref:G,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...y},children:_})}),A&&le&&(r.overflowY??!0)&&_e("div",{ref:j,className:"overlay-scrollbar-track",onMouseEnter:()=>{g(),Q.current=setTimeout(()=>{x(!0),Q.current=null},100)},onMouseLeave:()=>{Ce(),U||h(a.delay)},style:{position:"absolute",top:0,right:0,width:`${L}px`,height:"100%",opacity:we?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&R("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),wt(e)},style:{position:"absolute",top:X?`${T.width+r.margin*2}px`:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(L-T.width)/2}px`,width:`${T.width}px`,height:X?`calc(100% - ${T.width*2+r.margin*4}px)`:`calc(100% - ${r.margin*2}px)`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),R("div",{ref:oe,className:"overlay-scrollbar-thumb",onMouseDown:Tt,onMouseEnter:()=>Ye(!0),onMouseLeave:()=>Ye(!1),style:{position:"absolute",top:`${(X?b+r.margin*2:r.margin)+dt}px`,right:r.alignment==="outside"?"0px":`${(L-b)/2}px`,width:`${b}px`,height:`${Math.max(fe,Oe)}px`,backgroundColor:Xe||U?T.hoverColor:T.color,opacity:Xe||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"}})]}),A&&le&&X&&R("div",{className:"overlay-scrollbar-up-arrow",onClick:Mt,onMouseEnter:()=>Ee("up"),onMouseLeave:()=>Ee(null),style:{position:"absolute",top:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(L-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:Me==="up"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:we?Me==="up"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),A&&le&&X&&R("div",{className:"overlay-scrollbar-down-arrow",onClick:Et,onMouseEnter:()=>Ee("down"),onMouseLeave:()=>Ee(null),style:{position:"absolute",bottom:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(L-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:Me==="down"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:we?Me==="down"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),A&&q&&ft&&(r.overflowX??!0)&&_e("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{g(),Q.current=setTimeout(()=>{x(!0),Q.current=null},100)},onMouseLeave:()=>{Ce(),B||h(a.delay)},style:{position:"absolute",bottom:`${bt}px`,left:0,width:"100%",height:`${L}px`,opacity:we?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&R("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ct(e)},style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(L-b)/2}px`,left:`${r.margin}px`,right:le?r.alignment==="outside"?`${L-r.margin}px`:`${L}px`:`${r.margin}px`,height:`${b}px`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),R("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:St,onMouseEnter:()=>Ke(!0),onMouseLeave:()=>Ke(!1),style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(L-b)/2}px`,left:`${r.margin+We}px`,right:le?r.alignment==="outside"?`${L-r.margin}px`:`${L}px`:"auto",maxWidth:le?r.alignment==="outside"?`calc(100% - ${r.margin+We+L-r.margin}px)`:`calc(100% - ${r.margin+We+L}px)`:"none",width:`${Math.max(Ie,50)}px`,height:`${b}px`,backgroundColor:je||B?T.hoverColor:T.color,opacity:je||B?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ct=_t;export{ct as OverlayScrollbar,ct as default};
46
+ `,document.head.appendChild(o),()=>{let i=document.getElementById(e);i&&i.remove()}},[]),Be("div",{ref:M,className:`overlay-scrollbar-wrapper ${S}`,onMouseLeave:xt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...I},children:[st&&k("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${v-56}px)`,transition:x?"transform 0.15s ease-out":v===0?"transform 0.2s ease-out":"none",width:48,height:48,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:x?1:Math.min(pe*1.5,1)},children:x?k("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:k("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:fe,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):k("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${pe*270}deg)`,opacity:pe>=1?1:.6},children:k("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:fe})})}),k("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Ht,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:K?"none":"auto",...N},children:k("div",{ref:Q,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...y},children:B})}),P&&le&&(r.overflowY??!0)&&Be("div",{ref:j,className:"overlay-scrollbar-track",onMouseEnter:()=>{b(),ee.current=setTimeout(()=>{T(!0),ee.current=null},100)},onMouseLeave:()=>{He(),U||f(a.delay)},style:{position:"absolute",top:0,right:0,width:`${D}px`,height:"100%",opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&k("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),wt(e)},style:{position:"absolute",top:Y?`${w.width+r.margin*2}px`:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(D-w.width)/2}px`,width:`${w.width}px`,height:Y?`calc(100% - ${w.width*2+r.margin*4}px)`:`calc(100% - ${r.margin*2}px)`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),k("div",{ref:we,className:"overlay-scrollbar-thumb",onMouseDown:Tt,onMouseEnter:()=>Ye(!0),onMouseLeave:()=>Ye(!1),style:{position:"absolute",top:`${(Y?m+r.margin*2:r.margin)+dt}px`,right:r.alignment==="outside"?"0px":`${(D-m)/2}px`,width:`${m}px`,height:`${Math.max(he,Pe)}px`,backgroundColor:Xe||U?w.hoverColor:w.color,opacity:Xe||U?w.hoverOpacity:w.opacity,borderRadius:`${w.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),P&&le&&Y&&k("div",{className:"overlay-scrollbar-up-arrow",onClick:Mt,onMouseEnter:()=>Se("up"),onMouseLeave:()=>Se(null),style:{position:"absolute",top:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(D-m)/2}px`,width:`${m}px`,height:`${m}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(m*.75,8)}px`,color:Ee==="up"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:Me?Ee==="up"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),P&&le&&Y&&k("div",{className:"overlay-scrollbar-down-arrow",onClick:Et,onMouseEnter:()=>Se("down"),onMouseLeave:()=>Se(null),style:{position:"absolute",bottom:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(D-m)/2}px`,width:`${m}px`,height:`${m}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(m*.75,8)}px`,color:Ee==="down"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:Me?Ee==="down"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),P&&G&&ft&&(r.overflowX??!0)&&Be("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{b(),ee.current=setTimeout(()=>{T(!0),ee.current=null},100)},onMouseLeave:()=>{He(),X||f(a.delay)},style:{position:"absolute",bottom:`${bt}px`,left:0,width:"100%",height:`${D}px`,opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&k("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ct(e)},style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(D-m)/2}px`,left:`${r.margin}px`,right:le?r.alignment==="outside"?`${D-r.margin}px`:`${D}px`:`${r.margin}px`,height:`${m}px`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),k("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:St,onMouseEnter:()=>Ke(!0),onMouseLeave:()=>Ke(!1),style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(D-m)/2}px`,left:`${r.margin+Oe}px`,right:le?r.alignment==="outside"?`${D-r.margin}px`:`${D}px`:"auto",maxWidth:le?r.alignment==="outside"?`calc(100% - ${r.margin+Oe+D-r.margin}px)`:`calc(100% - ${r.margin+Oe+D}px)`:"none",width:`${Math.max(We,50)}px`,height:`${m}px`,backgroundColor:je||X?w.hoverColor:w.color,opacity:je||X?w.hoverOpacity:w.opacity,borderRadius:`${w.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ct=_t;export{ct as OverlayScrollbar,ct as default};
47
47
  //# sourceMappingURL=index.esm.js.map