!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e=e||self).vuescroll=t(e.Vue)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e};function i(e,t){for(var o=0;o container's height!");else S("refresh must be enabled!")}else S("You can only use triggerRefreshOrLoad in slide mode!")},getCurrentviewDomSlide:function(){return G(this.scrollPanelElm,this.$el)}}},{mounted:function(){this.scrollX=new ie,this.scrollY=new ie},methods:{nativeStop:function(){this.scrollX.stop(),this.scrollY.stop()},nativePause:function(){this.scrollX.pause(),this.scrollY.pause()},nativeContinue:function(){this.scrollX.continue(),this.scrollY.continue()},nativeScrollTo:function(e,t,o,i){!1===o||void 0===o&&(o=this.mergedOptions.scrollPanel.speed);var r=this.scrollPanelElm,n=r.scrollTop,l=r.scrollLeft,s=r.scrollWidth,a=r.clientWidth,c=r.scrollHeight,h=r.clientHeight;if(e=void 0===e?l:k(e,s-a),t=void 0===t?n:k(t,c-h),o){var u=J(i=i||this.mergedOptions.scrollPanel.easing,ee);e!=l&&this.scrollX.startScroll(l,e,o,function(e){r.scrollLeft=e},this.scrollingComplete.bind(this),void 0,u),t!=n&&this.scrollY.startScroll(n,t,o,function(e){r.scrollTop=e},this.scrollingComplete.bind(this),void 0,u)}else r.scrollTop=t,r.scrollLeft=e},getCurrentviewDomNative:function(){return G(this.scrollContentElm,this.$el)}}}],methods:{internalScrollTo:function(e,t,o,i){"native"==this.mode?this.nativeScrollTo(e,t,o,i):"slide"==this.mode&&this.slideScrollTo(e,t,o,i)},stop:function(){this.nativeStop()},pause:function(){this.nativePause()},continue:function(){this.nativeContinue()},getCurrentviewDom:function(){return"slide"==this.mode?this.getCurrentviewDomSlide():this.getCurrentviewDomNative()}}},ue=Date.now||function(){return+new Date},de={},_e=1,fe={effect:{}},pe=null;pe="undefined"!=typeof window?window:{},fe.effect.Animate={requestAnimationFrame:N(pe),stop:function(e){var t=null!=de[e];return t&&(de[e]=null),t},isRunning:function(e){return null!=de[e]},start:function(s,a,c,h,u,d){var _=ue(),f=_,p=0,v=0,m=_e++;if(d=d||document.body,m%20==0){var e={};for(var t in de)e[t]=!0;de=e}return de[m]=!0,fe.effect.Animate.requestAnimationFrame(function e(t){var o=!0!==t,i=ue();if(!de[m]||a&&!a(m))return de[m]=null,void(c&&c(60-v/((i-_)/1e3),m,!1));if(o)for(var r=Math.round((i-f)/(1e3/60))-1,n=0;nn.__maxScrollLeft?s=n.__maxScrollLeft:s<0&&(s=0),a>n.__maxScrollTop?a=n.__maxScrollTop:a<0&&(a=0),n.__publish(s,a,e,t)},zoomBy:function(e,t,o,i,r){this.zoomTo(this.__zoomLevel*e,t,o,i,r)},scrollTo:function(e,t,o,i,r,n,l){var s=this;if(s.__isDecelerating&&(fe.effect.Animate.stop(s.__isDecelerating),s.__isDecelerating=!1),null!=i&&i!==s.__zoomLevel){if(!s.options.zooming)throw new Error("Zooming is not enabled!");e*=i,t*=i,s.__computeScrollMax(i)}else i=s.__zoomLevel;s.options.scrollingX||r?s.options.paging?e=Math.round(e/s.__clientWidth)*s.__clientWidth:s.options.snapping&&(e=Math.round(e/s.__snapWidth)*s.__snapWidth):e=s.__scrollLeft,s.options.scrollingY||r?s.options.paging?t=Math.round(t/s.__clientHeight)*s.__clientHeight:s.options.snapping&&(t=Math.round(t/s.__snapHeight)*s.__snapHeight):t=s.__scrollTop,r||(e=Math.max(Math.min(s.__maxScrollLeft,e),0),t=Math.max(Math.min(s.__maxScrollTop,t),0)),e===s.__scrollLeft&&t===s.__scrollTop&&(o=!1),s.__isTracking||s.__publish(e,t,i,o,n,l)},scrollBy:function(e,t,o){var i=this,r=i.__isAnimating?i.__scheduledLeft:i.__scrollLeft,n=i.__isAnimating?i.__scheduledTop:i.__scrollTop;i.scrollTo(r+(e||0),n+(t||0),o)},getCurrentPage:function(){return this.__computePage(),{x:this.__currentPageX,y:this.__currentPageY}},goToPage:function(e,t){var o=e.x,i=e.y;isNaN(o)&&(o=1),isNaN(i)&&(i=1),this.scrollTo((o-1)*this.__clientWidth,(i-1)*this.__clientHeight,t)},doMouseZoom:function(e,t,o,i){var r=0-i.__refreshHeight?(i.__refreshActive=!1,i.__refreshDeactivate&&i.__refreshDeactivate()):!i.__loadActive&&h>=i.__maxScrollTop+i.__loadHeight&&0t.__lastTouchMove-100;n-=3)r=n;if(r!==i){var l=o[i]-o[r],s=t.__scrollLeft-o[r-2],a=t.__scrollTop-o[r-1];t.__decelerationVelocityX=s/l*(1e3/60),t.__decelerationVelocityY=a/l*(1e3/60);var c=t.options.paging||t.options.snapping?4:1;Math.abs(t.__decelerationVelocityX)>c||Math.abs(t.__decelerationVelocityY)>c?t.__refreshActive||t.__loadActive||t.__startDeceleration(e):t.__scrollComplete()}else t.__scrollComplete()}else 100=n||Math.abs(i.__decelerationVelocityY)>=n;return e||(i.__didDecelerationComplete=!0),e},function(){i.__isDecelerating&&(i.__isDecelerating=!1,i.__didDecelerationComplete&&i.__scrollComplete(),i.scrollTo(i.__scrollLeft,i.__scrollTop,i.options.snapping))})},__stepThroughDeceleration:function(e){var t=this,o=t.options.bouncing,i=t.__minDecelerationScrollLeft,r=t.__maxDecelerationScrollLeft,n=t.__minDecelerationScrollTop,l=t.__maxDecelerationScrollTop,s=t.__scrollLeft+t.__decelerationVelocityX,a=t.__scrollTop+t.__decelerationVelocityY,c=st.__maxDecelerationScrollLeft&&(_=t.__maxDecelerationScrollLeft-s)),h&&(at.__maxDecelerationScrollTop&&(f=t.__maxDecelerationScrollTop-a)),0!==_&&(_*t.__decelerationVelocityX<=0?(t.__decelerationVelocityX+=_*p,_<0&&-_>=o.right&&0=o.left&&t.__decelerationVelocityX<0&&(t.__decelerationVelocityX=o.left/2)):t.__decelerationVelocityX=_*v),0!==f&&(f*t.__decelerationVelocityY<=0?(t.__decelerationVelocityY+=f*p,f<0&&-f>=o.bottom&&0=o.top&&t.__decelerationVelocityY<0&&(t.__decelerationVelocityY=o.top/2)):t.__decelerationVelocityY=f*v/2)}};for(var Se in be)ge.prototype[Se]=be[Se];var ye=new m;P("vuescroll-silde-mode-style","\n @-webkit-keyframes loading-rotate {\n to {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n }\n }\n\n @keyframes loading-rotate {\n to {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n }\n }\n\n @-webkit-keyframes loading-wipe {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -40px;\n }\n to {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -120px;\n }\n }\n\n @keyframes loading-wipe {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -40px;\n }\n to {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -120px;\n }\n }\n\n .__vuescroll .__refresh,\n .__vuescroll .__load {\n position: absolute;\n width: 100%;\n color: black;\n height: 50px;\n line-height: 50px;\n text-align: center;\n font-size: 16px;\n }\n .__vuescroll .__refresh svg,\n .__vuescroll .__load svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .__vuescroll .__refresh svg.active,\n .__vuescroll .__load svg.active {\n transition: all 0.2s;\n }\n .__vuescroll .__refresh svg.active.deactive,\n .__vuescroll .__load svg.active.deactive {\n transform: rotateZ(180deg);\n }\n .__vuescroll .__refresh svg path,\n .__vuescroll .__refresh svg rect,\n .__vuescroll .__load svg path,\n .__vuescroll .__load svg rect {\n fill: #20a0ff;\n }\n .__vuescroll .__refresh svg.start,\n .__vuescroll .__load svg.start {\n stroke: #343640;\n stroke-width: 4;\n stroke-linecap: round;\n -webkit-animation: loading-rotate 2s linear infinite;\n animation: loading-rotate 2s linear infinite;\n }\n .__vuescroll .__refresh svg.start .bg-path,\n .__vuescroll .__load svg.start .bg-path {\n stroke: #f2f2f2;\n fill: none;\n }\n .__vuescroll .__refresh svg.start .active-path,\n .__vuescroll .__load svg.start .active-path {\n stroke: #20a0ff;\n fill: none;\n stroke-dasharray: 90, 150;\n stroke-dashoffset: 0;\n -webkit-animation: loading-wipe 1.5s ease-in-out infinite;\n animation: loading-wipe 1.5s ease-in-out infinite;\n }\n ");var we=function(e,t,o,i){var r,n=2i.__maxScrollLeft&&(r=i.__scrollLeft-i.__maxScrollLeft),i.__scrollTop<0?(n=-i.__scrollTop,this.outTheBottomBoundary=!1,this.outTheTopBoundary=!0):i.__scrollTop>i.__maxScrollTop?(n=i.__scrollTop-i.__maxScrollTop,this.outTheTopBoundary=!1,this.outTheBottomBoundary=!0):this.outTheTopBoundary=this.outTheBottomBoundary=!1,e=a/(h+n),t=s/(c+r);var u=Math.min(Math.max(0,i.__scrollTop),i.__maxScrollTop),d=Math.min(Math.max(0,i.__scrollLeft),i.__maxScrollLeft);this.bar.vBar.state.posValue=100*(u+n)/o.clientHeight,this.bar.hBar.state.posValue=100*(d+r)/o.clientWidth,i.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),i.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<1?e:0,this.bar.hBar.state.size=t<1?t:0},registryEvent:function(e){var t,o,i,r,n,l,s,a="refresh"==e?X:Y,c="refresh"==e?this.scroller.activatePullToRefresh:this.scroller.activatePushToLoad,h="refresh"==e?"refreshStage":"loadStage",u=this.$refs[a].elm||this.$refs[a],d=(t=e,o=h,r=u,n=(i=this).$listeners,l=function(){i.vuescroll.state[o]="start",setTimeout(function(){i.scroller.finishRefreshOrLoad()},2e3)},s=void 0,n[t+"-before-deactivate"]&&(s=function(e){i.vuescroll.state[o]="beforeDeactive",i.$emit(t+"-before-deactivate",i,r,e.bind(i.scroller))}),n[t+"-start"]&&(l=function(){i.vuescroll.state[o]="start",i.$emit(t+"-start",i,r,i.scroller.finishRefreshOrLoad.bind(i.scroller))}),{activateCallback:function(){i.vuescroll.state[o]="active",i.$emit(t+"-activate",i,r)},deactivateCallback:function(){i.vuescroll.state[o]="deactive",i.$emit(t+"-deactivate",i,r)},startCallback:l,beforeDeactivateCallback:s,beforeDeactiveEnd:function(){i.vuescroll.state[o]="beforeDeactiveEnd",i.$emit(t+"-before-deactivate-end",i,r)}}),_=u.offsetHeight;c.bind(this.scroller)(_,d)},getSlidePosition:function(){return{scrollLeft:this.scroller.__scrollLeft,scrollTop:this.scroller.__scrollTop}}}},{methods:{updateNativeModeBarState:function(){var e=this.scrollPanelElm,t="percent"==this.vuescroll.state.currentSizeStrategy,o=this.vuescroll.state,i=o.width,r=o.height,n=t||!i?e.clientWidth:i.slice(0,-2),l=t||!r?e.clientHeight:r.slice(0,-2),s=l/e.scrollHeight,a=n/e.scrollWidth;this.bar.vBar.state.posValue=100*e.scrollTop/l,this.bar.hBar.state.posValue=100*e.scrollLeft/n,this.bar.vBar.state.size=s<1?s:0,this.bar.hBar.state.size=a<1?a:0},getNativePosition:function(){return{scrollTop:this.scrollPanelElm.scrollTop,scrollLeft:this.scrollPanelElm.scrollLeft}},css:function(e,t){return window.getComputedStyle(e)[t]},checkScrollable:function(e,t,o){for(var i=!1,r=e.target?e.target:e;r&&1==r.nodeType&&r!==this.scrollPanelElm.parentNode&&!/^BODY|HTML/.test(r.nodeName);){var n=this.css(r,"overflow")||"";if(/scroll|auto/.test(n)){var l=this.getScrollProcess(r),s=l.v,a=l.h,c="hidden"!==this.css(r,"overflowX"),h="hidden"!==this.css(r,"overflowY");if(c&&(t<0&&0Math.abs(e.deltaY)?a=0:s=0)):(s=0,a=-1*e.wheelDelta/2):e.detail&&(a=s=16*e.detail,1==e.axis?a=0:2==e.axis&&(s=0)),r&&e.shiftKey&&(s^=a,s^=a^=s),o&&(s^=a,s^=a^=s),this.checkScrollable(e,s,a)&&(e.stopPropagation(),e.preventDefault(),this.scrollBy({dx:s,dy:a},i))}},computed:{scrollContentElm:function(){return this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent}}}])),mounted:function(){this._isDestroyed||this.renderError||("slide"==this.mode&&this.updatedCbs.push(this.updateScroller),this.$watch("mergedOptions.vuescroll.scroller.disable",{sync:!0,handler:function(e){this.scroller&&(this.scroller.__disable=e)}}))},computed:{mode:function(){return this.mergedOptions.vuescroll.mode}},methods:{destroy:function(){this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),this.destroyResize&&this.destroyResize()},handleScroll:function(e){this.updateBarStateAndEmitEvent("handle-scroll",e)},updateBarStateAndEmitEvent:function(e,t){var o=1