PageSourceSearch

https://www.svelt.it/vendors/hammerjs/hammer.min.js?v=kOCs7FI6NO03yo_dHHL24w_naBRljME7Lh_v_T00rKo

js svelt.it collected 2026-10-08 01:39:48 UTC 18,076 bytes, 6 lines download raw bytes

vendor: 4,770 bytes, lines 1-6
1/*! Hammer.JS - v2.0.4 - 2014-09-28
2 * http://hammerjs.github.io/
3 *
4 * Copyright (c) 2014 Jorik Tangelder;
5 * Licensed under the MIT license */
6!function(t,e,i,n){"use strict";var r=["","webkit","moz","MS","ms","o"],s=e.createElement("div"),o="function",a=Math.round,h=Math.abs,u=Date.now;function c(t,e,i){return setTimeout(m(t,i),e)}function l(t,e,i){return!!Array.isArray(t)&&(p(t,i[e],i),!0)}function p(t,e,i){var r;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==n)for(r=0;r<t.length;)e.call(i,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(i,t[r],r,t)}function f(t,e,i){for(var r=Object.keys(e),s=0;s<r.length;)(!i||i&&t[r[s]]===n)&&(t[r[s]]=e[r[s]]),s++;return t}function d(t,e){return f(t,e,!0)}function v(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&f(n,i)}function m(t,e){return function(){return t.apply(e,arguments)}}function g(t,e){return typeof t==o?t.apply(e&&e[0]||n,e):t}function T(t,e){return t===n?e:t}function y(t,e,i){p(_(e),(function(e){t.addEventListener(e,i,!1)}))}function E(t,e,i){p(_(e),(function(e){t.removeEventListener(e,i,!1)}))}function I(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function A(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function D(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function S(t){return Array.prototype.slice.call(t,0)}function w(t,e,i){for(var n=[],r=[],s=0;s<t.length;){var o=e?t[s][e]:t[s];D(r,o)<0&&n.push(t[s]),r[s]=o,s++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function b(t,e){for(var i,s,o=e[0].toUpperCase()+e.slice(1),a=0;a<r.length;){if((s=(i=r[a])?i+o:e)in t)return s;a++}return n}var C=1;function R(t){var e=t.ownerDocument;return e.defaultView||e.parentWindow}var z="ontouchstart"in t,N=b(t,"PointerEvent")!==n,P=z&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),M="touch",O="mouse",x=25,X=1,Y=4,F=8,W=1,q=2,L=4,H=8,k=16,U=q|L,G=H|k,V=U|G,j=["x","y"],Z=["clientX","clientY"];function B(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){g(t.options.enable,[t])&&i.handler(e)},this.init()}function J(t,e,i){var r=i.pointers.length,s=i.changedPointers.length,o=e&X&&r-s==0,a=e&(Y|F)&&r-s==0;i.isFirst=!!o,i.isFinal=!!a,o&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,r=e.pointers,s=r.length;i.firstInput||(i.firstInput=K(e));s>1&&!i.firstMultiple?i.firstMultiple=K(e):1===s&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,c=a?a.center:o.center,l=e.center=Q(r);e.timeStamp=u(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=et(c,l),e.distance=tt(c,l),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};e.eventType!==X&&s.eventType!==Y||(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=$(e.deltaX,e.deltaY),e.scale=a?(p=a.pointers,f=r,tt(f[0],f[1],Z)/tt(p[0],p[1],Z)):1,e.rotation=a?function(t,e){return et(e[1],e[0],Z)-et(t[1],t[0],Z)}(a.pointers,r):0,function(t,e){var i,r,s,o,a=t.lastInterval||e,u=e.timeStamp-a.timeStamp;if(e.eventType!=F&&(u>x||a.velocity===n)){var c=a.deltaX-e.deltaX,l=a.deltaY-e.deltaY,p=function(t,e,i){return{x:e/t||0,y:i/t||0}}(u,c,l);r=p.x,s=p.y,i=h(p.x)>h(p.y)?p.x:p.y,o=$(c,l),t.lastInterval=e}else i=a.velocity,r=a.velocityX,s=a.velocityY,o=a.direction;e.velocity=i,e.velocityX=r,e.velocityY=s,e.direction=o}(i,e);var p,f;var d=t.element;I(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function K(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:a(t.pointers[i].clientX),clientY:a(t.pointers[i].clientY)},i++;return{timeStamp:u(),pointers:e,center:Q(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Q(t){var e=t.length;if(1===e)return{x:a(t[0].clientX),y:a(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:a(i/e),y:a(n/e)}}function $(t,e){return t===e?W:h(t)>=h(e)?t>0?q:L:e>0?H:k}function tt(t,e,i){i||(i=j);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function et(t,e,i){i||(i=j);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}B.prototype={handler:function(){},init:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)}};
vendor: 4,185 bytes, line 6
6var it={mousedown:X,mousemove:2,mouseup:Y},nt="mousedown",rt="mousemove mouseup";function st(){this.evEl=nt,this.evWin=rt,this.allow=!0,this.pressed=!1,B.apply(this,arguments)}v(st,B,{handler:function(t){var e=it[t.type];e&X&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=Y),this.pressed&&this.allow&&(e&Y&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:O,srcEvent:t}))}});var ot={pointerdown:X,pointermove:2,pointerup:Y,pointercancel:F,pointerout:F},at={2:M,3:"pen",4:O,5:"kinect"},ht="pointerdown",ut="pointermove pointerup pointercancel";function ct(){this.evEl=ht,this.evWin=ut,B.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&(ht="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel"),v(ct,B,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=ot[n],s=at[t.pointerType]||t.pointerType,o=s==M,a=D(e,t.pointerId,"pointerId");r&X&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):r&(Y|F)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var lt={touchstart:X,touchmove:2,touchend:Y,touchcancel:F};function pt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,B.apply(this,arguments)}function ft(t,e){var i=S(t.touches),n=S(t.changedTouches);return e&(Y|F)&&(i=w(i.concat(n),"identifier",!0)),[i,n]}v(pt,B,{handler:function(t){var e=lt[t.type];if(e===X&&(this.started=!0),this.started){var i=ft.call(this,t,e);e&(Y|F)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:M,srcEvent:t})}}});var dt={touchstart:X,touchmove:2,touchend:Y,touchcancel:F},vt="touchstart touchmove touchend touchcancel";function mt(){this.evTarget=vt,this.targetIds={},B.apply(this,arguments)}function gt(t,e){var i=S(t.touches),n=this.targetIds;if(e&(2|X)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=S(t.changedTouches),a=[],h=this.target;if(s=i.filter((function(t){return I(t.target,h)})),e===X)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<o.length;)n[o[r].identifier]&&a.push(o[r]),e&(Y|F)&&delete n[o[r].identifier],r++;return a.length?[w(s.concat(a),"identifier",!0),a]:void 0}function Tt(){B.apply(this,arguments);var t=m(this.handler,this);this.touch=new mt(this.manager,t),this.mouse=new st(this.manager,t)}v(mt,B,{handler:function(t){var e=dt[t.type],i=gt.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:M,srcEvent:t})}}),v(Tt,B,{handler:function(t,e,i){var n=i.pointerType==M,r=i.pointerType==O;if(n)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;e&(Y|F)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var yt=b(s.style,"touchAction"),Et=yt!==n,It="compute",At="auto",_t="manipulation",Dt="none",St="pan-x",wt="pan-y";function bt(t,e){this.manager=t,this.set(e)}bt.prototype={set:function(t){t==It&&(t=this.compute()),Et&&(this.manager.element.style[yt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return p(this.manager.recognizers,(function(e){g(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(A(t,Dt))return Dt;var e=A(t,St),i=A(t,wt);if(e&&i)return St+" "+wt;if(e||i)return e?St:wt;if(A(t,_t))return _t;return At}(t.join(" "))},preventDefaults:function(t){if(!Et){var e=t.srcEvent,i=t.offsetDirection;if(!this.manager.session.prevented){var n=this.actions,r=A(n,Dt),s=A(n,wt),o=A(n,St);return r||s&&i&U||o&&i&G?this.preventSrc(e):void 0}e.preventDefault()}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ct=1,Rt=16,zt=32;function Nt(t){this.id=C++,this.manager=null,this.options=d(t||{},this.defaults),this.options.enable=T(this.options.enable,!0),this.state=Ct,this.simultaneous={},this.requireFail=[]}function Pt(t){return t==k?"down":t==H?"up":t==q?"left":t==L?"right":""}function Mt(t,e){var i=e.manager;return i?i.get(t):t}function Ot(){Nt.apply(this,arguments)}
vendor: 9,121 bytes, line 6
6function xt(){Ot.apply(this,arguments),this.pX=null,this.pY=null}function Xt(){Ot.apply(this,arguments)}function Yt(){Nt.apply(this,arguments),this._timer=null,this._input=null}function Ft(){Ot.apply(this,arguments)}function Wt(){Ot.apply(this,arguments)}function qt(){Nt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Lt(t,e){return(e=e||{}).recognizers=T(e.recognizers,Lt.defaults.preset),new Ht(t,e)}Nt.prototype={defaults:{},set:function(t){return f(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(l(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Mt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return l(t,"dropRecognizeWith",this)||(t=Mt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(l(t,"requireFailure",this))return this;var e=this.requireFail;return-1===D(e,t=Mt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(l(t,"dropRequireFailure",this))return this;t=Mt(t,this);var e=D(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(n){e.manager.emit(e.options.event+(n?function(t){if(t&Rt)return"cancel";if(8&t)return"end";if(4&t)return"move";if(2&t)return"start";return""}(i):""),t)}i<8&&n(!0),n(),i>=8&&n(!0)},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=zt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(zt|Ct)))return!1;t++}return!0},recognize:function(t){var e=f({},t);if(!g(this.options.enable,[this,e]))return this.reset(),void(this.state=zt);56&this.state&&(this.state=Ct),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},v(Ot,Nt,{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=6&e,r=this.attrTest(t);return n&&(i&F||!r)?e|Rt:n||r?i&Y?8|e:2&e?4|e:2:zt}}),v(xt,Ot,{defaults:{event:"pan",threshold:10,pointers:1,direction:V},getTouchAction:function(){var t=this.options.direction,e=[];return t&U&&e.push(wt),t&G&&e.push(St),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(e.direction&U?(r=0===s?W:s<0?q:L,i=s!=this.pX,n=Math.abs(t.deltaX)):(r=0===o?W:o<0?H:k,i=o!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return Ot.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Pt(t.direction);e&&this.manager.emit(this.options.event+e,t),this._super.emit.call(this,t)}}),v(Xt,Ot,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(this._super.emit.call(this,t),1!==t.scale){var e=t.scale<1?"in":"out";this.manager.emit(this.options.event+e,t)}}}),v(Yt,Nt,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[At]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(Y|F)&&!r)this.reset();else if(t.eventType&X)this.reset(),this._timer=c((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&Y)return 8;return zt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&Y?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),v(Ft,Ot,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),v(Wt,Ot,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:U|G,pointers:1},getTouchAction:function(){return xt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(U|G)?e=t.velocity:i&U?e=t.velocityX:i&G&&(e=t.velocityY),this._super.attrTest.call(this,t)&&i&t.direction&&t.distance>this.options.threshold&&h(e)>this.options.velocity&&t.eventType&Y},emit:function(t){var e=Pt(t.direction);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),v(qt,Nt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[_t]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&X&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=Y)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||tt(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,o&&s?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=c((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return zt},failTimeout:function(){return this._timer=c((function(){this.state=zt}),this.options.interval,this),zt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Lt.VERSION="2.0.4",Lt.defaults={domEvents:!1,touchAction:It,enable:!0,inputTarget:null,inputClass:null,preset:[[Ft,{enable:!1}],[Xt,{enable:!1},["rotate"]],[Wt,{direction:U}],[xt,{direction:U},["swipe"]],[qt],[qt,{event:"doubletap",taps:2},["tap"]],[Yt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ht(t,e){var i;e=e||{},this.options=d(e,Lt.defaults),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=new((i=this).options.inputClass||(N?ct:P?mt:z?Tt:st))(i,J),this.touchAction=new bt(this,this.options.touchAction),kt(this,!0),p(e.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 kt(t,e){var i=t.element;p(t.options.cssProps,(function(t,n){i.style[b(i.style,n)]=e?t:""}))}Ht.prototype={set:function(t){return f(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?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),s++}},get:function(t){if(t instanceof Nt)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(l(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(l(t,"remove",this))return this;var e=this.recognizers;return t=this.get(t),e.splice(D(e,t),1),this.touchAction.update(),this},on:function(t,e){var i=this.handlers;return p(_(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this},off:function(t,e){var i=this.handlers;return p(_(t),(function(t){e?i[t].splice(D(i[t],e),1):delete i[t]})),this},emit:function(t,i){this.options.domEvents&&function(t,i){var n=e.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(t,i);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&kt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},f(Lt,{INPUT_START:X,INPUT_MOVE:2,INPUT_END:Y,INPUT_CANCEL:F,STATE_POSSIBLE:Ct,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:Rt,STATE_FAILED:zt,DIRECTION_NONE:W,DIRECTION_LEFT:q,DIRECTION_RIGHT:L,DIRECTION_UP:H,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:U,DIRECTION_VERTICAL:G,DIRECTION_ALL:V,Manager:Ht,Input:B,TouchAction:bt,TouchInput:mt,MouseInput:st,PointerEventInput:ct,TouchMouseInput:Tt,SingleTouchInput:pt,Recognizer:Nt,AttrRecognizer:Ot,Tap:qt,Pan:xt,Swipe:Wt,Pinch:Xt,Rotate:Ft,Press:Yt,on:y,off:E,each:p,merge:d,extend:f,inherit:v,bindFn:m,prefixed:b}),typeof define==o&&define.amd?define((function(){return Lt})):"undefined"!=typeof module&&module.exports?module.exports=Lt:t.Hammer=Lt}(window,document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.