UNPKG

@angular/platform-browser

Version:

Angular - library for using Angular in a web browser

1 lines 62.7 kB
{"version":3,"file":"_dom_renderer-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/events/event_manager_plugin.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/events/dom_events.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/events/event_manager.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/shared_styles_host.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/dom_renderer.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC 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.dev/license\n */\n\nimport type {ListenerOptions} from '@angular/core';\nimport type {EventManager} from './event_manager';\n\n/**\n * The plugin definition for the `EventManager` class\n *\n * It can be used as a base class to create custom manager plugins, i.e. you can create your own\n * class that extends the `EventManagerPlugin` one.\n *\n * @see [Extend event handling](guide/templates/event-listeners#extend-event-handling)\n *\n * @publicApi\n */\nexport abstract class EventManagerPlugin {\n // TODO: remove (has some usage in G3)\n constructor(private _doc: any) {}\n\n // Using non-null assertion because it's set by EventManager's constructor\n manager!: EventManager;\n\n /**\n * Should return `true` for every event name that should be supported by this plugin\n */\n abstract supports(eventName: string): boolean;\n\n /**\n * Implement the behaviour for the supported events\n */\n abstract addEventListener(\n element: HTMLElement,\n eventName: string,\n handler: Function,\n options?: ListenerOptions,\n ): Function;\n}\n","/**\n * @license\n * Copyright Google LLC 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.dev/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, type ListenerOptions} from '@angular/core';\nimport {EventManagerPlugin} from './event_manager_plugin';\n\n@Injectable()\nexport class DomEventsPlugin extends EventManagerPlugin {\n constructor(@Inject(DOCUMENT) doc: any) {\n super(doc);\n }\n\n // This plugin should come last in the list of plugins, because it accepts all\n // events.\n override supports(eventName: string): boolean {\n return true;\n }\n\n override addEventListener(\n element: HTMLElement,\n eventName: string,\n handler: Function,\n options?: ListenerOptions,\n ): Function {\n element.addEventListener(eventName, handler as EventListener, options);\n return () => this.removeEventListener(element, eventName, handler as EventListener, options);\n }\n\n removeEventListener(\n target: any,\n eventName: string,\n callback: Function,\n options?: ListenerOptions,\n ): void {\n return target.removeEventListener(eventName, callback as EventListener, options);\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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.dev/license\n */\n\nimport {\n Inject,\n Injectable,\n InjectionToken,\n NgZone,\n ɵRuntimeError as RuntimeError,\n type ListenerOptions,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\nimport type {EventManagerPlugin} from './event_manager_plugin';\n\nimport {DomEventsPlugin} from './dom_events';\n\n/**\n * The injection token for plugins of the `EventManager` service.\n *\n * @see [Extend event handling](guide/templates/event-listeners#extend-event-handling)\n *\n * @publicApi\n */\nexport const EVENT_MANAGER_PLUGINS = new InjectionToken<EventManagerPlugin[]>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'EventManagerPlugins' : '',\n);\n\n/**\n * An injectable service that provides event management for Angular\n * through a browser plug-in.\n *\n * @publicApi\n */\n@Injectable()\nexport class EventManager {\n private _plugins: EventManagerPlugin[];\n private _eventNameToPlugin = new Map<string, EventManagerPlugin>();\n\n /**\n * Initializes an instance of the event-manager service.\n */\n constructor(\n @Inject(EVENT_MANAGER_PLUGINS) plugins: EventManagerPlugin[],\n private _zone: NgZone,\n ) {\n plugins.forEach((plugin) => {\n plugin.manager = this;\n });\n\n const otherPlugins = plugins.filter((p) => !(p instanceof DomEventsPlugin));\n this._plugins = otherPlugins.slice().reverse();\n\n // DomEventsPlugin.supports() always returns true, it should always be the last plugin.\n const domEventPlugin = plugins.find((p) => p instanceof DomEventsPlugin);\n if (domEventPlugin) {\n this._plugins.push(domEventPlugin);\n }\n }\n\n /**\n * Registers a handler for a specific element and event.\n *\n * @param element The HTML element to receive event notifications.\n * @param eventName The name of the event to listen for.\n * @param handler A function to call when the notification occurs. Receives the\n * event object as an argument.\n * @param options Options that configure how the event listener is bound.\n * @returns A callback function that can be used to remove the handler.\n */\n addEventListener(\n element: HTMLElement,\n eventName: string,\n handler: Function,\n options?: ListenerOptions,\n ): Function {\n const plugin = this._findPluginFor(eventName);\n return plugin.addEventListener(element, eventName, handler, options);\n }\n\n /**\n * Retrieves the compilation zone in which event listeners are registered.\n */\n getZone(): NgZone {\n return this._zone;\n }\n\n /** @internal */\n _findPluginFor(eventName: string): EventManagerPlugin {\n let plugin = this._eventNameToPlugin.get(eventName);\n if (plugin) {\n return plugin;\n }\n\n const plugins = this._plugins;\n plugin = plugins.find((plugin) => plugin.supports(eventName));\n if (!plugin) {\n throw new RuntimeError(\n RuntimeErrorCode.NO_PLUGIN_FOR_EVENT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n `No event manager plugin found for event ${eventName}`,\n );\n }\n\n this._eventNameToPlugin.set(eventName, plugin);\n return plugin;\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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.dev/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {\n APP_ID,\n CSP_NONCE,\n Inject,\n Injectable,\n OnDestroy,\n Optional,\n PLATFORM_ID,\n ɵSharedStylesHost,\n} from '@angular/core';\n\n/** The style elements attribute name used to set value of `APP_ID` token. */\nconst APP_ID_ATTRIBUTE_NAME = 'ng-app-id';\n\n/**\n * A record of usage for a specific style including all elements added to the DOM\n * that contain a given style.\n */\ninterface UsageRecord<T> {\n elements: T[];\n usage: number;\n}\n\n/**\n * Removes all provided elements from the document.\n * @param elements An array of HTML Elements.\n */\nfunction removeElements(elements: Iterable<HTMLElement>): void {\n for (const element of elements) {\n element.remove();\n }\n}\n\n/**\n * Creates a `style` element with the provided inline style content.\n * @param style A string of the inline style content.\n * @param doc A DOM Document to use to create the element.\n * @returns An HTMLStyleElement instance.\n */\nfunction createStyleElement(style: string, doc: Document): HTMLStyleElement {\n const styleElement = doc.createElement('style');\n styleElement.textContent = style;\n\n return styleElement;\n}\n\n/**\n * Searches a DOM document's head element for style elements with a matching application\n * identifier attribute (`ng-app-id`) to the provide identifier and adds usage records for each.\n * @param doc An HTML DOM document instance.\n * @param appId A string containing an Angular application identifer.\n * @param inline A Map object for tracking inline (defined via `styles` in component decorator) style usage.\n * @param external A Map object for tracking external (defined via `styleUrls` in component decorator) style usage.\n * @returns Whether or not styles were added.\n */\nfunction addServerStyles(\n doc: Document,\n appId: string,\n inline: Map<string, UsageRecord<HTMLStyleElement>>,\n external: Map<string, UsageRecord<HTMLLinkElement>>,\n): boolean {\n const elements = doc.head?.querySelectorAll<HTMLStyleElement | HTMLLinkElement>(\n `style[${APP_ID_ATTRIBUTE_NAME}=\"${appId}\"],link[${APP_ID_ATTRIBUTE_NAME}=\"${appId}\"]`,\n );\n\n if (!elements || elements.length === 0) return false;\n\n for (const styleElement of elements) {\n styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);\n if (styleElement instanceof HTMLLinkElement) {\n // Only use filename from href\n // The href is build time generated with a unique value to prevent duplicates.\n external.set(styleElement.href.slice(styleElement.href.lastIndexOf('/') + 1), {\n usage: 0,\n elements: [styleElement],\n });\n } else if (styleElement.textContent) {\n inline.set(styleElement.textContent, {usage: 0, elements: [styleElement]});\n }\n }\n\n return true;\n}\n\n/**\n * Creates a `link` element for the provided external style URL.\n * @param url A string of the URL for the stylesheet.\n * @param doc A DOM Document to use to create the element.\n * @returns An HTMLLinkElement instance.\n */\nexport function createLinkElement(url: string, doc: Document): HTMLLinkElement {\n const linkElement = doc.createElement('link');\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('href', url);\n\n return linkElement;\n}\n\n@Injectable()\nexport class SharedStylesHost implements ɵSharedStylesHost, OnDestroy {\n /**\n * Provides usage information for active inline style content and associated HTML <style> elements.\n * Embedded styles typically originate from the `styles` metadata of a rendered component.\n */\n private readonly inline = new Map<string /** content */, UsageRecord<HTMLStyleElement>>();\n\n /**\n * Provides usage information for active external style URLs and the associated HTML <link> elements.\n * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.\n */\n private readonly external = new Map<string /** URL */, UsageRecord<HTMLLinkElement>>();\n\n /**\n * Set of host DOM nodes that will have styles attached.\n */\n private readonly hosts = new Set<Node>();\n\n constructor(\n @Inject(DOCUMENT) private readonly doc: Document,\n @Inject(APP_ID) private readonly appId: string,\n @Inject(CSP_NONCE) @Optional() private readonly nonce?: string | null,\n // Cannot remove it due to backward compatibility\n // (it seems some TGP targets might be calling this constructor directly).\n @Inject(PLATFORM_ID) platformId: object = {},\n ) {\n const added = addServerStyles(doc, appId, this.inline, this.external);\n if (added) this.hosts.add(doc.head);\n }\n\n addStyles(styles: string[], urls?: string[]): void {\n for (const value of styles) {\n this.addUsage(value, this.inline, createStyleElement);\n }\n\n urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));\n }\n\n /**\n * Removes embedded styles from the DOM that were added as HTML `style` elements.\n * @param styles An array of style content strings.\n */\n removeStyles(styles: string[], urls?: string[]): void {\n for (const value of styles) {\n this.removeUsage(value, this.inline);\n }\n\n urls?.forEach((value) => this.removeUsage(value, this.external));\n }\n\n protected addUsage<T extends HTMLElement>(\n value: string,\n usages: Map<string, UsageRecord<T>>,\n creator: (value: string, doc: Document) => T,\n ): void {\n // Attempt to get any current usage of the value\n const record = usages.get(value);\n\n // If existing, just increment the usage count\n if (record) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && record.usage === 0) {\n // A usage count of zero indicates a preexisting server generated style.\n // This attribute is solely used for debugging purposes of SSR style reuse.\n record.elements.forEach((element) => element.setAttribute('ng-style-reused', ''));\n }\n record.usage++;\n } else {\n // Otherwise, create an entry to track the elements and add element for each host\n usages.set(value, {\n usage: 1,\n elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc))),\n });\n }\n }\n\n protected removeUsage<T extends HTMLElement>(\n value: string,\n usages: Map<string, UsageRecord<T>>,\n ): void {\n // Attempt to get any current usage of the value\n const record = usages.get(value);\n\n // If there is a record, reduce the usage count and if no longer used,\n // remove from DOM and delete usage record.\n if (record) {\n record.usage--;\n if (record.usage <= 0) {\n removeElements(record.elements);\n usages.delete(value);\n }\n }\n }\n\n ngOnDestroy(): void {\n for (const [, {elements}] of [...this.inline, ...this.external]) {\n removeElements(elements);\n }\n this.hosts.clear();\n }\n\n addHost(hostNode: Node): void {\n if (this.hosts.has(hostNode)) return;\n\n this.hosts.add(hostNode);\n\n // Add existing styles to new host\n for (const [style, {elements}] of this.inline) {\n elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));\n }\n for (const [url, {elements}] of this.external) {\n elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));\n }\n }\n\n removeHost(hostNode: Node): void {\n this.hosts.delete(hostNode);\n\n for (const record of [...this.inline.values(), ...this.external.values()]) {\n const remaining: Array<HTMLStyleElement | HTMLLinkElement> = [];\n for (const element of record.elements) {\n if (element.parentNode === hostNode) {\n element.remove();\n } else {\n remaining.push(element);\n }\n }\n record.elements = remaining;\n }\n }\n\n private addElement<T extends HTMLElement>(host: Node, element: T): T {\n // Add a nonce if present\n if (this.nonce) {\n element.setAttribute('nonce', this.nonce);\n }\n\n // Add application identifier when on the server to support client-side reuse\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);\n }\n\n // Insert the element into the DOM with the host node as parent\n return host.appendChild(element);\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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.dev/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {\n APP_ID,\n CSP_NONCE,\n Inject,\n Injectable,\n InjectionToken,\n NgZone,\n OnDestroy,\n Renderer2,\n RendererFactory2,\n RendererStyleFlags2,\n RendererType2,\n ViewEncapsulation,\n ɵRuntimeError as RuntimeError,\n type ListenerOptions,\n ɵTracingService as TracingService,\n ɵTracingSnapshot as TracingSnapshot,\n Optional,\n ɵallLeavingAnimations as allLeavingAnimations,\n ɵSHARED_STYLES_HOST as SHARED_STYLES_HOST,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nimport {EventManager} from './events/event_manager';\nimport {createLinkElement, SharedStylesHost} from './shared_styles_host';\n\nexport const NAMESPACE_URIS: {[ns: string]: string} = {\n 'svg': 'http://www.w3.org/2000/svg',\n 'xhtml': 'http://www.w3.org/1999/xhtml',\n 'xlink': 'http://www.w3.org/1999/xlink',\n 'xml': 'http://www.w3.org/XML/1998/namespace',\n 'xmlns': 'http://www.w3.org/2000/xmlns/',\n 'math': 'http://www.w3.org/1998/Math/MathML',\n};\n\nconst COMPONENT_REGEX = /%COMP%/g;\nconst SOURCEMAP_URL_REGEXP = /\\/\\*#\\s*sourceMappingURL=([^\\s*]+)\\s*\\*\\//;\nconst PROTOCOL_REGEXP = /^https?:/;\n\nexport const COMPONENT_VARIABLE = '%COMP%';\nexport const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;\nexport const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;\n\n/**\n * The default value for the `REMOVE_STYLES_ON_COMPONENT_DESTROY` DI token.\n */\nconst REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;\n\n/**\n * A DI token that indicates whether styles\n * of destroyed components should be removed from DOM.\n *\n * By default, the value is set to `true`.\n * @publicApi\n */\nexport const REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken<boolean>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'RemoveStylesOnCompDestroy' : '',\n {\n factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,\n },\n);\n\n/**\n * An injection token that allows an application to configure a prefix to be used for all\n * CSS variables generated compiled with CSS namespacing enabled.\n *\n * Typically set via {@link provideCssVarNamespacing}.\n */\nexport const CSS_VAR_NAMESPACE = new InjectionToken<string>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'CSS_VAR_NAMESPACE' : '',\n);\n\n/**\n * Configures the application to use the given namespace for all CSS variables.\n *\n * @param namespace The prefix string to use as a namespace. If not provided, it defaults\n * to the `APP_ID`. An underscore is appended unconditionally.\n * @publicApi\n */\nexport function provideCssVarNamespacing(namespace?: string): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: CSS_VAR_NAMESPACE,\n useFactory: (appId: string) => `${namespace ?? appId}_`,\n deps: [APP_ID],\n },\n ]);\n}\n\nexport function shimContentAttribute(componentShortId: string): string {\n return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n\nexport function shimHostAttribute(componentShortId: string): string {\n return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n\nexport function shimStylesContent(compId: string, styles: string[]): string[] {\n return styles.map((s) => s.replace(COMPONENT_REGEX, compId));\n}\n\n/**\n * Prepends a baseHref to the `sourceMappingURL` within the provided CSS content.\n * If the `sourceMappingURL` contains an inline (encoded) map, the function skips processing.\n *\n * @note For inline stylesheets, the `sourceMappingURL` is relative to the page's origin\n * and not the provided baseHref. This function is needed as when accessing the page with a URL\n * containing two or more segments.\n * For example, if the baseHref is set to `/`, and you visit a URL like `http://localhost/foo/bar`,\n * the map would be requested from `http://localhost/foo/bar/comp.css.map` instead of what you'd expect,\n * which is `http://localhost/comp.css.map`. This behavior is corrected by modifying the `sourceMappingURL`\n * to ensure external source maps are loaded relative to the baseHref.\n *\n\n * @param baseHref - The base URL to prepend to the `sourceMappingURL`.\n * @param styles - An array of CSS content strings, each potentially containing a `sourceMappingURL`.\n * @returns The updated array of CSS content strings with modified `sourceMappingURL` values,\n * or the original content if no modification is needed.\n */\nexport function addBaseHrefToCssSourceMap(baseHref: string, styles: string[]): string[] {\n if (!baseHref) {\n return styles;\n }\n\n const absoluteBaseHrefUrl = new URL(baseHref, 'http://localhost');\n\n return styles.map((cssContent) => {\n if (!cssContent.includes('sourceMappingURL=')) {\n return cssContent;\n }\n\n return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => {\n if (\n sourceMapUrl[0] === '/' ||\n sourceMapUrl.startsWith('data:') ||\n PROTOCOL_REGEXP.test(sourceMapUrl)\n ) {\n return `/*# sourceMappingURL=${sourceMapUrl} */`;\n }\n\n const {pathname: resolvedSourceMapUrl} = new URL(sourceMapUrl, absoluteBaseHrefUrl);\n\n return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`;\n });\n });\n}\n\n@Injectable()\nexport class DomRendererFactory2 implements RendererFactory2, OnDestroy {\n private readonly rendererByCompId = new Map<\n string,\n EmulatedEncapsulationDomRenderer2 | NoneEncapsulationDomRenderer\n >();\n private readonly defaultRenderer: Renderer2;\n private readonly cssVarNamespace: string;\n\n constructor(\n private readonly eventManager: EventManager,\n @Inject(SHARED_STYLES_HOST) private readonly sharedStylesHost: SharedStylesHost,\n @Inject(APP_ID) private readonly appId: string,\n @Inject(REMOVE_STYLES_ON_COMPONENT_DESTROY) private removeStylesOnCompDestroy: boolean,\n @Inject(DOCUMENT) private readonly doc: Document,\n readonly ngZone: NgZone,\n @Inject(CSP_NONCE) private readonly nonce: string | null = null,\n @Inject(TracingService)\n @Optional()\n private readonly tracingService: TracingService<TracingSnapshot> | null = null,\n @Inject(CSS_VAR_NAMESPACE) @Optional() cssVarNamespace: string | null = null,\n ) {\n this.cssVarNamespace = cssVarNamespace ?? '';\n this.defaultRenderer = new DefaultDomRenderer2(\n eventManager,\n doc,\n ngZone,\n this.tracingService,\n this.cssVarNamespace,\n );\n }\n\n createRenderer(element: any, type: RendererType2 | null): Renderer2 {\n if (!element || !type) {\n return this.defaultRenderer;\n }\n\n if (\n typeof ngServerMode !== 'undefined' &&\n ngServerMode &&\n (type.encapsulation === ViewEncapsulation.ShadowDom ||\n type.encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom)\n ) {\n // Domino does not support shadow DOM.\n type = {...type, encapsulation: ViewEncapsulation.Emulated};\n }\n\n const renderer = this.getOrCreateRenderer(element, type);\n // Renderers have different logic due to different encapsulation behaviours.\n // Ex: for emulated, an attribute is added to the element.\n if (renderer instanceof EmulatedEncapsulationDomRenderer2) {\n renderer.applyToHost(element);\n } else if (renderer instanceof NoneEncapsulationDomRenderer) {\n renderer.applyStyles();\n }\n\n return renderer;\n }\n\n private getOrCreateRenderer(element: any, type: RendererType2): Renderer2 {\n const rendererByCompId = this.rendererByCompId;\n let renderer = rendererByCompId.get(type.id);\n\n if (!renderer) {\n const doc = this.doc;\n const ngZone = this.ngZone;\n const eventManager = this.eventManager;\n const sharedStylesHost = this.sharedStylesHost;\n const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;\n const tracingService = this.tracingService;\n\n switch (type.encapsulation) {\n case ViewEncapsulation.Emulated:\n renderer = new EmulatedEncapsulationDomRenderer2(\n eventManager,\n sharedStylesHost,\n type,\n this.appId,\n removeStylesOnCompDestroy,\n doc,\n ngZone,\n tracingService,\n this.cssVarNamespace,\n );\n break;\n case ViewEncapsulation.ShadowDom:\n return new ShadowDomRenderer(\n eventManager,\n element,\n type,\n doc,\n ngZone,\n this.nonce,\n tracingService,\n this.cssVarNamespace,\n sharedStylesHost,\n );\n case ViewEncapsulation.ExperimentalIsolatedShadowDom:\n return new ShadowDomRenderer(\n eventManager,\n element,\n type,\n doc,\n ngZone,\n this.nonce,\n tracingService,\n this.cssVarNamespace,\n );\n\n default:\n renderer = new NoneEncapsulationDomRenderer(\n eventManager,\n sharedStylesHost,\n type,\n removeStylesOnCompDestroy,\n doc,\n ngZone,\n tracingService,\n this.cssVarNamespace,\n );\n break;\n }\n\n rendererByCompId.set(type.id, renderer);\n }\n\n return renderer;\n }\n\n ngOnDestroy() {\n this.rendererByCompId.clear();\n }\n\n /**\n * Used during HMR to clear any cached data about a component.\n * @param componentId ID of the component that is being replaced.\n */\n protected componentReplaced(componentId: string) {\n this.rendererByCompId.delete(componentId);\n }\n}\n\nclass DefaultDomRenderer2 implements Renderer2 {\n data: {[key: string]: any} = Object.create(null);\n\n /**\n * By default this renderer throws when encountering synthetic properties\n * This can be disabled for example by the AsyncAnimationRendererFactory\n */\n throwOnSyntheticProps = true;\n\n constructor(\n private readonly eventManager: EventManager,\n private readonly doc: Document,\n protected readonly ngZone: NgZone,\n private readonly tracingService: TracingService<TracingSnapshot> | null,\n private readonly cssVarNamespace: string = '',\n ) {}\n\n destroy(): void {}\n\n destroyNode = null;\n\n createElement(name: string, namespace?: string): any {\n if (namespace) {\n // TODO: `|| namespace` was added in\n // https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to\n // support how Ivy passed around the namespace URI rather than short name at the time. It did\n // not, however extend the support to other parts of the system (setAttribute, setAttribute,\n // and the ServerRenderer). We should decide what exactly the semantics for dealing with\n // namespaces should be and make it consistent.\n // Related issues:\n // https://github.com/angular/angular/issues/44028\n // https://github.com/angular/angular/issues/44883\n return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);\n }\n\n return this.doc.createElement(name);\n }\n\n createComment(value: string): any {\n return this.doc.createComment(value);\n }\n\n createText(value: string): any {\n return this.doc.createTextNode(value);\n }\n\n appendChild(parent: any, newChild: any): void {\n const targetParent = isTemplateNode(parent) ? parent.content : parent;\n targetParent.appendChild(newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n if (parent) {\n const targetParent = isTemplateNode(parent) ? parent.content : parent;\n targetParent.insertBefore(newChild, refChild);\n }\n }\n\n removeChild(_parent: any, oldChild: any): void {\n // child was removed\n oldChild.remove();\n }\n\n selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): any {\n let el: any =\n typeof selectorOrNode === 'string' ? this.doc.querySelector(selectorOrNode) : selectorOrNode;\n if (!el) {\n throw new RuntimeError(\n RuntimeErrorCode.ROOT_NODE_NOT_FOUND,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n `The selector \"${selectorOrNode}\" did not match any elements`,\n );\n }\n if (!preserveContent) {\n el.textContent = '';\n }\n return el;\n }\n\n parentNode(node: any): any {\n return node.parentNode;\n }\n\n nextSibling(node: any): any {\n return node.nextSibling;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n if (namespace) {\n name = namespace + ':' + name;\n const namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.setAttributeNS(namespaceUri, name, value);\n } else {\n el.setAttribute(name, value);\n }\n } else {\n el.setAttribute(name, value);\n }\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n if (namespace) {\n const namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.removeAttributeNS(namespaceUri, name);\n } else {\n el.removeAttribute(`${namespace}:${name}`);\n }\n } else {\n el.removeAttribute(name);\n }\n }\n\n addClass(el: any, name: string): void {\n el.classList.add(name);\n }\n\n removeClass(el: any, name: string): void {\n el.classList.remove(name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n const isVariable = style.startsWith('--');\n if (isVariable) {\n style = style.replace('%NS%', this.cssVarNamespace);\n }\n if (isVariable || flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {\n el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? 'important' : '');\n } else {\n el.style[style] = value;\n }\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n const isVariable = style.startsWith('--');\n if (isVariable) {\n style = style.replace('%NS%', this.cssVarNamespace);\n }\n if (isVariable || flags & RendererStyleFlags2.DashCase) {\n // removeProperty has no effect when used on camelCased properties.\n el.style.removeProperty(style);\n } else {\n el.style[style] = '';\n }\n }\n\n setProperty(el: any, name: string, value: any): void {\n if (el == null) {\n return;\n }\n\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n this.throwOnSyntheticProps &&\n checkNoSyntheticProp(name, 'property');\n el[name] = value;\n }\n\n setValue(node: any, value: string): void {\n node.nodeValue = value;\n }\n\n listen(\n target: 'window' | 'document' | 'body' | any,\n event: string,\n callback: (event: any) => boolean,\n options?: ListenerOptions,\n ): () => void {\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n this.throwOnSyntheticProps &&\n checkNoSyntheticProp(event, 'listener');\n if (typeof target === 'string') {\n target = getDOM().getGlobalEventTarget(this.doc, target);\n if (!target) {\n throw new RuntimeError(\n RuntimeErrorCode.UNSUPPORTED_EVENT_TARGET,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n `Unsupported event target ${target} for event ${event}`,\n );\n }\n }\n\n let wrappedCallback = this.decoratePreventDefault(callback);\n\n if (this.tracingService?.wrapEventListener) {\n wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);\n }\n\n return this.eventManager.addEventListener(\n target,\n event,\n wrappedCallback,\n options,\n ) as VoidFunction;\n }\n\n private decoratePreventDefault(eventHandler: Function): Function {\n // `DebugNode.triggerEventHandler` needs to know if the listener was created with\n // decoratePreventDefault or is a listener added outside the Angular context so it can handle\n // the two differently. In the first case, the special '__ngUnwrap__' token is passed to the\n // unwrap the listener (see below).\n return (event: any) => {\n // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The\n // debug_node can inspect the listener toString contents for the existence of this special\n // token. Because the token is a string literal, it is ensured to not be modified by compiled\n // code.\n if (event === '__ngUnwrap__') {\n return eventHandler;\n }\n\n // Run the event handler inside the ngZone because event handlers are not patched\n // by Zone on the server. This is required only for tests.\n const allowDefaultBehavior =\n typeof ngServerMode !== 'undefined' && ngServerMode\n ? this.ngZone.runGuarded(() => eventHandler(event))\n : eventHandler(event);\n if (allowDefaultBehavior === false) {\n event.preventDefault();\n }\n\n return undefined;\n };\n }\n}\n\nconst AT_CHARCODE = (() => '@'.charCodeAt(0))();\n\nfunction checkNoSyntheticProp(name: string, nameKind: string) {\n if (name.charCodeAt(0) === AT_CHARCODE) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_SYNTHETIC_PROPERTY,\n `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:\n - Make sure \\`provideAnimationsAsync()\\`, \\`provideAnimations()\\` or \\`provideNoopAnimations()\\` call was added to a list of providers used to bootstrap an application.\n - There is a corresponding animation configuration named \\`${name}\\` defined in the \\`animations\\` field of the \\`@Component\\` decorator (see https://angular.dev/api/core/Component#animations).`,\n );\n }\n}\n\nfunction isTemplateNode(node: any): node is HTMLTemplateElement {\n return node.tagName === 'TEMPLATE' && node.content !== undefined;\n}\n\nclass ShadowDomRenderer extends DefaultDomRenderer2 {\n private shadowRoot: any;\n\n constructor(\n eventManager: EventManager,\n private hostEl: any,\n component: RendererType2,\n doc: Document,\n ngZone: NgZone,\n nonce: string | null,\n tracingService: TracingService<TracingSnapshot> | null,\n cssVarNamespace: string,\n private sharedStylesHost?: SharedStylesHost,\n ) {\n super(eventManager, doc, ngZone, tracingService, cssVarNamespace);\n this.shadowRoot = (hostEl as any).attachShadow({mode: 'open'});\n\n // SharedStylesHost is used to add styles to the shadow root by ShadowDom.\n // This is optional as it is not used by ExperimentalIsolatedShadowDom.\n if (this.sharedStylesHost) {\n this.sharedStylesHost.addHost(this.shadowRoot);\n }\n let styles = component.styles;\n if (ngDevMode) {\n // We only do this in development, as for production users should not add CSS sourcemaps to components.\n const baseHref = getDOM().getBaseHref(doc) ?? '';\n styles = addBaseHrefToCssSourceMap(baseHref, styles);\n }\n\n styles = shimStylesContent(component.id, styles).map((s) =>\n s.replace(/%NS%/g, cssVarNamespace),\n );\n\n for (const style of styles) {\n const styleEl = document.createElement('style');\n\n if (nonce) {\n styleEl.setAttribute('nonce', nonce);\n }\n\n styleEl.textContent = style;\n this.shadowRoot.appendChild(styleEl);\n }\n\n // Apply any external component styles to the shadow root for the component's element.\n // The ShadowDOM renderer uses an alternative execution path for component styles that\n // does not use the SharedStylesHost that other encapsulation modes leverage. Much like\n // the manual addition of embedded styles directly above, any external stylesheets\n // must be manually added here to ensure ShadowDOM components are correctly styled.\n // TODO: Consider reworking the DOM Renderers to consolidate style handling.\n const styleUrls = component.getExternalStyles?.();\n if (styleUrls) {\n for (const styleUrl of styleUrls) {\n const linkEl = createLinkElement(styleUrl, doc);\n if (nonce) {\n linkEl.setAttribute('nonce', nonce);\n }\n this.shadowRoot.appendChild(linkEl);\n }\n }\n }\n\n private nodeOrShadowRoot(node: any): any {\n return node === this.hostEl ? this.shadowRoot : node;\n }\n\n override appendChild(parent: any, newChild: any): void {\n return super.appendChild(this.nodeOrShadowRoot(parent), newChild);\n }\n\n override insertBefore(parent: any, newChild: any, refChild: any): void {\n return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);\n }\n\n override removeChild(_parent: any, oldChild: any): void {\n return super.removeChild(null, oldChild);\n }\n\n override parentNode(node: any): any {\n return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));\n }\n\n override destroy() {\n if (this.sharedStylesHost) {\n this.sharedStylesHost.removeHost(this.shadowRoot);\n }\n }\n}\n\nclass NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {\n private readonly styles: string[];\n private readonly styleUrls?: string[];\n\n constructor(\n eventManager: EventManager,\n private readonly sharedStylesHost: SharedStylesHost,\n component: RendererType2,\n private removeStylesOnCompDestroy: boolean,\n doc: Document,\n ngZone: NgZone,\n tracingService: TracingService<TracingSnapshot> | null,\n cssVarNamespace: string,\n compId?: string,\n ) {\n super(eventManager, doc, ngZone, tracingService, cssVarNamespace);\n let styles = component.styles;\n if (ngDevMode) {\n // We only do this in development, as for production users should not add CSS sourcemaps to components.\n const baseHref = getDOM().getBaseHref(doc) ?? '';\n styles = addBaseHrefToCssSourceMap(baseHref, styles);\n }\n\n const shimmed = compId ? shimStylesContent(compId, styles) : styles;\n this.styles = shimmed.map((s) => s.replace(/%NS%/g, cssVarNamespace));\n this.styleUrls = component.getExternalStyles?.(compId);\n }\n\n applyStyles(): void {\n this.sharedStylesHost.addStyles(this.styles, this.styleUrls);\n }\n\n override destroy(): void {\n if (!this.removeStylesOnCompDestroy) {\n return;\n }\n if (allLeavingAnimations.size === 0) {\n this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);\n }\n }\n}\n\nclass EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {\n private contentAttr: string;\n private hostAttr: string;\n\n constructor(\n eventManager: EventManager,\n sharedStylesHost: SharedStylesHost,\n component: RendererType2,\n appId: string,\n removeStylesOnCompDestroy: boolean,\n doc: Document,\n ngZone: NgZone,\n tracingService: TracingService<TracingSnapshot> | null,\n cssVarNamespace: string,\n ) {\n const compId = appId + '-' + component.id;\n super(\n eventManager,\n sharedStylesHost,\n component,\n removeStylesOnCompDestroy,\n doc,\n ngZone,\n tracingService,\n cssVarNamespace,\n compId,\n );\n this.contentAttr = shimContentAttribute(compId);\n this.hostAttr = shimHostAttribute(compId);\n }\n\n applyToHost(element: any): void {\n this.applyStyles();\n this.setAttribute(element, this.hostAttr, '');\n }\n\n override createElement(parent: any, name: string): Element {\n const el = super.createElement(parent, name);\n super.setAttribute(el, this.contentAttr, '');\n return el;\n }\n}\n"],"names":["RuntimeError","i1.EventManager","SHARED_STYLES_HOST","TracingService","getDOM","allLeavingAnimations"],"mappings":";;;;;;;;;;MAqBsB,kBAAkB,CAAA;EAElB,IAAA;EAApB,WAAA,CAAoB,IAAS,EAAA;IAAT,IAAA,CAAA,IAAI,GAAJ,IAAI;AAAQ,EAAA;EAGhC,OAAO;AAgBR;;AC7BK,MAAO,eAAgB,SAAQ,kBAAkB,CAAA;EACrD,WAAA,CAA8B,GAAQ,EAAA;IACpC,KAAK,CAAC,GAAG,CAAC;AACZ,EAAA;EAIS,QAAQ,CAAC,SAAiB,EAAA;AACjC,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