!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).AnyTouch=e()}(this,(function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var i=function(){function t(){this.__map={}}return t.prototype.beforeEach=function(t){this.__interceptor=t},t.prototype.on=function(t,e){var n,i,o=Array.isArray(t)?t:[t];try{for(var a=r(o),u=a.next();!u.done;u=a.next()){var c=u.value;this.__map[c]=this.__map[c]||[];var s=this.__map[c];s&&s.push(e)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return this},t.prototype.emit=function(t,e,n){var r=this;void 0!==this.__interceptor?this.__interceptor(t,(function(){r.__emit(t,e),n&&n()})):(this.__emit(t,e),n&&n())},t.prototype.__emit=function(t,e){var n,i,o=this.__map[t];if(Array.isArray(o)&&(null==o?void 0:o.length))try{for(var a=r(o),u=a.next();!u.done;u=a.next()){(0,u.value)(e,t)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}this.event=e},t.prototype.off=function(t,e){var n=this.__map[t];if(void 0!==n)if(void 0===e)delete this.__map[t];else{var r=n.findIndex((function(t){return t===e}));n.splice(r,1)}},t.prototype.destroy=function(){this.__map={}},t}(),o="touchstart",a="touchmove",u="touchend",c="touchcancel",s="mouseup",p="mousemove",f="mousedown";var v,h="start",l="move",m="cancel",d="end",y=((v={})[4]=h,v[5]=l,v[1]=d,v[3]=m,v);function g(t){return y[t]}function _(t,e,n){var r,i,o,a,u,c,s,p={1:(r={},r[0]=(i={},i.move=4,i),r[4]=(o={},o.move=5,o[d]=1,o[m]=3,o),r[5]=(a={},a.move=5,a[d]=1,a[m]=3,a),r),0:(u={},u[4]=(c={},c.move=2,c[d]=1,c[m]=3,c),u[5]=(s={},s.start=2,s.move=2,s[d]=1,s[m]=3,s),u)}[Number(t)][e];return void 0!==p&&p[n]||0}function T(t){[1,3,2].includes(t.state)&&(t.state=0)}function x(t){return[5,1,3].includes(t)}function E(t){if(t.disabled)return t.state=0,!0}function b(t,e){return n(n(n({},t),e),{state:0,disabled:!1})}function M(t){return Math.round(100*t)/100}function L(){var t,e,r,i,o=0;return function(a){if(t=e,void 0!==a){var u=function(t,e){var n=t.phase,r=t.points,i=t.changedPoints,o=t.nativeEvent,a=r.length,u=h===n,c=d===n&&0===a||m===n,s=Date.now(),p=w(r)||w(i),f=p.x,v=p.y,l=o.currentTarget;return Object.assign(t,{id:e,x:f,y:v,timestamp:s,isStart:u,isEnd:c,pointLength:a,currentTarget:l,getOffset:function(t){void 0===t&&(t=l);var e=t.getBoundingClientRect();return{x:f-Math.round(e.left),y:v-Math.round(e.top)}}})}(a,o=Number.MAX_SAFE_INTEGER>o?++o:1);e=u;var c=u.isStart,s=u.pointLength;return c&&(r=u,t=void 0,i=11&&(r=1),Math.acos(r)}(t,e);return function(t,e){return t.x*e.y-e.x*t.y}(t,e)>0&&(n*=-1),N(n)},F=function(t,e){if(0!==t||0!==e)return Math.abs(t)>=Math.abs(e)?0=f&&o.maxPressTime>p?(clearTimeout(i),function(t,e){if(void 0!==n){var r=C({x:t.x-n.x,y:t.y-n.y});return n=t,e.maxDistanceFromPrevTap>=r}return n=t,!0}({x:h,y:l},o)&&function(t){var e=performance.now();if(void 0===r)return r=e,!0;var n=e-r;return r=e,ni)||n.minPressTime>c&&[d,m].includes(o))&&(clearTimeout(r),n.state=2)}}})),n}var et={name:"pinch",threshold:0,pointLength:2};function nt(t,e){var n=b(et,e);return t.compute([k,q],(function(e){if(T(n),!E(n)){var r,i,o=(r=e.pointLength,i=e.scale,e.deltaScale,e.phase,n.pointLength===r&&n.threshold