angular-docs-cn/aio/dist/default~code-code-example-m...

2 lines
54 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+rOU":function(t,e,i){"use strict";i.d(e,"a",function(){return c}),i.d(e,"b",function(){return d}),i.d(e,"c",function(){return _}),i.d(e,"d",function(){return r}),i.d(e,"e",function(){return l}),i.d(e,"f",function(){return p}),i.d(e,"g",function(){return a});var s=i("fXoL"),n=i("ofXK");class o{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class r extends o{constructor(t,e,i,s){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.componentFactoryResolver=s}}class a extends o{constructor(t,e,i){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class h extends o{constructor(t){super(),this.element=t instanceof s.l?t.nativeElement:t}}class c{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof r?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof a?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof h?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class l extends c{constructor(t,e,i,s,n){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=i,this._defaultInjector=s,this.attachDomPortal=t=>{const e=t.element,i=this._document.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})},this._document=n}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let i;return t.viewContainerRef?(i=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>i.destroy())):(i=e.create(t.injector||this._defaultInjector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(i)),i}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context);return i.rootNodes.forEach(t=>this.outletElement.appendChild(t)),i.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(i);-1!==t&&e.remove(t)}),i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let d=(()=>{class t extends a{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(s.Ob(s.N),s.Ob(s.R))},t.\u0275dir=s.Jb({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[s.zb]}),t})(),_=(()=>{class t extends c{constructor(t,e,i){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new s.n,this.attachDomPortal=t=>{const e=t.element,i=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(i,e),this._getRootNode().appendChild(e),super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})},this._document=i}get portal(){return this._attachedPortal}set portal(t){(!this.hasAttached()||t||this._isInitialized)&&(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,i=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),s=e.createComponent(i,e.length,t.injector||e.injector);return e!==this._viewContainerRef&&this._getRootNode().appendChild(s.hostView.rootNodes[0]),super.setDisposeFn(()=>s.destroy()),this._attachedPortal=t,this._attachedRef=s,this.attached.emit(s),s}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return t.\u0275fac=function(e){return new(e||t)(s.Ob(s.j),s.Ob(s.R),s.Ob(n.d))},t.\u0275dir=s.Jb({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[s.zb]}),t})(),p=(()=>{class t{}return t.\u0275mod=s.Mb({type:t}),t.\u0275inj=s.Lb({factory:function(e){return new(e||t)}}),t})()},"6CTB":function(t,e,i){"use strict";i.d(e,"a",function(){return p});var s=i("fXoL"),n=i("vkgz"),o=i("dNgK"),r=i("vVVL"),a=i("ofXK");class h{constructor(t,e){this._document=e;const i=this._textarea=this._document.createElement("textarea"),s=i.style;s.position="fixed",s.top=s.opacity="0",s.left="-999em",i.setAttribute("aria-hidden","true"),i.value=t,this._document.body.appendChild(i)}copy(){const t=this._textarea;let e=!1;try{if(t){const i=this._document.activeElement;t.select(),t.setSelectionRange(0,t.value.length),e=this._document.execCommand("copy"),i&&i.focus()}}catch(i){}return e}destroy(){const t=this._textarea;t&&(t.parentNode&&t.parentNode.removeChild(t),this._textarea=void 0)}}let c=(()=>{class t{constructor(t){this._document=t}copy(t){const e=this.beginCopy(t),i=e.copy();return e.destroy(),i}beginCopy(t){return new h(t,this._document)}}return t.\u0275fac=function(e){return new(e||t)(s.Xb(a.d))},t.\u0275prov=Object(s.Kb)({factory:function(){return new t(Object(s.Xb)(a.d))},token:t,providedIn:"root"}),t})();var l=i("vHPH");const d=["codeContainer"];function _(t,e){if(1&t){const t=s.Ub();s.Tb(0,"button",3),s.ac("click",function(){return s.sc(t),s.ec().doCopy()}),s.Ac(1,"\n "),s.Tb(2,"span",4),s.Ac(3,"content_copy"),s.Sb(),s.Ac(4,"\n "),s.Sb()}if(2&t){const t=s.ec();s.Db("aria-label",t.ariaLabel)}}let p=(()=>{class t{constructor(t,e,i,n){this.snackbar=t,this.pretty=e,this.clipboard=i,this.logger=n,this.ariaLabel="",this.codeFormatted=new s.n}set code(t){this._code=t,this._code&&this._code.trim()?this.formatDisplayedCode():this.showMissingCodeMessage()}get code(){return this._code}set header(t){this._header=t,this.ariaLabel=this.header?"Copy code snippet from "+this.header:""}get header(){return this._header}ngOnChanges(){this.code&&this.formatDisplayedCode()}formatDisplayedCode(){const t=function(t){let e=Number.MAX_VALUE;const i=t.split("\n");return i.forEach(t=>{const i=t.search(/\S/);-1!==i&&(e=Math.min(i,e))}),i.map(t=>t.substr(e)).join("\n").trim()}(this.code);this.setCodeHtml(t),this.codeText=this.getCodeText(),this.pretty.formatCode(t,this.language,this.getLinenums()).pipe(Object(n.a)(()=>this.codeFormatted.emit())).subscribe(t=>this.setCodeHtml(t),()=>{})}showMissingCodeMessage(){const t=this.path?this.path+(this.region?"#"+this.region:""):"";this.setCodeHtml(`<p class="code-missing">The code sample is missing${t?" for\n"+t:"."}</p>`)}setCodeHtml(t){this.codeContainer.nativeElement.innerHTML=t}getCodeText(){return this.codeContainer.nativeElement.textContent}doCopy(){const t=this.codeText;this.clipboard.copy(t)?(this.logger.log("Copied code to clipboard:",t),this.snackbar.open("Code Copied","",{duration:800})):(this.logger.error(new Error(`ERROR copying code to clipboard: "${t}"`)),this.snackbar.open("Copy failed. Please try again!","",{duration:800}))}getLinenums(){const t="boolean"==typeof this.linenums?this.linenums:"true"===this.linenums||"false"!==this.linenums&&("string"==typeof this.linenums?parseInt(this.linenums,10):this.linenums);return null!=t&&!isNaN(t)&&t}}return t.\u0275fac=function(e){return new(e||t)(s.Ob(o.a),s.Ob(r.a),s.Ob(c),s.Ob(l.a))},t.\u0275cmp=s.Ib({type:t,selectors:[["aio-code"]],viewQuery:function(t,e){if(1&t&&s.Ec(d,3),2&t){let t;s.oc(t=s.bc())&&(e.codeContainer=t.first)}},inputs:{hideCopy:"hideCopy",language:"language",linenums:"linenums",path:"path",region:"region",header:"header"},outputs:{codeFormatted:"codeFormatted"},features:[s.Ab],decls:7,vars:4,consts:[["class","material-icons copy-button no-print","title","Copy code snippet",3,"click",4,"ngIf"],[1,"animated","fadeIn"],["codeContainer",""],["title","Copy code snippet",1,"material-icons","copy-button","no-print",3,"click"],["aria-hidden","true"]],template:function(t,e){1&t&&(s.Tb(0,"pre"),s.Ac(1," "),s.zc(2,_,5,1,"button",0),s.Ac(3,"\n "),s.Pb(4,"code",1,2),s.Ac(6,"\n "),s.Sb()),2&t&&(s.Fb("prettyprint lang-",e.language,""),s.Cb(2),s.jc("ngIf",!e.hideCopy))},directives:[a.k],encapsulation:2}),t})()},V90o:function(t,e,i){"use strict";i.d(e,"a",function(){return a});var s=i("ofXK"),n=i("dNgK"),o=i("vVVL"),r=i("fXoL");let a=(()=>{class t{}return t.\u0275mod=r.Mb({type:t}),t.\u0275inj=r.Lb({factory:function(e){return new(e||t)},providers:[o.a],imports:[[s.c,n.b]]}),t})()},dNgK:function(t,e,i){"use strict";i.d(e,"a",function(){return vt}),i.d(e,"b",function(){return bt});var s=i("vxfF"),n=i("fXoL"),o=i("nLfN"),r=i("cH1L"),a=i("ofXK"),h=i("8LU1"),c=i("+rOU"),l=i("XNiG"),d=i("quSY"),_=i("VRyK"),p=i("IzEk"),u=i("1G5W"),f=i("7o/Q");i("FtGj");const m=Object(o.f)();class g{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=Object(h.c)(-this._previousScrollPosition.left),t.style.top=Object(h.c)(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,i=this._document.body.style,s=e.scrollBehavior||"",n=i.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),m&&(e.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),m&&(e.scrollBehavior=s,i.scrollBehavior=n)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}class b{constructor(t,e,i,s){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=s,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class y{enable(){}disable(){}attach(){}}function v(t,e){return e.some(e=>t.bottom<e.top||t.top>e.bottom||t.right<e.left||t.left>e.right)}function w(t,e){return e.some(e=>t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)}class O{constructor(t,e,i,s){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=s,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:i}=this._viewportRuler.getViewportSize();v(t,[{width:e,height:i,bottom:i,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let C=(()=>{class t{constructor(t,e,i,s){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this.noop=()=>new y,this.close=t=>new b(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new g(this._viewportRuler,this._document),this.reposition=t=>new O(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=s}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(s.c),n.Xb(s.e),n.Xb(n.A),n.Xb(a.d))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(s.c),Object(n.Xb)(s.e),Object(n.Xb)(n.A),Object(n.Xb)(a.d))},token:t,providedIn:"root"}),t})();class k{constructor(t){if(this.scrollStrategy=new y,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const i of e)void 0!==t[i]&&(this[i]=t[i])}}}class x{constructor(t,e,i,s,n){this.offsetX=i,this.offsetY=s,this.panelClass=n,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}}class R{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let S=(()=>{class t{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(a.d))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(a.d))},token:t,providedIn:"root"}),t})(),P=(()=>{class t extends S{constructor(t){super(t),this._keydownListener=t=>{const e=this._attachedOverlays;for(let i=e.length-1;i>-1;i--)if(e[i]._keydownEvents.observers.length>0){e[i]._keydownEvents.next(t);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(a.d))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(a.d))},token:t,providedIn:"root"}),t})(),E=(()=>{class t extends S{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=t.composedPath?t.composedPath()[0]:t.target,i=this._attachedOverlays.slice();for(let s=i.length-1;s>-1;s--){const n=i[s];if(!(n._outsidePointerEvents.observers.length<1)&&n.hasAttached()){if(n.overlayElement.contains(e))break;n._outsidePointerEvents.next(t)}}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("click",this._clickListener,!0),this._document.body.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=this._document.body.style.cursor,this._document.body.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("click",this._clickListener,!0),this._document.body.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(a.d),n.Xb(o.a))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(a.d),Object(n.Xb)(o.a))},token:t,providedIn:"root"}),t})();const j=!("undefined"==typeof window||!window||!window.__karma__&&!window.jasmine);let B=(()=>{class t{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){if(this._platform.isBrowser||j){const t=this._document.querySelectorAll('.cdk-overlay-container[platform="server"], .cdk-overlay-container[platform="test"]');for(let e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e])}const t=this._document.createElement("div");t.classList.add("cdk-overlay-container"),j?t.setAttribute("platform","test"):this._platform.isBrowser||t.setAttribute("platform","server"),this._document.body.appendChild(t),this._containerElement=t}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(a.d),n.Xb(o.a))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(a.d),Object(n.Xb)(o.a))},token:t,providedIn:"root"}),t})();class A{constructor(t,e,i,s,n,o,r,a,h){this._portalOutlet=t,this._host=e,this._pane=i,this._config=s,this._ngZone=n,this._keyboardDispatcher=o,this._document=r,this._location=a,this._outsideClickDispatcher=h,this._backdropElement=null,this._backdropClick=new l.a,this._attachments=new l.a,this._detachments=new l.a,this._locationChanges=d.a.EMPTY,this._backdropClickHandler=t=>this._backdropClick.next(t),this._keydownEvents=new l.a,this._outsidePointerEvents=new l.a,s.scrollStrategy&&(this._scrollStrategy=s.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=s.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){let e=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(Object(p.a)(1)).subscribe(()=>{this.hasAttached()&&this.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(()=>this.dispose())),this._outsideClickDispatcher.add(this),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const 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()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Object.assign(Object.assign({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Object.assign(Object.assign({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=Object(h.c)(this._config.width),t.height=Object(h.c)(this._config.height),t.minWidth=Object(h.c)(this._config.minWidth),t.minHeight=Object(h.c)(this._config.minHeight),t.maxWidth=Object(h.c)(this._config.maxWidth),t.maxHeight=Object(h.c)(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){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(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add("cdk-overlay-backdrop-showing")})}):this._backdropElement.classList.add("cdk-overlay-backdrop-showing")}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t,e=this._backdropElement;if(!e)return;let i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(t,e,i){const s=t.classList;Object(h.a)(e).forEach(t=>{t&&(i?s.add(t):s.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(Object(u.a)(Object(_.a)(this._attachments,this._detachments))).subscribe(()=>{this._pane&&this._host&&0!==this._pane.children.length||(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}}const X=/([A-Za-z%]+)$/;class D{constructor(t,e,i,s,n){this._viewportRuler=e,this._document=i,this._platform=s,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.a,this._resizeSubscription=d.a.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){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(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const t=this._originRect,e=this._overlayRect,i=this._viewportRect,s=[];let n;for(let o of this._preferredPositions){let r=this._getOriginPoint(t,o),a=this._getOverlayPoint(r,e,o),h=this._getOverlayFit(a,e,i,o);if(h.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,r);this._canFitWithFlexibleDimensions(h,a,i)?s.push({position:o,origin:r,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(r,o)}):(!n||n.overlayFit.visibleArea<h.visibleArea)&&(n={overlayFit:h,overlayPoint:a,originPoint:r,position:o,overlayRect:e})}if(s.length){let t=null,e=-1;for(const i of s){const s=i.boundingBoxRect.width*i.boundingBoxRect.height*(i.position.weight||1);s>e&&(e=s,t=i)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(n.position,n.originPoint);this._applyPosition(n.position,n.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&L(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)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e){let i,s;if("center"==e.originX)i=t.left+t.width/2;else{const s=this._isRtl()?t.right:t.left,n=this._isRtl()?t.left:t.right;i="start"==e.originX?s:n}return s="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,{x:i,y:s}}_getOverlayPoint(t,e,i){let s,n;return s="center"==i.overlayX?-e.width/2:"start"===i.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,n="center"==i.overlayY?-e.height/2:"top"==i.overlayY?0:-e.height,{x:t.x+s,y:t.y+n}}_getOverlayFit(t,e,i,s){const n=I(e);let{x:o,y:r}=t,a=this._getOffset(s,"x"),h=this._getOffset(s,"y");a&&(o+=a),h&&(r+=h);let c=0-r,l=r+n.height-i.height,d=this._subtractOverflows(n.width,0-o,o+n.width-i.width),_=this._subtractOverflows(n.height,c,l),p=d*_;return{visibleArea:p,isCompletelyWithinViewport:n.width*n.height===p,fitsInViewportVertically:_===n.height,fitsInViewportHorizontally:d==n.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){const s=i.bottom-e.y,n=i.right-e.x,o=M(this._overlayRef.getConfig().minHeight),r=M(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportHorizontally||null!=r&&r<=n;return(t.fitsInViewportVertically||null!=o&&o<=s)&&a}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const s=I(e),n=this._viewportRect,o=Math.max(t.x+s.width-n.width,0),r=Math.max(t.y+s.height-n.height,0),a=Math.max(n.top-i.top-t.y,0),h=Math.max(n.left-i.left-t.x,0);let c=0,l=0;return c=s.width<=n.width?h||-o:t.x<this._viewportMargin?n.left-i.left-t.x:0,l=s.height<=n.height?a||-r:t.y<this._viewportMargin?n.top-i.top-t.y:0,this._previousPushAmount={x:c,y:l},{x:t.x+c,y:t.y+l}}_applyPosition(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){const e=this._getScrollVisibility(),i=new R(t,e);this._positionChanges.next(i)}this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;const e=this._boundingBox.querySelectorAll(this._transformOriginSelector);let i,s=t.overlayY;i="center"===t.overlayX?"center":this._isRtl()?"start"===t.overlayX?"right":"left":"start"===t.overlayX?"left":"right";for(let n=0;n<e.length;n++)e[n].style.transformOrigin=`${i} ${s}`}_calculateBoundingBoxRect(t,e){const i=this._viewportRect,s=this._isRtl();let n,o,r,a,h,c;if("top"===e.overlayY)o=t.y,n=i.height-o+this._viewportMargin;else if("bottom"===e.overlayY)r=i.height-t.y+2*this._viewportMargin,n=i.height-r+this._viewportMargin;else{const e=Math.min(i.bottom-t.y+i.top,t.y),s=this._lastBoundingBoxSize.height;n=2*e,o=t.y-e,n>s&&!this._isInitialRender&&!this._growAfterOpen&&(o=t.y-s/2)}if("end"===e.overlayX&&!s||"start"===e.overlayX&&s)c=i.width-t.x+this._viewportMargin,a=t.x-this._viewportMargin;else if("start"===e.overlayX&&!s||"end"===e.overlayX&&s)h=t.x,a=i.right-t.x;else{const e=Math.min(i.right-t.x+i.left,t.x),s=this._lastBoundingBoxSize.width;a=2*e,h=t.x-e,a>s&&!this._isInitialRender&&!this._growAfterOpen&&(h=t.x-s/2)}return{top:o,left:h,bottom:r,right:c,width:a,height:n}}_setBoundingBoxStyles(t,e){const 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));const s={};if(this._hasExactPosition())s.top=s.left="0",s.bottom=s.right=s.maxHeight=s.maxWidth="",s.width=s.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,n=this._overlayRef.getConfig().maxWidth;s.height=Object(h.c)(i.height),s.top=Object(h.c)(i.top),s.bottom=Object(h.c)(i.bottom),s.width=Object(h.c)(i.width),s.left=Object(h.c)(i.left),s.right=Object(h.c)(i.right),s.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",s.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",t&&(s.maxHeight=Object(h.c)(t)),n&&(s.maxWidth=Object(h.c)(n))}this._lastBoundingBoxSize=i,L(this._boundingBox.style,s)}_resetBoundingBoxStyles(){L(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){L(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const i={},s=this._hasExactPosition(),n=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(s){const s=this._viewportRuler.getViewportScrollPosition();L(i,this._getExactOverlayY(e,t,s)),L(i,this._getExactOverlayX(e,t,s))}else i.position="static";let r="",a=this._getOffset(e,"x"),c=this._getOffset(e,"y");a&&(r+=`translateX(${a}px) `),c&&(r+=`translateY(${c}px)`),i.transform=r.trim(),o.maxHeight&&(s?i.maxHeight=Object(h.c)(o.maxHeight):n&&(i.maxHeight="")),o.maxWidth&&(s?i.maxWidth=Object(h.c)(o.maxWidth):n&&(i.maxWidth="")),L(this._pane.style,i)}_getExactOverlayY(t,e,i){let s={top:"",bottom:""},n=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(n=this._pushOverlayOnScreen(n,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return n.y-=o,"bottom"===t.overlayY?s.bottom=this._document.documentElement.clientHeight-(n.y+this._overlayRect.height)+"px":s.top=Object(h.c)(n.y),s}_getExactOverlayX(t,e,i){let s,n={left:"",right:""},o=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,i)),s=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===s?n.right=this._document.documentElement.clientWidth-(o.x+this._overlayRect.width)+"px":n.left=Object(h.c)(o.x),n}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:w(t,i),isOriginOutsideView:v(t,i),isOverlayClipped:w(e,i),isOverlayOutsideView:v(e,i)}}_subtractOverflows(t,...e){return e.reduce((t,e)=>t-Math.max(e,0),t)}_getNarrowedViewportRect(){const 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}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Object(h.a)(t).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof n.l)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const 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}}}function L(t,e){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function M(t){if("number"!=typeof t&&null!=t){const[e,i]=t.split(X);return i&&"px"!==i?null:parseFloat(e)}return t||null}function I(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)}}class F{constructor(t,e,i,s,n,o,r){this._preferredPositions=[],this._positionStrategy=new D(i,s,n,o,r).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(t,e),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(t){this._overlayRef=t,this._positionStrategy.attach(t),this._direction&&(t.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(t){this._positionStrategy.withScrollableContainers(t)}withFallbackPosition(t,e,i,s){const n=new x(t,e,i,s);return this._preferredPositions.push(n),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(t){return this._overlayRef?this._overlayRef.setDirection(t):this._direction=t,this}withOffsetX(t){return this._positionStrategy.withDefaultOffsetX(t),this}withOffsetY(t){return this._positionStrategy.withDefaultOffsetY(t),this}withLockedPosition(t){return this._positionStrategy.withLockedPosition(t),this}withPositions(t){return this._preferredPositions=t.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(t){return this._positionStrategy.setOrigin(t),this}}class H{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(t){const 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}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._rightOffset="",this._leftOffset=t,this._justifyContent="flex-start",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._leftOffset="",this._rightOffset=t,this._justifyContent="flex-end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._justifyContent="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:s,height:n,maxWidth:o,maxHeight:r}=i,a=!("100%"!==s&&"100vw"!==s||o&&"100%"!==o&&"100vw"!==o),h=!("100%"!==n&&"100vh"!==n||r&&"100%"!==r&&"100vh"!==r);t.position=this._cssPosition,t.marginLeft=a?"0":this._leftOffset,t.marginTop=h?"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=h?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const 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}}let T=(()=>{class t{constructor(t,e,i,s){this._viewportRuler=t,this._document=e,this._platform=i,this._overlayContainer=s}global(){return new H}connectedTo(t,e,i){return new F(e,i,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new D(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(s.e),n.Xb(a.d),n.Xb(o.a),n.Xb(B))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(s.e),Object(n.Xb)(a.d),Object(n.Xb)(o.a),Object(n.Xb)(B))},token:t,providedIn:"root"}),t})(),V=0,N=(()=>{class t{constructor(t,e,i,s,n,o,r,a,h,c,l){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=i,this._positionBuilder=s,this._keyboardDispatcher=n,this._injector=o,this._ngZone=r,this._document=a,this._directionality=h,this._location=c,this._outsideClickDispatcher=l}create(t){const e=this._createHostElement(),i=this._createPaneElement(e),s=this._createPortalOutlet(i),n=new k(t);return n.direction=n.direction||this._directionality.value,new A(s,e,i,n,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+V++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(n.g)),new c.e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(C),n.Xb(B),n.Xb(n.j),n.Xb(T),n.Xb(P),n.Xb(n.s),n.Xb(n.A),n.Xb(a.d),n.Xb(r.b),n.Xb(a.g),n.Xb(E))},t.\u0275prov=n.Kb({token:t,factory:t.\u0275fac}),t})();const z={provide:new n.r("cdk-connected-overlay-scroll-strategy"),deps:[N],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Y=(()=>{class t{}return t.\u0275mod=n.Mb({type:t}),t.\u0275inj=n.Lb({factory:function(e){return new(e||t)},providers:[N,z],imports:[[r.a,c.f,s.d],s.d]}),t})();var W=i("FKr1"),K=i("bTqV"),Z=i("R0Ic"),q=i("u47x"),$=i("itXk"),J=i("GyhO"),U=i("HDdC");class Q{constructor(t){this.total=t}call(t,e){return e.subscribe(new G(t,this.total))}}class G extends f.a{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}var tt=i("Kj3r"),et=i("lJxs"),it=i("JX91");const st=new Set;let nt,ot=(()=>{class t{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):rt}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!st.has(t))try{nt||(nt=document.createElement("style"),nt.setAttribute("type","text/css"),document.head.appendChild(nt)),nt.sheet&&(nt.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),st.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(o.a))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(o.a))},token:t,providedIn:"root"}),t})();function rt(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let at=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new l.a}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return ht(Object(h.a)(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){const e=ht(Object(h.a)(t)).map(t=>this._registerQuery(t).observable);let i=Object($.a)(e);return i=Object(J.a)(i.pipe(Object(p.a)(1)),i.pipe(t=>t.lift(new Q(1)),Object(tt.a)(0))),i.pipe(Object(et.a)(t=>{const e={matches:!1,breakpoints:{}};return t.forEach(({matches:t,query:i})=>{e.matches=e.matches||t,e.breakpoints[i]=t}),e}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const e=this._mediaMatcher.matchMedia(t),i={observable:new U.a(t=>{const i=e=>this._zone.run(()=>t.next(e));return e.addListener(i),()=>{e.removeListener(i)}}).pipe(Object(it.a)(e),Object(et.a)(({matches:e})=>({query:t,matches:e})),Object(u.a)(this._destroySubject)),mql:e};return this._queries.set(t,i),i}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(ot),n.Xb(n.A))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(ot),Object(n.Xb)(n.A))},token:t,providedIn:"root"}),t})();function ht(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function ct(t,e){if(1&t){const t=n.Ub();n.Tb(0,"div",1),n.Tb(1,"button",2),n.ac("click",function(){return n.sc(t),n.ec().action()}),n.Ac(2),n.Sb(),n.Sb()}if(2&t){const t=n.ec();n.Cb(2),n.Bc(t.data.action)}}function lt(t,e){}const dt=new n.r("MatSnackBarData");class _t{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const pt=Math.pow(2,31)-1;class ut{constructor(t,e){this._overlayRef=e,this._afterDismissed=new l.a,this._afterOpened=new l.a,this._onAction=new l.a,this._dismissedByAction=!1,this.containerInstance=t,this.onAction().subscribe(()=>this.dismiss()),t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete())}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,pt))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let ft=(()=>{class t{constructor(t,e){this.snackBarRef=t,this.data=e}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return t.\u0275fac=function(e){return new(e||t)(n.Ob(ut),n.Ob(dt))},t.\u0275cmp=n.Ib({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,e){1&t&&(n.Tb(0,"span"),n.Ac(1),n.Sb(),n.zc(2,ct,3,1,"div",0)),2&t&&(n.Cb(1),n.Bc(e.data.message),n.Cb(1),n.jc("ngIf",e.hasAction))},directives:[a.k,K.a],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),t})();const mt={snackBarState:Object(Z.j)("state",[Object(Z.g)("void, hidden",Object(Z.h)({transform:"scale(0.8)",opacity:0})),Object(Z.g)("visible",Object(Z.h)({transform:"scale(1)",opacity:1})),Object(Z.i)("* => visible",Object(Z.e)("150ms cubic-bezier(0, 0, 0.2, 1)")),Object(Z.i)("* => void, * => hidden",Object(Z.e)("75ms cubic-bezier(0.4, 0.0, 1, 1)",Object(Z.h)({opacity:0})))])};let gt=(()=>{class t extends c.a{constructor(t,e,i,s,n){super(),this._ngZone=t,this._elementRef=e,this._changeDetectorRef=i,this._platform=s,this.snackBarConfig=n,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new l.a,this._onExit=new l.a,this._onEnter=new l.a,this._animationState="void",this.attachDomPortal=t=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(t)),this._live="assertive"!==n.politeness||n.announcementMessage?"off"===n.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:e,toState:i}=t;if(("void"===i&&"void"!==e||"hidden"===i)&&this._completeExit(),"visible"===i){const t=this._onEnter;this._ngZone.run(()=>{t.next(),t.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(Object(p.a)(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(e=>t.classList.add(e)):t.classList.add(e)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),e=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&e){let i=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(i=document.activeElement),t.removeAttribute("aria-hidden"),e.appendChild(t),null==i||i.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return t.\u0275fac=function(e){return new(e||t)(n.Ob(n.A),n.Ob(n.l),n.Ob(n.h),n.Ob(o.a),n.Ob(_t))},t.\u0275cmp=n.Ib({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&n.Ec(c.c,3),2&t){let t;n.oc(t=n.bc())&&(e._portalOutlet=t.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,e){1&t&&n.xc("@state.done",function(t){return e.onAnimationEnd(t)}),2&t&&n.yc("@state",e._animationState)},features:[n.zb],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,e){1&t&&(n.Tb(0,"div",0),n.zc(1,lt,0,0,"ng-template",1),n.Sb(),n.Pb(2,"div")),2&t&&(n.Cb(2),n.Db("aria-live",e._live)("role",e._role))},directives:[c.c],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[mt.snackBarState]}}),t})(),bt=(()=>{class t{}return t.\u0275mod=n.Mb({type:t}),t.\u0275inj=n.Lb({factory:function(e){return new(e||t)},imports:[[Y,c.f,a.c,K.b,W.b],W.b]}),t})();const yt=new n.r("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new _t}});let vt=(()=>{class t{constructor(t,e,i,s,n,o){this._overlay=t,this._live=e,this._injector=i,this._breakpointObserver=s,this._parentSnackBar=n,this._defaultConfig=o,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=ft,this.snackBarContainerComponent=gt,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",i){const s=Object.assign(Object.assign({},this._defaultConfig),i);return s.data={message:t,action:e},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){const i=n.s.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:_t,useValue:e}]}),s=new c.d(this.snackBarContainerComponent,e.viewContainerRef,i),o=t.attach(s);return o.instance.snackBarConfig=e,o.instance}_attach(t,e){const i=Object.assign(Object.assign(Object.assign({},new _t),this._defaultConfig),e),s=this._createOverlay(i),o=this._attachSnackBarContainer(s,i),r=new ut(o,s);if(t instanceof n.N){const e=new c.g(t,null,{$implicit:i.data,snackBarRef:r});r.instance=o.attachTemplatePortal(e)}else{const e=this._createInjector(i,r),s=new c.d(t,void 0,e),n=o.attachComponentPortal(s);r.instance=n.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Object(u.a)(s.detachments())).subscribe(t=>{const e=s.overlayElement.classList;t.matches?e.add(this.handsetCssClass):e.remove(this.handsetCssClass)}),i.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(r,i),this._openedSnackBarRef=r,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration))}_createOverlay(t){const e=new k;e.direction=t.direction;let i=this._overlay.position().global();const s="rtl"===t.direction,n="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,o=!n&&"center"!==t.horizontalPosition;return n?i.left("0"):o?i.right("0"):i.centerHorizontally(),"top"===t.verticalPosition?i.top("0"):i.bottom("0"),e.positionStrategy=i,this._overlay.create(e)}_createInjector(t,e){return n.s.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:ut,useValue:e},{provide:dt,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(n.Xb(N),n.Xb(q.g),n.Xb(n.s),n.Xb(at),n.Xb(t,12),n.Xb(yt))},t.\u0275prov=Object(n.Kb)({factory:function(){return new t(Object(n.Xb)(N),Object(n.Xb)(q.g),Object(n.Xb)(n.o),Object(n.Xb)(at),Object(n.Xb)(t,12),Object(n.Xb)(yt))},token:t,providedIn:bt}),t})()},vVVL:function(t,e,i){"use strict";i.d(e,"a",function(){return c});var s=i("Cfvw"),n=i("w1tV"),o=i("lJxs"),r=i("SxV6"),a=i("fXoL"),h=i("vHPH");let c=(()=>{class t{constructor(t){this.logger=t,this.prettyPrintOne=Object(s.a)(this.getPrettyPrintOne()).pipe(Object(n.a)())}getPrettyPrintOne(){const t=window.prettyPrintOne;return t?Promise.resolve(t):i.e(4).then(i.t.bind(null,"Ue1H",7)).then(()=>window.prettyPrintOne,t=>{const e="Cannot get prettify.js from server: "+t.message;return this.logger.error(new Error(e)),()=>{throw new Error(e)}})}formatCode(t,e,i){return this.prettyPrintOne.pipe(Object(o.a)(s=>{try{return s(t,e,i)}catch(n){const e=`Could not format code that begins '${t.substr(0,50)}...'.`;throw console.error(e,n),new Error(e)}}),Object(r.a)())}}return t.\u0275fac=function(e){return new(e||t)(a.Xb(h.a))},t.\u0275prov=a.Kb({token:t,factory:t.\u0275fac}),t})()}}]);
//# sourceMappingURL=default~code-code-example-module~code-code-tabs-module-es2015.48e4e1c9f1670b9cec23.js.map