chunk-484a20ba.af77cc01.js 24 KB

123456789101112
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-484a20ba"],{"2ba8":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"msgbox-fade"}},[t.visible?i("div",{ref:"wrap",staticClass:"preview-wrap"},[i("div",{ref:"mask",staticClass:"preview-mask",on:{click:function(e){t.visible=!1}}}),i("i",{staticClass:"el-icon-close",on:{click:function(e){e.stopPropagation(),t.visible=!1}}}),i("img",{ref:"image",staticClass:"img",style:{transform:"translate("+t.picLeft+"px,"+t.picTop+"px) scale("+t.picScale+")"},attrs:{src:t.imgUrl,alt:""},on:{click:t.handleClickPC}}),i("a",{staticClass:"icon-download",attrs:{href:t.base64Url,download:t.base64Stamp}},[i("i",{staticClass:"el-icon-download"})])]):t._e()])},s=[],r=i("33f8"),o=i("8536"),a=i.n(o),c={name:"imgPreview",data:function(){return{isPcClick:!1,isMobile:Object(r["t"])(),picW:0,picH:0,curPicW:0,curPicH:0,picScale:1,picScaleMid:1,picInitTop:0,picInitLeft:0,picTop:0,picLeft:0,image:null,disX:0,disY:0,base64Url:"",base64Stamp:"meechat_"+(new Date).getTime()}},methods:{initEvent:function(){this.isMobile?this.handleH5():(this.handleDragPC(),this.handleScalePC(),this.$refs.mask.addEventListener("contextmenu",function(t){return t.preventDefault()}))},handleClickPC:function(){!this.isMobile&&this.isPcClick&&(this.visible=!1)},handleDragPC:function(){var t=this;this.image.onmousedown=function(e){return t.isPcClick=!0,t.dragStart(e),t.image.setCapture&&t.image.setCapture(),document.addEventListener("mousemove",t.drag),document.addEventListener("mouseup",t.dragAfter),!1}},handleScalePC:function(){document.body.addEventListener("mousewheel",this.scale)},handleH5:function(){var t=this,e=new a.a.Manager(this.$refs.wrap),i=new a.a.Manager(this.image),n=new a.a.Tap({pointers:1}),s=new a.a.Pan({pointers:1}),r=new a.a.Pinch({pointers:2});i.add([n,s]),e.add([r]),i.on("tap",function(e){t.visible=!1}),i.on("panstart panmove panend tap, multitap",function(e){"panstart"==e.type?t.dragStart(e):"panmove"==e.type?t.drag(e):"panend"==e.type&&t.dragAfter(e)}),e.on("pinchmove pinchin pinchout pinchend",function(e){t.picScale=(t.picScaleMid*e.scale).toFixed(2),"pinchend"==e.type&&(t.picScale<1&&(t.picScale=1),t.picScaleMid=t.picScale)})},dragStart:function(t){var e=this.isMobile?"delta":"client";this.disY=t["".concat(e,"Y")]-this.picTop,this.disX=t["".concat(e,"X")]-this.picLeft,this.curPicW=this.picW*this.picScale,this.curPicH=this.picH*this.picScale},drag:function(t){var e=this.isMobile?"delta":"client";this.isPcClick=!1,this.picTop=t["".concat(e,"Y")]-this.disY,this.picLeft=t["".concat(e,"X")]-this.disX},dragAfter:function(){if(document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.dragAfter),this.image.releaseCapture&&this.image.releaseCapture(),this.picScale<=1||this.curPicW<=this.winW)this.picTop=this.picInitTop,this.picLeft=this.picInitLeft;else if(this.picScale>1){var t=window.innerWidth,e=window.innerHeight,i=(this.curPicW-t)/2,n=(this.curPicH-e)/2;this.picLeft<-i&&(this.picLeft=-i),this.picLeft>i&&(this.picLeft=i),this.picTop<-n&&(this.picTop=-n),this.picTop>n&&(this.picTop=n),i<0&&(this.picLeft=0),n<0&&(this.picTop=0)}},scale:function(t){var e=this.picScale;t=t||window.event,t.deltaY>0?this.picScale=e>.2?e-.1:e:this.picScale+=.1,this.picW*this.picScale-window.innerWidth<0&&(this.picLeft=0),this.picH*this.picScale-window.innerHeight<0&&(this.picTop=0)}},mounted:function(){var t=this;this.image=this.$refs.image;var e=new Image;e.src=this.imgUrl,e.onload=function(){var i=window.innerWidth,n=e.width,s=e.height;t.picW=n>i?i:n,t.picH=n>i?i*s/n:n,t.initEvent()},Object(r["l"])(this.imgUrl,function(e){t.base64Url=e})},destroyed:function(){}},h=c,u=(i("5cfd"),i("17cc")),l=Object(u["a"])(h,n,s,!1,null,"0e94af84",null);e["default"]=l.exports},"49c5":function(t,e,i){},"5cfd":function(t,e,i){"use strict";var n=i("49c5"),s=i.n(n);s.a},8536:function(t,e,i){var n;
  2. /*! Hammer.JS - v2.0.7 - 2016-04-22
  3. * http://hammerjs.github.io/
  4. *
  5. * Copyright (c) 2016 Jorik Tangelder;
  6. * Licensed under the MIT license */
  7. /*! Hammer.JS - v2.0.7 - 2016-04-22
  8. * http://hammerjs.github.io/
  9. *
  10. * Copyright (c) 2016 Jorik Tangelder;
  11. * Licensed under the MIT license */
  12. (function(s,r,o,a){"use strict";var c,h=["","webkit","Moz","MS","ms","o"],u=r.createElement("div"),l="function",p=Math.round,f=Math.abs,d=Date.now;function v(t,e,i){return setTimeout(S(t,i),e)}function m(t,e,i){return!!Array.isArray(t)&&(g(t,i[e],i),!0)}function g(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a){n=0;while(n<t.length)e.call(i,t[n],n,t),n++}else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function T(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=s.console&&(s.console.warn||s.console.log);return r&&r.call(s.console,n,i),t.apply(this,arguments)}}c="function"!==typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==a&&null!==n)for(var s in n)n.hasOwnProperty(s)&&(e[s]=n[s])}return e}:Object.assign;var y=T(function(t,e,i){var n=Object.keys(e),s=0;while(s<n.length)(!i||i&&t[n[s]]===a)&&(t[n[s]]=e[n[s]]),s++;return t},"extend","Use `assign`."),E=T(function(t,e){return y(t,e,!0)},"merge","Use `assign`.");function w(t,e,i){var n,s=e.prototype;n=t.prototype=Object.create(s),n.constructor=t,n._super=s,i&&c(n,i)}function S(t,e){return function(){return t.apply(e,arguments)}}function b(t,e){return typeof t==l?t.apply(e&&e[0]||a,e):t}function C(t,e){return t===a?e:t}function P(t,e,i){g(D(e),function(e){t.addEventListener(e,i,!1)})}function I(t,e,i){g(D(e),function(e){t.removeEventListener(e,i,!1)})}function A(t,e){while(t){if(t==e)return!0;t=t.parentNode}return!1}function _(t,e){return t.indexOf(e)>-1}function D(t){return t.trim().split(/\s+/g)}function x(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);var n=0;while(n<t.length){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function M(t){return Array.prototype.slice.call(t,0)}function L(t,e,i){var n=[],s=[],r=0;while(r<t.length){var o=e?t[r][e]:t[r];x(s,o)<0&&n.push(t[r]),s[r]=o,r++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function O(t,e){var i,n,s=e[0].toUpperCase()+e.slice(1),r=0;while(r<h.length){if(i=h[r],n=i?i+s:e,n in t)return n;r++}return a}var Y=1;function X(){return Y++}function k(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||s}var R=/mobile|tablet|ip(ad|hone|od)|android/i,W="ontouchstart"in s,z=O(s,"PointerEvent")!==a,N=W&&R.test(navigator.userAgent),H="touch",F="pen",q="mouse",U="kinect",j=25,V=1,$=2,G=4,Z=8,B=1,J=2,K=4,Q=8,tt=16,et=J|K,it=Q|tt,nt=et|it,st=["x","y"],rt=["clientX","clientY"];function ot(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){b(t.options.enable,[t])&&i.handler(e)},this.init()}function at(t){var e,i=t.options.inputClass;return e=i||(z?_t:N?kt:W?Nt:bt),new e(t,ct)}function ct(t,e,i){var n=i.pointers.length,s=i.changedPointers.length,r=e&V&&n-s===0,o=e&(G|Z)&&n-s===0;i.isFirst=!!r,i.isFinal=!!o,r&&(t.session={}),i.eventType=e,ht(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function ht(t,e){var i=t.session,n=e.pointers,s=n.length;i.firstInput||(i.firstInput=pt(e)),s>1&&!i.firstMultiple?i.firstMultiple=pt(e):1===s&&(i.firstMultiple=!1);var r=i.firstInput,o=i.firstMultiple,a=o?o.center:r.center,c=e.center=ft(n);e.timeStamp=d(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=gt(a,c),e.distance=mt(a,c),ut(i,e),e.offsetDirection=vt(e.deltaX,e.deltaY);var h=dt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=f(h.x)>f(h.y)?h.x:h.y,e.scale=o?yt(o.pointers,n):1,e.rotation=o?Tt(o.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,lt(i,e);var u=t.element;A(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function ut(t,e){var i=e.center,n=t.offsetDelta||{},s=t.prevDelta||{},r=t.prevInput||{};e.eventType!==V&&r.eventType!==G||(s=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=s.x+(i.x-n.x),e.deltaY=s.y+(i.y-n.y)}function lt(t,e){var i,n,s,r,o=t.lastInterval||e,c=e.timeStamp-o.timeStamp;if(e.eventType!=Z&&(c>j||o.velocity===a)){var h=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,l=dt(c,h,u);n=l.x,s=l.y,i=f(l.x)>f(l.y)?l.x:l.y,r=vt(h,u),t.lastInterval=e}else i=o.velocity,n=o.velocityX,s=o.velocityY,r=o.direction;e.velocity=i,e.velocityX=n,e.velocityY=s,e.direction=r}function pt(t){var e=[],i=0;while(i<t.pointers.length)e[i]={clientX:p(t.pointers[i].clientX),clientY:p(t.pointers[i].clientY)},i++;return{timeStamp:d(),pointers:e,center:ft(e),deltaX:t.deltaX,deltaY:t.deltaY}}function ft(t){var e=t.length;if(1===e)return{x:p(t[0].clientX),y:p(t[0].clientY)};var i=0,n=0,s=0;while(s<e)i+=t[s].clientX,n+=t[s].clientY,s++;return{x:p(i/e),y:p(n/e)}}function dt(t,e,i){return{x:e/t||0,y:i/t||0}}function vt(t,e){return t===e?B:f(t)>=f(e)?t<0?J:K:e<0?Q:tt}function mt(t,e,i){i||(i=st);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.sqrt(n*n+s*s)}function gt(t,e,i){i||(i=st);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return 180*Math.atan2(s,n)/Math.PI}function Tt(t,e){return gt(e[1],e[0],rt)+gt(t[1],t[0],rt)}function yt(t,e){return mt(e[0],e[1],rt)/mt(t[0],t[1],rt)}ot.prototype={handler:function(){},init:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(k(this.element),this.evWin,this.domHandler)}};var Et={mousedown:V,mousemove:$,mouseup:G},wt="mousedown",St="mousemove mouseup";function bt(){this.evEl=wt,this.evWin=St,this.pressed=!1,ot.apply(this,arguments)}w(bt,ot,{handler:function(t){var e=Et[t.type];e&V&&0===t.button&&(this.pressed=!0),e&$&&1!==t.which&&(e=G),this.pressed&&(e&G&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:q,srcEvent:t}))}});var Ct={pointerdown:V,pointermove:$,pointerup:G,pointercancel:Z,pointerout:Z},Pt={2:H,3:F,4:q,5:U},It="pointerdown",At="pointermove pointerup pointercancel";function _t(){this.evEl=It,this.evWin=At,ot.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}s.MSPointerEvent&&!s.PointerEvent&&(It="MSPointerDown",At="MSPointerMove MSPointerUp MSPointerCancel"),w(_t,ot,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),s=Ct[n],r=Pt[t.pointerType]||t.pointerType,o=r==H,a=x(e,t.pointerId,"pointerId");s&V&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):s&(G|Z)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,s,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))}});var Dt={touchstart:V,touchmove:$,touchend:G,touchcancel:Z},xt="touchstart",Mt="touchstart touchmove touchend touchcancel";function Lt(){this.evTarget=xt,this.evWin=Mt,this.started=!1,ot.apply(this,arguments)}function Ot(t,e){var i=M(t.touches),n=M(t.changedTouches);return e&(G|Z)&&(i=L(i.concat(n),"identifier",!0)),[i,n]}w(Lt,ot,{handler:function(t){var e=Dt[t.type];if(e===V&&(this.started=!0),this.started){var i=Ot.call(this,t,e);e&(G|Z)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:H,srcEvent:t})}}});var Yt={touchstart:V,touchmove:$,touchend:G,touchcancel:Z},Xt="touchstart touchmove touchend touchcancel";function kt(){this.evTarget=Xt,this.targetIds={},ot.apply(this,arguments)}function Rt(t,e){var i=M(t.touches),n=this.targetIds;if(e&(V|$)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var s,r,o=M(t.changedTouches),a=[],c=this.target;if(r=i.filter(function(t){return A(t.target,c)}),e===V){s=0;while(s<r.length)n[r[s].identifier]=!0,s++}s=0;while(s<o.length)n[o[s].identifier]&&a.push(o[s]),e&(G|Z)&&delete n[o[s].identifier],s++;return a.length?[L(r.concat(a),"identifier",!0),a]:void 0}w(kt,ot,{handler:function(t){var e=Yt[t.type],i=Rt.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:H,srcEvent:t})}});var Wt=2500,zt=25;function Nt(){ot.apply(this,arguments);var t=S(this.handler,this);this.touch=new kt(this.manager,t),this.mouse=new bt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Ht(t,e){t&V?(this.primaryTouch=e.changedPointers[0].identifier,Ft.call(this,e)):t&(G|Z)&&Ft.call(this,e)}function Ft(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches,s=function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)};setTimeout(s,Wt)}}function qt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var s=this.lastTouches[n],r=Math.abs(e-s.x),o=Math.abs(i-s.y);if(r<=zt&&o<=zt)return!0}return!1}w(Nt,ot,{handler:function(t,e,i){var n=i.pointerType==H,s=i.pointerType==q;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)Ht.call(this,e,i);else if(s&&qt.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ut=O(u.style,"touchAction"),jt=Ut!==a,Vt="compute",$t="auto",Gt="manipulation",Zt="none",Bt="pan-x",Jt="pan-y",Kt=ee();function Qt(t,e){this.manager=t,this.set(e)}function te(t){if(_(t,Zt))return Zt;var e=_(t,Bt),i=_(t,Jt);return e&&i?Zt:e||i?e?Bt:Jt:_(t,Gt)?Gt:$t}function ee(){if(!jt)return!1;var t={},e=s.CSS&&s.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!e||s.CSS.supports("touch-action",i)}),t}Qt.prototype={set:function(t){t==Vt&&(t=this.compute()),jt&&this.manager.element.style&&Kt[t]&&(this.manager.element.style[Ut]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return g(this.manager.recognizers,function(e){b(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),te(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,s=_(n,Zt)&&!Kt[Zt],r=_(n,Jt)&&!Kt[Jt],o=_(n,Bt)&&!Kt[Bt];if(s){var a=1===t.pointers.length,c=t.distance<2,h=t.deltaTime<250;if(a&&c&&h)return}if(!o||!r)return s||r&&i&et||o&&i&it?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ie=1,ne=2,se=4,re=8,oe=re,ae=16,ce=32;function he(t){this.options=c({},this.defaults,t||{}),this.id=X(),this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=ie,this.simultaneous={},this.requireFail=[]}function ue(t){return t&ae?"cancel":t&re?"end":t&se?"move":t&ne?"start":""}function le(t){return t==tt?"down":t==Q?"up":t==J?"left":t==K?"right":""}function pe(t,e){var i=e.manager;return i?i.get(t):t}function fe(){he.apply(this,arguments)}function de(){fe.apply(this,arguments),this.pX=null,this.pY=null}function ve(){fe.apply(this,arguments)}function me(){he.apply(this,arguments),this._timer=null,this._input=null}function ge(){fe.apply(this,arguments)}function Te(){fe.apply(this,arguments)}function ye(){he.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ee(t,e){return e=e||{},e.recognizers=C(e.recognizers,Ee.defaults.preset),new be(t,e)}he.prototype={defaults:{},set:function(t){return c(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(m(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=pe(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return m(t,"dropRecognizeWith",this)?this:(t=pe(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(m(t,"requireFailure",this))return this;var e=this.requireFail;return t=pe(t,this),-1===x(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(m(t,"dropRequireFailure",this))return this;t=pe(t,this);var e=x(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<re&&n(e.options.event+ue(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=re&&n(e.options.event+ue(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=ce},canEmit:function(){var t=0;while(t<this.requireFail.length){if(!(this.requireFail[t].state&(ce|ie)))return!1;t++}return!0},recognize:function(t){var e=c({},t);if(!b(this.options.enable,[this,e]))return this.reset(),void(this.state=ce);this.state&(oe|ae|ce)&&(this.state=ie),this.state=this.process(e),this.state&(ne|se|re|ae)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},w(fe,he,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(ne|se),s=this.attrTest(t);return n&&(i&Z||!s)?e|ae:n||s?i&G?e|re:e&ne?e|se:ne:ce}}),w(de,fe,{defaults:{event:"pan",threshold:10,pointers:1,direction:nt},getTouchAction:function(){var t=this.options.direction,e=[];return t&et&&e.push(Jt),t&it&&e.push(Bt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,s=t.direction,r=t.deltaX,o=t.deltaY;return s&e.direction||(e.direction&et?(s=0===r?B:r<0?J:K,i=r!=this.pX,n=Math.abs(t.deltaX)):(s=0===o?B:o<0?Q:tt,i=o!=this.pY,n=Math.abs(t.deltaY))),t.direction=s,i&&n>e.threshold&&s&e.direction},attrTest:function(t){return fe.prototype.attrTest.call(this,t)&&(this.state&ne||!(this.state&ne)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=le(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),w(ve,fe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ne)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),w(me,he,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$t]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(G|Z)&&!s)this.reset();else if(t.eventType&V)this.reset(),this._timer=v(function(){this.state=oe,this.tryEmit()},e.time,this);else if(t.eventType&G)return oe;return ce},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===oe&&(t&&t.eventType&G?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(ge,fe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ne)}}),w(Te,fe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:et|it,pointers:1},getTouchAction:function(){return de.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(et|it)?e=t.overallVelocity:i&et?e=t.overallVelocityX:i&it&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&G},emit:function(t){var e=le(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),w(ye,he,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),t.eventType&V&&0===this.count)return this.failTimeout();if(n&&s&&i){if(t.eventType!=G)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||mt(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,o&&r?this.count+=1:this.count=1,this._input=t;var a=this.count%e.taps;if(0===a)return this.hasRequireFailures()?(this._timer=v(function(){this.state=oe,this.tryEmit()},e.interval,this),ne):oe}return ce},failTimeout:function(){return this._timer=v(function(){this.state=ce},this.options.interval,this),ce},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==oe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ee.VERSION="2.0.7",Ee.defaults={domEvents:!1,touchAction:Vt,enable:!0,inputTarget:null,inputClass:null,preset:[[ge,{enable:!1}],[ve,{enable:!1},["rotate"]],[Te,{direction:et}],[de,{direction:et},["swipe"]],[ye],[ye,{event:"doubletap",taps:2},["tap"]],[me]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var we=1,Se=2;function be(t,e){this.options=c({},Ee.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=at(this),this.touchAction=new Qt(this,this.options.touchAction),Ce(this,!0),g(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function Ce(t,e){var i,n=t.element;n.style&&(g(t.options.cssProps,function(s,r){i=O(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=s):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}function Pe(t,e){var i=r.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}be.prototype={set:function(t){return c(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?Se:we},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,s=e.curRecognizer;(!s||s&&s.state&oe)&&(s=e.curRecognizer=null);var r=0;while(r<n.length)i=n[r],e.stopped===Se||s&&i!=s&&!i.canRecognizeWith(s)?i.reset():i.recognize(t),!s&&i.state&(ne|se|re)&&(s=e.curRecognizer=i),r++}},get:function(t){if(t instanceof he)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(m(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(m(t,"remove",this))return this;if(t=this.get(t),t){var e=this.recognizers,i=x(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return g(D(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==a){var i=this.handlers;return g(D(t),function(t){e?i[t]&&i[t].splice(x(i[t],e),1):delete i[t]}),this}},emit:function(t,e){this.options.domEvents&&Pe(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};var n=0;while(n<i.length)i[n](e),n++}},destroy:function(){this.element&&Ce(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},c(Ee,{INPUT_START:V,INPUT_MOVE:$,INPUT_END:G,INPUT_CANCEL:Z,STATE_POSSIBLE:ie,STATE_BEGAN:ne,STATE_CHANGED:se,STATE_ENDED:re,STATE_RECOGNIZED:oe,STATE_CANCELLED:ae,STATE_FAILED:ce,DIRECTION_NONE:B,DIRECTION_LEFT:J,DIRECTION_RIGHT:K,DIRECTION_UP:Q,DIRECTION_DOWN:tt,DIRECTION_HORIZONTAL:et,DIRECTION_VERTICAL:it,DIRECTION_ALL:nt,Manager:be,Input:ot,TouchAction:Qt,TouchInput:kt,MouseInput:bt,PointerEventInput:_t,TouchMouseInput:Nt,SingleTouchInput:Lt,Recognizer:he,AttrRecognizer:fe,Tap:ye,Pan:de,Swipe:Te,Pinch:ve,Rotate:ge,Press:me,on:P,off:I,each:g,merge:E,extend:y,assign:c,inherit:w,bindFn:S,prefixed:O});var Ie="undefined"!==typeof s?s:"undefined"!==typeof self?self:{};Ie.Hammer=Ee,n=function(){return Ee}.call(e,i,e,t),n===a||(t.exports=n)})(window,document)}}]);