diff --git a/bower.json b/bower.json index a7c36d5..348481e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "smooth-scrollbar", - "version": "8.8.3", + "version": "8.8.4", "authors": [ "Dolphin Wood " ], diff --git a/dist/plugins/overscroll.js b/dist/plugins/overscroll.js index 762f735..9fb4886 100644 --- a/dist/plugins/overscroll.js +++ b/dist/plugins/overscroll.js @@ -13,4 +13,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},r=function(){return(r=Object.assign||function(t){for(var e,o=1,i=arguments.length;o0&&s.transform(-1,0,0,1,r,0);var c=h(Math.abs(t)/o,0,.75),a=h(c,0,.25)*r,l=Math.abs(t),u=this._touchY||n/2;s.globalAlpha=c,s.beginPath(),s.moveTo(0,-a),s.quadraticCurveTo(l,u,0,n+a),s.fill(),s.closePath(),s.restore()},t.prototype._renderY=function(t){var e=this._scrollbar.size,o=this._getMaxOverscroll(),i=e.container,r=i.width,n=i.height,s=this._ctx;s.save(),t>0&&s.transform(1,0,0,-1,0,n);var c=h(Math.abs(t)/o,0,.75),a=h(c,0,.25)*r,l=this._touchX||r/2,u=Math.abs(t);s.globalAlpha=c,s.beginPath(),s.moveTo(-a,0),s.quadraticCurveTo(l,u,r+a,0),s.fill(),s.closePath(),s.restore()},t}();o.d(e,"OverscrollEffect",(function(){return u})),function(t){t.BOUNCE="bounce",t.GLOW="glow"}(u||(u={}));var d=/wheel|touch/,y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._glow=new _(e.scrollbar),e._bounce=new f(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=function(t,e,o){void 0===e&&(e=0);return function(){for(var t=[],e=0;e0&&s.transform(-1,0,0,1,r,0);var c=h(Math.abs(t)/o,0,.75),a=h(c,0,.25)*r,l=Math.abs(t),u=this._touchY||n/2;s.globalAlpha=c,s.beginPath(),s.moveTo(0,-a),s.quadraticCurveTo(l,u,0,n+a),s.fill(),s.closePath(),s.restore()},t.prototype._renderY=function(t){var e=this._scrollbar.size,o=this._getMaxOverscroll(),i=e.container,r=i.width,n=i.height,s=this._ctx;s.save(),t>0&&s.transform(1,0,0,-1,0,n);var c=h(Math.abs(t)/o,0,.75),a=h(c,0,.25)*r,l=this._touchX||r/2,u=Math.abs(t);s.globalAlpha=c,s.beginPath(),s.moveTo(-a,0),s.quadraticCurveTo(l,u,r+a,0),s.fill(),s.closePath(),s.restore()},t}();o.d(e,"OverscrollEffect",(function(){return u})),function(t){t.BOUNCE="bounce",t.GLOW="glow"}(u||(u={}));var d=/wheel|touch/,y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._glow=new _(e.scrollbar),e._bounce=new f(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=function(t,e,o){var i;void 0===e&&(e=0);return function(){for(var o=this,r=[],n=0;n=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}n(66),n(89),n(91),n(97),n(101);var c,a=new WeakMap;function s(){if(void 0!==c)return c;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 c=!!t&&{passive:!1}}function f(t){var e=a.get(t)||[];return a.set(t,e),function(t,n,r){function o(t){t.defaultPrevented||r(t)}n.split(/\s+/g).forEach((function(n){e.push({elem:t,eventName:n,handler:o}),t.addEventListener(n,o,s())}))}}function l(t){var e=function(t){return t.touches?t.touches[t.touches.length-1]:t}(t);return{x:e.clientX,y:e.clientY}}function p(t,e){return void 0===e&&(e=[]),e.some((function(e){return t===e}))}var h=["webkit","moz","ms","o"],d=new RegExp("^-(?!(?:"+h.join("|")+")-)");function v(t,e){e=function(t){var e={};return Object.keys(t).forEach((function(n){if(d.test(n)){var r=t[n];n=n.replace(/^-/,""),e[n]=r,h.forEach((function(t){e["-"+t+"-"+n]=r}))}else e[n]=t[n]})),e}(e),Object.keys(e).forEach((function(n){var r=n.replace(/^-/,"").replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}));t.style[r]=e[n]}))}var y=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=l(t)}return t.prototype.update=function(t){var e=this.velocity,n=this.updateTime,r=this.lastPosition,o=Date.now(),i=l(t),u={x:-(i.x-r.x),y:-(i.y-r.y)},c=o-n||16.7,a=u.x/c*16.7,s=u.y/c*16.7;e.x=a*this.velocityMultiplier,e.y=s*this.velocityMultiplier,this.delta=u,this.updateTime=o,this.lastPosition=i},t}(),m=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?i({},t.delta):this._primitiveValue},t.prototype.getVelocity=function(){var t=this._getActiveTracker();return t?i({},t.velocity):this._primitiveValue},t.prototype.getEasingDistance=function(t){var e=1-t,n={x:0,y:0},r=this.getVelocity();return Object.keys(r).forEach((function(t){for(var o=Math.abs(r[t])<=10?0:r[t];0!==o;)n[t]+=o,o=o*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,r=t.changedTouches;return Array.from(n).forEach((function(t){e._renew(t)})),this._setActiveID(r),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 y(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 g(t,e,n){return Math.max(e,Math.min(n,t))}function x(t,e,n){var r;void 0===e&&(e=0);var o=-1/0;return function(){for(var i=this,u=[],c=0;c=e&&t.apply(this,u),clearTimeout(r),r=setTimeout((function(){t.apply(i,u)}),e)}}}function b(t,e){return void 0===t&&(t=-1/0),void 0===e&&(e=1/0),function(n,r){var o="_"+r;Object.defineProperty(n,r,{get:function(){return this[o]},set:function(n){Object.defineProperty(this,o,{value:g(n,t,e),enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}}function w(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 S(){for(var t=[],e=0;eo-20?f.x=a-o+20:ai-20?f.y=s-i+20:s=r)"function"==typeof a&&a.call(t);else{var i=requestAnimationFrame(e);P.set(t,i)}}()}(this,t,e,n,r)},t.prototype.scrollIntoView=function(t,e){void 0===e&&(e={}),function(t,e,n){var r=void 0===n?{}:n,o=r.alignToTop,i=void 0===o||o,u=r.onlyScrollIfNeeded,c=void 0!==u&&u,a=r.offsetTop,s=void 0===a?0:a,f=r.offsetLeft,l=void 0===f?0:f,p=r.offsetBottom,h=void 0===p?0:p,d=t.containerEl,v=t.bounding,y=t.offset,m=t.limit;if(e&&d.contains(e)){var x=e.getBoundingClientRect();if(!c||!t.isVisible(e)){var b=i?x.top-v.top-s:x.bottom-v.bottom+h;t.setMomentum(x.left-v.left-l,g(b,-y.y,m.y-y.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,r){this._updateDebounced();var o=this._plugins.reduce((function(t,e){return e.transformDelta(t,n)||t}),{x:t,y:e}),i=!this._shouldPropagateMomentum(o.x,o.y);i&&this.addMomentum(o.x,o.y),r&&r.call(this,i)},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=this.containerEl,e=this.contentEl;!function(t){var e=a.get(t);e&&(e.forEach((function(t){var e=t.elem,n=t.eventName,r=t.handler;e.removeEventListener(n,r,s())})),a.delete(t))}(this),this._listeners.clear(),this.setMomentum(0,0),cancelAnimationFrame(this._renderID),this._observer&&this._observer.disconnect(),X.delete(this.containerEl);for(var n=Array.from(e.childNodes);t.firstChild;)t.removeChild(t.firstChild);n.forEach((function(e){t.appendChild(e)})),v(t,{overflow:""}),t.scrollTop=this.scrollTop,t.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(r).forEach((function(e){r[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.options,r=this.offset,o=this.limit;if(!n.continuousScrolling)return!1;0===o.x&&0===o.y&&this._updateDebounced();var i=g(t+r.x,0,o.x),u=g(e+r.y,0,o.y),c=!0;return(c=(c=c&&i===r.x)&&u===r.y)&&(r.x===o.x||0===r.x||r.y===o.y||0===r.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 r=i({},this._momentum);this._plugins.forEach((function(t){t.onRender(r)})),this._renderID=requestAnimationFrame(this._render.bind(this))},t.prototype._nextTick=function(t){var e=this.options,n=this.offset,r=this._momentum,o=n[t],i=r[t];if(Math.abs(i)<=.1)return{momentum:0,position:o+i};var u=i*(1-e.damping);return e.renderByPixels&&(u|=0),{momentum:u,position:o+i-u}},u([S(100,!0)],t.prototype,"_updateDebounced",null),t}(),V="smooth-scrollbar-style",Y=!1;function q(){if(!Y&&"undefined"!=typeof window){var t=document.createElement("style");t.id=V,t.textContent="\n[data-scrollbar] {\n display: block;\n position: relative;\n}\n\n.scroll-content {\n display: flow-root;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.scrollbar-track {\n position: absolute;\n opacity: 0;\n z-index: 1;\n background: rgba(222, 222, 222, .75);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: opacity 0.5s 0.5s ease-out;\n transition: opacity 0.5s 0.5s ease-out;\n}\n.scrollbar-track.show,\n.scrollbar-track:hover {\n opacity: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.scrollbar-track-x {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 8px;\n}\n.scrollbar-track-y {\n top: 0;\n right: 0;\n width: 8px;\n height: 100%;\n}\n.scrollbar-thumb {\n position: absolute;\n top: 0;\n left: 0;\n width: 8px;\n height: 8px;\n background: rgba(0, 0, 0, .5);\n border-radius: 4px;\n}\n",document.head&&document.head.appendChild(t),Y=!0}}n.d(e,"ScrollbarPlugin",(function(){return z}));var Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.init=function(t,e){if(!t||1!==t.nodeType)throw new TypeError("expect element to be DOM Element, but got "+t);return q(),X.has(t)?X.get(t):new U(t,e)},e.initAll=function(t){return Array.from(document.querySelectorAll("[data-scrollbar]"),(function(n){return e.init(n,t)}))},e.has=function(t){return X.has(t)},e.get=function(t){return X.get(t)},e.getAll=function(){return Array.from(X.values())},e.destroy=function(t){var e=X.get(t);e&&e.destroy()},e.destroyAll=function(){X.forEach((function(t){t.destroy()}))},e.use=function(){for(var t=[],e=0;e=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}n(66),n(89),n(91),n(97),n(101);var c,a=new WeakMap;function s(){if(void 0!==c)return c;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 c=!!t&&{passive:!1}}function f(t){var e=a.get(t)||[];return a.set(t,e),function(t,n,r){function o(t){t.defaultPrevented||r(t)}n.split(/\s+/g).forEach((function(n){e.push({elem:t,eventName:n,handler:o}),t.addEventListener(n,o,s())}))}}function l(t){var e=function(t){return t.touches?t.touches[t.touches.length-1]:t}(t);return{x:e.clientX,y:e.clientY}}function p(t,e){return void 0===e&&(e=[]),e.some((function(e){return t===e}))}var h=["webkit","moz","ms","o"],d=new RegExp("^-(?!(?:"+h.join("|")+")-)");function v(t,e){e=function(t){var e={};return Object.keys(t).forEach((function(n){if(d.test(n)){var r=t[n];n=n.replace(/^-/,""),e[n]=r,h.forEach((function(t){e["-"+t+"-"+n]=r}))}else e[n]=t[n]})),e}(e),Object.keys(e).forEach((function(n){var r=n.replace(/^-/,"").replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}));t.style[r]=e[n]}))}var y=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=l(t)}return t.prototype.update=function(t){var e=this.velocity,n=this.updateTime,r=this.lastPosition,o=Date.now(),i=l(t),u={x:-(i.x-r.x),y:-(i.y-r.y)},c=o-n||16.7,a=u.x/c*16.7,s=u.y/c*16.7;e.x=a*this.velocityMultiplier,e.y=s*this.velocityMultiplier,this.delta=u,this.updateTime=o,this.lastPosition=i},t}(),m=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?i({},t.delta):this._primitiveValue},t.prototype.getVelocity=function(){var t=this._getActiveTracker();return t?i({},t.velocity):this._primitiveValue},t.prototype.getEasingDistance=function(t){var e=1-t,n={x:0,y:0},r=this.getVelocity();return Object.keys(r).forEach((function(t){for(var o=Math.abs(r[t])<=10?0:r[t];0!==o;)n[t]+=o,o=o*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,r=t.changedTouches;return Array.from(n).forEach((function(t){e._renew(t)})),this._setActiveID(r),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 y(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 g(t,e,n){return Math.max(e,Math.min(n,t))}function x(t,e,n){var r;void 0===e&&(e=0);var o=-1/0;return function(){for(var i=this,u=[],c=0;c=e&&t.apply(this,u)}clearTimeout(r),r=setTimeout((function(){t.apply(i,u)}),e)}}function b(t,e){return void 0===t&&(t=-1/0),void 0===e&&(e=1/0),function(n,r){var o="_"+r;Object.defineProperty(n,r,{get:function(){return this[o]},set:function(n){Object.defineProperty(this,o,{value:g(n,t,e),enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}}function w(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 S(){for(var t=[],e=0;eo-20?f.x=a-o+20:ai-20?f.y=s-i+20:s=r)"function"==typeof a&&a.call(t);else{var i=requestAnimationFrame(e);P.set(t,i)}}()}(this,t,e,n,r)},t.prototype.scrollIntoView=function(t,e){void 0===e&&(e={}),function(t,e,n){var r=void 0===n?{}:n,o=r.alignToTop,i=void 0===o||o,u=r.onlyScrollIfNeeded,c=void 0!==u&&u,a=r.offsetTop,s=void 0===a?0:a,f=r.offsetLeft,l=void 0===f?0:f,p=r.offsetBottom,h=void 0===p?0:p,d=t.containerEl,v=t.bounding,y=t.offset,m=t.limit;if(e&&d.contains(e)){var x=e.getBoundingClientRect();if(!c||!t.isVisible(e)){var b=i?x.top-v.top-s:x.bottom-v.bottom+h;t.setMomentum(x.left-v.left-l,g(b,-y.y,m.y-y.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,r){this._updateDebounced();var o=this._plugins.reduce((function(t,e){return e.transformDelta(t,n)||t}),{x:t,y:e}),i=!this._shouldPropagateMomentum(o.x,o.y);i&&this.addMomentum(o.x,o.y),r&&r.call(this,i)},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=this.containerEl,e=this.contentEl;!function(t){var e=a.get(t);e&&(e.forEach((function(t){var e=t.elem,n=t.eventName,r=t.handler;e.removeEventListener(n,r,s())})),a.delete(t))}(this),this._listeners.clear(),this.setMomentum(0,0),cancelAnimationFrame(this._renderID),this._observer&&this._observer.disconnect(),X.delete(this.containerEl);for(var n=Array.from(e.childNodes);t.firstChild;)t.removeChild(t.firstChild);n.forEach((function(e){t.appendChild(e)})),v(t,{overflow:""}),t.scrollTop=this.scrollTop,t.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(r).forEach((function(e){r[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.options,r=this.offset,o=this.limit;if(!n.continuousScrolling)return!1;0===o.x&&0===o.y&&this._updateDebounced();var i=g(t+r.x,0,o.x),u=g(e+r.y,0,o.y),c=!0;return(c=(c=c&&i===r.x)&&u===r.y)&&(r.x===o.x||0===r.x||r.y===o.y||0===r.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 r=i({},this._momentum);this._plugins.forEach((function(t){t.onRender(r)})),this._renderID=requestAnimationFrame(this._render.bind(this))},t.prototype._nextTick=function(t){var e=this.options,n=this.offset,r=this._momentum,o=n[t],i=r[t];if(Math.abs(i)<=.1)return{momentum:0,position:o+i};var u=i*(1-e.damping);return e.renderByPixels&&(u|=0),{momentum:u,position:o+i-u}},u([S(100,!0)],t.prototype,"_updateDebounced",null),t}(),V="smooth-scrollbar-style",Y=!1;function q(){if(!Y&&"undefined"!=typeof window){var t=document.createElement("style");t.id=V,t.textContent="\n[data-scrollbar] {\n display: block;\n position: relative;\n}\n\n.scroll-content {\n display: flow-root;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.scrollbar-track {\n position: absolute;\n opacity: 0;\n z-index: 1;\n background: rgba(222, 222, 222, .75);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: opacity 0.5s 0.5s ease-out;\n transition: opacity 0.5s 0.5s ease-out;\n}\n.scrollbar-track.show,\n.scrollbar-track:hover {\n opacity: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.scrollbar-track-x {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 8px;\n}\n.scrollbar-track-y {\n top: 0;\n right: 0;\n width: 8px;\n height: 100%;\n}\n.scrollbar-thumb {\n position: absolute;\n top: 0;\n left: 0;\n width: 8px;\n height: 8px;\n background: rgba(0, 0, 0, .5);\n border-radius: 4px;\n}\n",document.head&&document.head.appendChild(t),Y=!0}}n.d(e,"ScrollbarPlugin",(function(){return z}));var Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.init=function(t,e){if(!t||1!==t.nodeType)throw new TypeError("expect element to be DOM Element, but got "+t);return q(),X.has(t)?X.get(t):new U(t,e)},e.initAll=function(t){return Array.from(document.querySelectorAll("[data-scrollbar]"),(function(n){return e.init(n,t)}))},e.has=function(t){return X.has(t)},e.get=function(t){return X.get(t)},e.getAll=function(){return Array.from(X.values())},e.destroy=function(t){var e=X.get(t);e&&e.destroy()},e.destroyAll=function(){X.forEach((function(t){t.destroy()}))},e.use=function(){for(var t=[],e=0;e