UNPKG

vue-custom-scrollview

Version:

基于 Vue better-scroll的移动端滚动组件,支持自定义上下拉样式

7 lines 66.9 kB
(function(t,i){"object"===typeof exports&&"object"===typeof module?module.exports=i():"function"===typeof define&&define.amd?define([],i):"object"===typeof exports?exports["scroll"]=i():t["scroll"]=i()})("undefined"!==typeof self?self:this,function(){return function(t){var i={};function e(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=i,e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:s})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"===typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var o in t)e.d(s,o,function(i){return t[i]}.bind(null,o));return s},e.n=function(t){var i=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s="9c03")}({"0a82":function(t,i,e){var s=e("170f");"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var o=e("85cb").default;o("244ca892",s,!0,{sourceMap:!1,shadowMode:!1})},"109e":function(t,i,e){"use strict";var s=e("0a82"),o=e.n(s);o.a},"170f":function(t,i,e){i=t.exports=e("690e")(!1),i.push([t.i,".pulldown[data-v-7ca1b9e2]{position:absolute;left:0;top:-60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;height:60px}",""])},"2f7c":function(t,i,e){i=t.exports=e("690e")(!1),i.push([t.i,".pswp__preloader__icn[data-v-ea894aa6]{opacity:.75;width:24px;height:24px;-webkit-animation:clockwise-data-v-ea894aa6 .5s linear infinite;animation:clockwise-data-v-ea894aa6 .5s linear infinite}.pswp__preloader__cut[data-v-ea894aa6]{position:relative;width:12px;height:24px;overflow:hidden;position:absolute;top:0;left:0}.pswp__preloader__donut[data-v-ea894aa6]{-webkit-box-sizing:border-box;box-sizing:border-box;width:24px;height:24px;border:2px solid #000;border-radius:50%;border-left-color:transparent;border-bottom-color:transparent;position:absolute;top:0;left:0;background:none;margin:0;-webkit-animation:donut-rotate-data-v-ea894aa6 1s cubic-bezier(.4,0,.22,1) infinite;animation:donut-rotate-data-v-ea894aa6 1s cubic-bezier(.4,0,.22,1) infinite}@-webkit-keyframes clockwise-data-v-ea894aa6{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes clockwise-data-v-ea894aa6{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes donut-rotate-data-v-ea894aa6{0%{-webkit-transform:rotate(0)}50%{-webkit-transform:rotate(-140deg)}to{-webkit-transform:rotate(0)}}@keyframes donut-rotate-data-v-ea894aa6{0%{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(-140deg);transform:rotate(-140deg)}to{-webkit-transform:rotate(0);transform:rotate(0)}}",""])},3933:function(t,i,e){var s=e("2f7c");"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var o=e("85cb").default;o("c2820d5e",s,!0,{sourceMap:!1,shadowMode:!1})},"690e":function(t,i){function e(t,i){var e=t[1]||"",o=t[3];if(!o)return e;if(i&&"function"===typeof btoa){var n=s(o),r=o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"});return[e].concat(r).concat([n]).join("\n")}return[e].join("\n")}function s(t){var i=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),e="sourceMappingURL=data:application/json;charset=utf-8;base64,"+i;return"/*# "+e+" */"}t.exports=function(t){var i=[];return i.toString=function(){return this.map(function(i){var s=e(i,t);return i[2]?"@media "+i[2]+"{"+s+"}":s}).join("")},i.i=function(t,e){"string"===typeof t&&(t=[[null,t,""]]);for(var s={},o=0;o<this.length;o++){var n=this[o][0];"number"===typeof n&&(s[n]=!0)}for(o=0;o<t.length;o++){var r=t[o];"number"===typeof r[0]&&s[r[0]]||(e&&!r[2]?r[2]=e:e&&(r[2]="("+r[2]+") and ("+e+")"),i.push(r))}},i}},"698b":function(t,i,e){"use strict";var s=e("ae40"),o=e.n(s);o.a},"85cb":function(t,i,e){"use strict";function s(t,i){for(var e=[],s={},o=0;o<i.length;o++){var n=i[o],r=n[0],a=n[1],h=n[2],l=n[3],c={id:t+":"+o,css:a,media:h,sourceMap:l};s[r]?s[r].parts.push(c):e.push(s[r]={id:r,parts:[c]})}return e}e.r(i),e.d(i,"default",function(){return f});var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var n={},r=o&&(document.head||document.getElementsByTagName("head")[0]),a=null,h=0,l=!1,c=function(){},p=null,u="data-vue-ssr-id",d="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,i,e,o){l=e,p=o||{};var r=s(t,i);return m(r),function(i){for(var e=[],o=0;o<r.length;o++){var a=r[o],h=n[a.id];h.refs--,e.push(h)}i?(r=s(t,i),m(r)):r=[];for(o=0;o<e.length;o++){h=e[o];if(0===h.refs){for(var l=0;l<h.parts.length;l++)h.parts[l]();delete n[h.id]}}}}function m(t){for(var i=0;i<t.length;i++){var e=t[i],s=n[e.id];if(s){s.refs++;for(var o=0;o<s.parts.length;o++)s.parts[o](e.parts[o]);for(;o<e.parts.length;o++)s.parts.push(v(e.parts[o]));s.parts.length>e.parts.length&&(s.parts.length=e.parts.length)}else{var r=[];for(o=0;o<e.parts.length;o++)r.push(v(e.parts[o]));n[e.id]={id:e.id,refs:1,parts:r}}}}function g(){var t=document.createElement("style");return t.type="text/css",r.appendChild(t),t}function v(t){var i,e,s=document.querySelector("style["+u+'~="'+t.id+'"]');if(s){if(l)return c;s.parentNode.removeChild(s)}if(d){var o=h++;s=a||(a=g()),i=w.bind(null,s,o,!1),e=w.bind(null,s,o,!0)}else s=g(),i=b.bind(null,s),e=function(){s.parentNode.removeChild(s)};return i(t),function(s){if(s){if(s.css===t.css&&s.media===t.media&&s.sourceMap===t.sourceMap)return;i(t=s)}else e()}}var y=function(){var t=[];return function(i,e){return t[i]=e,t.filter(Boolean).join("\n")}}();function w(t,i,e,s){var o=e?"":s.css;if(t.styleSheet)t.styleSheet.cssText=y(i,o);else{var n=document.createTextNode(o),r=t.childNodes;r[i]&&t.removeChild(r[i]),r.length?t.insertBefore(n,r[i]):t.appendChild(n)}}function b(t,i){var e=i.css,s=i.media,o=i.sourceMap;if(s&&t.setAttribute("media",s),p.ssrId&&t.setAttribute(u,i.id),o&&(e+="\n/*# sourceURL="+o.sources[0]+" */",e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),t.styleSheet)t.styleSheet.cssText=e;else{while(t.firstChild)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},"9c03":function(t,i,e){"use strict";var s;(e.r(i),"undefined"!==typeof window)&&(e("e67d"),(s=window.document.currentScript)&&(s=s.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(e.p=s[1]));var o=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{ref:"wrapper"},[e("div",{staticClass:"contantView"},[e("div",{ref:"listWrapper"},[t._t("default"),t._t("pullup",null,{finishPullUp:t.pullUpDirty})],2),e("div",{staticClass:"pulldown"},[t.pullDownRefresh?t._t("pulldown",[e("Loading",{attrs:{isPullingDownStatus:t.isPullingDownStatus,isPullingDown:t.isPullingDown,isTouchEndStatus:t.isTouchEndStatus}})],{isPullingDownStatus:t.isPullingDownStatus,isPullingDown:t.isPullingDown}):t._e()],2)])])},n=[]; /*! * better-normal-scroll v1.15.2 * (c) 2016-2019 ustbhuangyi * Released under the MIT License. */ function r(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}var a=function(){function t(t,i){var e=[],s=!0,o=!1,n=void 0;try{for(var r,a=t[Symbol.iterator]();!(s=(r=a.next()).done);s=!0)if(e.push(r.value),i&&e.length===i)break}catch(h){o=!0,n=h}finally{try{!s&&a["return"]&&a["return"]()}finally{if(o)throw n}}return e}return function(i,e){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i<t.length;i++)e[i]=t[i];return e}return Array.from(t)};function l(t){t.prototype.on=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._events[t]||(this._events[t]=[]),this._events[t].push([i,e])},t.prototype.once=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;function s(){this.off(t,s),i.apply(e,arguments)}s.fn=i,this.on(t,s)},t.prototype.off=function(t,i){var e=this._events[t];if(e){var s=e.length;while(s--)(e[s][0]===i||e[s][0]&&e[s][0].fn===i)&&r(e,s)}},t.prototype.trigger=function(t){var i=this._events[t];if(i)for(var e=i.length,s=[].concat(h(i)),o=0;o<e;o++){var n=s[o],r=a(n,2),l=r[0],c=r[1];l&&l.apply(c,[].slice.call(arguments,1))}}}var c="undefined"!==typeof window,p=c&&navigator.userAgent.toLowerCase(),u=p&&/wechatdevtools/.test(p),d=p&&p.indexOf("android")>0;function f(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function m(t){for(var i=arguments.length,e=Array(i>1?i-1:0),s=1;s<i;s++)e[s-1]=arguments[s];for(var o=0;o<e.length;o++){var n=e[o];for(var r in n)t[r]=n[r]}return t}function g(t){return void 0===t||null===t}function v(t,i){return Math.sqrt(t*t+i*i)}var y=c&&document.createElement("div").style,w=function(){if(!c)return!1;var t={standard:"transform",webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform"};for(var i in t)if(void 0!==y[t[i]])return i;return!1}();function b(t){return!1!==w&&("standard"===w?"transitionEnd"===t?"transitionend":t:w+t.charAt(0).toUpperCase()+t.substr(1))}function x(t,i,e,s){t.addEventListener(i,e,{passive:!1,capture:!!s})}function T(t,i,e,s){t.removeEventListener(i,e,{passive:!1,capture:!!s})}function S(t){var i=0,e=0;while(t)i-=t.offsetLeft,e-=t.offsetTop,t=t.offsetParent;return{left:i,top:e}}function _(t){var i=t.getBoundingClientRect();return{left:-(i.left+window.pageXOffset),top:-(i.top+window.pageYOffset)}}var P=w&&"standard"!==w?"-"+w.toLowerCase()+"-":"",Y=b("transform"),X=b("transition"),D=c&&b("perspective")in y,M=c&&("ontouchstart"in window||u),E=!1!==Y,k=c&&X in y,I={transform:Y,transition:X,transitionTimingFunction:b("transitionTimingFunction"),transitionDuration:b("transitionDuration"),transitionDelay:b("transitionDelay"),transformOrigin:b("transformOrigin"),transitionEnd:b("transitionEnd")},C=1,W=2,z={touchstart:C,touchmove:C,touchend:C,mousedown:W,mousemove:W,mouseup:W};function O(t){if(t instanceof window.SVGElement){var i=t.getBoundingClientRect();return{top:i.top,left:i.left,width:i.width,height:i.height}}return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}function A(t,i){for(var e in i)if(i[e].test(t[e]))return!0;return!1}function H(t,i){var e=document.createEvent("Event");e.initEvent(i,!0,!0),e.pageX=t.pageX,e.pageY=t.pageY,t.target.dispatchEvent(e)}function L(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click",e=void 0;"mouseup"===t.type||"mousecancel"===t.type?e=t:"touchend"!==t.type&&"touchcancel"!==t.type||(e=t.changedTouches[0]);var s={};e&&(s.screenX=e.screenX||0,s.screenY=e.screenY||0,s.clientX=e.clientX||0,s.clientY=e.clientY||0);var o=void 0,n=!0,r=!0;if("undefined"!==typeof MouseEvent)try{o=new MouseEvent(i,m({bubbles:n,cancelable:r},s))}catch(t){a()}else a();function a(){o=document.createEvent("Event"),o.initEvent(i,n,r),m(o,s)}o.forwardedTouchEvent=!0,o._constructed=!0,t.target.dispatchEvent(o)}function U(t){L(t,"dblclick")}function R(t,i){i.firstChild?N(t,i.firstChild):i.appendChild(t)}function N(t,i){i.parentNode.insertBefore(t,i)}function B(t,i){t.removeChild(i)}var V={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:M,disableTouch:!M,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1};function j(t){t.prototype._init=function(t){this._handleOptions(t),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},t.prototype.setScale=function(t){this.lastScale=g(this.scale)?t:this.scale,this.scale=t},t.prototype._handleOptions=function(t){this.options=m({},V,t),this.translateZ=this.options.HWCompositing&&D?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&k,this.options.useTransform=this.options.useTransform&&E,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},t.prototype._addDOMEvents=function(){var t=x;this._handleDOMEvents(t)},t.prototype._removeDOMEvents=function(){var t=T;this._handleDOMEvents(t)},t.prototype._handleDOMEvents=function(t){var i=this.options.bindToWrapper?this.wrapper:window;t(window,"orientationchange",this),t(window,"resize",this),this.options.click&&t(this.wrapper,"click",this,!0),this.options.disableMouse||(t(this.wrapper,"mousedown",this),t(i,"mousemove",this),t(i,"mousecancel",this),t(i,"mouseup",this)),M&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(i,"touchmove",this),t(i,"touchcancel",this),t(i,"touchend",this)),t(this.scroller,I.transitionEnd,this)},t.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},t.prototype._watchTransition=function(){if("function"===typeof Object.defineProperty){var t=this,i=!1,e=this.options.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,e,{get:function(){return i},set:function(e){i=e;for(var s=t.scroller.children.length?t.scroller.children:[t.scroller],o=i&&!t.pulling?"none":"auto",n=0;n<s.length;n++)s[n].style.pointerEvents=o}})}},t.prototype._handleAutoBlur=function(){this.on("scrollStart",function(){var t=document.activeElement;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||t.blur()})},t.prototype._initDOMObserver=function(){var t=this;if("undefined"!==typeof MutationObserver){var i=void 0,e=new MutationObserver(function(e){if(!t._shouldNotRefresh()){for(var s=!1,o=!1,n=0;n<e.length;n++){var r=e[n];if("attributes"!==r.type){s=!0;break}if(r.target!==t.scroller){o=!0;break}}s?t.refresh():o&&(clearTimeout(i),i=setTimeout(function(){t._shouldNotRefresh()||t.refresh()},60))}}),s={attributes:!0,childList:!0,subtree:!0};e.observe(this.scroller,s),this.on("destroy",function(){e.disconnect()})}else this._checkDOMUpdate()},t.prototype._shouldNotRefresh=function(){var t=this.x>this.minScrollX||this.x<this.maxScrollX||this.y>this.minScrollY||this.y<this.maxScrollY;return this.isInTransition||this.stopFromTransition||t},t.prototype._checkDOMUpdate=function(){var t=O(this.scroller),i=t.width,e=t.height;function s(){if(!this.destroyed){t=O(this.scroller);var s=t.width,n=t.height;i===s&&e===n||this.refresh(),i=s,e=n,o.call(this)}}function o(){var t=this;setTimeout(function(){s.call(t)},1e3)}o.call(this)},t.prototype.handleEvent=function(t){switch(t.type){case"touchstart":case"mousedown":this._start(t),this.options.zoom&&t.touches&&t.touches.length>1&&this._zoomStart(t);break;case"touchmove":case"mousemove":this.options.zoom&&t.touches&&t.touches.length>1?this._zoom(t):this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(t):this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"click":this.enabled&&!t._constructed&&(A(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(t);break}},t.prototype.refresh=function(){var t="static"===window.getComputedStyle(this.wrapper,null).position,i=O(this.wrapper);this.wrapperWidth=i.width,this.wrapperHeight=i.height;var e=O(this.scroller);this.scrollerWidth=Math.round(e.width*this.scale),this.scrollerHeight=Math.round(e.height*this.scale),this.relativeX=e.left,this.relativeY=e.top,t&&(this.relativeX-=i.left,this.relativeY-=i.top),this.minScrollX=0,this.minScrollY=0;var s=this.options.wheel;s?(this.items=this.scroller.children,this._checkWheelAllDisabled(),this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=s.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):this.scale>1&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):this.scale>1&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<this.minScrollX,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<this.minScrollY,this.hasHorizontalScroll||(this.maxScrollX=this.minScrollX,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=this.minScrollY,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=S(this.wrapper),this.trigger("refresh"),!this.scaled&&this.resetPosition()},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1}}var F={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(t){return 1+--t*t*t*t*t}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}}};function $(t,i,e,s,o,n,r,a){var h=t-i,l=Math.abs(h)/e,c=r.deceleration,p=r.itemHeight,u=r.swipeBounceTime,d=r.wheel,f=r.swipeTime,m=f,g=d?4:15,v=t+l/c*(h<0?-1:1);return d&&p&&(v=a._findNearestValidWheel(v).y),v<s?(v=n?Math.max(s-n/4,s-n/g*l):s,m=u):v>o&&(v=n?Math.min(o+n/4,o+n/g*l):o,m=u),{destination:Math.round(v),duration:m}}var q=100/60;function Z(){}var G=function(){return c?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,(t.interval||q)/2)}:Z}(),J=function(){return c?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:Z}(),K=1,Q=-1,tt=1,it=-1,et=1,st=3;function ot(t){console.error("[BScroll warn]: "+t)}function nt(t,i){if(!t)throw new Error("[BScroll] "+i)}function rt(t){t.prototype._start=function(t){var i=z[t.type];if((i===C||0===t.button)&&!(!this.enabled||this.destroyed||this.initiated&&this.initiated!==i)){this.initiated=i,this.options.preventDefault&&!A(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.movingDirectionX=0,this.movingDirectionY=0,this.directionLocked=0,this._transitionTime(),this.startTime=f(),this.options.wheel&&(this.target=t.target),this.stop();var e=t.touches?t.touches[0]:t;this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=e.pageX,this.pointY=e.pageY,this.trigger("beforeScrollStart")}},t.prototype._move=function(t){if(this.enabled&&!this.destroyed&&z[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation();var i=t.touches?t.touches[0]:t,e=i.pageX-this.pointX,s=i.pageY-this.pointY;this.pointX=i.pageX,this.pointY=i.pageY,this.distX+=e,this.distY+=s;var o=Math.abs(this.distX),n=Math.abs(this.distY),r=f();if(!(r-this.endTime>this.options.momentumLimitTime&&!this.moved&&n<this.options.momentumLimitDistance&&o<this.options.momentumLimitDistance)){if(this.directionLocked||this.options.freeScroll||(o>n+this.options.directionLockThreshold?this.directionLocked="h":n>=o+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)t.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);s=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)t.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);e=0}e=this.hasHorizontalScroll?e:0,s=this.hasVerticalScroll?s:0,this.movingDirectionX=e>0?it:e<0?tt:0,this.movingDirectionY=s>0?Q:s<0?K:0;var a=this.x+e,h=this.y+s,l=!1,c=!1,p=!1,u=!1,d=this.options.bounce;!1!==d&&(l=void 0===d.top||d.top,c=void 0===d.bottom||d.bottom,p=void 0===d.left||d.left,u=void 0===d.right||d.right),(a>this.minScrollX||a<this.maxScrollX)&&(a=a>this.minScrollX&&p||a<this.maxScrollX&&u?this.x+e/3:a>this.minScrollX?this.minScrollX:this.maxScrollX),(h>this.minScrollY||h<this.maxScrollY)&&(h=h>this.minScrollY&&l||h<this.maxScrollY&&c?this.y+s/3:h>this.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(a,h),r-this.startTime>this.options.momentumLimitTime&&(this.startTime=r,this.startX=this.x,this.startY=this.y,this.options.probeType===et&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>et&&this.trigger("scroll",{x:this.x,y:this.y});var m=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,g=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,v=this.pointX-m,y=this.pointY-g;(v>document.documentElement.clientWidth-this.options.momentumLimitDistance||v<this.options.momentumLimitDistance||y<this.options.momentumLimitDistance||y>document.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(t)}}},t.prototype._end=function(t){if(this.enabled&&!this.destroyed&&z[t.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!A(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var i=Math.round(this.x),e=Math.round(this.y),s=i-this.absStartX,o=e-this.absStartY;if(this.directionX=s>0?it:s<0?tt:0,this.directionY=o>0?Q:o<0?K:0,!this.options.pullDownRefresh||!this._checkPullDown())if(this._checkClick(t))this.trigger("scrollCancel");else if(!this.resetPosition(this.options.bounceTime,F.bounce)){this._translate(i,e),this.endTime=f();var n=this.endTime-this.startTime,r=Math.abs(i-this.startX),a=Math.abs(e-this.startY);if(this._events.flick&&n<this.options.flickLimitTime&&r<this.options.flickLimitDistance&&a<this.options.flickLimitDistance)this.trigger("flick");else{var h=0;if(this.options.momentum&&n<this.options.momentumLimitTime&&(a>this.options.momentumLimitDistance||r>this.options.momentumLimitDistance)){var l=!1,c=!1,p=!1,u=!1,d=this.options.bounce;!1!==d&&(l=void 0===d.top||d.top,c=void 0===d.bottom||d.bottom,p=void 0===d.left||d.left,u=void 0===d.right||d.right);var m=this.directionX===it&&p||this.directionX===tt&&u?this.wrapperWidth:0,g=this.directionY===Q&&l||this.directionY===K&&c?this.wrapperHeight:0,v=this.hasHorizontalScroll?$(this.x,this.startX,n,this.maxScrollX,this.minScrollX,m,this.options,this):{destination:i,duration:0},y=this.hasVerticalScroll?$(this.y,this.startY,n,this.maxScrollY,this.minScrollY,g,this.options,this):{destination:e,duration:0};i=v.destination,e=y.destination,h=Math.max(v.duration,y.duration),this.isInTransition=!0}else this.options.wheel&&(e=this._findNearestValidWheel(e).y,h=this.options.wheel.adjustTime||400);var w=F.swipe;if(this.options.snap){var b=this._nearestSnap(i,e);this.currentPage=b,h=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(i-b.x),1e3),Math.min(Math.abs(e-b.y),1e3)),300),i=b.x,e=b.y,this.directionX=0,this.directionY=0,w=this.options.snap.easing||F.bounce}if(i!==this.x||e!==this.y)return(i>this.minScrollX||i<this.maxScrollX||e>this.minScrollY||e<this.maxScrollY)&&(w=F.swipeBounce),void this.scrollTo(i,e,h,w);this.options.wheel&&(this.selectedIndex=this._findNearestValidWheel(this.y).index),this.trigger("scrollEnd",{x:this.x,y:this.y})}}}},t.prototype._checkClick=function(t){var i=this.stopFromTransition&&!this.pulling;if(this.stopFromTransition=!1,!this.moved){if(this.options.wheel){if(this.target&&this.target.className===this.options.wheel.wheelWrapperClass){var e=this._findNearestValidWheel(this.y).index,s=Math.round((this.pointY+_(this.wrapper).top-this.wrapperHeight/2)/this.itemHeight);this.target=this.items[e+s]}var o=S(this.target).top,n=S(this.target).left;return o-=this.wrapperOffset.top,o-=Math.round(this.target.offsetHeight/2-this.wrapper.offsetHeight/2)||0,n-=this.wrapperOffset.left,n-=Math.round(this.target.offsetWidth/2-this.wrapper.offsetWidth/2)||0,o=this._findNearestValidWheel(o).y,this.scrollTo(n,o,this.options.wheel.adjustTime||400,F.swipe),!0}if(!i){var r=this.options.dblclick,a=!1;if(r&&this.lastClickTime){var h=r.delay,l=void 0===h?300:h;f()-this.lastClickTime<l&&(a=!0,U(t))}return this.options.tap&&H(t,this.options.tap),this.options.click&&!A(t.target,this.options.preventDefaultException)&&L(t),this.lastClickTime=a?null:f(),!0}return!1}return!1},t.prototype._resize=function(){var t=this;this.enabled&&(d&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){t.refresh()},this.options.resizePolling))},t.prototype._startProbe=function(){J(this.probeTimer),this.probeTimer=G(i);var t=this;function i(){var e=t.getComputedPosition();t.trigger("scroll",e),t.isInTransition?t.probeTimer=G(i):t.trigger("scrollEnd",e)}},t.prototype._transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.scrollerStyle[I.transitionDuration]=t+"ms",this.options.wheel)for(var i=0;i<this.items.length;i++)this.items[i].style[I.transitionDuration]=t+"ms";if(this.indicators)for(var e=0;e<this.indicators.length;e++)this.indicators[e].transitionTime(t)},t.prototype._transitionTimingFunction=function(t){if(this.scrollerStyle[I.transitionTimingFunction]=t,this.options.wheel)for(var i=0;i<this.items.length;i++)this.items[i].style[I.transitionTimingFunction]=t;if(this.indicators)for(var e=0;e<this.indicators.length;e++)this.indicators[e].transitionTimingFunction(t)},t.prototype._transitionEnd=function(t){if(t.target===this.scroller&&this.isInTransition){this._transitionTime();var i=!this.pulling||this.movingDirectionY===K;i&&!this.resetPosition(this.options.bounceTime,F.bounce)&&(this.isInTransition=!1,this.options.probeType!==st&&this.trigger("scrollEnd",{x:this.x,y:this.y}))}},t.prototype._translate=function(t,i,e){if(nt(!g(t)&&!g(i),"Translate x or y is null or undefined."),g(e)&&(e=this.scale),this.options.useTransform?this.scrollerStyle[I.transform]="translate("+t+"px,"+i+"px) scale("+e+")"+this.translateZ:(t=Math.round(t),i=Math.round(i),this.scrollerStyle.left=t+"px",this.scrollerStyle.top=i+"px"),this.options.wheel)for(var s=this.options.wheel.rotate,o=void 0===s?25:s,n=0;n<this.items.length;n++){var r=o*(i/this.itemHeight+n);this.items[n].style[I.transform]="rotateX("+r+"deg)"}if(this.x=t,this.y=i,this.setScale(e),this.indicators)for(var a=0;a<this.indicators.length;a++)this.indicators[a].updatePosition()},t.prototype._animate=function(t,i,e,s){var o=this,n=this.x,r=this.y,a=this.lastScale,h=this.scale,l=f(),c=l+e;function p(){var u=f();if(u>=c)return o.isAnimating=!1,o._translate(t,i,h),o.trigger("scroll",{x:o.x,y:o.y}),void(o.pulling||o.resetPosition(o.options.bounceTime)||o.trigger("scrollEnd",{x:o.x,y:o.y}));u=(u-l)/e;var d=s(u),m=(t-n)*d+n,g=(i-r)*d+r,v=(h-a)*d+a;o._translate(m,g,v),o.isAnimating&&(o.animateTimer=G(p)),o.options.probeType===st&&o.trigger("scroll",{x:o.x,y:o.y})}this.isAnimating=!0,J(this.animateTimer),p()},t.prototype.scrollBy=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:F.bounce;t=this.x+t,i=this.y+i,this.scrollTo(t,i,e,s)},t.prototype.scrollTo=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:F.bounce,o=arguments[4];if(this.options.wheel&&(i=this._findNearestValidWheel(i).y),t!==this.x||i!==this.y)if(this.isInTransition=this.options.useTransition&&e>0&&(this.x!==t||this.y!==i),!e||this.options.useTransition){if(this._transitionTimingFunction(s.style),this._transitionTime(e),this._translate(t,i),e&&this.options.probeType===st&&this._startProbe(),!e&&!o){if(this.options.zoom)return;this.trigger("scroll",{x:t,y:i}),this._reflow=document.body.offsetHeight,this.resetPosition(this.options.bounceTime,F.bounce)||this.trigger("scrollEnd",{x:t,y:i})}this.options.wheel&&(this.selectedIndex=this._findNearestValidWheel(i).index)}else this._animate(t,i,e,s.fn)},t.prototype.scrollToElement=function(t,i,e,s,o){if(t&&(t=t.nodeType?t:this.scroller.querySelector(t),!this.options.wheel||t.classList.contains(this.options.wheel.wheelItemClass))){var n=S(t);n.left-=this.wrapperOffset.left,n.top-=this.wrapperOffset.top,!0===e&&(e=Math.round(t.offsetWidth/2-this.wrapper.offsetWidth/2)),!0===s&&(s=Math.round(t.offsetHeight/2-this.wrapper.offsetHeight/2)),n.left-=e||0,n.top-=s||0,n.left=n.left>this.minScrollX?this.minScrollX:n.left<this.maxScrollX?this.maxScrollX:n.left,n.top=n.top>this.minScrollY?this.minScrollY:n.top<this.maxScrollY?this.maxScrollY:n.top,this.options.wheel&&(n.top=this._findNearestValidWheel(n.top).y),this.scrollTo(n.left,n.top,i,o)}},t.prototype.resetPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.bounce,e=this.x,s=Math.round(e);!this.hasHorizontalScroll||s>this.minScrollX?e=this.minScrollX:s<this.maxScrollX&&(e=this.maxScrollX);var o=this.y,n=Math.round(o);return!this.hasVerticalScroll||n>this.minScrollY?o=this.minScrollY:n<this.maxScrollY&&(o=this.maxScrollY),(e!==this.x||o!==this.y)&&(this.scrollTo(e,o,t,i),!0)},t.prototype.getComputedPosition=function(){var t=window.getComputedStyle(this.scroller,null),i=void 0,e=void 0;return this.options.useTransform?(t=t[I.transform].split(")")[0].split(", "),i=+(t[12]||t[4]),e=+(t[13]||t[5])):(i=+t.left.replace(/[^-\d.]/g,""),e=+t.top.replace(/[^-\d.]/g,"")),{x:i,y:e}},t.prototype.stop=function(){if(this.options.useTransition&&this.isInTransition){this.isInTransition=!1,J(this.probeTimer);var t=this.getComputedPosition();this._translate(t.x,t.y),this.options.wheel?this.target=this.items[this._findNearestValidWheel(t.y).index]:this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0}else!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,J(this.animateTimer),this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0)},t.prototype.destroy=function(){this.destroyed=!0,this.trigger("destroy"),this.options.useTransition?J(this.probeTimer):J(this.animateTimer),this._removeDOMEvents(),this._events={}}}function at(t){t.prototype._initSnap=function(){var t=this;this.currentPage={};var i=this.options.snap;if(i.loop){var e=this.scroller.children;e.length>1?(R(e[e.length-1].cloneNode(!0),this.scroller),this.scroller.appendChild(e[1].cloneNode(!0))):i.loop=!1}var s=i.el;"string"===typeof s&&(s=this.scroller.querySelectorAll(s)),this.on("refresh",function(){if(t.pages=[],t.wrapperWidth&&t.wrapperHeight&&t.scrollerWidth&&t.scrollerHeight){var e=i.stepX||t.wrapperWidth,o=i.stepY||t.wrapperHeight,n=0,r=void 0,a=void 0,h=void 0,l=0,c=void 0,p=0,u=void 0,d=void 0;if(s)for(c=s.length,u=-1;l<c;l++)d=O(s[l]),(0===l||d.left<=O(s[l-1]).left)&&(p=0,u++),t.pages[p]||(t.pages[p]=[]),n=Math.max(-d.left,t.maxScrollX),r=Math.max(-d.top,t.maxScrollY),a=n-Math.round(d.width/2),h=r-Math.round(d.height/2),t.pages[p][u]={x:n,y:r,width:d.width,height:d.height,cx:a,cy:h},n>t.maxScrollX&&p++;else{a=Math.round(e/2),h=Math.round(o/2);while(n>-t.scrollerWidth){t.pages[l]=[],c=0,r=0;while(r>-t.scrollerHeight)t.pages[l][c]={x:Math.max(n,t.maxScrollX),y:Math.max(r,t.maxScrollY),width:e,height:o,cx:n-a,cy:r-h},r-=o,c++;n-=e,l++}}t._checkSnapLoop();var f=i._loopX?1:0,m=i._loopY?1:0;t._goToPage(t.currentPage.pageX||f,t.currentPage.pageY||m,0,void 0,!0);var g=i.threshold;g%1===0?(t.snapThresholdX=g,t.snapThresholdY=g):(t.snapThresholdX=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].width*g),t.snapThresholdY=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].height*g))}}),this.on("scrollEnd",function(){i.loop&&(i._loopX?(0===t.currentPage.pageX&&t._goToPage(t.pages.length-2,t.currentPage.pageY,0,void 0,!0),t.currentPage.pageX===t.pages.length-1&&t._goToPage(1,t.currentPage.pageY,0,void 0,!0)):(0===t.currentPage.pageY&&t._goToPage(t.currentPage.pageX,t.pages[0].length-2,0,void 0,!0),t.currentPage.pageY===t.pages[0].length-1&&t._goToPage(t.currentPage.pageX,1,0,void 0,!0)))}),!1!==i.listenFlick&&this.on("flick",function(){var e=i.speed||Math.max(Math.max(Math.min(Math.abs(t.x-t.startX),1e3),Math.min(Math.abs(t.y-t.startY),1e3)),300);t._goToPage(t.currentPage.pageX+t.directionX,t.currentPage.pageY+t.directionY,e)}),this.on("destroy",function(){if(i.loop){var e=t.scroller.children;e.length>2&&(B(t.scroller,e[e.length-1]),B(t.scroller,e[0]))}})},t.prototype._checkSnapLoop=function(){var t=this.options.snap;t.loop&&this.pages&&this.pages.length&&(this.pages.length>1&&(t._loopX=!0),this.pages[0]&&this.pages[0].length>1&&(t._loopY=!0),t._loopX&&t._loopY&&ot("Loop does not support two direction at the same time."))},t.prototype._nearestSnap=function(t,i){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var e=0;if(Math.abs(t-this.absStartX)<=this.snapThresholdX&&Math.abs(i-this.absStartY)<=this.snapThresholdY)return this.currentPage;t>this.minScrollX?t=this.minScrollX:t<this.maxScrollX&&(t=this.maxScrollX),i>this.minScrollY?i=this.minScrollY:i<this.maxScrollY&&(i=this.maxScrollY);for(var s=this.pages.length;e<s;e++)if(t>=this.pages[e][0].cx){t=this.pages[e][0].x;break}s=this.pages[e].length;for(var o=0;o<s;o++)if(i>=this.pages[0][o].cy){i=this.pages[0][o].y;break}return e===this.currentPage.pageX&&(e+=this.directionX,e<0?e=0:e>=this.pages.length&&(e=this.pages.length-1),t=this.pages[e][0].x),o===this.currentPage.pageY&&(o+=this.directionY,o<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),i=this.pages[0][o].y),{x:t,y:i,pageX:e,pageY:o}},t.prototype._goToPage=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments[2],s=arguments[3],o=arguments[4],n=this.options.snap;if(n&&this.pages&&this.pages.length&&(s=s||n.easing||F.bounce,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),this.pages[t])){i>=this.pages[t].length?i=this.pages[t].length-1:i<0&&(i=0);var r=this.pages[t][i].x,a=this.pages[t][i].y;e=void 0===e?n.speed||Math.max(Math.max(Math.min(Math.abs(r-this.x),1e3),Math.min(Math.abs(a-this.y),1e3)),300):e,this.currentPage={x:r,y:a,pageX:t,pageY:i},this.scrollTo(r,a,e,s,o)}},t.prototype.goToPage=function(t,i,e,s){var o=this.options.snap;if(o&&this.pages&&this.pages.length){if(o.loop){var n=void 0;o._loopX?(n=this.pages.length-2,t>=n?t=n-1:t<0&&(t=0),t+=1):(n=this.pages[0].length-2,i>=n?i=n-1:i<0&&(i=0),i+=1)}this._goToPage(t,i,e,s)}},t.prototype.next=function(t,i){var e=this.options.snap;if(e){var s=this.currentPage.pageX,o=this.currentPage.pageY;s++,s>=this.pages.length&&this.hasVerticalScroll&&(s=0,o++),this._goToPage(s,o,t,i)}},t.prototype.prev=function(t,i){var e=this.options.snap;if(e){var s=this.currentPage.pageX,o=this.currentPage.pageY;s--,s<0&&this.hasVerticalScroll&&(s=0,o--),this._goToPage(s,o,t,i)}},t.prototype.getCurrentPage=function(){var t=this.options.snap;if(!t)return null;if(t.loop){var i=void 0;return i=t._loopX?m({},this.currentPage,{pageX:this.currentPage.pageX-1}):m({},this.currentPage,{pageY:this.currentPage.pageY-1}),i}return this.currentPage}}function ht(t){t.prototype.wheelTo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.options.wheel){var i=-t*this.itemHeight;this.scrollTo(0,i)}},t.prototype.getSelectedIndex=function(){return this.options.wheel&&this.selectedIndex},t.prototype._initWheel=function(){var t=this.options.wheel;t.wheelWrapperClass||(t.wheelWrapperClass="wheel-scroll"),t.wheelItemClass||(t.wheelItemClass="wheel-item"),t.wheelDisabledItemClass||(t.wheelDisabledItemClass="wheel-disabled-item"),void 0===t.selectedIndex&&(t.selectedIndex=0)},t.prototype._findNearestValidWheel=function(t){t=t>0?0:t<this.maxScrollY?this.maxScrollY:t;var i=this.options.wheel,e=Math.abs(Math.round(-t/this.itemHeight)),s=e,o=this.items;while(e>=0){if(-1===o[e].className.indexOf(i.wheelDisabledItemClass))break;e--}if(e<0){e=s;while(e<=o.length-1){if(-1===o[e].className.indexOf(i.wheelDisabledItemClass))break;e++}}return e===o.length&&(e=s),{index:this.wheelItemsAllDisabled?-1:e,y:-e*this.itemHeight}},t.prototype._checkWheelAllDisabled=function(){var t=this.options.wheel,i=this.items;this.wheelItemsAllDisabled=!0;for(var e=0;e<i.length;e++)if(-1===i[e].className.indexOf(t.wheelDisabledItemClass)){this.wheelItemsAllDisabled=!1;break}}}var lt=8;function ct(t){t.prototype._initScrollbar=function(){var t=this,i=this.options.scrollbar,e=i.fade,s=void 0===e||e,o=i.interactive,n=void 0!==o&&o;this.indicators=[];var r=void 0;this.options.scrollX&&(r={el:pt("horizontal"),direction:"horizontal",fade:s,interactive:n},this._insertScrollBar(r.el),this.indicators.push(new ut(this,r))),this.options.scrollY&&(r={el:pt("vertical"),direction:"vertical",fade:s,interactive:n},this._insertScrollBar(r.el),this.indicators.push(new ut(this,r))),this.on("refresh",function(){for(var i=0;i<t.indicators.length;i++)t.indicators[i].refresh()}),s&&(this.on("scrollEnd",function(){for(var i=0;i<t.indicators.length;i++)t.indicators[i].fade()}),this.on("scrollCancel",function(){for(var i=0;i<t.indicators.length;i++)t.indicators[i].fade()}),this.on("scrollStart",function(){for(var i=0;i<t.indicators.length;i++)t.indicators[i].fade(!0)}),this.on("beforeScrollStart",function(){for(var i=0;i<t.indicators.length;i++)t.indicators[i].fade(!0,!0)})),this.on("destroy",function(){t._removeScrollBars()})},t.prototype._insertScrollBar=function(t){this.wrapper.appendChild(t)},t.prototype._removeScrollBars=function(){for(var t=0;t<this.indicators.length;t++)this.indicators[t].destroy()}}function pt(t){var i=document.createElement("div"),e=document.createElement("div");return i.style.cssText="position:absolute;z-index:9999;pointerEvents:none",e.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",e.className="bscroll-indicator","horizontal"===t?(i.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",e.style.height="100%",i.className="bscroll-horizontal-scrollbar"):(i.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",e.style.width="100%",i.className="bscroll-vertical-scrollbar"),i.style.cssText+=";overflow:hidden",i.appendChild(e),i}function ut(t,i){this.wrapper=i.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=t,this.direction=i.direction,i.fade?(this.visible=0,this.wrapperStyle.opacity="0"):this.visible=1,this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.x=0,this.y=0,i.interactive&&this._addDOMEvents()}function dt(t){t.prototype._initPullDown=function(){this.options.probeType=st},t.prototype._checkPullDown=function(){var t=this.options.pullDownRefresh,i=t.threshold,e=void 0===i?90:i,s=t.stop,o=void 0===s?40:s;return!(this.directionY!==Q||this.y<e)&&(this.pulling||(this.pulling=!0,this.trigger("pullingDown")),this.scrollTo(this.x,o,this.options.bounceTime,F.bounce),this.pulling)},t.prototype.finishPullDown=function(){this.pulling=!1,this.resetPosition(this.options.bounceTime,F.bounce)},t.prototype.openPullDown=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.options.pullDownRefresh=t,this._initPullDown()},t.prototype.closePullDown=function(){this.options.pullDownRefresh=!1},t.prototype.autoPullDownRefresh=function(){var t=this.options.pullDownRefresh,i=t.threshold,e=void 0===i?90:i,s=t.stop,o=void 0===s?40:s;this.pulling||(this.pulling=!0,this.scrollTo(this.x,e),this.trigger("pullingDown"),this.scrollTo(this.x,o,this.options.bounceTime,F.bounce))}}function ft(t){t.prototype._initPullUp=function(){this.options.probeType=st,this.pullupWatching=!1,this._watchPullUp()},t.prototype._watchPullUp=function(){this.pullupWatching||(this.pullupWatching=!0,this.on("scroll",this._checkToEnd))},t.prototype._checkToEnd=function(t){var i=this,e=this.options.pullUpLoad.threshold,s=void 0===e?0:e;this.movingDirectionY===K&&t.y<=this.maxScrollY+s&&(this.once("scrollEnd",function(){i.pullupWatching=!1}),this.trigger("pullingUp"),this.off("scroll",this._checkToEnd))},t.prototype.finishPullUp=function(){var t=this;this.pullupWatching?this.once("scrollEnd",function(){t._watchPullUp()}):this._watchPullUp()},t.prototype.openPullUp=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.options.pullUpLoad=t,this._initPullUp()},t.prototype.closePullUp=function(){this.options.pullUpLoad=!1,this.pullupWatching&&(this.pullupWatching=!1,this.off("scroll",this._checkToEnd))}}function mt(t){t.prototype._initMouseWheel=function(){var t=this;this._handleMouseWheelEvent(x),this.on("destroy",function(){clearTimeout(t.mouseWheelTimer),clearTimeout(t.mouseWheelEndTimer),t._handleMouseWheelEvent(T)}),this.firstWheelOpreation=!0},t.prototype._handleMouseWheelEvent=function(t){t(this.wrapper,"wheel",this),t(this.wrapper,"mousewheel",this),t(this.wrapper,"DOMMouseScroll",this)},t.prototype._onMouseWheel=function(t){var i=this;if(this.enabled){t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.firstWheelOpreation&&this.trigger("scrollStart"),this.firstWheelOpreation=!1;var e=this.options.mouseWheel,s=e.speed,o=void 0===s?20:s,n=e.invert,r=void 0!==n&&n,a=e.easeTime,h=void 0===a?300:a;clearTimeout(this.mouseWheelTimer),this.mouseWheelTimer=setTimeout(function(){i.options.snap||h||i.trigger("scrollEnd",{x:i.x,y:i.y}),i.firstWheelOpreation=!0},400);var l=void 0,c=void 0;switch(!0){case"deltaX"in t:1===t.deltaMode?(l=-t.deltaX*o,c=-t.deltaY*o):(l=-t.deltaX,c=-t.deltaY);break;case"wheelDeltaX"in t:l=t.wheelDeltaX/120*o,c=t.wheelDeltaY/120*o;break;case"wheelDelta"in t:l=c=t.wheelDelta/120*o;break;case"detail"in t:l=c=-t.detail/3*o;break;default:return}var p=r?-1:1;l*=p,c*=p,this.hasVerticalScroll||(l=c,c=0);var u=void 0,d=void 0;if(this.options.snap)return u=this.currentPage.pageX,d=this.currentPage.pageY,l>0?u--:l<0&&u++,c>0?d--:c<0&&d++,void this._goToPage(u,d);u=this.x+Math.round(this.hasHorizontalScroll?l:0),d=this.y+Math.round(this.hasVerticalScroll?c:0),this.movingDirectionX=this.directionX=l>0?-1:l<0?1:0,this.movingDirectionY=this.directionY=c>0?-1:c<0?1:0,u>this.minScrollX?u=this.minScrollX:u<this.maxScrollX&&(u=this.maxScrollX),d>this.minScrollY?d=this.minScrollY:d<this.maxScrollY&&(d=this.maxScrollY);var f=this.y===d;this.scrollTo(u,d,h,F.swipe),this.trigger("scroll",{x:this.x,y:this.y}),clearTimeout(this.mouseWheelEndTimer),f&&(this.mouseWheelEndTimer=setTimeout(function(){i.trigger("scrollEnd",{x:i.x,y:i.y})},h))}}}function gt(t){t.prototype._initZoom=function(){var t=this.options.zoom,i=t.start,e=void 0===i?1:i,s=t.min,o=void 0===s?1:s,n=t.max,r=void 0===n?4:n;this.scale=Math.min(Math.max(e,o),r),this.setScale(this.scale),this.scrollerStyle[I.transformOrigin]="0 0"},t.prototype._zoomTo=function(t,i,e,s){this.scaled=!0;var o=t/(s||this.scale);this.setScale(t),this.refresh();var n=Math.round(this.startX-(i-this.relativeX)*(o-1)),r=Math.round(this.startY-(e-this.relativeY)*(o-1));n>this.minScrollX?n=this.minScrollX:n<this.maxScrollX&&(n=this.maxScrollX),r>this.minScrollY?r=this.minScrollY:r<this.maxScrollY&&(r=this.maxScrollY),this.x===n&&this.y===r||this.scrollTo(n,r,this.options.bounceTime),this.scaled=!1},t.prototype.zoomTo=function(t,i,e){var s=_(this.wrapper),o=s.left,n=s.top,r=i+o-this.x,a=e+n-this.y;this._zoomTo(t,r,a)},t.prototype._zoomStart=function(t){var i=t.touches[0],e=t.touches[1],s=Math.abs(i.pageX-e.pageX),o=Math.abs(i.pageY-e.pageY);this.startDistance=v(s,o),this.startScale=this.scale;var n=_(this.wrapper),r=n.left,a=n.top;this.originX=Math.abs(i.pageX+e.pageX)/2+r-this.x,this.originY=Math.abs(i.pageY+e.pageY)/2+a-this.y,this.trigger("zoomStart")},t.prototype._zoom=function(t){if(this.enabled&&!this.destroyed&&z[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation();var i=t.touches[0],e=t.touches[1],s=Math.abs(i.pageX-e.pageX),o=Math.abs(i.pageY-e.pageY),n=v(s,o),r=n/this.startDistance*this.startScale;this.scaled=!0;var a=this.options.zoom,h=a.min,l=void 0===h?1:h,c=a.max,p=void 0===c?4:c;r<l?r=.5*l*Math.pow(2,r/l):r>p&&(r=2*p*Math.pow(.5,p/r));var u=r/this.startScale,d=this.startX-(this.originX-this.relativeX)*(u-1),f=this.startY-(this.originY-this.relativeY)*(u-1);this.setScale(r),this.scrollTo(d,f,0)}},t.prototype._zoomEnd=function(t){if(this.enabled&&!this.destroyed&&z[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.isInTransition=!1,this.isAnimating=!1,this.initiated=0;var i=this.options.zoom,e=i.min,s=void 0===e?1:e,o=i.max,n=void 0===o?4:o,r=this.scale>n?n:this.scale<s?s:this.scale;this._zoomTo(r,this.originX,this.originY,this.startScale),this.trigger("zoomEnd")}}}ut.prototype.handleEvent=function(t){switch(t.type){case"touchstart":case"mousedown":this._start(t);break;case"touchmove":case"mousemove":this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this._end(t);break}},ut.prototype.refresh=function(){this._shouldShow()&&(this.transitionTime(),this._calculate(),this.updatePosition())},ut.prototype.fade=function(t,i){var e=this;if(!i||this.visible){var s=t?250:500;t=t?"1":"0",this.wrapperStyle[I.transitionDuration]=s+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){e.wrapperStyle.opacity=t,e.visible=+t},0)}},ut.prototype.updatePosition=function(){if("vertical"===this.direction){var t=Math.round(this.sizeRatioY*this.scroller.y);if(t<0){this.transitionTime(500);var i=Math.max(this.indicatorHeight+3*t,lt);this.indicatorStyle.height=i+"px",t=0}else if(t>this.maxPosY){this.transitionTime(500);var e=Math.max(this.indicatorHeight-3*(t-this.maxPosY),lt);this.indicatorStyle.height=e+"px",t=this.maxPosY+this.indicatorHeight-e}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=t,this.scroller.options.useTransform?this.indicatorStyle[I.transform]="translateY("+t+"px)"+this.scroller.translateZ:this.indicatorStyle.top=t+"px"}else{var s=Math.round(this.sizeRatioX*this.scroller.x);if(s<0){this.transitionTime(500);var o=Math.max(this.indicatorWidth+3*s,lt);this.indicatorStyle.width=o+"px",s=0}else if(s>this.maxPosX){this.transitionTime(500);var n=Math.max(this.indicatorWidth-3*(s-this.maxPosX),lt);this.indicatorStyle.width=n+"px",s=this.maxPosX+this.indicatorWidth-n}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=s,this.scroller.options.useTransform?this.indicatorStyle[I.transform]="translateX("+s+"px)"+this.scroller.translateZ:this.indicatorStyle.left=s+"px"}},ut.prototype.transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[I.transitionDuration]=t+"ms"},ut.prototype.transitionTimingFunction=function(t){this.indicatorStyle[I.transitionTimingFunction]=t},ut.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},ut.prototype._start=function(t){var i=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=i.pageX,this.lastPointY=i.pageY,this.startTime=f(),this._handleMoveEvents(x),this.scroller.trigger("beforeScrollStart")},ut.prototype._move=function(t){var i=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var e=i.pageX-this.lastPointX;this.lastPointX