-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointers.min.js
More file actions
1 lines (1 loc) · 21.8 KB
/
pointers.min.js
File metadata and controls
1 lines (1 loc) · 21.8 KB
1
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}({0:function(t,e,n){t.exports=n("SoY/")},"SoY/":function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._setAttributes(e),this.currentPointers={},this.startingCoordinates=null,this.firstInteractionAt=null,this.hasMoved=!1,this.movingThreshold=2,this.triggeredAt=null,this.succeed=!1,this.subs=[]}var e,n,u;return e=t,(n=[{key:"_setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){e[n]=t[n]}))}},{key:"handle",value:function(t){if("function"==typeof this[t.type])return this[t.type](t)}},{key:"validateConditions",value:function(t){var e=this;return!this.conditions.find((function(n){return!n(t,e)}))}},{key:"pointerdown",value:function(t){0===Object.keys(this.currentPointers).length&&(this.firstInteractionAt=this._getTime(),this.startingCoordinates={},this.startingCoordinates.x=t.clientX,this.startingCoordinates.y=t.clientY),this.currentPointers[t.pointerId]=t}},{key:"pointerup",value:function(t){this.reset(t)}},{key:"pointermove",value:function(t){!this.hasMoved&&this.startingCoordinates&&this.distance(t.clientX,t.clientY)>=this.movingThreshold&&(this.hasMoved=!0)}},{key:"pointerleave",value:function(t){this.reset(t)}},{key:"pointercancel",value:function(t){this.reset(t)}},{key:"pointerenter",value:function(t){}},{key:"reset",value:function(t){delete this.currentPointers[t.pointerId],0===Object.keys(this.currentPointers).length&&(this.startingCoordinates=null,this.firstInteractionAt=null,this.hasMoved=null,this.succeed=!1)}},{key:"distance",value:function(t,e){return Math.sqrt(Math.pow(this.startingCoordinates.x-t,2)+Math.pow(this.startingCoordinates.y-e,2))}},{key:"timeSinceFirstInteraction",value:function(){return this.firstInteractionAt?this._getTime()-this.firstInteractionAt:null}},{key:"runIfOk",value:function(t){if(this.validateConditions(t))if(this.triggeredAt=this._getTime(),t.pevent=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},this),t.data=this.data,this.selector){var e=$(this.selector)[0];t.target==e&&(t.currentTarget=e,this.handler.bind(e)(t))}else this.handler.bind($(this.currentSelector)[0])(t)}},{key:"getAvailableSubs",value:function(){return this.subs}},{key:"_getTime",value:function(){return(new Date).getTime()}}])&&i(e.prototype,n),u&&i(e,u),t}();function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h(t);if(e){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function p(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(i,t);var e,n,r,o=a(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).pressingThreshold=250,e}return e=i,(n=[{key:"handle",value:function(t){f(h(i.prototype),"handle",this).call(this,t)}},{key:"pointerup",value:function(t){this.timeSinceFirstInteraction()<=this.pressingThreshold&&!this.hasMoved&&(this.succeed=!0,this.runIfOk(t)),f(h(i.prototype),"pointerup",this).call(this,t)}}])&&s(e.prototype,n),r&&s(e,r),i}(u);function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=w(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=w(t);if(e){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==b(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(i,t);var e,n,r,o=O(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).pressingThreshold=251,e.subs=["up","down"],e}return e=i,(n=[{key:"handle",value:function(t){d(w(i.prototype),"handle",this).call(this,t)}},{key:"pointerdown",value:function(t){d(w(i.prototype),"pointerdown",this).call(this,t);var e=this,n=this.firstInteractionAt;setTimeout((function(){n!==e.firstInteractionAt||this.hasMoved||(e.succeed=!0,"down"!==e.sub&&null!==e.sub||e.runIfOk(t))}),this.pressingThreshold)}},{key:"pointerup",value:function(t){this.succeed&&"up"===this.sub&&!this.hasMoved&&this.runIfOk(t),d(w(i.prototype),"pointerup",this).call(this,t)}}])&&v(e.prototype,n),r&&v(e,r),i}(u);function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function S(t,e,n){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=E(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function _(t,e){return(_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=E(t);if(e){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R(this,n)}}function R(t,e){return!e||"object"!==k(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(i,t);var e,n,r,o=T(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).pressingThreshold=251,e.subs=["start","move","end","cancel"],e}return e=i,(n=[{key:"handle",value:function(t){S(E(i.prototype),"handle",this).call(this,t)}},{key:"pointermove",value:function(t){!this.hasMoved&&this.startingCoordinates&&this.distance(t.clientX,t.clientY)>=this.movingThreshold&&(this.hasMoved=!0,this.succeed=!0,"start"===this.sub&&this.runIfOk(t)),!this.hasMoved||null!==this.sub&&"move"!==this.sub||this.runIfOk(t)}},{key:"pointerup",value:function(t){this.hasMoved&&"end"===this.sub&&this.runIfOk(t),S(E(i.prototype),"pointerup",this).call(this,t)}},{key:"pointercancel",value:function(t){this.hasMoved&&"cancel"===this.sub&&this.runIfOk(t),S(E(i.prototype),"pointercancel",this).call(this,t)}}])&&P(e.prototype,n),r&&P(e,r),i}(u);function C(t){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function D(t,e,n){return(D="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=J(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function M(t,e){return(M=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=J(t);if(e){var o=J(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return q(this,n)}}function q(t,e){return!e||"object"!==C(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function J(t){return(J=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&M(t,e)}(i,t);var e,n,r,o=A(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).pressingThreshold=250,e.maxTimeBetweenTaps=300,e._tapCount=0,e.sub=2,e}return e=i,(n=[{key:"handle",value:function(t){D(J(i.prototype),"handle",this).call(this,t)}},{key:"pointerup",value:function(t){var e=this;if(this.timeSinceFirstInteraction()<=this.pressingThreshold){this._tapCount++;var n=this._tapCount;setTimeout((function(){n===e._tapCount&&(e._tapCount=0)}),this.maxTimeBetweenTaps),this._tapCount===Number(this.sub)&&this.runIfOk(t)}D(J(i.prototype),"pointerup",this).call(this,t)}},{key:"waitingTime",value:function(){return this.maxTimeBetweenTaps*Number(this.sub)}}])&&x(e.prototype,n),r&&x(e,r),i}(u);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function X(t,e,n){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=z(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function L(t,e){return(L=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=z(t);if(e){var o=z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return U(this,n)}}function U(t,e){return!e||"object"!==B(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var G=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&L(t,e)}(i,t);var e,n,r,o=N(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).subs=["down","up","move","cancel","leave","enter"],e}return e=i,(n=[{key:"handle",value:function(t){X(z(i.prototype),"handle",this).call(this,t)}},{key:"pointerdown",value:function(t){X(z(i.prototype),"pointerdown",this).call(this,t),"down"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t)}},{key:"pointermove",value:function(t){X(z(i.prototype),"pointermove",this).call(this,t),"move"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t)}},{key:"pointerup",value:function(t){"up"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t),X(z(i.prototype),"pointerup",this).call(this,t)}},{key:"pointercancel",value:function(t){"cancel"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t),X(z(i.prototype),"pointercancel",this).call(this,t)}},{key:"pointerleave",value:function(t){"leave"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t),X(z(i.prototype),"pointerleave",this).call(this,t)}},{key:"pointerenter",value:function(t){"enter"===this.sub&&"mouse"===t.pointerType&&this.runIfOk(t)}}])&&F(e.prototype,n),r&&F(e,r),i}(u);function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach((function(e){Q(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var et=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentSelector=null,this.currentJqueryElement=null,this.elements=new Map,this.conditions=[],this.options={},this.events={tap:y,nthtap:Y,press:j,pan:I,mouse:G}}var e,n,r;return e=t,(n=[{key:"_splitEvents",value:function(t){return t.split(" ").map((function(t){var e=[t,null,null],n=t.indexOf(":"),r=t.indexOf(".");return n>-1?(e[0]=t.substr(0,n),r>-1?(e[1]=t.substr(n+1,r-n-1),e[2]=t.substr(r+1)):e[1]=t.substr(n+1)):r>-1&&(e[0]=t.substr(0,r),e[2]=t.substr(r+1)),e}))}},{key:"on",value:function(t,e,n,r){var o=this,i=W(this._refineParameters(t,e,n,r),4);return t=i[0],e=i[1],n=i[2],r=i[3],this._splitEvents(t).forEach((function(t){o._assignEventListeners(t,e,n,r)})),this}},{key:"_refineParameters",value:function(t,e,n,r){return"function"==typeof n&&(r=n,n=null),"function"==typeof e?(r=e,e=null):"object"===V(e)&&(n=e,e=null),[t,e,n,r]}},{key:"_assignEventListeners",value:function(t,e,n,r){var o=t[0],i=t[1],u=t[2];if(!this.events.hasOwnProperty(o))return this.currentJqueryElement.on(o+"."+u,e,n,r),null;this.elements.has(this.currentSelector)||(this.elements.set(this.currentSelector,[]),this.currentJqueryElement.on("pointerenter.pointers pointerdown.pointers pointermove.pointers pointerup.pointers pointercancel.pointers pointerleave.pointers",this._handle.bind(this)));var c=new this.events[o](K(K({},{name:o,sub:i,namespace:null!=u?u:null,selector:e,data:n,handler:r,conditions:this.conditions,jqueryElement:this.currentJqueryElement,currentSelector:this.currentSelector}),this.options));return this.elements.get(this.currentSelector).push(c),c}},{key:"_handle",value:function(t){this.elements.get(this.currentSelector).forEach((function(e){e.handle(t)}))}},{key:"_reset",value:function(){return this.conditions=[],this.options={},this}},{key:"select",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._reset(),this.currentJqueryElement=$(t),this.currentSelector=t,this}},{key:"off",value:function(t,e){var n=this,r=this,o=this._splitEvents(t),i=r.getEvents();return o.forEach((function(t){var o=t[0],u=t[1],c=t[2];if(!r.events.hasOwnProperty(o))return r.currentJqueryElement.off(o+"."+c,e),n;var s=i.findIndex((function(t){return c?t.name===o&&t.sub===u&&t.namespace===c:t.name===o&&t.sub===u}));-1!==s&&i.splice(s,1)})),0===i.length&&this.currentJqueryElement.off("pointerenter.pointers pointerdown.pointers pointermove.pointers pointercancel.pointers pointerup.pointers pointerleave.pointers",e),this}},{key:"pointersCount",value:function(t){return this.conditions.push((function(e,n){return Object.keys(n.currentPointers).length===t||"mouse"===e.pointerType})),this}},{key:"condition",value:function(t){return this.conditions.push(t),this}},{key:"setOptions",value:function(t){return this.options=t,this}},{key:"getEvents",value:function(){return this.elements.get(this.currentSelector)}},{key:"addEvent",value:function(t,e){return this.events[t]=e,this}}])&&tt(e.prototype,n),r&&tt(e,r),t}());window.$p=et.select.bind(et)}});