text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):t.vuescroll=e(t.Vue)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function r(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,o){return e&&r(t.prototype,e),o&&r(t,o),t}}(),b=function(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t},d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},p=function(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}return Array.from(t)};function s(){if(l())return!1;var t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/")}var a=function(){return!l()&&!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)},l=function(){return t.prototype.$isServer},v=function(){function t(){e(this,t)}return o(t,[{key:"getEventObject",value:function(t){return this.touchObject?this.isTouch?t.touches:[t]:null}},{key:"getTouchObject",value:function(){if(l())return null;this.isTouch=!1;var t=navigator.userAgent,e=navigator.platform,o={};switch(o.touch=!!("ontouchstart"in window&&!window.opera||"msmaxtouchpoints"in window.navigator||"maxtouchpoints"in window.navigator||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints),o.nonDeskTouch=o.touch&&!/win32/i.test(e)||o.touch&&/win32/i.test(e)&&/mobile/i.test(t),o.eventType="onmousedown"in window&&!o.nonDeskTouch?"mouse":"ontouchstart"in window?"touch":"msmaxtouchpoints"in window.navigator||0<navigator.msMaxTouchPoints?"mstouchpoints":"maxtouchpoints"in window.navigator||0<navigator.maxTouchPoints?"touchpoints":"mouse",o.eventType){case"mouse":o.touchstart="mousedown",o.touchend="mouseup",o.touchmove="mousemove",o.touchenter="mouseenter",o.touchmove="mousemove",o.touchleave="mouseleave";break;case"touch":o.touchstart="touchstart",o.touchend="touchend",o.touchmove="touchmove",o.touchcancel="touchcancel",o.touchenter="touchstart",o.touchmove="touchmove",o.touchleave="touchend",this.isTouch=!0;break;case"mstouchpoints":o.touchstart="MSPointerDown",o.touchend="MSPointerUp",o.touchmove="MSPointerMove",o.touchcancel="MSPointerCancel",o.touchenter="MSPointerDown",o.touchmove="MSPointerMove",o.touchleave="MSPointerUp";break;case"touchpoints":o.touchstart="pointerdown",o.touchend="pointerup",o.touchmove="pointermove",o.touchcancel="pointercancel",o.touchenter="pointerdown",o.touchmove="pointermove",o.touchleave="pointerup"}return this.touchObject=o}}]),t}();function c(t,o,e){if(e&&z(o))return t;if(B(t))o=[],t.forEach(function(t,e){o[e]=c(t,o[e])});else if(t){if(!O(t))return t;for(var r in o={},t)o[r]="object"===n(t[r])?c(t[r],o[r]):t[r]}return o}function f(t,o,r,i){if(i&&z(o))return t;if(o=o||{},B(t))!B(o)&&r&&(o=[]),B(o)&&t.forEach(function(t,e){o[e]=f(t,o[e],r,i)});else if(t)if(O(t))for(var e in t)"object"===n(t[e])?z(o[e])?o[e]=c(t[e],o[e],i):f(t[e],o[e],r,i):(z(o[e])||r)&&(o[e]=t[e]);else r&&(o=t);return o}var u=void 0;function y(t,e,o){var r=3<arguments.length&&void 0!==arguments[3]&&arguments[3];"on"==(4<arguments.length&&void 0!==arguments[4]?arguments[4]:"on")?t.addEventListener(e,o,r):t.removeEventListener(e,o,r)}var g=function(t){console.warn("[vuescroll] "+t)};function m(t,e){var o=!1;if(!t||!e)return o;for(;t.parentNode!==e&&9!==t.parentNode.nodeType&&!t.parentNode._isVuescroll;)t=t.parentNode;return t.parentNode==e&&(o=!0),o}function h(t,e){if(l())return!1;var o,r,i,n="-"+(o=window,i=document.documentElement.style,o.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?r="presto":"MozAppearance"in i?r="gecko":"WebkitAppearance"in i?r="webkit":"string"==typeof navigator.cpuClass&&(r="trident"),{trident:"ms",gecko:"moz",webkit:"webkit",presto:"O"}[r])+"-"+e,s=document.createElement("div");return s.style[t]=n,s.style[t]==n&&n}function w(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[],r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=arguments[4];if(e&&1<e.length)return i?[].concat(p(o),p(e)):[].concat(p(e),p(o));var n=function(t){if(!t||1<t.length)return{};var e=!!(t=t[0]?t[0]:t).componentOptions,o=void 0,r=void 0;r=e?(o=t.componentOptions.children||[],t.componentOptions.tag):(o=t.children||[],t.tag);return{isComponent:e,ch:o,tag:r}}(e=e[0]),s=n.ch,a=n.tag;return n.isComponent&&(e.data=f({attrs:e.componentOptions.propsData},e.data,!1,!0)),s=i?[].concat(p(o),p(s)):[].concat(p(s),p(o)),delete e.data.slot,t(a,f(r,e.data,!1,!0),s)}function S(t){var e=t.$parent;return!e._isVuescrollRoot&&e&&(e=e.$parent),e}var B=function(t){return Array.isArray(t)},O=function(t){return"[object Object]"==Object.prototype.toString.call(t)},z=function(t){return void 0===t};function E(t,e){var o=void 0;return o=(o=/(-?\d+(?:\.\d+?)?)%$/.exec(t))?e*(o=o[1]-0)/100:t-0}function P(){!function(t,e){if(!l()&&!document.getElementById(t)){var o=document.head||doc.getElementsByTagName("head")[0],r=document.createElement("style");r.id=t,r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),o.appendChild(r)}}("vuescroll-hide-ios-bar",".__hidebar::-webkit-scrollbar {\n      width: 0;\n      height: 0;\n    }")}var r={mounted:function(){i[this._uid]=this},beforeDestroy:function(){delete i[this._uid]},methods:{scrollTo:function(t,e,o){var r=t.x,i=t.y;!0!==e&&void 0!==e||(e=this.mergedOptions.scrollPanel.speed),this.internalScrollTo(r,i,e,o)},scrollBy:function(t,e,o){var r=t.dx,i=void 0===r?0:r,n=t.dy,s=void 0===n?0:n,a=this.getPosition(),l=a.scrollLeft,c=void 0===l?0:l,u=a.scrollTop,h=void 0===u?0:u;i&&(c+=E(i,this.scrollPanelElm.scrollWidth-this.$el.clientWidth)),s&&(h+=E(s,this.scrollPanelElm.scrollHeight-this.$el.clientHeight)),this.internalScrollTo(c,h,e,o)},scrollIntoView:function(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.$el;if("string"==typeof t&&(t=o.querySelector(t)),m(t,o)){var r=this.$el.getBoundingClientRect(),i=r.left,n=r.top,s=t.getBoundingClientRect(),a=i-s.left,l=n-s.top;this.scrollBy({dx:-a,dy:-l},e)}else g("The element or selector you passed is not the element of Vuescroll, please pass the element that is in Vuescroll to scrollIntoView API. ")},refresh:function(){this.refreshInternalStatus(),this.$nextTick(this.refreshInternalStatus)}}},i={};var C={vuescroll:{sizeStrategy:"percent",detectResize:!0},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0,verticalNativeBarPos:"right"},rail:{background:"#01a99a",opacity:0,border:"none",size:"6px",specifyBorderRadius:!1,gutterOfEnds:null,gutterOfSide:"2px",keepShow:!1},bar:{showDelay:500,specifyBorderRadius:!1,onlyShowBarOnScroll:!0,keepShow:!1,background:"rgb(3, 185, 118)",opacity:1,size:"6px",minSize:0,disable:!1},scrollButton:{enable:!1,background:"rgb(3, 185, 118)",opacity:1,step:180,mousedownStep:30}};var T=null,x=["mergedOptions.vuescroll.pullRefresh.tips","mergedOptions.vuescroll.pushLoad.tips","mergedOptions.vuescroll.scroller.disable","mergedOptions.rail","mergedOptions.bar"];function k(t,e){return function(t,e){if(t.hasResized)return;var o="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",r=document.createElement("div");r.style.cssText=o;var i=document.createElement("object");i.style.cssText=o,i.type="text/html",i.tabIndex=-1,i.onload=function(){y(i.contentDocument.defaultView,"resize",e)},s()||(i.data="about:blank");r.isResizeElm=!0,r.appendChild(i),t.appendChild(r),s()&&(i.data="about:blank");return function(){i.contentDocument&&y(i.contentDocument.defaultView,"resize",e,"off"),t.removeChild(r),t.hasResized=!1}}(t,e)}var D={vertical:{size:"height",opsSize:"width",posName:"top",opposName:"bottom",sidePosName:"right",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY",axis:"Y",scrollButton:{start:"top",end:"bottom"}},horizontal:{size:"width",opsSize:"height",posName:"left",opposName:"right",sidePosName:"bottom",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX",axis:"X",scrollButton:{start:"left",end:"right"}}};function R(t){var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame,e=!!o;if(o&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(o.toString())&&(e=!1),e)return function(t,e){o(t,e)};var r={},i=1,n=null,s=+new Date;return function(t){var e=i++;return r[e]=t,null===n&&(n=setInterval(function(){var t=+new Date,e=r;for(var o in r={},e)e.hasOwnProperty(o)&&(e[o](t),s=t);2500<t-s&&(clearInterval(n),n=null)},1e3/60)),e}}var $={},N=/rgb\(/,H=/rgb\((.*)\)/;function A(t,e){var o=t+"&"+e;if($[o])return $[o];var r=document.createElement("div");r.style.background=t,document.body.appendChild(r);var i=window.getComputedStyle(r).backgroundColor;return document.body.removeChild(r),N.test(i)?$[o]="rgba("+H.exec(i)[1]+", "+e+")":t}var M={name:"bar",props:{ops:Object,state:Object,hideBar:Boolean,otherBarHide:Boolean,type:String},computed:{bar:function(){return D[this.type]},barSize:function(){return Math.max(this.state.size,this.ops.bar.minSize)},barRatio:function(){return(1-this.barSize)/(1-this.state.size)}},render:function(t){var e,o,r,i=this,n=A(i.ops.rail.background,i.ops.rail.opacity);this.touchManager||(this.touchManager=new v);var s=i.ops.rail.size,a=i.otherBarHide?0:s,l={class:"__rail-is-"+i.type,style:(e={position:"absolute","z-index":"1",borderRadius:i.ops.rail.specifyBorderRadius||s,background:n,border:i.ops.rail.border},b(e,i.bar.opsSize,s),b(e,i.bar.posName,i.ops.rail.gutterOfEnds||0),b(e,i.bar.opposName,i.ops.rail.gutterOfEnds||a),b(e,i.bar.sidePosName,i.ops.rail.gutterOfSide),e)},c=i.ops.scrollButton.enable?s:0,u={class:"__bar-wrap-is-"+i.type,style:(o={position:"absolute",borderRadius:i.ops.rail.specifyBorderRadius||s},b(o,i.bar.posName,c),b(o,i.bar.opposName,c),o),on:{}},h=i.state.posValue*i.state.size*i.barRatio/i.barSize,d=i.state.opacity;S(this).setClassHook("vertical"==this.type?"vBarVisible":"hBarVisible",!!d);var p={style:(b(r={cursor:"pointer",position:"absolute",margin:"auto",transition:"opacity 0.5s","user-select":"none","border-radius":"inherit"},i.bar.size,100*i.barSize+"%"),b(r,"background",i.ops.bar.background),b(r,i.bar.opsSize,i.ops.bar.size),b(r,"opacity",d),b(r,"transform","translate"+D[i.type].axis+"("+h+"%)"),r),class:"__bar-is-"+i.type,ref:"thumb",on:{}};"vertical"==i.type?(u.style.width="100%",p.style.left=0,p.style.right=0):(u.style.height="100%",p.style.top=0,p.style.bottom=0);var f=this.touchManager.getTouchObject();return p.on[f.touchstart]=this.createBarEvent(),u.on[f.touchstart]=this.createTrackEvent(),t("div",l,[this.createScrollbarButton(t,"start"),this.hideBar?null:t("div",u,[t("div",p)]),this.createScrollbarButton(t,"end")])},data:function(){return{isBarDragging:!1}},methods:{setBarDrag:function(t){this.$emit("setBarDrag",this.isBarDragging=t),S(this).setClassHook("vertical"==this.type?"vBarDragging":"hBarDragging",!!t)},createBarEvent:function(){var n=this,s=S(n),o=n.touchManager.getTouchObject();function r(t){if(n.axisStartPos){var e=n.touchManager.getEventObject(t);if(e){e=e[0];var o=n.$refs.thumb.parentNode,r=e[n.bar.client]-o.getBoundingClientRect()[n.bar.posName],i=((r/=n.barRatio)-n.axisStartPos)/o[n.bar.offset];s.scrollTo(b({},n.bar.axis.toLowerCase(),s.scrollPanelElm[n.bar.scrollSize]*i),!1)}}}function i(){n.setBarDrag(!1),s.hideBar(),document.onselectstart=null,n.axisStartPos=0,y(document,o.touchmove,r,!1,"off"),y(document,o.touchend,i,!1,"off")}return function(t){var e=n.touchManager.getEventObject(t);e&&(t.stopImmediatePropagation(),t.preventDefault(),e=e[0],document.onselectstart=function(){return!1},n.axisStartPos=e[n.bar.client]-n.$refs.thumb.getBoundingClientRect()[n.bar.posName],n.setBarDrag(!0),y(document,o.touchmove,r),y(document,o.touchend,i))}},createTrackEvent:function(){var u=this;return function(t){var e=S(u),o=u.bar,r=o.client,i=o.offset,n=o.posName,s=o.axis,a=u.$refs.thumb;if(t.preventDefault(),t.stopImmediatePropagation(),a){var l=a[i],c=(u.touchManager.getEventObject(t)[0][r]-t.currentTarget.getBoundingClientRect()[n]-l/2)/(t.currentTarget[i]-l);e.scrollTo(b({},s.toLowerCase(),100*c+"%"))}}},createScrollbarButton:function(t,e){var o,r=this;if(!r.ops.scrollButton.enable)return null;var i=r.ops.rail.size,n=r.ops.scrollButton,s=n.opacity,a=A(n.background,s),l={class:["__bar-button","__bar-button-is-"+r.type+"-"+e],style:(o={},b(o,r.bar.scrollButton[e],0),b(o,"width",i),b(o,"height",i),b(o,"position","absolute"),b(o,"cursor","pointer"),b(o,"display","table"),o),ref:e},c={class:"__bar-button-inner",style:{border:"calc("+i+" / 2.5) solid transparent",width:"0",height:"0",margin:"auto",position:"absolute",top:"0",bottom:"0",right:"0",left:"0"},on:{}};"vertical"==r.type?c.style.transform="start"==e?(c.style["border-bottom-color"]=a,"translateY(-25%)"):(c.style["border-top-color"]=a,"translateY(25%)"):c.style.transform="start"==e?(c.style["border-right-color"]=a,"translateX(-25%)"):(c.style["border-left-color"]=a,"translateX(25%)");var u=this.touchManager.getTouchObject();return c.on[u.touchstart]=this.createScrollButtonEvent(e,u),t("div",l,[t("div",c)])},createScrollButtonEvent:function(o,r){var i=this,n=S(i),t=i.ops.scrollButton,e=t.step,s=t.mousedownStep,a="start"==o?-e:e,l="start"==o?-s:s,c=R(window),u=i.type,h=!1,d=!0,p=void 0;function f(){h&&!d&&(n.scrollBy(b({},"d"+i.bar.axis.toLowerCase(),l),!1),c(f,window))}function v(){if(clearTimeout(p),h=!1,y(document,r.touchend,v,!1,"off"),"mousedown"==r.touchstart){var t=i.$refs[o];y(t,"mouseenter",m,!1,"off"),y(t,"mouseleave",g,!1,"off")}n.setClassHook("cliking"+u+o+"Button",!1)}function m(){d=!1,f()}function g(){d=!0}return function(t){if(3!=t.which){if(n.setClassHook("cliking"+u+o+"Button",!0),t.stopImmediatePropagation(),t.preventDefault(),d=!1,n.scrollBy(b({},"d"+i.bar.axis.toLowerCase(),a)),y(document,r.touchend,v,!1),"mousedown"==r.touchstart){var e=i.$refs[o];y(e,"mouseenter",m,!1),y(e,"mouseleave",g,!1)}clearTimeout(p),p=setTimeout(function(){h=!0,c(f,window)},500)}}}}};function V(t,e){var o=D[e].axis,r=e.charAt(0)+"Bar",i=!t.bar[r].state.size||!t.mergedOptions.scrollPanel["scrolling"+o]||t.refreshLoad&&"vertical"!==e||t.mergedOptions.bar.disable,n=t.mergedOptions.rail.keepShow;return i&&!n?null:{hideBar:i,props:{type:e,ops:{bar:t.mergedOptions.bar,rail:t.mergedOptions.rail,scrollButton:t.mergedOptions.scrollButton},state:t.bar[r].state,hideBar:i},on:{setBarDrag:t.setBarDrag},ref:e+"Bar",key:e}}var I=function(t){var h=t.render,e=t.components,o=t.mixins;return{name:"vueScroll",props:{ops:{type:Object}},components:e,mixins:[r].concat(p([].concat(o))),created:function(){var e,o,t,r,i,n,s,a,l,c,u,h=this,d=f(this.$vuescrollConfig||{},{}),p=f(C,d);this.$options.propsData.ops=this.$options.propsData.ops||{},Object.keys(this.$options.propsData.ops).forEach(function(t){var e,o,r,i;e=h.mergedOptions,o=t,((r=h.$options.propsData.ops)[o]||"function"==typeof r)&&(i=i||o,Object.defineProperty(e,o,{get:function(){return r[i]},configurable:!0}))}),f(p,this.mergedOptions),this._isVuescrollRoot=!0,this.renderError=(e=this.mergedOptions,o=!1,t=e.scrollPanel,r=e.bar,i=r.vBar,n=r.hBar,s=e.rail,a=s.vRail,l=s.hRail,c=t.initialScrollY,u=t.initialScrollX,c&&!String(c).match(/^\d+(\.\d+)?(%)?$/)&&g("The prop `initialScrollY` or `initialScrollX` should be a percent number like `10%` or an exact number that greater than or equal to 0 like `100`."),u&&!String(u).match(/^\d+(\.\d+)?(%)?$/)&&g("The prop `initialScrollY` or `initialScrollX` should be a percent number like `10%` or an exact number that greater than or equal to 0 like `100`."),(i||n||a||l)&&g("The options: vRail, hRail, vBar, hBar have been deprecated since v4.7.0,please use corresponing rail/bar instead!"),T&&(T=[].concat(T)).forEach(function(t){t(e)&&(o=!0)}),o)},render:function(t){var e=this;if(e.renderError)return t("div",[[e.$slots.default]]);e.touchManager||(e.touchManager=new v);var o,r={style:{height:e.vuescroll.state.height,width:e.vuescroll.state.width,padding:0,position:"relative",overflow:"hidden"},class:d({__vuescroll:!0},e.classHooks)},i=e.touchManager.getTouchObject();i&&(r.on=(b(o={},i.touchenter,function(){e.vuescroll.state.pointerLeave=!1,e.updateBarStateAndEmitEvent(),e.setClassHook("mouseEnter",!0)}),b(o,i.touchleave,function(){e.vuescroll.state.pointerLeave=!0,e.hideBar(),e.setClassHook("mouseEnter",!1)}),b(o,i.touchmove,function(){e.vuescroll.state.pointerLeave=!1,e.updateBarStateAndEmitEvent()}),o));var n,s,a,l,c=[h(t,e)].concat(p((n=t,a=V(s=e,"vertical"),l=V(s,"horizontal"),s.setClassHook("hasVBar",!(!a||a.hideBar)),s.setClassHook("hasHBar",!(!l||l.hideBar)),[a?n("bar",d({},a,{props:d({otherBarHide:!l},a.props)})):null,l?n("bar",d({},l,{props:d({otherBarHide:!a},l.props)})):null]))),u=this.$slots["scroll-container"];return u?w(t,u,c,r):t("div",r,[c])},mounted:function(){var t=this;this.renderError||(this.initVariables(),this.initWatchOpsChange(),this.refreshInternalStatus(),this.updatedCbs.push(function(){t.scrollToAnchor(),t.updateBarStateAndEmitEvent()}))},updated:function(){var e=this;this.updatedCbs.forEach(function(t){t.call(e)}),this.updatedCbs=[]},beforeDestroy:function(){this.destroyParentDomResize&&(this.destroyParentDomResize(),this.destroyParentDomResize=null),this.destroy&&this.destroy()},computed:{scrollPanelElm:function(){return this.$refs.scrollPanel._isVue?this.$refs.scrollPanel.$el:this.$refs.scrollPanel}},data:function(){return{vuescroll:{state:{isDragging:!1,pointerLeave:!0,height:"100%",width:"100%",currentSizeStrategy:"percent"}},bar:{vBar:{state:{posValue:0,size:0,opacity:0}},hBar:{state:{posValue:0,size:0,opacity:0}}},mergedOptions:{vuescroll:{},scrollPanel:{},scrollContent:{},rail:{},bar:{}},updatedCbs:[],renderError:!1,classHooks:{hasVBar:!1,hasHBar:!1,vBarVisible:!1,hBarVisible:!1,vBarDragging:!1,hBarDragging:!1,clikingVerticalStartButton:!1,clikingVerticalEndButton:!1,clikingHorizontalStartButton:!1,clikingHorizontalEndButton:!1,mouseEnter:!1}}},methods:{scrollingComplete:function(){this.updateBarStateAndEmitEvent("handle-scroll-complete")},setBarDrag:function(t){this.vuescroll.state.isDragging=t},setClassHook:function(t,e){this.classHooks[t]=e},showAndDefferedHideBar:function(t){var e=this;this.showBar(),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0),this.timeoutId=setTimeout(function(){e.timeoutId=0,e.hideBar(t)},this.mergedOptions.bar.showDelay)},showBar:function(){var t=this.mergedOptions.bar.opacity;this.bar.vBar.state.opacity=t,this.bar.hBar.state.opacity=t},hideBar:function(t){this.vuescroll.state.isDragging||(t&&!this.mergedOptions.bar.keepShow&&(this.bar.hBar.state.opacity=0,this.bar.vBar.state.opacity=0),this.mergedOptions.bar.keepShow||this.vuescroll.state.isDragging||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0,this.bar.hBar.state.opacity=0))},useNumbericSize:function(){var e=this;this.usePercentSize(),setTimeout(function(){e.vuescroll.state.currentSizeStrategy="number";var t=e.$el.parentNode||e.$el;e.vuescroll.state.height=t.offsetHeight+"px",e.vuescroll.state.width=t.offsetWidth+"px",e.updateBarStateAndEmitEvent("handle-resize")},0)},usePercentSize:function(){this.vuescroll.state.currentSizeStrategy="percent",this.vuescroll.state.height="100%",this.vuescroll.state.width="100%"},setVsSize:function(){this.destroyParentDomResize&&(this.destroyParentDomResize(),this.destroyParentDomResize=null),"number"==this.mergedOptions.vuescroll.sizeStrategy?(this.useNumbericSize(),this.registryParentResize()):"percent"==this.mergedOptions.vuescroll.sizeStrategy&&this.usePercentSize()},initWatchOpsChange:function(){var e=this,o={deep:!0,sync:!0};this.$watch("mergedOptions",function(){setTimeout(function(){if(e.isSmallChangeThisTick)return e.isSmallChangeThisTick=!1,void e.updateBarStateAndEmitEvent("options-change");e.refreshInternalStatus()},0)},o),x.forEach(function(t){e.$watch(t,function(){e.isSmallChangeThisTick=!0},o)})},scrollToAnchor:function(){var t=window.location.hash;if(t&&(!(t=t.slice(t.lastIndexOf("#")))||/^#[a-zA-Z_]\d*$/.test(t))){var e=document.querySelector(t);!m(e,this.$el)||this.mergedOptions.scrollPanel.initialScrollY||this.mergedOptions.scrollPanel.initialScrollX||this.scrollIntoView(e)}},registryParentResize:function(){var t=this.mergedOptions.vuescroll.detectResize;this.destroyParentDomResize=t?k(this.$el.parentNode,this.useNumbericSize):function(){}}}}},_={name:"scrollPanel",props:{ops:{type:Object,required:!0}},methods:{updateInitialScroll:function(){var t=0,e=0,o=S(this);this.ops.initialScrollX&&(t=this.ops.initialScrollX),this.ops.initialScrollY&&(e=this.ops.initialScrollY),(t||e)&&o.scrollTo({x:t,y:e})}},mounted:function(){var t=this;setTimeout(function(){t._isDestroyed||t.updateInitialScroll()},0)},render:function(t){var e={class:["__panel"],style:{position:"relative",boxSizing:"border-box"}},o=S(this).$slots["scroll-panel"];return o?w(t,o,this.$slots.default,e):t("div",e,[[this.$slots.default]])}};function L(e,o){return function(t){return o(e,t)}}function j(t,e){var o=null;return"easeInQuad"===t&&(o=e*e),"easeOutQuad"===t&&(o=e*(2-e)),"easeInOutQuad"===t&&(o=e<.5?2*e*e:(4-2*e)*e-1),"easeInCubic"===t&&(o=e*e*e),"easeOutCubic"===t&&(o=--e*e*e+1),"easeInOutCubic"===t&&(o=e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1),"easeInQuart"===t&&(o=e*e*e*e),"easeOutQuart"===t&&(o=1- --e*e*e*e),"easeInOutQuart"===t&&(o=e<.5?8*e*e*e*e:1-8*--e*e*e*e),"easeInQuint"===t&&(o=e*e*e*e*e),"easeOutQuint"===t&&(o=1+--e*e*e*e*e),"easeInOutQuint"===t&&(o=e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e),o||e}function X(){return!0}var Y=Date.now||function(){return(new Date).getTime()},W=function(){function t(){e(this,t),this.init(),this.isRunning=!1}return o(t,[{key:"startScroll",value:function(t,e,o){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:X,i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:X,n=5<arguments.length&&void 0!==arguments[5]?arguments[5]:X,s=6<arguments.length&&void 0!==arguments[6]?arguments[6]:X,a=e-t,l=0<a?-1:1,c=Y();this.isRunning||this.init(),l!=this.dir||200<c-this.ts?(this.ts=c,this.dir=l,this.st=t,this.ed=e,this.df=a):this.df+=a,this.spd=o,this.completeCb=i,this.vertifyCb=n,this.stepCb=r,this.easingMethod=s,this.ref=R(window),this.isRunning||this.execScroll()}},{key:"execScroll",value:function(){var o=this,r=0;this.isRunning=!0;this.ref(function t(){if(o.isRunning&&o.vertifyCb(r))if((r=(Y()-o.ts)/o.spd)<1){var e=o.st+o.df*o.easingMethod(r);o.stepCb(e),o.ref(t)}else o.stepCb(o.st+o.df),o.completeCb(),o.isRunning=!1;else o.isRunning=!1})}},{key:"init",value:function(){this.st=0,this.ed=0,this.df=0,this.spd=0,this.ts=0,this.dir=0}}]),t}();function q(t){var e={ref:"scrollPanel",style:{height:"100%",overflowY:"scroll",overflowX:"scroll"},class:[],nativeOn:{"&scroll":t.handleScroll},props:{ops:t.mergedOptions.scrollPanel}};t.scrollYEnable=!0,t.scrollXEnable=!0,e.nativeOn.DOMMouseScroll=e.nativeOn.mousewheel=t.onMouseWheel;var o=t.mergedOptions.scrollPanel,r=o.scrollingY,i=o.scrollingX;t.bar.hBar.state.size&&i||(t.scrollXEnable=!1,e.style.overflowX="hidden"),t.bar.vBar.state.size&&r||(t.scrollYEnable=!1,e.style.overflowY="hidden");var n=function(){if(l())return 0;if(void 0!==u)return u;var t=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);var e=t.offsetWidth;t.style.overflow="scroll";var o=document.createElement("div");o.style.width="100%",t.appendChild(o);var r=o.offsetWidth;return t.parentNode.removeChild(t),u=e-r}();return n?(t.bar.vBar.state.size&&t.mergedOptions.scrollPanel.scrollingY&&("right"==t.mergedOptions.scrollPanel.verticalNativeBarPos?e.style.marginRight="-"+n+"px":e.style.marginLeft="-"+n+"px"),t.bar.hBar.state.size&&t.mergedOptions.scrollPanel.scrollingX&&(e.style.height="calc(100% + "+n+"px)")):(P(),e.class.push("__hidebar"),a()&&(e.style["-webkit-overflow-scrolling"]="touch")),e.style.transformOrigin="",e.style.transform="",e}var Q=function(t,e){var o,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:[],n=(b(o={},_.name,_),b(o,M.name,M),o),s={};s.components=n,s.render=e,s.mixins=t;var a,l=I(s);return a=i,[].concat(r).forEach(function(t){f(t,C)}),T=a,l}({mixins:[{mounted:function(){this.scrollX=new W,this.scrollY=new W},methods:{nativeScrollTo:function(t,e,o,r){!1===o||void 0===o&&(o=this.mergedOptions.scrollPanel.speed);var i=this.scrollPanelElm,n=i.scrollTop,s=i.scrollLeft,a=i.scrollWidth,l=i.clientWidth,c=i.scrollHeight,u=i.clientHeight;if(t=void 0===t?s:E(t,a-l),e=void 0===e?n:E(e,c-u),o){var h=L(r=r||this.mergedOptions.scrollPanel.easing,j);t!=s&&this.scrollX.startScroll(s,t,o,function(t){i.scrollLeft=t},this.scrollingComplete.bind(this),void 0,h),e!=n&&this.scrollY.startScroll(n,e,o,function(t){i.scrollTop=t},this.scrollingComplete.bind(this),void 0,h)}else i.scrollTop=e,i.scrollLeft=t},getCurrentviewDomNative:function(){return function(t,e){for(var o,r,i,n,s,a,l,c,u,h,d=t.children,p=[],f=0;f<d.length;f++){var v=d.item(f);o=v.getBoundingClientRect(),r=o.left,i=o.top,n=o.width,s=o.height,a=e.getBoundingClientRect(),l=a.left,c=a.top,u=a.height,h=a.width,0<r-l+n&&r-l<h&&0<i-c+s&&i-c<u&&!v.isResizeElm&&p.push(v)}return p}(this.scrollContentElm,this.$el)}}},{methods:{updateNativeModeBarState:function(){var t=this.scrollPanelElm,e="percent"==this.vuescroll.state.currentSizeStrategy,o=e?t.clientWidth:this.vuescroll.state.width.slice(0,-2),r=e?t.clientHeight:this.vuescroll.state.height.slice(0,-2),i=r/t.scrollHeight,n=o/t.scrollWidth;this.bar.vBar.state.posValue=100*t.scrollTop/r,this.bar.hBar.state.posValue=100*t.scrollLeft/o,this.bar.vBar.state.size=i<1?i:0,this.bar.hBar.state.size=n<1?n:0},getNativePosition:function(){return{scrollTop:this.scrollPanelElm.scrollTop,scrollLeft:this.scrollPanelElm.scrollLeft}},css:function(t,e){return window.getComputedStyle(t)[e]},checkScrollable:function(t,e,o){for(var r=!1,i=t.target?t.target:t;i&&1==i.nodeType&&i!==this.scrollPanelElm.parentNode&&!/^BODY|HTML/.test(i.nodeName);){var n=this.css(i,"overflowY")||this.css(i,"overflowX")||this.css(i,"overflow")||"";if(/scroll|auto/.test(n)){var s=this.getScrollProcess(i),a=s.v,l=s.h;if("dx"==e&&(o<0&&0<l||0<o&&l<1)||"dy"==e&&(o<0&&0<a||0<o&&a<1)){r=i==this.scrollPanelElm;break}}i=!!i.parentNode&&i.parentNode}return r},onMouseWheel:function(t){var e=this.mergedOptions.vuescroll.wheelScrollDuration,o=this.mergedOptions.vuescroll.wheelDirectionReverse,r=0,i=void 0;t.wheelDelta?t.deltaY?(i="dy",r=t.deltaY):t.deltaX?(r=t.deltaX,i="dx"):r=-1*t.wheelDelta/2:t.detail&&(1==t.axis?i="dx":2==t.axis&&(i="dy"),r=16*t.detail),i=t.shiftKey?"dx":"dy",o&&(i="dx"==i?"dy":"dx"),this.checkScrollable(t,i,r)&&(t.stopPropagation(),t.preventDefault(),this.scrollBy(b({},i,r),e))}},computed:{scrollContentElm:function(){return this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent}}}],methods:{destroy:function(){this.destroyResize&&this.destroyResize()},getCurrentviewDom:function(){return this.getCurrentviewDomNative()},internalScrollTo:function(t,e,o,r){this.nativeScrollTo(t,e,o,r)},handleScroll:function(t){this.updateBarStateAndEmitEvent("handle-scroll",t)},updateBarStateAndEmitEvent:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;this.updateNativeModeBarState(),t&&this.emitEvent(t,e),this.mergedOptions.bar.onlyShowBarOnScroll?"handle-scroll"!=t&&"handle-resize"!=t&&"refresh-status"!=t&&"window-resize"!=t&&"options-change"!=t||this.showAndDefferedHideBar(!0):this.showAndDefferedHideBar()},getScrollProcess:function(t){var e=t||this.scrollPanelElm,o=e.scrollHeight,r=e.scrollWidth,i=e.clientHeight,n=e.clientWidth,s=e.scrollTop,a=e.scrollLeft;return{v:Math.min(s/(o-i||1),1),h:Math.min(a/(r-n||1),1)}},emitEvent:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,o=this.scrollPanelElm,r=o.scrollTop,i=o.scrollLeft,n={type:"vertical"},s={type:"horizontal"},a=this.getScrollProcess(),l=a.v,c=a.h;n.process=l,s.process=c,n.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,n.scrollTop=r,s.scrollLeft=i,this.$emit(t,n,s,e)},initVariables:function(){this.$el._isVuescroll=!0},refreshInternalStatus:function(){this.setVsSize(),this.registryResize(),this.updateBarStateAndEmitEvent("refresh-status")},registryResize:function(){var e=this,t=this.mergedOptions.vuescroll.detectResize;if((!this.destroyResize||!t)&&(this.destroyResize&&this.destroyResize(),t)){var o=this.scrollContentElm,r=this,i=function(){r.updateBarStateAndEmitEvent("window-resize")};window.addEventListener("resize",i,!1);var n=k(o,function(){var t={};t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight,e.updateBarStateAndEmitEvent("handle-resize",t)});this.destroyResize=function(){window.removeEventListener("resize",i,!1),n(),e.destroyResize=null}}},getPosition:function(){return this.getNativePosition()}}},function(t,e){return t("scrollPanel",q(e),[(o=t,r=e,i={position:"relative","box-sizing":"border-box","min-width":"100%","min-height":"100%"},n={style:i,ref:"scrollContent",class:"__view"},s=r.$slots["scroll-content"],r.mergedOptions.scrollPanel.scrollingX?i.width=h("width","fit-content"):n.style.width="100%",r.mergedOptions.scrollPanel.padding&&(n.style.paddingRight=r.mergedOptions.rail.size),s?w(o,s,r.$slots.default,n):o("div",n,[r.$slots.default]))]);var o,r,i,n,s},[{vuescroll:{wheelScrollDuration:0,wheelDirectionReverse:!1}}]);var F=d({install:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};t.component(e.name||Q.name,Q),t.prototype.$vuescrollConfig=e.ops||{}},version:"4.14.4",refreshAll:function(){for(var t in i)i[t].refresh()},scrollTo:function(e,t,o){var r,i,n,s,a,l,c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:300,u=arguments[4],h=arguments[5],d=e.nodeType,p=new W,f=new W;if(d){9==d&&(e=e.scrollingElement);var v=e;r=v.scrollLeft,i=v.scrollTop,n=v.scrollHeight,s=v.scrollWidth,a=v.clientWidth,l=v.clientHeight,t=void 0===t?r:E(t,s-a),o=void 0===o?i:E(o,n-l);var m=L(u,j);p.startScroll(r,t,c,function(t){e.scrollLeft=t},h,void 0,m),f.startScroll(i,o,c,function(t){e.scrollTop=t},h,void 0,m)}else g("You must pass a dom for the first param, for window scrolling, you can pass document as the first param.")}},Q);return"undefined"!=typeof window&&window.Vue&&window.Vue.use(F),F});
  