@egjs/axes
Advanced tools
Comparing version 3.8.0 to 3.8.1-beta.0
@@ -0,0 +0,0 @@ import { Axis, AxisManager } from "../AxisManager"; |
@@ -0,0 +0,0 @@ import { AxesOption } from "../Axes"; |
@@ -0,0 +0,0 @@ import Component from "@egjs/component"; |
@@ -23,3 +23,3 @@ import { ObjectInterface } from "./types"; | ||
filter(pos: Axis, callback: (value: number, options: AxisOption, key: string) => boolean): Axis; | ||
map<U>(pos: Axis, callback: (value: number, options: AxisOption, key: string) => U): ObjectInterface<U>; | ||
map<U>(pos: Axis, callback: (value: number, options: AxisOption, key: string) => U): Record<string | number, U>; | ||
isOutside(axes?: string[]): boolean; | ||
@@ -26,0 +26,0 @@ getAxisOptions(key: string): AxisOption; |
declare let win: any; | ||
export { win as window }; |
@@ -12,3 +12,3 @@ export declare const DIRECTION_NONE = 1; | ||
export declare const MOUSE_MIDDLE = "middle"; | ||
export declare const VELOCITY_INTERVAL = 16; | ||
export declare const VELOCITY_INTERVAL = 32; | ||
export declare const AXES_METHODS: readonly ["connect", "disconnect", "get", "setTo", "setBy", "setOptions", "setAxis", "stopAnimation", "updateAnimation", "isBounceArea"]; | ||
@@ -15,0 +15,0 @@ export declare const AXES_EVENTS: readonly ["hold", "release", "change", "animationStart", "animationEnd", "finish"]; |
@@ -0,0 +0,0 @@ export declare const getInsidePosition: (destPos: number, range: number[], circular: boolean[], bounce?: number[]) => number; |
@@ -0,0 +0,0 @@ import { ExtendedEvent, InputEventType } from "../types"; |
@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types"; |
@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types"; |
@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types"; |
@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types"; |
@@ -0,0 +0,0 @@ import { InputType } from "./inputType/InputType"; |
@@ -0,0 +0,0 @@ import Axes from "./Axes"; |
import Axes from "./index"; | ||
export default Axes; |
@@ -0,0 +0,0 @@ import { InterruptManager } from "./InterruptManager"; |
@@ -0,0 +0,0 @@ import { Axis } from "../AxisManager"; |
@@ -0,0 +0,0 @@ import { ElementType } from "../types"; |
@@ -27,2 +27,3 @@ import { ActiveEvent, ElementType, InputEventType } from "../types"; | ||
private _dragged; | ||
private _isOverThreshold; | ||
constructor(el: ElementType, options?: PanInputOption); | ||
@@ -43,2 +44,3 @@ mapAxes(axes: string[]): void; | ||
protected _getOffset(properties: number[], direction: boolean[]): number[]; | ||
private _getDistance; | ||
private _attachElementEvent; | ||
@@ -45,0 +47,0 @@ private _detachElementEvent; |
@@ -19,2 +19,3 @@ import { ElementType } from "../types"; | ||
private _baseValue; | ||
private _isOverThreshold; | ||
constructor(el: ElementType, options?: PinchInputOption); | ||
@@ -34,2 +35,3 @@ mapAxes(axes: string[]): void; | ||
private _getOffset; | ||
private _getDistance; | ||
} |
@@ -0,0 +0,0 @@ import { ElementType } from "../types"; |
@@ -0,0 +0,0 @@ import { ElementType } from "../types"; |
@@ -0,0 +0,0 @@ import { AxesOption } from "./Axes"; |
@@ -0,0 +0,0 @@ import Axes, { AxesOption } from "./Axes"; |
@@ -0,0 +0,0 @@ import { Ref } from "@cfcs/core"; |
@@ -8,5 +8,5 @@ import { PanInputOption } from "./inputType/PanInput"; | ||
export declare const cancelAnimationFrame: (key: any) => void; | ||
export declare const map: <T, U>(obj: ObjectInterface<T>, callback: (value: T, key: string) => U) => ObjectInterface<U>; | ||
export declare const filter: <T>(obj: ObjectInterface<T>, callback: (value: T, key: string) => boolean) => ObjectInterface<T>; | ||
export declare const every: <T>(obj: ObjectInterface<T>, callback: (value: T, key: string) => boolean) => boolean; | ||
export declare const map: <T, U>(obj: Record<string | number, T>, callback: (value: T, key: string) => U) => Record<string | number, U>; | ||
export declare const filter: <T>(obj: Record<string | number, T>, callback: (value: T, key: string) => boolean) => Record<string | number, T>; | ||
export declare const every: <T>(obj: Record<string | number, T>, callback: (value: T, key: string) => boolean) => boolean; | ||
export declare const equal: (target: ObjectInterface, base: ObjectInterface) => boolean; | ||
@@ -13,0 +13,0 @@ export declare const roundNumber: (num: number, roundUnit: number) => any; |
@@ -9,3 +9,3 @@ /* | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/agent"),require("@egjs/component"),require("@cfcs/core")):"function"==typeof define&&define.amd?define(["@egjs/agent","@egjs/component","@cfcs/core"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.eg.agent,t.eg.Component,t.core))}(this,function(t,u,h){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var c=function(){return(c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};function l(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function s(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function o(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function _(t,n){return o(t,function(t,e){return t===n[e]})}function a(t,e){return R[e]||(R[e]=q(e)),R[e](t)}function v(t,n){return t&&n?l(t,function(t,e){return a(t,"number"==typeof n?n:n[e])}):t}function d(t){if(!isFinite(t))return 0;var e="".concat(t);if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function f(t,e){return 180*Math.atan2(e,t)/Math.PI}function n(e){var n=!0;return Object.keys(D).forEach(function(t){e&&e[t]===D[t]||(n=!1)}),n}function g(t,e){return t&&e?30:t?6:e?T:1}function p(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function m(e,t,n){var i,s={1:"auto",30:"none",24:"pan-x",6:"pan-y"},r={};return e&&e.style&&(t=t.touchAction||s[n],i=c(c({},D),{"touch-action":"none"===e.style["touch-action"]?"none":t}),Object.keys(i).forEach(function(t){r[t]=e.style[t],e.style[t]=i[t]})),r}function E(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function L(t,e,n,i){return n=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],i=Math.max(n[0],t),Math.min(n[1],i)}function X(t,e){return t<e[0]||t>e[1]}function j(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function x(t,e,n){var i=t,s=e[0],r=(e=e[1])-s;return n[1]&&e<t&&(i=(i-e)%r+s),i=n[0]&&t<s?(i-s)%r+e:i}function b(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function Y(t){var e=!1,n=!1,i=!1;return(t=void 0===t?[]:t).forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=G;break;case"pointer":i=Z}}),i?new tt:e&&n?new et:e?new $:n?new J:null}function M(t,e,n){return Math.max(Math.min(t,n),e)}var y,F,e,P="undefined"==typeof window?{navigator:{userAgent:""}}:window,T=24,w="left",O="right",A="middle",N=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],W=["hold","release","change","animationStart","animationEnd","finish"],V="ontouchstart"in P&&"safari"===t().browser.name,K=function(){if("undefined"!=typeof document)for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),D={"user-select":"none","-webkit-user-drag":"none"},U=function(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e},I=function(t,e){var n;return void 0===e&&(e=!1),"string"==typeof t?(n=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,U(n.childNodes)):U(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===P?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in P&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return I(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},C=P.requestAnimationFrame||P.webkitRequestAnimationFrame,S=P.cancelAnimationFrame||P.webkitCancelAnimationFrame,R=(C&&!S?(y={},F=C,C=function(e){var n=F(function(t){y[n]&&e(t)});return y[n]=!0,n},S=function(t){delete y[t]}):C&&S||(C=function(t){return P.setTimeout(function(){t(P.performance&&P.performance.now&&P.performance.now()||(new Date).getTime())},16)},S=P.clearTimeout),{}),q=function(e){var n=e<1?Math.pow(10,d(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Q=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){t=this._getRoundPos(t).roundPos;this._axes.trigger(new u.ComponentEvent("hold",{pos:t,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa;t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new u.ComponentEvent("release",c(c({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var s=this,r=(void 0===i&&(i=!1),this.animationManager),o=r.axisManager,r=r.getEventInfo(),t=this._getRoundPos(t,e),e=t.roundPos,t=t.roundDepa,a=o.moveTo(e,t),e=(null==n?void 0:n.event)||(null==r?void 0:r.event)||null,t={pos:a.pos,delta:a.delta,bounceRatio:this._getBounceRatio(a.pos),holding:i,inputEvent:e,isTrusted:!!e,input:(null==n?void 0:n.input)||(null==r?void 0:r.input)||null,set:e?this._createUserControll(a.pos):function(){}},i=new u.ComponentEvent("change",t);return this._axes.trigger(i),Object.keys(a.pos).forEach(function(t){var e=a.pos[t];h.getObserver(s._axes,t,e).current=e}),e&&o.set(t.set().destPos),!i.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa,n=(t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),new u.ComponentEvent("animationStart",t));return this._axes.trigger(n),!n.isCanceled()},e.triggerAnimationEnd=function(t){this._axes.trigger(new u.ComponentEvent("animationEnd",{isTrusted:t=void 0===t?!1:t}))},e.triggerFinish=function(t){this._axes.trigger(new u.ComponentEvent("finish",{isTrusted:t=void 0===t?!1:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:c({},t),duration:e};return function(t,e){return t&&(n.destPos=c({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:v(t,n),roundDepa:v(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),z=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),H=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return l(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):c(c({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=l(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?x(t,e.range,e.circular):0})),{pos:c({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return o(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return s(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return l(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!X(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis ".concat(t," does not exist in Axes instance"));n._axis[t]=c(c({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var s=this;Object.keys(this._axis).forEach(function(i){s._axis[i]=c({range:[0,100],startPos:s._axis[i].range[0],bounce:[0,0],circular:[!1,!1]},s._axis[i]),["bounce","circular"].forEach(function(t){var e=s._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),G="ontouchstart"in P,k="PointerEvent"in P,t="MSPointerEvent"in P,Z=k||t,t=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),P.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e=this.prevEvent,n=this._getCenter(t),i=e?this._getMovement(t):{x:0,y:0},s=e?this._getScale(t):1,r=e?f(n.x-e.center.x,n.y-e.center.y):0,o=e?e.deltaX+i.x:i.x,a=e?e.deltaY+i.y:i.y,u=i.x,i=i.y,h=this._latestInterval,c=Date.now(),l=h?c-h.timestamp:0,_=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(_=(h=[(o-h.deltaX)/l,(a-h.deltaY)/l])[0],e=h[1]),this._latestInterval={timestamp:c,deltaX:o,deltaY:a}),{srcEvent:t,scale:s,angle:r,center:n,deltaX:o,deltaY:a,offsetX:u,offsetY:i,velocityX:_,velocityY:e,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,e=e.clientY-t.clientY;return Math.sqrt(n*n+e*e)},e._getButton=function(t){var e={1:w,2:O,4:A},e=this._isTouchEvent(t)?w:e[t.buttons];return e||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===O?P.addEventListener("contextmenu",this._stopContextMenu):e===A&&t.preventDefault()},t}(),J=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton({1:w,2:A,3:O}[t.which],e)&&-1===this.end.indexOf(t.type)?1:0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(t),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(t),tt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=k?["pointerdown"]:["MSPointerDown"],t.move=k?["pointermove"]:["MSPointerMove"],t.end=k?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,s=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(s=!0,i._recentInputs[e]=n)}),s||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(t),et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,t=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),n=t[0],t=t[1];return n.id===t.id?{x:n.x-t.x,y:n.y-t.y}:{x:0,y:0}},t}(t),nt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager,t=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=s,this._animationManager=t}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){!this._interruptManager.isInterrupted()&&t.axes.length&&(this._isStopped=!(e={input:t,event:e}),this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(e),this._moveDistance||this._eventManager.hold(this._axisManager.get(),e),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var s,r,o;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((o=e.srcEvent||e).__childrenAxesAlreadyChanged||(s=this._moveDistance||this._axisManager.get(t.axes),r=l(s,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(r,function(t,e){var n=e.circular,e=e.range;return n&&(n[0]||n[1])?x(t,e,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!X(t,e.range)})&&(this._isOutside=!1),s=this._atOutside(s),r=this._atOutside(r),this.options.nested&&this._isEndofAxis(n,s,r)||(o.__childrenAxesAlreadyChanged=!0),o={input:t,event:e},i?(t=this._animationManager.getDuration(r,s),this._animationManager.animateTo(r,t,o)):this._eventManager.triggerChange(r,s,o,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var s,r,o;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((o=e.srcEvent||e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),s=this._axisManager.get(t.axes),r=this._axisManager.get(),n=this._animationManager.getDisplacement(n),n=b(t.axes,n),n=this._axisManager.get(this._axisManager.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:L(s[n]+t,e.range,e.circular,e.bounce)})),o.__childrenAxesAlreadyReleased=!0,i={depaPos:r,destPos:n=0===(o=this._animationManager.getDuration(n,s,i))?c({},r):n,duration:o,delta:this._axisManager.getDelta(r,n),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(i),this._moveDistance=null,o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=_(o.destPos,r))||0===o.duration?(i||this._eventManager.triggerChange(o.destPos,r,n,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(n):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(o.destPos,o.duration,n))},e._atOutside=function(t){var r=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],e=e.range[1]+e.bounce[1];return e<t?e:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,e=e.circular;return e&&(e[0]||e[1])?t:t<n?n-r._animationManager.interpolate(n-t,s[0]):i<t?i+r._animationManager.interpolate(t-i,s[1]):t})},e._isEndofAxis=function(s,r,o){return this._axisManager.every(r,function(t,e,n){return 0===s[n]||r[n]===o[n]&&(n=t,t=e.range,i=e.bounce,!(e=e.circular)[0]&&n===t[0]-i[0]||!e[1]&&n===t[1]+i[1]);var i})},t}(),it=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}r(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,s,r=this._animateParam;r&&(e=(new Date).getTime()-r.startTime,n=(null==t?void 0:t.destPos)||r.destPos,i=(null==t?void 0:t.duration)||r.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(s=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,r.delta=this.axisManager.getDelta(s,n),r.destPos=n),null!=t&&t.duration&&(s=(e+this._durationOffset)/r.duration,this._durationOffset=s*i-e,r.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var s=this,r=this._animateParam,o=t.pos,a=r.destPos,u=l(o,function(t,e){return t<=a[e]?1:-1}),h=((new Date).getTime()-r.startTime+this._durationOffset)/r.duration,c=this._easing(h);return{pos:this.axisManager.map(o,function(t,e,n){var t=1<=h?a[n]:t+r.delta[n]*(c-s._prevEasingPer)/(1-s._initialEasingPer),i=x(t,e.range,e.circular);return t!==i&&(t=u[n]*(e.range[1]-e.range[0]),a[n]-=t,o[n]-=t),i}),easingPer:this._prevEasingPer=c,finished:1<=c}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,t=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=t,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(n,t,e){var i,s=this;return e=void 0!==e?e:(i=l(t,function(t,e){t=Math.abs(t-n[e]),e=s._options.deceleration;return(t=Math.sqrt(t/e*2))<100?0:t}),Object.keys(i).reduce(function(t,e){return Math.max(t,i[e])},-1/0)),M(e,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return x(t,e.range,e.circular)}),o(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,S(e)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo(),e=(this._animateParam=null,this.axisManager.filter(this.axisManager.get(),function(t,e){return j(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return x(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){t=t.setTo();return t.destPos=this.axisManager.get(t.destPos),t.duration=M(t.duration,this._options.minimumDuration,this._options.maximumDuration),t},e.animateTo=function(t,e,n){var i=this,t=(this.stopAnimation(),this._createAnimationParam(t,e,n)),e=c({},t.depaPos),s=this.eventManager.triggerAnimationStart(t),t=this.getUserControl(t);!s&&this.axisManager.every(t.destPos,function(t,e){return j(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),s&&!_(t.destPos,e)&&(s=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:e,destPos:t.destPos,duration:t.duration,delta:this.axisManager.getDelta(e,t.destPos),isTrusted:!!s,inputEvent:s,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);return _(t,i)||(this.interruptManager.setInterrupt(!0),n=s(t,function(t,e){return i[e]!==t}),Object.keys(n).length&&(n=this.axisManager.map(n,function(t,e){var n=e.range,e=e.circular;return e&&(e[0]||e[1])?t:L(t,n,e)}),_(n,i)||(0<e?this.animateTo(n,e):(this.stopAnimation(),this.eventManager.triggerChange(n),this.finish(!1))))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(l(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),s=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:t,duration:M(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,t),inputEvent:s,input:(null==n?void 0:n.input)||null,isTrusted:!!s,done:this.animationEnd}},e._animateLoop=function(t,i){var s,r,o,a=this;t.duration?(this._animateParam=c(c({},t),{startTime:(new Date).getTime()}),s=l(t.destPos,function(t){return t}),r=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(r),n=!a.eventManager.triggerChange(e.pos,r.pos);(r=e).finished?(t.destPos=a._getFinalPos(t.destPos,s),_(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),i()):n?a.finish(!1):a._raf=C(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,n){var i=this;return l(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:(e=i._getRoundUnit(t,e),a(t,e))})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),e=Math.max(d(e.range[0]),d(e.range[1]),d(t)),i=1/Math.pow(10,e)),i||n},t}()),B=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=c({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new z(i.options),i.axisManager=new H(i.axis),i.eventManager=new Q(i),i.animationManager=new it(i),i.inputObserver=new nt(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}r(t,s);var e=t.prototype;return e.connect=function(t,e){t="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(t),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){return t?0<=(t=this._inputs.indexOf(t))&&(this._inputs[t].disconnect(),this._inputs.splice(t,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return this.animationManager.setTo(t,e=void 0===e?0:e),this},e.setBy=function(t,e){return this.animationManager.setBy(t,e=void 0===e?0:e),this},e.setOptions=function(t){return this.options=c(c({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.8.0",t.TRANSFORM=K,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=T,t.DIRECTION_ALL=30,function(t,e,n,i){var s,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(s=t[a])&&(o=(r<3?s(o):3<r?s(e,n,o):s(e,n))||o);return 3<r&&o&&Object.defineProperty(e,n,o),o}([h.ReactiveSubscribe],t)}(u),t=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=I(t),this.options=c({inputType:["touch","mouse","pointer"],inputButton:[w],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=g(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=m(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),n(this._originalCssProps)||E(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e=this.options.inputButton,n=this._activeEvent,i=n.onEventStart(t,e);!i||!this._enabled||1<n.getTouches(t,e)||!1!==i.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._observer.hold(this,i),this._atRightEdge=V&&i.center.x>window.innerWidth-t,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,s=n.releaseOnScroll,r=n.inputButton,n=n.thresholdAngle,o=this._activeEvent,a=o.onEventMove(t,r),r=o.getTouches(t,r);if(0===r||s&&a&&!a.srcEvent.cancelable)this._onPanend(t);else if(a&&this._enabled&&!(1<r)){s=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?T:6}(a.angle,n);if(o.prevEvent&&V){if(a.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),a.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}t=this._getOffset([a.offsetX,a.offsetY],[p(6,this._direction,s),p(T,this._direction,s)]),r=t.some(function(t){return 0!==t});r&&(!1!==a.srcEvent.cancelable&&a.srcEvent.preventDefault(),a.srcEvent.stopPropagation()),(a.preventSystemEvent=r)&&(this._dragged=!0,this._observer.change(this,a,b(this.axes,t))),o.prevEvent=a}},e._onPanend=function(t){var e=this.options.inputButton,n=this._activeEvent;n.onEventEnd(t),this._enabled&&0===n.getTouches(t,e)&&(this._detachWindowEvent(n),clearTimeout(this._rightEdgeTimer),t=n.prevEvent,e=this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[p(6,this._direction),p(T,this._direction)]),n.onRelease(),this._observer.release(this,t,e))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,{passive:!1})}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,{passive:!1})})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._attachElementEvent=function(t){var e=this,n=Y(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,this._activeEvent=n,this.options.preventClickOnDrag&&i.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(t){i.addEventListener(t,e._onPanstart)}),n.move.forEach(function(t){i.addEventListener(t,e._voidFunction)})}},e._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(this.options.preventClickOnDrag&&n.removeEventListener("click",this._preventClickWhenDragged,!0),null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._voidFunction)})),this._enabled=!1,this._observer=null},t}(),st={default:B,PanInput:t,RotatePanInput:function(n){function t(t,e){t=n.call(this,t,e)||this;return t._prevQuadrant=null,t._lastDiff=0,t}r(t,n);var e=t.prototype;return e.mapAxes=function(t){this._direction=B.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,t=n.onEventStart(t,this.options.inputButton);t&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(t),n.prevEvent=t)},e._onPanmove=function(t){var e=this._activeEvent,t=e.onEventMove(t,this.options.inputButton);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),e.prevEvent=t)},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this.isEnabled()&&(t=i.prevEvent,this._triggerChange(t),n=t.velocityX,e=t.velocityY,n=Math.sqrt(n*n+e*e)*(0<this._lastDiff?-1:1),i.onRelease(),this._observer.release(this,t,[n*this._coefficientForDistanceToAngle]),this._detachWindowEvent(i))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,e=e.y,n=f(n,e),e=n<0?360+n:n,n=this._getQuadrant(t.center.x,t.center.y),i=this._getDifference(this._prevAngle,e,this._prevQuadrant,n);this._prevAngle=e,this._prevQuadrant=n,0!==i&&(this._lastDiff=i,this._observer.change(this,t,b(this.axes,[-i])))},e._getDifference=function(t,e,n,i){n=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return n},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var t=this._getPosFromOrigin(t,e),e=t.x,t=t.y,n=0;return 0<=e&&0<=t?n=1:e<0&&0<=t?n=2:e<0&&t<0?n=3:0<=e&&t<0&&(n=4),n},t}(t),PinchInput:function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=I(t),this.options=c({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=m(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),n(this._originalCssProps)||E(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,b(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=Y(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,(this._activeEvent=n).start.forEach(function(t){i.addEventListener(t,e._onPinchStart,!1)}),n.move.forEach(function(t){i.addEventListener(t,e._onPinchMove,!1)}),n.end.forEach(function(t){i.addEventListener(t,e._onPinchEnd,!1)})}},e._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){n.removeEventListener(t,e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return this._baseValue*(t-(e=void 0===e?1:e))*this.options.scale},t}(),WheelInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=I(t),this.options=c({scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=g(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;!this._enabled||0===(e=this._getOffset([t.deltaY,t.deltaX],[p(T,this._direction),p(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,b(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element&&this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),MoveKeyInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=I(t),this.options=c({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(n=-1===s&&!this.axes[0]||1===s&&!this.axes[1]?!1:n)&&(t.preventDefault(),e=-1===s?[+this.options.scale[0]*i,0]:[0,+this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,b(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("keydown",this._onKeydown,!1),e.addEventListener("keypress",this._onKeydown,!1),e.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){var t=this.element;t&&(t.removeEventListener("keydown",this._onKeydown,!1),t.removeEventListener("keypress",this._onKeydown,!1),t.removeEventListener("keyup",this._onKeyup,!1)),this._enabled=!1,this._observer=null},t}(),AXES_METHODS:N,AXES_EVENTS:W,REACTIVE_AXES:{methods:N,events:W,created:function(t){return new B(t.axis,t.options)},on:function(t,e,n){t.on(e,n)},off:function(t,e,n){t.off(e,n)},destroy:function(t){t.destroy()}}};for(e in st)B[e]=st[e];return B}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/agent"),require("@egjs/component"),require("@cfcs/core")):"function"==typeof define&&define.amd?define(["@egjs/agent","@egjs/component","@cfcs/core"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.eg.agent,t.Component,t.core))}(this,function(t,f,g){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,p=function(){return(p=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};s="undefined"==typeof window?{navigator:{userAgent:""}}:window;function o(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var a,u,m=24,h="left",c="right",l="middle",e=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],n=["hold","release","change","animationStart","animationEnd","finish"],E="ontouchstart"in s&&"safari"===t().browser.name,v=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),_={"user-select":"none","-webkit-user-drag":"none"},d=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,o(n.childNodes)):o(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t===s?i=t:"value"in t||"current"in t?i=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in s&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return d(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},x=s.requestAnimationFrame||s.webkitRequestAnimationFrame,b=s.cancelAnimationFrame||s.webkitCancelAnimationFrame;x&&!b?(a={},u=x,x=function(e){var n=u(function(t){a[n]&&e(t)});return a[n]=!0,n},b=function(t){delete a[t]}):x&&b||(x=function(t){return s.setTimeout(function(){t(s.performance&&s.performance.now&&s.performance.now()||(new Date).getTime())},16)},b=s.clearTimeout);function M(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function y(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function P(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function T(t,n){return P(t,function(t,e){return t===n[e]})}function O(t,e){return W[e]||(W[e]=V(e)),W[e](t)}function w(t,n){return t&&n?M(t,function(t,e){return O(t,"number"==typeof n?n:n[e])}):t}function A(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function D(t,e){return 180*Math.atan2(e,t)/Math.PI}function I(e){var n=!0;return Object.keys(_).forEach(function(t){e&&e[t]===_[t]||(n=!1)}),n}function C(t,e){return t&&e?30:t?6:e?m:1}function S(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function R(e,t,n){var i,s,r,o=((i={})[1]="auto",i[30]="none",i[m]="pan-x",i[6]="pan-y",i),a={};return e&&e.style&&(s=t.touchAction?t.touchAction:o[n],r=p(p({},_),{"touch-action":"none"===e.style["touch-action"]?"none":s}),Object.keys(r).forEach(function(t){a[t]=e.style[t],e.style[t]=r[t]})),a}function k(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function B(t,e,n,i){var s=t,r=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],s=Math.max(r[0],s);return Math.min(r[1],s)}function L(t,e){return t<e[0]||t>e[1]}function X(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function j(t,e,n){var i=t,s=e[0],r=e[1],o=r-s;return n[1]&&r<t&&(i=(i-r)%o+s),n[0]&&t<s&&(i=(i-s)%o+r),i}function Y(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function F(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=Q;break;case"pointer":i=G}}),i?new tt:e&&n?new et:e?new $:n?new J:null}function N(t,e,n){return Math.max(Math.min(t,n),e)}var W={},V=function(e){var n=e<1?Math.pow(10,A(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},K=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new f.ComponentEvent("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new f.ComponentEvent("release",p(p({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var s=this;void 0===i&&(i=!1);var r=this.animationManager,o=r.axisManager,a=r.getEventInfo(),u=this._getRoundPos(t,e),h=u.roundPos,c=u.roundDepa,l=o.moveTo(h,c),v=(null==n?void 0:n.event)||(null==a?void 0:a.event)||null,_={pos:l.pos,delta:l.delta,bounceRatio:this._getBounceRatio(l.pos),holding:i,inputEvent:v,isTrusted:!!v,input:(null==n?void 0:n.input)||(null==a?void 0:a.input)||null,set:v?this._createUserControll(l.pos):function(){}},d=new f.ComponentEvent("change",_);return this._axes.trigger(d),Object.keys(l.pos).forEach(function(t){var e=l.pos[t];g.getObserver(s._axes,t,e).current=e}),v&&o.set(_.set().destPos),!d.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var s=new f.ComponentEvent("animationStart",t);return this._axes.trigger(s),!s.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new f.ComponentEvent("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new f.ComponentEvent("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:p({},t),duration:e};return function(t,e){return t&&(n.destPos=p({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:w(t,n),roundDepa:w(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),q=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),U=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return M(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):p(p({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=M(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?j(t,e.range,e.circular):0})),{pos:p({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return P(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return y(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return M(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!L(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis "+t+" does not exist in Axes instance");n._axis[t]=p(p({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var s=this;Object.keys(this._axis).forEach(function(i){s._axis[i]=p({range:[0,100],startPos:s._axis[i].range[0],bounce:[0,0],circular:[!1,!1]},s._axis[i]),["bounce","circular"].forEach(function(t){var e=s._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),Q="ontouchstart"in s,z="PointerEvent"in s,H="MSPointerEvent"in s,G=z||H,Z=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),s.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),s=n?this._getMovement(t):{x:0,y:0},r=n?this._getScale(t):1,o=n?D(i.x-n.center.x,i.y-n.center.y):0,a=n?n.deltaX+s.x:s.x,u=n?n.deltaY+s.y:s.y,h=s.x,c=s.y,l=this._latestInterval,v=Date.now(),_=l?v-l.timestamp:0,d=n?n.velocityX:0,f=n?n.velocityY:0;return(!l||32<=_)&&(l&&(d=(e=[(a-l.deltaX)/_,(u-l.deltaY)/_])[0],f=e[1]),this._latestInterval={timestamp:v,deltaX:a,deltaY:u}),{srcEvent:t,scale:r,angle:o,center:i,deltaX:a,deltaY:u,offsetX:h,offsetY:c,velocityX:d,velocityY:f,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:h,2:c,4:l},n=this._isTouchEvent(t)?h:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===c?s.addEventListener("contextmenu",this._stopContextMenu):e===l&&t.preventDefault()},t}(),J=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){if(e){var n={1:h,2:l,3:c};return this._isValidButton(n[t.which],e)&&-1===this.end.indexOf(t.type)?1:0}return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(Z),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(Z),tt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=z?["pointerdown"]:["MSPointerDown"],t.move=z?["pointermove"]:["MSPointerMove"],t.end=z?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,s=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(s=!0,i._recentInputs[e]=n)}),s||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(Z),et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,n=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),i=n[0],s=n[1];return i.id===s.id?{x:i.x-s.x,y:i.y-s.y}:{x:0,y:0}},t}(Z),nt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager,r=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=s,this._animationManager=r}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var s,r,o,a,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(r=this._moveDistance||this._axisManager.get(t.axes),o=M(r,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?j(t,i,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!L(t,e.range)})&&(this._isOutside=!1),r=this._atOutside(r),o=this._atOutside(o),this.options.nested&&this._isEndofAxis(n,r,o)||(s.__childrenAxesAlreadyChanged=!0),a={input:t,event:e},i?(u=this._animationManager.getDuration(o,r),this._animationManager.animateTo(o,u,a)):this._eventManager.triggerChange(o,r,a,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var s,r,o,a,u,h,c,l,v,_,d;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),r=this._axisManager.get(t.axes),o=this._axisManager.get(),a=this._animationManager.getDisplacement(n),u=Y(t.axes,a),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:B(r[n]+t,e.range,e.circular,e.bounce)})),s.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,r,i))&&(h=p({},o)),l={depaPos:o,destPos:h,duration:c,delta:this._axisManager.getDelta(o,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),d={input:t,event:e},(_=T(v.destPos,o))||0===v.duration?(_||this._eventManager.triggerChange(v.destPos,o,d,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(d):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,d))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,r=e.circular;return r&&(r[0]||r[1])?t:t<n?n-o._animationManager.interpolate(n-t,s[0]):i<t?i+o._animationManager.interpolate(t-i,s[1]):t})},e._isEndofAxis=function(a,u,h){return this._axisManager.every(u,function(t,e,n){return 0===a[n]||u[n]===h[n]&&(i=t,s=e.range,r=e.bounce,!(o=e.circular)[0]&&i===s[0]-r[0]||!o[1]&&i===s[1]+r[1]);var i,s,r,o})},t}(),it=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}r(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,s,r,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=(null==t?void 0:t.duration)||o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(s=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(s,n),o.destPos=n),null!=t&&t.duration&&(r=(e+this._durationOffset)/o.duration,this._durationOffset=r*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var o=this,a=this._animateParam,u=t.pos,h=a.destPos,c=M(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-a.startTime+this._durationOffset)/a.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,s=1<=l?h[n]:t+a.delta[n]*(v-o._prevEasingPer)/(1-o._initialEasingPer),r=j(s,e.range,e.circular);return s!==r&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),r}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=s,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(r,t,e){var n,i,o=this;return i=void 0!==e?e:(n=M(t,function(t,e){return n=Math.abs(t-r[e]),i=o._options.deceleration,(s=Math.sqrt(n/i*2))<100?0:s;var n,i,s}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),N(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return j(t,e.range,e.circular)}),P(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._raf&&(i=this._raf,b(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)),this.finish(!1))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return X(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return j(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=N(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var s,r=this._createAnimationParam(t,e,n),o=p({},r.depaPos),a=this.eventManager.triggerAnimationStart(r),u=this.getUserControl(r);!a&&this.axisManager.every(u.destPos,function(t,e){return X(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!T(u.destPos,o)&&(s=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:o,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(o,u.destPos),isTrusted:!!s,inputEvent:s,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(T(t,i))return this;this.interruptManager.setInterrupt(!0);var s=y(t,function(t,e){return i[e]!==t});return Object.keys(s).length?(s=this.axisManager.map(s,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:B(t,n,i)}),T(s,i)||(0<e?this.animateTo(s,e):(this.stopAnimation(),this.eventManager.triggerChange(s),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(M(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),s=t,r=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:s,duration:N(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,s),inputEvent:r,input:(null==n?void 0:n.input)||null,isTrusted:!!r,done:this.animationEnd}},e._animateLoop=function(t,i){var s,r,o,a=this;t.duration?(this._animateParam=p(p({},t),{startTime:(new Date).getTime()}),s=M(t.destPos,function(t){return t}),r=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(r),n=!a.eventManager.triggerChange(e.pos,r.pos);if((r=e).finished)return t.destPos=a._getFinalPos(t.destPos,s),T(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),void i();n?a.finish(!1):a._raf=x(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var s=this;return M(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=s._getRoundUnit(t,e);return O(t,n)})},e._getRoundUnit=function(t,e){var n,i,s=this._options.round,r=null;return s||(n=this.axisManager.getAxisOptions(e),i=Math.max(A(n.range[0]),A(n.range[1]),A(t)),r=1/Math.pow(10,i)),r||s},t}()),st=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=p({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new q(i.options),i.axisManager=new U(i.axis),i.eventManager=new K(i),i.animationManager=new it(i),i.inputObserver=new nt(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}r(t,s);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.setOptions=function(t){return this.options=p(p({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.8.0",t.TRANSFORM=v,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=m,t.DIRECTION_ALL=30,function(t,e,n,i){var s,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(s=t[a])&&(o=(r<3?s(o):3<r?s(e,n,o):s(e,n))||o);return 3<r&&o&&Object.defineProperty(e,n,o),o}([g.ReactiveSubscribe],t)}(f),rt=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=d(t),this.options=p({inputType:["touch","mouse","pointer"],inputButton:[h],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=C(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=R(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),I(this._originalCssProps)||k(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e,n=this.options.inputButton,i=this._activeEvent,s=i.onEventStart(t,n);!s||!this._enabled||1<i.getTouches(t,n)||!1!==s.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,s),this._atRightEdge=E&&s.center.x>window.innerWidth-e,this._attachWindowEvent(i),i.prevEvent=s)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,s=n.releaseOnScroll,r=n.inputButton,o=n.threshold,a=n.thresholdAngle,u=this._activeEvent,h=u.onEventMove(t,r),c=u.getTouches(t,r);if(0===c||s&&h&&!h.srcEvent.cancelable)this._onPanend(t);else if(h&&this._enabled&&!(1<c)){var l=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?m:6}(h.angle,a),v=S(6,this._direction,l),_=S(m,this._direction,l);if(u.prevEvent&&E){if(h.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),h.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}var d=this._getDistance([h.deltaX,h.deltaY],[v,_]),f=this._getOffset([h.offsetX,h.offsetY],[v,_]),g=f.some(function(t){return 0!==t});g&&(!1!==h.srcEvent.cancelable&&h.srcEvent.preventDefault(),h.srcEvent.stopPropagation()),(h.preventSystemEvent=g)&&(this._isOverThreshold||o<=d)&&(this._dragged=!0,this._isOverThreshold=!0,this._observer.change(this,h,Y(this.axes,f))),u.prevEvent=h}},e._onPanend=function(t){var e,n,i=this.options.inputButton,s=this._activeEvent;s.onEventEnd(t),this._enabled&&0===s.getTouches(t,i)&&(this._detachWindowEvent(s),clearTimeout(this._rightEdgeTimer),e=s.prevEvent,n=this._isOverThreshold?this._getOffset([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[S(6,this._direction),S(m,this._direction)]):[0,0],s.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,{passive:!1})}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,{passive:!1})})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._getDistance=function(t,e){return Math.sqrt(Number(e[0])*Math.pow(t[0],2)+Number(e[1])*Math.pow(t[1],2))},e._attachElementEvent=function(t){var e=this,n=F(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,this._activeEvent=n,this.options.preventClickOnDrag&&i.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(t){i.addEventListener(t,e._onPanstart)}),n.move.forEach(function(t){i.addEventListener(t,e._voidFunction)})}},e._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(this.options.preventClickOnDrag&&n.removeEventListener("click",this._preventClickWhenDragged,!0),null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._voidFunction)})),this._enabled=!1,this._observer=null},t}(),ot={methods:e,events:n,created:function(t){return new st(t.axis,t.options)},on:function(t,e,n){t.on(e,n)},off:function(t,e,n){t.off(e,n)},destroy:function(t){t.destroy()}},at={default:st,PanInput:rt,RotatePanInput:function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}r(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=st.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,s,r=this._activeEvent;r.onEventEnd(t),this.isEnabled()&&(e=r.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,s=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),r.onRelease(),this._observer.release(this,e,[s*this._coefficientForDistanceToAngle]),this._detachWindowEvent(r))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,s=D(n,i),r=s<0?360+s:s,o=this._getQuadrant(t.center.x,t.center.y),a=this._getDifference(this._prevAngle,r,this._prevQuadrant,o);this._prevAngle=r,this._prevQuadrant=o,0!==a&&(this._lastDiff=a,this._observer.change(this,t,Y(this.axes,[-a])))},e._getDifference=function(t,e,n,i){var s=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return s},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,s=n.y,r=0;return 0<=i&&0<=s?r=1:i<0&&0<=s?r=2:i<0&&s<0?r=3:0<=i&&s<0&&(r=4),r},t}(rt),PinchInput:function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this._isOverThreshold=!1,this.element=d(t),this.options=p({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=R(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),I(this._originalCssProps)||k(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,this._isOverThreshold=!1,e.prevEvent=n)},e._onPinchMove=function(t){var e,n,i=this.options.threshold,s=this._activeEvent,r=s.onEventMove(t);r&&this._pinchFlag&&this._enabled&&2===s.getTouches(t)&&(e=this._getDistance(r.scale),n=this._getOffset(r.scale,s.prevEvent.scale),(this._isOverThreshold||i<=e)&&(this._isOverThreshold=!0,this._observer.change(this,t,Y(this.axes,[n]))),s.prevEvent=r)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=F(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,(this._activeEvent=n).start.forEach(function(t){i.addEventListener(t,e._onPinchStart,!1)}),n.move.forEach(function(t){i.addEventListener(t,e._onPinchMove,!1)}),n.end.forEach(function(t){i.addEventListener(t,e._onPinchEnd,!1)})}},e._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){n.removeEventListener(t,e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},e._getDistance=function(t){return Math.abs(t-1)},t}(),WheelInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=d(t),this.options=p({scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=C(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[S(m,this._direction),S(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,Y(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element&&this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),MoveKeyInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=d(t),this.options=p({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(-1===s&&!this.axes[0]||1===s&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===s?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,Y(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("keydown",this._onKeydown,!1),e.addEventListener("keypress",this._onKeydown,!1),e.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){var t=this.element;t&&(t.removeEventListener("keydown",this._onKeydown,!1),t.removeEventListener("keypress",this._onKeydown,!1),t.removeEventListener("keyup",this._onKeyup,!1)),this._enabled=!1,this._observer=null},t}(),AXES_METHODS:e,AXES_EVENTS:n,REACTIVE_AXES:ot};for(var ut in at)st[ut]=at[ut];return st}); | ||
//# sourceMappingURL=axes.min.js.map |
@@ -9,3 +9,3 @@ /* | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var j=function(t,e){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u=function(){return(u=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function B(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&i>=t.length?void 0:t)&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function c(t){return void 0===t}var r=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=B(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),V=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof r?e.eventType:e,i=o(this._eventHandler[i]||[]);return i.length<=0||(e instanceof r?(e.currentTarget=this,i.forEach(function(t){t(e)})):i.forEach(function(t){t.apply(void 0,o(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&c(i)){var t,e=n;for(t in e)this.once(t,e[t])}else"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,o(t)),s.off(n,r)},this.on(n,r));return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&c(e)){var n,i=t;for(n in i)this.on(n,i[n])}else{var r;"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],c(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e))}return this},e.off=function(t,e){var n,i;if(c(t))this._eventHandler={};else if(c(e))if("string"==typeof t)delete this._eventHandler[t];else{var r,s=t;for(r in s)this.off(r,s[r])}else{var o=this._eventHandler[t];if(o){var a=0;try{for(var u=B(o),h=u.next();!h.done;h=u.next()){if(h.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}return this},t.VERSION="3.0.2",t}(),h=r;var e="__observers__",X=function(){function t(t){this._emitter=new V,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){return this._current},set:function(t){var e=t!==this._current;this._current=t,e&&this._emitter.trigger("update",t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){this._emitter.on("update",t)},e.unsubscribe=function(t){this._emitter.off("update",t)},t}();function Y(t){return t[e]||(t[e]={}),t[e]}function l(t,e,n){t=Y(t);return t[e]||(t[e]=new X(n)),t[e]}function F(t){t.subscribe=function(t,e){l(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n=this;t?t in this&&l(this,t).unsubscribe(e):(t=Y(this),Object.keys(t).forEach(function(t){n.unsubscribe(t)}))}}function N(t){F(t.prototype)}function W(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function H(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function K(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}function U(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function q(t){return t.replace(/_/g,".")}function n(t,n){var i=null,r="-1";return W(t,function(t){var e=U("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",n);if(e&&!t.brand)return i=t,r=e[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),r=((e=U("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",n))?e[3]:"")||r),r=q(r),1}),{preset:i,version:r}}function t(t,n){var i={brand:"",version:"-1"};return W(t,function(t){var e=Q(n,t);return e&&(i.brand=t.id,i.version=t.versionAlias||e.version,"-1"!==i.version)}),i}function Q(t,e){return H(t,function(t){t=t.brand;return U(""+e.test,t.toLowerCase())})}var s="undefined"==typeof window?{navigator:{userAgent:""}}:window,a=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],z=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],v=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],G=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],d=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Z(t){return!!n(G,t).preset}function f(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function J(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function $(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function _(t,n){return $(t,function(t,e){return t===n[e]})}function tt(t,e){return wt[e]||(wt[e]=Mt(e)),wt[e](t)}function et(t,n){return t&&n?f(t,function(t,e){return tt(t,"number"==typeof n?n:n[e])}):t}function p(t){if(!isFinite(t))return 0;var e="".concat(t);if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function nt(t,e){return 180*Math.atan2(e,t)/Math.PI}function it(e){var n=!0;return Object.keys(xt).forEach(function(t){e&&e[t]===xt[t]||(n=!1)}),n}function rt(t,e){return t&&e?30:t?6:e?D:1}function g(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function st(e,t,n){var i,r={1:"auto",30:"none",24:"pan-x",6:"pan-y"},s={};return e&&e.style&&(t=t.touchAction||r[n],i=u(u({},xt),{"touch-action":"none"===e.style["touch-action"]?"none":t}),Object.keys(i).forEach(function(t){s[t]=e.style[t],e.style[t]=i[t]})),s}function ot(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function at(t,e,n,i){return n=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],i=Math.max(n[0],t),Math.min(n[1],i)}function ut(t,e){return t<e[0]||t>e[1]}function ht(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function m(t,e,n){var i=t,r=e[0],s=(e=e[1])-r;return n[1]&&e<t&&(i=(i-e)%s+r),i=n[0]&&t<r?(i-r)%s+e:i}function E(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function ct(t){var e=!1,n=!1,i=!1;return(t=void 0===t?[]:t).forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=At;break;case"pointer":i=Dt}}),i?new kt:e&&n?new St:e?new Ct:n?new It:null}function lt(t,e,n){return Math.max(Math.min(t,n),e)}var b,x,y,w,M,P,vt,T,O,A,dt,ft,D=24,I="left",_t="right",pt="middle",gt=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],mt=["hold","release","change","animationStart","animationEnd","finish"],Et="ontouchstart"in s&&"safari"===(void 0===b&&function(){var t;if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData)return(t=(t=navigator.userAgentData).brands||t.uaList)&&t.length}()?(y=((T=navigator.userAgentData).uaList||T.brands).slice(),w=x&&x.fullVersionList,M=T.mobile||!1,P=y[0],vt=(x&&x.platform||T.platform||navigator.platform).toLowerCase(),T={name:P.brand,version:P.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!t(G,y).brand||Z(K())},P={name:"unknown",version:"-1",majorVersion:-1},T.webkit=!T.chromium&&W(v,function(t){return Q(y,t)}),O=t(z,y),T.chromium=!!O.brand,T.chromiumVersion=O.version,T.chromium||(O=t(v,y),T.webkit=!!O.brand,T.webkitVersion=O.version),O=H(d,function(t){return new RegExp(""+t.test,"g").exec(vt)}),P.name=O?O.id:"",x&&(P.version=x.platformVersion),w&&w.length?(O=t(a,w),T.name=O.brand||T.name,T.version=O.version||T.version):(w=t(a,y),T.name=w.brand||T.name,T.version=w.brand&&x?x.uaFullVersion:w.version),T.webkit&&(P.name=M?"ios":"mac"),"ios"===P.name&&T.webview&&(T.version="-1"),P.version=q(P.version),T.version=q(T.version),P.majorVersion=parseInt(P.version,10),T.majorVersion=parseInt(T.version,10),{browser:T,os:P,isMobile:M,isHints:!0}):(O=K(O=b),x=!!/mobi/g.exec(O),w={name:"unknown",version:"-1",majorVersion:-1,webview:Z(O),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},T={name:"unknown",version:"-1",majorVersion:-1},M=(P=n(a,O)).preset,P=P.version,a=(b=n(d,O)).preset,b=b.version,d=n(z,O),w.chromium=!!d.preset,w.chromiumVersion=d.version,w.chromium||(d=n(v,O),w.webkit=!!d.preset,w.webkitVersion=d.version),a&&(T.name=a.id,T.version=b,T.majorVersion=parseInt(b,10)),M&&(w.name=M.id,w.version=P,w.webview&&"ios"===T.name&&"safari"!==w.name&&(w.webview=!1)),w.majorVersion=parseInt(w.version,10),{browser:w,os:T,isMobile:x,isHints:!1})).browser.name,bt=function(){if("undefined"!=typeof document)for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),xt={"user-select":"none","-webkit-user-drag":"none"},yt=function(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e},C=function(t,e){var n;return void 0===e&&(e=!1),"string"==typeof t?(n=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,yt(n.childNodes)):yt(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===s?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in s&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return C(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},k=s.requestAnimationFrame||s.webkitRequestAnimationFrame,S=s.cancelAnimationFrame||s.webkitCancelAnimationFrame,wt=(k&&!S?(A={},dt=k,k=function(e){var n=dt(function(t){A[n]&&e(t)});return A[n]=!0,n},S=function(t){delete A[t]}):k&&S||(k=function(t){return s.setTimeout(function(){t(s.performance&&s.performance.now&&s.performance.now()||(new Date).getTime())},16)},S=s.clearTimeout),{}),Mt=function(e){var n=e<1?Math.pow(10,p(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Pt=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){t=this._getRoundPos(t).roundPos;this._axes.trigger(new h("hold",{pos:t,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa;t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new h("release",u(u({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var r=this,s=(void 0===i&&(i=!1),this.animationManager),o=s.axisManager,s=s.getEventInfo(),t=this._getRoundPos(t,e),e=t.roundPos,t=t.roundDepa,a=o.moveTo(e,t),e=(null==n?void 0:n.event)||(null==s?void 0:s.event)||null,t={pos:a.pos,delta:a.delta,bounceRatio:this._getBounceRatio(a.pos),holding:i,inputEvent:e,isTrusted:!!e,input:(null==n?void 0:n.input)||(null==s?void 0:s.input)||null,set:e?this._createUserControll(a.pos):function(){}},i=new h("change",t);return this._axes.trigger(i),Object.keys(a.pos).forEach(function(t){var e=a.pos[t];l(r._axes,t,e).current=e}),e&&o.set(t.set().destPos),!i.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa,n=(t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),new h("animationStart",t));return this._axes.trigger(n),!n.isCanceled()},e.triggerAnimationEnd=function(t){this._axes.trigger(new h("animationEnd",{isTrusted:t=void 0===t?!1:t}))},e.triggerFinish=function(t){this._axes.trigger(new h("finish",{isTrusted:t=void 0===t?!1:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:u({},t),duration:e};return function(t,e){return t&&(n.destPos=u({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:et(t,n),roundDepa:et(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),Tt=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),Ot=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return f(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):u(u({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=f(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?m(t,e.range,e.circular):0})),{pos:u({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return $(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return J(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return f(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!ut(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis ".concat(t," does not exist in Axes instance"));n._axis[t]=u(u({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=u({range:[0,100],startPos:r._axis[i].range[0],bounce:[0,0],circular:[!1,!1]},r._axis[i]),["bounce","circular"].forEach(function(t){var e=r._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),At="ontouchstart"in s,R="PointerEvent"in s,z="MSPointerEvent"in s,Dt=R||z,v=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),s.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e=this.prevEvent,n=this._getCenter(t),i=e?this._getMovement(t):{x:0,y:0},r=e?this._getScale(t):1,s=e?nt(n.x-e.center.x,n.y-e.center.y):0,o=e?e.deltaX+i.x:i.x,a=e?e.deltaY+i.y:i.y,u=i.x,i=i.y,h=this._latestInterval,c=Date.now(),l=h?c-h.timestamp:0,v=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(v=(h=[(o-h.deltaX)/l,(a-h.deltaY)/l])[0],e=h[1]),this._latestInterval={timestamp:c,deltaX:o,deltaY:a}),{srcEvent:t,scale:r,angle:s,center:n,deltaX:o,deltaY:a,offsetX:u,offsetY:i,velocityX:v,velocityY:e,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,e=e.clientY-t.clientY;return Math.sqrt(n*n+e*e)},e._getButton=function(t){var e={1:I,2:_t,4:pt},e=this._isTouchEvent(t)?I:e[t.buttons];return e||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===_t?s.addEventListener("contextmenu",this._stopContextMenu):e===pt&&t.preventDefault()},t}(),It=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton({1:I,2:pt,3:_t}[t.which],e)&&-1===this.end.indexOf(t.type)?1:0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(v),Ct=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(v),kt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=R?["pointerdown"]:["MSPointerDown"],t.move=R?["pointermove"]:["MSPointerMove"],t.end=R?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(v),St=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,t=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),n=t[0],t=t[1];return n.id===t.id?{x:n.x-t.x,y:n.y-t.y}:{x:0,y:0}},t}(v),Rt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,t=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=t}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){!this._interruptManager.isInterrupted()&&t.axes.length&&(this._isStopped=!(e={input:t,event:e}),this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(e),this._moveDistance||this._eventManager.hold(this._axisManager.get(),e),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,s,o;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((o=e.srcEvent||e).__childrenAxesAlreadyChanged||(r=this._moveDistance||this._axisManager.get(t.axes),s=f(r,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(s,function(t,e){var n=e.circular,e=e.range;return n&&(n[0]||n[1])?m(t,e,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!ut(t,e.range)})&&(this._isOutside=!1),r=this._atOutside(r),s=this._atOutside(s),this.options.nested&&this._isEndofAxis(n,r,s)||(o.__childrenAxesAlreadyChanged=!0),o={input:t,event:e},i?(t=this._animationManager.getDuration(s,r),this._animationManager.animateTo(s,t,o)):this._eventManager.triggerChange(s,r,o,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,s,o;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((o=e.srcEvent||e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),r=this._axisManager.get(t.axes),s=this._axisManager.get(),n=this._animationManager.getDisplacement(n),n=E(t.axes,n),n=this._axisManager.get(this._axisManager.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:at(r[n]+t,e.range,e.circular,e.bounce)})),o.__childrenAxesAlreadyReleased=!0,i={depaPos:s,destPos:n=0===(o=this._animationManager.getDuration(n,r,i))?u({},s):n,duration:o,delta:this._axisManager.getDelta(s,n),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(i),this._moveDistance=null,o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=_(o.destPos,s))||0===o.duration?(i||this._eventManager.triggerChange(o.destPos,s,n,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(n):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(o.destPos,o.duration,n))},e._atOutside=function(t){var s=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],e=e.range[1]+e.bounce[1];return e<t?e:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,e=e.circular;return e&&(e[0]||e[1])?t:t<n?n-s._animationManager.interpolate(n-t,r[0]):i<t?i+s._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(r,s,o){return this._axisManager.every(s,function(t,e,n){return 0===r[n]||s[n]===o[n]&&(n=t,t=e.range,i=e.bounce,!(e=e.circular)[0]&&n===t[0]-i[0]||!e[1]&&n===t[1]+i[1]);var i})},t}(),Lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}i(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,s=this._animateParam;s&&(e=(new Date).getTime()-s.startTime,n=(null==t?void 0:t.destPos)||s.destPos,i=(null==t?void 0:t.duration)||s.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,s.delta=this.axisManager.getDelta(r,n),s.destPos=n),null!=t&&t.duration&&(r=(e+this._durationOffset)/s.duration,this._durationOffset=r*i-e,s.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var r=this,s=this._animateParam,o=t.pos,a=s.destPos,u=f(o,function(t,e){return t<=a[e]?1:-1}),h=((new Date).getTime()-s.startTime+this._durationOffset)/s.duration,c=this._easing(h);return{pos:this.axisManager.map(o,function(t,e,n){var t=1<=h?a[n]:t+s.delta[n]*(c-r._prevEasingPer)/(1-r._initialEasingPer),i=m(t,e.range,e.circular);return t!==i&&(t=u[n]*(e.range[1]-e.range[0]),a[n]-=t,o[n]-=t),i}),easingPer:this._prevEasingPer=c,finished:1<=c}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,t=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=t,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(n,t,e){var i,r=this;return e=void 0!==e?e:(i=f(t,function(t,e){t=Math.abs(t-n[e]),e=r._options.deceleration;return(t=Math.sqrt(t/e*2))<100?0:t}),Object.keys(i).reduce(function(t,e){return Math.max(t,i[e])},-1/0)),lt(e,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return m(t,e.range,e.circular)}),$(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,S(e)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo(),e=(this._animateParam=null,this.axisManager.filter(this.axisManager.get(),function(t,e){return ht(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return m(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){t=t.setTo();return t.destPos=this.axisManager.get(t.destPos),t.duration=lt(t.duration,this._options.minimumDuration,this._options.maximumDuration),t},e.animateTo=function(t,e,n){var i=this,t=(this.stopAnimation(),this._createAnimationParam(t,e,n)),e=u({},t.depaPos),r=this.eventManager.triggerAnimationStart(t),t=this.getUserControl(t);!r&&this.axisManager.every(t.destPos,function(t,e){return ht(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),r&&!_(t.destPos,e)&&(r=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:e,destPos:t.destPos,duration:t.duration,delta:this.axisManager.getDelta(e,t.destPos),isTrusted:!!r,inputEvent:r,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);return _(t,i)||(this.interruptManager.setInterrupt(!0),n=J(t,function(t,e){return i[e]!==t}),Object.keys(n).length&&(n=this.axisManager.map(n,function(t,e){var n=e.range,e=e.circular;return e&&(e[0]||e[1])?t:at(t,n,e)}),_(n,i)||(0<e?this.animateTo(n,e):(this.stopAnimation(),this.eventManager.triggerChange(n),this.finish(!1))))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(f(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:t,duration:lt(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,t),inputEvent:r,input:(null==n?void 0:n.input)||null,isTrusted:!!r,done:this.animationEnd}},e._animateLoop=function(t,i){var r,s,o,a=this;t.duration?(this._animateParam=u(u({},t),{startTime:(new Date).getTime()}),r=f(t.destPos,function(t){return t}),s=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(s),n=!a.eventManager.triggerChange(e.pos,s.pos);(s=e).finished?(t.destPos=a._getFinalPos(t.destPos,r),_(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),i()):n?a.finish(!1):a._raf=k(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,n){var i=this;return f(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:(e=i._getRoundUnit(t,e),tt(t,e))})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),e=Math.max(p(e.range[0]),p(e.range[1]),p(t)),i=1/Math.pow(10,e)),i||n},t}()),L=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=u({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new Tt(i.options),i.axisManager=new Ot(i.axis),i.eventManager=new Pt(i),i.animationManager=new Lt(i),i.inputObserver=new Rt(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}i(t,r);var e=t.prototype;return e.connect=function(t,e){t="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(t),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){return t?0<=(t=this._inputs.indexOf(t))&&(this._inputs[t].disconnect(),this._inputs.splice(t,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return this.animationManager.setTo(t,e=void 0===e?0:e),this},e.setBy=function(t,e){return this.animationManager.setBy(t,e=void 0===e?0:e),this},e.setOptions=function(t){return this.options=u(u({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.8.0",t.TRANSFORM=bt,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=D,t.DIRECTION_ALL=30,function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,n,o):r(e,n))||o);return 3<s&&o&&Object.defineProperty(e,n,o),o}([N],t)}(V),d=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=C(t),this.options=u({inputType:["touch","mouse","pointer"],inputButton:[I],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=rt(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=st(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),it(this._originalCssProps)||ot(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e=this.options.inputButton,n=this._activeEvent,i=n.onEventStart(t,e);!i||!this._enabled||1<n.getTouches(t,e)||!1!==i.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._observer.hold(this,i),this._atRightEdge=Et&&i.center.x>window.innerWidth-t,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,r=n.releaseOnScroll,s=n.inputButton,n=n.thresholdAngle,o=this._activeEvent,a=o.onEventMove(t,s),s=o.getTouches(t,s);if(0===s||r&&a&&!a.srcEvent.cancelable)this._onPanend(t);else if(a&&this._enabled&&!(1<s)){r=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?D:6}(a.angle,n);if(o.prevEvent&&Et){if(a.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),a.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}t=this._getOffset([a.offsetX,a.offsetY],[g(6,this._direction,r),g(D,this._direction,r)]),s=t.some(function(t){return 0!==t});s&&(!1!==a.srcEvent.cancelable&&a.srcEvent.preventDefault(),a.srcEvent.stopPropagation()),(a.preventSystemEvent=s)&&(this._dragged=!0,this._observer.change(this,a,E(this.axes,t))),o.prevEvent=a}},e._onPanend=function(t){var e=this.options.inputButton,n=this._activeEvent;n.onEventEnd(t),this._enabled&&0===n.getTouches(t,e)&&(this._detachWindowEvent(n),clearTimeout(this._rightEdgeTimer),t=n.prevEvent,e=this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[g(6,this._direction),g(D,this._direction)]),n.onRelease(),this._observer.release(this,t,e))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,{passive:!1})}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,{passive:!1})})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._attachElementEvent=function(t){var e=this,n=ct(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,this._activeEvent=n,this.options.preventClickOnDrag&&i.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(t){i.addEventListener(t,e._onPanstart)}),n.move.forEach(function(t){i.addEventListener(t,e._voidFunction)})}},e._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(this.options.preventClickOnDrag&&n.removeEventListener("click",this._preventClickWhenDragged,!0),null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._voidFunction)})),this._enabled=!1,this._observer=null},t}(),jt={default:L,PanInput:d,RotatePanInput:function(n){function t(t,e){t=n.call(this,t,e)||this;return t._prevQuadrant=null,t._lastDiff=0,t}i(t,n);var e=t.prototype;return e.mapAxes=function(t){this._direction=L.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,t=n.onEventStart(t,this.options.inputButton);t&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(t),n.prevEvent=t)},e._onPanmove=function(t){var e=this._activeEvent,t=e.onEventMove(t,this.options.inputButton);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),e.prevEvent=t)},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this.isEnabled()&&(t=i.prevEvent,this._triggerChange(t),n=t.velocityX,e=t.velocityY,n=Math.sqrt(n*n+e*e)*(0<this._lastDiff?-1:1),i.onRelease(),this._observer.release(this,t,[n*this._coefficientForDistanceToAngle]),this._detachWindowEvent(i))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,e=e.y,n=nt(n,e),e=n<0?360+n:n,n=this._getQuadrant(t.center.x,t.center.y),i=this._getDifference(this._prevAngle,e,this._prevQuadrant,n);this._prevAngle=e,this._prevQuadrant=n,0!==i&&(this._lastDiff=i,this._observer.change(this,t,E(this.axes,[-i])))},e._getDifference=function(t,e,n,i){n=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return n},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var t=this._getPosFromOrigin(t,e),e=t.x,t=t.y,n=0;return 0<=e&&0<=t?n=1:e<0&&0<=t?n=2:e<0&&t<0?n=3:0<=e&&t<0&&(n=4),n},t}(d),PinchInput:function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=C(t),this.options=u({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=st(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),it(this._originalCssProps)||ot(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,E(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=ct(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,(this._activeEvent=n).start.forEach(function(t){i.addEventListener(t,e._onPinchStart,!1)}),n.move.forEach(function(t){i.addEventListener(t,e._onPinchMove,!1)}),n.end.forEach(function(t){i.addEventListener(t,e._onPinchEnd,!1)})}},e._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){n.removeEventListener(t,e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return this._baseValue*(t-(e=void 0===e?1:e))*this.options.scale},t}(),WheelInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=C(t),this.options=u({scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=rt(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;!this._enabled||0===(e=this._getOffset([t.deltaY,t.deltaX],[g(D,this._direction),g(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,E(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element&&this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),MoveKeyInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=C(t),this.options=u({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(n=-1===r&&!this.axes[0]||1===r&&!this.axes[1]?!1:n)&&(t.preventDefault(),e=-1===r?[+this.options.scale[0]*i,0]:[0,+this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,E(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("keydown",this._onKeydown,!1),e.addEventListener("keypress",this._onKeydown,!1),e.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){var t=this.element;t&&(t.removeEventListener("keydown",this._onKeydown,!1),t.removeEventListener("keypress",this._onKeydown,!1),t.removeEventListener("keyup",this._onKeyup,!1)),this._enabled=!1,this._observer=null},t}(),AXES_METHODS:gt,AXES_EVENTS:mt,REACTIVE_AXES:{methods:gt,events:mt,created:function(t){return new L(t.axis,t.options)},on:function(t,e,n){t.on(e,n)},off:function(t,e,n){t.off(e,n)},destroy:function(t){t.destroy()}}};for(ft in jt)L[ft]=jt[ft];return L}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function s(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var _=function(){return(_=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function l(t){return void 0===t}var a=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=c(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),t=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof a?e.eventType:e,r=o(this._eventHandler[i]||[]);return r.length<=0||(e instanceof a?(e.currentTarget=this,r.forEach(function(t){t(e)})):r.forEach(function(t){t.apply(void 0,o(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&l(i)){var t=n;for(var e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,o(t)),s.off(n,r)},this.on(n,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(e)){var n=t;for(var i in n)this.on(i,n[i]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var n,i;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r=t;for(var s in r)this.off(s,r[s]);return this}var o=this._eventHandler[t];if(o){var a=0;try{for(var u=c(o),h=u.next();!h.done;h=u.next()){if(h.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},t.VERSION="3.0.2",t}(),p=a;function v(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function f(t){return void 0===t}var h=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=v(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),n=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof h?e.eventType:e,r=u(this._eventHandler[i]||[]);return r.length<=0||(e instanceof h?(e.currentTarget=this,r.forEach(function(t){t(e)})):r.forEach(function(t){t.apply(void 0,u(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&f(i)){var t=n;for(var e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,u(t)),s.off(n,r)},this.on(n,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&f(e)){var n=t;for(var i in n)this.on(i,n[i]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],f(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var n,i;if(f(t))return this._eventHandler={},this;if(f(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r=t;for(var s in r)this.off(s,r[s]);return this}var o=this._eventHandler[t];if(o){var a=0;try{for(var u=v(o),h=u.next();!h.done;h=u.next()){if(h.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},t.VERSION="3.0.2",t}();var r,e="__observers__",d=function(){function t(t){this._emitter=new n,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){return this._current},set:function(t){var e=t!==this._current;this._current=t,e&&this._emitter.trigger("update",t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){this._emitter.on("update",t)},e.unsubscribe=function(t){this._emitter.off("update",t)},t}();function g(t){return t[e]||(t[e]={}),t[e]}function m(t,e,n){var i=g(t);return i[e]||(i[e]=new d(n)),i[e]}function E(t){t.subscribe=function(t,e){m(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n,i=this;if(!t)return n=g(this),void Object.keys(n).forEach(function(t){i.unsubscribe(t)});t in this&&m(this,t).unsubscribe(e)}}function b(t){E(t.prototype)}function y(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function x(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function M(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function w(t){return t.replace(/_/g,".")}function P(t,r){var s=null,o="-1";return y(t,function(t){var e,n,i=M("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return i&&!t.brand&&(s=t,o=i[3]||"-1",t.versionAlias?o=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),n=M("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r),o=(n?n[3]:"")||o),o=w(o),1)}),{preset:s,version:o}}function T(t,n){return x(t,function(t){var e=t.brand;return M(""+n.test,e.toLowerCase())})}r="undefined"==typeof window?{navigator:{userAgent:""}}:window;var O=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],A=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],D=[{test:"applewebkit",id:"webkit"}],I=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],C=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function S(t){var e=function(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(t),n=!!/mobi/g.exec(e),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!P(I,e).preset,chromium:!!P(A,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},s=P(O,e),o=s.preset,a=s.version,u=P(C,e),h=u.preset,c=u.version;return i.webkit=!i.chromium&&!!P(D,e).preset,h&&(r.name=h.id,r.version=c,r.majorVersion=parseInt(c,10)),o&&(i.name=o.id,i.version=a,i.webview&&"ios"===r.name&&"safari"!==i.name&&(i.webview=!1)),i.majorVersion=parseInt(i.version,10),{browser:i,os:r,isMobile:n,isHints:!1}}function k(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var R,j,L,B,X,Y,N,V,F,H,W,K,U=24,q="left",Q="right",z="middle",G=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],Z=["hold","release","change","animationStart","animationEnd","finish"],J="ontouchstart"in r&&"safari"===(void 0===R&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,e=t.brands||t.uaList;return e&&e.length}}()?(X=navigator.userAgentData,Y=(X.uaList||X.brands).slice(),N=X.mobile||!1,V=Y[0],F={name:V.brand,version:V.version,majorVersion:-1,webkit:!1,webview:y(I,function(t){return T(Y,t)}),chromium:y(A,function(t){return T(Y,t)})},H={name:"unknown",version:"-1",majorVersion:-1},F.webkit=!F.chromium&&y(D,function(t){return T(Y,t)}),j&&(L=j.platform.toLowerCase(),B=x(C,function(t){return new RegExp(""+t.test,"g").exec(L)}),H.name=B?B.id:L,H.version=j.platformVersion),y(O,function(t){var e=T(Y,t);return e&&(F.name=t.id,F.version=j?j.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?H.name="android":F.webkit&&(H.name=N?"ios":"mac"),"ios"===H.name&&F.webview&&(F.version="-1"),H.version=w(H.version),F.version=w(F.version),H.majorVersion=parseInt(H.version,10),F.majorVersion=parseInt(F.version,10),{browser:F,os:H,isMobile:N,isHints:!0}):S(R)).browser.name,$=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),tt={"user-select":"none","-webkit-user-drag":"none"},et=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,k(n.childNodes)):k(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t===r?i=t:"value"in t||"current"in t?i=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in r&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return et(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},nt=r.requestAnimationFrame||r.webkitRequestAnimationFrame,it=r.cancelAnimationFrame||r.webkitCancelAnimationFrame;nt&&!it?(W={},K=nt,nt=function(e){var n=K(function(t){W[n]&&e(t)});return W[n]=!0,n},it=function(t){delete W[t]}):nt&&it||(nt=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},it=r.clearTimeout);function rt(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function st(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function ot(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function at(t,n){return ot(t,function(t,e){return t===n[e]})}function ut(t,e){return wt[e]||(wt[e]=Pt(e)),wt[e](t)}function ht(t,n){return t&&n?rt(t,function(t,e){return ut(t,"number"==typeof n?n:n[e])}):t}function ct(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function lt(t,e){return 180*Math.atan2(e,t)/Math.PI}function vt(e){var n=!0;return Object.keys(tt).forEach(function(t){e&&e[t]===tt[t]||(n=!1)}),n}function ft(t,e){return t&&e?30:t?6:e?U:1}function dt(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function _t(e,t,n){var i,r,s,o=((i={})[1]="auto",i[30]="none",i[U]="pan-x",i[6]="pan-y",i),a={};return e&&e.style&&(r=t.touchAction?t.touchAction:o[n],s=_(_({},tt),{"touch-action":"none"===e.style["touch-action"]?"none":r}),Object.keys(s).forEach(function(t){a[t]=e.style[t],e.style[t]=s[t]})),a}function pt(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function gt(t,e,n,i){var r=t,s=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],r=Math.max(s[0],r);return Math.min(s[1],r)}function mt(t,e){return t<e[0]||t>e[1]}function Et(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function bt(t,e,n){var i=t,r=e[0],s=e[1],o=s-r;return n[1]&&s<t&&(i=(i-s)%o+r),n[0]&&t<r&&(i=(i-r)%o+s),i}function yt(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function xt(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=Dt;break;case"pointer":i=St}}),i?new Lt:e&&n?new Bt:e?new jt:n?new Rt:null}function Mt(t,e,n){return Math.max(Math.min(t,n),e)}var wt={},Pt=function(e){var n=e<1?Math.pow(10,ct(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Tt=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new p("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new p("release",_(_({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var r=this;void 0===i&&(i=!1);var s=this.animationManager,o=s.axisManager,a=s.getEventInfo(),u=this._getRoundPos(t,e),h=u.roundPos,c=u.roundDepa,l=o.moveTo(h,c),v=(null==n?void 0:n.event)||(null==a?void 0:a.event)||null,f={pos:l.pos,delta:l.delta,bounceRatio:this._getBounceRatio(l.pos),holding:i,inputEvent:v,isTrusted:!!v,input:(null==n?void 0:n.input)||(null==a?void 0:a.input)||null,set:v?this._createUserControll(l.pos):function(){}},d=new p("change",f);return this._axes.trigger(d),Object.keys(l.pos).forEach(function(t){var e=l.pos[t];m(r._axes,t,e).current=e}),v&&o.set(f.set().destPos),!d.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var r=new p("animationStart",t);return this._axes.trigger(r),!r.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new p("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new p("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:_({},t),duration:e};return function(t,e){return t&&(n.destPos=_({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:ht(t,n),roundDepa:ht(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),Ot=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),At=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return rt(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):_(_({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=rt(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?bt(t,e.range,e.circular):0})),{pos:_({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return ot(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return st(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return rt(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!mt(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis "+t+" does not exist in Axes instance");n._axis[t]=_(_({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=_({range:[0,100],startPos:r._axis[i].range[0],bounce:[0,0],circular:[!1,!1]},r._axis[i]),["bounce","circular"].forEach(function(t){var e=r._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),Dt="ontouchstart"in r,It="PointerEvent"in r,Ct="MSPointerEvent"in r,St=It||Ct,kt=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),r.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),r=n?this._getMovement(t):{x:0,y:0},s=n?this._getScale(t):1,o=n?lt(i.x-n.center.x,i.y-n.center.y):0,a=n?n.deltaX+r.x:r.x,u=n?n.deltaY+r.y:r.y,h=r.x,c=r.y,l=this._latestInterval,v=Date.now(),f=l?v-l.timestamp:0,d=n?n.velocityX:0,_=n?n.velocityY:0;return(!l||32<=f)&&(l&&(d=(e=[(a-l.deltaX)/f,(u-l.deltaY)/f])[0],_=e[1]),this._latestInterval={timestamp:v,deltaX:a,deltaY:u}),{srcEvent:t,scale:s,angle:o,center:i,deltaX:a,deltaY:u,offsetX:h,offsetY:c,velocityX:d,velocityY:_,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:q,2:Q,4:z},n=this._isTouchEvent(t)?q:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===Q?r.addEventListener("contextmenu",this._stopContextMenu):e===z&&t.preventDefault()},t}(),Rt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){if(e){var n={1:q,2:z,3:Q};return this._isValidButton(n[t.which],e)&&-1===this.end.indexOf(t.type)?1:0}return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(kt),jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(kt),Lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=It?["pointerdown"]:["MSPointerDown"],t.move=It?["pointermove"]:["MSPointerMove"],t.end=It?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(kt),Bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,n=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),i=n[0],r=n[1];return i.id===r.id?{x:i.x-r.x,y:i.y-r.y}:{x:0,y:0}},t}(kt),Xt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,s=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=s}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,s,o,a,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(s=this._moveDistance||this._axisManager.get(t.axes),o=rt(s,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?bt(t,i,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!mt(t,e.range)})&&(this._isOutside=!1),s=this._atOutside(s),o=this._atOutside(o),this.options.nested&&this._isEndofAxis(n,s,o)||(r.__childrenAxesAlreadyChanged=!0),a={input:t,event:e},i?(u=this._animationManager.getDuration(o,s),this._animationManager.animateTo(o,u,a)):this._eventManager.triggerChange(o,s,a,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,s,o,a,u,h,c,l,v,f,d;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),s=this._axisManager.get(t.axes),o=this._axisManager.get(),a=this._animationManager.getDisplacement(n),u=yt(t.axes,a),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:gt(s[n]+t,e.range,e.circular,e.bounce)})),r.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,s,i))&&(h=_({},o)),l={depaPos:o,destPos:h,duration:c,delta:this._axisManager.getDelta(o,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),d={input:t,event:e},(f=at(v.destPos,o))||0===v.duration?(f||this._eventManager.triggerChange(v.destPos,o,d,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(d):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,d))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,s=e.circular;return s&&(s[0]||s[1])?t:t<n?n-o._animationManager.interpolate(n-t,r[0]):i<t?i+o._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(a,u,h){return this._axisManager.every(u,function(t,e,n){return 0===a[n]||u[n]===h[n]&&(i=t,r=e.range,s=e.bounce,!(o=e.circular)[0]&&i===r[0]-s[0]||!o[1]&&i===r[1]+s[1]);var i,r,s,o})},t}(),Yt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}s(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,s,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=(null==t?void 0:t.duration)||o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(r,n),o.destPos=n),null!=t&&t.duration&&(s=(e+this._durationOffset)/o.duration,this._durationOffset=s*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var o=this,a=this._animateParam,u=t.pos,h=a.destPos,c=rt(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-a.startTime+this._durationOffset)/a.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,r=1<=l?h[n]:t+a.delta[n]*(v-o._prevEasingPer)/(1-o._initialEasingPer),s=bt(r,e.range,e.circular);return r!==s&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),s}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=r,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(s,t,e){var n,i,o=this;return i=void 0!==e?e:(n=rt(t,function(t,e){return n=Math.abs(t-s[e]),i=o._options.deceleration,(r=Math.sqrt(n/i*2))<100?0:r;var n,i,r}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),Mt(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return bt(t,e.range,e.circular)}),ot(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._raf&&(i=this._raf,it(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)),this.finish(!1))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return Et(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return bt(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=Mt(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var r,s=this._createAnimationParam(t,e,n),o=_({},s.depaPos),a=this.eventManager.triggerAnimationStart(s),u=this.getUserControl(s);!a&&this.axisManager.every(u.destPos,function(t,e){return Et(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!at(u.destPos,o)&&(r=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:o,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(o,u.destPos),isTrusted:!!r,inputEvent:r,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(at(t,i))return this;this.interruptManager.setInterrupt(!0);var r=st(t,function(t,e){return i[e]!==t});return Object.keys(r).length?(r=this.axisManager.map(r,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:gt(t,n,i)}),at(r,i)||(0<e?this.animateTo(r,e):(this.stopAnimation(),this.eventManager.triggerChange(r),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(rt(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=t,s=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:r,duration:Mt(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,r),inputEvent:s,input:(null==n?void 0:n.input)||null,isTrusted:!!s,done:this.animationEnd}},e._animateLoop=function(t,i){var r,s,o,a=this;t.duration?(this._animateParam=_(_({},t),{startTime:(new Date).getTime()}),r=rt(t.destPos,function(t){return t}),s=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(s),n=!a.eventManager.triggerChange(e.pos,s.pos);if((s=e).finished)return t.destPos=a._getFinalPos(t.destPos,r),at(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),void i();n?a.finish(!1):a._raf=nt(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var r=this;return rt(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=r._getRoundUnit(t,e);return ut(t,n)})},e._getRoundUnit=function(t,e){var n,i,r=this._options.round,s=null;return r||(n=this.axisManager.getAxisOptions(e),i=Math.max(ct(n.range[0]),ct(n.range[1]),ct(t)),s=1/Math.pow(10,i)),s||r},t}()),Nt=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=_({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new Ot(i.options),i.axisManager=new At(i.axis),i.eventManager=new Tt(i),i.animationManager=new Yt(i),i.inputObserver=new Xt(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}s(t,r);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.setOptions=function(t){return this.options=_(_({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.8.0",t.TRANSFORM=$,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=U,t.DIRECTION_ALL=30,function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,n,o):r(e,n))||o);return 3<s&&o&&Object.defineProperty(e,n,o),o}([b],t)}(t),Vt=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=et(t),this.options=_({inputType:["touch","mouse","pointer"],inputButton:[q],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=ft(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=_t(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),vt(this._originalCssProps)||pt(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e,n=this.options.inputButton,i=this._activeEvent,r=i.onEventStart(t,n);!r||!this._enabled||1<i.getTouches(t,n)||!1!==r.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,r),this._atRightEdge=J&&r.center.x>window.innerWidth-e,this._attachWindowEvent(i),i.prevEvent=r)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,r=n.releaseOnScroll,s=n.inputButton,o=n.threshold,a=n.thresholdAngle,u=this._activeEvent,h=u.onEventMove(t,s),c=u.getTouches(t,s);if(0===c||r&&h&&!h.srcEvent.cancelable)this._onPanend(t);else if(h&&this._enabled&&!(1<c)){var l=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?U:6}(h.angle,a),v=dt(6,this._direction,l),f=dt(U,this._direction,l);if(u.prevEvent&&J){if(h.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),h.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}var d=this._getDistance([h.deltaX,h.deltaY],[v,f]),_=this._getOffset([h.offsetX,h.offsetY],[v,f]),p=_.some(function(t){return 0!==t});p&&(!1!==h.srcEvent.cancelable&&h.srcEvent.preventDefault(),h.srcEvent.stopPropagation()),(h.preventSystemEvent=p)&&(this._isOverThreshold||o<=d)&&(this._dragged=!0,this._isOverThreshold=!0,this._observer.change(this,h,yt(this.axes,_))),u.prevEvent=h}},e._onPanend=function(t){var e,n,i=this.options.inputButton,r=this._activeEvent;r.onEventEnd(t),this._enabled&&0===r.getTouches(t,i)&&(this._detachWindowEvent(r),clearTimeout(this._rightEdgeTimer),e=r.prevEvent,n=this._isOverThreshold?this._getOffset([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[dt(6,this._direction),dt(U,this._direction)]):[0,0],r.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,{passive:!1})}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,{passive:!1})})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._getDistance=function(t,e){return Math.sqrt(Number(e[0])*Math.pow(t[0],2)+Number(e[1])*Math.pow(t[1],2))},e._attachElementEvent=function(t){var e=this,n=xt(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,this._activeEvent=n,this.options.preventClickOnDrag&&i.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(t){i.addEventListener(t,e._onPanstart)}),n.move.forEach(function(t){i.addEventListener(t,e._voidFunction)})}},e._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(this.options.preventClickOnDrag&&n.removeEventListener("click",this._preventClickWhenDragged,!0),null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._voidFunction)})),this._enabled=!1,this._observer=null},t}(),Ft={methods:G,events:Z,created:function(t){return new Nt(t.axis,t.options)},on:function(t,e,n){t.on(e,n)},off:function(t,e,n){t.off(e,n)},destroy:function(t){t.destroy()}},Ht={default:Nt,PanInput:Vt,RotatePanInput:function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}s(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Nt.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,r,s=this._activeEvent;s.onEventEnd(t),this.isEnabled()&&(e=s.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,r=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),s.onRelease(),this._observer.release(this,e,[r*this._coefficientForDistanceToAngle]),this._detachWindowEvent(s))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,r=lt(n,i),s=r<0?360+r:r,o=this._getQuadrant(t.center.x,t.center.y),a=this._getDifference(this._prevAngle,s,this._prevQuadrant,o);this._prevAngle=s,this._prevQuadrant=o,0!==a&&(this._lastDiff=a,this._observer.change(this,t,yt(this.axes,[-a])))},e._getDifference=function(t,e,n,i){var r=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return r},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,r=n.y,s=0;return 0<=i&&0<=r?s=1:i<0&&0<=r?s=2:i<0&&r<0?s=3:0<=i&&r<0&&(s=4),s},t}(Vt),PinchInput:function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this._isOverThreshold=!1,this.element=et(t),this.options=_({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=_t(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),vt(this._originalCssProps)||pt(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,this._isOverThreshold=!1,e.prevEvent=n)},e._onPinchMove=function(t){var e,n,i=this.options.threshold,r=this._activeEvent,s=r.onEventMove(t);s&&this._pinchFlag&&this._enabled&&2===r.getTouches(t)&&(e=this._getDistance(s.scale),n=this._getOffset(s.scale,r.prevEvent.scale),(this._isOverThreshold||i<=e)&&(this._isOverThreshold=!0,this._observer.change(this,t,yt(this.axes,[n]))),r.prevEvent=s)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=xt(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,(this._activeEvent=n).start.forEach(function(t){i.addEventListener(t,e._onPinchStart,!1)}),n.move.forEach(function(t){i.addEventListener(t,e._onPinchMove,!1)}),n.end.forEach(function(t){i.addEventListener(t,e._onPinchEnd,!1)})}},e._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){n.removeEventListener(t,e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},e._getDistance=function(t){return Math.abs(t-1)},t}(),WheelInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=et(t),this.options=_({scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=ft(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[dt(U,this._direction),dt(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,yt(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element&&this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),MoveKeyInput:function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=et(t),this.options=_({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===r?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,yt(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("keydown",this._onKeydown,!1),e.addEventListener("keypress",this._onKeydown,!1),e.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){var t=this.element;t&&(t.removeEventListener("keydown",this._onKeydown,!1),t.removeEventListener("keypress",this._onKeydown,!1),t.removeEventListener("keyup",this._onKeyup,!1)),this._enabled=!1,this._observer=null},t}(),AXES_METHODS:G,AXES_EVENTS:Z,REACTIVE_AXES:Ft};for(var Wt in Ht)Nt[Wt]=Ht[Wt];return Nt}); | ||
//# sourceMappingURL=axes.pkgd.min.js.map |
@@ -54,3 +54,2 @@ var __assign = (this && this.__assign) || function () { | ||
} | ||
this._animateParam = null; | ||
if (this._raf) { | ||
@@ -61,2 +60,3 @@ cancelAnimationFrame(this._raf); | ||
this.eventManager.triggerAnimationEnd(!!(option === null || option === void 0 ? void 0 : option.event)); | ||
this.finish(false); | ||
} | ||
@@ -63,0 +63,0 @@ }; |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -86,3 +86,3 @@ var __assign = (this && this.__assign) || function () { | ||
if (!_this._axis[key]) { | ||
throw new Error("Axis ".concat(key, " does not exist in Axes instance")); | ||
throw new Error("Axis " + key + " does not exist in Axes instance"); | ||
} | ||
@@ -89,0 +89,0 @@ _this._axis[key] = __assign(__assign({}, _this._axis[key]), axis[key]); |
@@ -0,0 +0,0 @@ var win; |
export * from "./utils"; | ||
export * from "./types"; | ||
//# sourceMappingURL=index.js.map |
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -0,0 +0,0 @@ export function keys(obj) { |
export * from "./utils"; | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ export function withClassMethods(methods) { |
@@ -0,0 +0,0 @@ export * from "./reactive/index"; |
export var OBSERVERS_PATH = "__observers__"; | ||
export var REACTIVE_PATH = "__reactive__"; | ||
//# sourceMappingURL=const.js.map |
@@ -0,0 +0,0 @@ export * from "./utils"; |
@@ -0,0 +0,0 @@ import Component from "@egjs/component"; |
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -0,0 +0,0 @@ import { OBSERVERS_PATH } from "./const"; |
@@ -12,3 +12,3 @@ export var DIRECTION_NONE = 1; | ||
export var MOUSE_MIDDLE = "middle"; | ||
export var VELOCITY_INTERVAL = 16; | ||
export var VELOCITY_INTERVAL = 32; | ||
export var AXES_METHODS = [ | ||
@@ -15,0 +15,0 @@ "connect", |
@@ -0,0 +0,0 @@ export var getInsidePosition = function (destPos, range, circular, bounce) { |
@@ -0,0 +0,0 @@ import { getAngle } from "../utils"; |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ import Axes from "./Axes"; |
@@ -0,0 +0,0 @@ import Axes, * as modules from "./index"; |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ import { MouseEventInput } from "../eventInput/MouseEventInput"; |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -34,2 +34,3 @@ var __assign = (this && this.__assign) || function () { | ||
this._dragged = false; | ||
this._isOverThreshold = false; | ||
this._preventClickWhenDragged = function (e) { | ||
@@ -104,2 +105,3 @@ if (_this._dragged) { | ||
this._dragged = false; | ||
this._isOverThreshold = false; | ||
this._observer.hold(this, panEvent); | ||
@@ -114,3 +116,3 @@ this._atRightEdge = | ||
var _this = this; | ||
var _a = this.options, iOSEdgeSwipeThreshold = _a.iOSEdgeSwipeThreshold, releaseOnScroll = _a.releaseOnScroll, inputButton = _a.inputButton, thresholdAngle = _a.thresholdAngle; | ||
var _a = this.options, iOSEdgeSwipeThreshold = _a.iOSEdgeSwipeThreshold, releaseOnScroll = _a.releaseOnScroll, inputButton = _a.inputButton, threshold = _a.threshold, thresholdAngle = _a.thresholdAngle; | ||
var activeEvent = this._activeEvent; | ||
@@ -128,2 +130,4 @@ var panEvent = activeEvent.onEventMove(event, inputButton); | ||
var userDirection = getDirectionByAngle(panEvent.angle, thresholdAngle); | ||
var useHorizontal = useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection); | ||
var useVertical = useDirection(DIRECTION_VERTICAL, this._direction, userDirection); | ||
if (activeEvent.prevEvent && IS_IOS_SAFARI) { | ||
@@ -146,6 +150,4 @@ var swipeLeftToRight = panEvent.center.x < 0; | ||
} | ||
var offset = this._getOffset([panEvent.offsetX, panEvent.offsetY], [ | ||
useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection), | ||
useDirection(DIRECTION_VERTICAL, this._direction, userDirection), | ||
]); | ||
var distance = this._getDistance([panEvent.deltaX, panEvent.deltaY], [useHorizontal, useVertical]); | ||
var offset = this._getOffset([panEvent.offsetX, panEvent.offsetY], [useHorizontal, useVertical]); | ||
var prevent = offset.some(function (v) { return v !== 0; }); | ||
@@ -159,4 +161,5 @@ if (prevent) { | ||
panEvent.preventSystemEvent = prevent; | ||
if (prevent) { | ||
if (prevent && (this._isOverThreshold || distance >= threshold)) { | ||
this._dragged = true; | ||
this._isOverThreshold = true; | ||
this._observer.change(this, panEvent, toAxis(this.axes, offset)); | ||
@@ -176,3 +179,3 @@ } | ||
var prevEvent = activeEvent.prevEvent; | ||
var velocity = this._getOffset([ | ||
var velocity = this._isOverThreshold ? this._getOffset([ | ||
Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), | ||
@@ -183,3 +186,3 @@ Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1), | ||
useDirection(DIRECTION_VERTICAL, this._direction), | ||
]); | ||
]) : [0, 0]; | ||
activeEvent.onRelease(); | ||
@@ -213,2 +216,6 @@ this._observer.release(this, prevEvent, velocity); | ||
}; | ||
PanInput.prototype._getDistance = function (delta, direction) { | ||
return Math.sqrt(Number(direction[0]) * Math.pow(delta[0], 2) + | ||
Number(direction[1]) * Math.pow(delta[1], 2)); | ||
}; | ||
PanInput.prototype._attachElementEvent = function (observer) { | ||
@@ -215,0 +222,0 @@ var _this = this; |
@@ -22,2 +22,3 @@ var __assign = (this && this.__assign) || function () { | ||
this._activeEvent = null; | ||
this._isOverThreshold = false; | ||
this.element = $(el); | ||
@@ -71,5 +72,7 @@ this.options = __assign({ scale: 1, threshold: 0, inputType: ["touch", "pointer"], touchAction: "none" }, options); | ||
this._pinchFlag = true; | ||
this._isOverThreshold = false; | ||
activeEvent.prevEvent = pinchEvent; | ||
}; | ||
PinchInput.prototype._onPinchMove = function (event) { | ||
var threshold = this.options.threshold; | ||
var activeEvent = this._activeEvent; | ||
@@ -83,4 +86,8 @@ var pinchEvent = activeEvent.onEventMove(event); | ||
} | ||
var distance = this._getDistance(pinchEvent.scale); | ||
var offset = this._getOffset(pinchEvent.scale, activeEvent.prevEvent.scale); | ||
this._observer.change(this, event, toAxis(this.axes, [offset])); | ||
if (this._isOverThreshold || distance >= threshold) { | ||
this._isOverThreshold = true; | ||
this._observer.change(this, event, toAxis(this.axes, [offset])); | ||
} | ||
activeEvent.prevEvent = pinchEvent; | ||
@@ -146,2 +153,5 @@ }; | ||
}; | ||
PinchInput.prototype._getDistance = function (pinchScale) { | ||
return Math.abs(pinchScale - 1); | ||
}; | ||
return PinchInput; | ||
@@ -148,0 +158,0 @@ }()); |
@@ -5,8 +5,6 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -13,0 +11,0 @@ function __() { this.constructor = d; } |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ var InterruptManager = (function () { |
@@ -0,0 +0,0 @@ import Axes from "./Axes"; |
@@ -1,2 +0,1 @@ | ||
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -143,3 +143,3 @@ var __assign = (this && this.__assign) || function () { | ||
} | ||
var v = "".concat(val); | ||
var v = "" + val; | ||
if (v.indexOf("e") >= 0) { | ||
@@ -146,0 +146,0 @@ var p = 0; |
{ | ||
"name": "@egjs/axes", | ||
"version": "3.8.0", | ||
"version": "3.8.1-beta.0", | ||
"description": "A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.", | ||
"sideEffects": false, | ||
"main": "dist/axes.js", | ||
"main": "dist/axes.cjs.js", | ||
"module": "dist/axes.esm.js", | ||
@@ -8,0 +8,0 @@ "types": "declaration/index.d.ts", |
const buildHelper = require("@egjs/build-helper"); | ||
const external = { | ||
"@egjs/agent": "eg.agent", | ||
"@egjs/component": "eg.Component", | ||
"@egjs/agent": "eg.agent", | ||
"@egjs/component": "Component", | ||
}; | ||
@@ -42,2 +42,8 @@ const name = "eg.Axes"; | ||
{ | ||
input: "./src/index.cjs.ts", | ||
output: `./dist/${fileName}.cjs.js`, | ||
format: "cjs", | ||
exports: "named", | ||
}, | ||
{ | ||
input: "./src/index.ts", | ||
@@ -44,0 +50,0 @@ output: `./dist/${fileName}.esm.js`, |
@@ -114,3 +114,2 @@ import { | ||
} | ||
this._animateParam = null; | ||
if (this._raf) { | ||
@@ -121,2 +120,3 @@ cancelAnimationFrame(this._raf); | ||
this.eventManager.triggerAnimationEnd(!!option?.event); | ||
this.finish(false); | ||
} | ||
@@ -123,0 +123,0 @@ } |
@@ -18,3 +18,3 @@ /* | ||
export const VELOCITY_INTERVAL = 16; | ||
export const VELOCITY_INTERVAL = 32; | ||
@@ -21,0 +21,0 @@ export const AXES_METHODS = [ |
@@ -121,2 +121,3 @@ /* | ||
private _dragged = false; | ||
private _isOverThreshold = false; | ||
@@ -237,2 +238,3 @@ /** | ||
this._dragged = false; | ||
this._isOverThreshold = false; | ||
this._observer.hold(this, panEvent); | ||
@@ -251,2 +253,3 @@ this._atRightEdge = | ||
inputButton, | ||
threshold, | ||
thresholdAngle, | ||
@@ -271,2 +274,12 @@ } = this.options; | ||
const userDirection = getDirectionByAngle(panEvent.angle, thresholdAngle); | ||
const useHorizontal = useDirection( | ||
DIRECTION_HORIZONTAL, | ||
this._direction, | ||
userDirection | ||
); | ||
const useVertical = useDirection( | ||
DIRECTION_VERTICAL, | ||
this._direction, | ||
userDirection | ||
); | ||
@@ -294,8 +307,9 @@ if (activeEvent.prevEvent && IS_IOS_SAFARI) { | ||
} | ||
const distance = this._getDistance( | ||
[panEvent.deltaX, panEvent.deltaY], | ||
[useHorizontal, useVertical] | ||
); | ||
const offset = this._getOffset( | ||
[panEvent.offsetX, panEvent.offsetY], | ||
[ | ||
useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection), | ||
useDirection(DIRECTION_VERTICAL, this._direction, userDirection), | ||
] | ||
[useHorizontal, useVertical] | ||
); | ||
@@ -311,4 +325,5 @@ const prevent = offset.some((v) => v !== 0); | ||
panEvent.preventSystemEvent = prevent; | ||
if (prevent) { | ||
if (prevent && (this._isOverThreshold || distance >= threshold)) { | ||
this._dragged = true; | ||
this._isOverThreshold = true; | ||
this._observer.change(this, panEvent, toAxis(this.axes, offset)); | ||
@@ -329,3 +344,3 @@ } | ||
const prevEvent = activeEvent.prevEvent; | ||
const velocity = this._getOffset( | ||
const velocity = this._isOverThreshold ? this._getOffset( | ||
[ | ||
@@ -339,3 +354,3 @@ Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), | ||
] | ||
); | ||
) : [0, 0]; | ||
activeEvent.onRelease(); | ||
@@ -371,2 +386,9 @@ this._observer.release(this, prevEvent, velocity); | ||
private _getDistance(delta: number[], direction: boolean[]): number { | ||
return Math.sqrt( | ||
Number(direction[0]) * Math.pow(delta[0], 2) + | ||
Number(direction[1]) * Math.pow(delta[1], 2) | ||
); | ||
} | ||
private _attachElementEvent(observer: InputTypeObserver) { | ||
@@ -373,0 +395,0 @@ const activeEvent = convertInputType(this.options.inputType); |
@@ -61,2 +61,3 @@ /* | ||
private _baseValue: number; | ||
private _isOverThreshold = false; | ||
@@ -153,2 +154,3 @@ /** | ||
this._pinchFlag = true; | ||
this._isOverThreshold = false; | ||
activeEvent.prevEvent = pinchEvent; | ||
@@ -158,2 +160,3 @@ } | ||
private _onPinchMove(event: InputEventType) { | ||
const threshold = this.options.threshold; | ||
const activeEvent = this._activeEvent; | ||
@@ -170,2 +173,3 @@ const pinchEvent = activeEvent.onEventMove(event); | ||
const distance = this._getDistance(pinchEvent.scale); | ||
const offset = this._getOffset( | ||
@@ -175,3 +179,7 @@ pinchEvent.scale, | ||
); | ||
this._observer.change(this, event, toAxis(this.axes, [offset])); | ||
if (this._isOverThreshold || distance >= threshold) { | ||
this._isOverThreshold = true; | ||
this._observer.change(this, event, toAxis(this.axes, [offset])); | ||
} | ||
activeEvent.prevEvent = pinchEvent; | ||
@@ -241,2 +249,6 @@ } | ||
} | ||
private _getDistance(pinchScale: number): number { | ||
return Math.abs(pinchScale - 1); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2327423
148
23111
2