blob: f5ea8990e2a8271aecba766f977853b52d1b4ef7 [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("@angular/cdk/coercion"),require("@angular/cdk/platform"),require("@angular/cdk/bidi"),require("@angular/cdk/portal"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/keycodes")):"function"==typeof define&&define.amd?define("@angular/cdk/overlay",["exports","@angular/cdk/scrolling","@angular/common","@angular/core","@angular/cdk/coercion","@angular/cdk/platform","@angular/cdk/bidi","@angular/cdk/portal","rxjs","rxjs/operators","@angular/cdk/keycodes"],e):e(((t=t||self).ng=t.ng||{},t.ng.cdk=t.ng.cdk||{},t.ng.cdk.overlay={}),t.ng.cdk.scrolling,t.ng.common,t.ng.core,t.ng.cdk.coercion,t.ng.cdk.platform,t.ng.cdk.bidi,t.ng.cdk.portal,t.rxjs,t.rxjs.operators,t.ng.cdk.keycodes)}(this,(function(t,e,i,o,n,r,s,a,l,h,c){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function d(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],o=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var _=r.supportsScrollBehavior(),f=function(){function t(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}return t.prototype.attach=function(){},t.prototype.enable=function(){if(this._canBeEnabled()){var t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=n.coerceCssPixelValue(-this._previousScrollPosition.left),t.style.top=n.coerceCssPixelValue(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}},t.prototype.disable=function(){if(this._isEnabled){var t=this._document.documentElement,e=t.style,i=this._document.body.style,o=e.scrollBehavior||"",n=i.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),_&&(e.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),_&&(e.scrollBehavior=o,i.scrollBehavior=n)}},t.prototype._canBeEnabled=function(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;var t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width},t}(),y=function(){function t(t,e,i,o){var n=this;this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=o,this._scrollSubscription=null,this._detach=function(){n.disable(),n._overlayRef.hasAttached()&&n._ngZone.run((function(){return n._overlayRef.detach()}))}}return t.prototype.attach=function(t){this._overlayRef=t},t.prototype.enable=function(){var t=this;if(!this._scrollSubscription){var e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe((function(){var e=t._viewportRuler.getViewportScrollPosition().top;Math.abs(e-t._initialScrollPosition)>t._config.threshold?t._detach():t._overlayRef.updatePosition()}))):this._scrollSubscription=e.subscribe(this._detach)}},t.prototype.disable=function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)},t.prototype.detach=function(){this.disable(),this._overlayRef=null},t}(),g=function(){function t(){}return t.prototype.enable=function(){},t.prototype.disable=function(){},t.prototype.attach=function(){},t}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function v(t,e){return e.some((function(e){return t.bottom<e.top||t.top>e.bottom||t.right<e.left||t.left>e.right}))}function m(t,e){return e.some((function(e){return t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right}))}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var b,w=function(){function t(t,e,i,o){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=o,this._scrollSubscription=null}return t.prototype.attach=function(t){this._overlayRef=t},t.prototype.enable=function(){var t=this;this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe((function(){if(t._overlayRef.updatePosition(),t._config&&t._config.autoClose){var e=t._overlayRef.overlayElement.getBoundingClientRect(),i=t._viewportRuler.getViewportSize(),o=i.width,n=i.height;v(e,[{width:o,height:n,bottom:n,right:o,top:0,left:0}])&&(t.disable(),t._ngZone.run((function(){return t._overlayRef.detach()})))}})))},t.prototype.disable=function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)},t.prototype.detach=function(){this.disable(),this._overlayRef=null},t}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(b=function b(t,e,i,o){var n=this;this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this.noop=function(){return new g},this.close=function(t){return new y(n._scrollDispatcher,n._ngZone,n._viewportRuler,t)},this.block=function(){return new f(n._viewportRuler,n._document)},this.reposition=function(t){return new w(n._scrollDispatcher,n._viewportRuler,n._ngZone,t)},this._document=o}).ɵprov=o.ɵɵdefineInjectable({factory:function t(){return new b(o.ɵɵinject(e.ScrollDispatcher),o.ɵɵinject(e.ViewportRuler),o.ɵɵinject(o.NgZone),o.ɵɵinject(i.DOCUMENT))},token:b,providedIn:"root"}),b.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],b.ctorParameters=function(){return[{type:e.ScrollDispatcher},{type:e.ViewportRuler},{type:o.NgZone},{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var C,O=function O(t){var e,i;if(this.scrollStrategy=new g,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){var o=Object.keys(t);try{for(var n=d(o),r=n.next();!r.done;r=n.next()){var s=r.value;void 0!==t[s]&&(this[s]=t[s])}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}}},S=function S(t,e,i,o,n){this.offsetX=i,this.offsetY=o,this.panelClass=n,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY},k=function k(){};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(C=function C(t,e){this.connectionPair=t,this.scrollableViewProperties=e}).ctorParameters=function(){return[{type:S},{type:k,decorators:[{type:o.Optional}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var P=function(){function t(t){this._attachedOverlays=[],this._document=t}return t.prototype.ngOnDestroy=function(){this.detach()},t.prototype.add=function(t){this.remove(t),this._attachedOverlays.push(t)},t.prototype.remove=function(t){var e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()},t}();Pprov=o.ɵɵdefineInjectable({factory:function t(){return new P(o.ɵɵinject(i.DOCUMENT))},token:P,providedIn:"root"}),P.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],P.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]}]};var x=function(t){function e(e){var i=t.call(this,e)||this;return i._keydownListener=function(t){for(var e=i._attachedOverlays,o=e.length-1;o>-1;o--)if(e[o]._keydownEvents.observers.length>0){e[o]._keydownEvents.next(t);break}},i}return u(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)},e.prototype.detach=function(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)},e}(P);xprov=o.ɵɵdefineInjectable({factory:function t(){return new x(o.ɵɵinject(i.DOCUMENT))},token:x,providedIn:"root"}),x.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],x.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]}]};var E=function(t){function e(e,i){var o=t.call(this,e)||this;return o._platform=i,o._cursorStyleIsSet=!1,o._clickListener=function(t){for(var e=t.composedPath?t.composedPath()[0]:t.target,i=o._attachedOverlays.slice(),n=i.length-1;n>-1;n--){var r=i[n];if(!(r._outsidePointerEvents.observers.length<1)&&r.hasAttached()){if(r.overlayElement.contains(e))break;r._outsidePointerEvents.next(t)}}},o}return u(e,t),e.prototype.add=function(e){if(t.prototype.add.call(this,e),!this._isAttached){var i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}},e.prototype.detach=function(){if(this._isAttached){var t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}},e}(P);Eprov=o.ɵɵdefineInjectable({factory:function t(){return new E(o.ɵɵinject(i.DOCUMENT),o.ɵɵinject(r.Platform))},token:E,providedIn:"root"}),E.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],E.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:r.Platform}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var R=!("undefined"==typeof window||!window||!window.__karma__&&!window.jasmine),j=function(){function t(t,e){this._platform=e,this._document=t}return t.prototype.ngOnDestroy=function(){var t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)},t.prototype.getContainerElement=function(){return this._containerElement||this._createContainer(),this._containerElement},t.prototype._createContainer=function(){if(this._platform.isBrowser||R)for(var t=this._document.querySelectorAll('.cdk-overlay-container[platform="server"], .cdk-overlay-container[platform="test"]'),e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);var i=this._document.createElement("div");i.classList.add("cdk-overlay-container"),R?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i},t}();jprov=o.ɵɵdefineInjectable({factory:function t(){return new j(o.ɵɵinject(i.DOCUMENT),o.ɵɵinject(r.Platform))},token:j,providedIn:"root"}),j.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],j.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:r.Platform}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var D=function(){function t(t,e,i,o,n,r,s,a,h){var c=this;this._portalOutlet=t,this._host=e,this._pane=i,this._config=o,this._ngZone=n,this._keyboardDispatcher=r,this._document=s,this._location=a,this._outsideClickDispatcher=h,this._backdropElement=null,this._backdropClick=new l.Subject,this._attachments=new l.Subject,this._detachments=new l.Subject,this._locationChanges=l.Subscription.EMPTY,this._backdropClickHandler=function(t){return c._backdropClick.next(t)},this._keydownEvents=new l.Subject,this._outsidePointerEvents=new l.Subject,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}return Object.defineProperty(t.prototype,"overlayElement",{get:function(){return this._pane},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backdropElement",{get:function(){return this._backdropElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._host},enumerable:!1,configurable:!0}),t.prototype.attach=function(t){var e=this,i=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(h.take(1)).subscribe((function(){e.hasAttached()&&e.updatePosition()})),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe((function(){return e.dispose()}))),this._outsideClickDispatcher.add(this),i},t.prototype.detach=function(){if(this.hasAttached()){this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();var t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}},t.prototype.dispose=function(){var t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()},t.prototype.hasAttached=function(){return this._portalOutlet.hasAttached()},t.prototype.backdropClick=function(){return this._backdropClick},t.prototype.attachments=function(){return this._attachments},t.prototype.detachments=function(){return this._detachments},t.prototype.keydownEvents=function(){return this._keydownEvents},t.prototype.outsidePointerEvents=function(){return this._outsidePointerEvents},t.prototype.getConfig=function(){return this._config},t.prototype.updatePosition=function(){this._positionStrategy&&this._positionStrategy.apply()},t.prototype.updatePositionStrategy=function(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))},t.prototype.updateSize=function(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()},t.prototype.setDirection=function(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()},t.prototype.addPanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!0)},t.prototype.removePanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!1)},t.prototype.getDirection=function(){var t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"},t.prototype.updateScrollStrategy=function(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))},t.prototype._updateElementDirection=function(){this._host.setAttribute("dir",this.getDirection())},t.prototype._updateElementSize=function(){if(this._pane){var t=this._pane.style;t.width=n.coerceCssPixelValue(this._config.width),t.height=n.coerceCssPixelValue(this._config.height),t.minWidth=n.coerceCssPixelValue(this._config.minWidth),t.minHeight=n.coerceCssPixelValue(this._config.minHeight),t.maxWidth=n.coerceCssPixelValue(this._config.maxWidth),t.maxHeight=n.coerceCssPixelValue(this._config.maxHeight)}},t.prototype._togglePointerEvents=function(t){this._pane.style.pointerEvents=t?"":"none"},t.prototype._attachBackdrop=function(){var t=this;this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular((function(){requestAnimationFrame((function(){t._backdropElement&&t._backdropElement.classList.add("cdk-overlay-backdrop-showing")}))})):this._backdropElement.classList.add("cdk-overlay-backdrop-showing")},t.prototype._updateStackingOrder=function(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)},t.prototype.detachBackdrop=function(){var t=this,e=this._backdropElement;if(e){var i,o=function(){e&&(e.removeEventListener("click",t._backdropClickHandler),e.removeEventListener("transitionend",o),e.parentNode&&e.parentNode.removeChild(e)),t._backdropElement==e&&(t._backdropElement=null),t._config.backdropClass&&t._toggleClasses(e,t._config.backdropClass,!1),clearTimeout(i)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular((function(){e.addEventListener("transitionend",o)})),e.style.pointerEvents="none",i=this._ngZone.runOutsideAngular((function(){return setTimeout(o,500)}))}},t.prototype._toggleClasses=function(t,e,i){var o=t.classList;n.coerceArray(e).forEach((function(t){t&&(i?o.add(t):o.remove(t))}))},t.prototype._detachContentWhenStable=function(){var t=this;this._ngZone.runOutsideAngular((function(){var e=t._ngZone.onStable.pipe(h.takeUntil(l.merge(t._attachments,t._detachments))).subscribe((function(){t._pane&&t._host&&0!==t._pane.children.length||(t._pane&&t._config.panelClass&&t._toggleClasses(t._pane,t._config.panelClass,!1),t._host&&t._host.parentElement&&(t._previousHostParent=t._host.parentElement,t._previousHostParent.removeChild(t._host)),e.unsubscribe())}))}))},t.prototype._disposeScrollStrategy=function(){var t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())},t}(),I=/([A-Za-z%]+)$/,B=function(){function t(t,e,i,o,n){this._viewportRuler=e,this._document=i,this._platform=o,this._overlayContainer=n,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new l.Subject,this._resizeSubscription=l.Subscription.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}return Object.defineProperty(t.prototype,"positions",{get:function(){return this._preferredPositions},enumerable:!1,configurable:!0}),t.prototype.attach=function(t){var e=this;this._validatePositions(),t.hostElement.classList.add("cdk-overlay-connected-position-bounding-box"),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe((function(){e._isInitialRender=!0,e.apply()}))},t.prototype.apply=function(){var t,e,i,o;if(!this._isDisposed&&this._platform.isBrowser)if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)this.reapplyLastPosition();else{this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();var n,r=this._originRect,s=this._overlayRect,a=this._viewportRect,l=[];try{for(var h=d(this._preferredPositions),c=h.next();!c.done;c=h.next()){var p=c.value,u=this._getOriginPoint(r,p),_=this._getOverlayPoint(u,s,p),f=this._getOverlayFit(_,s,a,p);if(f.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(p,u);this._canFitWithFlexibleDimensions(f,_,a)?l.push({position:p,origin:u,overlayRect:s,boundingBoxRect:this._calculateBoundingBoxRect(u,p)}):(!n||n.overlayFit.visibleArea<f.visibleArea)&&(n={overlayFit:f,overlayPoint:_,originPoint:u,position:p,overlayRect:s})}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}if(l.length){var y=null,g=-1;try{for(var v=d(l),m=v.next();!m.done;m=v.next()){var b=m.value,w=b.boundingBoxRect.width*b.boundingBoxRect.height*(b.position.weight||1);w>g&&(g=w,y=b)}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}return this._isPushed=!1,void this._applyPosition(y.position,y.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(n.position,n.originPoint);this._applyPosition(n.position,n.originPoint)}},t.prototype.detach=function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()},t.prototype.dispose=function(){this._isDisposed||(this._boundingBox&&M(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove("cdk-overlay-connected-position-bounding-box"),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)},t.prototype.reapplyLastPosition=function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}},t.prototype.withScrollableContainers=function(t){return this._scrollables=t,this},t.prototype.withPositions=function(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this},t.prototype.withViewportMargin=function(t){return this._viewportMargin=t,this},t.prototype.withFlexibleDimensions=function(t){return void 0===t&&(t=!0),this._hasFlexibleDimensions=t,this},t.prototype.withGrowAfterOpen=function(t){return void 0===t&&(t=!0),this._growAfterOpen=t,this},t.prototype.withPush=function(t){return void 0===t&&(t=!0),this._canPush=t,this},t.prototype.withLockedPosition=function(t){return void 0===t&&(t=!0),this._positionLocked=t,this},t.prototype.setOrigin=function(t){return this._origin=t,this},t.prototype.withDefaultOffsetX=function(t){return this._offsetX=t,this},t.prototype.withDefaultOffsetY=function(t){return this._offsetY=t,this},t.prototype.withTransformOriginOn=function(t){return this._transformOriginSelector=t,this},t.prototype._getOriginPoint=function(t,e){var i;if("center"==e.originX)i=t.left+t.width/2;else{var o=this._isRtl()?t.right:t.left,n=this._isRtl()?t.left:t.right;i="start"==e.originX?o:n}return{x:i,y:"center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom}},t.prototype._getOverlayPoint=function(t,e,i){var o;return o="center"==i.overlayX?-e.width/2:"start"===i.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,{x:t.x+o,y:t.y+("center"==i.overlayY?-e.height/2:"top"==i.overlayY?0:-e.height)}},t.prototype._getOverlayFit=function(t,e,i,o){var n=A(e),r=t.x,s=t.y,a=this._getOffset(o,"x"),l=this._getOffset(o,"y");a&&(r+=a),l&&(s+=l);var h=0-s,c=s+n.height-i.height,p=this._subtractOverflows(n.width,0-r,r+n.width-i.width),u=this._subtractOverflows(n.height,h,c),d=p*u;return{visibleArea:d,isCompletelyWithinViewport:n.width*n.height===d,fitsInViewportVertically:u===n.height,fitsInViewportHorizontally:p==n.width}},t.prototype._canFitWithFlexibleDimensions=function(t,e,i){if(this._hasFlexibleDimensions){var o=i.bottom-e.y,n=i.right-e.x,r=L(this._overlayRef.getConfig().minHeight),s=L(this._overlayRef.getConfig().minWidth);return(t.fitsInViewportVertically||null!=r&&r<=o)&&(t.fitsInViewportHorizontally||null!=s&&s<=n)}return!1},t.prototype._pushOverlayOnScreen=function(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};var o,n,r=A(e),s=this._viewportRect,a=Math.max(t.x+r.width-s.width,0),l=Math.max(t.y+r.height-s.height,0),h=Math.max(s.top-i.top-t.y,0),c=Math.max(s.left-i.left-t.x,0);return this._previousPushAmount={x:o=r.width<=s.width?c||-a:t.x<this._viewportMargin?s.left-i.left-t.x:0,y:n=r.height<=s.height?h||-l:t.y<this._viewportMargin?s.top-i.top-t.y:0},{x:t.x+o,y:t.y+n}},t.prototype._applyPosition=function(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._lastPosition=t,this._positionChanges.observers.length){var i=this._getScrollVisibility(),o=new C(t,i);this._positionChanges.next(o)}this._isInitialRender=!1},t.prototype._setTransformOrigin=function(t){if(this._transformOriginSelector){var e,i=this._boundingBox.querySelectorAll(this._transformOriginSelector),o=t.overlayY;e="center"===t.overlayX?"center":this._isRtl()?"start"===t.overlayX?"right":"left":"start"===t.overlayX?"left":"right";for(var n=0;n<i.length;n++)i[n].style.transformOrigin=e+" "+o}},t.prototype._calculateBoundingBoxRect=function(t,e){var i,o,n,r,s,a,l=this._viewportRect,h=this._isRtl();if("top"===e.overlayY)i=l.height-(o=t.y)+this._viewportMargin;else if("bottom"===e.overlayY)i=l.height-(n=l.height-t.y+2*this._viewportMargin)+this._viewportMargin;else{var c=Math.min(l.bottom-t.y+l.top,t.y),p=this._lastBoundingBoxSize.height;o=t.y-c,(i=2*c)>p&&!this._isInitialRender&&!this._growAfterOpen&&(o=t.y-p/2)}if("end"===e.overlayX&&!h||"start"===e.overlayX&&h)a=l.width-t.x+this._viewportMargin,r=t.x-this._viewportMargin;else if("start"===e.overlayX&&!h||"end"===e.overlayX&&h)s=t.x,r=l.right-t.x;else{c=Math.min(l.right-t.x+l.left,t.x);var u=this._lastBoundingBoxSize.width;s=t.x-c,(r=2*c)>u&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.x-u/2)}return{top:o,left:s,bottom:n,right:a,width:r,height:i}},t.prototype._setBoundingBoxStyles=function(t,e){var i=this._calculateBoundingBoxRect(t,e);this._isInitialRender||this._growAfterOpen||(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));var o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{var r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;o.height=n.coerceCssPixelValue(i.height),o.top=n.coerceCssPixelValue(i.top),o.bottom=n.coerceCssPixelValue(i.bottom),o.width=n.coerceCssPixelValue(i.width),o.left=n.coerceCssPixelValue(i.left),o.right=n.coerceCssPixelValue(i.right),o.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",o.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",r&&(o.maxHeight=n.coerceCssPixelValue(r)),s&&(o.maxWidth=n.coerceCssPixelValue(s))}this._lastBoundingBoxSize=i,M(this._boundingBox.style,o)},t.prototype._resetBoundingBoxStyles=function(){M(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})},t.prototype._resetOverlayElementStyles=function(){M(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})},t.prototype._setOverlayElementStyles=function(t,e){var i={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(o){var a=this._viewportRuler.getViewportScrollPosition();M(i,this._getExactOverlayY(e,t,a)),M(i,this._getExactOverlayX(e,t,a))}else i.position="static";var l="",h=this._getOffset(e,"x"),c=this._getOffset(e,"y");h&&(l+="translateX("+h+"px) "),c&&(l+="translateY("+c+"px)"),i.transform=l.trim(),s.maxHeight&&(o?i.maxHeight=n.coerceCssPixelValue(s.maxHeight):r&&(i.maxHeight="")),s.maxWidth&&(o?i.maxWidth=n.coerceCssPixelValue(s.maxWidth):r&&(i.maxWidth="")),M(this._pane.style,i)},t.prototype._getExactOverlayY=function(t,e,i){var o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));var s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?o.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":o.top=n.coerceCssPixelValue(r.y),o},t.prototype._getExactOverlayX=function(t,e,i){var o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),"right"==(this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left")?o.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":o.left=n.coerceCssPixelValue(r.x),o},t.prototype._getScrollVisibility=function(){var t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map((function(t){return t.getElementRef().nativeElement.getBoundingClientRect()}));return{isOriginClipped:m(t,i),isOriginOutsideView:v(t,i),isOverlayClipped:m(e,i),isOverlayOutsideView:v(e,i)}},t.prototype._subtractOverflows=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(t,e){return t-Math.max(e,0)}),t)},t.prototype._getNarrowedViewportRect=function(){var t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}},t.prototype._isRtl=function(){return"rtl"===this._overlayRef.getDirection()},t.prototype._hasExactPosition=function(){return!this._hasFlexibleDimensions||this._isPushed},t.prototype._getOffset=function(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY},t.prototype._validatePositions=function(){},t.prototype._addPanelClasses=function(t){var e=this;this._pane&&n.coerceArray(t).forEach((function(t){""!==t&&-1===e._appliedPanelClasses.indexOf(t)&&(e._appliedPanelClasses.push(t),e._pane.classList.add(t))}))},t.prototype._clearPanelClasses=function(){var t=this;this._pane&&(this._appliedPanelClasses.forEach((function(e){t._pane.classList.remove(e)})),this._appliedPanelClasses=[])},t.prototype._getOriginRect=function(){var t=this._origin;if(t instanceof o.ElementRef)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();var e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}},t}();function M(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function L(t){if("number"!=typeof t&&null!=t){var e=function i(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var o,n,r=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return s}(t.split(I),2),o=e[1];return o&&"px"!==o?null:parseFloat(e[0])}return t||null}function A(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var V=function(){function t(t,e,i,o,n,r,s){this._preferredPositions=[],this._positionStrategy=new B(i,o,n,r,s).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}return Object.defineProperty(t.prototype,"positions",{get:function(){return this._preferredPositions},enumerable:!1,configurable:!0}),t.prototype.attach=function(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)},t.prototype.dispose=function(){this._positionStrategy.dispose()},t.prototype.detach=function(){this._positionStrategy.detach()},t.prototype.apply=function(){this._positionStrategy.apply()},t.prototype.recalculateLastPosition=function(){this._positionStrategy.reapplyLastPosition()},t.prototype.withScrollableContainers=function(t){this._positionStrategy.withScrollableContainers(t)},t.prototype.withFallbackPosition=function(t,e,i,o){var n=new S(t,e,i,o);return this._preferredPositions.push(n),this._positionStrategy.withPositions(this._preferredPositions),this},t.prototype.withDirection=function(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this},t.prototype.withOffsetX=function(t){return this._positionStrategy.withDefaultOffsetX(t),this},t.prototype.withOffsetY=function(t){return this._positionStrategy.withDefaultOffsetY(t),this},t.prototype.withLockedPosition=function(t){return this._positionStrategy.withLockedPosition(t),this},t.prototype.withPositions=function(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this},t.prototype.setOrigin=function(t){return this._positionStrategy.setOrigin(t),this},t}(),Y=function(){function t(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}return t.prototype.attach=function(t){var e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add("cdk-global-overlay-wrapper"),this._isDisposed=!1},t.prototype.top=function(t){return void 0===t&&(t=""),this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this},t.prototype.left=function(t){return void 0===t&&(t=""),this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this},t.prototype.bottom=function(t){return void 0===t&&(t=""),this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this},t.prototype.right=function(t){return void 0===t&&(t=""),this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this},t.prototype.width=function(t){return void 0===t&&(t=""),this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this},t.prototype.height=function(t){return void 0===t&&(t=""),this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this},t.prototype.centerHorizontally=function(t){return void 0===t&&(t=""),this.left(t),this._justifyContent="center",this},t.prototype.centerVertically=function(t){return void 0===t&&(t=""),this.top(t),this._alignItems="center",this},t.prototype.apply=function(){if(this._overlayRef&&this._overlayRef.hasAttached()){var t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),o=i.width,n=i.height,r=i.maxWidth,s=i.maxHeight,a=!("100%"!==o&&"100vw"!==o||r&&"100%"!==r&&"100vw"!==r),l=!("100%"!==n&&"100vh"!==n||s&&"100%"!==s&&"100vh"!==s);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=this._rightOffset,a?e.justifyContent="flex-start":"center"===this._justifyContent?e.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?e.justifyContent="flex-end":"flex-end"===this._justifyContent&&(e.justifyContent="flex-start"):e.justifyContent=this._justifyContent,e.alignItems=l?"flex-start":this._alignItems}},t.prototype.dispose=function(){if(!this._isDisposed&&this._overlayRef){var t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove("cdk-global-overlay-wrapper"),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},t}(),X=function(){function t(t,e,i,o){this._viewportRuler=t,this._document=e,this._platform=i,this._overlayContainer=o}return t.prototype.global=function(){return new Y},t.prototype.connectedTo=function(t,e,i){return new V(e,i,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)},t.prototype.flexibleConnectedTo=function(t){return new B(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)},t}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/Xprov=o.ɵɵdefineInjectable({factory:function t(){return new X(o.ɵɵinject(e.ViewportRuler),o.ɵɵinject(i.DOCUMENT),o.ɵɵinject(r.Platform),o.ɵɵinject(j))},token:X,providedIn:"root"}),X.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],X.ctorParameters=function(){return[{type:e.ViewportRuler},{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:r.Platform},{type:j}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var F=0,H=function(){function t(t,e,i,o,n,r,s,a,l,h,c){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=i,this._positionBuilder=o,this._keyboardDispatcher=n,this._injector=r,this._ngZone=s,this._document=a,this._directionality=l,this._location=h,this._outsideClickDispatcher=c}return t.prototype.create=function(t){var e=this._createHostElement(),i=this._createPaneElement(e),o=this._createPortalOutlet(i),n=new O(t);return n.direction=n.direction||this._directionality.value,new D(o,e,i,n,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)},t.prototype.position=function(){return this._positionBuilder},t.prototype._createPaneElement=function(t){var e=this._document.createElement("div");return e.id="cdk-overlay-"+F++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e},t.prototype._createHostElement=function(){var t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t},t.prototype._createPortalOutlet=function(t){return this._appRef||(this._appRef=this._injector.get(o.ApplicationRef)),new a.DomPortalOutlet(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)},t}();H.decorators=[{type:o.Injectable}],H.ctorParameters=function(){return[{type:b},{type:j},{type:o.ComponentFactoryResolver},{type:X},{type:x},{type:o.Injector},{type:o.NgZone},{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:s.Directionality},{type:i.Location},{type:E}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var T,N=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],W=new o.InjectionToken("cdk-connected-overlay-scroll-strategy");(T=function T(t){this.elementRef=t}).decorators=[{type:o.Directive,args:[{selector:"[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",exportAs:"cdkOverlayOrigin"}]}],T.ctorParameters=function(){return[{type:o.ElementRef}]};var z=function(){function t(t,e,i,n,r){this._overlay=t,this._dir=r,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=l.Subscription.EMPTY,this._attachSubscription=l.Subscription.EMPTY,this._detachSubscription=l.Subscription.EMPTY,this._positionSubscription=l.Subscription.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new o.EventEmitter,this.positionChange=new o.EventEmitter,this.attach=new o.EventEmitter,this.detach=new o.EventEmitter,this.overlayKeydown=new o.EventEmitter,this.overlayOutsideClick=new o.EventEmitter,this._templatePortal=new a.TemplatePortal(e,i),this._scrollStrategyFactory=n,this.scrollStrategy=this._scrollStrategyFactory()}return Object.defineProperty(t.prototype,"offsetX",{get:function(){return this._offsetX},set:function(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this._offsetY},set:function(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasBackdrop",{get:function(){return this._hasBackdrop},set:function(t){this._hasBackdrop=n.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lockPosition",{get:function(){return this._lockPosition},set:function(t){this._lockPosition=n.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flexibleDimensions",{get:function(){return this._flexibleDimensions},set:function(t){this._flexibleDimensions=n.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"growAfterOpen",{get:function(){return this._growAfterOpen},set:function(t){this._growAfterOpen=n.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"push",{get:function(){return this._push},set:function(t){this._push=n.coerceBooleanProperty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayRef",{get:function(){return this._overlayRef},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this._dir?this._dir.value:"ltr"},enumerable:!1,configurable:!0}),t.prototype.ngOnDestroy=function(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()},t.prototype.ngOnChanges=function(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())},t.prototype._createOverlay=function(){var t=this;this.positions&&this.positions.length||(this.positions=N);var e=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=e.attachments().subscribe((function(){return t.attach.emit()})),this._detachSubscription=e.detachments().subscribe((function(){return t.detach.emit()})),e.keydownEvents().subscribe((function(e){t.overlayKeydown.next(e),e.keyCode!==c.ESCAPE||t.disableClose||c.hasModifierKey(e)||(e.preventDefault(),t._detachOverlay())})),this._overlayRef.outsidePointerEvents().subscribe((function(e){t.overlayOutsideClick.next(e)}))},t.prototype._buildConfig=function(){var t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new O({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e},t.prototype._updatePositionStrategy=function(t){var e=this,i=this.positions.map((function(t){return{originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||e.offsetX,offsetY:t.offsetY||e.offsetY,panelClass:t.panelClass||void 0}}));return t.setOrigin(this.origin.elementRef).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)},t.prototype._createPositionStrategy=function(){var t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t},t.prototype._attachOverlay=function(){var t=this;this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe((function(e){t.backdropClick.emit(e)})):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(h.takeWhile((function(){return t.positionChange.observers.length>0}))).subscribe((function(e){t.positionChange.emit(e),0===t.positionChange.observers.length&&t._positionSubscription.unsubscribe()})))},t.prototype._detachOverlay=function(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()},t}();function Z(t){return function(){return t.scrollStrategies.reposition()}}z.decorators=[{type:o.Directive,args:[{selector:"[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",exportAs:"cdkConnectedOverlay"}]}],z.ctorParameters=function(){return[{type:H},{type:o.TemplateRef},{type:o.ViewContainerRef},{type:void 0,decorators:[{type:o.Inject,args:[W]}]},{type:s.Directionality,decorators:[{type:o.Optional}]}]},z.propDecorators={origin:[{type:o.Input,args:["cdkConnectedOverlayOrigin"]}],positions:[{type:o.Input,args:["cdkConnectedOverlayPositions"]}],positionStrategy:[{type:o.Input,args:["cdkConnectedOverlayPositionStrategy"]}],offsetX:[{type:o.Input,args:["cdkConnectedOverlayOffsetX"]}],offsetY:[{type:o.Input,args:["cdkConnectedOverlayOffsetY"]}],width:[{type:o.Input,args:["cdkConnectedOverlayWidth"]}],height:[{type:o.Input,args:["cdkConnectedOverlayHeight"]}],minWidth:[{type:o.Input,args:["cdkConnectedOverlayMinWidth"]}],minHeight:[{type:o.Input,args:["cdkConnectedOverlayMinHeight"]}],backdropClass:[{type:o.Input,args:["cdkConnectedOverlayBackdropClass"]}],panelClass:[{type:o.Input,args:["cdkConnectedOverlayPanelClass"]}],viewportMargin:[{type:o.Input,args:["cdkConnectedOverlayViewportMargin"]}],scrollStrategy:[{type:o.Input,args:["cdkConnectedOverlayScrollStrategy"]}],open:[{type:o.Input,args:["cdkConnectedOverlayOpen"]}],disableClose:[{type:o.Input,args:["cdkConnectedOverlayDisableClose"]}],transformOriginSelector:[{type:o.Input,args:["cdkConnectedOverlayTransformOriginOn"]}],hasBackdrop:[{type:o.Input,args:["cdkConnectedOverlayHasBackdrop"]}],lockPosition:[{type:o.Input,args:["cdkConnectedOverlayLockPosition"]}],flexibleDimensions:[{type:o.Input,args:["cdkConnectedOverlayFlexibleDimensions"]}],growAfterOpen:[{type:o.Input,args:["cdkConnectedOverlayGrowAfterOpen"]}],push:[{type:o.Input,args:["cdkConnectedOverlayPush"]}],backdropClick:[{type:o.Output}],positionChange:[{type:o.Output}],attach:[{type:o.Output}],detach:[{type:o.Output}],overlayKeydown:[{type:o.Output}],overlayOutsideClick:[{type:o.Output}]};var U,q={provide:W,deps:[H],useFactory:Z};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(U=function U(){}).decorators=[{type:o.NgModule,args:[{imports:[s.BidiModule,a.PortalModule,e.ScrollingModule],exports:[z,T,e.ScrollingModule],declarations:[z,T],providers:[H,q]}]}];
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var K=function(t){function e(e,i){return t.call(this,e,i)||this}return u(e,t),e.prototype.ngOnDestroy=function(){t.prototype.ngOnDestroy.call(this),this._fullScreenEventName&&this._fullScreenListener&&this._document.removeEventListener(this._fullScreenEventName,this._fullScreenListener)},e.prototype._createContainer=function(){var e=this;t.prototype._createContainer.call(this),this._adjustParentForFullscreenChange(),this._addFullscreenChangeListener((function(){return e._adjustParentForFullscreenChange()}))},e.prototype._adjustParentForFullscreenChange=function(){this._containerElement&&(this.getFullscreenElement()||this._document.body).appendChild(this._containerElement)},e.prototype._addFullscreenChangeListener=function(t){var e=this._getEventName();e&&(this._fullScreenListener&&this._document.removeEventListener(e,this._fullScreenListener),this._document.addEventListener(e,t),this._fullScreenListener=t)},e.prototype._getEventName=function(){if(!this._fullScreenEventName){var t=this._document;t.fullscreenEnabled?this._fullScreenEventName="fullscreenchange":t.webkitFullscreenEnabled?this._fullScreenEventName="webkitfullscreenchange":t.mozFullScreenEnabled?this._fullScreenEventName="mozfullscreenchange":t.msFullscreenEnabled&&(this._fullScreenEventName="MSFullscreenChange")}return this._fullScreenEventName},e.prototype.getFullscreenElement=function(){var t=this._document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||null},e}(j);Kprov=o.ɵɵdefineInjectable({factory:function t(){return new K(o.ɵɵinject(i.DOCUMENT),o.ɵɵinject(r.Platform))},token:K,providedIn:"root"}),K.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],K.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:r.Platform}]},
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
Object.defineProperty(t,"CdkScrollable",{enumerable:!0,get:function(){return e.CdkScrollable}}),Object.defineProperty(t,"ScrollDispatcher",{enumerable:!0,get:function(){return e.ScrollDispatcher}}),Object.defineProperty(t,"ViewportRuler",{enumerable:!0,get:function(){return e.ViewportRuler}}),t.BlockScrollStrategy=f,t.CdkConnectedOverlay=z,t.CdkOverlayOrigin=T,t.CloseScrollStrategy=y,t.ConnectedOverlayPositionChange=C,t.ConnectedPositionStrategy=V,t.ConnectionPositionPair=S,t.FlexibleConnectedPositionStrategy=B,t.FullscreenOverlayContainer=K,t.GlobalPositionStrategy=Y,t.NoopScrollStrategy=g,t.Overlay=H,t.OverlayConfig=O,t.OverlayContainer=j,t.OverlayKeyboardDispatcher=x,t.OverlayModule=U,t.OverlayOutsideClickDispatcher=E,t.OverlayPositionBuilder=X,t.OverlayRef=D,t.RepositionScrollStrategy=w,t.ScrollStrategyOptions=b,t.ScrollingVisibility=k,t.validateHorizontalPosition=function G(t,e){if("start"!==e&&"end"!==e&&"center"!==e)throw Error("ConnectedPosition: Invalid "+t+' "'+e+'". Expected "start", "end" or "center".')},t.validateVerticalPosition=function $(t,e){if("top"!==e&&"bottom"!==e&&"center"!==e)throw Error("ConnectedPosition: Invalid "+t+' "'+e+'". Expected "top", "bottom" or "center".')},tangular_material_src_cdk_overlay_overlay_a=W,tangular_material_src_cdk_overlay_overlay_b=Z,tangular_material_src_cdk_overlay_overlay_c=q,tangular_material_src_cdk_overlay_overlay_d=P,Object.defineProperty(t,"__esModule",{value:!0})}));