System.register(["@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/platform","@angular/cdk/portal","@angular/common","@angular/core","@angular/cdk/keycodes","rxjs","@angular/cdk/bidi","rxjs/operators"],(function(e){"use strict";var t,i,o,n,s,a,r,l,c,h,d,u,p,f,_,g,v,y,m,C,b,D,O,A,k,I;return{setters:[function(e){t=e,i=e.A11yModule},function(e){o=e,n=e.OverlayConfig,s=e.OverlayModule,a=e.Overlay,r=e.OverlayRef},function(e){l=e._getFocusedElementPierceShadowDom},function(e){c=e.BasePortalOutlet,h=e.CdkPortalOutlet,d=e,u=e.ComponentPortal,p=e.TemplatePortal,f=e.PortalModule},function(e){_=e.DOCUMENT},function(e){g=e,e.Component,e.ViewEncapsulation,e.ChangeDetectionStrategy,e.Optional,e.Inject,e.ViewChild,v=e.InjectionToken,y=e.Injector,m=e.TemplateRef,e.Injectable,e.SkipSelf,e.NgModule},function(e){C=e.ESCAPE,b=e.hasModifierKey},function(e){D=e.Subject,O=e.defer,A=e.of},function(e){k=e.Directionality},function(e){I=e.startWith}],execute:function(){function T(e,t){}e({DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY:P,throwDialogContentAlreadyAttachedError:F});class R{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.ariaModal=!0,this.autoFocus="first-tabbable",this.restoreFocus=!0,this.closeOnNavigation=!0,this.closeOnDestroy=!0,this.closeOnOverlayDetachments=!0}}function F(){throw Error("Attempting to attach dialog content after content is already attached")}e("DialogConfig",R);class E extends c{constructor(e,t,i,o,n,s,a,r){super(),this._elementRef=e,this._focusTrapFactory=t,this._config=o,this._interactivityChecker=n,this._ngZone=s,this._overlayRef=a,this._focusMonitor=r,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this._ariaLabelledByQueue=[],this.attachDomPortal=e=>{this._portalOutlet.hasAttached();const t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t},this._document=i,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_contentAttached(){this._initializeFocusTrap(),this._handleBackdropClicks(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();const t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();const t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular((()=>{const t=()=>{e.removeEventListener("blur",t),e.removeEventListener("mousedown",t),e.removeAttribute("tabindex")};e.addEventListener("blur",t),e.addEventListener("mousedown",t)}))),e.focus(t)}_focusByCssSelector(e,t){let i=this._elementRef.nativeElement.querySelector(e);i&&this._forceFocus(i,t)}_trapFocus(){const e=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||e.focus();break;case!0:case"first-tabbable":this._focusTrap.focusInitialElementWhenReady().then((e=>{e||this._focusDialogContainer()}));break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this._config.autoFocus)}}_restoreFocus(){const e=this._config.restoreFocus;let t=null;if("string"==typeof e?t=this._document.querySelector(e):"boolean"==typeof e?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=l(),i=this._elementRef.nativeElement;e&&e!==this._document.body&&e!==i&&!i.contains(e)||(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const e=this._elementRef.nativeElement,t=l();return e===t||e.contains(t)}_initializeFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=l())}_handleBackdropClicks(){this._overlayRef.backdropClick().subscribe((()=>{this._config.disableClose&&this._recaptureFocus()}))}static{this.\u0275fac=function(e){return new(e||E)(g.\u0275\u0275directiveInject(g.ElementRef),g.\u0275\u0275directiveInject(t.FocusTrapFactory),g.\u0275\u0275directiveInject(_,8),g.\u0275\u0275directiveInject(R),g.\u0275\u0275directiveInject(t.InteractivityChecker),g.\u0275\u0275directiveInject(g.NgZone),g.\u0275\u0275directiveInject(o.OverlayRef),g.\u0275\u0275directiveInject(t.FocusMonitor))}}static{this.\u0275cmp=g.\u0275\u0275defineComponent({type:E,selectors:[["cdk-dialog-container"]],viewQuery:function(e,t){if(1&e&&g.\u0275\u0275viewQuery(h,7),2&e){let e;g.\u0275\u0275queryRefresh(e=g.\u0275\u0275loadQuery())&&(t._portalOutlet=e.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(e,t){2&e&&g.\u0275\u0275attribute("id",t._config.id||null)("role",t._config.role)("aria-modal",t._config.ariaModal)("aria-labelledby",t._config.ariaLabel?null:t._ariaLabelledByQueue[0])("aria-label",t._config.ariaLabel)("aria-describedby",t._config.ariaDescribedBy||null)},features:[g.\u0275\u0275InheritDefinitionFeature],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,t){1&e&&g.\u0275\u0275template(0,T,0,0,"ng-template",0)},dependencies:[d.CdkPortalOutlet],styles:[".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"],encapsulation:2})}}e("CdkDialogContainer",E);class w{constructor(e,t){this.overlayRef=e,this.config=t,this.closed=new D,this.disableClose=t.disableClose,this.backdropClick=e.backdropClick(),this.keydownEvents=e.keydownEvents(),this.outsidePointerEvents=e.outsidePointerEvents(),this.id=t.id,this.keydownEvents.subscribe((e=>{e.keyCode!==C||this.disableClose||b(e)||(e.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))})),this.backdropClick.subscribe((()=>{this.disableClose||this.close(void 0,{focusOrigin:"mouse"})})),this._detachSubscription=e.detachments().subscribe((()=>{!1!==t.closeOnOverlayDetachments&&this.close()}))}close(e,t){if(this.containerInstance){const i=this.closed;this.containerInstance._closeInteractionType=t?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(e),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(e="",t=""){return this.overlayRef.updateSize({width:e,height:t}),this}addPanelClass(e){return this.overlayRef.addPanelClass(e),this}removePanelClass(e){return this.overlayRef.removePanelClass(e),this}}e("DialogRef",w);const L=e("DIALOG_SCROLL_STRATEGY",new v("DialogScrollStrategy")),j=e("DIALOG_DATA",new v("DialogData")),S=e("DEFAULT_DIALOG_CONFIG",new v("DefaultDialogConfig"));function P(e){return()=>e.scrollStrategies.block()}const B=e("DIALOG_SCROLL_STRATEGY_PROVIDER",{provide:L,deps:[a],useFactory:P});let x=0;class M{get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}constructor(e,t,i,o,n,s){this._overlay=e,this._injector=t,this._defaultOptions=i,this._parentDialog=o,this._overlayContainer=n,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new D,this._afterOpenedAtThisLevel=new D,this._ariaHiddenElements=new Map,this.afterAllClosed=O((()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(I(void 0)))),this._scrollStrategy=s}open(e,t){(t={...this._defaultOptions||new R,...t}).id=t.id||"cdk-dialog-"+x++,t.id&&this.getDialogById(t.id);const i=this._getOverlayConfig(t),o=this._overlay.create(i),n=new w(o,t),s=this._attachContainer(o,n,t);return n.containerInstance=s,this._attachDialogContent(e,n,s,t),this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(n),n.closed.subscribe((()=>this._removeOpenDialog(n,!0))),this.afterOpened.next(n),n}closeAll(){V(this.openDialogs,(e=>e.close()))}getDialogById(e){return this.openDialogs.find((t=>t.id===e))}ngOnDestroy(){V(this._openDialogsAtThisLevel,(e=>{!1===e.config.closeOnDestroy&&this._removeOpenDialog(e,!1)})),V(this._openDialogsAtThisLevel,(e=>e.close())),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){const t=new n({positionStrategy:e.positionStrategy||this._overlay.position().global().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,i){const o=i.injector||i.viewContainerRef?.injector,n=[{provide:R,useValue:i},{provide:w,useValue:t},{provide:r,useValue:e}];let s;i.container?"function"==typeof i.container?s=i.container:(s=i.container.type,n.push(...i.container.providers(i))):s=E;const a=new u(s,i.viewContainerRef,y.create({parent:o||this._injector,providers:n}),i.componentFactoryResolver);return e.attach(a).instance}_attachDialogContent(e,t,i,o){if(e instanceof m){const n=this._createInjector(o,t,i,void 0);let s={$implicit:o.data,dialogRef:t};o.templateContext&&(s={...s,..."function"==typeof o.templateContext?o.templateContext():o.templateContext}),i.attachTemplatePortal(new p(e,null,s,n))}else{const n=this._createInjector(o,t,i,this._injector),s=i.attachComponentPortal(new u(e,o.viewContainerRef,n,o.componentFactoryResolver));t.componentRef=s,t.componentInstance=s.instance}}_createInjector(e,t,i,o){const n=e.injector||e.viewContainerRef?.injector,s=[{provide:j,useValue:e.data},{provide:w,useValue:t}];return e.providers&&("function"==typeof e.providers?s.push(...e.providers(t,e,i)):s.push(...e.providers)),!e.direction||n&&n.get(k,null,{optional:!0})||s.push({provide:k,useValue:{value:e.direction,change:A()}}),y.create({parent:n||o,providers:s})}_removeOpenDialog(e,t){const i=this.openDialogs.indexOf(e);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach(((e,t)=>{e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")})),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const e=this._overlayContainer.getContainerElement();if(e.parentElement){const t=e.parentElement.children;for(let i=t.length-1;i>-1;i--){const o=t[i];o===e||"SCRIPT"===o.nodeName||"STYLE"===o.nodeName||o.hasAttribute("aria-live")||(this._ariaHiddenElements.set(o,o.getAttribute("aria-hidden")),o.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){const e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static{this.\u0275fac=function(e){return new(e||M)(g.\u0275\u0275inject(o.Overlay),g.\u0275\u0275inject(g.Injector),g.\u0275\u0275inject(S,8),g.\u0275\u0275inject(M,12),g.\u0275\u0275inject(o.OverlayContainer),g.\u0275\u0275inject(L))}}static{this.\u0275prov=g.\u0275\u0275defineInjectable({token:M,factory:M.\u0275fac})}}function V(e,t){let i=e.length;for(;i--;)t(e[i])}e("Dialog",M);class N{static{this.\u0275fac=function(e){return new(e||N)}}static{this.\u0275mod=g.\u0275\u0275defineNgModule({type:N})}static{this.\u0275inj=g.\u0275\u0275defineInjector({providers:[M,B],imports:[s,f,i,f]})}}e("DialogModule",N)}}}));