blob: c537eec41cd5e6b6ee67133cf4148b74b29086d8 [file] [log] [blame]
{"version":3,"file":"cdk-drag-drop.umd.js","sources":["../../../../../src/cdk/drag-drop/drag-styling.ts","../../../../../src/cdk/drag-drop/transition-duration.ts","../../../../../src/cdk/drag-drop/client-rect.ts","../../../../../src/cdk/drag-drop/parent-position-tracker.ts","../../../../../src/cdk/drag-drop/clone-node.ts","../../../../../src/cdk/drag-drop/drag-ref.ts","../../../../../external/npm/node_modules/tslib/tslib.es6.js","../../../../../src/cdk/drag-drop/drag-utils.ts","../../../../../src/cdk/drag-drop/drop-list-ref.ts","../../../../../src/cdk/drag-drop/drag-drop-registry.ts","../../../../../src/cdk/drag-drop/drag-drop.ts","../../../../../src/cdk/drag-drop/drag-parent.ts","../../../../../src/cdk/drag-drop/directives/drop-list-group.ts","../../../../../src/cdk/drag-drop/directives/config.ts","../../../../../src/cdk/drag-drop/directives/assertions.ts","../../../../../src/cdk/drag-drop/directives/drop-list.ts","../../../../../src/cdk/drag-drop/directives/drag-handle.ts","../../../../../src/cdk/drag-drop/directives/drag-placeholder.ts","../../../../../src/cdk/drag-drop/directives/drag-preview.ts","../../../../../src/cdk/drag-drop/directives/drag.ts","../../../../../src/cdk/drag-drop/drag-drop-module.ts","../../../../../src/cdk/drag-drop/public-api.ts","../../../../../src/cdk/drag-drop/index.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.io/license\n */\n\n\n// Helper type that ignores `readonly` properties. This is used in\n// `extendStyles` to ignore the readonly properties on CSSStyleDeclaration\n// since we won't be touching those anyway.\ntype Writeable<T> = { -readonly [P in keyof T]-?: T[P] };\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 webkitUserDrag: string;\n MozUserSelect: string; // For some reason the Firefox property is in PascalCase.\n msScrollSnapType: string;\n scrollSnapType: string;\n msUserSelect: string;\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet object.\n * @docs-private\n */\nexport function extendStyles(\n dest: Writeable<CSSStyleDeclaration>,\n source: Partial<DragCSSStyleDeclaration>) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n dest[key] = source[key]!;\n }\n }\n\n return dest;\n}\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 touchAction: enable ? '' : 'none',\n webkitUserDrag: enable ? '' : 'none',\n webkitTapHighlightColor: enable ? '' : 'transparent',\n userSelect: userSelect,\n msUserSelect: userSelect,\n webkitUserSelect: userSelect,\n MozUserSelect: 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 * @docs-private\n */\nexport function toggleVisibility(element: HTMLElement, enable: boolean) {\n const styles = element.style;\n styles.position = enable ? '' : 'fixed';\n styles.top = styles.opacity = enable ? '' : '0';\n styles.left = enable ? '' : '-999em';\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.io/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 parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\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.io/license\n */\n\n/** Gets a mutable version of an element's bounding `ClientRect`. */\nexport function getMutableClientRect(element: Element): ClientRect {\n const clientRect = 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 `ClientRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: clientRect.top,\n right: clientRect.right,\n bottom: clientRect.bottom,\n left: clientRect.left,\n width: clientRect.width,\n height: clientRect.height\n };\n}\n\n/**\n * Checks whether some coordinates are within a `ClientRect`.\n * @param clientRect ClientRect 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: ClientRect, 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 * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\n * @param clientRect `ClientRect` 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 adjustClientRect(clientRect: ClientRect, top: number, left: number) {\n clientRect.top += top;\n clientRect.bottom = clientRect.top + clientRect.height;\n\n clientRect.left += left;\n clientRect.right = clientRect.left + clientRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a ClientRect.\n * @param rect ClientRect to check against.\n * @param threshold Threshold around the ClientRect.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nexport function isPointerNearClientRect(rect: ClientRect,\n threshold: number,\n pointerX: number,\n pointerY: number): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * threshold;\n const yThreshold = height * threshold;\n\n return pointerY > top - yThreshold && pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold && pointerX < right + xThreshold;\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.io/license\n */\n\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {getMutableClientRect, adjustClientRect} from './client-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<Document|HTMLElement, {\n scrollPosition: ScrollPosition,\n clientRect?: ClientRect\n }>();\n\n constructor(private _document: Document, private _viewportRuler: ViewportRuler) {}\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: HTMLElement[] | ReadonlyArray<HTMLElement>) {\n this.clear();\n this.positions.set(this._document, {\n scrollPosition: this._viewportRuler.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 = event.target as HTMLElement | Document;\n const cachedPosition = this.positions.get(target);\n\n if (!cachedPosition) {\n return null;\n }\n\n // Used when figuring out whether an element is inside the scroll parent. If the scrolled\n // parent is the `document`, we use the `documentElement`, because IE doesn't support\n // `contains` on the `document`.\n const scrolledParentNode = target === this._document ? target.documentElement : target;\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const viewportScrollPosition = this._viewportRuler!.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 && scrolledParentNode.contains(node)) {\n adjustClientRect(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 * @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.io/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>(selector: string, node: HTMLElement, clone: HTMLElement,\n callback: (source: T, clone: T) => void) {\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(source: Element & {value: string},\n clone: Element & {value: string; name: string; type: string}) {\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.io/license\n */\n\nimport {EmbeddedViewRef, ElementRef, NgZone, ViewContainerRef, TemplateRef} from '@angular/core';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {Direction} from '@angular/cdk/bidi';\nimport {normalizePassiveListenerOptions, _getShadowRoot} from '@angular/cdk/platform';\nimport {coerceBooleanProperty, coerceElement} from '@angular/cdk/coercion';\nimport {Subscription, Subject, Observable} from 'rxjs';\nimport {DropListRefInternal as DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {extendStyles, toggleNativeDragInteractions, toggleVisibility} from './drag-styling';\nimport {getTransformTransitionDurationInMs} from './transition-duration';\nimport {getMutableClientRect, adjustClientRect} from './client-rect';\nimport {ParentPositionTracker} from './parent-position-tracker';\nimport {deepCloneNode} from './clone-node';\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/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});\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// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/**\n * Internal compile-time-only representation of a `DragRef`.\n * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.\n * @docs-private\n */\nexport interface DragRefInternal extends DragRef {}\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/** Template that can be used to create a drag preview element. */\ninterface DragPreviewTemplate<T = any> extends DragHelperTemplate<T> {\n matchSize?: boolean;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: HTMLElement;\n\n /** Reference to the view of the preview element. */\n private _previewRef: EmbeddedViewRef<any> | null;\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 * Anchor 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 _anchor: Comment;\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: boolean;\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 _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 /** Cached dimensions of the preview element. */\n private _previewRect?: ClientRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: ClientRect;\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';\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 /** 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 const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this._disabled) {\n this._disabled = newValue;\n this._toggleNativeDragInteractions();\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, newValue));\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n started = new Subject<{source: DragRef}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n released = new Subject<{source: DragRef}>();\n\n /** Emits when the user stops dragging an item in the container. */\n ended = new Subject<{source: DragRef, distance: Point}>();\n\n /** Emits when the user has moved the item into a new container. */\n 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 exited = new Subject<{container: DropListRef, item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n isPointerOverContainer: boolean;\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 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 and should return a point describing where the item should\n * be rendered.\n */\n constrainPosition?: (point: Point, dragRef: DragRef) => Point;\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<DragRef, DropListRef>) {\n\n this.withRootElement(element).withParent(_config.parentDragRef || null);\n this._parentPositions = new ParentPositionTracker(_document, _viewportRuler);\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 if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\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(this._rootElement);\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 removeNode(this._rootElement);\n }\n\n removeNode(this._anchor);\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeSubscriptions();\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 = this._rootElement = this._ownerSVGElement = this._placeholderTemplate =\n this._previewTemplate = this._anchor = this._parentDragRef = 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 /**\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 /** 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 _removeSubscriptions() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n if (this._preview) {\n removeNode(this._preview);\n }\n\n if (this._previewRef) {\n this._previewRef.destroy();\n }\n\n this._preview = this._previewRef = null!;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n if (this._placeholder) {\n removeNode(this._placeholder);\n }\n\n if (this._placeholderRef) {\n this._placeholderRef.destroy();\n }\n\n this._placeholder = 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._handles.find(handle => {\n const target = event.target;\n return !!target && (target === handle || handle.contains(target as HTMLElement));\n });\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 preferrable 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 event.preventDefault();\n this._hasStartedDragging = true;\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We only need the preview dimensions if we have a boundary element.\n if (this._boundaryElement) {\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 || this._rootElement).getBoundingClientRect();\n }\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 event.preventDefault();\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 const activeTransform = this._activeTransform;\n activeTransform.x =\n constrainedPointerPosition.x - this._pickupPositionOnPage.x + this._passiveTransform.x;\n activeTransform.y =\n constrainedPointerPosition.y - this._pickupPositionOnPage.y + this._passiveTransform.y;\n\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n\n // Apply transform as attribute if dragging and svg element to work for IE\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n const appliedTransform = `translate(${activeTransform.x} ${activeTransform.y})`;\n this._rootElement.setAttribute('transform', appliedTransform);\n }\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._removeSubscriptions();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging) {\n return;\n }\n\n this.released.next({source: this});\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 this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(this._getPointerPositionOnPage(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 const dropContainer = this._dropContainer;\n\n if (dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode!;\n const preview = this._preview = this._createPreviewElement();\n const placeholder = this._placeholder = this._createPlaceholderElement();\n const anchor = this._anchor = this._anchor || this._document.createComment('');\n\n // Needs to happen before the root element is moved.\n const shadowRoot = this._getShadowRoot();\n\n // Insert an anchor node so that we can restore the element's position in the DOM.\n parent.insertBefore(anchor, element);\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);\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n getPreviewInsertionPoint(this._document, shadowRoot).appendChild(preview);\n this.started.next({source: this}); // 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});\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 isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\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 (event.target && (event.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) {\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 this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor || '';\n rootElement.style.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasStartedDragging = this._hasMoved = false;\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._removeSubscriptions();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry.scroll.subscribe(scrollEvent => {\n this._updateOnScroll(scrollEvent);\n });\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 = previewTemplate && previewTemplate.template &&\n !previewTemplate.matchSize ? {x: 0, y: 0} :\n this._getPointerPositionInElement(referenceElement, event);\n const pointerPosition = this._pickupPositionOnPage = 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);\n this._anchor.parentNode!.replaceChild(this._rootElement, this._anchor);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._boundaryRect = this._previewRect = 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(this._getPointerPositionOnPage(event));\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x, pointerPosition.y);\n\n this.ended.next({source: this, distance});\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 });\n container.drop(this, currentIndex, this._initialIndex, this._initialContainer,\n isPointerOverContainer, distance);\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 (!newContainer && this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\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 // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(this, x, y, newContainer === this._initialContainer &&\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.sortingDisabled ? this._initialIndex : undefined);\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this)\n });\n });\n }\n\n this._dropContainer!._startScrollingIfNecessary(rawX, rawY);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n this._preview.style.transform =\n getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);\n }\n\n /**\n * Creates the element that will be rendered next to the user's pointer\n * and will be used as a preview of the element that is being dragged.\n */\n private _createPreviewElement(): 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._rootElement.getBoundingClientRect() : null;\n const viewRef = previewConfig.viewContainer.createEmbeddedView(previewTemplate,\n previewConfig.context);\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewRef = viewRef;\n if (previewConfig.matchSize) {\n matchElementSize(preview, rootRect!);\n } else {\n preview.style.transform =\n getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n }\n } else {\n const element = this._rootElement;\n preview = deepCloneNode(element);\n matchElementSize(preview, element.getBoundingClientRect());\n }\n\n extendStyles(preview.style, {\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 pointerEvents: 'none',\n // We have to reset the margin, because it can throw off positioning relative to the viewport.\n margin: '0',\n position: 'fixed',\n top: '0',\n left: '0',\n zIndex: `${this._config.zIndex || 1000}`\n });\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\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 * 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.classList.add('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._preview.style.transform = getTransform(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 = getTransformTransitionDurationInMs(this._preview);\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 (!event || (event.target === this._preview && event.propertyName === 'transform')) {\n this._preview.removeEventListener('transitionend', handler);\n resolve();\n clearTimeout(timeout);\n }\n }) as EventListenerOrEventListenerObject;\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 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 placeholder.classList.add('cdk-drag-placeholder');\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(referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent): Point {\n const elementRect = this._rootElement.getBoundingClientRect();\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}) : 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\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 ? this.constrainPosition(point, this) : point;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n y = this._pickupPositionOnPage.y;\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n x = this._pickupPositionOnPage.x;\n }\n\n if (this._boundaryRect) {\n const {x: pickupX, y: pickupY} = this._pickupPositionInElement;\n const boundaryRect = this._boundaryRect;\n const previewRect = this._previewRect!;\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewRect.height - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewRect.width - pickupX);\n\n x = clamp(x, minX, maxX);\n y = clamp(y, minY, maxY);\n }\n\n return {x, y};\n }\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(element: HTMLElement) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\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 transform = getTransform(x, y);\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 if (this._initialTransform == null) {\n this._initialTransform = this._rootElement.style.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 this._rootElement.style.transform = this._initialTransform ?\n transform + ' ' + this._initialTransform : transform;\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 const boundaryRect = this._boundaryElement.getBoundingClientRect();\n const elementRect = this._rootElement.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 ((boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)) {\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 = event.target as Node;\n\n // ClientRect dimensions are based on the scroll position of the page and its parent node so\n // we have to update the cached boundary ClientRect if the user has scrolled. Check for\n // the `document` specifically since IE doesn't support `contains` on it.\n if (this._boundaryRect && (target === this._document ||\n (target !== this._boundaryElement && target.contains(this._boundaryElement)))) {\n adjustClientRect(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 const cachedPosition = this._parentPositions.positions.get(this._document);\n return cachedPosition ? cachedPosition.scrollPosition :\n this._viewportRuler.getViewportScrollPosition();\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\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 */\nfunction 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/** 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/**\n * Helper to remove a node from the DOM and to do all the necessary null checks.\n * @param node Node to be removed.\n */\nfunction removeNode(node: Node | null) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\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/** Gets the element into which the drag preview should be inserted. */\nfunction getPreviewInsertionPoint(documentRef: any, shadowRoot: ShadowRoot | null): HTMLElement {\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 shadowRoot ||\n documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\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 */\nfunction 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/**\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 */\nfunction matchElementSize(target: HTMLElement, sourceRect: ClientRect): 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","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\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.io/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/**\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>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): 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>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): 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.io/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {_getShadowRoot} from '@angular/cdk/platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {moveItemInArray} from './drag-utils';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {DragRefInternal as DragRef, Point} from './drag-ref';\nimport {\n isPointerNearClientRect,\n adjustClientRect,\n getMutableClientRect,\n isInsideClientRect,\n} from './client-rect';\nimport {ParentPositionTracker} from './parent-position-tracker';\nimport {DragCSSStyleDeclaration} from './drag-styling';\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/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition {\n /** Instance of the drag item. */\n drag: DragRef;\n /** Dimensions of the item. */\n clientRect: ClientRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n}\n\n/** Vertical direction in which we can auto-scroll. */\nconst enum AutoScrollVerticalDirection {NONE, UP, DOWN}\n\n/** Horizontal direction in which we can auto-scroll. */\nconst enum AutoScrollHorizontalDirection {NONE, LEFT, RIGHT}\n\n/**\n * Internal compile-time-only representation of a `DropListRef`.\n * Used to avoid circular import issues between the `DropListRef` and the `DragRef`.\n * @docs-private\n */\nexport interface DropListRefInternal extends DropListRef {}\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';\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 * 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 /** Functions 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 beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n 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 exited = new Subject<{item: DragRef, container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n 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 }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n sorted = new Subject<{\n previousIndex: number,\n currentIndex: number,\n container: DropListRef,\n item: DragRef\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition[] = [];\n\n /** Keeps track of the positions of any parent scrollable elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Cached `ClientRect` of the drop list. */\n private _clientRect: ClientRect | undefined;\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * from `_draggables`, as well as any items that have been dragged in, but haven't\n * been dropped yet.\n */\n private _activeDraggables: 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 occured and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {drag: null as DragRef | null, delta: 0, overlaps: false};\n\n /** Draggable items in the container. */\n private _draggables: ReadonlyArray<DragRef> = [];\n\n /** Drop lists that are connected to the current one. */\n private _siblings: ReadonlyArray<DropListRef> = [];\n\n /** Direction in which the list is oriented. */\n private _orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Layout direction of the drop list. */\n private _direction: Direction = 'ltr';\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 _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 constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler) {\n this.element = coerceElement(element);\n this._document = _document;\n this.withScrollableParents([this.element]);\n _dragDropRegistry.registerDropContainer(this);\n this._parentPositions = new ParentPositionTracker(_document, _viewportRuler);\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._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 * Emits an event to indicate that the user moved 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 let newIndex: number;\n\n if (index == null) {\n newIndex = this.sortingDisabled ? this._draggables.indexOf(item) : -1;\n\n if (newIndex === -1) {\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 newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n }\n } else {\n newIndex = index;\n }\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 // 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 if (this._shouldEnterAsFirstChild(pointerX, pointerY)) {\n const reference = activeDraggables[0].getRootElement();\n reference.parentNode!.insertBefore(placeholder, reference);\n activeDraggables.unshift(item);\n } else {\n coerceElement(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 the positions were already cached when we called `start` above,\n // but we need to refresh them since the amount of items has changed and also parent rects.\n this._cacheItemPositions();\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 */\n drop(item: DragRef, currentIndex: number, previousIndex: number, previousContainer: DropListRef,\n isPointerOverContainer: boolean, distance: Point): void {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance\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._cacheItems();\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 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: 'vertical' | 'horizontal'): this {\n this._orientation = orientation;\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 = coerceElement(this.element);\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 /** Gets the scrollable parents that are registered with this drop container. */\n getScrollableParents(): ReadonlyArray<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 if (!this._isDragging) {\n return this._draggables.indexOf(item);\n }\n\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 const items = this._orientation === 'horizontal' && this._direction === 'rtl' ?\n this._itemPositions.slice().reverse() : this._itemPositions;\n\n return findIndex(items, currentItem => currentItem.drag === item);\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(item: DragRef, pointerX: number, pointerY: number,\n pointerDelta: {x: number, y: number}): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (this.sortingDisabled || !this._clientRect ||\n !isPointerNearClientRect(this._clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {\n return;\n }\n\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return;\n }\n\n const isHorizontal = this._orientation === 'horizontal';\n const currentIndex = findIndex(siblings, 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 this.sorted.next({\n previousIndex: currentIndex,\n currentIndex: newIndex,\n container: this,\n item\n });\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 ? item.getPlaceholderElement() :\n sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\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 = `translate3d(${Math.round(sibling.offset)}px, 0, 0)`;\n adjustClientRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = `translate3d(0, ${Math.round(sibling.offset)}px, 0)`;\n adjustClientRect(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\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 (isPointerNearClientRect(position.clientRect, DROP_PROXIMITY_THRESHOLD,\n pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement, position.clientRect, pointerX, pointerY);\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 clientRect = {width, height, top: 0, right: width, bottom: height, left: 0};\n verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);\n scrollNode = window;\n }\n\n if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)) {\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 = coerceElement(this.element).style as DragCSSStyleDeclaration;\n this.beforeStarted.next();\n this._isDragging = true;\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._cacheItems();\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n const element = coerceElement(this.element);\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 `ClientRect`.\n this._clientRect = this._parentPositions.positions.get(element)!.clientRect!;\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.map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure)};\n }).sort((a, b) => {\n return isHorizontal ? a.clientRect.left - b.clientRect.left :\n a.clientRect.top - b.clientRect.top;\n });\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n\n const styles = coerceElement(this.element).style as DragCSSStyleDeclaration;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\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 rootElement.style.transform = '';\n }\n });\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._activeDraggables = [];\n this._itemPositions = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\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(currentIndex: number,\n siblings: CachedItemPosition[],\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 * 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: ClientRect, newPosition: ClientRect, delta: 1 | -1) {\n const isHorizontal = this._orientation === 'horizontal';\n let itemOffset = isHorizontal ? 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 ? newPosition.width - currentPosition.width :\n newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\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(item: DragRef, pointerX: number, pointerY: number,\n delta?: {x: number, y: number}): number {\n const isHorizontal = this._orientation === 'horizontal';\n const index = findIndex(this._itemPositions, ({drag, clientRect}, _, array) => {\n if (drag === item) {\n // If there's only one item left in the container, it must be\n // the dragged item itself so we use it as a reference.\n return array.length < 2;\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 (drag === this._previousSwap.drag && this._previousSwap.overlaps &&\n direction === this._previousSwap.delta) {\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, this)) ? -1 : index;\n }\n\n /** Caches the current items in the list and their positions. */\n private _cacheItems(): void {\n this._activeDraggables = this._draggables.slice();\n this._cacheItemPositions();\n this._cacheParentPositions();\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 incrementVerticalScroll(node, -scrollStep);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n incrementVerticalScroll(node, scrollStep);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n incrementHorizontalScroll(node, -scrollStep);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n incrementHorizontalScroll(node, scrollStep);\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._clientRect != null && isInsideClientRect(this._clientRect, 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 (!this._clientRect || !isInsideClientRect(this._clientRect, x, y) ||\n !this.enterPredicate(item, this)) {\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 const nativeElement = coerceElement(this.element);\n\n // The `ClientRect`, 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 === nativeElement || nativeElement.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 (!activeSiblings.has(sibling) && 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 activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\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 }\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.scroll.subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\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 adjustClientRect(clientRect, scrollDifference.top, scrollDifference.left);\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 } 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(coerceElement(this.element));\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._activeDraggables.filter(item => item.isDragging());\n this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));\n }\n}\n\n\n/**\n * Finds the index of an item that matches a predicate function. Used as an equivalent\n * of `Array.prototype.findIndex` which isn't part of the standard Google typings.\n * @param array Array in which to look for matches.\n * @param predicate Function used to determine whether an item is a match.\n */\nfunction findIndex<T>(array: T[],\n predicate: (value: T, index: number, obj: T[]) => boolean): number {\n\n for (let i = 0; i < array.length; i++) {\n if (predicate(array[i], i, array)) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Increments the vertical scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementVerticalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(0, amount);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollTop += amount;\n }\n}\n\n/**\n * Increments the horizontal scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementHorizontalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(amount, 0);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollLeft += amount;\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: ClientRect, 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: ClientRect, 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 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(element: HTMLElement, clientRect: ClientRect, pointerX: number,\n pointerY: number): [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 (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 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.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {Subject} from 'rxjs';\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true\n});\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// Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order\n// to avoid circular imports. If we were to reference them here, importing the registry into the\n// classes that are registering themselves will introduce a circular import.\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry<I extends {isDragging(): boolean}, C> implements OnDestroy {\n private _document: Document;\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<C>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<I>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances: I[] = [];\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners = new Map<string, {\n handler: (event: Event) => void,\n options?: AddEventListenerOptions | boolean\n }>();\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: I) => item.isDragging();\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 /** Emits when the viewport has been scrolled while the user is dragging an item. */\n readonly scroll: Subject<Event> = new Subject<Event>();\n\n constructor(\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any) {\n this._document = _document;\n }\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: C) {\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: I) {\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._document.addEventListener('touchmove', this._persistentTouchmoveListener,\n activeCapturingEventOptions);\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: C) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: I) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._document.removeEventListener('touchmove', this._persistentTouchmoveListener,\n activeCapturingEventOptions);\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: I, 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._activeDragInstances.push(drag);\n\n if (this._activeDragInstances.length === 1) {\n const isTouchEvent = event.type.startsWith('touch');\n\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 this._globalListeners\n .set(isTouchEvent ? 'touchend' : 'mouseup', {\n handler: (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent),\n options: true\n })\n .set('scroll', {\n handler: (e: Event) => this.scroll.next(e),\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 options: true\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 .set('selectstart', {\n handler: this._preventDefaultWhileDragging,\n options: activeCapturingEventOptions\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 this._globalListeners.set('mousemove', {\n handler: (e: Event) => this.pointerMove.next(e as MouseEvent),\n options: activeCapturingEventOptions\n });\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners.forEach((config, name) => {\n this._document.addEventListener(name, config.handler, config.options);\n });\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: I) {\n const index = this._activeDragInstances.indexOf(drag);\n\n if (index > -1) {\n this._activeDragInstances.splice(index, 1);\n\n if (this._activeDragInstances.length === 0) {\n this._clearGlobalListeners();\n }\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: I) {\n return this._activeDragInstances.indexOf(drag) > -1;\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\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((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n\n this._globalListeners.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.io/license\n */\n\nimport {Injectable, Inject, NgZone, ElementRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {ViewportRuler} from '@angular/cdk/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 constructor(\n @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>) {}\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>(element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG): DragRef<T> {\n\n return new DragRef<T>(element, config, this._document, this._ngZone, this._viewportRuler,\n this._dragDropRegistry);\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>(element, this._dragDropRegistry, this._document, this._ngZone,\n this._viewportRuler);\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.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\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<{}>('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.io/license\n */\n\nimport {Directive, OnDestroy, Input, InjectionToken} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\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 =\n new InjectionToken<CdkDropListGroup<unknown>>('CdkDropListGroup');\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('cdkDropListGroupDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n ngOnDestroy() {\n this._items.clear();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\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.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {DragRefConfig, Point, DragRef} 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/** Function that can be used to constrain the position of a dragged element. */\nexport type DragConstrainPosition = (point: Point, dragRef: DragRef) => Point;\n\n/** Possible orientations for a drop list. */\nexport type DropListOrientation = 'horizontal' | 'vertical';\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;\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}\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.io/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(`${name} must be attached to an element node. ` +\n `Currently attached to \"${node.nodeName}\".`);\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.io/license\n */\n\nimport {\n BooleanInput,\n coerceArray,\n coerceNumberProperty,\n coerceBooleanProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Optional,\n Directive,\n ChangeDetectorRef,\n SkipSelf,\n Inject,\n InjectionToken,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ScrollDispatcher} from '@angular/cdk/scrolling';\nimport {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 {Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {assertElementNode} from './assertions';\n\n/** Counter used to generate unique ids for drop zones. */\nlet _uniqueIdCounter = 0;\n\n/**\n * Internal compile-time-only representation of a `CdkDropList`.\n * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.\n * @docs-private\n */\nexport interface CdkDropListInternal extends CdkDropList {}\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/** 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 /** Emits when the list has been destroyed. */\n private _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 = `cdk-drop-list-${_uniqueIdCounter++}`;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n @Input('cdkDropListLockAxis') lockAxis: DragAxis;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n @Input('cdkDropListDisabled')\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 = coerceBooleanProperty(value);\n }\n private _disabled: boolean;\n\n /** Whether sorting within this drop list is disabled. */\n @Input('cdkDropListSortingDisabled')\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('cdkDropListAutoScrollDisabled')\n autoScrollDisabled: boolean;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n @Input('cdkDropListAutoScrollStep')\n autoScrollStep: number;\n\n /** Emits when the user drops an item inside the container. */\n @Output('cdkDropListDropped')\n 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 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 exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();\n\n /** Emits as the user is swapping items while actively dragging. */\n @Output('cdkDropListSorted')\n 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(\n /** Element that the drop list is attached to. */\n public element: ElementRef<HTMLElement>, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef,\n private _scrollDispatcher: ScrollDispatcher,\n @Optional() private _dir?: Directionality,\n @Optional() @Inject(CDK_DROP_LIST_GROUP) @SkipSelf()\n private _group?: CdkDropListGroup<CdkDropList>,\n @Optional() @Inject(CDK_DRAG_CONFIG) config?: DragDropConfig) {\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(element.nativeElement, 'cdkDropList');\n }\n\n this._dropListRef = dragDrop.createDropList(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, drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\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 (_group) {\n _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\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n\n /** Removes an item from the drop list. */\n removeItem(item: CdkDrag): void {\n this._unsortedItems.delete(item);\n\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\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 =\n a._dragRef.getVisibleElement().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._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 ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);\n ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);\n ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);\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();\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(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n item: event.item.data,\n isPointerOverContainer: event.isPointerOverContainer,\n distance: event.distance\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\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n 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\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n }\n\n /** Syncs up the registered drag items with underlying drop list ref. */\n private _syncItemsWithRef() {\n this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_sortingDisabled: BooleanInput;\n static ngAcceptInputType_autoScrollDisabled: BooleanInput;\n static ngAcceptInputType_autoScrollStep: NumberInput;\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.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n Optional,\n SkipSelf,\n} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {assertElementNode} from './assertions';\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 OnDestroy {\n /** Closest parent draggable instance. */\n _parentDrag: {} | undefined;\n\n /** Emits when the state of the handle has changed. */\n _stateChanges = new Subject<CdkDragHandle>();\n\n /** Whether starting to drag through this handle is disabled. */\n @Input('cdkDragHandleDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._stateChanges.next(this);\n }\n private _disabled = false;\n\n constructor(\n public element: ElementRef<HTMLElement>,\n @Inject(CDK_DRAG_PARENT) @Optional() @SkipSelf() parentDrag?: any) {\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(element.nativeElement, 'cdkDragHandle');\n }\n\n this._parentDrag = parentDrag;\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\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.io/license\n */\n\nimport {Directive, TemplateRef, Input, InjectionToken} from '@angular/core';\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> {\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n constructor(public templateRef: TemplateRef<T>) {}\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.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, InjectionToken, Input, TemplateRef} from '@angular/core';\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> {\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()\n get matchSize(): boolean { return this._matchSize; }\n set matchSize(value: boolean) { this._matchSize = coerceBooleanProperty(value); }\n private _matchSize = false;\n\n constructor(public templateRef: TemplateRef<T>) {}\n\n static ngAcceptInputType_matchSize: BooleanInput;\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.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ContentChild,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n SkipSelf,\n ViewContainerRef,\n OnChanges,\n SimpleChanges,\n ChangeDetectorRef,\n Self,\n} from '@angular/core';\nimport {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput\n} from '@angular/cdk/coercion';\nimport {Observable, Observer, Subject, merge} from 'rxjs';\nimport {startWith, take, map, takeUntil, switchMap, tap} from 'rxjs/operators';\nimport {\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 {CDK_DRAG_PLACEHOLDER, CdkDragPlaceholder} from './drag-placeholder';\nimport {CDK_DRAG_PREVIEW, CdkDragPreview} from './drag-preview';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, Point} from '../drag-ref';\nimport {CDK_DROP_LIST, CdkDropListInternal as CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\nimport {CDK_DRAG_CONFIG, DragDropConfig, DragStartDelay, DragAxis} from './config';\nimport {assertElementNode} from './assertions';\n\nconst DRAG_HOST_CLASS = 'cdk-drag';\n\n/** Element that can be moved inside a CdkDropList container. */\n@Directive({\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n host: {\n 'class': DRAG_HOST_CLASS,\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 private _destroyed = new Subject<void>();\n private static _dragInstances: CdkDrag[] = [];\n\n /** Reference to the underlying drag instance. */\n _dragRef: DragRef<CdkDrag<T>>;\n\n /** Elements that can be used to drag the draggable item. */\n @ContentChildren(CDK_DRAG_HANDLE, {descendants: true}) _handles: QueryList<CdkDragHandle>;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n @ContentChild(CDK_DRAG_PREVIEW) _previewTemplate: CdkDragPreview;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n @ContentChild(CDK_DRAG_PLACEHOLDER) _placeholderTemplate: CdkDragPlaceholder;\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;\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: {x: number, y: number};\n\n /** Whether starting to drag this element is disabled. */\n @Input('cdkDragDisabled')\n get disabled(): boolean {\n return this._disabled || (this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(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 and should return a point describing where the item should\n * be rendered.\n */\n @Input('cdkDragConstrainPosition') constrainPosition?: (point: Point, dragRef: DragRef) => Point;\n\n /** Class to be added to the preview element. */\n @Input('cdkDragPreviewClass') previewClass: string | string[];\n\n /** Emits when the user starts dragging the item. */\n @Output('cdkDragStarted') started: EventEmitter<CdkDragStart> = new EventEmitter<CdkDragStart>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n @Output('cdkDragReleased') released: EventEmitter<CdkDragRelease> =\n new EventEmitter<CdkDragRelease>();\n\n /** Emits when the user stops dragging an item in the container. */\n @Output('cdkDragEnded') ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();\n\n /** Emits when the user has moved the item into a new container. */\n @Output('cdkDragEntered') entered: EventEmitter<CdkDragEnter<any>> =\n new EventEmitter<CdkDragEnter<any>>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n @Output('cdkDragExited') exited: EventEmitter<CdkDragExit<any>> =\n new EventEmitter<CdkDragExit<any>>();\n\n /** Emits when the user drops the item inside a container. */\n @Output('cdkDragDropped') dropped: EventEmitter<CdkDragDrop<any>> =\n new EventEmitter<CdkDragDrop<any>>();\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') moved: Observable<CdkDragMove<T>> =\n new Observable((observer: Observer<CdkDragMove<T>>) => {\n const subscription = this._dragRef.moved.pipe(map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance\n }))).subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n });\n\n constructor(\n /** Element that the draggable is attached to. */\n public element: ElementRef<HTMLElement>,\n /** Droppable container that the draggable is a part of. */\n @Inject(CDK_DROP_LIST) @Optional() @SkipSelf() public dropContainer: CdkDropList,\n /**\n * @deprecated `_document` parameter no longer being used and will be removed.\n * @breaking-change 12.0.0\n */\n @Inject(DOCUMENT) _document: any, private _ngZone: NgZone,\n private _viewContainerRef: ViewContainerRef,\n @Optional() @Inject(CDK_DRAG_CONFIG) config: DragDropConfig,\n @Optional() private _dir: Directionality, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() @Self() @Inject(CDK_DRAG_HANDLE) private _selfHandle?: CdkDragHandle,\n @Optional() @SkipSelf() @Inject(CDK_DRAG_PARENT) private _parentDrag?: CdkDrag) {\n this._dragRef = dragDrop.createDrag(element, {\n dragStartThreshold: config && config.dragStartThreshold != null ?\n config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?\n config.pointerDirectionChangeThreshold : 5,\n zIndex: config?.zIndex,\n });\n this._dragRef.data = this;\n\n // We have to keep track of the drag instances in order to be able to match an element to\n // a drag instance. We can't go through the global registry of `DragRef`, because the root\n // element could be different.\n CdkDrag._dragInstances.push(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 this._dragRef._withDropContainer(dropContainer._dropListRef);\n dropContainer.addItem(this);\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 /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition(): {readonly x: number, readonly y: number} {\n return this._dragRef.getFreeDragPosition();\n }\n\n ngAfterViewInit() {\n // We need to wait for the zone to stabilize, 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 this._ngZone.onStable\n .pipe(take(1), takeUntil(this._destroyed))\n .subscribe(() => {\n this._updateRootElement();\n\n // Listen for any newly-added handles.\n this._handles.changes.pipe(\n startWith(this._handles),\n // Sync the new handles with the DragRef.\n tap((handles: QueryList<CdkDragHandle>) => {\n const childHandleElements = handles\n .filter(handle => handle._parentDrag === this)\n .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 childHandleElements.push(this.element);\n }\n\n this._dragRef.withHandles(childHandleElements);\n }),\n // Listen if the state of any of the handles changes.\n switchMap((handles: QueryList<CdkDragHandle>) => {\n return merge(...handles.map(item => {\n return item._stateChanges.pipe(startWith(item));\n })) as Observable<CdkDragHandle>;\n }),\n takeUntil(this._destroyed)\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 if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\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 `ngAfterViewInit` where it needs to be deferred.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n\n // Skip the first change since it's being handled in `ngAfterViewInit`.\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 const index = CdkDrag._dragInstances.indexOf(this);\n if (index > -1) {\n CdkDrag._dragInstances.splice(index, 1);\n }\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n }\n\n /** Syncs the root element with the `DragRef`. */\n private _updateRootElement() {\n const element = this.element.nativeElement;\n const rootElement = this.rootElementSelector ?\n getClosestMatchingAncestor(element, this.rootElementSelector) : element;\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 getClosestMatchingAncestor(this.element.nativeElement, boundary);\n }\n\n const element = coerceElement(boundary);\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n !element.contains(this.element.nativeElement)) {\n throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');\n }\n\n return element;\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 template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef\n } : null;\n const preview = this._previewTemplate ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef\n } : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.dragStartDelay = (typeof dragStartDelay === 'object' && dragStartDelay) ?\n dragStartDelay : 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\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 // `classList` needs to be null checked, because IE doesn't have it on some elements.\n if (parent.classList?.contains(DRAG_HOST_CLASS)) {\n ref.withParent(CdkDrag._dragInstances.find(drag => {\n return drag.element.nativeElement === parent;\n })?._dragRef || null);\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(() => {\n this.started.emit({source: this});\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(() => {\n this.released.emit({source: this});\n });\n\n ref.ended.subscribe(event => {\n this.ended.emit({source: this, distance: event.distance});\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(event => {\n this.entered.emit({\n container: event.container.data,\n item: this,\n currentIndex: event.currentIndex\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: event.container.data,\n item: this\n });\n });\n\n ref.dropped.subscribe(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n isPointerOverContainer: event.isPointerOverContainer,\n item: this,\n distance: event.distance\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, dragStartDelay, constrainPosition, previewClass,\n boundaryElement, draggingDisabled, rootElementSelector\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\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\n static ngAcceptInputType_disabled: BooleanInput;\n}\n\n/** Gets the closest ancestor of an element that matches a selector. */\nfunction getClosestMatchingAncestor(element: HTMLElement, selector: string) {\n let currentElement = element.parentElement as HTMLElement | null;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) :\n (currentElement as any).msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\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.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkScrollableModule} from '@angular/cdk/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\n@NgModule({\n declarations: [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n exports: [\n CdkScrollableModule,\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n providers: [\n DragDrop,\n ]\n})\nexport class DragDropModule {}\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.io/license\n */\n\nexport {DragDrop} from './drag-drop';\nexport {DragRef, DragRefConfig, Point} from './drag-ref';\nexport {DropListRef} from './drop-list-ref';\nexport {CDK_DRAG_PARENT} from './drag-parent';\n\nexport * from './drag-events';\nexport * from './drag-utils';\nexport * from './drag-drop-module';\nexport * from './drag-drop-registry';\n\nexport {CdkDropList, CDK_DROP_LIST} from './directives/drop-list';\nexport * from './directives/config';\nexport * from './directives/drop-list-group';\nexport * from './directives/drag';\nexport * from './directives/drag-handle';\nexport * from './directives/drag-preview';\nexport * from './directives/drag-placeholder';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {CdkDropListInternal as ɵangular_material_src_cdk_drag_drop_drag_drop_a} from './directives/drop-list';"],"names":["normalizePassiveListenerOptions","Subject","Subscription","coerceBooleanProperty","coerceElement","_getShadowRoot","clamp","interval","animationFrameScheduler","takeUntil","Injectable","NgZone","Inject","DOCUMENT","ViewportRuler","InjectionToken","Directive","Input","EventEmitter","startWith","coerceArray","coerceNumberProperty","ElementRef","ChangeDetectorRef","ScrollDispatcher","Directionality","Optional","SkipSelf","Output","TemplateRef","Observable","map","take","tap","switchMap","merge","ViewContainerRef","Self","ContentChildren","ContentChild","NgModule","CdkScrollableModule"],"mappings":";;;;;;IAAA;;;;;;;IA0BA;;;;AAIA,aAAgB,YAAY,CACxB,IAAoC,EACpC,MAAwC;QAC1C,KAAK,IAAI,GA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