UNPKG

169 kBSource Map (JSON)View Raw
1{"version":3,"file":"axes.pkgd.js","sources":["../src/Coordinate.ts","../src/browser.ts","../src/utils.ts","../src/AnimationManager.ts","../src/EventManager.ts","../src/InterruptManager.ts","../src/AxisManager.ts","../src/InputObserver.ts","../src/const.ts","../src/Axes.ts","../src/inputType/InputType.ts","../src/inputType/PanInput.ts","../src/inputType/RotatePanInput.ts","../src/inputType/PinchInput.ts","../src/inputType/WheelInput.ts","../src/inputType/MoveKeyInput.ts","../src/index.umd.ts"],"sourcesContent":["export function getInsidePosition(\n\tdestPos: number,\n\trange: number[],\n\tcircular: boolean[],\n\tbounce?: number[],\n): number {\n\tlet toDestPos: number = destPos;\n\tconst targetRange: number[] = [\n\t\tcircular[0] ? range[0] : (bounce ? range[0] - bounce[0] : range[0]),\n\t\tcircular[1] ? range[1] : (bounce ? range[1] + bounce[1] : range[1]),\n\t];\n\n\ttoDestPos = Math.max(targetRange[0], toDestPos);\n\ttoDestPos = Math.min(targetRange[1], toDestPos);\n\n\treturn toDestPos;\n}\n\n// determine outside\nexport function isOutside(pos: number, range: number[]): boolean {\n\treturn pos < range[0] || pos > range[1];\n}\n\nexport function getDuration(distance: number, deceleration): number {\n\tconst duration = Math.sqrt(distance / deceleration * 2);\n\n\t// when duration is under 100, then value is zero\n\treturn duration < 100 ? 0 : duration;\n}\nexport function isCircularable(destPos: number, range: number[], circular: boolean[]): boolean {\n\treturn (circular[1] && destPos > range[1]) ||\n\t\t(circular[0] && destPos < range[0]);\n}\nexport function getCirculatedPos(pos: number, range: number[], circular: boolean[]): number {\n\tlet toPos = pos;\n\tconst min = range[0];\n\tconst max = range[1];\n\tconst length = max - min;\n\n\tif (circular[1] && pos > max) { // right\n\t\ttoPos = (toPos - max) % length + min;\n\t}\n\tif (circular[0] && pos < min) { // left\n\t\ttoPos = (toPos - min) % length + max;\n\t}\n\treturn toPos;\n}\n","/* eslint-disable no-new-func, no-nested-ternary */\n\nlet win: any;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t};\n} else {\n\twin = window;\n}\n/* eslint-enable no-new-func, no-nested-ternary */\n\nexport {win as window};\n","import {window} from \"./browser\";\nimport { ObjectInterface } from \"./types\";\n\ndeclare var jQuery: any;\n\nexport function toArray(nodes: NodeList): HTMLElement[] {\n\t// const el = Array.prototype.slice.call(nodes);\n\t// for IE8\n\tconst el = [];\n\tfor (let i = 0, len = nodes.length;\n\t\ti < len; i++) {\n\t\t\tel.push(nodes[i]);\n\t}\n\treturn el;\n}\n\nexport function $(param, multi = false) {\n\tlet el;\n\n\tif (typeof param === \"string\") {\t// String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = param.match(/^<([a-z]+)\\s*([^>]*)>/);\n\n\t\t// creating element\n\t\tif (match) {\t // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = toArray(dummy.childNodes);\n\t\t} else {\t// Selector\n\t\t\tel = toArray(document.querySelectorAll(param));\n\t\t}\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? el[0] : undefined;\n\t\t}\n\t} else if (param === window) { // window\n\t\tel = param;\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) {\t// HTMLElement, Document\n\t\tel = param;\n\t} else if ((\"jQuery\" in window && param instanceof jQuery) ||\n\t\tparam.constructor.prototype.jquery) {\t// jQuery\n\t\tel = multi ? param.toArray() : param.get(0);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? el[0] : undefined;\n\t\t}\n\t}\n\treturn el;\n}\n\nlet raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame;\nlet caf = window.cancelAnimationFrame || window.webkitCancelAnimationFrame;\nif (raf && !caf) {\n\tconst keyInfo = {};\n\tconst oldraf = raf;\n\traf = (callback: FrameRequestCallback) => {\n\t\tfunction wrapCallback(timestamp) {\n\t\t\tif (keyInfo[key]) {\n\t\t\t\tcallback(timestamp);\n\t\t\t}\n\t\t}\n\t\tconst key = oldraf(wrapCallback);\n\t\tkeyInfo[key] = true;\n\t\treturn key;\n\t};\n\tcaf = (key: number) => {\n\t\tdelete keyInfo[key];\n\t};\n} else if (!(raf && caf)) {\n\traf = (callback: FrameRequestCallback) => {\n\t\treturn window.setTimeout(() => {\n\t\t\tcallback(window.performance && window.performance.now && window.performance.now() || new Date().getTime());\n\t\t}, 16);\n\t};\n\tcaf = window.clearTimeout;\n}\n\n/**\n * A polyfill for the window.requestAnimationFrame() method.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame\n * @private\n */\nexport function requestAnimationFrame(fp) {\n\treturn raf(fp);\n}\n/**\n* A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.\n* @param {Number} key −\tThe ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame\n* @private\n*/\nexport function cancelAnimationFrame(key) {\n\tcaf(key);\n}\n\nexport function map<T, U>(obj: ObjectInterface<T>, callback: (value: T, key: string) => U): ObjectInterface<U> {\n\tconst tranformed: ObjectInterface<U> = {};\n\n\tfor (const k in obj) {\n\t\tk && (tranformed[k] = callback(obj[k], k));\n\t}\n\treturn tranformed;\n}\n\nexport function filter<T>(obj: ObjectInterface<T>, callback: (value: T, key: string) => boolean): ObjectInterface<T> {\n\tconst filtered: ObjectInterface<T> = {};\n\n\tfor (const k in obj) {\n\t\tk && callback(obj[k], k) && (filtered[k] = obj[k]);\n\t}\n\treturn filtered;\n}\nexport function every<T>(obj: ObjectInterface<T>, callback: (value: T, key: string) => boolean) {\n\tfor (const k in obj) {\n\t\tif (k && !callback(obj[k], k)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\nexport function equal(target: ObjectInterface, base: ObjectInterface): boolean {\n\treturn every(target, (v, k) => v === base[k]);\n}\n\nconst roundNumFunc = {};\n\nexport function roundNumber(num: number, roundUnit: number) {\n\t// Cache for performance\n\tif (!roundNumFunc[roundUnit]) {\n\t\troundNumFunc[roundUnit] = getRoundFunc(roundUnit);\n\t}\n\n\treturn roundNumFunc[roundUnit](num);\n}\n\nexport function roundNumbers(num: ObjectInterface<number>, roundUnit: ObjectInterface<number> | number) {\n\tif (!num || !roundUnit) {\n\t\treturn num;\n\t}\n\tconst isNumber = typeof roundUnit === \"number\";\n\treturn map(num, (value, key) => roundNumber(value, isNumber ? roundUnit : roundUnit[key]));\n}\n\nexport function getDecimalPlace(val: number): number {\n\tif (!isFinite(val)) {\n\t\treturn 0;\n\t}\n\n\tconst v = (val + \"\");\n\n\tif (v.indexOf(\"e\") >= 0) {\n\t\t// Exponential Format\n\t\t// 1e-10, 1e-12\n\t\tlet p = 0;\n\t\tlet e = 1;\n\n\t\twhile (Math.round(val * e) / e !== val) {\n\t\t\te *= 10;\n\t\t\tp++;\n\t\t}\n\n\t\treturn p;\n\t}\n\n\t// In general, following has performance benefit.\n\t// https://jsperf.com/precision-calculation\n\treturn v.indexOf(\".\") >= 0 ? (v.length - v.indexOf(\".\") - 1) : 0;\n}\n\nexport function inversePow(n: number) {\n\t// replace Math.pow(10, -n) to solve floating point issue.\n\t// eg. Math.pow(10, -4) => 0.00009999999999999999\n\treturn 1 / Math.pow(10, n);\n}\n\nexport function getRoundFunc(v: number) {\n\tconst p = v < 1 ? Math.pow(10, getDecimalPlace(v)) : 1;\n\n\treturn (n: number) => {\n\t\tif (v === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn Math.round(Math.round(n / v) * v * p) / p;\n\t};\n}\n","import { getInsidePosition, isCircularable, getCirculatedPos, getDuration } from \"./Coordinate\";\nimport { Axis, AxisManager } from \"./AxisManager\";\nimport { InterruptManager } from \"./InterruptManager\";\nimport { EventManager, ChangeEventOption } from \"./EventManager\";\nimport { requestAnimationFrame, cancelAnimationFrame, map, every, filter, equal, roundNumber, getDecimalPlace, inversePow } from \"./utils\";\nimport { AxesOption } from \"./Axes\";\nimport { AnimationParam, ObjectInterface } from \"./types\";\n\nfunction minMax(value: number, min: number, max: number): number {\n\treturn Math.max(Math.min(value, max), min);\n}\n\nexport class AnimationManager {\n\tprivate _raf;\n\tprivate _animateParam: AnimationParam;\n\tprivate options: AxesOption;\n\tpublic itm: InterruptManager;\n\tpublic em: EventManager;\n\tpublic axm: AxisManager;\n\n\tconstructor({ options, itm, em, axm }) {\n\t\tthis.options = options;\n\t\tthis.itm = itm;\n\t\tthis.em = em;\n\t\tthis.axm = axm;\n\t\tthis.animationEnd = this.animationEnd.bind(this);\n\t}\n\tgetDuration(depaPos: Axis, destPos: Axis, wishDuration?: number) {\n\t\tlet duration;\n\t\tif (typeof wishDuration !== \"undefined\") {\n\t\t\tduration = wishDuration;\n\t\t} else {\n\t\t\tconst durations: Axis = map(\n\t\t\t\tdestPos,\n\t\t\t\t(v, k) => getDuration(\n\t\t\t\t\tMath.abs(v - depaPos[k]),\n\t\t\t\t\tthis.options.deceleration),\n\t\t\t);\n\t\t\tduration = Object.keys(durations).reduce((max, v) => Math.max(max, durations[v]), -Infinity);\n\t\t}\n\t\treturn minMax(\n\t\t\tduration,\n\t\t\tthis.options.minimumDuration,\n\t\t\tthis.options.maximumDuration);\n\t}\n\n\tprivate createAnimationParam(pos: Axis, duration: number, option?: ChangeEventOption): AnimationParam {\n\t\tconst depaPos: Axis = this.axm.get();\n\t\tconst destPos: Axis = pos;\n\t\tconst inputEvent = option && option.event || null;\n\t\treturn {\n\t\t\tdepaPos,\n\t\t\tdestPos,\n\t\t\tduration: minMax(\n\t\t\t\tduration,\n\t\t\t\tthis.options.minimumDuration,\n\t\t\t\tthis.options.maximumDuration),\n\t\t\tdelta: this.axm.getDelta(depaPos, destPos),\n\t\t\tinputEvent,\n\t\t\tinput: option && option.input || null,\n\t\t\tisTrusted: !!inputEvent,\n\t\t\tdone: this.animationEnd,\n\t\t};\n\t}\n\n\tgrab(axes: string[], option?: ChangeEventOption) {\n\t\tif (this._animateParam && axes.length) {\n\t\t\tconst orgPos: Axis = this.axm.get(axes);\n\t\t\tconst pos: Axis = this.axm.map(orgPos,\n\t\t\t\t(v, opt) => getCirculatedPos(v, opt.range, opt.circular as boolean[]));\n\t\t\tif (!every(pos, (v, k) => orgPos[k] === v)) {\n\t\t\t\tthis.em.triggerChange(pos, false, orgPos, option, !!option);\n\t\t\t}\n\t\t\tthis._animateParam = null;\n\t\t\tthis._raf && cancelAnimationFrame(this._raf);\n\t\t\tthis._raf = null;\n\t\t\tthis.em.triggerAnimationEnd(!!(option && option.event));\n\t\t}\n\t}\n\n\tgetEventInfo(): ChangeEventOption {\n\t\tif (this._animateParam && this._animateParam.input && this._animateParam.inputEvent) {\n\t\t\treturn {\n\t\t\t\tinput: this._animateParam.input,\n\t\t\t\tevent: this._animateParam.inputEvent,\n\t\t\t};\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\trestore(option: ChangeEventOption) {\n\t\tconst pos: Axis = this.axm.get();\n\t\tconst destPos: Axis = this.axm.map(pos,\n\t\t\t(v, opt) => Math.min(opt.range[1], Math.max(opt.range[0], v)));\n\t\tthis.animateTo(destPos, this.getDuration(pos, destPos), option);\n\t}\n\n\tanimationEnd() {\n\t\tconst beforeParam: ChangeEventOption = this.getEventInfo();\n\t\tthis._animateParam = null;\n\n\t\t// for Circular\n\t\tconst circularTargets = this.axm.filter(\n\t\t\tthis.axm.get(),\n\t\t\t(v, opt) => isCircularable(v, opt.range, opt.circular as boolean[]),\n\t\t);\n\t\tObject.keys(circularTargets).length > 0 && this.setTo(this.axm.map(\n\t\t\tcircularTargets,\n\t\t\t(v, opt) => getCirculatedPos(v, opt.range, opt.circular as boolean[]),\n\t\t));\n\t\tthis.itm.setInterrupt(false);\n\t\tthis.em.triggerAnimationEnd(!!beforeParam);\n\t\tif (this.axm.isOutside()) {\n\t\t\tthis.restore(beforeParam);\n\t\t} else {\n\t\t\tthis.finish(!!beforeParam);\n\t\t}\n\t}\n\tfinish(isTrusted) {\n\t\tthis._animateParam = null;\n\t\tthis.itm.setInterrupt(false);\n\t\tthis.em.triggerFinish(isTrusted);\n\t}\n\tprivate animateLoop(param: AnimationParam, complete: () => void) {\n\t\tif (param.duration) {\n\t\t\tthis._animateParam = { ...param };\n\t\t\tconst info: AnimationParam = this._animateParam;\n\t\t\tconst self = this;\n\t\t\tlet destPos = info.destPos;\n\t\t\tlet prevPos = info.depaPos;\n\t\t\tlet prevEasingPer = 0;\n\t\t\tconst directions = map(prevPos, (value, key) => {\n\t\t\t\treturn value <= destPos[key] ? 1 : -1;\n\t\t\t});\n\t\t\tconst originalIntendedPos = map(destPos, v => v);\n\t\t\tlet prevTime = new Date().getTime();\n\t\t\tinfo.startTime = prevTime;\n\n\t\t\t(function loop() {\n\t\t\t\tself._raf = null;\n\t\t\t\tconst currentTime = new Date().getTime();\n\t\t\t\tconst ratio = (currentTime - info.startTime) / param.duration;\n\t\t\t\tconst easingPer = self.easing(ratio);\n\t\t\t\tconst toPos: Axis = self.axm.map(prevPos, (pos, options, key) => {\n\t\t\t\t\tconst nextPos = ratio >= 1\n\t\t\t\t\t\t? destPos[key]\n\t\t\t\t\t\t: pos + info.delta[key] * (easingPer - prevEasingPer);\n\n\t\t\t\t\t// Subtract distance from distance already moved.\n\t\t\t\t\t// Recalculate the remaining distance.\n\t\t\t\t\t// Fix the bouncing phenomenon by changing the range.\n\t\t\t\t\tconst circulatedPos = getCirculatedPos(nextPos, options.range, options.circular as boolean[]);\n\t\t\t\t\tif (nextPos !== circulatedPos) {\n\t\t\t\t\t\t// circular\n\t\t\t\t\t\tconst rangeOffset = directions[key] * (options.range[1] - options.range[0]);\n\n\t\t\t\t\t\tdestPos[key] -= rangeOffset;\n\t\t\t\t\t\tprevPos[key] -= rangeOffset;\n\t\t\t\t\t}\n\t\t\t\t\treturn circulatedPos;\n\t\t\t\t});\n\t\t\t\tconst isCanceled = !self.em.triggerChange(toPos, false, prevPos);\n\n\t\t\t\tprevPos = toPos;\n\t\t\t\tprevTime = currentTime;\n\t\t\t\tprevEasingPer = easingPer;\n\t\t\t\tif (easingPer >= 1) {\n\t\t\t\t\tdestPos = self.getFinalPos(destPos, originalIntendedPos);\n\n\t\t\t\t\tif (!equal(destPos, self.axm.get(Object.keys(destPos)))) {\n\t\t\t\t\t\tself.em.triggerChange(destPos, true, prevPos);\n\t\t\t\t\t}\n\t\t\t\t\tcomplete();\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isCanceled) {\n\t\t\t\t\tself.finish(false);\n\t\t\t\t} else {\n\t\t\t\t\t// animationEnd\n\t\t\t\t\tself._raf = requestAnimationFrame(loop);\n\t\t\t\t}\n\t\t\t})();\n\t\t} else {\n\t\t\tthis.em.triggerChange(param.destPos, true);\n\t\t\tcomplete();\n\t\t}\n\t}\n\n\t/**\n\t * Get estimated final value.\n\t *\n\t * If destPos is within the 'error range' of the original intended position, the initial intended position is returned.\n\t * - eg. original intended pos: 100, destPos: 100.0000000004 ==> return 100;\n\t * If dest Pos is outside the 'range of error' compared to the originally intended pos, it is returned rounded based on the originally intended pos.\n\t * - eg. original intended pos: 100.123 destPos: 50.12345 => return 50.123\n\t *\n\t * @param originalIntendedPos\n\t * @param destPos\n\t */\n\tprivate getFinalPos(destPos: ObjectInterface<number>, originalIntendedPos: ObjectInterface<number>) {\n\t\t// compare destPos and originalIntendedPos\n\t\tconst ERROR_LIMIT = 0.000001;\n\t\tconst finalPos = map(destPos, (value, key) => {\n\t\t\tif (value >= originalIntendedPos[key] - ERROR_LIMIT && value <= originalIntendedPos[key] + ERROR_LIMIT) {\n\t\t\t\t// In error range, return original intended\n\t\t\t\treturn originalIntendedPos[key];\n\t\t\t} else {\n\t\t\t\t// Out of error range, return rounded pos.\n\t\t\t\tconst roundUnit = this.getRoundUnit(value, key);\n\t\t\t\tconst result = roundNumber(value, roundUnit);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t});\n\t\treturn finalPos;\n\t}\n\n\tprivate getRoundUnit(val: number, key: string) {\n\t\tconst roundUnit = this.options.round; // manual mode\n\t\tlet minRoundUnit = null; // auto mode\n\n\t\t// auto mode\n\t\tif (!roundUnit) {\n\t\t\t// Get minimum round unit\n\t\t\tconst options = this.axm.getAxisOptions(key);\n\t\t\tminRoundUnit = inversePow(Math.max(\n\t\t\t\tgetDecimalPlace(options.range[0]),\n\t\t\t\tgetDecimalPlace(options.range[1]),\n\t\t\t\tgetDecimalPlace(val)));\n\t\t}\n\n\t\treturn minRoundUnit || roundUnit;\n\t}\n\n\tgetUserControll(param: AnimationParam) {\n\t\tconst userWish = param.setTo();\n\t\tuserWish.destPos = this.axm.get(userWish.destPos);\n\t\tuserWish.duration = minMax(\n\t\t\tuserWish.duration,\n\t\t\tthis.options.minimumDuration,\n\t\t\tthis.options.maximumDuration);\n\t\treturn userWish;\n\t}\n\n\tanimateTo(destPos: Axis, duration: number, option?: ChangeEventOption) {\n\t\tconst param: AnimationParam = this.createAnimationParam(destPos, duration, option);\n\t\tconst depaPos = { ...param.depaPos };\n\t\tconst retTrigger = this.em.triggerAnimationStart(param);\n\n\t\t// to control\n\t\tconst userWish = this.getUserControll(param);\n\n\t\t// You can't stop the 'animationStart' event when 'circular' is true.\n\t\tif (!retTrigger && this.axm.every(\n\t\t\tuserWish.destPos,\n\t\t\t(v, opt) => isCircularable(v, opt.range, opt.circular as boolean[]))) {\n\t\t\tconsole.warn(\"You can't stop the 'animation' event when 'circular' is true.\");\n\t\t}\n\n\t\tif (retTrigger && !equal(userWish.destPos, depaPos)) {\n\t\t\tconst inputEvent = option && option.event || null;\n\t\t\tthis.animateLoop({\n\t\t\t\tdepaPos,\n\t\t\t\tdestPos: userWish.destPos,\n\t\t\t\tduration: userWish.duration,\n\t\t\t\tdelta: this.axm.getDelta(depaPos, userWish.destPos),\n\t\t\t\tisTrusted: !!inputEvent,\n\t\t\t\tinputEvent,\n\t\t\t\tinput: option && option.input || null,\n\t\t\t}, () => this.animationEnd());\n\t\t}\n\t}\n\n\teasing(p) {\n\t\treturn p > 1 ? 1 : this.options.easing(p);\n\t}\n\n\tsetTo(pos: Axis, duration: number = 0) {\n\t\tconst axes: string[] = Object.keys(pos);\n\t\tthis.grab(axes);\n\t\tconst orgPos: Axis = this.axm.get(axes);\n\n\t\tif (equal(pos, orgPos)) {\n\t\t\treturn this;\n\t\t}\n\t\tthis.itm.setInterrupt(true);\n\t\tlet movedPos = filter(pos, (v, k) => orgPos[k] !== v);\n\t\tif (!Object.keys(movedPos).length) {\n\t\t\treturn this;\n\t\t}\n\n\t\tmovedPos = this.axm.map(movedPos, (v, opt) => {\n\t\t\tconst { range, circular } = opt;\n\n\t\t\tif (circular && (circular[0] || circular[1])) {\n\t\t\t\treturn v;\n\t\t\t} else {\n\t\t\t\treturn getInsidePosition(v, range, circular as boolean[]);\n\t\t\t}\n\t\t});\n\n\t\tif (equal(movedPos, orgPos)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (duration > 0) {\n\t\t\tthis.animateTo(movedPos, duration);\n\t\t} else {\n\t\t\tthis.em.triggerChange(movedPos);\n\t\t\tthis.finish(false);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetBy(pos: Axis, duration = 0) {\n\t\treturn this.setTo(\n\t\t\tmap(this.axm.get(Object.keys(pos)), (v, k) => v + pos[k]),\n\t\t\tduration,\n\t\t);\n\t}\n}\n","import { IInputType } from \"./inputType/InputType\";\nimport { Axis } from \"./AxisManager\";\nimport { AnimationManager } from \"./AnimationManager\";\nimport Axes from \"./Axes\";\nimport { roundNumbers } from \"./utils\";\nimport { AnimationParam, OnAnimationStart, OnRelease } from \"./types\";\n\nexport interface ChangeEventOption {\n\tinput: IInputType;\n\tevent;\n}\n\nexport class EventManager {\n\tpublic am: AnimationManager;\n\tconstructor(private axes: Axes) {}\n\t/**\n\t * This event is fired when a user holds an element on the screen of the device.\n\t * @ko 사용자가 기기의 화면에 손을 대고 있을 때 발생하는 이벤트\n\t * @name eg.Axes#hold\n\t * @event\n\t * @type {object}\n\t * @property {Object.<string, number>} pos coordinate <ko>좌표 정보</ko>\n\t * @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>\n\t * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"hold\", function(event) {\n\t * // event.pos\n\t * // event.input\n\t * // event.inputEvent\n\t * // isTrusted\n\t * });\n\t */\n\ttriggerHold(pos: Axis, option: ChangeEventOption) {\n\t\tconst {roundPos} = this.getRoundPos(pos);\n\n\t\tthis.axes.trigger(\"hold\", {\n\t\t\tpos: roundPos,\n\t\t\tinput: option.input || null,\n\t\t\tinputEvent: option.event || null,\n\t\t\tisTrusted: true,\n\t\t});\n\t}\n\n\t/**\n\t * Specifies the coordinates to move after the 'change' event. It works when the holding value of the change event is true.\n\t * @ko 'change' 이벤트 이후 이동할 좌표를 지정한다. change이벤트의 holding 값이 true일 경우에 동작한다\n\t * @name set\n * @function\n\t * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"change\", function(event) {\n\t * event.holding && event.set({x: 10});\n\t * });\n\t */\n\t/** Specifies the animation coordinates to move after the 'release' or 'animationStart' events.\n\t * @ko 'release' 또는 'animationStart' 이벤트 이후 이동할 좌표를 지정한다.\n\t * @name setTo\n * @function\n\t * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n\t * @param {Number} [duration] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"animationStart\", function(event) {\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\t/**\n\t * This event is fired when a user release an element on the screen of the device.\n\t * @ko 사용자가 기기의 화면에서 손을 뗐을 때 발생하는 이벤트\n\t * @name eg.Axes#release\n\t * @event\n\t * @type {object}\n\t * @property {Object.<string, number>} depaPos The coordinates when releasing an element<ko>손을 뗐을 때의 좌표 </ko>\n\t * @property {Object.<string, number>} destPos The coordinates to move to after releasing an element<ko>손을 뗀 뒤에 이동할 좌표</ko>\n\t * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n\t * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n\t * @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>\n\t * @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"release\", function(event) {\n\t * // event.depaPos\n\t * // event.destPos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.setTo\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the animation coordinates to move after the 'release' event.\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\ttriggerRelease(param: AnimationParam) {\n\t\tconst {roundPos, roundDepa} = this.getRoundPos(param.destPos, param.depaPos);\n\t\tparam.destPos = roundPos;\n\t\tparam.depaPos = roundDepa;\n\t\tparam.setTo = this.createUserControll(param.destPos, param.duration);\n\t\tthis.axes.trigger(\"release\", param as OnRelease);\n\t}\n\n\t/**\n\t * This event is fired when coordinate changes.\n\t * @ko 좌표가 변경됐을 때 발생하는 이벤트\n\t * @name eg.Axes#change\n\t * @event\n\t * @type {object}\n\t * @property {Object.<string, number>} pos The coordinate <ko>좌표</ko>\n\t * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n\t * @property {Boolean} holding Indicates whether a user holds an element on the screen of the device.<ko>사용자가 기기의 화면을 누르고 있는지 여부</ko>\n\t * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n\t * @property {Object} inputEvent The event object received from inputType. If the value is changed by animation, it returns 'null'.<ko>inputType으로 부터 받은 이벤트 객체. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n\t * @property {set} set Specifies the coordinates to move after the event. It works when the holding value is true <ko>이벤트 이후 이동할 좌표를 지정한다. holding 값이 true일 경우에 동작한다.</ko>\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"change\", function(event) {\n\t * // event.pos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.holding\n\t * // event.set\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the coordinates to move after the 'change' event.\n\t * // it works when the holding value of the change event is true.\n\t * event.holding && event.set({x: 10});\n\t * });\n\t */\n\ttriggerChange(pos: Axis, isAccurate?: boolean, depaPos?: Axis, option?: ChangeEventOption, holding: boolean = false) {\n\t\tconst am = this.am;\n\t\tconst axm = am.axm;\n\t\tconst eventInfo = am.getEventInfo();\n\t\tconst {roundPos, roundDepa} = this.getRoundPos(pos, depaPos);\n\t\tconst moveTo = axm.moveTo(roundPos, roundDepa);\n\t\tconst inputEvent = option && option.event || eventInfo && eventInfo.event || null;\n\t\tconst param = {\n\t\t\tpos: moveTo.pos,\n\t\t\tdelta: moveTo.delta,\n\t\t\tholding,\n\t\t\tinputEvent,\n\t\t\tisTrusted: !!inputEvent,\n\t\t\tinput: option && option.input || eventInfo && eventInfo.input || null,\n\t\t\tset: inputEvent ? this.createUserControll(moveTo.pos) : () => { },\n\t\t};\n\t\tconst result = this.axes.trigger(\"change\", param);\n\n\t\tinputEvent && axm.set(param.set()[\"destPos\"]);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * This event is fired when animation starts.\n\t * @ko 에니메이션이 시작할 때 발생한다.\n\t * @name eg.Axes#animationStart\n\t * @event\n\t * @type {object}\n\t * @property {Object.<string, number>} depaPos The coordinates when animation starts<ko>애니메이션이 시작 되었을 때의 좌표 </ko>\n\t * @property {Object.<string, number>} destPos The coordinates to move to. If you change this value, you can run the animation<ko>이동할 좌표. 이값을 변경하여 애니메이션을 동작시킬수 있다</ko>\n\t * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n\t * @property {Number} duration Duration of the animation (unit: ms). If you change this value, you can control the animation duration time.<ko>애니메이션 진행 시간(단위: ms). 이값을 변경하여 애니메이션의 이동시간을 조절할 수 있다.</ko>\n\t * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n\t * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n\t * @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"release\", function(event) {\n\t * // event.depaPos\n\t * // event.destPos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.setTo\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the animation coordinates to move after the 'animationStart' event.\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\ttriggerAnimationStart(param: AnimationParam): boolean {\n\t\tconst {roundPos, roundDepa} = this.getRoundPos(param.destPos, param.depaPos);\n\t\tparam.destPos = roundPos;\n\t\tparam.depaPos = roundDepa;\n\t\tparam.setTo = this.createUserControll(param.destPos, param.duration);\n\t\treturn this.axes.trigger(\"animationStart\", param as OnAnimationStart);\n\t}\n\n\t/**\n\t * This event is fired when animation ends.\n\t * @ko 에니메이션이 끝났을 때 발생한다.\n\t * @name eg.Axes#animationEnd\n\t * @event\n\t * @type {object}\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"animationEnd\", function(event) {\n\t * // event.isTrusted\n\t * });\n\t */\n\ttriggerAnimationEnd(isTrusted: boolean = false) {\n\t\tthis.axes.trigger(\"animationEnd\", {\n\t\t\tisTrusted,\n\t\t});\n\t}\n\t/**\n\t * This event is fired when all actions have been completed.\n\t * @ko 에니메이션이 끝났을 때 발생한다.\n\t * @name eg.Axes#finish\n\t * @event\n\t * @type {object}\n\t * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n\t *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"finish\", function(event) {\n\t * // event.isTrusted\n\t * });\n\t */\n\ttriggerFinish(isTrusted: boolean = false) {\n\t\tthis.axes.trigger(\"finish\", {\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate createUserControll(pos: Axis, duration: number = 0) {\n\t\t// to controll\n\t\tconst userControl = {\n\t\t\tdestPos: { ...pos },\n\t\t\tduration,\n\t\t};\n\t\treturn (toPos?: Axis, userDuration?: number): { destPos: Axis, duration: number } => {\n\t\t\ttoPos && (userControl.destPos = { ...toPos });\n\t\t\t(userDuration !== undefined) && (userControl.duration = userDuration);\n\t\t\treturn userControl;\n\t\t};\n\t}\n\n\tsetAnimationManager(am: AnimationManager) {\n\t\tthis.am = am;\n\t}\n\n\tdestroy() {\n\t\tthis.axes.off();\n\t}\n\n\tprivate getRoundPos(pos: Axis, depaPos?: Axis) {\n\t\t// round value if round exist\n\t\tconst roundUnit = this.axes.options.round;\n\n\t\t// if (round == null) {\n\t\t// \treturn {pos, depaPos}; // undefined, undefined\n\t\t// }\n\t\treturn {\n\t\t\troundPos: roundNumbers(pos, roundUnit),\n\t\t\troundDepa: roundNumbers(depaPos, roundUnit),\n\t\t};\n\t}\n}\n","import { AxesOption } from \"./Axes\";\nexport class InterruptManager {\n\tprivate _prevented = false; // check whether the animation event was prevented\n\tconstructor(private options: AxesOption) { }\n\n\tisInterrupting() {\n\t\t// when interruptable is 'true', return value is always 'true'.\n\t\treturn this.options.interruptable || this._prevented;\n\t}\n\n\tisInterrupted() {\n\t\treturn !this.options.interruptable && this._prevented;\n\t}\n\n\tsetInterrupt(prevented) {\n\t\t!this.options.interruptable && (this._prevented = prevented);\n\t}\n}\n","import { isOutside, getCirculatedPos } from \"./Coordinate\";\nimport { map, filter, every } from \"./utils\";\nimport { ObjectInterface } from \"./types\";\n\nexport interface Axis {\n\t[key: string]: number;\n}\n\nexport interface AxisOption {\n\trange?: number[];\n\tbounce?: number | number[];\n\tcircular?: boolean | boolean[];\n}\n\nexport class AxisManager {\n\tprivate _pos: Axis;\n\tconstructor(private axis: ObjectInterface<AxisOption>, private options) {\n\t\tthis._complementOptions();\n\t\tthis._pos = Object.keys(this.axis).reduce((acc, v) => {\n\t\t\tacc[v] = this.axis[v].range[0];\n\t\t\treturn acc;\n\t\t}, {});\n\t}\n\t/**\n\t * set up 'css' expression\n\t * @private\n\t */\n\tprivate _complementOptions() {\n\t\tObject.keys(this.axis).forEach(axis => {\n\t\t\tthis.axis[axis] = {\n\t\t\t\t...{\n\t\t\t\t\trange: [0, 100],\n\t\t\t\t\tbounce: [0, 0],\n\t\t\t\t\tcircular: [false, false],\n\t\t\t\t}, ...this.axis[axis],\n\t\t\t};\n\n\t\t\t[\"bounce\", \"circular\"].forEach(v => {\n\t\t\t\tconst axisOption = this.axis;\n\t\t\t\tconst key = axisOption[axis][v];\n\n\t\t\t\tif (/string|number|boolean/.test(typeof key)) {\n\t\t\t\t\taxisOption[axis][v] = [key, key];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\tgetDelta(depaPos: Axis, destPos: Axis): Axis {\n\t\tconst fullDepaPos = this.get(depaPos);\n\t\treturn map(this.get(destPos), (v, k) => v - fullDepaPos[k]);\n\t}\n\tget(axes?: string[] | Axis): Axis {\n\t\tif (axes && Array.isArray(axes)) {\n\t\t\treturn axes.reduce((acc, v) => {\n\t\t\t\tif (v && (v in this._pos)) {\n\t\t\t\t\tacc[v] = this._pos[v];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, {});\n\t\t} else {\n\t\t\treturn { ...this._pos, ...((axes || {}) as Axis) };\n\t\t}\n\t}\n\tmoveTo(pos: Axis, depaPos: Axis = this._pos): { [key: string]: Axis } {\n\t\tconst delta = map(this._pos, (v, key) => {\n\t\t\treturn key in pos && key in depaPos ? pos[key] - depaPos[key] : 0;\n\t\t});\n\n\t\tthis.set(this.map(pos, (v, opt) => opt ? getCirculatedPos(v, opt.range, opt.circular as boolean[]) : 0));\n\t\treturn {\n\t\t\tpos: { ...this._pos },\n\t\t\tdelta,\n\t\t};\n\t}\n\tset(pos: Axis) {\n\t\tfor (const k in pos) {\n\t\t\tif (k && (k in this._pos)) {\n\t\t\t\tthis._pos[k] = pos[k];\n\t\t\t}\n\t\t}\n\t}\n\tevery(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => boolean): boolean {\n\t\tconst axisOptions = this.axis;\n\n\t\treturn every(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tfilter(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => boolean): Axis {\n\n\t\tconst axisOptions = this.axis;\n\n\t\treturn filter(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tmap<U>(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => U) {\n\t\tconst axisOptions = this.axis;\n\n\t\treturn map<number, U>(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tisOutside(axes?: string[]) {\n\t\treturn !this.every(\n\t\t\taxes ? this.get(axes) : this._pos,\n\t\t\t(v, opt) => !isOutside(v, opt.range),\n\t\t);\n\t}\n\tgetAxisOptions(key: string) {\n\t\treturn this.axis[key];\n\t}\n}\n","import { InterruptManager } from \"./InterruptManager\";\nimport { IInputType, IInputTypeObserver } from \"./inputType/InputType\";\nimport { EventManager, ChangeEventOption } from \"./EventManager\";\nimport { AxisManager, Axis } from \"./AxisManager\";\nimport { AnimationManager } from \"./AnimationManager\";\nimport { AxesOption } from \"./Axes\";\nimport { isOutside, getInsidePosition } from \"./Coordinate\";\nimport { map, equal } from \"./utils\";\nimport { AnimationParam } from \"./types\";\n\nexport class InputObserver implements IInputTypeObserver {\n\tpublic options: AxesOption;\n\tprivate itm: InterruptManager;\n\tprivate em: EventManager;\n\tprivate axm: AxisManager;\n\tprivate am: AnimationManager;\n\tprivate isOutside = false;\n\tprivate moveDistance: Axis = null;\n\tprivate isStopped = false;\n\tconstructor({ options, itm, em, axm, am }) {\n\t\tthis.options = options;\n\t\tthis.itm = itm;\n\t\tthis.em = em;\n\t\tthis.axm = axm;\n\t\tthis.am = am;\n\t}\n\n\t// when move pointer is held in outside\n\tprivate atOutside(pos: Axis) {\n\t\tif (this.isOutside) {\n\t\t\treturn this.axm.map(pos, (v, opt) => {\n\t\t\t\tconst tn = opt.range[0] - opt.bounce[0];\n\t\t\t\tconst tx = opt.range[1] + opt.bounce[1];\n\t\t\t\treturn v > tx ? tx : (v < tn ? tn : v);\n\t\t\t});\n\t\t} else {\n\t\t\t// when start pointer is held in inside\n\t\t\t// get a initialization slope value to prevent smooth animation.\n\t\t\tconst initSlope = this.am.easing(0.00001) / 0.00001;\n\t\t\treturn this.axm.map(pos, (v, opt) => {\n\t\t\t\tconst min = opt.range[0];\n\t\t\t\tconst max = opt.range[1];\n\t\t\t\tconst out = opt.bounce;\n\t\t\t\tconst circular = opt.circular;\n\n\t\t\t\tif (circular && (circular[0] || circular[1])) {\n\t\t\t\t\treturn v;\n\t\t\t\t} else if (v < min) { // left\n\t\t\t\t\treturn min - this.am.easing((min - v) / (out[0] * initSlope)) * out[0];\n\t\t\t\t} else if (v > max) { // right\n\t\t\t\t\treturn max + this.am.easing((v - max) / (out[1] * initSlope)) * out[1];\n\t\t\t\t}\n\t\t\t\treturn v;\n\t\t\t});\n\t\t}\n\t}\n\tget(input: IInputType): Axis {\n\t\treturn this.axm.get(input.axes);\n\t}\n\thold(input: IInputType, event) {\n\t\tif (this.itm.isInterrupted() || !input.axes.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst changeOption: ChangeEventOption = {\n\t\t\tinput,\n\t\t\tevent,\n\t\t};\n\t\tthis.isStopped = false;\n\t\tthis.itm.setInterrupt(true);\n\t\tthis.am.grab(input.axes, changeOption);\n\t\t!this.moveDistance && this.em.triggerHold(this.axm.get(), changeOption);\n\t\tthis.isOutside = this.axm.isOutside(input.axes);\n\t\tthis.moveDistance = this.axm.get(input.axes);\n\t}\n\tchange(input: IInputType, event, offset: Axis) {\n\t\tif (this.isStopped || !this.itm.isInterrupting() || this.axm.every(offset, v => v === 0)) {\n\t\t\treturn;\n\t\t}\n\t\tlet depaPos: Axis = this.moveDistance || this.axm.get(input.axes);\n\t\tlet destPos: Axis;\n\n\t\t// for outside logic\n\t\tdestPos = map(depaPos, (v, k) => v + (offset[k] || 0));\n\t\tthis.moveDistance && (this.moveDistance = destPos);\n\t\t// from outside to inside\n\t\tif (this.isOutside &&\n\t\t\tthis.axm.every(depaPos, (v, opt) => !isOutside(v, opt.range))) {\n\t\t\tthis.isOutside = false;\n\t\t}\n\t\tdepaPos = this.atOutside(depaPos);\n\t\tdestPos = this.atOutside(destPos);\n\n\t\tconst isCanceled = !this.em.triggerChange(destPos, false, depaPos, {\n\t\t\tinput,\n\t\t\tevent,\n\t\t}, true);\n\n\t\tif (isCanceled) {\n\t\t\tthis.isStopped = true;\n\t\t\tthis.moveDistance = null;\n\t\t\tthis.am.finish(false);\n\t\t}\n\t}\n\trelease(input: IInputType, event, offset: Axis, inputDuration?: number) {\n\t\tif (this.isStopped || !this.itm.isInterrupting() || !this.moveDistance) {\n\t\t\treturn;\n\t\t}\n\t\tconst pos: Axis = this.axm.get(input.axes);\n\t\tconst depaPos: Axis = this.axm.get();\n\t\tlet destPos: Axis = this.axm.get(this.axm.map(offset, (v, opt, k) => {\n\t\t\tif (opt.circular && (opt.circular[0] || opt.circular[1])) {\n\t\t\t\treturn pos[k] + v;\n\t\t\t} else {\n\t\t\t\treturn getInsidePosition(\n\t\t\t\t\tpos[k] + v,\n\t\t\t\t\topt.range,\n\t\t\t\t\topt.circular as boolean[],\n\t\t\t\t\topt.bounce as number[],\n\t\t\t\t);\n\t\t\t}\n\t\t}));\n\t\tconst duration = this.am.getDuration(destPos, pos, inputDuration);\n\n\t\tif (duration === 0) {\n\t\t\tdestPos = { ...depaPos };\n\t\t}\n\t\t// prepare params\n\t\tconst param: AnimationParam = {\n\t\t\tdepaPos,\n\t\t\tdestPos,\n\t\t\tduration,\n\t\t\tdelta: this.axm.getDelta(depaPos, destPos),\n\t\t\tinputEvent: event,\n\t\t\tinput,\n\t\t\tisTrusted: true,\n\t\t};\n\t\tthis.em.triggerRelease(param);\n\t\tthis.moveDistance = null;\n\n\t\t// to contol\n\t\tconst userWish = this.am.getUserControll(param);\n\t\tconst isEqual = equal(userWish.destPos, depaPos);\n\t\tconst changeOption: ChangeEventOption = {\n\t\t\tinput,\n\t\t\tevent,\n\t\t};\n\t\tif (isEqual || userWish.duration === 0) {\n\t\t\t!isEqual && this.em.triggerChange(userWish.destPos, false, depaPos, changeOption, true);\n\t\t\tthis.itm.setInterrupt(false);\n\t\t\tif (this.axm.isOutside()) {\n\t\t\t\tthis.am.restore(changeOption);\n\t\t\t} else {\n\t\t\t\tthis.em.triggerFinish(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.am.animateTo(userWish.destPos, userWish.duration, changeOption);\n\t\t}\n\t}\n}\n","// export const DIRECTION_NONE = 1;\n// export const DIRECTION_LEFT = 2;\n// export const DIRECTION_RIGHT = 4;\n// export const DIRECTION_HORIZONTAL = 2 | 4;\n// export const DIRECTION_UP = 8;\n// export const DIRECTION_DOWN = 16;\n// export const DIRECTION_VERTICAL = 8 | 16;\n// export const DIRECTION_ALL = 2 | 4 | 8 | 16;\n\nexport {\n\tDIRECTION_NONE,\n\tDIRECTION_LEFT,\n\tDIRECTION_RIGHT,\n\tDIRECTION_UP,\n\tDIRECTION_DOWN,\n\tDIRECTION_HORIZONTAL,\n\tDIRECTION_VERTICAL,\n\tDIRECTION_ALL,\n} from \"@egjs/hammerjs\";\nimport getAgent from \"@egjs/agent\";\nimport { window } from \"./browser\";\n\nexport const IOS_EDGE_THRESHOLD = 30;\nexport const IS_IOS_SAFARI = \"ontouchstart\" in window && getAgent().browser.name === \"safari\";\n\nexport const TRANSFORM = (() => {\n\tif (typeof document === \"undefined\") {\n\t\treturn \"\";\n\t}\n\tconst bodyStyle = (document.head || document.getElementsByTagName(\"head\")[0]).style;\n\tconst target = [\"transform\", \"webkitTransform\", \"msTransform\", \"mozTransform\"];\n\tfor (let i = 0, len = target.length; i < len; i++) {\n\t\tif (target[i] in bodyStyle) {\n\t\t\treturn target[i];\n\t\t}\n\t}\n\treturn \"\";\n})();\n","import Component from \"@egjs/component\";\nimport { AnimationManager } from \"./AnimationManager\";\nimport { EventManager } from \"./EventManager\";\nimport { InterruptManager } from \"./InterruptManager\";\nimport { AxisManager, AxisOption, Axis } from \"./AxisManager\";\nimport { InputObserver } from \"./InputObserver\";\nimport {\n\tTRANSFORM,\n\tDIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT,\n\tDIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL\n} from \"./const\";\nimport { IInputType } from \"./inputType/InputType\";\nimport { AxesEvents, ObjectInterface } from \"./types\";\n\nexport interface AxesOption {\n\teasing?: (x: number) => number;\n\tmaximumDuration?: number;\n\tminimumDuration?: number;\n\tdeceleration?: number;\n\tinterruptable?: boolean;\n\tround?: number;\n}\n\n/**\n * @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.\n * @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.\n * @property {Number[]} [range] The coordinate of range <ko>좌표 범위</ko>\n * @property {Number} [range.0=0] The coordinate of the minimum <ko>최소 좌표</ko>\n * @property {Number} [range.1=0] The coordinate of the maximum <ko>최대 좌표</ko>\n * @property {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area<ko>바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다</ko>\n * @property {Number} [bounce.0=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>\n * @property {Number} [bounce.1=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>\n * @property {Boolean[]} [circular] Indicates whether a circular element is available. If it is set to \"true\" and an element is dragged outside the coordinate area, the element will appear on the other side.<ko>순환 여부. 'true'로 설정한 방향의 좌표 영역 밖으로 엘리먼트가 이동하면 반대 방향에서 엘리먼트가 나타난다</ko>\n * @property {Boolean} [circular.0=false] Indicates whether to circulate to the coordinate of the minimum <ko>최소 좌표 방향의 순환 여부</ko>\n * @property {Boolean} [circular.1=false] Indicates whether to circulate to the coordinate of the maximum <ko>최대 좌표 방향의 순환 여부</ko>\n**/\n\n/**\n * @typedef {Object} AxesOption The option object of the eg.Axes module\n * @ko eg.Axes 모듈의 옵션 객체\n * @property {Function} [easing=easing.easeOutCubic] The easing function to apply to an animation <ko>애니메이션에 적용할 easing 함수</ko>\n * @property {Number} [maximumDuration=Infinity] Maximum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최대 좌표 이동 시간</ko>\n * @property {Number} [minimumDuration=0] Minimum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최소 좌표 이동 시간</ko>\n * @property {Number} [deceleration=0.0006] Deceleration of the animation where acceleration is manually enabled by user. A higher value indicates shorter running time. <ko>사용자의 동작으로 가속도가 적용된 애니메이션의 감속도. 값이 높을수록 애니메이션 실행 시간이 짧아진다</ko>\n * @property {Boolean} [interruptable=true] Indicates whether an animation is interruptible.<br>- true: It can be paused or stopped by user action or the API.<br>- false: It cannot be paused or stopped by user action or the API while it is running.<ko>진행 중인 애니메이션 중지 가능 여부.<br>- true: 사용자의 동작이나 API로 애니메이션을 중지할 수 있다.<br>- false: 애니메이션이 진행 중일 때는 사용자의 동작이나 API가 적용되지 않는다</ko>\n * @property {Number} [round = null] Rounding unit. For example, 0.1 rounds to 0.1 decimal point(6.1234 => 6.1), 5 rounds to 5 (93 => 95) <br>[Details](https://github.com/naver/egjs-axes/wiki/round-option)<ko>반올림 단위. 예를 들어 0.1 은 소숫점 0.1 까지 반올림(6.1234 => 6.1), 5 는 5 단위로 반올림(93 => 95).<br>[상세내용](https://github.com/naver/egjs-axes/wiki/round-option)</ko>\n**/\n\n/**\n * @class eg.Axes\n * @classdesc 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.\n * @ko 터치 입력 장치나 마우스와 같은 다양한 입력 장치를 통해 전달 받은 사용자의 동작을 논리적인 가상 좌표로 변경하는 모듈이다. 사용자 동작에 반응하는 UI를 손쉽게 만들수 있다.\n * @extends eg.Component\n *\n * @param {Object.<string, AxisOption>} axis Axis information managed by eg.Axes. The key of the axis specifies the name to use as the logical virtual coordinate system. <ko>eg.Axes가 관리하는 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.</ko>\n * @param {AxesOption} [options] The option object of the eg.Axes module<ko>eg.Axes 모듈의 옵션 객체</ko>\n * @param {Object.<string, number>} [startPos] The coordinates to be moved when creating an instance. not triggering change event.<ko>인스턴스 생성시 이동할 좌표, change 이벤트는 발생하지 않음.</ko>\n *\n * @support {\"ie\": \"10+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.3+ (except 3.x)\"}\n * @example\n *\n * // 1. Initialize eg.Axes\n * const axes = new eg.Axes({\n *\tsomething1: {\n *\t\trange: [0, 150],\n *\t\tbounce: 50\n *\t},\n *\tsomething2: {\n *\t\trange: [0, 200],\n *\t\tbounce: 100\n *\t},\n *\tsomethingN: {\n *\t\trange: [1, 10],\n *\t}\n * }, {\n * deceleration : 0.0024\n * });\n *\n * // 2. attach event handler\n * axes.on({\n *\t\"hold\" : function(evt) {\n *\t},\n *\t\"release\" : function(evt) {\n *\t},\n *\t\"animationStart\" : function(evt) {\n *\t},\n *\t\"animationEnd\" : function(evt) {\n *\t},\n *\t\"change\" : function(evt) {\n *\t}\n * });\n *\n * // 3. Initialize inputTypes\n * const panInputArea = new eg.Axes.PanInput(\"#area\", {\n *\tscale: [0.5, 1]\n * });\n * const panInputHmove = new eg.Axes.PanInput(\"#hmove\");\n * const panInputVmove = new eg.Axes.PanInput(\"#vmove\");\n * const pinchInputArea = new eg.Axes.PinchInput(\"#area\", {\n *\tscale: 1.5\n * });\n *\n * // 4. Connect eg.Axes and InputTypes\n * // [PanInput] When the mouse or touchscreen is down and moved.\n * // Connect the 'something2' axis to the mouse or touchscreen x position and\n * // connect the 'somethingN' axis to the mouse or touchscreen y position.\n * axes.connect([\"something2\", \"somethingN\"], panInputArea); // or axes.connect(\"something2 somethingN\", panInputArea);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position.\n * axes.connect([\"something1\"], panInputHmove); // or axes.connect(\"something1\", panInputHmove);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position.\n * axes.connect([\"\", \"something2\"], panInputVmove); // or axes.connect(\" something2\", panInputVmove);\n *\n * // [PinchInput] Connect 'something2' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something2\", pinchInputArea);\n */\nexport default class Axes extends Component<AxesEvents> {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.Axes.VERSION; // ex) 3.3.3\n\t * @memberof eg.Axes\n\t */\n\tstatic VERSION = \"#__VERSION__#\";\n\t// for tree shaking\n\tstatic PanInput;\n\tstatic PinchInput;\n\tstatic WheelInput;\n\tstatic MoveKeyInput;\n\tstatic RotatePanInput;\n\n\t/**\n\t * @name eg.Axes.TRANSFORM\n\t * @desc Returns the transform attribute with CSS vendor prefixes.\n\t * @ko CSS vendor prefixes를 붙인 transform 속성을 반환한다.\n\t *\n\t * @constant\n\t * @type {String}\n\t * @example\n\t * eg.Axes.TRANSFORM; // \"transform\" or \"webkitTransform\"\n\t */\n\tstatic TRANSFORM = TRANSFORM;\n\t/**\n\t * @name eg.Axes.DIRECTION_NONE\n\t * @constant\n\t * @type {Number}\n\t */\n\tstatic DIRECTION_NONE = DIRECTION_NONE;\n\t/**\n\t * @name eg.Axes.DIRECTION_LEFT\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_LEFT = DIRECTION_LEFT;\n\t/**\n\t * @name eg.Axes.DIRECTION_RIGHT\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_RIGHT = DIRECTION_RIGHT;\n\t/**\n\t * @name eg.Axes.DIRECTION_UP\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_UP = DIRECTION_UP;\n\t/**\n\t * @name eg.Axes.DIRECTION_DOWN\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_DOWN = DIRECTION_DOWN;\n\t/**\n\t * @name eg.Axes.DIRECTION_HORIZONTAL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;\n\t/**\n\t * @name eg.Axes.DIRECTION_VERTICAL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_VERTICAL = DIRECTION_VERTICAL;\n\t/**\n\t * @name eg.Axes.DIRECTION_ALL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tpublic static DIRECTION_ALL = DIRECTION_ALL;\n\n\tpublic options: AxesOption;\n\tpublic em: EventManager;\n\tpublic axm: AxisManager;\n\tpublic itm: InterruptManager;\n\tpublic am: AnimationManager;\n\tpublic io: InputObserver;\n\tprivate _inputs: IInputType[] = [];\n\n\tconstructor(public axis: ObjectInterface<AxisOption> = {}, options: AxesOption = {}, startPos?: Axis) {\n\t\tsuper();\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\teasing: function easeOutCubic(x) {\n\t\t\t\t\treturn 1 - Math.pow(1 - x, 3);\n\t\t\t\t},\n\t\t\t\tinterruptable: true,\n\t\t\t\tmaximumDuration: Infinity,\n\t\t\t\tminimumDuration: 0,\n\t\t\t\tdeceleration: 0.0006,\n\t\t\t\tround: null,\n\t\t\t}, ...options,\n\t\t};\n\n\t\tthis.itm = new InterruptManager(this.options);\n\t\tthis.axm = new AxisManager(this.axis, this.options);\n\t\tthis.em = new EventManager(this);\n\t\tthis.am = new AnimationManager(this);\n\t\tthis.io = new InputObserver(this);\n\t\tthis.em.setAnimationManager(this.am);\n\t\tstartPos && this.em.triggerChange(startPos);\n\t}\n\t/**\n\t * Connect the axis of eg.Axes to the inputType.\n\t * @ko eg.Axes의 축과 inputType을 연결한다\n\t * @method eg.Axes#connect\n\t * @param {(String[]|String)} axes The name of the axis to associate with inputType <ko>inputType과 연결할 축의 이름</ko>\n\t * @param {Object} inputType The inputType instance to associate with the axis of eg.Axes <ko>eg.Axes의 축과 연결할 inputType 인스턴스<ko>\n\t * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * }\n\t * });\n\t *\n\t * axes.connect(\"x\", new eg.Axes.PanInput(\"#area1\"))\n\t * .connect(\"x xOther\", new eg.Axes.PanInput(\"#area2\"))\n\t * .connect(\" xOther\", new eg.Axes.PanInput(\"#area3\"))\n\t * .connect([\"x\"], new eg.Axes.PanInput(\"#area4\"))\n\t * .connect([\"xOther\", \"x\"], new eg.Axes.PanInput(\"#area5\"))\n\t * .connect([\"\", \"xOther\"], new eg.Axes.PanInput(\"#area6\"));\n\t */\n\tconnect(axes: string[] | string, inputType: IInputType) {\n\t\tlet mapped;\n\t\tif (typeof axes === \"string\") {\n\t\t\tmapped = axes.split(\" \");\n\t\t} else {\n\t\t\tmapped = axes.concat();\n\t\t}\n\n\t\t// check same instance\n\t\tif (~this._inputs.indexOf(inputType)) {\n\t\t\tthis.disconnect(inputType);\n\t\t}\n\n\t\t// check same element in hammer type for share\n\t\tif (\"hammer\" in inputType) {\n\t\t\tconst targets = this._inputs.filter(v => v.hammer && v.element === inputType.element);\n\t\t\tif (targets.length) {\n\t\t\t\tinputType.hammer = targets[0].hammer;\n\t\t\t}\n\t\t}\n\t\tinputType.mapAxes(mapped);\n\t\tinputType.connect(this.io);\n\t\tthis._inputs.push(inputType);\n\t\treturn this;\n\t}\n\t/**\n\t * Disconnect the axis of eg.Axes from the inputType.\n\t * @ko eg.Axes의 축과 inputType의 연결을 끊는다.\n\t * @method eg.Axes#disconnect\n\t * @param {Object} [inputType] An inputType instance associated with the axis of eg.Axes <ko>eg.Axes의 축과 연결한 inputType 인스턴스<ko>\n\t * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * }\n\t * });\n\t *\n\t * const input1 = new eg.Axes.PanInput(\"#area1\");\n\t * const input2 = new eg.Axes.PanInput(\"#area2\");\n\t * const input3 = new eg.Axes.PanInput(\"#area3\");\n\t *\n\t * axes.connect(\"x\", input1);\n\t * .connect(\"x xOther\", input2)\n\t * .connect([\"xOther\", \"x\"], input3);\n\t *\n\t * axes.disconnect(input1); // disconnects input1\n\t * axes.disconnect(); // disconnects all of them\n\t */\n\tdisconnect(inputType?: IInputType) {\n\t\tif (inputType) {\n\t\t\tconst index = this._inputs.indexOf(inputType);\n\n\t\t\tif (index >= 0) {\n\t\t\t\tthis._inputs[index].disconnect();\n\t\t\t\tthis._inputs.splice(index, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._inputs.forEach(v => v.disconnect());\n\t\t\tthis._inputs = [];\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the current position of the coordinates.\n\t * @ko 좌표의 현재 위치를 반환한다\n\t * @method eg.Axes#get\n\t * @param {Object} [axes] The names of the axis <ko>축 이름들</ko>\n\t * @return {Object.<string, number>} Axis coordinate information <ko>축 좌표 정보</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.get(); // {\"x\": 0, \"xOther\": -100, \"zoom\": 50}\n\t * axes.get([\"x\", \"zoom\"]); // {\"x\": 0, \"zoom\": 50}\n\t */\n\tget(axes?: string[]) {\n\t\treturn this.axm.get(axes);\n\t}\n\n\t/**\n\t * Moves an axis to specific coordinates.\n\t * @ko 좌표를 이동한다.\n\t * @method eg.Axes#setTo\n\t * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n\t * @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n\t * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.setTo({\"x\": 30, \"zoom\": 60});\n\t * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n\t *\n\t * axes.setTo({\"x\": 100, \"xOther\": 60}, 1000); // animatation\n\t *\n\t * // after 1000 ms\n\t * axes.get(); // {\"x\": 100, \"xOther\": 60, \"zoom\": 60}\n\t */\n\tsetTo(pos: Axis, duration = 0) {\n\t\tthis.am.setTo(pos, duration);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Moves an axis from the current coordinates to specific coordinates.\n\t * @ko 현재 좌표를 기준으로 좌표를 이동한다.\n\t * @method eg.Axes#setBy\n\t * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n\t * @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n\t * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.setBy({\"x\": 30, \"zoom\": 10});\n\t * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n\t *\n\t * axes.setBy({\"x\": 70, \"xOther\": 60}, 1000); // animatation\n\t *\n\t * // after 1000 ms\n\t * axes.get(); // {\"x\": 100, \"xOther\": -40, \"zoom\": 60}\n\t */\n\tsetBy(pos: Axis, duration = 0) {\n\t\tthis.am.setBy(pos, duration);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns whether there is a coordinate in the bounce area of ​​the target axis.\n\t * @ko 대상 축 중 bounce영역에 좌표가 존재하는지를 반환한다\n\t * @method eg.Axes#isBounceArea\n\t * @param {Object} [axes] The names of the axis <ko>축 이름들</ko>\n\t * @return {Boolen} Whether the bounce area exists. <ko>bounce 영역 존재 여부</ko>\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.isBounceArea([\"x\"]);\n\t * axes.isBounceArea([\"x\", \"zoom\"]);\n\t * axes.isBounceArea();\n\t */\n\tisBounceArea(axes?: string[]) {\n\t\treturn this.axm.isOutside(axes);\n\t}\n\n\t/**\n\t* Destroys properties, and events used in a module and disconnect all connections to inputTypes.\n\t* @ko 모듈에 사용한 속성, 이벤트를 해제한다. 모든 inputType과의 연결을 끊는다.\n\t* @method eg.Axes#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.em.destroy();\n\t}\n}\n","import {Manager, PointerEventInput, TouchMouseInput, TouchInput, MouseInput} from \"@egjs/hammerjs\";\nimport { Axis } from \"../AxisManager\";\nimport { AxesOption } from \"../Axes\";\nimport { window } from \"../browser\";\n\nexport interface IInputType {\n\taxes: string[];\n\telement: HTMLElement;\n\thammer?;\n\tmapAxes(axes: string[]);\n\tconnect(observer: IInputTypeObserver): IInputType;\n\tdisconnect();\n\tdestroy();\n\tenable?();\n\tdisable?();\n\tisEnable?(): boolean;\n}\n\nexport interface IInputTypeObserver {\n\toptions: AxesOption;\n\tget(inputType: IInputType): Axis;\n\tchange(inputType: IInputType, event, offset: Axis);\n\thold(inputType: IInputType, event);\n\trelease(inputType: IInputType, event, offset: Axis, duration?: number);\n}\n\nexport const SUPPORT_POINTER_EVENTS = \"PointerEvent\" in window || \"MSPointerEvent\" in window;\nexport const SUPPORT_TOUCH = \"ontouchstart\" in window;\nexport const UNIQUEKEY = \"_EGJS_AXES_INPUTTYPE_\";\nexport function toAxis(source: string[], offset: number[]): Axis {\n\treturn offset.reduce((acc, v, i) => {\n\t\tif (source[i]) {\n\t\t\tacc[source[i]] = v;\n\t\t}\n\t\treturn acc;\n\t}, {});\n}\nexport function createHammer(element: HTMLElement, options) {\n\ttry {\n\t\t// create Hammer\n\t\treturn new Manager(element, { ...options });\n\t} catch (e) {\n\t\treturn null;\n\t}\n}\nexport function convertInputType(inputType: string[] = []): any {\n\tlet hasTouch = false;\n\tlet hasMouse = false;\n\tlet hasPointer = false;\n\n\tinputType.forEach(v => {\n\t\tswitch (v) {\n\t\t\tcase \"mouse\": hasMouse = true; break;\n\t\t\tcase \"touch\": hasTouch = SUPPORT_TOUCH; break;\n\t\t\tcase \"pointer\": hasPointer = SUPPORT_POINTER_EVENTS;\n\t\t\t// no default\n\t\t}\n\t});\n\tif (hasPointer) {\n\t\treturn PointerEventInput;\n\t} else if (hasTouch && hasMouse) {\n\t\treturn TouchMouseInput;\n\t} else if (hasTouch) {\n\t\treturn TouchInput;\n\t} else if (hasMouse) {\n\t\treturn MouseInput;\n\t}\n\treturn null;\n}\n","import { DIRECTION_ALL, DIRECTION_HORIZONTAL, DIRECTION_NONE, DIRECTION_VERTICAL, Manager, Pan } from \"@egjs/hammerjs\";\nimport { $ } from \"../utils\";\nimport { convertInputType, createHammer, IInputType, IInputTypeObserver, toAxis, UNIQUEKEY } from \"./InputType\";\nimport { IS_IOS_SAFARI, IOS_EDGE_THRESHOLD } from \"../const\";\nimport { ObjectInterface } from \"../types\";\n\nexport interface PanInputOption {\n\tinputType?: string[];\n\tscale?: number[];\n\tthresholdAngle?: number;\n\tthreshold?: number;\n\thammerManagerOptions?: ObjectInterface;\n\tiOSEdgeSwipeThreshold?: number;\n\treleaseOnScroll?: boolean;\n}\n\n// get user's direction\nexport function getDirectionByAngle(angle: number, thresholdAngle: number) {\n\tif (thresholdAngle < 0 || thresholdAngle > 90) {\n\t\treturn DIRECTION_NONE;\n\t}\n\tconst toAngle = Math.abs(angle);\n\n\treturn toAngle > thresholdAngle && toAngle < 180 - thresholdAngle ?\n\t\tDIRECTION_VERTICAL : DIRECTION_HORIZONTAL;\n}\n\nexport function getNextOffset(speeds: number[], deceleration: number) {\n\tconst normalSpeed = Math.sqrt(\n\t\tspeeds[0] * speeds[0] + speeds[1] * speeds[1],\n\t);\n\tconst duration = Math.abs(normalSpeed / -deceleration);\n\treturn [\n\t\tspeeds[0] / 2 * duration,\n\t\tspeeds[1] / 2 * duration,\n\t];\n}\n\nexport function useDirection(\n\tcheckType,\n\tdirection,\n\tuserDirection?): boolean {\n\tif (userDirection) {\n\t\treturn !!((direction === DIRECTION_ALL) ||\n\t\t\t((direction & checkType) && (userDirection & checkType)));\n\t} else {\n\t\treturn !!(direction & checkType);\n\t}\n}\n\n/**\n * @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.\n * @ko eg.Axes.PanInput 모듈의 옵션 객체\n * @property {String[]} [inputType=[\"touch\",\"mouse\", \"pointer\"]] Types of input devices.<br>- touch: Touch screen<br>- mouse: Mouse <ko>입력 장치 종류.<br>- touch: 터치 입력 장치<br>- mouse: 마우스</ko>\n * @property {Number[]} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @property {Number} [scale.0=1] horizontal axis scale <ko>수평축 배율</ko>\n * @property {Number} [scale.1=1] vertical axis scale <ko>수직축 배율</ko>\n * @property {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>\n * @property {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>\n * @property {Number} [iOSEdgeSwipeThreshold=30] Area (px) that can go to the next page when swiping the right edge in iOS safari <ko>iOS Safari에서 오른쪽 엣지를 스와이프 하는 경우 다음 페이지로 넘어갈 수 있는 영역(px)</ko>\n * @property {Object} [hammerManagerOptions={cssProps: {userSelect: \"none\",touchSelect: \"none\",touchCallout: \"none\",userDrag: \"none\"}] Options of Hammer.Manager <ko>Hammer.Manager의 옵션</ko>\n**/\n/**\n * @class eg.Axes.PanInput\n * @classdesc A module that passes the amount of change to eg.Axes when the mouse or touchscreen is down and moved. use less than two axes.\n * @ko 마우스나 터치 스크린을 누르고 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 두개 이하의 축을 사용한다.\n *\n * @example\n * const pan = new eg.Axes.PanInput(\"#area\", {\n * \t\tinputType: [\"touch\"],\n * \t\tscale: [1, 1.3],\n * });\n *\n * // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * // Connect the 'somethingN' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something2\", \"somethingN\"], pan); // or axes.connect(\"something2 somethingN\", pan);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something1\"], pan); // or axes.connect(\"something1\", pan);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"\", \"something2\"], pan); // or axes.connect(\" something2\", pan);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>\n * @param {PanInputOption} [options] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>\n */\nexport class PanInput implements IInputType {\n\toptions: PanInputOption;\n\taxes: string[] = [];\n\thammer = null;\n\telement: HTMLElement = null;\n\tprotected observer: IInputTypeObserver;\n\tprotected _direction;\n\tprivate panRecognizer = null;\n\tprivate isRightEdge = false;\n\tprivate rightEdgeTimer = 0;\n\tprivate panFlag = false;\n\n\tconstructor(el: string | HTMLElement, options?: PanInputOption) {\n\t\t/**\n\t\t * Hammer helps you add support for touch gestures to your page\n\t\t *\n\t\t * @external Hammer\n\t\t * @see {@link http://hammerjs.github.io|Hammer.JS}\n\t\t * @see {@link http://hammerjs.github.io/jsdoc/Hammer.html|Hammer.JS API documents}\n\t\t * @see Hammer.JS applies specific CSS properties by {@link http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html|default} when creating an instance. The eg.Axes module removes all default CSS properties provided by Hammer.JS\n\t\t */\n\t\tif (typeof Manager === \"undefined\") {\n\t\t\tthrow new Error(`The Hammerjs must be loaded before eg.Axes.PanInput.\\nhttp://hammerjs.github.io/`);\n\t\t}\n\t\tthis.element = $(el);\n\n\t\tthis.options = {\n\t\t\tinputType: [\"touch\", \"mouse\", \"pointer\"],\n\t\t\tscale: [1, 1],\n\t\t\tthresholdAngle: 45,\n\t\t\tthreshold: 0,\n\t\t\tiOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD,\n\t\t\treleaseOnScroll: false,\n\t\t\thammerManagerOptions: {\n\t\t\t\t// css properties were removed due to usablility issue\n\t\t\t\t// http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html\n\t\t\t\tcssProps: {\n\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\ttouchSelect: \"none\",\n\t\t\t\t\ttouchCallout: \"none\",\n\t\t\t\t\tuserDrag: \"none\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t...options,\n\t\t};\n\t\tthis.onHammerInput = this.onHammerInput.bind(this);\n\t\tthis.onPanmove = this.onPanmove.bind(this);\n\t\tthis.onPanend = this.onPanend.bind(this);\n\t}\n\n\tpublic mapAxes(axes: string[]) {\n\t\tconst useHorizontal = !!axes[0];\n\t\tconst useVertical = !!axes[1];\n\t\tif (useHorizontal && useVertical) {\n\t\t\tthis._direction = DIRECTION_ALL;\n\t\t} else if (useHorizontal) {\n\t\t\tthis._direction = DIRECTION_HORIZONTAL;\n\t\t} else if (useVertical) {\n\t\t\tthis._direction = DIRECTION_VERTICAL;\n\t\t} else {\n\t\t\tthis._direction = DIRECTION_NONE;\n\t\t}\n\t\tthis.axes = axes;\n\t}\n\n\tpublic connect(observer: IInputTypeObserver): IInputType {\n\t\tconst hammerOption = {\n\t\t\tdirection: this._direction,\n\t\t\tthreshold: this.options.threshold,\n\t\t};\n\t\tif (this.hammer) { // for sharing hammer instance.\n\t\t\t// hammer remove previous PanRecognizer.\n\t\t\tthis.removeRecognizer();\n\t\t\tthis.dettachEvent();\n\t\t} else {\n\t\t\tlet keyValue: string = this.element[UNIQUEKEY];\n\t\t\tif (!keyValue) {\n\t\t\t\tkeyValue = String(Math.round(Math.random() * new Date().getTime()));\n\t\t\t}\n\t\t\tconst inputClass = convertInputType(this.options.inputType);\n\t\t\tif (!inputClass) {\n\t\t\t\tthrow new Error(\"Wrong inputType parameter!\");\n\t\t\t}\n\t\t\tthis.hammer = createHammer(this.element, {\n\t\t\t\t...{\n\t\t\t\t\tinputClass,\n\t\t\t\t}, ... this.options.hammerManagerOptions,\n\t\t\t});\n\t\t\tthis.element[UNIQUEKEY] = keyValue;\n\t\t}\n\t\tthis.panRecognizer = new Pan(hammerOption);\n\n\t\tthis.hammer.add(this.panRecognizer);\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tpublic disconnect() {\n\t\tthis.removeRecognizer();\n\t\tif (this.hammer) {\n\t\t\tthis.dettachEvent();\n\t\t}\n\t\tthis._direction = DIRECTION_NONE;\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.PanInput#destroy\n\t*/\n\tpublic destroy() {\n\t\tthis.disconnect();\n\t\tif (this.hammer && this.hammer.recognizers.length === 0) {\n\t\t\tthis.hammer.destroy();\n\t\t}\n\t\tdelete this.element[UNIQUEKEY];\n\t\tthis.element = null;\n\t\tthis.hammer = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.PanInput#enable\n\t * @return {eg.Axes.PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tpublic enable() {\n\t\tthis.hammer && (this.hammer.get(\"pan\").options.enable = true);\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.PanInput#disable\n\t * @return {eg.Axes.PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tpublic disable() {\n\t\tthis.hammer && (this.hammer.get(\"pan\").options.enable = false);\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.PanInput#isEnable\n\t * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n\t */\n\tpublic isEnable() {\n\t\treturn !!(this.hammer && this.hammer.get(\"pan\").options.enable);\n\t}\n\n\tprivate removeRecognizer() {\n\t\tif (this.hammer && this.panRecognizer) {\n\t\t\tthis.hammer.remove(this.panRecognizer);\n\t\t\tthis.panRecognizer = null;\n\t\t}\n\t}\n\n\tprotected onHammerInput(event) {\n\t\tif (this.isEnable()) {\n\t\t\tif (event.isFirst) {\n\t\t\t\tthis.panFlag = false;\n\n\t\t\t\tif (event.srcEvent.cancelable !== false) {\n\t\t\t\t\tconst edgeThreshold = this.options.iOSEdgeSwipeThreshold!;\n\n\t\t\t\t\tthis.observer.hold(this, event);\n\t\t\t\t\tthis.isRightEdge = IS_IOS_SAFARI && event.center.x > window.innerWidth - edgeThreshold;\n\t\t\t\t\tthis.panFlag = true;\n\t\t\t\t}\n\t\t\t} else if (event.isFinal) {\n\t\t\t\tthis.onPanend(event);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onPanmove(event) {\n\t\tif (!this.panFlag) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { iOSEdgeSwipeThreshold, releaseOnScroll } = this.options;\n\t\tconst userDirection = getDirectionByAngle(\n\t\t\tevent.angle, this.options.thresholdAngle);\n\n\t\t// not support offset properties in Hammerjs - start\n\t\tconst prevInput = this.hammer.session.prevInput;\n\n\t\tif (releaseOnScroll && !event.srcEvent.cancelable) {\n\t\t\tthis.onPanend({\n\t\t\t\t...event,\n\t\t\t\tvelocityX: 0,\n\t\t\t\tvelocityY: 0,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevInput && IS_IOS_SAFARI) {\n\t\t\tconst swipeLeftToRight = event.center.x < 0;\n\n\t\t\tif (swipeLeftToRight) {\n\t\t\t\t// iOS swipe left => right\n\t\t\t\tthis.onPanend({\n\t\t\t\t\t...prevInput,\n\t\t\t\t\tvelocityX: 0,\n\t\t\t\t\tvelocityY: 0,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} else if (this.isRightEdge) {\n\t\t\t\tclearTimeout(this.rightEdgeTimer);\n\n\t\t\t\t// - is right to left\n\t\t\t\tconst swipeRightToLeft = event.deltaX < -iOSEdgeSwipeThreshold;\n\n\t\t\t\tif (swipeRightToLeft) {\n\t\t\t\t\tthis.isRightEdge = false;\n\t\t\t\t} else {\n\t\t\t\t\t// iOS swipe right => left\n\t\t\t\t\tthis.rightEdgeTimer = window.setTimeout(() => {\n\t\t\t\t\t\tthis.onPanend({\n\t\t\t\t\t\t\t...prevInput,\n\t\t\t\t\t\t\tvelocityX: 0,\n\t\t\t\t\t\t\tvelocityY: 0,\n\t\t\t\t\t\t\toffsetX: 0,\n\t\t\t\t\t\t\toffsetY: 0,\n\t\t\t\t\t\t});\n\t\t\t\t\t}, 100);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* eslint-disable no-param-reassign */\n\t\tif (prevInput) {\n\t\t\tevent.offsetX = event.deltaX - prevInput.deltaX;\n\t\t\tevent.offsetY = event.deltaY - prevInput.deltaY;\n\t\t} else {\n\t\t\tevent.offsetX = 0;\n\t\t\tevent.offsetY = 0;\n\t\t}\n\t\tconst offset: number[] = this.getOffset(\n\t\t\t[event.offsetX, event.offsetY],\n\t\t\t[\n\t\t\t\tuseDirection(DIRECTION_HORIZONTAL, this._direction, userDirection),\n\t\t\t\tuseDirection(DIRECTION_VERTICAL, this._direction, userDirection),\n\t\t\t]);\n\t\tconst prevent = offset.some(v => v !== 0);\n\n\t\tif (prevent) {\n\t\t\tconst srcEvent = event.srcEvent;\n\n\t\t\tif (srcEvent.cancelable !== false) {\n\t\t\t\tsrcEvent.preventDefault();\n\t\t\t}\n\t\t\tsrcEvent.stopPropagation();\n\t\t}\n\t\tevent.preventSystemEvent = prevent;\n\t\tprevent && this.observer.change(this, event, toAxis(this.axes, offset));\n\t}\n\n\tprotected onPanend(event) {\n\t\tif (!this.panFlag) {\n\t\t\treturn;\n\t\t}\n\t\tclearTimeout(this.rightEdgeTimer);\n\t\tthis.panFlag = false;\n\t\tlet offset: number[] = this.getOffset(\n\t\t\t[\n\t\t\t\tMath.abs(event.velocityX) * (event.deltaX < 0 ? -1 : 1),\n\t\t\t\tMath.abs(event.velocityY) * (event.deltaY < 0 ? -1 : 1),\n\t\t\t],\n\t\t\t[\n\t\t\t\tuseDirection(DIRECTION_HORIZONTAL, this._direction),\n\t\t\t\tuseDirection(DIRECTION_VERTICAL, this._direction),\n\t\t\t]);\n\t\toffset = getNextOffset(offset, this.observer.options.deceleration);\n\t\tthis.observer.release(this, event, toAxis(this.axes, offset));\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.hammer.on(\"hammer.input\", this.onHammerInput)\n\t\t\t.on(\"panstart panmove\", this.onPanmove);\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.hammer.off(\"hammer.input\", this.onHammerInput)\n\t\t\t.off(\"panstart panmove\", this.onPanmove);\n\t\tthis.observer = null;\n\t}\n\n\tprivate getOffset(\n\t\tproperties: number[],\n\t\tdirection: boolean[]): number[] {\n\t\tconst offset: number[] = [0, 0];\n\t\tconst scale = this.options.scale;\n\n\t\tif (direction[0]) {\n\t\t\toffset[0] = (properties[0] * scale[0]);\n\t\t}\n\t\tif (direction[1]) {\n\t\t\toffset[1] = (properties[1] * scale[1]);\n\t\t}\n\t\treturn offset;\n\t}\n}\n","import Axes from \"../Axes\";\nimport { toAxis } from \"./InputType\";\nimport { PanInput, PanInputOption } from \"./PanInput\";\n\n/**\n * @class eg.Axes.RotatePanInput\n * @classdesc A module that passes the angle moved by touch to Axes and uses one axis of rotation.<br>[Details](https://github.com/naver/egjs-axes/wiki/RotatePanInput)\n * @ko 터치에 의해 움직인 각도를 Axes 에 전달하며 1개의 회전축만 사용한다.<br>[상세내용](https://github.com/naver/egjs-axes/wiki/RotatePanInput-%7C-%ED%95%9C%EA%B5%AD%EC%96%B4)\n *\n * @example\n * const input = new eg.Axes.RotatePanInput(\"#area\");\n *\n * var axes = new eg.Axes({\n *\t// property name('angle') could be anything you want (eg. x, y, z...)\n * \tangle: {\n * \t\trange: [-180, 180] // from -180deg to 180deg\n * \t}\n * });\n *\n * axes.connect(\"angle\", input)\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.RotatePanInput module <ko>eg.Axes.RotatePanInput 모듈을 사용할 엘리먼트</ko>\n * @param {PanInputOption} [options] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>\n * @extends eg.Axes.PanInput\n */\nexport class RotatePanInput extends PanInput {\n\tprivate rotateOrigin: number[];\n\tprivate prevAngle: number;\n\tprivate prevQuadrant: number;\n\tprivate lastDiff: number;\n\tprivate coefficientForDistanceToAngle: number;\n\n\tconstructor(el: string | HTMLElement, options?: PanInputOption) {\n\t\tsuper(el, options);\n\n\t\tthis.prevQuadrant = null;\n\t\tthis.lastDiff = 0;\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis._direction = Axes.DIRECTION_ALL;\n\t\tthis.axes = axes;\n\t}\n\n\tonHammerInput(event) {\n\t\tif (this.isEnable()) {\n\t\t\tif (event.isFirst) {\n\t\t\t\tthis.observer.hold(this, event);\n\t\t\t\tthis.onPanstart(event);\n\t\t\t} else if (event.isFinal) {\n\t\t\t\tthis.onPanend(event);\n\t\t\t}\n\t\t}\n\t}\n\n\tonPanstart(event) {\n\t\tconst rect = this.element.getBoundingClientRect();\n\n\t\t/**\n\t\t * Responsive\n\t\t */\n\t\t// TODO: how to do if element is ellipse not circle.\n\t\tthis.coefficientForDistanceToAngle = 360 / (rect.width * Math.PI); // from 2*pi*r * x / 360\n\t\t// TODO: provide a way to set origin like https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin\n\t\tthis.rotateOrigin = [rect.left + (rect.width - 1) / 2, rect.top + (rect.height - 1) / 2];\n\n\t\t// init angle.\n\t\tthis.prevAngle = null;\n\n\t\tthis.triggerChange(event);\n\t}\n\n\tonPanmove(event) {\n\t\tthis.triggerChange(event);\n\t}\n\n\tonPanend(event) {\n\t\tthis.triggerChange(event);\n\t\tthis.triggerAnimation(event);\n\t}\n\n\tprivate triggerChange(event) {\n\t\tconst angle = this.getAngle(event.center.x, event.center.y);\n\t\tconst quadrant = this.getQuadrant(event.center.x, event.center.y);\n\t\tconst diff = this.getDifference(this.prevAngle, angle, this.prevQuadrant, quadrant);\n\n\t\tthis.prevAngle = angle;\n\t\tthis.prevQuadrant = quadrant;\n\n\t\tif (diff === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.lastDiff = diff;\n\t\tthis.observer.change(this, event, toAxis(this.axes, [-diff])); // minus for clockwise\n\t}\n\n\tprivate triggerAnimation(event) {\n\t\tconst vx = event.velocityX;\n\t\tconst vy = event.velocityY;\n\t\tconst velocity = Math.sqrt(vx * vx + vy * vy) * (this.lastDiff > 0 ? -1 : 1); // clockwise\n\t\tconst duration = Math.abs(velocity / -this.observer.options.deceleration);\n\t\tconst distance = velocity / 2 * duration;\n\n\t\tthis.observer.release(this, event, toAxis(this.axes, [distance * this.coefficientForDistanceToAngle]));\n\t}\n\n\tprivate getDifference(prevAngle: number, angle: number, prevQuadrant: number, quadrant: number) {\n\t\tlet diff: number;\n\n\t\tif (prevAngle === null) {\n\t\t\tdiff = 0;\n\t\t} else if (prevQuadrant === 1 && quadrant === 4) {\n\t\t\tdiff = -prevAngle - (360 - angle);\n\t\t} else if (prevQuadrant === 4 && quadrant === 1) {\n\t\t\tdiff = (360 - prevAngle) + angle;\n\t\t} else {\n\t\t\tdiff = angle - prevAngle;\n\t\t}\n\n\t\treturn diff;\n\t}\n\n\tprivate getPosFromOrigin(posX: number, posY: number) {\n\t\treturn {\n\t\t\tx: posX - this.rotateOrigin[0],\n\t\t\ty: this.rotateOrigin[1] - posY,\n\t\t};\n\t}\n\n\tprivate getAngle(posX: number, posY: number) {\n\t\tconst { x, y } = this.getPosFromOrigin(posX, posY);\n\n\t\tconst angle = Math.atan2(y, x) * 180 / Math.PI;\n\t\t// console.log(angle, x, y);\n\t\treturn angle < 0 ? 360 + angle : angle;\n\t}\n\n\t/**\n\t * Quadrant\n\t * y(+)\n\t * |\n\t * 2 | 1\n\t * --------------->x(+)\n\t * 3 | 4\n\t * |\n\t */\n\tprivate getQuadrant(posX: number, posY: number) {\n\t\tconst { x, y } = this.getPosFromOrigin(posX, posY);\n\t\tlet q = 0;\n\n\t\tif (x >= 0 && y >= 0) {\n\t\t\tq = 1;\n\t\t} else if (x < 0 && y >= 0) {\n\t\t\tq = 2;\n\t\t} else if (x < 0 && y < 0) {\n\t\t\tq = 3;\n\t\t} else if (x >= 0 && y < 0) {\n\t\t\tq = 4;\n\t\t}\n\t\treturn q;\n\t}\n}\n","import { Manager, Pinch } from \"@egjs/hammerjs\";\nimport { $ } from \"../utils\";\nimport { UNIQUEKEY, toAxis, convertInputType, createHammer, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { ObjectInterface } from \"../types\";\n\nexport interface PinchInputOption {\n\tscale?: number;\n\tthreshold?: number;\n\tinputType?: string[];\n\thammerManagerOptions?: ObjectInterface;\n}\n\n/**\n * @typedef {Object} PinchInputOption The option object of the eg.Axes.PinchInput module\n * @ko eg.Axes.PinchInput 모듈의 옵션 객체\n * @property {Number} [scale=1] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @property {Number} [threshold=0] Minimal scale before recognizing <ko>사용자의 Pinch 동작을 인식하기 위해산 최소한의 배율</ko>\n * @property {Object} [hammerManagerOptions={cssProps: {userSelect: \"none\",touchSelect: \"none\",touchCallout: \"none\",userDrag: \"none\"}] Options of Hammer.Manager <ko>Hammer.Manager의 옵션</ko>\n**/\n\n/**\n * @class eg.Axes.PinchInput\n * @classdesc A module that passes the amount of change to eg.Axes when two pointers are moving toward (zoom-in) or away from each other (zoom-out). use one axis.\n * @ko 2개의 pointer를 이용하여 zoom-in하거나 zoom-out 하는 동작의 변화량을 eg.Axes에 전달하는 모듈. 한 개 의 축을 사용한다.\n * @example\n * const pinch = new eg.Axes.PinchInput(\"#area\", {\n * \t\tscale: 1\n * });\n *\n * // Connect 'something' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something\", pinch);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PinchInput module <ko>eg.Axes.PinchInput 모듈을 사용할 엘리먼트</ko>\n * @param {PinchInputOption} [options] The option object of the eg.Axes.PinchInput module<ko>eg.Axes.PinchInput 모듈의 옵션 객체</ko>\n */\nexport class PinchInput implements IInputType {\n\n\toptions: PinchInputOption;\n\taxes: string[] = [];\n\thammer = null;\n\telement: HTMLElement = null;\n\n\tprivate observer: IInputTypeObserver;\n\tprivate _base: number = null;\n\tprivate _prev: number = null;\n\tprivate pinchRecognizer = null;\n\n\tconstructor(el, options?: PinchInputOption) {\n\t\t/**\n\t\t * Hammer helps you add support for touch gestures to your page\n\t\t *\n\t\t * @external Hammer\n\t\t * @see {@link http://hammerjs.github.io|Hammer.JS}\n\t\t * @see {@link http://hammerjs.github.io/jsdoc/Hammer.html|Hammer.JS API documents}\n\t\t * @see Hammer.JS applies specific CSS properties by {@link http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html|default} when creating an instance. The eg.Axes module removes all default CSS properties provided by Hammer.JS\n\t\t */\n\t\tif (typeof Manager === \"undefined\") {\n\t\t\tthrow new Error(`The Hammerjs must be loaded before eg.Axes.PinchInput.\\nhttp://hammerjs.github.io/`);\n\t\t}\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: 1,\n\t\t\t\tthreshold: 0,\n\t\t\t\tinputType: [\"touch\", \"pointer\"],\n\t\t\t\thammerManagerOptions: {\n\t\t\t\t\t// css properties were removed due to usablility issue\n\t\t\t\t\t// http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html\n\t\t\t\t\tcssProps: {\n\t\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\t\ttouchSelect: \"none\",\n\t\t\t\t\t\ttouchCallout: \"none\",\n\t\t\t\t\t\tuserDrag: \"none\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t...options,\n\t\t};\n\t\tthis.onPinchStart = this.onPinchStart.bind(this);\n\t\tthis.onPinchMove = this.onPinchMove.bind(this);\n\t\tthis.onPinchEnd = this.onPinchEnd.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tconst hammerOption = { threshold: this.options.threshold };\n\n\t\tif (this.hammer) { // for sharing hammer instance.\n\t\t\t// hammer remove previous PinchRecognizer.\n\t\t\tthis.removeRecognizer();\n\t\t\tthis.dettachEvent();\n\t\t} else {\n\t\t\tlet keyValue: string = this.element[UNIQUEKEY];\n\t\t\tif (!keyValue) {\n\t\t\t\tkeyValue = String(Math.round(Math.random() * new Date().getTime()));\n\t\t\t}\n\t\t\tconst inputClass = convertInputType(this.options.inputType);\n\t\t\tif (!inputClass) {\n\t\t\t\tthrow new Error(\"Wrong inputType parameter!\");\n\t\t\t}\n\t\t\tthis.hammer = createHammer(\n\t\t\t\tthis.element,\n\t\t\t\t{\n\t\t\t\t\t...{\n\t\t\t\t\t\tinputClass,\n\t\t\t\t\t}, ...this.options.hammerManagerOptions,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.element[UNIQUEKEY] = keyValue;\n\t\t}\n\t\tthis.pinchRecognizer = new Pinch(hammerOption);\n\t\tthis.hammer.add(this.pinchRecognizer);\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.removeRecognizer();\n\t\tif (this.hammer) {\n\t\t\tthis.hammer.remove(this.pinchRecognizer);\n\t\t\tthis.pinchRecognizer = null;\n\t\t\tthis.dettachEvent();\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.PinchInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tif (this.hammer && this.hammer.recognizers.length === 0) {\n\t\t\tthis.hammer.destroy();\n\t\t}\n\t\tdelete this.element[UNIQUEKEY];\n\t\tthis.element = null;\n\t\tthis.hammer = null;\n\t}\n\n\tprivate removeRecognizer() {\n\t\tif (this.hammer && this.pinchRecognizer) {\n\t\t\tthis.hammer.remove(this.pinchRecognizer);\n\t\t\tthis.pinchRecognizer = null;\n\t\t}\n\t}\n\n\tprivate onPinchStart(event) {\n\t\tthis._base = this.observer.get(this)[this.axes[0]];\n\t\tconst offset = this.getOffset(event.scale);\n\t\tthis.observer.hold(this, event);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis._prev = event.scale;\n\t}\n\tprivate onPinchMove(event) {\n\t\tconst offset = this.getOffset(event.scale, this._prev);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis._prev = event.scale;\n\t}\n\tprivate onPinchEnd(event) {\n\t\tconst offset = this.getOffset(event.scale, this._prev);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis.observer.release(this, event, toAxis(this.axes, [0]), 0);\n\t\tthis._base = null;\n\t\tthis._prev = null;\n\t}\n\tprivate getOffset(pinchScale: number, prev: number = 1): number {\n\t\treturn this._base * (pinchScale - prev) * this.options.scale;\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.hammer.on(\"pinchstart\", this.onPinchStart)\n\t\t\t.on(\"pinchmove\", this.onPinchMove)\n\t\t\t.on(\"pinchend\", this.onPinchEnd);\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.hammer.off(\"pinchstart\", this.onPinchStart)\n\t\t\t.off(\"pinchmove\", this.onPinchMove)\n\t\t\t.off(\"pinchend\", this.onPinchEnd);\n\t\tthis.observer = null;\n\t\tthis._prev = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.PinchInput#enable\n\t * @return {eg.Axes.PinchInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tenable() {\n\t\tthis.hammer && (this.hammer.get(\"pinch\").options.enable = true);\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.PinchInput#disable\n\t * @return {eg.Axes.PinchInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tdisable() {\n\t\tthis.hammer && (this.hammer.get(\"pinch\").options.enable = false);\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.PinchInput#isEnable\n\t * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n\t */\n\tisEnable() {\n\t\treturn !!(this.hammer && this.hammer.get(\"pinch\").options.enable);\n\t}\n}\n","import { InputObserver } from \"./../InputObserver\";\nimport { $ } from \"../utils\";\nimport { UNIQUEKEY, toAxis, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { Axis } from \"../AxisManager\";\n\nexport interface WheelInputOption {\n\tscale?: number;\n\tuseNormalized?: boolean;\n}\n\n/**\n * @typedef {Object} WheelInputOption The option object of the eg.Axes.WheelInput module\n * @ko eg.Axes.WheelInput 모듈의 옵션 객체\n * @property {Number} [scale=1] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n**/\n\n/**\n * @class eg.Axes.WheelInput\n * @classdesc A module that passes the amount of change to eg.Axes when the mouse wheel is moved. use one axis.\n * @ko 마우스 휠이 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 한 개 의 축을 사용한다.\n *\n * @example\n * const wheel = new eg.Axes.WheelInput(\"#area\", {\n * \t\tscale: 1\n * });\n *\n * // Connect 'something' axis when the mousewheel is moved.\n * axes.connect(\"something\", wheel);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.WheelInput module <ko>eg.Axes.WheelInput 모듈을 사용할 엘리먼트</ko>\n * @param {WheelInputOption} [options] The option object of the eg.Axes.WheelInput module<ko>eg.Axes.WheelInput 모듈의 옵션 객체</ko>\n */\nexport class WheelInput implements IInputType {\n\toptions: WheelInputOption;\n\taxes: string[] = [];\n\telement: HTMLElement = null;\n\tprivate _isEnabled = false;\n\tprivate _isHolded = false;\n\tprivate _timer = null;\n\tprivate observer: IInputTypeObserver;\n\tconstructor(el, options?: WheelInputOption) {\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: 1,\n\t\t\t\tuseNormalized: true,\n\t\t\t}, ...options,\n\t\t};\n\t\tthis.onWheel = this.onWheel.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tthis.dettachEvent();\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.dettachEvent();\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.WheelInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.element = null;\n\t}\n\n\tprivate onWheel(event) {\n\t\tif (!this._isEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tevent.preventDefault();\n\n\t\tif (event.deltaY === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._isHolded) {\n\t\t\tthis.observer.hold(this, event);\n\t\t\tthis._isHolded = true;\n\t\t}\n\t\tconst offset = (event.deltaY > 0 ? -1 : 1) * this.options.scale * (this.options.useNormalized ? 1 : Math.abs(event.deltaY));\n\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tclearTimeout(this._timer);\n\t\tconst inst = this;\n\n\t\tthis._timer = setTimeout(() => {\n\t\t\tif (this._isHolded) {\n\t\t\t\tthis._isHolded = false;\n\t\t\t\tthis.observer.release(this, event, toAxis(this.axes, [0]));\n\t\t\t}\n\t\t}, 50);\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.element.addEventListener(\"wheel\", this.onWheel);\n\t\tthis._isEnabled = true;\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.element.removeEventListener(\"wheel\", this.onWheel);\n\t\tthis._isEnabled = false;\n\t\tthis.observer = null;\n\n\t\tif (this._timer) {\n\t\t\tclearTimeout(this._timer);\n\t\t\tthis._timer = null;\n\t\t}\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.WheelInput#enable\n\t * @return {eg.Axes.WheelInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tenable() {\n\t\tthis._isEnabled = true;\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.WheelInput#disable\n\t * @return {eg.Axes.WheelInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tdisable() {\n\t\tthis._isEnabled = false;\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.WheelInput#isEnable\n\t * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n\t */\n\tisEnable() {\n\t\treturn this._isEnabled;\n\t}\n}\n","import { InputObserver } from \"./../InputObserver\";\nimport { $ } from \"../utils\";\nimport { toAxis, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { Axis } from \"../AxisManager\";\n\nexport const KEY_LEFT_ARROW = 37;\nexport const KEY_A = 65;\nexport const KEY_UP_ARROW = 38;\nexport const KEY_W = 87;\nexport const KEY_RIGHT_ARROW = 39;\nexport const KEY_D = 68;\nexport const KEY_DOWN_ARROW = 40;\nexport const KEY_S = 83;\n\nconst DIRECTION_REVERSE = -1;\nconst DIRECTION_FORWARD = 1;\nconst DIRECTION_HORIZONTAL = -1;\nconst DIRECTION_VERTICAL = 1;\nconst DELAY = 80;\n\nexport interface MoveKeyInputOption {\n\tscale?: number[];\n}\n\n/**\n * @typedef {Object} MoveKeyInputOption The option object of the eg.Axes.MoveKeyInput module\n * @ko eg.Axes.MoveKeyInput 모듈의 옵션 객체\n * @property {Array<Number>} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @property {Number} [scale[0]=1] Coordinate scale for the first axis<ko>첫번째 축의 배율</ko>\n * @property {Number} [scale[1]=1] Coordinate scale for the decond axis<ko>두번째 축의 배율</ko>\n**/\n\n/**\n * @class eg.Axes.MoveKeyInput\n * @classdesc A module that passes the amount of change to eg.Axes when the move key stroke is occured. use two axis.\n * @ko 이동키 입력이 발생했을 때의 변화량을 eg.Axes에 전달하는 모듈. 두 개 의 축을 사용한다.\n *\n * @example\n * const moveKey = new eg.Axes.MoveKeyInput(\"#area\", {\n * \t\tscale: [1, 1]\n * });\n *\n * // Connect 'x', 'y' axes when the moveKey is pressed.\n * axes.connect([\"x\", \"y\"], moveKey);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.MoveKeyInput module <ko>eg.Axes.MoveKeyInput 모듈을 사용할 엘리먼트</ko>\n * @param {MoveKeyInputOption} [options] The option object of the eg.Axes.MoveKeyInput module<ko>eg.Axes.MoveKeyInput 모듈의 옵션 객체</ko>\n */\nexport class MoveKeyInput implements IInputType {\n\toptions: MoveKeyInputOption;\n\taxes: string[] = [];\n\telement: HTMLElement = null;\n\tprivate _isEnabled = false;\n\tprivate _isHolded = false;\n\tprivate _timer = null;\n\tprivate observer: IInputTypeObserver;\n\tconstructor(el, options?: MoveKeyInputOption) {\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: [1, 1],\n\t\t\t}, ...options,\n\t\t};\n\t\tthis.onKeydown = this.onKeydown.bind(this);\n\t\tthis.onKeyup = this.onKeyup.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tthis.dettachEvent();\n\n\t\t// add tabindex=\"0\" to the container for making it focusable\n\t\tif (this.element.getAttribute(\"tabindex\") !== \"0\") {\n\t\t\tthis.element.setAttribute(\"tabindex\", \"0\");\n\t\t}\n\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.dettachEvent();\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.MoveKeyInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.element = null;\n\t}\n\n\tprivate onKeydown(e) {\n\t\tif (!this._isEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet isMoveKey = true;\n\t\tlet direction = DIRECTION_FORWARD;\n\t\tlet move = DIRECTION_HORIZONTAL;\n\n\t\tswitch (e.keyCode) {\n\t\t\tcase KEY_LEFT_ARROW:\n\t\t\tcase KEY_A:\n\t\t\t\tdirection = DIRECTION_REVERSE;\n\t\t\t\tbreak;\n\t\t\tcase KEY_RIGHT_ARROW:\n\t\t\tcase KEY_D:\n\t\t\t\tbreak;\n\t\t\tcase KEY_DOWN_ARROW:\n\t\t\tcase KEY_S:\n\t\t\t\tdirection = DIRECTION_REVERSE;\n\t\t\t\tmove = DIRECTION_VERTICAL;\n\t\t\t\tbreak;\n\t\t\tcase KEY_UP_ARROW:\n\t\t\tcase KEY_W:\n\t\t\t\tmove = DIRECTION_VERTICAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisMoveKey = false;\n\t\t}\n\t\tif ((move === DIRECTION_HORIZONTAL && !this.axes[0]) ||\n\t\t\t(move === DIRECTION_VERTICAL && !this.axes[1])) {\n\t\t\tisMoveKey = false;\n\t\t}\n\t\tif (!isMoveKey) {\n\t\t\treturn;\n\t\t}\n\t\tconst offsets = move === DIRECTION_HORIZONTAL ? [+this.options.scale[0] * direction, 0] : [0, +this.options.scale[1] * direction];\n\n\t\tif (!this._isHolded) {\n\t\t\tthis.observer.hold(this, event);\n\t\t\tthis._isHolded = true;\n\t\t}\n\t\tclearTimeout(this._timer);\n\t\tthis.observer.change(this, event, toAxis(this.axes, offsets));\n\t}\n\tprivate onKeyup(e) {\n\t\tif (!this._isHolded) {\n\t\t\treturn;\n\t\t}\n\t\tclearTimeout(this._timer);\n\t\tthis._timer = setTimeout(() => {\n\t\t\tthis.observer.release(this, e, toAxis(this.axes, [0, 0]));\n\t\t\tthis._isHolded = false;\n\t\t}, DELAY);\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.element.addEventListener(\"keydown\", this.onKeydown, false);\n\t\tthis.element.addEventListener(\"keypress\", this.onKeydown, false);\n\t\tthis.element.addEventListener(\"keyup\", this.onKeyup, false);\n\t\tthis._isEnabled = true;\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.element.removeEventListener(\"keydown\", this.onKeydown, false);\n\t\tthis.element.removeEventListener(\"keypress\", this.onKeydown, false);\n\t\tthis.element.removeEventListener(\"keyup\", this.onKeyup, false);\n\t\tthis._isEnabled = false;\n\t\tthis.observer = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.MoveKeyInput#enable\n\t * @return {eg.Axes.MoveKeyInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tenable() {\n\t\tthis._isEnabled = true;\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.MoveKeyInput#disable\n\t * @return {eg.Axes.MoveKeyInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n\t */\n\tdisable() {\n\t\tthis._isEnabled = false;\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.MoveKeyInput#isEnable\n\t * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n\t */\n\tisEnable() {\n\t\treturn this._isEnabled;\n\t}\n}\n","import Axes from \"./Axes\";\nimport { PanInput } from \"./inputType/PanInput\";\nimport { RotatePanInput } from \"./inputType/RotatePanInput\";\nimport { PinchInput } from \"./inputType/PinchInput\";\nimport { WheelInput } from \"./inputType/WheelInput\";\nimport { MoveKeyInput } from \"./inputType/MoveKeyInput\";\n\nAxes.PanInput = PanInput;\nAxes.RotatePanInput = RotatePanInput;\nAxes.PinchInput = PinchInput;\nAxes.WheelInput = WheelInput;\nAxes.MoveKeyInput = MoveKeyInput;\n\nexport default Axes;\n"],"names":["getInsidePosition","destPos","range","circular","bounce","toDestPos","targetRange","Math","max","min","isOutside","pos","getDuration","distance","deceleration","duration","sqrt","isCircularable","getCirculatedPos","toPos","length","win","window","navigator","userAgent","toArray","nodes","el","i","len","push","$","param","multi","match","dummy","document","createElement","innerHTML","childNodes","querySelectorAll","undefined","nodeName","nodeType","jQuery","constructor","prototype","jquery","get","Array","isArray","map","v","raf","requestAnimationFrame","webkitRequestAnimationFrame","caf","cancelAnimationFrame","webkitCancelAnimationFrame","keyInfo_1","oldraf_1","callback","wrapCallback","timestamp","key","setTimeout","performance","now","Date","getTime","clearTimeout","fp","obj","tranformed","k","filter","filtered","every","equal","target","base","roundNumFunc","roundNumber","num","roundUnit","getRoundFunc","roundNumbers","isNumber","value","getDecimalPlace","val","isFinite","indexOf","p","e","round","inversePow","n","pow","minMax","_a","options","itm","em","axm","animationEnd","bind","depaPos","wishDuration","durations_1","abs","_this","Object","keys","reduce","Infinity","minimumDuration","maximumDuration","option","inputEvent","event","delta","getDelta","input","isTrusted","done","axes","_animateParam","orgPos_1","opt","triggerChange","_raf","triggerAnimationEnd","animateTo","beforeParam","getEventInfo","circularTargets","setTo","setInterrupt","restore","finish","triggerFinish","complete","info_1","self_1","destPos_1","prevPos_1","prevEasingPer_1","directions_1","originalIntendedPos_1","prevTime_1","startTime","loop","currentTime","ratio","easingPer","easing","nextPos","circulatedPos","rangeOffset","isCanceled","getFinalPos","originalIntendedPos","ERROR_LIMIT","finalPos","getRoundUnit","result","minRoundUnit","getAxisOptions","userWish","createAnimationParam","retTrigger","triggerAnimationStart","getUserControll","console","warn","animateLoop","grab","orgPos","movedPos","roundPos","getRoundPos","trigger","roundDepa","createUserControll","isAccurate","holding","am","eventInfo","moveTo","set","userControl","userDuration","off","interruptable","_prevented","prevented","axis","_complementOptions","_pos","acc","forEach","axisOption","test","fullDepaPos","axisOptions","tn","tx","initSlope_1","out","isInterrupted","changeOption","isStopped","moveDistance","triggerHold","offset","isInterrupting","atOutside","inputDuration","triggerRelease","isEqual","IOS_EDGE_THRESHOLD","IS_IOS_SAFARI","getAgent","browser","name","TRANSFORM","bodyStyle","head","getElementsByTagName","style","__extends","startPos","_super","easeOutCubic","x","InterruptManager","AxisManager","EventManager","AnimationManager","io","InputObserver","setAnimationManager","inputType","mapped","split","concat","_inputs","disconnect","targets","hammer","element","mapAxes","connect","index","splice","setBy","destroy","Axes","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","Component","SUPPORT_POINTER_EVENTS","SUPPORT_TOUCH","UNIQUEKEY","toAxis","source","createHammer","Manager","convertInputType","hasTouch","hasMouse","hasPointer","PointerEventInput","TouchMouseInput","TouchInput","MouseInput","getDirectionByAngle","angle","thresholdAngle","toAngle","getNextOffset","speeds","normalSpeed","useDirection","checkType","direction","userDirection","Error","scale","threshold","iOSEdgeSwipeThreshold","releaseOnScroll","hammerManagerOptions","cssProps","userSelect","touchSelect","touchCallout","userDrag","onHammerInput","onPanmove","onPanend","useHorizontal","useVertical","_direction","observer","hammerOption","removeRecognizer","dettachEvent","keyValue","String","random","inputClass","panRecognizer","Pan","add","attachEvent","recognizers","enable","remove","isEnable","isFirst","panFlag","srcEvent","cancelable","edgeThreshold","hold","isRightEdge","center","innerWidth","isFinal","prevInput","session","velocityX","velocityY","offsetX","offsetY","swipeLeftToRight","rightEdgeTimer","swipeRightToLeft","deltaX","deltaY","getOffset","prevent","some","preventDefault","stopPropagation","preventSystemEvent","change","release","on","properties","prevQuadrant","lastDiff","onPanstart","rect","getBoundingClientRect","coefficientForDistanceToAngle","width","PI","rotateOrigin","left","top","height","prevAngle","triggerAnimation","getAngle","y","quadrant","getQuadrant","diff","getDifference","vx","vy","velocity","posX","posY","getPosFromOrigin","atan2","q","PanInput","onPinchStart","onPinchMove","onPinchEnd","pinchRecognizer","Pinch","_base","_prev","pinchScale","prev","useNormalized","onWheel","_isEnabled","_isHolded","_timer","addEventListener","removeEventListener","KEY_LEFT_ARROW","KEY_A","KEY_UP_ARROW","KEY_W","KEY_RIGHT_ARROW","KEY_D","KEY_DOWN_ARROW","KEY_S","DIRECTION_REVERSE","DIRECTION_FORWARD","DELAY","onKeydown","onKeyup","getAttribute","setAttribute","isMoveKey","move","keyCode","offsets","RotatePanInput","PinchInput","WheelInput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