blob: 33b58f28187550a50a2120d66425eea674251957 [file] [log] [blame]
{"version":3,"file":"cdk-overlay.umd.min.js","sources":["../../src/cdk/overlay/position/global-position-strategy.ts","../../src/cdk/overlay/position/overlay-position-builder.ts","../../src/cdk/overlay/overlay.ts","../../src/cdk/overlay/overlay-directives.ts","../../src/cdk/overlay/overlay-module.ts","../../src/cdk/overlay/fullscreen-overlay-container.ts","../../node_modules/tslib/tslib.es6.js","../../src/cdk/overlay/scroll/scroll-strategy.ts","../../src/cdk/overlay/position/scroll-clip.ts","../../src/cdk/overlay/position/connected-position.ts","../../src/cdk/overlay/keyboard/overlay-keyboard-dispatcher.ts","../../src/cdk/overlay/overlay-container.ts","../../src/cdk/overlay/position/flexible-connected-position-strategy.ts","../../src/cdk/overlay/scroll/block-scroll-strategy.ts","../../src/cdk/overlay/scroll/close-scroll-strategy.ts","../../src/cdk/overlay/scroll/noop-scroll-strategy.ts","../../src/cdk/overlay/scroll/reposition-scroll-strategy.ts","../../src/cdk/overlay/scroll/scroll-strategy-options.ts","../../src/cdk/overlay/overlay-config.ts","../../src/cdk/overlay/overlay-ref.ts","../../src/cdk/overlay/position/connected-position-strategy.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\nimport {PositionStrategy} from './position-strategy';\nimport {OverlayReference} from '../overlay-reference';\n\n/** Class to be added to the overlay pane wrapper. */\nconst wrapperClass = 'cdk-global-overlay-wrapper';\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * explicit position relative to the browser's viewport. We use flexbox, instead of\n * transforms, in order to avoid issues with subpixel rendering which can cause the\n * element to become blurry.\n */\nexport class GlobalPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef: OverlayReference;\n private _cssPosition: string = 'static';\n private _topOffset: string = '';\n private _bottomOffset: string = '';\n private _leftOffset: string = '';\n private _rightOffset: string = '';\n private _alignItems: string = '';\n private _justifyContent: string = '';\n private _width: string = '';\n private _height: string = '';\n private _isDisposed: boolean;\n\n attach(overlayRef: OverlayReference): void {\n const config = overlayRef.getConfig();\n\n this._overlayRef = overlayRef;\n\n if (this._width && !config.width) {\n overlayRef.updateSize({width: this._width});\n }\n\n if (this._height && !config.height) {\n overlayRef.updateSize({height: this._height});\n }\n\n overlayRef.hostElement.classList.add(wrapperClass);\n this._isDisposed = false;\n }\n\n /**\n * Sets the top position of the overlay. Clears any previously set vertical position.\n * @param value New top offset.\n */\n top(value: string = ''): this {\n this._bottomOffset = '';\n this._topOffset = value;\n this._alignItems = 'flex-start';\n return this;\n }\n\n /**\n * Sets the left position of the overlay. Clears any previously set horizontal position.\n * @param value New left offset.\n */\n left(value: string = ''): this {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }\n\n /**\n * Sets the bottom position of the overlay. Clears any previously set vertical position.\n * @param value New bottom offset.\n */\n bottom(value: string = ''): this {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }\n\n /**\n * Sets the right position of the overlay. Clears any previously set horizontal position.\n * @param value New right offset.\n */\n right(value: string = ''): this {\n this._leftOffset = '';\n this._rightOffset = value;\n this._justifyContent = 'flex-end';\n return this;\n }\n\n /**\n * Sets the overlay width and clears any previously set width.\n * @param value New width for the overlay\n * @deprecated Pass the `width` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n width(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({width: value});\n } else {\n this._width = value;\n }\n\n return this;\n }\n\n /**\n * Sets the overlay height and clears any previously set height.\n * @param value New height for the overlay\n * @deprecated Pass the `height` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n height(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({height: value});\n } else {\n this._height = value;\n }\n\n return this;\n }\n\n /**\n * Centers the overlay horizontally with an optional offset.\n * Clears any previously set horizontal position.\n *\n * @param offset Overlay offset from the horizontal center.\n */\n centerHorizontally(offset: string = ''): this {\n this.left(offset);\n this._justifyContent = 'center';\n return this;\n }\n\n /**\n * Centers the overlay vertically with an optional offset.\n * Clears any previously set vertical position.\n *\n * @param offset Overlay offset from the vertical center.\n */\n centerVertically(offset: string = ''): this {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }\n\n /**\n * Apply the position to the element.\n * @docs-private\n */\n apply(): void {\n // Since the overlay ref applies the strategy asynchronously, it could\n // have been disposed before it ends up being applied. If that is the\n // case, we shouldn't do anything.\n if (!this._overlayRef || !this._overlayRef.hasAttached()) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parentStyles = this._overlayRef.hostElement.style;\n const config = this._overlayRef.getConfig();\n\n styles.position = this._cssPosition;\n styles.marginLeft = config.width === '100%' ? '0' : this._leftOffset;\n styles.marginTop = config.height === '100%' ? '0' : this._topOffset;\n styles.marginBottom = this._bottomOffset;\n styles.marginRight = this._rightOffset;\n\n if (config.width === '100%') {\n parentStyles.justifyContent = 'flex-start';\n } else if (this._justifyContent === 'center') {\n parentStyles.justifyContent = 'center';\n } else if (this._overlayRef.getConfig().direction === 'rtl') {\n // In RTL the browser will invert `flex-start` and `flex-end` automatically, but we\n // don't want that because our positioning is explicitly `left` and `right`, hence\n // why we do another inversion to ensure that the overlay stays in the same position.\n // TODO: reconsider this if we add `start` and `end` methods.\n if (this._justifyContent === 'flex-start') {\n parentStyles.justifyContent = 'flex-end';\n } else if (this._justifyContent === 'flex-end') {\n parentStyles.justifyContent = 'flex-start';\n }\n } else {\n parentStyles.justifyContent = this._justifyContent;\n }\n\n parentStyles.alignItems = config.height === '100%' ? 'flex-start' : this._alignItems;\n }\n\n /**\n * Cleans up the DOM changes from the position strategy.\n * @docs-private\n */\n dispose(): void {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =\n styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n\n this._overlayRef = null!;\n this._isDisposed = true;\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 {Platform} from '@angular/cdk/platform';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {DOCUMENT} from '@angular/common';\nimport {ElementRef, Inject, Injectable} from '@angular/core';\n\nimport {OverlayContainer} from '../overlay-container';\n\nimport {OriginConnectionPosition, OverlayConnectionPosition} from './connected-position';\nimport {ConnectedPositionStrategy} from './connected-position-strategy';\nimport {\n FlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategyOrigin,\n} from './flexible-connected-position-strategy';\nimport {GlobalPositionStrategy} from './global-position-strategy';\n\n\n/** Builder for overlay position strategy. */\n@Injectable({providedIn: 'root'})\nexport class OverlayPositionBuilder {\n constructor(\n private _viewportRuler: ViewportRuler, @Inject(DOCUMENT) private _document: any,\n private _platform: Platform, private _overlayContainer: OverlayContainer) {}\n\n /**\n * Creates a global position strategy.\n */\n global(): GlobalPositionStrategy {\n return new GlobalPositionStrategy();\n }\n\n /**\n * Creates a relative position strategy.\n * @param elementRef\n * @param originPos\n * @param overlayPos\n * @deprecated Use `flexibleConnectedTo` instead.\n * @breaking-change 8.0.0\n */\n connectedTo(\n elementRef: ElementRef,\n originPos: OriginConnectionPosition,\n overlayPos: OverlayConnectionPosition): ConnectedPositionStrategy {\n return new ConnectedPositionStrategy(\n originPos, overlayPos, elementRef, this._viewportRuler, this._document, this._platform,\n this._overlayContainer);\n }\n\n /**\n * Creates a flexible position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\n flexibleConnectedTo(origin: FlexibleConnectedPositionStrategyOrigin):\n FlexibleConnectedPositionStrategy {\n return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document,\n this._platform, this._overlayContainer);\n }\n\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DomPortalOutlet} from '@angular/cdk/portal';\nimport {DOCUMENT, Location} from '@angular/common';\nimport {\n ApplicationRef,\n ComponentFactoryResolver,\n Inject,\n Injectable,\n Injector,\n NgZone,\n Optional,\n} from '@angular/core';\nimport {OverlayKeyboardDispatcher} from './keyboard/overlay-keyboard-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {OverlayContainer} from './overlay-container';\nimport {OverlayRef} from './overlay-ref';\nimport {OverlayPositionBuilder} from './position/overlay-position-builder';\nimport {ScrollStrategyOptions} from './scroll/index';\n\n\n/** Next overlay unique ID. */\nlet nextUniqueId = 0;\n\n// Note that Overlay is *not* scoped to the app root because the ComponentFactoryResolver\n// it needs is different based on where OverlayModule is imported.\n\n/**\n * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be\n * used as a low-level building block for other components. Dialogs, tooltips, menus,\n * selects, etc. can all be built using overlays. The service should primarily be used by authors\n * of re-usable components rather than developers building end-user applications.\n *\n * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.\n */\n@Injectable()\nexport class Overlay {\n private _appRef: ApplicationRef;\n\n constructor(\n /** Scrolling strategies that can be used when creating an overlay. */\n public scrollStrategies: ScrollStrategyOptions,\n private _overlayContainer: OverlayContainer,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _positionBuilder: OverlayPositionBuilder,\n private _keyboardDispatcher: OverlayKeyboardDispatcher,\n private _injector: Injector,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) private _document: any,\n private _directionality: Directionality,\n // @breaking-change 8.0.0 `_location` parameter to be made required.\n @Optional() private _location?: Location) { }\n\n /**\n * Creates an overlay.\n * @param config Configuration applied to the overlay.\n * @returns Reference to the created overlay.\n */\n create(config?: OverlayConfig): OverlayRef {\n const host = this._createHostElement();\n const pane = this._createPaneElement(host);\n const portalOutlet = this._createPortalOutlet(pane);\n const overlayConfig = new OverlayConfig(config);\n\n overlayConfig.direction = overlayConfig.direction || this._directionality.value;\n\n return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone,\n this._keyboardDispatcher, this._document, this._location);\n }\n\n /**\n * Gets a position builder that can be used, via fluent API,\n * to construct and configure a position strategy.\n * @returns An overlay position builder.\n */\n position(): OverlayPositionBuilder {\n return this._positionBuilder;\n }\n\n /**\n * Creates the DOM element for an overlay and appends it to the overlay container.\n * @returns Newly-created pane element\n */\n private _createPaneElement(host: HTMLElement): HTMLElement {\n const pane = this._document.createElement('div');\n\n pane.id = `cdk-overlay-${nextUniqueId++}`;\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n\n return pane;\n }\n\n /**\n * Creates the host element that wraps around an overlay\n * and can be used for advanced positioning.\n * @returns Newly-create host element.\n */\n private _createHostElement(): HTMLElement {\n const host = this._document.createElement('div');\n this._overlayContainer.getContainerElement().appendChild(host);\n return host;\n }\n\n /**\n * Create a DomPortalOutlet into which the overlay content can be loaded.\n * @param pane The DOM element to turn into a portal outlet.\n * @returns A portal outlet for the given DOM element.\n */\n private _createPortalOutlet(pane: HTMLElement): DomPortalOutlet {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get<ApplicationRef>(ApplicationRef);\n }\n\n return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector);\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 {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {Overlay} from './overlay';\nimport {OverlayConfig} from './overlay-config';\nimport {OverlayRef} from './overlay-ref';\nimport {ConnectedOverlayPositionChange} from './position/connected-position';\nimport {\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n} from './position/flexible-connected-position-strategy';\nimport {\n RepositionScrollStrategy,\n RepositionScrollStrategyConfig,\n ScrollStrategy,\n} from './scroll/index';\n\n\n/** Default set of positions for the overlay. Follows the behavior of a dropdown. */\nconst defaultPositionList: ConnectedPosition[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top'\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom'\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom'\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top'\n }\n];\n\n/** Injection token that determines the scroll handling while the connected overlay is open. */\nexport const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY =\n new InjectionToken<() => ScrollStrategy>('cdk-connected-overlay-scroll-strategy');\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_FACTORY(overlay: Overlay):\n () => ScrollStrategy {\n return (config?: RepositionScrollStrategyConfig) => overlay.scrollStrategies.reposition(config);\n}\n\n/**\n * Directive applied to an element to make it usable as an origin for an Overlay using a\n * ConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',\n exportAs: 'cdkOverlayOrigin',\n})\nexport class CdkOverlayOrigin {\n constructor(\n /** Reference to the element on which the directive is applied. */\n public elementRef: ElementRef) { }\n}\n\n\n/**\n * Directive to facilitate declarative creation of an\n * Overlay using a FlexibleConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',\n exportAs: 'cdkConnectedOverlay'\n})\nexport class CdkConnectedOverlay implements OnDestroy, OnChanges {\n private _overlayRef: OverlayRef;\n private _templatePortal: TemplatePortal;\n private _hasBackdrop = false;\n private _lockPosition = false;\n private _growAfterOpen = false;\n private _flexibleDimensions = false;\n private _push = false;\n private _backdropSubscription = Subscription.EMPTY;\n private _offsetX: number;\n private _offsetY: number;\n private _position: FlexibleConnectedPositionStrategy;\n private _scrollStrategyFactory: () => ScrollStrategy;\n\n /** Origin for the connected overlay. */\n @Input('cdkConnectedOverlayOrigin') origin: CdkOverlayOrigin;\n\n /** Registered connected position pairs. */\n @Input('cdkConnectedOverlayPositions') positions: ConnectedPosition[];\n\n /** The offset in pixels for the overlay connection point on the x-axis */\n @Input('cdkConnectedOverlayOffsetX')\n get offsetX(): number { return this._offsetX; }\n set offsetX(offsetX: number) {\n this._offsetX = offsetX;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The offset in pixels for the overlay connection point on the y-axis */\n @Input('cdkConnectedOverlayOffsetY')\n get offsetY() { return this._offsetY; }\n set offsetY(offsetY: number) {\n this._offsetY = offsetY;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The width of the overlay panel. */\n @Input('cdkConnectedOverlayWidth') width: number | string;\n\n /** The height of the overlay panel. */\n @Input('cdkConnectedOverlayHeight') height: number | string;\n\n /** The min width of the overlay panel. */\n @Input('cdkConnectedOverlayMinWidth') minWidth: number | string;\n\n /** The min height of the overlay panel. */\n @Input('cdkConnectedOverlayMinHeight') minHeight: number | string;\n\n /** The custom class to be set on the backdrop element. */\n @Input('cdkConnectedOverlayBackdropClass') backdropClass: string;\n\n /** The custom class to add to the overlay pane element. */\n @Input('cdkConnectedOverlayPanelClass') panelClass: string | string[];\n\n /** Margin between the overlay and the viewport edges. */\n @Input('cdkConnectedOverlayViewportMargin') viewportMargin: number = 0;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n @Input('cdkConnectedOverlayScrollStrategy') scrollStrategy: ScrollStrategy;\n\n /** Whether the overlay is open. */\n @Input('cdkConnectedOverlayOpen') open: boolean = false;\n\n /** Whether or not the overlay should attach a backdrop. */\n @Input('cdkConnectedOverlayHasBackdrop')\n get hasBackdrop() { return this._hasBackdrop; }\n set hasBackdrop(value: any) { this._hasBackdrop = coerceBooleanProperty(value); }\n\n /** Whether or not the overlay should be locked when scrolling. */\n @Input('cdkConnectedOverlayLockPosition')\n get lockPosition() { return this._lockPosition; }\n set lockPosition(value: any) { this._lockPosition = coerceBooleanProperty(value); }\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n @Input('cdkConnectedOverlayFlexibleDimensions')\n get flexibleDimensions() { return this._flexibleDimensions; }\n set flexibleDimensions(value: boolean) {\n this._flexibleDimensions = coerceBooleanProperty(value);\n }\n\n /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */\n @Input('cdkConnectedOverlayGrowAfterOpen')\n get growAfterOpen() { return this._growAfterOpen; }\n set growAfterOpen(value: boolean) { this._growAfterOpen = coerceBooleanProperty(value); }\n\n /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */\n @Input('cdkConnectedOverlayPush')\n get push() { return this._push; }\n set push(value: boolean) { this._push = coerceBooleanProperty(value); }\n\n /** Event emitted when the backdrop is clicked. */\n @Output() backdropClick = new EventEmitter<MouseEvent>();\n\n /** Event emitted when the position has changed. */\n @Output() positionChange = new EventEmitter<ConnectedOverlayPositionChange>();\n\n /** Event emitted when the overlay has been attached. */\n @Output() attach = new EventEmitter<void>();\n\n /** Event emitted when the overlay has been detached. */\n @Output() detach = new EventEmitter<void>();\n\n /** Emits when there are keyboard events that are targeted at the overlay. */\n @Output() overlayKeydown = new EventEmitter<KeyboardEvent>();\n\n // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.\n\n constructor(\n private _overlay: Overlay,\n templateRef: TemplateRef<any>,\n viewContainerRef: ViewContainerRef,\n @Inject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY) scrollStrategyFactory: any,\n @Optional() private _dir: Directionality) {\n this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);\n this._scrollStrategyFactory = scrollStrategyFactory;\n this.scrollStrategy = this._scrollStrategyFactory();\n }\n\n /** The associated overlay reference. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n\n /** The element's layout direction. */\n get dir(): Direction {\n return this._dir ? this._dir.value : 'ltr';\n }\n\n ngOnDestroy() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n }\n\n this._backdropSubscription.unsubscribe();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this._position) {\n this._updatePositionStrategy(this._position);\n this._overlayRef.updateSize({\n width: this.width,\n minWidth: this.minWidth,\n height: this.height,\n minHeight: this.minHeight,\n });\n\n if (changes['origin'] && this.open) {\n this._position.apply();\n }\n }\n\n if (changes['open']) {\n this.open ? this._attachOverlay() : this._detachOverlay();\n }\n }\n\n /** Creates an overlay */\n private _createOverlay() {\n if (!this.positions || !this.positions.length) {\n this.positions = defaultPositionList;\n }\n\n this._overlayRef = this._overlay.create(this._buildConfig());\n\n this._overlayRef.keydownEvents().subscribe((event: KeyboardEvent) => {\n this.overlayKeydown.next(event);\n\n if (event.keyCode === ESCAPE && !hasModifierKey(event)) {\n event.preventDefault();\n this._detachOverlay();\n }\n });\n }\n\n /** Builds the overlay config based on the directive's inputs */\n private _buildConfig(): OverlayConfig {\n const positionStrategy = this._position = this._createPositionStrategy();\n const overlayConfig = new OverlayConfig({\n direction: this._dir,\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n hasBackdrop: this.hasBackdrop\n });\n\n if (this.width || this.width === 0) {\n overlayConfig.width = this.width;\n }\n\n if (this.height || this.height === 0) {\n overlayConfig.height = this.height;\n }\n\n if (this.minWidth || this.minWidth === 0) {\n overlayConfig.minWidth = this.minWidth;\n }\n\n if (this.minHeight || this.minHeight === 0) {\n overlayConfig.minHeight = this.minHeight;\n }\n\n if (this.backdropClass) {\n overlayConfig.backdropClass = this.backdropClass;\n }\n\n if (this.panelClass) {\n overlayConfig.panelClass = this.panelClass;\n }\n\n return overlayConfig;\n }\n\n /** Updates the state of a position strategy, based on the values of the directive inputs. */\n private _updatePositionStrategy(positionStrategy: FlexibleConnectedPositionStrategy) {\n const positions: ConnectedPosition[] = this.positions.map(currentPosition => ({\n originX: currentPosition.originX,\n originY: currentPosition.originY,\n overlayX: currentPosition.overlayX,\n overlayY: currentPosition.overlayY,\n offsetX: currentPosition.offsetX || this.offsetX,\n offsetY: currentPosition.offsetY || this.offsetY,\n panelClass: currentPosition.panelClass || undefined,\n }));\n\n return positionStrategy\n .setOrigin(this.origin.elementRef)\n .withPositions(positions)\n .withFlexibleDimensions(this.flexibleDimensions)\n .withPush(this.push)\n .withGrowAfterOpen(this.growAfterOpen)\n .withViewportMargin(this.viewportMargin)\n .withLockedPosition(this.lockPosition);\n }\n\n /** Returns the position strategy of the overlay to be set on the overlay config */\n private _createPositionStrategy(): FlexibleConnectedPositionStrategy {\n const strategy = this._overlay.position().flexibleConnectedTo(this.origin.elementRef);\n\n this._updatePositionStrategy(strategy);\n strategy.positionChanges.subscribe(p => this.positionChange.emit(p));\n\n return strategy;\n }\n\n /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */\n private _attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n } else {\n // Update the overlay size, in case the directive's inputs have changed\n this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;\n }\n\n if (!this._overlayRef.hasAttached()) {\n this._overlayRef.attach(this._templatePortal);\n this.attach.emit();\n }\n\n if (this.hasBackdrop) {\n this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {\n this.backdropClick.emit(event);\n });\n } else {\n this._backdropSubscription.unsubscribe();\n }\n }\n\n /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */\n private _detachOverlay() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n this.detach.emit();\n }\n\n this._backdropSubscription.unsubscribe();\n }\n}\n\n\n/** @docs-private */\nexport function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay):\n () => RepositionScrollStrategy {\n return () => overlay.scrollStrategies.reposition();\n}\n\n/** @docs-private */\nexport const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {\n provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,\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 {BidiModule} from '@angular/cdk/bidi';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {ScrollingModule, VIEWPORT_RULER_PROVIDER} from '@angular/cdk/scrolling';\nimport {NgModule, Provider} from '@angular/core';\nimport {OVERLAY_KEYBOARD_DISPATCHER_PROVIDER} from './keyboard/overlay-keyboard-dispatcher';\nimport {Overlay} from './overlay';\nimport {OVERLAY_CONTAINER_PROVIDER} from './overlay-container';\nimport {\n CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,\n CdkConnectedOverlay,\n CdkOverlayOrigin,\n} from './overlay-directives';\nimport {OverlayPositionBuilder} from './position/overlay-position-builder';\n\n\n@NgModule({\n imports: [BidiModule, PortalModule, ScrollingModule],\n exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],\n declarations: [CdkConnectedOverlay, CdkOverlayOrigin],\n providers: [\n Overlay,\n CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,\n ],\n})\nexport class OverlayModule {}\n\n\n/**\n * @deprecated Use `OverlayModule` instead.\n * @breaking-change 8.0.0\n * @docs-private\n */\nexport const OVERLAY_PROVIDERS: Provider[] = [\n Overlay,\n OverlayPositionBuilder,\n OVERLAY_KEYBOARD_DISPATCHER_PROVIDER,\n VIEWPORT_RULER_PROVIDER,\n OVERLAY_CONTAINER_PROVIDER,\n CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,\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, OnDestroy} from '@angular/core';\nimport {OverlayContainer} from './overlay-container';\nimport {DOCUMENT} from '@angular/common';\n\n\n/**\n * Alternative to OverlayContainer that supports correct displaying of overlay elements in\n * Fullscreen mode\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen\n *\n * Should be provided in the root component.\n */\n@Injectable({providedIn: 'root'})\nexport class FullscreenOverlayContainer extends OverlayContainer implements OnDestroy {\n private _fullScreenEventName: string | undefined;\n private _fullScreenListener: () => void;\n\n constructor(@Inject(DOCUMENT) _document: any) {\n super(_document);\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n\n if (this._fullScreenEventName && this._fullScreenListener) {\n this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);\n }\n }\n\n protected _createContainer(): void {\n super._createContainer();\n this._adjustParentForFullscreenChange();\n this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());\n }\n\n private _adjustParentForFullscreenChange(): void {\n if (!this._containerElement) {\n return;\n }\n\n const fullscreenElement = this.getFullscreenElement();\n const parent = fullscreenElement || this._document.body;\n parent.appendChild(this._containerElement);\n }\n\n private _addFullscreenChangeListener(fn: () => void) {\n const eventName = this._getEventName();\n\n if (eventName) {\n if (this._fullScreenListener) {\n this._document.removeEventListener(eventName, this._fullScreenListener);\n }\n\n this._document.addEventListener(eventName, fn);\n this._fullScreenListener = fn;\n }\n }\n\n private _getEventName(): string | undefined {\n if (!this._fullScreenEventName) {\n if (this._document.fullscreenEnabled) {\n this._fullScreenEventName = 'fullscreenchange';\n } else if (this._document.webkitFullscreenEnabled) {\n this._fullScreenEventName = 'webkitfullscreenchange';\n } else if ((this._document as any).mozFullScreenEnabled) {\n this._fullScreenEventName = 'mozfullscreenchange';\n } else if ((this._document as any).msFullscreenEnabled) {\n this._fullScreenEventName = 'MSFullscreenChange';\n }\n }\n\n return this._fullScreenEventName;\n }\n\n /**\n * When the page is put into fullscreen mode, a specific element is specified.\n * Only that element and its children are visible when in fullscreen mode.\n */\n getFullscreenElement(): Element {\n return this._document.fullscreenElement ||\n this._document.webkitFullscreenElement ||\n (this._document as any).mozFullScreenElement ||\n (this._document as any).msFullscreenElement ||\n null;\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\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++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\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 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) : new P(function (resolve) { resolve(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 function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n 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}\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\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\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\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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = 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","/**\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 {OverlayReference} from '../overlay-reference';\n\n/**\n * Describes a strategy that will be used by an overlay to handle scroll events while it is open.\n */\nexport interface ScrollStrategy {\n /** Enable this scroll strategy (called when the attached overlay is attached to a portal). */\n enable: () => void;\n\n /** Disable this scroll strategy (called when the attached overlay is detached from a portal). */\n disable: () => void;\n\n /** Attaches this `ScrollStrategy` to an overlay. */\n attach: (overlayRef: OverlayReference) => void;\n\n /** Detaches the scroll strategy from the current overlay. */\n detach?: () => void;\n}\n\n/**\n * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.\n */\nexport function getMatScrollStrategyAlreadyAttachedError(): Error {\n return Error(`Scroll strategy has already been attached.`);\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// TODO(jelbourn): move this to live with the rest of the scrolling code\n// TODO(jelbourn): someday replace this with IntersectionObservers\n\n/**\n * Gets whether an element is scrolled outside of view by any of its parent scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is scrolled out of view\n * @docs-private\n */\nexport function isElementScrolledOutsideView(element: ClientRect, scrollContainers: ClientRect[]) {\n return scrollContainers.some(containerBounds => {\n const outsideAbove = element.bottom < containerBounds.top;\n const outsideBelow = element.top > containerBounds.bottom;\n const outsideLeft = element.right < containerBounds.left;\n const outsideRight = element.left > containerBounds.right;\n\n return outsideAbove || outsideBelow || outsideLeft || outsideRight;\n });\n}\n\n\n/**\n * Gets whether an element is clipped by any of its scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is clipped\n * @docs-private\n */\nexport function isElementClippedByScrolling(element: ClientRect, scrollContainers: ClientRect[]) {\n return scrollContainers.some(scrollContainerRect => {\n const clippedAbove = element.top < scrollContainerRect.top;\n const clippedBelow = element.bottom > scrollContainerRect.bottom;\n const clippedLeft = element.left < scrollContainerRect.left;\n const clippedRight = element.right > scrollContainerRect.right;\n\n return clippedAbove || clippedBelow || clippedLeft || clippedRight;\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/** Horizontal dimension of a connection point on the perimeter of the origin or overlay element. */\nimport {Optional} from '@angular/core';\nexport type HorizontalConnectionPos = 'start' | 'center' | 'end';\n\n/** Vertical dimension of a connection point on the perimeter of the origin or overlay element. */\nexport type VerticalConnectionPos = 'top' | 'center' | 'bottom';\n\n\n/** A connection point on the origin element. */\nexport interface OriginConnectionPosition {\n originX: HorizontalConnectionPos;\n originY: VerticalConnectionPos;\n}\n\n/** A connection point on the overlay element. */\nexport interface OverlayConnectionPosition {\n overlayX: HorizontalConnectionPos;\n overlayY: VerticalConnectionPos;\n}\n\n/** The points of the origin element and the overlay element to connect. */\nexport class ConnectionPositionPair {\n /** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */\n originX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */\n originY: VerticalConnectionPos;\n /** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */\n overlayX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */\n overlayY: VerticalConnectionPos;\n\n constructor(\n origin: OriginConnectionPosition,\n overlay: OverlayConnectionPosition,\n /** Offset along the X axis. */\n public offsetX?: number,\n /** Offset along the Y axis. */\n public offsetY?: number,\n /** Class(es) to be applied to the panel while this position is active. */\n public panelClass?: string | string[]) {\n\n this.originX = origin.originX;\n this.originY = origin.originY;\n this.overlayX = overlay.overlayX;\n this.overlayY = overlay.overlayY;\n }\n}\n\n/**\n * Set of properties regarding the position of the origin and overlay relative to the viewport\n * with respect to the containing Scrollable elements.\n *\n * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the\n * bounds of any one of the strategy's Scrollable's bounding client rectangle.\n *\n * The overlay and origin are outside view if there is no overlap between their bounding client\n * rectangle and any one of the strategy's Scrollable's bounding client rectangle.\n *\n * ----------- -----------\n * | outside | | clipped |\n * | view | --------------------------\n * | | | | | |\n * ---------- | ----------- |\n * -------------------------- | |\n * | | | Scrollable |\n * | | | |\n * | | --------------------------\n * | Scrollable |\n * | |\n * --------------------------\n *\n * @docs-private\n */\nexport class ScrollingVisibility {\n isOriginClipped: boolean;\n isOriginOutsideView: boolean;\n isOverlayClipped: boolean;\n isOverlayOutsideView: boolean;\n}\n\n/** The change event emitted by the strategy when a fallback position is used. */\nexport class ConnectedOverlayPositionChange {\n constructor(\n /** The position used as a result of this change. */\n public connectionPair: ConnectionPositionPair,\n /** @docs-private */\n @Optional() public scrollableViewProperties: ScrollingVisibility) {}\n}\n\n/**\n * Validates whether a vertical position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateVerticalPosition(property: string, value: VerticalConnectionPos) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"top\", \"bottom\" or \"center\".`);\n }\n}\n\n/**\n * Validates whether a horizontal position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateHorizontalPosition(property: string, value: HorizontalConnectionPos) {\n if (value !== 'start' && value !== 'end' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"start\", \"end\" or \"center\".`);\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 {DOCUMENT} from '@angular/common';\nimport {\n Inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n SkipSelf,\n} from '@angular/core';\nimport {OverlayRef} from '../overlay-ref';\n\n\n/**\n * Service for dispatching keyboard events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport class OverlayKeyboardDispatcher implements OnDestroy {\n\n /** Currently attached overlays in the order they were attached. */\n _attachedOverlays: OverlayRef[] = [];\n\n private _document: Document;\n private _isAttached: boolean;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n ngOnDestroy() {\n this._detach();\n }\n\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef: OverlayRef): void {\n // Ensure that we don't get the same overlay multiple times.\n this.remove(overlayRef);\n\n // Lazily start dispatcher once first overlay is added\n if (!this._isAttached) {\n this._document.body.addEventListener('keydown', this._keydownListener);\n this._isAttached = true;\n }\n\n this._attachedOverlays.push(overlayRef);\n }\n\n /** Remove an overlay from the list of attached overlay refs. */\n remove(overlayRef: OverlayRef): void {\n const index = this._attachedOverlays.indexOf(overlayRef);\n\n if (index > -1) {\n this._attachedOverlays.splice(index, 1);\n }\n\n // Remove the global listener once there are no more overlays.\n if (this._attachedOverlays.length === 0) {\n this._detach();\n }\n }\n\n /** Detaches the global keyboard event listener. */\n private _detach() {\n if (this._isAttached) {\n this._document.body.removeEventListener('keydown', this._keydownListener);\n this._isAttached = false;\n }\n }\n\n /** Keyboard event listener that will be attached to the body. */\n private _keydownListener = (event: KeyboardEvent) => {\n const overlays = this._attachedOverlays;\n\n for (let i = overlays.length - 1; i > -1; i--) {\n // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.\n // We want to target the most recent overlay, rather than trying to match where the event came\n // from, because some components might open an overlay, but keep focus on a trigger element\n // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,\n // because we don't want overlays that don't handle keyboard events to block the ones below\n // them that do.\n if (overlays[i]._keydownEventSubscriptions > 0) {\n overlays[i]._keydownEvents.next(event);\n break;\n }\n }\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(\n dispatcher: OverlayKeyboardDispatcher, _document: any) {\n return dispatcher || new OverlayKeyboardDispatcher(_document);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {\n // If there is already an OverlayKeyboardDispatcher available, use that.\n // Otherwise, provide a new one.\n provide: OverlayKeyboardDispatcher,\n deps: [\n [new Optional(), new SkipSelf(), OverlayKeyboardDispatcher],\n\n // Coerce to `InjectionToken` so that the `deps` match the \"shape\"\n // of the type expected by Angular\n DOCUMENT as InjectionToken<any>\n ],\n useFactory: OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY\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 {DOCUMENT} from '@angular/common';\nimport {\n Inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n SkipSelf,\n} from '@angular/core';\n\n\n/** Container inside which all overlays will render. */\n@Injectable({providedIn: 'root'})\nexport class OverlayContainer implements OnDestroy {\n protected _containerElement: HTMLElement;\n\n constructor(@Inject(DOCUMENT) protected _document: any) {}\n\n ngOnDestroy() {\n if (this._containerElement && this._containerElement.parentNode) {\n this._containerElement.parentNode.removeChild(this._containerElement);\n }\n }\n\n /**\n * This method returns the overlay container element. It will lazily\n * create the element the first time it is called to facilitate using\n * the container in non-browser environments.\n * @returns the container element\n */\n getContainerElement(): HTMLElement {\n if (!this._containerElement) { this._createContainer(); }\n return this._containerElement;\n }\n\n /**\n * Create the overlay container element, which is simply a div\n * with the 'cdk-overlay-container' class on the document body.\n */\n protected _createContainer(): void {\n const container = this._document.createElement('div');\n\n container.classList.add('cdk-overlay-container');\n this._document.body.appendChild(container);\n this._containerElement = container;\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer: OverlayContainer,\n _document: any) {\n return parentContainer || new OverlayContainer(_document);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const OVERLAY_CONTAINER_PROVIDER = {\n // If there is already an OverlayContainer available, use that. Otherwise, provide a new one.\n provide: OverlayContainer,\n deps: [\n [new Optional(), new SkipSelf(), OverlayContainer],\n DOCUMENT as InjectionToken<any> // We need to use the InjectionToken somewhere to keep TS happy\n ],\n useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY\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 {PositionStrategy} from './position-strategy';\nimport {ElementRef} from '@angular/core';\nimport {ViewportRuler, CdkScrollable, ViewportScrollPosition} from '@angular/cdk/scrolling';\nimport {\n ConnectedOverlayPositionChange,\n ConnectionPositionPair,\n ScrollingVisibility,\n validateHorizontalPosition,\n validateVerticalPosition,\n} from './connected-position';\nimport {Observable, Subscription, Subject} from 'rxjs';\nimport {OverlayReference} from '../overlay-reference';\nimport {isElementScrolledOutsideView, isElementClippedByScrolling} from './scroll-clip';\nimport {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {OverlayContainer} from '../overlay-container';\n\n// TODO: refactor clipping detection into a separate thing (part of scrolling module)\n// TODO: doesn't handle both flexible width and height when it has to scroll along both axis.\n\n/** Class to be added to the overlay bounding box. */\nconst boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';\n\n/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */\nexport type FlexibleConnectedPositionStrategyOrigin = ElementRef | HTMLElement | Point;\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * implicit position relative some origin element. The relative position is defined in terms of\n * a point on the origin element that is connected to a point on the overlay element. For example,\n * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner\n * of the overlay.\n */\nexport class FlexibleConnectedPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef: OverlayReference;\n\n /** Whether we're performing the very first positioning of the overlay. */\n private _isInitialRender: boolean;\n\n /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */\n private _lastBoundingBoxSize = {width: 0, height: 0};\n\n /** Whether the overlay was pushed in a previous positioning. */\n private _isPushed = false;\n\n /** Whether the overlay can be pushed on-screen on the initial open. */\n private _canPush = true;\n\n /** Whether the overlay can grow via flexible width/height after the initial open. */\n private _growAfterOpen = false;\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n private _hasFlexibleDimensions = true;\n\n /** Whether the overlay position is locked. */\n private _positionLocked = false;\n\n /** Cached origin dimensions */\n private _originRect: ClientRect;\n\n /** Cached overlay dimensions */\n private _overlayRect: ClientRect;\n\n /** Cached viewport dimensions */\n private _viewportRect: ClientRect;\n\n /** Amount of space that must be maintained between the overlay and the edge of the viewport. */\n private _viewportMargin = 0;\n\n /** The Scrollable containers used to check scrollable view properties on position change. */\n private _scrollables: CdkScrollable[] = [];\n\n /** Ordered list of preferred positions, from most to least desirable. */\n _preferredPositions: ConnectionPositionPair[] = [];\n\n /** The origin element against which the overlay will be positioned. */\n private _origin: FlexibleConnectedPositionStrategyOrigin;\n\n /** The overlay pane element. */\n private _pane: HTMLElement;\n\n /** Whether the strategy has been disposed of already. */\n private _isDisposed: boolean;\n\n /**\n * Parent element for the overlay panel used to constrain the overlay panel's size to fit\n * within the viewport.\n */\n private _boundingBox: HTMLElement | null;\n\n /** The last position to have been calculated as the best fit position. */\n private _lastPosition: ConnectedPosition | null;\n\n /** Subject that emits whenever the position changes. */\n private _positionChanges = new Subject<ConnectedOverlayPositionChange>();\n\n /** Subscription to viewport size changes. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /** Default offset for the overlay along the x axis. */\n private _offsetX = 0;\n\n /** Default offset for the overlay along the y axis. */\n private _offsetY = 0;\n\n /** Selector to be used when finding the elements on which to set the transform origin. */\n private _transformOriginSelector: string;\n\n /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */\n private _appliedPanelClasses: string[] = [];\n\n /** Amount by which the overlay was pushed in each axis during the last time it was positioned. */\n private _previousPushAmount: {x: number, y: number} | null;\n\n /** Observable sequence of position changes. */\n positionChanges: Observable<ConnectedOverlayPositionChange> =\n this._positionChanges.asObservable();\n\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions(): ConnectionPositionPair[] {\n return this._preferredPositions;\n }\n\n constructor(\n connectedTo: FlexibleConnectedPositionStrategyOrigin, private _viewportRuler: ViewportRuler,\n private _document: Document, private _platform: Platform,\n private _overlayContainer: OverlayContainer) {\n this.setOrigin(connectedTo);\n }\n\n /** Attaches this position strategy to an overlay. */\n attach(overlayRef: OverlayReference): void {\n if (this._overlayRef && overlayRef !== this._overlayRef) {\n throw Error('This position strategy is already attached to an overlay');\n }\n\n this._validatePositions();\n\n overlayRef.hostElement.classList.add(boundingBoxClass);\n\n this._overlayRef = overlayRef;\n this._boundingBox = overlayRef.hostElement;\n this._pane = overlayRef.overlayElement;\n this._isDisposed = false;\n this._isInitialRender = true;\n this._lastPosition = null;\n this._resizeSubscription.unsubscribe();\n this._resizeSubscription = this._viewportRuler.change().subscribe(() => {\n // When the window is resized, we want to trigger the next reposition as if it\n // was an initial render, in order for the strategy to pick a new optimal position,\n // otherwise position locking will cause it to stay at the old one.\n this._isInitialRender = true;\n this.apply();\n });\n }\n\n /**\n * Updates the position of the overlay element, using whichever preferred position relative\n * to the origin best fits on-screen.\n *\n * The selection of a position goes as follows:\n * - If any positions fit completely within the viewport as-is,\n * choose the first position that does so.\n * - If flexible dimensions are enabled and at least one satifies the given minimum width/height,\n * choose the position with the greatest available size modified by the positions' weight.\n * - If pushing is enabled, take the position that went off-screen the least and push it\n * on-screen.\n * - If none of the previous criteria were met, use the position that goes off-screen the least.\n * @docs-private\n */\n apply(): void {\n // We shouldn't do anything if the strategy was disposed or we're on the server.\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n\n // If the position has been applied already (e.g. when the overlay was opened) and the\n // consumer opted into locking in the position, re-use the old position, in order to\n // prevent the overlay from jumping around.\n if (!this._isInitialRender && this._positionLocked && this._lastPosition) {\n this.reapplyLastPosition();\n return;\n }\n\n this._clearPanelClasses();\n this._resetOverlayElementStyles();\n this._resetBoundingBoxStyles();\n\n // We need the bounding rects for the origin and the overlay to determine how to position\n // the overlay relative to the origin.\n // We use the viewport rect to determine whether a position would go off-screen.\n this._viewportRect = this._getNarrowedViewportRect();\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n\n const originRect = this._originRect;\n const overlayRect = this._overlayRect;\n const viewportRect = this._viewportRect;\n\n // Positions where the overlay will fit with flexible dimensions.\n const flexibleFits: FlexibleFit[] = [];\n\n // Fallback if none of the preferred positions fit within the viewport.\n let fallback: FallbackPosition | undefined;\n\n // Go through each of the preferred positions looking for a good fit.\n // If a good fit is found, it will be applied immediately.\n for (let pos of this._preferredPositions) {\n // Get the exact (x, y) coordinate for the point-of-origin on the origin element.\n let originPoint = this._getOriginPoint(originRect, pos);\n\n // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the\n // overlay in this position. We use the top-left corner for calculations and later translate\n // this into an appropriate (top, left, bottom, right) style.\n let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);\n\n // Calculate how well the overlay would fit into the viewport with this point.\n let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);\n\n // If the overlay, without any further work, fits into the viewport, use this position.\n if (overlayFit.isCompletelyWithinViewport) {\n this._isPushed = false;\n this._applyPosition(pos, originPoint);\n return;\n }\n\n // If the overlay has flexible dimensions, we can use this position\n // so long as there's enough space for the minimum dimensions.\n if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {\n // Save positions where the overlay will fit with flexible dimensions. We will use these\n // if none of the positions fit *without* flexible dimensions.\n flexibleFits.push({\n position: pos,\n origin: originPoint,\n overlayRect,\n boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos)\n });\n\n continue;\n }\n\n // If the current preferred position does not fit on the screen, remember the position\n // if it has more visible area on-screen than we've seen and move onto the next preferred\n // position.\n if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {\n fallback = {overlayFit, overlayPoint, originPoint, position: pos, overlayRect};\n }\n }\n\n // If there are any positions where the overlay would fit with flexible dimensions, choose the\n // one that has the greatest area available modified by the position's weight\n if (flexibleFits.length) {\n let bestFit: FlexibleFit | null = null;\n let bestScore = -1;\n for (const fit of flexibleFits) {\n const score =\n fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);\n if (score > bestScore) {\n bestScore = score;\n bestFit = fit;\n }\n }\n\n this._isPushed = false;\n this._applyPosition(bestFit!.position, bestFit!.origin);\n return;\n }\n\n // When none of the preferred positions fit within the viewport, take the position\n // that went off-screen the least and attempt to push it on-screen.\n if (this._canPush) {\n // TODO(jelbourn): after pushing, the opening \"direction\" of the overlay might not make sense.\n this._isPushed = true;\n this._applyPosition(fallback!.position, fallback!.originPoint);\n return;\n }\n\n // All options for getting the overlay within the viewport have been exhausted, so go with the\n // position that went off-screen the least.\n this._applyPosition(fallback!.position, fallback!.originPoint);\n }\n\n detach(): void {\n this._clearPanelClasses();\n this._lastPosition = null;\n this._previousPushAmount = null;\n this._resizeSubscription.unsubscribe();\n }\n\n /** Cleanup after the element gets destroyed. */\n dispose(): void {\n if (this._isDisposed) {\n return;\n }\n\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null!;\n this._isDisposed = true;\n }\n\n /**\n * This re-aligns the overlay element with the trigger in its last calculated position,\n * even if a position higher in the \"preferred positions\" list would now fit. This\n * allows one to re-align the panel without changing the orientation of the panel.\n */\n reapplyLastPosition(): void {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n\n this._applyPosition(lastPosition, originPoint);\n }\n }\n\n /**\n * Sets the list of Scrollable containers that host the origin element so that\n * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every\n * Scrollable must be an ancestor element of the strategy's origin element.\n */\n withScrollableContainers(scrollables: CdkScrollable[]): this {\n this._scrollables = scrollables;\n return this;\n }\n\n /**\n * Adds new preferred positions.\n * @param positions List of positions options for this overlay.\n */\n withPositions(positions: ConnectedPosition[]): this {\n this._preferredPositions = positions;\n\n // If the last calculated position object isn't part of the positions anymore, clear\n // it in order to avoid it being picked up if the consumer tries to re-apply.\n if (positions.indexOf(this._lastPosition!) === -1) {\n this._lastPosition = null;\n }\n\n this._validatePositions();\n\n return this;\n }\n\n /**\n * Sets a minimum distance the overlay may be positioned to the edge of the viewport.\n * @param margin Required margin between the overlay and the viewport edge in pixels.\n */\n withViewportMargin(margin: number): this {\n this._viewportMargin = margin;\n return this;\n }\n\n /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */\n withFlexibleDimensions(flexibleDimensions = true): this {\n this._hasFlexibleDimensions = flexibleDimensions;\n return this;\n }\n\n /** Sets whether the overlay can grow after the initial open via flexible width/height. */\n withGrowAfterOpen(growAfterOpen = true): this {\n this._growAfterOpen = growAfterOpen;\n return this;\n }\n\n /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */\n withPush(canPush = true): this {\n this._canPush = canPush;\n return this;\n }\n\n /**\n * Sets whether the overlay's position should be locked in after it is positioned\n * initially. When an overlay is locked in, it won't attempt to reposition itself\n * when the position is re-applied (e.g. when the user scrolls away).\n * @param isLocked Whether the overlay should locked in.\n */\n withLockedPosition(isLocked = true): this {\n this._positionLocked = isLocked;\n return this;\n }\n\n /**\n * Sets the origin, relative to which to position the overlay.\n * Using an element origin is useful for building components that need to be positioned\n * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be\n * used for cases like contextual menus which open relative to the user's pointer.\n * @param origin Reference to the new origin.\n */\n setOrigin(origin: FlexibleConnectedPositionStrategyOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the x-axis.\n * @param offset New offset in the X axis.\n */\n withDefaultOffsetX(offset: number): this {\n this._offsetX = offset;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the y-axis.\n * @param offset New offset in the Y axis.\n */\n withDefaultOffsetY(offset: number): this {\n this._offsetY = offset;\n return this;\n }\n\n /**\n * Configures that the position strategy should set a `transform-origin` on some elements\n * inside the overlay, depending on the current position that is being applied. This is\n * useful for the cases where the origin of an animation can change depending on the\n * alignment of the overlay.\n * @param selector CSS selector that will be used to find the target\n * elements onto which to set the transform origin.\n */\n withTransformOriginOn(selector: string): this {\n this._transformOriginSelector = selector;\n return this;\n }\n\n /**\n * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.\n */\n private _getOriginPoint(originRect: ClientRect, pos: ConnectedPosition): Point {\n let x: number;\n if (pos.originX == 'center') {\n // Note: when centering we should always use the `left`\n // offset, otherwise the position will be wrong in RTL.\n x = originRect.left + (originRect.width / 2);\n } else {\n const startX = this._isRtl() ? originRect.right : originRect.left;\n const endX = this._isRtl() ? originRect.left : originRect.right;\n x = pos.originX == 'start' ? startX : endX;\n }\n\n let y: number;\n if (pos.originY == 'center') {\n y = originRect.top + (originRect.height / 2);\n } else {\n y = pos.originY == 'top' ? originRect.top : originRect.bottom;\n }\n\n return {x, y};\n }\n\n\n /**\n * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and\n * origin point to which the overlay should be connected.\n */\n private _getOverlayPoint(\n originPoint: Point,\n overlayRect: ClientRect,\n pos: ConnectedPosition): Point {\n\n // Calculate the (overlayStartX, overlayStartY), the start of the\n // potential overlay position relative to the origin point.\n let overlayStartX: number;\n if (pos.overlayX == 'center') {\n overlayStartX = -overlayRect.width / 2;\n } else if (pos.overlayX === 'start') {\n overlayStartX = this._isRtl() ? -overlayRect.width : 0;\n } else {\n overlayStartX = this._isRtl() ? 0 : -overlayRect.width;\n }\n\n let overlayStartY: number;\n if (pos.overlayY == 'center') {\n overlayStartY = -overlayRect.height / 2;\n } else {\n overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;\n }\n\n // The (x, y) coordinates of the overlay.\n return {\n x: originPoint.x + overlayStartX,\n y: originPoint.y + overlayStartY,\n };\n }\n\n /** Gets how well an overlay at the given point will fit within the viewport. */\n private _getOverlayFit(point: Point, overlay: ClientRect, viewport: ClientRect,\n position: ConnectedPosition): OverlayFit {\n\n let {x, y} = point;\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n // Account for the offsets since they could push the overlay out of the viewport.\n if (offsetX) {\n x += offsetX;\n }\n\n if (offsetY) {\n y += offsetY;\n }\n\n // How much the overlay would overflow at this position, on each side.\n let leftOverflow = 0 - x;\n let rightOverflow = (x + overlay.width) - viewport.width;\n let topOverflow = 0 - y;\n let bottomOverflow = (y + overlay.height) - viewport.height;\n\n // Visible parts of the element on each axis.\n let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);\n let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);\n let visibleArea = visibleWidth * visibleHeight;\n\n return {\n visibleArea,\n isCompletelyWithinViewport: (overlay.width * overlay.height) === visibleArea,\n fitsInViewportVertically: visibleHeight === overlay.height,\n fitsInViewportHorizontally: visibleWidth == overlay.width,\n };\n }\n\n /**\n * Whether the overlay can fit within the viewport when it may resize either its width or height.\n * @param fit How well the overlay fits in the viewport at some position.\n * @param point The (x, y) coordinates of the overlat at some position.\n * @param viewport The geometry of the viewport.\n */\n private _canFitWithFlexibleDimensions(fit: OverlayFit, point: Point, viewport: ClientRect) {\n if (this._hasFlexibleDimensions) {\n const availableHeight = viewport.bottom - point.y;\n const availableWidth = viewport.right - point.x;\n const minHeight = this._overlayRef.getConfig().minHeight;\n const minWidth = this._overlayRef.getConfig().minWidth;\n\n const verticalFit = fit.fitsInViewportVertically ||\n (minHeight != null && minHeight <= availableHeight);\n const horizontalFit = fit.fitsInViewportHorizontally ||\n (minWidth != null && minWidth <= availableWidth);\n\n return verticalFit && horizontalFit;\n }\n }\n\n /**\n * Gets the point at which the overlay can be \"pushed\" on-screen. If the overlay is larger than\n * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the\n * right and bottom).\n *\n * @param start Starting point from which the overlay is pushed.\n * @param overlay Dimensions of the overlay.\n * @param scrollPosition Current viewport scroll position.\n * @returns The point at which to position the overlay after pushing. This is effectively a new\n * originPoint.\n */\n private _pushOverlayOnScreen(start: Point,\n overlay: ClientRect,\n scrollPosition: ViewportScrollPosition): Point {\n // If the position is locked and we've pushed the overlay already, reuse the previous push\n // amount, rather than pushing it again. If we were to continue pushing, the element would\n // remain in the viewport, which goes against the expectations when position locking is enabled.\n if (this._previousPushAmount && this._positionLocked) {\n return {\n x: start.x + this._previousPushAmount.x,\n y: start.y + this._previousPushAmount.y\n };\n }\n\n const viewport = this._viewportRect;\n\n // Determine how much the overlay goes outside the viewport on each\n // side, which we'll use to decide which direction to push it.\n const overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);\n const overflowBottom = Math.max(start.y + overlay.height - viewport.bottom, 0);\n const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);\n const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);\n\n // Amount by which to push the overlay in each axis such that it remains on-screen.\n let pushX = 0;\n let pushY = 0;\n\n // If the overlay fits completely within the bounds of the viewport, push it from whichever\n // direction is goes off-screen. Otherwise, push the top-left corner such that its in the\n // viewport and allow for the trailing end of the overlay to go out of bounds.\n if (overlay.width <= viewport.width) {\n pushX = overflowLeft || -overflowRight;\n } else {\n pushX = start.x < this._viewportMargin ? (viewport.left - scrollPosition.left) - start.x : 0;\n }\n\n if (overlay.height <= viewport.height) {\n pushY = overflowTop || -overflowBottom;\n } else {\n pushY = start.y < this._viewportMargin ? (viewport.top - scrollPosition.top) - start.y : 0;\n }\n\n this._previousPushAmount = {x: pushX, y: pushY};\n\n return {\n x: start.x + pushX,\n y: start.y + pushY,\n };\n }\n\n /**\n * Applies a computed position to the overlay and emits a position change.\n * @param position The position preference\n * @param originPoint The point on the origin element where the overlay is connected.\n */\n private _applyPosition(position: ConnectedPosition, originPoint: Point) {\n this._setTransformOrigin(position);\n this._setOverlayElementStyles(originPoint, position);\n this._setBoundingBoxStyles(originPoint, position);\n\n if (position.panelClass) {\n this._addPanelClasses(position.panelClass);\n }\n\n // Save the last connected position in case the position needs to be re-calculated.\n this._lastPosition = position;\n\n // Notify that the position has been changed along with its change properties.\n // We only emit if we've got any subscriptions, because the scroll visibility\n // calculcations can be somewhat expensive.\n if (this._positionChanges.observers.length) {\n const scrollableViewProperties = this._getScrollVisibility();\n const changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);\n this._positionChanges.next(changeEvent);\n }\n\n this._isInitialRender = false;\n }\n\n /** Sets the transform origin based on the configured selector and the passed-in position. */\n private _setTransformOrigin(position: ConnectedPosition) {\n if (!this._transformOriginSelector) {\n return;\n }\n\n const elements: NodeListOf<HTMLElement> =\n this._boundingBox!.querySelectorAll(this._transformOriginSelector);\n let xOrigin: 'left' | 'right' | 'center';\n let yOrigin: 'top' | 'bottom' | 'center' = position.overlayY;\n\n if (position.overlayX === 'center') {\n xOrigin = 'center';\n } else if (this._isRtl()) {\n xOrigin = position.overlayX === 'start' ? 'right' : 'left';\n } else {\n xOrigin = position.overlayX === 'start' ? 'left' : 'right';\n }\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\n }\n }\n\n /**\n * Gets the position and size of the overlay's sizing container.\n *\n * This method does no measuring and applies no styles so that we can cheaply compute the\n * bounds for all positions and choose the best fit based on these results.\n */\n private _calculateBoundingBoxRect(origin: Point, position: ConnectedPosition): BoundingBoxRect {\n const viewport = this._viewportRect;\n const isRtl = this._isRtl();\n let height: number, top: number, bottom: number;\n\n if (position.overlayY === 'top') {\n // Overlay is opening \"downward\" and thus is bound by the bottom viewport edge.\n top = origin.y;\n height = viewport.height - top + this._viewportMargin;\n } else if (position.overlayY === 'bottom') {\n // Overlay is opening \"upward\" and thus is bound by the top viewport edge. We need to add\n // the viewport margin back in, because the viewport rect is narrowed down to remove the\n // margin, whereas the `origin` position is calculated based on its `ClientRect`.\n bottom = viewport.height - origin.y + this._viewportMargin * 2;\n height = viewport.height - bottom + this._viewportMargin;\n } else {\n // If neither top nor bottom, it means that the overlay is vertically centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.bottom - origin.y` and\n // `origin.y - viewport.top`.\n const smallestDistanceToViewportEdge =\n Math.min(viewport.bottom - origin.y + viewport.top, origin.y);\n\n const previousHeight = this._lastBoundingBoxSize.height;\n\n height = smallestDistanceToViewportEdge * 2;\n top = origin.y - smallestDistanceToViewportEdge;\n\n if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {\n top = origin.y - (previousHeight / 2);\n }\n }\n\n // The overlay is opening 'right-ward' (the content flows to the right).\n const isBoundedByRightViewportEdge =\n (position.overlayX === 'start' && !isRtl) ||\n (position.overlayX === 'end' && isRtl);\n\n // The overlay is opening 'left-ward' (the content flows to the left).\n const isBoundedByLeftViewportEdge =\n (position.overlayX === 'end' && !isRtl) ||\n (position.overlayX === 'start' && isRtl);\n\n let width: number, left: number, right: number;\n\n if (isBoundedByLeftViewportEdge) {\n right = viewport.width - origin.x + this._viewportMargin;\n width = origin.x - this._viewportMargin;\n } else if (isBoundedByRightViewportEdge) {\n left = origin.x;\n width = viewport.right - origin.x;\n } else {\n // If neither start nor end, it means that the overlay is horizontally centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.right - origin.x` and\n // `origin.x - viewport.left`.\n const smallestDistanceToViewportEdge =\n Math.min(viewport.right - origin.x + viewport.left, origin.x);\n const previousWidth = this._lastBoundingBoxSize.width;\n\n width = smallestDistanceToViewportEdge * 2;\n left = origin.x - smallestDistanceToViewportEdge;\n\n if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {\n left = origin.x - (previousWidth / 2);\n }\n }\n\n return {top: top!, left: left!, bottom: bottom!, right: right!, width, height};\n }\n\n /**\n * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the\n * origin's connection point and stetches to the bounds of the viewport.\n *\n * @param origin The point on the origin element where the overlay is connected.\n * @param position The position preference\n */\n private _setBoundingBoxStyles(origin: Point, position: ConnectedPosition): void {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\n\n // It's weird if the overlay *grows* while scrolling, so we take the last size into account\n // when applying a new size.\n if (!this._isInitialRender && !this._growAfterOpen) {\n boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);\n boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);\n }\n\n const styles = {} as CSSStyleDeclaration;\n\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = '';\n styles.width = styles.height = '100%';\n } else {\n const maxHeight = this._overlayRef.getConfig().maxHeight;\n const maxWidth = this._overlayRef.getConfig().maxWidth;\n\n styles.height = coerceCssPixelValue(boundingBoxRect.height);\n styles.top = coerceCssPixelValue(boundingBoxRect.top);\n styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);\n styles.width = coerceCssPixelValue(boundingBoxRect.width);\n styles.left = coerceCssPixelValue(boundingBoxRect.left);\n styles.right = coerceCssPixelValue(boundingBoxRect.right);\n\n // Push the pane content towards the proper direction.\n if (position.overlayX === 'center') {\n styles.alignItems = 'center';\n } else {\n styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';\n }\n\n if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n } else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n\n if (maxHeight) {\n styles.maxHeight = coerceCssPixelValue(maxHeight);\n }\n\n if (maxWidth) {\n styles.maxWidth = coerceCssPixelValue(maxWidth);\n }\n }\n\n this._lastBoundingBoxSize = boundingBoxRect;\n\n extendStyles(this._boundingBox!.style, styles);\n }\n\n /** Resets the styles for the bounding box so that a new positioning can be computed. */\n private _resetBoundingBoxStyles() {\n extendStyles(this._boundingBox!.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n /** Resets the styles for the overlay pane so that a new positioning can be computed. */\n private _resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: '',\n } as CSSStyleDeclaration);\n }\n\n /** Sets positioning styles to the overlay element. */\n private _setOverlayElementStyles(originPoint: Point, position: ConnectedPosition): void {\n const styles = {} as CSSStyleDeclaration;\n\n if (this._hasExactPosition()) {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));\n extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));\n } else {\n styles.position = 'static';\n }\n\n // Use a transform to apply the offsets. We do this because the `center` positions rely on\n // being in the normal flex flow and setting a `top` / `left` at all will completely throw\n // off the position. We also can't use margins, because they won't have an effect in some\n // cases where the element doesn't have anything to \"push off of\". Finally, this works\n // better both with flexible and non-flexible positioning.\n let transformString = '';\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n if (offsetX) {\n transformString += `translateX(${offsetX}px) `;\n }\n\n if (offsetY) {\n transformString += `translateY(${offsetY}px)`;\n }\n\n styles.transform = transformString.trim();\n\n // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because\n // we need these values to both be set to \"100%\" for the automatic flexible sizing to work.\n // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.\n if (this._hasFlexibleDimensions && this._overlayRef.getConfig().maxHeight) {\n styles.maxHeight = '';\n }\n\n if (this._hasFlexibleDimensions && this._overlayRef.getConfig().maxWidth) {\n styles.maxWidth = '';\n }\n\n extendStyles(this._pane.style, styles);\n }\n\n /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayY(position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition) {\n // Reset any existing styles. This is necessary in case the\n // preferred position has changed since the last `apply`.\n let styles = {top: null, bottom: null} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n let virtualKeyboardOffset =\n this._overlayContainer.getContainerElement().getBoundingClientRect().top;\n\n // Normally this would be zero, however when the overlay is attached to an input (e.g. in an\n // autocomplete), mobile browsers will shift everything in order to put the input in the middle\n // of the screen and to make space for the virtual keyboard. We need to account for this offset,\n // otherwise our positioning will be thrown off.\n overlayPoint.y -= virtualKeyboardOffset;\n\n // We want to set either `top` or `bottom` based on whether the overlay wants to appear\n // above or below the origin and the direction in which the element will expand.\n if (position.overlayY === 'bottom') {\n // When using `bottom`, we adjust the y position such that it is the distance\n // from the bottom of the viewport rather than the top.\n const documentHeight = this._document.documentElement!.clientHeight;\n styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;\n } else {\n styles.top = coerceCssPixelValue(overlayPoint.y);\n }\n\n return styles;\n }\n\n /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayX(position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition) {\n // Reset any existing styles. This is necessary in case the preferred position has\n // changed since the last `apply`.\n let styles = {left: null, right: null} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n // We want to set either `left` or `right` based on whether the overlay wants to appear \"before\"\n // or \"after\" the origin, which determines the direction in which the element will expand.\n // For the horizontal axis, the meaning of \"before\" and \"after\" change based on whether the\n // page is in RTL or LTR.\n let horizontalStyleProperty: 'left' | 'right';\n\n if (this._isRtl()) {\n horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';\n } else {\n horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';\n }\n\n // When we're setting `right`, we adjust the x position such that it is the distance\n // from the right edge of the viewport rather than the left edge.\n if (horizontalStyleProperty === 'right') {\n const documentWidth = this._document.documentElement!.clientWidth;\n styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;\n } else {\n styles.left = coerceCssPixelValue(overlayPoint.x);\n }\n\n return styles;\n }\n\n /**\n * Gets the view properties of the trigger and overlay, including whether they are clipped\n * or completely outside the view of any of the strategy's scrollables.\n */\n private _getScrollVisibility(): ScrollingVisibility {\n // Note: needs fresh rects since the position could've changed.\n const originBounds = this._getOriginRect();\n const overlayBounds = this._pane.getBoundingClientRect();\n\n // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers\n // every time, we should be able to use the scrollTop of the containers if the size of those\n // containers hasn't changed.\n const scrollContainerBounds = this._scrollables.map(scrollable => {\n return scrollable.getElementRef().nativeElement.getBoundingClientRect();\n });\n\n return {\n isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),\n isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),\n isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),\n isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),\n };\n }\n\n /** Subtracts the amount that an element is overflowing on an axis from it's length. */\n private _subtractOverflows(length: number, ...overflows: number[]): number {\n return overflows.reduce((currentValue: number, currentOverflow: number) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }\n\n /** Narrows the given viewport rect by the current _viewportMargin. */\n private _getNarrowedViewportRect(): ClientRect {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement!.clientWidth;\n const height = this._document.documentElement!.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - (2 * this._viewportMargin),\n height: height - (2 * this._viewportMargin),\n };\n }\n\n /** Whether the we're dealing with an RTL context */\n private _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n\n /** Determines whether the overlay uses exact or flexible positioning. */\n private _hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }\n\n /** Retrieves the offset of a position along the x or y axis. */\n private _getOffset(position: ConnectedPosition, axis: 'x' | 'y') {\n if (axis === 'x') {\n // We don't do something like `position['offset' + axis]` in\n // order to avoid breking minifiers that rename properties.\n return position.offsetX == null ? this._offsetX : position.offsetX;\n }\n\n return position.offsetY == null ? this._offsetY : position.offsetY;\n }\n\n /** Validates that the current position match the expected values. */\n private _validatePositions(): void {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\n }\n\n // TODO(crisbeto): remove these once Angular's template type\n // checking is advanced enough to catch these cases.\n this._preferredPositions.forEach(pair => {\n validateHorizontalPosition('originX', pair.originX);\n validateVerticalPosition('originY', pair.originY);\n validateHorizontalPosition('overlayX', pair.overlayX);\n validateVerticalPosition('overlayY', pair.overlayY);\n });\n }\n\n /** Adds a single CSS class or an array of classes on the overlay panel. */\n private _addPanelClasses(cssClasses: string | string[]) {\n if (this._pane) {\n coerceArray(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelClasses.push(cssClass);\n this._pane.classList.add(cssClass);\n }\n });\n }\n }\n\n /** Clears the classes that the position strategy has applied from the overlay panel. */\n private _clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }\n\n /** Returns the ClientRect of the current origin. */\n private _getOriginRect(): ClientRect {\n const origin = this._origin;\n\n if (origin instanceof ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n\n if (origin instanceof HTMLElement) {\n return origin.getBoundingClientRect();\n }\n\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y,\n left: origin.x,\n right: origin.x,\n height: 0,\n width: 0\n };\n }\n}\n\n/** A simple (x, y) coordinate. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/** Record of measurements for how an overlay (at a given position) fits into the viewport. */\ninterface OverlayFit {\n /** Whether the overlay fits completely in the viewport. */\n isCompletelyWithinViewport: boolean;\n\n /** Whether the overlay fits in the viewport on the y-axis. */\n fitsInViewportVertically: boolean;\n\n /** Whether the overlay fits in the viewport on the x-axis. */\n fitsInViewportHorizontally: boolean;\n\n /** The total visible area (in px^2) of the overlay inside the viewport. */\n visibleArea: number;\n}\n\n/** Record of the measurments determining whether an overlay will fit in a specific position. */\ninterface FallbackPosition {\n position: ConnectedPosition;\n originPoint: Point;\n overlayPoint: Point;\n overlayFit: OverlayFit;\n overlayRect: ClientRect;\n}\n\n/** Position and size of the overlay sizing wrapper for a specific position. */\ninterface BoundingBoxRect {\n top: number;\n left: number;\n bottom: number;\n right: number;\n height: number;\n width: number;\n}\n\n/** Record of measures determining how well a given position will fit with flexible dimensions. */\ninterface FlexibleFit {\n position: ConnectedPosition;\n origin: Point;\n overlayRect: ClientRect;\n boundingBoxRect: BoundingBoxRect;\n}\n\n/** A connected position as specified by the user. */\nexport interface ConnectedPosition {\n originX: 'start' | 'center' | 'end';\n originY: 'top' | 'center' | 'bottom';\n\n overlayX: 'start' | 'center' | 'end';\n overlayY: 'top' | 'center' | 'bottom';\n\n weight?: number;\n offsetX?: number;\n offsetY?: number;\n panelClass?: string | string[];\n}\n\n/** Shallow-extends a stylesheet object with another stylesheet object. */\nfunction extendStyles(dest: CSSStyleDeclaration, source: CSSStyleDeclaration): CSSStyleDeclaration {\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 * @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 {ScrollStrategy} from './scroll-strategy';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {coerceCssPixelValue} from '@angular/cdk/coercion';\n\n/**\n * Extended `CSSStyleDeclaration` that includes `scrollBehavior` which isn't part of the\n * built-in TS typings. Once it is, this declaration can be removed safely.\n * @docs-private\n */\ntype ScrollBehaviorCSSStyleDeclaration = CSSStyleDeclaration & {scrollBehavior: string};\n\n/**\n * Strategy that will prevent the user from scrolling while the overlay is visible.\n */\nexport class BlockScrollStrategy implements ScrollStrategy {\n private _previousHTMLStyles = {top: '', left: ''};\n private _previousScrollPosition: { top: number, left: number };\n private _isEnabled = false;\n private _document: Document;\n\n constructor(private _viewportRuler: ViewportRuler, document: any) {\n this._document = document;\n }\n\n /** Attaches this scroll strategy to an overlay. */\n attach() { }\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this._canBeEnabled()) {\n const root = this._document.documentElement!;\n\n this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this._previousHTMLStyles.left = root.style.left || '';\n this._previousHTMLStyles.top = root.style.top || '';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);\n root.classList.add('cdk-global-scrollblock');\n this._isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement!;\n const body = this._document.body!;\n const htmlStyle = html.style as ScrollBehaviorCSSStyleDeclaration;\n const bodyStyle = body.style as ScrollBehaviorCSSStyleDeclaration;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this._isEnabled = false;\n\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n\n window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n\n private _canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this._document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {\n return false;\n }\n\n const body = this._document.body;\n const viewport = this._viewportRuler.getViewportSize();\n return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;\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 */\nimport {NgZone} from '@angular/core';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {OverlayReference} from '../overlay-reference';\nimport {Subscription} from 'rxjs';\nimport {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\n\n/**\n * Config options for the CloseScrollStrategy.\n */\nexport interface CloseScrollStrategyConfig {\n /** Amount of pixels the user has to scroll before the overlay is closed. */\n threshold?: number;\n}\n\n/**\n * Strategy that will close the overlay as soon as the user starts scrolling.\n */\nexport class CloseScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription|null = null;\n private _overlayRef: OverlayReference;\n private _initialScrollPosition: number;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _config?: CloseScrollStrategyConfig) {}\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayReference) {\n if (this._overlayRef) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables the closing of the attached overlay on scroll. */\n enable() {\n if (this._scrollSubscription) {\n return;\n }\n\n const stream = this._scrollDispatcher.scrolled(0);\n\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config!.threshold!) {\n this._detach();\n } else {\n this._overlayRef.updatePosition();\n }\n });\n } else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }\n\n /** Disables the closing the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = null!;\n }\n\n /** Detaches the overlay ref and disables the scroll strategy. */\n private _detach = () => {\n this.disable();\n\n if (this._overlayRef.hasAttached()) {\n this._ngZone.run(() => this._overlayRef.detach());\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ScrollStrategy} from './scroll-strategy';\n\n/** Scroll strategy that doesn't do anything. */\nexport class NoopScrollStrategy implements ScrollStrategy {\n /** Does nothing, as this scroll strategy is a no-op. */\n enable() { }\n /** Does nothing, as this scroll strategy is a no-op. */\n disable() { }\n /** Does nothing, as this scroll strategy is a no-op. */\n attach() { }\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 {NgZone} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {OverlayReference} from '../overlay-reference';\nimport {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\nimport {isElementScrolledOutsideView} from '../position/scroll-clip';\n\n/**\n * Config options for the RepositionScrollStrategy.\n */\nexport interface RepositionScrollStrategyConfig {\n /** Time in milliseconds to throttle the scroll events. */\n scrollThrottle?: number;\n\n /** Whether to close the overlay once the user has scrolled away completely. */\n autoClose?: boolean;\n}\n\n/**\n * Strategy that will update the element position as the user is scrolling.\n */\nexport class RepositionScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription|null = null;\n private _overlayRef: OverlayReference;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _viewportRuler: ViewportRuler,\n private _ngZone: NgZone,\n private _config?: RepositionScrollStrategyConfig) { }\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayReference) {\n if (this._overlayRef) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables repositioning of the attached overlay on scroll. */\n enable() {\n if (!this._scrollSubscription) {\n const throttle = this._config ? this._config.scrollThrottle : 0;\n\n this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {\n this._overlayRef.updatePosition();\n\n // TODO(crisbeto): make `close` on by default once all components can handle it.\n if (this._config && this._config.autoClose) {\n const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();\n const {width, height} = this._viewportRuler.getViewportSize();\n\n // TODO(crisbeto): include all ancestor scroll containers here once\n // we have a way of exposing the trigger element to the scroll strategy.\n const parentRects = [{width, height, bottom: height, right: width, top: 0, left: 0}];\n\n if (isElementScrolledOutsideView(overlayRect, parentRects)) {\n this.disable();\n this._ngZone.run(() => this._overlayRef.detach());\n }\n }\n });\n }\n }\n\n /** Disables repositioning of the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = 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 {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, NgZone} from '@angular/core';\nimport {BlockScrollStrategy} from './block-scroll-strategy';\nimport {CloseScrollStrategy, CloseScrollStrategyConfig} from './close-scroll-strategy';\nimport {NoopScrollStrategy} from './noop-scroll-strategy';\nimport {\n RepositionScrollStrategy,\n RepositionScrollStrategyConfig,\n} from './reposition-scroll-strategy';\n\n\n/**\n * Options for how an overlay will handle scrolling.\n *\n * Users can provide a custom value for `ScrollStrategyOptions` to replace the default\n * behaviors. This class primarily acts as a factory for ScrollStrategy instances.\n */\n@Injectable({providedIn: 'root'})\nexport class ScrollStrategyOptions {\n private _document: Document;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _viewportRuler: ViewportRuler,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /** Do nothing on scroll. */\n noop = () => new NoopScrollStrategy();\n\n /**\n * Close the overlay as soon as the user scrolls.\n * @param config Configuration to be used inside the scroll strategy.\n */\n close = (config?: CloseScrollStrategyConfig) => new CloseScrollStrategy(this._scrollDispatcher,\n this._ngZone, this._viewportRuler, config)\n\n /** Block scrolling. */\n block = () => new BlockScrollStrategy(this._viewportRuler, this._document);\n\n /**\n * Update the overlay's position on scroll.\n * @param config Configuration to be used inside the scroll strategy.\n * Allows debouncing the reposition calls.\n */\n reposition = (config?: RepositionScrollStrategyConfig) => new RepositionScrollStrategy(\n this._scrollDispatcher, this._viewportRuler, this._ngZone, config)\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 {PositionStrategy} from './position/position-strategy';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {ScrollStrategy, NoopScrollStrategy} from './scroll/index';\n\n\n/** Initial configuration used when creating an overlay. */\nexport class OverlayConfig {\n /** Strategy with which to position the overlay. */\n positionStrategy?: PositionStrategy;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n scrollStrategy?: ScrollStrategy = new NoopScrollStrategy();\n\n /** Custom class to add to the overlay pane. */\n panelClass?: string | string[] = '';\n\n /** Whether the overlay has a backdrop. */\n hasBackdrop?: boolean = false;\n\n /** Custom class to add to the backdrop */\n backdropClass?: string | string[] = 'cdk-overlay-dark-backdrop';\n\n /** The width of the overlay panel. If a number is provided, pixel units are assumed. */\n width?: number | string;\n\n /** The height of the overlay panel. If a number is provided, pixel units are assumed. */\n height?: number | string;\n\n /** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */\n minWidth?: number | string;\n\n /** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */\n minHeight?: number | string;\n\n /** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */\n maxWidth?: number | string;\n\n /** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */\n maxHeight?: number | string;\n\n /**\n * Direction of the text in the overlay panel. If a `Directionality` instance\n * is passed in, the overlay will handle changes to its value automatically.\n */\n direction?: Direction | Directionality;\n\n /**\n * Whether the overlay should be disposed of when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n disposeOnNavigation?: boolean = false;\n\n constructor(config?: OverlayConfig) {\n if (config) {\n const configKeys = Object.keys(config) as Array<keyof OverlayConfig>;\n for (const key of configKeys) {\n if (config[key] !== undefined) {\n // TypeScript, as of version 3.5, sees the left-hand-side of this expression\n // as \"I don't know *which* key this is, so the only valid value is the intersection\n // of all the posible values.\" In this case, that happens to be `undefined`. TypeScript\n // is not smart enough to see that the right-hand-side is actually an access of the same\n // exact type with the same exact key, meaning that the value type must be identical.\n // So we use `any` to work around this.\n this[key] = config[key] as any;\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {ComponentPortal, Portal, PortalOutlet, TemplatePortal} from '@angular/cdk/portal';\nimport {ComponentRef, EmbeddedViewRef, NgZone} from '@angular/core';\nimport {Location} from '@angular/common';\nimport {Observable, Subject, merge, SubscriptionLike, Subscription, Observer} from 'rxjs';\nimport {take, takeUntil} from 'rxjs/operators';\nimport {OverlayKeyboardDispatcher} from './keyboard/overlay-keyboard-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion';\nimport {OverlayReference} from './overlay-reference';\nimport {PositionStrategy} from './position/position-strategy';\nimport {ScrollStrategy} from './scroll';\n\n\n/** An object where all of its properties cannot be written. */\nexport type ImmutableObject<T> = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * Reference to an overlay that has been created with the Overlay service.\n * Used to manipulate or dispose of said overlay.\n */\nexport class OverlayRef implements PortalOutlet, OverlayReference {\n private _backdropElement: HTMLElement | null = null;\n private _backdropClick: Subject<MouseEvent> = new Subject();\n private _attachments = new Subject<void>();\n private _detachments = new Subject<void>();\n private _positionStrategy: PositionStrategy | undefined;\n private _scrollStrategy: ScrollStrategy | undefined;\n private _locationChanges: SubscriptionLike = Subscription.EMPTY;\n private _backdropClickHandler = (event: MouseEvent) => this._backdropClick.next(event);\n\n /**\n * Reference to the parent of the `_host` at the time it was detached. Used to restore\n * the `_host` to its original position in the DOM when it gets re-attached.\n */\n private _previousHostParent: HTMLElement;\n\n private _keydownEventsObservable: Observable<KeyboardEvent> =\n new Observable((observer: Observer<KeyboardEvent>) => {\n const subscription = this._keydownEvents.subscribe(observer);\n this._keydownEventSubscriptions++;\n\n return () => {\n subscription.unsubscribe();\n this._keydownEventSubscriptions--;\n };\n });\n\n /** Stream of keydown events dispatched to this overlay. */\n _keydownEvents = new Subject<KeyboardEvent>();\n\n /** Amount of subscriptions to the keydown events. */\n _keydownEventSubscriptions = 0;\n\n constructor(\n private _portalOutlet: PortalOutlet,\n private _host: HTMLElement,\n private _pane: HTMLElement,\n private _config: ImmutableObject<OverlayConfig>,\n private _ngZone: NgZone,\n private _keyboardDispatcher: OverlayKeyboardDispatcher,\n private _document: Document,\n // @breaking-change 8.0.0 `_location` parameter to be made required.\n private _location?: Location) {\n\n if (_config.scrollStrategy) {\n this._scrollStrategy = _config.scrollStrategy;\n this._scrollStrategy.attach(this);\n }\n\n this._positionStrategy = _config.positionStrategy;\n }\n\n /** The overlay's HTML element */\n get overlayElement(): HTMLElement {\n return this._pane;\n }\n\n /** The overlay's backdrop HTML element. */\n get backdropElement(): HTMLElement | null {\n return this._backdropElement;\n }\n\n /**\n * Wrapper around the panel element. Can be used for advanced\n * positioning where a wrapper with specific styling is\n * required around the overlay pane.\n */\n get hostElement(): HTMLElement {\n return this._host;\n }\n\n attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;\n attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;\n attach(portal: any): any;\n\n /**\n * Attaches content, given via a Portal, to the overlay.\n * If the overlay is configured to have a backdrop, it will be created.\n *\n * @param portal Portal instance to which to attach the overlay.\n * @returns The portal attachment result.\n */\n attach(portal: Portal<any>): any {\n let attachResult = this._portalOutlet.attach(portal);\n\n if (this._positionStrategy) {\n this._positionStrategy.attach(this);\n }\n\n // Update the pane element with the given configuration.\n if (!this._host.parentElement && this._previousHostParent) {\n this._previousHostParent.appendChild(this._host);\n }\n\n this._updateStackingOrder();\n this._updateElementSize();\n this._updateElementDirection();\n\n if (this._scrollStrategy) {\n this._scrollStrategy.enable();\n }\n\n // Update the position once the zone is stable so that the overlay will be fully rendered\n // before attempting to position it, as the position may depend on the size of the rendered\n // content.\n this._ngZone.onStable\n .asObservable()\n .pipe(take(1))\n .subscribe(() => {\n // The overlay could've been detached before the zone has stabilized.\n if (this.hasAttached()) {\n this.updatePosition();\n }\n });\n\n // Enable pointer events for the overlay pane element.\n this._togglePointerEvents(true);\n\n if (this._config.hasBackdrop) {\n this._attachBackdrop();\n }\n\n if (this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, true);\n }\n\n // Only emit the `attachments` event once all other setup is done.\n this._attachments.next();\n\n // Track this overlay by the keyboard dispatcher\n this._keyboardDispatcher.add(this);\n\n // @breaking-change 8.0.0 remove the null check for `_location`\n // once the constructor parameter is made required.\n if (this._config.disposeOnNavigation && this._location) {\n this._locationChanges = this._location.subscribe(() => this.dispose());\n }\n\n return attachResult;\n }\n\n /**\n * Detaches an overlay from a portal.\n * @returns The portal detachment result.\n */\n detach(): any {\n if (!this.hasAttached()) {\n return;\n }\n\n this.detachBackdrop();\n\n // When the overlay is detached, the pane element should disable pointer events.\n // This is necessary because otherwise the pane element will cover the page and disable\n // pointer events therefore. Depends on the position strategy and the applied pane boundaries.\n this._togglePointerEvents(false);\n\n if (this._positionStrategy && this._positionStrategy.detach) {\n this._positionStrategy.detach();\n }\n\n if (this._scrollStrategy) {\n this._scrollStrategy.disable();\n }\n\n const detachmentResult = this._portalOutlet.detach();\n\n // Only emit after everything is detached.\n this._detachments.next();\n\n // Remove this overlay from keyboard dispatcher tracking.\n this._keyboardDispatcher.remove(this);\n\n // Keeping the host element in DOM the can cause scroll jank, because it still gets\n // rendered, even though it's transparent and unclickable which is why we remove it.\n this._detachContentWhenStable();\n\n // Stop listening for location changes.\n this._locationChanges.unsubscribe();\n\n return detachmentResult;\n }\n\n /** Cleans up the overlay from the DOM. */\n dispose(): void {\n const isAttached = this.hasAttached();\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._disposeScrollStrategy();\n this.detachBackdrop();\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n\n if (this._host && this._host.parentNode) {\n this._host.parentNode.removeChild(this._host);\n this._host = null!;\n }\n\n this._previousHostParent = this._pane = null!;\n\n if (isAttached) {\n this._detachments.next();\n }\n\n this._detachments.complete();\n }\n\n /** Whether the overlay has attached content. */\n hasAttached(): boolean {\n return this._portalOutlet.hasAttached();\n }\n\n /** Gets an observable that emits when the backdrop has been clicked. */\n backdropClick(): Observable<MouseEvent> {\n return this._backdropClick.asObservable();\n }\n\n /** Gets an observable that emits when the overlay has been attached. */\n attachments(): Observable<void> {\n return this._attachments.asObservable();\n }\n\n /** Gets an observable that emits when the overlay has been detached. */\n detachments(): Observable<void> {\n return this._detachments.asObservable();\n }\n\n /** Gets an observable of keydown events targeted to this overlay. */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._keydownEventsObservable;\n }\n\n /** Gets the current overlay configuration, which is immutable. */\n getConfig(): OverlayConfig {\n return this._config;\n }\n\n /** Updates the position of the overlay based on the position strategy. */\n updatePosition(): void {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }\n\n /** Switches to a new position strategy and updates the overlay position. */\n updatePositionStrategy(strategy: PositionStrategy): void {\n if (strategy === this._positionStrategy) {\n return;\n }\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._positionStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n this.updatePosition();\n }\n }\n\n /** Update the size properties of the overlay. */\n updateSize(sizeConfig: OverlaySizeConfig): void {\n this._config = {...this._config, ...sizeConfig};\n this._updateElementSize();\n }\n\n /** Sets the LTR/RTL direction for the overlay. */\n setDirection(dir: Direction | Directionality): void {\n this._config = {...this._config, direction: dir};\n this._updateElementDirection();\n }\n\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }\n\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }\n\n /**\n * Returns the layout direction of the overlay panel.\n */\n getDirection(): Direction {\n const direction = this._config.direction;\n\n if (!direction) {\n return 'ltr';\n }\n\n return typeof direction === 'string' ? direction : direction.value;\n }\n\n /** Switches to a new scroll strategy. */\n updateScrollStrategy(strategy: ScrollStrategy): void {\n if (strategy === this._scrollStrategy) {\n return;\n }\n\n this._disposeScrollStrategy();\n this._scrollStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n strategy.enable();\n }\n }\n\n /** Updates the text direction of the overlay panel. */\n private _updateElementDirection() {\n this._host.setAttribute('dir', this.getDirection());\n }\n\n /** Updates the size of the overlay element based on the overlay config. */\n private _updateElementSize() {\n const style = this._pane.style;\n\n style.width = coerceCssPixelValue(this._config.width);\n style.height = coerceCssPixelValue(this._config.height);\n style.minWidth = coerceCssPixelValue(this._config.minWidth);\n style.minHeight = coerceCssPixelValue(this._config.minHeight);\n style.maxWidth = coerceCssPixelValue(this._config.maxWidth);\n style.maxHeight = coerceCssPixelValue(this._config.maxHeight);\n }\n\n /** Toggles the pointer events for the overlay pane element. */\n private _togglePointerEvents(enablePointer: boolean) {\n this._pane.style.pointerEvents = enablePointer ? 'auto' : 'none';\n }\n\n /** Attaches a backdrop for this overlay. */\n private _attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n\n this._backdropElement = this._document.createElement('div');\n this._backdropElement.classList.add('cdk-overlay-backdrop');\n\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropElement, this._config.backdropClass, true);\n }\n\n // Insert the backdrop before the pane in the DOM order,\n // in order to handle stacked overlays properly.\n this._host.parentElement!.insertBefore(this._backdropElement, this._host);\n\n // Forward backdrop clicks such that the consumer of the overlay can perform whatever\n // action desired when such a click occurs (usually closing the overlay).\n this._backdropElement.addEventListener('click', this._backdropClickHandler);\n\n // Add class to fade-in the backdrop after one frame.\n if (typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n if (this._backdropElement) {\n this._backdropElement.classList.add(showingClass);\n }\n });\n });\n } else {\n this._backdropElement.classList.add(showingClass);\n }\n }\n\n /**\n * Updates the stacking order of the element, moving it to the top if necessary.\n * This is required in cases where one overlay was detached, while another one,\n * that should be behind it, was destroyed. The next time both of them are opened,\n * the stacking will be wrong, because the detached element's pane will still be\n * in its original DOM position.\n */\n private _updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode!.appendChild(this._host);\n }\n }\n\n /** Detaches the backdrop (if any) associated with the overlay. */\n detachBackdrop(): void {\n let backdropToDetach = this._backdropElement;\n\n if (!backdropToDetach) {\n return;\n }\n\n let timeoutId: number;\n let finishDetach = () => {\n // It may not be attached to anything in certain cases (e.g. unit tests).\n if (backdropToDetach) {\n backdropToDetach.removeEventListener('click', this._backdropClickHandler);\n backdropToDetach.removeEventListener('transitionend', finishDetach);\n\n if (backdropToDetach.parentNode) {\n backdropToDetach.parentNode.removeChild(backdropToDetach);\n }\n }\n\n // It is possible that a new portal has been attached to this overlay since we started\n // removing the backdrop. If that is the case, only clear the backdrop reference if it\n // is still the same instance that we started to remove.\n if (this._backdropElement == backdropToDetach) {\n this._backdropElement = null;\n }\n\n if (this._config.backdropClass) {\n this._toggleClasses(backdropToDetach!, this._config.backdropClass, false);\n }\n\n clearTimeout(timeoutId);\n };\n\n backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');\n\n this._ngZone.runOutsideAngular(() => {\n backdropToDetach!.addEventListener('transitionend', finishDetach);\n });\n\n // If the backdrop doesn't have a transition, the `transitionend` event won't fire.\n // In this case we make it unclickable and we try to remove it after a delay.\n backdropToDetach.style.pointerEvents = 'none';\n\n // Run this outside the Angular zone because there's nothing that Angular cares about.\n // If it were to run inside the Angular zone, every test that used Overlay would have to be\n // either async or fakeAsync.\n timeoutId = this._ngZone.runOutsideAngular(() => setTimeout(finishDetach, 500));\n }\n\n /** Toggles a single CSS class or an array of classes on an element. */\n private _toggleClasses(element: HTMLElement, cssClasses: string | string[], isAdd: boolean) {\n const classList = element.classList;\n\n coerceArray(cssClasses).forEach(cssClass => {\n // We can't do a spread here, because IE doesn't support setting multiple classes.\n isAdd ? classList.add(cssClass) : classList.remove(cssClass);\n });\n }\n\n /** Detaches the overlay content next time the zone stabilizes. */\n private _detachContentWhenStable() {\n // Normally we wouldn't have to explicitly run this outside the `NgZone`, however\n // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will\n // be patched to run inside the zone, which will throw us into an infinite loop.\n this._ngZone.runOutsideAngular(() => {\n // We can't remove the host here immediately, because the overlay pane's content\n // might still be animating. This stream helps us avoid interrupting the animation\n // by waiting for the pane to become empty.\n const subscription = this._ngZone.onStable\n .asObservable()\n .pipe(takeUntil(merge(this._attachments, this._detachments)))\n .subscribe(() => {\n // Needs a couple of checks for the pane and host, because\n // they may have been removed by the time the zone stabilizes.\n if (!this._pane || !this._host || this._pane.children.length === 0) {\n if (this._pane && this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, false);\n }\n\n if (this._host && this._host.parentElement) {\n this._previousHostParent = this._host.parentElement;\n this._previousHostParent.removeChild(this._host);\n }\n\n subscription.unsubscribe();\n }\n });\n });\n }\n\n /** Disposes of a scroll strategy. */\n private _disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n\n if (scrollStrategy) {\n scrollStrategy.disable();\n\n if (scrollStrategy.detach) {\n scrollStrategy.detach();\n }\n }\n }\n}\n\n\n/** Size properties for an overlay. */\nexport interface OverlaySizeConfig {\n width?: number | string;\n height?: number | string;\n minWidth?: number | string;\n minHeight?: number | string;\n maxWidth?: number | string;\n maxHeight?: number | string;\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 {Direction} from '@angular/cdk/bidi';\nimport {Platform} from '@angular/cdk/platform';\nimport {CdkScrollable, ViewportRuler} from '@angular/cdk/scrolling';\nimport {ElementRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {OverlayContainer} from '../overlay-container';\nimport {OverlayReference} from '../overlay-reference';\n\nimport {\n ConnectedOverlayPositionChange,\n ConnectionPositionPair,\n OriginConnectionPosition,\n OverlayConnectionPosition,\n} from './connected-position';\nimport {FlexibleConnectedPositionStrategy} from './flexible-connected-position-strategy';\nimport {PositionStrategy} from './position-strategy';\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * implicit position relative to some origin element. The relative position is defined in terms of\n * a point on the origin element that is connected to a point on the overlay element. For example,\n * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner\n * of the overlay.\n * @deprecated Use `FlexibleConnectedPositionStrategy` instead.\n * @breaking-change 8.0.0\n */\nexport class ConnectedPositionStrategy implements PositionStrategy {\n /**\n * Reference to the underlying position strategy to which all the API calls are proxied.\n * @docs-private\n */\n _positionStrategy: FlexibleConnectedPositionStrategy;\n\n /** The overlay to which this strategy is attached. */\n private _overlayRef: OverlayReference;\n\n private _direction: Direction | null;\n\n /** Whether the we're dealing with an RTL context */\n get _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n\n /** Ordered list of preferred positions, from most to least desirable. */\n _preferredPositions: ConnectionPositionPair[] = [];\n\n /** Emits an event when the connection point changes. */\n get onPositionChange(): Observable<ConnectedOverlayPositionChange> {\n return this._positionStrategy.positionChanges;\n }\n\n constructor(\n originPos: OriginConnectionPosition, overlayPos: OverlayConnectionPosition,\n connectedTo: ElementRef<HTMLElement>, viewportRuler: ViewportRuler, document: Document,\n platform: Platform, overlayContainer: OverlayContainer) {\n // Since the `ConnectedPositionStrategy` is deprecated and we don't want to maintain\n // the extra logic, we create an instance of the positioning strategy that has some\n // defaults that make it behave as the old position strategy and to which we'll\n // proxy all of the API calls.\n this._positionStrategy = new FlexibleConnectedPositionStrategy(\n connectedTo, viewportRuler, document, platform, overlayContainer)\n .withFlexibleDimensions(false)\n .withPush(false)\n .withViewportMargin(0);\n\n this.withFallbackPosition(originPos, overlayPos);\n }\n\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions(): ConnectionPositionPair[] {\n return this._preferredPositions;\n }\n\n /** Attach this position strategy to an overlay. */\n attach(overlayRef: OverlayReference): void {\n this._overlayRef = overlayRef;\n this._positionStrategy.attach(overlayRef);\n\n if (this._direction) {\n overlayRef.setDirection(this._direction);\n this._direction = null;\n }\n }\n\n /** Disposes all resources used by the position strategy. */\n dispose() {\n this._positionStrategy.dispose();\n }\n\n /** @docs-private */\n detach() {\n this._positionStrategy.detach();\n }\n\n /**\n * Updates the position of the overlay element, using whichever preferred position relative\n * to the origin fits on-screen.\n * @docs-private\n */\n apply(): void {\n this._positionStrategy.apply();\n }\n\n /**\n * Re-positions the overlay element with the trigger in its last calculated position,\n * even if a position higher in the \"preferred positions\" list would now fit. This\n * allows one to re-align the panel without changing the orientation of the panel.\n */\n recalculateLastPosition(): void {\n this._positionStrategy.reapplyLastPosition();\n }\n\n /**\n * Sets the list of Scrollable containers that host the origin element so that\n * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every\n * Scrollable must be an ancestor element of the strategy's origin element.\n */\n withScrollableContainers(scrollables: CdkScrollable[]) {\n this._positionStrategy.withScrollableContainers(scrollables);\n }\n\n /**\n * Adds a new preferred fallback position.\n * @param originPos\n * @param overlayPos\n */\n withFallbackPosition(\n originPos: OriginConnectionPosition,\n overlayPos: OverlayConnectionPosition,\n offsetX?: number,\n offsetY?: number): this {\n\n const position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);\n this._preferredPositions.push(position);\n this._positionStrategy.withPositions(this._preferredPositions);\n return this;\n }\n\n /**\n * Sets the layout direction so the overlay's position can be adjusted to match.\n * @param dir New layout direction.\n */\n withDirection(dir: 'ltr' | 'rtl'): this {\n // Since the direction might be declared before the strategy is attached,\n // we save the value in a temporary property and we'll transfer it to the\n // overlay ref on attachment.\n if (this._overlayRef) {\n this._overlayRef.setDirection(dir);\n } else {\n this._direction = dir;\n }\n\n return this;\n }\n\n /**\n * Sets an offset for the overlay's connection point on the x-axis\n * @param offset New offset in the X axis.\n */\n withOffsetX(offset: number): this {\n this._positionStrategy.withDefaultOffsetX(offset);\n return this;\n }\n\n /**\n * Sets an offset for the overlay's connection point on the y-axis\n * @param offset New offset in the Y axis.\n */\n withOffsetY(offset: number): this {\n this._positionStrategy.withDefaultOffsetY(offset);\n return this;\n }\n\n /**\n * Sets whether the overlay's position should be locked in after it is positioned\n * initially. When an overlay is locked in, it won't attempt to reposition itself\n * when the position is re-applied (e.g. when the user scrolls away).\n * @param isLocked Whether the overlay should locked in.\n */\n withLockedPosition(isLocked: boolean): this {\n this._positionStrategy.withLockedPosition(isLocked);\n return this;\n }\n\n /**\n * Overwrites the current set of positions with an array of new ones.\n * @param positions Position pairs to be set on the strategy.\n */\n withPositions(positions: ConnectionPositionPair[]): this {\n this._preferredPositions = positions.slice();\n this._positionStrategy.withPositions(this._preferredPositions);\n return this;\n }\n\n /**\n * Sets the origin element, relative to which to position the overlay.\n * @param origin Reference to the new origin element.\n */\n setOrigin(origin: ElementRef): this {\n this._positionStrategy.setOrigin(origin);\n return this;\n }\n}\n"],"names":["GlobalPositionStrategy","prototype","left","value","_rightOffset","_leftOffset","_justifyContent","bottom","_topOffset","_bottomOffset","_alignItems","right","width","_overlayRef","updateSize","_width","height","_height","centerHorizontally","offset","centerVertically","top","apply","this","hasAttached","styles","overlayElement","style","parentStyles","hostElement","config","getConfig","position","_cssPosition","marginLeft","marginTop","marginBottom","marginRight","justifyContent","direction","alignItems","dispose","_isDisposed","parent","classList","remove","OverlayPositionBuilder","_viewportRuler","_document","_platform","_overlayContainer","global","connectedTo","elementRef","originPos","overlayPos","ConnectedPositionStrategy","flexibleConnectedTo","origin","FlexibleConnectedPositionStrategy","type","Injectable","args","providedIn","ViewportRuler","undefined","decorators","Inject","DOCUMENT","Platform","OverlayContainer","nextUniqueId","Overlay","scrollStrategies","_componentFactoryResolver","_positionBuilder","_keyboardDispatcher","_injector","_ngZone","_directionality","_location","create","host","_createHostElement","pane","_createPaneElement","portalOutlet","_createPortalOutlet","overlayConfig","OverlayConfig","OverlayRef","createElement","id","add","appendChild","getContainerElement","_appRef","get","ApplicationRef","DomPortalOutlet","ScrollStrategyOptions","ComponentFactoryResolver","OverlayKeyboardDispatcher","Injector","NgZone","Directionality","Location","Optional","defaultPositionList","originX","originY","overlayX","overlayY","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY","InjectionToken","CdkOverlayOrigin","Directive","selector","exportAs","ElementRef","CdkConnectedOverlay","_overlay","templateRef","viewContainerRef","scrollStrategyFactory","_dir","_hasBackdrop","_lockPosition","_growAfterOpen","_flexibleDimensions","_push","_backdropSubscription","Subscription","EMPTY","viewportMargin","open","backdropClick","EventEmitter","positionChange","attach","detach","overlayKeydown","_templatePortal","TemplatePortal","_scrollStrategyFactory","scrollStrategy","Object","defineProperty","_offsetX","offsetX","_position","_updatePositionStrategy","_offsetY","offsetY","coerceBooleanProperty","ngOnDestroy","unsubscribe","ngOnChanges","changes","minWidth","minHeight","_attachOverlay","_detachOverlay","_createOverlay","_this","positions","length","_buildConfig","keydownEvents","subscribe","event","next","keyCode","ESCAPE","hasModifierKey","preventDefault","positionStrategy","_createPositionStrategy","hasBackdrop","backdropClass","panelClass","map","currentPosition","setOrigin","withPositions","withFlexibleDimensions","flexibleDimensions","withPush","push","withGrowAfterOpen","growAfterOpen","withViewportMargin","withLockedPosition","lockPosition","strategy","positionChanges","p","emit","TemplateRef","ViewContainerRef","Input","Output","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER","provide","deps","useFactory","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY","OverlayModule","NgModule","imports","BidiModule","PortalModule","ScrollingModule","exports","declarations","providers","OVERLAY_PROVIDERS","OVERLAY_KEYBOARD_DISPATCHER_PROVIDER","VIEWPORT_RULER_PROVIDER","OVERLAY_CONTAINER_PROVIDER","FullscreenOverlayContainer","_super","call","tslib_1.__extends","_fullScreenEventName","_fullScreenListener","removeEventListener","_createContainer","_adjustParentForFullscreenChange","_addFullscreenChangeListener","_containerElement","getFullscreenElement","body","fn","eventName","_getEventName","addEventListener","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","__extends","d","b","__","constructor","extendStatics","getMatScrollStrategyAlreadyAttachedError","Error","isElementScrolledOutsideView","element","scrollContainers","some","containerBounds","outsideAbove","outsideBelow","outsideLeft","outsideRight","isElementClippedByScrolling","scrollContainerRect","clippedAbove","clippedBelow","clippedLeft","clippedRight","validateVerticalPosition","property","validateHorizontalPosition","OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY","dispatcher","OVERLAY_CONTAINER_PROVIDER_FACTORY","parentContainer","extendStyles","dest","source","key","hasOwnProperty","overlay","reposition","setPrototypeOf","__proto__","Array","__assign","assign","t","s","i","n","arguments","BlockScrollStrategy","document","_previousHTMLStyles","_isEnabled","enable","_canBeEnabled","root","_previousScrollPosition","getViewportScrollPosition","coerceCssPixelValue","disable","html","htmlStyle","bodyStyle","previousHtmlScrollBehavior","scrollBehavior","previousBodyScrollBehavior","window","scroll","contains","viewport","getViewportSize","scrollHeight","scrollWidth","CloseScrollStrategy","_scrollDispatcher","_config","_scrollSubscription","_detach","run","overlayRef","stream","scrolled","threshold","_initialScrollPosition","scrollPosition","Math","abs","updatePosition","NoopScrollStrategy","RepositionScrollStrategy","throttle","scrollThrottle","autoClose","overlayRect","getBoundingClientRect","_a","noop","close","block","ScrollDispatcher","disposeOnNavigation","configKeys","keys","_i","configKeys_1","ConnectionPositionPair","ScrollingVisibility","ConnectedOverlayPositionChange","connectionPair","scrollableViewProperties","_attachedOverlays","_keydownListener","overlays","_keydownEventSubscriptions","_keydownEvents","_isAttached","index","indexOf","splice","SkipSelf","parentNode","removeChild","container","_portalOutlet","_host","_pane","_backdropElement","_backdropClick","Subject","_attachments","_detachments","_locationChanges","_backdropClickHandler","_keydownEventsObservable","Observable","observer","subscription","_scrollStrategy","_positionStrategy","portal","attachResult","parentElement","_previousHostParent","_updateStackingOrder","_updateElementSize","_updateElementDirection","onStable","asObservable","pipe","take","_togglePointerEvents","_attachBackdrop","_toggleClasses","detachBackdrop","detachmentResult","_detachContentWhenStable","isAttached","_disposeScrollStrategy","complete","attachments","detachments","updatePositionStrategy","sizeConfig","tslib_1.__assign","setDirection","dir","addPanelClass","classes","removePanelClass","getDirection","updateScrollStrategy","setAttribute","maxWidth","maxHeight","enablePointer","pointerEvents","insertBefore","requestAnimationFrame","runOutsideAngular","nextSibling","backdropToDetach","timeoutId","finishDetach","clearTimeout","setTimeout","cssClasses","isAdd","coerceArray","forEach","cssClass","takeUntil","merge","children","_lastBoundingBoxSize","_isPushed","_canPush","_hasFlexibleDimensions","_positionLocked","_viewportMargin","_scrollables","_preferredPositions","_positionChanges","_resizeSubscription","_appliedPanelClasses","_validatePositions","_boundingBox","_isInitialRender","_lastPosition","change","isBrowser","reapplyLastPosition","_clearPanelClasses","_resetOverlayElementStyles","_resetBoundingBoxStyles","_viewportRect","_getNarrowedViewportRect","_originRect","_getOriginRect","_overlayRect","fallback","originRect","viewportRect","flexibleFits","pos","originPoint","_getOriginPoint","overlayPoint","_getOverlayPoint","overlayFit","_getOverlayFit","isCompletelyWithinViewport","_applyPosition","_canFitWithFlexibleDimensions","boundingBoxRect","_calculateBoundingBoxRect","visibleArea","bestFit","bestScore","_b","flexibleFits_1","fit","score","weight","_previousPushAmount","lastPosition","withScrollableContainers","scrollables","margin","canPush","isLocked","_origin","withDefaultOffsetX","withDefaultOffsetY","withTransformOriginOn","_transformOriginSelector","x","startX","_isRtl","endX","y","overlayStartX","overlayStartY","point","_getOffset","leftOverflow","rightOverflow","topOverflow","bottomOverflow","visibleWidth","_subtractOverflows","visibleHeight","fitsInViewportVertically","fitsInViewportHorizontally","availableHeight","availableWidth","verticalFit","horizontalFit","_pushOverlayOnScreen","start","overflowRight","max","overflowBottom","overflowTop","overflowLeft","pushX","pushY","_setTransformOrigin","_setOverlayElementStyles","_setBoundingBoxStyles","_addPanelClasses","observers","_getScrollVisibility","changeEvent","xOrigin","elements","querySelectorAll","yOrigin","transformOrigin","isRtl","smallestDistanceToViewportEdge","min","previousHeight","isBoundedByRightViewportEdge","isBoundedByLeftViewportEdge","previousWidth","_hasExactPosition","transform","_getExactOverlayY","_getExactOverlayX","transformString","trim","virtualKeyboardOffset","documentHeight","clientHeight","documentWidth","clientWidth","originBounds","overlayBounds","scrollContainerBounds","scrollable","getElementRef","nativeElement","isOriginClipped","isOriginOutsideView","isOverlayClipped","isOverlayOutsideView","overflows","reduce","currentValue","currentOverflow","axis","pair","HTMLElement","viewportRuler","platform","overlayContainer","withFallbackPosition","_direction","recalculateLastPosition","withDirection","withOffsetX","withOffsetY","slice"],"mappings":";;;;;;;04BMuBA,SAAgBqP,GAAUC,EAAGC,GAEzB,QAASC,KAAOjO,KAAKkO,YAAcH,EADnCI,EAAcJ,EAAGC,GAEjBD,EAAErP,UAAkB,OAANsP,EAAarG,OAAOjE,OAAOsK,IAAMC,EAAGvP,UAAYsP,EAAEtP,UAAW,GAAIuP,ICInF,QAAgBG,KACd,MAAOC,OAAM,8CCbf,QAAgBC,GAA6BC,EAAqBC,GAChE,MAAOA,GAAiBC,KAAI,SAACC,GAC/B,GAAUC,GAAeJ,EAAQvP,OAAS0P,EAAgB5O,IAChD8O,EAAeL,EAAQzO,IAAM4O,EAAgB1P,OAC7C6P,EAAcN,EAAQnP,MAAQ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