UNPKG

390 kBSource Map (JSON)View Raw
1{"version":3,"sources":["_header.js","packages/@interactjs/utils/isWindow.ts","packages/@interactjs/utils/window.ts","packages/@interactjs/utils/is.ts","packages/@interactjs/actions/drag/plugin.ts","packages/@interactjs/utils/domObjects.ts","packages/@interactjs/utils/browser.ts","packages/@interactjs/utils/domUtils.ts","packages/@interactjs/utils/extend.ts","packages/@interactjs/utils/rect.ts","packages/@interactjs/utils/getOriginXY.ts","packages/@interactjs/utils/normalizeListeners.ts","packages/@interactjs/utils/hypot.ts","packages/@interactjs/utils/pointerExtend.ts","packages/@interactjs/utils/pointerUtils.ts","packages/@interactjs/core/BaseEvent.ts","packages/@interactjs/utils/arr.ts","packages/@interactjs/actions/drop/DropEvent.ts","packages/@interactjs/actions/drop/plugin.ts","packages/@interactjs/actions/gesture/plugin.ts","packages/@interactjs/actions/resize/plugin.ts","packages/@interactjs/actions/plugin.ts","packages/@interactjs/arrange/plugin.ts","packages/@interactjs/utils/raf.ts","packages/@interactjs/auto-scroll/plugin.ts","packages/@interactjs/utils/misc.ts","packages/@interactjs/auto-start/InteractableMethods.ts","packages/@interactjs/auto-start/base.ts","packages/@interactjs/auto-start/dragAxis.ts","packages/@interactjs/auto-start/hold.ts","packages/@interactjs/auto-start/plugin.ts","packages/@interactjs/clone/plugin.ts","packages/@interactjs/core/interactablePreventDefault.ts","packages/@interactjs/dev-tools/plugin.ts","packages/@interactjs/utils/clone.ts","packages/@interactjs/modifiers/Modification.ts","packages/@interactjs/modifiers/base.ts","packages/@interactjs/core/defaultOptions.ts","packages/@interactjs/core/InteractEvent.ts","packages/@interactjs/core/PointerInfo.ts","packages/@interactjs/core/Interaction.ts","packages/@interactjs/offset/plugin.ts","packages/@interactjs/inertia/plugin.ts","packages/@interactjs/core/Eventable.ts","packages/@interactjs/core/isNonNativeEvent.ts","packages/@interactjs/core/Interactable.ts","packages/@interactjs/core/InteractableSet.ts","packages/@interactjs/core/events.ts","packages/@interactjs/core/interactStatic.ts","packages/@interactjs/core/interactionFinder.ts","packages/@interactjs/core/interactions.ts","packages/@interactjs/core/scope.ts","packages/@interactjs/interact/index.ts","packages/@interactjs/snappers/edgeTarget.ts","packages/@interactjs/snappers/elements.ts","packages/@interactjs/snappers/grid.ts","packages/@interactjs/snappers/plugin.ts","packages/@interactjs/modifiers/aspectRatio.ts","packages/@interactjs/modifiers/noop.ts","packages/@interactjs/modifiers/restrict/pointer.ts","packages/@interactjs/modifiers/restrict/edges.ts","packages/@interactjs/modifiers/restrict/rect.ts","packages/@interactjs/modifiers/restrict/size.ts","packages/@interactjs/modifiers/snap/pointer.ts","packages/@interactjs/modifiers/snap/size.ts","packages/@interactjs/modifiers/snap/edges.ts","packages/@interactjs/modifiers/all.ts","packages/@interactjs/modifiers/plugin.ts","packages/@interactjs/pointer-events/PointerEvent.ts","packages/@interactjs/pointer-events/base.ts","packages/@interactjs/pointer-events/holdRepeat.ts","packages/@interactjs/pointer-events/interactableTargets.ts","packages/@interactjs/pointer-events/plugin.ts","packages/@interactjs/reflow/plugin.ts","packages/@interactjs/utils/displace.ts","packages/@interactjs/utils/exchange.ts","packages/@interactjs/interactjs/index.ts","packages/interactjs/index.ts","node_modules/browser-pack-flat/_postlude"],"names":[],"mappings":";AAAA,CAMA,SAAA,GAAA,GAAA,iBAAA,SAAA,oBAAA,OAAA,OAAA,QAAA,SAAA,GAAA,mBAAA,QAAA,OAAA,IAAA,OAAA,GAAA,OAAA,EAAA,oBAAA,OAAA,OAAA,oBAAA,OAAA,OAAA,oBAAA,KAAA,KAAA,MAAA,SAAA,KAAA,EAAA,WAAA,IACA,EAAA,+ECPgB,SAAA,GAAD,SAAmB,IAAS,EAAZ,SAA8B,aAAiB,EAA9E,0GCEA,IAAM,EAAM,CACV,gBADU,EAEV,YAFU,EAGV,UAAA,EACA,KAAA,GAGK,SAAA,EAAA,GAGL,EAAA,WAHyE,EAMzE,IAAM,EAAK,EAAA,SAAA,eAN8D,IASrE,EAAA,gBAAqB,EAArB,UAAA,mBACO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CAO,8aC+BP,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAGA,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,IAAA,GAAA,SAEA,GAAA,QAAA,QAAmB,CACjB,SAAA,GAAA,SACA,SAAA,GACA,QAAS,GAKT,GAAA,QAAA,IAAA,GAAA,gBAGF,GAAA,QAEA,yBAAI,WAAA,GAAA,KAAJ,GACE,IAAM,GAAA,QAAA,GAAA,QACN,MAAA,IAGF,GAAA,QAAA,QAAA,GAAA,4WCrFe,GAAA,QAEf,yBAAsB,WAAlB,GAAO,KAAyB,GAClC,IAAM,GAAA,QAAiB,GAAA,QACvB,MAAA,ICNF,ODSC,GAAA,QAAD,QAA4B,GAAA,QCV5B,GAAA,GAAA;A9ECA","file":"interact.min.js","sourceRoot":"","sourcesContent":["/**\n * interact.js 1.9.19\n *\n * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>\n * Released under the MIT License.\n * https://raw.github.com/taye/interact.js/master/LICENSE\n */\n","export default (thing: any) => !!(thing && thing.Window) && (thing instanceof thing.Window)\n","import isWindow from './isWindow'\n\nconst win = {\n realWindow: undefined as Window,\n window: undefined as Window,\n getWindow,\n init,\n}\n\nexport function init (window: Window & { wrap?: (...args: any[]) => any }) {\n // get wrapped window if using Shadow DOM polyfill\n\n win.realWindow = window\n\n // create a TextNode\n const el = window.document.createTextNode('')\n\n // check if it's wrapped by a polyfill\n if (el.ownerDocument !== window.document &&\n typeof window.wrap === 'function' &&\n window.wrap(el) === el) {\n // use wrapped window\n window = window.wrap(window)\n }\n\n win.window = window\n}\n\nif (typeof window === 'undefined') {\n win.window = undefined\n win.realWindow = undefined\n}\nelse {\n init(window)\n}\n\nexport function getWindow (node: any) {\n if (isWindow(node)) {\n return node\n }\n\n const rootNode = (node.ownerDocument || node)\n\n return rootNode.defaultView || win.window\n}\n\nwin.init = init\n\nexport default win\n","import * as Interact from '@interactjs/types/index'\n\nimport isWindow from './isWindow'\nimport win from './window'\n\nconst window = (thing: any): thing is Window =>\n thing === win.window || isWindow(thing)\n\nconst docFrag = (thing: any): thing is DocumentFragment =>\n object(thing) && thing.nodeType === 11\n\nconst object = (thing: any): thing is { [index: string]: any } =>\n !!thing && (typeof thing === 'object')\n\nconst func = (thing: any): thing is (...args: any[]) => any =>\n typeof thing === 'function'\n\nconst number = (thing: any): thing is number =>\n typeof thing === 'number'\n\nconst bool = (thing: any): thing is boolean =>\n typeof thing === 'boolean'\n\nconst string = (thing: any): thing is string =>\n typeof thing === 'string'\n\nconst element = (thing: any): thing is Interact.Element => {\n if (!thing || (typeof thing !== 'object')) { return false }\n\n // eslint-disable-next-line import/no-named-as-default-member\n const _window = win.getWindow(thing) || win.window\n\n return (/object|function/.test(typeof _window.Element)\n ? thing instanceof _window.Element // DOM2\n : thing.nodeType === 1 && typeof thing.nodeName === 'string')\n}\n\nconst plainObject: typeof object = (thing: any): thing is { [index: string]: any } =>\n object(thing) &&\n !!thing.constructor &&\n /function Object\\b/.test(thing.constructor.toString())\n\nconst array = <T extends unknown>(thing: any): thing is T[] =>\n (object(thing) &&\n (typeof thing.length !== 'undefined') &&\n func(thing.splice))\n\nexport default {\n window,\n docFrag,\n object,\n func,\n number,\n bool,\n string,\n element,\n plainObject,\n array,\n}\n","import { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n draggable: DraggableMethod\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n drag: Interact.DraggableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n drag?: typeof drag\n }\n}\n\nexport type DragEvent = Interact.InteractEvent<'drag'>\n\nexport type DraggableMethod = Interact.ActionMethod<Interact.DraggableOptions>\n\nfunction install (scope: Scope) {\n const {\n actions,\n Interactable,\n defaults,\n } = scope\n\n Interactable.prototype.draggable = drag.draggable\n\n actions.map.drag = drag\n actions.methodDict.drag = 'draggable'\n\n defaults.actions.drag = drag.defaults\n}\n\nfunction beforeMove ({ interaction }) {\n if (interaction.prepared.name !== 'drag') { return }\n\n const axis = interaction.prepared.axis\n\n if (axis === 'x') {\n interaction.coords.cur.page.y = interaction.coords.start.page.y\n interaction.coords.cur.client.y = interaction.coords.start.client.y\n\n interaction.coords.velocity.client.y = 0\n interaction.coords.velocity.page.y = 0\n }\n else if (axis === 'y') {\n interaction.coords.cur.page.x = interaction.coords.start.page.x\n interaction.coords.cur.client.x = interaction.coords.start.client.x\n\n interaction.coords.velocity.client.x = 0\n interaction.coords.velocity.page.x = 0\n }\n}\n\nfunction move ({ iEvent, interaction }) {\n if (interaction.prepared.name !== 'drag') { return }\n\n const axis = interaction.prepared.axis\n\n if (axis === 'x' || axis === 'y') {\n const opposite = axis === 'x' ? 'y' : 'x'\n\n iEvent.page[opposite] = interaction.coords.start.page[opposite]\n iEvent.client[opposite] = interaction.coords.start.client[opposite]\n iEvent.delta[opposite] = 0\n }\n}\n\n/**\n * ```js\n * interact(element).draggable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // the axis in which the first movement must be\n * // for the drag sequence to start\n * // 'xy' by default - any direction\n * startAxis: 'x' || 'y' || 'xy',\n *\n * // 'xy' by default - don't restrict to one axis (move in any direction)\n * // 'x' or 'y' to restrict movement to either axis\n * // 'start' to restrict movement to the axis the drag started in\n * lockAxis: 'x' || 'y' || 'xy' || 'start',\n *\n * // max number of drags that can happen concurrently\n * // with elements of this Interactable. Infinity by default\n * max: Infinity,\n *\n * // max number of drags that can target the same element+Interactable\n * // 1 by default\n * maxPerElement: 2\n * })\n *\n * var isDraggable = interact('element').draggable(); // true\n * ```\n *\n * Get or set whether drag actions can be performed on the target\n *\n * @alias Interactable.prototype.draggable\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on drag events (object makes the Interactable\n * draggable)\n * @return {boolean | Interactable} boolean indicating if this can be the\n * target of drag events, or this Interctable\n */\nconst draggable: DraggableMethod = function draggable (this: Interact.Interactable, options?: Interact.DraggableOptions | boolean): any {\n if (is.object(options)) {\n this.options.drag.enabled = options.enabled !== false\n this.setPerAction('drag', options)\n this.setOnEvents('drag', options)\n\n if (/^(xy|x|y|start)$/.test(options.lockAxis)) {\n this.options.drag.lockAxis = options.lockAxis\n }\n if (/^(xy|x|y)$/.test(options.startAxis)) {\n this.options.drag.startAxis = options.startAxis\n }\n\n return this\n }\n\n if (is.bool(options)) {\n this.options.drag.enabled = options\n\n return this\n }\n\n return this.options.drag\n}\n\nconst drag: Interact.Plugin = {\n id: 'actions/drag',\n install,\n listeners: {\n 'interactions:before-action-move': beforeMove,\n 'interactions:action-resume': beforeMove,\n\n // dragmove\n 'interactions:action-move': move,\n 'auto-start:check': arg => {\n const { interaction, interactable, buttons } = arg\n const dragOptions = interactable.options.drag\n\n if (\n !(dragOptions && dragOptions.enabled) ||\n // check mouseButton setting if the pointer is down\n (interaction.pointerIsDown &&\n /mouse|pointer/.test(interaction.pointerType) &&\n (buttons & interactable.options.drag.mouseButtons) === 0)\n ) {\n return undefined\n }\n\n arg.action = {\n name: 'drag',\n axis: (dragOptions.lockAxis === 'start'\n ? dragOptions.startAxis\n : dragOptions.lockAxis),\n }\n\n return false\n },\n },\n draggable,\n beforeMove,\n move,\n defaults: {\n startAxis : 'xy',\n lockAxis : 'xy',\n } as Interact.DropzoneOptions,\n\n getCursor () {\n return 'move'\n },\n}\n\nexport default drag\n","const domObjects: {\n init: any\n document: Document\n DocumentFragment: typeof DocumentFragment\n SVGElement: typeof SVGElement\n SVGSVGElement: typeof SVGSVGElement\n SVGElementInstance: any\n Element: typeof Element\n HTMLElement: typeof HTMLElement\n Event: typeof Event\n Touch: typeof Touch\n PointerEvent: typeof PointerEvent\n} =\n{\n init,\n document: null,\n DocumentFragment: null,\n SVGElement: null,\n SVGSVGElement: null,\n SVGElementInstance: null,\n Element: null,\n HTMLElement: null,\n Event: null,\n Touch: null,\n PointerEvent: null,\n}\n\nfunction blank () {}\n\nexport default domObjects\n\nfunction init (window: Window) {\n const win = window as any\n\n domObjects.document = win.document\n domObjects.DocumentFragment = win.DocumentFragment || blank\n domObjects.SVGElement = win.SVGElement || blank\n domObjects.SVGSVGElement = win.SVGSVGElement || blank\n domObjects.SVGElementInstance = win.SVGElementInstance || blank\n domObjects.Element = win.Element || blank\n domObjects.HTMLElement = win.HTMLElement || domObjects.Element\n\n domObjects.Event = win.Event\n domObjects.Touch = win.Touch || blank\n domObjects.PointerEvent = (win.PointerEvent || win.MSPointerEvent)\n}\n","import domObjects from './domObjects'\nimport is from './is'\nimport win from './window'\n\nconst browser = {\n init,\n supportsTouch: null as boolean,\n supportsPointerEvent: null as boolean,\n isIOS7: null as boolean,\n isIOS: null as boolean,\n isIe9: null as boolean,\n isOperaMobile: null as boolean,\n prefixedMatchesSelector: null as string,\n pEventTypes: null as {\n up: string\n down: string\n over: string\n out: string\n move: string\n cancel: string\n },\n wheelEvent: null as string,\n}\n\nfunction init (window: any) {\n const Element = domObjects.Element\n const navigator = win.window.navigator\n\n // Does the browser support touch input?\n browser.supportsTouch = ('ontouchstart' in window) ||\n (is.func(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch)\n\n // Does the browser support PointerEvents\n browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!domObjects.PointerEvent\n\n browser.isIOS = (/iP(hone|od|ad)/.test(navigator.platform))\n\n // scrolling doesn't change the result of getClientRects on iOS 7\n browser.isIOS7 = (/iP(hone|od|ad)/.test(navigator.platform) &&\n /OS 7[^\\d]/.test(navigator.appVersion))\n\n browser.isIe9 = /MSIE 9/.test(navigator.userAgent)\n\n // Opera Mobile must be handled differently\n browser.isOperaMobile = (navigator.appName === 'Opera' &&\n browser.supportsTouch &&\n /Presto/.test(navigator.userAgent))\n\n // prefix matchesSelector\n browser.prefixedMatchesSelector = 'matches' in Element.prototype\n ? 'matches'\n : 'webkitMatchesSelector' in Element.prototype\n ? 'webkitMatchesSelector'\n : 'mozMatchesSelector' in Element.prototype\n ? 'mozMatchesSelector'\n : 'oMatchesSelector' in Element.prototype\n ? 'oMatchesSelector'\n : 'msMatchesSelector'\n\n browser.pEventTypes = (browser.supportsPointerEvent\n ? (domObjects.PointerEvent === window.MSPointerEvent\n ? {\n up: 'MSPointerUp',\n down: 'MSPointerDown',\n over: 'mouseover',\n out: 'mouseout',\n move: 'MSPointerMove',\n cancel: 'MSPointerCancel',\n }\n : {\n up: 'pointerup',\n down: 'pointerdown',\n over: 'pointerover',\n out: 'pointerout',\n move: 'pointermove',\n cancel: 'pointercancel',\n })\n : null)\n\n // because Webkit and Opera still use 'mousewheel' event type\n browser.wheelEvent = 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel'\n}\n\nexport default browser\n","import * as Interact from '@interactjs/types/index'\n\nimport browser from './browser'\nimport domObjects from './domObjects'\nimport is from './is'\nimport win, { getWindow } from './window'\n\nexport function nodeContains (parent: Node | Interact.EventTarget, child: Node | Interact.EventTarget) {\n while (child) {\n if (child === parent) {\n return true\n }\n\n child = (child as Node).parentNode\n }\n\n return false\n}\n\nexport function closest (element: Node, selector: string) {\n while (is.element(element)) {\n if (matchesSelector(element, selector)) { return element }\n\n element = parentNode(element)\n }\n\n return null\n}\n\nexport function parentNode (node: Node | Document) {\n let parent = node.parentNode\n\n if (is.docFrag(parent)) {\n // skip past #shado-root fragments\n // tslint:disable-next-line\n while ((parent = (parent as any).host) && is.docFrag(parent)) {\n continue\n }\n\n return parent\n }\n\n return parent\n}\n\nexport function matchesSelector (element: Interact.Element, selector: string) {\n // remove /deep/ from selectors if shadowDOM polyfill is used\n if (win.window !== win.realWindow) {\n selector = selector.replace(/\\/deep\\//g, ' ')\n }\n\n return element[browser.prefixedMatchesSelector](selector)\n}\n\nconst getParent = (el: Node | Document | ShadowRoot) => el.parentNode || (el as ShadowRoot).host\n\n// Test for the element that's \"above\" all other qualifiers\nexport function indexOfDeepestElement (elements: Interact.Element[] | NodeListOf<Element>) {\n let deepestNodeParents: Node[] = []\n let deepestNodeIndex: number\n\n for (let i = 0; i < elements.length; i++) {\n const currentNode = elements[i]\n const deepestNode: Node = elements[deepestNodeIndex]\n\n // node may appear in elements array multiple times\n if (!currentNode || i === deepestNodeIndex) {\n continue\n }\n\n if (!deepestNode) {\n deepestNodeIndex = i\n continue\n }\n\n const currentNodeParent = getParent(currentNode)\n const deepestNodeParent = getParent(deepestNode)\n\n // check if the deepest or current are document.documentElement/rootElement\n // - if the current node is, do nothing and continue\n if (currentNodeParent === currentNode.ownerDocument) {\n continue\n }\n // - if deepest is, update with the current node and continue to next\n else if (deepestNodeParent === currentNode.ownerDocument) {\n deepestNodeIndex = i\n continue\n }\n\n // compare zIndex of siblings\n if (currentNodeParent === deepestNodeParent) {\n if (zIndexIsHigherThan(currentNode, deepestNode)) {\n deepestNodeIndex = i\n }\n\n continue\n }\n\n // populate the ancestry array for the latest deepest node\n deepestNodeParents = deepestNodeParents.length ? deepestNodeParents : getNodeParents(deepestNode)\n\n let ancestryStart: Node\n\n // if the deepest node is an HTMLElement and the current node is a non root svg element\n if (deepestNode instanceof domObjects.HTMLElement &&\n currentNode instanceof domObjects.SVGElement &&\n !(currentNode instanceof domObjects.SVGSVGElement)\n ) {\n // TODO: is this check necessary? Was this for HTML elements embedded in SVG?\n if (currentNode === deepestNodeParent) {\n continue\n }\n\n ancestryStart = currentNode.ownerSVGElement\n }\n else {\n ancestryStart = currentNode\n }\n\n const currentNodeParents = getNodeParents(ancestryStart, deepestNode.ownerDocument)\n let commonIndex = 0\n\n // get (position of closest common ancestor) + 1\n while (currentNodeParents[commonIndex] && currentNodeParents[commonIndex] === deepestNodeParents[commonIndex]) {\n commonIndex++\n }\n\n const parents = [\n currentNodeParents[commonIndex - 1],\n currentNodeParents[commonIndex],\n deepestNodeParents[commonIndex],\n ]\n\n let child = parents[0].lastChild\n\n while (child) {\n if (child === parents[1]) {\n deepestNodeIndex = i\n deepestNodeParents = currentNodeParents\n\n break\n }\n else if (child === parents[2]) {\n break\n }\n\n child = child.previousSibling\n }\n }\n\n return deepestNodeIndex\n}\n\nfunction getNodeParents (node: Node, limit?: Node) {\n const parents: Node[] = []\n let parent: Node = node\n let parentParent: Node\n\n while ((parentParent = getParent(parent)) && parent !== limit && parentParent !== parent.ownerDocument) {\n parents.unshift(parent)\n parent = parentParent\n }\n\n return parents\n}\n\nfunction zIndexIsHigherThan (higherNode: Node, lowerNode: Node) {\n const higherIndex = parseInt(getWindow(higherNode).getComputedStyle(higherNode).zIndex, 10) || 0\n const lowerIndex = parseInt(getWindow(lowerNode).getComputedStyle(lowerNode).zIndex, 10) || 0\n\n return higherIndex >= lowerIndex\n}\n\nexport function matchesUpTo (element: Interact.Element, selector: string, limit: Node) {\n while (is.element(element)) {\n if (matchesSelector(element, selector)) {\n return true\n }\n\n element = parentNode(element) as Interact.Element\n\n if (element === limit) {\n return matchesSelector(element, selector)\n }\n }\n\n return false\n}\n\nexport function getActualElement (element: Interact.Element) {\n return (element instanceof domObjects.SVGElementInstance\n ? (element as SVGElement).correspondingUseElement\n : element)\n}\n\nexport function getScrollXY (relevantWindow) {\n relevantWindow = relevantWindow || win.window\n return {\n x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,\n y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop,\n }\n}\n\nexport function getElementClientRect (element: Interact.Element) {\n const clientRect = (element instanceof domObjects.SVGElement\n ? element.getBoundingClientRect()\n : element.getClientRects()[0])\n\n return clientRect && {\n left : clientRect.left,\n right : clientRect.right,\n top : clientRect.top,\n bottom: clientRect.bottom,\n width : clientRect.width || clientRect.right - clientRect.left,\n height: clientRect.height || clientRect.bottom - clientRect.top,\n }\n}\n\nexport function getElementRect (element: Interact.Element) {\n const clientRect = getElementClientRect(element)\n\n if (!browser.isIOS7 && clientRect) {\n const scroll = getScrollXY(win.getWindow(element))\n\n clientRect.left += scroll.x\n clientRect.right += scroll.x\n clientRect.top += scroll.y\n clientRect.bottom += scroll.y\n }\n\n return clientRect\n}\n\nexport function getPath (node: Node | Document) {\n const path = []\n\n while (node) {\n path.push(node)\n node = parentNode(node)\n }\n\n return path\n}\n\nexport function trySelector (value: Interact.Target) {\n if (!is.string(value)) { return false }\n\n // an exception will be raised if it is invalid\n domObjects.document.querySelector(value)\n return true\n}\n","export default function extend<T, U extends object> (dest: U & Partial<T>, source: T): T & U {\n for (const prop in source) {\n (dest as unknown as T)[prop] = source[prop]\n }\n\n const ret = dest as T & U\n\n return ret\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport { closest, getElementRect, parentNode } from './domUtils'\nimport extend from './extend'\nimport is from './is'\n\nexport function getStringOptionResult (value: any, target: Interact.HasGetRect, element) {\n if (value === 'parent') { return parentNode(element) }\n\n if (value === 'self') { return target.getRect(element) }\n\n return closest(element, value)\n}\n\nexport function resolveRectLike<T extends any[]> (\n value: Interact.RectResolvable<T>,\n target?: Interact.HasGetRect,\n element?: Node,\n functionArgs?: T,\n) {\n let returnValue: any = value\n if (is.string(returnValue)) {\n returnValue = getStringOptionResult(returnValue, target, element)\n }\n else if (is.func(returnValue)) {\n returnValue = returnValue(...functionArgs)\n }\n\n if (is.element(returnValue)) {\n returnValue = getElementRect(returnValue)\n }\n\n return returnValue as Interact.Rect\n}\n\nexport function rectToXY (rect) {\n return rect && {\n x: 'x' in rect ? rect.x : rect.left,\n y: 'y' in rect ? rect.y : rect.top,\n }\n}\n\nexport function xywhToTlbr (rect) {\n if (rect && !('left' in rect && 'top' in rect)) {\n rect = extend({}, rect)\n\n rect.left = rect.x || 0\n rect.top = rect.y || 0\n rect.right = rect.right || (rect.left + rect.width)\n rect.bottom = rect.bottom || (rect.top + rect.height)\n }\n\n return rect\n}\n\nexport function tlbrToXywh (rect) {\n if (rect && !('x' in rect && 'y' in rect)) {\n rect = extend({}, rect)\n\n rect.x = rect.left || 0\n rect.y = rect.top || 0\n rect.width = rect.width || ((rect.right || 0) - rect.x)\n rect.height = rect.height || ((rect.bottom || 0) - rect.y)\n }\n\n return rect\n}\n\nexport function addEdges (edges: Interact.EdgeOptions, rect: Interact.Rect, delta: Interact.Point) {\n if (edges.left) { rect.left += delta.x }\n if (edges.right) { rect.right += delta.x }\n if (edges.top) { rect.top += delta.y }\n if (edges.bottom) { rect.bottom += delta.y }\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport { rectToXY, resolveRectLike } from './rect'\n\nexport default function (\n target: Interact.HasGetRect & { options: Interact.PerActionDefaults },\n element: Node,\n actionName?: Interact.ActionName,\n) {\n const actionOptions = (target.options as any)[actionName]\n const actionOrigin = actionOptions && actionOptions.origin\n const origin = actionOrigin || target.options.origin\n\n const originRect = resolveRectLike(origin, target, element, [target && element])\n\n return rectToXY(originRect) || { x: 0, y: 0 }\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport extend from './extend'\nimport is from './is'\n\nexport interface NormalizedListeners {\n [type: string]: Interact.Listener[]\n}\n\nexport default function normalize (\n type: Interact.EventTypes,\n listeners?: Interact.ListenersArg | Interact.ListenersArg[],\n result?: NormalizedListeners,\n): NormalizedListeners {\n result = result || {}\n\n if (is.string(type) && type.search(' ') !== -1) {\n type = split(type)\n }\n\n if (is.array(type)) {\n return type.reduce<NormalizedListeners>(\n (acc, t) => extend(acc, normalize(t, listeners, result)),\n result,\n )\n }\n\n // ({ type: fn }) -> ('', { type: fn })\n if (is.object(type)) {\n listeners = type\n type = ''\n }\n\n if (is.func(listeners)) {\n result[type] = result[type] || []\n result[type].push(listeners)\n }\n else if (is.array(listeners)) {\n for (const l of listeners) {\n normalize(type, l, result)\n }\n }\n else if (is.object(listeners)) {\n for (const prefix in listeners) {\n const combinedTypes = split(prefix).map(p => `${type}${p}`)\n\n normalize(combinedTypes, listeners[prefix], result)\n }\n }\n\n return result as NormalizedListeners\n}\n\nfunction split (type: string) {\n return type.trim().split(/ +/)\n}\n","export default (x: number, y: number) => Math.sqrt(x * x + y * y)\n","export interface PointerExtend {\n webkit: RegExp\n [prefix: string]: RegExp\n}\n\nfunction pointerExtend (dest, source) {\n for (const prop in source) {\n const prefixedPropREs = pointerExtend.prefixedPropREs\n let deprecated = false\n\n // skip deprecated prefixed properties\n for (const vendor in prefixedPropREs) {\n if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {\n deprecated = true\n break\n }\n }\n\n if (!deprecated && typeof source[prop] !== 'function') {\n dest[prop] = source[prop]\n }\n }\n return dest\n}\n\npointerExtend.prefixedPropREs = {\n webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,\n moz: /(Pressure)$/,\n}\n\nexport default pointerExtend\n","import * as Interact from '@interactjs/types/index'\n\nimport browser from './browser'\nimport dom from './domObjects'\nimport * as domUtils from './domUtils'\nimport hypot from './hypot'\nimport is from './is'\nimport pointerExtend from './pointerExtend'\n\nexport function copyCoords (dest: Interact.CoordsSetMember, src: Interact.CoordsSetMember) {\n dest.page = dest.page || {} as any\n dest.page.x = src.page.x\n dest.page.y = src.page.y\n\n dest.client = dest.client || {} as any\n dest.client.x = src.client.x\n dest.client.y = src.client.y\n\n dest.timeStamp = src.timeStamp\n}\n\nexport function setCoordDeltas (targetObj: Interact.CoordsSetMember, prev: Interact.CoordsSetMember, cur: Interact.CoordsSetMember) {\n targetObj.page.x = cur.page.x - prev.page.x\n targetObj.page.y = cur.page.y - prev.page.y\n targetObj.client.x = cur.client.x - prev.client.x\n targetObj.client.y = cur.client.y - prev.client.y\n targetObj.timeStamp = cur.timeStamp - prev.timeStamp\n}\n\nexport function setCoordVelocity (targetObj: Interact.CoordsSetMember, delta: Interact.CoordsSetMember) {\n const dt = Math.max(delta.timeStamp / 1000, 0.001)\n\n targetObj.page.x = delta.page.x / dt\n targetObj.page.y = delta.page.y / dt\n targetObj.client.x = delta.client.x / dt\n targetObj.client.y = delta.client.y / dt\n targetObj.timeStamp = dt\n}\n\nexport function setZeroCoords (targetObj: Interact.CoordsSetMember) {\n targetObj.page.x = 0\n targetObj.page.y = 0\n targetObj.client.x = 0\n targetObj.client.y = 0\n}\n\nexport function isNativePointer (pointer: any) {\n return (pointer instanceof dom.Event || pointer instanceof dom.Touch)\n}\n\n// Get specified X/Y coords for mouse or event.touches[0]\nexport function getXY (type, pointer, xy) {\n xy = xy || {}\n type = type || 'page'\n\n xy.x = pointer[type + 'X']\n xy.y = pointer[type + 'Y']\n\n return xy\n}\n\nexport function getPageXY (pointer: Interact.PointerType | Interact.InteractEvent, page?: Interact.Point) {\n page = page || { x: 0, y: 0 }\n\n // Opera Mobile handles the viewport and scrolling oddly\n if (browser.isOperaMobile && isNativePointer(pointer)) {\n getXY('screen', pointer, page)\n\n page.x += window.scrollX\n page.y += window.scrollY\n }\n else {\n getXY('page', pointer, page)\n }\n\n return page\n}\n\nexport function getClientXY (pointer, client) {\n client = client || {}\n\n if (browser.isOperaMobile && isNativePointer(pointer)) {\n // Opera Mobile handles the viewport and scrolling oddly\n getXY('screen', pointer, client)\n }\n else {\n getXY('client', pointer, client)\n }\n\n return client\n}\n\nexport function getPointerId (pointer) {\n return is.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier\n}\n\nexport function setCoords (targetObj, pointers: any[], timeStamp: number) {\n const pointer = (pointers.length > 1\n ? pointerAverage(pointers)\n : pointers[0])\n\n const tmpXY = {} as { x: number, y: number }\n\n getPageXY(pointer, tmpXY)\n targetObj.page.x = tmpXY.x\n targetObj.page.y = tmpXY.y\n\n getClientXY(pointer, tmpXY)\n targetObj.client.x = tmpXY.x\n targetObj.client.y = tmpXY.y\n\n targetObj.timeStamp = timeStamp\n}\n\nexport function getTouchPair (event) {\n const touches = []\n\n // array of touches is supplied\n if (is.array(event)) {\n touches[0] = event[0]\n touches[1] = event[1]\n }\n // an event\n else {\n if (event.type === 'touchend') {\n if (event.touches.length === 1) {\n touches[0] = event.touches[0]\n touches[1] = event.changedTouches[0]\n }\n else if (event.touches.length === 0) {\n touches[0] = event.changedTouches[0]\n touches[1] = event.changedTouches[1]\n }\n }\n else {\n touches[0] = event.touches[0]\n touches[1] = event.touches[1]\n }\n }\n\n return touches\n}\n\nexport function pointerAverage (pointers: PointerEvent[] | Event[]) {\n const average = {\n pageX : 0,\n pageY : 0,\n clientX: 0,\n clientY: 0,\n screenX: 0,\n screenY: 0,\n }\n\n for (const pointer of pointers) {\n for (const prop in average) {\n average[prop] += pointer[prop]\n }\n }\n for (const prop in average) {\n average[prop] /= pointers.length\n }\n\n return average\n}\n\nexport function touchBBox (event: Event | Array<(Interact.PointerType) | TouchEvent>) {\n if (!(event as any).length &&\n !((event as TouchEvent).touches &&\n (event as TouchEvent).touches.length > 1)) {\n return null\n }\n\n const touches = getTouchPair(event)\n const minX = Math.min(touches[0].pageX, touches[1].pageX)\n const minY = Math.min(touches[0].pageY, touches[1].pageY)\n const maxX = Math.max(touches[0].pageX, touches[1].pageX)\n const maxY = Math.max(touches[0].pageY, touches[1].pageY)\n\n return {\n x: minX,\n y: minY,\n left: minX,\n top: minY,\n right: maxX,\n bottom: maxY,\n width: maxX - minX,\n height: maxY - minY,\n }\n}\n\nexport function touchDistance (event, deltaSource) {\n const sourceX = deltaSource + 'X'\n const sourceY = deltaSource + 'Y'\n const touches = getTouchPair(event)\n\n const dx = touches[0][sourceX] - touches[1][sourceX]\n const dy = touches[0][sourceY] - touches[1][sourceY]\n\n return hypot(dx, dy)\n}\n\nexport function touchAngle (event, deltaSource) {\n const sourceX = deltaSource + 'X'\n const sourceY = deltaSource + 'Y'\n const touches = getTouchPair(event)\n const dx = touches[1][sourceX] - touches[0][sourceX]\n const dy = touches[1][sourceY] - touches[0][sourceY]\n const angle = 180 * Math.atan2(dy, dx) / Math.PI\n\n return angle\n}\n\nexport function getPointerType (pointer) {\n return is.string(pointer.pointerType)\n ? pointer.pointerType\n : is.number(pointer.pointerType)\n ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType]\n // if the PointerEvent API isn't available, then the \"pointer\" must\n // be either a MouseEvent, TouchEvent, or Touch object\n : /touch/.test(pointer.type) || pointer instanceof dom.Touch\n ? 'touch'\n : 'mouse'\n}\n\n// [ event.target, event.currentTarget ]\nexport function getEventTargets (event) {\n const path = is.func(event.composedPath) ? event.composedPath() : event.path\n\n return [\n domUtils.getActualElement(path ? path[0] : event.target),\n domUtils.getActualElement(event.currentTarget),\n ]\n}\n\nexport function newCoords (): Interact.CoordsSetMember {\n return {\n page : { x: 0, y: 0 },\n client : { x: 0, y: 0 },\n timeStamp: 0,\n }\n}\n\nexport function coordsToEvent (coords: MockCoords) {\n const event = {\n coords,\n get page () { return this.coords.page },\n get client () { return this.coords.client },\n get timeStamp () { return this.coords.timeStamp },\n get pageX () { return this.coords.page.x },\n get pageY () { return this.coords.page.y },\n get clientX () { return this.coords.client.x },\n get clientY () { return this.coords.client.y },\n get pointerId () { return this.coords.pointerId },\n get target () { return this.coords.target },\n get type () { return this.coords.type },\n get pointerType () { return this.coords.pointerType },\n get buttons () { return this.coords.buttons },\n preventDefault () {},\n }\n\n return event as typeof event & Interact.PointerType & Interact.PointerEventType\n}\n\nexport interface MockCoords {\n page: Interact.Point\n client: Interact.Point\n timeStamp?: number\n pointerId?: any\n target?: any\n type?: string\n pointerType?: string\n buttons?: number\n}\n\nexport { pointerExtend }\n","import * as Interact from '@interactjs/types/index'\n\nexport class BaseEvent<T extends Interact.ActionName = any> {\n type: string\n target: EventTarget\n currentTarget: EventTarget\n interactable: Interact.Interactable\n _interaction: Interact.Interaction<T>\n timeStamp: any\n immediatePropagationStopped = false\n propagationStopped = false\n\n constructor (interaction: Interact.Interaction) {\n this._interaction = interaction\n }\n\n preventDefault () {}\n\n /**\n * Don't call any other listeners (even on the current target)\n */\n stopPropagation () {\n this.propagationStopped = true\n }\n\n /**\n * Don't call listeners on the remaining targets\n */\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n}\n\n// defined outside of class definition to avoid assignment of undefined during\n// construction\nexport interface BaseEvent<T extends Interact.ActionName = any> {\n interaction: Interact.InteractionProxy<T>\n}\n\n// getters and setters defined here to support typescript 3.6 and below which\n// don't support getter and setters in .d.ts files\nObject.defineProperty(BaseEvent.prototype, 'interaction', {\n get (this: BaseEvent) { return this._interaction._proxy },\n set (this: BaseEvent) {},\n})\n\nexport default BaseEvent\n","type Filter<T> = (element: T, index: number, array: T[]) => boolean\n\nexport const contains = <T>(array: T[], target: T) => array.indexOf(target) !== -1\n\nexport const remove = <T>(array: T[], target: T) => array.splice(array.indexOf(target), 1)\n\nexport const merge = <T, U>(target: Array<T | U>, source: U[]) => {\n for (const item of source) {\n target.push(item)\n }\n\n return target\n}\n\nexport const from = <T = any>(source: ArrayLike<T>) => merge([] as T[], source as T[])\n\nexport const findIndex = <T>(array: T[], func: Filter<T>) => {\n for (let i = 0; i < array.length; i++) {\n if (func(array[i], i, array)) {\n return i\n }\n }\n\n return -1\n}\n\nexport const find = <T = any>(array: T[], func: Filter<T>) => array[findIndex(array, func)]\n","import { BaseEvent } from '@interactjs/core/BaseEvent'\nimport { InteractEvent } from '@interactjs/core/InteractEvent'\nimport { Interactable } from '@interactjs/core/Interactable'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\n\nexport class DropEvent extends BaseEvent {\n target: Interact.Element\n dropzone: Interactable\n dragEvent: InteractEvent<'drag'>\n relatedTarget: Interact.Element\n draggable: Interactable\n timeStamp: number\n propagationStopped = false\n immediatePropagationStopped = false\n\n /**\n * Class of events fired on dropzones during drags with acceptable targets.\n */\n constructor (dropState: import('./plugin').DropState, dragEvent: InteractEvent<'drag'>, type: string) {\n super(dragEvent._interaction)\n\n const { element, dropzone } = type === 'dragleave'\n ? dropState.prev\n : dropState.cur\n\n this.type = type\n this.target = element\n this.currentTarget = element\n this.dropzone = dropzone\n this.dragEvent = dragEvent\n this.relatedTarget = dragEvent.target\n this.draggable = dragEvent.interactable\n this.timeStamp = dragEvent.timeStamp\n }\n\n /**\n * If this is a `dropactivate` event, the dropzone element will be\n * deactivated.\n *\n * If this is a `dragmove` or `dragenter`, a `dragleave` will be fired on the\n * dropzone element and more.\n */\n reject () {\n const { dropState } = this._interaction\n\n if (\n (this.type !== 'dropactivate') && (\n !this.dropzone ||\n dropState.cur.dropzone !== this.dropzone ||\n dropState.cur.element !== this.target)) {\n return\n }\n\n dropState.prev.dropzone = this.dropzone\n dropState.prev.element = this.target\n\n dropState.rejected = true\n dropState.events.enter = null\n\n this.stopImmediatePropagation()\n\n if (this.type === 'dropactivate') {\n const activeDrops = dropState.activeDrops\n const index = arr.findIndex(activeDrops, ({ dropzone, element }) =>\n dropzone === this.dropzone && element === this.target)\n\n dropState.activeDrops.splice(index, 1)\n\n const deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate')\n\n deactivateEvent.dropzone = this.dropzone\n deactivateEvent.target = this.target\n\n this.dropzone.fire(deactivateEvent)\n }\n else {\n this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave'))\n }\n }\n\n preventDefault () {}\n\n stopPropagation () {\n this.propagationStopped = true\n }\n\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n}\n","import { InteractEvent } from '@interactjs/core/InteractEvent'\nimport { Interactable } from '@interactjs/core/Interactable'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport is from '@interactjs/utils/is'\nimport normalizeListeners from '@interactjs/utils/normalizeListeners'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport drag from '../drag/plugin'\n\nimport { DropEvent } from './DropEvent'\n\nexport interface DropzoneMethod {\n (options: Interact.DropzoneOptions | boolean): Interact.Interactable\n (): Interact.DropzoneOptions\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n dropzone: DropzoneMethod\n dropCheck: (\n dragEvent: InteractEvent,\n event: Interact.PointerEventType,\n draggable: Interactable,\n draggableElement: Interact.Element,\n dropElemen: Interact.Element,\n rect: any\n ) => boolean\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n dropState?: DropState\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n drop: Interact.DropzoneOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n drop?: typeof drop\n }\n\n interface Scope {\n dynamicDrop?: boolean\n }\n\n interface SignalArgs {\n 'actions/drop:start': DropSignalArg\n 'actions/drop:move': DropSignalArg\n 'actions/drop:end': DropSignalArg\n }\n}\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n dynamicDrop: (this: Interact.InteractStatic, newValue?: boolean) => boolean | this\n }\n}\n\ninterface DropSignalArg {\n interaction: Interact.Interaction\n dragEvent: Interact.DragEvent\n}\n\nexport interface ActiveDrop {\n dropzone: Interactable\n element: Interact.Element\n rect: Interact.Rect\n}\n\nexport interface DropState {\n cur: {\n dropzone: Interactable // the dropzone a drag target might be dropped into\n element: Interact.Element // the element at the time of checking\n }\n prev: {\n dropzone: Interactable // the dropzone that was recently dragged away from\n element: Interact.Element // the element at the time of checking\n }\n rejected: boolean // wheather the potential drop was rejected from a listener\n events: any // the drop events related to the current drag event\n activeDrops: ActiveDrop[]\n}\n\nfunction install (scope: Scope) {\n const {\n actions,\n /** @lends module:interact */\n interactStatic: interact,\n /** @lends Interactable */\n Interactable, // eslint-disable-line no-shadow\n defaults,\n } = scope\n\n scope.usePlugin(drag)\n\n /**\n *\n * ```js\n * interact('.drop').dropzone({\n * accept: '.can-drop' || document.getElementById('single-drop'),\n * overlap: 'pointer' || 'center' || zeroToOne\n * }\n * ```\n *\n * Returns or sets whether draggables can be dropped onto this target to\n * trigger drop events\n *\n * Dropzones can receive the following events:\n * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends\n * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone\n * - `dragmove` when a draggable that has entered the dropzone is moved\n * - `drop` when a draggable is dropped into this dropzone\n *\n * Use the `accept` option to allow only elements that match the given CSS\n * selector or element. The value can be:\n *\n * - **an Element** - only that element can be dropped into this dropzone.\n * - **a string**, - the element being dragged must match it as a CSS selector.\n * - **`null`** - accept options is cleared - it accepts any element.\n *\n * Use the `overlap` option to set how drops are checked for. The allowed\n * values are:\n *\n * - `'pointer'`, the pointer must be over the dropzone (default)\n * - `'center'`, the draggable element's center must be over the dropzone\n * - a number from 0-1 which is the `(intersection area) / (draggable area)`.\n * e.g. `0.5` for drop to happen when half of the area of the draggable is\n * over the dropzone\n *\n * Use the `checker` option to specify a function to check if a dragged element\n * is over this Interactable.\n *\n * @param {boolean | object | null} [options] The new options to be set.\n * @return {boolean | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.dropzone = function (this: Interact.Interactable, options?: Interact.DropzoneOptions | boolean) {\n return dropzoneMethod(this, options)\n }\n\n /**\n * ```js\n * interact(target)\n * .dropChecker(function(dragEvent, // related dragmove or dragend event\n * event, // TouchEvent/PointerEvent/MouseEvent\n * dropped, // bool result of the default checker\n * dropzone, // dropzone Interactable\n * dropElement, // dropzone elemnt\n * draggable, // draggable Interactable\n * draggableElement) {// draggable element\n *\n * return dropped && event.target.hasAttribute('allow-drop')\n * }\n * ```\n */\n Interactable.prototype.dropCheck = function (this: Interact.Interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) {\n return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect)\n }\n\n /**\n * Returns or sets whether the dimensions of dropzone elements are calculated\n * on every dragmove or only on dragstart for the default dropChecker\n *\n * @param {boolean} [newValue] True to check on each move. False to check only\n * before start\n * @return {boolean | interact} The current setting or interact\n */\n interact.dynamicDrop = function (newValue?: boolean) {\n if (is.bool(newValue)) {\n // if (dragging && scope.dynamicDrop !== newValue && !newValue) {\n // calcRects(dropzones)\n // }\n\n scope.dynamicDrop = newValue\n\n return interact\n }\n return scope.dynamicDrop\n }\n\n extend(actions.phaselessTypes, {\n dragenter: true,\n dragleave: true,\n dropactivate: true,\n dropdeactivate: true,\n dropmove: true,\n drop: true,\n })\n actions.methodDict.drop = 'dropzone'\n\n scope.dynamicDrop = false\n\n defaults.actions.drop = drop.defaults\n}\n\nfunction collectDrops ({ interactables }, draggableElement) {\n const drops = []\n\n // collect all dropzones and their elements which qualify for a drop\n for (const dropzone of interactables.list) {\n if (!dropzone.options.drop.enabled) { continue }\n\n const accept = dropzone.options.drop.accept\n\n // test the draggable draggableElement against the dropzone's accept setting\n if ((is.element(accept) && accept !== draggableElement) ||\n (is.string(accept) &&\n !domUtils.matchesSelector(draggableElement, accept)) ||\n (is.func(accept) && !accept({ dropzone, draggableElement }))) {\n continue\n }\n\n // query for new elements if necessary\n const dropElements = is.string(dropzone.target)\n ? dropzone._context.querySelectorAll(dropzone.target)\n : is.array(dropzone.target) ? dropzone.target : [dropzone.target]\n\n for (const dropzoneElement of dropElements) {\n if (dropzoneElement !== draggableElement) {\n drops.push({\n dropzone,\n element: dropzoneElement,\n })\n }\n }\n }\n\n return drops\n}\n\nfunction fireActivationEvents (activeDrops, event) {\n // loop through all active dropzones and trigger event\n for (const { dropzone, element } of activeDrops.slice()) {\n event.dropzone = dropzone\n\n // set current element as event target\n event.target = element\n dropzone.fire(event)\n event.propagationStopped = event.immediatePropagationStopped = false\n }\n}\n\n// return a new array of possible drops. getActiveDrops should always be\n// called when a drag has just started or a drag event happens while\n// dynamicDrop is true\nfunction getActiveDrops (scope: Scope, dragElement: Interact.Element) {\n // get dropzones and their elements that could receive the draggable\n const activeDrops = collectDrops(scope, dragElement)\n\n for (const activeDrop of activeDrops) {\n activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element)\n }\n\n return activeDrops\n}\n\nfunction getDrop ({ dropState, interactable: draggable, element: dragElement }: Partial<Interact.Interaction>, dragEvent, pointerEvent) {\n const validDrops = []\n\n // collect all dropzones and their elements which qualify for a drop\n for (const { dropzone, element: dropzoneElement, rect } of dropState.activeDrops) {\n validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, rect)\n ? dropzoneElement\n : null)\n }\n\n // get the most appropriate dropzone based on DOM depth and order\n const dropIndex = domUtils.indexOfDeepestElement(validDrops)\n\n return dropState.activeDrops[dropIndex] || null\n}\n\nfunction getDropEvents (interaction: Interact.Interaction, _pointerEvent, dragEvent) {\n const { dropState } = interaction\n const dropEvents = {\n enter : null,\n leave : null,\n activate : null,\n deactivate: null,\n move : null,\n drop : null,\n }\n\n if (dragEvent.type === 'dragstart') {\n dropEvents.activate = new DropEvent(dropState, dragEvent, 'dropactivate')\n\n dropEvents.activate.target = null\n dropEvents.activate.dropzone = null\n }\n if (dragEvent.type === 'dragend') {\n dropEvents.deactivate = new DropEvent(dropState, dragEvent, 'dropdeactivate')\n\n dropEvents.deactivate.target = null\n dropEvents.deactivate.dropzone = null\n }\n\n if (dropState.rejected) {\n return dropEvents\n }\n\n if (dropState.cur.element !== dropState.prev.element) {\n // if there was a previous dropzone, create a dragleave event\n if (dropState.prev.dropzone) {\n dropEvents.leave = new DropEvent(dropState, dragEvent, 'dragleave')\n\n dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element\n dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone\n }\n // if dropzone is not null, create a dragenter event\n if (dropState.cur.dropzone) {\n dropEvents.enter = new DropEvent(dropState, dragEvent, 'dragenter')\n\n dragEvent.dragEnter = dropState.cur.element\n dragEvent.dropzone = dropState.cur.dropzone\n }\n }\n\n if (dragEvent.type === 'dragend' && dropState.cur.dropzone) {\n dropEvents.drop = new DropEvent(dropState, dragEvent, 'drop')\n\n dragEvent.dropzone = dropState.cur.dropzone\n dragEvent.relatedTarget = dropState.cur.element\n }\n if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) {\n dropEvents.move = new DropEvent(dropState, dragEvent, 'dropmove')\n\n dropEvents.move.dragmove = dragEvent\n dragEvent.dropzone = dropState.cur.dropzone\n }\n\n return dropEvents\n}\n\nfunction fireDropEvents (interaction: Interact.Interaction, events) {\n const { dropState } = interaction\n const {\n activeDrops,\n cur,\n prev,\n } = dropState\n\n if (events.leave) { prev.dropzone.fire(events.leave) }\n if (events.move) { cur.dropzone.fire(events.move) }\n if (events.enter) { cur.dropzone.fire(events.enter) }\n if (events.drop) { cur.dropzone.fire(events.drop) }\n\n if (events.deactivate) {\n fireActivationEvents(activeDrops, events.deactivate)\n }\n\n dropState.prev.dropzone = cur.dropzone\n dropState.prev.element = cur.element\n}\n\nfunction onEventCreated ({ interaction, iEvent, event }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) {\n if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') { return }\n\n const { dropState } = interaction\n\n if (scope.dynamicDrop) {\n dropState.activeDrops = getActiveDrops(scope, interaction.element)\n }\n\n const dragEvent = iEvent\n const dropResult = getDrop(interaction, dragEvent, event)\n\n // update rejected status\n dropState.rejected = dropState.rejected &&\n !!dropResult &&\n dropResult.dropzone === dropState.cur.dropzone &&\n dropResult.element === dropState.cur.element\n\n dropState.cur.dropzone = dropResult && dropResult.dropzone\n dropState.cur.element = dropResult && dropResult.element\n\n dropState.events = getDropEvents(interaction, event, dragEvent)\n}\n\nfunction dropzoneMethod (interactable: Interact.Interactable): Interact.DropzoneOptions\nfunction dropzoneMethod (interactable: Interact.Interactable, options: Interact.DropzoneOptions | boolean)\nfunction dropzoneMethod (interactable: Interact.Interactable, options?: Interact.DropzoneOptions | boolean) {\n if (is.object(options)) {\n interactable.options.drop.enabled = options.enabled !== false\n\n if (options.listeners) {\n const normalized = normalizeListeners(options.listeners)\n // rename 'drop' to '' as it will be prefixed with 'drop'\n const corrected = Object.keys(normalized).reduce((acc, type) => {\n const correctedType = /^(enter|leave)/.test(type)\n ? `drag${type}`\n : /^(activate|deactivate|move)/.test(type)\n ? `drop${type}`\n : type\n\n acc[correctedType] = normalized[type]\n\n return acc\n }, {})\n\n interactable.off(interactable.options.drop.listeners)\n interactable.on(corrected)\n interactable.options.drop.listeners = corrected\n }\n\n if (is.func(options.ondrop)) { interactable.on('drop', options.ondrop) }\n if (is.func(options.ondropactivate)) { interactable.on('dropactivate', options.ondropactivate) }\n if (is.func(options.ondropdeactivate)) { interactable.on('dropdeactivate', options.ondropdeactivate) }\n if (is.func(options.ondragenter)) { interactable.on('dragenter', options.ondragenter) }\n if (is.func(options.ondragleave)) { interactable.on('dragleave', options.ondragleave) }\n if (is.func(options.ondropmove)) { interactable.on('dropmove', options.ondropmove) }\n\n if (/^(pointer|center)$/.test(options.overlap as string)) {\n interactable.options.drop.overlap = options.overlap\n }\n else if (is.number(options.overlap)) {\n interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0)\n }\n if ('accept' in options) {\n interactable.options.drop.accept = options.accept\n }\n if ('checker' in options) {\n interactable.options.drop.checker = options.checker\n }\n\n return interactable\n }\n\n if (is.bool(options)) {\n interactable.options.drop.enabled = options\n\n return interactable\n }\n\n return interactable.options.drop\n}\n\nfunction dropCheckMethod (\n interactable: Interact.Interactable,\n dragEvent: InteractEvent,\n event: Interact.PointerEventType,\n draggable: Interact.Interactable,\n draggableElement: Interact.Element,\n dropElement: Interact.Element,\n rect: any,\n) {\n let dropped = false\n\n // if the dropzone has no rect (eg. display: none)\n // call the custom dropChecker or just return false\n if (!(rect = rect || interactable.getRect(dropElement))) {\n return (interactable.options.drop.checker\n ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement)\n : false)\n }\n\n const dropOverlap = interactable.options.drop.overlap\n\n if (dropOverlap === 'pointer') {\n const origin = getOriginXY(draggable, draggableElement, 'drag')\n const page = pointerUtils.getPageXY(dragEvent)\n\n page.x += origin.x\n page.y += origin.y\n\n const horizontal = (page.x > rect.left) && (page.x < rect.right)\n const vertical = (page.y > rect.top) && (page.y < rect.bottom)\n\n dropped = horizontal && vertical\n }\n\n const dragRect = draggable.getRect(draggableElement)\n\n if (dragRect && dropOverlap === 'center') {\n const cx = dragRect.left + dragRect.width / 2\n const cy = dragRect.top + dragRect.height / 2\n\n dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom\n }\n\n if (dragRect && is.number(dropOverlap)) {\n const overlapArea = (Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) *\n Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top)))\n\n const overlapRatio = overlapArea / (dragRect.width * dragRect.height)\n\n dropped = overlapRatio >= dropOverlap\n }\n\n if (interactable.options.drop.checker) {\n dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement)\n }\n\n return dropped\n}\n\nconst drop: Interact.Plugin = {\n id: 'actions/drop',\n install,\n listeners: {\n 'interactions:before-action-start': ({ interaction }) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n interaction.dropState = {\n cur: {\n dropzone: null,\n element: null,\n },\n prev: {\n dropzone: null,\n element: null,\n },\n rejected: null,\n events: null,\n activeDrops: [],\n }\n },\n\n 'interactions:after-action-start': ({ interaction, event, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n const { dropState } = interaction\n\n // reset active dropzones\n dropState.activeDrops = null\n dropState.events = null\n dropState.activeDrops = getActiveDrops(scope, interaction.element)\n dropState.events = getDropEvents(interaction, event, dragEvent)\n\n if (dropState.events.activate) {\n fireActivationEvents(dropState.activeDrops, dropState.events.activate)\n scope.fire('actions/drop:start', { interaction, dragEvent })\n }\n },\n\n // FIXME proper signal types\n 'interactions:action-move': onEventCreated,\n 'interactions:action-end': onEventCreated,\n\n 'interactions:after-action-move': function fireDropAfterMove ({ interaction, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) {\n if (interaction.prepared.name !== 'drag') { return }\n\n fireDropEvents(interaction, interaction.dropState.events)\n\n scope.fire('actions/drop:move', { interaction, dragEvent })\n interaction.dropState.events = {}\n },\n\n 'interactions:after-action-end': ({ interaction, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n fireDropEvents(interaction, interaction.dropState.events)\n scope.fire('actions/drop:end', { interaction, dragEvent })\n },\n\n 'interactions:stop': ({ interaction }) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n const { dropState } = interaction\n\n if (dropState) {\n dropState.activeDrops = null\n dropState.events = null\n dropState.cur.dropzone = null\n dropState.cur.element = null\n dropState.prev.dropzone = null\n dropState.prev.element = null\n dropState.rejected = false\n }\n },\n },\n getActiveDrops,\n getDrop,\n getDropEvents,\n fireDropEvents,\n defaults: {\n enabled: false,\n accept : null,\n overlap: 'pointer',\n } as Interact.DropzoneOptions,\n}\n\nexport default drop\n","import * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nexport type GesturableMethod = Interact.ActionMethod<Interact.GesturableOptions>\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n gesture?: {\n angle: number // angle from first to second touch\n distance: number\n scale: number // gesture.distance / gesture.startDistance\n startAngle: number // angle of line joining two touches\n startDistance: number // distance between two touches of touchStart\n }\n }\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n gesturable: GesturableMethod\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n gesture: Interact.GesturableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n gesture?: typeof gesture\n }\n}\n\nexport interface GestureEvent extends Interact.InteractEvent<'gesture'> {\n distance: number\n angle: number\n da: number // angle change\n scale: number // ratio of distance start to current event\n ds: number // scale change\n box: Interact.Rect // enclosing box of all points\n touches: Interact.PointerType[]\n}\n\nexport interface GestureSignalArg extends Interact.DoPhaseArg<'gesture', Interact.EventPhase> {\n iEvent: GestureEvent\n interaction: Interact.Interaction<'gesture'>\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n actions,\n Interactable,\n defaults,\n } = scope\n\n /**\n * ```js\n * interact(element).gesturable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // limit multiple gestures.\n * // See the explanation in {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * })\n *\n * var isGestureable = interact(element).gesturable()\n * ```\n *\n * Gets or sets whether multitouch gestures can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on gesture events (makes the Interactable gesturable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of gesture events, or this Interactable\n */\n Interactable.prototype.gesturable = function (this: Interact.Interactable, options: Interact.GesturableOptions | boolean) {\n if (is.object(options)) {\n this.options.gesture.enabled = options.enabled !== false\n this.setPerAction('gesture', options)\n this.setOnEvents('gesture', options)\n\n return this\n }\n\n if (is.bool(options)) {\n this.options.gesture.enabled = options\n\n return this\n }\n\n return this.options.gesture as Interact.Options\n } as GesturableMethod\n\n actions.map.gesture = gesture\n actions.methodDict.gesture = 'gesturable'\n\n defaults.actions.gesture = gesture.defaults\n}\n\nfunction updateGestureProps ({ interaction, iEvent, phase }: GestureSignalArg) {\n if (interaction.prepared.name !== 'gesture') { return }\n\n const pointers = interaction.pointers.map(p => p.pointer)\n const starting = phase === 'start'\n const ending = phase === 'end'\n const deltaSource = interaction.interactable.options.deltaSource\n\n iEvent.touches = [pointers[0], pointers[1]]\n\n if (starting) {\n iEvent.distance = pointerUtils.touchDistance(pointers, deltaSource)\n iEvent.box = pointerUtils.touchBBox(pointers)\n iEvent.scale = 1\n iEvent.ds = 0\n iEvent.angle = pointerUtils.touchAngle(pointers, deltaSource)\n iEvent.da = 0\n\n interaction.gesture.startDistance = iEvent.distance\n interaction.gesture.startAngle = iEvent.angle\n }\n else if (ending) {\n const prevEvent = interaction.prevEvent as GestureEvent\n\n iEvent.distance = prevEvent.distance\n iEvent.box = prevEvent.box\n iEvent.scale = prevEvent.scale\n iEvent.ds = 0\n iEvent.angle = prevEvent.angle\n iEvent.da = 0\n }\n else {\n iEvent.distance = pointerUtils.touchDistance(pointers, deltaSource)\n iEvent.box = pointerUtils.touchBBox(pointers)\n iEvent.scale = iEvent.distance / interaction.gesture.startDistance\n iEvent.angle = pointerUtils.touchAngle(pointers, deltaSource)\n\n iEvent.ds = iEvent.scale - interaction.gesture.scale\n iEvent.da = iEvent.angle - interaction.gesture.angle\n }\n\n interaction.gesture.distance = iEvent.distance\n interaction.gesture.angle = iEvent.angle\n\n if (is.number(iEvent.scale) &&\n iEvent.scale !== Infinity &&\n !isNaN(iEvent.scale)) {\n interaction.gesture.scale = iEvent.scale\n }\n}\n\nconst gesture: Interact.Plugin = {\n id: 'actions/gesture',\n before: ['actions/drag', 'actions/resize'],\n install,\n listeners: {\n 'interactions:action-start': updateGestureProps,\n 'interactions:action-move': updateGestureProps,\n 'interactions:action-end': updateGestureProps,\n\n 'interactions:new': ({ interaction }) => {\n interaction.gesture = {\n angle: 0,\n distance: 0,\n scale: 1,\n startAngle: 0,\n startDistance: 0,\n }\n },\n\n 'auto-start:check': arg => {\n if (arg.interaction.pointers.length < 2) {\n return undefined\n }\n\n const gestureOptions = arg.interactable.options.gesture\n\n if (!(gestureOptions && gestureOptions.enabled)) {\n return undefined\n }\n\n arg.action = { name: 'gesture' }\n\n return false\n },\n },\n\n defaults: {\n },\n\n getCursor () {\n return ''\n },\n}\n\nexport default gesture\n","import { Interaction } from '@interactjs/core/Interaction'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\nexport type EdgeName = 'top' | 'left' | 'bottom' | 'right'\n\nexport type ResizableMethod = Interact.ActionMethod<Interact.ResizableOptions>\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n resizable: ResizableMethod\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n resizeAxes: 'x' | 'y' | 'xy'\n resizeStartAspectRatio: number\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n resize: Interact.ResizableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n resize?: typeof resize\n }\n}\n\nexport interface ResizeEvent<P extends Interact.EventPhase = Interact.EventPhase> extends Interact.InteractEvent<'resize', P> {\n deltaRect?: Interact.FullRect\n edges?: Interact.ActionProps['edges']\n}\n\nfunction install (scope: Scope) {\n const {\n actions,\n browser,\n /** @lends Interactable */\n Interactable, // tslint:disable-line no-shadowed-variable\n defaults,\n } = scope\n\n // Less Precision with touch input\n\n resize.cursors = initCursors(browser)\n resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10\n\n /**\n * ```js\n * interact(element).resizable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * edges: {\n * top : true, // Use pointer coords to check for resize.\n * left : false, // Disable resizing from left edge.\n * bottom: '.resize-s',// Resize if pointer target matches selector\n * right : handleEl // Resize if pointer target is the given Element\n * },\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height are adjusted at a 1:1 ratio.\n * square: false,\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height maintain the aspect ratio they had when resizing started.\n * preserveAspectRatio: false,\n *\n * // a value of 'none' will limit the resize rect to a minimum of 0x0\n * // 'negate' will allow the rect to have negative width/height\n * // 'reposition' will keep the width/height positive by swapping\n * // the top and bottom edges and/or swapping the left and right edges\n * invert: 'none' || 'negate' || 'reposition'\n *\n * // limit multiple resizes.\n * // See the explanation in the {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * })\n *\n * var isResizeable = interact(element).resizable()\n * ```\n *\n * Gets or sets whether resize actions can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on resize events (object makes the Interactable\n * resizable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of resize elements, or this Interactable\n */\n Interactable.prototype.resizable = function (this: Interact.Interactable, options: Interact.ResizableOptions | boolean) {\n return resizable(this, options, scope)\n } as ResizableMethod\n\n actions.map.resize = resize\n actions.methodDict.resize = 'resizable'\n\n defaults.actions.resize = resize.defaults\n}\n\nfunction resizeChecker (arg) {\n const { interaction, interactable, element, rect, buttons } = arg\n\n if (!rect) { return undefined }\n\n const page = extend({}, interaction.coords.cur.page)\n const resizeOptions = interactable.options.resize\n\n if (\n !(resizeOptions && resizeOptions.enabled) ||\n // check mouseButton setting if the pointer is down\n (interaction.pointerIsDown &&\n /mouse|pointer/.test(interaction.pointerType) &&\n (buttons & resizeOptions.mouseButtons) === 0)\n ) {\n return undefined\n }\n\n // if using resize.edges\n if (is.object(resizeOptions.edges)) {\n const resizeEdges = {\n left: false,\n right: false,\n top: false,\n bottom: false,\n }\n\n for (const edge in resizeEdges) {\n resizeEdges[edge] = checkResizeEdge(edge,\n resizeOptions.edges[edge],\n page,\n interaction._latestPointer.eventTarget,\n element,\n rect,\n resizeOptions.margin || resize.defaultMargin)\n }\n\n resizeEdges.left = resizeEdges.left && !resizeEdges.right\n resizeEdges.top = resizeEdges.top && !resizeEdges.bottom\n\n if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {\n arg.action = {\n name: 'resize',\n edges: resizeEdges,\n }\n }\n }\n else {\n const right = resizeOptions.axis !== 'y' && page.x > (rect.right - resize.defaultMargin)\n const bottom = resizeOptions.axis !== 'x' && page.y > (rect.bottom - resize.defaultMargin)\n\n if (right || bottom) {\n arg.action = {\n name: 'resize',\n axes: (right ? 'x' : '') + (bottom ? 'y' : ''),\n }\n }\n }\n\n return arg.action ? false : undefined\n}\n\nfunction resizable (interactable: Interact.Interactable, options: Interact.OrBoolean<Interact.ResizableOptions> | boolean, scope: Scope) {\n if (is.object(options)) {\n interactable.options.resize.enabled = options.enabled !== false\n interactable.setPerAction('resize', options)\n interactable.setOnEvents('resize', options)\n\n if (is.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {\n interactable.options.resize.axis = options.axis\n }\n else if (options.axis === null) {\n interactable.options.resize.axis = scope.defaults.actions.resize.axis\n }\n\n if (is.bool(options.preserveAspectRatio)) {\n interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio\n }\n else if (is.bool(options.square)) {\n interactable.options.resize.square = options.square\n }\n\n return interactable\n }\n if (is.bool(options)) {\n interactable.options.resize.enabled = options\n\n return interactable\n }\n return interactable.options.resize\n}\n\nfunction checkResizeEdge (\n name: string,\n value: any,\n page: Interact.Point,\n element: Node,\n interactableElement: Interact.Element,\n rect: Interact.Rect,\n margin: number,\n) {\n // false, '', undefined, null\n if (!value) { return false }\n\n // true value, use pointer coords and element rect\n if (value === true) {\n // if dimensions are negative, \"switch\" edges\n const width = is.number(rect.width) ? rect.width : rect.right - rect.left\n const height = is.number(rect.height) ? rect.height : rect.bottom - rect.top\n\n // don't use margin greater than half the relevent dimension\n margin = Math.min(margin, Math.abs((name === 'left' || name === 'right' ? width : height) / 2))\n\n if (width < 0) {\n if (name === 'left') { name = 'right' }\n else if (name === 'right') { name = 'left' }\n }\n if (height < 0) {\n if (name === 'top') { name = 'bottom' }\n else if (name === 'bottom') { name = 'top' }\n }\n\n if (name === 'left') { return page.x < ((width >= 0 ? rect.left : rect.right) + margin) }\n if (name === 'top') { return page.y < ((height >= 0 ? rect.top : rect.bottom) + margin) }\n\n if (name === 'right') { return page.x > ((width >= 0 ? rect.right : rect.left) - margin) }\n if (name === 'bottom') { return page.y > ((height >= 0 ? rect.bottom : rect.top) - margin) }\n }\n\n // the remaining checks require an element\n if (!is.element(element)) { return false }\n\n return is.element(value)\n // the value is an element to use as a resize handle\n ? value === element\n // otherwise check if element matches value as selector\n : dom.matchesUpTo(element, value, interactableElement)\n}\n\nfunction initCursors (browser: typeof import ('@interactjs/utils/browser').default) {\n return (browser.isIe9 ? {\n x : 'e-resize',\n y : 's-resize',\n xy: 'se-resize',\n\n top : 'n-resize',\n left : 'w-resize',\n bottom : 's-resize',\n right : 'e-resize',\n topleft : 'se-resize',\n bottomright: 'se-resize',\n topright : 'ne-resize',\n bottomleft : 'ne-resize',\n } : {\n x : 'ew-resize',\n y : 'ns-resize',\n xy: 'nwse-resize',\n\n top : 'ns-resize',\n left : 'ew-resize',\n bottom : 'ns-resize',\n right : 'ew-resize',\n topleft : 'nwse-resize',\n bottomright: 'nwse-resize',\n topright : 'nesw-resize',\n bottomleft : 'nesw-resize',\n })\n}\n\nfunction start ({ iEvent, interaction }: { iEvent: Interact.InteractEvent<any, any>, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {\n return\n }\n\n const resizeEvent = iEvent as ResizeEvent\n const rect = interaction.rect\n\n interaction._rects = {\n start: extend({}, rect),\n corrected: extend({}, rect),\n previous: extend({}, rect),\n delta: {\n left: 0,\n right : 0,\n width : 0,\n top : 0,\n bottom: 0,\n height: 0,\n },\n }\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = interaction._rects.corrected\n resizeEvent.deltaRect = interaction._rects.delta\n}\n\nfunction move ({ iEvent, interaction }: { iEvent: Interact.InteractEvent<any, any>, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { return }\n\n const resizeEvent = iEvent as ResizeEvent\n const resizeOptions = interaction.interactable.options.resize\n const invert = resizeOptions.invert\n const invertible = invert === 'reposition' || invert === 'negate'\n\n // eslint-disable-next-line no-shadow\n const current = interaction.rect\n const { start: startRect, corrected, delta: deltaRect, previous } = interaction._rects\n\n extend(previous, corrected)\n\n if (invertible) {\n // if invertible, copy the current rect\n extend(corrected, current)\n\n if (invert === 'reposition') {\n // swap edge values if necessary to keep width/height positive\n if (corrected.top > corrected.bottom) {\n const swap = corrected.top\n\n corrected.top = corrected.bottom\n corrected.bottom = swap\n }\n if (corrected.left > corrected.right) {\n const swap = corrected.left\n\n corrected.left = corrected.right\n corrected.right = swap\n }\n }\n }\n else {\n // if not invertible, restrict to minimum of 0x0 rect\n corrected.top = Math.min(current.top, startRect.bottom)\n corrected.bottom = Math.max(current.bottom, startRect.top)\n corrected.left = Math.min(current.left, startRect.right)\n corrected.right = Math.max(current.right, startRect.left)\n }\n\n corrected.width = corrected.right - corrected.left\n corrected.height = corrected.bottom - corrected.top\n\n for (const edge in corrected) {\n deltaRect[edge] = corrected[edge] - previous[edge]\n }\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = corrected\n resizeEvent.deltaRect = deltaRect\n}\n\nfunction end ({ iEvent, interaction }: { iEvent: Interact.InteractEvent<any, any>, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { return }\n\n const resizeEvent = iEvent as ResizeEvent\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = interaction._rects.corrected\n resizeEvent.deltaRect = interaction._rects.delta\n}\n\nfunction updateEventAxes ({ iEvent, interaction }: { iEvent: Interact.InteractEvent<any, any>, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.resizeAxes) { return }\n\n const options = interaction.interactable.options\n const resizeEvent = iEvent as ResizeEvent\n\n if (options.resize.square) {\n if (interaction.resizeAxes === 'y') {\n resizeEvent.delta.x = resizeEvent.delta.y\n }\n else {\n resizeEvent.delta.y = resizeEvent.delta.x\n }\n resizeEvent.axes = 'xy'\n }\n else {\n resizeEvent.axes = interaction.resizeAxes\n\n if (interaction.resizeAxes === 'x') {\n resizeEvent.delta.y = 0\n }\n else if (interaction.resizeAxes === 'y') {\n resizeEvent.delta.x = 0\n }\n }\n}\n\nconst resize: Interact.Plugin = {\n id: 'actions/resize',\n before: ['actions/drag'],\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.resizeAxes = 'xy'\n },\n\n 'interactions:action-start': arg => {\n start(arg)\n updateEventAxes(arg)\n },\n 'interactions:action-move': arg => {\n move(arg)\n updateEventAxes(arg)\n },\n 'interactions:action-end': end,\n 'auto-start:check': resizeChecker,\n },\n\n defaults: {\n square: false,\n preserveAspectRatio: false,\n axis: 'xy',\n\n // use default margin\n margin: NaN,\n\n // object with props left, right, top, bottom which are\n // true/false values to resize when the pointer is over that edge,\n // CSS selectors to match the handles for each direction\n // or the Elements for each handle\n edges: null,\n\n // a value of 'none' will limit the resize rect to a minimum of 0x0\n // 'negate' will alow the rect to have negative width/height\n // 'reposition' will keep the width/height positive by swapping\n // the top and bottom edges and/or swapping the left and right edges\n invert: 'none',\n } as Interact.ResizableOptions,\n\n cursors: null as ReturnType<typeof initCursors>,\n\n getCursor ({ edges, axis, name }: Interact.ActionProps) {\n const cursors = resize.cursors\n let result: string = null\n\n if (axis) {\n result = cursors[name + axis]\n }\n else if (edges) {\n let cursorKey = ''\n\n for (const edge of ['top', 'bottom', 'left', 'right']) {\n if (edges[edge]) {\n cursorKey += edge\n }\n }\n\n result = cursors[cursorKey]\n }\n\n return result\n },\n\n defaultMargin: null as number,\n}\n\nexport default resize\n","import * as Interact from '@interactjs/types/index'\n\nimport drag from './drag/plugin'\nimport drop from './drop/plugin'\nimport gesture from './gesture/plugin'\nimport resize from './resize/plugin'\n\nexport default {\n id: 'actions',\n install (scope: Interact.Scope) {\n scope.usePlugin(gesture)\n scope.usePlugin(resize)\n scope.usePlugin(drag)\n scope.usePlugin(drop)\n },\n}\n","export type ArrangeEvent = {}\nexport type ArrangeMode = {}\n\nexport default {}\n","let lastTime = 0\nlet request\nlet cancel\n\nfunction init (window) {\n request = window.requestAnimationFrame\n cancel = window.cancelAnimationFrame\n\n if (!request) {\n const vendors = ['ms', 'moz', 'webkit', 'o']\n\n for (const vendor of vendors) {\n request = window[`${vendor}RequestAnimationFrame`]\n cancel = window[`${vendor}CancelAnimationFrame`] || window[`${vendor}CancelRequestAnimationFrame`]\n }\n }\n\n if (!request) {\n request = callback => {\n const currTime = Date.now()\n const timeToCall = Math.max(0, 16 - (currTime - lastTime))\n // eslint-disable-next-line standard/no-callback-literal\n const token = setTimeout(() => { callback(currTime + timeToCall) },\n timeToCall)\n\n lastTime = currTime + timeToCall\n return token\n }\n\n cancel = token => clearTimeout(token)\n }\n}\n\nexport default {\n request: callback => request(callback),\n cancel: token => cancel(token),\n init,\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport raf from '@interactjs/utils/raf'\nimport { getStringOptionResult } from '@interactjs/utils/rect'\nimport { getWindow } from '@interactjs/utils/window'\n\ntype Scope = import ('@interactjs/core/scope').Scope\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n autoScroll: typeof autoScroll\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n autoScroll?: typeof autoScroll\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n autoScroll?: AutoScrollOptions\n }\n}\n\nexport interface AutoScrollOptions {\n container?: Window | HTMLElement\n margin?: number\n distance?: number\n interval?: number\n speed?: number\n enabled?: boolean\n}\n\nfunction install (scope: Scope) {\n const {\n defaults,\n actions,\n } = scope\n\n scope.autoScroll = autoScroll\n autoScroll.now = () => scope.now()\n\n actions.phaselessTypes.autoscroll = true\n defaults.perAction.autoScroll = autoScroll.defaults\n}\n\nconst autoScroll = {\n defaults: {\n enabled : false,\n margin : 60,\n\n // the item that is scrolled (Window or HTMLElement)\n container: null as AutoScrollOptions['container'],\n\n // the scroll speed in pixels per second\n speed : 300,\n } as AutoScrollOptions,\n\n now: Date.now,\n\n interaction: null as Interact.Interaction,\n i: 0, // the handle returned by window.setInterval\n\n // Direction each pulse is to scroll in\n x: 0,\n y: 0,\n\n isScrolling: false,\n prevTime: 0,\n margin: 0,\n speed: 0,\n\n start (interaction: Interact.Interaction) {\n autoScroll.isScrolling = true\n raf.cancel(autoScroll.i)\n\n interaction.autoScroll = autoScroll\n autoScroll.interaction = interaction\n autoScroll.prevTime = autoScroll.now()\n autoScroll.i = raf.request(autoScroll.scroll)\n },\n\n stop () {\n autoScroll.isScrolling = false\n if (autoScroll.interaction) {\n autoScroll.interaction.autoScroll = null\n }\n raf.cancel(autoScroll.i)\n },\n\n // scroll the window by the values in scroll.x/y\n scroll () {\n const { interaction } = autoScroll\n const { interactable, element } = interaction\n const actionName = interaction.prepared.name\n const options = interactable.options[actionName].autoScroll\n const container = getContainer(options.container, interactable, element)\n const now = autoScroll.now()\n // change in time in seconds\n const dt = (now - autoScroll.prevTime) / 1000\n // displacement\n const s = options.speed * dt\n\n if (s >= 1) {\n const scrollBy = {\n x: autoScroll.x * s,\n y: autoScroll.y * s,\n }\n\n if (scrollBy.x || scrollBy.y) {\n const prevScroll = getScroll(container)\n\n if (is.window(container)) {\n container.scrollBy(scrollBy.x, scrollBy.y)\n }\n else if (container) {\n container.scrollLeft += scrollBy.x\n container.scrollTop += scrollBy.y\n }\n\n const curScroll = getScroll(container)\n const delta = {\n x: curScroll.x - prevScroll.x,\n y: curScroll.y - prevScroll.y,\n }\n\n if (delta.x || delta.y) {\n interactable.fire({\n type: 'autoscroll',\n target: element,\n interactable,\n delta,\n interaction,\n container,\n })\n }\n }\n\n autoScroll.prevTime = now\n }\n\n if (autoScroll.isScrolling) {\n raf.cancel(autoScroll.i)\n autoScroll.i = raf.request(autoScroll.scroll)\n }\n },\n check (interactable: Interact.Interactable, actionName: Interact.ActionName) {\n const options = interactable.options\n\n return options[actionName].autoScroll && options[actionName].autoScroll.enabled\n },\n onInteractionMove<T extends Interact.ActionName> ({ interaction, pointer }: { interaction: Interact.Interaction<T>, pointer: Interact.PointerType }) {\n if (!(interaction.interacting() &&\n autoScroll.check(interaction.interactable, interaction.prepared.name))) {\n return\n }\n\n if (interaction.simulation) {\n autoScroll.x = autoScroll.y = 0\n return\n }\n\n let top\n let right\n let bottom\n let left\n\n const { interactable, element } = interaction\n const actionName = interaction.prepared.name\n const options = interactable.options[actionName].autoScroll\n const container = getContainer(options.container, interactable, element)\n\n if (is.window(container)) {\n left = pointer.clientX < autoScroll.margin\n top = pointer.clientY < autoScroll.margin\n right = pointer.clientX > container.innerWidth - autoScroll.margin\n bottom = pointer.clientY > container.innerHeight - autoScroll.margin\n }\n else {\n const rect = domUtils.getElementClientRect(container)\n\n left = pointer.clientX < rect.left + autoScroll.margin\n top = pointer.clientY < rect.top + autoScroll.margin\n right = pointer.clientX > rect.right - autoScroll.margin\n bottom = pointer.clientY > rect.bottom - autoScroll.margin\n }\n\n autoScroll.x = (right ? 1 : left ? -1 : 0)\n autoScroll.y = (bottom ? 1 : top ? -1 : 0)\n\n if (!autoScroll.isScrolling) {\n // set the autoScroll properties to those of the target\n autoScroll.margin = options.margin\n autoScroll.speed = options.speed\n\n autoScroll.start(interaction)\n }\n },\n}\n\nexport function getContainer (value: any, interactable: Interact.Interactable, element: Interact.Element) {\n return (is.string(value) ? getStringOptionResult(value, interactable, element) : value) || getWindow(element)\n}\n\nexport function getScroll (container: any) {\n if (is.window(container)) { container = window.document.body }\n\n return { x: container.scrollLeft, y: container.scrollTop }\n}\n\nexport function getScrollSize (container: any) {\n if (is.window(container)) { container = window.document.body }\n\n return { x: container.scrollWidth, y: container.scrollHeight }\n}\n\nexport function getScrollSizeDelta<T extends Interact.ActionName> ({ interaction, element }: {\n interaction: Partial<Interact.Interaction<T>>\n element: Interact.Element\n}, func: any) {\n const scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll\n\n if (!scrollOptions || !scrollOptions.enabled) {\n func()\n return { x: 0, y: 0 }\n }\n\n const scrollContainer = getContainer(\n scrollOptions.container,\n interaction.interactable,\n element,\n )\n\n const prevSize = getScroll(scrollContainer)\n func()\n const curSize = getScroll(scrollContainer)\n\n return {\n x: curSize.x - prevSize.x,\n y: curSize.y - prevSize.y,\n }\n}\n\nconst autoScrollPlugin: Interact.Plugin = {\n id: 'auto-scroll',\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.autoScroll = null\n },\n\n 'interactions:destroy': ({ interaction }) => {\n interaction.autoScroll = null\n autoScroll.stop()\n if (autoScroll.interaction) {\n autoScroll.interaction = null\n }\n },\n\n 'interactions:stop': autoScroll.stop,\n\n 'interactions:action-move': (arg: any) => autoScroll.onInteractionMove(arg),\n },\n}\n\nexport default autoScrollPlugin\n","import * as Interact from '@interactjs/types/index'\n\nimport win from './window'\n\nexport function warnOnce<T> (this: T, method: (...args: any[]) => any, message: string) {\n let warned = false\n\n return function (this: T) {\n if (!warned) {\n (win.window as any).console.warn(message)\n warned = true\n }\n\n return method.apply(this, arguments)\n }\n}\n\nexport function copyAction (dest: Interact.ActionProps, src: Interact.ActionProps) {\n dest.name = src.name\n dest.axis = src.axis\n dest.edges = src.edges\n\n return dest\n}\n","import * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\nimport { warnOnce } from '@interactjs/utils/misc'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n getAction: (\n this: Interact.Interactable,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n ) => Interact.ActionProps | null\n styleCursor: typeof styleCursor\n actionChecker: typeof actionChecker\n ignoreFrom: {\n (...args: any[]): Interactable\n (): boolean\n }\n allowFrom: {\n (...args: any[]): Interactable\n (): boolean\n }\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n /** @lends Interactable */\n Interactable, // tslint:disable-line no-shadowed-variable\n } = scope\n\n Interactable.prototype.getAction = function getAction (\n this: Interact.Interactable,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n ): Interact.ActionProps {\n const action = defaultActionChecker(this, event, interaction, element, scope)\n\n if (this.options.actionChecker) {\n return this.options.actionChecker(pointer, event, action, this, element, interaction)\n }\n\n return action\n }\n\n /**\n * ```js\n * interact(element, { ignoreFrom: document.getElementById('no-action') })\n * // or\n * interact(element).ignoreFrom('input, textarea, a')\n * ```\n * @deprecated\n * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any\n * of it's parents match the given CSS selector or Element, no\n * drag/resize/gesture is started.\n *\n * Don't use this method. Instead set the `ignoreFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .draggable({\n * ignoreFrom: 'input, textarea, a[href]'',\n * })\n * .pointerEvents({\n * ignoreFrom: '[no-pointer]',\n * })\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to not ignore any elements\n * @return {string | Element | object} The current ignoreFrom value or this\n * Interactable\n */\n Interactable.prototype.ignoreFrom = warnOnce(function (this: Interact.Interactable, newValue) {\n return this._backCompatOption('ignoreFrom', newValue)\n }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).')\n\n /**\n * @deprecated\n *\n * A drag/resize/gesture is started only If the target of the `mousedown`,\n * `pointerdown` or `touchstart` event or any of it's parents match the given\n * CSS selector or Element.\n *\n * Don't use this method. Instead set the `allowFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .resizable({\n * allowFrom: '.resize-handle',\n * .pointerEvents({\n * allowFrom: '.handle',,\n * })\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to allow from any element\n * @return {string | Element | object} The current allowFrom value or this\n * Interactable\n */\n Interactable.prototype.allowFrom = warnOnce(function (this: Interact.Interactable, newValue) {\n return this._backCompatOption('allowFrom', newValue)\n }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).')\n\n /**\n * ```js\n * interact('.resize-drag')\n * .resizable(true)\n * .draggable(true)\n * .actionChecker(function (pointer, event, action, interactable, element, interaction) {\n *\n * if (interact.matchesSelector(event.target, '.drag-handle')) {\n * // force drag with handle target\n * action.name = drag\n * }\n * else {\n * // resize from the top and right edges\n * action.name = 'resize'\n * action.edges = { top: true, right: true }\n * }\n *\n * return action\n * })\n * ```\n *\n * Returns or sets the function used to check action to be performed on\n * pointerDown\n *\n * @param {function | null} [checker] A function which takes a pointer event,\n * defaultAction string, interactable, element and interaction as parameters\n * and returns an object with name property 'drag' 'resize' or 'gesture' and\n * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right\n * props.\n * @return {Function | Interactable} The checker function or this Interactable\n */\n Interactable.prototype.actionChecker = actionChecker\n\n /**\n * Returns or sets whether the the cursor should be changed depending on the\n * action that would be performed if the mouse were pressed and dragged.\n *\n * @param {boolean} [newValue]\n * @return {boolean | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.styleCursor = styleCursor\n}\n\nfunction defaultActionChecker (\n interactable: Interact.Interactable,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n scope: Interact.Scope,\n) {\n const rect = interactable.getRect(element)\n const buttons = (event as MouseEvent).buttons || ({\n 0: 1,\n 1: 4,\n 3: 8,\n 4: 16,\n })[(event as MouseEvent).button as 0 | 1 | 3 | 4]\n const arg = {\n action: null,\n interactable,\n interaction,\n element,\n rect,\n buttons,\n }\n\n scope.fire('auto-start:check', arg)\n\n return arg.action\n}\n\nfunction styleCursor (this: Interact.Interactable): boolean\nfunction styleCursor (this: Interact.Interactable, newValue: boolean): typeof this\nfunction styleCursor (this: Interact.Interactable, newValue?: boolean) {\n if (is.bool(newValue)) {\n this.options.styleCursor = newValue\n\n return this\n }\n\n if (newValue === null) {\n delete this.options.styleCursor\n\n return this\n }\n\n return this.options.styleCursor\n}\n\nfunction actionChecker (this: Interact.Interactable, checker: any) {\n if (is.func(checker)) {\n this.options.actionChecker = checker\n\n return this\n }\n\n if (checker === null) {\n delete this.options.actionChecker\n\n return this\n }\n\n return this.options.actionChecker\n}\n\nexport default {\n id: 'auto-start/interactableMethods',\n install,\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport { copyAction } from '@interactjs/utils/misc'\n\nimport InteractableMethods from './InteractableMethods'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n maxInteractions: (newValue: any) => any\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n autoStart: AutoStart\n }\n\n interface SignalArgs {\n 'autoStart:before-start': Interact.SignalArgs['interactions:move']\n 'autoStart:prepared': { interaction: Interact.Interaction }\n 'auto-start:check': CheckSignalArg\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface BaseDefaults {\n actionChecker?: any\n cursorChecker?: any\n styleCursor?: any\n }\n\n interface PerActionDefaults {\n manualStart?: boolean\n max?: number\n maxPerElement?: number\n allowFrom?: string | Interact.Element\n ignoreFrom?: string | Interact.Element\n cursorChecker?: Interact.CursorChecker\n\n // only allow left button by default\n // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value\n mouseButtons?: 0 | 1 | 2 | 4 | 16\n }\n}\n\ninterface CheckSignalArg {\n interactable: Interact.Interactable\n interaction: Interact.Interaction\n element: Interact.Element\n action: Interact.ActionProps\n buttons: number\n}\n\nexport interface AutoStart {\n // Allow this many interactions to happen simultaneously\n maxInteractions: number\n withinInteractionLimit: typeof withinInteractionLimit\n cursorElement: Interact.Element\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n interactStatic: interact,\n defaults,\n } = scope\n\n scope.usePlugin(InteractableMethods)\n\n defaults.base.actionChecker = null\n defaults.base.styleCursor = true\n\n extend(defaults.perAction, {\n manualStart: false,\n max: Infinity,\n maxPerElement: 1,\n allowFrom: null,\n ignoreFrom: null,\n\n // only allow left button by default\n // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value\n mouseButtons: 1,\n })\n\n /**\n * Returns or sets the maximum number of concurrent interactions allowed. By\n * default only 1 interaction is allowed at a time (for backwards\n * compatibility). To allow multiple interactions on the same Interactables and\n * elements, you need to enable it in the draggable, resizable and gesturable\n * `'max'` and `'maxPerElement'` options.\n *\n * @alias module:interact.maxInteractions\n *\n * @param {number} [newValue] Any number. newValue <= 0 means no interactions.\n */\n interact.maxInteractions = (newValue: number) => maxInteractions(newValue, scope)\n\n scope.autoStart = {\n // Allow this many interactions to happen simultaneously\n maxInteractions: Infinity,\n withinInteractionLimit,\n cursorElement: null,\n }\n}\n\nfunction prepareOnDown ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:down'], scope: Interact.Scope) {\n if (interaction.interacting()) { return }\n\n const actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope)\n prepare(interaction, actionInfo, scope)\n}\n\nfunction prepareOnMove ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n if (interaction.pointerType !== 'mouse' ||\n interaction.pointerIsDown ||\n interaction.interacting()) { return }\n\n const actionInfo = getActionInfo(interaction, pointer, event, eventTarget as Interact.Element, scope)\n prepare(interaction, actionInfo, scope)\n}\n\nfunction startOnMove (arg: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n const { interaction } = arg\n\n if (!interaction.pointerIsDown ||\n interaction.interacting() ||\n !interaction.pointerWasMoved ||\n !interaction.prepared.name) {\n return\n }\n\n scope.fire('autoStart:before-start', arg)\n\n const { interactable } = interaction\n const actionName = interaction.prepared.name\n\n if (actionName && interactable) {\n // check manualStart and interaction limit\n if (interactable.options[actionName].manualStart ||\n !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {\n interaction.stop()\n }\n else {\n interaction.start(interaction.prepared, interactable, interaction.element)\n setInteractionCursor(interaction, scope)\n }\n }\n}\n\nfunction clearCursorOnStop ({ interaction }: { interaction: Interact.Interaction }, scope: Interact.Scope) {\n const { interactable } = interaction\n\n if (interactable && interactable.options.styleCursor) {\n setCursor(interaction.element, '', scope)\n }\n}\n\n// Check if the current interactable supports the action.\n// If so, return the validated action. Otherwise, return null\nfunction validateAction<T extends Interact.ActionName> (\n action: Interact.ActionProps<T>,\n interactable: Interact.Interactable,\n element: Interact.Element,\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) &&\n interactable.options[action.name].enabled &&\n withinInteractionLimit(interactable, element, action, scope)) {\n return action\n }\n\n return null\n}\n\nfunction validateMatches (\n interaction: Interact.Interaction,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n matches: Interact.Interactable[],\n matchElements: Interact.Element[],\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n for (let i = 0, len = matches.length; i < len; i++) {\n const match = matches[i]\n const matchElement = matchElements[i]\n const matchAction = match.getAction(pointer, event, interaction, matchElement)\n\n if (!matchAction) { continue }\n\n const action = validateAction(\n matchAction,\n match,\n matchElement,\n eventTarget,\n scope)\n\n if (action) {\n return {\n action,\n interactable: match,\n element: matchElement,\n }\n }\n }\n\n return { action: null, interactable: null, element: null }\n}\n\nfunction getActionInfo (\n interaction: Interact.Interaction,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n let matches: Interact.Interactable[] = []\n let matchElements: Interact.Element[] = []\n\n let element = eventTarget as Interact.Element\n\n function pushMatches (interactable: Interact.Interactable) {\n matches.push(interactable)\n matchElements.push(element)\n }\n\n while (is.element(element)) {\n matches = []\n matchElements = []\n\n scope.interactables.forEachMatch(element, pushMatches)\n\n const actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope)\n\n if (actionInfo.action &&\n !actionInfo.interactable.options[actionInfo.action.name].manualStart) {\n return actionInfo\n }\n\n element = domUtils.parentNode(element) as Interact.Element\n }\n\n return { action: null, interactable: null, element: null }\n}\n\nfunction prepare (\n interaction: Interact.Interaction,\n { action, interactable, element }: {\n action: Interact.ActionProps\n interactable: Interact.Interactable\n element: Interact.Element\n },\n scope: Interact.Scope,\n) {\n action = action || { name: null }\n\n interaction.interactable = interactable\n interaction.element = element\n copyAction(interaction.prepared, action)\n\n interaction.rect = interactable && action.name\n ? interactable.getRect(element)\n : null\n\n setInteractionCursor(interaction, scope)\n\n scope.fire('autoStart:prepared', { interaction })\n}\n\nfunction withinInteractionLimit<T extends Interact.ActionName> (\n interactable: Interact.Interactable,\n element: Interact.Element,\n action: Interact.ActionProps<T>,\n scope: Interact.Scope,\n) {\n const options = interactable.options\n const maxActions = options[action.name].max\n const maxPerElement = options[action.name].maxPerElement\n const autoStartMax = scope.autoStart.maxInteractions\n let activeInteractions = 0\n let interactableCount = 0\n let elementCount = 0\n\n // no actions if any of these values == 0\n if (!(maxActions && maxPerElement && autoStartMax)) { return false }\n\n for (const interaction of scope.interactions.list) {\n const otherAction = interaction.prepared.name\n\n if (!interaction.interacting()) { continue }\n\n activeInteractions++\n\n if (activeInteractions >= autoStartMax) {\n return false\n }\n\n if (interaction.interactable !== interactable) { continue }\n\n interactableCount += otherAction === action.name ? 1 : 0\n\n if (interactableCount >= maxActions) {\n return false\n }\n\n if (interaction.element === element) {\n elementCount++\n\n if (otherAction === action.name && elementCount >= maxPerElement) {\n return false\n }\n }\n }\n\n return autoStartMax > 0\n}\n\nfunction maxInteractions (newValue: any, scope: Interact.Scope) {\n if (is.number(newValue)) {\n scope.autoStart.maxInteractions = newValue\n\n return this\n }\n\n return scope.autoStart.maxInteractions\n}\n\nfunction setCursor (element: Interact.Element, cursor: string, scope: Interact.Scope) {\n const { cursorElement: prevCursorElement } = scope.autoStart\n\n if (prevCursorElement && prevCursorElement !== element) {\n prevCursorElement.style.cursor = ''\n }\n\n element.ownerDocument.documentElement.style.cursor = cursor\n element.style.cursor = cursor\n scope.autoStart.cursorElement = cursor ? element : null\n}\n\nfunction setInteractionCursor<T extends Interact.ActionName> (interaction: Interact.Interaction<T>, scope: Interact.Scope) {\n const { interactable, element, prepared } = interaction\n\n if (!(interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor)) {\n // clear previous target element cursor\n if (scope.autoStart.cursorElement) {\n setCursor(scope.autoStart.cursorElement, '', scope)\n }\n\n return\n }\n\n let cursor = ''\n\n if (prepared.name) {\n const cursorChecker: Interact.CursorChecker = interactable.options[prepared.name].cursorChecker\n\n if (is.func(cursorChecker)) {\n cursor = cursorChecker(prepared, interactable, element, interaction._interacting)\n }\n else {\n cursor = scope.actions.map[prepared.name].getCursor(prepared)\n }\n }\n\n setCursor(interaction.element, cursor || '', scope)\n}\n\nconst autoStart: Interact.Plugin = {\n id: 'auto-start/base',\n before: ['actions', 'actions/drag', 'actions/resize', 'actions/gesture'],\n install,\n listeners: {\n 'interactions:down': prepareOnDown,\n 'interactions:move': (arg, scope) => {\n prepareOnMove(arg, scope)\n startOnMove(arg, scope)\n },\n 'interactions:stop': clearCursorOnStop,\n },\n maxInteractions,\n withinInteractionLimit,\n validateAction,\n} as Interact.Plugin\n\nexport default autoStart\n","import * as Interact from '@interactjs/types/index'\nimport { parentNode } from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\n\nimport autoStart from './base'\n\nfunction beforeStart ({ interaction, eventTarget, dx, dy }: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n if (interaction.prepared.name !== 'drag') { return }\n\n // check if a drag is in the correct axis\n const absX = Math.abs(dx)\n const absY = Math.abs(dy)\n const targetOptions = interaction.interactable.options.drag\n const startAxis = targetOptions.startAxis\n const currentAxis = (absX > absY ? 'x' : absX < absY ? 'y' : 'xy')\n\n interaction.prepared.axis = targetOptions.lockAxis === 'start'\n ? currentAxis[0] as 'x' | 'y' // always lock to one axis even if currentAxis === 'xy'\n : targetOptions.lockAxis\n\n // if the movement isn't in the startAxis of the interactable\n if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {\n // cancel the prepared action\n interaction.prepared.name = null\n\n // then try to get a drag from another ineractable\n let element = eventTarget as Interact.Element\n\n const getDraggable = function (interactable: Interact.Interactable): Interact.Interactable | void {\n if (interactable === interaction.interactable) { return }\n\n const options = interaction.interactable.options.drag\n\n if (!options.manualStart &&\n interactable.testIgnoreAllow(options, element, eventTarget)) {\n const action = interactable.getAction(\n interaction.downPointer, interaction.downEvent, interaction, element)\n\n if (action &&\n action.name === 'drag' &&\n checkStartAxis(currentAxis, interactable) &&\n autoStart.validateAction(action, interactable, element, eventTarget, scope)) {\n return interactable\n }\n }\n }\n\n // check all interactables\n while (is.element(element)) {\n const interactable = scope.interactables.forEachMatch(element, getDraggable)\n\n if (interactable) {\n interaction.prepared.name = 'drag'\n interaction.interactable = interactable\n interaction.element = element\n break\n }\n\n element = parentNode(element) as Interact.Element\n }\n }\n}\n\nfunction checkStartAxis (startAxis: string, interactable: Interact.Interactable) {\n if (!interactable) { return false }\n\n const thisAxis = interactable.options.drag.startAxis\n\n return (startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis)\n}\n\nexport default {\n id: 'auto-start/dragAxis',\n listeners: { 'autoStart:before-start': beforeStart },\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport basePlugin from './base'\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n hold?: number\n delay?: number\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n autoStartHoldTimer?: any\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n defaults,\n } = scope\n\n scope.usePlugin(basePlugin)\n\n defaults.perAction.hold = 0\n defaults.perAction.delay = 0\n}\n\nfunction getHoldDuration (interaction) {\n const actionName = interaction.prepared && interaction.prepared.name\n\n if (!actionName) { return null }\n\n const options = interaction.interactable.options\n\n return options[actionName].hold || options[actionName].delay\n}\n\nexport default {\n id: 'auto-start/hold',\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.autoStartHoldTimer = null\n },\n\n 'autoStart:prepared': ({ interaction }) => {\n const hold = getHoldDuration(interaction)\n\n if (hold > 0) {\n interaction.autoStartHoldTimer = setTimeout(() => {\n interaction.start(interaction.prepared, interaction.interactable, interaction.element)\n }, hold)\n }\n },\n\n 'interactions:move': ({ interaction, duplicate }) => {\n if (interaction.pointerWasMoved && !duplicate) {\n clearTimeout(interaction.autoStartHoldTimer)\n }\n },\n\n // prevent regular down->move autoStart\n 'autoStart:before-start': ({ interaction }) => {\n const hold = getHoldDuration(interaction)\n\n if (hold > 0) {\n interaction.prepared.name = null\n }\n },\n },\n getHoldDuration,\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport autoStart from './base'\nimport dragAxis from './dragAxis'\nimport hold from './hold'\n\nexport default {\n id: 'auto-start',\n install (scope: Interact.Scope) {\n scope.usePlugin(autoStart)\n scope.usePlugin(hold)\n scope.usePlugin(dragAxis)\n },\n}\n","export default {}\n","import * as Interact from '@interactjs/types/index'\nimport { matchesSelector, nodeContains } from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport { getWindow } from '@interactjs/utils/window'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n preventDefault: typeof preventDefault\n checkAndPreventDefault: (event: Event) => void\n }\n}\n\ntype PreventDefaultValue = 'always' | 'never' | 'auto'\nfunction preventDefault (this: Interact.Interactable): PreventDefaultValue\nfunction preventDefault (this: Interact.Interactable, newValue: PreventDefaultValue): typeof this\nfunction preventDefault (this: Interact.Interactable, newValue?: PreventDefaultValue) {\n if (/^(always|never|auto)$/.test(newValue)) {\n this.options.preventDefault = newValue\n return this\n }\n\n if (is.bool(newValue)) {\n this.options.preventDefault = newValue ? 'always' : 'never'\n return this\n }\n\n return this.options.preventDefault\n}\n\nfunction checkAndPreventDefault (interactable: Interact.Interactable, scope: Interact.Scope, event: Event) {\n const setting = interactable.options.preventDefault\n\n if (setting === 'never') { return }\n\n if (setting === 'always') {\n event.preventDefault()\n return\n }\n\n // setting === 'auto'\n\n // if the browser supports passive event listeners and isn't running on iOS,\n // don't preventDefault of touch{start,move} events. CSS touch-action and\n // user-select should be used instead of calling event.preventDefault().\n if (scope.events.supportsPassive && /^touch(start|move)$/.test(event.type)) {\n const doc = getWindow(event.target).document\n const docOptions = scope.getDocOptions(doc)\n\n if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {\n return\n }\n }\n\n // don't preventDefault of pointerdown events\n if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {\n return\n }\n\n // don't preventDefault on editable elements\n if (is.element(event.target) &&\n matchesSelector(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {\n return\n }\n\n event.preventDefault()\n}\n\nfunction onInteractionEvent ({ interaction, event }: { interaction: Interact.Interaction, event: Interact.PointerEventType }) {\n if (interaction.interactable) {\n interaction.interactable.checkAndPreventDefault(event as Event)\n }\n}\n\nexport function install (scope: Interact.Scope) {\n /** @lends Interactable */\n const { Interactable } = scope\n\n /**\n * Returns or sets whether to prevent the browser's default behaviour in\n * response to pointer events. Can be set to:\n * - `'always'` to always prevent\n * - `'never'` to never prevent\n * - `'auto'` to let interact.js try to determine what would be best\n *\n * @param {string} [newValue] `'always'`, `'never'` or `'auto'`\n * @return {string | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.preventDefault = preventDefault\n\n Interactable.prototype.checkAndPreventDefault = function (event) {\n return checkAndPreventDefault(this, scope, event)\n }\n\n // prevent native HTML5 drag on interact.js target elements\n scope.interactions.docEvents.push({\n type: 'dragstart',\n listener (event) {\n for (const interaction of scope.interactions.list) {\n if (interaction.element &&\n (interaction.element === event.target ||\n nodeContains(interaction.element, event.target))) {\n interaction.interactable.checkAndPreventDefault(event)\n return\n }\n }\n },\n })\n}\n\nexport default {\n id: 'core/interactablePreventDefault',\n install,\n listeners: ['down', 'move', 'up', 'cancel'].reduce((acc, eventType) => {\n acc[`interactions:${eventType}`] = onInteractionEvent\n return acc\n }, {} as any),\n}\n","/* eslint-disable no-console */\nimport * as Interact from '@interactjs/types/index'\nimport domObjects from '@interactjs/utils/domObjects'\nimport { parentNode } from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport win from '@interactjs/utils/window'\n\nimport visualizer from './visualizer/plugin'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n logger: Logger\n }\n}\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n visializer: typeof visualizer\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface BaseDefaults {\n devTools?: DevToolsOptions\n }\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n devTools: Interact.OptionMethod<DevToolsOptions>\n }\n}\n\nexport interface DevToolsOptions {\n ignore: { [P in keyof typeof CheckName]?: boolean }\n}\n\nexport interface Logger {\n warn: (...args: any[]) => void\n error: (...args: any[]) => void\n log: (...args: any[]) => void\n}\n\nexport interface Check {\n name: CheckName\n text: string\n perform: (interaction: Interact.Interaction) => boolean\n getInfo: (interaction: Interact.Interaction) => any[]\n}\n\nenum CheckName {\n touchAction = 'touchAction',\n boxSizing = 'boxSizing',\n noListeners = 'noListeners',\n}\n\nconst prefix = '[interact.js] '\nconst links = {\n touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action',\n boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing',\n}\n\n// eslint-disable-next-line no-undef\nconst isProduction = process.env.NODE_ENV === 'production'\n\n// eslint-disable-next-line no-restricted-syntax\nfunction install (scope: Interact.Scope, { logger }: { logger?: Logger } = {}) {\n const {\n Interactable,\n defaults,\n } = scope\n\n scope.logger = logger || console\n\n defaults.base.devTools = {\n ignore: {},\n }\n\n Interactable.prototype.devTools = function (options?: object) {\n if (options) {\n extend(this.options.devTools, options)\n return this\n }\n\n return this.options.devTools\n }\n}\n\nconst checks: Check[] = [\n {\n name: CheckName.touchAction,\n perform ({ element }) {\n return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/)\n },\n getInfo ({ element }) {\n return [\n element,\n links.touchAction,\n ]\n },\n text: 'Consider adding CSS \"touch-action: none\" to this element\\n',\n },\n\n {\n name: CheckName.boxSizing,\n perform (interaction) {\n const { element } = interaction\n\n return interaction.prepared.name === 'resize' &&\n element instanceof domObjects.HTMLElement &&\n !hasStyle(element, 'boxSizing', /border-box/)\n },\n text: 'Consider adding CSS \"box-sizing: border-box\" to this resizable element',\n getInfo ({ element }) {\n return [\n element,\n links.boxSizing,\n ]\n },\n },\n\n {\n name: CheckName.noListeners,\n perform (interaction) {\n const actionName = interaction.prepared.name\n const moveListeners = interaction.interactable.events.types[`${actionName}move`] || []\n\n return !moveListeners.length\n },\n getInfo (interaction) {\n return [\n interaction.prepared.name,\n interaction.interactable,\n ]\n },\n text: 'There are no listeners set for this action',\n },\n]\n\nfunction hasStyle (element: HTMLElement, prop: keyof CSSStyleDeclaration, styleRe: RegExp) {\n const value = element.style[prop] || win.window.getComputedStyle(element)[prop]\n return styleRe.test((value || '').toString())\n}\n\nfunction parentHasStyle (element: Interact.Element, prop: keyof CSSStyleDeclaration, styleRe: RegExp) {\n let parent = element as HTMLElement\n\n while (is.element(parent)) {\n if (hasStyle(parent, prop, styleRe)) {\n return true\n }\n\n parent = parentNode(parent) as HTMLElement\n }\n\n return false\n}\n\nconst id = 'dev-tools'\nconst defaultExport: Interact.Plugin = isProduction\n ? { id, install: () => {} }\n : {\n id,\n install,\n listeners: {\n 'interactions:action-start': ({ interaction }, scope) => {\n for (const check of checks) {\n const options = interaction.interactable && interaction.interactable.options\n\n if (\n !(options && options.devTools && options.devTools.ignore[check.name]) &&\n check.perform(interaction)\n ) {\n scope.logger.warn(prefix + check.text, ...check.getInfo(interaction))\n }\n }\n },\n },\n checks,\n CheckName,\n links,\n prefix,\n }\n\nexport default defaultExport\n","import * as arr from './arr'\nimport is from './is'\n\n// tslint:disable-next-line ban-types\nexport default function clone<T extends Object> (source: T): Partial<T> {\n const dest = {} as Partial<T>\n\n for (const prop in source) {\n const value = source[prop]\n\n if (is.plainObject(value)) {\n dest[prop] = clone(value) as any\n }\n else if (is.array(value)) {\n dest[prop] = arr.from(value) as typeof value\n }\n else {\n dest[prop] = value\n }\n }\n\n return dest\n}\n","import * as Interact from '@interactjs/types/index'\nimport clone from '@interactjs/utils/clone'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { Modifier, ModifierArg, ModifierState } from './base'\n\nexport interface ModificationResult {\n delta: Interact.Point\n rectDelta: Interact.Rect\n coords: Interact.Point\n rect: Interact.FullRect\n eventProps: any[]\n changed: boolean\n}\n\ninterface MethodArg {\n phase: Interact.EventPhase\n pageCoords?: Interact.Point\n rect?: Interact.FullRect\n coords?: Interact.Point\n preEnd?: boolean\n skipModifiers?: number\n}\n\nexport default class Modification {\n states: ModifierState[] = []\n startOffset: Interact.Rect = { left: 0, right: 0, top: 0, bottom: 0 }\n startDelta: Interact.Point = null\n result?: ModificationResult = null\n endResult?: Interact.Point = null\n edges: Interact.EdgeOptions\n readonly interaction: Readonly<Interact.Interaction>\n\n constructor (interaction: Interact.Interaction) {\n this.interaction = interaction\n this.result = createResult()\n }\n\n start (\n { phase }: MethodArg,\n pageCoords: Interact.Point,\n ) {\n const { interaction } = this\n const modifierList = getModifierList(interaction)\n this.prepareStates(modifierList)\n\n this.edges = extend({}, interaction.edges)\n this.startOffset = getRectOffset(interaction.rect, pageCoords)\n this.startDelta = { x: 0, y: 0 }\n\n const arg: MethodArg = {\n phase,\n pageCoords,\n preEnd: false,\n }\n\n this.result = createResult()\n this.startAll(arg)\n\n const result = this.result = this.setAll(arg)\n\n return result\n }\n\n fillArg (arg: Partial<ModifierArg>) {\n const { interaction } = this\n\n arg.interaction = interaction\n arg.interactable = interaction.interactable\n arg.element = interaction.element\n arg.rect = arg.rect || interaction.rect\n arg.edges = this.edges\n arg.startOffset = this.startOffset\n }\n\n startAll (arg: MethodArg & Partial<ModifierArg>) {\n this.fillArg(arg)\n\n for (const state of this.states) {\n if (state.methods.start) {\n arg.state = state\n state.methods.start(arg as ModifierArg)\n }\n }\n }\n\n setAll (arg: MethodArg & Partial<ModifierArg>): ModificationResult {\n this.fillArg(arg)\n\n const {\n phase,\n preEnd,\n skipModifiers,\n rect: unmodifiedRect,\n } = arg\n\n arg.coords = extend({}, arg.pageCoords)\n arg.rect = extend({}, unmodifiedRect)\n\n const states = skipModifiers\n ? this.states.slice(skipModifiers)\n : this.states\n\n const newResult = createResult(arg.coords, arg.rect)\n\n for (const state of states) {\n const { options } = state\n const lastModifierCoords = extend({}, arg.coords)\n let returnValue = null\n\n if (state.methods.set && this.shouldDo(options, preEnd, phase)) {\n arg.state = state\n returnValue = state.methods.set(arg as ModifierArg)\n\n rectUtils.addEdges(this.interaction.edges, arg.rect, { x: arg.coords.x - lastModifierCoords.x, y: arg.coords.y - lastModifierCoords.y })\n }\n\n newResult.eventProps.push(returnValue)\n }\n\n newResult.delta.x = arg.coords.x - arg.pageCoords.x\n newResult.delta.y = arg.coords.y - arg.pageCoords.y\n\n newResult.rectDelta.left = arg.rect.left - unmodifiedRect.left\n newResult.rectDelta.right = arg.rect.right - unmodifiedRect.right\n newResult.rectDelta.top = arg.rect.top - unmodifiedRect.top\n newResult.rectDelta.bottom = arg.rect.bottom - unmodifiedRect.bottom\n\n const prevCoords = this.result.coords\n const prevRect = this.result.rect\n\n if (prevCoords && prevRect) {\n const rectChanged = newResult.rect.left !== prevRect.left ||\n newResult.rect.right !== prevRect.right ||\n newResult.rect.top !== prevRect.top ||\n newResult.rect.bottom !== prevRect.bottom\n\n newResult.changed = rectChanged ||\n prevCoords.x !== newResult.coords.x ||\n prevCoords.y !== newResult.coords.y\n }\n\n return newResult\n }\n\n applyToInteraction (arg: { phase: Interact.EventPhase, rect?: Interact.Rect }) {\n const { interaction } = this\n const { phase } = arg\n const curCoords = interaction.coords.cur\n const startCoords = interaction.coords.start\n const { result, startDelta } = this\n const curDelta = result.delta\n\n if (phase === 'start') {\n extend(this.startDelta, result.delta)\n }\n\n for (const [coordsSet, delta] of [[startCoords, startDelta], [curCoords, curDelta]] as const) {\n coordsSet.page.x += delta.x\n coordsSet.page.y += delta.y\n coordsSet.client.x += delta.x\n coordsSet.client.y += delta.y\n }\n\n const { rectDelta } = this.result\n const rect = arg.rect || interaction.rect\n\n rect.left += rectDelta.left\n rect.right += rectDelta.right\n rect.top += rectDelta.top\n rect.bottom += rectDelta.bottom\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n setAndApply (arg: Partial<Interact.DoAnyPhaseArg> & {\n phase: Interact.EventPhase\n preEnd?: boolean\n skipModifiers?: number\n modifiedCoords?: Interact.Point\n }): void | false {\n const { interaction } = this\n const { phase, preEnd, skipModifiers } = arg\n\n const result = this.setAll({\n preEnd,\n phase,\n pageCoords: arg.modifiedCoords || interaction.coords.cur.page,\n })\n\n this.result = result\n\n // don't fire an action move if a modifier would keep the event in the same\n // cordinates as before\n if (!result.changed && (!skipModifiers || skipModifiers < this.states.length) && interaction.interacting()) {\n return false\n }\n\n if (arg.modifiedCoords) {\n const { page } = interaction.coords.cur\n const adjustment = {\n x: arg.modifiedCoords.x - page.x,\n y: arg.modifiedCoords.y - page.y,\n }\n\n result.coords.x += adjustment.x\n result.coords.y += adjustment.y\n result.delta.x += adjustment.x\n result.delta.y += adjustment.y\n }\n\n this.applyToInteraction(arg)\n }\n\n beforeEnd (arg: Omit<Interact.DoAnyPhaseArg, 'iEvent'> & { state?: ModifierState }): void | false {\n const { interaction, event } = arg\n const states = this.states\n\n if (!states || !states.length) {\n return\n }\n\n let doPreend = false\n\n for (const state of states) {\n arg.state = state\n const { options, methods } = state\n\n const endPosition = methods.beforeEnd && methods.beforeEnd(arg as unknown as ModifierArg)\n\n if (endPosition) {\n this.endResult = endPosition\n return false\n }\n\n doPreend = doPreend || (!doPreend && this.shouldDo(options, true, arg.phase, true))\n }\n\n if (doPreend) {\n // trigger a final modified move before ending\n interaction.move({ event, preEnd: true })\n }\n }\n\n stop (arg: { interaction: Interact.Interaction }) {\n const { interaction } = arg\n\n if (!this.states || !this.states.length) {\n return\n }\n\n const modifierArg: Partial<ModifierArg> = extend({\n states: this.states,\n interactable: interaction.interactable,\n element: interaction.element,\n rect: null,\n }, arg)\n\n this.fillArg(modifierArg)\n\n for (const state of this.states) {\n modifierArg.state = state\n\n if (state.methods.stop) { state.methods.stop(modifierArg as ModifierArg) }\n }\n\n this.states = null\n this.endResult = null\n }\n\n prepareStates (modifierList: Modifier[]) {\n this.states = []\n\n for (let index = 0; index < modifierList.length; index++) {\n const { options, methods, name } = modifierList[index]\n\n if (options && options.enabled === false) { continue }\n\n this.states.push({\n options,\n methods,\n index,\n name,\n })\n }\n\n return this.states\n }\n\n restoreInteractionCoords ({ interaction: { coords, rect, modification } }: { interaction: Interact.Interaction }) {\n if (!modification.result) { return }\n\n const { startDelta } = modification\n const { delta: curDelta, rectDelta } = modification.result\n\n const coordsAndDeltas = [\n [coords.start, startDelta],\n [coords.cur, curDelta],\n ]\n\n for (const [coordsSet, delta] of coordsAndDeltas as any) {\n coordsSet.page.x -= delta.x\n coordsSet.page.y -= delta.y\n coordsSet.client.x -= delta.x\n coordsSet.client.y -= delta.y\n }\n\n rect.left -= rectDelta.left\n rect.right -= rectDelta.right\n rect.top -= rectDelta.top\n rect.bottom -= rectDelta.bottom\n }\n\n shouldDo (options, preEnd?: boolean, phase?: string, requireEndOnly?: boolean) {\n if (\n // ignore disabled modifiers\n (!options || options.enabled === false) ||\n // check if we require endOnly option to fire move before end\n (requireEndOnly && !options.endOnly) ||\n // don't apply endOnly modifiers when not ending\n (options.endOnly && !preEnd) ||\n // check if modifier should run be applied on start\n (phase === 'start' && !options.setStart)\n ) {\n return false\n }\n\n return true\n }\n\n copyFrom (other: Modification) {\n this.startOffset = other.startOffset\n this.startDelta = other.startDelta\n this.edges = other.edges\n this.states = other.states.map(s => clone(s) as ModifierState)\n this.result = createResult(extend({}, other.result.coords), extend({}, other.result.rect))\n }\n\n destroy () {\n for (const prop in this) {\n this[prop] = null\n }\n }\n}\n\nfunction createResult (coords?: Interact.Point, rect?: Interact.FullRect): ModificationResult {\n return {\n rect,\n coords,\n delta: { x: 0, y: 0 },\n rectDelta: {\n left : 0,\n right : 0,\n top : 0,\n bottom: 0,\n },\n eventProps: [],\n changed: true,\n }\n}\n\nfunction getModifierList (interaction) {\n const actionOptions = interaction.interactable.options[interaction.prepared.name]\n const actionModifiers = actionOptions.modifiers\n\n if (actionModifiers && actionModifiers.length) {\n return actionModifiers.filter(\n modifier => !modifier.options || modifier.options.enabled !== false,\n )\n }\n\n return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize']\n .map(type => {\n const options = actionOptions[type]\n\n return options && options.enabled && {\n options,\n methods: options._methods,\n }\n })\n .filter(m => !!m)\n}\n\nexport function getRectOffset (rect, coords) {\n return rect\n ? {\n left : coords.x - rect.left,\n top : coords.y - rect.top,\n right : rect.right - coords.x,\n bottom: rect.bottom - coords.y,\n }\n : {\n left : 0,\n top : 0,\n right : 0,\n bottom: 0,\n }\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport Modification from './Modification'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n modification?: Modification\n }\n}\n\ndeclare module '@interactjs/core/InteractEvent' {\n interface InteractEvent {\n modifiers?: Array<{\n name: string\n [key: string]: any\n }>\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n modifiers?: Modifier[]\n }\n}\n\nexport interface Modifier<\n Defaults = any,\n State extends ModifierState = any,\n Name extends string = any\n> {\n options?: Defaults\n methods: {\n start?: (arg: ModifierArg<State>) => void\n set: (arg: ModifierArg<State>) => void\n beforeEnd?: (arg: ModifierArg<State>) => Interact.Point | void\n stop?: (arg: ModifierArg<State>) => void\n }\n name?: Name\n}\n\nexport type ModifierState<\n Defaults = {},\n StateProps extends { [prop: string]: any } = {},\n Name extends string = any\n> = {\n options: Defaults\n methods?: Modifier<Defaults>['methods']\n index?: number\n name?: Name\n} & StateProps\n\nexport interface ModifierArg<State extends ModifierState = ModifierState> {\n interaction: Interact.Interaction\n interactable: Interact.Interactable\n phase: Interact.EventPhase\n rect: Interact.FullRect\n edges: Interact.EdgeOptions\n state?: State\n element: Interact.Element\n pageCoords?: Interact.Point\n prevCoords?: Interact.Point\n prevRect?: Interact.FullRect\n coords?: Interact.Point\n startOffset?: Interact.Rect\n preEnd?: boolean\n}\n\nexport interface ModifierModule<\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n> {\n defaults?: Defaults\n start? (arg: ModifierArg<State>): void\n set? (arg: ModifierArg<State>): any\n beforeEnd? (arg: ModifierArg<State>): Interact.Point | void\n stop? (arg: ModifierArg<State>): void\n}\n\nexport interface ModifierFunction <\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n Name extends string,\n> {\n (_options?: Partial<Defaults>): Modifier<Defaults, State, Name>\n _defaults: Defaults\n _methods: ModifierModule<Defaults, State>\n}\n\nexport function makeModifier<\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n Name extends string\n> (\n module: ModifierModule<Defaults, State>,\n name?: Name,\n) {\n const { defaults } = module\n const methods = {\n start: module.start,\n set: module.set,\n beforeEnd: module.beforeEnd,\n stop: module.stop,\n }\n\n const modifier = (_options?: Partial<Defaults>) => {\n const options: Defaults = (_options || {}) as Defaults\n\n options.enabled = options.enabled !== false\n\n // add missing defaults to options\n for (const prop in defaults) {\n if (!(prop in options)) {\n options[prop] = defaults[prop]\n }\n }\n\n const m: Modifier<Defaults, State, Name> = { options, methods, name }\n\n return m\n }\n\n if (name && typeof name === 'string') {\n // for backwrads compatibility\n modifier._defaults = defaults\n modifier._methods = methods\n }\n\n return modifier\n}\n\nexport function addEventModifiers ({ iEvent, interaction: { modification: { result } } }: {\n iEvent: Interact.InteractEvent<Interact.ActionName, Interact.EventPhase>\n interaction: Interact.Interaction\n}) {\n if (result) {\n iEvent.modifiers = result.eventProps\n }\n}\n\nconst modifiersBase: Interact.Plugin = {\n id: 'modifiers/base',\n install: scope => {\n scope.defaults.perAction.modifiers = []\n },\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.modification = new Modification(interaction)\n },\n\n 'interactions:before-action-start': arg => {\n const { modification } = arg.interaction\n\n modification.start(arg, arg.interaction.coords.start.page)\n arg.interaction.edges = modification.edges\n modification.applyToInteraction(arg)\n },\n\n 'interactions:before-action-move': arg => arg.interaction.modification.setAndApply(arg),\n\n 'interactions:before-action-end': arg => arg.interaction.modification.beforeEnd(arg),\n\n 'interactions:action-start': addEventModifiers,\n 'interactions:action-move': addEventModifiers,\n 'interactions:action-end': addEventModifiers,\n\n 'interactions:after-action-start': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n 'interactions:after-action-move': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n\n 'interactions:stop': arg => arg.interaction.modification.stop(arg),\n },\n before: ['actions', 'action/drag', 'actions/resize', 'actions/gesture'],\n}\n\nexport default modifiersBase\n","import * as Interact from '@interactjs/types/index'\n\nexport interface Defaults {\n base: BaseDefaults\n perAction: PerActionDefaults\n actions: ActionDefaults\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ActionDefaults {\n}\n\nexport interface BaseDefaults {\n preventDefault?: 'auto' | 'never' | string\n deltaSource?: 'page' | 'client'\n context?: Node\n}\n\nexport interface PerActionDefaults {\n enabled?: boolean\n origin?: Interact.Point | string | Interact.Element\n listeners?: Interact.Listeners\n allowFrom?: string | Interact.Element\n ignoreFrom?: string | Interact.Element\n}\n\nexport type Options = Partial<BaseDefaults> & Partial<PerActionDefaults> & {\n [P in keyof ActionDefaults]?: Partial<ActionDefaults[P]>\n}\n\n// export interface Options extends BaseDefaults, PerActionDefaults {}\n\nexport interface OptionsArg extends BaseDefaults, Interact.OrBoolean<Partial<ActionDefaults>> {}\n\nexport const defaults: Defaults = {\n base: {\n preventDefault: 'auto',\n deltaSource: 'page',\n },\n\n perAction: {\n enabled: false,\n origin: { x: 0, y: 0 },\n },\n\n actions: {} as ActionDefaults,\n}\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport hypot from '@interactjs/utils/hypot'\n\nimport { BaseEvent } from './BaseEvent'\nimport { Interaction } from './Interaction'\nimport { defaults } from './defaultOptions'\n\nexport type EventPhase = keyof PhaseMap\n\nexport interface PhaseMap {\n start: true\n move: true\n end: true\n}\n\n// defined outside of class definition to avoid assignment of undefined during\n// construction\nexport interface InteractEvent {\n pageX: number\n pageY: number\n\n clientX: number\n clientY: number\n\n dx: number\n dy: number\n\n velocityX: number\n velocityY: number\n}\n\nexport class InteractEvent<\n T extends Interact.ActionName = never,\n P extends EventPhase = EventPhase,\n> extends BaseEvent<T> {\n target: Interact.Element\n currentTarget: Interact.Element\n relatedTarget: null = null\n screenX?: number\n screenY?: number\n button: number\n buttons: number\n ctrlKey: boolean\n shiftKey: boolean\n altKey: boolean\n metaKey: boolean\n page: Interact.Point\n client: Interact.Point\n delta: Interact.Point\n rect: Interact.FullRect\n x0: number\n y0: number\n t0: number\n dt: number\n duration: number\n clientX0: number\n clientY0: number\n velocity: Interact.Point\n speed: number\n swipe: ReturnType<InteractEvent<T>['getSwipe']>\n timeStamp: any\n // drag\n dragEnter?: Interact.Element\n dragLeave?: Interact.Element\n // resize\n axes?: 'x' | 'y' | 'xy'\n preEnd?: boolean\n\n /** */\n constructor (\n interaction: Interaction,\n event: Interact.PointerEventType,\n actionName: T,\n phase: P,\n element: Interact.Element,\n preEnd?: boolean,\n type?: string,\n ) {\n super(interaction)\n\n element = element || interaction.element\n\n const target = interaction.interactable\n const deltaSource = (((target && target.options) || defaults) as any).deltaSource as 'page' | 'client'\n const origin = getOriginXY(target, element, actionName)\n const starting = phase === 'start'\n const ending = phase === 'end'\n const prevEvent = starting ? this : interaction.prevEvent\n const coords = starting\n ? interaction.coords.start\n : ending\n ? { page: prevEvent.page, client: prevEvent.client, timeStamp: interaction.coords.cur.timeStamp }\n : interaction.coords.cur\n\n this.page = extend({}, coords.page)\n this.client = extend({}, coords.client)\n this.rect = extend({}, interaction.rect)\n this.timeStamp = coords.timeStamp\n\n if (!ending) {\n this.page.x -= origin.x\n this.page.y -= origin.y\n\n this.client.x -= origin.x\n this.client.y -= origin.y\n }\n\n this.ctrlKey = event.ctrlKey\n this.altKey = event.altKey\n this.shiftKey = event.shiftKey\n this.metaKey = event.metaKey\n this.button = (event as MouseEvent).button\n this.buttons = (event as MouseEvent).buttons\n this.target = element\n this.currentTarget = element\n this.preEnd = preEnd\n this.type = type || (actionName + (phase || ''))\n this.interactable = target\n\n this.t0 = starting\n ? interaction.pointers[interaction.pointers.length - 1].downTime\n : prevEvent.t0\n\n this.x0 = interaction.coords.start.page.x - origin.x\n this.y0 = interaction.coords.start.page.y - origin.y\n this.clientX0 = interaction.coords.start.client.x - origin.x\n this.clientY0 = interaction.coords.start.client.y - origin.y\n\n if (starting || ending) {\n this.delta = { x: 0, y: 0 }\n }\n else {\n this.delta = {\n x: this[deltaSource].x - prevEvent[deltaSource].x,\n y: this[deltaSource].y - prevEvent[deltaSource].y,\n }\n }\n\n this.dt = interaction.coords.delta.timeStamp\n this.duration = this.timeStamp - this.t0\n\n // velocity and speed in pixels per second\n this.velocity = extend({}, interaction.coords.velocity[deltaSource])\n this.speed = hypot(this.velocity.x, this.velocity.y)\n\n this.swipe = (ending || phase === 'inertiastart') ? this.getSwipe() : null\n }\n\n getSwipe () {\n const interaction = this._interaction\n\n if (interaction.prevEvent.speed < 600 ||\n this.timeStamp - interaction.prevEvent.timeStamp > 150) {\n return null\n }\n\n let angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI\n const overlap = 22.5\n\n if (angle < 0) {\n angle += 360\n }\n\n const left = 135 - overlap <= angle && angle < 225 + overlap\n const up = 225 - overlap <= angle && angle < 315 + overlap\n\n const right = !left && (315 - overlap <= angle || angle < 45 + overlap)\n const down = !up && 45 - overlap <= angle && angle < 135 + overlap\n\n return {\n up,\n down,\n left,\n right,\n angle,\n speed: interaction.prevEvent.speed,\n velocity: {\n x: interaction.prevEvent.velocityX,\n y: interaction.prevEvent.velocityY,\n },\n }\n }\n\n preventDefault () {}\n\n /**\n * Don't call listeners on the remaining targets\n */\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n\n /**\n * Don't call any other listeners (even on the current target)\n */\n stopPropagation () {\n this.propagationStopped = true\n }\n}\n\n// getters and setters defined here to support typescript 3.6 and below which\n// don't support getter and setters in .d.ts files\nObject.defineProperties(InteractEvent.prototype, {\n pageX: { get () { return this.page.x }, set (value) { this.page.x = value } },\n pageY: { get () { return this.page.y }, set (value) { this.page.y = value } },\n\n clientX: { get () { return this.client.x }, set (value) { this.client.x = value } },\n clientY: { get () { return this.client.y }, set (value) { this.client.y = value } },\n\n dx: { get () { return this.delta.x }, set (value) { this.delta.x = value } },\n dy: { get () { return this.delta.y }, set (value) { this.delta.y = value } },\n\n velocityX: { get () { return this.velocity.x }, set (value) { this.velocity.x = value } },\n velocityY: { get () { return this.velocity.y }, set (value) { this.velocity.y = value } },\n\n})\n","import * as Interact from '@interactjs/types/index'\n\nexport class PointerInfo {\n id: number\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n downTime: number\n downTarget: Interact.EventTarget\n\n constructor (\n id: number,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n downTime: number,\n downTarget: Interact.EventTarget,\n ) {\n this.id = id\n this.pointer = pointer\n this.event = event\n this.downTime = downTime\n this.downTarget = downTarget\n }\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport hypot from '@interactjs/utils/hypot'\nimport { warnOnce, copyAction } from '@interactjs/utils/misc'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { InteractEvent, EventPhase } from './InteractEvent'\nimport { Interactable } from './Interactable'\nimport { PointerInfo } from './PointerInfo'\nimport { ActionName } from './scope'\n\nexport interface ActionProps<T extends ActionName = Interact.ActionName> {\n name: T\n axis?: 'x' | 'y' | 'xy'\n edges?: Interact.EdgeOptions\n}\n\nexport interface StartAction extends ActionProps {\n name: ActionName\n}\n\nexport enum _ProxyValues {\n interactable = '',\n element = '',\n prepared = '',\n pointerIsDown = '',\n pointerWasMoved = '',\n _proxy = ''\n}\n\nexport enum _ProxyMethods {\n start = '',\n move = '',\n end = '',\n stop = '',\n interacting = ''\n}\n\nexport type PointerArgProps<T extends {} = {}> = {\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n eventTarget: Interact.EventTarget\n pointerIndex: number\n pointerInfo: PointerInfo\n interaction: Interaction\n} & T\n\nexport interface DoPhaseArg<T extends ActionName, P extends EventPhase> {\n event: Interact.PointerEventType\n phase: EventPhase\n interaction: Interaction<T>\n iEvent: InteractEvent<T, P>\n preEnd?: boolean\n type?: string\n}\n\nexport type DoAnyPhaseArg = DoPhaseArg<ActionName, EventPhase>\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:new': { interaction: Interaction }\n 'interactions:down': PointerArgProps<{\n type: 'down'\n }>\n 'interactions:move': PointerArgProps<{\n type: 'move'\n dx: number\n dy: number\n duplicate: boolean\n }>\n 'interactions:up': PointerArgProps<{\n type: 'up'\n curEventTarget: EventTarget\n }>\n 'interactions:cancel': SignalArgs['interactions:up'] & {\n type: 'cancel'\n curEventTarget: EventTarget\n }\n 'interactions:update-pointer': PointerArgProps<{\n down: boolean\n }>\n 'interactions:remove-pointer': PointerArgProps\n 'interactions:blur': { interaction: Interaction, event: Event, type: 'blur' }\n 'interactions:before-action-start': Omit<DoAnyPhaseArg, 'iEvent'>\n 'interactions:action-start': DoAnyPhaseArg\n 'interactions:after-action-start': DoAnyPhaseArg\n 'interactions:before-action-move': Omit<DoAnyPhaseArg, 'iEvent'>\n 'interactions:action-move': DoAnyPhaseArg\n 'interactions:after-action-move': DoAnyPhaseArg\n 'interactions:before-action-end': Omit<DoAnyPhaseArg, 'iEvent'>\n 'interactions:action-end': DoAnyPhaseArg\n 'interactions:after-action-end': DoAnyPhaseArg\n 'interactions:stop': { interaction: Interaction }\n }\n}\n\nexport type InteractionProxy<T extends ActionName = ActionName> = Pick<\nInteraction<T>,\nkeyof typeof _ProxyValues | keyof typeof _ProxyMethods\n>\n\nlet idCounter = 0\n\nexport class Interaction<T extends ActionName = ActionName> {\n // current interactable being interacted with\n interactable: Interactable = null\n\n // the target element of the interactable\n element: Interact.Element = null\n rect: Interact.FullRect\n _rects?: {\n start: Interact.FullRect\n corrected: Interact.FullRect\n previous: Interact.FullRect\n delta: Interact.FullRect\n }\n edges: Interact.EdgeOptions\n\n _scopeFire: Interact.Scope['fire']\n\n // action that's ready to be fired on next move event\n prepared: ActionProps<T> = {\n name : null,\n axis : null,\n edges: null,\n }\n\n pointerType: string\n\n // keep track of added pointers\n pointers: PointerInfo[] = []\n\n // pointerdown/mousedown/touchstart event\n downEvent: Interact.PointerEventType = null\n\n downPointer: Interact.PointerType = {} as Interact.PointerType\n\n _latestPointer: {\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n eventTarget: Node\n } = {\n pointer: null,\n event: null,\n eventTarget: null,\n }\n\n // previous action event\n prevEvent: InteractEvent<T, EventPhase> = null\n\n pointerIsDown = false\n pointerWasMoved = false\n _interacting = false\n _ending = false\n _stopped = true\n _proxy: InteractionProxy<T> = null\n\n simulation = null\n\n /** @internal */ get pointerMoveTolerance () {\n return 1\n }\n\n /**\n * @alias Interaction.prototype.move\n */\n doMove = warnOnce(\n function (this: Interaction, signalArg: any) {\n this.move(signalArg)\n },\n 'The interaction.doMove() method has been renamed to interaction.move()')\n\n coords: Interact.CoordsSet = {\n // Starting InteractEvent pointer coordinates\n start: pointerUtils.newCoords(),\n // Previous native pointer move event coordinates\n prev: pointerUtils.newCoords(),\n // current native pointer move event coordinates\n cur: pointerUtils.newCoords(),\n // Change in coordinates and time of the pointer\n delta: pointerUtils.newCoords(),\n // pointer velocity\n velocity: pointerUtils.newCoords(),\n }\n\n readonly _id: number = idCounter++\n\n /** */\n constructor ({ pointerType, scopeFire }: {\n pointerType?: string\n scopeFire: Interact.Scope['fire']\n }) {\n this._scopeFire = scopeFire\n this.pointerType = pointerType\n\n const that = this\n\n this._proxy = {} as InteractionProxy<T>\n\n for (const key in _ProxyValues) {\n Object.defineProperty(this._proxy, key, {\n get () { return that[key] },\n })\n }\n\n for (const key in _ProxyMethods) {\n Object.defineProperty(this._proxy, key, {\n value: (...args: any[]) => that[key](...args),\n })\n }\n\n this._scopeFire('interactions:new', { interaction: this })\n }\n\n pointerDown (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget) {\n const pointerIndex = this.updatePointer(pointer, event, eventTarget, true)\n const pointerInfo = this.pointers[pointerIndex]\n\n this._scopeFire('interactions:down', {\n pointer,\n event,\n eventTarget,\n pointerIndex,\n pointerInfo,\n type: 'down',\n interaction: this,\n })\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable({\n * // disable the default drag start by down->move\n * manualStart: true\n * })\n * // start dragging after the user holds the pointer down\n * .on('hold', function (event) {\n * var interaction = event.interaction\n *\n * if (!interaction.interacting()) {\n * interaction.start({ name: 'drag' },\n * event.interactable,\n * event.currentTarget)\n * }\n * })\n * ```\n *\n * Start an action with the given Interactable and Element as tartgets. The\n * action must be enabled for the target Interactable and an appropriate\n * number of pointers must be held down - 1 for drag/resize, 2 for gesture.\n *\n * Use it with `interactable.<action>able({ manualStart: false })` to always\n * [start actions manually](https://github.com/taye/interact.js/issues/114)\n *\n * @param {object} action The action to be performed - drag, resize, etc.\n * @param {Interactable} target The Interactable to target\n * @param {Element} element The DOM Element to target\n * @return {object} interact\n */\n start (action: StartAction, interactable: Interactable, element: Interact.Element) {\n if (this.interacting() ||\n !this.pointerIsDown ||\n this.pointers.length < (action.name === 'gesture' ? 2 : 1) ||\n !interactable.options[action.name].enabled) {\n return false\n }\n\n copyAction(this.prepared, action)\n\n this.interactable = interactable\n this.element = element\n this.rect = interactable.getRect(element)\n this.edges = this.prepared.edges\n ? extend({}, this.prepared.edges)\n : { left: true, right: true, top: true, bottom: true }\n this._stopped = false\n this._interacting = this._doPhase({\n interaction: this,\n event: this.downEvent,\n phase: 'start',\n }) && !this._stopped\n\n return this._interacting\n }\n\n pointerMove (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget) {\n if (!this.simulation && !(this.modification && this.modification.endResult)) {\n this.updatePointer(pointer, event, eventTarget, false)\n }\n\n const duplicateMove = (this.coords.cur.page.x === this.coords.prev.page.x &&\n this.coords.cur.page.y === this.coords.prev.page.y &&\n this.coords.cur.client.x === this.coords.prev.client.x &&\n this.coords.cur.client.y === this.coords.prev.client.y)\n\n let dx: number\n let dy: number\n\n // register movement greater than pointerMoveTolerance\n if (this.pointerIsDown && !this.pointerWasMoved) {\n dx = this.coords.cur.client.x - this.coords.start.client.x\n dy = this.coords.cur.client.y - this.coords.start.client.y\n\n this.pointerWasMoved = hypot(dx, dy) > this.pointerMoveTolerance\n }\n\n const pointerIndex = this.getPointerIndex(pointer)\n const signalArg = {\n pointer,\n pointerIndex,\n pointerInfo: this.pointers[pointerIndex],\n event,\n type: 'move' as const,\n eventTarget,\n dx,\n dy,\n duplicate: duplicateMove,\n interaction: this,\n }\n\n if (!duplicateMove) {\n // set pointer coordinate, time changes and velocity\n pointerUtils.setCoordVelocity(this.coords.velocity, this.coords.delta)\n }\n\n this._scopeFire('interactions:move', signalArg)\n\n if (!duplicateMove && !this.simulation) {\n // if interacting, fire an 'action-move' signal etc\n if (this.interacting()) {\n signalArg.type = null\n this.move(signalArg)\n }\n\n if (this.pointerWasMoved) {\n pointerUtils.copyCoords(this.coords.prev, this.coords.cur)\n }\n }\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable(true)\n * .on('dragmove', function (event) {\n * if (someCondition) {\n * // change the snap settings\n * event.interactable.draggable({ snap: { targets: [] }})\n * // fire another move event with re-calculated snap\n * event.interaction.move()\n * }\n * })\n * ```\n *\n * Force a move of the current action at the same coordinates. Useful if\n * snap/restrict has been changed and you want a movement with the new\n * settings.\n */\n move (signalArg?: any) {\n if (!signalArg || !signalArg.event) {\n pointerUtils.setZeroCoords(this.coords.delta)\n }\n\n signalArg = extend({\n pointer: this._latestPointer.pointer,\n event: this._latestPointer.event,\n eventTarget: this._latestPointer.eventTarget,\n interaction: this,\n }, signalArg || {})\n\n signalArg.phase = 'move'\n\n this._doPhase(signalArg)\n }\n\n // End interact move events and stop auto-scroll unless simulation is running\n pointerUp (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget, curEventTarget: Interact.EventTarget) {\n let pointerIndex = this.getPointerIndex(pointer)\n\n if (pointerIndex === -1) {\n pointerIndex = this.updatePointer(pointer, event, eventTarget, false)\n }\n\n const type = /cancel$/i.test(event.type) ? 'cancel' : 'up'\n\n this._scopeFire(`interactions:${type}` as 'interactions:up' | 'interactions:cancel', {\n pointer,\n pointerIndex,\n pointerInfo: this.pointers[pointerIndex],\n event,\n eventTarget,\n type: type as any,\n curEventTarget,\n interaction: this,\n })\n\n if (!this.simulation) {\n this.end(event)\n }\n\n this.pointerIsDown = false\n this.removePointer(pointer, event)\n }\n\n documentBlur (event: Event) {\n this.end(event as any)\n this._scopeFire('interactions:blur', { event, type: 'blur', interaction: this })\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable(true)\n * .on('move', function (event) {\n * if (event.pageX > 1000) {\n * // end the current action\n * event.interaction.end()\n * // stop all further listeners from being called\n * event.stopImmediatePropagation()\n * }\n * })\n * ```\n *\n * @param {PointerEvent} [event]\n */\n end (event?: Interact.PointerEventType) {\n this._ending = true\n event = event || this._latestPointer.event\n let endPhaseResult: boolean\n\n if (this.interacting()) {\n endPhaseResult = this._doPhase({\n event,\n interaction: this,\n phase: 'end',\n })\n }\n\n this._ending = false\n\n if (endPhaseResult === true) {\n this.stop()\n }\n }\n\n currentAction () {\n return this._interacting ? this.prepared.name : null\n }\n\n interacting () {\n return this._interacting\n }\n\n /** */\n stop () {\n this._scopeFire('interactions:stop', { interaction: this })\n\n this.interactable = this.element = null\n\n this._interacting = false\n this._stopped = true\n this.prepared.name = this.prevEvent = null\n }\n\n getPointerIndex (pointer: Interact.PointerType) {\n const pointerId = pointerUtils.getPointerId(pointer)\n\n // mouse and pen interactions may have only one pointer\n return (this.pointerType === 'mouse' || this.pointerType === 'pen')\n ? this.pointers.length - 1\n : arr.findIndex(this.pointers, curPointer => curPointer.id === pointerId)\n }\n\n getPointerInfo (pointer: any) {\n return this.pointers[this.getPointerIndex(pointer)]\n }\n\n updatePointer (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget, down?: boolean) {\n const id = pointerUtils.getPointerId(pointer)\n let pointerIndex = this.getPointerIndex(pointer)\n let pointerInfo = this.pointers[pointerIndex]\n\n down = down === false\n ? false\n : down || /(down|start)$/i.test(event.type)\n\n if (!pointerInfo) {\n pointerInfo = new PointerInfo(\n id,\n pointer,\n event,\n null,\n null,\n )\n\n pointerIndex = this.pointers.length\n this.pointers.push(pointerInfo)\n }\n else {\n pointerInfo.pointer = pointer\n }\n\n pointerUtils.setCoords(this.coords.cur, this.pointers.map(p => p.pointer), this._now())\n pointerUtils.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur)\n\n if (down) {\n this.pointerIsDown = true\n\n pointerInfo.downTime = this.coords.cur.timeStamp\n pointerInfo.downTarget = eventTarget\n pointerUtils.pointerExtend(this.downPointer, pointer)\n\n if (!this.interacting()) {\n pointerUtils.copyCoords(this.coords.start, this.coords.cur)\n pointerUtils.copyCoords(this.coords.prev, this.coords.cur)\n\n this.downEvent = event\n this.pointerWasMoved = false\n }\n }\n\n this._updateLatestPointer(pointer, event, eventTarget)\n\n this._scopeFire('interactions:update-pointer', {\n pointer,\n event,\n eventTarget,\n down,\n pointerInfo,\n pointerIndex,\n interaction: this,\n })\n\n return pointerIndex\n }\n\n removePointer (pointer: Interact.PointerType, event: Interact.PointerEventType) {\n const pointerIndex = this.getPointerIndex(pointer)\n\n if (pointerIndex === -1) { return }\n\n const pointerInfo = this.pointers[pointerIndex]\n\n this._scopeFire('interactions:remove-pointer', {\n pointer,\n event,\n eventTarget: null,\n pointerIndex,\n pointerInfo,\n interaction: this,\n })\n\n this.pointers.splice(pointerIndex, 1)\n }\n\n _updateLatestPointer (pointer, event, eventTarget) {\n this._latestPointer.pointer = pointer\n this._latestPointer.event = event\n this._latestPointer.eventTarget = eventTarget\n }\n\n destroy () {\n this._latestPointer.pointer = null\n this._latestPointer.event = null\n this._latestPointer.eventTarget = null\n }\n\n _createPreparedEvent<P extends EventPhase> (event: Interact.PointerEventType, phase: P, preEnd?: boolean, type?: string) {\n return new InteractEvent<T, P>(this, event, this.prepared.name, phase, this.element, preEnd, type)\n }\n\n _fireEvent<P extends EventPhase> (iEvent: InteractEvent<T, P>) {\n this.interactable.fire(iEvent)\n\n if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {\n this.prevEvent = iEvent\n }\n }\n\n _doPhase<P extends EventPhase> (signalArg: Omit<DoPhaseArg<T, P>, 'iEvent'> & { iEvent?: InteractEvent<T, P> }) {\n const { event, phase, preEnd, type } = signalArg\n const { rect } = this\n\n if (rect && phase === 'move') {\n // update the rect changes due to pointer move\n rectUtils.addEdges(this.edges, rect, this.coords.delta[this.interactable.options.deltaSource])\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n const beforeResult = this._scopeFire(`interactions:before-action-${phase}` as any, signalArg)\n\n if (beforeResult === false) {\n return false\n }\n\n const iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type)\n\n this._scopeFire(`interactions:action-${phase}` as any, signalArg)\n\n if (phase === 'start') { this.prevEvent = iEvent }\n\n this._fireEvent(iEvent)\n\n this._scopeFire(`interactions:after-action-${phase}` as any, signalArg)\n\n return true\n }\n\n _now () { return Date.now() }\n}\n\nexport default Interaction\nexport { PointerInfo }\n","import { _ProxyMethods } from '@interactjs/core/Interaction'\nimport * as Interact from '@interactjs/types/index'\nimport * as rectUtils from '@interactjs/utils/rect'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n offsetBy?: typeof offsetBy\n offset: {\n total: Interact.Point\n pending: Interact.Point\n }\n }\n\n // eslint-disable-next-line no-shadow\n enum _ProxyMethods {\n // eslint-disable-next-line no-shadow\n offsetBy = ''\n }\n}\n\n(_ProxyMethods as any).offsetBy = ''\n\nexport function addTotal (interaction: Interact.Interaction) {\n if (!interaction.pointerIsDown) { return }\n\n addToCoords(interaction.coords.cur, interaction.offset.total)\n\n interaction.offset.pending.x = 0\n interaction.offset.pending.y = 0\n}\n\nfunction beforeAction ({ interaction }: { interaction: Interact.Interaction }) {\n applyPending(interaction)\n}\n\nfunction beforeEnd ({ interaction }: { interaction: Interact.Interaction }): boolean | void {\n const hadPending = applyPending(interaction)\n\n if (!hadPending) { return }\n\n interaction.move({ offset: true })\n interaction.end()\n\n return false\n}\n\nfunction end ({ interaction }: { interaction: Interact.Interaction }) {\n interaction.offset.total.x = 0\n interaction.offset.total.y = 0\n interaction.offset.pending.x = 0\n interaction.offset.pending.y = 0\n}\n\nexport function applyPending (interaction: Interact.Interaction) {\n if (!hasPending(interaction)) {\n return false\n }\n\n const { pending } = interaction.offset\n\n addToCoords(interaction.coords.cur, pending)\n addToCoords(interaction.coords.delta, pending)\n rectUtils.addEdges(interaction.edges, interaction.rect, pending)\n\n pending.x = 0\n pending.y = 0\n\n return true\n}\n\nfunction offsetBy (this: Interact.Interaction, { x, y }: Interact.Point) {\n this.offset.pending.x += x\n this.offset.pending.y += y\n\n this.offset.total.x += x\n this.offset.total.y += y\n}\n\nfunction addToCoords ({ page, client }, { x, y }: Interact.Point) {\n page.x += x\n page.y += y\n client.x += x\n client.y += y\n}\n\nfunction hasPending (interaction) {\n return !!(interaction.offset.pending.x || interaction.offset.pending.y)\n}\n\nconst offset: Interact.Plugin = {\n id: 'offset',\n install (scope) {\n scope.Interaction.prototype.offsetBy = offsetBy\n },\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.offset = {\n total: { x: 0, y: 0 },\n pending: { x: 0, y: 0 },\n }\n },\n 'interactions:update-pointer': ({ interaction }) => addTotal(interaction),\n 'interactions:before-action-start': beforeAction,\n 'interactions:before-action-move': beforeAction,\n 'interactions:before-action-end': beforeEnd,\n 'interactions:stop': end,\n },\n}\n\nexport default offset\n","import Modification from '@interactjs/modifiers/Modification'\nimport * as modifiers from '@interactjs/modifiers/base'\nimport offset from '@interactjs/offset/plugin'\nimport * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\nimport hypot from '@interactjs/utils/hypot'\nimport is from '@interactjs/utils/is'\nimport { copyCoords } from '@interactjs/utils/pointerUtils'\nimport raf from '@interactjs/utils/raf'\n\ndeclare module '@interactjs/core/InteractEvent' {\n // eslint-disable-next-line no-shadow\n interface PhaseMap {\n resume?: true\n inertiastart?: true\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n inertia?: InertiaState\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n inertia?: {\n enabled?: boolean\n resistance?: number // the lambda in exponential decay\n minSpeed?: number // target speed must be above this for inertia to start\n endSpeed?: number // the speed at which inertia is slow enough to stop\n allowResume?: true // allow resuming an action in inertia phase\n smoothEndDuration?: number // animate to snap/restrict endOnly if there's no inertia\n }\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:before-action-inertiastart': Omit<Interact.DoPhaseArg<Interact.ActionName, 'inertiastart'>, 'iEvent'>\n 'interactions:action-inertiastart': Interact.DoPhaseArg<Interact.ActionName, 'inertiastart'>\n 'interactions:after-action-inertiastart': Interact.DoPhaseArg<Interact.ActionName, 'inertiastart'>\n 'interactions:before-action-resume': Omit<Interact.DoPhaseArg<Interact.ActionName, 'resume'>, 'iEvent'>\n 'interactions:action-resume': Interact.DoPhaseArg<Interact.ActionName, 'resume'>\n 'interactions:after-action-resume': Interact.DoPhaseArg<Interact.ActionName, 'resume'>\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n defaults,\n } = scope\n\n scope.usePlugin(offset)\n scope.usePlugin(modifiers.default)\n scope.actions.phases.inertiastart = true\n scope.actions.phases.resume = true\n\n defaults.perAction.inertia = {\n enabled : false,\n resistance : 10, // the lambda in exponential decay\n minSpeed : 100, // target speed must be above this for inertia to start\n endSpeed : 10, // the speed at which inertia is slow enough to stop\n allowResume : true, // allow resuming an action in inertia phase\n smoothEndDuration: 300, // animate to snap/restrict endOnly if there's no inertia\n }\n}\n\nexport class InertiaState {\n active = false\n isModified = false\n smoothEnd = false\n allowResume = false\n\n modification: Modification = null\n modifierCount = 0\n modifierArg: modifiers.ModifierArg = null\n\n startCoords: Interact.Point = null\n t0 = 0\n v0 = 0\n\n te = 0\n targetOffset: Interact.Point = null\n modifiedOffset: Interact.Point = null\n currentOffset: Interact.Point = null\n\n lambda_v0? = 0 // eslint-disable-line camelcase\n one_ve_v0? = 0 // eslint-disable-line camelcase\n timeout: number = null\n readonly interaction: Interact.Interaction\n\n constructor (interaction: Interact.Interaction) {\n this.interaction = interaction\n }\n\n start (event: Interact.PointerEventType) {\n const { interaction } = this\n const options = getOptions(interaction)\n\n if (!options || !options.enabled) {\n return false\n }\n\n const { client: velocityClient } = interaction.coords.velocity\n const pointerSpeed = hypot(velocityClient.x, velocityClient.y)\n const modification = this.modification || (this.modification = new Modification(interaction))\n\n modification.copyFrom(interaction.modification)\n\n this.t0 = interaction._now()\n this.allowResume = options.allowResume\n this.v0 = pointerSpeed\n this.currentOffset = { x: 0, y: 0 }\n this.startCoords = interaction.coords.cur.page\n\n this.modifierArg = {\n interaction,\n interactable: interaction.interactable,\n element: interaction.element,\n rect: interaction.rect,\n edges: interaction.edges,\n pageCoords: this.startCoords,\n preEnd: true,\n phase: 'inertiastart',\n }\n\n const thrown = (\n (this.t0 - interaction.coords.cur.timeStamp) < 50 &&\n pointerSpeed > options.minSpeed &&\n pointerSpeed > options.endSpeed\n )\n\n if (thrown) {\n this.startInertia()\n } else {\n modification.result = modification.setAll(this.modifierArg)\n\n if (!modification.result.changed) {\n return false\n }\n\n this.startSmoothEnd()\n }\n\n // force modification change\n interaction.modification.result.rect = null\n\n // bring inertiastart event to the target coords\n interaction.offsetBy(this.targetOffset)\n interaction._doPhase({\n interaction,\n event,\n phase: 'inertiastart',\n })\n interaction.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y })\n // force modification change\n interaction.modification.result.rect = null\n\n this.active = true\n interaction.simulation = this\n\n return true\n }\n\n startInertia () {\n const startVelocity = this.interaction.coords.velocity.client\n const options = getOptions(this.interaction)\n const lambda = options.resistance\n const inertiaDur = -Math.log(options.endSpeed / this.v0) / lambda\n\n this.targetOffset = {\n x: (startVelocity.x - inertiaDur) / lambda,\n y: (startVelocity.y - inertiaDur) / lambda,\n }\n\n this.te = inertiaDur\n this.lambda_v0 = lambda / this.v0\n this.one_ve_v0 = 1 - options.endSpeed / this.v0\n\n const { modification, modifierArg } = this\n\n modifierArg.pageCoords = {\n x: this.startCoords.x + this.targetOffset.x,\n y: this.startCoords.y + this.targetOffset.y,\n }\n\n modification.result = modification.setAll(modifierArg)\n\n if (modification.result.changed) {\n this.isModified = true\n this.modifiedOffset = {\n x: this.targetOffset.x + modification.result.delta.x,\n y: this.targetOffset.y + modification.result.delta.y,\n }\n }\n\n this.timeout = raf.request(() => this.inertiaTick())\n }\n\n startSmoothEnd () {\n this.smoothEnd = true\n this.isModified = true\n this.targetOffset = {\n x: this.modification.result.delta.x,\n y: this.modification.result.delta.y,\n }\n\n this.timeout = raf.request(() => this.smoothEndTick())\n }\n\n inertiaTick () {\n const { interaction } = this\n const options = getOptions(interaction)\n const lambda = options.resistance\n const t = (interaction._now() - this.t0) / 1000\n\n if (t < this.te) {\n const progress = 1 - (Math.exp(-lambda * t) - this.lambda_v0) / this.one_ve_v0\n let newOffset: Interact.Point\n\n if (this.isModified) {\n newOffset = getQuadraticCurvePoint(\n 0, 0,\n this.targetOffset.x, this.targetOffset.y,\n this.modifiedOffset.x, this.modifiedOffset.y,\n progress,\n )\n }\n else {\n newOffset = {\n x: this.targetOffset.x * progress,\n y: this.targetOffset.y * progress,\n }\n }\n\n const delta = { x: newOffset.x - this.currentOffset.x, y: newOffset.y - this.currentOffset.y }\n\n this.currentOffset.x += delta.x\n this.currentOffset.y += delta.y\n\n interaction.offsetBy(delta)\n interaction.move()\n\n this.timeout = raf.request(() => this.inertiaTick())\n }\n else {\n interaction.offsetBy({\n x: this.modifiedOffset.x - this.currentOffset.x,\n y: this.modifiedOffset.y - this.currentOffset.y,\n })\n\n this.end()\n }\n }\n\n smoothEndTick () {\n const { interaction } = this\n const t = interaction._now() - this.t0\n const { smoothEndDuration: duration } = getOptions(interaction)\n\n if (t < duration) {\n const newOffset = {\n x: easeOutQuad(t, 0, this.targetOffset.x, duration),\n y: easeOutQuad(t, 0, this.targetOffset.y, duration),\n }\n const delta = {\n x: newOffset.x - this.currentOffset.x,\n y: newOffset.y - this.currentOffset.y,\n }\n\n this.currentOffset.x += delta.x\n this.currentOffset.y += delta.y\n\n interaction.offsetBy(delta)\n interaction.move({ skipModifiers: this.modifierCount })\n\n this.timeout = raf.request(() => this.smoothEndTick())\n }\n else {\n interaction.offsetBy({\n x: this.targetOffset.x - this.currentOffset.x,\n y: this.targetOffset.y - this.currentOffset.y,\n })\n\n this.end()\n }\n }\n\n resume ({ pointer, event, eventTarget }: Interact.SignalArgs['interactions:down']) {\n const { interaction } = this\n\n // undo inertia changes to interaction coords\n interaction.offsetBy({\n x: -this.currentOffset.x,\n y: -this.currentOffset.y,\n })\n\n // update pointer at pointer down position\n interaction.updatePointer(pointer, event, eventTarget, true)\n\n // fire resume signals and event\n interaction._doPhase({\n interaction,\n event,\n phase: 'resume',\n })\n copyCoords(interaction.coords.prev, interaction.coords.cur)\n\n this.stop()\n }\n\n end () {\n this.interaction.move()\n this.interaction.end()\n this.stop()\n }\n\n stop () {\n this.active = this.smoothEnd = false\n this.interaction.simulation = null\n raf.cancel(this.timeout)\n }\n}\n\nfunction start ({ interaction, event }: Interact.DoPhaseArg<Interact.ActionName, 'end'>) {\n if (!interaction._interacting || interaction.simulation) {\n return null\n }\n\n const started = interaction.inertia.start(event)\n\n // prevent action end if inertia or smoothEnd\n return started ? false : null\n}\n\n// Check if the down event hits the current inertia target\n// control should be return to the user\nfunction resume (arg: Interact.SignalArgs['interactions:down']) {\n const { interaction, eventTarget } = arg\n const state = interaction.inertia\n\n if (!state.active) { return }\n\n let element = eventTarget as Node\n\n // climb up the DOM tree from the event target\n while (is.element(element)) {\n // if interaction element is the current inertia target element\n if (element === interaction.element) {\n state.resume(arg)\n break\n }\n\n element = dom.parentNode(element)\n }\n}\n\nfunction stop ({ interaction }: { interaction: Interact.Interaction }) {\n const state = interaction.inertia\n\n if (state.active) {\n state.stop()\n }\n}\n\nfunction getOptions ({ interactable, prepared }: Interact.Interaction) {\n return interactable &&\n interactable.options &&\n prepared.name &&\n interactable.options[prepared.name].inertia\n}\n\nconst inertia: Interact.Plugin = {\n id: 'inertia',\n before: ['modifiers/base'],\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.inertia = new InertiaState(interaction)\n },\n\n 'interactions:before-action-end': start,\n 'interactions:down': resume,\n 'interactions:stop': stop,\n\n 'interactions:before-action-resume': arg => {\n const { modification } = arg.interaction\n\n modification.stop(arg)\n modification.start(arg, arg.interaction.coords.cur.page)\n modification.applyToInteraction(arg)\n },\n\n 'interactions:before-action-inertiastart': arg => arg.interaction.modification.setAndApply(arg),\n 'interactions:action-resume': modifiers.addEventModifiers,\n 'interactions:action-inertiastart': modifiers.addEventModifiers,\n 'interactions:after-action-inertiastart': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n 'interactions:after-action-resume': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n },\n}\n\n// http://stackoverflow.com/a/5634528/2280888\nfunction _getQBezierValue (t: number, p1: number, p2: number, p3: number) {\n const iT = 1 - t\n return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3\n}\n\nfunction getQuadraticCurvePoint (\n startX: number, startY: number, cpX: number, cpY: number, endX: number, endY: number, position: number) {\n return {\n x: _getQBezierValue(position, startX, cpX, endX),\n y: _getQBezierValue(position, startY, cpY, endY),\n }\n}\n\n// http://gizma.com/easing/\nfunction easeOutQuad (t: number, b: number, c: number, d: number) {\n t /= d\n return -c * t * (t - 2) + b\n}\n\nexport default inertia\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport normalize, { NormalizedListeners } from '@interactjs/utils/normalizeListeners'\n\nfunction fireUntilImmediateStopped<\n T extends Interact.ActionName,\n P extends Interact.EventPhase,\n> (event: Interact.InteractEvent<T, P>, listeners: Interact.Listener[]) {\n for (const listener of listeners) {\n if (event.immediatePropagationStopped) { break }\n\n listener(event)\n }\n}\n\nexport class Eventable {\n options: any\n types: NormalizedListeners = {}\n propagationStopped = false\n immediatePropagationStopped = false\n global: any\n\n constructor (options?: { [index: string]: any }) {\n this.options = extend({}, options || {})\n }\n\n fire (event: any) {\n let listeners: Interact.Listener[]\n const global = this.global\n\n // Interactable#on() listeners\n // tslint:disable no-conditional-assignment\n if ((listeners = this.types[event.type])) {\n fireUntilImmediateStopped(event, listeners)\n }\n\n // interact.on() listeners\n if (!event.propagationStopped && global && (listeners = global[event.type])) {\n fireUntilImmediateStopped(event, listeners)\n }\n }\n\n on (type: string, listener: Interact.ListenersArg) {\n const listeners = normalize(type, listener)\n\n for (type in listeners) {\n this.types[type] = arr.merge(this.types[type] || [], listeners[type])\n }\n }\n\n off (type: string, listener: Interact.ListenersArg) {\n const listeners = normalize(type, listener)\n\n for (type in listeners) {\n const eventList = this.types[type]\n\n if (!eventList || !eventList.length) { continue }\n\n for (const subListener of listeners[type]) {\n const index = eventList.indexOf(subListener)\n\n if (index !== -1) {\n eventList.splice(index, 1)\n }\n }\n }\n }\n\n getRect (_element: Interact.Element): Interact.Rect {\n return null\n }\n}\n","import * as Interact from '@interactjs/types/index'\n\nexport default function isNonNativeEvent (type: string, actions: Interact.Actions) {\n if (actions.phaselessTypes[type]) { return true }\n\n for (const name in actions.map) {\n if (type.indexOf(name) === 0 && type.substr(name.length) in actions.phases) {\n return true\n }\n }\n\n return false\n}\n","/* eslint-disable no-dupe-class-members */\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport browser from '@interactjs/utils/browser'\nimport clone from '@interactjs/utils/clone'\nimport { getElementRect, matchesUpTo, nodeContains, trySelector } from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport normalizeListeners from '@interactjs/utils/normalizeListeners'\nimport { getWindow } from '@interactjs/utils/window'\n\nimport { Eventable } from './Eventable'\nimport { ActionDefaults, Defaults, Options } from './defaultOptions'\nimport isNonNativeEvent from './isNonNativeEvent'\n\ntype IgnoreValue = string | Interact.Element | boolean\ntype DeltaSource = 'page' | 'client'\n\n/** */\nexport class Interactable implements Partial<Eventable> {\n /** @internal */ get _defaults (): Defaults {\n return {\n base: {},\n perAction: {},\n actions: {} as ActionDefaults,\n }\n }\n\n readonly options!: Required<Options>\n readonly _actions: Interact.Actions\n readonly target: Interact.Target\n readonly events = new Eventable()\n readonly _context: Interact.Context\n readonly _win: Window\n readonly _doc: Document\n readonly _scopeEvents: Interact.Scope['events']\n\n /** @internal */ _rectChecker?: typeof Interactable.prototype.getRect\n\n /** */\n constructor (target: Interact.Target, options: any, defaultContext: Document | Interact.Element, scopeEvents: Interact.Scope['events']) {\n this._actions = options.actions\n this.target = target\n this._context = options.context || defaultContext\n this._win = getWindow(trySelector(target) ? this._context : target)\n this._doc = this._win.document\n this._scopeEvents = scopeEvents\n\n this.set(options)\n }\n\n setOnEvents (actionName: Interact.ActionName, phases: NonNullable<any>) {\n if (is.func(phases.onstart)) { this.on(`${actionName}start`, phases.onstart) }\n if (is.func(phases.onmove)) { this.on(`${actionName}move`, phases.onmove) }\n if (is.func(phases.onend)) { this.on(`${actionName}end`, phases.onend) }\n if (is.func(phases.oninertiastart)) { this.on(`${actionName}inertiastart`, phases.oninertiastart) }\n\n return this\n }\n\n updatePerActionListeners (actionName: Interact.ActionName, prev: Interact.Listeners, cur: Interact.Listeners) {\n if (is.array(prev) || is.object(prev)) {\n this.off(actionName, prev)\n }\n\n if (is.array(cur) || is.object(cur)) {\n this.on(actionName, cur)\n }\n }\n\n setPerAction (actionName: Interact.ActionName, options: Interact.OrBoolean<Options>) {\n const defaults = this._defaults\n\n // for all the default per-action options\n for (const optionName_ in options) {\n const optionName = optionName_ as keyof Interact.PerActionDefaults\n const actionOptions = this.options[actionName]\n const optionValue: any = options[optionName]\n\n // remove old event listeners and add new ones\n if (optionName === 'listeners') {\n this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue as Interact.Listeners)\n }\n\n // if the option value is an array\n if (is.array<any>(optionValue)) {\n (actionOptions[optionName] as any) = arr.from(optionValue)\n }\n // if the option value is an object\n else if (is.plainObject(optionValue)) {\n // copy the object\n (actionOptions[optionName] as any) = extend(\n actionOptions[optionName] || {} as any,\n clone(optionValue))\n\n // set anabled field to true if it exists in the defaults\n if (is.object(defaults.perAction[optionName]) && 'enabled' in (defaults.perAction[optionName] as any)) {\n (actionOptions[optionName] as any).enabled = optionValue.enabled !== false\n }\n }\n // if the option value is a boolean and the default is an object\n else if (is.bool(optionValue) && is.object(defaults.perAction[optionName])) {\n (actionOptions[optionName] as any).enabled = optionValue\n }\n // if it's anything else, do a plain assignment\n else {\n (actionOptions[optionName] as any) = optionValue\n }\n }\n }\n\n /**\n * The default function to get an Interactables bounding rect. Can be\n * overridden using {@link Interactable.rectChecker}.\n *\n * @param {Element} [element] The element to measure.\n * @return {Interact.Rect} The object's bounding rectangle.\n */\n getRect (element: Interact.Element) {\n element = element || (is.element(this.target)\n ? this.target\n : null)\n\n if (is.string(this.target)) {\n element = element || this._context.querySelector(this.target)\n }\n\n return getElementRect(element)\n }\n\n /**\n * Returns or sets the function used to calculate the interactable's\n * element's rectangle\n *\n * @param {function} [checker] A function which returns this Interactable's\n * bounding rectangle. See {@link Interactable.getRect}\n * @return {function | object} The checker function or this Interactable\n */\n rectChecker (): (element: Interact.Element) => any | null\n rectChecker (checker: (element: Interact.Element) => any): this\n rectChecker (checker?: (element: Interact.Element) => any) {\n if (is.func(checker)) {\n this._rectChecker = checker\n\n this.getRect = element => {\n const rect = extend({}, this._rectChecker(element))\n\n if (!('width' in rect)) {\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n return rect\n }\n\n return this\n }\n\n if (checker === null) {\n delete this.getRect\n delete this._rectChecker\n\n return this\n }\n\n return this.getRect\n }\n\n _backCompatOption (optionName: keyof Interact.Options, newValue: any) {\n if (trySelector(newValue) || is.object(newValue)) {\n (this.options[optionName] as any) = newValue\n\n for (const action in this._actions.map) {\n (this.options[action][optionName] as any) = newValue\n }\n\n return this\n }\n\n return this.options[optionName]\n }\n\n /**\n * Gets or sets the origin of the Interactable's element. The x and y\n * of the origin will be subtracted from action event coordinates.\n *\n * @param {Element | object | string} [origin] An HTML or SVG Element whose\n * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'\n * or any CSS selector\n *\n * @return {object} The current origin or this Interactable\n */\n origin (newValue: any) {\n return this._backCompatOption('origin', newValue)\n }\n\n /**\n * Returns or sets the mouse coordinate types used to calculate the\n * movement of the pointer.\n *\n * @param {string} [newValue] Use 'client' if you will be scrolling while\n * interacting; Use 'page' if you want autoScroll to work\n * @return {string | object} The current deltaSource or this Interactable\n */\n deltaSource (): DeltaSource\n deltaSource (newValue: DeltaSource): this\n deltaSource (newValue?: DeltaSource) {\n if (newValue === 'page' || newValue === 'client') {\n this.options.deltaSource = newValue\n\n return this\n }\n\n return this.options.deltaSource\n }\n\n /**\n * Gets the selector context Node of the Interactable. The default is\n * `window.document`.\n *\n * @return {Node} The context Node of this Interactable\n */\n context () {\n return this._context\n }\n\n inContext (element: Document | Node) {\n return (this._context === element.ownerDocument ||\n nodeContains(this._context, element))\n }\n\n testIgnoreAllow (\n this: Interactable,\n options: { ignoreFrom?: IgnoreValue, allowFrom?: IgnoreValue },\n targetNode: Node,\n eventTarget: Interact.EventTarget,\n ) {\n return (!this.testIgnore(options.ignoreFrom, targetNode, eventTarget) &&\n this.testAllow(options.allowFrom, targetNode, eventTarget))\n }\n\n testAllow (\n this: Interactable,\n allowFrom: IgnoreValue,\n targetNode: Node,\n element: Interact.EventTarget,\n ) {\n if (!allowFrom) { return true }\n\n if (!is.element(element)) { return false }\n\n if (is.string(allowFrom)) {\n return matchesUpTo(element, allowFrom, targetNode)\n }\n else if (is.element(allowFrom)) {\n return nodeContains(allowFrom, element)\n }\n\n return false\n }\n\n testIgnore (\n this: Interactable,\n ignoreFrom: IgnoreValue,\n targetNode: Node,\n element: Interact.EventTarget,\n ) {\n if (!ignoreFrom || !is.element(element)) { return false }\n\n if (is.string(ignoreFrom)) {\n return matchesUpTo(element, ignoreFrom, targetNode)\n }\n else if (is.element(ignoreFrom)) {\n return nodeContains(ignoreFrom, element)\n }\n\n return false\n }\n\n /**\n * Calls listeners for the given InteractEvent type bound globally\n * and directly to this Interactable\n *\n * @param {InteractEvent} iEvent The InteractEvent object to be fired on this\n * Interactable\n * @return {Interactable} this Interactable\n */\n fire (iEvent: object) {\n this.events.fire(iEvent)\n\n return this\n }\n\n _onOff (method: 'on' | 'off', typeArg: Interact.EventTypes, listenerArg?: Interact.ListenersArg | null, options?: any) {\n if (is.object(typeArg) && !is.array(typeArg)) {\n options = listenerArg\n listenerArg = null\n }\n\n const addRemove = method === 'on' ? 'add' : 'remove'\n const listeners = normalizeListeners(typeArg, listenerArg)\n\n for (let type in listeners) {\n if (type === 'wheel') { type = browser.wheelEvent }\n\n for (const listener of listeners[type]) {\n // if it is an action event type\n if (isNonNativeEvent(type, this._actions)) {\n this.events[method](type, listener)\n }\n // delegated event\n else if (is.string(this.target)) {\n this._scopeEvents[`${addRemove}Delegate` as 'addDelegate' | 'removeDelegate'](this.target, this._context, type, listener, options)\n }\n // remove listener from this Interactable's element\n else {\n this._scopeEvents[addRemove](this.target, type, listener, options)\n }\n }\n }\n\n return this\n }\n\n /**\n * Binds a listener for an InteractEvent, pointerEvent or DOM event.\n *\n * @param {string | array | object} types The types of events to listen\n * for\n * @param {function | array | object} [listener] The event listener function(s)\n * @param {object | boolean} [options] options object or useCapture flag for\n * addEventListener\n * @return {Interactable} This Interactable\n */\n on (types: Interact.EventTypes, listener?: Interact.ListenersArg, options?: any) {\n return this._onOff('on', types, listener, options)\n }\n\n /**\n * Removes an InteractEvent, pointerEvent or DOM event listener.\n *\n * @param {string | array | object} types The types of events that were\n * listened for\n * @param {function | array | object} [listener] The event listener function(s)\n * @param {object | boolean} [options] options object or useCapture flag for\n * removeEventListener\n * @return {Interactable} This Interactable\n */\n off (types: string | string[] | Interact.EventTypes, listener?: Interact.ListenersArg, options?: any) {\n return this._onOff('off', types, listener, options)\n }\n\n /**\n * Reset the options of this Interactable\n *\n * @param {object} options The new settings to apply\n * @return {object} This Interactable\n */\n set (options: Interact.OptionsArg) {\n const defaults = this._defaults\n\n if (!is.object(options)) {\n options = {}\n }\n\n (this.options as Required<Options>) = clone(defaults.base) as Required<Options>\n\n for (const actionName_ in this._actions.methodDict) {\n const actionName = actionName_ as Interact.ActionName\n const methodName = this._actions.methodDict[actionName]\n\n this.options[actionName] = {}\n this.setPerAction(actionName, extend(extend({}, defaults.perAction), defaults.actions[actionName]))\n\n this[methodName](options[actionName])\n }\n\n for (const setting in options) {\n if (is.func(this[setting])) {\n this[setting](options[setting])\n }\n }\n\n return this\n }\n\n /**\n * Remove this interactable from the list of interactables and remove it's\n * action capabilities and event listeners\n */\n unset () {\n if (is.string(this.target)) {\n // remove delegated events\n for (const type in this._scopeEvents.delegatedEvents) {\n const delegated = this._scopeEvents.delegatedEvents[type]\n\n for (let i = delegated.length - 1; i >= 0; i--) {\n const { selector, context, listeners } = delegated[i]\n\n if (selector === this.target && context === this._context) {\n delegated.splice(i, 1)\n }\n\n for (let l = listeners.length - 1; l >= 0; l--) {\n this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1])\n }\n }\n }\n }\n else {\n this._scopeEvents.remove(this.target as Node, 'all')\n }\n }\n}\n","import { Interactable } from '@interactjs/core/Interactable'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactable:new': {\n interactable: Interact.Interactable\n target: Interact.Target\n options: Interact.OptionsArg\n win: Window\n }\n }\n}\n\ninterface InteractableScopeProp {\n context: Document | Interact.Element\n interactable: Interact.Interactable\n}\n\nexport class InteractableSet {\n // all set interactables\n list: Interact.Interactable[] = []\n\n selectorMap: {\n [selector: string]: InteractableScopeProp[]\n } = {}\n\n scope: Interact.Scope\n\n constructor (scope: Interact.Scope) {\n this.scope = scope\n scope.addListeners({\n 'interactable:unset': ({ interactable }) => {\n const { target, _context: context } = interactable\n const targetMappings: InteractableScopeProp[] = is.string(target)\n ? this.selectorMap[target]\n : (target as any)[this.scope.id]\n\n const targetIndex = targetMappings.findIndex(m => m.context === context)\n if (targetMappings[targetIndex]) {\n // Destroying mappingInfo's context and interactable\n targetMappings[targetIndex].context = null\n targetMappings[targetIndex].interactable = null\n }\n targetMappings.splice(targetIndex, 1)\n },\n })\n }\n\n new (target: Interact.Target, options?: any): Interactable {\n options = extend(options || {}, {\n actions: this.scope.actions,\n })\n const interactable = new this.scope.Interactable(target, options, this.scope.document, this.scope.events)\n const mappingInfo = { context: interactable._context, interactable }\n\n this.scope.addDocument(interactable._doc)\n this.list.push(interactable)\n\n if (is.string(target)) {\n if (!this.selectorMap[target]) { this.selectorMap[target] = [] }\n this.selectorMap[target].push(mappingInfo)\n } else {\n if (!((interactable.target as any)[this.scope.id])) {\n Object.defineProperty(target, this.scope.id, {\n value: [],\n configurable: true,\n })\n }\n\n (target as any)[this.scope.id].push(mappingInfo)\n }\n\n this.scope.fire('interactable:new', {\n target,\n options,\n interactable,\n win: this.scope._win,\n })\n\n return interactable\n }\n\n get (target: Interact.Target, options?: Interact.Options) {\n const context = (options && options.context) || this.scope.document\n const isSelector = is.string(target)\n const targetMappings: InteractableScopeProp[] = isSelector\n ? this.selectorMap[target as string]\n : (target as any)[this.scope.id]\n\n if (!targetMappings) { return null }\n\n const found = arr.find(\n targetMappings,\n m => m.context === context &&\n (isSelector || m.interactable.inContext(target as any)))\n\n return found && found.interactable\n }\n\n forEachMatch<T> (node: Node, callback: (interactable: Interact.Interactable) => T) {\n for (const interactable of this.list) {\n let ret: void | T\n\n if ((is.string(interactable.target)\n // target is a selector and the element matches\n ? (is.element(node) && domUtils.matchesSelector(node, interactable.target))\n // target is the element\n : node === interactable.target) &&\n // the element is in context\n (interactable.inContext(node))) {\n ret = callback(interactable)\n }\n\n if (ret !== undefined) {\n return ret\n }\n }\n }\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport pExtend from '@interactjs/utils/pointerExtend'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n events: ReturnType<typeof install>\n }\n}\n\ntype Listener = (event: Event | FakeEvent) => any\n\nfunction install (scope: Interact.Scope) {\n const targets: Array<{\n eventTarget: EventTarget\n events: { [type: string]: Listener[] }\n }> = []\n\n const delegatedEvents: {\n [type: string]: Array<{\n selector: string\n context: Node\n listeners: Array<[Listener, { capture: boolean, passive: boolean }]>\n }>\n } = {}\n const documents: Document[] = []\n\n const eventsMethods = {\n add,\n remove,\n\n addDelegate,\n removeDelegate,\n\n delegateListener,\n delegateUseCapture,\n delegatedEvents,\n documents,\n\n targets,\n\n supportsOptions: false,\n supportsPassive: false,\n }\n\n // check if browser supports passive events and options arg\n scope.document.createElement('div').addEventListener('test', null, {\n get capture () { return (eventsMethods.supportsOptions = true) },\n get passive () { return (eventsMethods.supportsPassive = true) },\n })\n\n scope.events = eventsMethods\n\n function add (eventTarget: EventTarget, type: string, listener: Listener, optionalArg?: boolean | any) {\n const options = getOptions(optionalArg)\n let target = arr.find(targets, t => t.eventTarget === eventTarget)\n\n if (!target) {\n target = {\n eventTarget,\n events: {},\n }\n\n targets.push(target)\n }\n\n if (!target.events[type]) {\n target.events[type] = []\n }\n\n if (eventTarget.addEventListener && !arr.contains(target.events[type], listener)) {\n eventTarget.addEventListener(type, listener as any, eventsMethods.supportsOptions ? options : options.capture)\n target.events[type].push(listener)\n }\n }\n\n function remove (eventTarget: EventTarget, type: string, listener?: 'all' | Listener, optionalArg?: boolean | any) {\n const options = getOptions(optionalArg)\n const targetIndex = arr.findIndex(targets, t => t.eventTarget === eventTarget)\n const target = targets[targetIndex]\n\n if (!target || !target.events) {\n return\n }\n\n if (type === 'all') {\n for (type in target.events) {\n if (target.events.hasOwnProperty(type)) {\n remove(eventTarget, type, 'all')\n }\n }\n return\n }\n\n let typeIsEmpty = false\n const typeListeners = target.events[type]\n\n if (typeListeners) {\n if (listener === 'all') {\n for (let i = typeListeners.length - 1; i >= 0; i--) {\n remove(eventTarget, type, typeListeners[i], options)\n }\n return\n }\n else {\n for (let i = 0; i < typeListeners.length; i++) {\n if (typeListeners[i] === listener) {\n eventTarget.removeEventListener(type, listener as any, eventsMethods.supportsOptions ? options : options.capture)\n typeListeners.splice(i, 1)\n\n if (typeListeners.length === 0) {\n delete target.events[type]\n typeIsEmpty = true\n }\n\n break\n }\n }\n }\n }\n\n if (typeIsEmpty && !Object.keys(target.events).length) {\n targets.splice(targetIndex, 1)\n }\n }\n\n function addDelegate (selector: string, context: Node, type: string, listener: Listener, optionalArg?: any) {\n const options = getOptions(optionalArg)\n if (!delegatedEvents[type]) {\n delegatedEvents[type] = []\n\n // add delegate listener functions\n for (const doc of documents) {\n add(doc, type, delegateListener)\n add(doc, type, delegateUseCapture, true)\n }\n }\n\n const delegates = delegatedEvents[type]\n let delegate = arr.find(delegates, d => d.selector === selector && d.context === context)\n\n if (!delegate) {\n delegate = { selector, context, listeners: [] }\n delegates.push(delegate)\n }\n\n delegate.listeners.push([listener, options])\n }\n\n function removeDelegate (\n selector: string,\n context: Document | Interact.Element,\n type: string,\n listener?: Listener,\n optionalArg?: any,\n ) {\n const options = getOptions(optionalArg)\n const delegates = delegatedEvents[type]\n let matchFound = false\n let index: number\n\n if (!delegates) { return }\n\n // count from last index of delegated to 0\n for (index = delegates.length - 1; index >= 0; index--) {\n const cur = delegates[index]\n // look for matching selector and context Node\n if (cur.selector === selector && cur.context === context) {\n const { listeners } = cur\n\n // each item of the listeners array is an array: [function, capture, passive]\n for (let i = listeners.length - 1; i >= 0; i--) {\n const [fn, { capture, passive }] = listeners[i]\n\n // check if the listener functions and capture and passive flags match\n if (fn === listener && capture === options.capture && passive === options.passive) {\n // remove the listener from the array of listeners\n listeners.splice(i, 1)\n\n // if all listeners for this target have been removed\n // remove the target from the delegates array\n if (!listeners.length) {\n delegates.splice(index, 1)\n\n // remove delegate function from context\n remove(context, type, delegateListener)\n remove(context, type, delegateUseCapture, true)\n }\n\n // only remove one listener\n matchFound = true\n break\n }\n }\n\n if (matchFound) { break }\n }\n }\n }\n\n // bound to the interactable context when a DOM event\n // listener is added to a selector interactable\n function delegateListener (event: Event, optionalArg?: any) {\n const options = getOptions(optionalArg)\n const fakeEvent = new FakeEvent(event)\n const delegates = delegatedEvents[event.type]\n const [eventTarget] = (pointerUtils.getEventTargets(event))\n let element: Node = eventTarget\n\n // climb up document tree looking for selector matches\n while (is.element(element)) {\n for (let i = 0; i < delegates.length; i++) {\n const cur = delegates[i]\n const { selector, context } = cur\n\n if (domUtils.matchesSelector(element, selector) &&\n domUtils.nodeContains(context, eventTarget) &&\n domUtils.nodeContains(context, element)) {\n const { listeners } = cur\n\n fakeEvent.currentTarget = element\n\n for (const [fn, { capture, passive }] of listeners) {\n if (capture === options.capture && passive === options.passive) {\n fn(fakeEvent)\n }\n }\n }\n }\n\n element = domUtils.parentNode(element)\n }\n }\n\n function delegateUseCapture (event: Event) {\n return delegateListener.call(this, event, true)\n }\n\n // for type inferrence\n return eventsMethods\n}\n\nexport class FakeEvent implements Partial<Event> {\n currentTarget: EventTarget\n originalEvent: Event\n\n constructor (originalEvent: Event) {\n this.originalEvent = originalEvent\n // duplicate the event so that currentTarget can be changed\n pExtend(this, originalEvent)\n }\n\n preventOriginalDefault () {\n this.originalEvent.preventDefault()\n }\n\n stopPropagation () {\n this.originalEvent.stopPropagation()\n }\n\n stopImmediatePropagation () {\n this.originalEvent.stopImmediatePropagation()\n }\n}\n\nfunction getOptions (param: { [index: string]: any } | boolean): { capture: boolean, passive: boolean } {\n if (!is.object(param)) { return { capture: !!param, passive: false } }\n\n const options = extend({}, param) as any\n\n options.capture = !!param.capture\n options.passive = !!param.passive\n\n return options\n}\n\nexport default {\n id: 'events',\n install,\n}\n","/** @module interact */\nimport * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport { Interactable } from './Interactable'\nimport { Options } from './defaultOptions'\nimport isNonNativeEvent from './isNonNativeEvent'\n\nexport interface InteractStatic {\n (target: Interact.Target, options?: Options): Interactable\n getPointerAverage: typeof pointerUtils.pointerAverage\n getTouchBBox: typeof pointerUtils.touchBBox\n getTouchDistance: typeof pointerUtils.touchDistance\n getTouchAngle: typeof pointerUtils.touchAngle\n getElementRect: typeof domUtils.getElementRect\n getElementClientRect: typeof domUtils.getElementClientRect\n matchesSelector: typeof domUtils.matchesSelector\n closest: typeof domUtils.closest\n /** @internal */ globalEvents: any\n version: string\n /** @internal */ scope: Interact.Scope\n use(plugin: Interact.Plugin, options?: {\n [key: string]: any\n }): any\n isSet(target: Interact.Element, options?: any): boolean\n on(type: string | Interact.EventTypes, listener: Interact.ListenersArg, options?: object): any\n off(type: Interact.EventTypes, listener: any, options?: object): any\n debug(): any\n supportsTouch(): boolean\n supportsPointerEvent(): boolean\n stop(): any\n pointerMoveTolerance(newValue?: number): any\n addDocument(doc: Document, options?: object): void\n removeDocument(doc: Document): void\n}\n\nexport function createInteractStatic (scope: Interact.Scope): Interact.InteractStatic {\n /**\n * ```js\n * interact('#draggable').draggable(true)\n *\n * var rectables = interact('rect')\n * rectables\n * .gesturable(true)\n * .on('gesturemove', function (event) {\n * // ...\n * })\n * ```\n *\n * The methods of this variable can be used to set elements as interactables\n * and also to change various default settings.\n *\n * Calling it as a function and passing an element or a valid CSS selector\n * string returns an Interactable object which has various methods to configure\n * it.\n *\n * @global\n *\n * @param {Element | string} target The HTML or SVG Element to interact with\n * or CSS selector\n * @return {Interactable}\n */\n const interact = ((target, options) => {\n let interactable = scope.interactables.get(target, options)\n\n if (!interactable) {\n interactable = scope.interactables.new(target, options)\n interactable.events.global = interact.globalEvents\n }\n\n return interactable\n }) as InteractStatic\n\n // expose the functions used to calculate multi-touch properties\n interact.getPointerAverage = pointerUtils.pointerAverage\n interact.getTouchBBox = pointerUtils.touchBBox\n interact.getTouchDistance = pointerUtils.touchDistance\n interact.getTouchAngle = pointerUtils.touchAngle\n\n interact.getElementRect = domUtils.getElementRect\n interact.getElementClientRect = domUtils.getElementClientRect\n interact.matchesSelector = domUtils.matchesSelector\n interact.closest = domUtils.closest\n\n interact.globalEvents = {} as any\n\n // eslint-disable-next-line no-undef\n interact.version = process.env.npm_package_version\n interact.scope = scope\n /**\n * Use a plugin\n *\n * @alias module:interact.use\n *\n * @param {Object} plugin\n * @param {function} plugin.install\n * @return {Interact.InteractStatic}\n */\n interact.use = function (plugin, options) {\n this.scope.usePlugin(plugin, options)\n\n return this\n }\n\n /**\n * Check if an element or selector has been set with the {@link interact}\n * function\n *\n * @alias module:interact.isSet\n *\n * @param {Element} element The Element being searched for\n * @return {boolean} Indicates if the element or CSS selector was previously\n * passed to interact\n */\n interact.isSet = function (target, options) {\n return !!this.scope.interactables.get(target, options && options.context)\n }\n\n /**\n * Add a global listener for an InteractEvent or adds a DOM event to `document`\n *\n * @alias module:interact.on\n *\n * @param {string | array | object} type The types of events to listen for\n * @param {function} listener The function event (s)\n * @param {object | boolean} [options] object or useCapture flag for\n * addEventListener\n * @return {object} interact\n */\n interact.on = function (type: string | Interact.EventTypes, listener: Interact.ListenersArg, options?: object) {\n if (is.string(type) && type.search(' ') !== -1) {\n type = type.trim().split(/ +/)\n }\n\n if (is.array(type)) {\n for (const eventType of (type as any[])) {\n this.on(eventType, listener, options)\n }\n\n return this\n }\n\n if (is.object(type)) {\n for (const prop in type) {\n this.on(prop, (type as any)[prop], listener)\n }\n\n return this\n }\n\n // if it is an InteractEvent type, add listener to globalEvents\n if (isNonNativeEvent(type, this.scope.actions)) {\n // if this type of event was never bound\n if (!this.globalEvents[type]) {\n this.globalEvents[type] = [listener]\n }\n else {\n this.globalEvents[type].push(listener)\n }\n }\n // If non InteractEvent type, addEventListener to document\n else {\n this.scope.events.add(this.scope.document, type, listener as Interact.Listener, { options })\n }\n\n return this\n }\n\n /**\n * Removes a global InteractEvent listener or DOM event from `document`\n *\n * @alias module:interact.off\n *\n * @param {string | array | object} type The types of events that were listened\n * for\n * @param {function} listener The listener function to be removed\n * @param {object | boolean} options [options] object or useCapture flag for\n * removeEventListener\n * @return {object} interact\n */\n interact.off = function (type: Interact.EventTypes, listener: any, options?: object) {\n if (is.string(type) && type.search(' ') !== -1) {\n type = type.trim().split(/ +/)\n }\n\n if (is.array(type)) {\n for (const eventType of type) {\n this.off(eventType, listener, options)\n }\n\n return this\n }\n\n if (is.object(type)) {\n for (const prop in type) {\n this.off(prop, type[prop], listener)\n }\n\n return this\n }\n\n if (isNonNativeEvent(type, this.scope.actions)) {\n let index: number\n\n if (type in this.globalEvents &&\n (index = this.globalEvents[type].indexOf(listener)) !== -1) {\n this.globalEvents[type].splice(index, 1)\n }\n }\n else {\n this.scope.events.remove(this.scope.document, type, listener, options)\n }\n\n return this\n }\n\n interact.debug = function () {\n return this.scope\n }\n\n /**\n * @alias module:interact.supportsTouch\n *\n * @return {boolean} Whether or not the browser supports touch input\n */\n interact.supportsTouch = function () {\n return browser.supportsTouch\n }\n\n /**\n * @alias module:interact.supportsPointerEvent\n *\n * @return {boolean} Whether or not the browser supports PointerEvents\n */\n interact.supportsPointerEvent = function () {\n return browser.supportsPointerEvent\n }\n\n /**\n * Cancels all interactions (end events are not fired)\n *\n * @alias module:interact.stop\n *\n * @return {object} interact\n */\n interact.stop = function () {\n for (const interaction of this.scope.interactions.list) {\n interaction.stop()\n }\n\n return this\n }\n\n /**\n * Returns or sets the distance the pointer must be moved before an action\n * sequence occurs. This also affects tolerance for tap events.\n *\n * @alias module:interact.pointerMoveTolerance\n *\n * @param {number} [newValue] The movement from the start position must be greater than this value\n * @return {interact | number}\n */\n interact.pointerMoveTolerance = function (newValue?: number) {\n if (is.number(newValue)) {\n this.scope.interactions.pointerMoveTolerance = newValue\n\n return this\n }\n\n return this.scope.interactions.pointerMoveTolerance\n }\n\n interact.addDocument = function (doc: Document, options?: object) {\n this.scope.addDocument(doc, options)\n }\n\n interact.removeDocument = function (doc: Document) {\n this.scope.removeDocument(doc)\n }\n\n return interact as any\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\n\nexport interface SearchDetails {\n pointer: Interact.PointerType\n pointerId: number\n pointerType: string\n eventType: string\n eventTarget: Interact.EventTarget\n curEventTarget: Interact.EventTarget\n scope: Interact.Scope\n}\n\nconst finder = {\n methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'] as const,\n\n search (details: SearchDetails) {\n for (const method of finder.methodOrder) {\n const interaction = finder[method](details)\n\n if (interaction) {\n return interaction\n }\n }\n\n return null\n },\n\n // try to resume simulation with a new pointer\n simulationResume ({ pointerType, eventType, eventTarget, scope }: SearchDetails) {\n if (!/down|start/i.test(eventType)) {\n return null\n }\n\n for (const interaction of scope.interactions.list) {\n let element = eventTarget as Node\n\n if (interaction.simulation && interaction.simulation.allowResume &&\n (interaction.pointerType === pointerType)) {\n while (element) {\n // if the element is the interaction element\n if (element === interaction.element) {\n return interaction\n }\n element = dom.parentNode(element)\n }\n }\n }\n\n return null\n },\n\n // if it's a mouse or pen interaction\n mouseOrPen ({ pointerId, pointerType, eventType, scope }: SearchDetails) {\n if (pointerType !== 'mouse' && pointerType !== 'pen') {\n return null\n }\n\n let firstNonActive\n\n for (const interaction of scope.interactions.list) {\n if (interaction.pointerType === pointerType) {\n // if it's a down event, skip interactions with running simulations\n if (interaction.simulation && !hasPointerId(interaction, pointerId)) { continue }\n\n // if the interaction is active, return it immediately\n if (interaction.interacting()) {\n return interaction\n }\n // otherwise save it and look for another active interaction\n else if (!firstNonActive) {\n firstNonActive = interaction\n }\n }\n }\n\n // if no active mouse interaction was found use the first inactive mouse\n // interaction\n if (firstNonActive) {\n return firstNonActive\n }\n\n // find any mouse or pen interaction.\n // ignore the interaction if the eventType is a *down, and a simulation\n // is active\n for (const interaction of scope.interactions.list) {\n if (interaction.pointerType === pointerType && !(/down/i.test(eventType) && interaction.simulation)) {\n return interaction\n }\n }\n\n return null\n },\n\n // get interaction that has this pointer\n hasPointer ({ pointerId, scope }: SearchDetails) {\n for (const interaction of scope.interactions.list) {\n if (hasPointerId(interaction, pointerId)) {\n return interaction\n }\n }\n\n return null\n },\n\n // get first idle interaction with a matching pointerType\n idle ({ pointerType, scope }: SearchDetails) {\n for (const interaction of scope.interactions.list) {\n // if there's already a pointer held down\n if (interaction.pointers.length === 1) {\n const target = interaction.interactable\n // don't add this pointer if there is a target interactable and it\n // isn't gesturable\n if (target && !(target.options.gesture && target.options.gesture.enabled)) {\n continue\n }\n }\n // maximum of 2 pointers per interaction\n else if (interaction.pointers.length >= 2) {\n continue\n }\n\n if (!interaction.interacting() && (pointerType === interaction.pointerType)) {\n return interaction\n }\n }\n\n return null\n },\n}\n\nfunction hasPointerId (interaction: Interact.Interaction, pointerId: number) {\n return interaction.pointers.some(({ id }) => id === pointerId)\n}\n\nexport default finder\n","import * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport domObjects from '@interactjs/utils/domObjects'\nimport { nodeContains } from '@interactjs/utils/domUtils'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport InteractionBase from './Interaction'\nimport interactablePreventDefault from './interactablePreventDefault'\nimport finder, { SearchDetails } from './interactionFinder'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n Interaction: typeof InteractionBase\n interactions: {\n new: <T extends ActionName> (options: any) => InteractionBase<T>\n list: InteractionBase[]\n listeners: { [type: string]: Interact.Listener }\n docEvents: Array<{ type: string, listener: Interact.Listener }>\n pointerMoveTolerance: number\n }\n prevTouchTime: number\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:find': {\n interaction: InteractionBase\n searchDetails: SearchDetails\n }\n }\n}\n\nconst methodNames = [\n 'pointerDown', 'pointerMove', 'pointerUp',\n 'updatePointer', 'removePointer', 'windowBlur',\n]\n\nfunction install (scope: Interact.Scope) {\n const listeners = {} as any\n\n for (const method of methodNames) {\n listeners[method] = doOnInteractions(method, scope)\n }\n\n const pEventTypes = browser.pEventTypes\n let docEvents: typeof scope.interactions.docEvents\n\n if (domObjects.PointerEvent) {\n docEvents = [\n { type: pEventTypes.down, listener: releasePointersOnRemovedEls },\n { type: pEventTypes.down, listener: listeners.pointerDown },\n { type: pEventTypes.move, listener: listeners.pointerMove },\n { type: pEventTypes.up, listener: listeners.pointerUp },\n { type: pEventTypes.cancel, listener: listeners.pointerUp },\n ]\n }\n else {\n docEvents = [\n { type: 'mousedown', listener: listeners.pointerDown },\n { type: 'mousemove', listener: listeners.pointerMove },\n { type: 'mouseup', listener: listeners.pointerUp },\n\n { type: 'touchstart', listener: releasePointersOnRemovedEls },\n { type: 'touchstart', listener: listeners.pointerDown },\n { type: 'touchmove', listener: listeners.pointerMove },\n { type: 'touchend', listener: listeners.pointerUp },\n { type: 'touchcancel', listener: listeners.pointerUp },\n ]\n }\n\n docEvents.push({\n type: 'blur',\n listener (event) {\n for (const interaction of scope.interactions.list) {\n interaction.documentBlur(event)\n }\n },\n })\n\n // for ignoring browser's simulated mouse events\n scope.prevTouchTime = 0\n\n scope.Interaction = class <T extends Interact.ActionName> extends InteractionBase<T> {\n get pointerMoveTolerance () {\n return scope.interactions.pointerMoveTolerance\n }\n\n set pointerMoveTolerance (value) {\n scope.interactions.pointerMoveTolerance = value\n }\n\n _now () { return scope.now() }\n }\n\n scope.interactions = {\n // all active and idle interactions\n list: [],\n new<T extends Interact.ActionName> (options: { pointerType?: string, scopeFire?: Interact.Scope['fire'] }) {\n options.scopeFire = (name, arg) => scope.fire(name, arg)\n\n const interaction = new scope.Interaction<T>(options as Required<typeof options>)\n\n scope.interactions.list.push(interaction)\n return interaction\n },\n listeners,\n docEvents,\n pointerMoveTolerance: 1,\n }\n\n function releasePointersOnRemovedEls () {\n // for all inactive touch interactions with pointers down\n for (const interaction of scope.interactions.list) {\n if (!interaction.pointerIsDown ||\n interaction.pointerType !== 'touch' ||\n interaction._interacting) {\n continue\n }\n\n // if a pointer is down on an element that is no longer in the DOM tree\n for (const pointer of interaction.pointers) {\n if (!scope.documents.some(({ doc }) => nodeContains(doc, pointer.downTarget))) {\n // remove the pointer from the interaction\n interaction.removePointer(pointer.pointer, pointer.event)\n }\n }\n }\n }\n\n scope.usePlugin(interactablePreventDefault)\n}\n\nfunction doOnInteractions (method, scope) {\n return function (event) {\n const interactions = scope.interactions.list\n\n const pointerType = pointerUtils.getPointerType(event)\n const [eventTarget, curEventTarget] = pointerUtils.getEventTargets(event)\n const matches = [] // [ [pointer, interaction], ...]\n\n if (/^touch/.test(event.type)) {\n scope.prevTouchTime = scope.now()\n\n for (const changedTouch of event.changedTouches) {\n const pointer = changedTouch\n const pointerId = pointerUtils.getPointerId(pointer)\n const searchDetails: SearchDetails = {\n pointer,\n pointerId,\n pointerType,\n eventType: event.type,\n eventTarget,\n curEventTarget,\n scope,\n }\n const interaction = getInteraction(searchDetails)\n\n matches.push([\n searchDetails.pointer,\n searchDetails.eventTarget,\n searchDetails.curEventTarget,\n interaction,\n ])\n }\n }\n else {\n let invalidPointer = false\n\n if (!browser.supportsPointerEvent && /mouse/.test(event.type)) {\n // ignore mouse events while touch interactions are active\n for (let i = 0; i < interactions.length && !invalidPointer; i++) {\n invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown\n }\n\n // try to ignore mouse events that are simulated by the browser\n // after a touch event\n invalidPointer = invalidPointer ||\n (scope.now() - scope.prevTouchTime < 500) ||\n // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated\n event.timeStamp === 0\n }\n\n if (!invalidPointer) {\n const searchDetails = {\n pointer: event,\n pointerId: pointerUtils.getPointerId(event),\n pointerType,\n eventType: event.type,\n curEventTarget,\n eventTarget,\n scope,\n }\n\n const interaction = getInteraction(searchDetails)\n\n matches.push([\n searchDetails.pointer,\n searchDetails.eventTarget,\n searchDetails.curEventTarget,\n interaction,\n ])\n }\n }\n\n // eslint-disable-next-line no-shadow\n for (const [pointer, eventTarget, curEventTarget, interaction] of matches) {\n interaction[method](pointer, event, eventTarget, curEventTarget)\n }\n }\n}\n\nfunction getInteraction (searchDetails: SearchDetails) {\n const { pointerType, scope } = searchDetails\n\n const foundInteraction = finder.search(searchDetails)\n const signalArg = { interaction: foundInteraction, searchDetails }\n\n scope.fire('interactions:find', signalArg)\n\n return signalArg.interaction || scope.interactions.new({ pointerType })\n}\n\nfunction onDocSignal<T extends 'scope:add-document' | 'scope:remove-document'> ({ doc, scope, options }: Interact.SignalArgs[T], eventMethodName: 'add' | 'remove') {\n const { interactions: { docEvents }, events } = scope\n const eventMethod = events[eventMethodName]\n\n if (scope.browser.isIOS && !options.events) {\n options.events = { passive: false }\n }\n\n // delegate event listener\n for (const eventType in events.delegatedEvents) {\n eventMethod(doc, eventType, events.delegateListener)\n eventMethod(doc, eventType, events.delegateUseCapture, true)\n }\n\n const eventOptions = options && options.events\n\n for (const { type, listener } of docEvents) {\n eventMethod(doc, type, listener, eventOptions)\n }\n}\n\nconst interactions: Interact.Plugin = {\n id: 'core/interactions',\n install,\n listeners: {\n 'scope:add-document': arg => onDocSignal(arg, 'add'),\n 'scope:remove-document': arg => onDocSignal(arg, 'remove'),\n 'interactable:unset': ({ interactable }, scope) => {\n // Stop and destroy related interactions when an Interactable is unset\n for (let i = scope.interactions.list.length - 1; i >= 0; i--) {\n const interaction = scope.interactions.list[i]\n\n if (interaction.interactable !== interactable) { continue }\n\n interaction.stop()\n scope.fire('interactions:destroy', { interaction })\n interaction.destroy()\n\n if (scope.interactions.list.length > 2) {\n scope.interactions.list.splice(i, 1)\n }\n }\n },\n },\n onDocSignal,\n doOnInteractions,\n methodNames,\n}\n\nexport default interactions\n","import * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport clone from '@interactjs/utils/clone'\nimport domObjects from '@interactjs/utils/domObjects'\nimport extend from '@interactjs/utils/extend'\nimport raf from '@interactjs/utils/raf'\nimport win from '@interactjs/utils/window'\n\nimport { Eventable } from './Eventable'\nimport { InteractEvent, PhaseMap } from './InteractEvent'\nimport { Interactable as InteractableBase } from './Interactable'\nimport { InteractableSet } from './InteractableSet'\nimport { defaults } from './defaultOptions'\nimport events from './events'\nimport { createInteractStatic } from './interactStatic'\nimport interactions from './interactions'\n\nexport interface SignalArgs {\n 'scope:add-document': DocSignalArg\n 'scope:remove-document': DocSignalArg\n 'interactable:unset': { interactable: InteractableBase }\n 'interactable:set': { interactable: InteractableBase, options: Interact.OptionsArg }\n 'interactions:destroy': { interaction: Interact.Interaction }\n}\n\nexport type ListenerName = keyof SignalArgs\n\nexport type ListenerMap = {\n [P in ListenerName]?: (arg: SignalArgs[P], scope: Scope, signalName: P) => void | boolean\n}\n\ninterface DocSignalArg {\n doc: Document\n window: Window\n scope: Scope\n options?: { [index: string]: any }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ActionMap { // tslint:disable-line no-empty-interface\n}\n\nexport type ActionName = keyof ActionMap\n\nexport interface Actions {\n map: ActionMap\n phases: PhaseMap\n methodDict: { [P in ActionName]?: string }\n phaselessTypes: { [type: string]: true }\n}\n\n/**\n * plugin typedef\n * @typedef Plugin\n */\nexport interface Plugin {\n [key: string]: any\n id?: string\n listeners?: ListenerMap\n before?: string[]\n install? (scope: Scope, options?: any): void\n}\n\nexport class Scope {\n id = `__interact_scope_${Math.floor(Math.random() * 100)}`\n isInitialized = false\n listenerMaps: Array<{\n map: ListenerMap\n id: string\n }> = []\n\n browser = browser\n defaults = clone(defaults) as typeof defaults\n Eventable = Eventable\n actions: Actions = {\n map: {},\n phases: {\n start: true,\n move: true,\n end: true,\n },\n methodDict: {},\n phaselessTypes: {},\n }\n\n interactStatic = createInteractStatic(this)\n InteractEvent = InteractEvent\n Interactable: typeof InteractableBase\n interactables = new InteractableSet(this)\n\n // main window\n _win!: Window\n\n // main document\n document!: Document\n\n // main window\n window!: Window\n\n // all documents being listened to\n documents: Array<{ doc: Document, options: any }> = []\n\n _plugins: {\n list: Plugin[]\n map: { [id: string]: Plugin }\n } = {\n list: [],\n map: {},\n }\n\n constructor () {\n const scope = this\n\n this.Interactable = class extends InteractableBase {\n get _defaults () { return scope.defaults }\n\n set <T extends InteractableBase> (this: T, options: Interact.OptionsArg) {\n super.set(options)\n\n scope.fire('interactable:set', {\n options,\n interactable: this,\n })\n\n return this\n }\n\n unset (this: InteractableBase) {\n super.unset()\n scope.interactables.list.splice(scope.interactables.list.indexOf(this), 1)\n\n scope.fire('interactable:unset', { interactable: this })\n }\n }\n }\n\n addListeners (map: ListenerMap, id?: string) {\n this.listenerMaps.push({ id, map })\n }\n\n fire<T extends ListenerName> (name: T, arg: SignalArgs[T]): void | false {\n for (const { map: { [name]: listener } } of this.listenerMaps) {\n if (!!listener && listener(arg as any, this, name as never) === false) {\n return false\n }\n }\n }\n\n onWindowUnload = (event: BeforeUnloadEvent) => this.removeDocument(event.target as Document)\n\n init (window: Window) {\n return this.isInitialized\n ? this\n : initScope(this, window)\n }\n\n pluginIsInstalled (plugin: Plugin) {\n return this._plugins.map[plugin.id] || this._plugins.list.indexOf(plugin) !== -1\n }\n\n usePlugin (plugin: Plugin, options?: { [key: string]: any }) {\n if (!this.isInitialized) {\n return this\n }\n\n if (this.pluginIsInstalled(plugin)) {\n return this\n }\n\n if (plugin.id) { this._plugins.map[plugin.id] = plugin }\n this._plugins.list.push(plugin)\n\n if (plugin.install) {\n plugin.install(this, options)\n }\n\n if (plugin.listeners && plugin.before) {\n let index = 0\n const len = this.listenerMaps.length\n const before = plugin.before.reduce((acc, id) => {\n acc[id] = true\n return acc\n }, {})\n\n for (; index < len; index++) {\n const otherId = this.listenerMaps[index].id\n\n if (before[otherId]) { break }\n }\n\n this.listenerMaps.splice(index, 0, { id: plugin.id, map: plugin.listeners })\n }\n else if (plugin.listeners) {\n this.listenerMaps.push({ id: plugin.id, map: plugin.listeners })\n }\n\n return this\n }\n\n addDocument (doc: Document, options?: any): void | false {\n // do nothing if document is already known\n if (this.getDocIndex(doc) !== -1) { return false }\n\n const window = win.getWindow(doc)\n\n options = options ? extend({}, options) : {}\n\n this.documents.push({ doc, options })\n this.events.documents.push(doc)\n\n // don't add an unload event for the main document\n // so that the page may be cached in browser history\n if (doc !== this.document) {\n this.events.add(window, 'unload', this.onWindowUnload)\n }\n\n this.fire('scope:add-document', { doc, window, scope: this, options })\n }\n\n removeDocument (doc: Document) {\n const index = this.getDocIndex(doc)\n\n const window = win.getWindow(doc)\n const options = this.documents[index].options\n\n this.events.remove(window, 'unload', this.onWindowUnload)\n\n this.documents.splice(index, 1)\n this.events.documents.splice(index, 1)\n\n this.fire('scope:remove-document', { doc, window, scope: this, options })\n }\n\n getDocIndex (doc: Document) {\n for (let i = 0; i < this.documents.length; i++) {\n if (this.documents[i].doc === doc) {\n return i\n }\n }\n\n return -1\n }\n\n getDocOptions (doc: Document) {\n const docIndex = this.getDocIndex(doc)\n\n return docIndex === -1 ? null : this.documents[docIndex].options\n }\n\n now () {\n return ((this.window as any).Date as typeof Date || Date).now()\n }\n}\n\nexport function initScope (scope: Scope, window: Window) {\n scope.isInitialized = true\n win.init(window)\n domObjects.init(window)\n browser.init(window)\n raf.init(window)\n\n scope.window = window\n scope.document = window.document\n\n scope.usePlugin(interactions)\n scope.usePlugin(events)\n\n return scope\n}\n","import { Scope } from '@interactjs/core/scope'\n\nconst scope = new Scope()\n\nconst interact: import('@interactjs/core/interactStatic').InteractStatic = scope.interactStatic\n\nexport default interact\n\nexport const init = (win: Window) => scope.init(win)\n\nif (typeof window === 'object' && !!window) {\n init(window)\n}\n","export default () => {}\n","export default () => {}\n","import * as Interact from '@interactjs/types/index'\n\nexport type GridOptions = (Partial<Interact.Rect> | Interact.Point) & {\n range?: number\n limits?: Interact.Rect\n offset?: Interact.Point\n}\n\nexport default (grid: GridOptions) => {\n const coordFields = ([\n ['x', 'y'],\n ['left', 'top'],\n ['right', 'bottom'],\n ['width', 'height'],\n ] as const).filter(([xField, yField]) => xField in grid || yField in grid)\n\n const gridFunc: Interact.SnapFunction & {\n grid: typeof grid\n coordFields: typeof coordFields\n } = (x, y) => {\n const {\n range,\n limits = {\n left : -Infinity,\n right : Infinity,\n top : -Infinity,\n bottom: Infinity,\n },\n offset = { x: 0, y: 0 },\n } = grid\n\n const result: Interact.SnapTarget & {\n grid: typeof grid\n } = { range, grid, x: null as number, y: null as number }\n\n for (const [xField, yField] of coordFields) {\n const gridx = Math.round((x - offset.x) / (grid as any)[xField])\n const gridy = Math.round((y - offset.y) / (grid as any)[yField])\n\n result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * (grid as any)[xField] + offset.x))\n result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * (grid as any)[yField] + offset.y))\n }\n\n return result\n }\n\n gridFunc.grid = grid\n gridFunc.coordFields = coordFields\n\n return gridFunc\n}\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\n\nimport * as allSnappers from './all'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n snappers: typeof allSnappers\n createSnapGrid: typeof allSnappers.grid\n }\n}\n\nconst snappersPlugin: Interact.Plugin = {\n id: 'snappers',\n install (scope) {\n const { interactStatic: interact } = scope\n\n interact.snappers = extend(interact.snappers || {}, allSnappers)\n interact.createSnapGrid = interact.snappers.grid\n },\n}\n\nexport default snappersPlugin\n","/**\n * @module modifiers/aspectRatio\n *\n * @description\n * This module forces elements to be resized with a specified dx/dy ratio.\n *\n * @example\n * interact(target).resizable({\n * modifiers: [\n * interact.modifiers.snapSize({\n * targets: [ interact.createSnapGrid({ x: 20, y: 20 }) ],\n * }),\n * interact.aspectRatio({ ratio: 'preserve' }),\n * ],\n * });\n */\n\nimport * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport { addEdges } from '@interactjs/utils/rect'\n\nimport Modification from './Modification'\nimport { Modifier, ModifierModule, ModifierState, makeModifier } from './base'\n\nexport interface AspectRatioOptions {\n ratio?: number | 'preserve'\n equalDelta?: boolean\n modifiers?: Modifier[]\n enabled?: boolean\n}\n\nexport type AspectRatioState = ModifierState<AspectRatioOptions, {\n startCoords: Interact.Point\n startRect: Interact.Rect\n linkedEdges: Interact.EdgeOptions\n ratio: number\n equalDelta: boolean\n xIsPrimaryAxis: boolean\n edgeSign: 1 | -1\n subModification: Modification\n}>\n\nconst aspectRatio: ModifierModule<AspectRatioOptions, AspectRatioState> = {\n start (arg) {\n const { state, rect, edges: originalEdges, pageCoords: coords } = arg\n let { ratio } = state.options\n const { equalDelta, modifiers } = state.options\n\n if (ratio === 'preserve') {\n ratio = rect.width / rect.height\n }\n\n state.startCoords = extend({}, coords)\n state.startRect = extend({}, rect)\n state.ratio = ratio\n state.equalDelta = equalDelta\n\n const linkedEdges = state.linkedEdges = {\n top : originalEdges.top || (originalEdges.left && !originalEdges.bottom),\n left : originalEdges.left || (originalEdges.top && !originalEdges.right),\n bottom: originalEdges.bottom || (originalEdges.right && !originalEdges.top),\n right : originalEdges.right || (originalEdges.bottom && !originalEdges.left),\n }\n\n state.xIsPrimaryAxis = !!(originalEdges.left || originalEdges.right)\n\n if (state.equalDelta) {\n state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1) as 1 | -1\n }\n else {\n const negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left\n state.edgeSign = negativeSecondaryEdge ? -1 : 1\n }\n\n extend(arg.edges, linkedEdges)\n\n if (!modifiers || !modifiers.length) { return }\n\n const subModification = new Modification(arg.interaction)\n\n subModification.copyFrom(arg.interaction.modification)\n subModification.prepareStates(modifiers)\n\n state.subModification = subModification\n subModification.startAll({ ...arg })\n },\n\n set (arg) {\n const { state, rect, coords } = arg\n const initialCoords = extend({}, coords)\n const aspectMethod = state.equalDelta ? setEqualDelta : setRatio\n\n aspectMethod(state, state.xIsPrimaryAxis, coords, rect)\n\n if (!state.subModification) { return null }\n\n const correctedRect = extend({}, rect)\n\n addEdges(state.linkedEdges, correctedRect, { x: coords.x - initialCoords.x, y: coords.y - initialCoords.y })\n\n const result = state.subModification.setAll({\n ...arg,\n rect: correctedRect,\n edges: state.linkedEdges,\n pageCoords: coords,\n prevCoords: coords,\n prevRect: correctedRect,\n })\n\n const { delta } = result\n\n if (result.changed) {\n const xIsCriticalAxis = Math.abs(delta.x) > Math.abs(delta.y)\n\n // do aspect modification again with critical edge axis as primary\n aspectMethod(state, xIsCriticalAxis, result.coords, result.rect)\n extend(coords, result.coords)\n }\n\n return result.eventProps\n },\n\n defaults: {\n ratio: 'preserve',\n equalDelta: false,\n modifiers: [],\n enabled: false,\n },\n}\n\nfunction setEqualDelta ({ startCoords, edgeSign }: AspectRatioState, xIsPrimaryAxis: boolean, coords: Interact.Point) {\n if (xIsPrimaryAxis) {\n coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign\n }\n else {\n coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign\n }\n}\n\nfunction setRatio ({ startRect, startCoords, ratio, edgeSign }: AspectRatioState, xIsPrimaryAxis: boolean, coords: Interact.Point, rect: Interact.Rect) {\n if (xIsPrimaryAxis) {\n const newHeight = rect.width / ratio\n\n coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign\n }\n else {\n const newWidth = rect.height * ratio\n\n coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign\n }\n}\n\nexport default makeModifier(aspectRatio, 'aspectRatio')\nexport { aspectRatio }\n","import { ModifierFunction } from './base'\n\nconst noop = (() => {\n}) as unknown as ModifierFunction<any, any, 'noop'>\n\nnoop._defaults = {}\n\nexport default noop\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierModule, ModifierState } from '../base'\n\nexport interface RestrictOptions {\n // where to drag over\n restriction: Interact.RectResolvable<[number, number, Interact.Interaction]>\n // what part of self is allowed to drag over\n elementRect: Interact.Rect\n offset: Interact.Rect\n // restrict just before the end drag\n endOnly: boolean\n enabled?: boolean\n}\n\nexport type RestrictState = ModifierState<RestrictOptions, {\n offset: Interact.Rect\n}>\n\nfunction start ({ rect, startOffset, state, interaction, pageCoords }: ModifierArg<RestrictState>) {\n const { options } = state\n const { elementRect } = options\n const offset: Interact.Rect = extend({\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n }, options.offset || {})\n\n if (rect && elementRect) {\n const restriction = getRestrictionRect(options.restriction, interaction, pageCoords)\n\n if (restriction) {\n const widthDiff = (restriction.right - restriction.left) - rect.width\n const heightDiff = (restriction.bottom - restriction.top) - rect.height\n\n if (widthDiff < 0) {\n offset.left += widthDiff\n offset.right += widthDiff\n }\n if (heightDiff < 0) {\n offset.top += heightDiff\n offset.bottom += heightDiff\n }\n }\n\n offset.left += startOffset.left - (rect.width * elementRect.left)\n offset.top += startOffset.top - (rect.height * elementRect.top)\n\n offset.right += startOffset.right - (rect.width * (1 - elementRect.right))\n offset.bottom += startOffset.bottom - (rect.height * (1 - elementRect.bottom))\n }\n\n state.offset = offset\n}\n\nfunction set ({ coords, interaction, state }: ModifierArg<RestrictState>) {\n const { options, offset } = state\n\n const restriction = getRestrictionRect(options.restriction, interaction, coords)\n\n if (!restriction) { return }\n\n const rect = rectUtils.xywhToTlbr(restriction)\n\n coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left)\n coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top)\n}\n\nexport function getRestrictionRect (\n value: Interact.RectResolvable<[number, number, Interact.Interaction]>,\n interaction: Interact.Interaction,\n coords?: Interact.Point,\n) {\n if (is.func(value)) {\n return rectUtils.resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction])\n } else {\n return rectUtils.resolveRectLike(value, interaction.interactable, interaction.element)\n }\n}\n\nconst defaults: RestrictOptions = {\n restriction: null,\n elementRect: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrict: ModifierModule<RestrictOptions, RestrictState> = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrict, 'restrict')\nexport { restrict }\n","// This module adds the options.resize.restrictEdges setting which sets min and\n// max for the top, left, bottom and right edges of the target being resized.\n//\n// interact(target).resize({\n// edges: { top: true, left: true },\n// restrictEdges: {\n// inner: { top: 200, left: 200, right: 400, bottom: 400 },\n// outer: { top: 0, left: 0, right: 600, bottom: 600 },\n// },\n// })\n\nimport * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nimport { getRestrictionRect, RestrictOptions } from './pointer'\n\nexport interface RestrictEdgesOptions {\n inner: RestrictOptions['restriction']\n outer: RestrictOptions['restriction']\n offset?: RestrictOptions['offset']\n endOnly: boolean\n enabled?: boolean\n}\n\nexport type RestrictEdgesState = ModifierState<RestrictEdgesOptions, {\n inner: Interact.Rect\n outer: Interact.Rect\n offset: RestrictEdgesOptions['offset']\n}>\n\nconst noInner = { top: +Infinity, left: +Infinity, bottom: -Infinity, right: -Infinity }\nconst noOuter = { top: -Infinity, left: -Infinity, bottom: +Infinity, right: +Infinity }\n\nfunction start ({ interaction, startOffset, state }: ModifierArg<RestrictEdgesState>) {\n const { options } = state\n let offset\n\n if (options) {\n const offsetRect = getRestrictionRect(options.offset, interaction, interaction.coords.start.page)\n\n offset = rectUtils.rectToXY(offsetRect)\n }\n\n offset = offset || { x: 0, y: 0 }\n\n state.offset = {\n top: offset.y + startOffset.top,\n left: offset.x + startOffset.left,\n bottom: offset.y - startOffset.bottom,\n right: offset.x - startOffset.right,\n }\n}\n\nfunction set ({ coords, edges, interaction, state }: ModifierArg<RestrictEdgesState>) {\n const { offset, options } = state\n\n if (!edges) {\n return\n }\n\n const page = extend({}, coords)\n const inner = getRestrictionRect(options.inner, interaction, page) || {} as Interact.Rect\n const outer = getRestrictionRect(options.outer, interaction, page) || {} as Interact.Rect\n\n fixRect(inner, noInner)\n fixRect(outer, noOuter)\n\n if (edges.top) {\n coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top)\n }\n else if (edges.bottom) {\n coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom)\n }\n if (edges.left) {\n coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left)\n }\n else if (edges.right) {\n coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right)\n }\n}\n\nfunction fixRect (rect, defaults) {\n for (const edge of ['top', 'left', 'bottom', 'right']) {\n if (!(edge in rect)) {\n rect[edge] = defaults[edge]\n }\n }\n\n return rect\n}\n\nconst defaults: RestrictEdgesOptions = {\n inner: null,\n outer: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrictEdges = {\n noInner,\n noOuter,\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrictEdges, 'restrictEdges')\nexport { restrictEdges }\n","import extend from '@interactjs/utils/extend'\n\nimport { makeModifier } from '../base'\n\nimport { restrict } from './pointer'\n\nconst defaults = extend({\n get elementRect () {\n return { top: 0, left: 0, bottom: 1, right: 1 }\n },\n set elementRect (_) {},\n}, restrict.defaults)\n\nconst restrictRect = {\n start: restrict.start,\n set: restrict.set,\n defaults,\n}\n\nexport default makeModifier(restrictRect, 'restrictRect')\nexport { restrictRect }\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nimport { restrictEdges, RestrictEdgesState } from './edges'\nimport { getRestrictionRect, RestrictOptions } from './pointer'\n\nconst noMin = { width: -Infinity, height: -Infinity }\nconst noMax = { width: +Infinity, height: +Infinity }\n\nexport interface RestrictSizeOptions {\n min?: Interact.Size | Interact.Point | RestrictOptions['restriction']\n max?: Interact.Size | Interact.Point | RestrictOptions['restriction']\n endOnly: boolean\n enabled?: boolean\n}\n\nfunction start (arg: ModifierArg<RestrictEdgesState>) {\n return restrictEdges.start(arg)\n}\n\nexport type RestrictSizeState =\n RestrictEdgesState & ModifierState<RestrictSizeOptions & { inner: Interact.Rect, outer: Interact.Rect }, {\n min: Interact.Rect\n max: Interact.Rect\n }>\n\nfunction set (arg: ModifierArg<RestrictSizeState>) {\n const { interaction, state, rect, edges } = arg\n const { options } = state\n\n if (!edges) {\n return\n }\n\n const minSize = rectUtils.tlbrToXywh(getRestrictionRect(options.min as any, interaction, arg.coords)) || noMin\n const maxSize = rectUtils.tlbrToXywh(getRestrictionRect(options.max as any, interaction, arg.coords)) || noMax\n\n state.options = {\n endOnly: options.endOnly,\n inner: extend({}, restrictEdges.noInner),\n outer: extend({}, restrictEdges.noOuter),\n }\n\n if (edges.top) {\n state.options.inner.top = rect.bottom - minSize.height\n state.options.outer.top = rect.bottom - maxSize.height\n }\n else if (edges.bottom) {\n state.options.inner.bottom = rect.top + minSize.height\n state.options.outer.bottom = rect.top + maxSize.height\n }\n if (edges.left) {\n state.options.inner.left = rect.right - minSize.width\n state.options.outer.left = rect.right - maxSize.width\n }\n else if (edges.right) {\n state.options.inner.right = rect.left + minSize.width\n state.options.outer.right = rect.left + maxSize.width\n }\n\n restrictEdges.set(arg)\n\n state.options = options\n}\n\nconst defaults: RestrictSizeOptions = {\n min: null,\n max: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrictSize = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrictSize, 'restrictSize')\nexport { restrictSize }\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport hypot from '@interactjs/utils/hypot'\nimport is from '@interactjs/utils/is'\nimport { resolveRectLike, rectToXY } from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nexport interface Offset {\n x: number\n y: number\n index: number\n relativePoint?: Interact.Point\n}\n\nexport interface SnapPosition {\n x?: number\n y?: number\n range?: number\n offset?: Offset\n [index: string]: any\n}\n\nexport type SnapFunction = (\n x: number,\n y: number,\n interaction: Interact.InteractionProxy,\n offset: Offset,\n index: number\n) => SnapPosition\nexport type SnapTarget = SnapPosition | SnapFunction\nexport interface SnapOptions {\n targets: SnapTarget[]\n // target range\n range: number\n // self points for snapping. [0,0] = top left, [1,1] = bottom right\n relativePoints: Interact.Point[]\n // startCoords = offset snapping from drag start page position\n offset: Interact.Point | Interact.RectResolvable<[Interact.Interaction]> | 'startCoords'\n offsetWithOrigin?: boolean\n origin: Interact.RectResolvable<[Interact.Element]> | Interact.Point\n endOnly?: boolean\n enabled?: boolean\n}\n\nexport type SnapState = ModifierState<SnapOptions, {\n offsets?: Offset[]\n closest?: any\n targetFields?: string[][]\n}>\n\nfunction start (arg: ModifierArg<SnapState>) {\n const { interaction, interactable, element, rect, state, startOffset } = arg\n const { options } = state\n const origin = options.offsetWithOrigin\n ? getOrigin(arg)\n : { x: 0, y: 0 }\n\n let snapOffset: Interact.Point\n\n if (options.offset === 'startCoords') {\n snapOffset = {\n x: interaction.coords.start.page.x,\n y: interaction.coords.start.page.y,\n }\n }\n else {\n const offsetRect = resolveRectLike(options.offset as any, interactable, element, [interaction])\n\n snapOffset = rectToXY(offsetRect) || { x: 0, y: 0 }\n snapOffset.x += origin.x\n snapOffset.y += origin.y\n }\n\n const { relativePoints } = options\n\n state.offsets = rect && relativePoints && relativePoints.length\n ? relativePoints.map((relativePoint, index) => ({\n index,\n relativePoint,\n x: startOffset.left - (rect.width * relativePoint.x) + snapOffset.x,\n y: startOffset.top - (rect.height * relativePoint.y) + snapOffset.y,\n }))\n : [extend({\n index: 0,\n relativePoint: null,\n }, snapOffset)]\n}\n\nfunction set (arg: ModifierArg<SnapState>) {\n const { interaction, coords, state } = arg\n const { options, offsets } = state\n\n const origin = getOriginXY(interaction.interactable, interaction.element, interaction.prepared.name)\n const page = extend({}, coords)\n const targets = []\n\n if (!options.offsetWithOrigin) {\n page.x -= origin.x\n page.y -= origin.y\n }\n\n for (const offset of offsets) {\n const relativeX = page.x - offset.x\n const relativeY = page.y - offset.y\n\n for (let index = 0, len = options.targets.length; index < len; index++) {\n const snapTarget = options.targets[index]\n let target: SnapPosition\n\n if (is.func(snapTarget)) {\n target = snapTarget(relativeX, relativeY, interaction._proxy, offset, index)\n }\n else {\n target = snapTarget\n }\n\n if (!target) { continue }\n\n targets.push({\n x: (is.number(target.x) ? target.x : relativeX) + offset.x,\n y: (is.number(target.y) ? target.y : relativeY) + offset.y,\n\n range: is.number(target.range) ? target.range : options.range,\n source: snapTarget,\n index,\n offset,\n })\n }\n }\n\n const closest = {\n target: null,\n inRange: false,\n distance: 0,\n range: 0,\n delta: { x: 0, y: 0 },\n }\n\n for (const target of targets) {\n const range = target.range\n const dx = target.x - page.x\n const dy = target.y - page.y\n const distance = hypot(dx, dy)\n let inRange = distance <= range\n\n // Infinite targets count as being out of range\n // compared to non infinite ones that are in range\n if (range === Infinity && closest.inRange && closest.range !== Infinity) {\n inRange = false\n }\n\n if (!closest.target || (inRange\n // is the closest target in range?\n ? (closest.inRange && range !== Infinity\n // the pointer is relatively deeper in this target\n ? distance / range < closest.distance / closest.range\n // this target has Infinite range and the closest doesn't\n : (range === Infinity && closest.range !== Infinity) ||\n // OR this target is closer that the previous closest\n distance < closest.distance)\n // The other is not in range and the pointer is closer to this target\n : (!closest.inRange && distance < closest.distance))) {\n closest.target = target\n closest.distance = distance\n closest.range = range\n closest.inRange = inRange\n closest.delta.x = dx\n closest.delta.y = dy\n }\n }\n\n if (closest.inRange) {\n coords.x = closest.target.x\n coords.y = closest.target.y\n }\n\n state.closest = closest\n return closest\n}\n\nfunction getOrigin (arg: Partial<ModifierArg<SnapState>>) {\n const { element } = arg.interaction\n const optionsOrigin = rectToXY(\n resolveRectLike(arg.state.options.origin as any, null, null, [element]),\n )\n const origin = optionsOrigin || getOriginXY(\n arg.interactable,\n element,\n arg.interaction.prepared.name,\n )\n\n return origin\n}\n\nconst defaults: SnapOptions = {\n range : Infinity,\n targets: null,\n offset: null,\n offsetWithOrigin: true,\n origin: null,\n relativePoints: null,\n endOnly: false,\n enabled: false,\n}\nconst snap = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(snap, 'snap')\nexport { snap }\n","// This module allows snapping of the size of targets during resize\n// interactions.\n\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\nimport { makeModifier, ModifierArg } from '../base'\n\nimport { snap, SnapOptions, SnapState } from './pointer'\n\nexport type SnapSizeOptions = Pick<\nSnapOptions,\n'targets' | 'offset' | 'endOnly' | 'range' | 'enabled'\n>\n\nfunction start (arg: ModifierArg<SnapState>) {\n const { state, edges } = arg\n const { options } = state\n\n if (!edges) { return null }\n\n arg.state = {\n options: {\n targets: null,\n relativePoints: [{\n x: edges.left ? 0 : 1,\n y: edges.top ? 0 : 1,\n }],\n offset: options.offset || 'self',\n origin: { x: 0, y: 0 },\n range: options.range,\n },\n }\n\n state.targetFields = state.targetFields || [\n ['width', 'height'],\n ['x', 'y'],\n ]\n\n snap.start(arg)\n state.offsets = arg.state.offsets\n\n arg.state = state\n}\n\nfunction set (arg) {\n const { interaction, state, coords } = arg\n const { options, offsets } = state\n const relative = {\n x: coords.x - offsets[0].x,\n y: coords.y - offsets[0].y,\n }\n\n state.options = extend({}, options)\n state.options.targets = []\n\n for (const snapTarget of (options.targets || [])) {\n let target\n\n if (is.func(snapTarget)) {\n target = snapTarget(relative.x, relative.y, interaction)\n }\n else {\n target = snapTarget\n }\n\n if (!target) { continue }\n\n for (const [xField, yField] of state.targetFields) {\n if (xField in target || yField in target) {\n target.x = target[xField]\n target.y = target[yField]\n\n break\n }\n }\n\n state.options.targets.push(target)\n }\n\n const returnValue = snap.set(arg)\n\n state.options = options\n\n return returnValue\n}\n\nconst defaults: SnapSizeOptions = {\n range: Infinity,\n targets: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst snapSize = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(snapSize, 'snapSize')\nexport { snapSize }\n","/**\n * @module modifiers/snapEdges\n *\n * @description\n * This module allows snapping of the edges of targets during resize\n * interactions.\n *\n * @example\n * interact(target).resizable({\n * snapEdges: {\n * targets: [interact.snappers.grid({ x: 100, y: 50 })],\n * },\n * })\n *\n * interact(target).resizable({\n * snapEdges: {\n * targets: [\n * interact.snappers.grid({\n * top: 50,\n * left: 50,\n * bottom: 100,\n * right: 100,\n * }),\n * ],\n * },\n * })\n */\n\nimport clone from '@interactjs/utils/clone'\nimport extend from '@interactjs/utils/extend'\n\nimport { makeModifier, ModifierArg, ModifierModule } from '../base'\n\nimport { SnapOptions, SnapState } from './pointer'\nimport { snapSize } from './size'\n\nexport type SnapEdgesOptions = Pick<SnapOptions, 'targets' | 'range' | 'offset' | 'endOnly' | 'enabled'>\n\nfunction start (arg: ModifierArg<SnapState>) {\n const { edges } = arg\n\n if (!edges) { return null }\n\n arg.state.targetFields = arg.state.targetFields || [\n [edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom'],\n ]\n\n return snapSize.start(arg)\n}\n\nconst snapEdges: ModifierModule<SnapEdgesOptions, SnapState> = {\n start,\n set: snapSize.set,\n defaults: extend(\n clone(snapSize.defaults),\n {\n targets: null,\n range: null,\n offset: { x: 0, y: 0 },\n } as const,\n ),\n}\n\nexport default makeModifier(snapEdges, 'snapEdges')\nexport { snapEdges }\n","/* eslint-disable node/no-extraneous-import */\nimport aspectRatio from './aspectRatio'\nimport avoid from './avoid'\nimport restrictEdges from './restrict/edges'\nimport restrict from './restrict/pointer'\nimport restrictRect from './restrict/rect'\nimport restrictSize from './restrict/size'\nimport rubberband from './rubberband'\nimport snapEdges from './snap/edges'\nimport snap from './snap/pointer'\nimport snapSize from './snap/size'\nimport spring from './spring'\nimport transform from './transform'\n\nexport default {\n aspectRatio,\n restrictEdges,\n restrict,\n restrictRect,\n restrictSize,\n snapEdges,\n snap,\n snapSize,\n\n spring,\n avoid,\n transform,\n rubberband,\n}\n","import snappers from '@interactjs/snappers/plugin'\nimport * as Interact from '@interactjs/types/index'\n\nimport all from './all'\nimport base from './base'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n modifiers: typeof all\n }\n}\n\nconst modifiers: Interact.Plugin = {\n id: 'modifiers',\n install (scope) {\n const { interactStatic: interact } = scope\n\n scope.usePlugin(base)\n scope.usePlugin(snappers)\n\n interact.modifiers = all\n\n // for backwrads compatibility\n for (const type in all) {\n const { _defaults, _methods } = all[type as keyof typeof all]\n\n ;(_defaults as any)._methods = _methods\n ;(scope.defaults.perAction as any)[type] = _defaults\n }\n },\n}\n\nexport default modifiers\n","import * as Interact from '@interactjs/types/index'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport BaseEvent from '../core/BaseEvent'\n\nexport default class PointerEvent<T extends string = any> extends BaseEvent {\n type: T\n originalEvent: Interact.PointerEventType\n pointerId: number\n pointerType: string\n double: boolean\n pageX: number\n pageY: number\n clientX: number\n clientY: number\n dt: number\n eventable: any\n [key: string]: any\n\n /** */\n constructor (\n type: T,\n pointer: Interact.PointerType | PointerEvent<any>,\n event: Interact.PointerEventType,\n eventTarget: Interact.EventTarget,\n interaction: Interact.Interaction,\n timeStamp: number,\n ) {\n super(interaction)\n pointerUtils.pointerExtend(this, event)\n\n if (event !== pointer) {\n pointerUtils.pointerExtend(this, pointer)\n }\n\n this.timeStamp = timeStamp\n this.originalEvent = event\n this.type = type\n this.pointerId = pointerUtils.getPointerId(pointer)\n this.pointerType = pointerUtils.getPointerType(pointer)\n this.target = eventTarget\n this.currentTarget = null\n\n if (type === 'tap') {\n const pointerIndex = interaction.getPointerIndex(pointer)\n this.dt = this.timeStamp - interaction.pointers[pointerIndex].downTime\n\n const interval = this.timeStamp - interaction.tapTime\n\n this.double = !!(interaction.prevTap &&\n interaction.prevTap.type !== 'doubletap' &&\n interaction.prevTap.target === this.target &&\n interval < 500)\n }\n else if (type === 'doubletap') {\n this.dt = (pointer as PointerEvent<'tap'>).timeStamp - interaction.tapTime\n }\n }\n\n _subtractOrigin ({ x: originX, y: originY }: Interact.Point) {\n this.pageX -= originX\n this.pageY -= originY\n this.clientX -= originX\n this.clientY -= originY\n\n return this\n }\n\n _addOrigin ({ x: originX, y: originY }: Interact.Point) {\n this.pageX += originX\n this.pageY += originY\n this.clientX += originX\n this.clientY += originY\n\n return this\n }\n\n /**\n * Prevent the default behaviour of the original Event\n */\n preventDefault () {\n this.originalEvent.preventDefault()\n }\n}\n\nexport { PointerEvent }\n","import { Eventable } from '@interactjs/core/Eventable'\nimport { Interaction } from '@interactjs/core/Interaction'\nimport { PerActionDefaults } from '@interactjs/core/defaultOptions'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\n\nimport { PointerEvent } from './PointerEvent'\n\nexport type EventTargetList = Array<{\n node: Node\n eventable: Eventable\n props: { [key: string]: any }\n}>\n\nexport interface PointerEventOptions extends PerActionDefaults {\n enabled?: undefined // not used\n holdDuration?: number\n ignoreFrom?: any\n allowFrom?: any\n origin?: Interact.Point | string | Interact.Element\n}\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n pointerEvents: typeof pointerEvents\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n prevTap?: PointerEvent<string>\n tapTime?: number\n }\n}\n\ndeclare module '@interactjs/core/PointerInfo' {\n interface PointerInfo {\n hold?: {\n duration: number\n timeout: any\n }\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n pointerEvents: Interact.Options\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'pointerEvents:new': { pointerEvent: PointerEvent<any> }\n 'pointerEvents:fired': {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent<any>\n event: Interact.PointerEventType | PointerEvent<any>\n eventTarget: Interact.EventTarget\n pointerEvent: PointerEvent<any>\n targets?: EventTargetList\n type: string\n }\n 'pointerEvents:collect-targets': {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent<any>\n event: Interact.PointerEventType | PointerEvent<any>\n eventTarget: Interact.EventTarget\n targets?: EventTargetList\n type: string\n path: Node[]\n node: null\n }\n }\n}\n\nconst defaults: PointerEventOptions = {\n holdDuration: 600,\n ignoreFrom : null,\n allowFrom : null,\n origin : { x: 0, y: 0 },\n}\n\nconst pointerEvents: Interact.Plugin = {\n id: 'pointer-events/base',\n install,\n listeners: {\n 'interactions:new': addInteractionProps,\n 'interactions:update-pointer': addHoldInfo,\n 'interactions:move': moveAndClearHold,\n 'interactions:down': (arg, scope) => {\n downAndStartHold(arg, scope)\n fire(arg, scope)\n },\n 'interactions:up': (arg, scope) => {\n clearHold(arg)\n fire(arg, scope)\n tapAfterUp(arg, scope)\n },\n 'interactions:cancel': (arg, scope) => {\n clearHold(arg)\n fire(arg, scope)\n },\n },\n PointerEvent,\n fire,\n collectEventTargets,\n defaults,\n types: {\n down: true,\n move: true,\n up: true,\n cancel: true,\n tap: true,\n doubletap: true,\n hold: true,\n } as { [type: string]: true },\n}\n\nfunction fire<T extends string> (\n arg: {\n pointer: Interact.PointerType | PointerEvent<any>\n event: Interact.PointerEventType | PointerEvent<any>\n eventTarget: Interact.EventTarget\n interaction: Interaction\n type: T\n targets?: EventTargetList\n },\n scope: Interact.Scope,\n) {\n const {\n interaction,\n pointer,\n event,\n eventTarget,\n type,\n targets = collectEventTargets(arg, scope),\n } = arg\n\n const pointerEvent = new PointerEvent(type, pointer, event, eventTarget, interaction, scope.now())\n\n scope.fire('pointerEvents:new', { pointerEvent })\n\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n targets,\n type,\n pointerEvent,\n }\n\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i]\n\n for (const prop in target.props || {}) {\n (pointerEvent as any)[prop] = target.props[prop]\n }\n\n const origin = getOriginXY(target.eventable, target.node)\n\n pointerEvent._subtractOrigin(origin)\n pointerEvent.eventable = target.eventable\n pointerEvent.currentTarget = target.node\n\n target.eventable.fire(pointerEvent)\n\n pointerEvent._addOrigin(origin)\n\n if (pointerEvent.immediatePropagationStopped ||\n (pointerEvent.propagationStopped &&\n (i + 1) < targets.length && targets[i + 1].node !== pointerEvent.currentTarget)) {\n break\n }\n }\n\n scope.fire('pointerEvents:fired', signalArg)\n\n if (type === 'tap') {\n // if pointerEvent should make a double tap, create and fire a doubletap\n // PointerEvent and use that as the prevTap\n const prevTap = pointerEvent.double\n ? fire({\n interaction,\n pointer,\n event,\n eventTarget,\n type: 'doubletap',\n }, scope)\n : pointerEvent\n\n interaction.prevTap = prevTap\n interaction.tapTime = prevTap.timeStamp\n }\n\n return pointerEvent\n}\n\nfunction collectEventTargets<T extends string> ({ interaction, pointer, event, eventTarget, type }: {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent<any>\n event: Interact.PointerEventType | PointerEvent<any>\n eventTarget: Interact.EventTarget\n type: T\n}, scope: Interact.Scope) {\n const pointerIndex = interaction.getPointerIndex(pointer)\n const pointerInfo = interaction.pointers[pointerIndex]\n\n // do not fire a tap event if the pointer was moved before being lifted\n if (type === 'tap' && (interaction.pointerWasMoved ||\n // or if the pointerup target is different to the pointerdown target\n !(pointerInfo && pointerInfo.downTarget === eventTarget))) {\n return []\n }\n\n const path = domUtils.getPath(eventTarget as Interact.Element | Document)\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n type,\n path,\n targets: [] as EventTargetList,\n node: null,\n }\n\n for (const node of path) {\n signalArg.node = node\n\n scope.fire('pointerEvents:collect-targets', signalArg)\n }\n\n if (type === 'hold') {\n signalArg.targets = signalArg.targets.filter(target =>\n target.eventable.options.holdDuration === interaction.pointers[pointerIndex].hold.duration)\n }\n\n return signalArg.targets\n}\n\nfunction addInteractionProps ({ interaction }) {\n interaction.prevTap = null // the most recent tap event on this interaction\n interaction.tapTime = 0 // time of the most recent tap event\n}\n\nfunction addHoldInfo ({ down, pointerInfo }: Interact.SignalArgs['interactions:update-pointer']) {\n if (!down && pointerInfo.hold) {\n return\n }\n\n pointerInfo.hold = { duration: Infinity, timeout: null }\n}\n\nfunction clearHold ({ interaction, pointerIndex }) {\n if (interaction.pointers[pointerIndex].hold) {\n clearTimeout(interaction.pointers[pointerIndex].hold.timeout)\n }\n}\n\nfunction moveAndClearHold (\n { interaction, pointer, event, eventTarget, duplicate }: Interact.SignalArgs['interactions:move'],\n scope: Interact.Scope,\n) {\n const pointerIndex = interaction.getPointerIndex(pointer)\n\n if (!duplicate && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {\n if (interaction.pointerIsDown) {\n clearTimeout(interaction.pointers[pointerIndex].hold.timeout)\n }\n\n fire({\n interaction,\n pointer,\n event,\n eventTarget: eventTarget as Interact.Element,\n type: 'move',\n }, scope)\n }\n}\n\nfunction downAndStartHold ({ interaction, pointer, event, eventTarget, pointerIndex }: Interact.SignalArgs['interactions:down'], scope: Interact.Scope) {\n const timer = interaction.pointers[pointerIndex].hold\n const path = domUtils.getPath(eventTarget as Interact.Element | Document)\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n type: 'hold',\n targets: [] as EventTargetList,\n path,\n node: null,\n }\n\n for (const node of path) {\n signalArg.node = node\n\n scope.fire('pointerEvents:collect-targets', signalArg)\n }\n\n if (!signalArg.targets.length) { return }\n\n let minDuration = Infinity\n\n for (const target of signalArg.targets) {\n const holdDuration = target.eventable.options.holdDuration\n\n if (holdDuration < minDuration) {\n minDuration = holdDuration\n }\n }\n\n timer.duration = minDuration\n timer.timeout = setTimeout(() => {\n fire({\n interaction,\n eventTarget,\n pointer,\n event,\n type: 'hold',\n }, scope)\n }, minDuration)\n}\n\nfunction tapAfterUp ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:up'], scope: Interact.Scope) {\n if (!interaction.pointerWasMoved) {\n fire({ interaction, eventTarget, pointer, event, type: 'tap' }, scope)\n }\n}\n\nfunction install (scope: Scope) {\n scope.pointerEvents = pointerEvents\n scope.defaults.actions.pointerEvents = pointerEvents.defaults\n extend(scope.actions.phaselessTypes, pointerEvents.types)\n}\n\nexport default pointerEvents\n","import { ListenerMap } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\n\nimport PointerEvent from './PointerEvent'\nimport basePlugin from './base'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n holdIntervalHandle?: any\n }\n}\n\ndeclare module '@interactjs/pointer-events/PointerEvent' {\n interface PointerEvent<T extends string = any> {\n count?: number\n }\n}\n\ndeclare module '@interactjs/pointer-events/base' {\n interface PointerEventOptions {\n holdRepeatInterval?: number\n }\n}\n\nfunction install (scope: Interact.Scope) {\n scope.usePlugin(basePlugin)\n\n const {\n pointerEvents,\n } = scope\n\n // don't repeat by default\n pointerEvents.defaults.holdRepeatInterval = 0\n pointerEvents.types.holdrepeat = scope.actions.phaselessTypes.holdrepeat = true\n}\n\nfunction onNew ({ pointerEvent }: { pointerEvent: PointerEvent<any> }) {\n if (pointerEvent.type !== 'hold') { return }\n\n pointerEvent.count = (pointerEvent.count || 0) + 1\n}\n\nfunction onFired (\n { interaction, pointerEvent, eventTarget, targets }: Interact.SignalArgs['pointerEvents:fired'],\n scope: Interact.Scope,\n) {\n if (pointerEvent.type !== 'hold' || !targets.length) { return }\n\n // get the repeat interval from the first eventable\n const interval = targets[0].eventable.options.holdRepeatInterval\n\n // don't repeat if the interval is 0 or less\n if (interval <= 0) { return }\n\n // set a timeout to fire the holdrepeat event\n interaction.holdIntervalHandle = setTimeout(() => {\n scope.pointerEvents.fire({\n interaction,\n eventTarget,\n type: 'hold',\n pointer: pointerEvent,\n event: pointerEvent,\n }, scope)\n }, interval)\n}\n\nfunction endHoldRepeat ({ interaction }: { interaction: Interact.Interaction }) {\n // set the interaction's holdStopTime property\n // to stop further holdRepeat events\n if (interaction.holdIntervalHandle) {\n clearInterval(interaction.holdIntervalHandle)\n interaction.holdIntervalHandle = null\n }\n}\n\nconst holdRepeat: Interact.Plugin = {\n id: 'pointer-events/holdRepeat',\n install,\n listeners: ['move', 'up', 'cancel', 'endall'].reduce(\n (acc, enderTypes) => {\n (acc as any)[`pointerEvents:${enderTypes}`] = endHoldRepeat\n return acc\n },\n {\n 'pointerEvents:new': onNew,\n 'pointerEvents:fired': onFired,\n } as ListenerMap,\n ),\n}\n\nexport default holdRepeat\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n pointerEvents: typeof pointerEventsMethod\n __backCompatOption: (optionName: string, newValue: any) => any\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const { Interactable } = scope\n\n Interactable.prototype.pointerEvents = pointerEventsMethod\n\n const __backCompatOption = Interactable.prototype._backCompatOption\n\n Interactable.prototype._backCompatOption = function (optionName, newValue) {\n const ret = __backCompatOption.call(this, optionName, newValue)\n\n if (ret === this) {\n this.events.options[optionName] = newValue\n }\n\n return ret\n }\n}\n\nfunction pointerEventsMethod (this: Interact.Interactable, options: any) {\n extend(this.events.options, options)\n\n return this\n}\n\nconst plugin: Interact.Plugin = {\n id: 'pointer-events/interactableTargets',\n install,\n listeners: {\n 'pointerEvents:collect-targets': ({\n targets,\n node,\n type,\n eventTarget,\n }, scope) => {\n scope.interactables.forEachMatch(node, (interactable: Interact.Interactable) => {\n const eventable = interactable.events\n const options = eventable.options\n\n if (\n eventable.types[type] &&\n eventable.types[type].length &&\n interactable.testIgnoreAllow(options, node, eventTarget)) {\n targets.push({\n node,\n eventable,\n props: { interactable },\n })\n }\n })\n },\n\n 'interactable:new': ({ interactable }) => {\n interactable.events.getRect = function (element: Interact.Element) {\n return interactable.getRect(element)\n }\n },\n\n 'interactable:set': ({ interactable, options }, scope) => {\n extend(interactable.events.options, scope.pointerEvents.defaults)\n extend(interactable.events.options, options.pointerEvents || {})\n },\n },\n}\n\nexport default plugin\n","import * as Interact from '@interactjs/types/index'\n\nimport * as pointerEvents from './base'\nimport holdRepeat from './holdRepeat'\nimport interactableTargets from './interactableTargets'\n\nconst plugin: Interact.Plugin = {\n id: 'pointer-events',\n install (scope) {\n scope.usePlugin(pointerEvents)\n scope.usePlugin(holdRepeat)\n scope.usePlugin(interactableTargets)\n },\n}\n\nexport default plugin\n\nexport {\n pointerEvents,\n holdRepeat,\n interactableTargets,\n}\n","import { Interactable } from '@interactjs/core/Interactable'\nimport { ActionProps, Interaction } from '@interactjs/core/Interaction'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport { tlbrToXywh } from '@interactjs/utils/rect'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n reflow: (action: ActionProps) => ReturnType<typeof reflow>\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n _reflowPromise: Promise<void>\n _reflowResolve: () => void\n }\n}\n\ndeclare module '@interactjs/core/InteractEvent' {\n // eslint-disable-next-line no-shadow\n interface PhaseMap {\n reflow?: true\n }\n}\n\nexport function install (scope: Scope) {\n const {\n /** @lends Interactable */\n // eslint-disable-next-line no-shadow\n Interactable,\n } = scope\n\n scope.actions.phases.reflow = true\n\n /**\n * ```js\n * const interactable = interact(target)\n * const drag = { name: drag, axis: 'x' }\n * const resize = { name: resize, edges: { left: true, bottom: true }\n *\n * interactable.reflow(drag)\n * interactable.reflow(resize)\n * ```\n *\n * Start an action sequence to re-apply modifiers, check drops, etc.\n *\n * @param { Object } action The action to begin\n * @param { string } action.name The name of the action\n * @returns { Promise } A promise that resolves to the `Interactable` when actions on all targets have ended\n */\n Interactable.prototype.reflow = function (action) {\n return reflow(this, action, scope)\n }\n}\n\nfunction reflow<T extends Interact.ActionName> (interactable: Interactable, action: ActionProps<T>, scope: Scope): Promise<Interactable> {\n const elements = (is.string(interactable.target)\n ? arr.from(interactable._context.querySelectorAll(interactable.target))\n : [interactable.target]) as Interact.Element[]\n\n // tslint:disable-next-line variable-name\n const Promise = (scope.window as any).Promise\n const promises: Array<Promise<null>> | null = Promise ? [] : null\n\n for (const element of elements) {\n const rect = interactable.getRect(element as HTMLElement | SVGElement)\n\n if (!rect) { break }\n\n const runningInteraction = arr.find(\n scope.interactions.list,\n (interaction: Interaction) => {\n return interaction.interacting() &&\n interaction.interactable === interactable &&\n interaction.element === element &&\n interaction.prepared.name === action.name\n })\n let reflowPromise: Promise<null>\n\n if (runningInteraction) {\n runningInteraction.move()\n\n if (promises) {\n reflowPromise = runningInteraction._reflowPromise || new Promise((resolve: any) => {\n runningInteraction._reflowResolve = resolve\n })\n }\n }\n else {\n const xywh = tlbrToXywh(rect)\n const coords = {\n page : { x: xywh.x, y: xywh.y },\n client : { x: xywh.x, y: xywh.y },\n timeStamp: scope.now(),\n }\n\n const event = pointerUtils.coordsToEvent(coords)\n reflowPromise = startReflow<T>(scope, interactable, element, action, event)\n }\n\n if (promises) {\n promises.push(reflowPromise)\n }\n }\n\n return promises && Promise.all(promises).then(() => interactable)\n}\n\nfunction startReflow<T extends Interact.ActionName> (scope: Scope, interactable: Interactable, element: Interact.Element, action: ActionProps<T>, event: any) {\n const interaction = scope.interactions.new({ pointerType: 'reflow' })\n const signalArg = {\n interaction,\n event,\n pointer: event,\n eventTarget: element,\n phase: 'reflow',\n } as const\n\n interaction.interactable = interactable\n interaction.element = element\n interaction.prepared = extend({}, action)\n interaction.prevEvent = event\n interaction.updatePointer(event, event, element, true)\n\n interaction._doPhase(signalArg)\n\n const Promise: PromiseConstructor = (scope.window as unknown as any).Promise\n const reflowPromise = Promise\n ? new Promise<null>(resolve => {\n interaction._reflowResolve = resolve\n })\n : null\n\n interaction._reflowPromise = reflowPromise\n interaction.start(action, interactable, element)\n\n if (interaction._interacting) {\n interaction.move(signalArg)\n interaction.end(event)\n }\n else {\n interaction.stop()\n }\n\n interaction.removePointer(event, event)\n interaction.pointerIsDown = false\n\n return reflowPromise\n}\n\nexport default {\n id: 'reflow',\n install,\n listeners: {\n // remove completed reflow interactions\n 'interactions:stop': ({ interaction }, scope) => {\n if (interaction.pointerType === 'reflow') {\n if (interaction._reflowResolve) {\n interaction._reflowResolve()\n }\n\n arr.remove(scope.interactions.list, interaction)\n }\n },\n },\n} as Interact.Plugin\n","export default {}\n","export const exchange = {}\n","import actions from '@interactjs/actions/plugin'\nimport arrange from '@interactjs/arrange/plugin'\nimport autoScroll from '@interactjs/auto-scroll/plugin'\nimport autoStart from '@interactjs/auto-start/plugin'\nimport clone from '@interactjs/clone/plugin'\nimport interactablePreventDefault from '@interactjs/core/interactablePreventDefault'\nimport devTools from '@interactjs/dev-tools/plugin'\nimport feedback from '@interactjs/feedback/plugin'\nimport inertia from '@interactjs/inertia/plugin'\nimport interact from '@interactjs/interact'\nimport modifiers from '@interactjs/modifiers/plugin'\nimport multiTarget from '@interactjs/multi-target/plugin'\nimport offset from '@interactjs/offset/plugin'\nimport pointerEvents from '@interactjs/pointer-events/plugin'\nimport reactComponents from '@interactjs/react/plugin'\nimport reflow from '@interactjs/reflow/plugin'\nimport * as displace from '@interactjs/utils/displace'\nimport { exchange } from '@interactjs/utils/exchange'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport vueComponents from '@interactjs/vue/plugin'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n __utils: {\n exchange: typeof exchange\n displace: typeof displace\n pointer: typeof pointerUtils\n }\n }\n}\n\ninteract.use(multiTarget)\n\ninteract.use(interactablePreventDefault)\n\ninteract.use(offset)\n\n// interaction element cloning\ninteract.use(clone)\n\n// sortable and swappable\ninteract.use(arrange)\n\n// pointerEvents\ninteract.use(pointerEvents)\n\n// inertia\ninteract.use(inertia)\n\n// snap, resize, etc.\ninteract.use(modifiers)\n\n// autoStart, hold\ninteract.use(autoStart)\n\n// drag and drop, resize, gesture\ninteract.use(actions)\n\n// autoScroll\ninteract.use(autoScroll)\n\n// reflow\ninteract.use(reflow)\n\ninteract.use(feedback)\n\ninteract.use(vueComponents)\n\ninteract.use(reactComponents)\n\ninteract.__utils = {\n exchange,\n displace,\n pointer: pointerUtils,\n}\n\n// eslint-disable-next-line no-undef\nif (process.env.NODE_ENV !== 'production') {\n interact.use(devTools)\n}\n\nexport default interact\n\nif (typeof module === 'object' && !!module) {\n try { module.exports = interact }\n catch {}\n}\n\n(interact as any).default = interact\n","// eslint-disable-next-line import/no-extraneous-dependencies\nimport interact from '@interactjs/interactjs/index'\n\nexport default interact\n\nif (typeof module === 'object' && !!module) {\n try { module.exports = interact }\n catch {}\n}\n\n(interact as any).default = interact\n","\nreturn _$index_86;\n\n});\n"]}
\No newline at end of file