@angular/platform-browser 21.0.0-next.1 → 21.0.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dom_renderer-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-browser/src/dom/events/dom_events.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-browser/src/dom/events/event_manager.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-browser/src/dom/shared_styles_host.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/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 {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} 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 */\nfunction addServerStyles(\n doc: Document,\n appId: string,\n inline: Map<string, UsageRecord<HTMLStyleElement>>,\n external: Map<string, UsageRecord<HTMLLinkElement>>,\n): void {\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) {\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}\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 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 addServerStyles(doc, appId, this.inline, this.external);\n this.hosts.add(doc.head);\n }\n\n /**\n * Adds embedded styles to the DOM via HTML `style` elements.\n * @param styles An array of style content strings.\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 /**\n * Adds a host node to the set of style hosts and adds all existing style usage to\n * the newly added host node.\n *\n * This is currently only used for Shadow DOM encapsulation mode.\n */\n addHost(hostNode: Node): void {\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\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 PLATFORM_ID,\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} 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*\\*\\//;\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 providedIn: 'root',\n factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,\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 platformIsServer: boolean;\n\n constructor(\n private readonly eventManager: EventManager,\n 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 @Inject(PLATFORM_ID) readonly platformId: Object,\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 ) {\n this.platformIsServer = typeof ngServerMode !== 'undefined' && ngServerMode;\n this.defaultRenderer = new DefaultDomRenderer2(\n eventManager,\n doc,\n ngZone,\n this.platformIsServer,\n this.tracingService,\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.IsolatedShadowDom)\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 platformIsServer = this.platformIsServer;\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 platformIsServer,\n tracingService,\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 platformIsServer,\n tracingService,\n sharedStylesHost,\n );\n case ViewEncapsulation.IsolatedShadowDom:\n return new ShadowDomRenderer(\n eventManager,\n element,\n type,\n doc,\n ngZone,\n this.nonce,\n platformIsServer,\n tracingService,\n );\n\n default:\n renderer = new NoneEncapsulationDomRenderer(\n eventManager,\n sharedStylesHost,\n type,\n removeStylesOnCompDestroy,\n doc,\n ngZone,\n platformIsServer,\n tracingService,\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 platformIsServer: boolean,\n private readonly tracingService: TracingService<TracingSnapshot> | null,\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 if (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 if (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 platformIsServer: boolean,\n tracingService: TracingService<TracingSnapshot> | null,\n private sharedStylesHost?: SharedStylesHost,\n ) {\n super(eventManager, doc, ngZone, platformIsServer, tracingService);\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 IsolatedShadowDom.\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);\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 platformIsServer: boolean,\n tracingService: TracingService<TracingSnapshot> | null,\n compId?: string,\n ) {\n super(eventManager, doc, ngZone, platformIsServer, tracingService);\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 this.styles = compId ? shimStylesContent(compId, styles) : styles;\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 platformIsServer: boolean,\n tracingService: TracingService<TracingSnapshot> | null,\n ) {\n const compId = appId + '-' + component.id;\n super(\n eventManager,\n sharedStylesHost,\n component,\n removeStylesOnCompDestroy,\n doc,\n ngZone,\n platformIsServer,\n tracingService,\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":["addEventListener","element","eventName","handler","options","removeEventListener","target","callback","EVENT_MANAGER_PLUGINS","InjectionToken","ngDevMode","undefined","EventManager","_zone","_plugins","otherPlugins","slice","reverse","domEventPlugin","plugins","find","p","DomEventsPlugin","push","elements","remove","external","set","styleElement","href","usage","textContent","inline","linkElement","doc","createElement","nonce","Map","platformId","appId","hosts","add","head","value","styles","removeStyles","urls","addUsage","usages","creator","record","get","forEach","setAttribute","map","host","addElement","NAMESPACE_URIS","SOURCEMAP_URL_REGEXP","PROTOCOL_REGEXP","COMPONENT_VARIABLE","HOST_ATTR","CONTENT_ATTR","shimHostAttribute","componentShortId","COMPONENT_REGEX","s","replace","compId","cssContent","_","sourceMapUrl","startsWith","test","resolvedSourceMapUrl","ngZone","tracingService","rendererByCompId","defaultRenderer","platformIsServer","constructor","eventManager","sharedStylesHost","removeStylesOnCompDestroy","ngServerMode","DefaultDomRenderer2","createRenderer","type","encapsulation","ViewEncapsulation","ShadowDom","Emulated","id","renderer","EmulatedEncapsulationDomRenderer2","ShadowDomRenderer","IsolatedShadowDom","NoneEncapsulationDomRenderer","clear","componentReplaced","componentId","delete","Injectable","ctorParameters","i1","i2","decorators","Document","throwOnSyntheticProps","name","namespace","createElementNS","createComment","createTextNode","appendChild","parent","newChild","isTemplateNode","content","targetParent","insertBefore","refChild","removeChild","_parent","oldChild","selectRootElement","selectorOrNode","preserveContent","el","querySelector","node","parentNode","nextSibling","namespaceUri","setAttributeNS","removeAttributeNS","removeAttribute","removeClass","setStyle","style","flags","RendererStyleFlags2","DashCase","Important","removeProperty","setProperty","checkNoSyntheticProp","event","getDOM","getGlobalEventTarget","RuntimeError","wrappedCallback","decoratePreventDefault","wrapEventListener","eventHandler","allowDefaultBehavior","runGuarded","charCodeAt","nameKind","AT_CHARCODE","tagName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAwBW,OAAA,IAAA;;AAOAA,EAAAA,gBAAAA,CAAAC,OAAA,EAAAC,SAAA,EAAAC,OAAA,EAAAC,OAAA,EAAA;;8EASyE,CAAA;;AA3BvEC,EAAAA,mBAAAA,CAAAC,MAAA,EAAAJ,SAAA,EAAAK,QAAA,EAAAH,OAAA,EAAA;;;kBADF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmCNI,MAAAA,qBAAA,OAAAC,cAAA,CAAA,OAAAC,SAAA,KAAAC,SAAA,IAAAD,SAAA,GAAA,qBAAA,GAAA,EAAA;MAUIE,YAAA,CAAA;EAKHC,KAAA;;;;IAsBJ,IAAAA,CAAAA,KAAA,GAAAA,KAAA;;;;;AARA,IAAA,IAAA,CAAAC,QAAA,GAAAC,YAAA,CAAAC,KAAA,GAAAC,OAAA,EAAA;IAQA,MAAAC,cAAA,GAAAC,OAAA,CAAAC,IAAA,CAAAC,CAAA,IAAAA,CAAA,YAAAC,eAAA,CAAA;;AAIG,MAAA,IAAA,CAAAR,QAAA,CAAAS,IAAA,CAAAL,cAAA,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,KAAA3G,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * @license Angular v21.0.0-next.10
3
+ * (c) 2010-2025 Google LLC. https://angular.dev/
4
+ * License: MIT
5
+ */
6
+
7
+ import { DOCUMENT } from '@angular/common';
8
+ import * as i0 from '@angular/core';
9
+ import { inject, Injector, ɵRuntimeError as _RuntimeError, ɵChangeDetectionScheduler as _ChangeDetectionScheduler, Injectable, InjectionToken, ɵperformanceMarkFeature as _performanceMarkFeature, makeEnvironmentProviders, RendererFactory2, NgZone, ANIMATION_MODULE_TYPE } from '@angular/core';
10
+ import { DomRendererFactory2 } from './_dom_renderer-chunk.mjs';
11
+
12
+ const ANIMATION_PREFIX = '@';
13
+ class AsyncAnimationRendererFactory {
14
+ doc;
15
+ delegate;
16
+ zone;
17
+ animationType;
18
+ moduleImpl;
19
+ _rendererFactoryPromise = null;
20
+ scheduler = null;
21
+ injector = inject(Injector);
22
+ loadingSchedulerFn = inject(ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN, {
23
+ optional: true
24
+ });
25
+ _engine;
26
+ constructor(doc, delegate, zone, animationType, moduleImpl) {
27
+ this.doc = doc;
28
+ this.delegate = delegate;
29
+ this.zone = zone;
30
+ this.animationType = animationType;
31
+ this.moduleImpl = moduleImpl;
32
+ }
33
+ ngOnDestroy() {
34
+ this._engine?.flush();
35
+ }
36
+ loadImpl() {
37
+ const loadFn = () => this.moduleImpl ?? import('@angular/animations/browser').then(m => m);
38
+ let moduleImplPromise;
39
+ if (this.loadingSchedulerFn) {
40
+ moduleImplPromise = this.loadingSchedulerFn(loadFn);
41
+ } else {
42
+ moduleImplPromise = loadFn();
43
+ }
44
+ return moduleImplPromise.catch(e => {
45
+ throw new _RuntimeError(5300, (typeof ngDevMode === 'undefined' || ngDevMode) && 'Async loading for animations package was ' + 'enabled, but loading failed. Angular falls back to using regular rendering. ' + "No animations will be displayed and their styles won't be applied.");
46
+ }).then(({
47
+ ɵcreateEngine,
48
+ ɵAnimationRendererFactory
49
+ }) => {
50
+ this._engine = ɵcreateEngine(this.animationType, this.doc);
51
+ const rendererFactory = new ɵAnimationRendererFactory(this.delegate, this._engine, this.zone);
52
+ this.delegate = rendererFactory;
53
+ return rendererFactory;
54
+ });
55
+ }
56
+ createRenderer(hostElement, rendererType) {
57
+ const renderer = this.delegate.createRenderer(hostElement, rendererType);
58
+ if (renderer.ɵtype === 0) {
59
+ return renderer;
60
+ }
61
+ if (typeof renderer.throwOnSyntheticProps === 'boolean') {
62
+ renderer.throwOnSyntheticProps = false;
63
+ }
64
+ const dynamicRenderer = new DynamicDelegationRenderer(renderer);
65
+ if (rendererType?.data?.['animation'] && !this._rendererFactoryPromise) {
66
+ this._rendererFactoryPromise = this.loadImpl();
67
+ }
68
+ this._rendererFactoryPromise?.then(animationRendererFactory => {
69
+ const animationRenderer = animationRendererFactory.createRenderer(hostElement, rendererType);
70
+ dynamicRenderer.use(animationRenderer);
71
+ this.scheduler ??= this.injector.get(_ChangeDetectionScheduler, null, {
72
+ optional: true
73
+ });
74
+ this.scheduler?.notify(10);
75
+ }).catch(e => {
76
+ dynamicRenderer.use(renderer);
77
+ });
78
+ return dynamicRenderer;
79
+ }
80
+ begin() {
81
+ this.delegate.begin?.();
82
+ }
83
+ end() {
84
+ this.delegate.end?.();
85
+ }
86
+ whenRenderingDone() {
87
+ return this.delegate.whenRenderingDone?.() ?? Promise.resolve();
88
+ }
89
+ componentReplaced(componentId) {
90
+ this._engine?.flush();
91
+ this.delegate.componentReplaced?.(componentId);
92
+ }
93
+ static ɵfac = i0.ɵɵngDeclareFactory({
94
+ minVersion: "12.0.0",
95
+ version: "21.0.0-next.10",
96
+ ngImport: i0,
97
+ type: AsyncAnimationRendererFactory,
98
+ deps: "invalid",
99
+ target: i0.ɵɵFactoryTarget.Injectable
100
+ });
101
+ static ɵprov = i0.ɵɵngDeclareInjectable({
102
+ minVersion: "12.0.0",
103
+ version: "21.0.0-next.10",
104
+ ngImport: i0,
105
+ type: AsyncAnimationRendererFactory
106
+ });
107
+ }
108
+ i0.ɵɵngDeclareClassMetadata({
109
+ minVersion: "12.0.0",
110
+ version: "21.0.0-next.10",
111
+ ngImport: i0,
112
+ type: AsyncAnimationRendererFactory,
113
+ decorators: [{
114
+ type: Injectable
115
+ }],
116
+ ctorParameters: () => [{
117
+ type: Document
118
+ }, {
119
+ type: i0.RendererFactory2
120
+ }, {
121
+ type: i0.NgZone
122
+ }, {
123
+ type: undefined
124
+ }, {
125
+ type: Promise
126
+ }]
127
+ });
128
+ class DynamicDelegationRenderer {
129
+ delegate;
130
+ replay = [];
131
+ ɵtype = 1;
132
+ constructor(delegate) {
133
+ this.delegate = delegate;
134
+ }
135
+ use(impl) {
136
+ this.delegate = impl;
137
+ if (this.replay !== null) {
138
+ for (const fn of this.replay) {
139
+ fn(impl);
140
+ }
141
+ this.replay = null;
142
+ }
143
+ }
144
+ get data() {
145
+ return this.delegate.data;
146
+ }
147
+ destroy() {
148
+ this.replay = null;
149
+ this.delegate.destroy();
150
+ }
151
+ createElement(name, namespace) {
152
+ return this.delegate.createElement(name, namespace);
153
+ }
154
+ createComment(value) {
155
+ return this.delegate.createComment(value);
156
+ }
157
+ createText(value) {
158
+ return this.delegate.createText(value);
159
+ }
160
+ get destroyNode() {
161
+ return this.delegate.destroyNode;
162
+ }
163
+ appendChild(parent, newChild) {
164
+ this.delegate.appendChild(parent, newChild);
165
+ }
166
+ insertBefore(parent, newChild, refChild, isMove) {
167
+ this.delegate.insertBefore(parent, newChild, refChild, isMove);
168
+ }
169
+ removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval) {
170
+ this.delegate.removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval);
171
+ }
172
+ selectRootElement(selectorOrNode, preserveContent) {
173
+ return this.delegate.selectRootElement(selectorOrNode, preserveContent);
174
+ }
175
+ parentNode(node) {
176
+ return this.delegate.parentNode(node);
177
+ }
178
+ nextSibling(node) {
179
+ return this.delegate.nextSibling(node);
180
+ }
181
+ setAttribute(el, name, value, namespace) {
182
+ this.delegate.setAttribute(el, name, value, namespace);
183
+ }
184
+ removeAttribute(el, name, namespace) {
185
+ this.delegate.removeAttribute(el, name, namespace);
186
+ }
187
+ addClass(el, name) {
188
+ this.delegate.addClass(el, name);
189
+ }
190
+ removeClass(el, name) {
191
+ this.delegate.removeClass(el, name);
192
+ }
193
+ setStyle(el, style, value, flags) {
194
+ this.delegate.setStyle(el, style, value, flags);
195
+ }
196
+ removeStyle(el, style, flags) {
197
+ this.delegate.removeStyle(el, style, flags);
198
+ }
199
+ setProperty(el, name, value) {
200
+ if (this.shouldReplay(name)) {
201
+ this.replay.push(renderer => renderer.setProperty(el, name, value));
202
+ }
203
+ this.delegate.setProperty(el, name, value);
204
+ }
205
+ setValue(node, value) {
206
+ this.delegate.setValue(node, value);
207
+ }
208
+ listen(target, eventName, callback, options) {
209
+ if (this.shouldReplay(eventName)) {
210
+ this.replay.push(renderer => renderer.listen(target, eventName, callback, options));
211
+ }
212
+ return this.delegate.listen(target, eventName, callback, options);
213
+ }
214
+ shouldReplay(propOrEventName) {
215
+ return this.replay !== null && propOrEventName.startsWith(ANIMATION_PREFIX);
216
+ }
217
+ }
218
+ const ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN = new InjectionToken(typeof ngDevMode !== undefined && ngDevMode ? 'async_animation_loading_scheduler_fn' : '');
219
+
220
+ function provideAnimationsAsync(type = 'animations') {
221
+ _performanceMarkFeature('NgAsyncAnimations');
222
+ if (typeof ngServerMode !== 'undefined' && ngServerMode) {
223
+ type = 'noop';
224
+ }
225
+ return makeEnvironmentProviders([{
226
+ provide: RendererFactory2,
227
+ useFactory: () => {
228
+ return new AsyncAnimationRendererFactory(inject(DOCUMENT), inject(DomRendererFactory2), inject(NgZone), type);
229
+ }
230
+ }, {
231
+ provide: ANIMATION_MODULE_TYPE,
232
+ useValue: type === 'noop' ? 'NoopAnimations' : 'BrowserAnimations'
233
+ }]);
234
+ }
235
+
236
+ export { provideAnimationsAsync, ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN, AsyncAnimationRendererFactory as ɵAsyncAnimationRendererFactory };
237
+ //# sourceMappingURL=animations-async.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animations-async.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-browser/animations/async/src/async_animation_renderer.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-browser/animations/async/src/providers.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 {\n ɵAnimationEngine as AnimationEngine,\n ɵAnimationRenderer as AnimationRenderer,\n ɵAnimationRendererFactory as AnimationRendererFactory,\n} from '@angular/animations/browser';\nimport {\n ɵAnimationRendererType as AnimationRendererType,\n ɵChangeDetectionScheduler as ChangeDetectionScheduler,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n NgZone,\n ɵNotificationSource as NotificationSource,\n OnDestroy,\n Renderer2,\n RendererFactory2,\n RendererStyleFlags2,\n RendererType2,\n ɵRuntimeError as RuntimeError,\n type ListenerOptions,\n} from '@angular/core';\nimport {ɵRuntimeErrorCode as RuntimeErrorCode} from '../../../index';\n\nconst ANIMATION_PREFIX = '@';\n\n@Injectable()\nexport class AsyncAnimationRendererFactory implements OnDestroy, RendererFactory2 {\n private _rendererFactoryPromise: Promise<AnimationRendererFactory> | null = null;\n private scheduler: ChangeDetectionScheduler | null = null;\n private readonly injector = inject(Injector);\n private readonly loadingSchedulerFn = inject(ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN, {\n optional: true,\n });\n private _engine?: AnimationEngine;\n\n /**\n *\n * @param moduleImpl allows to provide a mock implmentation (or will load the animation module)\n */\n constructor(\n private doc: Document,\n private delegate: RendererFactory2,\n private zone: NgZone,\n private animationType: 'animations' | 'noop',\n private moduleImpl?: Promise<{\n ɵcreateEngine: (type: 'animations' | 'noop', doc: Document) => AnimationEngine;\n ɵAnimationRendererFactory: typeof AnimationRendererFactory;\n }>,\n ) {}\n\n /** @docs-private */\n ngOnDestroy(): void {\n // When the root view is removed, the renderer defers the actual work to the\n // `TransitionAnimationEngine` to do this, and the `TransitionAnimationEngine` doesn't actually\n // remove the DOM node, but just calls `markElementAsRemoved()`. The actual DOM node is not\n // removed until `TransitionAnimationEngine` \"flushes\".\n // Note: we already flush on destroy within the `InjectableAnimationEngine`. The injectable\n // engine is not provided when async animations are used.\n this._engine?.flush();\n }\n\n /**\n * @internal\n */\n private loadImpl(): Promise<AnimationRendererFactory> {\n // Note on the `.then(m => m)` part below: Closure compiler optimizations in g3 require\n // `.then` to be present for a dynamic import (or an import should be `await`ed) to detect\n // the set of imported symbols.\n const loadFn = () => this.moduleImpl ?? import('@angular/animations/browser').then((m) => m);\n\n let moduleImplPromise: typeof this.moduleImpl;\n if (this.loadingSchedulerFn) {\n moduleImplPromise = this.loadingSchedulerFn(loadFn);\n } else {\n moduleImplPromise = loadFn();\n }\n\n return moduleImplPromise\n .catch((e) => {\n throw new RuntimeError(\n RuntimeErrorCode.ANIMATION_RENDERER_ASYNC_LOADING_FAILURE,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Async loading for animations package was ' +\n 'enabled, but loading failed. Angular falls back to using regular rendering. ' +\n \"No animations will be displayed and their styles won't be applied.\",\n );\n })\n .then(({ɵcreateEngine, ɵAnimationRendererFactory}) => {\n // We can't create the renderer yet because we might need the hostElement and the type\n // Both are provided in createRenderer().\n this._engine = ɵcreateEngine(this.animationType, this.doc);\n const rendererFactory = new ɵAnimationRendererFactory(\n this.delegate,\n this._engine,\n this.zone,\n );\n this.delegate = rendererFactory;\n return rendererFactory;\n });\n }\n\n /**\n * This method is delegating the renderer creation to the factories.\n * It uses default factory while the animation factory isn't loaded\n * and will rely on the animation factory once it is loaded.\n *\n * Calling this method will trigger as side effect the loading of the animation module\n * if the renderered component uses animations.\n */\n createRenderer(hostElement: any, rendererType: RendererType2): Renderer2 {\n const renderer = this.delegate.createRenderer(hostElement, rendererType);\n\n if ((renderer as AnimationRenderer).ɵtype === AnimationRendererType.Regular) {\n // The factory is already loaded, this is an animation renderer\n return renderer;\n }\n\n // We need to prevent the DomRenderer to throw an error because of synthetic properties\n if (typeof (renderer as any).throwOnSyntheticProps === 'boolean') {\n (renderer as any).throwOnSyntheticProps = false;\n }\n\n // Using a dynamic renderer to switch the renderer implementation once the module is loaded.\n const dynamicRenderer = new DynamicDelegationRenderer(renderer);\n\n // Kick off the module loading if the component uses animations but the module hasn't been\n // loaded yet.\n if (rendererType?.data?.['animation'] && !this._rendererFactoryPromise) {\n this._rendererFactoryPromise = this.loadImpl();\n }\n\n this._rendererFactoryPromise\n ?.then((animationRendererFactory) => {\n const animationRenderer = animationRendererFactory.createRenderer(\n hostElement,\n rendererType,\n );\n dynamicRenderer.use(animationRenderer);\n this.scheduler ??= this.injector.get(ChangeDetectionScheduler, null, {optional: true});\n this.scheduler?.notify(NotificationSource.AsyncAnimationsLoaded);\n })\n .catch((e) => {\n // Permanently use regular renderer when loading fails.\n dynamicRenderer.use(renderer);\n });\n\n return dynamicRenderer;\n }\n\n begin(): void {\n this.delegate.begin?.();\n }\n\n end(): void {\n this.delegate.end?.();\n }\n\n whenRenderingDone?(): Promise<any> {\n return this.delegate.whenRenderingDone?.() ?? Promise.resolve();\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 // Flush the engine since the renderer destruction waits for animations to be done.\n this._engine?.flush();\n (this.delegate as {componentReplaced?: (id: string) => void}).componentReplaced?.(componentId);\n }\n}\n\n/**\n * The class allows to dynamicly switch between different renderer implementations\n * by changing the delegate renderer.\n */\nexport class DynamicDelegationRenderer implements Renderer2 {\n // List of callbacks that need to be replayed on the animation renderer once its loaded\n private replay: ((renderer: Renderer2) => void)[] | null = [];\n readonly ɵtype = AnimationRendererType.Delegated;\n\n constructor(private delegate: Renderer2) {}\n\n use(impl: Renderer2) {\n this.delegate = impl;\n\n if (this.replay !== null) {\n // Replay queued actions using the animation renderer to apply\n // all events and properties collected while loading was in progress.\n for (const fn of this.replay) {\n fn(impl);\n }\n // Set to `null` to indicate that the queue was processed\n // and we no longer need to collect events and properties.\n this.replay = null;\n }\n }\n\n get data(): {[key: string]: any} {\n return this.delegate.data;\n }\n\n destroy(): void {\n this.replay = null;\n this.delegate.destroy();\n }\n\n createElement(name: string, namespace?: string | null) {\n return this.delegate.createElement(name, namespace);\n }\n\n createComment(value: string): void {\n return this.delegate.createComment(value);\n }\n\n createText(value: string): any {\n return this.delegate.createText(value);\n }\n\n get destroyNode(): ((node: any) => void) | null {\n return this.delegate.destroyNode;\n }\n\n appendChild(parent: any, newChild: any): void {\n this.delegate.appendChild(parent, newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean | undefined): void {\n this.delegate.insertBefore(parent, newChild, refChild, isMove);\n }\n\n removeChild(\n parent: any,\n oldChild: any,\n isHostElement?: boolean | undefined,\n requireSynchronousElementRemoval?: boolean,\n ): void {\n this.delegate.removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval);\n }\n\n selectRootElement(selectorOrNode: any, preserveContent?: boolean | undefined): any {\n return this.delegate.selectRootElement(selectorOrNode, preserveContent);\n }\n\n parentNode(node: any): any {\n return this.delegate.parentNode(node);\n }\n\n nextSibling(node: any): any {\n return this.delegate.nextSibling(node);\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string | null | undefined): void {\n this.delegate.setAttribute(el, name, value, namespace);\n }\n\n removeAttribute(el: any, name: string, namespace?: string | null | undefined): void {\n this.delegate.removeAttribute(el, name, namespace);\n }\n\n addClass(el: any, name: string): void {\n this.delegate.addClass(el, name);\n }\n\n removeClass(el: any, name: string): void {\n this.delegate.removeClass(el, name);\n }\n\n setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2 | undefined): void {\n this.delegate.setStyle(el, style, value, flags);\n }\n\n removeStyle(el: any, style: string, flags?: RendererStyleFlags2 | undefined): void {\n this.delegate.removeStyle(el, style, flags);\n }\n\n setProperty(el: any, name: string, value: any): void {\n // We need to keep track of animation properties set on default renderer\n // So we can also set them also on the animation renderer\n if (this.shouldReplay(name)) {\n this.replay!.push((renderer: Renderer2) => renderer.setProperty(el, name, value));\n }\n this.delegate.setProperty(el, name, value);\n }\n\n setValue(node: any, value: string): void {\n this.delegate.setValue(node, value);\n }\n\n listen(\n target: any,\n eventName: string,\n callback: (event: any) => boolean | void,\n options?: ListenerOptions,\n ): () => void {\n // We need to keep track of animation events registred by the default renderer\n // So we can also register them against the animation renderer\n if (this.shouldReplay(eventName)) {\n this.replay!.push((renderer: Renderer2) =>\n renderer.listen(target, eventName, callback, options),\n );\n }\n return this.delegate.listen(target, eventName, callback, options);\n }\n\n private shouldReplay(propOrEventName: string): boolean {\n //`null` indicates that we no longer need to collect events and properties\n return this.replay !== null && propOrEventName.startsWith(ANIMATION_PREFIX);\n }\n}\n\n/**\n * Provides a custom scheduler function for the async loading of the animation package.\n *\n * Private token for investigation purposes\n */\nexport const ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN = new InjectionToken<<T>(loadFn: () => T) => T>(\n typeof ngDevMode !== undefined && ngDevMode ? 'async_animation_loading_scheduler_fn' : '',\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 ANIMATION_MODULE_TYPE,\n EnvironmentProviders,\n makeEnvironmentProviders,\n NgZone,\n RendererFactory2,\n ɵperformanceMarkFeature as performanceMarkFeature,\n inject,\n} from '@angular/core';\nimport {ɵDomRendererFactory2 as DomRendererFactory2} from '../../../index';\n\nimport {AsyncAnimationRendererFactory} from './async_animation_renderer';\n\n/**\n * Returns the set of dependency-injection providers\n * to enable animations in an application. See [animations guide](guide/animations)\n * to learn more about animations in Angular.\n *\n * When you use this function instead of the eager `provideAnimations()`, animations won't be\n * rendered until the renderer is loaded.\n *\n * @usageNotes\n *\n * The function is useful when you want to enable animations in an application\n * bootstrapped using the `bootstrapApplication` function. In this scenario there\n * is no need to import the `BrowserAnimationsModule` NgModule at all, just add\n * providers returned by this function to the `providers` list as show below.\n *\n * ```ts\n * bootstrapApplication(RootComponent, {\n * providers: [\n * provideAnimationsAsync()\n * ]\n * });\n * ```\n *\n * @param type pass `'noop'` as argument to disable animations.\n *\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\nexport function provideAnimationsAsync(\n type: 'animations' | 'noop' = 'animations',\n): EnvironmentProviders {\n performanceMarkFeature('NgAsyncAnimations');\n\n // Animations don't work on the server so we switch them over to no-op automatically.\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n type = 'noop';\n }\n\n return makeEnvironmentProviders([\n {\n provide: RendererFactory2,\n useFactory: () => {\n return new AsyncAnimationRendererFactory(\n inject(DOCUMENT),\n inject(DomRendererFactory2),\n inject(NgZone),\n type,\n );\n },\n },\n {\n provide: ANIMATION_MODULE_TYPE,\n useValue: type === 'noop' ? 'NoopAnimations' : 'BrowserAnimations',\n },\n ]);\n}\n"],"names":["AsyncAnimationRendererFactory","delegate","zone","animationType","moduleImpl","_rendererFactoryPromise","scheduler","loadingSchedulerFn","inject","ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN","optional","_engine","ngOnDestroy","flush","loadFn","then","m","moduleImplPromise","catch","e","RuntimeError","ngDevMode","ɵcreateEngine","ɵAnimationRendererFactory","doc","rendererFactory","createRenderer","hostElement","rendererType","renderer","ɵtype","throwOnSyntheticProps","data","loadImpl","animationRendererFactory","animationRenderer","use","ChangeDetectionScheduler","notify","dynamicRenderer","begin","end","whenRenderingDone","Promise","resolve","componentReplaced","componentId","deps","target","i0","ɵɵFactoryTarget","Injectable","decorators","DynamicDelegationRenderer","replay","impl","fn","destroy","createElement","name","namespace","createComment","value","createText","destroyNode","appendChild","parent","newChild","makeEnvironmentProviders"],"mappings":";;;;;;;;;;;sBAgE2D,GAAA,GAAA;AAGvD,MAAKA,6BAAiB,CAAA;;EAgBpBC,QAAA;EACDC,IAAA;EAEDC,aAAA;EACGC,UAAA;AAnBJC,EAAAA,uBAAA,GAAA,IAAA;AAEDC,EAAAA,SAAA,GAAA,IAAA;;AAEGC,EAAAA,kBAAA,GAAAC,MAAA,CAAAC,qCAAA,EAAA;AACKC,IAAAA,QAAQ,EAAA;;EAE4EC,OAAA;iBAOlF,EACNV,QAA0B,EAC3BC,IAAA,EAEDC,aAAwB,EACrBC;YALK,MAAA;IACN,IAAAH,CAAAA,QAAiB,GAAjBA,QAAiB;IAClB,IAAAC,CAAAA,IAAA,GAAAA,IAAA;IAED,IAAAC,CAAAA,aAAwB,GAAxBA,aAAwB;IACrB,IAAAC,CAAAA,UAAQ,GAARA,UAAQ;AAMD;aAIgFQ,GAAA;AAW5F,IAAA,IAAC,CAAAD,OAAA,EAAAE,KAAA,EAAA;AAED;;AASE,IAAA,MAAAC,MAAc,GAAAA,MAAG,IAAI,CAACV,UAAuB,IAAA,OAAA,6BAA2B,CAAC,CAAAW,IAAA,CAAAC,CAAA,IAAAA,CAAA,CAAA;yBAGR;IAC/D,IAAA,IAAA,CAAAT,kBAAgB,EAAA;uBACjB,GAAA,IAAA,CAAAA,kBAAA,CAAAO,MAAA,CAAA;WAEsF;MACvFG,iBAA4B,GAAAH;AACzB;WAGyFG,iBAAA,CAC5FC,KAAA,CAAMC;AAEN,MAAA,MAA0F,IAAAC,aAAA,CAAA,IAAA,EAE1F,CAAA,OAAgBC,SAAM,KAAE,WAAC,IAAYA,SAAU,KAC7C,2CAAoC,GACrC,8EAAA,GAE2B,oEAA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