@angular/cdk 21.0.2 → 21.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/fesm2022/_a11y-module-chunk.mjs +22 -22
  2. package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
  3. package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
  4. package/fesm2022/_array-chunk.mjs.map +1 -1
  5. package/fesm2022/_breakpoints-observer-chunk.mjs +6 -6
  6. package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
  7. package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
  8. package/fesm2022/_data-source-chunk.mjs.map +1 -1
  9. package/fesm2022/_directionality-chunk.mjs +3 -3
  10. package/fesm2022/_directionality-chunk.mjs.map +1 -1
  11. package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
  12. package/fesm2022/_element-chunk.mjs.map +1 -1
  13. package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
  14. package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
  15. package/fesm2022/_focus-monitor-chunk.mjs +9 -9
  16. package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
  17. package/fesm2022/_id-generator-chunk.mjs +3 -3
  18. package/fesm2022/_id-generator-chunk.mjs.map +1 -1
  19. package/fesm2022/_keycodes-chunk.mjs.map +1 -1
  20. package/fesm2022/_list-key-manager-chunk.mjs +5 -5
  21. package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
  22. package/fesm2022/_overlay-module-chunk.mjs +42 -34
  23. package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
  24. package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
  25. package/fesm2022/_platform-chunk.mjs +3 -3
  26. package/fesm2022/_platform-chunk.mjs.map +1 -1
  27. package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
  28. package/fesm2022/_scrolling-chunk.mjs.map +1 -1
  29. package/fesm2022/_selection-model-chunk.mjs.map +1 -1
  30. package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
  31. package/fesm2022/_style-loader-chunk.mjs +3 -3
  32. package/fesm2022/_style-loader-chunk.mjs.map +1 -1
  33. package/fesm2022/_test-environment-chunk.mjs.map +1 -1
  34. package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
  35. package/fesm2022/_typeahead-chunk.mjs.map +1 -1
  36. package/fesm2022/_unique-selection-dispatcher-chunk.mjs +3 -3
  37. package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
  38. package/fesm2022/_visually-hidden-chunk.mjs +3 -3
  39. package/fesm2022/_visually-hidden-chunk.mjs.map +1 -1
  40. package/fesm2022/a11y.mjs +9 -9
  41. package/fesm2022/a11y.mjs.map +1 -1
  42. package/fesm2022/accordion.mjs +10 -10
  43. package/fesm2022/accordion.mjs.map +1 -1
  44. package/fesm2022/bidi.mjs +7 -7
  45. package/fesm2022/bidi.mjs.map +1 -1
  46. package/fesm2022/cdk.mjs +1 -1
  47. package/fesm2022/cdk.mjs.map +1 -1
  48. package/fesm2022/clipboard.mjs +10 -10
  49. package/fesm2022/clipboard.mjs.map +1 -1
  50. package/fesm2022/coercion-private.mjs.map +1 -1
  51. package/fesm2022/coercion.mjs.map +1 -1
  52. package/fesm2022/dialog.mjs +10 -10
  53. package/fesm2022/dialog.mjs.map +1 -1
  54. package/fesm2022/drag-drop.mjs +31 -31
  55. package/fesm2022/drag-drop.mjs.map +1 -1
  56. package/fesm2022/keycodes.mjs.map +1 -1
  57. package/fesm2022/layout.mjs +4 -4
  58. package/fesm2022/layout.mjs.map +1 -1
  59. package/fesm2022/listbox.mjs +10 -10
  60. package/fesm2022/listbox.mjs.map +1 -1
  61. package/fesm2022/menu.mjs +69 -52
  62. package/fesm2022/menu.mjs.map +1 -1
  63. package/fesm2022/observers-private.mjs +3 -3
  64. package/fesm2022/observers-private.mjs.map +1 -1
  65. package/fesm2022/observers.mjs +13 -13
  66. package/fesm2022/observers.mjs.map +1 -1
  67. package/fesm2022/overlay.mjs +3 -3
  68. package/fesm2022/overlay.mjs.map +1 -1
  69. package/fesm2022/platform.mjs +4 -4
  70. package/fesm2022/platform.mjs.map +1 -1
  71. package/fesm2022/portal.mjs +10 -10
  72. package/fesm2022/portal.mjs.map +1 -1
  73. package/fesm2022/private.mjs.map +1 -1
  74. package/fesm2022/scrolling.mjs +40 -40
  75. package/fesm2022/scrolling.mjs.map +1 -1
  76. package/fesm2022/stepper.mjs +22 -22
  77. package/fesm2022/stepper.mjs.map +1 -1
  78. package/fesm2022/table.mjs +73 -73
  79. package/fesm2022/table.mjs.map +1 -1
  80. package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
  81. package/fesm2022/testing-testbed.mjs +7 -1
  82. package/fesm2022/testing-testbed.mjs.map +1 -1
  83. package/fesm2022/testing.mjs.map +1 -1
  84. package/fesm2022/text-field.mjs +16 -16
  85. package/fesm2022/text-field.mjs.map +1 -1
  86. package/fesm2022/tree.mjs +25 -25
  87. package/fesm2022/tree.mjs.map +1 -1
  88. package/package.json +1 -1
  89. package/schematics/ng-add/index.js +1 -1
  90. package/types/_overlay-module-chunk.d.ts +1 -0
  91. package/types/menu.d.ts +7 -2
  92. package/types/testing-testbed.d.ts +3 -0
  93. package/_adev_assets/cdk_drag_drop.json +0 -7221
  94. package/_adev_assets/cdk_testing.json +0 -7601
  95. package/_adev_assets/cdk_testing_protractor.json +0 -1747
  96. package/_adev_assets/cdk_testing_selenium_webdriver.json +0 -1801
  97. package/_adev_assets/cdk_testing_testbed.json +0 -1903
@@ -1 +1 @@
1
- {"version":3,"file":"drag-drop.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/clone-node.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/dom-rect.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/parent-position-tracker.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/root-node.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/styling.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/dom/transition-duration.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/preview-ref.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-ref.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-utils.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/sorting/single-axis-sort-strategy.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/sorting/mixed-sort-strategy.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drop-list-ref.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-drop-registry.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-drop.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-parent.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/assertions.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drag-handle.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/config.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drag.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drop-list-group.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drop-list.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drag-preview.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/directives/drag-placeholder.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/drag-drop/drag-drop-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Creates a deep clone of an element. */\nexport function deepCloneNode(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n const descendantsWithId = clone.querySelectorAll('[id]');\n const nodeName = node.nodeName.toLowerCase();\n\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n\n if (nodeName === 'canvas') {\n transferCanvasData(node as HTMLCanvasElement, clone as HTMLCanvasElement);\n } else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') {\n transferInputData(node as HTMLInputElement, clone as HTMLInputElement);\n }\n\n transferData('canvas', node, clone, transferCanvasData);\n transferData('input, textarea, select', node, clone, transferInputData);\n return clone;\n}\n\n/** Matches elements between an element and its clone and allows for their data to be cloned. */\nfunction transferData<T extends Element>(\n selector: string,\n node: HTMLElement,\n clone: HTMLElement,\n callback: (source: T, clone: T) => void,\n) {\n const descendantElements = node.querySelectorAll<T>(selector);\n\n if (descendantElements.length) {\n const cloneElements = clone.querySelectorAll<T>(selector);\n\n for (let i = 0; i < descendantElements.length; i++) {\n callback(descendantElements[i], cloneElements[i]);\n }\n }\n}\n\n// Counter for unique cloned radio button names.\nlet cloneUniqueId = 0;\n\n/** Transfers the data of one input element to another. */\nfunction transferInputData(\n source: Element & {value: string},\n clone: Element & {value: string; name: string; type: string},\n) {\n // Browsers throw an error when assigning the value of a file input programmatically.\n if (clone.type !== 'file') {\n clone.value = source.value;\n }\n\n // Radio button `name` attributes must be unique for radio button groups\n // otherwise original radio buttons can lose their checked state\n // once the clone is inserted in the DOM.\n if (clone.type === 'radio' && clone.name) {\n clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`;\n }\n}\n\n/** Transfers the data of one canvas element to another. */\nfunction transferCanvasData(source: HTMLCanvasElement, clone: HTMLCanvasElement) {\n const context = clone.getContext('2d');\n\n if (context) {\n // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).\n // We can't do much about it so just ignore the error.\n try {\n context.drawImage(source, 0, 0);\n } catch {}\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Gets a mutable version of an element's bounding `DOMRect`. */\nexport function getMutableClientRect(element: Element): DOMRect {\n const rect = element.getBoundingClientRect();\n\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `DOMRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n x: rect.x,\n y: rect.y,\n } as DOMRect;\n}\n\n/**\n * Checks whether some coordinates are within a `DOMRect`.\n * @param clientRect DOMRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nexport function isInsideClientRect(clientRect: DOMRect, x: number, y: number) {\n const {top, bottom, left, right} = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n\n/**\n * Checks if the child element is overflowing from its parent.\n * @param parentRect - The bounding rect of the parent element.\n * @param childRect - The bounding rect of the child element.\n */\nexport function isOverflowingParent(parentRect: DOMRect, childRect: DOMRect): boolean {\n // check for horizontal overflow (left and right)\n const isLeftOverflowing = childRect.left < parentRect.left;\n const isRightOverflowing = childRect.left + childRect.width > parentRect.right;\n\n // check for vertical overflow (top and bottom)\n const isTopOverflowing = childRect.top < parentRect.top;\n const isBottomOverflowing = childRect.top + childRect.height > parentRect.bottom;\n\n return isLeftOverflowing || isRightOverflowing || isTopOverflowing || isBottomOverflowing;\n}\n\n/**\n * Updates the top/left positions of a `DOMRect`, as well as their bottom/right counterparts.\n * @param domRect `DOMRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nexport function adjustDomRect(\n domRect: {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n },\n top: number,\n left: number,\n) {\n domRect.top += top;\n domRect.bottom = domRect.top + domRect.height;\n\n domRect.left += left;\n domRect.right = domRect.left + domRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a DOMRect.\n * @param rect DOMRect to check against.\n * @param threshold Threshold around the DOMRect.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nexport function isPointerNearDomRect(\n rect: DOMRect,\n threshold: number,\n pointerX: number,\n pointerY: number,\n): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * threshold;\n const yThreshold = height * threshold;\n\n return (\n pointerY > top - yThreshold &&\n pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold &&\n pointerX < right + xThreshold\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_getEventTarget} from '../../platform';\nimport {getMutableClientRect, adjustDomRect} from './dom-rect';\n\n/** Object holding the scroll position of something. */\ninterface ScrollPosition {\n top: number;\n left: number;\n}\n\n/** Keeps track of the scroll position and dimensions of the parents of an element. */\nexport class ParentPositionTracker {\n /** Cached positions of the scrollable parent elements. */\n readonly positions = new Map<\n Document | HTMLElement,\n {\n scrollPosition: ScrollPosition;\n clientRect?: DOMRect;\n }\n >();\n\n constructor(private _document: Document) {}\n\n /** Clears the cached positions. */\n clear() {\n this.positions.clear();\n }\n\n /** Caches the positions. Should be called at the beginning of a drag sequence. */\n cache(elements: readonly HTMLElement[]) {\n this.clear();\n this.positions.set(this._document, {\n scrollPosition: this.getViewportScrollPosition(),\n });\n\n elements.forEach(element => {\n this.positions.set(element, {\n scrollPosition: {top: element.scrollTop, left: element.scrollLeft},\n clientRect: getMutableClientRect(element),\n });\n });\n }\n\n /** Handles scrolling while a drag is taking place. */\n handleScroll(event: Event): ScrollPosition | null {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n const cachedPosition = this.positions.get(target);\n\n if (!cachedPosition) {\n return null;\n }\n\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const viewportScrollPosition = this.getViewportScrollPosition();\n newTop = viewportScrollPosition.top;\n newLeft = viewportScrollPosition.left;\n } else {\n newTop = (target as HTMLElement).scrollTop;\n newLeft = (target as HTMLElement).scrollLeft;\n }\n\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this.positions.forEach((position, node) => {\n if (position.clientRect && target !== node && target.contains(node)) {\n adjustDomRect(position.clientRect, topDifference, leftDifference);\n }\n });\n\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n\n return {top: topDifference, left: leftDifference};\n }\n\n /**\n * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,\n * instead of going through the `ViewportRuler`, because the first value the ruler looks at is\n * the top/left offset of the `document.documentElement` which works for most cases, but breaks\n * if the element is offset by something like the `BlockScrollStrategy`.\n */\n getViewportScrollPosition() {\n return {top: window.scrollY, left: window.scrollX};\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmbeddedViewRef} from '@angular/core';\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nexport function getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNodes: Node[] = viewRef.rootNodes;\n\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0] as HTMLElement;\n }\n\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Extended CSSStyleDeclaration that includes a couple of drag-related\n * properties that aren't in the built-in TS typings.\n */\nexport interface DragCSSStyleDeclaration extends CSSStyleDeclaration {\n msScrollSnapType: string;\n scrollSnapType: string;\n webkitTapHighlightColor: string;\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet-like object.\n * Note that the keys in `source` have to be dash-cased.\n * @docs-private\n */\nexport function extendStyles(\n dest: CSSStyleDeclaration,\n source: Record<string, string>,\n importantProperties?: Set<string>,\n) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n const value = source[key];\n\n if (value) {\n dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : '');\n } else {\n dest.removeProperty(key);\n }\n }\n }\n\n return dest;\n}\n\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nexport function toggleNativeDragInteractions(element: HTMLElement, enable: boolean) {\n const userSelect = enable ? '' : 'none';\n\n extendStyles(element.style, {\n 'touch-action': enable ? '' : 'none',\n '-webkit-user-drag': enable ? '' : 'none',\n '-webkit-tap-highlight-color': enable ? '' : 'transparent',\n 'user-select': userSelect,\n '-ms-user-select': userSelect,\n '-webkit-user-select': userSelect,\n '-moz-user-select': userSelect,\n });\n}\n\n/**\n * Toggles whether an element is visible while preserving its dimensions.\n * @param element Element whose visibility to toggle\n * @param enable Whether the element should be visible.\n * @param importantProperties Properties to be set as `!important`.\n * @docs-private\n */\nexport function toggleVisibility(\n element: HTMLElement,\n enable: boolean,\n importantProperties?: Set<string>,\n) {\n extendStyles(\n element.style,\n {\n position: enable ? '' : 'fixed',\n top: enable ? '' : '0',\n opacity: enable ? '' : '0',\n left: enable ? '' : '-999em',\n },\n importantProperties,\n );\n}\n\n/**\n * Combines a transform string with an optional other transform\n * that exited before the base transform was applied.\n */\nexport function combineTransforms(transform: string, initialTransform?: string): string {\n return initialTransform && initialTransform != 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param sourceRect Dimensions of the source element.\n */\nexport function matchElementSize(target: HTMLElement, sourceRect: DOMRect): void {\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nexport function getTransform(x: number, y: number): string {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return (\n parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex])\n );\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmbeddedViewRef, Renderer2, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {Direction} from '../bidi';\nimport {\n extendStyles,\n getTransform,\n matchElementSize,\n toggleNativeDragInteractions,\n} from './dom/styling';\nimport {deepCloneNode} from './dom/clone-node';\nimport {getRootNode} from './dom/root-node';\nimport {getTransformTransitionDurationInMs} from './dom/transition-duration';\n\n/** Template that can be used to create a drag preview element. */\nexport interface DragPreviewTemplate<T = any> {\n matchSize?: boolean;\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst importantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n\nexport class PreviewRef {\n /** Reference to the view of the preview element. */\n private _previewEmbeddedView: EmbeddedViewRef<any> | null;\n\n /** Reference to the preview element. */\n private _preview: HTMLElement;\n\n get element(): HTMLElement {\n return this._preview;\n }\n\n constructor(\n private _document: Document,\n private _rootElement: HTMLElement,\n private _direction: Direction,\n private _initialDomRect: DOMRect,\n private _previewTemplate: DragPreviewTemplate | null,\n private _previewClass: string | string[] | null,\n private _pickupPositionOnPage: {\n x: number;\n y: number;\n },\n private _initialTransform: string | null,\n private _zIndex: number,\n private _renderer: Renderer2,\n ) {}\n\n attach(parent: HTMLElement): void {\n this._preview = this._createPreview();\n parent.appendChild(this._preview);\n\n // The null check is necessary for browsers that don't support the popover API.\n // Note that we use a string access for compatibility with Closure.\n if (supportsPopover(this._preview)) {\n this._preview['showPopover']();\n }\n }\n\n destroy(): void {\n this._preview.remove();\n this._previewEmbeddedView?.destroy();\n this._preview = this._previewEmbeddedView = null!;\n }\n\n setTransform(value: string): void {\n this._preview.style.transform = value;\n }\n\n getBoundingClientRect(): DOMRect {\n return this._preview.getBoundingClientRect();\n }\n\n addClass(className: string): void {\n this._preview.classList.add(className);\n }\n\n getTransitionDuration(): number {\n return getTransformTransitionDurationInMs(this._preview);\n }\n\n addEventListener(name: string, handler: (event: any) => void): () => void {\n return this._renderer.listen(this._preview, name, handler);\n }\n\n private _createPreview(): HTMLElement {\n const previewConfig = this._previewTemplate;\n const previewClass = this._previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview: HTMLElement;\n\n if (previewTemplate && previewConfig) {\n // Measure the element before we've inserted the preview\n // since the insertion could throw off the measurement.\n const rootRect = previewConfig.matchSize ? this._initialDomRect : null;\n const viewRef = previewConfig.viewContainer.createEmbeddedView(\n previewTemplate,\n previewConfig.context,\n );\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewEmbeddedView = viewRef;\n if (previewConfig.matchSize) {\n matchElementSize(preview, rootRect!);\n } else {\n preview.style.transform = getTransform(\n this._pickupPositionOnPage.x,\n this._pickupPositionOnPage.y,\n );\n }\n } else {\n preview = deepCloneNode(this._rootElement);\n matchElementSize(preview, this._initialDomRect!);\n\n if (this._initialTransform) {\n preview.style.transform = this._initialTransform;\n }\n }\n\n extendStyles(\n preview.style,\n {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n 'pointer-events': 'none',\n // If the preview has a margin, it can throw off our positioning so we reset it. The reset\n // value for `margin-right` needs to be `auto` when opened as a popover, because our\n // positioning is always top/left based, but native popover seems to position itself\n // to the top/right if `<html>` or `<body>` have `dir=\"rtl\"` (see #29604). Setting it\n // to `auto` pushed it to the top/left corner in RTL and is a noop in LTR.\n 'margin': supportsPopover(preview) ? '0 auto 0 0' : '0',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'z-index': this._zIndex + '',\n },\n importantProperties,\n );\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('popover', 'manual');\n preview.setAttribute('dir', this._direction);\n\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n } else {\n preview.classList.add(previewClass);\n }\n }\n\n return preview;\n }\n}\n\n/** Checks whether a specific element supports the popover API. */\nfunction supportsPopover(element: HTMLElement): boolean {\n return 'showPopover' in element;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader} from '../a11y';\nimport {Direction} from '../bidi';\nimport {coerceElement} from '../coercion';\nimport {_getEventTarget, _getShadowRoot} from '../platform';\nimport {ViewportRuler} from '../scrolling';\nimport {\n ElementRef,\n EmbeddedViewRef,\n NgZone,\n Renderer2,\n TemplateRef,\n ViewContainerRef,\n signal,\n} from '@angular/core';\nimport {Observable, Subject, Subscription} from 'rxjs';\nimport {deepCloneNode} from './dom/clone-node';\nimport {adjustDomRect, getMutableClientRect, isOverflowingParent} from './dom/dom-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {getRootNode} from './dom/root-node';\nimport {\n DragCSSStyleDeclaration,\n combineTransforms,\n getTransform,\n toggleNativeDragInteractions,\n toggleVisibility,\n} from './dom/styling';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport type {DropListRef} from './drop-list-ref';\nimport {DragPreviewTemplate, PreviewRef} from './preview-ref';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n\n /** `z-index` for the absolutely-positioned elements that are created by the drag item. */\n zIndex?: number;\n\n /** Ref that the current drag item is nested in. */\n parentDragRef?: DragRef;\n}\n\n/** Function that can be used to constrain the position of a dragged element. */\nexport type DragConstrainPosition = (\n userPointerPosition: Point,\n dragRef: DragRef,\n dimensions: DOMRect,\n pickupPositionInElement: Point,\n) => Point;\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = {passive: true};\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = {passive: false};\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = {\n passive: false,\n capture: true,\n};\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n/** Class applied to the drag placeholder. */\nconst PLACEHOLDER_CLASS = 'cdk-drag-placeholder';\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst dragImportantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n\n/**\n * Possible places into which the preview of a drag item can be inserted.\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */\nexport type PreviewContainer = 'global' | 'parent' | ElementRef<HTMLElement> | HTMLElement;\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n private _rootElementCleanups: (() => void)[] | undefined;\n private _cleanupShadowRootSelectStart: (() => void) | undefined;\n\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: PreviewRef | null;\n\n /** Container into which to insert the preview. */\n private _previewContainer: PreviewContainer | undefined;\n\n /** Reference to the view of the placeholder element. */\n private _placeholderRef: EmbeddedViewRef<any> | null;\n\n /** Element that is rendered instead of the draggable item while it is being sorted. */\n private _placeholder: HTMLElement;\n\n /** Coordinates within the element at which the user picked up the element. */\n private _pickupPositionInElement: Point;\n\n /** Coordinates on the page at which the user picked up the element. */\n private _pickupPositionOnPage: Point;\n\n /**\n * Marker node used to save the place in the DOM where the element was\n * picked up so that it can be restored at the end of the drag sequence.\n */\n private _marker: Comment;\n\n /**\n * Element indicating the position from which the item was picked up initially.\n */\n private _anchor: HTMLElement | null = null;\n\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n private _passiveTransform: Point = {x: 0, y: 0};\n\n /** CSS `transform` that is applied to the element while it's being dragged. */\n private _activeTransform: Point = {x: 0, y: 0};\n\n /** Inline `transform` value that the element had before the first dragging sequence. */\n private _initialTransform?: string;\n\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n private _hasStartedDragging = signal(false);\n\n /** Whether the element has moved since the user started dragging it. */\n private _hasMoved: boolean;\n\n /** Drop container in which the DragRef resided when dragging began. */\n private _initialContainer: DropListRef;\n\n /** Index at which the item started in its initial container. */\n private _initialIndex: number;\n\n /** Cached positions of scrollable parent elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Emits when the item is being moved. */\n private readonly _moveEvents = new Subject<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }>();\n\n /** Keeps track of the direction in which the user is dragging along each axis. */\n private _pointerDirectionDelta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n\n /** Pointer position at which the last change in the delta occurred. */\n private _pointerPositionAtLastDirectionChange: Point;\n\n /** Position of the pointer at the last pointer event. */\n private _lastKnownPointerPosition: Point;\n\n /**\n * Root DOM node of the drag instance. This is the element that will\n * be moved around as the user is dragging.\n */\n private _rootElement: HTMLElement;\n\n /**\n * Nearest ancestor SVG, relative to which coordinates are calculated if dragging SVGElement\n */\n private _ownerSVGElement: SVGSVGElement | null;\n\n /**\n * Inline style value of `-webkit-tap-highlight-color` at the time the\n * dragging was started. Used to restore the value once we're done dragging.\n */\n private _rootElementTapHighlight: string;\n\n /** Subscription to pointer movement events. */\n private _pointerMoveSubscription = Subscription.EMPTY;\n\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n private _pointerUpSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being scrolled. */\n private _scrollSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being resized. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /**\n * Time at which the last touch event occurred. Used to avoid firing the same\n * events multiple times on touch devices where the browser will fire a fake\n * mouse event for each touch event, after a certain time.\n */\n private _lastTouchEventTime: number;\n\n /** Time at which the last dragging sequence was started. */\n private _dragStartTime: number;\n\n /** Cached reference to the boundary element. */\n private _boundaryElement: HTMLElement | null = null;\n\n /** Whether the native dragging interactions have been enabled on the root element. */\n private _nativeInteractionsEnabled = true;\n\n /** Client rect of the root element when the dragging sequence has started. */\n private _initialDomRect?: DOMRect;\n\n /** Cached dimensions of the preview element. Should be read via `_getPreviewRect`. */\n private _previewRect?: DOMRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: DOMRect;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n private _previewTemplate?: DragPreviewTemplate | null;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n private _placeholderTemplate?: DragHelperTemplate | null;\n\n /** Elements that can be used to drag the draggable item. */\n private _handles: HTMLElement[] = [];\n\n /** Registered handles that are currently disabled. */\n private _disabledHandles = new Set<HTMLElement>();\n\n /** Droppable container that the draggable is a part of. */\n private _dropContainer?: DropListRef;\n\n /** Layout direction of the item. */\n private _direction: Direction = 'ltr';\n\n /** Ref that the current drag item is nested in. */\n private _parentDragRef: DragRef<unknown> | null;\n\n /**\n * Cached shadow root that the element is placed in. `null` means that the element isn't in\n * the shadow DOM and `undefined` means that it hasn't been resolved yet. Should be read via\n * `_getShadowRoot`, not directly.\n */\n private _cachedShadowRoot: ShadowRoot | null | undefined;\n\n /** Axis along which dragging is locked. */\n lockAxis: 'x' | 'y' | null = null;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n dragStartDelay: number | {touch: number; mouse: number} = 0;\n\n /** Class to be added to the preview element. */\n previewClass: string | string[] | undefined;\n\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n scale: number = 1;\n\n /** Whether starting to drag this element is disabled. */\n get disabled(): boolean {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value: boolean) {\n if (value !== this._disabled) {\n this._disabled = value;\n this._toggleNativeDragInteractions();\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, value));\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n readonly beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n readonly started = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n readonly released = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user stops dragging an item in the container. */\n readonly ended = new Subject<{\n source: DragRef;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits when the user has moved the item into a new container. */\n readonly entered = new Subject<{container: DropListRef; item: DragRef; currentIndex: number}>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n readonly exited = new Subject<{container: DropListRef; item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n readonly dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n dropPoint: Point;\n isPointerOverContainer: boolean;\n event: MouseEvent | TouchEvent;\n }>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n readonly moved: Observable<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }> = this._moveEvents;\n\n /** Arbitrary data that can be attached to the drag item. */\n data: T;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page, a reference to the item being dragged and its dimensions.\n * Should return a point describing where the item should be rendered.\n */\n constrainPosition?: DragConstrainPosition;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _config: DragRefConfig,\n private _document: Document,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry,\n private _renderer: Renderer2,\n ) {\n this.withRootElement(element).withParent(_config.parentDragRef || null);\n this._parentPositions = new ParentPositionTracker(_document);\n _dragDropRegistry.registerDragItem(this);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._placeholder;\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._rootElement;\n }\n\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement(): HTMLElement {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled));\n this._toggleNativeDragInteractions();\n\n // Delete any lingering disabled handles that may have been destroyed. Note that we re-create\n // the set, rather than iterate over it and filter out the destroyed handles, because while\n // the ES spec allows for sets to be modified while they're being iterated over, some polyfills\n // use an array internally which may throw an error.\n const disabledHandles = new Set<HTMLElement>();\n this._disabledHandles.forEach(handle => {\n if (this._handles.indexOf(handle) > -1) {\n disabledHandles.add(handle);\n }\n });\n this._disabledHandles = disabledHandles;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template: DragPreviewTemplate | null): this {\n this._previewTemplate = template;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template: DragHelperTemplate | null): this {\n this._placeholderTemplate = template;\n return this;\n }\n\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this {\n const element = coerceElement(rootElement);\n\n if (element !== this._rootElement) {\n this._removeRootElementListeners();\n const renderer = this._renderer;\n this._rootElementCleanups = this._ngZone.runOutsideAngular(() => [\n renderer.listen(element, 'mousedown', this._pointerDown, activeEventListenerOptions),\n renderer.listen(element, 'touchstart', this._pointerDown, passiveEventListenerOptions),\n renderer.listen(element, 'dragstart', this._nativeDragStart, activeEventListenerOptions),\n ]);\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n this._ownerSVGElement = this._rootElement.ownerSVGElement;\n }\n\n return this;\n }\n\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n\n /** Sets the parent ref that the ref is nested in. */\n withParent(parent: DragRef<unknown> | null): this {\n this._parentDragRef = parent;\n return this;\n }\n\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners();\n\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n this._rootElement?.remove();\n }\n\n this._marker?.remove();\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeListeners();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._parentPositions.clear();\n this._boundaryElement =\n this._rootElement =\n this._ownerSVGElement =\n this._placeholderTemplate =\n this._previewTemplate =\n this._marker =\n this._parentDragRef =\n null!;\n }\n\n /** Checks whether the element is currently being dragged. */\n isDragging(): boolean {\n return this._hasStartedDragging() && this._dragDropRegistry.isDragging(this);\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform = {x: 0, y: 0};\n }\n\n /** Resets drag item to end of boundary element. */\n resetToBoundary(): void {\n if (\n // can be null if the drag item was never dragged.\n this._boundaryElement &&\n this._rootElement &&\n // check if we are overflowing off our boundary element\n isOverflowingParent(\n this._boundaryElement.getBoundingClientRect(),\n this._rootElement.getBoundingClientRect(),\n )\n ) {\n const parentRect = this._boundaryElement.getBoundingClientRect();\n const childRect = this._rootElement.getBoundingClientRect();\n\n let offsetX = 0;\n let offsetY = 0;\n\n // check if we are overflowing from left or right\n if (childRect.left < parentRect.left) {\n offsetX = parentRect.left - childRect.left;\n } else if (childRect.right > parentRect.right) {\n offsetX = parentRect.right - childRect.right;\n }\n\n // check if we are overflowing from top or bottom\n if (childRect.top < parentRect.top) {\n offsetY = parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n offsetY = parentRect.bottom - childRect.bottom;\n }\n\n const currentLeft = this._activeTransform.x;\n const currentTop = this._activeTransform.y;\n\n let x = currentLeft + offsetX,\n y = currentTop + offsetY;\n\n this._rootElement.style.transform = getTransform(x, y);\n this._activeTransform = {x, y};\n this._passiveTransform = {x, y};\n }\n }\n\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle: HTMLElement) {\n if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n toggleNativeDragInteractions(handle, true);\n }\n }\n\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle: HTMLElement) {\n if (this._disabledHandles.has(handle)) {\n this._disabledHandles.delete(handle);\n toggleNativeDragInteractions(handle, this.disabled);\n }\n }\n\n /** Sets the layout direction of the draggable item. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /** Sets the container that the item is part of. */\n _withDropContainer(container: DropListRef) {\n this._dropContainer = container;\n }\n\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return {x: position.x, y: position.y};\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): this {\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n\n return this;\n }\n\n /**\n * Sets the container into which to insert the preview element.\n * @param value Container into which to insert the preview.\n */\n withPreviewContainer(value: PreviewContainer): this {\n this._previewContainer = value;\n return this;\n }\n\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._lastKnownPointerPosition;\n\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position);\n }\n }\n\n /** Unsubscribes from the global subscriptions. */\n private _removeListeners() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n this._cleanupShadowRootSelectStart?.();\n this._cleanupShadowRootSelectStart = undefined;\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n this._preview?.destroy();\n this._preview = null;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n this._anchor?.remove();\n this._placeholder?.remove();\n this._placeholderRef?.destroy();\n this._placeholder = this._anchor = this._placeholderRef = null!;\n }\n\n /** Handler for the `mousedown`/`touchstart` events. */\n private _pointerDown = (event: MouseEvent | TouchEvent) => {\n this.beforeStarted.next();\n\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n } else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n };\n\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n private _pointerMove = (event: MouseEvent | TouchEvent) => {\n const pointerPosition = this._getPointerPositionOnPage(event);\n\n if (!this._hasStartedDragging()) {\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n const container = this._dropContainer;\n\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!container || (!container.isDragging() && !container.isReceiving())) {\n // Prevent the default action as soon as the dragging sequence is considered as\n // \"started\" since waiting for the next event can allow the device to begin scrolling.\n if (event.cancelable) {\n event.preventDefault();\n }\n this._hasStartedDragging.set(true);\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We prevent the default action down here so that we know that dragging has started. This is\n // important for touch devices where doing this too early can unnecessarily block scrolling,\n // if there's a dragging delay.\n if (event.cancelable) {\n event.preventDefault();\n }\n\n const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition);\n this._hasMoved = true;\n this._lastKnownPointerPosition = pointerPosition;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition);\n } else {\n // If there's a position constraint function, we want the element's top/left to be at the\n // specific position on the page. Use the initial position as a reference if that's the case.\n const offset = this.constrainPosition ? this._initialDomRect! : this._pickupPositionOnPage;\n const activeTransform = this._activeTransform;\n activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x;\n activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y;\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n }\n\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta,\n });\n });\n }\n };\n\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n private _pointerUp = (event: MouseEvent | TouchEvent) => {\n this._endDragSequence(event);\n };\n\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n private _endDragSequence(event: MouseEvent | TouchEvent) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n\n this._removeListeners();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n (this._rootElement.style as DragCSSStyleDeclaration).webkitTapHighlightColor =\n this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging()) {\n return;\n }\n\n this.released.next({source: this, event});\n\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n } else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n const pointerPosition = this._getPointerPositionOnPage(event);\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(pointerPosition),\n dropPoint: pointerPosition,\n event,\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n\n /** Starts the dragging sequence. */\n private _startDragSequence(event: MouseEvent | TouchEvent) {\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n\n this._toggleNativeDragInteractions();\n\n // Needs to happen before the root element is moved.\n const shadowRoot = this._getShadowRoot();\n const dropContainer = this._dropContainer;\n\n if (shadowRoot) {\n // In some browsers the global `selectstart` that we maintain in the `DragDropRegistry`\n // doesn't cross the shadow boundary so we have to prevent it at the shadow root (see #28792).\n this._ngZone.runOutsideAngular(() => {\n this._cleanupShadowRootSelectStart = this._renderer.listen(\n shadowRoot,\n 'selectstart',\n shadowDomSelectStart,\n activeCapturingEventOptions,\n );\n });\n }\n\n if (dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode as HTMLElement;\n const placeholder = (this._placeholder = this._createPlaceholderElement());\n const marker = (this._marker =\n this._marker ||\n this._document.createComment(\n typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-marker' : '',\n ));\n\n // Insert a marker node so that we can restore the element's position in the DOM.\n parent.insertBefore(marker, element);\n\n // There's no risk of transforms stacking when inside a drop container so\n // we can keep the initial transform up to date any time dragging starts.\n this._initialTransform = element.style.transform || '';\n\n // Create the preview after the initial transform has\n // been cached, because it can be affected by the transform.\n this._preview = new PreviewRef(\n this._document,\n this._rootElement,\n this._direction,\n this._initialDomRect!,\n this._previewTemplate || null,\n this.previewClass || null,\n this._pickupPositionOnPage,\n this._initialTransform,\n this._config.zIndex || 1000,\n this._renderer,\n );\n this._preview.attach(this._getPreviewInsertionPoint(parent, shadowRoot));\n\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n toggleVisibility(element, false, dragImportantProperties);\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n this.started.next({source: this, event}); // Emit before notifying the container.\n dropContainer.start();\n this._initialContainer = dropContainer;\n this._initialIndex = dropContainer.getItemIndex(this);\n } else {\n this.started.next({source: this, event});\n this._initialContainer = this._initialIndex = undefined!;\n }\n\n // Important to run after we've called `start` on the parent container\n // so that it has had time to resolve its scrollable parents.\n this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []);\n }\n\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n private _initializeDragSequence(referenceElement: HTMLElement, event: MouseEvent | TouchEvent) {\n // Stop propagation if the item is inside another\n // draggable so we don't start multiple drag sequences.\n if (this._parentDragRef) {\n event.stopPropagation();\n }\n\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && (event as MouseEvent).button !== 0;\n const rootElement = this._rootElement;\n const target = _getEventTarget(event);\n const isSyntheticEvent =\n !isTouchSequence &&\n this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n const isFakeEvent = isTouchSequence\n ? isFakeTouchstartFromScreenReader(event as TouchEvent)\n : isFakeMousedownFromScreenReader(event as MouseEvent);\n\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (target && (target as HTMLElement).draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) {\n return;\n }\n\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n const rootStyles = rootElement.style as DragCSSStyleDeclaration;\n this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || '';\n rootStyles.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasMoved = false;\n this._hasStartedDragging.set(this._hasMoved);\n\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeListeners();\n this._initialDomRect = this._rootElement.getBoundingClientRect();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(scrollEvent => this._updateOnScroll(scrollEvent));\n\n if (this._boundaryElement) {\n this._boundaryRect = getMutableClientRect(this._boundaryElement);\n }\n\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement =\n previewTemplate && previewTemplate.template && !previewTemplate.matchSize\n ? {x: 0, y: 0}\n : this._getPointerPositionInElement(this._initialDomRect, referenceElement, event);\n const pointerPosition =\n (this._pickupPositionOnPage =\n this._lastKnownPointerPosition =\n this._getPointerPositionOnPage(event));\n this._pointerDirectionDelta = {x: 0, y: 0};\n this._pointerPositionAtLastDirectionChange = {x: pointerPosition.x, y: pointerPosition.y};\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n private _cleanupDragArtifacts(event: MouseEvent | TouchEvent) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n toggleVisibility(this._rootElement, true, dragImportantProperties);\n this._marker.parentNode!.replaceChild(this._rootElement, this._marker);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._initialDomRect =\n this._boundaryRect =\n this._previewRect =\n this._initialTransform =\n undefined;\n\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer!;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(pointerPosition);\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x,\n pointerPosition.y,\n );\n\n this.ended.next({source: this, distance, dropPoint: pointerPosition, event});\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance,\n dropPoint: pointerPosition,\n event,\n });\n container.drop(\n this,\n currentIndex,\n this._initialIndex,\n this._initialContainer,\n isPointerOverContainer,\n distance,\n pointerPosition,\n event,\n );\n this._dropContainer = this._initialContainer;\n });\n }\n\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n private _updateActiveDropContainer({x, y}: Point, {x: rawX, y: rawY}: Point) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (\n !newContainer &&\n this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)\n ) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n const exitIndex = this._dropContainer!.getItemIndex(this);\n const nextItemElement =\n this._dropContainer!.getItemAtIndex(exitIndex + 1)?.getVisibleElement() || null;\n\n // Notify the old container that the item has left.\n this.exited.next({item: this, container: this._dropContainer!});\n this._dropContainer!.exit(this);\n this._conditionallyInsertAnchor(newContainer, this._dropContainer!, nextItemElement);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(\n this,\n x,\n y,\n // If we're re-entering the initial container and sorting is disabled,\n // put item the into its starting index to begin with.\n newContainer === this._initialContainer && newContainer.sortingDisabled\n ? this._initialIndex\n : undefined,\n );\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this),\n });\n });\n }\n\n // Dragging may have been interrupted as a result of the events above.\n if (this.isDragging()) {\n this._dropContainer!._startScrollingIfNecessary(rawX, rawY);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n\n if (this.constrainPosition) {\n this._applyPreviewTransform(x, y);\n } else {\n this._applyPreviewTransform(\n x - this._pickupPositionInElement.x,\n y - this._pickupPositionInElement.y,\n );\n }\n }\n }\n\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n private _animatePreviewToPlaceholder(): Promise<void> {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n\n const placeholderRect = this._placeholder.getBoundingClientRect();\n\n // Apply the class that adds a transition to the preview.\n this._preview!.addClass('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._applyPreviewTransform(placeholderRect.left, placeholderRect.top);\n\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = this._preview!.getTransitionDuration();\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = (event: TransitionEvent) => {\n if (\n !event ||\n (this._preview &&\n _getEventTarget(event) === this._preview.element &&\n event.propertyName === 'transform')\n ) {\n cleanupListener();\n resolve();\n clearTimeout(timeout);\n }\n };\n\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler as Function, duration * 1.5);\n const cleanupListener = this._preview!.addEventListener('transitionend', handler);\n });\n });\n }\n\n /** Creates an element that will be shown instead of the current element while dragging. */\n private _createPlaceholderElement(): HTMLElement {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder: HTMLElement;\n\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView(\n placeholderTemplate,\n placeholderConfig!.context,\n );\n this._placeholderRef.detectChanges();\n placeholder = getRootNode(this._placeholderRef, this._document);\n } else {\n placeholder = deepCloneNode(this._rootElement);\n }\n\n // Stop pointer events on the preview so the user can't\n // interact with it while the preview is animating.\n placeholder.style.pointerEvents = 'none';\n placeholder.classList.add(PLACEHOLDER_CLASS);\n return placeholder;\n }\n\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n private _getPointerPositionInElement(\n elementRect: DOMRect,\n referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent,\n ): Point {\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const scrollPosition = this._getViewportScrollPosition();\n const x = point.pageX - referenceRect.left - scrollPosition.left;\n const y = point.pageY - referenceRect.top - scrollPosition.top;\n\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y,\n };\n }\n\n /** Determines the point of the page that was touched by the user. */\n private _getPointerPositionOnPage(event: MouseEvent | TouchEvent): Point {\n const scrollPosition = this._getViewportScrollPosition();\n const point = isTouchEvent(event)\n ? // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n // Also note that on real devices we're guaranteed for either `touches` or `changedTouches`\n // to have a value, but Firefox in device emulation mode has a bug where both can be empty\n // for `touchstart` and `touchend` so we fall back to a dummy object in order to avoid\n // throwing an error. The value returned here will be incorrect, but since this only\n // breaks inside a developer tool and the value is only used for secondary information,\n // we can get away with it. See https://bugzilla.mozilla.org/show_bug.cgi?id=1615824.\n event.touches[0] || event.changedTouches[0] || {pageX: 0, pageY: 0}\n : event;\n\n const x = point.pageX - scrollPosition.left;\n const y = point.pageY - scrollPosition.top;\n\n // if dragging SVG element, try to convert from the screen coordinate system to the SVG\n // coordinate system\n if (this._ownerSVGElement) {\n const svgMatrix = this._ownerSVGElement.getScreenCTM();\n if (svgMatrix) {\n const svgPoint = this._ownerSVGElement.createSVGPoint();\n svgPoint.x = x;\n svgPoint.y = y;\n return svgPoint.matrixTransform(svgMatrix.inverse());\n }\n }\n\n return {x, y};\n }\n\n /** Gets the pointer position on the page, accounting for any position constraints. */\n private _getConstrainedPointerPosition(point: Point): Point {\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n let {x, y} = this.constrainPosition\n ? this.constrainPosition(point, this, this._initialDomRect!, this._pickupPositionInElement)\n : point;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n y =\n this._pickupPositionOnPage.y -\n (this.constrainPosition ? this._pickupPositionInElement.y : 0);\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n x =\n this._pickupPositionOnPage.x -\n (this.constrainPosition ? this._pickupPositionInElement.x : 0);\n }\n\n if (this._boundaryRect) {\n // If not using a custom constrain we need to account for the pickup position in the element\n // otherwise we do not need to do this, as it has already been accounted for\n const {x: pickupX, y: pickupY} = !this.constrainPosition\n ? this._pickupPositionInElement\n : {x: 0, y: 0};\n\n const boundaryRect = this._boundaryRect;\n const {width: previewWidth, height: previewHeight} = this._getPreviewRect();\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewHeight - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewWidth - pickupX);\n\n x = clamp(x, minX, maxX);\n y = clamp(y, minY, maxY);\n }\n\n return {x, y};\n }\n\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n private _updatePointerDirectionDelta(pointerPositionOnPage: Point) {\n const {x, y} = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n\n return delta;\n }\n\n /** Toggles the native drag interactions, based on how many handles are registered. */\n private _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n\n /** Removes the manually-added event listeners from the root element. */\n private _removeRootElementListeners() {\n this._rootElementCleanups?.forEach(cleanup => cleanup());\n this._rootElementCleanups = undefined;\n }\n\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyRootElementTransform(x: number, y: number) {\n const scale = 1 / this.scale;\n const transform = getTransform(x * scale, y * scale);\n const styles = this._rootElement.style;\n\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n // Should be excluded none because none + translate3d(x, y, x) is invalid css\n if (this._initialTransform == null) {\n this._initialTransform =\n styles.transform && styles.transform != 'none' ? styles.transform : '';\n }\n\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n styles.transform = combineTransforms(transform, this._initialTransform);\n }\n\n /**\n * Applies a `transform` to the preview, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyPreviewTransform(x: number, y: number) {\n // Only apply the initial transform if the preview is a clone of the original element, otherwise\n // it could be completely different and the transform might not make sense anymore.\n const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;\n const transform = getTransform(x, y);\n this._preview!.setTransform(combineTransforms(transform, initialTransform));\n }\n\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n private _getDragDistance(currentPosition: Point): Point {\n const pickupPosition = this._pickupPositionOnPage;\n\n if (pickupPosition) {\n return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};\n }\n\n return {x: 0, y: 0};\n }\n\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n private _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n this._parentPositions.clear();\n }\n\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n private _containInsideBoundaryOnResize() {\n let {x, y} = this._passiveTransform;\n\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n\n // Note: don't use `_clientRectAtStart` here, because we want the latest position.\n const elementRect = this._rootElement.getBoundingClientRect();\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if (\n (boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)\n ) {\n return;\n }\n\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n } else {\n x = 0;\n }\n\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n } else {\n y = 0;\n }\n\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({y, x});\n }\n }\n\n /** Gets the drag start delay, based on the event type. */\n private _getDragStartDelay(event: MouseEvent | TouchEvent): number {\n const value = this.dragStartDelay;\n\n if (typeof value === 'number') {\n return value;\n } else if (isTouchEvent(event)) {\n return value.touch;\n }\n\n return value ? value.mouse : 0;\n }\n\n /** Updates the internal state of the draggable element when scrolling has occurred. */\n private _updateOnScroll(event: Event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n\n // DOMRect dimensions are based on the scroll position of the page and its parent\n // node so we have to update the cached boundary DOMRect if the user has scrolled.\n if (\n this._boundaryRect &&\n target !== this._boundaryElement &&\n target.contains(this._boundaryElement)\n ) {\n adjustDomRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }\n\n /** Gets the scroll position of the viewport. */\n private _getViewportScrollPosition() {\n return (\n this._parentPositions.positions.get(this._document)?.scrollPosition ||\n this._parentPositions.getViewportScrollPosition()\n );\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): ShadowRoot | null {\n if (this._cachedShadowRoot === undefined) {\n this._cachedShadowRoot = _getShadowRoot(this._rootElement);\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Gets the element into which the drag preview should be inserted. */\n private _getPreviewInsertionPoint(\n initialParent: HTMLElement,\n shadowRoot: ShadowRoot | null,\n ): HTMLElement {\n const previewContainer = this._previewContainer || 'global';\n\n if (previewContainer === 'parent') {\n return initialParent;\n }\n\n if (previewContainer === 'global') {\n const documentRef = this._document;\n\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return (\n shadowRoot ||\n documentRef.fullscreenElement ||\n (documentRef as any).webkitFullscreenElement ||\n (documentRef as any).mozFullScreenElement ||\n (documentRef as any).msFullscreenElement ||\n documentRef.body\n );\n }\n\n return coerceElement(previewContainer);\n }\n\n /** Lazily resolves and returns the dimensions of the preview. */\n private _getPreviewRect(): DOMRect {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = this._preview\n ? this._preview!.getBoundingClientRect()\n : this._initialDomRect!;\n }\n\n return this._previewRect;\n }\n\n /** Handles a native `dragstart` event. */\n private _nativeDragStart = (event: DragEvent) => {\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n event.preventDefault();\n }\n } else if (!this.disabled) {\n // Usually this isn't necessary since the we prevent the default action in `pointerDown`,\n // but some cases like dragging of links can slip through (see #24403).\n event.preventDefault();\n }\n };\n\n /** Gets a handle that is the target of an event. */\n private _getTargetHandle(event: Event): HTMLElement | undefined {\n return this._handles.find(handle => {\n return event.target && (event.target === handle || handle.contains(event.target as Node));\n });\n }\n\n /** Inserts the anchor element, if it's valid. */\n private _conditionallyInsertAnchor(\n newContainer: DropListRef,\n exitContainer: DropListRef,\n nextItemElement: HTMLElement | null,\n ) {\n // Remove the anchor when returning to the initial container.\n if (newContainer === this._initialContainer) {\n this._anchor?.remove();\n this._anchor = null;\n } else if (exitContainer === this._initialContainer && exitContainer.hasAnchor) {\n // Insert the anchor when leaving the initial container.\n const anchor = (this._anchor ??= deepCloneNode(this._placeholder));\n anchor.classList.remove(PLACEHOLDER_CLASS);\n anchor.classList.add('cdk-drag-anchor');\n\n // Clear the transform since the single-axis strategy uses transforms to sort the items.\n anchor.style.transform = '';\n\n // When the item leaves the initial container, the container's DOM will be restored to\n // its original state, except for the dragged item which is removed. Insert the anchor in\n // the position from which the item left so that the list looks consistent.\n if (nextItemElement) {\n nextItemElement.before(anchor);\n } else {\n coerceElement(exitContainer.element).appendChild(anchor);\n }\n }\n }\n}\n\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/** Callback invoked for `selectstart` events inside the shadow DOM. */\nfunction shadowDomSelectStart(event: Event) {\n event.preventDefault();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Direction} from '../../bidi';\nimport {DragDropRegistry} from '../drag-drop-registry';\nimport {moveItemInArray} from '../drag-utils';\nimport {combineTransforms} from '../dom/styling';\nimport {adjustDomRect, getMutableClientRect, isInsideClientRect} from '../dom/dom-rect';\nimport {DropListSortStrategy, SortPredicate} from './drop-list-sort-strategy';\nimport type {DragRef} from '../drag-ref';\n\n/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition<T> {\n /** Instance of the drag item. */\n drag: T;\n /** Dimensions of the item. */\n clientRect: DOMRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n /** Inline transform that the drag item had when dragging started. */\n initialTransform: string;\n}\n\n/**\n * Strategy that only supports sorting along a single axis.\n * Items are reordered using CSS transforms which allows for sorting to be animated.\n * @docs-private\n */\nexport class SingleAxisSortStrategy implements DropListSortStrategy {\n /** Root element container of the drop list. */\n private _element: HTMLElement;\n\n /** Function used to determine if an item can be sorted into a specific index. */\n private _sortPredicate: SortPredicate<DragRef>;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition<DragRef>[] = [];\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * that were there at the start of the sequence, as well as any items that have been dragged\n * in, but haven't been dropped yet.\n */\n private _activeDraggables: DragRef[];\n\n /** Direction in which the list is oriented. */\n orientation: 'vertical' | 'horizontal' = 'vertical';\n\n /** Layout direction of the drop list. */\n direction: Direction;\n\n constructor(private _dragDropRegistry: DragDropRegistry) {}\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {\n drag: null as DragRef | null,\n delta: 0,\n overlaps: false,\n };\n\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items: readonly DragRef[]) {\n this.withItems(items);\n }\n\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(item: DragRef, pointerX: number, pointerY: number, pointerDelta: {x: number; y: number}) {\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return null;\n }\n\n const isHorizontal = this.orientation === 'horizontal';\n const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem\n ? item.getPlaceholderElement()\n : sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n\n const transformAmount = Math.round(sibling.offset * (1 / sibling.drag.scale));\n\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = combineTransforms(\n `translate3d(${transformAmount}px, 0, 0)`,\n sibling.initialTransform,\n );\n adjustDomRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = combineTransforms(\n `translate3d(0, ${transformAmount}px, 0)`,\n sibling.initialTransform,\n );\n adjustDomRect(sibling.clientRect, offset, 0);\n }\n });\n\n // Note that it's important that we do this after the client rects have been adjusted.\n this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY);\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n\n return {previousIndex: currentIndex, currentIndex: newIndex};\n }\n\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n const newIndex =\n index == null || index < 0\n ? // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference: DragRef | undefined = activeDraggables[newIndex];\n\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n\n // If we didn't find a new position reference, it means that either the item didn't start off\n // in this container, or that the item requested to be inserted at the end of the list.\n if (\n !newPositionReference &&\n (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) &&\n this._shouldEnterAsFirstChild(pointerX, pointerY)\n ) {\n newPositionReference = activeDraggables[0];\n }\n\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement!.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n } else {\n this._element.appendChild(placeholder);\n activeDraggables.push(item);\n }\n\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n\n // Note that usually `start` is called together with `enter` when an item goes into a new\n // container. This will cache item positions, but we need to refresh them since the amount\n // of items has changed.\n this._cacheItemPositions();\n }\n\n /** Sets the items that are currently part of the list. */\n withItems(items: readonly DragRef[]): void {\n this._activeDraggables = items.slice();\n this._cacheItemPositions();\n }\n\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate: SortPredicate<DragRef>): void {\n this._sortPredicate = predicate;\n }\n\n /** Resets the strategy to its initial state before dragging was started. */\n reset() {\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables?.forEach(item => {\n const rootElement = item.getRootElement();\n\n if (rootElement) {\n const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform;\n rootElement.style.transform = initialTransform || '';\n }\n });\n\n this._itemPositions = [];\n this._activeDraggables = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n }\n\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot(): readonly DragRef[] {\n return this._activeDraggables;\n }\n\n /** Gets the index of a specific item. */\n getItemIndex(item: DragRef): number {\n return this._getVisualItemPositions().findIndex(currentItem => currentItem.drag === item);\n }\n\n /** Gets the item at a specific index. */\n getItemAtIndex(index: number): DragRef | null {\n return this._getVisualItemPositions()[index]?.drag || null;\n }\n\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(topDifference: number, leftDifference: number) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({clientRect}) => {\n adjustDomRect(clientRect, topDifference, leftDifference);\n });\n\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({drag}) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n\n withElementContainer(container: HTMLElement): void {\n this._element = container;\n }\n\n /** Refreshes the position cache of the items and sibling containers. */\n private _cacheItemPositions() {\n const isHorizontal = this.orientation === 'horizontal';\n\n this._itemPositions = this._activeDraggables\n .map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {\n drag,\n offset: 0,\n initialTransform: elementToMeasure.style.transform || '',\n clientRect: getMutableClientRect(elementToMeasure),\n };\n })\n .sort((a, b) => {\n return isHorizontal\n ? a.clientRect.left - b.clientRect.left\n : a.clientRect.top - b.clientRect.top;\n });\n }\n\n private _getVisualItemPositions() {\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n return this.orientation === 'horizontal' && this.direction === 'rtl'\n ? this._itemPositions.slice().reverse()\n : this._itemPositions;\n }\n\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n private _getItemOffsetPx(currentPosition: DOMRect, newPosition: DOMRect, delta: 1 | -1) {\n const isHorizontal = this.orientation === 'horizontal';\n let itemOffset = isHorizontal\n ? newPosition.left - currentPosition.left\n : newPosition.top - currentPosition.top;\n\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal\n ? newPosition.width - currentPosition.width\n : newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\n }\n\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n private _getSiblingOffsetPx(\n currentIndex: number,\n siblings: CachedItemPosition<DragRef>[],\n delta: 1 | -1,\n ) {\n const isHorizontal = this.orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n } else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n\n return siblingOffset;\n }\n\n /**\n * Checks if pointer is entering in the first position\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n private _shouldEnterAsFirstChild(pointerX: number, pointerY: number) {\n if (!this._activeDraggables.length) {\n return false;\n }\n\n const itemPositions = this._itemPositions;\n const isHorizontal = this.orientation === 'horizontal';\n\n // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index\n // check if container is using some sort of \"reverse\" ordering (eg: flex-direction: row-reverse)\n const reversed = itemPositions[0].drag !== this._activeDraggables[0];\n if (reversed) {\n const lastItemRect = itemPositions[itemPositions.length - 1].clientRect;\n return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom;\n } else {\n const firstItemRect = itemPositions[0].clientRect;\n return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top;\n }\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n delta?: {x: number; y: number},\n ): number {\n const isHorizontal = this.orientation === 'horizontal';\n const index = this._itemPositions.findIndex(({drag, clientRect}) => {\n // Skip the item itself.\n if (drag === item) {\n return false;\n }\n\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n\n // If the user is still hovering over the same item as last time, their cursor hasn't left\n // the item after we made the swap, and they didn't change the direction in which they're\n // dragging, we don't consider it a direction swap.\n if (\n drag === this._previousSwap.drag &&\n this._previousSwap.overlaps &&\n direction === this._previousSwap.delta\n ) {\n return false;\n }\n }\n\n return isHorizontal\n ? // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right)\n : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom);\n });\n\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_getShadowRoot} from '../../platform';\nimport {moveItemInArray} from '../drag-utils';\nimport {DropListSortStrategy, SortPredicate} from './drop-list-sort-strategy';\nimport {DragDropRegistry} from '../drag-drop-registry';\nimport type {DragRef} from '../drag-ref';\n\n/**\n * Strategy that only supports sorting on a list that might wrap.\n * Items are reordered by moving their DOM nodes around.\n * @docs-private\n */\nexport class MixedSortStrategy implements DropListSortStrategy {\n /** Root element container of the drop list. */\n private _element: HTMLElement;\n\n /** Function used to determine if an item can be sorted into a specific index. */\n private _sortPredicate: SortPredicate<DragRef>;\n\n /** Lazily-resolved root node containing the list. Use `_getRootNode` to read this. */\n private _rootNode: DocumentOrShadowRoot | undefined;\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * that were there at the start of the sequence, as well as any items that have been dragged\n * in, but haven't been dropped yet.\n */\n private _activeItems: DragRef[];\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {\n drag: null as DragRef | null,\n deltaX: 0,\n deltaY: 0,\n overlaps: false,\n };\n\n /**\n * Keeps track of the relationship between a node and its next sibling. This information\n * is used to restore the DOM to the order it was in before dragging started.\n */\n private _relatedNodes: [node: Node, nextSibling: Node | null][] = [];\n\n constructor(\n private _document: Document,\n private _dragDropRegistry: DragDropRegistry,\n ) {}\n\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items: readonly DragRef[]): void {\n const childNodes = this._element.childNodes;\n this._relatedNodes = [];\n\n for (let i = 0; i < childNodes.length; i++) {\n const node = childNodes[i];\n this._relatedNodes.push([node, node.nextSibling]);\n }\n\n this.withItems(items);\n }\n\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n pointerDelta: {x: number; y: number},\n ): {previousIndex: number; currentIndex: number} | null {\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n const previousSwap = this._previousSwap;\n\n if (newIndex === -1 || this._activeItems[newIndex] === item) {\n return null;\n }\n\n const toSwapWith = this._activeItems[newIndex];\n\n // Prevent too many swaps over the same item.\n if (\n previousSwap.drag === toSwapWith &&\n previousSwap.overlaps &&\n previousSwap.deltaX === pointerDelta.x &&\n previousSwap.deltaY === pointerDelta.y\n ) {\n return null;\n }\n\n const previousIndex = this.getItemIndex(item);\n const current = item.getPlaceholderElement();\n const overlapElement = toSwapWith.getRootElement();\n\n if (newIndex > previousIndex) {\n overlapElement.after(current);\n } else {\n overlapElement.before(current);\n }\n\n moveItemInArray(this._activeItems, previousIndex, newIndex);\n\n const newOverlapElement = this._getRootNode().elementFromPoint(pointerX, pointerY);\n // Note: it's tempting to save the entire `pointerDelta` object here, however that'll\n // break this functionality, because the same object is passed for all `sort` calls.\n previousSwap.deltaX = pointerDelta.x;\n previousSwap.deltaY = pointerDelta.y;\n previousSwap.drag = toSwapWith;\n previousSwap.overlaps =\n overlapElement === newOverlapElement || overlapElement.contains(newOverlapElement);\n\n return {\n previousIndex,\n currentIndex: newIndex,\n };\n }\n\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n // Remove the item from current set of items first so that it doesn't throw off the indexes\n // further down in this method. See https://github.com/angular/components/issues/31505\n const currentIndex = this._activeItems.indexOf(item);\n\n if (currentIndex > -1) {\n this._activeItems.splice(currentIndex, 1);\n }\n\n let enterIndex =\n index == null || index < 0\n ? this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n\n // In some cases (e.g. when the container has padding) we might not be able to figure\n // out which item to insert the dragged item next to, because the pointer didn't overlap\n // with anything. In that case we find the item that's closest to the pointer.\n if (enterIndex === -1) {\n enterIndex = this._getClosestItemIndexToPointer(item, pointerX, pointerY);\n }\n\n const targetItem = this._activeItems[enterIndex] as DragRef | undefined;\n\n if (targetItem && !this._dragDropRegistry.isDragging(targetItem)) {\n this._activeItems.splice(enterIndex, 0, item);\n targetItem.getRootElement().before(item.getPlaceholderElement());\n } else {\n this._activeItems.push(item);\n this._element.appendChild(item.getPlaceholderElement());\n }\n }\n\n /** Sets the items that are currently part of the list. */\n withItems(items: readonly DragRef[]): void {\n this._activeItems = items.slice();\n }\n\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate: SortPredicate<DragRef>): void {\n this._sortPredicate = predicate;\n }\n\n /** Resets the strategy to its initial state before dragging was started. */\n reset(): void {\n const root = this._element;\n const previousSwap = this._previousSwap;\n\n // Moving elements around in the DOM can break things like the `@for` loop, because it\n // uses comment nodes to know where to insert elements. To avoid such issues, we restore\n // the DOM nodes in the list to their original order when the list is reset.\n // Note that this could be simpler if we just saved all the nodes, cleared the root\n // and then appended them in the original order. We don't do it, because it can break\n // down depending on when the snapshot was taken. E.g. we may end up snapshotting the\n // placeholder element which is removed after dragging.\n for (let i = this._relatedNodes.length - 1; i > -1; i--) {\n const [node, nextSibling] = this._relatedNodes[i];\n if (node.parentNode === root && node.nextSibling !== nextSibling) {\n if (nextSibling === null) {\n root.appendChild(node);\n } else if (nextSibling.parentNode === root) {\n root.insertBefore(node, nextSibling);\n }\n }\n }\n\n this._relatedNodes = [];\n this._activeItems = [];\n previousSwap.drag = null;\n previousSwap.deltaX = previousSwap.deltaY = 0;\n previousSwap.overlaps = false;\n }\n\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot(): readonly DragRef[] {\n return this._activeItems;\n }\n\n /** Gets the index of a specific item. */\n getItemIndex(item: DragRef): number {\n return this._activeItems.indexOf(item);\n }\n\n /** Gets the item at a specific index. */\n getItemAtIndex(index: number): DragRef | null {\n return this._activeItems[index] || null;\n }\n\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(): void {\n this._activeItems.forEach(item => {\n if (this._dragDropRegistry.isDragging(item)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n item._sortFromLastPointerPosition();\n }\n });\n }\n\n withElementContainer(container: HTMLElement): void {\n if (container !== this._element) {\n this._element = container;\n this._rootNode = undefined;\n }\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n ): number {\n const elementAtPoint = this._getRootNode().elementFromPoint(\n Math.floor(pointerX),\n Math.floor(pointerY),\n );\n const index = elementAtPoint\n ? this._activeItems.findIndex(item => {\n const root = item.getRootElement();\n return elementAtPoint === root || root.contains(elementAtPoint);\n })\n : -1;\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n\n /** Lazily resolves the list's root node. */\n private _getRootNode(): DocumentOrShadowRoot {\n // Resolve the root node lazily to ensure that the drop list is in its final place in the DOM.\n if (!this._rootNode) {\n this._rootNode = _getShadowRoot(this._element) || this._document;\n }\n return this._rootNode;\n }\n\n /**\n * Finds the index of the item that's closest to the item being dragged.\n * @param item Item being dragged.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n private _getClosestItemIndexToPointer(item: DragRef, pointerX: number, pointerY: number): number {\n if (this._activeItems.length === 0) {\n return -1;\n }\n\n if (this._activeItems.length === 1) {\n return 0;\n }\n\n let minDistance = Infinity;\n let minIndex = -1;\n\n // Find the Euclidean distance (https://en.wikipedia.org/wiki/Euclidean_distance) between each\n // item and the pointer, and return the smallest one. Note that this is a bit flawed in that DOM\n // nodes are rectangles, not points, so we use the top/left coordinates. It should be enough\n // for our purposes.\n for (let i = 0; i < this._activeItems.length; i++) {\n const current = this._activeItems[i];\n if (current !== item) {\n const {x, y} = current.getRootElement().getBoundingClientRect();\n const distance = Math.hypot(pointerX - x, pointerY - y);\n\n if (distance < minDistance) {\n minDistance = distance;\n minIndex = i;\n }\n }\n }\n\n return minIndex;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '../bidi';\nimport {coerceElement} from '../coercion';\nimport {ViewportRuler} from '../scrolling';\nimport {_getShadowRoot} from '../platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport type {DragRef, Point} from './drag-ref';\nimport {isPointerNearDomRect, isInsideClientRect} from './dom/dom-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {DragCSSStyleDeclaration} from './dom/styling';\nimport {DropListSortStrategy} from './sorting/drop-list-sort-strategy';\nimport {SingleAxisSortStrategy} from './sorting/single-axis-sort-strategy';\nimport {MixedSortStrategy} from './sorting/mixed-sort-strategy';\nimport {DropListOrientation} from './directives/config';\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n\n/** Vertical direction in which we can auto-scroll. */\nenum AutoScrollVerticalDirection {\n NONE,\n UP,\n DOWN,\n}\n\n/** Horizontal direction in which we can auto-scroll. */\nenum AutoScrollHorizontalDirection {\n NONE,\n LEFT,\n RIGHT,\n}\n\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nexport class DropListRef<T = any> {\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean = false;\n\n /** Whether sorting items within the list is disabled. */\n sortingDisabled: boolean = false;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y' | null = null;\n\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n autoScrollDisabled: boolean = false;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n autoScrollStep: number = 2;\n\n /**\n * Whether the items in the list should leave an anchor node when leaving the initial container.\n */\n hasAnchor: boolean = false;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n enterPredicate: (drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Function that is used to determine whether an item can be sorted into a particular index. */\n sortPredicate: (index: number, drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Emits right before dragging has started. */\n readonly beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n readonly entered = new Subject<{item: DragRef; container: DropListRef; currentIndex: number}>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n readonly exited = new Subject<{item: DragRef; container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n readonly dropped = new Subject<{\n item: DragRef;\n currentIndex: number;\n previousIndex: number;\n container: DropListRef;\n previousContainer: DropListRef;\n isPointerOverContainer: boolean;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n readonly sorted = new Subject<{\n previousIndex: number;\n currentIndex: number;\n container: DropListRef;\n item: DragRef;\n }>();\n\n /** Emits when a dragging sequence is started in a list connected to the current one. */\n readonly receivingStarted = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n items: DragRef[];\n }>();\n\n /** Emits when a dragging sequence is stopped from a list connected to the current one. */\n readonly receivingStopped = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Element that is the direct parent of the drag items. */\n private _container: HTMLElement;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Keeps track of the positions of any parent scrollable elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Strategy being used to sort items within the list. */\n private _sortStrategy: DropListSortStrategy;\n\n /** Cached `DOMRect` of the drop list. */\n private _domRect: DOMRect | undefined;\n\n /** Draggable items in the container. */\n private _draggables: readonly DragRef[] = [];\n\n /** Drop lists that are connected to the current one. */\n private _siblings: readonly DropListRef[] = [];\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Subscription to the window being scrolled. */\n private _viewportScrollSubscription = Subscription.EMPTY;\n\n /** Vertical direction in which the list is currently scrolling. */\n private _verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n\n /** Horizontal direction in which the list is currently scrolling. */\n private _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n /** Node that is being auto-scrolled. */\n private _scrollNode: HTMLElement | Window;\n\n /** Used to signal to the current auto-scroll sequence when to stop. */\n private readonly _stopScrollTimers = new Subject<void>();\n\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n private _cachedShadowRoot: DocumentOrShadowRoot | null = null;\n\n /** Reference to the document. */\n private _document: Document;\n\n /** Elements that can be scrolled while the user is dragging. */\n private _scrollableElements: HTMLElement[] = [];\n\n /** Initial value for the element's `scroll-snap-type` style. */\n private _initialScrollSnap: string;\n\n /** Direction of the list's layout. */\n private _direction: Direction = 'ltr';\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n ) {\n const coercedElement = (this.element = coerceElement(element));\n this._document = _document;\n this.withOrientation('vertical').withElementContainer(coercedElement);\n _dragDropRegistry.registerDropContainer(this);\n this._parentPositions = new ParentPositionTracker(_document);\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this.receivingStarted.complete();\n this.receivingStopped.complete();\n this._activeSiblings.clear();\n this._scrollNode = null!;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n\n /** Starts dragging an item. */\n start(): void {\n this._draggingStarted();\n this._notifyReceivingSiblings();\n }\n\n /**\n * Attempts to move an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n this._draggingStarted();\n\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n if (index == null && this.sortingDisabled) {\n index = this._draggables.indexOf(item);\n }\n\n this._sortStrategy.enter(item, pointerX, pointerY, index);\n\n // Note that this usually happens inside `_draggingStarted` as well, but the dimensions\n // can change when the sort strategy moves the item around inside `enter`.\n this._cacheParentPositions();\n\n // Notify siblings at the end so that the item has been inserted into the `activeDraggables`.\n this._notifyReceivingSiblings();\n this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)});\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item: DragRef): void {\n this._reset();\n this.exited.next({item, container: this});\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousIndex Index of the item when dragging started.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param event Event that triggered the dropping sequence.\n *\n * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.\n */\n drop(\n item: DragRef,\n currentIndex: number,\n previousIndex: number,\n previousContainer: DropListRef,\n isPointerOverContainer: boolean,\n distance: Point,\n dropPoint: Point,\n event: MouseEvent | TouchEvent = {} as any,\n ): void {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance,\n dropPoint,\n event,\n });\n }\n\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items: DragRef[]): this {\n const previousItems = this._draggables;\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n\n if (this.isDragging()) {\n const draggedItems = previousItems.filter(item => item.isDragging());\n\n // If all of the items being dragged were removed\n // from the list, abort the current drag sequence.\n if (draggedItems.every(item => items.indexOf(item) === -1)) {\n this._reset();\n } else {\n this._sortStrategy.withItems(this._draggables);\n }\n }\n\n return this;\n }\n\n /** Sets the layout direction of the drop list. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n if (this._sortStrategy instanceof SingleAxisSortStrategy) {\n this._sortStrategy.direction = direction;\n }\n return this;\n }\n\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo: DropListRef[]): this {\n this._siblings = connectedTo.slice();\n return this;\n }\n\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation: DropListOrientation): this {\n if (orientation === 'mixed') {\n this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry);\n } else {\n const strategy = new SingleAxisSortStrategy(this._dragDropRegistry);\n strategy.direction = this._direction;\n strategy.orientation = orientation;\n this._sortStrategy = strategy;\n }\n this._sortStrategy.withElementContainer(this._container);\n this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));\n return this;\n }\n\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements: HTMLElement[]): this {\n const element = this._container;\n\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n\n /**\n * Configures the drop list so that a different element is used as the container for the\n * dragged items. This is useful for the cases when one might not have control over the\n * full DOM that sets up the dragging.\n * Note that the alternate container needs to be a descendant of the drop list.\n * @param container New element container to be assigned.\n */\n withElementContainer(container: HTMLElement): this {\n if (container === this._container) {\n return this;\n }\n\n const element = coerceElement(this.element);\n\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n container !== element &&\n !element.contains(container)\n ) {\n throw new Error(\n 'Invalid DOM structure for drop list. Alternate container element must be a descendant of the drop list.',\n );\n }\n\n const oldContainerIndex = this._scrollableElements.indexOf(this._container);\n const newContainerIndex = this._scrollableElements.indexOf(container);\n\n if (oldContainerIndex > -1) {\n this._scrollableElements.splice(oldContainerIndex, 1);\n }\n\n if (newContainerIndex > -1) {\n this._scrollableElements.splice(newContainerIndex, 1);\n }\n\n if (this._sortStrategy) {\n this._sortStrategy.withElementContainer(container);\n }\n\n this._cachedShadowRoot = null;\n this._scrollableElements.unshift(container);\n this._container = container;\n return this;\n }\n\n /** Gets the scrollable parents that are registered with this drop container. */\n getScrollableParents(): readonly HTMLElement[] {\n return this._scrollableElements;\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item: DragRef): number {\n return this._isDragging\n ? this._sortStrategy.getItemIndex(item)\n : this._draggables.indexOf(item);\n }\n\n /**\n * Gets the item at a specific index.\n * @param index Index at which to retrieve the item.\n */\n getItemAtIndex(index: number): DragRef | null {\n return this._isDragging\n ? this._sortStrategy.getItemAtIndex(index)\n : this._draggables[index] || null;\n }\n\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving(): boolean {\n return this._activeSiblings.size > 0;\n }\n\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n pointerDelta: {x: number; y: number},\n ): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (\n this.sortingDisabled ||\n !this._domRect ||\n !isPointerNearDomRect(this._domRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)\n ) {\n return;\n }\n\n const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta);\n\n if (result) {\n this.sorted.next({\n previousIndex: result.previousIndex,\n currentIndex: result.currentIndex,\n container: this,\n item,\n });\n }\n }\n\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX: number, pointerY: number) {\n if (this.autoScrollDisabled) {\n return;\n }\n\n let scrollNode: HTMLElement | Window | undefined;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.positions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n\n if (isPointerNearDomRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement,\n position.clientRect,\n this._direction,\n pointerX,\n pointerY,\n );\n\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element as HTMLElement;\n }\n }\n });\n\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const {width, height} = this._viewportRuler.getViewportSize();\n const domRect = {\n width,\n height,\n top: 0,\n right: width,\n bottom: height,\n left: 0,\n } as DOMRect;\n verticalScrollDirection = getVerticalScrollDirection(domRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(domRect, pointerX);\n scrollNode = window;\n }\n\n if (\n scrollNode &&\n (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)\n ) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._stopScrolling();\n }\n }\n }\n\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n\n /** Starts the dragging sequence within the list. */\n private _draggingStarted() {\n const styles = this._container.style as DragCSSStyleDeclaration;\n this.beforeStarted.next();\n this._isDragging = true;\n\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n // Prevent the check from running on apps not using an alternate container. Ideally we\n // would always run it, but introducing it at this stage would be a breaking change.\n this._container !== coerceElement(this.element)\n ) {\n for (const drag of this._draggables) {\n if (!drag.isDragging() && drag.getVisibleElement().parentNode !== this._container) {\n throw new Error(\n 'Invalid DOM structure for drop list. All items must be placed directly inside of the element container.',\n );\n }\n }\n }\n\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';\n styles.scrollSnapType = styles.msScrollSnapType = 'none';\n this._sortStrategy.start(this._draggables);\n this._cacheParentPositions();\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n this._parentPositions.cache(this._scrollableElements);\n\n // The list element is always in the `scrollableElements`\n // so we can take advantage of the cached `DOMRect`.\n this._domRect = this._parentPositions.positions.get(this._container)!.clientRect!;\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n const styles = this._container.style as DragCSSStyleDeclaration;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._sortStrategy.reset();\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n\n /** Starts the interval that'll auto-scroll the element. */\n private _startScrollInterval = () => {\n this._stopScrolling();\n\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n const scrollStep = this.autoScrollStep;\n\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n node.scrollBy(0, -scrollStep);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n node.scrollBy(0, scrollStep);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n node.scrollBy(-scrollStep, 0);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n node.scrollBy(scrollStep, 0);\n }\n });\n };\n\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x: number, y: number): boolean {\n return this._domRect != null && isInsideClientRect(this._domRect, x, y);\n }\n\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item: DragRef, x: number, y: number): DropListRef | undefined {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item: DragRef, x: number, y: number): boolean {\n if (\n !this._domRect ||\n !isInsideClientRect(this._domRect, x, y) ||\n !this.enterPredicate(item, this)\n ) {\n return false;\n }\n\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y) as HTMLElement | null;\n\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n\n // The `DOMRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === this._container || this._container.contains(elementFromPoint);\n }\n\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling: DropListRef, items: DragRef[]) {\n const activeSiblings = this._activeSiblings;\n\n if (\n !activeSiblings.has(sibling) &&\n items.every(item => {\n // Note that we have to add an exception to the `enterPredicate` for items that started off\n // in this drop list. The drag ref has logic that allows an item to return to its initial\n // container, if it has left the initial container and none of the connected containers\n // allow it to enter. See `DragRef._updateActiveDropContainer` for more context.\n return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1;\n })\n ) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n this.receivingStarted.next({\n initiator: sibling,\n receiver: this,\n items,\n });\n }\n }\n\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling: DropListRef) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n this.receivingStopped.next({initiator: sibling, receiver: this});\n }\n\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n private _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left);\n }\n } else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): DocumentOrShadowRoot {\n if (!this._cachedShadowRoot) {\n const shadowRoot = _getShadowRoot(this._container);\n this._cachedShadowRoot = shadowRoot || this._document;\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Notifies any siblings that may potentially receive the item. */\n private _notifyReceivingSiblings() {\n const draggedItems = this._sortStrategy\n .getActiveItemsSnapshot()\n .filter(item => item.isDragging());\n this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));\n }\n}\n\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect: DOMRect, pointerY: number) {\n const {top, bottom, height} = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n\n return AutoScrollVerticalDirection.NONE;\n}\n\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect: DOMRect, pointerX: number) {\n const {left, right, width} = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n\n return AutoScrollHorizontalDirection.NONE;\n}\n\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param direction Layout direction of the drop list.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(\n element: HTMLElement,\n clientRect: DOMRect,\n direction: Direction,\n pointerX: number,\n pointerY: number,\n): [AutoScrollVerticalDirection, AutoScrollHorizontalDirection] {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n } else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n\n if (direction === 'rtl') {\n if (computedHorizontal === AutoScrollHorizontalDirection.RIGHT) {\n // In RTL `scrollLeft` will be negative when scrolled.\n if (scrollLeft < 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n } else if (element.scrollWidth + scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else {\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n }\n\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n Injectable,\n ListenerOptions,\n NgZone,\n OnDestroy,\n RendererFactory2,\n ViewEncapsulation,\n WritableSignal,\n inject,\n signal,\n DOCUMENT,\n} from '@angular/core';\n\nimport {_CdkPrivateStyleLoader} from '../private';\nimport {Observable, Observer, Subject, merge} from 'rxjs';\nimport type {DropListRef} from './drop-list-ref';\nimport type {DragRef} from './drag-ref';\nimport type {CdkDrag} from './directives/drag';\n\n/** Event options that can be used to bind a capturing event. */\nconst capturingEventOptions = {\n capture: true,\n};\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = {\n passive: false,\n capture: true,\n};\n\n/**\n * Component used to load the drag&drop reset styles.\n * @docs-private\n */\n@Component({\n styleUrl: 'resets.css',\n encapsulation: ViewEncapsulation.None,\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'cdk-drag-resets-container': ''},\n})\nexport class _ResetsLoader {}\n\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry implements OnDestroy {\n private _ngZone = inject(NgZone);\n private _document = inject(DOCUMENT);\n private _styleLoader = inject(_CdkPrivateStyleLoader);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n private _cleanupDocumentTouchmove: (() => void) | undefined;\n private _scroll: Subject<Event> = new Subject<Event>();\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<DropListRef>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<DragRef>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances: WritableSignal<DragRef[]> = signal([]);\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners: (() => void)[] | undefined;\n\n /**\n * Predicate function to check if an item is being dragged. Moved out into a property,\n * because it'll be called a lot and we don't want to create a new function every time.\n */\n private _draggingPredicate = (item: DragRef) => item.isDragging();\n\n /**\n * Map tracking DOM nodes and their corresponding drag directives. Note that this is different\n * from looking through the `_dragInstances` and getting their root node, because the root node\n * isn't necessarily the node that the directive is set on.\n */\n private _domNodesToDirectives: WeakMap<Node, CdkDrag> | null = null;\n\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerMove: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: DropListRef) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag: DragRef) {\n this._dragInstances.add(drag);\n\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._cleanupDocumentTouchmove?.();\n this._cleanupDocumentTouchmove = this._renderer.listen(\n this._document,\n 'touchmove',\n this._persistentTouchmoveListener,\n activeCapturingEventOptions,\n );\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: DropListRef) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: DragRef) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._cleanupDocumentTouchmove?.();\n }\n }\n\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag: DragRef, event: TouchEvent | MouseEvent) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances().indexOf(drag) > -1) {\n return;\n }\n\n this._styleLoader.load(_ResetsLoader);\n this._activeDragInstances.update(instances => [...instances, drag]);\n\n if (this._activeDragInstances().length === 1) {\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n const isTouchEvent = event.type.startsWith('touch');\n const endEventHandler = (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent);\n\n const toBind: [name: string, handler: (event: Event) => void, options: ListenerOptions][] = [\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n ['scroll', (e: Event) => this._scroll.next(e), capturingEventOptions],\n\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n ['selectstart', this._preventDefaultWhileDragging, activeCapturingEventOptions],\n ];\n\n if (isTouchEvent) {\n toBind.push(\n ['touchend', endEventHandler, capturingEventOptions],\n ['touchcancel', endEventHandler, capturingEventOptions],\n );\n } else {\n toBind.push(['mouseup', endEventHandler, capturingEventOptions]);\n }\n\n // We don't have to bind a move event for touch drag sequences, because\n // we already have a persistent global one bound from `registerDragItem`.\n if (!isTouchEvent) {\n toBind.push([\n 'mousemove',\n (e: Event) => this.pointerMove.next(e as MouseEvent),\n activeCapturingEventOptions,\n ]);\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners = toBind.map(([name, handler, options]) =>\n this._renderer.listen(this._document, name, handler, options),\n );\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: DragRef) {\n this._activeDragInstances.update(instances => {\n const index = instances.indexOf(drag);\n if (index > -1) {\n instances.splice(index, 1);\n return [...instances];\n }\n return instances;\n });\n\n if (this._activeDragInstances().length === 0) {\n this._clearGlobalListeners();\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: DragRef) {\n return this._activeDragInstances().indexOf(drag) > -1;\n }\n\n /**\n * Gets a stream that will emit when any element on the page is scrolled while an item is being\n * dragged.\n * @param shadowRoot Optional shadow root that the current dragging sequence started from.\n * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can\n * be used to include an additional top-level listener at the shadow root level.\n */\n scrolled(shadowRoot?: DocumentOrShadowRoot | null): Observable<Event> {\n const streams: Observable<Event>[] = [this._scroll];\n\n if (shadowRoot && shadowRoot !== this._document) {\n // Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,\n // because we want to guarantee that the event is bound outside of the `NgZone`. With\n // `fromEvent` it'll only happen if the subscription is outside the `NgZone`.\n streams.push(\n new Observable((observer: Observer<Event>) => {\n return this._ngZone.runOutsideAngular(() => {\n const cleanup = this._renderer.listen(\n shadowRoot as ShadowRoot,\n 'scroll',\n (event: Event) => {\n if (this._activeDragInstances().length) {\n observer.next(event);\n }\n },\n capturingEventOptions,\n );\n\n return () => {\n cleanup();\n };\n });\n }),\n );\n }\n\n return merge(...streams);\n }\n\n /**\n * Tracks the DOM node which has a draggable directive.\n * @param node Node to track.\n * @param dragRef Drag directive set on the node.\n */\n registerDirectiveNode(node: Node, dragRef: CdkDrag): void {\n this._domNodesToDirectives ??= new WeakMap();\n this._domNodesToDirectives.set(node, dragRef);\n }\n\n /**\n * Stops tracking a draggable directive node.\n * @param node Node to stop tracking.\n */\n removeDirectiveNode(node: Node): void {\n this._domNodesToDirectives?.delete(node);\n }\n\n /**\n * Gets the drag directive corresponding to a specific DOM node, if any.\n * @param node Node for which to do the lookup.\n */\n getDragDirectiveForNode(node: Node): CdkDrag | null {\n return this._domNodesToDirectives?.get(node) || null;\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._domNodesToDirectives = null;\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n private _preventDefaultWhileDragging = (event: Event) => {\n if (this._activeDragInstances().length > 0) {\n event.preventDefault();\n }\n };\n\n /** Event listener for `touchmove` that is bound even if no dragging is happening. */\n private _persistentTouchmoveListener = (event: TouchEvent) => {\n if (this._activeDragInstances().length > 0) {\n // Note that we only want to prevent the default action after dragging has actually started.\n // Usually this is the same time at which the item is added to the `_activeDragInstances`,\n // but it could be pushed back if the user has set up a drag delay or threshold.\n if (this._activeDragInstances().some(this._draggingPredicate)) {\n event.preventDefault();\n }\n\n this.pointerMove.next(event);\n }\n };\n\n /** Clears out the global event listeners from the `document`. */\n private _clearGlobalListeners() {\n this._globalListeners?.forEach(cleanup => cleanup());\n this._globalListeners = undefined;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, NgZone, ElementRef, inject, RendererFactory2, DOCUMENT} from '@angular/core';\n\nimport {ViewportRuler} from '../scrolling';\nimport {DragRef, DragRefConfig} from './drag-ref';\nimport {DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5,\n};\n\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\n@Injectable({providedIn: 'root'})\nexport class DragDrop {\n private _document = inject(DOCUMENT);\n private _ngZone = inject(NgZone);\n private _viewportRuler = inject(ViewportRuler);\n private _dragDropRegistry = inject(DragDropRegistry);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag<T = any>(\n element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG,\n ): DragRef<T> {\n return new DragRef<T>(\n element,\n config,\n this._document,\n this._ngZone,\n this._viewportRuler,\n this._dragDropRegistry,\n this._renderer,\n );\n }\n\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T> {\n return new DropListRef<T>(\n element,\n this._dragDropRegistry,\n this._document,\n this._ngZone,\n this._viewportRuler,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport type {CdkDrag} from './directives/drag';\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nexport const CDK_DRAG_PARENT = new InjectionToken<CdkDrag>('CDK_DRAG_PARENT');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Asserts that a particular node is an element.\n * @param node Node to be checked.\n * @param name Name to attach to the error message.\n */\nexport function assertElementNode(node: Node, name: string): asserts node is HTMLElement {\n if (node.nodeType !== 1) {\n throw Error(\n `${name} must be attached to an element node. ` + `Currently attached to \"${node.nodeName}\".`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n AfterViewInit,\n Directive,\n ElementRef,\n InjectionToken,\n Input,\n OnDestroy,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport type {CdkDrag} from './drag';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {assertElementNode} from './assertions';\nimport {DragDropRegistry} from '../drag-drop-registry';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as\n * alternative token to the actual `CdkDragHandle` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_HANDLE = new InjectionToken<CdkDragHandle>('CdkDragHandle');\n\n/** Handle that can be used to drag a CdkDrag instance. */\n@Directive({\n selector: '[cdkDragHandle]',\n host: {\n 'class': 'cdk-drag-handle',\n },\n providers: [{provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle}],\n})\nexport class CdkDragHandle implements AfterViewInit, OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private _parentDrag = inject<CdkDrag>(CDK_DRAG_PARENT, {optional: true, skipSelf: true});\n private _dragDropRegistry = inject(DragDropRegistry);\n\n /** Emits when the state of the handle has changed. */\n readonly _stateChanges = new Subject<CdkDragHandle>();\n\n /** Whether starting to drag through this handle is disabled. */\n @Input({alias: 'cdkDragHandleDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = value;\n this._stateChanges.next(this);\n }\n private _disabled = false;\n\n constructor(...args: unknown[]);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(this.element.nativeElement, 'cdkDragHandle');\n }\n\n this._parentDrag?._addHandle(this);\n }\n\n ngAfterViewInit() {\n if (!this._parentDrag) {\n let parent = this.element.nativeElement.parentElement;\n while (parent) {\n const ref = this._dragDropRegistry.getDragDirectiveForNode(parent);\n if (ref) {\n this._parentDrag = ref;\n ref._addHandle(this);\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n ngOnDestroy() {\n this._parentDrag?._removeHandle(this);\n this._stateChanges.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {DragRefConfig, DragConstrainPosition} from '../drag-ref';\n\n/** Possible values that can be used to configure the drag start delay. */\nexport type DragStartDelay = number | {touch: number; mouse: number};\n\n/** Possible axis along which dragging can be locked. */\nexport type DragAxis = 'x' | 'y';\n\n/** Possible orientations for a drop list. */\nexport type DropListOrientation = 'horizontal' | 'vertical' | 'mixed';\n\n/**\n * Injection token that can be used to configure the\n * behavior of the drag&drop-related components.\n */\nexport const CDK_DRAG_CONFIG = new InjectionToken<DragDropConfig>('CDK_DRAG_CONFIG');\n\n/**\n * Object that can be used to configure the drag\n * items and drop lists within a module or a component.\n */\nexport interface DragDropConfig extends Partial<DragRefConfig> {\n lockAxis?: DragAxis | null;\n dragStartDelay?: DragStartDelay;\n constrainPosition?: DragConstrainPosition;\n previewClass?: string | string[];\n boundaryElement?: string;\n rootElementSelector?: string;\n draggingDisabled?: boolean;\n sortingDisabled?: boolean;\n listAutoScrollDisabled?: boolean;\n listOrientation?: DropListOrientation;\n zIndex?: number;\n previewContainer?: 'global' | 'parent';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directionality} from '../../bidi';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewContainerRef,\n OnChanges,\n SimpleChanges,\n ChangeDetectorRef,\n InjectionToken,\n booleanAttribute,\n afterNextRender,\n AfterViewInit,\n inject,\n Injector,\n numberAttribute,\n} from '@angular/core';\nimport {coerceElement, coerceNumberProperty} from '../../coercion';\nimport {BehaviorSubject, Observable, Observer, Subject, merge} from 'rxjs';\nimport {startWith, take, map, takeUntil, switchMap, tap} from 'rxjs/operators';\nimport type {\n CdkDragDrop,\n CdkDragEnd,\n CdkDragEnter,\n CdkDragExit,\n CdkDragMove,\n CdkDragStart,\n CdkDragRelease,\n} from '../drag-events';\nimport {CDK_DRAG_HANDLE, CdkDragHandle} from './drag-handle';\nimport {CdkDragPlaceholder} from './drag-placeholder';\nimport {CdkDragPreview} from './drag-preview';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, Point, PreviewContainer, DragConstrainPosition} from '../drag-ref';\nimport type {CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\nimport {CDK_DRAG_CONFIG, DragDropConfig, DragStartDelay, DragAxis} from './config';\nimport {assertElementNode} from './assertions';\nimport {DragDropRegistry} from '../drag-drop-registry';\n\n/**\n * Injection token that can be used to reference instances of `CdkDropList`. It serves as\n * alternative token to the actual `CdkDropList` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DROP_LIST = new InjectionToken<CdkDropList>('CdkDropList');\n\n/** Element that can be moved inside a CdkDropList container. */\n@Directive({\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n host: {\n 'class': 'cdk-drag',\n '[class.cdk-drag-disabled]': 'disabled',\n '[class.cdk-drag-dragging]': '_dragRef.isDragging()',\n },\n providers: [{provide: CDK_DRAG_PARENT, useExisting: CdkDrag}],\n})\nexport class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n dropContainer = inject<CdkDropList>(CDK_DROP_LIST, {optional: true, skipSelf: true})!;\n private _ngZone = inject(NgZone);\n private _viewContainerRef = inject(ViewContainerRef);\n private _dir = inject(Directionality, {optional: true});\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _selfHandle = inject<CdkDragHandle>(CDK_DRAG_HANDLE, {optional: true, self: true});\n private _parentDrag = inject<CdkDrag>(CDK_DRAG_PARENT, {optional: true, skipSelf: true});\n private _dragDropRegistry = inject(DragDropRegistry);\n\n private readonly _destroyed = new Subject<void>();\n private _handles = new BehaviorSubject<CdkDragHandle[]>([]);\n private _previewTemplate: CdkDragPreview | null;\n private _placeholderTemplate: CdkDragPlaceholder | null;\n\n /** Reference to the underlying drag instance. */\n _dragRef: DragRef<CdkDrag<T>>;\n\n /** Arbitrary data to attach to this drag instance. */\n @Input('cdkDragData') data: T;\n\n /** Locks the position of the dragged element along the specified axis. */\n @Input('cdkDragLockAxis') lockAxis: DragAxis | null = null;\n\n /**\n * Selector that will be used to determine the root draggable element, starting from\n * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful\n * when trying to enable dragging on an element that you might not have access to.\n */\n @Input('cdkDragRootElement') rootElementSelector: string;\n\n /**\n * Node or selector that will be used to determine the element to which the draggable's\n * position will be constrained. If a string is passed in, it'll be used as a selector that\n * will be matched starting from the element's parent and going up the DOM until a match\n * has been found.\n */\n @Input('cdkDragBoundary') boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n @Input('cdkDragStartDelay') dragStartDelay: DragStartDelay;\n\n /**\n * Sets the position of a `CdkDrag` that is outside of a drop container.\n * Can be used to restore the element's position for a returning user.\n */\n @Input('cdkDragFreeDragPosition') freeDragPosition: Point;\n\n /** Whether starting to drag this element is disabled. */\n @Input({alias: 'cdkDragDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled || !!(this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value: boolean) {\n this._disabled = value;\n this._dragRef.disabled = this._disabled;\n }\n private _disabled: boolean;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page, a reference to the item being dragged and its dimensions.\n * Should return a point describing where the item should be rendered.\n */\n @Input('cdkDragConstrainPosition') constrainPosition?: DragConstrainPosition;\n\n /** Class to be added to the preview element. */\n @Input('cdkDragPreviewClass') previewClass: string | string[];\n\n /**\n * Configures the place into which the preview of the item will be inserted. Can be configured\n * globally through `CDK_DROP_LIST`. Possible values:\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */\n @Input('cdkDragPreviewContainer') previewContainer: PreviewContainer;\n\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n @Input({alias: 'cdkDragScale', transform: numberAttribute})\n scale: number = 1;\n\n /** Emits when the user starts dragging the item. */\n @Output('cdkDragStarted') readonly started: EventEmitter<CdkDragStart> =\n new EventEmitter<CdkDragStart>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n @Output('cdkDragReleased') readonly released: EventEmitter<CdkDragRelease> =\n new EventEmitter<CdkDragRelease>();\n\n /** Emits when the user stops dragging an item in the container. */\n @Output('cdkDragEnded') readonly ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();\n\n /** Emits when the user has moved the item into a new container. */\n @Output('cdkDragEntered') readonly entered: EventEmitter<CdkDragEnter<any>> = new EventEmitter<\n CdkDragEnter<any>\n >();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n @Output('cdkDragExited') readonly exited: EventEmitter<CdkDragExit<any>> = new EventEmitter<\n CdkDragExit<any>\n >();\n\n /** Emits when the user drops the item inside a container. */\n @Output('cdkDragDropped') readonly dropped: EventEmitter<CdkDragDrop<any>> = new EventEmitter<\n CdkDragDrop<any>\n >();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n @Output('cdkDragMoved')\n readonly moved: Observable<CdkDragMove<T>> = new Observable(\n (observer: Observer<CdkDragMove<T>>) => {\n const subscription = this._dragRef.moved\n .pipe(\n map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance,\n })),\n )\n .subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n },\n );\n\n private _injector = inject(Injector);\n\n constructor(...args: unknown[]);\n\n constructor() {\n const dropContainer = this.dropContainer;\n const config = inject<DragDropConfig>(CDK_DRAG_CONFIG, {optional: true});\n const dragDrop = inject(DragDrop);\n\n this._dragRef = dragDrop.createDrag(this.element, {\n dragStartThreshold:\n config && config.dragStartThreshold != null ? config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold:\n config && config.pointerDirectionChangeThreshold != null\n ? config.pointerDirectionChangeThreshold\n : 5,\n zIndex: config?.zIndex,\n });\n this._dragRef.data = this;\n this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement, this);\n\n if (config) {\n this._assignDefaults(config);\n }\n\n // Note that usually the container is assigned when the drop list is picks up the item, but in\n // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation\n // where there are no items on the first change detection pass, but the items get picked up as\n // soon as the user triggers another pass by dragging. This is a problem, because the item would\n // have to switch from standalone mode to drag mode in the middle of the dragging sequence which\n // is too late since the two modes save different kinds of information. We work around it by\n // assigning the drop container both from here and the list.\n if (dropContainer) {\n dropContainer.addItem(this);\n\n // The drop container reads this so we need to sync it here.\n dropContainer._dropListRef.beforeStarted.pipe(takeUntil(this._destroyed)).subscribe(() => {\n this._dragRef.scale = this.scale;\n });\n }\n\n this._syncInputs(this._dragRef);\n this._handleEvents(this._dragRef);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._dragRef.getPlaceholderElement();\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._dragRef.getRootElement();\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._dragRef.reset();\n }\n\n /** Resets drag item to end of boundary element. */\n resetToBoundary() {\n this._dragRef.resetToBoundary();\n }\n\n /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n return this._dragRef.getFreeDragPosition();\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): void {\n this._dragRef.setFreeDragPosition(value);\n }\n\n ngAfterViewInit() {\n // We need to wait until after render, in order for the reference\n // element to be in the proper place in the DOM. This is mostly relevant\n // for draggable elements inside portals since they get stamped out in\n // their original DOM position, and then they get transferred to the portal.\n afterNextRender(\n () => {\n this._updateRootElement();\n this._setupHandlesListener();\n this._dragRef.scale = this.scale;\n\n if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n },\n {injector: this._injector},\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const rootSelectorChange = changes['rootElementSelector'];\n const positionChange = changes['freeDragPosition'];\n\n // We don't have to react to the first change since it's being\n // handled in the `afterNextRender` queued up in the constructor.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n\n // Scale affects the free drag position so we need to sync it up here.\n this._dragRef.scale = this.scale;\n\n // Skip the first change since it's being handled in the `afterNextRender` queued up in the\n // constructor.\n if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }\n\n ngOnDestroy() {\n if (this.dropContainer) {\n this.dropContainer.removeItem(this);\n }\n\n this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement);\n\n // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`.\n this._ngZone.runOutsideAngular(() => {\n this._handles.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n });\n }\n\n _addHandle(handle: CdkDragHandle) {\n const handles = this._handles.getValue();\n handles.push(handle);\n this._handles.next(handles);\n }\n\n _removeHandle(handle: CdkDragHandle) {\n const handles = this._handles.getValue();\n const index = handles.indexOf(handle);\n\n if (index > -1) {\n handles.splice(index, 1);\n this._handles.next(handles);\n }\n }\n\n _setPreviewTemplate(preview: CdkDragPreview) {\n this._previewTemplate = preview;\n }\n\n _resetPreviewTemplate(preview: CdkDragPreview) {\n if (preview === this._previewTemplate) {\n this._previewTemplate = null;\n }\n }\n\n _setPlaceholderTemplate(placeholder: CdkDragPlaceholder) {\n this._placeholderTemplate = placeholder;\n }\n\n _resetPlaceholderTemplate(placeholder: CdkDragPlaceholder) {\n if (placeholder === this._placeholderTemplate) {\n this._placeholderTemplate = null;\n }\n }\n\n /** Syncs the root element with the `DragRef`. */\n private _updateRootElement() {\n const element = this.element.nativeElement as HTMLElement;\n let rootElement = element;\n if (this.rootElementSelector) {\n rootElement =\n element.closest !== undefined\n ? (element.closest(this.rootElementSelector) as HTMLElement)\n : // Comment tag doesn't have closest method, so use parent's one.\n (element.parentElement?.closest(this.rootElementSelector) as HTMLElement);\n }\n\n if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n assertElementNode(rootElement, 'cdkDrag');\n }\n\n this._dragRef.withRootElement(rootElement || element);\n }\n\n /** Gets the boundary element, based on the `boundaryElement` value. */\n private _getBoundaryElement() {\n const boundary = this.boundaryElement;\n\n if (!boundary) {\n return null;\n }\n\n if (typeof boundary === 'string') {\n return this.element.nativeElement.closest<HTMLElement>(boundary);\n }\n\n return coerceElement(boundary);\n }\n\n /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */\n private _syncInputs(ref: DragRef<CdkDrag<T>>) {\n ref.beforeStarted.subscribe(() => {\n if (!ref.isDragging()) {\n const dir = this._dir;\n const dragStartDelay = this.dragStartDelay;\n const placeholder = this._placeholderTemplate\n ? {\n template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef,\n }\n : null;\n const preview = this._previewTemplate\n ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef,\n }\n : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.scale = this.scale;\n ref.dragStartDelay =\n typeof dragStartDelay === 'object' && dragStartDelay\n ? dragStartDelay\n : coerceNumberProperty(dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\n ref.previewClass = this.previewClass;\n ref\n .withBoundaryElement(this._getBoundaryElement())\n .withPlaceholderTemplate(placeholder)\n .withPreviewTemplate(preview)\n .withPreviewContainer(this.previewContainer || 'global');\n\n if (dir) {\n ref.withDirection(dir.value);\n }\n }\n });\n\n // This only needs to be resolved once.\n ref.beforeStarted.pipe(take(1)).subscribe(() => {\n // If we managed to resolve a parent through DI, use it.\n if (this._parentDrag) {\n ref.withParent(this._parentDrag._dragRef);\n return;\n }\n\n // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if\n // the item was projected into another item by something like `ngTemplateOutlet`.\n let parent = this.element.nativeElement.parentElement;\n while (parent) {\n const parentDrag = this._dragDropRegistry.getDragDirectiveForNode(parent);\n if (parentDrag) {\n ref.withParent(parentDrag._dragRef);\n break;\n }\n parent = parent.parentElement;\n }\n });\n }\n\n /** Handles the events from the underlying `DragRef`. */\n private _handleEvents(ref: DragRef<CdkDrag<T>>) {\n ref.started.subscribe(startEvent => {\n this.started.emit({source: this, event: startEvent.event});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.released.subscribe(releaseEvent => {\n this.released.emit({source: this, event: releaseEvent.event});\n });\n\n ref.ended.subscribe(endEvent => {\n this.ended.emit({\n source: this,\n distance: endEvent.distance,\n dropPoint: endEvent.dropPoint,\n event: endEvent.event,\n });\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(enterEvent => {\n this.entered.emit({\n container: enterEvent.container.data,\n item: this,\n currentIndex: enterEvent.currentIndex,\n });\n });\n\n ref.exited.subscribe(exitEvent => {\n this.exited.emit({\n container: exitEvent.container.data,\n item: this,\n });\n });\n\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n item: this,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis,\n dragStartDelay,\n constrainPosition,\n previewClass,\n boundaryElement,\n draggingDisabled,\n rootElementSelector,\n previewContainer,\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n this.lockAxis = lockAxis || null;\n\n if (constrainPosition) {\n this.constrainPosition = constrainPosition;\n }\n\n if (previewClass) {\n this.previewClass = previewClass;\n }\n\n if (boundaryElement) {\n this.boundaryElement = boundaryElement;\n }\n\n if (rootElementSelector) {\n this.rootElementSelector = rootElementSelector;\n }\n\n if (previewContainer) {\n this.previewContainer = previewContainer;\n }\n }\n\n /** Sets up the listener that syncs the handles with the drag ref. */\n private _setupHandlesListener() {\n // Listen for any newly-added handles.\n this._handles\n .pipe(\n // Sync the new handles with the DragRef.\n tap(handles => {\n const handleElements = handles.map(handle => handle.element);\n\n // Usually handles are only allowed to be a descendant of the drag element, but if\n // the consumer defined a different drag root, we should allow the drag element\n // itself to be a handle too.\n if (this._selfHandle && this.rootElementSelector) {\n handleElements.push(this.element);\n }\n\n this._dragRef.withHandles(handleElements);\n }),\n // Listen if the state of any of the handles changes.\n switchMap((handles: CdkDragHandle[]) => {\n return merge(\n ...handles.map(item => item._stateChanges.pipe(startWith(item))),\n ) as Observable<CdkDragHandle>;\n }),\n takeUntil(this._destroyed),\n )\n .subscribe(handleInstance => {\n // Enabled/disable the handle that changed in the DragRef.\n const dragRef = this._dragRef;\n const handle = handleInstance.element.nativeElement;\n handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, OnDestroy, Input, InjectionToken, booleanAttribute} from '@angular/core';\n\n/**\n * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as\n * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DROP_LIST_GROUP = new InjectionToken<CdkDropListGroup<unknown>>(\n 'CdkDropListGroup',\n);\n\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n */\n@Directive({\n selector: '[cdkDropListGroup]',\n exportAs: 'cdkDropListGroup',\n providers: [{provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup}],\n})\nexport class CdkDropListGroup<T> implements OnDestroy {\n /** Drop lists registered inside the group. */\n readonly _items = new Set<T>();\n\n /** Whether starting a dragging sequence from inside this group is disabled. */\n @Input({alias: 'cdkDropListGroupDisabled', transform: booleanAttribute})\n disabled: boolean = false;\n\n ngOnDestroy() {\n this._items.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NumberInput, coerceArray, coerceNumberProperty} from '../../coercion';\nimport {\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Directive,\n ChangeDetectorRef,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {Directionality} from '../../bidi';\nimport {_IdGenerator} from '../../a11y';\nimport {ScrollDispatcher} from '../../scrolling';\nimport {CDK_DROP_LIST, CdkDrag} from './drag';\nimport {CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent} from '../drag-events';\nimport {CDK_DROP_LIST_GROUP, CdkDropListGroup} from './drop-list-group';\nimport {DropListRef} from '../drop-list-ref';\nimport {DragRef} from '../drag-ref';\nimport {DragDrop} from '../drag-drop';\nimport {DropListOrientation, DragAxis, DragDropConfig, CDK_DRAG_CONFIG} from './config';\nimport {merge, Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {assertElementNode} from './assertions';\n\n/** Container that wraps a set of draggable items. */\n@Directive({\n selector: '[cdkDropList], cdk-drop-list',\n exportAs: 'cdkDropList',\n providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n {provide: CDK_DROP_LIST_GROUP, useValue: undefined},\n {provide: CDK_DROP_LIST, useExisting: CdkDropList},\n ],\n host: {\n 'class': 'cdk-drop-list',\n '[attr.id]': 'id',\n '[class.cdk-drop-list-disabled]': 'disabled',\n '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',\n },\n})\nexport class CdkDropList<T = any> implements OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _scrollDispatcher = inject(ScrollDispatcher);\n private _dir = inject(Directionality, {optional: true});\n private _group = inject<CdkDropListGroup<CdkDropList>>(CDK_DROP_LIST_GROUP, {\n optional: true,\n skipSelf: true,\n });\n\n /** Refs that have been synced with the drop ref most recently. */\n private _latestSortedRefs: DragRef[] | undefined;\n\n /** Emits when the list has been destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n /** Whether the element's scrollable parents have been resolved. */\n private _scrollableParentsResolved: boolean;\n\n /** Keeps track of the drop lists that are currently on the page. */\n private static _dropLists: CdkDropList[] = [];\n\n /** Reference to the underlying drop list instance. */\n _dropListRef: DropListRef<CdkDropList<T>>;\n\n /**\n * Other draggable containers that this container is connected to and into which the\n * container's items can be transferred. Can either be references to other drop containers,\n * or their unique IDs.\n */\n @Input('cdkDropListConnectedTo')\n connectedTo: (CdkDropList | string)[] | CdkDropList | string = [];\n\n /** Arbitrary data to attach to this container. */\n @Input('cdkDropListData') data: T;\n\n /** Direction in which the list is oriented. */\n @Input('cdkDropListOrientation') orientation: DropListOrientation;\n\n /**\n * Unique ID for the drop zone. Can be used as a reference\n * in the `connectedTo` of another `CdkDropList`.\n */\n @Input() id: string = inject(_IdGenerator).getId('cdk-drop-list-');\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n @Input('cdkDropListLockAxis') lockAxis: DragAxis | null = null;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n @Input({alias: 'cdkDropListDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled || (!!this._group && this._group.disabled);\n }\n set disabled(value: boolean) {\n // Usually we sync the directive and ref state right before dragging starts, in order to have\n // a single point of failure and to avoid having to use setters for everything. `disabled` is\n // a special case, because it can prevent the `beforeStarted` event from firing, which can lock\n // the user in a disabled state, so we also need to sync it as it's being set.\n this._dropListRef.disabled = this._disabled = value;\n }\n private _disabled: boolean;\n\n /** Whether sorting within this drop list is disabled. */\n @Input({alias: 'cdkDropListSortingDisabled', transform: booleanAttribute})\n sortingDisabled: boolean;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n @Input('cdkDropListEnterPredicate')\n enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean = () => true;\n\n /** Functions that is used to determine whether an item can be sorted into a particular index. */\n @Input('cdkDropListSortPredicate')\n sortPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean = () => true;\n\n /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */\n @Input({alias: 'cdkDropListAutoScrollDisabled', transform: booleanAttribute})\n autoScrollDisabled: boolean;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n @Input('cdkDropListAutoScrollStep')\n autoScrollStep: NumberInput;\n\n /**\n * Selector that will be used to resolve an alternate element container for the drop list.\n * Passing an alternate container is useful for the cases where one might not have control\n * over the parent node of the draggable items within the list (e.g. due to content projection).\n * This allows for usages like:\n *\n * ```\n * <div cdkDropList cdkDropListElementContainer=\".inner\">\n * <div class=\"inner\">\n * <div cdkDrag></div>\n * </div>\n * </div>\n * ```\n */\n @Input('cdkDropListElementContainer') elementContainerSelector: string | null;\n\n /**\n * By default when an item leaves its initial container, its placeholder will be transferred\n * to the new container. If that's not desirable for your use case, you can enable this option\n * which will clone the placeholder and leave it inside the original container. If the item is\n * returned to the initial container, the anchor element will be removed automatically.\n *\n * The cloned placeholder can be styled by targeting the `cdk-drag-anchor` class.\n *\n * This option is useful in combination with `cdkDropListSortingDisabled` to implement copying\n * behavior in a drop list.\n */\n @Input({alias: 'cdkDropListHasAnchor', transform: booleanAttribute})\n hasAnchor: boolean;\n\n /** Emits when the user drops an item inside the container. */\n @Output('cdkDropListDropped')\n readonly dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n @Output('cdkDropListEntered')\n readonly entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n @Output('cdkDropListExited')\n readonly exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();\n\n /** Emits as the user is swapping items while actively dragging. */\n @Output('cdkDropListSorted')\n readonly sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();\n\n /**\n * Keeps track of the items that are registered with this container. Historically we used to\n * do this with a `ContentChildren` query, however queries don't handle transplanted views very\n * well which means that we can't handle cases like dragging the headers of a `mat-table`\n * correctly. What we do instead is to have the items register themselves with the container\n * and then we sort them based on their position in the DOM.\n */\n private _unsortedItems = new Set<CdkDrag>();\n\n constructor(...args: unknown[]);\n\n constructor() {\n const dragDrop = inject(DragDrop);\n const config = inject<DragDropConfig>(CDK_DRAG_CONFIG, {optional: true});\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(this.element.nativeElement, 'cdkDropList');\n }\n\n this._dropListRef = dragDrop.createDropList(this.element);\n this._dropListRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n\n this._dropListRef.sortPredicate = (\n index: number,\n drag: DragRef<CdkDrag>,\n drop: DropListRef<CdkDropList>,\n ) => {\n return this.sortPredicate(index, drag.data, drop.data);\n };\n\n this._setupInputSyncSubscription(this._dropListRef);\n this._handleEvents(this._dropListRef);\n CdkDropList._dropLists.push(this);\n\n if (this._group) {\n this._group._items.add(this);\n }\n }\n\n /** Registers an items with the drop list. */\n addItem(item: CdkDrag): void {\n this._unsortedItems.add(item);\n item._dragRef._withDropContainer(this._dropListRef);\n\n // Only sync the items while dragging since this method is\n // called when items are being initialized one-by-one.\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef));\n }\n }\n\n /** Removes an item from the drop list. */\n removeItem(item: CdkDrag): void {\n this._unsortedItems.delete(item);\n\n // This method might be called on destroy so we always want to sync with the ref.\n // Note that we reuse the last set of synced items, rather than re-sorting the whole\n // list, because it can slow down re-renders of large lists (see #30737).\n if (this._latestSortedRefs) {\n const index = this._latestSortedRefs.indexOf(item._dragRef);\n\n if (index > -1) {\n this._latestSortedRefs.splice(index, 1);\n this._syncItemsWithRef(this._latestSortedRefs);\n }\n }\n }\n\n /** Gets the registered items in the list, sorted by their position in the DOM. */\n getSortedItems(): CdkDrag[] {\n return Array.from(this._unsortedItems).sort((a: CdkDrag, b: CdkDrag) => {\n const documentPosition = a._dragRef\n .getVisibleElement()\n .compareDocumentPosition(b._dragRef.getVisibleElement());\n\n // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n // tslint:disable-next-line:no-bitwise\n return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n }\n\n ngOnDestroy() {\n const index = CdkDropList._dropLists.indexOf(this);\n\n if (index > -1) {\n CdkDropList._dropLists.splice(index, 1);\n }\n\n if (this._group) {\n this._group._items.delete(this);\n }\n\n this._latestSortedRefs = undefined;\n this._unsortedItems.clear();\n this._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n private _setupInputSyncSubscription(ref: DropListRef<CdkDropList>) {\n if (this._dir) {\n this._dir.change\n .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n .subscribe(value => ref.withDirection(value));\n }\n\n ref.beforeStarted.subscribe(() => {\n const siblings = coerceArray(this.connectedTo).map(drop => {\n if (typeof drop === 'string') {\n const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop);\n\n if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n console.warn(`CdkDropList could not find connected drop list with id \"${drop}\"`);\n }\n\n return correspondingDropList!;\n }\n\n return drop;\n });\n\n if (this._group) {\n this._group._items.forEach(drop => {\n if (siblings.indexOf(drop) === -1) {\n siblings.push(drop);\n }\n });\n }\n\n // Note that we resolve the scrollable parents here so that we delay the resolution\n // as long as possible, ensuring that the element is in its final place in the DOM.\n if (!this._scrollableParentsResolved) {\n const scrollableParents = this._scrollDispatcher\n .getAncestorScrollContainers(this.element)\n .map(scrollable => scrollable.getElementRef().nativeElement);\n this._dropListRef.withScrollableParents(scrollableParents);\n\n // Only do this once since it involves traversing the DOM and the parents\n // shouldn't be able to change without the drop list being destroyed.\n this._scrollableParentsResolved = true;\n }\n\n if (this.elementContainerSelector) {\n const container = this.element.nativeElement.querySelector(this.elementContainerSelector);\n\n if (!container && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error(\n `CdkDropList could not find an element container matching the selector \"${this.elementContainerSelector}\"`,\n );\n }\n\n ref.withElementContainer(container as HTMLElement);\n }\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = this.sortingDisabled;\n ref.autoScrollDisabled = this.autoScrollDisabled;\n ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);\n ref.hasAnchor = this.hasAnchor;\n ref\n .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))\n .withOrientation(this.orientation);\n });\n }\n\n /** Handles events from the underlying DropListRef. */\n private _handleEvents(ref: DropListRef<CdkDropList>) {\n ref.beforeStarted.subscribe(() => {\n this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef));\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: this,\n item: event.item.data,\n currentIndex: event.currentIndex,\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: this,\n item: event.item.data,\n });\n this._changeDetectorRef.markForCheck();\n });\n\n ref.sorted.subscribe(event => {\n this.sorted.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n container: this,\n item: event.item.data,\n });\n });\n\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n item: dropEvent.item.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n\n // Mark for check since all of these events run outside of change\n // detection and we're not guaranteed for something else to have triggered it.\n this._changeDetectorRef.markForCheck();\n });\n\n merge(ref.receivingStarted, ref.receivingStopped).subscribe(() =>\n this._changeDetectorRef.markForCheck(),\n );\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation} =\n config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;\n this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;\n this.orientation = listOrientation || 'vertical';\n this.lockAxis = lockAxis || null;\n }\n\n /** Syncs up the registered drag items with underlying drop list ref. */\n private _syncItemsWithRef(items: DragRef[]) {\n this._latestSortedRefs = items;\n this._dropListRef.withItems(items);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n InjectionToken,\n Input,\n OnDestroy,\n TemplateRef,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as\n * alternative token to the actual `CdkDragPreview` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_PREVIEW = new InjectionToken<CdkDragPreview>('CdkDragPreview');\n\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPreview]',\n providers: [{provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview}],\n})\nexport class CdkDragPreview<T = any> implements OnDestroy {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n private _drag = inject(CDK_DRAG_PARENT, {optional: true});\n\n /** Context data to be added to the preview template instance. */\n @Input() data: T;\n\n /** Whether the preview should preserve the same size as the item that is being dragged. */\n @Input({transform: booleanAttribute}) matchSize: boolean = false;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._drag?._setPreviewTemplate(this);\n }\n\n ngOnDestroy(): void {\n this._drag?._resetPreviewTemplate(this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, TemplateRef, Input, InjectionToken, inject, OnDestroy} from '@angular/core';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as\n * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_PLACEHOLDER = new InjectionToken<CdkDragPlaceholder>('CdkDragPlaceholder');\n\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPlaceholder]',\n providers: [{provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder}],\n})\nexport class CdkDragPlaceholder<T = any> implements OnDestroy {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n private _drag = inject(CDK_DRAG_PARENT, {optional: true});\n\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._drag?._setPlaceholderTemplate(this);\n }\n\n ngOnDestroy(): void {\n this._drag?._resetPlaceholderTemplate(this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkScrollableModule} from '../scrolling';\nimport {CdkDropList} from './directives/drop-list';\nimport {CdkDropListGroup} from './directives/drop-list-group';\nimport {CdkDrag} from './directives/drag';\nimport {CdkDragHandle} from './directives/drag-handle';\nimport {CdkDragPreview} from './directives/drag-preview';\nimport {CdkDragPlaceholder} from './directives/drag-placeholder';\nimport {DragDrop} from './drag-drop';\n\nconst DRAG_DROP_DIRECTIVES = [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n];\n\n@NgModule({\n imports: DRAG_DROP_DIRECTIVES,\n exports: [CdkScrollableModule, ...DRAG_DROP_DIRECTIVES],\n providers: [DragDrop],\n})\nexport class DragDropModule {}\n\n// Re-export needed by the Angular compiler.\n// See: https://github.com/angular/components/issues/30663.\n// Note: These exports need to be stable and shouldn't be renamed unnecessarily because\n// consuming libraries might have references to them in their own partial compilation output.\nexport {CdkScrollable as ɵɵCdkScrollable} from '../scrolling';\n"],"names":["deepCloneNode","node","clone","cloneNode","descendantsWithId","querySelectorAll","nodeName","toLowerCase","removeAttribute","i","length","transferCanvasData","transferInputData","transferData","selector","callback","descendantElements","cloneElements","cloneUniqueId","source","type","value","name","context","getContext","drawImage","getMutableClientRect","element","rect","getBoundingClientRect","top","right","bottom","left","width","height","x","y","isInsideClientRect","clientRect","isOverflowingParent","parentRect","childRect","isLeftOverflowing","isRightOverflowing","isTopOverflowing","isBottomOverflowing","adjustDomRect","domRect","isPointerNearDomRect","threshold","pointerX","pointerY","xThreshold","yThreshold","ParentPositionTracker","_document","positions","Map","constructor","clear","cache","elements","set","scrollPosition","getViewportScrollPosition","forEach","scrollTop","scrollLeft","handleScroll","event","target","_getEventTarget","cachedPosition","get","newTop","newLeft","viewportScrollPosition","topDifference","leftDifference","position","contains","window","scrollY","scrollX","getRootNode","viewRef","rootNodes","nodeType","ELEMENT_NODE","wrapper","createElement","appendChild","extendStyles","dest","importantProperties","key","hasOwnProperty","setProperty","has","removeProperty","toggleNativeDragInteractions","enable","userSelect","style","toggleVisibility","opacity","combineTransforms","transform","initialTransform","matchElementSize","sourceRect","getTransform","Math","round","parseCssTimeUnitsToMs","multiplier","indexOf","parseFloat","getTransformTransitionDurationInMs","computedStyle","getComputedStyle","transitionedProperties","parseCssPropertyValue","property","find","prop","propertyIndex","rawDurations","rawDelays","getPropertyValue","split","map","part","trim","Set","PreviewRef","_rootElement","_direction","_initialDomRect","_previewTemplate","_previewClass","_pickupPositionOnPage","_initialTransform","_zIndex","_renderer","_previewEmbeddedView","_preview","attach","parent","_createPreview","supportsPopover","destroy","remove","setTransform","addClass","className","classList","add","getTransitionDuration","addEventListener","handler","listen","previewConfig","previewClass","previewTemplate","template","preview","rootRect","matchSize","viewContainer","createEmbeddedView","detectChanges","setAttribute","Array","isArray","passiveEventListenerOptions","passive","activeEventListenerOptions","activeCapturingEventOptions","capture","MOUSE_EVENT_IGNORE_TIME","PLACEHOLDER_CLASS","dragImportantProperties","DragRef","_config","_ngZone","_viewportRuler","_dragDropRegistry","_rootElementCleanups","_cleanupShadowRootSelectStart","_previewContainer","_placeholderRef","_placeholder","_pickupPositionInElement","_marker","_anchor","_passiveTransform","_activeTransform","_hasStartedDragging","signal","_hasMoved","_initialContainer","_initialIndex","_parentPositions","_moveEvents","Subject","_pointerDirectionDelta","_pointerPositionAtLastDirectionChange","_lastKnownPointerPosition","_ownerSVGElement","_rootElementTapHighlight","_pointerMoveSubscription","Subscription","EMPTY","_pointerUpSubscription","_scrollSubscription","_resizeSubscription","_lastTouchEventTime","_dragStartTime","_boundaryElement","_nativeInteractionsEnabled","_previewRect","_boundaryRect","_placeholderTemplate","_handles","_disabledHandles","_dropContainer","_parentDragRef","_cachedShadowRoot","lockAxis","dragStartDelay","scale","disabled","_disabled","_toggleNativeDragInteractions","handle","beforeStarted","started","released","ended","entered","exited","dropped","moved","data","constrainPosition","withRootElement","withParent","parentDragRef","registerDragItem","getPlaceholderElement","getRootElement","getVisibleElement","isDragging","withHandles","handles","coerceElement","disabledHandles","withPreviewTemplate","withPlaceholderTemplate","rootElement","_removeRootElementListeners","renderer","runOutsideAngular","_pointerDown","_nativeDragStart","undefined","SVGElement","ownerSVGElement","withBoundaryElement","boundaryElement","unsubscribe","change","subscribe","_containInsideBoundaryOnResize","dispose","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeListeners","complete","reset","resetToBoundary","offsetX","offsetY","currentLeft","currentTop","disableHandle","enableHandle","delete","withDirection","direction","_withDropContainer","container","getFreeDragPosition","setFreeDragPosition","_applyRootElementTransform","withPreviewContainer","_sortFromLastPointerPosition","_updateActiveDropContainer","_getConstrainedPointerPosition","next","targetHandle","_getTargetHandle","_initializeDragSequence","_pointerMove","pointerPosition","_getPointerPositionOnPage","distanceX","abs","distanceY","isOverThreshold","dragStartThreshold","isDelayElapsed","Date","now","_getDragStartDelay","_endDragSequence","isReceiving","cancelable","preventDefault","run","_startDragSequence","constrainedPointerPosition","_updatePointerDirectionDelta","offset","activeTransform","observers","distance","_getDragDistance","delta","_pointerUp","stopDragging","webkitTapHighlightColor","_stopScrolling","_animatePreviewToPlaceholder","then","_cleanupDragArtifacts","_cleanupCachedDimensions","dropPoint","isTouchEvent","shadowRoot","_getShadowRoot","dropContainer","shadowDomSelectStart","parentNode","placeholder","_createPlaceholderElement","marker","createComment","ngDevMode","insertBefore","zIndex","_getPreviewInsertionPoint","body","replaceChild","start","getItemIndex","getScrollableParents","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","isFakeEvent","isFakeTouchstartFromScreenReader","isFakeMousedownFromScreenReader","draggable","rootStyles","pointerMove","pointerUp","scrolled","scrollEvent","_updateOnScroll","_getPointerPositionInElement","startDragging","currentIndex","isPointerOverContainer","_isOverContainer","item","previousIndex","previousContainer","drop","rawX","rawY","newContainer","_getSiblingContainerFromPosition","exitIndex","nextItemElement","getItemAtIndex","exit","_conditionallyInsertAnchor","enter","sortingDisabled","_startScrollingIfNecessary","_sortItem","_applyPreviewTransform","Promise","resolve","placeholderRect","duration","propertyName","cleanupListener","clearTimeout","timeout","setTimeout","placeholderConfig","placeholderTemplate","pointerEvents","elementRect","handleElement","referenceRect","point","targetTouches","_getViewportScrollPosition","pageX","pageY","touches","changedTouches","svgMatrix","getScreenCTM","svgPoint","createSVGPoint","matrixTransform","inverse","dropContainerLock","pickupX","pickupY","boundaryRect","previewWidth","previewHeight","_getPreviewRect","minY","maxY","minX","maxX","clamp","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","pointerDirectionChangeThreshold","shouldEnable","cleanup","styles","currentPosition","pickupPosition","leftOverflow","rightOverflow","topOverflow","bottomOverflow","touch","mouse","scrollDifference","initialParent","previewContainer","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","exitContainer","hasAnchor","anchor","before","min","max","moveItemInArray","array","fromIndex","toIndex","from","to","transferArrayItem","currentArray","targetArray","targetIndex","splice","copyArrayItem","SingleAxisSortStrategy","_element","_sortPredicate","_itemPositions","_activeDraggables","orientation","_previousSwap","drag","overlaps","items","withItems","sort","pointerDelta","siblings","newIndex","_getItemIndexFromPointerPosition","isHorizontal","findIndex","currentItem","siblingAtNewPosition","newPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","slice","sibling","index","isDraggedItem","elementToOffset","transformAmount","activeDraggables","newPositionReference","_shouldEnterAsFirstChild","parentElement","push","_cacheItemPositions","withSortPredicate","predicate","p","getActiveItemsSnapshot","_getVisualItemPositions","updateOnScroll","withElementContainer","elementToMeasure","a","b","reverse","immediateSibling","end","itemPositions","reversed","lastItemRect","firstItemRect","floor","MixedSortStrategy","_rootNode","_activeItems","deltaX","deltaY","_relatedNodes","childNodes","nextSibling","previousSwap","toSwapWith","current","overlapElement","after","newOverlapElement","_getRootNode","elementFromPoint","enterIndex","_getClosestItemIndexToPointer","targetItem","root","elementAtPoint","minDistance","Infinity","minIndex","hypot","DROP_PROXIMITY_THRESHOLD","SCROLL_PROXIMITY_THRESHOLD","AutoScrollVerticalDirection","AutoScrollHorizontalDirection","DropListRef","autoScrollDisabled","autoScrollStep","enterPredicate","sortPredicate","sorted","receivingStarted","receivingStopped","_container","_isDragging","_sortStrategy","_domRect","_draggables","_siblings","_activeSiblings","_viewportScrollSubscription","_verticalScrollDirection","NONE","_horizontalScrollDirection","_scrollNode","_stopScrollTimers","_scrollableElements","_initialScrollSnap","coercedElement","withOrientation","registerDropContainer","removeDropContainer","_draggingStarted","_notifyReceivingSiblings","_cacheParentPositions","_reset","previousItems","draggedItems","filter","every","connectedTo","strategy","withScrollableParents","Error","oldContainerIndex","newContainerIndex","unshift","size","result","scrollNode","verticalScrollDirection","horizontalScrollDirection","getElementScrollDirections","getViewportSize","getVerticalScrollDirection","getHorizontalScrollDirection","_startScrollInterval","msScrollSnapType","scrollSnapType","_listenToScrollEvents","_stopReceiving","interval","animationFrameScheduler","pipe","takeUntil","scrollStep","UP","scrollBy","DOWN","LEFT","RIGHT","_canReceive","_startReceiving","activeSiblings","initiator","receiver","computedVertical","computedHorizontal","scrollHeight","clientHeight","scrollWidth","clientWidth","capturingEventOptions","_ResetsLoader","deps","i0","ɵɵFactoryTarget","Component","ɵcmp","ɵɵngDeclareComponent","minVersion","version","isInline","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","decorators","args","host","DragDropRegistry","inject","NgZone","DOCUMENT","_styleLoader","_CdkPrivateStyleLoader","RendererFactory2","createRenderer","_cleanupDocumentTouchmove","_scroll","_dropInstances","_dragInstances","_activeDragInstances","_globalListeners","_draggingPredicate","_domNodesToDirectives","_persistentTouchmoveListener","load","update","instances","startsWith","endEventHandler","e","toBind","_preventDefaultWhileDragging","options","_clearGlobalListeners","streams","Observable","observer","merge","registerDirectiveNode","dragRef","WeakMap","removeDirectiveNode","getDragDirectiveForNode","ngOnDestroy","instance","some","Injectable","ɵprov","ɵɵngDeclareInjectable","ngImport","providedIn","DEFAULT_CONFIG","DragDrop","ViewportRuler","createDrag","config","createDropList","CDK_DRAG_PARENT","InjectionToken","assertElementNode","CDK_DRAG_HANDLE","CdkDragHandle","ElementRef","_parentDrag","optional","skipSelf","_stateChanges","nativeElement","_addHandle","ngAfterViewInit","ref","_removeHandle","Directive","ɵdir","ɵɵngDeclareDirective","isStandalone","inputs","booleanAttribute","classAttribute","providers","provide","useExisting","Input","alias","CDK_DRAG_CONFIG","CDK_DROP_LIST","CdkDrag","_viewContainerRef","ViewContainerRef","_dir","Directionality","_changeDetectorRef","ChangeDetectorRef","_selfHandle","self","_destroyed","BehaviorSubject","_dragRef","rootElementSelector","freeDragPosition","EventEmitter","subscription","movedEvent","_injector","Injector","dragDrop","_assignDefaults","addItem","_dropListRef","_syncInputs","_handleEvents","afterNextRender","_updateRootElement","_setupHandlesListener","injector","ngOnChanges","changes","rootSelectorChange","positionChange","firstChange","removeItem","getValue","_setPreviewTemplate","_resetPreviewTemplate","_setPlaceholderTemplate","_resetPlaceholderTemplate","closest","_getBoundaryElement","boundary","dir","templateRef","coerceNumberProperty","take","parentDrag","startEvent","emit","markForCheck","releaseEvent","endEvent","enterEvent","exitEvent","dropEvent","draggingDisabled","tap","handleElements","switchMap","startWith","handleInstance","numberAttribute","exportAs","usesOnChanges","Output","CDK_DROP_LIST_GROUP","CdkDropListGroup","_items","CdkDropList","_scrollDispatcher","ScrollDispatcher","_group","_latestSortedRefs","_scrollableParentsResolved","_dropLists","id","_IdGenerator","getId","elementContainerSelector","_unsortedItems","_setupInputSyncSubscription","_syncItemsWithRef","getSortedItems","documentPosition","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","coerceArray","correspondingDropList","list","console","warn","scrollableParents","getAncestorScrollContainers","scrollable","getElementRef","querySelector","listAutoScrollDisabled","listOrientation","outputs","properties","useValue","CDK_DRAG_PREVIEW","CdkDragPreview","TemplateRef","_drag","CDK_DRAG_PLACEHOLDER","CdkDragPlaceholder","DRAG_DROP_DIRECTIVES","DragDropModule","NgModule","ɵmod","ɵɵngDeclareNgModule","exports","CdkScrollableModule","ɵinj","ɵɵngDeclareInjector","imports"],"mappings":";;;;;;;;;;;;;;;;;;;;AASM,SAAUA,aAAaA,CAACC,IAAiB,EAAA;AAC7C,EAAA,MAAMC,KAAK,GAAGD,IAAI,CAACE,SAAS,CAAC,IAAI,CAAgB;AACjD,EAAA,MAAMC,iBAAiB,GAAGF,KAAK,CAACG,gBAAgB,CAAC,MAAM,CAAC;EACxD,MAAMC,QAAQ,GAAGL,IAAI,CAACK,QAAQ,CAACC,WAAW,EAAE;AAG5CL,EAAAA,KAAK,CAACM,eAAe,CAAC,IAAI,CAAC;AAE3B,EAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,iBAAiB,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;AACjDL,IAAAA,iBAAiB,CAACK,CAAC,CAAC,CAACD,eAAe,CAAC,IAAI,CAAC;AAC5C;EAEA,IAAIF,QAAQ,KAAK,QAAQ,EAAE;AACzBK,IAAAA,kBAAkB,CAACV,IAAyB,EAAEC,KAA0B,CAAC;AAC3E,GAAA,MAAO,IAAII,QAAQ,KAAK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js","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/clone-node.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/dom-rect.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/parent-position-tracker.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/root-node.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/styling.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/dom/transition-duration.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/preview-ref.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-ref.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-utils.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/sorting/single-axis-sort-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/sorting/mixed-sort-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drop-list-ref.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-drop-registry.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-drop.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-parent.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/assertions.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drag-handle.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/config.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drag.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drop-list-group.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drop-list.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drag-preview.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/directives/drag-placeholder.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/drag-drop/drag-drop-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Creates a deep clone of an element. */\nexport function deepCloneNode(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n const descendantsWithId = clone.querySelectorAll('[id]');\n const nodeName = node.nodeName.toLowerCase();\n\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n\n if (nodeName === 'canvas') {\n transferCanvasData(node as HTMLCanvasElement, clone as HTMLCanvasElement);\n } else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') {\n transferInputData(node as HTMLInputElement, clone as HTMLInputElement);\n }\n\n transferData('canvas', node, clone, transferCanvasData);\n transferData('input, textarea, select', node, clone, transferInputData);\n return clone;\n}\n\n/** Matches elements between an element and its clone and allows for their data to be cloned. */\nfunction transferData<T extends Element>(\n selector: string,\n node: HTMLElement,\n clone: HTMLElement,\n callback: (source: T, clone: T) => void,\n) {\n const descendantElements = node.querySelectorAll<T>(selector);\n\n if (descendantElements.length) {\n const cloneElements = clone.querySelectorAll<T>(selector);\n\n for (let i = 0; i < descendantElements.length; i++) {\n callback(descendantElements[i], cloneElements[i]);\n }\n }\n}\n\n// Counter for unique cloned radio button names.\nlet cloneUniqueId = 0;\n\n/** Transfers the data of one input element to another. */\nfunction transferInputData(\n source: Element & {value: string},\n clone: Element & {value: string; name: string; type: string},\n) {\n // Browsers throw an error when assigning the value of a file input programmatically.\n if (clone.type !== 'file') {\n clone.value = source.value;\n }\n\n // Radio button `name` attributes must be unique for radio button groups\n // otherwise original radio buttons can lose their checked state\n // once the clone is inserted in the DOM.\n if (clone.type === 'radio' && clone.name) {\n clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`;\n }\n}\n\n/** Transfers the data of one canvas element to another. */\nfunction transferCanvasData(source: HTMLCanvasElement, clone: HTMLCanvasElement) {\n const context = clone.getContext('2d');\n\n if (context) {\n // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).\n // We can't do much about it so just ignore the error.\n try {\n context.drawImage(source, 0, 0);\n } catch {}\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Gets a mutable version of an element's bounding `DOMRect`. */\nexport function getMutableClientRect(element: Element): DOMRect {\n const rect = element.getBoundingClientRect();\n\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `DOMRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n x: rect.x,\n y: rect.y,\n } as DOMRect;\n}\n\n/**\n * Checks whether some coordinates are within a `DOMRect`.\n * @param clientRect DOMRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nexport function isInsideClientRect(clientRect: DOMRect, x: number, y: number) {\n const {top, bottom, left, right} = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n\n/**\n * Checks if the child element is overflowing from its parent.\n * @param parentRect - The bounding rect of the parent element.\n * @param childRect - The bounding rect of the child element.\n */\nexport function isOverflowingParent(parentRect: DOMRect, childRect: DOMRect): boolean {\n // check for horizontal overflow (left and right)\n const isLeftOverflowing = childRect.left < parentRect.left;\n const isRightOverflowing = childRect.left + childRect.width > parentRect.right;\n\n // check for vertical overflow (top and bottom)\n const isTopOverflowing = childRect.top < parentRect.top;\n const isBottomOverflowing = childRect.top + childRect.height > parentRect.bottom;\n\n return isLeftOverflowing || isRightOverflowing || isTopOverflowing || isBottomOverflowing;\n}\n\n/**\n * Updates the top/left positions of a `DOMRect`, as well as their bottom/right counterparts.\n * @param domRect `DOMRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nexport function adjustDomRect(\n domRect: {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n },\n top: number,\n left: number,\n) {\n domRect.top += top;\n domRect.bottom = domRect.top + domRect.height;\n\n domRect.left += left;\n domRect.right = domRect.left + domRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a DOMRect.\n * @param rect DOMRect to check against.\n * @param threshold Threshold around the DOMRect.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nexport function isPointerNearDomRect(\n rect: DOMRect,\n threshold: number,\n pointerX: number,\n pointerY: number,\n): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * threshold;\n const yThreshold = height * threshold;\n\n return (\n pointerY > top - yThreshold &&\n pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold &&\n pointerX < right + xThreshold\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_getEventTarget} from '../../platform';\nimport {getMutableClientRect, adjustDomRect} from './dom-rect';\n\n/** Object holding the scroll position of something. */\ninterface ScrollPosition {\n top: number;\n left: number;\n}\n\n/** Keeps track of the scroll position and dimensions of the parents of an element. */\nexport class ParentPositionTracker {\n /** Cached positions of the scrollable parent elements. */\n readonly positions = new Map<\n Document | HTMLElement,\n {\n scrollPosition: ScrollPosition;\n clientRect?: DOMRect;\n }\n >();\n\n constructor(private _document: Document) {}\n\n /** Clears the cached positions. */\n clear() {\n this.positions.clear();\n }\n\n /** Caches the positions. Should be called at the beginning of a drag sequence. */\n cache(elements: readonly HTMLElement[]) {\n this.clear();\n this.positions.set(this._document, {\n scrollPosition: this.getViewportScrollPosition(),\n });\n\n elements.forEach(element => {\n this.positions.set(element, {\n scrollPosition: {top: element.scrollTop, left: element.scrollLeft},\n clientRect: getMutableClientRect(element),\n });\n });\n }\n\n /** Handles scrolling while a drag is taking place. */\n handleScroll(event: Event): ScrollPosition | null {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n const cachedPosition = this.positions.get(target);\n\n if (!cachedPosition) {\n return null;\n }\n\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const viewportScrollPosition = this.getViewportScrollPosition();\n newTop = viewportScrollPosition.top;\n newLeft = viewportScrollPosition.left;\n } else {\n newTop = (target as HTMLElement).scrollTop;\n newLeft = (target as HTMLElement).scrollLeft;\n }\n\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this.positions.forEach((position, node) => {\n if (position.clientRect && target !== node && target.contains(node)) {\n adjustDomRect(position.clientRect, topDifference, leftDifference);\n }\n });\n\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n\n return {top: topDifference, left: leftDifference};\n }\n\n /**\n * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,\n * instead of going through the `ViewportRuler`, because the first value the ruler looks at is\n * the top/left offset of the `document.documentElement` which works for most cases, but breaks\n * if the element is offset by something like the `BlockScrollStrategy`.\n */\n getViewportScrollPosition() {\n return {top: window.scrollY, left: window.scrollX};\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmbeddedViewRef} from '@angular/core';\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nexport function getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNodes: Node[] = viewRef.rootNodes;\n\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0] as HTMLElement;\n }\n\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Extended CSSStyleDeclaration that includes a couple of drag-related\n * properties that aren't in the built-in TS typings.\n */\nexport interface DragCSSStyleDeclaration extends CSSStyleDeclaration {\n msScrollSnapType: string;\n scrollSnapType: string;\n webkitTapHighlightColor: string;\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet-like object.\n * Note that the keys in `source` have to be dash-cased.\n * @docs-private\n */\nexport function extendStyles(\n dest: CSSStyleDeclaration,\n source: Record<string, string>,\n importantProperties?: Set<string>,\n) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n const value = source[key];\n\n if (value) {\n dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : '');\n } else {\n dest.removeProperty(key);\n }\n }\n }\n\n return dest;\n}\n\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nexport function toggleNativeDragInteractions(element: HTMLElement, enable: boolean) {\n const userSelect = enable ? '' : 'none';\n\n extendStyles(element.style, {\n 'touch-action': enable ? '' : 'none',\n '-webkit-user-drag': enable ? '' : 'none',\n '-webkit-tap-highlight-color': enable ? '' : 'transparent',\n 'user-select': userSelect,\n '-ms-user-select': userSelect,\n '-webkit-user-select': userSelect,\n '-moz-user-select': userSelect,\n });\n}\n\n/**\n * Toggles whether an element is visible while preserving its dimensions.\n * @param element Element whose visibility to toggle\n * @param enable Whether the element should be visible.\n * @param importantProperties Properties to be set as `!important`.\n * @docs-private\n */\nexport function toggleVisibility(\n element: HTMLElement,\n enable: boolean,\n importantProperties?: Set<string>,\n) {\n extendStyles(\n element.style,\n {\n position: enable ? '' : 'fixed',\n top: enable ? '' : '0',\n opacity: enable ? '' : '0',\n left: enable ? '' : '-999em',\n },\n importantProperties,\n );\n}\n\n/**\n * Combines a transform string with an optional other transform\n * that exited before the base transform was applied.\n */\nexport function combineTransforms(transform: string, initialTransform?: string): string {\n return initialTransform && initialTransform != 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param sourceRect Dimensions of the source element.\n */\nexport function matchElementSize(target: HTMLElement, sourceRect: DOMRect): void {\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nexport function getTransform(x: number, y: number): string {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return (\n parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex])\n );\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmbeddedViewRef, Renderer2, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {Direction} from '../bidi';\nimport {\n extendStyles,\n getTransform,\n matchElementSize,\n toggleNativeDragInteractions,\n} from './dom/styling';\nimport {deepCloneNode} from './dom/clone-node';\nimport {getRootNode} from './dom/root-node';\nimport {getTransformTransitionDurationInMs} from './dom/transition-duration';\n\n/** Template that can be used to create a drag preview element. */\nexport interface DragPreviewTemplate<T = any> {\n matchSize?: boolean;\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst importantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n\nexport class PreviewRef {\n /** Reference to the view of the preview element. */\n private _previewEmbeddedView: EmbeddedViewRef<any> | null;\n\n /** Reference to the preview element. */\n private _preview: HTMLElement;\n\n get element(): HTMLElement {\n return this._preview;\n }\n\n constructor(\n private _document: Document,\n private _rootElement: HTMLElement,\n private _direction: Direction,\n private _initialDomRect: DOMRect,\n private _previewTemplate: DragPreviewTemplate | null,\n private _previewClass: string | string[] | null,\n private _pickupPositionOnPage: {\n x: number;\n y: number;\n },\n private _initialTransform: string | null,\n private _zIndex: number,\n private _renderer: Renderer2,\n ) {}\n\n attach(parent: HTMLElement): void {\n this._preview = this._createPreview();\n parent.appendChild(this._preview);\n\n // The null check is necessary for browsers that don't support the popover API.\n // Note that we use a string access for compatibility with Closure.\n if (supportsPopover(this._preview)) {\n this._preview['showPopover']();\n }\n }\n\n destroy(): void {\n this._preview.remove();\n this._previewEmbeddedView?.destroy();\n this._preview = this._previewEmbeddedView = null!;\n }\n\n setTransform(value: string): void {\n this._preview.style.transform = value;\n }\n\n getBoundingClientRect(): DOMRect {\n return this._preview.getBoundingClientRect();\n }\n\n addClass(className: string): void {\n this._preview.classList.add(className);\n }\n\n getTransitionDuration(): number {\n return getTransformTransitionDurationInMs(this._preview);\n }\n\n addEventListener(name: string, handler: (event: any) => void): () => void {\n return this._renderer.listen(this._preview, name, handler);\n }\n\n private _createPreview(): HTMLElement {\n const previewConfig = this._previewTemplate;\n const previewClass = this._previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview: HTMLElement;\n\n if (previewTemplate && previewConfig) {\n // Measure the element before we've inserted the preview\n // since the insertion could throw off the measurement.\n const rootRect = previewConfig.matchSize ? this._initialDomRect : null;\n const viewRef = previewConfig.viewContainer.createEmbeddedView(\n previewTemplate,\n previewConfig.context,\n );\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewEmbeddedView = viewRef;\n if (previewConfig.matchSize) {\n matchElementSize(preview, rootRect!);\n } else {\n preview.style.transform = getTransform(\n this._pickupPositionOnPage.x,\n this._pickupPositionOnPage.y,\n );\n }\n } else {\n preview = deepCloneNode(this._rootElement);\n matchElementSize(preview, this._initialDomRect!);\n\n if (this._initialTransform) {\n preview.style.transform = this._initialTransform;\n }\n }\n\n extendStyles(\n preview.style,\n {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n 'pointer-events': 'none',\n // If the preview has a margin, it can throw off our positioning so we reset it. The reset\n // value for `margin-right` needs to be `auto` when opened as a popover, because our\n // positioning is always top/left based, but native popover seems to position itself\n // to the top/right if `<html>` or `<body>` have `dir=\"rtl\"` (see #29604). Setting it\n // to `auto` pushed it to the top/left corner in RTL and is a noop in LTR.\n 'margin': supportsPopover(preview) ? '0 auto 0 0' : '0',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'z-index': this._zIndex + '',\n },\n importantProperties,\n );\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('popover', 'manual');\n preview.setAttribute('dir', this._direction);\n\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n } else {\n preview.classList.add(previewClass);\n }\n }\n\n return preview;\n }\n}\n\n/** Checks whether a specific element supports the popover API. */\nfunction supportsPopover(element: HTMLElement): boolean {\n return 'showPopover' in element;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader} from '../a11y';\nimport {Direction} from '../bidi';\nimport {coerceElement} from '../coercion';\nimport {_getEventTarget, _getShadowRoot} from '../platform';\nimport {ViewportRuler} from '../scrolling';\nimport {\n ElementRef,\n EmbeddedViewRef,\n NgZone,\n Renderer2,\n TemplateRef,\n ViewContainerRef,\n signal,\n} from '@angular/core';\nimport {Observable, Subject, Subscription} from 'rxjs';\nimport {deepCloneNode} from './dom/clone-node';\nimport {adjustDomRect, getMutableClientRect, isOverflowingParent} from './dom/dom-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {getRootNode} from './dom/root-node';\nimport {\n DragCSSStyleDeclaration,\n combineTransforms,\n getTransform,\n toggleNativeDragInteractions,\n toggleVisibility,\n} from './dom/styling';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport type {DropListRef} from './drop-list-ref';\nimport {DragPreviewTemplate, PreviewRef} from './preview-ref';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n\n /** `z-index` for the absolutely-positioned elements that are created by the drag item. */\n zIndex?: number;\n\n /** Ref that the current drag item is nested in. */\n parentDragRef?: DragRef;\n}\n\n/** Function that can be used to constrain the position of a dragged element. */\nexport type DragConstrainPosition = (\n userPointerPosition: Point,\n dragRef: DragRef,\n dimensions: DOMRect,\n pickupPositionInElement: Point,\n) => Point;\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = {passive: true};\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = {passive: false};\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = {\n passive: false,\n capture: true,\n};\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n/** Class applied to the drag placeholder. */\nconst PLACEHOLDER_CLASS = 'cdk-drag-placeholder';\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst dragImportantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n\n/**\n * Possible places into which the preview of a drag item can be inserted.\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */\nexport type PreviewContainer = 'global' | 'parent' | ElementRef<HTMLElement> | HTMLElement;\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n private _rootElementCleanups: (() => void)[] | undefined;\n private _cleanupShadowRootSelectStart: (() => void) | undefined;\n\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: PreviewRef | null;\n\n /** Container into which to insert the preview. */\n private _previewContainer: PreviewContainer | undefined;\n\n /** Reference to the view of the placeholder element. */\n private _placeholderRef: EmbeddedViewRef<any> | null;\n\n /** Element that is rendered instead of the draggable item while it is being sorted. */\n private _placeholder: HTMLElement;\n\n /** Coordinates within the element at which the user picked up the element. */\n private _pickupPositionInElement: Point;\n\n /** Coordinates on the page at which the user picked up the element. */\n private _pickupPositionOnPage: Point;\n\n /**\n * Marker node used to save the place in the DOM where the element was\n * picked up so that it can be restored at the end of the drag sequence.\n */\n private _marker: Comment;\n\n /**\n * Element indicating the position from which the item was picked up initially.\n */\n private _anchor: HTMLElement | null = null;\n\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n private _passiveTransform: Point = {x: 0, y: 0};\n\n /** CSS `transform` that is applied to the element while it's being dragged. */\n private _activeTransform: Point = {x: 0, y: 0};\n\n /** Inline `transform` value that the element had before the first dragging sequence. */\n private _initialTransform?: string;\n\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n private _hasStartedDragging = signal(false);\n\n /** Whether the element has moved since the user started dragging it. */\n private _hasMoved: boolean;\n\n /** Drop container in which the DragRef resided when dragging began. */\n private _initialContainer: DropListRef;\n\n /** Index at which the item started in its initial container. */\n private _initialIndex: number;\n\n /** Cached positions of scrollable parent elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Emits when the item is being moved. */\n private readonly _moveEvents = new Subject<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }>();\n\n /** Keeps track of the direction in which the user is dragging along each axis. */\n private _pointerDirectionDelta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n\n /** Pointer position at which the last change in the delta occurred. */\n private _pointerPositionAtLastDirectionChange: Point;\n\n /** Position of the pointer at the last pointer event. */\n private _lastKnownPointerPosition: Point;\n\n /**\n * Root DOM node of the drag instance. This is the element that will\n * be moved around as the user is dragging.\n */\n private _rootElement: HTMLElement;\n\n /**\n * Nearest ancestor SVG, relative to which coordinates are calculated if dragging SVGElement\n */\n private _ownerSVGElement: SVGSVGElement | null;\n\n /**\n * Inline style value of `-webkit-tap-highlight-color` at the time the\n * dragging was started. Used to restore the value once we're done dragging.\n */\n private _rootElementTapHighlight: string;\n\n /** Subscription to pointer movement events. */\n private _pointerMoveSubscription = Subscription.EMPTY;\n\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n private _pointerUpSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being scrolled. */\n private _scrollSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being resized. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /**\n * Time at which the last touch event occurred. Used to avoid firing the same\n * events multiple times on touch devices where the browser will fire a fake\n * mouse event for each touch event, after a certain time.\n */\n private _lastTouchEventTime: number;\n\n /** Time at which the last dragging sequence was started. */\n private _dragStartTime: number;\n\n /** Cached reference to the boundary element. */\n private _boundaryElement: HTMLElement | null = null;\n\n /** Whether the native dragging interactions have been enabled on the root element. */\n private _nativeInteractionsEnabled = true;\n\n /** Client rect of the root element when the dragging sequence has started. */\n private _initialDomRect?: DOMRect;\n\n /** Cached dimensions of the preview element. Should be read via `_getPreviewRect`. */\n private _previewRect?: DOMRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: DOMRect;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n private _previewTemplate?: DragPreviewTemplate | null;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n private _placeholderTemplate?: DragHelperTemplate | null;\n\n /** Elements that can be used to drag the draggable item. */\n private _handles: HTMLElement[] = [];\n\n /** Registered handles that are currently disabled. */\n private _disabledHandles = new Set<HTMLElement>();\n\n /** Droppable container that the draggable is a part of. */\n private _dropContainer?: DropListRef;\n\n /** Layout direction of the item. */\n private _direction: Direction = 'ltr';\n\n /** Ref that the current drag item is nested in. */\n private _parentDragRef: DragRef<unknown> | null;\n\n /**\n * Cached shadow root that the element is placed in. `null` means that the element isn't in\n * the shadow DOM and `undefined` means that it hasn't been resolved yet. Should be read via\n * `_getShadowRoot`, not directly.\n */\n private _cachedShadowRoot: ShadowRoot | null | undefined;\n\n /** Axis along which dragging is locked. */\n lockAxis: 'x' | 'y' | null = null;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n dragStartDelay: number | {touch: number; mouse: number} = 0;\n\n /** Class to be added to the preview element. */\n previewClass: string | string[] | undefined;\n\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n scale: number = 1;\n\n /** Whether starting to drag this element is disabled. */\n get disabled(): boolean {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value: boolean) {\n if (value !== this._disabled) {\n this._disabled = value;\n this._toggleNativeDragInteractions();\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, value));\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n readonly beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n readonly started = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n readonly released = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user stops dragging an item in the container. */\n readonly ended = new Subject<{\n source: DragRef;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits when the user has moved the item into a new container. */\n readonly entered = new Subject<{container: DropListRef; item: DragRef; currentIndex: number}>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n readonly exited = new Subject<{container: DropListRef; item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n readonly dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n dropPoint: Point;\n isPointerOverContainer: boolean;\n event: MouseEvent | TouchEvent;\n }>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n readonly moved: Observable<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }> = this._moveEvents;\n\n /** Arbitrary data that can be attached to the drag item. */\n data: T;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page, a reference to the item being dragged and its dimensions.\n * Should return a point describing where the item should be rendered.\n */\n constrainPosition?: DragConstrainPosition;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _config: DragRefConfig,\n private _document: Document,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry,\n private _renderer: Renderer2,\n ) {\n this.withRootElement(element).withParent(_config.parentDragRef || null);\n this._parentPositions = new ParentPositionTracker(_document);\n _dragDropRegistry.registerDragItem(this);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._placeholder;\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._rootElement;\n }\n\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement(): HTMLElement {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled));\n this._toggleNativeDragInteractions();\n\n // Delete any lingering disabled handles that may have been destroyed. Note that we re-create\n // the set, rather than iterate over it and filter out the destroyed handles, because while\n // the ES spec allows for sets to be modified while they're being iterated over, some polyfills\n // use an array internally which may throw an error.\n const disabledHandles = new Set<HTMLElement>();\n this._disabledHandles.forEach(handle => {\n if (this._handles.indexOf(handle) > -1) {\n disabledHandles.add(handle);\n }\n });\n this._disabledHandles = disabledHandles;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template: DragPreviewTemplate | null): this {\n this._previewTemplate = template;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template: DragHelperTemplate | null): this {\n this._placeholderTemplate = template;\n return this;\n }\n\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this {\n const element = coerceElement(rootElement);\n\n if (element !== this._rootElement) {\n this._removeRootElementListeners();\n const renderer = this._renderer;\n this._rootElementCleanups = this._ngZone.runOutsideAngular(() => [\n renderer.listen(element, 'mousedown', this._pointerDown, activeEventListenerOptions),\n renderer.listen(element, 'touchstart', this._pointerDown, passiveEventListenerOptions),\n renderer.listen(element, 'dragstart', this._nativeDragStart, activeEventListenerOptions),\n ]);\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n this._ownerSVGElement = this._rootElement.ownerSVGElement;\n }\n\n return this;\n }\n\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n\n /** Sets the parent ref that the ref is nested in. */\n withParent(parent: DragRef<unknown> | null): this {\n this._parentDragRef = parent;\n return this;\n }\n\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners();\n\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n this._rootElement?.remove();\n }\n\n this._marker?.remove();\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeListeners();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._parentPositions.clear();\n this._boundaryElement =\n this._rootElement =\n this._ownerSVGElement =\n this._placeholderTemplate =\n this._previewTemplate =\n this._marker =\n this._parentDragRef =\n null!;\n }\n\n /** Checks whether the element is currently being dragged. */\n isDragging(): boolean {\n return this._hasStartedDragging() && this._dragDropRegistry.isDragging(this);\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform = {x: 0, y: 0};\n }\n\n /** Resets drag item to end of boundary element. */\n resetToBoundary(): void {\n if (\n // can be null if the drag item was never dragged.\n this._boundaryElement &&\n this._rootElement &&\n // check if we are overflowing off our boundary element\n isOverflowingParent(\n this._boundaryElement.getBoundingClientRect(),\n this._rootElement.getBoundingClientRect(),\n )\n ) {\n const parentRect = this._boundaryElement.getBoundingClientRect();\n const childRect = this._rootElement.getBoundingClientRect();\n\n let offsetX = 0;\n let offsetY = 0;\n\n // check if we are overflowing from left or right\n if (childRect.left < parentRect.left) {\n offsetX = parentRect.left - childRect.left;\n } else if (childRect.right > parentRect.right) {\n offsetX = parentRect.right - childRect.right;\n }\n\n // check if we are overflowing from top or bottom\n if (childRect.top < parentRect.top) {\n offsetY = parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n offsetY = parentRect.bottom - childRect.bottom;\n }\n\n const currentLeft = this._activeTransform.x;\n const currentTop = this._activeTransform.y;\n\n let x = currentLeft + offsetX,\n y = currentTop + offsetY;\n\n this._rootElement.style.transform = getTransform(x, y);\n this._activeTransform = {x, y};\n this._passiveTransform = {x, y};\n }\n }\n\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle: HTMLElement) {\n if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n toggleNativeDragInteractions(handle, true);\n }\n }\n\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle: HTMLElement) {\n if (this._disabledHandles.has(handle)) {\n this._disabledHandles.delete(handle);\n toggleNativeDragInteractions(handle, this.disabled);\n }\n }\n\n /** Sets the layout direction of the draggable item. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /** Sets the container that the item is part of. */\n _withDropContainer(container: DropListRef) {\n this._dropContainer = container;\n }\n\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return {x: position.x, y: position.y};\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): this {\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n\n return this;\n }\n\n /**\n * Sets the container into which to insert the preview element.\n * @param value Container into which to insert the preview.\n */\n withPreviewContainer(value: PreviewContainer): this {\n this._previewContainer = value;\n return this;\n }\n\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._lastKnownPointerPosition;\n\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position);\n }\n }\n\n /** Unsubscribes from the global subscriptions. */\n private _removeListeners() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n this._cleanupShadowRootSelectStart?.();\n this._cleanupShadowRootSelectStart = undefined;\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n this._preview?.destroy();\n this._preview = null;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n this._anchor?.remove();\n this._placeholder?.remove();\n this._placeholderRef?.destroy();\n this._placeholder = this._anchor = this._placeholderRef = null!;\n }\n\n /** Handler for the `mousedown`/`touchstart` events. */\n private _pointerDown = (event: MouseEvent | TouchEvent) => {\n this.beforeStarted.next();\n\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n } else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n };\n\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n private _pointerMove = (event: MouseEvent | TouchEvent) => {\n const pointerPosition = this._getPointerPositionOnPage(event);\n\n if (!this._hasStartedDragging()) {\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n const container = this._dropContainer;\n\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!container || (!container.isDragging() && !container.isReceiving())) {\n // Prevent the default action as soon as the dragging sequence is considered as\n // \"started\" since waiting for the next event can allow the device to begin scrolling.\n if (event.cancelable) {\n event.preventDefault();\n }\n this._hasStartedDragging.set(true);\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We prevent the default action down here so that we know that dragging has started. This is\n // important for touch devices where doing this too early can unnecessarily block scrolling,\n // if there's a dragging delay.\n if (event.cancelable) {\n event.preventDefault();\n }\n\n const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition);\n this._hasMoved = true;\n this._lastKnownPointerPosition = pointerPosition;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition);\n } else {\n // If there's a position constraint function, we want the element's top/left to be at the\n // specific position on the page. Use the initial position as a reference if that's the case.\n const offset = this.constrainPosition ? this._initialDomRect! : this._pickupPositionOnPage;\n const activeTransform = this._activeTransform;\n activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x;\n activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y;\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n }\n\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta,\n });\n });\n }\n };\n\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n private _pointerUp = (event: MouseEvent | TouchEvent) => {\n this._endDragSequence(event);\n };\n\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n private _endDragSequence(event: MouseEvent | TouchEvent) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n\n this._removeListeners();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n (this._rootElement.style as DragCSSStyleDeclaration).webkitTapHighlightColor =\n this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging()) {\n return;\n }\n\n this.released.next({source: this, event});\n\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n } else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n const pointerPosition = this._getPointerPositionOnPage(event);\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(pointerPosition),\n dropPoint: pointerPosition,\n event,\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n\n /** Starts the dragging sequence. */\n private _startDragSequence(event: MouseEvent | TouchEvent) {\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n\n this._toggleNativeDragInteractions();\n\n // Needs to happen before the root element is moved.\n const shadowRoot = this._getShadowRoot();\n const dropContainer = this._dropContainer;\n\n if (shadowRoot) {\n // In some browsers the global `selectstart` that we maintain in the `DragDropRegistry`\n // doesn't cross the shadow boundary so we have to prevent it at the shadow root (see #28792).\n this._ngZone.runOutsideAngular(() => {\n this._cleanupShadowRootSelectStart = this._renderer.listen(\n shadowRoot,\n 'selectstart',\n shadowDomSelectStart,\n activeCapturingEventOptions,\n );\n });\n }\n\n if (dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode as HTMLElement;\n const placeholder = (this._placeholder = this._createPlaceholderElement());\n const marker = (this._marker =\n this._marker ||\n this._document.createComment(\n typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-marker' : '',\n ));\n\n // Insert a marker node so that we can restore the element's position in the DOM.\n parent.insertBefore(marker, element);\n\n // There's no risk of transforms stacking when inside a drop container so\n // we can keep the initial transform up to date any time dragging starts.\n this._initialTransform = element.style.transform || '';\n\n // Create the preview after the initial transform has\n // been cached, because it can be affected by the transform.\n this._preview = new PreviewRef(\n this._document,\n this._rootElement,\n this._direction,\n this._initialDomRect!,\n this._previewTemplate || null,\n this.previewClass || null,\n this._pickupPositionOnPage,\n this._initialTransform,\n this._config.zIndex || 1000,\n this._renderer,\n );\n this._preview.attach(this._getPreviewInsertionPoint(parent, shadowRoot));\n\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n toggleVisibility(element, false, dragImportantProperties);\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n this.started.next({source: this, event}); // Emit before notifying the container.\n dropContainer.start();\n this._initialContainer = dropContainer;\n this._initialIndex = dropContainer.getItemIndex(this);\n } else {\n this.started.next({source: this, event});\n this._initialContainer = this._initialIndex = undefined!;\n }\n\n // Important to run after we've called `start` on the parent container\n // so that it has had time to resolve its scrollable parents.\n this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []);\n }\n\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n private _initializeDragSequence(referenceElement: HTMLElement, event: MouseEvent | TouchEvent) {\n // Stop propagation if the item is inside another\n // draggable so we don't start multiple drag sequences.\n if (this._parentDragRef) {\n event.stopPropagation();\n }\n\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && (event as MouseEvent).button !== 0;\n const rootElement = this._rootElement;\n const target = _getEventTarget(event);\n const isSyntheticEvent =\n !isTouchSequence &&\n this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n const isFakeEvent = isTouchSequence\n ? isFakeTouchstartFromScreenReader(event as TouchEvent)\n : isFakeMousedownFromScreenReader(event as MouseEvent);\n\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (target && (target as HTMLElement).draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) {\n return;\n }\n\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n const rootStyles = rootElement.style as DragCSSStyleDeclaration;\n this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || '';\n rootStyles.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasMoved = false;\n this._hasStartedDragging.set(this._hasMoved);\n\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeListeners();\n this._initialDomRect = this._rootElement.getBoundingClientRect();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(scrollEvent => this._updateOnScroll(scrollEvent));\n\n if (this._boundaryElement) {\n this._boundaryRect = getMutableClientRect(this._boundaryElement);\n }\n\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement =\n previewTemplate && previewTemplate.template && !previewTemplate.matchSize\n ? {x: 0, y: 0}\n : this._getPointerPositionInElement(this._initialDomRect, referenceElement, event);\n const pointerPosition =\n (this._pickupPositionOnPage =\n this._lastKnownPointerPosition =\n this._getPointerPositionOnPage(event));\n this._pointerDirectionDelta = {x: 0, y: 0};\n this._pointerPositionAtLastDirectionChange = {x: pointerPosition.x, y: pointerPosition.y};\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n private _cleanupDragArtifacts(event: MouseEvent | TouchEvent) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n toggleVisibility(this._rootElement, true, dragImportantProperties);\n this._marker.parentNode!.replaceChild(this._rootElement, this._marker);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._initialDomRect =\n this._boundaryRect =\n this._previewRect =\n this._initialTransform =\n undefined;\n\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer!;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(pointerPosition);\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x,\n pointerPosition.y,\n );\n\n this.ended.next({source: this, distance, dropPoint: pointerPosition, event});\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance,\n dropPoint: pointerPosition,\n event,\n });\n container.drop(\n this,\n currentIndex,\n this._initialIndex,\n this._initialContainer,\n isPointerOverContainer,\n distance,\n pointerPosition,\n event,\n );\n this._dropContainer = this._initialContainer;\n });\n }\n\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n private _updateActiveDropContainer({x, y}: Point, {x: rawX, y: rawY}: Point) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (\n !newContainer &&\n this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)\n ) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n const exitIndex = this._dropContainer!.getItemIndex(this);\n const nextItemElement =\n this._dropContainer!.getItemAtIndex(exitIndex + 1)?.getVisibleElement() || null;\n\n // Notify the old container that the item has left.\n this.exited.next({item: this, container: this._dropContainer!});\n this._dropContainer!.exit(this);\n this._conditionallyInsertAnchor(newContainer, this._dropContainer!, nextItemElement);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(\n this,\n x,\n y,\n // If we're re-entering the initial container and sorting is disabled,\n // put item the into its starting index to begin with.\n newContainer === this._initialContainer && newContainer.sortingDisabled\n ? this._initialIndex\n : undefined,\n );\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this),\n });\n });\n }\n\n // Dragging may have been interrupted as a result of the events above.\n if (this.isDragging()) {\n this._dropContainer!._startScrollingIfNecessary(rawX, rawY);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n\n if (this.constrainPosition) {\n this._applyPreviewTransform(x, y);\n } else {\n this._applyPreviewTransform(\n x - this._pickupPositionInElement.x,\n y - this._pickupPositionInElement.y,\n );\n }\n }\n }\n\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n private _animatePreviewToPlaceholder(): Promise<void> {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n\n const placeholderRect = this._placeholder.getBoundingClientRect();\n\n // Apply the class that adds a transition to the preview.\n this._preview!.addClass('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._applyPreviewTransform(placeholderRect.left, placeholderRect.top);\n\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = this._preview!.getTransitionDuration();\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = (event: TransitionEvent) => {\n if (\n !event ||\n (this._preview &&\n _getEventTarget(event) === this._preview.element &&\n event.propertyName === 'transform')\n ) {\n cleanupListener();\n resolve();\n clearTimeout(timeout);\n }\n };\n\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler as Function, duration * 1.5);\n const cleanupListener = this._preview!.addEventListener('transitionend', handler);\n });\n });\n }\n\n /** Creates an element that will be shown instead of the current element while dragging. */\n private _createPlaceholderElement(): HTMLElement {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder: HTMLElement;\n\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView(\n placeholderTemplate,\n placeholderConfig!.context,\n );\n this._placeholderRef.detectChanges();\n placeholder = getRootNode(this._placeholderRef, this._document);\n } else {\n placeholder = deepCloneNode(this._rootElement);\n }\n\n // Stop pointer events on the preview so the user can't\n // interact with it while the preview is animating.\n placeholder.style.pointerEvents = 'none';\n placeholder.classList.add(PLACEHOLDER_CLASS);\n return placeholder;\n }\n\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n private _getPointerPositionInElement(\n elementRect: DOMRect,\n referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent,\n ): Point {\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const scrollPosition = this._getViewportScrollPosition();\n const x = point.pageX - referenceRect.left - scrollPosition.left;\n const y = point.pageY - referenceRect.top - scrollPosition.top;\n\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y,\n };\n }\n\n /** Determines the point of the page that was touched by the user. */\n private _getPointerPositionOnPage(event: MouseEvent | TouchEvent): Point {\n const scrollPosition = this._getViewportScrollPosition();\n const point = isTouchEvent(event)\n ? // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n // Also note that on real devices we're guaranteed for either `touches` or `changedTouches`\n // to have a value, but Firefox in device emulation mode has a bug where both can be empty\n // for `touchstart` and `touchend` so we fall back to a dummy object in order to avoid\n // throwing an error. The value returned here will be incorrect, but since this only\n // breaks inside a developer tool and the value is only used for secondary information,\n // we can get away with it. See https://bugzilla.mozilla.org/show_bug.cgi?id=1615824.\n event.touches[0] || event.changedTouches[0] || {pageX: 0, pageY: 0}\n : event;\n\n const x = point.pageX - scrollPosition.left;\n const y = point.pageY - scrollPosition.top;\n\n // if dragging SVG element, try to convert from the screen coordinate system to the SVG\n // coordinate system\n if (this._ownerSVGElement) {\n const svgMatrix = this._ownerSVGElement.getScreenCTM();\n if (svgMatrix) {\n const svgPoint = this._ownerSVGElement.createSVGPoint();\n svgPoint.x = x;\n svgPoint.y = y;\n return svgPoint.matrixTransform(svgMatrix.inverse());\n }\n }\n\n return {x, y};\n }\n\n /** Gets the pointer position on the page, accounting for any position constraints. */\n private _getConstrainedPointerPosition(point: Point): Point {\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n let {x, y} = this.constrainPosition\n ? this.constrainPosition(point, this, this._initialDomRect!, this._pickupPositionInElement)\n : point;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n y =\n this._pickupPositionOnPage.y -\n (this.constrainPosition ? this._pickupPositionInElement.y : 0);\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n x =\n this._pickupPositionOnPage.x -\n (this.constrainPosition ? this._pickupPositionInElement.x : 0);\n }\n\n if (this._boundaryRect) {\n // If not using a custom constrain we need to account for the pickup position in the element\n // otherwise we do not need to do this, as it has already been accounted for\n const {x: pickupX, y: pickupY} = !this.constrainPosition\n ? this._pickupPositionInElement\n : {x: 0, y: 0};\n\n const boundaryRect = this._boundaryRect;\n const {width: previewWidth, height: previewHeight} = this._getPreviewRect();\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewHeight - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewWidth - pickupX);\n\n x = clamp(x, minX, maxX);\n y = clamp(y, minY, maxY);\n }\n\n return {x, y};\n }\n\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n private _updatePointerDirectionDelta(pointerPositionOnPage: Point) {\n const {x, y} = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n\n return delta;\n }\n\n /** Toggles the native drag interactions, based on how many handles are registered. */\n private _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n\n /** Removes the manually-added event listeners from the root element. */\n private _removeRootElementListeners() {\n this._rootElementCleanups?.forEach(cleanup => cleanup());\n this._rootElementCleanups = undefined;\n }\n\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyRootElementTransform(x: number, y: number) {\n const scale = 1 / this.scale;\n const transform = getTransform(x * scale, y * scale);\n const styles = this._rootElement.style;\n\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n // Should be excluded none because none + translate3d(x, y, x) is invalid css\n if (this._initialTransform == null) {\n this._initialTransform =\n styles.transform && styles.transform != 'none' ? styles.transform : '';\n }\n\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n styles.transform = combineTransforms(transform, this._initialTransform);\n }\n\n /**\n * Applies a `transform` to the preview, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyPreviewTransform(x: number, y: number) {\n // Only apply the initial transform if the preview is a clone of the original element, otherwise\n // it could be completely different and the transform might not make sense anymore.\n const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;\n const transform = getTransform(x, y);\n this._preview!.setTransform(combineTransforms(transform, initialTransform));\n }\n\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n private _getDragDistance(currentPosition: Point): Point {\n const pickupPosition = this._pickupPositionOnPage;\n\n if (pickupPosition) {\n return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};\n }\n\n return {x: 0, y: 0};\n }\n\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n private _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n this._parentPositions.clear();\n }\n\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n private _containInsideBoundaryOnResize() {\n let {x, y} = this._passiveTransform;\n\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n\n // Note: don't use `_clientRectAtStart` here, because we want the latest position.\n const elementRect = this._rootElement.getBoundingClientRect();\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if (\n (boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)\n ) {\n return;\n }\n\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n } else {\n x = 0;\n }\n\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n } else {\n y = 0;\n }\n\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({y, x});\n }\n }\n\n /** Gets the drag start delay, based on the event type. */\n private _getDragStartDelay(event: MouseEvent | TouchEvent): number {\n const value = this.dragStartDelay;\n\n if (typeof value === 'number') {\n return value;\n } else if (isTouchEvent(event)) {\n return value.touch;\n }\n\n return value ? value.mouse : 0;\n }\n\n /** Updates the internal state of the draggable element when scrolling has occurred. */\n private _updateOnScroll(event: Event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n\n // DOMRect dimensions are based on the scroll position of the page and its parent\n // node so we have to update the cached boundary DOMRect if the user has scrolled.\n if (\n this._boundaryRect &&\n target !== this._boundaryElement &&\n target.contains(this._boundaryElement)\n ) {\n adjustDomRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }\n\n /** Gets the scroll position of the viewport. */\n private _getViewportScrollPosition() {\n return (\n this._parentPositions.positions.get(this._document)?.scrollPosition ||\n this._parentPositions.getViewportScrollPosition()\n );\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): ShadowRoot | null {\n if (this._cachedShadowRoot === undefined) {\n this._cachedShadowRoot = _getShadowRoot(this._rootElement);\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Gets the element into which the drag preview should be inserted. */\n private _getPreviewInsertionPoint(\n initialParent: HTMLElement,\n shadowRoot: ShadowRoot | null,\n ): HTMLElement {\n const previewContainer = this._previewContainer || 'global';\n\n if (previewContainer === 'parent') {\n return initialParent;\n }\n\n if (previewContainer === 'global') {\n const documentRef = this._document;\n\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return (\n shadowRoot ||\n documentRef.fullscreenElement ||\n (documentRef as any).webkitFullscreenElement ||\n (documentRef as any).mozFullScreenElement ||\n (documentRef as any).msFullscreenElement ||\n documentRef.body\n );\n }\n\n return coerceElement(previewContainer);\n }\n\n /** Lazily resolves and returns the dimensions of the preview. */\n private _getPreviewRect(): DOMRect {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = this._preview\n ? this._preview!.getBoundingClientRect()\n : this._initialDomRect!;\n }\n\n return this._previewRect;\n }\n\n /** Handles a native `dragstart` event. */\n private _nativeDragStart = (event: DragEvent) => {\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n event.preventDefault();\n }\n } else if (!this.disabled) {\n // Usually this isn't necessary since the we prevent the default action in `pointerDown`,\n // but some cases like dragging of links can slip through (see #24403).\n event.preventDefault();\n }\n };\n\n /** Gets a handle that is the target of an event. */\n private _getTargetHandle(event: Event): HTMLElement | undefined {\n return this._handles.find(handle => {\n return event.target && (event.target === handle || handle.contains(event.target as Node));\n });\n }\n\n /** Inserts the anchor element, if it's valid. */\n private _conditionallyInsertAnchor(\n newContainer: DropListRef,\n exitContainer: DropListRef,\n nextItemElement: HTMLElement | null,\n ) {\n // Remove the anchor when returning to the initial container.\n if (newContainer === this._initialContainer) {\n this._anchor?.remove();\n this._anchor = null;\n } else if (exitContainer === this._initialContainer && exitContainer.hasAnchor) {\n // Insert the anchor when leaving the initial container.\n const anchor = (this._anchor ??= deepCloneNode(this._placeholder));\n anchor.classList.remove(PLACEHOLDER_CLASS);\n anchor.classList.add('cdk-drag-anchor');\n\n // Clear the transform since the single-axis strategy uses transforms to sort the items.\n anchor.style.transform = '';\n\n // When the item leaves the initial container, the container's DOM will be restored to\n // its original state, except for the dragged item which is removed. Insert the anchor in\n // the position from which the item left so that the list looks consistent.\n if (nextItemElement) {\n nextItemElement.before(anchor);\n } else {\n coerceElement(exitContainer.element).appendChild(anchor);\n }\n }\n }\n}\n\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/** Callback invoked for `selectstart` events inside the shadow DOM. */\nfunction shadowDomSelectStart(event: Event) {\n event.preventDefault();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Direction} from '../../bidi';\nimport {DragDropRegistry} from '../drag-drop-registry';\nimport {moveItemInArray} from '../drag-utils';\nimport {combineTransforms} from '../dom/styling';\nimport {adjustDomRect, getMutableClientRect, isInsideClientRect} from '../dom/dom-rect';\nimport {DropListSortStrategy, SortPredicate} from './drop-list-sort-strategy';\nimport type {DragRef} from '../drag-ref';\n\n/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition<T> {\n /** Instance of the drag item. */\n drag: T;\n /** Dimensions of the item. */\n clientRect: DOMRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n /** Inline transform that the drag item had when dragging started. */\n initialTransform: string;\n}\n\n/**\n * Strategy that only supports sorting along a single axis.\n * Items are reordered using CSS transforms which allows for sorting to be animated.\n * @docs-private\n */\nexport class SingleAxisSortStrategy implements DropListSortStrategy {\n /** Root element container of the drop list. */\n private _element: HTMLElement;\n\n /** Function used to determine if an item can be sorted into a specific index. */\n private _sortPredicate: SortPredicate<DragRef>;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition<DragRef>[] = [];\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * that were there at the start of the sequence, as well as any items that have been dragged\n * in, but haven't been dropped yet.\n */\n private _activeDraggables: DragRef[];\n\n /** Direction in which the list is oriented. */\n orientation: 'vertical' | 'horizontal' = 'vertical';\n\n /** Layout direction of the drop list. */\n direction: Direction;\n\n constructor(private _dragDropRegistry: DragDropRegistry) {}\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {\n drag: null as DragRef | null,\n delta: 0,\n overlaps: false,\n };\n\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items: readonly DragRef[]) {\n this.withItems(items);\n }\n\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(item: DragRef, pointerX: number, pointerY: number, pointerDelta: {x: number; y: number}) {\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return null;\n }\n\n const isHorizontal = this.orientation === 'horizontal';\n const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem\n ? item.getPlaceholderElement()\n : sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n\n const transformAmount = Math.round(sibling.offset * (1 / sibling.drag.scale));\n\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = combineTransforms(\n `translate3d(${transformAmount}px, 0, 0)`,\n sibling.initialTransform,\n );\n adjustDomRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = combineTransforms(\n `translate3d(0, ${transformAmount}px, 0)`,\n sibling.initialTransform,\n );\n adjustDomRect(sibling.clientRect, offset, 0);\n }\n });\n\n // Note that it's important that we do this after the client rects have been adjusted.\n this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY);\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n\n return {previousIndex: currentIndex, currentIndex: newIndex};\n }\n\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n const newIndex =\n index == null || index < 0\n ? // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference: DragRef | undefined = activeDraggables[newIndex];\n\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n\n // If we didn't find a new position reference, it means that either the item didn't start off\n // in this container, or that the item requested to be inserted at the end of the list.\n if (\n !newPositionReference &&\n (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) &&\n this._shouldEnterAsFirstChild(pointerX, pointerY)\n ) {\n newPositionReference = activeDraggables[0];\n }\n\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement!.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n } else {\n this._element.appendChild(placeholder);\n activeDraggables.push(item);\n }\n\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n\n // Note that usually `start` is called together with `enter` when an item goes into a new\n // container. This will cache item positions, but we need to refresh them since the amount\n // of items has changed.\n this._cacheItemPositions();\n }\n\n /** Sets the items that are currently part of the list. */\n withItems(items: readonly DragRef[]): void {\n this._activeDraggables = items.slice();\n this._cacheItemPositions();\n }\n\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate: SortPredicate<DragRef>): void {\n this._sortPredicate = predicate;\n }\n\n /** Resets the strategy to its initial state before dragging was started. */\n reset() {\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables?.forEach(item => {\n const rootElement = item.getRootElement();\n\n if (rootElement) {\n const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform;\n rootElement.style.transform = initialTransform || '';\n }\n });\n\n this._itemPositions = [];\n this._activeDraggables = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n }\n\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot(): readonly DragRef[] {\n return this._activeDraggables;\n }\n\n /** Gets the index of a specific item. */\n getItemIndex(item: DragRef): number {\n return this._getVisualItemPositions().findIndex(currentItem => currentItem.drag === item);\n }\n\n /** Gets the item at a specific index. */\n getItemAtIndex(index: number): DragRef | null {\n return this._getVisualItemPositions()[index]?.drag || null;\n }\n\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(topDifference: number, leftDifference: number) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({clientRect}) => {\n adjustDomRect(clientRect, topDifference, leftDifference);\n });\n\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({drag}) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n\n withElementContainer(container: HTMLElement): void {\n this._element = container;\n }\n\n /** Refreshes the position cache of the items and sibling containers. */\n private _cacheItemPositions() {\n const isHorizontal = this.orientation === 'horizontal';\n\n this._itemPositions = this._activeDraggables\n .map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {\n drag,\n offset: 0,\n initialTransform: elementToMeasure.style.transform || '',\n clientRect: getMutableClientRect(elementToMeasure),\n };\n })\n .sort((a, b) => {\n return isHorizontal\n ? a.clientRect.left - b.clientRect.left\n : a.clientRect.top - b.clientRect.top;\n });\n }\n\n private _getVisualItemPositions() {\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n return this.orientation === 'horizontal' && this.direction === 'rtl'\n ? this._itemPositions.slice().reverse()\n : this._itemPositions;\n }\n\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n private _getItemOffsetPx(currentPosition: DOMRect, newPosition: DOMRect, delta: 1 | -1) {\n const isHorizontal = this.orientation === 'horizontal';\n let itemOffset = isHorizontal\n ? newPosition.left - currentPosition.left\n : newPosition.top - currentPosition.top;\n\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal\n ? newPosition.width - currentPosition.width\n : newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\n }\n\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n private _getSiblingOffsetPx(\n currentIndex: number,\n siblings: CachedItemPosition<DragRef>[],\n delta: 1 | -1,\n ) {\n const isHorizontal = this.orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n } else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n\n return siblingOffset;\n }\n\n /**\n * Checks if pointer is entering in the first position\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n private _shouldEnterAsFirstChild(pointerX: number, pointerY: number) {\n if (!this._activeDraggables.length) {\n return false;\n }\n\n const itemPositions = this._itemPositions;\n const isHorizontal = this.orientation === 'horizontal';\n\n // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index\n // check if container is using some sort of \"reverse\" ordering (eg: flex-direction: row-reverse)\n const reversed = itemPositions[0].drag !== this._activeDraggables[0];\n if (reversed) {\n const lastItemRect = itemPositions[itemPositions.length - 1].clientRect;\n return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom;\n } else {\n const firstItemRect = itemPositions[0].clientRect;\n return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top;\n }\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n delta?: {x: number; y: number},\n ): number {\n const isHorizontal = this.orientation === 'horizontal';\n const index = this._itemPositions.findIndex(({drag, clientRect}) => {\n // Skip the item itself.\n if (drag === item) {\n return false;\n }\n\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n\n // If the user is still hovering over the same item as last time, their cursor hasn't left\n // the item after we made the swap, and they didn't change the direction in which they're\n // dragging, we don't consider it a direction swap.\n if (\n drag === this._previousSwap.drag &&\n this._previousSwap.overlaps &&\n direction === this._previousSwap.delta\n ) {\n return false;\n }\n }\n\n return isHorizontal\n ? // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right)\n : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom);\n });\n\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_getShadowRoot} from '../../platform';\nimport {moveItemInArray} from '../drag-utils';\nimport {DropListSortStrategy, SortPredicate} from './drop-list-sort-strategy';\nimport {DragDropRegistry} from '../drag-drop-registry';\nimport type {DragRef} from '../drag-ref';\n\n/**\n * Strategy that only supports sorting on a list that might wrap.\n * Items are reordered by moving their DOM nodes around.\n * @docs-private\n */\nexport class MixedSortStrategy implements DropListSortStrategy {\n /** Root element container of the drop list. */\n private _element: HTMLElement;\n\n /** Function used to determine if an item can be sorted into a specific index. */\n private _sortPredicate: SortPredicate<DragRef>;\n\n /** Lazily-resolved root node containing the list. Use `_getRootNode` to read this. */\n private _rootNode: DocumentOrShadowRoot | undefined;\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * that were there at the start of the sequence, as well as any items that have been dragged\n * in, but haven't been dropped yet.\n */\n private _activeItems: DragRef[];\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {\n drag: null as DragRef | null,\n deltaX: 0,\n deltaY: 0,\n overlaps: false,\n };\n\n /**\n * Keeps track of the relationship between a node and its next sibling. This information\n * is used to restore the DOM to the order it was in before dragging started.\n */\n private _relatedNodes: [node: Node, nextSibling: Node | null][] = [];\n\n constructor(\n private _document: Document,\n private _dragDropRegistry: DragDropRegistry,\n ) {}\n\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items: readonly DragRef[]): void {\n const childNodes = this._element.childNodes;\n this._relatedNodes = [];\n\n for (let i = 0; i < childNodes.length; i++) {\n const node = childNodes[i];\n this._relatedNodes.push([node, node.nextSibling]);\n }\n\n this.withItems(items);\n }\n\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n pointerDelta: {x: number; y: number},\n ): {previousIndex: number; currentIndex: number} | null {\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n const previousSwap = this._previousSwap;\n\n if (newIndex === -1 || this._activeItems[newIndex] === item) {\n return null;\n }\n\n const toSwapWith = this._activeItems[newIndex];\n\n // Prevent too many swaps over the same item.\n if (\n previousSwap.drag === toSwapWith &&\n previousSwap.overlaps &&\n previousSwap.deltaX === pointerDelta.x &&\n previousSwap.deltaY === pointerDelta.y\n ) {\n return null;\n }\n\n const previousIndex = this.getItemIndex(item);\n const current = item.getPlaceholderElement();\n const overlapElement = toSwapWith.getRootElement();\n\n if (newIndex > previousIndex) {\n overlapElement.after(current);\n } else {\n overlapElement.before(current);\n }\n\n moveItemInArray(this._activeItems, previousIndex, newIndex);\n\n const newOverlapElement = this._getRootNode().elementFromPoint(pointerX, pointerY);\n // Note: it's tempting to save the entire `pointerDelta` object here, however that'll\n // break this functionality, because the same object is passed for all `sort` calls.\n previousSwap.deltaX = pointerDelta.x;\n previousSwap.deltaY = pointerDelta.y;\n previousSwap.drag = toSwapWith;\n previousSwap.overlaps =\n overlapElement === newOverlapElement || overlapElement.contains(newOverlapElement);\n\n return {\n previousIndex,\n currentIndex: newIndex,\n };\n }\n\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n // Remove the item from current set of items first so that it doesn't throw off the indexes\n // further down in this method. See https://github.com/angular/components/issues/31505\n const currentIndex = this._activeItems.indexOf(item);\n\n if (currentIndex > -1) {\n this._activeItems.splice(currentIndex, 1);\n }\n\n let enterIndex =\n index == null || index < 0\n ? this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n\n // In some cases (e.g. when the container has padding) we might not be able to figure\n // out which item to insert the dragged item next to, because the pointer didn't overlap\n // with anything. In that case we find the item that's closest to the pointer.\n if (enterIndex === -1) {\n enterIndex = this._getClosestItemIndexToPointer(item, pointerX, pointerY);\n }\n\n const targetItem = this._activeItems[enterIndex] as DragRef | undefined;\n\n if (targetItem && !this._dragDropRegistry.isDragging(targetItem)) {\n this._activeItems.splice(enterIndex, 0, item);\n targetItem.getRootElement().before(item.getPlaceholderElement());\n } else {\n this._activeItems.push(item);\n this._element.appendChild(item.getPlaceholderElement());\n }\n }\n\n /** Sets the items that are currently part of the list. */\n withItems(items: readonly DragRef[]): void {\n this._activeItems = items.slice();\n }\n\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate: SortPredicate<DragRef>): void {\n this._sortPredicate = predicate;\n }\n\n /** Resets the strategy to its initial state before dragging was started. */\n reset(): void {\n const root = this._element;\n const previousSwap = this._previousSwap;\n\n // Moving elements around in the DOM can break things like the `@for` loop, because it\n // uses comment nodes to know where to insert elements. To avoid such issues, we restore\n // the DOM nodes in the list to their original order when the list is reset.\n // Note that this could be simpler if we just saved all the nodes, cleared the root\n // and then appended them in the original order. We don't do it, because it can break\n // down depending on when the snapshot was taken. E.g. we may end up snapshotting the\n // placeholder element which is removed after dragging.\n for (let i = this._relatedNodes.length - 1; i > -1; i--) {\n const [node, nextSibling] = this._relatedNodes[i];\n if (node.parentNode === root && node.nextSibling !== nextSibling) {\n if (nextSibling === null) {\n root.appendChild(node);\n } else if (nextSibling.parentNode === root) {\n root.insertBefore(node, nextSibling);\n }\n }\n }\n\n this._relatedNodes = [];\n this._activeItems = [];\n previousSwap.drag = null;\n previousSwap.deltaX = previousSwap.deltaY = 0;\n previousSwap.overlaps = false;\n }\n\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot(): readonly DragRef[] {\n return this._activeItems;\n }\n\n /** Gets the index of a specific item. */\n getItemIndex(item: DragRef): number {\n return this._activeItems.indexOf(item);\n }\n\n /** Gets the item at a specific index. */\n getItemAtIndex(index: number): DragRef | null {\n return this._activeItems[index] || null;\n }\n\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(): void {\n this._activeItems.forEach(item => {\n if (this._dragDropRegistry.isDragging(item)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n item._sortFromLastPointerPosition();\n }\n });\n }\n\n withElementContainer(container: HTMLElement): void {\n if (container !== this._element) {\n this._element = container;\n this._rootNode = undefined;\n }\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n ): number {\n const elementAtPoint = this._getRootNode().elementFromPoint(\n Math.floor(pointerX),\n Math.floor(pointerY),\n );\n const index = elementAtPoint\n ? this._activeItems.findIndex(item => {\n const root = item.getRootElement();\n return elementAtPoint === root || root.contains(elementAtPoint);\n })\n : -1;\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n\n /** Lazily resolves the list's root node. */\n private _getRootNode(): DocumentOrShadowRoot {\n // Resolve the root node lazily to ensure that the drop list is in its final place in the DOM.\n if (!this._rootNode) {\n this._rootNode = _getShadowRoot(this._element) || this._document;\n }\n return this._rootNode;\n }\n\n /**\n * Finds the index of the item that's closest to the item being dragged.\n * @param item Item being dragged.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n private _getClosestItemIndexToPointer(item: DragRef, pointerX: number, pointerY: number): number {\n if (this._activeItems.length === 0) {\n return -1;\n }\n\n if (this._activeItems.length === 1) {\n return 0;\n }\n\n let minDistance = Infinity;\n let minIndex = -1;\n\n // Find the Euclidean distance (https://en.wikipedia.org/wiki/Euclidean_distance) between each\n // item and the pointer, and return the smallest one. Note that this is a bit flawed in that DOM\n // nodes are rectangles, not points, so we use the top/left coordinates. It should be enough\n // for our purposes.\n for (let i = 0; i < this._activeItems.length; i++) {\n const current = this._activeItems[i];\n if (current !== item) {\n const {x, y} = current.getRootElement().getBoundingClientRect();\n const distance = Math.hypot(pointerX - x, pointerY - y);\n\n if (distance < minDistance) {\n minDistance = distance;\n minIndex = i;\n }\n }\n }\n\n return minIndex;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '../bidi';\nimport {coerceElement} from '../coercion';\nimport {ViewportRuler} from '../scrolling';\nimport {_getShadowRoot} from '../platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport type {DragRef, Point} from './drag-ref';\nimport {isPointerNearDomRect, isInsideClientRect} from './dom/dom-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {DragCSSStyleDeclaration} from './dom/styling';\nimport {DropListSortStrategy} from './sorting/drop-list-sort-strategy';\nimport {SingleAxisSortStrategy} from './sorting/single-axis-sort-strategy';\nimport {MixedSortStrategy} from './sorting/mixed-sort-strategy';\nimport {DropListOrientation} from './directives/config';\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n\n/** Vertical direction in which we can auto-scroll. */\nenum AutoScrollVerticalDirection {\n NONE,\n UP,\n DOWN,\n}\n\n/** Horizontal direction in which we can auto-scroll. */\nenum AutoScrollHorizontalDirection {\n NONE,\n LEFT,\n RIGHT,\n}\n\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nexport class DropListRef<T = any> {\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean = false;\n\n /** Whether sorting items within the list is disabled. */\n sortingDisabled: boolean = false;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y' | null = null;\n\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n autoScrollDisabled: boolean = false;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n autoScrollStep: number = 2;\n\n /**\n * Whether the items in the list should leave an anchor node when leaving the initial container.\n */\n hasAnchor: boolean = false;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n enterPredicate: (drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Function that is used to determine whether an item can be sorted into a particular index. */\n sortPredicate: (index: number, drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Emits right before dragging has started. */\n readonly beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n readonly entered = new Subject<{item: DragRef; container: DropListRef; currentIndex: number}>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n readonly exited = new Subject<{item: DragRef; container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n readonly dropped = new Subject<{\n item: DragRef;\n currentIndex: number;\n previousIndex: number;\n container: DropListRef;\n previousContainer: DropListRef;\n isPointerOverContainer: boolean;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n readonly sorted = new Subject<{\n previousIndex: number;\n currentIndex: number;\n container: DropListRef;\n item: DragRef;\n }>();\n\n /** Emits when a dragging sequence is started in a list connected to the current one. */\n readonly receivingStarted = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n items: DragRef[];\n }>();\n\n /** Emits when a dragging sequence is stopped from a list connected to the current one. */\n readonly receivingStopped = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Element that is the direct parent of the drag items. */\n private _container: HTMLElement;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Keeps track of the positions of any parent scrollable elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Strategy being used to sort items within the list. */\n private _sortStrategy: DropListSortStrategy;\n\n /** Cached `DOMRect` of the drop list. */\n private _domRect: DOMRect | undefined;\n\n /** Draggable items in the container. */\n private _draggables: readonly DragRef[] = [];\n\n /** Drop lists that are connected to the current one. */\n private _siblings: readonly DropListRef[] = [];\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Subscription to the window being scrolled. */\n private _viewportScrollSubscription = Subscription.EMPTY;\n\n /** Vertical direction in which the list is currently scrolling. */\n private _verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n\n /** Horizontal direction in which the list is currently scrolling. */\n private _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n /** Node that is being auto-scrolled. */\n private _scrollNode: HTMLElement | Window;\n\n /** Used to signal to the current auto-scroll sequence when to stop. */\n private readonly _stopScrollTimers = new Subject<void>();\n\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n private _cachedShadowRoot: DocumentOrShadowRoot | null = null;\n\n /** Reference to the document. */\n private _document: Document;\n\n /** Elements that can be scrolled while the user is dragging. */\n private _scrollableElements: HTMLElement[] = [];\n\n /** Initial value for the element's `scroll-snap-type` style. */\n private _initialScrollSnap: string;\n\n /** Direction of the list's layout. */\n private _direction: Direction = 'ltr';\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n ) {\n const coercedElement = (this.element = coerceElement(element));\n this._document = _document;\n this.withOrientation('vertical').withElementContainer(coercedElement);\n _dragDropRegistry.registerDropContainer(this);\n this._parentPositions = new ParentPositionTracker(_document);\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this.receivingStarted.complete();\n this.receivingStopped.complete();\n this._activeSiblings.clear();\n this._scrollNode = null!;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n\n /** Starts dragging an item. */\n start(): void {\n this._draggingStarted();\n this._notifyReceivingSiblings();\n }\n\n /**\n * Attempts to move an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n this._draggingStarted();\n\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n if (index == null && this.sortingDisabled) {\n index = this._draggables.indexOf(item);\n }\n\n this._sortStrategy.enter(item, pointerX, pointerY, index);\n\n // Note that this usually happens inside `_draggingStarted` as well, but the dimensions\n // can change when the sort strategy moves the item around inside `enter`.\n this._cacheParentPositions();\n\n // Notify siblings at the end so that the item has been inserted into the `activeDraggables`.\n this._notifyReceivingSiblings();\n this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)});\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item: DragRef): void {\n this._reset();\n this.exited.next({item, container: this});\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousIndex Index of the item when dragging started.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param event Event that triggered the dropping sequence.\n *\n * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.\n */\n drop(\n item: DragRef,\n currentIndex: number,\n previousIndex: number,\n previousContainer: DropListRef,\n isPointerOverContainer: boolean,\n distance: Point,\n dropPoint: Point,\n event: MouseEvent | TouchEvent = {} as any,\n ): void {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance,\n dropPoint,\n event,\n });\n }\n\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items: DragRef[]): this {\n const previousItems = this._draggables;\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n\n if (this.isDragging()) {\n const draggedItems = previousItems.filter(item => item.isDragging());\n\n // If all of the items being dragged were removed\n // from the list, abort the current drag sequence.\n if (draggedItems.every(item => items.indexOf(item) === -1)) {\n this._reset();\n } else {\n this._sortStrategy.withItems(this._draggables);\n }\n }\n\n return this;\n }\n\n /** Sets the layout direction of the drop list. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n if (this._sortStrategy instanceof SingleAxisSortStrategy) {\n this._sortStrategy.direction = direction;\n }\n return this;\n }\n\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo: DropListRef[]): this {\n this._siblings = connectedTo.slice();\n return this;\n }\n\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation: DropListOrientation): this {\n if (orientation === 'mixed') {\n this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry);\n } else {\n const strategy = new SingleAxisSortStrategy(this._dragDropRegistry);\n strategy.direction = this._direction;\n strategy.orientation = orientation;\n this._sortStrategy = strategy;\n }\n this._sortStrategy.withElementContainer(this._container);\n this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));\n return this;\n }\n\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements: HTMLElement[]): this {\n const element = this._container;\n\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n\n /**\n * Configures the drop list so that a different element is used as the container for the\n * dragged items. This is useful for the cases when one might not have control over the\n * full DOM that sets up the dragging.\n * Note that the alternate container needs to be a descendant of the drop list.\n * @param container New element container to be assigned.\n */\n withElementContainer(container: HTMLElement): this {\n if (container === this._container) {\n return this;\n }\n\n const element = coerceElement(this.element);\n\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n container !== element &&\n !element.contains(container)\n ) {\n throw new Error(\n 'Invalid DOM structure for drop list. Alternate container element must be a descendant of the drop list.',\n );\n }\n\n const oldContainerIndex = this._scrollableElements.indexOf(this._container);\n const newContainerIndex = this._scrollableElements.indexOf(container);\n\n if (oldContainerIndex > -1) {\n this._scrollableElements.splice(oldContainerIndex, 1);\n }\n\n if (newContainerIndex > -1) {\n this._scrollableElements.splice(newContainerIndex, 1);\n }\n\n if (this._sortStrategy) {\n this._sortStrategy.withElementContainer(container);\n }\n\n this._cachedShadowRoot = null;\n this._scrollableElements.unshift(container);\n this._container = container;\n return this;\n }\n\n /** Gets the scrollable parents that are registered with this drop container. */\n getScrollableParents(): readonly HTMLElement[] {\n return this._scrollableElements;\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item: DragRef): number {\n return this._isDragging\n ? this._sortStrategy.getItemIndex(item)\n : this._draggables.indexOf(item);\n }\n\n /**\n * Gets the item at a specific index.\n * @param index Index at which to retrieve the item.\n */\n getItemAtIndex(index: number): DragRef | null {\n return this._isDragging\n ? this._sortStrategy.getItemAtIndex(index)\n : this._draggables[index] || null;\n }\n\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving(): boolean {\n return this._activeSiblings.size > 0;\n }\n\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n pointerDelta: {x: number; y: number},\n ): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (\n this.sortingDisabled ||\n !this._domRect ||\n !isPointerNearDomRect(this._domRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)\n ) {\n return;\n }\n\n const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta);\n\n if (result) {\n this.sorted.next({\n previousIndex: result.previousIndex,\n currentIndex: result.currentIndex,\n container: this,\n item,\n });\n }\n }\n\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX: number, pointerY: number) {\n if (this.autoScrollDisabled) {\n return;\n }\n\n let scrollNode: HTMLElement | Window | undefined;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.positions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n\n if (isPointerNearDomRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement,\n position.clientRect,\n this._direction,\n pointerX,\n pointerY,\n );\n\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element as HTMLElement;\n }\n }\n });\n\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const {width, height} = this._viewportRuler.getViewportSize();\n const domRect = {\n width,\n height,\n top: 0,\n right: width,\n bottom: height,\n left: 0,\n } as DOMRect;\n verticalScrollDirection = getVerticalScrollDirection(domRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(domRect, pointerX);\n scrollNode = window;\n }\n\n if (\n scrollNode &&\n (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)\n ) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._stopScrolling();\n }\n }\n }\n\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n\n /** Starts the dragging sequence within the list. */\n private _draggingStarted() {\n const styles = this._container.style as DragCSSStyleDeclaration;\n this.beforeStarted.next();\n this._isDragging = true;\n\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n // Prevent the check from running on apps not using an alternate container. Ideally we\n // would always run it, but introducing it at this stage would be a breaking change.\n this._container !== coerceElement(this.element)\n ) {\n for (const drag of this._draggables) {\n if (!drag.isDragging() && drag.getVisibleElement().parentNode !== this._container) {\n throw new Error(\n 'Invalid DOM structure for drop list. All items must be placed directly inside of the element container.',\n );\n }\n }\n }\n\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';\n styles.scrollSnapType = styles.msScrollSnapType = 'none';\n this._sortStrategy.start(this._draggables);\n this._cacheParentPositions();\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n this._parentPositions.cache(this._scrollableElements);\n\n // The list element is always in the `scrollableElements`\n // so we can take advantage of the cached `DOMRect`.\n this._domRect = this._parentPositions.positions.get(this._container)!.clientRect!;\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n const styles = this._container.style as DragCSSStyleDeclaration;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._sortStrategy.reset();\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n\n /** Starts the interval that'll auto-scroll the element. */\n private _startScrollInterval = () => {\n this._stopScrolling();\n\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n const scrollStep = this.autoScrollStep;\n\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n node.scrollBy(0, -scrollStep);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n node.scrollBy(0, scrollStep);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n node.scrollBy(-scrollStep, 0);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n node.scrollBy(scrollStep, 0);\n }\n });\n };\n\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x: number, y: number): boolean {\n return this._domRect != null && isInsideClientRect(this._domRect, x, y);\n }\n\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item: DragRef, x: number, y: number): DropListRef | undefined {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item: DragRef, x: number, y: number): boolean {\n if (\n !this._domRect ||\n !isInsideClientRect(this._domRect, x, y) ||\n !this.enterPredicate(item, this)\n ) {\n return false;\n }\n\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y) as HTMLElement | null;\n\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n\n // The `DOMRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === this._container || this._container.contains(elementFromPoint);\n }\n\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling: DropListRef, items: DragRef[]) {\n const activeSiblings = this._activeSiblings;\n\n if (\n !activeSiblings.has(sibling) &&\n items.every(item => {\n // Note that we have to add an exception to the `enterPredicate` for items that started off\n // in this drop list. The drag ref has logic that allows an item to return to its initial\n // container, if it has left the initial container and none of the connected containers\n // allow it to enter. See `DragRef._updateActiveDropContainer` for more context.\n return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1;\n })\n ) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n this.receivingStarted.next({\n initiator: sibling,\n receiver: this,\n items,\n });\n }\n }\n\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling: DropListRef) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n this.receivingStopped.next({initiator: sibling, receiver: this});\n }\n\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n private _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left);\n }\n } else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): DocumentOrShadowRoot {\n if (!this._cachedShadowRoot) {\n const shadowRoot = _getShadowRoot(this._container);\n this._cachedShadowRoot = shadowRoot || this._document;\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Notifies any siblings that may potentially receive the item. */\n private _notifyReceivingSiblings() {\n const draggedItems = this._sortStrategy\n .getActiveItemsSnapshot()\n .filter(item => item.isDragging());\n this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));\n }\n}\n\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect: DOMRect, pointerY: number) {\n const {top, bottom, height} = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n\n return AutoScrollVerticalDirection.NONE;\n}\n\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect: DOMRect, pointerX: number) {\n const {left, right, width} = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n\n return AutoScrollHorizontalDirection.NONE;\n}\n\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param direction Layout direction of the drop list.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(\n element: HTMLElement,\n clientRect: DOMRect,\n direction: Direction,\n pointerX: number,\n pointerY: number,\n): [AutoScrollVerticalDirection, AutoScrollHorizontalDirection] {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n } else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n\n if (direction === 'rtl') {\n if (computedHorizontal === AutoScrollHorizontalDirection.RIGHT) {\n // In RTL `scrollLeft` will be negative when scrolled.\n if (scrollLeft < 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n } else if (element.scrollWidth + scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else {\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n }\n\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n Injectable,\n ListenerOptions,\n NgZone,\n OnDestroy,\n RendererFactory2,\n ViewEncapsulation,\n WritableSignal,\n inject,\n signal,\n DOCUMENT,\n} from '@angular/core';\n\nimport {_CdkPrivateStyleLoader} from '../private';\nimport {Observable, Observer, Subject, merge} from 'rxjs';\nimport type {DropListRef} from './drop-list-ref';\nimport type {DragRef} from './drag-ref';\nimport type {CdkDrag} from './directives/drag';\n\n/** Event options that can be used to bind a capturing event. */\nconst capturingEventOptions = {\n capture: true,\n};\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = {\n passive: false,\n capture: true,\n};\n\n/**\n * Component used to load the drag&drop reset styles.\n * @docs-private\n */\n@Component({\n styleUrl: 'resets.css',\n encapsulation: ViewEncapsulation.None,\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'cdk-drag-resets-container': ''},\n})\nexport class _ResetsLoader {}\n\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry implements OnDestroy {\n private _ngZone = inject(NgZone);\n private _document = inject(DOCUMENT);\n private _styleLoader = inject(_CdkPrivateStyleLoader);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n private _cleanupDocumentTouchmove: (() => void) | undefined;\n private _scroll: Subject<Event> = new Subject<Event>();\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<DropListRef>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<DragRef>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances: WritableSignal<DragRef[]> = signal([]);\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners: (() => void)[] | undefined;\n\n /**\n * Predicate function to check if an item is being dragged. Moved out into a property,\n * because it'll be called a lot and we don't want to create a new function every time.\n */\n private _draggingPredicate = (item: DragRef) => item.isDragging();\n\n /**\n * Map tracking DOM nodes and their corresponding drag directives. Note that this is different\n * from looking through the `_dragInstances` and getting their root node, because the root node\n * isn't necessarily the node that the directive is set on.\n */\n private _domNodesToDirectives: WeakMap<Node, CdkDrag> | null = null;\n\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerMove: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: DropListRef) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag: DragRef) {\n this._dragInstances.add(drag);\n\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._cleanupDocumentTouchmove?.();\n this._cleanupDocumentTouchmove = this._renderer.listen(\n this._document,\n 'touchmove',\n this._persistentTouchmoveListener,\n activeCapturingEventOptions,\n );\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: DropListRef) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: DragRef) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._cleanupDocumentTouchmove?.();\n }\n }\n\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag: DragRef, event: TouchEvent | MouseEvent) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances().indexOf(drag) > -1) {\n return;\n }\n\n this._styleLoader.load(_ResetsLoader);\n this._activeDragInstances.update(instances => [...instances, drag]);\n\n if (this._activeDragInstances().length === 1) {\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n const isTouchEvent = event.type.startsWith('touch');\n const endEventHandler = (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent);\n\n const toBind: [name: string, handler: (event: Event) => void, options: ListenerOptions][] = [\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n ['scroll', (e: Event) => this._scroll.next(e), capturingEventOptions],\n\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n ['selectstart', this._preventDefaultWhileDragging, activeCapturingEventOptions],\n ];\n\n if (isTouchEvent) {\n toBind.push(\n ['touchend', endEventHandler, capturingEventOptions],\n ['touchcancel', endEventHandler, capturingEventOptions],\n );\n } else {\n toBind.push(['mouseup', endEventHandler, capturingEventOptions]);\n }\n\n // We don't have to bind a move event for touch drag sequences, because\n // we already have a persistent global one bound from `registerDragItem`.\n if (!isTouchEvent) {\n toBind.push([\n 'mousemove',\n (e: Event) => this.pointerMove.next(e as MouseEvent),\n activeCapturingEventOptions,\n ]);\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners = toBind.map(([name, handler, options]) =>\n this._renderer.listen(this._document, name, handler, options),\n );\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: DragRef) {\n this._activeDragInstances.update(instances => {\n const index = instances.indexOf(drag);\n if (index > -1) {\n instances.splice(index, 1);\n return [...instances];\n }\n return instances;\n });\n\n if (this._activeDragInstances().length === 0) {\n this._clearGlobalListeners();\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: DragRef) {\n return this._activeDragInstances().indexOf(drag) > -1;\n }\n\n /**\n * Gets a stream that will emit when any element on the page is scrolled while an item is being\n * dragged.\n * @param shadowRoot Optional shadow root that the current dragging sequence started from.\n * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can\n * be used to include an additional top-level listener at the shadow root level.\n */\n scrolled(shadowRoot?: DocumentOrShadowRoot | null): Observable<Event> {\n const streams: Observable<Event>[] = [this._scroll];\n\n if (shadowRoot && shadowRoot !== this._document) {\n // Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,\n // because we want to guarantee that the event is bound outside of the `NgZone`. With\n // `fromEvent` it'll only happen if the subscription is outside the `NgZone`.\n streams.push(\n new Observable((observer: Observer<Event>) => {\n return this._ngZone.runOutsideAngular(() => {\n const cleanup = this._renderer.listen(\n shadowRoot as ShadowRoot,\n 'scroll',\n (event: Event) => {\n if (this._activeDragInstances().length) {\n observer.next(event);\n }\n },\n capturingEventOptions,\n );\n\n return () => {\n cleanup();\n };\n });\n }),\n );\n }\n\n return merge(...streams);\n }\n\n /**\n * Tracks the DOM node which has a draggable directive.\n * @param node Node to track.\n * @param dragRef Drag directive set on the node.\n */\n registerDirectiveNode(node: Node, dragRef: CdkDrag): void {\n this._domNodesToDirectives ??= new WeakMap();\n this._domNodesToDirectives.set(node, dragRef);\n }\n\n /**\n * Stops tracking a draggable directive node.\n * @param node Node to stop tracking.\n */\n removeDirectiveNode(node: Node): void {\n this._domNodesToDirectives?.delete(node);\n }\n\n /**\n * Gets the drag directive corresponding to a specific DOM node, if any.\n * @param node Node for which to do the lookup.\n */\n getDragDirectiveForNode(node: Node): CdkDrag | null {\n return this._domNodesToDirectives?.get(node) || null;\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._domNodesToDirectives = null;\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n private _preventDefaultWhileDragging = (event: Event) => {\n if (this._activeDragInstances().length > 0) {\n event.preventDefault();\n }\n };\n\n /** Event listener for `touchmove` that is bound even if no dragging is happening. */\n private _persistentTouchmoveListener = (event: TouchEvent) => {\n if (this._activeDragInstances().length > 0) {\n // Note that we only want to prevent the default action after dragging has actually started.\n // Usually this is the same time at which the item is added to the `_activeDragInstances`,\n // but it could be pushed back if the user has set up a drag delay or threshold.\n if (this._activeDragInstances().some(this._draggingPredicate)) {\n event.preventDefault();\n }\n\n this.pointerMove.next(event);\n }\n };\n\n /** Clears out the global event listeners from the `document`. */\n private _clearGlobalListeners() {\n this._globalListeners?.forEach(cleanup => cleanup());\n this._globalListeners = undefined;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, NgZone, ElementRef, inject, RendererFactory2, DOCUMENT} from '@angular/core';\n\nimport {ViewportRuler} from '../scrolling';\nimport {DragRef, DragRefConfig} from './drag-ref';\nimport {DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5,\n};\n\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\n@Injectable({providedIn: 'root'})\nexport class DragDrop {\n private _document = inject(DOCUMENT);\n private _ngZone = inject(NgZone);\n private _viewportRuler = inject(ViewportRuler);\n private _dragDropRegistry = inject(DragDropRegistry);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag<T = any>(\n element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG,\n ): DragRef<T> {\n return new DragRef<T>(\n element,\n config,\n this._document,\n this._ngZone,\n this._viewportRuler,\n this._dragDropRegistry,\n this._renderer,\n );\n }\n\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T> {\n return new DropListRef<T>(\n element,\n this._dragDropRegistry,\n this._document,\n this._ngZone,\n this._viewportRuler,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport type {CdkDrag} from './directives/drag';\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nexport const CDK_DRAG_PARENT = new InjectionToken<CdkDrag>('CDK_DRAG_PARENT');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Asserts that a particular node is an element.\n * @param node Node to be checked.\n * @param name Name to attach to the error message.\n */\nexport function assertElementNode(node: Node, name: string): asserts node is HTMLElement {\n if (node.nodeType !== 1) {\n throw Error(\n `${name} must be attached to an element node. ` + `Currently attached to \"${node.nodeName}\".`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n AfterViewInit,\n Directive,\n ElementRef,\n InjectionToken,\n Input,\n OnDestroy,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport type {CdkDrag} from './drag';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {assertElementNode} from './assertions';\nimport {DragDropRegistry} from '../drag-drop-registry';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as\n * alternative token to the actual `CdkDragHandle` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_HANDLE = new InjectionToken<CdkDragHandle>('CdkDragHandle');\n\n/** Handle that can be used to drag a CdkDrag instance. */\n@Directive({\n selector: '[cdkDragHandle]',\n host: {\n 'class': 'cdk-drag-handle',\n },\n providers: [{provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle}],\n})\nexport class CdkDragHandle implements AfterViewInit, OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private _parentDrag = inject<CdkDrag>(CDK_DRAG_PARENT, {optional: true, skipSelf: true});\n private _dragDropRegistry = inject(DragDropRegistry);\n\n /** Emits when the state of the handle has changed. */\n readonly _stateChanges = new Subject<CdkDragHandle>();\n\n /** Whether starting to drag through this handle is disabled. */\n @Input({alias: 'cdkDragHandleDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = value;\n this._stateChanges.next(this);\n }\n private _disabled = false;\n\n constructor(...args: unknown[]);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(this.element.nativeElement, 'cdkDragHandle');\n }\n\n this._parentDrag?._addHandle(this);\n }\n\n ngAfterViewInit() {\n if (!this._parentDrag) {\n let parent = this.element.nativeElement.parentElement;\n while (parent) {\n const ref = this._dragDropRegistry.getDragDirectiveForNode(parent);\n if (ref) {\n this._parentDrag = ref;\n ref._addHandle(this);\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n ngOnDestroy() {\n this._parentDrag?._removeHandle(this);\n this._stateChanges.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {DragRefConfig, DragConstrainPosition} from '../drag-ref';\n\n/** Possible values that can be used to configure the drag start delay. */\nexport type DragStartDelay = number | {touch: number; mouse: number};\n\n/** Possible axis along which dragging can be locked. */\nexport type DragAxis = 'x' | 'y';\n\n/** Possible orientations for a drop list. */\nexport type DropListOrientation = 'horizontal' | 'vertical' | 'mixed';\n\n/**\n * Injection token that can be used to configure the\n * behavior of the drag&drop-related components.\n */\nexport const CDK_DRAG_CONFIG = new InjectionToken<DragDropConfig>('CDK_DRAG_CONFIG');\n\n/**\n * Object that can be used to configure the drag\n * items and drop lists within a module or a component.\n */\nexport interface DragDropConfig extends Partial<DragRefConfig> {\n lockAxis?: DragAxis | null;\n dragStartDelay?: DragStartDelay;\n constrainPosition?: DragConstrainPosition;\n previewClass?: string | string[];\n boundaryElement?: string;\n rootElementSelector?: string;\n draggingDisabled?: boolean;\n sortingDisabled?: boolean;\n listAutoScrollDisabled?: boolean;\n listOrientation?: DropListOrientation;\n zIndex?: number;\n previewContainer?: 'global' | 'parent';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directionality} from '../../bidi';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewContainerRef,\n OnChanges,\n SimpleChanges,\n ChangeDetectorRef,\n InjectionToken,\n booleanAttribute,\n afterNextRender,\n AfterViewInit,\n inject,\n Injector,\n numberAttribute,\n} from '@angular/core';\nimport {coerceElement, coerceNumberProperty} from '../../coercion';\nimport {BehaviorSubject, Observable, Observer, Subject, merge} from 'rxjs';\nimport {startWith, take, map, takeUntil, switchMap, tap} from 'rxjs/operators';\nimport type {\n CdkDragDrop,\n CdkDragEnd,\n CdkDragEnter,\n CdkDragExit,\n CdkDragMove,\n CdkDragStart,\n CdkDragRelease,\n} from '../drag-events';\nimport {CDK_DRAG_HANDLE, CdkDragHandle} from './drag-handle';\nimport {CdkDragPlaceholder} from './drag-placeholder';\nimport {CdkDragPreview} from './drag-preview';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, Point, PreviewContainer, DragConstrainPosition} from '../drag-ref';\nimport type {CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\nimport {CDK_DRAG_CONFIG, DragDropConfig, DragStartDelay, DragAxis} from './config';\nimport {assertElementNode} from './assertions';\nimport {DragDropRegistry} from '../drag-drop-registry';\n\n/**\n * Injection token that can be used to reference instances of `CdkDropList`. It serves as\n * alternative token to the actual `CdkDropList` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DROP_LIST = new InjectionToken<CdkDropList>('CdkDropList');\n\n/** Element that can be moved inside a CdkDropList container. */\n@Directive({\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n host: {\n 'class': 'cdk-drag',\n '[class.cdk-drag-disabled]': 'disabled',\n '[class.cdk-drag-dragging]': '_dragRef.isDragging()',\n },\n providers: [{provide: CDK_DRAG_PARENT, useExisting: CdkDrag}],\n})\nexport class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n dropContainer = inject<CdkDropList>(CDK_DROP_LIST, {optional: true, skipSelf: true})!;\n private _ngZone = inject(NgZone);\n private _viewContainerRef = inject(ViewContainerRef);\n private _dir = inject(Directionality, {optional: true});\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _selfHandle = inject<CdkDragHandle>(CDK_DRAG_HANDLE, {optional: true, self: true});\n private _parentDrag = inject<CdkDrag>(CDK_DRAG_PARENT, {optional: true, skipSelf: true});\n private _dragDropRegistry = inject(DragDropRegistry);\n\n private readonly _destroyed = new Subject<void>();\n private _handles = new BehaviorSubject<CdkDragHandle[]>([]);\n private _previewTemplate: CdkDragPreview | null;\n private _placeholderTemplate: CdkDragPlaceholder | null;\n\n /** Reference to the underlying drag instance. */\n _dragRef: DragRef<CdkDrag<T>>;\n\n /** Arbitrary data to attach to this drag instance. */\n @Input('cdkDragData') data: T;\n\n /** Locks the position of the dragged element along the specified axis. */\n @Input('cdkDragLockAxis') lockAxis: DragAxis | null = null;\n\n /**\n * Selector that will be used to determine the root draggable element, starting from\n * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful\n * when trying to enable dragging on an element that you might not have access to.\n */\n @Input('cdkDragRootElement') rootElementSelector: string;\n\n /**\n * Node or selector that will be used to determine the element to which the draggable's\n * position will be constrained. If a string is passed in, it'll be used as a selector that\n * will be matched starting from the element's parent and going up the DOM until a match\n * has been found.\n */\n @Input('cdkDragBoundary') boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n @Input('cdkDragStartDelay') dragStartDelay: DragStartDelay;\n\n /**\n * Sets the position of a `CdkDrag` that is outside of a drop container.\n * Can be used to restore the element's position for a returning user.\n */\n @Input('cdkDragFreeDragPosition') freeDragPosition: Point;\n\n /** Whether starting to drag this element is disabled. */\n @Input({alias: 'cdkDragDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled || !!(this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value: boolean) {\n this._disabled = value;\n this._dragRef.disabled = this._disabled;\n }\n private _disabled: boolean;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page, a reference to the item being dragged and its dimensions.\n * Should return a point describing where the item should be rendered.\n */\n @Input('cdkDragConstrainPosition') constrainPosition?: DragConstrainPosition;\n\n /** Class to be added to the preview element. */\n @Input('cdkDragPreviewClass') previewClass: string | string[];\n\n /**\n * Configures the place into which the preview of the item will be inserted. Can be configured\n * globally through `CDK_DROP_LIST`. Possible values:\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */\n @Input('cdkDragPreviewContainer') previewContainer: PreviewContainer;\n\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n @Input({alias: 'cdkDragScale', transform: numberAttribute})\n scale: number = 1;\n\n /** Emits when the user starts dragging the item. */\n @Output('cdkDragStarted') readonly started: EventEmitter<CdkDragStart> =\n new EventEmitter<CdkDragStart>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n @Output('cdkDragReleased') readonly released: EventEmitter<CdkDragRelease> =\n new EventEmitter<CdkDragRelease>();\n\n /** Emits when the user stops dragging an item in the container. */\n @Output('cdkDragEnded') readonly ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();\n\n /** Emits when the user has moved the item into a new container. */\n @Output('cdkDragEntered') readonly entered: EventEmitter<CdkDragEnter<any>> = new EventEmitter<\n CdkDragEnter<any>\n >();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n @Output('cdkDragExited') readonly exited: EventEmitter<CdkDragExit<any>> = new EventEmitter<\n CdkDragExit<any>\n >();\n\n /** Emits when the user drops the item inside a container. */\n @Output('cdkDragDropped') readonly dropped: EventEmitter<CdkDragDrop<any>> = new EventEmitter<\n CdkDragDrop<any>\n >();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n @Output('cdkDragMoved')\n readonly moved: Observable<CdkDragMove<T>> = new Observable(\n (observer: Observer<CdkDragMove<T>>) => {\n const subscription = this._dragRef.moved\n .pipe(\n map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance,\n })),\n )\n .subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n },\n );\n\n private _injector = inject(Injector);\n\n constructor(...args: unknown[]);\n\n constructor() {\n const dropContainer = this.dropContainer;\n const config = inject<DragDropConfig>(CDK_DRAG_CONFIG, {optional: true});\n const dragDrop = inject(DragDrop);\n\n this._dragRef = dragDrop.createDrag(this.element, {\n dragStartThreshold:\n config && config.dragStartThreshold != null ? config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold:\n config && config.pointerDirectionChangeThreshold != null\n ? config.pointerDirectionChangeThreshold\n : 5,\n zIndex: config?.zIndex,\n });\n this._dragRef.data = this;\n this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement, this);\n\n if (config) {\n this._assignDefaults(config);\n }\n\n // Note that usually the container is assigned when the drop list is picks up the item, but in\n // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation\n // where there are no items on the first change detection pass, but the items get picked up as\n // soon as the user triggers another pass by dragging. This is a problem, because the item would\n // have to switch from standalone mode to drag mode in the middle of the dragging sequence which\n // is too late since the two modes save different kinds of information. We work around it by\n // assigning the drop container both from here and the list.\n if (dropContainer) {\n dropContainer.addItem(this);\n\n // The drop container reads this so we need to sync it here.\n dropContainer._dropListRef.beforeStarted.pipe(takeUntil(this._destroyed)).subscribe(() => {\n this._dragRef.scale = this.scale;\n });\n }\n\n this._syncInputs(this._dragRef);\n this._handleEvents(this._dragRef);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._dragRef.getPlaceholderElement();\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._dragRef.getRootElement();\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._dragRef.reset();\n }\n\n /** Resets drag item to end of boundary element. */\n resetToBoundary() {\n this._dragRef.resetToBoundary();\n }\n\n /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n return this._dragRef.getFreeDragPosition();\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): void {\n this._dragRef.setFreeDragPosition(value);\n }\n\n ngAfterViewInit() {\n // We need to wait until after render, in order for the reference\n // element to be in the proper place in the DOM. This is mostly relevant\n // for draggable elements inside portals since they get stamped out in\n // their original DOM position, and then they get transferred to the portal.\n afterNextRender(\n () => {\n this._updateRootElement();\n this._setupHandlesListener();\n this._dragRef.scale = this.scale;\n\n if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n },\n {injector: this._injector},\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const rootSelectorChange = changes['rootElementSelector'];\n const positionChange = changes['freeDragPosition'];\n\n // We don't have to react to the first change since it's being\n // handled in the `afterNextRender` queued up in the constructor.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n\n // Scale affects the free drag position so we need to sync it up here.\n this._dragRef.scale = this.scale;\n\n // Skip the first change since it's being handled in the `afterNextRender` queued up in the\n // constructor.\n if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }\n\n ngOnDestroy() {\n if (this.dropContainer) {\n this.dropContainer.removeItem(this);\n }\n\n this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement);\n\n // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`.\n this._ngZone.runOutsideAngular(() => {\n this._handles.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n });\n }\n\n _addHandle(handle: CdkDragHandle) {\n const handles = this._handles.getValue();\n handles.push(handle);\n this._handles.next(handles);\n }\n\n _removeHandle(handle: CdkDragHandle) {\n const handles = this._handles.getValue();\n const index = handles.indexOf(handle);\n\n if (index > -1) {\n handles.splice(index, 1);\n this._handles.next(handles);\n }\n }\n\n _setPreviewTemplate(preview: CdkDragPreview) {\n this._previewTemplate = preview;\n }\n\n _resetPreviewTemplate(preview: CdkDragPreview) {\n if (preview === this._previewTemplate) {\n this._previewTemplate = null;\n }\n }\n\n _setPlaceholderTemplate(placeholder: CdkDragPlaceholder) {\n this._placeholderTemplate = placeholder;\n }\n\n _resetPlaceholderTemplate(placeholder: CdkDragPlaceholder) {\n if (placeholder === this._placeholderTemplate) {\n this._placeholderTemplate = null;\n }\n }\n\n /** Syncs the root element with the `DragRef`. */\n private _updateRootElement() {\n const element = this.element.nativeElement as HTMLElement;\n let rootElement = element;\n if (this.rootElementSelector) {\n rootElement =\n element.closest !== undefined\n ? (element.closest(this.rootElementSelector) as HTMLElement)\n : // Comment tag doesn't have closest method, so use parent's one.\n (element.parentElement?.closest(this.rootElementSelector) as HTMLElement);\n }\n\n if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n assertElementNode(rootElement, 'cdkDrag');\n }\n\n this._dragRef.withRootElement(rootElement || element);\n }\n\n /** Gets the boundary element, based on the `boundaryElement` value. */\n private _getBoundaryElement() {\n const boundary = this.boundaryElement;\n\n if (!boundary) {\n return null;\n }\n\n if (typeof boundary === 'string') {\n return this.element.nativeElement.closest<HTMLElement>(boundary);\n }\n\n return coerceElement(boundary);\n }\n\n /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */\n private _syncInputs(ref: DragRef<CdkDrag<T>>) {\n ref.beforeStarted.subscribe(() => {\n if (!ref.isDragging()) {\n const dir = this._dir;\n const dragStartDelay = this.dragStartDelay;\n const placeholder = this._placeholderTemplate\n ? {\n template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef,\n }\n : null;\n const preview = this._previewTemplate\n ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef,\n }\n : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.scale = this.scale;\n ref.dragStartDelay =\n typeof dragStartDelay === 'object' && dragStartDelay\n ? dragStartDelay\n : coerceNumberProperty(dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\n ref.previewClass = this.previewClass;\n ref\n .withBoundaryElement(this._getBoundaryElement())\n .withPlaceholderTemplate(placeholder)\n .withPreviewTemplate(preview)\n .withPreviewContainer(this.previewContainer || 'global');\n\n if (dir) {\n ref.withDirection(dir.value);\n }\n }\n });\n\n // This only needs to be resolved once.\n ref.beforeStarted.pipe(take(1)).subscribe(() => {\n // If we managed to resolve a parent through DI, use it.\n if (this._parentDrag) {\n ref.withParent(this._parentDrag._dragRef);\n return;\n }\n\n // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if\n // the item was projected into another item by something like `ngTemplateOutlet`.\n let parent = this.element.nativeElement.parentElement;\n while (parent) {\n const parentDrag = this._dragDropRegistry.getDragDirectiveForNode(parent);\n if (parentDrag) {\n ref.withParent(parentDrag._dragRef);\n break;\n }\n parent = parent.parentElement;\n }\n });\n }\n\n /** Handles the events from the underlying `DragRef`. */\n private _handleEvents(ref: DragRef<CdkDrag<T>>) {\n ref.started.subscribe(startEvent => {\n this.started.emit({source: this, event: startEvent.event});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.released.subscribe(releaseEvent => {\n this.released.emit({source: this, event: releaseEvent.event});\n });\n\n ref.ended.subscribe(endEvent => {\n this.ended.emit({\n source: this,\n distance: endEvent.distance,\n dropPoint: endEvent.dropPoint,\n event: endEvent.event,\n });\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(enterEvent => {\n this.entered.emit({\n container: enterEvent.container.data,\n item: this,\n currentIndex: enterEvent.currentIndex,\n });\n });\n\n ref.exited.subscribe(exitEvent => {\n this.exited.emit({\n container: exitEvent.container.data,\n item: this,\n });\n });\n\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n item: this,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis,\n dragStartDelay,\n constrainPosition,\n previewClass,\n boundaryElement,\n draggingDisabled,\n rootElementSelector,\n previewContainer,\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n this.lockAxis = lockAxis || null;\n\n if (constrainPosition) {\n this.constrainPosition = constrainPosition;\n }\n\n if (previewClass) {\n this.previewClass = previewClass;\n }\n\n if (boundaryElement) {\n this.boundaryElement = boundaryElement;\n }\n\n if (rootElementSelector) {\n this.rootElementSelector = rootElementSelector;\n }\n\n if (previewContainer) {\n this.previewContainer = previewContainer;\n }\n }\n\n /** Sets up the listener that syncs the handles with the drag ref. */\n private _setupHandlesListener() {\n // Listen for any newly-added handles.\n this._handles\n .pipe(\n // Sync the new handles with the DragRef.\n tap(handles => {\n const handleElements = handles.map(handle => handle.element);\n\n // Usually handles are only allowed to be a descendant of the drag element, but if\n // the consumer defined a different drag root, we should allow the drag element\n // itself to be a handle too.\n if (this._selfHandle && this.rootElementSelector) {\n handleElements.push(this.element);\n }\n\n this._dragRef.withHandles(handleElements);\n }),\n // Listen if the state of any of the handles changes.\n switchMap((handles: CdkDragHandle[]) => {\n return merge(\n ...handles.map(item => item._stateChanges.pipe(startWith(item))),\n ) as Observable<CdkDragHandle>;\n }),\n takeUntil(this._destroyed),\n )\n .subscribe(handleInstance => {\n // Enabled/disable the handle that changed in the DragRef.\n const dragRef = this._dragRef;\n const handle = handleInstance.element.nativeElement;\n handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, OnDestroy, Input, InjectionToken, booleanAttribute} from '@angular/core';\n\n/**\n * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as\n * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DROP_LIST_GROUP = new InjectionToken<CdkDropListGroup<unknown>>(\n 'CdkDropListGroup',\n);\n\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n */\n@Directive({\n selector: '[cdkDropListGroup]',\n exportAs: 'cdkDropListGroup',\n providers: [{provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup}],\n})\nexport class CdkDropListGroup<T> implements OnDestroy {\n /** Drop lists registered inside the group. */\n readonly _items = new Set<T>();\n\n /** Whether starting a dragging sequence from inside this group is disabled. */\n @Input({alias: 'cdkDropListGroupDisabled', transform: booleanAttribute})\n disabled: boolean = false;\n\n ngOnDestroy() {\n this._items.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NumberInput, coerceArray, coerceNumberProperty} from '../../coercion';\nimport {\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Directive,\n ChangeDetectorRef,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {Directionality} from '../../bidi';\nimport {_IdGenerator} from '../../a11y';\nimport {ScrollDispatcher} from '../../scrolling';\nimport {CDK_DROP_LIST, CdkDrag} from './drag';\nimport {CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent} from '../drag-events';\nimport {CDK_DROP_LIST_GROUP, CdkDropListGroup} from './drop-list-group';\nimport {DropListRef} from '../drop-list-ref';\nimport {DragRef} from '../drag-ref';\nimport {DragDrop} from '../drag-drop';\nimport {DropListOrientation, DragAxis, DragDropConfig, CDK_DRAG_CONFIG} from './config';\nimport {merge, Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {assertElementNode} from './assertions';\n\n/** Container that wraps a set of draggable items. */\n@Directive({\n selector: '[cdkDropList], cdk-drop-list',\n exportAs: 'cdkDropList',\n providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n {provide: CDK_DROP_LIST_GROUP, useValue: undefined},\n {provide: CDK_DROP_LIST, useExisting: CdkDropList},\n ],\n host: {\n 'class': 'cdk-drop-list',\n '[attr.id]': 'id',\n '[class.cdk-drop-list-disabled]': 'disabled',\n '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',\n },\n})\nexport class CdkDropList<T = any> implements OnDestroy {\n element = inject<ElementRef<HTMLElement>>(ElementRef);\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _scrollDispatcher = inject(ScrollDispatcher);\n private _dir = inject(Directionality, {optional: true});\n private _group = inject<CdkDropListGroup<CdkDropList>>(CDK_DROP_LIST_GROUP, {\n optional: true,\n skipSelf: true,\n });\n\n /** Refs that have been synced with the drop ref most recently. */\n private _latestSortedRefs: DragRef[] | undefined;\n\n /** Emits when the list has been destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n /** Whether the element's scrollable parents have been resolved. */\n private _scrollableParentsResolved: boolean;\n\n /** Keeps track of the drop lists that are currently on the page. */\n private static _dropLists: CdkDropList[] = [];\n\n /** Reference to the underlying drop list instance. */\n _dropListRef: DropListRef<CdkDropList<T>>;\n\n /**\n * Other draggable containers that this container is connected to and into which the\n * container's items can be transferred. Can either be references to other drop containers,\n * or their unique IDs.\n */\n @Input('cdkDropListConnectedTo')\n connectedTo: (CdkDropList | string)[] | CdkDropList | string = [];\n\n /** Arbitrary data to attach to this container. */\n @Input('cdkDropListData') data: T;\n\n /** Direction in which the list is oriented. */\n @Input('cdkDropListOrientation') orientation: DropListOrientation;\n\n /**\n * Unique ID for the drop zone. Can be used as a reference\n * in the `connectedTo` of another `CdkDropList`.\n */\n @Input() id: string = inject(_IdGenerator).getId('cdk-drop-list-');\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n @Input('cdkDropListLockAxis') lockAxis: DragAxis | null = null;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n @Input({alias: 'cdkDropListDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled || (!!this._group && this._group.disabled);\n }\n set disabled(value: boolean) {\n // Usually we sync the directive and ref state right before dragging starts, in order to have\n // a single point of failure and to avoid having to use setters for everything. `disabled` is\n // a special case, because it can prevent the `beforeStarted` event from firing, which can lock\n // the user in a disabled state, so we also need to sync it as it's being set.\n this._dropListRef.disabled = this._disabled = value;\n }\n private _disabled: boolean;\n\n /** Whether sorting within this drop list is disabled. */\n @Input({alias: 'cdkDropListSortingDisabled', transform: booleanAttribute})\n sortingDisabled: boolean;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n @Input('cdkDropListEnterPredicate')\n enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean = () => true;\n\n /** Functions that is used to determine whether an item can be sorted into a particular index. */\n @Input('cdkDropListSortPredicate')\n sortPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean = () => true;\n\n /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */\n @Input({alias: 'cdkDropListAutoScrollDisabled', transform: booleanAttribute})\n autoScrollDisabled: boolean;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n @Input('cdkDropListAutoScrollStep')\n autoScrollStep: NumberInput;\n\n /**\n * Selector that will be used to resolve an alternate element container for the drop list.\n * Passing an alternate container is useful for the cases where one might not have control\n * over the parent node of the draggable items within the list (e.g. due to content projection).\n * This allows for usages like:\n *\n * ```\n * <div cdkDropList cdkDropListElementContainer=\".inner\">\n * <div class=\"inner\">\n * <div cdkDrag></div>\n * </div>\n * </div>\n * ```\n */\n @Input('cdkDropListElementContainer') elementContainerSelector: string | null;\n\n /**\n * By default when an item leaves its initial container, its placeholder will be transferred\n * to the new container. If that's not desirable for your use case, you can enable this option\n * which will clone the placeholder and leave it inside the original container. If the item is\n * returned to the initial container, the anchor element will be removed automatically.\n *\n * The cloned placeholder can be styled by targeting the `cdk-drag-anchor` class.\n *\n * This option is useful in combination with `cdkDropListSortingDisabled` to implement copying\n * behavior in a drop list.\n */\n @Input({alias: 'cdkDropListHasAnchor', transform: booleanAttribute})\n hasAnchor: boolean;\n\n /** Emits when the user drops an item inside the container. */\n @Output('cdkDropListDropped')\n readonly dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n @Output('cdkDropListEntered')\n readonly entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n @Output('cdkDropListExited')\n readonly exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();\n\n /** Emits as the user is swapping items while actively dragging. */\n @Output('cdkDropListSorted')\n readonly sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();\n\n /**\n * Keeps track of the items that are registered with this container. Historically we used to\n * do this with a `ContentChildren` query, however queries don't handle transplanted views very\n * well which means that we can't handle cases like dragging the headers of a `mat-table`\n * correctly. What we do instead is to have the items register themselves with the container\n * and then we sort them based on their position in the DOM.\n */\n private _unsortedItems = new Set<CdkDrag>();\n\n constructor(...args: unknown[]);\n\n constructor() {\n const dragDrop = inject(DragDrop);\n const config = inject<DragDropConfig>(CDK_DRAG_CONFIG, {optional: true});\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(this.element.nativeElement, 'cdkDropList');\n }\n\n this._dropListRef = dragDrop.createDropList(this.element);\n this._dropListRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n\n this._dropListRef.sortPredicate = (\n index: number,\n drag: DragRef<CdkDrag>,\n drop: DropListRef<CdkDropList>,\n ) => {\n return this.sortPredicate(index, drag.data, drop.data);\n };\n\n this._setupInputSyncSubscription(this._dropListRef);\n this._handleEvents(this._dropListRef);\n CdkDropList._dropLists.push(this);\n\n if (this._group) {\n this._group._items.add(this);\n }\n }\n\n /** Registers an items with the drop list. */\n addItem(item: CdkDrag): void {\n this._unsortedItems.add(item);\n item._dragRef._withDropContainer(this._dropListRef);\n\n // Only sync the items while dragging since this method is\n // called when items are being initialized one-by-one.\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef));\n }\n }\n\n /** Removes an item from the drop list. */\n removeItem(item: CdkDrag): void {\n this._unsortedItems.delete(item);\n\n // This method might be called on destroy so we always want to sync with the ref.\n // Note that we reuse the last set of synced items, rather than re-sorting the whole\n // list, because it can slow down re-renders of large lists (see #30737).\n if (this._latestSortedRefs) {\n const index = this._latestSortedRefs.indexOf(item._dragRef);\n\n if (index > -1) {\n this._latestSortedRefs.splice(index, 1);\n this._syncItemsWithRef(this._latestSortedRefs);\n }\n }\n }\n\n /** Gets the registered items in the list, sorted by their position in the DOM. */\n getSortedItems(): CdkDrag[] {\n return Array.from(this._unsortedItems).sort((a: CdkDrag, b: CdkDrag) => {\n const documentPosition = a._dragRef\n .getVisibleElement()\n .compareDocumentPosition(b._dragRef.getVisibleElement());\n\n // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n // tslint:disable-next-line:no-bitwise\n return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n }\n\n ngOnDestroy() {\n const index = CdkDropList._dropLists.indexOf(this);\n\n if (index > -1) {\n CdkDropList._dropLists.splice(index, 1);\n }\n\n if (this._group) {\n this._group._items.delete(this);\n }\n\n this._latestSortedRefs = undefined;\n this._unsortedItems.clear();\n this._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n private _setupInputSyncSubscription(ref: DropListRef<CdkDropList>) {\n if (this._dir) {\n this._dir.change\n .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n .subscribe(value => ref.withDirection(value));\n }\n\n ref.beforeStarted.subscribe(() => {\n const siblings = coerceArray(this.connectedTo).map(drop => {\n if (typeof drop === 'string') {\n const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop);\n\n if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n console.warn(`CdkDropList could not find connected drop list with id \"${drop}\"`);\n }\n\n return correspondingDropList!;\n }\n\n return drop;\n });\n\n if (this._group) {\n this._group._items.forEach(drop => {\n if (siblings.indexOf(drop) === -1) {\n siblings.push(drop);\n }\n });\n }\n\n // Note that we resolve the scrollable parents here so that we delay the resolution\n // as long as possible, ensuring that the element is in its final place in the DOM.\n if (!this._scrollableParentsResolved) {\n const scrollableParents = this._scrollDispatcher\n .getAncestorScrollContainers(this.element)\n .map(scrollable => scrollable.getElementRef().nativeElement);\n this._dropListRef.withScrollableParents(scrollableParents);\n\n // Only do this once since it involves traversing the DOM and the parents\n // shouldn't be able to change without the drop list being destroyed.\n this._scrollableParentsResolved = true;\n }\n\n if (this.elementContainerSelector) {\n const container = this.element.nativeElement.querySelector(this.elementContainerSelector);\n\n if (!container && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error(\n `CdkDropList could not find an element container matching the selector \"${this.elementContainerSelector}\"`,\n );\n }\n\n ref.withElementContainer(container as HTMLElement);\n }\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = this.sortingDisabled;\n ref.autoScrollDisabled = this.autoScrollDisabled;\n ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);\n ref.hasAnchor = this.hasAnchor;\n ref\n .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))\n .withOrientation(this.orientation);\n });\n }\n\n /** Handles events from the underlying DropListRef. */\n private _handleEvents(ref: DropListRef<CdkDropList>) {\n ref.beforeStarted.subscribe(() => {\n this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef));\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: this,\n item: event.item.data,\n currentIndex: event.currentIndex,\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: this,\n item: event.item.data,\n });\n this._changeDetectorRef.markForCheck();\n });\n\n ref.sorted.subscribe(event => {\n this.sorted.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n container: this,\n item: event.item.data,\n });\n });\n\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n item: dropEvent.item.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n\n // Mark for check since all of these events run outside of change\n // detection and we're not guaranteed for something else to have triggered it.\n this._changeDetectorRef.markForCheck();\n });\n\n merge(ref.receivingStarted, ref.receivingStopped).subscribe(() =>\n this._changeDetectorRef.markForCheck(),\n );\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation} =\n config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;\n this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;\n this.orientation = listOrientation || 'vertical';\n this.lockAxis = lockAxis || null;\n }\n\n /** Syncs up the registered drag items with underlying drop list ref. */\n private _syncItemsWithRef(items: DragRef[]) {\n this._latestSortedRefs = items;\n this._dropListRef.withItems(items);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n InjectionToken,\n Input,\n OnDestroy,\n TemplateRef,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as\n * alternative token to the actual `CdkDragPreview` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_PREVIEW = new InjectionToken<CdkDragPreview>('CdkDragPreview');\n\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPreview]',\n providers: [{provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview}],\n})\nexport class CdkDragPreview<T = any> implements OnDestroy {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n private _drag = inject(CDK_DRAG_PARENT, {optional: true});\n\n /** Context data to be added to the preview template instance. */\n @Input() data: T;\n\n /** Whether the preview should preserve the same size as the item that is being dragged. */\n @Input({transform: booleanAttribute}) matchSize: boolean = false;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._drag?._setPreviewTemplate(this);\n }\n\n ngOnDestroy(): void {\n this._drag?._resetPreviewTemplate(this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, TemplateRef, Input, InjectionToken, inject, OnDestroy} from '@angular/core';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as\n * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_DRAG_PLACEHOLDER = new InjectionToken<CdkDragPlaceholder>('CdkDragPlaceholder');\n\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPlaceholder]',\n providers: [{provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder}],\n})\nexport class CdkDragPlaceholder<T = any> implements OnDestroy {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n private _drag = inject(CDK_DRAG_PARENT, {optional: true});\n\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._drag?._setPlaceholderTemplate(this);\n }\n\n ngOnDestroy(): void {\n this._drag?._resetPlaceholderTemplate(this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkScrollableModule} from '../scrolling';\nimport {CdkDropList} from './directives/drop-list';\nimport {CdkDropListGroup} from './directives/drop-list-group';\nimport {CdkDrag} from './directives/drag';\nimport {CdkDragHandle} from './directives/drag-handle';\nimport {CdkDragPreview} from './directives/drag-preview';\nimport {CdkDragPlaceholder} from './directives/drag-placeholder';\nimport {DragDrop} from './drag-drop';\n\nconst DRAG_DROP_DIRECTIVES = [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n];\n\n@NgModule({\n imports: DRAG_DROP_DIRECTIVES,\n exports: [CdkScrollableModule, ...DRAG_DROP_DIRECTIVES],\n providers: [DragDrop],\n})\nexport class DragDropModule {}\n\n// Re-export needed by the Angular compiler.\n// See: https://github.com/angular/components/issues/30663.\n// Note: These exports need to be stable and shouldn't be renamed unnecessarily because\n// consuming libraries might have references to them in their own partial compilation output.\nexport {CdkScrollable as ɵɵCdkScrollable} from '../scrolling';\n"],"names":["deepCloneNode","node","clone","cloneNode","descendantsWithId","querySelectorAll","nodeName","toLowerCase","removeAttribute","i","length","transferCanvasData","transferInputData","transferData","selector","callback","descendantElements","cloneElements","cloneUniqueId","source","type","value","name","context","getContext","drawImage","getMutableClientRect","element","rect","getBoundingClientRect","top","right","bottom","left","width","height","x","y","isInsideClientRect","clientRect","isOverflowingParent","parentRect","childRect","isLeftOverflowing","isRightOverflowing","isTopOverflowing","isBottomOverflowing","adjustDomRect","domRect","isPointerNearDomRect","threshold","pointerX","pointerY","xThreshold","yThreshold","ParentPositionTracker","_document","positions","Map","constructor","clear","cache","elements","set","scrollPosition","getViewportScrollPosition","forEach","scrollTop","scrollLeft","handleScroll","event","target","_getEventTarget","cachedPosition","get","newTop","newLeft","viewportScrollPosition","topDifference","leftDifference","position","contains","window","scrollY","scrollX","getRootNode","viewRef","rootNodes","nodeType","ELEMENT_NODE","wrapper","createElement","appendChild","extendStyles","dest","importantProperties","key","hasOwnProperty","setProperty","has","removeProperty","toggleNativeDragInteractions","enable","userSelect","style","toggleVisibility","opacity","combineTransforms","transform","initialTransform","matchElementSize","sourceRect","getTransform","Math","round","parseCssTimeUnitsToMs","multiplier","indexOf","parseFloat","getTransformTransitionDurationInMs","computedStyle","getComputedStyle","transitionedProperties","parseCssPropertyValue","property","find","prop","propertyIndex","rawDurations","rawDelays","getPropertyValue","split","map","part","trim","Set","PreviewRef","_rootElement","_direction","_initialDomRect","_previewTemplate","_previewClass","_pickupPositionOnPage","_initialTransform","_zIndex","_renderer","_previewEmbeddedView","_preview","attach","parent","_createPreview","supportsPopover","destroy","remove","setTransform","addClass","className","classList","add","getTransitionDuration","addEventListener","handler","listen","previewConfig","previewClass","previewTemplate","template","preview","rootRect","matchSize","viewContainer","createEmbeddedView","detectChanges","setAttribute","Array","isArray","passiveEventListenerOptions","passive","activeEventListenerOptions","activeCapturingEventOptions","capture","MOUSE_EVENT_IGNORE_TIME","PLACEHOLDER_CLASS","dragImportantProperties","DragRef","_config","_ngZone","_viewportRuler","_dragDropRegistry","_rootElementCleanups","_cleanupShadowRootSelectStart","_previewContainer","_placeholderRef","_placeholder","_pickupPositionInElement","_marker","_anchor","_passiveTransform","_activeTransform","_hasStartedDragging","signal","_hasMoved","_initialContainer","_initialIndex","_parentPositions","_moveEvents","Subject","_pointerDirectionDelta","_pointerPositionAtLastDirectionChange","_lastKnownPointerPosition","_ownerSVGElement","_rootElementTapHighlight","_pointerMoveSubscription","Subscription","EMPTY","_pointerUpSubscription","_scrollSubscription","_resizeSubscription","_lastTouchEventTime","_dragStartTime","_boundaryElement","_nativeInteractionsEnabled","_previewRect","_boundaryRect","_placeholderTemplate","_handles","_disabledHandles","_dropContainer","_parentDragRef","_cachedShadowRoot","lockAxis","dragStartDelay","scale","disabled","_disabled","_toggleNativeDragInteractions","handle","beforeStarted","started","released","ended","entered","exited","dropped","moved","data","constrainPosition","withRootElement","withParent","parentDragRef","registerDragItem","getPlaceholderElement","getRootElement","getVisibleElement","isDragging","withHandles","handles","coerceElement","disabledHandles","withPreviewTemplate","withPlaceholderTemplate","rootElement","_removeRootElementListeners","renderer","runOutsideAngular","_pointerDown","_nativeDragStart","undefined","SVGElement","ownerSVGElement","withBoundaryElement","boundaryElement","unsubscribe","change","subscribe","_containInsideBoundaryOnResize","dispose","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeListeners","complete","reset","resetToBoundary","offsetX","offsetY","currentLeft","currentTop","disableHandle","enableHandle","delete","withDirection","direction","_withDropContainer","container","getFreeDragPosition","setFreeDragPosition","_applyRootElementTransform","withPreviewContainer","_sortFromLastPointerPosition","_updateActiveDropContainer","_getConstrainedPointerPosition","next","targetHandle","_getTargetHandle","_initializeDragSequence","_pointerMove","pointerPosition","_getPointerPositionOnPage","distanceX","abs","distanceY","isOverThreshold","dragStartThreshold","isDelayElapsed","Date","now","_getDragStartDelay","_endDragSequence","isReceiving","cancelable","preventDefault","run","_startDragSequence","constrainedPointerPosition","_updatePointerDirectionDelta","offset","activeTransform","observers","distance","_getDragDistance","delta","_pointerUp","stopDragging","webkitTapHighlightColor","_stopScrolling","_animatePreviewToPlaceholder","then","_cleanupDragArtifacts","_cleanupCachedDimensions","dropPoint","isTouchEvent","shadowRoot","_getShadowRoot","dropContainer","shadowDomSelectStart","parentNode","placeholder","_createPlaceholderElement","marker","createComment","ngDevMode","insertBefore","zIndex","_getPreviewInsertionPoint","body","replaceChild","start","getItemIndex","getScrollableParents","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","isFakeEvent","isFakeTouchstartFromScreenReader","isFakeMousedownFromScreenReader","draggable","rootStyles","pointerMove","pointerUp","scrolled","scrollEvent","_updateOnScroll","_getPointerPositionInElement","startDragging","currentIndex","isPointerOverContainer","_isOverContainer","item","previousIndex","previousContainer","drop","rawX","rawY","newContainer","_getSiblingContainerFromPosition","exitIndex","nextItemElement","getItemAtIndex","exit","_conditionallyInsertAnchor","enter","sortingDisabled","_startScrollingIfNecessary","_sortItem","_applyPreviewTransform","Promise","resolve","placeholderRect","duration","propertyName","cleanupListener","clearTimeout","timeout","setTimeout","placeholderConfig","placeholderTemplate","pointerEvents","elementRect","handleElement","referenceRect","point","targetTouches","_getViewportScrollPosition","pageX","pageY","touches","changedTouches","svgMatrix","getScreenCTM","svgPoint","createSVGPoint","matrixTransform","inverse","dropContainerLock","pickupX","pickupY","boundaryRect","previewWidth","previewHeight","_getPreviewRect","minY","maxY","minX","maxX","clamp","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","pointerDirectionChangeThreshold","shouldEnable","cleanup","styles","currentPosition","pickupPosition","leftOverflow","rightOverflow","topOverflow","bottomOverflow","touch","mouse","scrollDifference","initialParent","previewContainer","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","exitContainer","hasAnchor","anchor","before","min","max","moveItemInArray","array","fromIndex","toIndex","from","to","transferArrayItem","currentArray","targetArray","targetIndex","splice","copyArrayItem","SingleAxisSortStrategy","_element","_sortPredicate","_itemPositions","_activeDraggables","orientation","_previousSwap","drag","overlaps","items","withItems","sort","pointerDelta","siblings","newIndex","_getItemIndexFromPointerPosition","isHorizontal","findIndex","currentItem","siblingAtNewPosition","newPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","slice","sibling","index","isDraggedItem","elementToOffset","transformAmount","activeDraggables","newPositionReference","_shouldEnterAsFirstChild","parentElement","push","_cacheItemPositions","withSortPredicate","predicate","p","getActiveItemsSnapshot","_getVisualItemPositions","updateOnScroll","withElementContainer","elementToMeasure","a","b","reverse","immediateSibling","end","itemPositions","reversed","lastItemRect","firstItemRect","floor","MixedSortStrategy","_rootNode","_activeItems","deltaX","deltaY","_relatedNodes","childNodes","nextSibling","previousSwap","toSwapWith","current","overlapElement","after","newOverlapElement","_getRootNode","elementFromPoint","enterIndex","_getClosestItemIndexToPointer","targetItem","root","elementAtPoint","minDistance","Infinity","minIndex","hypot","DROP_PROXIMITY_THRESHOLD","SCROLL_PROXIMITY_THRESHOLD","AutoScrollVerticalDirection","AutoScrollHorizontalDirection","DropListRef","autoScrollDisabled","autoScrollStep","enterPredicate","sortPredicate","sorted","receivingStarted","receivingStopped","_container","_isDragging","_sortStrategy","_domRect","_draggables","_siblings","_activeSiblings","_viewportScrollSubscription","_verticalScrollDirection","NONE","_horizontalScrollDirection","_scrollNode","_stopScrollTimers","_scrollableElements","_initialScrollSnap","coercedElement","withOrientation","registerDropContainer","removeDropContainer","_draggingStarted","_notifyReceivingSiblings","_cacheParentPositions","_reset","previousItems","draggedItems","filter","every","connectedTo","strategy","withScrollableParents","Error","oldContainerIndex","newContainerIndex","unshift","size","result","scrollNode","verticalScrollDirection","horizontalScrollDirection","getElementScrollDirections","getViewportSize","getVerticalScrollDirection","getHorizontalScrollDirection","_startScrollInterval","msScrollSnapType","scrollSnapType","_listenToScrollEvents","_stopReceiving","interval","animationFrameScheduler","pipe","takeUntil","scrollStep","UP","scrollBy","DOWN","LEFT","RIGHT","_canReceive","_startReceiving","activeSiblings","initiator","receiver","computedVertical","computedHorizontal","scrollHeight","clientHeight","scrollWidth","clientWidth","capturingEventOptions","_ResetsLoader","deps","i0","ɵɵFactoryTarget","Component","ɵcmp","ɵɵngDeclareComponent","minVersion","version","isInline","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","decorators","args","host","DragDropRegistry","inject","NgZone","DOCUMENT","_styleLoader","_CdkPrivateStyleLoader","RendererFactory2","createRenderer","_cleanupDocumentTouchmove","_scroll","_dropInstances","_dragInstances","_activeDragInstances","_globalListeners","_draggingPredicate","_domNodesToDirectives","_persistentTouchmoveListener","load","update","instances","startsWith","endEventHandler","e","toBind","_preventDefaultWhileDragging","options","_clearGlobalListeners","streams","Observable","observer","merge","registerDirectiveNode","dragRef","WeakMap","removeDirectiveNode","getDragDirectiveForNode","ngOnDestroy","instance","some","Injectable","ɵprov","ɵɵngDeclareInjectable","ngImport","providedIn","DEFAULT_CONFIG","DragDrop","ViewportRuler","createDrag","config","createDropList","CDK_DRAG_PARENT","InjectionToken","assertElementNode","CDK_DRAG_HANDLE","CdkDragHandle","ElementRef","_parentDrag","optional","skipSelf","_stateChanges","nativeElement","_addHandle","ngAfterViewInit","ref","_removeHandle","Directive","ɵdir","ɵɵngDeclareDirective","isStandalone","inputs","booleanAttribute","classAttribute","providers","provide","useExisting","Input","alias","CDK_DRAG_CONFIG","CDK_DROP_LIST","CdkDrag","_viewContainerRef","ViewContainerRef","_dir","Directionality","_changeDetectorRef","ChangeDetectorRef","_selfHandle","self","_destroyed","BehaviorSubject","_dragRef","rootElementSelector","freeDragPosition","EventEmitter","subscription","movedEvent","_injector","Injector","dragDrop","_assignDefaults","addItem","_dropListRef","_syncInputs","_handleEvents","afterNextRender","_updateRootElement","_setupHandlesListener","injector","ngOnChanges","changes","rootSelectorChange","positionChange","firstChange","removeItem","getValue","_setPreviewTemplate","_resetPreviewTemplate","_setPlaceholderTemplate","_resetPlaceholderTemplate","closest","_getBoundaryElement","boundary","dir","templateRef","coerceNumberProperty","take","parentDrag","startEvent","emit","markForCheck","releaseEvent","endEvent","enterEvent","exitEvent","dropEvent","draggingDisabled","tap","handleElements","switchMap","startWith","handleInstance","numberAttribute","exportAs","usesOnChanges","Output","CDK_DROP_LIST_GROUP","CdkDropListGroup","_items","CdkDropList","_scrollDispatcher","ScrollDispatcher","_group","_latestSortedRefs","_scrollableParentsResolved","_dropLists","id","_IdGenerator","getId","elementContainerSelector","_unsortedItems","_setupInputSyncSubscription","_syncItemsWithRef","getSortedItems","documentPosition","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","coerceArray","correspondingDropList","list","console","warn","scrollableParents","getAncestorScrollContainers","scrollable","getElementRef","querySelector","listAutoScrollDisabled","listOrientation","outputs","properties","useValue","CDK_DRAG_PREVIEW","CdkDragPreview","TemplateRef","_drag","CDK_DRAG_PLACEHOLDER","CdkDragPlaceholder","DRAG_DROP_DIRECTIVES","DragDropModule","NgModule","ɵmod","ɵɵngDeclareNgModule","exports","CdkScrollableModule","ɵinj","ɵɵngDeclareInjector","imports"],"mappings":";;;;;;;;;;;;;;;;;;;;AASM,SAAUA,aAAaA,CAACC,IAAiB,EAAA;AAC7C,EAAA,MAAMC,KAAK,GAAGD,IAAI,CAACE,SAAS,CAAC,IAAI,CAAgB;AACjD,EAAA,MAAMC,iBAAiB,GAAGF,KAAK,CAACG,gBAAgB,CAAC,MAAM,CAAC;EACxD,MAAMC,QAAQ,GAAGL,IAAI,CAACK,QAAQ,CAACC,WAAW,EAAE;AAG5CL,EAAAA,KAAK,CAAC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