@egjs/axes
Advanced tools
Comparing version 3.8.5-beta.0 to 3.8.5
@@ -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"; |
@@ -0,0 +0,0 @@ import { ObjectInterface } from "./types"; |
declare let win: any; | ||
export { win as window }; |
@@ -0,0 +0,0 @@ export declare const DIRECTION_NONE = 1; |
@@ -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"; |
import Axes from "./index"; | ||
export default Axes; | ||
export * from "./index"; |
@@ -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"; |
@@ -0,0 +0,0 @@ import { ActiveEvent, ElementType, InputEventType } from "../types"; |
@@ -0,0 +0,0 @@ import { ElementType } from "../types"; |
@@ -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"; |
@@ -0,0 +0,0 @@ import { PanInputOption } from "./inputType/PanInput"; |
@@ -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.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 n(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}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 d(t,n){return o(t,function(t,e){return t===n[e]})}function a(t,e){return S[e]||(S[e]=G(e)),S[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 _(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 g(e){var n=!0;return Object.keys(A).forEach(function(t){e&&e[t]===A[t]||(n=!1)}),n}function p(t,e){return t&&e?30:t?6:e?M:1}function m(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function X(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({},A),{"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 j(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function B(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 Y(t,e){return t<e[0]||t>e[1]}function K(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function E(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 F(t,e){return!!(!e||-1<e.indexOf(w)||-1<e.indexOf("none")&&!t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey||-1<e.indexOf("shift")&&t.shiftKey||-1<e.indexOf("ctrl")&&t.ctrlKey||-1<e.indexOf("alt")&&t.altKey||-1<e.indexOf("meta")&&t.metaKey)}function x(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function N(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=tt;break;case"pointer":i=et}}),i?new st:e&&n?new rt:e?new it:n?new nt:null}var y,V,b="undefined"==typeof window?{navigator:{userAgent:""}}:window,M=24,P="left",T="right",O="middle",W={1:P,2:O,3:T},w="any",q=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],U=["hold","release","change","animationStart","animationEnd","finish"],Q="ontouchstart"in b&&"safari"===t().browser.name,z=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""}(),A={"-webkit-user-select":"none","-ms-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-user-drag":"none"},H=function(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e},D=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,H(n.childNodes)):H(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===b?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in b&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return D(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},C=b.requestAnimationFrame||b.webkitRequestAnimationFrame,I=b.cancelAnimationFrame||b.webkitCancelAnimationFrame,S=(C&&!I?(y={},V=C,C=function(e){var n=V(function(t){y[n]&&e(t)});return y[n]=!0,n},I=function(t){delete y[t]}):C&&I||(C=function(t){return b.setTimeout(function(){t(b.performance&&b.performance.now&&b.performance.now()||(new Date).getTime())},16)},I=b.clearTimeout),{}),G=function(e){var n=e<1?Math.pow(10,_(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Z=function(){function t(t){this._axes=t,this.holdingCount=0}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})},n([h.Observe],t.prototype,"holdingCount",void 0),t}(),J=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}(),$=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?E(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!Y(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}(),tt="ontouchstart"in b,R="PointerEvent"in b,t="MSPointerEvent"in b,et=R||t,t=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),b.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,d=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(d=(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:d,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:P,2:T,4:O},e=this._isTouchEvent(t)?P:e[t.buttons];return e||null},e._isTouchEvent=function(t){return t.type&&-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._isValidEvent=function(t,e,n){return(!e||F(t,e))&&(!n||this._isValidButton(this._getButton(t),n))},e._preventMouseButton=function(t,e){e===T?b.addEventListener("contextmenu",this._stopContextMenu):e===O&&t.preventDefault()},t}(),nt=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,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton(W[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),it=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,e){return this._baseTouches=t.touches,this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventMove=function(t,e){return this._isValidEvent(t,e)?this.extendEvent(t):null},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),st=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}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?(this._updatePointerEvent(t),this.extendEvent(t)):null},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),rt=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,n){var i=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t,e){return this._isTouchEvent(t)?t.touches.length:this._isValidButton(W[t.which],e)&&-1===this.end.indexOf(t.type)?1: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);function ot(t){return-1<t.indexOf("touch")&&{passive:!1}}function k(t,e,n){return Math.max(Math.min(t,n),e)}var e,at=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._eventManager.holdingCount,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])?E(t,e,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!Y(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=x(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:B(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.holdingCount,this._eventManager.triggerRelease(i),0===this._eventManager.holdingCount&&(this._moveDistance=null),o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=d(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[0]&&t<n||e[1]&&i<t?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}(),ut=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!=(i=null==t?void 0:t.duration)?i: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=E(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)),k(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 E(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,I(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 K(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return E(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=k(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 K(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),s&&!d(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 d(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:B(t,n,e)}),d(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:k(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),d(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(_(e.range[0]),_(e.range[1]),_(t)),i=1/Math.pow(10,e)),i||n},t}()),L=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 J(i.options),i.axisManager=new $(i.axis),i.eventManager=new Z(i),i.animationManager=new ut(i),i.inputObserver=new at(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}r(t,s);var e=t.prototype;return Object.defineProperty(e,"holding",{get:function(){return 0<this.eventManager.holdingCount},enumerable:!1,configurable:!0}),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.animationManager.finish(!1),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.4",t.TRANSFORM=z,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,n([h.Computed],t.prototype,"holding",null),n([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._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=D(t),this.options=c({inputType:["touch","mouse","pointer"],inputKey:[w],inputButton:[P],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=p(!!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=X(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),g(this._originalCssProps)||j(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,n=e.inputKey,e=e.inputButton,i=this._activeEvent,n=i.onEventStart(t,n,e);!n||!this._enabled||1<i.getTouches(t,e)||!1!==n.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,n),this._atRightEdge=Q&&n.center.x>window.innerWidth-t,this._attachWindowEvent(i),i.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,s=n.preventClickOnDrag,r=n.releaseOnScroll,o=n.inputKey,a=n.inputButton,u=n.threshold,n=n.thresholdAngle,h=this._activeEvent,o=h.onEventMove(t,o,a),a=h.getTouches(t,a);if(0===a||r&&o&&!o.srcEvent.cancelable)this._onPanend(t);else if(o&&this._enabled&&!(1<a)){r=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?M:6}(o.angle,n),t=m(6,this._direction,r),a=m(M,this._direction,r);if(h.prevEvent&&Q){if(o.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),o.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}n=this._getDistance([o.deltaX,o.deltaY],[t,a]),r=this._getOffset([o.offsetX,o.offsetY],[t,a]),i=r.some(function(t){return 0!==t});i&&(!1!==o.srcEvent.cancelable&&o.srcEvent.preventDefault(),o.srcEvent.stopPropagation()),(o.preventSystemEvent=i)&&(this._isOverThreshold||u<=n)&&(this._dragged=s,this._isOverThreshold=!0,this._observer.change(this,o,x(this.axes,r))),h.prevEvent=o}},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._isOverThreshold?this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[m(6,this._direction),m(M,this._direction)]):[0,0],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,ot(t))}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,ot(t))})},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=N(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,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&&(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}(),ht={default:L,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=L.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventStart(t,n,e);t&&this.isEnabled()&&(n=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(i),this._coefficientForDistanceToAngle=360/(n.width*Math.PI),this._rotateOrigin=[n.left+(n.width-1)/2,n.top+(n.height-1)/2],this._prevAngle=null,this._triggerChange(t),i.prevEvent=t)},e._onPanmove=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventMove(t,n,e);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),i.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,x(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._isOverThreshold=!1,this.element=D(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=X(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),g(this._originalCssProps)||j(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,x(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=N(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},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=c({inputKey:[w],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=p(!!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&&F(t,this.options.inputKey)&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[m(M,this._direction),m(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,x(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=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,x(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:q,AXES_EVENTS:U,REACTIVE_AXES:{methods:q,events:U,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(e in ht)L[e]=ht[e];return L}); | ||
!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,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 n(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}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 d(t,n){return o(t,function(t,e){return t===n[e]})}function a(t,e){return S[e]||(S[e]=G(e)),S[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 _(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 g(e){var n=!0;return Object.keys(A).forEach(function(t){e&&e[t]===A[t]||(n=!1)}),n}function p(t,e){return t&&e?30:t?6:e?M:1}function m(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function X(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({},A),{"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 j(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function B(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 Y(t,e){return t<e[0]||t>e[1]}function K(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function E(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 F(t,e){return!!(!e||-1<e.indexOf(w)||-1<e.indexOf("none")&&!t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey||-1<e.indexOf("shift")&&t.shiftKey||-1<e.indexOf("ctrl")&&t.ctrlKey||-1<e.indexOf("alt")&&t.altKey||-1<e.indexOf("meta")&&t.metaKey)}function x(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function N(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=tt;break;case"pointer":i=et}}),i?new st:e&&n?new rt:e?new it:n?new nt:null}var y,V,b="undefined"==typeof window?{navigator:{userAgent:""}}:window,M=24,P="left",T="right",O="middle",W={1:P,2:O,3:T},w="any",q=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],U=["hold","release","change","animationStart","animationEnd","finish"],Q="ontouchstart"in b&&"safari"===t().browser.name,z=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""}(),A={"-webkit-user-select":"none","-ms-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-user-drag":"none"},H=function(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e},D=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,H(n.childNodes)):H(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===b?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in b&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return D(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},C=b.requestAnimationFrame||b.webkitRequestAnimationFrame,I=b.cancelAnimationFrame||b.webkitCancelAnimationFrame,S=(C&&!I?(y={},V=C,C=function(e){var n=V(function(t){y[n]&&e(t)});return y[n]=!0,n},I=function(t){delete y[t]}):C&&I||(C=function(t){return b.setTimeout(function(){t(b.performance&&b.performance.now&&b.performance.now()||(new Date).getTime())},16)},I=b.clearTimeout),{}),G=function(e){var n=e<1?Math.pow(10,_(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Z=function(){function t(t){this._axes=t,this.holdingCount=0}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})},n([h.Observe],t.prototype,"holdingCount",void 0),t}(),J=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}(),$=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?E(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!Y(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}(),tt="ontouchstart"in b,R="PointerEvent"in b,t="MSPointerEvent"in b,et=R||t,t=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),b.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,d=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(d=(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:d,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:P,2:T,4:O},e=this._isTouchEvent(t)?P:e[t.buttons];return e||null},e._isTouchEvent=function(t){return t.type&&-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._isValidEvent=function(t,e,n){return(!e||F(t,e))&&(!n||this._isValidButton(this._getButton(t),n))},e._preventMouseButton=function(t,e){e===T?b.addEventListener("contextmenu",this._stopContextMenu):e===O&&t.preventDefault()},t}(),nt=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,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton(W[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),it=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,e){return this._baseTouches=t.touches,this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventMove=function(t,e){return this._isValidEvent(t,e)?this.extendEvent(t):null},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),st=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}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?(this._updatePointerEvent(t),this.extendEvent(t)):null},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),rt=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,n){var i=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t,e){return this._isTouchEvent(t)?t.touches.length:this._isValidButton(W[t.which],e)&&-1===this.end.indexOf(t.type)?1: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);function ot(t){return-1<t.indexOf("touch")&&{passive:!1}}function k(t,e,n){return Math.max(Math.min(t,n),e)}var e,at=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._eventManager.holdingCount,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])?E(t,e,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!Y(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=x(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:B(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.holdingCount,this._eventManager.triggerRelease(i),0===this._eventManager.holdingCount&&(this._moveDistance=null),o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=d(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[0]&&t<n||e[1]&&i<t?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}(),ut=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!=(i=null==t?void 0:t.duration)?i: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=E(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)),k(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 E(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,I(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 K(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return E(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=k(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 K(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),s&&!d(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 d(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:B(t,n,e)}),d(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:k(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),d(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(_(e.range[0]),_(e.range[1]),_(t)),i=1/Math.pow(10,e)),i||n},t}()),L=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 J(i.options),i.axisManager=new $(i.axis),i.eventManager=new Z(i),i.animationManager=new ut(i),i.inputObserver=new at(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}r(t,s);var e=t.prototype;return Object.defineProperty(e,"holding",{get:function(){return 0<this.eventManager.holdingCount},enumerable:!1,configurable:!0}),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.animationManager.finish(!1),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.4",t.TRANSFORM=z,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,n([h.Computed],t.prototype,"holding",null),n([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._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=D(t),this.options=c({inputType:["touch","mouse","pointer"],inputKey:[w],inputButton:[P],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=p(!!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=X(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),g(this._originalCssProps)||j(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,n=e.inputKey,e=e.inputButton,i=this._activeEvent,n=i.onEventStart(t,n,e);!n||!this._enabled||1<i.getTouches(t,e)||!1!==n.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,n),this._atRightEdge=Q&&n.center.x>window.innerWidth-t,this._attachWindowEvent(i),i.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,s=n.preventClickOnDrag,r=n.releaseOnScroll,o=n.inputKey,a=n.inputButton,u=n.threshold,n=n.thresholdAngle,h=this._activeEvent,o=h.onEventMove(t,o,a),a=h.getTouches(t,a);if(0===a||r&&o&&!o.srcEvent.cancelable)this._onPanend(t);else if(o&&this._enabled&&!(1<a)){r=o.angle;a=(t=n)<0||90<t?1:t<(r=Math.abs(r))&&r<180-t?M:6,n=m(6,this._direction,a),r=m(M,this._direction,a);if(h.prevEvent&&Q){if(o.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),o.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}t=this._getDistance([o.deltaX,o.deltaY],[n,r]),a=this._getOffset([o.offsetX,o.offsetY],[n,r]),i=a.some(function(t){return 0!==t});i&&(!1!==o.srcEvent.cancelable&&o.srcEvent.preventDefault(),o.srcEvent.stopPropagation()),(o.preventSystemEvent=i)&&(this._isOverThreshold||u<=t)&&(this._dragged=s,this._isOverThreshold=!0,this._observer.change(this,o,x(this.axes,a))),h.prevEvent=o}},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._isOverThreshold?this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[m(6,this._direction),m(M,this._direction)]):[0,0],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,ot(t))}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,ot(t))})},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=N(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,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&&(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}(),ht={default:L,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=L.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventStart(t,n,e);t&&this.isEnabled()&&(n=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(i),this._coefficientForDistanceToAngle=360/(n.width*Math.PI),this._rotateOrigin=[n.left+(n.width-1)/2,n.top+(n.height-1)/2],this._prevAngle=null,this._triggerChange(t),i.prevEvent=t)},e._onPanmove=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventMove(t,n,e);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),i.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,x(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._isOverThreshold=!1,this.element=D(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=X(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),g(this._originalCssProps)||j(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,x(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=N(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},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=c({inputKey:[w],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=p(!!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&&F(t,this.options.inputKey)&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[m(M,this._direction),m(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,x(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=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,x(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:q,AXES_EVENTS:U,REACTIVE_AXES:{methods:q,events:U,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(e in ht)L[e]=ht[e];return L}); | ||
//# 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 L=function(t,e){return(L=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}L(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 n(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}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{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 X=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}(),B=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 X?e.eventType:e,i=o(this._eventHandler[i]||[]);return i.length<=0||(e instanceof X?(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=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}(),h=X;function N(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 Y(){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 K=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=N(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}(),F=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 K?e.eventType:e,i=Y(this._eventHandler[i]||[]);return i.length<=0||(e instanceof K?(e.currentTarget=this,i.forEach(function(t){t(e)})):i.forEach(function(t){t.apply(void 0,Y(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&l(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,Y(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&&l(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],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e))}return this},e.off=function(t,e){var n,i;if(l(t))this._eventHandler={};else if(l(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=N(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.4",t}();var H="__observers__",s="__computed__",W=1,U="__CFCS_DETECTED_DEPENDENCIES__",q=function(t,e){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function z(){Object[U]=Object[U]||{};var t=Object[U];return t[W]=t[W]||[],t[W]}var Q=function(){function t(t){this._emitter=new F,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){var t=(t=z())[t.length-1];return null!=t&&t.push(this),this._current},set:function(t){this._setCurrent(t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){return this.current,this._emitter.on("update",t),this},e.unsubscribe=function(t){return this._emitter.off("update",t),this},e._setCurrent=function(t){var e=this._current,n=t!==e;this._current=t,n&&this._emitter.trigger("update",t,e)},e.toString=function(){return"".concat(this.current)},e.valueOf=function(){return this.current},t}(),G=function(n){var t=r,e=n;if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}function r(t){var e=n.call(this)||this;return e._computedCallback=t,e._registered=[],e._onCheckUpdate=function(){e._setCurrent(e.current)},e._current=e.current,e}return q(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i),Object.defineProperty(r.prototype,"current",{get:function(){var e,n,i=this,t=(e=this,t=z(),r={host:e,observers:n=[],push:function(t){e!==t&&-1===n.indexOf(t)&&n.push(t)}},t.push(r),this._computedCallback()),r=z().pop();return this._registered.forEach(function(t){t.unsubscribe(i._onCheckUpdate)}),r.observers.forEach(function(t){t.subscribe(i._onCheckUpdate)}),this._registered=r.observers,t},enumerable:!1,configurable:!0}),r}(Q);function Z(t,e,n){void 0===n&&(n=e),Object.defineProperty(t,e,{configurable:!0,get:function(){return f(this,n).current},set:function(t){f(this,n,t).current=t}}),n!==e&&Object.defineProperty(t,n,{configurable:!0,get:function(){return f(this,n).current}})}function J(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 1<n.length?Z(n[0],n[1]):function(t,e){return Z(t,e,n[0])}}function $(t){t.subscribe=function(t,e){this[t],f(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n=this;t?t in this&&f(this,t).unsubscribe(e):(t=et(this),Object.keys(t).forEach(function(t){n.unsubscribe(t)}))}}function tt(t){$(t.prototype)}function et(e,t){e[H]||(n={},Object.defineProperty(e,H,{get:function(){return n}}));var n,i=e[H];return t||(t=null==(t=null==(t=null==e?void 0:e.constructor)?void 0:t.prototype)?void 0:t[s])&&t.forEach(function(t){!(t in i)&&t in e&&e[t]}),i}function f(t,e,n){t=et(t);return t[e]||(t[e]=new Q(n)),t[e]}function nt(t,e,n){var i=n.get;var n={configurable:!0,get:function(){var t=et(this,!0);return e in t||(t[e]=(t=i.bind(this),new G(t))),f(this,e).current}},r=(t[s]||(t[s]=[]),t[s]);return-1===r.indexOf(e)&&r.push(e),Object.defineProperty(t,e,n),n}function it(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function rt(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function st(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}function ot(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function at(t){return t.replace(/_/g,".")}function e(t,n){var i=null,r="-1";return it(t,function(t){var e=ot("("+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=ot("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",n))?e[3]:"")||r),r=at(r),1}),{preset:i,version:r}}function t(t,n){var i={brand:"",version:"-1"};return it(t,function(t){var e=ut(n,t);return e&&(i.brand=t.id,i.version=t.versionAlias||e.version,"-1"!==i.version)}),i}function ut(t,e){return rt(t,function(t){t=t.brand;return ot(""+e.test,t.toLowerCase())})}var r="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"}],ht=[{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"}],ct=[{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 lt(t){return!!e(ct,t).preset}function _(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function ft(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function vt(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function p(t,n){return vt(t,function(t,e){return t===n[e]})}function dt(t,e){return Vt[e]||(Vt[e]=Xt(e)),Vt[e](t)}function _t(t,n){return t&&n?_(t,function(t,e){return dt(t,"number"==typeof n?n:n[e])}):t}function g(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 pt(t,e){return 180*Math.atan2(e,t)/Math.PI}function gt(e){var n=!0;return Object.keys(Rt).forEach(function(t){e&&e[t]===Rt[t]||(n=!1)}),n}function mt(t,e){return t&&e?30:t?6:e?24:1}function m(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function Et(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({},Rt),{"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 bt(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function yt(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 xt(t,e){return t<e[0]||t>e[1]}function wt(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function E(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 Mt(t,e){return!!(!e||-1<e.indexOf("any")||-1<e.indexOf("none")&&!t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey||-1<e.indexOf("shift")&&t.shiftKey||-1<e.indexOf("ctrl")&&t.ctrlKey||-1<e.indexOf("alt")&&t.altKey||-1<e.indexOf("meta")&&t.metaKey)}function b(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function Pt(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=Kt;break;case"pointer":i=Ft}}),i?new Ut:e&&n?new qt:e?new Wt:n?new Ht:null}var y,x,w,M,P,O,Ot,T,A,D,Tt,C="left",At="right",Dt="middle",Ct={1:C,2:Dt,3:At},It=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],St=["hold","release","change","animationStart","animationEnd","finish"],kt="ontouchstart"in r&&"safari"===(void 0===y&&function(){var t;if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData)return(t=(t=navigator.userAgentData).brands||t.uaList)&&t.length}()?(w=((T=navigator.userAgentData).uaList||T.brands).slice(),M=x&&x.fullVersionList,P=T.mobile||!1,O=w[0],Ot=(x&&x.platform||T.platform||navigator.platform).toLowerCase(),T={name:O.brand,version:O.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!t(ct,w).brand||lt(st())},O={name:"unknown",version:"-1",majorVersion:-1},T.webkit=!T.chromium&&it(v,function(t){return ut(w,t)}),A=t(ht,w),T.chromium=!!A.brand,T.chromiumVersion=A.version,T.chromium||(A=t(v,w),T.webkit=!!A.brand,T.webkitVersion=A.version),A=rt(d,function(t){return new RegExp(""+t.test,"g").exec(Ot)}),O.name=A?A.id:"",x&&(O.version=x.platformVersion),M&&M.length?(A=t(a,M),T.name=A.brand||T.name,T.version=A.version||T.version):(M=t(a,w),T.name=M.brand||T.name,T.version=M.brand&&x?x.uaFullVersion:M.version),T.webkit&&(O.name=P?"ios":"mac"),"ios"===O.name&&T.webview&&(T.version="-1"),O.version=at(O.version),T.version=at(T.version),O.majorVersion=parseInt(O.version,10),T.majorVersion=parseInt(T.version,10),{browser:T,os:O,isMobile:P,isHints:!0}):(A=st(A=y),x=!!/mobi/g.exec(A),M={name:"unknown",version:"-1",majorVersion:-1,webview:lt(A),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},T={name:"unknown",version:"-1",majorVersion:-1},P=(O=e(a,A)).preset,O=O.version,a=(y=e(d,A)).preset,y=y.version,d=e(ht,A),M.chromium=!!d.preset,M.chromiumVersion=d.version,M.chromium||(d=e(v,A),M.webkit=!!d.preset,M.webkitVersion=d.version),a&&(T.name=a.id,T.version=y,T.majorVersion=parseInt(y,10)),P&&(M.name=P.id,M.version=O,M.webview&&"ios"===T.name&&"safari"!==M.name&&(M.webview=!1)),M.majorVersion=parseInt(M.version,10),{browser:M,os:T,isMobile:x,isHints:!1})).browser.name,jt=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""}(),Rt={"-webkit-user-select":"none","-ms-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-user-drag":"none"},Lt=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,Lt(n.childNodes)):Lt(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===r?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in r&&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},S=r.requestAnimationFrame||r.webkitRequestAnimationFrame,k=r.cancelAnimationFrame||r.webkitCancelAnimationFrame,Vt=(S&&!k?(D={},Tt=S,S=function(e){var n=Tt(function(t){D[n]&&e(t)});return D[n]=!0,n},k=function(t){delete D[t]}):S&&k||(S=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},k=r.clearTimeout),{}),Xt=function(e){var n=e<1?Math.pow(10,g(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Bt=function(){function t(t){this._axes=t,this.holdingCount=0}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];f(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:_t(t,n),roundDepa:_t(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})},n([J],t.prototype,"holdingCount",void 0),t}(),Nt=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}(),Yt=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 _(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=_(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?E(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 vt(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return ft(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return _(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!xt(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}(),Kt="ontouchstart"in r,j="PointerEvent"in r,ht="MSPointerEvent"in r,Ft=j||ht,v=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=this.prevEvent,n=this._getCenter(t),i=e?this._getMovement(t):{x:0,y:0},r=e?this._getScale(t):1,s=e?pt(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,f=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(f=(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:f,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:C,2:At,4:Dt},e=this._isTouchEvent(t)?C:e[t.buttons];return e||null},e._isTouchEvent=function(t){return t.type&&-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._isValidEvent=function(t,e,n){return(!e||Mt(t,e))&&(!n||this._isValidButton(this._getButton(t),n))},e._preventMouseButton=function(t,e){e===At?r.addEventListener("contextmenu",this._stopContextMenu):e===Dt&&t.preventDefault()},t}(),Ht=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,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton(Ct[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),Wt=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,e){return this._baseTouches=t.touches,this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventMove=function(t,e){return this._isValidEvent(t,e)?this.extendEvent(t):null},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),Ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=j?["pointerdown"]:["MSPointerDown"],t.move=j?["pointermove"]:["MSPointerMove"],t.end=j?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?(this._updatePointerEvent(t),this.extendEvent(t)):null},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),qt=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,n){var i=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t,e){return this._isTouchEvent(t)?t.touches.length:this._isValidButton(Ct[t.which],e)&&-1===this.end.indexOf(t.type)?1: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);function zt(t){return-1<t.indexOf("touch")&&{passive:!1}}function Qt(t,e,n){return Math.max(Math.min(t,n),e)}var Gt,Zt=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._eventManager.holdingCount,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=_(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])?E(t,e,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!xt(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=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])?r[n]+t:yt(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.holdingCount,this._eventManager.triggerRelease(i),0===this._eventManager.holdingCount&&(this._moveDistance=null),o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=p(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[0]&&t<n||e[1]&&i<t?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}(),Jt=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!=(i=null==t?void 0:t.duration)?i: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=_(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=E(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=_(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)),Qt(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 E(t,e.range,e.circular)}),vt(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,k(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 wt(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return E(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=Qt(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 wt(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),r&&!p(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 p(t,i)||(this.interruptManager.setInterrupt(!0),n=ft(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:yt(t,n,e)}),p(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(_(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:Qt(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=_(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),p(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),i()):n?a.finish(!1):a._raf=S(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,n){var i=this;return _(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:(e=i._getRoundUnit(t,e),dt(t,e))})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),e=Math.max(g(e.range[0]),g(e.range[1]),g(t)),i=1/Math.pow(10,e)),i||n},t}()),R=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 Nt(i.options),i.axisManager=new Yt(i.axis),i.eventManager=new Bt(i),i.animationManager=new Jt(i),i.inputObserver=new Zt(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}i(t,r);var e=t.prototype;return Object.defineProperty(e,"holding",{get:function(){return 0<this.eventManager.holdingCount},enumerable:!1,configurable:!0}),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.animationManager.finish(!1),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.4",t.TRANSFORM=jt,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=24,t.DIRECTION_ALL=30,n([nt],t.prototype,"holding",null),n([tt],t)}(B),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._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=I(t),this.options=u({inputType:["touch","mouse","pointer"],inputKey:["any"],inputButton:[C],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=mt(!!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=Et(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),gt(this._originalCssProps)||bt(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,n=e.inputKey,e=e.inputButton,i=this._activeEvent,n=i.onEventStart(t,n,e);!n||!this._enabled||1<i.getTouches(t,e)||!1!==n.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,n),this._atRightEdge=kt&&n.center.x>window.innerWidth-t,this._attachWindowEvent(i),i.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,r=n.preventClickOnDrag,s=n.releaseOnScroll,o=n.inputKey,a=n.inputButton,u=n.threshold,n=n.thresholdAngle,h=this._activeEvent,o=h.onEventMove(t,o,a),a=h.getTouches(t,a);if(0===a||s&&o&&!o.srcEvent.cancelable)this._onPanend(t);else if(o&&this._enabled&&!(1<a)){s=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?24:6}(o.angle,n),t=m(6,this._direction,s),a=m(24,this._direction,s);if(h.prevEvent&&kt){if(o.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),o.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}n=this._getDistance([o.deltaX,o.deltaY],[t,a]),s=this._getOffset([o.offsetX,o.offsetY],[t,a]),i=s.some(function(t){return 0!==t});i&&(!1!==o.srcEvent.cancelable&&o.srcEvent.preventDefault(),o.srcEvent.stopPropagation()),(o.preventSystemEvent=i)&&(this._isOverThreshold||u<=n)&&(this._dragged=r,this._isOverThreshold=!0,this._observer.change(this,o,b(this.axes,s))),h.prevEvent=o}},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._isOverThreshold?this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[m(6,this._direction),m(24,this._direction)]):[0,0],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,zt(t))}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,zt(t))})},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=Pt(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,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&&(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}(),$t={default:R,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=R.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventStart(t,n,e);t&&this.isEnabled()&&(n=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(i),this._coefficientForDistanceToAngle=360/(n.width*Math.PI),this._rotateOrigin=[n.left+(n.width-1)/2,n.top+(n.height-1)/2],this._prevAngle=null,this._triggerChange(t),i.prevEvent=t)},e._onPanmove=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventMove(t,n,e);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),i.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=pt(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}(d),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=I(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=Et(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),gt(this._originalCssProps)||bt(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,b(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=Pt(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},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=I(t),this.options=u({inputKey:["any"],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=mt(!!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&&Mt(t,this.options.inputKey)&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[m(24,this._direction),m(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=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,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:It,AXES_EVENTS:St,REACTIVE_AXES:{methods:It,events:St,created:function(t){return new R(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(Gt in $t)R[Gt]=$t[Gt];return R}); | ||
!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 L=function(t,e){return(L=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}L(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 n(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}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{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=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}(),X=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=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.4",t}(),h=r;var B="__observers__",s="__computed__",Y=1,K="__CFCS_DETECTED_DEPENDENCIES__",N=function(t,e){return(N=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function F(){Object[K]=Object[K]||{};var t=Object[K];return t[Y]=t[Y]||[],t[Y]}var W=function(){function t(t){this._emitter=new X,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){var t=(t=F())[t.length-1];return null!=t&&t.push(this),this._current},set:function(t){this._setCurrent(t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){return this.current,this._emitter.on("update",t),this},e.unsubscribe=function(t){return this._emitter.off("update",t),this},e._setCurrent=function(t){var e=this._current,n=t!==e;this._current=t,n&&this._emitter.trigger("update",t,e)},e.toString=function(){return"".concat(this.current)},e.valueOf=function(){return this.current},t}(),H=function(n){var t=r,e=n;if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}function r(t){var e=n.call(this)||this;return e._computedCallback=t,e._registered=[],e._onCheckUpdate=function(){e._setCurrent(e.current)},e._current=e.current,e}return N(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i),Object.defineProperty(r.prototype,"current",{get:function(){var e,n,i=this,t=(e=this,t=F(),r={host:e,observers:n=[],push:function(t){e!==t&&-1===n.indexOf(t)&&n.push(t)}},t.push(r),this._computedCallback()),r=F().pop();return this._registered.forEach(function(t){t.unsubscribe(i._onCheckUpdate)}),r.observers.forEach(function(t){t.subscribe(i._onCheckUpdate)}),this._registered=r.observers,t},enumerable:!1,configurable:!0}),r}(W);function U(t,e,n){void 0===n&&(n=e),Object.defineProperty(t,e,{configurable:!0,get:function(){return l(this,n).current},set:function(t){l(this,n,t).current=t}}),n!==e&&Object.defineProperty(t,n,{configurable:!0,get:function(){return l(this,n).current}})}function q(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 1<n.length?U(n[0],n[1]):function(t,e){return U(t,e,n[0])}}function z(t){t.subscribe=function(t,e){this[t],l(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n=this;t?t in this&&l(this,t).unsubscribe(e):(t=G(this),Object.keys(t).forEach(function(t){n.unsubscribe(t)}))}}function Q(t){z(t.prototype)}function G(e,t){e[B]||(n={},Object.defineProperty(e,B,{get:function(){return n}}));var n,i=e[B];return t||(t=null==(t=null==(t=null==e?void 0:e.constructor)?void 0:t.prototype)?void 0:t[s])&&t.forEach(function(t){!(t in i)&&t in e&&e[t]}),i}function l(t,e,n){t=G(t);return t[e]||(t[e]=new W(n)),t[e]}function Z(t,e,n){var i=n.get;var n={configurable:!0,get:function(){var t=G(this,!0);return e in t||(t[e]=(t=i.bind(this),new H(t))),l(this,e).current}},r=(t[s]||(t[s]=[]),t[s]);return-1===r.indexOf(e)&&r.push(e),Object.defineProperty(t,e,n),n}function J(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function $(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function tt(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}function et(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function nt(t){return t.replace(/_/g,".")}function e(t,n){var i=null,r="-1";return J(t,function(t){var e=et("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",n);return e&&!t.brand&&(i=t,r=e[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),r=((e=et("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",n))?e[3]:"")||r),r=nt(r),1)}),{preset:i,version:r}}function t(t,n){var i={brand:"",version:"-1"};return J(t,function(t){var e=it(n,t);return e&&(i.brand=t.id,i.version=t.versionAlias||e.version,"-1"!==i.version)}),i}function it(t,e){return $(t,function(t){t=t.brand;return et(""+e.test,t.toLowerCase())})}var a="undefined"==typeof window?{navigator:{userAgent:""}}:window,d=[{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"}],rt=[{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"}],st=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],f=[{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 ot(t){return!!e(st,t).preset}function _(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function at(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function ut(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function p(t,n){return ut(t,function(t,e){return t===n[e]})}function ht(t,e){return kt[e]||(kt[e]=St(e)),kt[e](t)}function ct(t,n){return t&&n?_(t,function(t,e){return ht(t,"number"==typeof n?n:n[e])}):t}function g(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 lt(t,e){return 180*Math.atan2(e,t)/Math.PI}function dt(e){var n=!0;return Object.keys(Ct).forEach(function(t){e&&e[t]===Ct[t]||(n=!1)}),n}function vt(t,e){return t&&e?30:t?6:e?24:1}function m(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function ft(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({},Ct),{"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 _t(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function pt(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 gt(t,e){return t<e[0]||t>e[1]}function mt(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function E(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 Et(t,e){return!!(!e||-1<e.indexOf("any")||-1<e.indexOf("none")&&!t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey||-1<e.indexOf("shift")&&t.shiftKey||-1<e.indexOf("ctrl")&&t.ctrlKey||-1<e.indexOf("alt")&&t.altKey||-1<e.indexOf("meta")&&t.metaKey)}function b(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function bt(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=Vt;break;case"pointer":i=Xt}}),i?new Kt:e&&n?new Nt:e?new Yt:n?new Bt:null}var y,x,w,M,P,O,yt,T,A,D,xt,C="left",wt="right",Mt="middle",Pt={1:C,2:Mt,3:wt},Ot=["connect","disconnect","get","setTo","setBy","setOptions","setAxis","stopAnimation","updateAnimation","isBounceArea"],Tt=["hold","release","change","animationStart","animationEnd","finish"],At="ontouchstart"in a&&"safari"===(void 0===y&&function(){var t;if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData)return(t=(t=navigator.userAgentData).brands||t.uaList)&&t.length}()?(w=((T=navigator.userAgentData).uaList||T.brands).slice(),M=x&&x.fullVersionList,P=T.mobile||!1,O=w[0],yt=(x&&x.platform||T.platform||navigator.platform).toLowerCase(),T={name:O.brand,version:O.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!t(st,w).brand||ot(tt())},O={name:"unknown",version:"-1",majorVersion:-1},T.webkit=!T.chromium&&J(v,function(t){return it(w,t)}),A=t(rt,w),T.chromium=!!A.brand,T.chromiumVersion=A.version,T.chromium||(A=t(v,w),T.webkit=!!A.brand,T.webkitVersion=A.version),A=$(f,function(t){return new RegExp(""+t.test,"g").exec(yt)}),O.name=A?A.id:"",x&&(O.version=x.platformVersion),M&&M.length?(A=t(d,M),T.name=A.brand||T.name,T.version=A.version||T.version):(M=t(d,w),T.name=M.brand||T.name,T.version=M.brand&&x?x.uaFullVersion:M.version),T.webkit&&(O.name=P?"ios":"mac"),"ios"===O.name&&T.webview&&(T.version="-1"),O.version=nt(O.version),T.version=nt(T.version),O.majorVersion=parseInt(O.version,10),T.majorVersion=parseInt(T.version,10),{browser:T,os:O,isMobile:P,isHints:!0}):(A=tt(A=y),x=!!/mobi/g.exec(A),M={name:"unknown",version:"-1",majorVersion:-1,webview:ot(A),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},T={name:"unknown",version:"-1",majorVersion:-1},P=(O=e(d,A)).preset,O=O.version,d=(y=e(f,A)).preset,y=y.version,f=e(rt,A),M.chromium=!!f.preset,M.chromiumVersion=f.version,M.chromium||(f=e(v,A),M.webkit=!!f.preset,M.webkitVersion=f.version),d&&(T.name=d.id,T.version=y,T.majorVersion=parseInt(y,10)),P&&(M.name=P.id,M.version=O,M.webview)&&"ios"===T.name&&"safari"!==M.name&&(M.webview=!1),M.majorVersion=parseInt(M.version,10),{browser:M,os:T,isMobile:x,isHints:!1})).browser.name,Dt=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""}(),Ct={"-webkit-user-select":"none","-ms-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-user-drag":"none"},It=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,It(n.childNodes)):It(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===a?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in a&&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},k=a.requestAnimationFrame||a.webkitRequestAnimationFrame,S=a.cancelAnimationFrame||a.webkitCancelAnimationFrame,kt=(k&&!S?(D={},xt=k,k=function(e){var n=xt(function(t){D[n]&&e(t)});return D[n]=!0,n},S=function(t){delete D[t]}):k&&S||(k=function(t){return a.setTimeout(function(){t(a.performance&&a.performance.now&&a.performance.now()||(new Date).getTime())},16)},S=a.clearTimeout),{}),St=function(e){var n=e<1?Math.pow(10,g(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},jt=function(){function t(t){this._axes=t,this.holdingCount=0}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:ct(t,n),roundDepa:ct(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})},n([q],t.prototype,"holdingCount",void 0),t}(),Rt=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}(),Lt=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 _(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=_(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?E(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 ut(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return at(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return _(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!gt(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}(),Vt="ontouchstart"in a,j="PointerEvent"in a,rt="MSPointerEvent"in a,Xt=j||rt,v=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),a.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?lt(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,d=e?e.velocityX:0,e=e?e.velocityY:0;return(!h||16<=l)&&(h&&(d=(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:d,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:C,2:wt,4:Mt},e=this._isTouchEvent(t)?C:e[t.buttons];return e||null},e._isTouchEvent=function(t){return t.type&&-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._isValidEvent=function(t,e,n){return(!e||Et(t,e))&&(!n||this._isValidButton(this._getButton(t),n))},e._preventMouseButton=function(t,e){e===wt?a.addEventListener("contextmenu",this._stopContextMenu):e===Mt&&t.preventDefault()},t}(),Bt=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,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){return e&&this._isValidButton(Pt[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),Yt=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,e){return this._baseTouches=t.touches,this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventMove=function(t,e){return this._isValidEvent(t,e)?this.extendEvent(t):null},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=j?["pointerdown"]:["MSPointerDown"],t.move=j?["pointermove"]:["MSPointerMove"],t.end=j?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}i(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?(this._updatePointerEvent(t),this.extendEvent(t)):null},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),Nt=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,n){var i=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t,e){return this._isTouchEvent(t)?t.touches.length:this._isValidButton(Pt[t.which],e)&&-1===this.end.indexOf(t.type)?1: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);function Ft(t){return-1<t.indexOf("touch")&&{passive:!1}}function Wt(t,e,n){return Math.max(Math.min(t,n),e)}var Ht,Ut=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._eventManager.holdingCount,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=_(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])?E(t,e,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!gt(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=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])?r[n]+t:pt(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.holdingCount,this._eventManager.triggerRelease(i),0===this._eventManager.holdingCount&&(this._moveDistance=null),o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=p(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[0]&&t<n||e[1]&&i<t?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}(),qt=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!=(i=null==t?void 0:t.duration)?i: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=_(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=E(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=_(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)),Wt(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 E(t,e.range,e.circular)}),ut(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 mt(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return E(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=Wt(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 mt(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),r&&!p(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 p(t,i)||(this.interruptManager.setInterrupt(!0),n=at(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:pt(t,n,e)}),p(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(_(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:Wt(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=_(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),p(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 _(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:(e=i._getRoundUnit(t,e),ht(t,e))})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),e=Math.max(g(e.range[0]),g(e.range[1]),g(t)),i=1/Math.pow(10,e)),i||n},t}()),R=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 Rt(i.options),i.axisManager=new Lt(i.axis),i.eventManager=new jt(i),i.animationManager=new qt(i),i.inputObserver=new Ut(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}i(t,r);var e=t.prototype;return Object.defineProperty(e,"holding",{get:function(){return 0<this.eventManager.holdingCount},enumerable:!1,configurable:!0}),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.animationManager.finish(!1),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.4",t.TRANSFORM=Dt,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=24,t.DIRECTION_ALL=30,n([Z],t.prototype,"holding",null),n([Q],t)}(X),f=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=I(t),this.options=u({inputType:["touch","mouse","pointer"],inputKey:["any"],inputButton:[C],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=vt(!!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=ft(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),dt(this._originalCssProps)||_t(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,n=e.inputKey,e=e.inputButton,i=this._activeEvent,n=i.onEventStart(t,n,e);!n||!this._enabled||1<i.getTouches(t,e)||!1!==n.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,n),this._atRightEdge=At&&n.center.x>window.innerWidth-t,this._attachWindowEvent(i),i.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,r=n.preventClickOnDrag,s=n.releaseOnScroll,o=n.inputKey,a=n.inputButton,u=n.threshold,n=n.thresholdAngle,h=this._activeEvent,o=h.onEventMove(t,o,a),a=h.getTouches(t,a);if(0===a||s&&o&&!o.srcEvent.cancelable)this._onPanend(t);else if(o&&this._enabled&&!(1<a)){s=o.angle;a=(t=n)<0||90<t?1:t<(s=Math.abs(s))&&s<180-t?24:6,n=m(6,this._direction,a),s=m(24,this._direction,a);if(h.prevEvent&&At){if(o.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),o.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}t=this._getDistance([o.deltaX,o.deltaY],[n,s]),a=this._getOffset([o.offsetX,o.offsetY],[n,s]),i=a.some(function(t){return 0!==t});i&&(!1!==o.srcEvent.cancelable&&o.srcEvent.preventDefault(),o.srcEvent.stopPropagation()),(o.preventSystemEvent=i)&&(this._isOverThreshold||u<=t)&&(this._dragged=r,this._isOverThreshold=!0,this._observer.change(this,o,b(this.axes,a))),h.prevEvent=o}},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._isOverThreshold?this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[m(6,this._direction),m(24,this._direction)]):[0,0],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,Ft(t))}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,Ft(t))})},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=bt(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,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&&(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}(),zt={default:R,PanInput:f,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=R.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventStart(t,n,e);t&&this.isEnabled()&&(n=this.element.getBoundingClientRect(),this._observer.hold(this,t),this._attachWindowEvent(i),this._coefficientForDistanceToAngle=360/(n.width*Math.PI),this._rotateOrigin=[n.left+(n.width-1)/2,n.top+(n.height-1)/2],this._prevAngle=null,this._triggerChange(t),i.prevEvent=t)},e._onPanmove=function(t){var e=this.options,n=e.inputKey,e=e.inputButton,i=this._activeEvent,t=i.onEventMove(t,n,e);t&&this.isEnabled()&&(!1!==t.srcEvent.cancelable&&t.srcEvent.preventDefault(),t.srcEvent.stopPropagation(),this._triggerChange(t),i.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=lt(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}(f),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=I(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=ft(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),dt(this._originalCssProps)||_t(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,b(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=bt(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},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=I(t),this.options=u({inputKey:["any"],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=vt(!!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&&Et(t,this.options.inputKey)&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[m(24,this._direction),m(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=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,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:Ot,AXES_EVENTS:Tt,REACTIVE_AXES:{methods:Ot,events:Tt,created:function(t){return new R(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(Ht in zt)R[Ht]=zt[Ht];return R}); | ||
//# sourceMappingURL=axes.pkgd.min.js.map |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -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"; |
@@ -0,0 +0,0 @@ export var DIRECTION_NONE = 1; |
@@ -0,0 +0,0 @@ export var getInsidePosition = function (destPos, range, circular, bounce) { |
@@ -0,0 +0,0 @@ import { getAngle } from "../utils"; |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ import Axes, * as modules from "./index"; |
@@ -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 () { |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -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"; |
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
{ | ||
"name": "@egjs/axes", | ||
"version": "3.8.5-beta.0", | ||
"version": "3.8.5", | ||
"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.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
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 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
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
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
1
2272625
117
19332