{"version":3,"file":"layout.js","sources":["../../packages/cdk/layout/media-matcher.js","../../packages/cdk/layout/breakpoints-observer.js","../../packages/cdk/layout/breakpoints.js","../../packages/cdk/layout/public-api.js","../../packages/cdk/layout/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable } from '@angular/core';\nimport { Platform } from '@angular/cdk/platform';\n/**\n * Global registry for all dynamically-created, injected style tags.\n */\nconst styleElementForWebkitCompatibility = new Map();\n/**\n * A utility for calling matchMedia queries.\n */\nexport class MediaMatcher {\n /**\n * @param {?} platform\n */\n constructor(platform) {\n this.platform = platform;\n this._matchMedia = this.platform.isBrowser ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n /**\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n * @param {?} query\n * @return {?}\n */\n matchMedia(query) {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\nMediaMatcher.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nMediaMatcher.ctorParameters = () => [\n { type: Platform, },\n];\nfunction MediaMatcher_tsickle_Closure_declarations() {\n /** @type {?} */\n MediaMatcher.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n MediaMatcher.ctorParameters;\n /**\n * The internal matchMedia method to return back a MediaQueryList like object.\n * @type {?}\n */\n MediaMatcher.prototype._matchMedia;\n /** @type {?} */\n MediaMatcher.prototype.platform;\n}\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when there is at least one CSS\n * selector for the respective media query.\n * @param {?} query\n * @return {?}\n */\nfunction createEmptyStyleRule(query) {\n if (!styleElementForWebkitCompatibility.has(query)) {\n try {\n const /** @type {?} */ style = document.createElement('style');\n style.setAttribute('type', 'text/css');\n if (!style.sheet) {\n const /** @type {?} */ cssText = `@media ${query} {.fx-query-test{ }}`;\n style.appendChild(document.createTextNode(cssText));\n }\n document.getElementsByTagName('head')[0].appendChild(style);\n // Store in private global registry\n styleElementForWebkitCompatibility.set(query, style);\n }\n catch (e) {\n console.error(e);\n }\n }\n}\n/**\n * No-op matchMedia replacement for non-browser platforms.\n * @param {?} query\n * @return {?}\n */\nfunction noopMatchMedia(query) {\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => { },\n removeListener: () => { }\n };\n}\n//# sourceMappingURL=media-matcher.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, NgZone } from '@angular/core';\nimport { MediaMatcher } from './media-matcher';\nimport { Subject } from 'rxjs/Subject';\nimport { RxChain, map, startWith, takeUntil } from '@angular/cdk/rxjs';\nimport { coerceArray } from '@angular/cdk/coercion';\nimport { combineLatest } from 'rxjs/observable/combineLatest';\nimport { fromEventPattern } from 'rxjs/observable/fromEventPattern';\n/**\n * Utility for checking the matching state of \\@media queries.\n */\nexport class BreakpointObserver {\n /**\n * @param {?} mediaMatcher\n * @param {?} zone\n */\n constructor(mediaMatcher, zone) {\n this.mediaMatcher = mediaMatcher;\n this.zone = zone;\n /**\n * A map of all media queries currently being listened for.\n */\n this._queries = new Map();\n /**\n * A subject for all other observables to takeUntil based on.\n */\n this._destroySubject = new Subject();\n }\n /**\n * Completes the active subject, signalling to all other observables to complete.\n * @return {?}\n */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n /**\n * Whether the query currently is matched.\n * @param {?} value\n * @return {?}\n */\n isMatched(value) {\n let /** @type {?} */ queries = coerceArray(value);\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param {?} value\n * @return {?}\n */\n observe(value) {\n let /** @type {?} */ queries = coerceArray(value);\n let /** @type {?} */ observables = queries.map(query => this._registerQuery(query).observable);\n return combineLatest(observables, (a, b) => {\n return {\n matches: !!((a && a.matches) || (b && b.matches)),\n };\n });\n }\n /**\n * Registers a specific query to be listened for.\n * @param {?} query\n * @return {?}\n */\n _registerQuery(query) {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return ((this._queries.get(query)));\n }\n let /** @type {?} */ mql = this.mediaMatcher.matchMedia(query);\n // Create callback for match changes and add it is as a listener.\n let /** @type {?} */ queryObservable = RxChain.from(fromEventPattern(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n (listener) => {\n mql.addListener((e) => this.zone.run(() => listener(e)));\n }, (listener) => {\n mql.removeListener((e) => this.zone.run(() => listener(e)));\n }))\n .call(takeUntil, this._destroySubject)\n .call(startWith, mql)\n .call(map, (nextMql) => ({ matches: nextMql.matches }))\n .result();\n // Add the MediaQueryList to the set of queries.\n let /** @type {?} */ output = { observable: queryObservable, mql: mql };\n this._queries.set(query, output);\n return output;\n }\n}\nBreakpointObserver.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nBreakpointObserver.ctorParameters = () => [\n { type: MediaMatcher, },\n { type: NgZone, },\n];\nfunction BreakpointObserver_tsickle_Closure_declarations() {\n /** @type {?} */\n BreakpointObserver.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n BreakpointObserver.ctorParameters;\n /**\n * A map of all media queries currently being listened for.\n * @type {?}\n */\n BreakpointObserver.prototype._queries;\n /**\n * A subject for all other observables to takeUntil based on.\n * @type {?}\n */\n BreakpointObserver.prototype._destroySubject;\n /** @type {?} */\n BreakpointObserver.prototype.mediaMatcher;\n /** @type {?} */\n BreakpointObserver.prototype.zone;\n}\n//# sourceMappingURL=breakpoints-observer.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const /** @type {?} */ Breakpoints = {\n Handset: '(max-width: 599px) and (orientation: portrait), ' +\n '(max-width: 959px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\n};\n//# sourceMappingURL=breakpoints.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule } from '@angular/core';\nimport { PlatformModule } from '@angular/cdk/platform';\nimport { BreakpointObserver } from './breakpoints-observer';\nimport { MediaMatcher } from './media-matcher';\nexport class LayoutModule {\n}\nLayoutModule.decorators = [\n { type: NgModule, args: [{\n providers: [BreakpointObserver, MediaMatcher],\n imports: [PlatformModule],\n },] },\n];\n/**\n * @nocollapse\n */\nLayoutModule.ctorParameters = () => [];\nfunction LayoutModule_tsickle_Closure_declarations() {\n /** @type {?} */\n LayoutModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n LayoutModule.ctorParameters;\n}\nexport { BreakpointObserver } from './breakpoints-observer';\nexport { Breakpoints } from './breakpoints';\nexport { MediaMatcher } from './media-matcher';\n//# sourceMappingURL=public-api.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { LayoutModule, BreakpointObserver, Breakpoints, MediaMatcher } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA;;;AAGA,MAAM,kCAAkC,GAAG,IAAI,GAAG,EAAE,CAAC;;;;AAIrD,AAAO,MAAM,YAAY,CAAC;;;;IAItB,WAAW,CAAC,QAAQ,EAAE;QAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS;;;YAGtC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KACtB;;;;;;;IAOD,UAAU,CAAC,KAAK,EAAE;QACd,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACtB,oBAAoB,CAAC,KAAK,CAAC,CAAC;SAC/B;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAClC;CACJ;AACD,YAAY,CAAC,UAAU,GAAG;IACtB,EAAE,IAAI,EAAE,UAAU,EAAE;CACvB,CAAC;;;;AAIF,YAAY,CAAC,cAAc,GAAG,MAAM;IAChC,EAAE,IAAI,EAAE,QAAQ,GAAG;CACtB,CAAC;AACF,AAgBA;;;;;;AAMA,SAAS,oBAAoB,CAAC,KAAK,EAAE;IACjC,IAAI,CAAC,kCAAkC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAChD,IAAI;YACA,uBAAuB,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC/D,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBACd,uBAAuB,OAAO,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBACvE,KAAK,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