vue-awesome-picker.js 49.8 KB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("VueAwesomePicker",[],e):"object"==typeof exports?exports.VueAwesomePicker=e():t.VueAwesomePicker=e()}("undefined"!=typeof self?self:this,function(){return function(t){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}var i={};return e.m=t,e.c=i,e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get: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,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=2)}([function(t,e,i){"use strict";function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var o=i(10),r=i(11),n=i(12);e.a={name:"awesome-picker",props:{data:{type:Array,default:function(){return[]}},anchor:{type:Array,default:function(){return[]}},type:{type:String,default:"normal"},textTitle:{type:String,default:""},textConfirm:{type:String,default:"确定"},textCancel:{type:String,default:"取消"},colorTitle:{type:String,default:"#000000"},colorConfirm:{type:String,default:"#42b983"},colorCancel:{type:String,default:"#999999"},swipeTime:{type:Number,default:1800}},data:function(){return{display:!1,dataChange:!1,pickerData:this._dataGetter(),pickerAnchor:this._anchorGetter(),wheels:[]}},watch:{data:function(){this._setPickerData()}},computed:{proxyData:function(){return this._dataGetter()},proxyAnchor:function(){return this._anchorGetter()},dataType:function(){return Array.isArray(this.proxyData[0])?"normal":"cascade"}},methods:{_dataGetter:function(){var t=null;switch(this.type){case"time":t=r.a;break;case"date":t=n.b;break;case"normal":default:t=this.data}return[].concat(s(t))},_anchorGetter:function(){var t=this,e=[];if(this.anchor.length)e=this.anchor;else switch(this.type){case"date":e=n.a;break;default:e=this.anchor}return e=e.map(function(e,i){return e.index?e.index:e.value?t.pickerData&&t.pickerData[i]&&t.pickerData[i].indexOf(e.value)>-1?t.pickerData[i].indexOf(e.value):0:e}),[].concat(s(e))},show:function(){var t=this;this.display=!0,!this.wheels.length||this.dataChange?("cascade"===this.dataType&&this._updatePickerData(),this.$nextTick(function(){var e=t.$refs.wheelWrapper;t.pickerData.forEach(function(i,s){t._createWheel(e,s).enable()}),t._wheelToAnchor(t.proxyAnchor),t.dataChange&&t._destroyExtraWheels(),t.dataChange=!1})):this.wheels.forEach(function(t){t.enable()})},hide:function(){this.wheels.forEach(function(t){t.disable()}),this.display=!1},_createWheel:function(t,e){var i=this;if(this.wheels[e])this.wheels[e].refresh();else{(this.wheels[e]=new o.a(t.children[e],{wheel:{selectedIndex:0,rotate:25},swipeTime:this.swipeTime})).on("scrollEnd",function(){i._cascadePickerChange(e)})}return this.wheels[e]},_cascadePickerChange:function(t){if("cascade"===this.dataType){var e=this._getCurrentValue()[t].index;e!==this.pickerAnchor[t]&&(this.pickerAnchor.splice(t,1,e),this._updatePickerData(t+1))}},_wheelToAnchor:function(t){this.wheels.forEach(function(e,i){e.wheelTo(t[i]||0)})},_getCurrentValue:function(){var t=this,e=[];return this.wheels.forEach(function(i,s){var o=i.getSelectedIndex();e.push({index:o,value:t.pickerData[s][o]})}),e},_setPickerData:function(){var t=this;this.pickerData=this._dataGetter(),this.pickerAnchor=this._anchorGetter(),this.display?this.$nextTick(function(){var e=t.$refs.wheelWrapper;t.pickerData.forEach(function(i,s){t._createWheel(e,s)}),t._wheelToAnchor(t.proxyAnchor),t._destroyExtraWheels()}):this.dataChange=!0},_destroyExtraWheels:function(){var t=this.pickerData.length;if(t<this.wheels.length){this.wheels.splice(t).forEach(function(t){t.destroy()})}},_updatePickerData:function(){for(var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=[].concat(s(this.proxyData)),o=0;i;)o>=e&&function(){var s=[];i.forEach(function(t){s.push(t.value)}),t.pickerData[o]=s,t.pickerAnchor[o]=0===e?t.pickerAnchor[o]<i.length?t.pickerAnchor[o]||0:0:t._reloadWheel(o,s)}(),i=i.length?i[this.pickerAnchor[o]].children:null,o++;this.pickerData=this.pickerData.slice(0,o)},_reloadWheel:function(t,e){var i=this,s=this.$refs.wheelWrapper,o=s.children[t].querySelector(".wheel-scroll"),r=!!this.wheels&&this.wheels[t];return o&&r&&(this.$set(this.pickerData,t,e),this.pickerAnchor[t]=0,this.$nextTick(function(){r=i._createWheel(s,t),r.wheelTo(0)})),0},confirm:function(){if(!this.wheels.some(function(t){return t.isInTransition})){var t=this._getCurrentValue();this.$emit("confirm",t),this.hide()}},cancel:function(){this.$emit("cancel"),this.hide()}}}},function(t,e,i){"use strict";e.a=function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=[],r=t;r<=e;r++){var n=(i&&r<10?"0"+r:r)+s;o.push(n)}return o}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(3),o={install:function(t){t.component(s.a.name,s.a)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(o),e.default=o},function(t,e,i){"use strict";function s(t){i(4)}var o=i(0),r=i(13),n=i(9),a=s,h=n(o.a,r.a,!1,a,"data-v-171df494",null);e.a=h.exports},function(t,e,i){var s=i(5);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);i(7)("3d9c1580",s,!0,{})},function(t,e,i){e=t.exports=i(6)(!1),e.push([t.i,'.fade-enter[data-v-171df494],.fade-leave-to[data-v-171df494]{opacity:0}.fade-enter-active[data-v-171df494],.fade-leave-active[data-v-171df494]{transition:all .3s ease}.slide-enter[data-v-171df494],.slide-leave-to[data-v-171df494]{opacity:.5;transform:translate3d(0,270px,0)}.slide-enter-active[data-v-171df494],.slide-leave-active[data-v-171df494]{transition:all .3s ease}.mask[data-v-171df494]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:rgba(0,0,0,.2)}.picker[data-v-171df494]{position:fixed;left:0;right:0;bottom:0;height:270px;z-index:10000;background:#fff}.picker-title[data-v-171df494]{position:relative;height:44px;color:#333}.picker-title[data-v-171df494]:after{content:"";display:block;border-bottom:1px solid #ebebeb;left:0;right:0;transform:scaleY(.5)}.picker-title span[data-v-171df494]{position:absolute;height:44px;line-height:44px;padding:0 12px;font-size:14px}.picker-title .pt-cancel[data-v-171df494]{left:0;color:#999}.picker-title .pt-submit[data-v-171df494]{right:0;color:#42b983}.picker-title h4[data-v-171df494]{margin:0;font-size:16px;font-weight:400;height:44px;line-height:44px;text-align:center}.picker-panel[data-v-171df494]{position:relative;height:226px;padding:24px 12px;box-sizing:border-box}.picker-panel .picker-mask-bottom[data-v-171df494],.picker-panel .picker-mask-top[data-v-171df494]{position:absolute;left:0;right:0;height:72px;background:#fff;transform:translateZ(0);z-index:1;pointer-events:none}.picker-panel .picker-mask-top[data-v-171df494]{top:24px;background:linear-gradient(180deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.5))}.picker-panel .picker-mask-top[data-v-171df494]:after{content:"";display:block;position:absolute;left:0;right:0;bottom:0;border-bottom:1px solid #ebebeb;transform:scaleY(.5)}.picker-panel .picker-mask-bottom[data-v-171df494]{bottom:24px;background:linear-gradient(0deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.5))}.picker-panel .picker-mask-bottom[data-v-171df494]:before{content:"";display:block;position:absolute;left:0;right:0;top:0;border-bottom:1px solid #ebebeb;transform:scaleY(.5)}.picker-wheel-wrapper[data-v-171df494]{display:flex;align-items:stretch;height:100%}.picker-wheel-wrapper .picker-wheel[data-v-171df494]{flex:1;overflow:hidden}.picker-wheel-wrapper .wheel-scroll[data-v-171df494]{margin-top:72px}.picker-wheel-wrapper .wheel-scroll .wheel-item[data-v-171df494]{height:34px;line-height:34px;font-size:17px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333}',""])},function(t,e){function i(t,e){var i=t[1]||"",o=t[3];if(!o)return i;if(e&&"function"==typeof btoa){var r=s(o);return[i].concat(o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"})).concat([r]).join("\n")}return[i].join("\n")}function s(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var s=i(e,t);return e[2]?"@media "+e[2]+"{"+s+"}":s}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var s={},o=0;o<this.length;o++){var r=this[o][0];"number"==typeof r&&(s[r]=!0)}for(o=0;o<t.length;o++){var n=t[o];"number"==typeof n[0]&&s[n[0]]||(i&&!n[2]?n[2]=i:i&&(n[2]="("+n[2]+") and ("+i+")"),e.push(n))}},e}},function(t,e,i){function s(t){for(var e=0;e<t.length;e++){var i=t[e],s=c[i.id];if(s){s.refs++;for(var o=0;o<s.parts.length;o++)s.parts[o](i.parts[o]);for(;o<i.parts.length;o++)s.parts.push(r(i.parts[o]));s.parts.length>i.parts.length&&(s.parts.length=i.parts.length)}else{for(var n=[],o=0;o<i.parts.length;o++)n.push(r(i.parts[o]));c[i.id]={id:i.id,refs:1,parts:n}}}}function o(){var t=document.createElement("style");return t.type="text/css",p.appendChild(t),t}function r(t){var e,i,s=document.querySelector("style["+g+'~="'+t.id+'"]');if(s){if(f)return m;s.parentNode.removeChild(s)}if(y){var r=u++;s=d||(d=o()),e=n.bind(null,s,r,!1),i=n.bind(null,s,r,!0)}else s=o(),e=a.bind(null,s),i=function(){s.parentNode.removeChild(s)};return e(t),function(s){if(s){if(s.css===t.css&&s.media===t.media&&s.sourceMap===t.sourceMap)return;e(t=s)}else i()}}function n(t,e,i,s){var o=i?"":s.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var r=document.createTextNode(o),n=t.childNodes;n[e]&&t.removeChild(n[e]),n.length?t.insertBefore(r,n[e]):t.appendChild(r)}}function a(t,e){var i=e.css,s=e.media,o=e.sourceMap;if(s&&t.setAttribute("media",s),v.ssrId&&t.setAttribute(g,e.id),o&&(i+="\n/*# sourceURL="+o.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var h="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!h)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 l=i(8),c={},p=h&&(document.head||document.getElementsByTagName("head")[0]),d=null,u=0,f=!1,m=function(){},v=null,g="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,i,o){f=i,v=o||{};var r=l(t,e);return s(r),function(e){for(var i=[],o=0;o<r.length;o++){var n=r[o],a=c[n.id];a.refs--,i.push(a)}e?(r=l(t,e),s(r)):r=[];for(var o=0;o<i.length;o++){var a=i[o];if(0===a.refs){for(var h=0;h<a.parts.length;h++)a.parts[h]();delete c[a.id]}}}};var x=function(){var t=[];return function(e,i){return t[e]=i,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var i=[],s={},o=0;o<e.length;o++){var r=e[o],n=r[0],a=r[1],h=r[2],l=r[3],c={id:t+":"+o,css:a,media:h,sourceMap:l};s[n]?s[n].parts.push(c):i.push(s[n]={id:n,parts:[c]})}return i}},function(t,e){t.exports=function(t,e,i,s,o,r){var n,a=t=t||{},h=typeof t.default;"object"!==h&&"function"!==h||(n=t,a=t.default);var l="function"==typeof a?a.options:a;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),i&&(l.functional=!0),o&&(l._scopeId=o);var c;if(r?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},l._ssrRegister=c):s&&(c=s),c){var p=l.functional,d=p?l.render:l.beforeCreate;p?(l._injectStyles=c,l.render=function(t,e){return c.call(e),d(t,e)}):l.beforeCreate=d?[].concat(d,c):[c]}return{esModule:n,exports:a,options:l}}},function(t,e,i){"use strict";function s(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function o(t){for(var e=arguments.length,i=Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];for(var o=0;o<i.length;o++){var r=i[o];for(var n in r)t[n]=r[n]}return t}function r(t){return void 0===t||null===t}function n(t){return!1!==E&&("standard"===E?"transitionEnd"===t?"transitionend":t:E+t.charAt(0).toUpperCase()+t.substr(1))}function a(t,e,i,s){t.addEventListener(e,i,{passive:!1,capture:!!s})}function h(t,e,i,s){t.removeEventListener(e,i,{passive:!1,capture:!!s})}function l(t){for(var e=0,i=0;t;)e-=t.offsetLeft,i-=t.offsetTop,t=t.offsetParent;return{left:e,top:i}}function c(t){if(t instanceof window.SVGElement){var e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}function p(t,e){for(var i in e)if(e[i].test(t[i]))return!0;return!1}function d(t,e){var i=document.createEvent("Event");i.initEvent(e,!0,!0),i.pageX=t.pageX,i.pageY=t.pageY,t.target.dispatchEvent(i)}function u(t){function e(){r=document.createEvent("Event"),r.initEvent(n,a,h),o(r,s)}var i=void 0;"mouseup"===t.type||"mousecancel"===t.type?i=t:"touchend"!==t.type&&"touchcancel"!==t.type||(i=t.changedTouches[0]);var s={};i&&(s.screenX=i.screenX||0,s.screenY=i.screenY||0,s.clientX=i.clientX||0,s.clientY=i.clientY||0);var r=void 0,n="click",a=!0,h=!0;if("undefined"!=typeof MouseEvent)try{r=new MouseEvent(n,o({bubbles:a,cancelable:h},s))}catch(t){e()}else e();r.forwardedTouchEvent=!0,r._constructed=!0,t.target.dispatchEvent(r)}function f(t,e){e.firstChild?m(t,e.firstChild):e.appendChild(t)}function m(t,e){e.parentNode.insertBefore(t,e)}function v(t,e){t.removeChild(e)}function g(t,e,i,s,o,r){var n=t-e,a=Math.abs(n)/i,h=r.deceleration,l=r.itemHeight,c=r.swipeBounceTime,p=r.wheel,d=r.swipeTime,u=d,f=p?4:15,m=t+a/h*(n<0?-1:1);return p&&l&&(m=Math.round(m/l)*l),m<s?(m=o?Math.max(s-o/4,s-o/f*a):s,u=c):m>0&&(m=o?Math.min(o/4,o/f*a):0,u=c),{destination:Math.round(m),duration:u}}function y(){}function x(t){console.error("[BScroll warn]: "+t)}function w(t,e){if(!t)throw new Error("[BScroll] "+e)}function b(t){var e=document.createElement("div"),i=document.createElement("div");return e.style.cssText="position:absolute;z-index:9999;pointerEvents:none",i.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;",i.className="bscroll-indicator","horizontal"===t?(e.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",i.style.height="100%",e.className="bscroll-horizontal-scrollbar"):(e.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",i.style.width="100%",e.className="bscroll-vertical-scrollbar"),e.style.cssText+=";overflow:hidden",e.appendChild(i),e}function T(t,e){this.wrapper=e.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=t,this.direction=e.direction,e.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,e.interactive&&this._addDOMEvents()}function _(t,e){this.wrapper="string"==typeof t?document.querySelector(t):t,this.wrapper||x("can not resolve the wrapper dom"),this.scroller=this.wrapper.children[0],this.scroller||x("the wrapper need at least one child element to be scroller"),this.scrollerStyle=this.scroller.style,this._init(t,e)}/*!
 * better-normal-scroll v1.8.4
 * (c) 2016-2018 ustbhuangyi
 * Released under the MIT License.
 */
var k=function(){function t(t,e){var i=[],s=!0,o=!1,r=void 0;try{for(var n,a=t[Symbol.iterator]();!(s=(n=a.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){o=!0,r=t}finally{try{!s&&a.return&&a.return()}finally{if(o)throw r}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},M="undefined"!=typeof window,P=M&&navigator.userAgent.toLowerCase(),X=P&&/wechatdevtools/.test(P),Y=P&&P.indexOf("android")>0,D=M&&document.createElement("div").style,E=function(){if(!M)return!1;var t={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(var e in t)if(void 0!==D[t[e]])return e;return!1}(),C=n("transform"),W=M&&n("perspective")in D,O=M&&("ontouchstart"in window||X),A=!1!==C,H=M&&n("transition")in D,L={transform:C,transitionTimingFunction:n("transitionTimingFunction"),transitionDuration:n("transitionDuration"),transitionProperty:n("transitionProperty"),transitionDelay:n("transitionDelay"),transformOrigin:n("transformOrigin"),transitionEnd:n("transitionEnd")},z=1,I={touchstart:z,touchmove:z,touchend:z,mousedown:2,mousemove:2,mouseup:2},R={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:.001,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:O,disableTouch:!O,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1},N={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}}},F=function(){return M?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,(t.interval||100/60)/2)}:y}(),U=function(){return M?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:y}(),j=1,B=-1,V=1,$=-1;T.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)}},T.prototype.refresh=function(){this.transitionTime(),this._calculate(),this.updatePosition()},T.prototype.fade=function(t,e){var i=this;if(!e||this.visible){var s=t?250:500;t=t?"1":"0",this.wrapperStyle[L.transitionDuration]=s+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){i.wrapperStyle.opacity=t,i.visible=+t},0)}},T.prototype.updatePosition=function(){if("vertical"===this.direction){var t=Math.round(this.sizeRatioY*this.scroller.y);if(t<0){this.transitionTime(500);var e=Math.max(this.indicatorHeight+3*t,8);this.indicatorStyle.height=e+"px",t=0}else if(t>this.maxPosY){this.transitionTime(500);var i=Math.max(this.indicatorHeight-3*(t-this.maxPosY),8);this.indicatorStyle.height=i+"px",t=this.maxPosY+this.indicatorHeight-i}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=t,this.scroller.options.useTransform?this.indicatorStyle[L.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,8);this.indicatorStyle.width=o+"px",s=0}else if(s>this.maxPosX){this.transitionTime(500);var r=Math.max(this.indicatorWidth-3*(s-this.maxPosX),8);this.indicatorStyle.width=r+"px",s=this.maxPosX+this.indicatorWidth-r}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=s,this.scroller.options.useTransform?this.indicatorStyle[L.transform]="translateX("+s+"px)"+this.scroller.translateZ:this.indicatorStyle.left=s+"px"}},T.prototype.transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[L.transitionDuration]=t+"ms"},T.prototype.transitionTimingFunction=function(t){this.indicatorStyle[L.transitionTimingFunction]=t},T.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},T.prototype._start=function(t){var e=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=e.pageX,this.lastPointY=e.pageY,this.startTime=s(),this._handleMoveEvents(a),this.scroller.trigger("beforeScrollStart")},T.prototype._move=function(t){var e=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var i=e.pageX-this.lastPointX;this.lastPointX=e.pageX;var s=e.pageY-this.lastPointY;this.lastPointY=e.pageY;var o=this.x+i,r=this.y+s;this._pos(o,r)},T.prototype._end=function(t){if(this.initiated){this.initiated=!1,t.preventDefault(),t.stopPropagation(),this._handleMoveEvents(h);var e=this.scroller.options.snap;if(e){var i=e.speed,s=e.easing,o=void 0===s?N.bounce:s,r=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),n=i||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-r.x),1e3),Math.min(Math.abs(this.scroller.y-r.y),1e3)),300);this.scroller.x===r.x&&this.scroller.y===r.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=r,this.scroller.scrollTo(r.x,r.y,n,o))}this.moved&&this.scroller.trigger("scrollEnd",{x:this.scroller.x,y:this.scroller.y})}},T.prototype._pos=function(t,e){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),e<0?e=0:e>this.maxPosY&&(e=this.maxPosY),t=Math.round(t/this.sizeRatioX),e=Math.round(e/this.sizeRatioY),this.scroller.scrollTo(t,e),this.scroller.trigger("scroll",{x:this.scroller.x,y:this.scroller.y})},T.prototype._calculate=function(){if("vertical"===this.direction){var t=this.wrapper.clientHeight;this.indicatorHeight=Math.max(Math.round(t*t/(this.scroller.scrollerHeight||t||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=t-this.indicatorHeight,this.sizeRatioY=this.maxPosY/this.scroller.maxScrollY}else{var e=this.wrapper.clientWidth;this.indicatorWidth=Math.max(Math.round(e*e/(this.scroller.scrollerWidth||e||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=e-this.indicatorWidth,this.sizeRatioX=this.maxPosX/this.scroller.maxScrollX}},T.prototype._addDOMEvents=function(){var t=a;this._handleDOMEvents(t)},T.prototype._removeDOMEvents=function(){var t=h;this._handleDOMEvents(t),this._handleMoveEvents(t)},T.prototype._handleMoveEvents=function(t){this.scroller.options.disableTouch||t(window,"touchmove",this),this.scroller.options.disableMouse||t(window,"mousemove",this)},T.prototype._handleDOMEvents=function(t){this.scroller.options.disableTouch||(t(this.indicator,"touchstart",this),t(window,"touchend",this)),this.scroller.options.disableMouse||(t(this.indicator,"mousedown",this),t(window,"mouseup",this))},function(t){t.prototype._init=function(t,e){this._handleOptions(e),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,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._handleOptions=function(t){this.options=o({},R,t),this.translateZ=this.options.HWCompositing&&W?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&H,this.options.useTransform=this.options.useTransform&&A,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=a;this._handleDOMEvents(t)},t.prototype._removeDOMEvents=function(){var t=h;this._handleDOMEvents(t)},t.prototype._handleDOMEvents=function(t){var e=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(e,"mousemove",this),t(e,"mousecancel",this),t(e,"mouseup",this)),O&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(e,"touchmove",this),t(e,"touchcancel",this),t(e,"touchend",this)),t(this.scroller,L.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()},t.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var t=this,e=!1;Object.defineProperty(this,"isInTransition",{get:function(){return e},set:function(i){e=i;for(var s=t.scroller.children.length?t.scroller.children:[t.scroller],o=e&&!t.pulling?"none":"auto",r=0;r<s.length;r++)s[r].style.pointerEvents=o}})}},t.prototype._handleAutoBlur=function(){this.on("beforeScrollStart",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 e=void 0,i=new MutationObserver(function(i){if(!t._shouldNotRefresh()){for(var s=!1,o=!1,r=0;r<i.length;r++){var n=i[r];if("attributes"!==n.type){s=!0;break}if(n.target!==t.scroller){o=!0;break}}s?t.refresh():o&&(clearTimeout(e),e=setTimeout(function(){t._shouldNotRefresh()||t.refresh()},60))}}),s={attributes:!0,childList:!0,subtree:!0};i.observe(this.scroller,s),this.on("destroy",function(){i.disconnect()})}else this._checkDOMUpdate()},t.prototype._shouldNotRefresh=function(){var t=this.x>0||this.x<this.maxScrollX||this.y>0||this.y<this.maxScrollY;return this.isInTransition||this.stopFromTransition||t},t.prototype._checkDOMUpdate=function(){function t(){if(!this.destroyed){i=c(this.scroller);var t=i.width,r=i.height;s===t&&o===r||this.refresh(),s=t,o=r,e.call(this)}}function e(){var e=this;setTimeout(function(){t.call(e)},1e3)}var i=c(this.scroller),s=i.width,o=i.height;e.call(this)},t.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;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&&(p(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(t)}},t.prototype.refresh=function(){var t=c(this.wrapper);this.wrapperWidth=t.width,this.wrapperHeight=t.height;var e=c(this.scroller);this.scrollerWidth=e.width,this.scrollerHeight=e.height;var i=this.options.wheel;i?(this.items=this.scroller.children,this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=i.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.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0,this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=l(this.wrapper),this.trigger("refresh"),this.resetPosition()},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1}}(_),function(t){t.prototype._start=function(t){var e=I[t.type];if((e===z||0===t.button)&&!(!this.enabled||this.destroyed||this.initiated&&this.initiated!==e)){this.initiated=e,this.options.preventDefault&&!p(t.target,this.options.preventDefaultException)&&t.preventDefault(),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=s(),this.options.wheel&&(this.target=t.target),this.stop();var i=t.touches?t.touches[0]:t;this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=i.pageX,this.pointY=i.pageY,this.trigger("beforeScrollStart")}},t.prototype._move=function(t){if(this.enabled&&!this.destroyed&&I[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault();var e=t.touches?t.touches[0]:t,i=e.pageX-this.pointX,o=e.pageY-this.pointY;this.pointX=e.pageX,this.pointY=e.pageY,this.distX+=i,this.distY+=o;var r=Math.abs(this.distX),n=Math.abs(this.distY),a=s();if(!(a-this.endTime>this.options.momentumLimitTime&&n<this.options.momentumLimitDistance&&r<this.options.momentumLimitDistance)){if(this.directionLocked||this.options.freeScroll||(r>n+this.options.directionLockThreshold?this.directionLocked="h":n>=r+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);o=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)t.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);i=0}i=this.hasHorizontalScroll?i:0,o=this.hasVerticalScroll?o:0,this.movingDirectionX=i>0?$:i<0?V:0,this.movingDirectionY=o>0?B:o<0?j:0;var h=this.x+i,l=this.y+o;(h>0||h<this.maxScrollX)&&(h=this.options.bounce?this.x+i/3:h>0?0:this.maxScrollX),(l>0||l<this.maxScrollY)&&(l=this.options.bounce?this.y+o/3:l>0?0:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(h,l),a-this.startTime>this.options.momentumLimitTime&&(this.startTime=a,this.startX=this.x,this.startY=this.y,1===this.options.probeType&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>1&&this.trigger("scroll",{x:this.x,y:this.y});var c=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,p=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,d=this.pointX-c,u=this.pointY-p;(d>document.documentElement.clientWidth-this.options.momentumLimitDistance||d<this.options.momentumLimitDistance||u<this.options.momentumLimitDistance||u>document.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(t)}}},t.prototype._end=function(t){if(this.enabled&&!this.destroyed&&I[t.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!p(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var e=Math.round(this.x),i=Math.round(this.y),o=e-this.absStartX,r=i-this.absStartY;if(this.directionX=o>0?$:o<0?V:0,this.directionY=r>0?B:r<0?j:0,!this.options.pullDownRefresh||!this._checkPullDown()){if(this._checkClick(t))return void this.trigger("scrollCancel");if(!this.resetPosition(this.options.bounceTime,N.bounce)){this.scrollTo(e,i),this.endTime=s();var n=this.endTime-this.startTime,a=Math.abs(e-this.startX),h=Math.abs(i-this.startY);if(this._events.flick&&n<this.options.flickLimitTime&&a<this.options.flickLimitDistance&&h<this.options.flickLimitDistance)return void this.trigger("flick");var l=0;if(this.options.momentum&&n<this.options.momentumLimitTime&&(h>this.options.momentumLimitDistance||a>this.options.momentumLimitDistance)){var c=this.hasHorizontalScroll?g(this.x,this.startX,n,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options):{destination:e,duration:0},d=this.hasVerticalScroll?g(this.y,this.startY,n,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options):{destination:i,duration:0};e=c.destination,i=d.destination,l=Math.max(c.duration,d.duration),this.isInTransition=!0}else this.options.wheel&&(i=Math.round(i/this.itemHeight)*this.itemHeight,l=this.options.wheel.adjustTime||400);var u=N.swipe;if(this.options.snap){var f=this._nearestSnap(e,i);this.currentPage=f,l=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(e-f.x),1e3),Math.min(Math.abs(i-f.y),1e3)),300),e=f.x,i=f.y,this.directionX=0,this.directionY=0,u=this.options.snap.easing||N.bounce}if(e!==this.x||i!==this.y)return(e>0||e<this.maxScrollX||i>0||i<this.maxScrollY)&&(u=N.swipeBounce),void this.scrollTo(e,i,l,u);this.options.wheel&&(this.selectedIndex=Math.round(Math.abs(this.y/this.itemHeight))),this.trigger("scrollEnd",{x:this.x,y:this.y})}}}},t.prototype._checkClick=function(t){var e=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 i=Math.abs(Math.round(this.y/this.itemHeight)),s=Math.round((this.pointY+l(this.target).top-this.itemHeight/2)/this.itemHeight);this.target=this.items[i+s]}return this.scrollToElement(this.target,this.options.wheel.adjustTime||400,!0,!0,N.swipe),!0}return!e&&(this.options.tap&&d(t,this.options.tap),this.options.click&&!p(t.target,this.options.preventDefaultException)&&u(t),!0)}return!1},t.prototype._resize=function(){var t=this;this.enabled&&(Y&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){t.refresh()},this.options.resizePolling))},t.prototype._startProbe=function(){function t(){var i=e.getComputedPosition();if(e.trigger("scroll",i),!e.isInTransition)return void e.trigger("scrollEnd",i);e.probeTimer=F(t)}U(this.probeTimer),this.probeTimer=F(t);var e=this},t.prototype._transitionProperty=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";this.scrollerStyle[L.transitionProperty]=t},t.prototype._transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.scrollerStyle[L.transitionDuration]=t+"ms",this.options.wheel)for(var e=0;e<this.items.length;e++)this.items[e].style[L.transitionDuration]=t+"ms";if(this.indicators)for(var i=0;i<this.indicators.length;i++)this.indicators[i].transitionTime(t)},t.prototype._transitionTimingFunction=function(t){if(this.scrollerStyle[L.transitionTimingFunction]=t,this.options.wheel)for(var e=0;e<this.items.length;e++)this.items[e].style[L.transitionTimingFunction]=t;if(this.indicators)for(var i=0;i<this.indicators.length;i++)this.indicators[i].transitionTimingFunction(t)},t.prototype._transitionEnd=function(t){t.target===this.scroller&&this.isInTransition&&(this._transitionTime(),this.pulling||this.resetPosition(this.options.bounceTime,N.bounce)||(this.isInTransition=!1,3!==this.options.probeType&&this.trigger("scrollEnd",{x:this.x,y:this.y})))},t.prototype._translate=function(t,e){if(w(!r(t)&&!r(e),"Oops! translate x or y is null or undefined. please check your code."),this.options.useTransform?this.scrollerStyle[L.transform]="translate("+t+"px,"+e+"px)"+this.translateZ:(t=Math.round(t),e=Math.round(e),this.scrollerStyle.left=t+"px",this.scrollerStyle.top=e+"px"),this.options.wheel)for(var i=this.options.wheel.rotate,s=void 0===i?25:i,o=0;o<this.items.length;o++){var n=s*(e/this.itemHeight+o);this.items[o].style[L.transform]="rotateX("+n+"deg)"}if(this.x=t,this.y=e,this.indicators)for(var a=0;a<this.indicators.length;a++)this.indicators[a].updatePosition()},t.prototype._animate=function(t,e,i,o){function r(){var p=s();if(p>=c)return n.isAnimating=!1,n._translate(t,e),void(n.pulling||n.resetPosition(n.options.bounceTime)||n.trigger("scrollEnd",{x:n.x,y:n.y}));p=(p-l)/i;var d=o(p),u=(t-a)*d+a,f=(e-h)*d+h;n._translate(u,f),n.isAnimating&&(n.animateTimer=F(r)),3===n.options.probeType&&n.trigger("scroll",{x:n.x,y:n.y})}var n=this,a=this.x,h=this.y,l=s(),c=l+i;this.isAnimating=!0,U(this.animateTimer),r()},t.prototype.scrollBy=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:N.bounce;t=this.x+t,e=this.y+e,this.scrollTo(t,e,i,s)},t.prototype.scrollTo=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:N.bounce;this.isInTransition=this.options.useTransition&&i>0&&(t!==this.x||e!==this.y),!i||this.options.useTransition?(this._transitionProperty(),this._transitionTimingFunction(s.style),this._transitionTime(i),this._translate(t,e),i&&3===this.options.probeType&&this._startProbe(),this.options.wheel&&(e>0?this.selectedIndex=0:e<this.maxScrollY?this.selectedIndex=this.items.length-1:this.selectedIndex=Math.round(Math.abs(e/this.itemHeight)))):this._animate(t,e,i,s.fn)},t.prototype.scrollToElement=function(t,e,i,s,o){if(t&&(t=t.nodeType?t:this.scroller.querySelector(t),!this.options.wheel||t.className===this.options.wheel.wheelItemClass)){var r=l(t);r.left-=this.wrapperOffset.left,r.top-=this.wrapperOffset.top,!0===i&&(i=Math.round(t.offsetWidth/2-this.wrapper.offsetWidth/2)),!0===s&&(s=Math.round(t.offsetHeight/2-this.wrapper.offsetHeight/2)),r.left-=i||0,r.top-=s||0,r.left=r.left>0?0:r.left<this.maxScrollX?this.maxScrollX:r.left,r.top=r.top>0?0:r.top<this.maxScrollY?this.maxScrollY:r.top,this.options.wheel&&(r.top=Math.round(r.top/this.itemHeight)*this.itemHeight),this.scrollTo(r.left,r.top,e,o)}},t.prototype.resetPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.bounce,i=this.x,s=Math.round(i);!this.hasHorizontalScroll||s>0?i=0:s<this.maxScrollX&&(i=this.maxScrollX);var o=this.y,r=Math.round(o);return!this.hasVerticalScroll||r>0?o=0:r<this.maxScrollY&&(o=this.maxScrollY),(i!==this.x||o!==this.y)&&(this.scrollTo(i,o,t,e),!0)},t.prototype.getComputedPosition=function(){var t=window.getComputedStyle(this.scroller,null),e=void 0,i=void 0;return this.options.useTransform?(t=t[L.transform].split(")")[0].split(", "),e=+(t[12]||t[4]),i=+(t[13]||t[5])):(e=+t.left.replace(/[^-\d.]/g,""),i=+t.top.replace(/[^-\d.]/g,"")),{x:e,y:i}},t.prototype.stop=function(){if(this.options.useTransition&&this.isInTransition){this.isInTransition=!1;var t=this.getComputedPosition();this._translate(t.x,t.y),this.options.wheel?this.target=this.items[Math.round(-t.y/this.itemHeight)]:this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0}else!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0)},t.prototype.destroy=function(){this.destroyed=!0,this.trigger("destroy"),this._removeDOMEvents(),this._events={}}}(_),function(t){t.prototype.on=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._events[t]||(this._events[t]=[]),this._events[t].push([e,i])},t.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(s,arguments)}var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;i.fn=e,this.on(t,i)},t.prototype.off=function(t,e){var i=this._events[t];if(i)for(var s=i.length;s--;)(i[s][0]===e||i[s][0]&&i[s][0].fn===e)&&(i[s][0]=void 0)},t.prototype.trigger=function(t){var e=this._events[t];if(e)for(var i=e.length,s=[].concat(S(e)),o=0;o<i;o++){var r=s[o],n=k(r,2),a=n[0],h=n[1];a&&a.apply(h,[].slice.call(arguments,1))}}}(_),function(t){t.prototype._initSnap=function(){var t=this;this.currentPage={};var e=this.options.snap;if(e.loop){var i=this.scroller.children;i.length>0&&(f(i[i.length-1].cloneNode(!0),this.scroller),this.scroller.appendChild(i[1].cloneNode(!0)))}var s=e.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 i=e.stepX||t.wrapperWidth,o=e.stepY||t.wrapperHeight,r=0,n=void 0,a=void 0,h=void 0,l=0,p=void 0,d=0,u=void 0,f=void 0;if(s)for(p=s.length,u=-1;l<p;l++)f=c(s[l]),(0===l||f.left<=c(s[l-1]).left)&&(d=0,u++),t.pages[d]||(t.pages[d]=[]),r=Math.max(-f.left,t.maxScrollX),n=Math.max(-f.top,t.maxScrollY),a=r-Math.round(f.width/2),h=n-Math.round(f.height/2),t.pages[d][u]={x:r,y:n,width:f.width,height:f.height,cx:a,cy:h},r>t.maxScrollX&&d++;else for(a=Math.round(i/2),h=Math.round(o/2);r>-t.scrollerWidth;){for(t.pages[l]=[],p=0,n=0;n>-t.scrollerHeight;)t.pages[l][p]={x:Math.max(r,t.maxScrollX),y:Math.max(n,t.maxScrollY),width:i,height:o,cx:r-a,cy:n-h},n-=o,p++;r-=i,l++}var m=e.loop?1:0;t._goToPage(t.currentPage.pageX||m,t.currentPage.pageY||0,0);var v=e.threshold;v%1==0?(t.snapThresholdX=v,t.snapThresholdY=v):(t.snapThresholdX=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].width*v),t.snapThresholdY=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].height*v))}}),this.on("scrollEnd",function(){e.loop&&(0===t.currentPage.pageX&&t._goToPage(t.pages.length-2,t.currentPage.pageY,0),t.currentPage.pageX===t.pages.length-1&&t._goToPage(1,t.currentPage.pageY,0))}),!1!==e.listenFlick&&this.on("flick",function(){var i=e.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,i)}),this.on("destroy",function(){if(e.loop){var i=t.scroller.children;i.length>2&&(v(t.scroller,i[i.length-1]),v(t.scroller,i[0]))}})},t.prototype._nearestSnap=function(t,e){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var i=0;if(Math.abs(t-this.absStartX)<=this.snapThresholdX&&Math.abs(e-this.absStartY)<=this.snapThresholdY)return this.currentPage;t>0?t=0:t<this.maxScrollX&&(t=this.maxScrollX),e>0?e=0:e<this.maxScrollY&&(e=this.maxScrollY);for(var s=this.pages.length;i<s;i++)if(t>=this.pages[i][0].cx){t=this.pages[i][0].x;break}s=this.pages[i].length;for(var o=0;o<s;o++)if(e>=this.pages[0][o].cy){e=this.pages[0][o].y;break}return i===this.currentPage.pageX&&(i+=this.directionX,i<0?i=0:i>=this.pages.length&&(i=this.pages.length-1),t=this.pages[i][0].x),o===this.currentPage.pageY&&(o+=this.directionY,o<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),e=this.pages[0][o].y),{x:t,y:e,pageX:i,pageY:o}},t.prototype._goToPage=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2],s=arguments[3],o=this.options.snap;if(o&&this.pages&&(s=s||o.easing||N.bounce,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),this.pages[t])){e>=this.pages[t].length?e=this.pages[t].length-1:e<0&&(e=0);var r=this.pages[t][e].x,n=this.pages[t][e].y;i=void 0===i?o.speed||Math.max(Math.max(Math.min(Math.abs(r-this.x),1e3),Math.min(Math.abs(n-this.y),1e3)),300):i,this.currentPage={x:r,y:n,pageX:t,pageY:e},this.scrollTo(r,n,i,s)}},t.prototype.goToPage=function(t,e,i,s){var o=this.options.snap;if(o){if(o.loop){var r=this.pages.length-2;t>=r?t=r-1:t<0&&(t=0),t+=1}this._goToPage(t,e,i,s)}},t.prototype.next=function(t,e){var i=this.currentPage.pageX,s=this.currentPage.pageY;i++,i>=this.pages.length&&this.hasVerticalScroll&&(i=0,s++),this._goToPage(i,s,t,e)},t.prototype.prev=function(t,e){var i=this.currentPage.pageX,s=this.currentPage.pageY;i--,i<0&&this.hasVerticalScroll&&(i=0,s--),this._goToPage(i,s,t,e)},t.prototype.getCurrentPage=function(){var t=this.options.snap;return t?t.loop?o({},this.currentPage,{pageX:this.currentPage.pageX-1}):this.currentPage:null}}(_),function(t){t.prototype.wheelTo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.options.wheel&&(this.y=-t*this.itemHeight,this.scrollTo(0,this.y))},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"),void 0===t.selectedIndex&&(t.selectedIndex=0,x("wheel option selectedIndex is required!"))}}(_),function(t){t.prototype._initScrollbar=function(){var t=this,e=this.options.scrollbar,i=e.fade,s=void 0===i||i,o=e.interactive,r=void 0!==o&&o;this.indicators=[];var n=void 0;this.options.scrollX&&(n={el:b("horizontal"),direction:"horizontal",fade:s,interactive:r},this._insertScrollBar(n.el),this.indicators.push(new T(this,n))),this.options.scrollY&&(n={el:b("vertical"),direction:"vertical",fade:s,interactive:r},this._insertScrollBar(n.el),this.indicators.push(new T(this,n))),this.on("refresh",function(){for(var e=0;e<t.indicators.length;e++)t.indicators[e].refresh()}),s&&(this.on("scrollEnd",function(){for(var e=0;e<t.indicators.length;e++)t.indicators[e].fade()}),this.on("scrollCancel",function(){for(var e=0;e<t.indicators.length;e++)t.indicators[e].fade()}),this.on("scrollStart",function(){for(var e=0;e<t.indicators.length;e++)t.indicators[e].fade(!0)}),this.on("beforeScrollStart",function(){for(var e=0;e<t.indicators.length;e++)t.indicators[e].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(t){t.prototype._initPullDown=function(){this.options.probeType=3},t.prototype._checkPullDown=function(){var t=this.options.pullDownRefresh,e=t.threshold,i=void 0===e?90:e,s=t.stop,o=void 0===s?40:s;return!(this.directionY!==B||this.y<i)&&(this.pulling||(this.pulling=!0,this.trigger("pullingDown")),this.scrollTo(this.x,o,this.options.bounceTime,N.bounce),this.pulling)},t.prototype.finishPullDown=function(){this.pulling=!1,this.resetPosition(this.options.bounceTime,N.bounce)}}(_),function(t){t.prototype._initPullUp=function(){this.options.probeType=3,this.pullupWatching=!1,this._watchPullUp()},t.prototype._watchPullUp=function(){function t(e){var s=this;this.movingDirectionY===j&&e.y<=this.maxScrollY+i&&(this.once("scrollEnd",function(){s.pullupWatching=!1}),this.trigger("pullingUp"),this.off("scroll",t))}this.pullupWatching=!0;var e=this.options.pullUpLoad.threshold,i=void 0===e?0:e;this.on("scroll",t)},t.prototype.finishPullUp=function(){var t=this;this.pullupWatching?this.once("scrollEnd",function(){t._watchPullUp()}):this._watchPullUp()}}(_),function(t){t.prototype._initMouseWheel=function(){var t=this;this._handleMouseWheelEvent(a),this.on("destroy",function(){clearTimeout(t.mouseWheelTimer),t._handleMouseWheelEvent(h)}),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 e=this;if(this.enabled){t.preventDefault(),this.firstWheelOpreation&&this.trigger("scrollStart"),this.firstWheelOpreation=!1,clearTimeout(this.mouseWheelTimer),this.mouseWheelTimer=setTimeout(function(){e.options.snap||e.trigger("scrollEnd",{x:e.x,y:e.y}),e.firstWheelOpreation=!0},400);var i=this.options.mouseWheel,s=i.speed,o=void 0===s?20:s,r=i.invert,n=void 0!==r&&r,a=void 0,h=void 0;switch(!0){case"deltaX"in t:1===t.deltaMode?(a=-t.deltaX*o,h=-t.deltaY*o):(a=-t.deltaX,h=-t.deltaY);break;case"wheelDeltaX"in t:a=t.wheelDeltaX/120*o,h=t.wheelDeltaY/120*o;break;case"wheelDelta"in t:a=h=t.wheelDelta/120*o;break;case"detail"in t:a=h=-t.detail/3*o;break;default:return}var l=n?-1:1;a*=l,h*=l,this.hasVerticalScroll||(a=h,h=0);var c=void 0,p=void 0;if(this.options.snap)return c=this.currentPage.pageX,p=this.currentPage.pageY,a>0?c--:a<0&&c++,h>0?p--:h<0&&p++,void this._goToPage(c,p);c=this.x+Math.round(this.hasHorizontalScroll?a:0),p=this.y+Math.round(this.hasVerticalScroll?h:0),this.directionX=a>0?-1:a<0?1:0,this.directionY=h>0?-1:h<0?1:0,c>0?c=0:c<this.maxScrollX&&(c=this.maxScrollX),p>0?p=0:p<this.maxScrollY&&(p=this.maxScrollY),this.scrollTo(c,p),this.trigger("scroll",{x:this.x,y:this.y})}}}(_),_.Version="1.8.4",e.a=_},function(t,e,i){"use strict";var s=i(1);e.a=[Object(s.a)(0,23,!0,"点"),Object(s.a)(0,59,!0,"分"),Object(s.a)(0,59,!0,"秒")]},function(t,e,i){"use strict";function s(t){return t%4==0&&(t%100!=0||t%400==0)}function o(t,e){t=Number(t),e=Number(e);var i=null;switch(e){case 2:i=s(t)?29:28;break;case 1:case 3:case 5:case 7:case 8:case 10:case 12:i=31;break;case 4:case 6:case 9:case 11:default:i=30}return Object(r.a)(1,i,!1,n).map(function(t){return{value:t}})}i.d(e,"a",function(){return d}),i.d(e,"b",function(){return c});var r=i(1),n="日",a=Object(r.a)(1900,2100,!1,"年"),h=Object(r.a)(1,12,!1,"月"),l=h.map(function(t){return{value:t,children:[]}}),c=a.map(function(t){var e={value:t,children:l.slice()};return e.children.forEach(function(e){e.children=o(t.slice(0,-1),e.value.slice(0,-1))}),e}),p=new Date,d=[{value:p.getFullYear()+"年"},{value:p.getMonth()+1+"月"},{value:""+p.getDate()+n}]},function(t,e,i){"use strict";var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("transition",{attrs:{name:"fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.display,expression:"display"}],staticClass:"mask",on:{click:t.hide}})]),t._v(" "),i("transition",{attrs:{name:"slide"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.display,expression:"display"}],staticClass:"picker"},[i("div",{staticClass:"picker-title"},[i("span",{staticClass:"pt-cancel",style:{color:t.colorCancel},on:{click:t.cancel}},[t._v(t._s(t.textCancel))]),t._v(" "),i("span",{staticClass:"pt-submit",style:{color:t.colorConfirm},on:{click:t.confirm}},[t._v(t._s(t.textConfirm))]),t._v(" "),i("h4",{style:{color:t.colorTitle}},[t._v(t._s(t.textTitle))])]),t._v(" "),i("div",{staticClass:"picker-panel"},[i("div",{staticClass:"picker-mask-top"}),t._v(" "),i("div",{staticClass:"picker-mask-bottom"}),t._v(" "),i("div",{ref:"wheelWrapper",staticClass:"picker-wheel-wrapper"},t._l(t.pickerData,function(e,s){return i("div",{key:s,staticClass:"picker-wheel"},[i("ul",{staticClass:"wheel-scroll"},t._l(e,function(e,s){return i("li",{key:s,staticClass:"wheel-item"},[t._v(t._s(e))])}))])}))])])])],1)},o=[],r={render:s,staticRenderFns:o};e.a=r}])});
//# sourceMappingURL=vue-awesome-picker.js.map