UNPKG

react-smooth-scrollbar-z

Version:

A React wrapper for Smooth Scrollbar with hooks and plugin support

1 lines 65.2 kB
import t,{ScrollbarPlugin as e}from"smooth-scrollbar";import n,{useRef as o,useCallback as i,useEffect as r,forwardRef as l,useImperativeHandle as s}from"react";var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,h=function(){return h=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},h.apply(this,arguments)};function f(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function p(t,e,n,o){var i,r=arguments.length,l=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(l=(r<3?i(l):r>3?i(e,n,l):i(e,n))||l);return r>3&&l&&Object.defineProperty(e,n,l),l}function d(t,e,n,o){return new(n||(n=Promise))(function(i,r){function l(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(l,s)}a((o=o.apply(t,e||[])).next())})}function v(t,e){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=s(0),l.throw=s(1),l.return=s(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],l=0,s=r.length;l<s;l++,i++)o[i]=r[l];return o}"function"==typeof SuppressedError&&SuppressedError;var y=new WeakMap;function b(){if(void 0!==u)return u;var t=!1;try{var e=function(){},n=Object.defineProperty({},"passive",{enumerable:!0,get:function(){return t=!0,!0}});window.addEventListener("testPassive",e,n),window.removeEventListener("testPassive",e,n)}catch(t){}return u=!!t&&{passive:!1}}function g(t){var e=y.get(t)||[];return y.set(t,e),function(t,n,o){function i(t){t.defaultPrevented||o(t)}n.split(/\s+/g).forEach(function(n){e.push({elem:t,eventName:n,handler:i}),t.addEventListener(n,i,b())})}}function _(t){var e=function(t){return t.touches?t.touches[t.touches.length-1]:t}(t);return{x:e.clientX,y:e.clientY}}function x(t,e){return void 0===e&&(e=[]),e.some(function(e){return t===e})}var w=["webkit","moz","ms","o"],E=new RegExp("^-(?!(?:"+w.join("|")+")-)");function O(t,e){e=function(t){var e={};return Object.keys(t).forEach(function(n){if(E.test(n)){var o=t[n];n=n.replace(/^-/,""),e[n]=o,w.forEach(function(t){e["-"+t+"-"+n]=o})}else e[n]=t[n]}),e}(e),Object.keys(e).forEach(function(n){var o=n.replace(/^-/,"").replace(/-([a-z])/g,function(t,e){return e.toUpperCase()});t.style[o]=e[n]})}var k=function(){function t(t){this.velocityMultiplier=window.devicePixelRatio,this.updateTime=Date.now(),this.delta={x:0,y:0},this.velocity={x:0,y:0},this.lastPosition={x:0,y:0},this.lastPosition=_(t)}return t.prototype.update=function(t){var e=this,n=e.velocity,o=e.updateTime,i=e.lastPosition,r=Date.now(),l=_(t),s={x:-(l.x-i.x),y:-(l.y-i.y)},a=r-o||16.7,c=s.x/a*16.7,u=s.y/a*16.7;n.x=c*this.velocityMultiplier,n.y=u*this.velocityMultiplier,this.delta=s,this.updateTime=r,this.lastPosition=l},t}(),S=function(){function t(){this._touchList={}}return Object.defineProperty(t.prototype,"_primitiveValue",{get:function(){return{x:0,y:0}},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){return void 0!==this._activeTouchID},t.prototype.getDelta=function(){var t=this._getActiveTracker();return t?h({},t.delta):this._primitiveValue},t.prototype.getVelocity=function(){var t=this._getActiveTracker();return t?h({},t.velocity):this._primitiveValue},t.prototype.getEasingDistance=function(t){var e=1-t,n={x:0,y:0},o=this.getVelocity();return Object.keys(o).forEach(function(t){for(var i=Math.abs(o[t])<=10?0:o[t];0!==i;)n[t]+=i,i=i*e|0}),n},t.prototype.track=function(t){var e=this,n=t.targetTouches;return Array.from(n).forEach(function(t){e._add(t)}),this._touchList},t.prototype.update=function(t){var e=this,n=t.touches,o=t.changedTouches;return Array.from(n).forEach(function(t){e._renew(t)}),this._setActiveID(o),this._touchList},t.prototype.release=function(t){var e=this;delete this._activeTouchID,Array.from(t.changedTouches).forEach(function(t){e._delete(t)})},t.prototype._add=function(t){this._has(t)&&this._delete(t);var e=new k(t);this._touchList[t.identifier]=e},t.prototype._renew=function(t){this._has(t)&&this._touchList[t.identifier].update(t)},t.prototype._delete=function(t){delete this._touchList[t.identifier]},t.prototype._has=function(t){return this._touchList.hasOwnProperty(t.identifier)},t.prototype._setActiveID=function(t){this._activeTouchID=t[t.length-1].identifier},t.prototype._getActiveTracker=function(){return this._touchList[this._activeTouchID]},t}();function T(t,e,n){return Math.max(e,Math.min(n,t))}function P(t,e,n){var o;void 0===e&&(e=0);var i=-1/0;return function(){for(var r=this,l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];if(n){var a=Date.now(),c=a-i;i=a,c>=e&&t.apply(this,l)}clearTimeout(o),o=setTimeout(function(){t.apply(r,l)},e)}}var A,z=function(){function t(t){this._scrollbar=t}return t.prototype.render=function(t){var e=t.x,n=void 0===e?0:e,o=t.y,i=void 0===o?0:o,r=this._scrollbar,l=r.size,s=r.track,a=r.offset;if(O(r.contentEl,{"-transform":"translate3d("+-(a.x+n)+"px, "+-(a.y+i)+"px, 0)"}),n){s.xAxis.show();var c=l.container.width/(l.container.width+Math.abs(n));O(s.xAxis.thumb.element,{"-transform":"translate3d("+s.xAxis.thumb.offset+"px, 0, 0) scale3d("+c+", 1, 1)","-transform-origin":n<0?"left":"right"})}if(i){s.yAxis.show();c=l.container.height/(l.container.height+Math.abs(i));O(s.yAxis.thumb.element,{"-transform":"translate3d(0, "+s.yAxis.thumb.offset+"px, 0) scale3d(1, "+c+", 1)","-transform-origin":i<0?"top":"bottom"})}s.autoHideOnIdle()},t}(),M=function(){function t(t){this._scrollbar=t,this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d"),O(this._canvas,{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"none"})}return t.prototype.mount=function(){this._scrollbar.containerEl.appendChild(this._canvas)},t.prototype.unmount=function(){this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},t.prototype.adjust=function(){var t=this._scrollbar.size,e=window.devicePixelRatio||1,n=t.container.width*e,o=t.container.height*e;n===this._canvas.width&&o===this._canvas.height||(this._canvas.width=n,this._canvas.height=o,this._ctx.scale(e,e))},t.prototype.recordTouch=function(t){var e=t.touches[t.touches.length-1];this._touchX=e.clientX,this._touchY=e.clientY},t.prototype.render=function(t,e){var n=t.x,o=void 0===n?0:n,i=t.y,r=void 0===i?0:i;if(o||r){O(this._canvas,{display:"block"});var l=this._scrollbar.size;this._ctx.clearRect(0,0,l.container.width,l.container.height),this._ctx.fillStyle=e,this._renderX(o),this._renderY(r)}else O(this._canvas,{display:"none"})},t.prototype._getMaxOverscroll=function(){var t=this._scrollbar.options.plugins.overscroll;return t&&t.maxOverscroll?t.maxOverscroll:150},t.prototype._renderX=function(t){var e=this._scrollbar.size,n=this._getMaxOverscroll(),o=e.container,i=o.width,r=o.height,l=this._ctx;l.save(),t>0&&l.transform(-1,0,0,1,i,0);var s=T(Math.abs(t)/n,0,.75),a=T(s,0,.25)*i,c=Math.abs(t),u=this._touchY||r/2;l.globalAlpha=s,l.beginPath(),l.moveTo(0,-a),l.quadraticCurveTo(c,u,0,r+a),l.fill(),l.closePath(),l.restore()},t.prototype._renderY=function(t){var e=this._scrollbar.size,n=this._getMaxOverscroll(),o=e.container,i=o.width,r=o.height,l=this._ctx;l.save(),t>0&&l.transform(1,0,0,-1,0,r);var s=T(Math.abs(t)/n,0,.75),a=T(s,0,.25)*i,c=this._touchX||i/2,u=Math.abs(t);l.globalAlpha=s,l.beginPath(),l.moveTo(-a,0),l.quadraticCurveTo(c,u,i+a,0),l.fill(),l.closePath(),l.restore()},t}();!function(t){t.BOUNCE="bounce",t.GLOW="glow"}(A||(A={}));var H=/wheel|touch/,N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._glow=new M(e.scrollbar),e._bounce=new z(e.scrollbar),e._wheelScrollBack={x:!1,y:!1},e._lockWheel={x:!1,y:!1},e._touching=!1,e._amplitude={x:0,y:0},e._position={x:0,y:0},e._releaseWheel=P(function(){e._lockWheel.x=!1,e._lockWheel.y=!1},30),e}return c(e,t),Object.defineProperty(e.prototype,"_isWheelLocked",{get:function(){return this._lockWheel.x||this._lockWheel.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_enabled",{get:function(){return!!this.options.effect},enumerable:!0,configurable:!0}),e.prototype.onInit=function(){var t=this,e=t._glow,n=t.options,o=t.scrollbar,i=n.effect;Object.defineProperty(n,"effect",{get:function(){return i},set:function(t){if(t){if(t!==A.BOUNCE&&t!==A.GLOW)throw new TypeError("unknow overscroll effect: "+t);i=t,o.options.continuousScrolling=!1,t===A.GLOW?(e.mount(),e.adjust()):e.unmount()}else i=void 0}}),n.effect=i},e.prototype.onUpdate=function(){this.options.effect===A.GLOW&&this._glow.adjust()},e.prototype.onRender=function(t){if(this._enabled){this.scrollbar.options.continuousScrolling&&(this.scrollbar.options.continuousScrolling=!1);var e=t.x,n=t.y;!this._amplitude.x&&this._willOverscroll("x",t.x)&&(e=0,this._absorbMomentum("x",t.x)),!this._amplitude.y&&this._willOverscroll("y",t.y)&&(n=0,this._absorbMomentum("y",t.y)),this.scrollbar.setMomentum(e,n),this._render()}},e.prototype.transformDelta=function(t,e){if(this._lastEventType=e.type,!this._enabled||!H.test(e.type))return t;this._isWheelLocked&&/wheel/.test(e.type)&&(this._releaseWheel(),this._willOverscroll("x",t.x)&&(t.x=0),this._willOverscroll("y",t.y)&&(t.y=0));var n=t.x,o=t.y;switch(this._willOverscroll("x",t.x)&&(n=0,this._addAmplitude("x",t.x)),this._willOverscroll("y",t.y)&&(o=0,this._addAmplitude("y",t.y)),e.type){case"touchstart":case"touchmove":this._touching=!0,this._glow.recordTouch(e);break;case"touchcancel":case"touchend":this._touching=!1}return{x:n,y:o}},e.prototype._willOverscroll=function(t,e){if(!e)return!1;if(this._position[t])return!0;var n=this.scrollbar.offset[t],o=this.scrollbar.limit[t];return 0!==o&&(T(n+e,0,o)===n&&(0===n||n===o))},e.prototype._absorbMomentum=function(t,e){var n=this,o=n.options,i=n._lastEventType,r=n._amplitude;H.test(i)&&(r[t]=T(e,-o.maxOverscroll,o.maxOverscroll))},e.prototype._addAmplitude=function(t,e){var n=this,o=n.options,i=n.scrollbar,r=n._amplitude,l=n._position,s=r[t],a=e*s<0,c=s+e*(1-(a?0:this._wheelScrollBack[t]?1:Math.abs(s/o.maxOverscroll)));r[t]=0===i.offset[t]?T(c,-o.maxOverscroll,0):T(c,0,o.maxOverscroll),a&&(l[t]=r[t])},e.prototype._render=function(){var t=this,e=t.options,n=t._amplitude,o=t._position;if(this._enabled&&(n.x||n.y||o.x||o.y)){var i=this._nextAmp("x"),r=this._nextAmp("y");switch(n.x=i.amplitude,o.x=i.position,n.y=r.amplitude,o.y=r.position,e.effect){case A.BOUNCE:this._bounce.render(o);break;case A.GLOW:this._glow.render(o,this.options.glowColor)}"function"==typeof e.onScroll&&e.onScroll.call(this,h({},o))}},e.prototype._nextAmp=function(t){var e=this,n=e.options,o=e._amplitude,i=e._position,r=1-n.damping,l=o[t],s=i[t],a=this._touching?l:l*r|0,c=a-s,u=s+c-(c*r|0);return!this._touching&&Math.abs(u)<Math.abs(s)&&(this._wheelScrollBack[t]=!0),this._wheelScrollBack[t]&&Math.abs(u)<=1&&(this._wheelScrollBack[t]=!1,this._lockWheel[t]=!0),{amplitude:a,position:u}},e.pluginName="overscroll",e.defaultOptions={effect:A.BOUNCE,onScroll:void 0,damping:.2,maxOverscroll:150,glowColor:"#87ceeb"},e}(e),D=Object.freeze({__proto__:null,get OverscrollEffect(){return A},default:N});function L(t,e){return void 0===t&&(t=-1/0),void 0===e&&(e=1/0),function(n,o){var i="_"+o;Object.defineProperty(n,o,{get:function(){return this[i]},set:function(n){Object.defineProperty(this,i,{value:T(n,t,e),enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}}function j(t,e){var n="_"+e;Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){Object.defineProperty(this,n,{value:!!t,enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e,n,o){var i=o.value;return{get:function(){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{value:P.apply(void 0,m([i],t))}),this[n]}}}}var I,R=function(){function t(t){var e=this;void 0===t&&(t={}),this.damping=.1,this.thumbMinSize=20,this.renderByPixels=!0,this.alwaysShowTracks=!1,this.continuousScrolling=!0,this.delegateTo=null,this.plugins={},Object.keys(t).forEach(function(n){e[n]=t[n]})}return Object.defineProperty(t.prototype,"wheelEventTarget",{get:function(){return this.delegateTo},set:function(t){console.warn("[smooth-scrollbar]: `options.wheelEventTarget` is deprecated and will be removed in the future, use `options.delegateTo` instead."),this.delegateTo=t},enumerable:!0,configurable:!0}),p([L(0,1)],t.prototype,"damping",void 0),p([L(0,1/0)],t.prototype,"thumbMinSize",void 0),p([j],t.prototype,"renderByPixels",void 0),p([j],t.prototype,"alwaysShowTracks",void 0),p([j],t.prototype,"continuousScrolling",void 0),t}();!function(t){t.X="x",t.Y="y"}(I||(I={}));var B=function(){function t(t,e){void 0===e&&(e=0),this._direction=t,this._minSize=e,this.element=document.createElement("div"),this.displaySize=0,this.realSize=0,this.offset=0,this.element.className="scrollbar-thumb scrollbar-thumb-"+t}return t.prototype.attachTo=function(t){t.appendChild(this.element)},t.prototype.update=function(t,e,n){this.realSize=Math.min(e/n,1)*e,this.displaySize=Math.max(this.realSize,this._minSize),this.offset=t/n*(e+(this.realSize-this.displaySize)),O(this.element,this._getStyle())},t.prototype._getStyle=function(){switch(this._direction){case I.X:return{width:this.displaySize+"px","-transform":"translate3d("+this.offset+"px, 0, 0)"};case I.Y:return{height:this.displaySize+"px","-transform":"translate3d(0, "+this.offset+"px, 0)"};default:return null}},t}(),W=function(){function t(t,e){void 0===e&&(e=0),this.element=document.createElement("div"),this._isShown=!1,this.element.className="scrollbar-track scrollbar-track-"+t,this.thumb=new B(t,e),this.thumb.attachTo(this.element)}return t.prototype.attachTo=function(t){t.appendChild(this.element)},t.prototype.show=function(){this._isShown||(this._isShown=!0,this.element.classList.add("show"))},t.prototype.hide=function(){this._isShown&&(this._isShown=!1,this.element.classList.remove("show"))},t.prototype.update=function(t,e,n){O(this.element,{display:n<=e?"none":"block"}),this.thumb.update(t,e,n)},t}(),Y=function(){function t(t){this._scrollbar=t;var e=t.options.thumbMinSize;this.xAxis=new W(I.X,e),this.yAxis=new W(I.Y,e),this.xAxis.attachTo(t.containerEl),this.yAxis.attachTo(t.containerEl),t.options.alwaysShowTracks&&(this.xAxis.show(),this.yAxis.show())}return t.prototype.update=function(){var t=this._scrollbar,e=t.size,n=t.offset;this.xAxis.update(n.x,e.container.width,e.content.width),this.yAxis.update(n.y,e.container.height,e.content.height)},t.prototype.autoHideOnIdle=function(){this._scrollbar.options.alwaysShowTracks||(this.xAxis.hide(),this.yAxis.hide())},p([C(300)],t.prototype,"autoHideOnIdle",null),t}();var F=new WeakMap;function X(t){return Math.pow(t-1,3)+1}var q,G,U,V={order:new Set,constructors:{}};!function(t){t[t.TAB=9]="TAB",t[t.SPACE=32]="SPACE",t[t.PAGE_UP=33]="PAGE_UP",t[t.PAGE_DOWN=34]="PAGE_DOWN",t[t.END=35]="END",t[t.HOME=36]="HOME",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(q||(q={})),function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(G||(G={}));var J={STANDARD:1,OTHERS:-3},K=[1,28,500],Q=function(t){return K[t]||K[0]};var Z=Object.freeze({__proto__:null,keyboardHandler:function(t){var e=g(t),n=t.containerEl;e(n,"keydown",function(e){var o=document.activeElement;if((o===n||n.contains(o))&&!function(t){if("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!t.disabled;return!1}(o)){var i=function(t,e){var n=t.size,o=t.limit,i=t.offset;switch(e){case q.TAB:return function(t){requestAnimationFrame(function(){t.scrollIntoView(document.activeElement,{offsetTop:t.size.container.height/2,offsetLeft:t.size.container.width/2,onlyScrollIfNeeded:!0})})}(t);case q.SPACE:return[0,200];case q.PAGE_UP:return[0,40-n.container.height];case q.PAGE_DOWN:return[0,n.container.height-40];case q.END:return[0,o.y-i.y];case q.HOME:return[0,-i.y];case q.LEFT:return[-40,0];case q.UP:return[0,-40];case q.RIGHT:return[40,0];case q.DOWN:return[0,40];default:return null}}(t,e.keyCode||e.which);if(i){var r=i[0],l=i[1];t.addTransformableMomentum(r,l,e,function(n){n?e.preventDefault():(t.containerEl.blur(),t.parent&&t.parent.containerEl.focus())})}}})},mouseHandler:function(t){var e,n,o,i,r,l=g(t),s=t.containerEl,a=t.track,c=a.xAxis,u=a.yAxis;function h(e,n){var o=t.size,i=t.limit,r=t.offset;return e===G.X?T(n/(o.container.width+(c.thumb.realSize-c.thumb.displaySize))*o.content.width,0,i.x)-r.x:e===G.Y?T(n/(o.container.height+(u.thumb.realSize-u.thumb.displaySize))*o.content.height,0,i.y)-r.y:0}function f(t){return x(t,[c.element,c.thumb.element])?G.X:x(t,[u.element,u.thumb.element])?G.Y:void 0}l(s,"click",function(e){if(!n&&x(e.target,[c.element,u.element])){var o=e.target,i=f(o),r=o.getBoundingClientRect(),l=_(e);if(i===G.X){var s=l.x-r.left-c.thumb.displaySize/2;t.setMomentum(h(i,s),0)}if(i===G.Y){s=l.y-r.top-u.thumb.displaySize/2;t.setMomentum(0,h(i,s))}}}),l(s,"mousedown",function(n){if(x(n.target,[c.thumb.element,u.thumb.element])){e=!0;var l=n.target,a=_(n),h=l.getBoundingClientRect();i=f(l),o={x:a.x-h.left,y:a.y-h.top},r=s.getBoundingClientRect(),O(t.containerEl,{"-user-select":"none"})}}),l(window,"mousemove",function(l){if(e){n=!0;var s=_(l);if(i===G.X){var a=s.x-o.x-r.left;t.setMomentum(h(i,a),0)}if(i===G.Y){a=s.y-o.y-r.top;t.setMomentum(0,h(i,a))}}}),l(window,"mouseup blur",function(){e=n=!1,O(t.containerEl,{"-user-select":""})})},resizeHandler:function(t){g(t)(window,"resize",P(t.update.bind(t),300))},selectHandler:function(t){var e,n=g(t),o=t.containerEl,i=t.contentEl,r=!1,l=!1;function s(n){var o=n.x,i=n.y;if(o||i){var r=t.offset,l=t.limit;t.setMomentum(T(r.x+o,0,l.x)-r.x,T(r.y+i,0,l.y)-r.y),e=requestAnimationFrame(function(){s({x:o,y:i})})}}n(window,"mousemove",function(n){if(r){cancelAnimationFrame(e);var o=function(t,e){var n=t.bounding,o=n.top,i=n.right,r=n.bottom,l=n.left,s=_(e),a=s.x,c=s.y,u={x:0,y:0},h=20;if(0===a&&0===c)return u;a>i-h?u.x=a-i+h:a<l+h&&(u.x=a-l-h);c>r-h?u.y=c-r+h:c<o+h&&(u.y=c-o-h);return u.x*=2,u.y*=2,u}(t,n);s(o)}}),n(i,"contextmenu",function(){l=!0,cancelAnimationFrame(e),r=!1}),n(i,"mousedown",function(){l=!1}),n(i,"selectstart",function(){l||(cancelAnimationFrame(e),r=!0)}),n(window,"mouseup blur",function(){cancelAnimationFrame(e),r=!1,l=!1}),n(o,"scroll",function(t){t.preventDefault(),o.scrollTop=o.scrollLeft=0})},touchHandler:function(t){var e,n=t.options.delegateTo||t.containerEl,o=new S,i=g(t),r=0;i(n,"touchstart",function(n){o.track(n),t.setMomentum(0,0),0===r&&(e=t.options.damping,t.options.damping=Math.max(e,.5)),r++}),i(n,"touchmove",function(e){if(!U||U===t){o.update(e);var n=o.getDelta(),i=n.x,r=n.y;t.addTransformableMomentum(i,r,e,function(n){n&&e.cancelable&&(e.preventDefault(),U=t)})}}),i(n,"touchcancel touchend",function(n){var i=o.getEasingDistance(e);t.addTransformableMomentum(i.x,i.y,n),0===--r&&(t.options.damping=e),o.release(n),U=null})},wheelHandler:function(t){g(t)(t.options.delegateTo||t.containerEl,"onwheel"in window||document.implementation.hasFeature("Events.wheel","3.0")?"wheel":"mousewheel",function(e){var n=function(t){if("deltaX"in t){var e=Q(t.deltaMode);return{x:t.deltaX/J.STANDARD*e,y:t.deltaY/J.STANDARD*e}}if("wheelDeltaX"in t)return{x:t.wheelDeltaX/J.OTHERS,y:t.wheelDeltaY/J.OTHERS};return{x:0,y:t.wheelDelta/J.OTHERS}}(e),o=n.x,i=n.y;t.addTransformableMomentum(o,i,e,function(t){t&&e.preventDefault()})})}}),$=new Map;!function(){function t(t,e){var n=this;this.offset={x:0,y:0},this.limit={x:1/0,y:1/0},this.bounding={top:0,right:0,bottom:0,left:0},this._plugins=[],this._momentum={x:0,y:0},this._listeners=new Set,this.containerEl=t;var o=this.contentEl=document.createElement("div");this.options=new R(e),t.setAttribute("data-scrollbar","true"),t.setAttribute("tabindex","-1"),O(t,{overflow:"hidden",outline:"none"}),window.navigator.msPointerEnabled&&(t.style.msTouchAction="none"),o.className="scroll-content",Array.from(t.childNodes).forEach(function(t){o.appendChild(t)}),t.appendChild(o),this.track=new Y(this),this.size=this.getSize(),this._plugins=function(t,e){return Array.from(V.order).filter(function(t){return!1!==e[t]}).map(function(n){var o=new(0,V.constructors[n])(t,e[n]);return e[n]=o.options,o})}(this,this.options.plugins);var i=t.scrollLeft,r=t.scrollTop;t.scrollLeft=t.scrollTop=0,this.setPosition(i,r,{withoutCallbacks:!0});var l=window.ResizeObserver;"function"==typeof l&&(this._observer=new l(function(){n.update()}),this._observer.observe(o)),$.set(t,this),requestAnimationFrame(function(){n._init()})}Object.defineProperty(t.prototype,"parent",{get:function(){for(var t=this.containerEl.parentElement;t;){var e=$.get(t);if(e)return e;t=t.parentElement}return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollTop",{get:function(){return this.offset.y},set:function(t){this.setPosition(this.scrollLeft,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollLeft",{get:function(){return this.offset.x},set:function(t){this.setPosition(t,this.scrollTop)},enumerable:!0,configurable:!0}),t.prototype.getSize=function(){return e=(t=this).containerEl,n=t.contentEl,o=getComputedStyle(e),i=["paddingTop","paddingBottom","paddingLeft","paddingRight"].map(function(t){return o[t]?parseFloat(o[t]):0}),r=i[0]+i[1],l=i[2]+i[3],{container:{width:e.clientWidth,height:e.clientHeight},content:{width:n.offsetWidth-n.clientWidth+n.scrollWidth+l,height:n.offsetHeight-n.clientHeight+n.scrollHeight+r}};var t,e,n,o,i,r,l},t.prototype.update=function(){var t,e,n,o,i;e=(t=this).getSize(),n={x:Math.max(e.content.width-e.container.width,0),y:Math.max(e.content.height-e.container.height,0)},o=t.containerEl.getBoundingClientRect(),i={top:Math.max(o.top,0),right:Math.min(o.right,window.innerWidth),bottom:Math.min(o.bottom,window.innerHeight),left:Math.max(o.left,0)},t.size=e,t.limit=n,t.bounding=i,t.track.update(),t.setPosition(),this._plugins.forEach(function(t){t.onUpdate()})},t.prototype.isVisible=function(t){return function(t,e){var n=t.bounding,o=e.getBoundingClientRect(),i=Math.max(n.top,o.top),r=Math.max(n.left,o.left),l=Math.min(n.right,o.right);return i<Math.min(n.bottom,o.bottom)&&r<l}(this,t)},t.prototype.setPosition=function(t,e,n){var o=this;void 0===t&&(t=this.offset.x),void 0===e&&(e=this.offset.y),void 0===n&&(n={});var i=function(t,e,n){var o=t.options,i=t.offset,r=t.limit,l=t.track,s=t.contentEl;return o.renderByPixels&&(e=Math.round(e),n=Math.round(n)),e=T(e,0,r.x),n=T(n,0,r.y),e!==i.x&&l.xAxis.show(),n!==i.y&&l.yAxis.show(),o.alwaysShowTracks||l.autoHideOnIdle(),e===i.x&&n===i.y?null:(i.x=e,i.y=n,O(s,{"-transform":"translate3d("+-e+"px, "+-n+"px, 0)"}),l.update(),{offset:h({},i),limit:h({},r)})}(this,t,e);i&&!n.withoutCallbacks&&this._listeners.forEach(function(t){t.call(o,i)})},t.prototype.scrollTo=function(t,e,n,o){void 0===t&&(t=this.offset.x),void 0===e&&(e=this.offset.y),void 0===n&&(n=0),void 0===o&&(o={}),function(t,e,n,o,i){void 0===o&&(o=0);var r=void 0===i?{}:i,l=r.easing,s=void 0===l?X:l,a=r.callback,c=t.options,u=t.offset,h=t.limit;c.renderByPixels&&(e=Math.round(e),n=Math.round(n));var f=u.x,p=u.y,d=T(e,0,h.x)-f,v=T(n,0,h.y)-p,m=Date.now();cancelAnimationFrame(F.get(t)),function e(){var n=Date.now()-m,i=o?s(Math.min(n/o,1)):1;if(t.setPosition(f+d*i,p+v*i),n>=o)"function"==typeof a&&a.call(t);else{var r=requestAnimationFrame(e);F.set(t,r)}}()}(this,t,e,n,o)},t.prototype.scrollIntoView=function(t,e){void 0===e&&(e={}),function(t,e,n){var o=void 0===n?{}:n,i=o.alignToTop,r=void 0===i||i,l=o.onlyScrollIfNeeded,s=void 0!==l&&l,a=o.offsetTop,c=void 0===a?0:a,u=o.offsetLeft,h=void 0===u?0:u,f=o.offsetBottom,p=void 0===f?0:f,d=t.containerEl,v=t.bounding,m=t.offset,y=t.limit;if(e&&d.contains(e)){var b=e.getBoundingClientRect();if(!s||!t.isVisible(e)){var g=r?b.top-v.top-c:b.bottom-v.bottom+p;t.setMomentum(b.left-v.left-h,T(g,-m.y,y.y-m.y))}}}(this,t,e)},t.prototype.addListener=function(t){if("function"!=typeof t)throw new TypeError("[smooth-scrollbar] scrolling listener should be a function");this._listeners.add(t)},t.prototype.removeListener=function(t){this._listeners.delete(t)},t.prototype.addTransformableMomentum=function(t,e,n,o){this._updateDebounced();var i=this._plugins.reduce(function(t,e){return e.transformDelta(t,n)||t},{x:t,y:e}),r=!this._shouldPropagateMomentum(i.x,i.y);r&&this.addMomentum(i.x,i.y),o&&o.call(this,r)},t.prototype.addMomentum=function(t,e){this.setMomentum(this._momentum.x+t,this._momentum.y+e)},t.prototype.setMomentum=function(t,e){0===this.limit.x&&(t=0),0===this.limit.y&&(e=0),this.options.renderByPixels&&(t=Math.round(t),e=Math.round(e)),this._momentum.x=t,this._momentum.y=e},t.prototype.updatePluginOptions=function(t,e){this._plugins.forEach(function(n){n.name===t&&Object.assign(n.options,e)})},t.prototype.destroy=function(){var t,e,n=this.containerEl,o=this.contentEl;t=this,(e=y.get(t))&&(e.forEach(function(t){var e=t.elem,n=t.eventName,o=t.handler;e.removeEventListener(n,o,b())}),y.delete(t)),this._listeners.clear(),this.setMomentum(0,0),cancelAnimationFrame(this._renderID),this._observer&&this._observer.disconnect(),$.delete(this.containerEl);for(var i=Array.from(o.childNodes);n.firstChild;)n.removeChild(n.firstChild);i.forEach(function(t){n.appendChild(t)}),O(n,{overflow:""}),n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,this._plugins.forEach(function(t){t.onDestroy()}),this._plugins.length=0},t.prototype._init=function(){var t=this;this.update(),Object.keys(Z).forEach(function(e){Z[e](t)}),this._plugins.forEach(function(t){t.onInit()}),this._render()},t.prototype._updateDebounced=function(){this.update()},t.prototype._shouldPropagateMomentum=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this,o=n.options,i=n.offset,r=n.limit;if(!o.continuousScrolling)return!1;0===r.x&&0===r.y&&this._updateDebounced();var l=T(t+i.x,0,r.x),s=T(e+i.y,0,r.y),a=!0;return a=(a=(a=a&&l===i.x)&&s===i.y)&&(i.x===r.x||0===i.x||i.y===r.y||0===i.y)},t.prototype._render=function(){var t=this._momentum;if(t.x||t.y){var e=this._nextTick("x"),n=this._nextTick("y");t.x=e.momentum,t.y=n.momentum,this.setPosition(e.position,n.position)}var o=h({},this._momentum);this._plugins.forEach(function(t){t.onRender(o)}),this._renderID=requestAnimationFrame(this._render.bind(this))},t.prototype._nextTick=function(t){var e=this,n=e.options,o=e.offset,i=e._momentum,r=o[t],l=i[t];if(Math.abs(l)<=.1)return{momentum:0,position:r+l};var s=l*(1-n.damping);return n.renderByPixels&&(s|=0),{momentum:s,position:r+l-s}},p([C(100,!0)],t.prototype,"_updateDebounced",null)}();var tt={overscroll:function(){return Promise.resolve().then(function(){return D}).then(function(t){return t.default})}};function et(e){var n=this;void 0===e&&(e={});var l=o(null),s=o(null),a=o({isScrolling:!1,timeout:0}),c=o(1),u=o(!1),p=o(null),m=function(){p.current&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(function(){var t;return null===(t=s.current)||void 0===t?void 0:t.update()})},y=function(t){var n,o,i,r,l,c;null===(n=e.onScroll)||void 0===n||n.call(e,t,s.current);var u=t.offset,h=t.limit;if(0===u.y&&(null===(o=e.onReachTop)||void 0===o||o.call(e)),u.y>=h.y&&(null===(i=e.onReachBottom)||void 0===i||i.call(e)),0===u.x&&(null===(r=e.onReachLeft)||void 0===r||r.call(e)),u.x>=h.x&&(null===(l=e.onReachRight)||void 0===l||l.call(e)),e.onReachPercentage&&h.y>0){var f=u.y/h.y*100;e.onReachPercentage(f,t,s.current)}a.current.isScrolling||(a.current.isScrolling=!0,null===(c=e.onScrollStart)||void 0===c||c.call(e)),clearTimeout(a.current.timeout),a.current.timeout=window.setTimeout(function(){var t;a.current.isScrolling=!1,null===(t=e.onScrollEnd)||void 0===t||t.call(e)},120)},b=function(t){var n;if(s.current&&!e.disableKeyboard){var o=s.current,i=o.limit,r=o.offset,a=(null===(n=l.current)||void 0===n?void 0:n.clientHeight)||300;switch(t.key){case"Home":_.scrollTo(0,0);break;case"End":_.scrollTo(0,i.y);break;case"PageDown":_.scrollTo(r.x,Math.min(r.y+a,i.y));break;case"PageUp":_.scrollTo(r.x,Math.max(r.y-a,0))}}},g=i(function(o){return d(n,void 0,void 0,function(){var n,i,r,l,a,c,u,p,g,_,x,w,E,O=this;return v(this,function(k){switch(k.label){case 0:return o&&"undefined"!=typeof window?o.clientHeight<=1&&o.clientWidth<=1?[2]:(n=e.overEffect,i=e.plugins,r=e.initialX,l=e.initialY,a=e.hideNativeScrollbar,c=e.pluginLoaders,u=e.damping,p=e.momentum,g=f(e,["overEffect","plugins","initialX","initialY","hideNativeScrollbar","pluginLoaders","damping","momentum"]),a&&(o.style.setProperty("scrollbar-width","none"),o.style.msOverflowStyle="none",o.style.overflow="hidden"),_=h({},i||{}),n&&(_.overscroll=h(h({},_.overscroll),{effect:n})),x=h(h({},tt),c||{}),[4,Promise.all(Object.keys(_).map(function(e){return d(O,void 0,void 0,function(){var n,o;return v(this,function(i){switch(i.label){case 0:return(n=x[e])?[4,n()]:[3,2];case 1:o=i.sent(),t.use(o),i.label=2;case 2:return[2]}})})}))]):[2];case 1:return k.sent(),w=null!=u?u:.1,p&&(w=Math.max(.01,Math.min(1,1/p))),s.current=t.init(o,h(h({},g),{damping:w})),Object.keys(_).forEach(function(t){var e;return null===(e=s.current)||void 0===e?void 0:e.updatePluginOptions(t,_[t])}),s.current.addListener(y),(r||l)&&s.current.scrollTo(r||0,l||0,0),E=new ResizeObserver(function(t){var n;m(),null===(n=e.onResize)||void 0===n||n.call(e,t[0],s.current)}),E.observe(o),new MutationObserver(m).observe(o,{childList:!0,subtree:!0}),e.onWheel&&o.addEventListener("wheel",function(t){var n;return null===(n=e.onWheel)||void 0===n?void 0:n.call(e,t,s.current)}),e.disableKeyboard||(o.setAttribute("tabIndex","0"),o.addEventListener("keydown",b)),[2]}})})},[e]);r(function(){return function(){var t,e;p.current&&cancelAnimationFrame(p.current),null===(t=s.current)||void 0===t||t.removeListener(y),null===(e=s.current)||void 0===e||e.destroy()}},[]);var _={scrollTo:function(t,e,n){var o;return void 0===n&&(n=300),null===(o=s.current)||void 0===o?void 0:o.scrollTo(t,e,n*c.current)},scrollBy:function(t,e,n){if(void 0===n&&(n=300),s.current){var o=s.current.offset,i=o.x,r=o.y;s.current.scrollTo(i+t,r+e,n*c.current)}},scrollToTop:function(t){var e;return void 0===t&&(t=300),null===(e=s.current)||void 0===e?void 0:e.scrollTo(0,0,t*c.current)},scrollToBottom:function(t){var e,n,o;return void 0===t&&(t=300),null===(e=s.current)||void 0===e?void 0:e.scrollTo(0,null!==(o=null===(n=s.current)||void 0===n?void 0:n.limit.y)&&void 0!==o?o:0,t*c.current)},scrollToLeft:function(t){var e;return void 0===t&&(t=300),null===(e=s.current)||void 0===e?void 0:e.scrollTo(0,s.current.offset.y,t)},scrollToRight:function(t){var e;return void 0===t&&(t=300),null===(e=s.current)||void 0===e?void 0:e.scrollTo(s.current.limit.x,s.current.offset.y,t)},scrollToPercent:function(t,e,n){if(void 0===n&&(n=300),s.current){var o=s.current.limit.x*t/100,i=s.current.limit.y*e/100;s.current.scrollTo(o,i,n*c.current)}},scrollToElement:function(t,e){var n=void 0===e?{}:e,o=n.align,i=void 0===o?"start":o,r=n.duration,a=void 0===r?300:r;if(s.current&&l.current){var c="string"==typeof t?l.current.querySelector(t):t;if(c instanceof HTMLElement){var u=c.getBoundingClientRect(),h=l.current.getBoundingClientRect(),f=u.top-h.top+s.current.offset.y;"center"===i?f=f-h.height/2+u.height/2:"end"===i&&(f=f-h.height+u.height),s.current.scrollTo(0,f,a)}}},scrollIntoViewIfNeeded:function(t,e,n){if(void 0===e&&(e=20),void 0===n&&(n=300),s.current&&l.current){var o="string"==typeof t?l.current.querySelector(t):t;if(o instanceof HTMLElement){var i=o.getBoundingClientRect(),r=l.current.getBoundingClientRect(),a=s.current.offset.y;i.top<r.top+e?a-=r.top-i.top+e:i.bottom>r.bottom-e&&(a+=i.bottom-r.bottom+e);var c=s.current.offset.x;i.left<r.left+e?c-=r.left-i.left+e:i.right>r.right-e&&(c+=i.right-r.right+e),s.current.scrollTo(c,a,n)}}},getScrollPosition:function(){var t,e=(null===(t=s.current)||void 0===t?void 0:t.offset)||{x:0,y:0};return{x:e.x,y:e.y}},getScrollPercent:function(){if(!s.current)return{xPercent:0,yPercent:0};var t=s.current.offset,e=t.x,n=t.y,o=s.current.limit,i=o.x,r=o.y;return{xPercent:i>0?e/i*100:0,yPercent:r>0?n/r*100:0}},setSpeed:function(t){c.current=t>0?t:1},disableScroll:function(){s.current&&!u.current&&(s.current.options.continuousScrolling=!1,s.current.options.renderByPixels=!1,u.current=!0)},enableScroll:function(){s.current&&u.current&&(s.current.options.continuousScrolling=!0,s.current.options.renderByPixels=!0,u.current=!1)},update:function(){return m()},destroy:function(){var t;return null===(t=s.current)||void 0===t?void 0:t.destroy()},getScrollbar:function(){return s.current}};return{ref:l,initScrollbar:g,api:_}}function nt(e){var n=this;void 0===e&&(e={});var i=o(null),l=o(null),s=o(null),a=function(){s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(function(){var t;return null===(t=l.current)||void 0===t?void 0:t.update()})},c=function(t){var n,o,i;null===(n=e.onScroll)||void 0===n||n.call(e,t,l.current),null===(o=e.onScrollStart)||void 0===o||o.call(e),clearTimeout(null===(i=l.current)||void 0===i?void 0:i._scrollEndTimeout),l.current._scrollEndTimeout=window.setTimeout(function(){var t;null===(t=e.onScrollEnd)||void 0===t||t.call(e)},120)};return r(function(){var o=i.current;if(o&&"undefined"!=typeof window){var r=e.overEffect,u=e.plugins,p=e.pluginLoaders,m=e.initialX,y=e.initialY,b=f(e,["overEffect","plugins","pluginLoaders","initialX","initialY"]),g=h({},u||{});r&&(g.overscroll=h(h({},g.overscroll),{effect:r}));var _=h({overscroll:function(){return Promise.resolve().then(function(){return D}).then(function(t){return t.default})}},p);d(n,void 0,void 0,function(){var e,n,i,r,u;return v(this,function(h){switch(h.label){case 0:e=0,n=Object.keys(g),h.label=1;case 1:return e<n.length?(i=n[e],(r=_[i])?[4,r()]:[3,3]):[3,4];case 2:u=h.sent(),t.use(u),h.label=3;case 3:return e++,[3,1];case 4:return l.current=t.init(o,b),Object.keys(g).forEach(function(t){var e;null===(e=l.current)||void 0===e||e.updatePluginOptions(t,g[t])}),l.current.addListener(c),(m||y)&&l.current.scrollTo(m||0,y||0,0),new ResizeObserver(a).observe(o),new MutationObserver(a).observe(o,{childList:!0,subtree:!0}),[2,function(){var t,e;s.current&&cancelAnimationFrame(s.current),null===(t=l.current)||void 0===t||t.removeListener(c),null===(e=l.current)||void 0===e||e.destroy()}]}})})}},[e]),{ref:i,api:{scrollTo:function(t,e,n){var o;return void 0===n&&(n=300),null===(o=l.current)||void 0===o?void 0:o.scrollTo(t,e,n)},scrollToTop:function(t){var e;return void 0===t&&(t=300),null===(e=l.current)||void 0===e?void 0:e.scrollTo(0,0,t)},scrollToBottom:function(t){var e,n,o;return void 0===t&&(t=300),null===(e=l.current)||void 0===e?void 0:e.scrollTo(0,null!==(o=null===(n=l.current)||void 0===n?void 0:n.limit.y)&&void 0!==o?o:0,t)},update:function(){return a()},destroy:function(){var t;return null===(t=l.current)||void 0===t?void 0:t.destroy()}}}}var ot=l(function(t,e){var o=t.id,i=t.className,r=t.style,l=t.children,a=t.width,c=t.height,u=t.maxWidth,p=t.maxHeight,d=t.thumbColor,v=void 0===d?"rgba(0,0,0,0.5)":d,m=t.thumbHoverColor,y=void 0===m?"rgba(0,0,0,0.75)":m,b=t.thumbSize,g=void 0===b?12:b,_=t.thumbHoverSize,x=void 0===_?1.5:_,w=t.trackColor,E=void 0===w?"rgba(0,0,0,0.1)":w,O=t.trackSize,k=void 0===O?8:O,S=t.trackHoverSize,T=t.alwaysShowTracks,P=void 0!==T&&T,A=t.showOnHover,z=void 0!==A&&A,M=t.trackOpacity,H=void 0===M?.7:M,N=t.renderByPixels,D=void 0===N||N,L=t.continuousScrolling,j=void 0===L||L,C=f(t,["id","className","style","children","width","height","maxWidth","maxHeight","thumbColor","thumbHoverColor","thumbSize","thumbHoverSize","trackColor","trackSize","trackHoverSize","alwaysShowTracks","showOnHover","trackOpacity","renderByPixels","continuousScrolling"]),I=et(h(h({},C),{renderByPixels:D,continuousScrolling:j})),R=I.ref,B=I.initScrollbar,W=I.api;s(e,function(){return W},[W]);var Y=function(t){return"number"==typeof t?"".concat(t,"px"):t},F="undefined"==typeof window;return n.createElement("div",{id:o,ref:function(t){R.current=t,t&&B(t)},className:"full-scrollbar ".concat(P?"always-visible":""," ").concat(i||"").trim(),style:h({width:a,height:c,maxWidth:u,maxHeight:p,overflow:F?"auto":"hidden",position:"relative"},r)},n.isValidElement(l)?l:n.createElement("div",{className:"full-scrollbar-wrap"},l),!F&&n.createElement("style",null,"\n /* hide native scrollbar */\n .full-scrollbar::-webkit-scrollbar { display: none; }\n .full-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }\n\n /* track base */\n .full-scrollbar .scrollbar-track {\n background: ".concat(E,";\n opacity: ").concat(P?1:z?0:H,";\n transition: opacity 0.25s ease;\n }\n .full-scrollbar:hover .scrollbar-track {\n opacity: 1 !important;\n }\n .full-scrollbar.always-visible .scrollbar-track {\n opacity: 1 !important;\n visibility: visible !important;\n }\n\n /* thumb */\n .full-scrollbar .scrollbar-thumb {\n background: ").concat(v,";\n border-radius: 999px;\n width: ").concat(Y(g),";\n height: ").concat(Y(g),";\n transition: background 0.25s ease, transform 0.25s cubic-bezier(0.4,0,0.2,1);\n transform-origin: center;\n }\n .full-scrollbar .scrollbar-thumb:hover {\n background: ").concat(y,";\n transform: scale3d(").concat(x,", ").concat(x,", 1);\n }\n\n /* track X */\n .full-scrollbar .scrollbar-track-x {\n height: ").concat(Y(k),";\n bottom: 0;\n left: 0;\n right: 0;\n position: absolute;\n transition: height 0.25s ease;\n }\n .full-scrollbar .scrollbar-track-x:hover {\n height: ").concat(Y(S||k),";\n }\n\n /* track Y */\n .full-scrollbar .scrollbar-track-y {\n width: ").concat(Y(k),";\n top: 0;\n bottom: 0;\n right: 0;\n position: absolute;\n transition: width 0.25s ease;\n }\n .full-scrollbar .scrollbar-track-y:hover {\n width: ").concat(Y(S||k),";\n }\n\n .full-scrollbar .highlighted {\n background-color: #fff8e1 !important;\n box-shadow: 0 2px 6px rgba(0,0,0,0.1);\n transition: background 0.3s, box-shadow 0.3s;\n }\n ")))});ot.displayName="FullScrollbar";var it=l(function(t,e){var o=t.id,i=t.className,l=t.style,s=t.children,a=t.width,c=t.height,u=t.maxWidth,p=t.maxHeight,d=t.thumbColor,v=void 0===d?"rgba(0,0,0,0.5)":d,m=t.thumbHoverColor,y=void 0===m?"rgba(0,0,0,0.75)":m,b=t.thumbSize,g=void 0===b?12:b,_=t.thumbHoverSize,x=void 0===_?1.7:_,w=t.trackColor,E=void 0===w?"rgba(0,0,0,0.2)":w;t.trackSize;var O=t.trackHoverSize,k=t.trackOpacity,S=void 0===k?.7:k,T=t.hideNativeScrollbar,P=void 0===T||T,A=t.showOnHover,z=void 0!==A&&A,M=t.alwaysShowTracks,H=void 0!==M&&M;t.visibleOpacity;var N=t.plugins,D=t.pluginLoaders,L=f(t,["id","className","style","children","width","height","maxWidth","maxHeight","thumbColor","thumbHoverColor","thumbSize","thumbHoverSize","trackColor","trackSize","trackHoverSize","trackOpacity","hideNativeScrollbar","showOnHover","alwaysShowTracks","visibleOpacity","plugins","pluginLoaders"]),j=nt(h(h({},L),{plugins:N,pluginLoaders:D})),C=j.ref,I=j.api;r(function(){e&&("function"==typeof e?e(I):e.current=I)},[e,I]);var R=function(t){return"number"==typeof t?"".concat(t,"px"):t},B="undefined"==typeof window;return n.createElement("div",{id:o,ref:C,className:"neo-scrollbar ".concat(i||""," ").concat(H?"always-visible":"").trim(),style:h({width:a,height:c,maxWidth:u,maxHeight:p,overflow:B?"auto":"hidden",position:"relative"},l)},n.isValidElement(s)?s:n.createElement("div",{className:"neo-scrollbar-wrap"},s),P&&!B&&n.createElement("style",null,"\n .neo-scrollbar::-webkit-scrollbar { display: none; }\n .neo-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }\n "),n.createElement("style",null,"\n .neo-scrollbar .scrollbar-track {\n background-color: ".concat(E,";\n opacity: ").concat(H?1:z?0:S,";\n transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease;\n }\n .neo-scrollbar:hover .scrollbar-track {\n opacity: 1 !important;\n ").concat(O?"width: ".concat(R(O),"; height: ").concat(R(O),";"):"","\n }\n .neo-scrollbar.always-visible .scrollbar-track {\n opacity: 1 !important;\n visibility: visible !important;\n }\n\n .neo-scrollbar .scrollbar-thumb {\n background-color: ").concat(v,";\n border-radius: 999px;\n width: ").concat(R(g),";\n height: ").concat(R(g),";\n transition: background-color 0.2s ease, transform 0.2s ease;\n transform-origin: center;\n }\n .neo-scrollbar .scrollbar-thumb:hover {\n background-color: ").concat(y,";\n transform: scale3d(").concat(x,", ").concat(x,", 1);\n }\n\n .neo-scrollbar .highlighted {\n background-color: #fff8e1 !important;\n box-shadow: 0 2px 6px rgba(0,0,0,0.1);\n transition: background 0.3s, box-shadow 0.3s;\n }\n ")))});it.displayName="NeoScrollbar";var rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._links=[],e}return c(e,t),e.prototype.onInit=function(){var t=this,e=this.options,n=e.selector,o=e.duration,i=e.align,r=e.offset;this._links=Array.from(this.scrollbar.containerEl.querySelectorAll(n)),this._handleClick=function(e){var n,l=e.target;if("A"===l.tagName){var s=l.closest("a");if(s&&(null===(n=s.getAttribute("href"))||void 0===n?void 0:n.startsWith("#"))){var a=s.getAttribute("href").slice(1),c=document.getElementById(a);if(c){e.preventDefault();var u=c.getBoundingClientRect(),h=u.top+t.scrollbar.offset.y-r;"center"===i?h=h-t.scrollbar.size.container.height/2+u.height/2:"end"===i&&(h=h-t.scrollbar.size.container.height+u.height),t.scrollbar.scrollTo(0,h,o)}}}},this.scrollbar.containerEl.addEventListener("click",this._handleClick)},e.prototype.onRender=function(){var t=this,e=this.options,n=e.activeClass,o=e.offset,i=this.scrollbar.scrollTop+o,r=this.scrollbar.scrollTop+this.scrollbar.size.container.height,l=null;this._links.forEach(function(e){var n,o=null===(n=e.getAttribute("href"))||void 0===n?void 0:n.slice(1);if(o){var s=document.getElementById(o);if(s){var a=s.getBoundingClientRect(),c=t.scrollbar.scrollTop+a.top,u=c+a.height;c<r&&u>i&&(l=o)}}}),this._links.forEach(function(t){var e,o=null===(e=t.getAttribute("href"))||void 0===e?void 0:e.slice(1);o&&(o===l?t.classList.add(n):t.classList.remove(n))})},e.prototype.onDestroy=function(){this._handleClick&&this.scrollbar.containerEl.removeEventListener("click",this._handleClick),this._links=[]},e.pluginName="anchor",e.defaultOptions={duration:600,align:"start",activeClass:"active",offset:0,selector:"a[href^='#']"},e}(e),lt=Object.freeze({__proto__:null,default:rt}),st=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._bouncing=!1,e}return c(e,t),e.prototype.onRender=function(){var t=this,e=this.scrollbar,n=e.offset,o=e.limit,i=e.containerEl,r=this.options,l=r.distance,s=void 0===l?15:l,a=r.duration,c=void 0===a?200:a,u=r.easing,h=void 0===u?"ease-out":u;this._bouncing||(n.y<=0||n.y>=o.y)&&(this._bouncing=!0,i.style.transition="transform ".concat(c,"ms ").concat(h),i.style.transform="translateY(".concat(n.y<=0?s:-s,"px)"),setTimeout(function(){i.style.transform="translateY(0)",setTimeout(function(){i.style.transition="",t._bouncing=!1},c)},c/2))},e.prototype.onDestroy=function(){this.scrollbar.containerEl.style.transition="",this.scrollbar.containerEl.style.transform=""},e.pluginName="bounceEffect",e}(e),at=Object.freeze({__proto__:null,default:st}),ct=function(){function t(){}return t.prototype.transformDelta=function(t){return t},t.prototype.onInit=function(t){},t.prototype.onDestroy=function(t){},t.pluginName="base",t}(),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.onInit=function(t){this._mutationObserver=new MutationObserver(function(){t.update()}),this._mutationObserver.observe(t.contentEl,{childList:!0,subtree:!0,characterData:!0}),this._resizeObserver=new ResizeObserver(function(){t.update()}),this._resizeObserver.observe(t.contentEl)},e.prototype.onDestroy=function(t){var e,n;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),null===(n=this._resizeObserver)||void 0===n||n.disconnect()},e.pluginName="contentSize",e}(ct),ht=Object.freeze({__proto__:null,default:ut}),ft=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animating=!1,e}return c(e,t),e.prototype.onRender=function(){var t=this,e=this.scrollbar,n=e.offset,o=e.limit,i=e.contentEl,r=this.options||{},l=r.distance,s=void 0===l?8:l,a=r.duration,c=void 0===a?200:a;this.animating||(n.y<=0||n.y>=o.y)&&(this.animating=!0,i.animate([{transform:"translateY(".concat(n.y<=0?s:-s,"px)")},{transform:"translateY(0)"}],{duration:c,easing:"cubic-bezier(.25,.1,.25,1)"}).onfinish=function(){t.animating=!1})},e.pluginName="edgeBounce",e}(e),pt=Object.freeze({__proto__:null,default:ft}),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.transformDelta=function(t){var e,n=this.scrollbar,o=n.limit,i=n.offset,r=n.size,l=this.options||{},s=null!==(e=l.factor)&&void 0!==e?e:.3,a=t.x,c=t.y;if(i.x+a<0)a*=l.dynamic?Math.max((i.x+a)/r.container.width,s):s;else if(i.x+a>o.x){var u=o.x-i.x;a*=l.dynamic?Math.max(u/r.container.width,s):s}if(i.y+c<0)c*=l.dynamic?Math.max((i.y+c)/r.container.height,s):s;else if(i.y+c>o.y){u=o.y-i.y;c*=l.dynamic?Math.max(u/r.container.height,s):s}return{x:a,y:c}},e.pluginName="edgeEasing",e}(e),vt=Object.freeze({__proto__:null,default:dt}),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.onInit=function(){var t=this;this.scrollbar.containerEl.querySelectorAll(".scrollbar-track").forEach(function(e){var n,o;e.style.transition="opacity 0.3s ease",e.style.opacity=String(null!==(o=null===(n=t.options)||void 0===n?void 0:n.fadedOpacity)&&void 0!==o?o:.3)})},e.prototype.onRender=function(){var t,e=this.scrollbar.containerEl,n=this.options||{},o=e.querySelectorAll(n.includeX?".scrollbar-track":".scrollbar-track-y");o.forEach(function(t){var e;t.style.opacity=String(null!==(e=n.visibleOpacity)&&void 0!==e?e:1)}),this._timeout&&clearTimeout(this._timeout),this._timeout=window.setTimeout(function(){o.forEach(function(t){var e;t.style.opacity=String(null!==(e=n.fadedOpacity)&&void 0!==e?e:.3)})},null!==(t=n.fadeDelay)&&void 0!==t?t:500)},e.prototype.onDestroy=function(){this._timeout&&clearTimeout(this._timeout)},e.pluginName="fadeScroll",e}(e),yt=Object.freeze({__proto__:null,default:mt}),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.transformOptions=function(t){var e,n,o,i;return{height:null!==(e=t.height)&&void 0!==e?e:24,color:null!==(n=t.color)&&void 0!==n?n:"rgba(0,0,0,0.15)",fadeDuration:null!==(o=t.fadeDuration)&&void 0!==o?o:200,zIndex:null!==(i=t.zIndex)&&void 0!==i?i:5}},e.prototype.onInit=function(){var t=this.scrollbar.containerEl,e=this.options;this.topEl=document.createElement("div"),this.bottomEl=document.createElement("div");var n={position:"absolute",left:"0",right:"0",pointerEvents:"none",opacity:"0",zIndex:String(e.zIndex),transition:"opacity ".concat(e.fadeDuration,"ms ease")};Object.assign(this.topEl.style,n,{top:"0",height:"".concat(e.height,"px"),background:"linear-gradient(to bottom, ".concat(e.color,", transparent)")}),Object.assign(this.bottomEl.style