{"version":3,"file":"platform-browser.umd.js","sources":["../../../../packages/platform-browser/src/private_export.ts","../../../../packages/platform-browser/src/dom/debug/by.ts","../../../../packages/platform-browser/src/browser/tools/tools.ts","../../../../packages/platform-browser/src/browser/tools/common_tools.ts","../../../../packages/platform-browser/src/browser.ts","../../../../packages/platform-browser/src/security/dom_sanitization_service.ts","../../../../packages/platform-browser/src/security/style_sanitizer.ts","../../../../packages/platform-browser/src/security/html_sanitizer.ts","../../../../packages/platform-browser/src/security/url_sanitizer.ts","../../../../packages/platform-browser/src/dom/events/key_events.ts","../../../../packages/platform-browser/src/dom/events/hammer_gestures.ts","../../../../packages/platform-browser/src/dom/events/dom_events.ts","../../../../packages/platform-browser/src/dom/dom_renderer.ts","../../../../packages/platform-browser/src/dom/shared_styles_host.ts","../../../../packages/platform-browser/src/dom/events/event_manager.ts","../../../../packages/platform-browser/src/dom/debug/ng_probe.ts","../../../../packages/platform-browser/src/dom/util.ts","../../../../packages/platform-browser/src/browser/title.ts","../../../../packages/platform-browser/src/browser/testability.ts","../../../../packages/platform-browser/src/browser/server-transition.ts","../../../../packages/platform-browser/src/browser/meta.ts","../../../../packages/platform-browser/src/browser/location/browser_platform_location.ts","../../../../packages/platform-browser/src/dom/dom_tokens.ts","../../../../packages/platform-browser/src/browser/browser_adapter.ts","../../../../packages/platform-browser/src/browser/generic_browser_adapter.ts","../../../../packages/platform-browser/src/dom/dom_adapter.ts","../../../../node_modules/tslib/tslib.es6.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 */\n\nexport {BROWSER_SANITIZATION_PROVIDERS as ɵBROWSER_SANITIZATION_PROVIDERS, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, initDomAdapter as ɵinitDomAdapter} from './browser';\nexport {BrowserDomAdapter as ɵBrowserDomAdapter} from './browser/browser_adapter';\nexport {BrowserPlatformLocation as ɵBrowserPlatformLocation} from './browser/location/browser_platform_location';\nexport {TRANSITION_ID as ɵTRANSITION_ID} from './browser/server-transition';\nexport {BrowserGetTestability as ɵBrowserGetTestability} from './browser/testability';\nexport {ELEMENT_PROBE_PROVIDERS as ɵELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe';\nexport {DomAdapter as ɵDomAdapter, getDOM as ɵgetDOM, setRootDomAdapter as ɵsetRootDomAdapter} from './dom/dom_adapter';\nexport {DomRendererFactory2 as ɵDomRendererFactory2, NAMESPACE_URIS as ɵNAMESPACE_URIS, flattenStyles as ɵflattenStyles, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute} from './dom/dom_renderer';\nexport {DomEventsPlugin as ɵDomEventsPlugin} from './dom/events/dom_events';\nexport {HammerGesturesPlugin as ɵHammerGesturesPlugin} from './dom/events/hammer_gestures';\nexport {KeyEventsPlugin as ɵKeyEventsPlugin} from './dom/events/key_events';\nexport {DomSharedStylesHost as ɵDomSharedStylesHost, SharedStylesHost as ɵSharedStylesHost} from './dom/shared_styles_host';\n","/**\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\n\nimport {DebugElement, Predicate, Type} from '@angular/core';\nimport {getDOM} from '../../dom/dom_adapter';\n/**\n * Predicates for use with {\\@link DebugElement}'s query functions.\n * \n * \\@experimental All debugging apis are currently experimental.\n */\nexport class By {\n/**\n * Match all elements.\n * \n * ## Example\n * \n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n * @return {?}\n */\nstatic all(): Predicate { return (debugElement) => true; }\n/**\n * Match elements by the given CSS selector.\n * \n * ## Example\n * \n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n * @param {?} selector\n * @return {?}\n */\nstatic css(selector: string): Predicate {\n return (debugElement) => {\n return debugElement.nativeElement != null ?\n getDOM().elementMatches(debugElement.nativeElement, selector) :\n false;\n };\n }\n/**\n * Match elements that have the given directive present.\n * \n * ## Example\n * \n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n * @param {?} type\n * @return {?}\n */\nstatic directive(type: Type): Predicate {\n return (debugElement) => /** @type {?} */(( debugElement.providerTokens)).indexOf(type) !== -1;\n }\n}\n","/**\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\n\nimport {ComponentRef} from '@angular/core';\nimport {exportNgVar} from '../../dom/util';\nimport {AngularProfiler} from './common_tools';\n\nconst /** @type {?} */ PROFILER_GLOBAL_NAME = 'profiler';\n/**\n * Enabled Angular debug tools that are accessible via your browser's\n * developer console.\n * \n * Usage:\n * \n * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)\n * 1. Type `ng.` (usually the console will show auto-complete suggestion)\n * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`\n * then hit Enter.\n * \n * \\@experimental All debugging apis are currently experimental.\n * @template T\n * @param {?} ref\n * @return {?}\n */\nexport function enableDebugTools(ref: ComponentRef): ComponentRef {\n exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n return ref;\n}\n/**\n * Disables Angular tools.\n * \n * \\@experimental All debugging apis are currently experimental.\n * @return {?}\n */\nexport function disableDebugTools(): void {\n exportNgVar(PROFILER_GLOBAL_NAME, null);\n}\n","/**\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\n\nimport {ApplicationRef, ComponentRef} from '@angular/core';\nimport {getDOM} from '../../dom/dom_adapter';\nimport {window} from './browser';\nexport class ChangeDetectionPerfRecord {\n/**\n * @param {?} msPerTick\n * @param {?} numTicks\n */\nconstructor(public msPerTick: number,\npublic numTicks: number) {}\n}\n\nfunction ChangeDetectionPerfRecord_tsickle_Closure_declarations() {\n/** @type {?} */\nChangeDetectionPerfRecord.prototype.msPerTick;\n/** @type {?} */\nChangeDetectionPerfRecord.prototype.numTicks;\n}\n\n/**\n * Entry point for all Angular profiling-related debug tools. This object\n * corresponds to the `ng.profiler` in the dev console.\n */\nexport class AngularProfiler {\n appRef: ApplicationRef;\n/**\n * @param {?} ref\n */\nconstructor(ref: ComponentRef) { this.appRef = ref.injector.get(ApplicationRef); }\n/**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n * \n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n * \n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n * \n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n * @param {?} config\n * @return {?}\n */\ntimeChangeDetection(config: any): ChangeDetectionPerfRecord {\n const /** @type {?} */ record = config && config['record'];\n const /** @type {?} */ profileName = 'Change Detection';\n // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened\n const /** @type {?} */ isProfilerAvailable = window.console.profile != null;\n if (record && isProfilerAvailable) {\n window.console.profile(profileName);\n }\n const /** @type {?} */ start = getDOM().performanceNow();\n let /** @type {?} */ numTicks = 0;\n while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {\n this.appRef.tick();\n numTicks++;\n }\n const /** @type {?} */ end = getDOM().performanceNow();\n if (record && isProfilerAvailable) {\n // need to cast to because type checker thinks there's no argument\n // while in fact there is:\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd\n ( /** @type {?} */((window.console.profileEnd)))(profileName);\n }\n const /** @type {?} */ msPerTick = (end - start) / numTicks;\n window.console.log(`ran ${numTicks} change detection cycles`);\n window.console.log(`${msPerTick.toFixed(2)} ms per check`);\n\n return new ChangeDetectionPerfRecord(msPerTick, numTicks);\n }\n}\n\nfunction AngularProfiler_tsickle_Closure_declarations() {\n/** @type {?} */\nAngularProfiler.prototype.appRef;\n}\n\n","/**\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\n\nimport {CommonModule, PlatformLocation, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common';\nimport {APP_ID, ApplicationModule, ErrorHandler, ModuleWithProviders, NgModule, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, Provider, RendererFactory2, RootRenderer, Sanitizer, SkipSelf, Testability, createPlatformFactory, platformCore} from '@angular/core';\n\nimport {BrowserDomAdapter} from './browser/browser_adapter';\nimport {BrowserPlatformLocation} from './browser/location/browser_platform_location';\nimport {Meta} from './browser/meta';\nimport {SERVER_TRANSITION_PROVIDERS, TRANSITION_ID} from './browser/server-transition';\nimport {BrowserGetTestability} from './browser/testability';\nimport {Title} from './browser/title';\nimport {ELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe';\nimport {getDOM} from './dom/dom_adapter';\nimport {DomRendererFactory2} from './dom/dom_renderer';\nimport {DOCUMENT} from './dom/dom_tokens';\nimport {DomEventsPlugin} from './dom/events/dom_events';\nimport {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';\nimport {HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerGesturesPlugin} from './dom/events/hammer_gestures';\nimport {KeyEventsPlugin} from './dom/events/key_events';\nimport {DomSharedStylesHost, SharedStylesHost} from './dom/shared_styles_host';\nimport {DomSanitizer, DomSanitizerImpl} from './security/dom_sanitization_service';\n\nexport const /** @type {?} */ INTERNAL_BROWSER_PLATFORM_PROVIDERS: Provider[] = [\n {provide: PLATFORM_ID, useValue: PLATFORM_BROWSER_ID},\n {provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true},\n {provide: PlatformLocation, useClass: BrowserPlatformLocation},\n {provide: DOCUMENT, useFactory: _document, deps: []},\n];\n/**\n * \\@security Replacing built-in sanitization providers exposes the application to XSS risks.\n * Attacker-controlled data introduced by an unsanitized provider could expose your\n * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).\n * \\@experimental\n */\nexport const BROWSER_SANITIZATION_PROVIDERS: Array = [\n {provide: Sanitizer, useExisting: DomSanitizer},\n {provide: DomSanitizer, useClass: DomSanitizerImpl},\n];\n/**\n * \\@stable\n */\nexport const platformBrowser: (extraProviders?: Provider[]) => PlatformRef =\n createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n/**\n * @return {?}\n */\nexport function initDomAdapter() {\n BrowserDomAdapter.makeCurrent();\n BrowserGetTestability.init();\n}\n/**\n * @return {?}\n */\nexport function errorHandler(): ErrorHandler {\n return new ErrorHandler();\n}\n/**\n * @return {?}\n */\nexport function _document(): any {\n return document;\n}\n/**\n * The ng module for the browser.\n * \n * \\@stable\n */\nexport class BrowserModule {\n/**\n * @param {?} parentModule\n */\nconstructor( parentModule: BrowserModule) {\n if (parentModule) {\n throw new Error(\n `BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.`);\n }\n }\n/**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n * \n * \\@experimental\n * @param {?} params\n * @return {?}\n */\nstatic withServerTransition(params: {appId: string}): ModuleWithProviders {\n return {\n ngModule: BrowserModule,\n providers: [\n {provide: APP_ID, useValue: params.appId},\n {provide: TRANSITION_ID, useExisting: APP_ID},\n SERVER_TRANSITION_PROVIDERS,\n ],\n };\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n providers: [\n BROWSER_SANITIZATION_PROVIDERS,\n {provide: ErrorHandler, useFactory: errorHandler, deps: []},\n {provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true},\n {provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true},\n {provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true},\n {provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig},\n DomRendererFactory2,\n {provide: RendererFactory2, useExisting: DomRendererFactory2},\n {provide: SharedStylesHost, useExisting: DomSharedStylesHost},\n DomSharedStylesHost,\n Testability,\n EventManager,\n ELEMENT_PROBE_PROVIDERS,\n Meta,\n Title,\n ],\n exports: [CommonModule, ApplicationModule]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: BrowserModule, decorators: [{ type: Optional }, { type: SkipSelf }, ]},\n];\n}\n\nfunction BrowserModule_tsickle_Closure_declarations() {\n/** @type {?} */\nBrowserModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nBrowserModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\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\n\nimport {Inject, Injectable, Sanitizer, SecurityContext} from '@angular/core';\n\nimport {DOCUMENT} from '../dom/dom_tokens';\n\nimport {sanitizeHtml} from './html_sanitizer';\nimport {sanitizeStyle} from './style_sanitizer';\nimport {sanitizeUrl} from './url_sanitizer';\n\nexport {SecurityContext};\n\n\n\n/**\n * Marker interface for a value that's safe to use in a particular context.\n *\n * @stable\n */\nexport interface SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as HTML.\n *\n * @stable\n */\nexport interface SafeHtml extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as style (CSS).\n *\n * @stable\n */\nexport interface SafeStyle extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as JavaScript.\n *\n * @stable\n */\nexport interface SafeScript extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL linking to a document.\n *\n * @stable\n */\nexport interface SafeUrl extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL to load executable code from.\n *\n * @stable\n */\nexport interface SafeResourceUrl extends SafeValue {}\n/**\n * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n * values to be safe to use in the different DOM contexts.\n * \n * For example, when binding a URL in an `` hyperlink, `someValue` will be\n * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n * the website.\n * \n * In specific situations, it might be necessary to disable sanitization, for example if the\n * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n * methods, and then binding to that value from the template.\n * \n * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n * Cross Site Scripting (XSS) security bug!\n * \n * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n * close as possible to the source of the value, to make it easy to verify no security bug is\n * created by its use.\n * \n * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n * code. The sanitizer leaves safe values intact.\n * \n * \\@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n * sanitization for the value passed in. Carefully check and audit all values and code paths going\n * into this call. Make sure any user data is appropriately escaped for this security context.\n * For more detail, see the [Security Guide](http://g.co/ng/security).\n * \n * \\@stable\n * @abstract\n */\nexport abstract class DomSanitizer implements Sanitizer {\n/**\n * Sanitizes a value for use in the given SecurityContext.\n * \n * If value is trusted for the context, this method will unwrap the contained safe value and use\n * it directly. Otherwise, value will be sanitized to be safe in the given context, for example\n * by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation\n * is responsible to make sure that the value can definitely be safely used in the given context.\n * @abstract\n * @param {?} context\n * @param {?} value\n * @return {?}\n */\nsanitize(context: SecurityContext, value: SafeValue|string|null) {}\n/**\n * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML\n * is unsafe (e.g. contains `