This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

9 lines
22 KiB
JavaScript
Raw Permalink Normal View History

2021-04-02 02:24:13 +03:00
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Hammer=e()}(this,function(){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var i,a="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign,u=["","webkit","Moz","MS","ms","o"],t="undefined"==typeof document?{style:{}}:document.createElement("div"),n="function",c=Math.round,A=Math.abs,b=Date.now;function h(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o<u.length;){if((i=(n=u[o])?n+r:e)in t)return i;o++}}i="undefined"==typeof window?{}:window;var l=h(t.style,"touchAction"),p=void 0!==l;var f="compute",v="auto",d="manipulation",m="none",g="pan-x",y="pan-y",T=function(){if(!p)return!1;var e={},n=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!n||i.CSS.supports("touch-action",t)}),e}(),E="ontouchstart"in i,I=void 0!==h(i,"PointerEvent"),w=E&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",C="mouse",S=25,_=1,D=4,O=8,x=1,R=2,M=4,N=8,z=16,X=R|M,Y=N|z,F=X|Y,W=["x","y"],q=["clientX","clientY"];function L(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function k(t,e){return typeof t===n?t.apply(e&&e[0]||void 0,e):t}function H(t,e){return-1<t.indexOf(e)}var j=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===f&&(t=this.compute()),p&&this.manager.element.style&&T[t]&&(this.manager.element.style[l]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return L(this.manager.recognizers,function(t){k(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(H(t,m))return m;var e=H(t,g),n=H(t,y);return e&&n?m:e||n?e?g:y:H(t,d)?d:v}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=H(i,m)&&!T[m],o=H(i,y)&&!T[y],s=H(i,g)&&!T[g];if(r){var a=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(a&&u&&c)return}if(!s||!o)return r||o&&n&X||s&&n&Y?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function U(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function V(t){var e=t.length;if(1===e)return{x:c(t[0].clientX),y:c(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:c(n/e),y:c(i/e)}}function G(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:c(t.pointers[n].clientX),clientY:c(t.pointers[n].clientY)},n++;return{timeStamp:b(),pointers:e,center:V(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Z(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function B(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function $(t,e){return t===e?x:A(t)>=A(e)?t<0?R:M:e<0?N:z}function J(t,e,n){return{x:e/t||0,y:n/t||0}}function K(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=G(e)),1<r&&!n.firstMultiple?n.firstMultiple=G(e):1===r&&(n.firstMultiple=!1);var o,s,a,u,c,h,l=n.firstInput,p=n.firstMultiple,f=p?p.center:l.center,v=e.center=V(i);e.timeStamp=b(),e.deltaTime=e.timeStamp-l.timeStamp,e.angle=B(f,v),e.distance=Z(f,v),o=n,a=(s=e).center,u=o.o
//# sourceMappingURL=hammer.min.js.map