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ACL,MAAMnX,EAAImX,EAAI1X,EACRS,EAAIiX,EAAIzX,EACRH,EAAK2X,EAAIC,EAAItU,EAAKxC,MAAQP,EAAGO,MAC7Bb,EAAK0X,EAAIC,EAAItU,EAAKrC,OAASV,EAAGU,OACpC,MAAO,cAAclB,eAAuBU,QAAQE,cAAcX,MAAOC","sources":["webpack://app/./node_modules/svelte-dnd-action/src/helpers/dispatcher.js","webpack://app/./node_modules/svelte-dnd-action/src/constants.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/listUtil.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/intersection.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/scroller.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/util.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/observer.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/windowScroller.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/styler.js","webpack://app/./node_modules/svelte-dnd-action/src/pointerAction.js","webpack://app/./node_modules/svelte-dnd-action/src/helpers/aria.js","webpack://app/./node_modules/svelte-dnd-action/src/keyboardAction.js","webpack://app/./node_modules/svelte-dnd-action/src/action.js","webpack://app/./node_modules/svelte/animate/index.mjs"],"sourcesContent":["// external events\nconst FINALIZE_EVENT_NAME = \"finalize\";\nconst CONSIDER_EVENT_NAME = \"consider\";\n\n/**\n * @typedef {Object} Info\n * @property {string} trigger\n * @property {string} id\n * @property {string} source\n * @param {Node} el\n * @param {Array} items\n * @param {Info} info\n */\nexport function dispatchFinalizeEvent(el, items, info) {\n el.dispatchEvent(\n new CustomEvent(FINALIZE_EVENT_NAME, {\n detail: {items, info}\n })\n );\n}\n\n/**\n * Dispatches a consider event\n * @param {Node} el\n * @param {Array} items\n * @param {Info} info\n */\nexport function dispatchConsiderEvent(el, items, info) {\n el.dispatchEvent(\n new CustomEvent(CONSIDER_EVENT_NAME, {\n detail: {items, info}\n })\n );\n}\n\n// internal events\nexport const DRAGGED_ENTERED_EVENT_NAME = \"draggedEntered\";\nexport const DRAGGED_LEFT_EVENT_NAME = \"draggedLeft\";\nexport const DRAGGED_OVER_INDEX_EVENT_NAME = \"draggedOverIndex\";\nexport const DRAGGED_LEFT_DOCUMENT_EVENT_NAME = \"draggedLeftDocument\";\n\nexport const DRAGGED_LEFT_TYPES = {\n LEFT_FOR_ANOTHER: \"leftForAnother\",\n OUTSIDE_OF_ANY: \"outsideOfAny\"\n};\n\nexport function dispatchDraggedElementEnteredContainer(containerEl, indexObj, draggedEl) {\n containerEl.dispatchEvent(\n new CustomEvent(DRAGGED_ENTERED_EVENT_NAME, {\n detail: {indexObj, draggedEl}\n })\n );\n}\n\n/**\n * @param containerEl - the dropzone the element left\n * @param draggedEl - the dragged element\n * @param theOtherDz - the new dropzone the element entered\n */\nexport function dispatchDraggedElementLeftContainerForAnother(containerEl, draggedEl, theOtherDz) {\n containerEl.dispatchEvent(\n new CustomEvent(DRAGGED_LEFT_EVENT_NAME, {\n detail: {draggedEl, type: DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER, theOtherDz}\n })\n );\n}\n\nexport function dispatchDraggedElementLeftContainerForNone(containerEl, draggedEl) {\n containerEl.dispatchEvent(\n new CustomEvent(DRAGGED_LEFT_EVENT_NAME, {\n detail: {draggedEl, type: DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY}\n })\n );\n}\nexport function dispatchDraggedElementIsOverIndex(containerEl, indexObj, draggedEl) {\n containerEl.dispatchEvent(\n new CustomEvent(DRAGGED_OVER_INDEX_EVENT_NAME, {\n detail: {indexObj, draggedEl}\n })\n );\n}\nexport function dispatchDraggedLeftDocument(draggedEl) {\n window.dispatchEvent(\n new CustomEvent(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, {\n detail: {draggedEl}\n })\n );\n}\n","import {DRAGGED_ENTERED_EVENT_NAME, DRAGGED_LEFT_EVENT_NAME, DRAGGED_OVER_INDEX_EVENT_NAME} from \"./helpers/dispatcher\";\n\nexport const TRIGGERS = {\n DRAG_STARTED: \"dragStarted\",\n DRAGGED_ENTERED: DRAGGED_ENTERED_EVENT_NAME,\n DRAGGED_ENTERED_ANOTHER: \"dragEnteredAnother\",\n DRAGGED_OVER_INDEX: DRAGGED_OVER_INDEX_EVENT_NAME,\n DRAGGED_LEFT: DRAGGED_LEFT_EVENT_NAME,\n DRAGGED_LEFT_ALL: \"draggedLeftAll\",\n DROPPED_INTO_ZONE: \"droppedIntoZone\",\n DROPPED_INTO_ANOTHER: \"droppedIntoAnother\",\n DROPPED_OUTSIDE_OF_ANY: \"droppedOutsideOfAny\",\n DRAG_STOPPED: \"dragStopped\"\n};\n\nexport const SOURCES = {\n POINTER: \"pointer\",\n KEYBOARD: \"keyboard\"\n};\n\nexport const SHADOW_ITEM_MARKER_PROPERTY_NAME = \"isDndShadowItem\";\nexport const SHADOW_ELEMENT_ATTRIBUTE_NAME = \"data-is-dnd-shadow-item\";\nexport const SHADOW_PLACEHOLDER_ITEM_ID = \"id:dnd-shadow-placeholder-0000\";\nexport const DRAGGED_ELEMENT_ID = \"dnd-action-dragged-el\";\n\nexport let ITEM_ID_KEY = \"id\";\nlet activeDndZoneCount = 0;\nexport function incrementActiveDropZoneCount() {\n activeDndZoneCount++;\n}\nexport function decrementActiveDropZoneCount() {\n if (activeDndZoneCount === 0) {\n throw new Error(\"Bug! trying to decrement when there are no dropzones\");\n }\n activeDndZoneCount--;\n}\n\n/**\n * Allows using another key instead of \"id\" in the items data. This is global and applies to all dndzones.\n * Has to be called when there are no rendered dndzones whatsoever.\n * @param {String} newKeyName\n * @throws {Error} if it was called when there are rendered dndzones or if it is given the wrong type (not a string)\n */\nexport function overrideItemIdKeyNameBeforeInitialisingDndZones(newKeyName) {\n if (activeDndZoneCount > 0) {\n throw new Error(\"can only override the id key before initialising any dndzone\");\n }\n if (typeof newKeyName !== \"string\") {\n throw new Error(\"item id key has to be a string\");\n }\n printDebug(() => [\"overriding item id key name\", newKeyName]);\n ITEM_ID_KEY = newKeyName;\n}\n\nexport const isOnServer = typeof window === \"undefined\";\n\nexport let printDebug = () => {};\n\n/**\n * Allows the user to show/hide console debug output\n * * @param {Boolean} isDebug\n */\nexport function setDebugMode(isDebug) {\n if (isDebug) {\n printDebug = (generateMessage, logFunction = console.debug) => {\n const message = generateMessage();\n if (Array.isArray(message)) {\n logFunction(...message);\n } else {\n logFunction(message);\n }\n };\n } else {\n printDebug = () => {};\n }\n}\n","import {isCenterOfAInsideB, calcDistanceBetweenCenters, getAbsoluteRectNoTransforms, isPointInsideRect, findCenterOfElement} from \"./intersection\";\nimport {printDebug, SHADOW_ELEMENT_ATTRIBUTE_NAME} from \"../constants\";\n\nlet dzToShadowIndexToRect;\n\n/**\n * Resets the cache that allows for smarter \"would be index\" resolution. Should be called after every drag operation\n */\nexport function resetIndexesCache() {\n printDebug(() => \"resetting indexes cache\");\n dzToShadowIndexToRect = new Map();\n}\nresetIndexesCache();\n\n/**\n * Caches the coordinates of the shadow element when it's in a certain index in a certain dropzone.\n * Helpful in order to determine \"would be index\" more effectively\n * @param {HTMLElement} dz\n * @return {number} - the shadow element index\n */\nfunction cacheShadowRect(dz) {\n const shadowElIndex = Array.from(dz.children).findIndex(child => child.getAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME));\n if (shadowElIndex >= 0) {\n if (!dzToShadowIndexToRect.has(dz)) {\n dzToShadowIndexToRect.set(dz, new Map());\n }\n dzToShadowIndexToRect.get(dz).set(shadowElIndex, getAbsoluteRectNoTransforms(dz.children[shadowElIndex]));\n return shadowElIndex;\n }\n return undefined;\n}\n\n/**\n * @typedef {Object} Index\n * @property {number} index - the would be index\n * @property {boolean} isProximityBased - false if the element is actually over the index, true if it is not over it but this index is the closest\n */\n/**\n * Find the index for the dragged element in the list it is dragged over\n * @param {HTMLElement} floatingAboveEl\n * @param {HTMLElement} collectionBelowEl\n * @returns {Index|null} - if the element is over the container the Index object otherwise null\n */\nexport function findWouldBeIndex(floatingAboveEl, collectionBelowEl) {\n if (!isCenterOfAInsideB(floatingAboveEl, collectionBelowEl)) {\n return null;\n }\n const children = collectionBelowEl.children;\n // the container is empty, floating element should be the first\n if (children.length === 0) {\n return {index: 0, isProximityBased: true};\n }\n const shadowElIndex = cacheShadowRect(collectionBelowEl);\n\n // the search could be more efficient but keeping it simple for now\n // a possible improvement: pass in the lastIndex it was found in and check there first, then expand from there\n for (let i = 0; i < children.length; i++) {\n if (isCenterOfAInsideB(floatingAboveEl, children[i])) {\n const cachedShadowRect = dzToShadowIndexToRect.has(collectionBelowEl) && dzToShadowIndexToRect.get(collectionBelowEl).get(i);\n if (cachedShadowRect) {\n if (!isPointInsideRect(findCenterOfElement(floatingAboveEl), cachedShadowRect)) {\n return {index: shadowElIndex, isProximityBased: false};\n }\n }\n return {index: i, isProximityBased: false};\n }\n }\n // this can happen if there is space around the children so the floating element has\n //entered the container but not any of the children, in this case we will find the nearest child\n let minDistanceSoFar = Number.MAX_VALUE;\n let indexOfMin = undefined;\n // we are checking all of them because we don't know whether we are dealing with a horizontal or vertical container and where the floating element entered from\n for (let i = 0; i < children.length; i++) {\n const distance = calcDistanceBetweenCenters(floatingAboveEl, children[i]);\n if (distance < minDistanceSoFar) {\n minDistanceSoFar = distance;\n indexOfMin = i;\n }\n }\n return {index: indexOfMin, isProximityBased: true};\n}\n","// This is based off https://stackoverflow.com/questions/27745438/how-to-compute-getboundingclientrect-without-considering-transforms/57876601#57876601\n// It removes the transforms that are potentially applied by the flip animations\n/**\n * Gets the bounding rect but removes transforms (ex: flip animation)\n * @param {HTMLElement} el\n * @return {{top: number, left: number, bottom: number, right: number}}\n */\nexport function getBoundingRectNoTransforms(el) {\n let ta;\n const rect = el.getBoundingClientRect();\n const style = getComputedStyle(el);\n const tx = style.transform;\n\n if (tx) {\n let sx, sy, dx, dy;\n if (tx.startsWith(\"matrix3d(\")) {\n ta = tx.slice(9, -1).split(/, /);\n sx = +ta[0];\n sy = +ta[5];\n dx = +ta[12];\n dy = +ta[13];\n } else if (tx.startsWith(\"matrix(\")) {\n ta = tx.slice(7, -1).split(/, /);\n sx = +ta[0];\n sy = +ta[3];\n dx = +ta[4];\n dy = +ta[5];\n } else {\n return rect;\n }\n\n const to = style.transformOrigin;\n const x = rect.x - dx - (1 - sx) * parseFloat(to);\n const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(\" \") + 1));\n const w = sx ? rect.width / sx : el.offsetWidth;\n const h = sy ? rect.height / sy : el.offsetHeight;\n return {\n x: x,\n y: y,\n width: w,\n height: h,\n top: y,\n right: x + w,\n bottom: y + h,\n left: x\n };\n } else {\n return rect;\n }\n}\n\n/**\n * Gets the absolute bounding rect (accounts for the window's scroll position and removes transforms)\n * @param {HTMLElement} el\n * @return {{top: number, left: number, bottom: number, right: number}}\n */\nexport function getAbsoluteRectNoTransforms(el) {\n const rect = getBoundingRectNoTransforms(el);\n return {\n top: rect.top + window.scrollY,\n bottom: rect.bottom + window.scrollY,\n left: rect.left + window.scrollX,\n right: rect.right + window.scrollX\n };\n}\n\n/**\n * Gets the absolute bounding rect (accounts for the window's scroll position)\n * @param {HTMLElement} el\n * @return {{top: number, left: number, bottom: number, right: number}}\n */\nexport function getAbsoluteRect(el) {\n const rect = el.getBoundingClientRect();\n return {\n top: rect.top + window.scrollY,\n bottom: rect.bottom + window.scrollY,\n left: rect.left + window.scrollX,\n right: rect.right + window.scrollX\n };\n}\n\n/**\n * finds the center :)\n * @typedef {Object} Rect\n * @property {number} top\n * @property {number} bottom\n * @property {number} left\n * @property {number} right\n * @param {Rect} rect\n * @return {{x: number, y: number}}\n */\nexport function findCenter(rect) {\n return {\n x: (rect.left + rect.right) / 2,\n y: (rect.top + rect.bottom) / 2\n };\n}\n\n/**\n * @typedef {Object} Point\n * @property {number} x\n * @property {number} y\n * @param {Point} pointA\n * @param {Point} pointB\n * @return {number}\n */\nfunction calcDistance(pointA, pointB) {\n return Math.sqrt(Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2));\n}\n\n/**\n * @param {Point} point\n * @param {Rect} rect\n * @return {boolean|boolean}\n */\nexport function isPointInsideRect(point, rect) {\n return point.y <= rect.bottom && point.y >= rect.top && point.x >= rect.left && point.x <= rect.right;\n}\n\n/**\n * find the absolute coordinates of the center of a dom element\n * @param el {HTMLElement}\n * @returns {{x: number, y: number}}\n */\nexport function findCenterOfElement(el) {\n return findCenter(getAbsoluteRect(el));\n}\n\n/**\n * @param {HTMLElement} elA\n * @param {HTMLElement} elB\n * @return {boolean}\n */\nexport function isCenterOfAInsideB(elA, elB) {\n const centerOfA = findCenterOfElement(elA);\n const rectOfB = getAbsoluteRectNoTransforms(elB);\n return isPointInsideRect(centerOfA, rectOfB);\n}\n\n/**\n * @param {HTMLElement|ChildNode} elA\n * @param {HTMLElement|ChildNode} elB\n * @return {number}\n */\nexport function calcDistanceBetweenCenters(elA, elB) {\n const centerOfA = findCenterOfElement(elA);\n const centerOfB = findCenterOfElement(elB);\n return calcDistance(centerOfA, centerOfB);\n}\n\n/**\n * @param {HTMLElement} el - the element to check\n * @returns {boolean} - true if the element in its entirety is off screen including the scrollable area (the normal dom events look at the mouse rather than the element)\n */\nexport function isElementOffDocument(el) {\n const rect = getAbsoluteRect(el);\n return rect.right < 0 || rect.left > document.documentElement.scrollWidth || rect.bottom < 0 || rect.top > document.documentElement.scrollHeight;\n}\n\n/**\n * If the point is inside the element returns its distances from the sides, otherwise returns null\n * @param {Point} point\n * @param {HTMLElement} el\n * @return {null|{top: number, left: number, bottom: number, right: number}}\n */\nexport function calcInnerDistancesBetweenPointAndSidesOfElement(point, el) {\n const rect = getAbsoluteRect(el);\n if (!isPointInsideRect(point, rect)) {\n return null;\n }\n return {\n top: point.y - rect.top,\n bottom: rect.bottom - point.y,\n left: point.x - rect.left,\n // TODO - figure out what is so special about right (why the rect is too big)\n right: Math.min(rect.right, document.documentElement.clientWidth) - point.x\n };\n}\n","import {calcInnerDistancesBetweenPointAndSidesOfElement} from \"./intersection\";\nconst SCROLL_ZONE_PX = 25;\n\nexport function makeScroller() {\n let scrollingInfo;\n function resetScrolling() {\n scrollingInfo = {directionObj: undefined, stepPx: 0};\n }\n resetScrolling();\n // directionObj {x: 0|1|-1, y:0|1|-1} - 1 means down in y and right in x\n function scrollContainer(containerEl) {\n const {directionObj, stepPx} = scrollingInfo;\n if (directionObj) {\n containerEl.scrollBy(directionObj.x * stepPx, directionObj.y * stepPx);\n window.requestAnimationFrame(() => scrollContainer(containerEl));\n }\n }\n function calcScrollStepPx(distancePx) {\n return SCROLL_ZONE_PX - distancePx;\n }\n\n /**\n * If the pointer is next to the sides of the element to scroll, will trigger scrolling\n * Can be called repeatedly with updated pointer and elementToScroll values without issues\n * @return {boolean} - true if scrolling was needed\n */\n function scrollIfNeeded(pointer, elementToScroll) {\n if (!elementToScroll) {\n return false;\n }\n const distances = calcInnerDistancesBetweenPointAndSidesOfElement(pointer, elementToScroll);\n if (distances === null) {\n resetScrolling();\n return false;\n }\n const isAlreadyScrolling = !!scrollingInfo.directionObj;\n let [scrollingVertically, scrollingHorizontally] = [false, false];\n // vertical\n if (elementToScroll.scrollHeight > elementToScroll.clientHeight) {\n if (distances.bottom < SCROLL_ZONE_PX) {\n scrollingVertically = true;\n scrollingInfo.directionObj = {x: 0, y: 1};\n scrollingInfo.stepPx = calcScrollStepPx(distances.bottom);\n } else if (distances.top < SCROLL_ZONE_PX) {\n scrollingVertically = true;\n scrollingInfo.directionObj = {x: 0, y: -1};\n scrollingInfo.stepPx = calcScrollStepPx(distances.top);\n }\n if (!isAlreadyScrolling && scrollingVertically) {\n scrollContainer(elementToScroll);\n return true;\n }\n }\n // horizontal\n if (elementToScroll.scrollWidth > elementToScroll.clientWidth) {\n if (distances.right < SCROLL_ZONE_PX) {\n scrollingHorizontally = true;\n scrollingInfo.directionObj = {x: 1, y: 0};\n scrollingInfo.stepPx = calcScrollStepPx(distances.right);\n } else if (distances.left < SCROLL_ZONE_PX) {\n scrollingHorizontally = true;\n scrollingInfo.directionObj = {x: -1, y: 0};\n scrollingInfo.stepPx = calcScrollStepPx(distances.left);\n }\n if (!isAlreadyScrolling && scrollingHorizontally) {\n scrollContainer(elementToScroll);\n return true;\n }\n }\n resetScrolling();\n return false;\n }\n\n return {\n scrollIfNeeded,\n resetScrolling\n };\n}\n","/**\n * @param {Object} object\n * @return {string}\n */\nexport function toString(object) {\n return JSON.stringify(object, null, 2);\n}\n\n/**\n * Finds the depth of the given node in the DOM tree\n * @param {HTMLElement} node\n * @return {number} - the depth of the node\n */\nexport function getDepth(node) {\n if (!node) {\n throw new Error(\"cannot get depth of a falsy node\");\n }\n return _getDepth(node, 0);\n}\nfunction _getDepth(node, countSoFar = 0) {\n if (!node.parentElement) {\n return countSoFar - 1;\n }\n return _getDepth(node.parentElement, countSoFar + 1);\n}\n\n/**\n * A simple util to shallow compare objects quickly, it doesn't validate the arguments so pass objects in\n * @param {Object} objA\n * @param {Object} objB\n * @return {boolean} - true if objA and objB are shallow equal\n */\nexport function areObjectsShallowEqual(objA, objB) {\n if (Object.keys(objA).length !== Object.keys(objB).length) {\n return false;\n }\n for (const keyA in objA) {\n if (!{}.hasOwnProperty.call(objB, keyA) || objB[keyA] !== objA[keyA]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Shallow compares two arrays\n * @param arrA\n * @param arrB\n * @return {boolean} - whether the arrays are shallow equal\n */\nexport function areArraysShallowEqualSameOrder(arrA, arrB) {\n if (arrA.length !== arrB.length) {\n return false;\n }\n for (let i = 0; i < arrA.length; i++) {\n if (arrA[i] !== arrB[i]) {\n return false;\n }\n }\n return true;\n}\n","import {findWouldBeIndex, resetIndexesCache} from \"./listUtil\";\nimport {findCenterOfElement, isElementOffDocument} from \"./intersection\";\nimport {\n dispatchDraggedElementEnteredContainer,\n dispatchDraggedElementLeftContainerForAnother,\n dispatchDraggedElementLeftContainerForNone,\n dispatchDraggedLeftDocument,\n dispatchDraggedElementIsOverIndex\n} from \"./dispatcher\";\nimport {makeScroller} from \"./scroller\";\nimport {getDepth} from \"./util\";\nimport {printDebug} from \"../constants\";\n\nconst INTERVAL_MS = 200;\nconst TOLERANCE_PX = 10;\nconst {scrollIfNeeded, resetScrolling} = makeScroller();\nlet next;\n\n/**\n * Tracks the dragged elements and performs the side effects when it is dragged over a drop zone (basically dispatching custom-events scrolling)\n * @param {Set} dropZones\n * @param {HTMLElement} draggedEl\n * @param {number} [intervalMs = INTERVAL_MS]\n */\nexport function observe(draggedEl, dropZones, intervalMs = INTERVAL_MS) {\n // initialization\n let lastDropZoneFound;\n let lastIndexFound;\n let lastIsDraggedInADropZone = false;\n let lastCentrePositionOfDragged;\n // We are sorting to make sure that in case of nested zones of the same type the one \"on top\" is considered first\n const dropZonesFromDeepToShallow = Array.from(dropZones).sort((dz1, dz2) => getDepth(dz2) - getDepth(dz1));\n\n /**\n * The main function in this module. Tracks where everything is/ should be a take the actions\n */\n function andNow() {\n const currentCenterOfDragged = findCenterOfElement(draggedEl);\n const scrolled = scrollIfNeeded(currentCenterOfDragged, lastDropZoneFound);\n // we only want to make a new decision after the element was moved a bit to prevent flickering\n if (\n !scrolled &&\n lastCentrePositionOfDragged &&\n Math.abs(lastCentrePositionOfDragged.x - currentCenterOfDragged.x) < TOLERANCE_PX &&\n Math.abs(lastCentrePositionOfDragged.y - currentCenterOfDragged.y) < TOLERANCE_PX\n ) {\n next = window.setTimeout(andNow, intervalMs);\n return;\n }\n if (isElementOffDocument(draggedEl)) {\n printDebug(() => \"off document\");\n dispatchDraggedLeftDocument(draggedEl);\n return;\n }\n\n lastCentrePositionOfDragged = currentCenterOfDragged;\n // this is a simple algorithm, potential improvement: first look at lastDropZoneFound\n let isDraggedInADropZone = false;\n for (const dz of dropZonesFromDeepToShallow) {\n const indexObj = findWouldBeIndex(draggedEl, dz);\n if (indexObj === null) {\n // it is not inside\n continue;\n }\n const {index} = indexObj;\n isDraggedInADropZone = true;\n // the element is over a container\n if (dz !== lastDropZoneFound) {\n lastDropZoneFound && dispatchDraggedElementLeftContainerForAnother(lastDropZoneFound, draggedEl, dz);\n dispatchDraggedElementEnteredContainer(dz, indexObj, draggedEl);\n lastDropZoneFound = dz;\n } else if (index !== lastIndexFound) {\n dispatchDraggedElementIsOverIndex(dz, indexObj, draggedEl);\n lastIndexFound = index;\n }\n // we handle looping with the 'continue' statement above\n break;\n }\n // the first time the dragged element is not in any dropzone we need to notify the last dropzone it was in\n if (!isDraggedInADropZone && lastIsDraggedInADropZone && lastDropZoneFound) {\n dispatchDraggedElementLeftContainerForNone(lastDropZoneFound, draggedEl);\n lastDropZoneFound = undefined;\n lastIndexFound = undefined;\n lastIsDraggedInADropZone = false;\n } else {\n lastIsDraggedInADropZone = true;\n }\n next = window.setTimeout(andNow, intervalMs);\n }\n andNow();\n}\n\n// assumption - we can only observe one dragged element at a time, this could be changed in the future\nexport function unobserve() {\n printDebug(() => \"unobserving\");\n clearTimeout(next);\n resetScrolling();\n resetIndexesCache();\n}\n","import {makeScroller} from \"./scroller\";\nimport {printDebug} from \"../constants\";\n\nconst INTERVAL_MS = 300;\nlet mousePosition;\n\n/**\n * Do not use this! it is visible for testing only until we get over the issue Cypress not triggering the mousemove listeners\n * // TODO - make private (remove export)\n * @param {{clientX: number, clientY: number}} e\n */\nexport function updateMousePosition(e) {\n const c = e.touches ? e.touches[0] : e;\n mousePosition = {x: c.clientX, y: c.clientY};\n}\nconst {scrollIfNeeded, resetScrolling} = makeScroller();\nlet next;\n\nfunction loop() {\n if (mousePosition) {\n scrollIfNeeded(mousePosition, document.documentElement);\n }\n next = window.setTimeout(loop, INTERVAL_MS);\n}\n\n/**\n * will start watching the mouse pointer and scroll the window if it goes next to the edges\n */\nexport function armWindowScroller() {\n printDebug(() => \"arming window scroller\");\n window.addEventListener(\"mousemove\", updateMousePosition);\n window.addEventListener(\"touchmove\", updateMousePosition);\n loop();\n}\n\n/**\n * will stop watching the mouse pointer and won't scroll the window anymore\n */\nexport function disarmWindowScroller() {\n printDebug(() => \"disarming window scroller\");\n window.removeEventListener(\"mousemove\", updateMousePosition);\n window.removeEventListener(\"touchmove\", updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next);\n resetScrolling();\n}\n","import {SHADOW_ELEMENT_ATTRIBUTE_NAME, DRAGGED_ELEMENT_ID} from \"../constants\";\nimport {findCenter} from \"./intersection\";\n\nconst TRANSITION_DURATION_SECONDS = 0.2;\n\n/**\n * private helper function - creates a transition string for a property\n * @param {string} property\n * @return {string} - the transition string\n */\nfunction trs(property) {\n return `${property} ${TRANSITION_DURATION_SECONDS}s ease`;\n}\n/**\n * clones the given element and applies proper styles and transitions to the dragged element\n * @param {HTMLElement} originalElement\n * @param {Point} [positionCenterOnXY]\n * @return {Node} - the cloned, styled element\n */\nexport function createDraggedElementFrom(originalElement, positionCenterOnXY) {\n const rect = originalElement.getBoundingClientRect();\n const draggedEl = originalElement.cloneNode(true);\n copyStylesFromTo(originalElement, draggedEl);\n draggedEl.id = DRAGGED_ELEMENT_ID;\n draggedEl.style.position = \"fixed\";\n let elTopPx = rect.top;\n let elLeftPx = rect.left;\n draggedEl.style.top = `${elTopPx}px`;\n draggedEl.style.left = `${elLeftPx}px`;\n if (positionCenterOnXY) {\n const center = findCenter(rect);\n elTopPx -= center.y - positionCenterOnXY.y;\n elLeftPx -= center.x - positionCenterOnXY.x;\n window.setTimeout(() => {\n draggedEl.style.top = `${elTopPx}px`;\n draggedEl.style.left = `${elLeftPx}px`;\n }, 0);\n }\n draggedEl.style.margin = \"0\";\n // we can't have relative or automatic height and width or it will break the illusion\n draggedEl.style.boxSizing = \"border-box\";\n draggedEl.style.height = `${rect.height}px`;\n draggedEl.style.width = `${rect.width}px`;\n draggedEl.style.transition = `${trs(\"top\")}, ${trs(\"left\")}, ${trs(\"background-color\")}, ${trs(\"opacity\")}, ${trs(\"color\")} `;\n // this is a workaround for a strange browser bug that causes the right border to disappear when all the transitions are added at the same time\n window.setTimeout(() => (draggedEl.style.transition += `, ${trs(\"width\")}, ${trs(\"height\")}`), 0);\n draggedEl.style.zIndex = \"9999\";\n draggedEl.style.cursor = \"grabbing\";\n\n return draggedEl;\n}\n\n/**\n * styles the dragged element to a 'dropped' state\n * @param {HTMLElement} draggedEl\n */\nexport function moveDraggedElementToWasDroppedState(draggedEl) {\n draggedEl.style.cursor = \"grab\";\n}\n\n/**\n * Morphs the dragged element style, maintains the mouse pointer within the element\n * @param {HTMLElement} draggedEl\n * @param {HTMLElement} copyFromEl - the element the dragged element should look like, typically the shadow element\n * @param {number} currentMouseX\n * @param {number} currentMouseY\n * @param {function} transformDraggedElement - function to transform the dragged element, does nothing by default.\n */\nexport function morphDraggedElementToBeLike(draggedEl, copyFromEl, currentMouseX, currentMouseY, transformDraggedElement) {\n const newRect = copyFromEl.getBoundingClientRect();\n const draggedElRect = draggedEl.getBoundingClientRect();\n const widthChange = newRect.width - draggedElRect.width;\n const heightChange = newRect.height - draggedElRect.height;\n if (widthChange || heightChange) {\n const relativeDistanceOfMousePointerFromDraggedSides = {\n left: (currentMouseX - draggedElRect.left) / draggedElRect.width,\n top: (currentMouseY - draggedElRect.top) / draggedElRect.height\n };\n draggedEl.style.height = `${newRect.height}px`;\n draggedEl.style.width = `${newRect.width}px`;\n draggedEl.style.left = `${parseFloat(draggedEl.style.left) - relativeDistanceOfMousePointerFromDraggedSides.left * widthChange}px`;\n draggedEl.style.top = `${parseFloat(draggedEl.style.top) - relativeDistanceOfMousePointerFromDraggedSides.top * heightChange}px`;\n }\n\n /// other properties\n copyStylesFromTo(copyFromEl, draggedEl);\n transformDraggedElement();\n}\n\n/**\n * @param {HTMLElement} copyFromEl\n * @param {HTMLElement} copyToEl\n */\nfunction copyStylesFromTo(copyFromEl, copyToEl) {\n const computedStyle = window.getComputedStyle(copyFromEl);\n Array.from(computedStyle)\n .filter(\n s =>\n s.startsWith(\"background\") ||\n s.startsWith(\"padding\") ||\n s.startsWith(\"font\") ||\n s.startsWith(\"text\") ||\n s.startsWith(\"align\") ||\n s.startsWith(\"justify\") ||\n s.startsWith(\"display\") ||\n s.startsWith(\"flex\") ||\n s.startsWith(\"border\") ||\n s === \"opacity\" ||\n s === \"color\" ||\n s === \"list-style-type\"\n )\n .forEach(s => copyToEl.style.setProperty(s, computedStyle.getPropertyValue(s), computedStyle.getPropertyPriority(s)));\n}\n\n/**\n * makes the element compatible with being draggable\n * @param {HTMLElement} draggableEl\n * @param {boolean} dragDisabled\n */\nexport function styleDraggable(draggableEl, dragDisabled) {\n draggableEl.draggable = false;\n draggableEl.ondragstart = () => false;\n if (!dragDisabled) {\n draggableEl.style.userSelect = \"none\";\n draggableEl.style.WebkitUserSelect = \"none\";\n draggableEl.style.cursor = \"grab\";\n } else {\n draggableEl.style.userSelect = \"\";\n draggableEl.style.WebkitUserSelect = \"\";\n draggableEl.style.cursor = \"\";\n }\n}\n\n/**\n * Hides the provided element so that it can stay in the dom without interrupting\n * @param {HTMLElement} dragTarget\n */\nexport function hideOriginalDragTarget(dragTarget) {\n dragTarget.style.display = \"none\";\n dragTarget.style.position = \"fixed\";\n dragTarget.style.zIndex = \"-5\";\n}\n\n/**\n * styles the shadow element\n * @param {HTMLElement} shadowEl\n */\nexport function decorateShadowEl(shadowEl) {\n shadowEl.style.visibility = \"hidden\";\n shadowEl.setAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME, \"true\");\n}\n\n/**\n * undo the styles the shadow element\n * @param {HTMLElement} shadowEl\n */\nexport function unDecorateShadowElement(shadowEl) {\n shadowEl.style.visibility = \"\";\n shadowEl.removeAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME);\n}\n\n/**\n * will mark the given dropzones as visually active\n * @param {Array} dropZones\n * @param {Function} getStyles - maps a dropzone to a styles object (so the styles can be removed)\n * @param {Function} getClasses - maps a dropzone to a classList\n */\nexport function styleActiveDropZones(dropZones, getStyles = () => {}, getClasses = () => []) {\n dropZones.forEach(dz => {\n const styles = getStyles(dz);\n Object.keys(styles).forEach(style => {\n dz.style[style] = styles[style];\n });\n getClasses(dz).forEach(c => dz.classList.add(c));\n });\n}\n\n/**\n * will remove the 'active' styling from given dropzones\n * @param {Array} dropZones\n * @param {Function} getStyles - maps a dropzone to a styles object\n * @param {Function} getClasses - maps a dropzone to a classList\n */\nexport function styleInactiveDropZones(dropZones, getStyles = () => {}, getClasses = () => []) {\n dropZones.forEach(dz => {\n const styles = getStyles(dz);\n Object.keys(styles).forEach(style => {\n dz.style[style] = \"\";\n });\n getClasses(dz).forEach(c => dz.classList.contains(c) && dz.classList.remove(c));\n });\n}\n\n/**\n * will prevent the provided element from shrinking by setting its minWidth and minHeight to the current width and height values\n * @param {HTMLElement} el\n * @return {function(): void} - run this function to undo the operation and restore the original values\n */\nexport function preventShrinking(el) {\n const originalMinHeight = el.style.minHeight;\n el.style.minHeight = window.getComputedStyle(el).getPropertyValue(\"height\");\n const originalMinWidth = el.style.minWidth;\n el.style.minWidth = window.getComputedStyle(el).getPropertyValue(\"width\");\n return function undo() {\n el.style.minHeight = originalMinHeight;\n el.style.minWidth = originalMinWidth;\n };\n}\n","import {\n decrementActiveDropZoneCount,\n incrementActiveDropZoneCount,\n ITEM_ID_KEY,\n printDebug,\n SHADOW_ITEM_MARKER_PROPERTY_NAME,\n SHADOW_PLACEHOLDER_ITEM_ID,\n SOURCES,\n TRIGGERS\n} from \"./constants\";\nimport {observe, unobserve} from \"./helpers/observer\";\nimport {armWindowScroller, disarmWindowScroller} from \"./helpers/windowScroller\";\nimport {\n createDraggedElementFrom,\n decorateShadowEl,\n hideOriginalDragTarget,\n morphDraggedElementToBeLike,\n moveDraggedElementToWasDroppedState,\n preventShrinking,\n styleActiveDropZones,\n styleDraggable,\n styleInactiveDropZones,\n unDecorateShadowElement\n} from \"./helpers/styler\";\nimport {\n dispatchConsiderEvent,\n dispatchFinalizeEvent,\n DRAGGED_ENTERED_EVENT_NAME,\n DRAGGED_LEFT_DOCUMENT_EVENT_NAME,\n DRAGGED_LEFT_EVENT_NAME,\n DRAGGED_LEFT_TYPES,\n DRAGGED_OVER_INDEX_EVENT_NAME\n} from \"./helpers/dispatcher\";\nimport {areArraysShallowEqualSameOrder, areObjectsShallowEqual, toString} from \"./helpers/util\";\nimport {getBoundingRectNoTransforms} from \"./helpers/intersection\";\n\nconst DEFAULT_DROP_ZONE_TYPE = \"--any--\";\nconst MIN_OBSERVATION_INTERVAL_MS = 100;\nconst MIN_MOVEMENT_BEFORE_DRAG_START_PX = 3;\nconst DEFAULT_DROP_TARGET_STYLE = {\n outline: \"rgba(255, 255, 102, 0.7) solid 2px\"\n};\n\nlet originalDragTarget;\nlet draggedEl;\nlet draggedElData;\nlet draggedElType;\nlet originDropZone;\nlet originIndex;\nlet shadowElData;\nlet shadowElDropZone;\nlet dragStartMousePosition;\nlet currentMousePosition;\nlet isWorkingOnPreviousDrag = false;\nlet finalizingPreviousDrag = false;\nlet unlockOriginDzMinDimensions;\nlet isDraggedOutsideOfAnyDz = false;\n\n// a map from type to a set of drop-zones\nconst typeToDropZones = new Map();\n// important - this is needed because otherwise the config that would be used for everyone is the config of the element that created the event listeners\nconst dzToConfig = new Map();\n// this is needed in order to be able to cleanup old listeners and avoid stale closures issues (as the listener is defined within each zone)\nconst elToMouseDownListener = new WeakMap();\n\n/* drop-zones registration management */\nfunction registerDropZone(dropZoneEl, type) {\n printDebug(() => \"registering drop-zone if absent\");\n if (!typeToDropZones.has(type)) {\n typeToDropZones.set(type, new Set());\n }\n if (!typeToDropZones.get(type).has(dropZoneEl)) {\n typeToDropZones.get(type).add(dropZoneEl);\n incrementActiveDropZoneCount();\n }\n}\nfunction unregisterDropZone(dropZoneEl, type) {\n typeToDropZones.get(type).delete(dropZoneEl);\n decrementActiveDropZoneCount();\n if (typeToDropZones.get(type).size === 0) {\n typeToDropZones.delete(type);\n }\n}\n\n/* functions to manage observing the dragged element and trigger custom drag-events */\nfunction watchDraggedElement() {\n printDebug(() => \"watching dragged element\");\n armWindowScroller();\n const dropZones = typeToDropZones.get(draggedElType);\n for (const dz of dropZones) {\n dz.addEventListener(DRAGGED_ENTERED_EVENT_NAME, handleDraggedEntered);\n dz.addEventListener(DRAGGED_LEFT_EVENT_NAME, handleDraggedLeft);\n dz.addEventListener(DRAGGED_OVER_INDEX_EVENT_NAME, handleDraggedIsOverIndex);\n }\n window.addEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);\n // it is important that we don't have an interval that is faster than the flip duration because it can cause elements to jump bach and forth\n const observationIntervalMs = Math.max(\n MIN_OBSERVATION_INTERVAL_MS,\n ...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs)\n );\n observe(draggedEl, dropZones, observationIntervalMs * 1.07);\n}\nfunction unWatchDraggedElement() {\n printDebug(() => \"unwatching dragged element\");\n disarmWindowScroller();\n const dropZones = typeToDropZones.get(draggedElType);\n for (const dz of dropZones) {\n dz.removeEventListener(DRAGGED_ENTERED_EVENT_NAME, handleDraggedEntered);\n dz.removeEventListener(DRAGGED_LEFT_EVENT_NAME, handleDraggedLeft);\n dz.removeEventListener(DRAGGED_OVER_INDEX_EVENT_NAME, handleDraggedIsOverIndex);\n }\n window.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);\n unobserve();\n}\n\n// finds the initial placeholder that is placed there on drag start\nfunction findShadowPlaceHolderIdx(items) {\n return items.findIndex(item => item[ITEM_ID_KEY] === SHADOW_PLACEHOLDER_ITEM_ID);\n}\nfunction findShadowElementIdx(items) {\n // checking that the id is not the placeholder's for Dragula like usecases\n return items.findIndex(item => !!item[SHADOW_ITEM_MARKER_PROPERTY_NAME] && item[ITEM_ID_KEY] !== SHADOW_PLACEHOLDER_ITEM_ID);\n}\n\n/* custom drag-events handlers */\nfunction handleDraggedEntered(e) {\n printDebug(() => [\"dragged entered\", e.currentTarget, e.detail]);\n let {items, dropFromOthersDisabled} = dzToConfig.get(e.currentTarget);\n if (dropFromOthersDisabled && e.currentTarget !== originDropZone) {\n printDebug(() => \"ignoring dragged entered because drop is currently disabled\");\n return;\n }\n isDraggedOutsideOfAnyDz = false;\n // this deals with another race condition. in rare occasions (super rapid operations) the list hasn't updated yet\n items = items.filter(item => item[ITEM_ID_KEY] !== shadowElData[ITEM_ID_KEY]);\n printDebug(() => `dragged entered items ${toString(items)}`);\n\n if (originDropZone !== e.currentTarget) {\n const originZoneItems = dzToConfig.get(originDropZone).items;\n const newOriginZoneItems = originZoneItems.filter(item => !item[SHADOW_ITEM_MARKER_PROPERTY_NAME]);\n dispatchConsiderEvent(originDropZone, newOriginZoneItems, {\n trigger: TRIGGERS.DRAGGED_ENTERED_ANOTHER,\n id: draggedElData[ITEM_ID_KEY],\n source: SOURCES.POINTER\n });\n } else {\n const shadowPlaceHolderIdx = findShadowPlaceHolderIdx(items);\n if (shadowPlaceHolderIdx !== -1) {\n // only happens right after drag start, on the first drag entered event\n printDebug(() => \"removing placeholder item from origin dz\");\n items.splice(shadowPlaceHolderIdx, 1);\n }\n }\n\n const {index, isProximityBased} = e.detail.indexObj;\n const shadowElIdx = isProximityBased && index === e.currentTarget.children.length - 1 ? index + 1 : index;\n shadowElDropZone = e.currentTarget;\n items.splice(shadowElIdx, 0, shadowElData);\n dispatchConsiderEvent(e.currentTarget, items, {trigger: TRIGGERS.DRAGGED_ENTERED, id: draggedElData[ITEM_ID_KEY], source: SOURCES.POINTER});\n}\n\nfunction handleDraggedLeft(e) {\n // dealing with a rare race condition on extremely rapid clicking and dropping\n if (!isWorkingOnPreviousDrag) return;\n printDebug(() => [\"dragged left\", e.currentTarget, e.detail]);\n const {items, dropFromOthersDisabled} = dzToConfig.get(e.currentTarget);\n if (dropFromOthersDisabled && e.currentTarget !== originDropZone && e.currentTarget !== shadowElDropZone) {\n printDebug(() => \"drop is currently disabled\");\n return;\n }\n const shadowElIdx = findShadowElementIdx(items);\n const shadowItem = items.splice(shadowElIdx, 1)[0];\n shadowElDropZone = undefined;\n const {type, theOtherDz} = e.detail;\n if (\n type === DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY ||\n (type === DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER && theOtherDz !== originDropZone && dzToConfig.get(theOtherDz).dropFromOthersDisabled)\n ) {\n printDebug(() => \"dragged left all, putting shadow element back in the origin dz\");\n isDraggedOutsideOfAnyDz = true;\n shadowElDropZone = originDropZone;\n const originZoneItems = dzToConfig.get(originDropZone).items;\n originZoneItems.splice(originIndex, 0, shadowItem);\n dispatchConsiderEvent(originDropZone, originZoneItems, {\n trigger: TRIGGERS.DRAGGED_LEFT_ALL,\n id: draggedElData[ITEM_ID_KEY],\n source: SOURCES.POINTER\n });\n }\n // for the origin dz, when the dragged is outside of any, this will be fired in addition to the previous. this is for simplicity\n dispatchConsiderEvent(e.currentTarget, items, {\n trigger: TRIGGERS.DRAGGED_LEFT,\n id: draggedElData[ITEM_ID_KEY],\n source: SOURCES.POINTER\n });\n}\nfunction handleDraggedIsOverIndex(e) {\n printDebug(() => [\"dragged is over index\", e.currentTarget, e.detail]);\n const {items, dropFromOthersDisabled} = dzToConfig.get(e.currentTarget);\n if (dropFromOthersDisabled && e.currentTarget !== originDropZone) {\n printDebug(() => \"drop is currently disabled\");\n return;\n }\n isDraggedOutsideOfAnyDz = false;\n const {index} = e.detail.indexObj;\n const shadowElIdx = findShadowElementIdx(items);\n items.splice(shadowElIdx, 1);\n items.splice(index, 0, shadowElData);\n dispatchConsiderEvent(e.currentTarget, items, {trigger: TRIGGERS.DRAGGED_OVER_INDEX, id: draggedElData[ITEM_ID_KEY], source: SOURCES.POINTER});\n}\n\n// Global mouse/touch-events handlers\nfunction handleMouseMove(e) {\n e.preventDefault();\n const c = e.touches ? e.touches[0] : e;\n currentMousePosition = {x: c.clientX, y: c.clientY};\n draggedEl.style.transform = `translate3d(${currentMousePosition.x - dragStartMousePosition.x}px, ${\n currentMousePosition.y - dragStartMousePosition.y\n }px, 0)`;\n}\n\nfunction handleDrop() {\n printDebug(() => \"dropped\");\n finalizingPreviousDrag = true;\n // cleanup\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"touchmove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleDrop);\n window.removeEventListener(\"touchend\", handleDrop);\n unWatchDraggedElement();\n moveDraggedElementToWasDroppedState(draggedEl);\n\n if (!shadowElDropZone) {\n printDebug(() => \"element was dropped right after it left origin but before entering somewhere else\");\n shadowElDropZone = originDropZone;\n }\n printDebug(() => [\"dropped in dz\", shadowElDropZone]);\n let {items, type} = dzToConfig.get(shadowElDropZone);\n styleInactiveDropZones(\n typeToDropZones.get(type),\n dz => dzToConfig.get(dz).dropTargetStyle,\n dz => dzToConfig.get(dz).dropTargetClasses\n );\n let shadowElIdx = findShadowElementIdx(items);\n // the handler might remove the shadow element, ex: dragula like copy on drag\n if (shadowElIdx === -1) shadowElIdx = originIndex;\n items = items.map(item => (item[SHADOW_ITEM_MARKER_PROPERTY_NAME] ? draggedElData : item));\n function finalizeWithinZone() {\n unlockOriginDzMinDimensions();\n dispatchFinalizeEvent(shadowElDropZone, items, {\n trigger: isDraggedOutsideOfAnyDz ? TRIGGERS.DROPPED_OUTSIDE_OF_ANY : TRIGGERS.DROPPED_INTO_ZONE,\n id: draggedElData[ITEM_ID_KEY],\n source: SOURCES.POINTER\n });\n if (shadowElDropZone !== originDropZone) {\n // letting the origin drop zone know the element was permanently taken away\n dispatchFinalizeEvent(originDropZone, dzToConfig.get(originDropZone).items, {\n trigger: TRIGGERS.DROPPED_INTO_ANOTHER,\n id: draggedElData[ITEM_ID_KEY],\n source: SOURCES.POINTER\n });\n }\n unDecorateShadowElement(shadowElDropZone.children[shadowElIdx]);\n cleanupPostDrop();\n }\n animateDraggedToFinalPosition(shadowElIdx, finalizeWithinZone);\n}\n\n// helper function for handleDrop\nfunction animateDraggedToFinalPosition(shadowElIdx, callback) {\n const shadowElRect = getBoundingRectNoTransforms(shadowElDropZone.children[shadowElIdx]);\n const newTransform = {\n x: shadowElRect.left - parseFloat(draggedEl.style.left),\n y: shadowElRect.top - parseFloat(draggedEl.style.top)\n };\n const {dropAnimationDurationMs} = dzToConfig.get(shadowElDropZone);\n const transition = `transform ${dropAnimationDurationMs}ms ease`;\n draggedEl.style.transition = draggedEl.style.transition ? draggedEl.style.transition + \",\" + transition : transition;\n draggedEl.style.transform = `translate3d(${newTransform.x}px, ${newTransform.y}px, 0)`;\n window.setTimeout(callback, dropAnimationDurationMs);\n}\n\n/* cleanup */\nfunction cleanupPostDrop() {\n draggedEl.remove();\n originalDragTarget.remove();\n draggedEl = undefined;\n originalDragTarget = undefined;\n draggedElData = undefined;\n draggedElType = undefined;\n originDropZone = undefined;\n originIndex = undefined;\n shadowElData = undefined;\n shadowElDropZone = undefined;\n dragStartMousePosition = undefined;\n currentMousePosition = undefined;\n isWorkingOnPreviousDrag = false;\n finalizingPreviousDrag = false;\n unlockOriginDzMinDimensions = undefined;\n isDraggedOutsideOfAnyDz = false;\n}\n\nexport function dndzone(node, options) {\n const config = {\n items: undefined,\n type: undefined,\n flipDurationMs: 0,\n dragDisabled: false,\n morphDisabled: false,\n dropFromOthersDisabled: false,\n dropTargetStyle: DEFAULT_DROP_TARGET_STYLE,\n dropTargetClasses: [],\n transformDraggedElement: () => {},\n centreDraggedOnCursor: false\n };\n printDebug(() => [`dndzone good to go options: ${toString(options)}, config: ${toString(config)}`, {node}]);\n let elToIdx = new Map();\n\n function addMaybeListeners() {\n window.addEventListener(\"mousemove\", handleMouseMoveMaybeDragStart, {passive: false});\n window.addEventListener(\"touchmove\", handleMouseMoveMaybeDragStart, {passive: false, capture: false});\n window.addEventListener(\"mouseup\", handleFalseAlarm, {passive: false});\n window.addEventListener(\"touchend\", handleFalseAlarm, {passive: false});\n }\n function removeMaybeListeners() {\n window.removeEventListener(\"mousemove\", handleMouseMoveMaybeDragStart);\n window.removeEventListener(\"touchmove\", handleMouseMoveMaybeDragStart);\n window.removeEventListener(\"mouseup\", handleFalseAlarm);\n window.removeEventListener(\"touchend\", handleFalseAlarm);\n }\n function handleFalseAlarm() {\n removeMaybeListeners();\n originalDragTarget = undefined;\n dragStartMousePosition = undefined;\n currentMousePosition = undefined;\n }\n\n function handleMouseMoveMaybeDragStart(e) {\n e.preventDefault();\n const c = e.touches ? e.touches[0] : e;\n currentMousePosition = {x: c.clientX, y: c.clientY};\n if (\n Math.abs(currentMousePosition.x - dragStartMousePosition.x) >= MIN_MOVEMENT_BEFORE_DRAG_START_PX ||\n Math.abs(currentMousePosition.y - dragStartMousePosition.y) >= MIN_MOVEMENT_BEFORE_DRAG_START_PX\n ) {\n removeMaybeListeners();\n handleDragStart();\n }\n }\n function handleMouseDown(e) {\n // on safari clicking on a select element doesn't fire mouseup at the end of the click and in general this makes more sense\n if (e.target !== e.currentTarget && (e.target.value !== undefined || e.target.isContentEditable)) {\n printDebug(() => \"won't initiate drag on a nested input element\");\n return;\n }\n // prevents responding to any button but left click which equals 0 (which is falsy)\n if (e.button) {\n printDebug(() => `ignoring none left click button: ${e.button}`);\n return;\n }\n if (isWorkingOnPreviousDrag) {\n printDebug(() => \"cannot start a new drag before finalizing previous one\");\n return;\n }\n e.stopPropagation();\n const c = e.touches ? e.touches[0] : e;\n dragStartMousePosition = {x: c.clientX, y: c.clientY};\n currentMousePosition = {...dragStartMousePosition};\n originalDragTarget = e.currentTarget;\n addMaybeListeners();\n }\n\n function handleDragStart() {\n printDebug(() => [`drag start config: ${toString(config)}`, originalDragTarget]);\n isWorkingOnPreviousDrag = true;\n\n // initialising globals\n const currentIdx = elToIdx.get(originalDragTarget);\n originIndex = currentIdx;\n originDropZone = originalDragTarget.parentElement;\n /** @type {ShadowRoot | HTMLDocument} */\n const rootNode = originDropZone.getRootNode();\n const originDropZoneRoot = rootNode.body || rootNode;\n const {items, type, centreDraggedOnCursor} = config;\n draggedElData = {...items[currentIdx]};\n draggedElType = type;\n shadowElData = {...draggedElData, [SHADOW_ITEM_MARKER_PROPERTY_NAME]: true};\n // The initial shadow element. We need a different id at first in order to avoid conflicts and timing issues\n const placeHolderElData = {...shadowElData, [ITEM_ID_KEY]: SHADOW_PLACEHOLDER_ITEM_ID};\n\n // creating the draggable element\n draggedEl = createDraggedElementFrom(originalDragTarget, centreDraggedOnCursor && currentMousePosition);\n // We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after the framework removes it\n function keepOriginalElementInDom() {\n if (!draggedEl.parentElement) {\n originDropZoneRoot.appendChild(draggedEl);\n // to prevent the outline from disappearing\n draggedEl.focus();\n watchDraggedElement();\n hideOriginalDragTarget(originalDragTarget);\n originDropZoneRoot.appendChild(originalDragTarget);\n } else {\n window.requestAnimationFrame(keepOriginalElementInDom);\n }\n }\n window.requestAnimationFrame(keepOriginalElementInDom);\n\n styleActiveDropZones(\n Array.from(typeToDropZones.get(config.type)).filter(dz => dz === originDropZone || !dzToConfig.get(dz).dropFromOthersDisabled),\n dz => dzToConfig.get(dz).dropTargetStyle,\n dz => dzToConfig.get(dz).dropTargetClasses\n );\n\n // removing the original element by removing its data entry\n items.splice(currentIdx, 1, placeHolderElData);\n unlockOriginDzMinDimensions = preventShrinking(originDropZone);\n\n dispatchConsiderEvent(originDropZone, items, {trigger: TRIGGERS.DRAG_STARTED, id: draggedElData[ITEM_ID_KEY], source: SOURCES.POINTER});\n\n // handing over to global handlers - starting to watch the element\n window.addEventListener(\"mousemove\", handleMouseMove, {passive: false});\n window.addEventListener(\"touchmove\", handleMouseMove, {passive: false, capture: false});\n window.addEventListener(\"mouseup\", handleDrop, {passive: false});\n window.addEventListener(\"touchend\", handleDrop, {passive: false});\n }\n\n function configure({\n items = undefined,\n flipDurationMs: dropAnimationDurationMs = 0,\n type: newType = DEFAULT_DROP_ZONE_TYPE,\n dragDisabled = false,\n morphDisabled = false,\n dropFromOthersDisabled = false,\n dropTargetStyle = DEFAULT_DROP_TARGET_STYLE,\n dropTargetClasses = [],\n transformDraggedElement = () => {},\n centreDraggedOnCursor = false\n }) {\n config.dropAnimationDurationMs = dropAnimationDurationMs;\n if (config.type && newType !== config.type) {\n unregisterDropZone(node, config.type);\n }\n config.type = newType;\n registerDropZone(node, newType);\n\n config.items = [...items];\n config.dragDisabled = dragDisabled;\n config.morphDisabled = morphDisabled;\n config.transformDraggedElement = transformDraggedElement;\n config.centreDraggedOnCursor = centreDraggedOnCursor;\n\n // realtime update for dropTargetStyle\n if (\n isWorkingOnPreviousDrag &&\n !finalizingPreviousDrag &&\n (!areObjectsShallowEqual(dropTargetStyle, config.dropTargetStyle) ||\n !areArraysShallowEqualSameOrder(dropTargetClasses, config.dropTargetClasses))\n ) {\n styleInactiveDropZones(\n [node],\n () => config.dropTargetStyle,\n () => dropTargetClasses\n );\n styleActiveDropZones(\n [node],\n () => dropTargetStyle,\n () => dropTargetClasses\n );\n }\n config.dropTargetStyle = dropTargetStyle;\n config.dropTargetClasses = [...dropTargetClasses];\n\n // realtime update for dropFromOthersDisabled\n function getConfigProp(dz, propName) {\n return dzToConfig.get(dz) ? dzToConfig.get(dz)[propName] : config[propName];\n }\n if (isWorkingOnPreviousDrag && config.dropFromOthersDisabled !== dropFromOthersDisabled) {\n if (dropFromOthersDisabled) {\n styleInactiveDropZones(\n [node],\n dz => getConfigProp(dz, \"dropTargetStyle\"),\n dz => getConfigProp(dz, \"dropTargetClasses\")\n );\n } else {\n styleActiveDropZones(\n [node],\n dz => getConfigProp(dz, \"dropTargetStyle\"),\n dz => getConfigProp(dz, \"dropTargetClasses\")\n );\n }\n }\n config.dropFromOthersDisabled = dropFromOthersDisabled;\n\n dzToConfig.set(node, config);\n const shadowElIdx = findShadowElementIdx(config.items);\n for (let idx = 0; idx < node.children.length; idx++) {\n const draggableEl = node.children[idx];\n styleDraggable(draggableEl, dragDisabled);\n if (idx === shadowElIdx) {\n if (!morphDisabled) {\n morphDraggedElementToBeLike(draggedEl, draggableEl, currentMousePosition.x, currentMousePosition.y, () =>\n config.transformDraggedElement(draggedEl, draggedElData, idx)\n );\n }\n decorateShadowEl(draggableEl);\n continue;\n }\n draggableEl.removeEventListener(\"mousedown\", elToMouseDownListener.get(draggableEl));\n draggableEl.removeEventListener(\"touchstart\", elToMouseDownListener.get(draggableEl));\n if (!dragDisabled) {\n draggableEl.addEventListener(\"mousedown\", handleMouseDown);\n draggableEl.addEventListener(\"touchstart\", handleMouseDown);\n elToMouseDownListener.set(draggableEl, handleMouseDown);\n }\n // updating the idx\n elToIdx.set(draggableEl, idx);\n }\n }\n configure(options);\n\n return {\n update: newOptions => {\n printDebug(() => `pointer dndzone will update newOptions: ${toString(newOptions)}`);\n configure(newOptions);\n },\n destroy: () => {\n printDebug(() => \"pointer dndzone will destroy\");\n unregisterDropZone(node, config.type);\n dzToConfig.delete(node);\n }\n };\n}\n","import {isOnServer} from \"../constants\";\n\nconst INSTRUCTION_IDs = {\n DND_ZONE_ACTIVE: \"dnd-zone-active\",\n DND_ZONE_DRAG_DISABLED: \"dnd-zone-drag-disabled\"\n};\nconst ID_TO_INSTRUCTION = {\n [INSTRUCTION_IDs.DND_ZONE_ACTIVE]: \"Tab to one the items and press space-bar or enter to start dragging it\",\n [INSTRUCTION_IDs.DND_ZONE_DRAG_DISABLED]: \"This is a disabled drag and drop list\"\n};\n\nconst ALERT_DIV_ID = \"dnd-action-aria-alert\";\nlet alertsDiv;\n\nfunction initAriaOnBrowser() {\n // setting the dynamic alerts\n alertsDiv = document.createElement(\"div\");\n (function initAlertsDiv() {\n alertsDiv.id = ALERT_DIV_ID;\n // tab index -1 makes the alert be read twice on chrome for some reason\n //alertsDiv.tabIndex = -1;\n alertsDiv.style.position = \"fixed\";\n alertsDiv.style.bottom = \"0\";\n alertsDiv.style.left = \"0\";\n alertsDiv.style.zIndex = \"-5\";\n alertsDiv.style.opacity = \"0\";\n alertsDiv.style.height = \"0\";\n alertsDiv.style.width = \"0\";\n alertsDiv.setAttribute(\"role\", \"alert\");\n })();\n document.body.prepend(alertsDiv);\n\n // setting the instructions\n Object.entries(ID_TO_INSTRUCTION).forEach(([id, txt]) => document.body.prepend(instructionToHiddenDiv(id, txt)));\n}\n\n/**\n * Initializes the static aria instructions so they can be attached to zones\n * @return {{DND_ZONE_ACTIVE: string, DND_ZONE_DRAG_DISABLED: string} | null} - the IDs for static aria instruction (to be used via aria-describedby) or null on the server\n */\nexport function initAria() {\n if (isOnServer) return null;\n if (document.readyState === \"complete\") {\n initAriaOnBrowser();\n } else {\n window.addEventListener(\"DOMContentLoaded\", initAriaOnBrowser);\n }\n return {...INSTRUCTION_IDs};\n}\nfunction instructionToHiddenDiv(id, txt) {\n const div = document.createElement(\"div\");\n div.id = id;\n div.innerHTML = `

${txt}

`;\n div.style.display = \"none\";\n div.style.position = \"fixed\";\n div.style.zIndex = \"-5\";\n return div;\n}\n\n/**\n * Will make the screen reader alert the provided text to the user\n * @param {string} txt\n */\nexport function alertToScreenReader(txt) {\n alertsDiv.innerHTML = \"\";\n const alertText = document.createTextNode(txt);\n alertsDiv.appendChild(alertText);\n // this is needed for Safari\n alertsDiv.style.display = \"none\";\n alertsDiv.style.display = \"inline\";\n}\n","import {decrementActiveDropZoneCount, incrementActiveDropZoneCount, ITEM_ID_KEY, SOURCES, TRIGGERS} from \"./constants\";\nimport {styleActiveDropZones, styleInactiveDropZones} from \"./helpers/styler\";\nimport {dispatchConsiderEvent, dispatchFinalizeEvent} from \"./helpers/dispatcher\";\nimport {initAria, alertToScreenReader} from \"./helpers/aria\";\nimport {toString} from \"./helpers/util\";\nimport {printDebug} from \"./constants\";\n\nconst DEFAULT_DROP_ZONE_TYPE = \"--any--\";\nconst DEFAULT_DROP_TARGET_STYLE = {\n outline: \"rgba(255, 255, 102, 0.7) solid 2px\"\n};\n\nlet isDragging = false;\nlet draggedItemType;\nlet focusedDz;\nlet focusedDzLabel = \"\";\nlet focusedItem;\nlet focusedItemId;\nlet focusedItemLabel = \"\";\nconst allDragTargets = new WeakSet();\nconst elToKeyDownListeners = new WeakMap();\nconst elToFocusListeners = new WeakMap();\nconst dzToHandles = new Map();\nconst dzToConfig = new Map();\nconst typeToDropZones = new Map();\n\n/* TODO (potentially)\n * what's the deal with the black border of voice-reader not following focus?\n * maybe keep focus on the last dragged item upon drop?\n */\n\nconst INSTRUCTION_IDs = initAria();\n\n/* drop-zones registration management */\nfunction registerDropZone(dropZoneEl, type) {\n printDebug(() => \"registering drop-zone if absent\");\n if (typeToDropZones.size === 0) {\n printDebug(() => \"adding global keydown and click handlers\");\n window.addEventListener(\"keydown\", globalKeyDownHandler);\n window.addEventListener(\"click\", globalClickHandler);\n }\n if (!typeToDropZones.has(type)) {\n typeToDropZones.set(type, new Set());\n }\n if (!typeToDropZones.get(type).has(dropZoneEl)) {\n typeToDropZones.get(type).add(dropZoneEl);\n incrementActiveDropZoneCount();\n }\n}\nfunction unregisterDropZone(dropZoneEl, type) {\n printDebug(() => \"unregistering drop-zone\");\n if (focusedDz === dropZoneEl) {\n handleDrop();\n }\n typeToDropZones.get(type).delete(dropZoneEl);\n decrementActiveDropZoneCount();\n if (typeToDropZones.get(type).size === 0) {\n typeToDropZones.delete(type);\n }\n if (typeToDropZones.size === 0) {\n printDebug(() => \"removing global keydown and click handlers\");\n window.removeEventListener(\"keydown\", globalKeyDownHandler);\n window.removeEventListener(\"click\", globalClickHandler);\n }\n}\n\nfunction globalKeyDownHandler(e) {\n if (!isDragging) return;\n switch (e.key) {\n case \"Escape\": {\n handleDrop();\n break;\n }\n }\n}\n\nfunction globalClickHandler() {\n if (!isDragging) return;\n if (!allDragTargets.has(document.activeElement)) {\n printDebug(() => \"clicked outside of any draggable\");\n handleDrop();\n }\n}\n\nfunction handleZoneFocus(e) {\n printDebug(() => \"zone focus\");\n if (!isDragging) return;\n const newlyFocusedDz = e.currentTarget;\n if (newlyFocusedDz === focusedDz) return;\n\n focusedDzLabel = newlyFocusedDz.getAttribute(\"aria-label\") || \"\";\n const {items: originItems} = dzToConfig.get(focusedDz);\n const originItem = originItems.find(item => item[ITEM_ID_KEY] === focusedItemId);\n const originIdx = originItems.indexOf(originItem);\n const itemToMove = originItems.splice(originIdx, 1)[0];\n const {items: targetItems, autoAriaDisabled} = dzToConfig.get(newlyFocusedDz);\n if (\n newlyFocusedDz.getBoundingClientRect().top < focusedDz.getBoundingClientRect().top ||\n newlyFocusedDz.getBoundingClientRect().left < focusedDz.getBoundingClientRect().left\n ) {\n targetItems.push(itemToMove);\n if (!autoAriaDisabled) {\n alertToScreenReader(`Moved item ${focusedItemLabel} to the end of the list ${focusedDzLabel}`);\n }\n } else {\n targetItems.unshift(itemToMove);\n if (!autoAriaDisabled) {\n alertToScreenReader(`Moved item ${focusedItemLabel} to the beginning of the list ${focusedDzLabel}`);\n }\n }\n const dzFrom = focusedDz;\n dispatchFinalizeEvent(dzFrom, originItems, {trigger: TRIGGERS.DROPPED_INTO_ANOTHER, id: focusedItemId, source: SOURCES.KEYBOARD});\n dispatchFinalizeEvent(newlyFocusedDz, targetItems, {trigger: TRIGGERS.DROPPED_INTO_ZONE, id: focusedItemId, source: SOURCES.KEYBOARD});\n focusedDz = newlyFocusedDz;\n}\n\nfunction triggerAllDzsUpdate() {\n dzToHandles.forEach(({update}, dz) => update(dzToConfig.get(dz)));\n}\n\nfunction handleDrop(dispatchConsider = true) {\n printDebug(() => \"drop\");\n if (!dzToConfig.get(focusedDz).autoAriaDisabled) {\n alertToScreenReader(`Stopped dragging item ${focusedItemLabel}`);\n }\n if (allDragTargets.has(document.activeElement)) {\n document.activeElement.blur();\n }\n if (dispatchConsider) {\n dispatchConsiderEvent(focusedDz, dzToConfig.get(focusedDz).items, {\n trigger: TRIGGERS.DRAG_STOPPED,\n id: focusedItemId,\n source: SOURCES.KEYBOARD\n });\n }\n styleInactiveDropZones(\n typeToDropZones.get(draggedItemType),\n dz => dzToConfig.get(dz).dropTargetStyle,\n dz => dzToConfig.get(dz).dropTargetClasses\n );\n focusedItem = null;\n focusedItemId = null;\n focusedItemLabel = \"\";\n draggedItemType = null;\n focusedDz = null;\n focusedDzLabel = \"\";\n isDragging = false;\n triggerAllDzsUpdate();\n}\n//////\nexport function dndzone(node, options) {\n const config = {\n items: undefined,\n type: undefined,\n dragDisabled: false,\n zoneTabIndex: 0,\n dropFromOthersDisabled: false,\n dropTargetStyle: DEFAULT_DROP_TARGET_STYLE,\n dropTargetClasses: [],\n autoAriaDisabled: false\n };\n\n function swap(arr, i, j) {\n if (arr.length <= 1) return;\n arr.splice(j, 1, arr.splice(i, 1, arr[j])[0]);\n }\n\n function handleKeyDown(e) {\n printDebug(() => [\"handling key down\", e.key]);\n switch (e.key) {\n case \"Enter\":\n case \" \": {\n // we don't want to affect nested input elements or clickable elements\n if ((e.target.disabled !== undefined || e.target.href || e.target.isContentEditable) && !allDragTargets.has(e.target)) {\n return;\n }\n e.preventDefault(); // preventing scrolling on spacebar\n e.stopPropagation();\n if (isDragging) {\n // TODO - should this trigger a drop? only here or in general (as in when hitting space or enter outside of any zone)?\n handleDrop();\n } else {\n // drag start\n handleDragStart(e);\n }\n break;\n }\n case \"ArrowDown\":\n case \"ArrowRight\": {\n if (!isDragging) return;\n e.preventDefault(); // prevent scrolling\n e.stopPropagation();\n const {items} = dzToConfig.get(node);\n const children = Array.from(node.children);\n const idx = children.indexOf(e.currentTarget);\n printDebug(() => [\"arrow down\", idx]);\n if (idx < children.length - 1) {\n if (!config.autoAriaDisabled) {\n alertToScreenReader(`Moved item ${focusedItemLabel} to position ${idx + 2} in the list ${focusedDzLabel}`);\n }\n swap(items, idx, idx + 1);\n dispatchFinalizeEvent(node, items, {trigger: TRIGGERS.DROPPED_INTO_ZONE, id: focusedItemId, source: SOURCES.KEYBOARD});\n }\n break;\n }\n case \"ArrowUp\":\n case \"ArrowLeft\": {\n if (!isDragging) return;\n e.preventDefault(); // prevent scrolling\n e.stopPropagation();\n const {items} = dzToConfig.get(node);\n const children = Array.from(node.children);\n const idx = children.indexOf(e.currentTarget);\n printDebug(() => [\"arrow up\", idx]);\n if (idx > 0) {\n if (!config.autoAriaDisabled) {\n alertToScreenReader(`Moved item ${focusedItemLabel} to position ${idx} in the list ${focusedDzLabel}`);\n }\n swap(items, idx, idx - 1);\n dispatchFinalizeEvent(node, items, {trigger: TRIGGERS.DROPPED_INTO_ZONE, id: focusedItemId, source: SOURCES.KEYBOARD});\n }\n break;\n }\n }\n }\n function handleDragStart(e) {\n printDebug(() => \"drag start\");\n setCurrentFocusedItem(e.currentTarget);\n focusedDz = node;\n draggedItemType = config.type;\n isDragging = true;\n const dropTargets = Array.from(typeToDropZones.get(config.type)).filter(dz => dz === focusedDz || !dzToConfig.get(dz).dropFromOthersDisabled);\n styleActiveDropZones(\n dropTargets,\n dz => dzToConfig.get(dz).dropTargetStyle,\n dz => dzToConfig.get(dz).dropTargetClasses\n );\n if (!config.autoAriaDisabled) {\n let msg = `Started dragging item ${focusedItemLabel}. Use the arrow keys to move it within its list ${focusedDzLabel}`;\n if (dropTargets.length > 1) {\n msg += `, or tab to another list in order to move the item into it`;\n }\n alertToScreenReader(msg);\n }\n dispatchConsiderEvent(node, dzToConfig.get(node).items, {trigger: TRIGGERS.DRAG_STARTED, id: focusedItemId, source: SOURCES.KEYBOARD});\n triggerAllDzsUpdate();\n }\n\n function handleClick(e) {\n if (!isDragging) return;\n if (e.currentTarget === focusedItem) return;\n e.stopPropagation();\n handleDrop(false);\n handleDragStart(e);\n }\n function setCurrentFocusedItem(draggableEl) {\n const {items} = dzToConfig.get(node);\n const children = Array.from(node.children);\n const focusedItemIdx = children.indexOf(draggableEl);\n focusedItem = draggableEl;\n focusedItem.tabIndex = 0;\n focusedItemId = items[focusedItemIdx][ITEM_ID_KEY];\n focusedItemLabel = children[focusedItemIdx].getAttribute(\"aria-label\") || \"\";\n }\n\n function configure({\n items = [],\n type: newType = DEFAULT_DROP_ZONE_TYPE,\n dragDisabled = false,\n zoneTabIndex = 0,\n dropFromOthersDisabled = false,\n dropTargetStyle = DEFAULT_DROP_TARGET_STYLE,\n dropTargetClasses = [],\n autoAriaDisabled = false\n }) {\n config.items = [...items];\n config.dragDisabled = dragDisabled;\n config.dropFromOthersDisabled = dropFromOthersDisabled;\n config.zoneTabIndex = zoneTabIndex;\n config.dropTargetStyle = dropTargetStyle;\n config.dropTargetClasses = dropTargetClasses;\n config.autoAriaDisabled = autoAriaDisabled;\n if (!autoAriaDisabled) {\n node.setAttribute(\"aria-disabled\", dragDisabled);\n node.setAttribute(\"role\", \"list\");\n node.setAttribute(\"aria-describedby\", dragDisabled ? INSTRUCTION_IDs.DND_ZONE_DRAG_DISABLED : INSTRUCTION_IDs.DND_ZONE_ACTIVE);\n }\n if (config.type && newType !== config.type) {\n unregisterDropZone(node, config.type);\n }\n config.type = newType;\n registerDropZone(node, newType);\n dzToConfig.set(node, config);\n\n if (isDragging) {\n node.tabIndex =\n node === focusedDz ||\n focusedItem.contains(node) ||\n config.dropFromOthersDisabled ||\n (focusedDz && config.type !== dzToConfig.get(focusedDz).type)\n ? -1\n : 0;\n } else {\n node.tabIndex = config.zoneTabIndex;\n }\n\n node.addEventListener(\"focus\", handleZoneFocus);\n\n for (let i = 0; i < node.children.length; i++) {\n const draggableEl = node.children[i];\n allDragTargets.add(draggableEl);\n draggableEl.tabIndex = isDragging ? -1 : 0;\n if (!autoAriaDisabled) {\n draggableEl.setAttribute(\"role\", \"listitem\");\n }\n draggableEl.removeEventListener(\"keydown\", elToKeyDownListeners.get(draggableEl));\n draggableEl.removeEventListener(\"click\", elToFocusListeners.get(draggableEl));\n if (!dragDisabled) {\n draggableEl.addEventListener(\"keydown\", handleKeyDown);\n elToKeyDownListeners.set(draggableEl, handleKeyDown);\n draggableEl.addEventListener(\"click\", handleClick);\n elToFocusListeners.set(draggableEl, handleClick);\n }\n if (isDragging && config.items[i][ITEM_ID_KEY] === focusedItemId) {\n printDebug(() => [\"focusing on\", {i, focusedItemId}]);\n // if it is a nested dropzone, it was re-rendered and we need to refresh our pointer\n focusedItem = draggableEl;\n focusedItem.tabIndex = 0;\n // without this the element loses focus if it moves backwards in the list\n draggableEl.focus();\n }\n }\n }\n configure(options);\n\n const handles = {\n update: newOptions => {\n printDebug(() => `keyboard dndzone will update newOptions: ${toString(newOptions)}`);\n configure(newOptions);\n },\n destroy: () => {\n printDebug(() => \"keyboard dndzone will destroy\");\n unregisterDropZone(node, config.type);\n dzToConfig.delete(node);\n dzToHandles.delete(node);\n }\n };\n dzToHandles.set(node, handles);\n return handles;\n}\n","import {dndzone as pointerDndZone} from \"./pointerAction\";\nimport {dndzone as keyboardDndZone} from \"./keyboardAction\";\nimport {ITEM_ID_KEY} from \"./constants\";\nimport {toString} from \"./helpers/util\";\n\n/**\n * A custom action to turn any container to a dnd zone and all of its direct children to draggables\n * Supports mouse, touch and keyboard interactions.\n * Dispatches two events that the container is expected to react to by modifying its list of items,\n * which will then feed back in to this action via the update function\n *\n * @typedef {object} Options\n * @property {array} items - the list of items that was used to generate the children of the given node (the list used in the #each block\n * @property {string} [type] - the type of the dnd zone. children dragged from here can only be dropped in other zones of the same type, default to a base type\n * @property {number} [flipDurationMs] - if the list animated using flip (recommended), specifies the flip duration such that everything syncs with it without conflict, defaults to zero\n * @property {boolean} [dragDisabled]\n * @property {boolean} [morphDisabled] - whether dragged element should morph to zone dimensions\n * @property {boolean} [dropFromOthersDisabled]\n * @property {number} [zoneTabIndex] - set the tabindex of the list container when not dragging\n * @property {object} [dropTargetStyle]\n * @property {string[]} [dropTargetClasses]\n * @property {function} [transformDraggedElement]\n * @param {HTMLElement} node - the element to enhance\n * @param {Options} options\n * @return {{update: function, destroy: function}}\n */\nexport function dndzone(node, options) {\n validateOptions(options);\n const pointerZone = pointerDndZone(node, options);\n const keyboardZone = keyboardDndZone(node, options);\n return {\n update: newOptions => {\n validateOptions(newOptions);\n pointerZone.update(newOptions);\n keyboardZone.update(newOptions);\n },\n destroy: () => {\n pointerZone.destroy();\n keyboardZone.destroy();\n }\n };\n}\n\nfunction validateOptions(options) {\n /*eslint-disable*/\n const {\n items,\n flipDurationMs,\n type,\n dragDisabled,\n morphDisabled,\n dropFromOthersDisabled,\n zoneTabIndex,\n dropTargetStyle,\n dropTargetClasses,\n transformDraggedElement,\n autoAriaDisabled,\n centreDraggedOnCursor,\n ...rest\n } = options;\n /*eslint-enable*/\n if (Object.keys(rest).length > 0) {\n console.warn(`dndzone will ignore unknown options`, rest);\n }\n if (!items) {\n throw new Error(\"no 'items' key provided to dndzone\");\n }\n const itemWithMissingId = items.find(item => !{}.hasOwnProperty.call(item, ITEM_ID_KEY));\n if (itemWithMissingId) {\n throw new Error(`missing '${ITEM_ID_KEY}' property for item ${toString(itemWithMissingId)}`);\n }\n if (dropTargetClasses && !Array.isArray(dropTargetClasses)) {\n throw new Error(`dropTargetClasses should be an array but instead it is a ${typeof dropTargetClasses}, ${toString(dropTargetClasses)}`);\n }\n if (zoneTabIndex && !isInt(zoneTabIndex)) {\n throw new Error(`zoneTabIndex should be a number but instead it is a ${typeof zoneTabIndex}, ${toString(zoneTabIndex)}`);\n }\n}\n\nfunction isInt(value) {\n return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value));\n}\n","import { cubicOut } from '../easing/index.mjs';\nimport { is_function } from '../internal/index.mjs';\n\nfunction flip(node, { from, to }, params = {}) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n const [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);\n const dx = (from.left + from.width * ox / to.width) - (to.left + ox);\n const dy = (from.top + from.height * oy / to.height) - (to.top + oy);\n const { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;\n return {\n delay,\n duration: is_function(duration) ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,\n easing,\n css: (t, u) => {\n const x = u * dx;\n const y = u * dy;\n const sx = t + u * from.width / to.width;\n const sy = t + u * from.height / to.height;\n return `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;\n }\n };\n}\n\nexport { flip };\n"],"names":["dispatchFinalizeEvent","el","items","info","dispatchEvent","CustomEvent","detail","dispatchConsiderEvent","DRAGGED_ENTERED_EVENT_NAME","DRAGGED_LEFT_EVENT_NAME","DRAGGED_OVER_INDEX_EVENT_NAME","DRAGGED_LEFT_DOCUMENT_EVENT_NAME","DRAGGED_LEFT_TYPES","dispatchDraggedElementEnteredContainer","containerEl","indexObj","draggedEl","dispatchDraggedElementLeftContainerForAnother","theOtherDz","type","dispatchDraggedElementIsOverIndex","TRIGGERS","SOURCES","SHADOW_ITEM_MARKER_PROPERTY_NAME","SHADOW_ELEMENT_ATTRIBUTE_NAME","SHADOW_PLACEHOLDER_ITEM_ID","ITEM_ID_KEY","activeDndZoneCount","incrementActiveDropZoneCount","decrementActiveDropZoneCount","Error","isOnServer","window","dzToShadowIndexToRect","printDebug","getBoundingRectNoTransforms","ta","rect","getBoundingClientRect","style","getComputedStyle","tx","transform","sx","sy","dx","dy","startsWith","slice","split","to","transformOrigin","x","parseFloat","y","indexOf","w","width","offsetWidth","h","height","offsetHeight","top","right","bottom","left","getAbsoluteRectNoTransforms","scrollY","scrollX","getAbsoluteRect","findCenter","isPointInsideRect","point","findCenterOfElement","isCenterOfAInsideB","elA","elB","calcDistanceBetweenCenters","centerOfA","centerOfB","pointA","pointB","Math","sqrt","pow","resetIndexesCache","Map","findWouldBeIndex","floatingAboveEl","collectionBelowEl","children","length","index","isProximityBased","shadowElIndex","dz","Array","from","findIndex","child","getAttribute","has","set","get","cacheShadowRect","i","cachedShadowRect","indexOfMin","minDistanceSoFar","Number","MAX_VALUE","distance","makeScroller","scrollingInfo","resetScrolling","directionObj","undefined","stepPx","scrollContainer","scrollBy","requestAnimationFrame","calcScrollStepPx","distancePx","scrollIfNeeded","pointer","elementToScroll","distances","min","document","documentElement","clientWidth","calcInnerDistancesBetweenPointAndSidesOfElement","isAlreadyScrolling","scrollingVertically","scrollingHorizontally","scrollHeight","clientHeight","scrollWidth","object","JSON","stringify","getDepth","node","_getDepth","countSoFar","parentElement","next","observe","dropZones","intervalMs","lastDropZoneFound","lastIndexFound","lastCentrePositionOfDragged","lastIsDraggedInADropZone","dropZonesFromDeepToShallow","sort","dz1","dz2","andNow","currentCenterOfDragged","abs","setTimeout","isElementOffDocument","dispatchDraggedLeftDocument","isDraggedInADropZone","dispatchDraggedElementLeftContainerForNone","mousePosition","updateMousePosition","e","c","touches","clientX","clientY","loop","trs","property","morphDraggedElementToBeLike","copyFromEl","currentMouseX","currentMouseY","transformDraggedElement","newRect","draggedElRect","widthChange","heightChange","relativeDistanceOfMousePointerFromDraggedSides","copyStylesFromTo","copyToEl","computedStyle","filter","s","forEach","setProperty","getPropertyValue","getPropertyPriority","styleDraggable","draggableEl","dragDisabled","draggable","ondragstart","userSelect","WebkitUserSelect","cursor","styleActiveDropZones","getStyles","getClasses","styles","Object","keys","classList","add","styleInactiveDropZones","contains","remove","DEFAULT_DROP_TARGET_STYLE","outline","originalDragTarget","draggedElData","draggedElType","originDropZone","originIndex","shadowElData","shadowElDropZone","dragStartMousePosition","currentMousePosition","unlockOriginDzMinDimensions","isWorkingOnPreviousDrag","finalizingPreviousDrag","isDraggedOutsideOfAnyDz","typeToDropZones","dzToConfig","elToMouseDownListener","WeakMap","unregisterDropZone","dropZoneEl","delete","size","watchDraggedElement","addEventListener","handleDraggedEntered","handleDraggedLeft","handleDraggedIsOverIndex","handleDrop","observationIntervalMs","max","map","dropAnimationDurationMs","unWatchDraggedElement","removeEventListener","clearTimeout","findShadowElementIdx","item","currentTarget","dropFromOthersDisabled","newOriginZoneItems","trigger","id","source","shadowPlaceHolderIdx","findShadowPlaceHolderIdx","splice","shadowElIdx","shadowItem","originZoneItems","handleMouseMove","preventDefault","moveDraggedElementToWasDroppedState","dropTargetStyle","dropTargetClasses","callback","shadowElRect","newTransform","transition","animateDraggedToFinalPosition","shadowEl","visibility","removeAttribute","dndzone","options","config","flipDurationMs","morphDisabled","centreDraggedOnCursor","elToIdx","removeMaybeListeners","handleMouseMoveMaybeDragStart","handleFalseAlarm","currentIdx","rootNode","getRootNode","originDropZoneRoot","body","placeHolderElData","keepOriginalElementInDom","dragTarget","appendChild","focus","display","position","zIndex","originalElement","positionCenterOnXY","cloneNode","elTopPx","elLeftPx","center","margin","boxSizing","createDraggedElementFrom","originalMinHeight","minHeight","originalMinWidth","minWidth","preventShrinking","passive","capture","handleDragStart","handleMouseDown","target","value","isContentEditable","button","stopPropagation","configure","newType","getConfigProp","propName","Set","objA","objB","keyA","hasOwnProperty","call","areObjectsShallowEqual","arrA","arrB","areArraysShallowEqualSameOrder","idx","setAttribute","update","newOptions","destroy","INSTRUCTION_IDs","DND_ZONE_ACTIVE","DND_ZONE_DRAG_DISABLED","ID_TO_INSTRUCTION","alertsDiv","initAriaOnBrowser","createElement","opacity","prepend","entries","txt","div","innerHTML","instructionToHiddenDiv","alertToScreenReader","alertText","createTextNode","draggedItemType","focusedDz","focusedItem","focusedItemId","isDragging","focusedDzLabel","focusedItemLabel","allDragTargets","WeakSet","elToKeyDownListeners","elToFocusListeners","dzToHandles","readyState","globalKeyDownHandler","globalClickHandler","key","activeElement","handleZoneFocus","newlyFocusedDz","originItems","originItem","find","originIdx","itemToMove","targetItems","autoAriaDisabled","push","unshift","triggerAllDzsUpdate","dispatchConsider","blur","zoneTabIndex","swap","arr","j","handleKeyDown","disabled","href","focusedItemIdx","tabIndex","setCurrentFocusedItem","dropTargets","msg","handleClick","handles","validateOptions","pointerZone","keyboardZone","rest","console","warn","itemWithMissingId","isArray","isNaN","flip","params","ox","oy","delay","duration","d","easing","css","t","u"],"sourceRoot":""}