@angular/platform-browser 19.0.0-next.6 → 19.0.0-next.8

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.0.0-next.6
2
+ * @license Angular v19.0.0-next.8
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7,7 +7,7 @@
7
7
  import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, isPlatformServer, DOCUMENT, ɵPLATFORM_BROWSER_ID, XhrFactory, CommonModule } from '@angular/common';
8
8
  export { ɵgetDOM } from '@angular/common';
9
9
  import * as i0 from '@angular/core';
10
- import { ɵglobal, ɵRuntimeError, Injectable, InjectionToken, Inject, APP_ID, CSP_NONCE, PLATFORM_ID, Optional, ViewEncapsulation, RendererStyleFlags2, inject, ɵGLOBAL_EVENT_DELEGATION, ɵinternalCreateApplication, ErrorHandler, ɵsetDocument, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵTESTABILITY_GETTER, ɵTESTABILITY, Testability, NgZone, TestabilityRegistry, ɵINJECTOR_SCOPE, RendererFactory2, ApplicationModule, NgModule, SkipSelf, ApplicationRef, ɵConsole, forwardRef, ɵXSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, ɵwithI18nSupport, ɵwithEventReplay, ENVIRONMENT_INITIALIZER, ɵformatRuntimeError, makeEnvironmentProviders, ɵwithDomHydration, Version } from '@angular/core';
10
+ import { ɵglobal, ɵRuntimeError, Injectable, InjectionToken, Inject, APP_ID, CSP_NONCE, PLATFORM_ID, Optional, ViewEncapsulation, RendererStyleFlags2, ɵinternalCreateApplication, ErrorHandler, ɵsetDocument, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵTESTABILITY_GETTER, ɵTESTABILITY, Testability, NgZone, TestabilityRegistry, ɵINJECTOR_SCOPE, RendererFactory2, ApplicationModule, NgModule, SkipSelf, ApplicationRef, ɵConsole, forwardRef, ɵXSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, ɵwithI18nSupport, ɵwithEventReplay, ENVIRONMENT_INITIALIZER, inject, ɵZONELESS_ENABLED, ɵformatRuntimeError, makeEnvironmentProviders, ɵwithDomHydration, Version } from '@angular/core';
11
11
  import { ɵwithHttpTransferCache } from '@angular/common/http';
12
12
 
13
13
  /**
@@ -155,10 +155,10 @@ class BrowserXhr {
155
155
  build() {
156
156
  return new XMLHttpRequest();
157
157
  }
158
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
159
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserXhr }); }
158
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
159
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserXhr }); }
160
160
  }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserXhr, decorators: [{
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserXhr, decorators: [{
162
162
  type: Injectable
163
163
  }] });
164
164
 
@@ -220,10 +220,10 @@ class EventManager {
220
220
  this._eventNameToPlugin.set(eventName, plugin);
221
221
  return plugin;
222
222
  }
223
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
224
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventManager }); }
223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
224
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: EventManager }); }
225
225
  }
226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventManager, decorators: [{
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: EventManager, decorators: [{
227
227
  type: Injectable
228
228
  }], ctorParameters: () => [{ type: undefined, decorators: [{
229
229
  type: Inject,
@@ -246,138 +246,173 @@ class EventManagerPlugin {
246
246
 
247
247
  /** The style elements attribute name used to set value of `APP_ID` token. */
248
248
  const APP_ID_ATTRIBUTE_NAME = 'ng-app-id';
249
+ /**
250
+ * Removes all provided elements from the document.
251
+ * @param elements An array of HTML Elements.
252
+ */
253
+ function removeElements(elements) {
254
+ for (const element of elements) {
255
+ element.remove();
256
+ }
257
+ }
258
+ /**
259
+ * Creates a `style` element with the provided inline style content.
260
+ * @param style A string of the inline style content.
261
+ * @param doc A DOM Document to use to create the element.
262
+ * @returns An HTMLStyleElement instance.
263
+ */
264
+ function createStyleElement(style, doc) {
265
+ const styleElement = doc.createElement('style');
266
+ styleElement.textContent = style;
267
+ return styleElement;
268
+ }
269
+ /**
270
+ * Searches a DOM document's head element for style elements with a matching application
271
+ * identifier attribute (`ng-app-id`) to the provide identifier and adds usage records for each.
272
+ * @param doc An HTML DOM document instance.
273
+ * @param appId A string containing an Angular application identifer.
274
+ * @param usages A Map object for tracking style usage.
275
+ */
276
+ function addServerStyles(doc, appId, usages) {
277
+ const styleElements = doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`);
278
+ if (styleElements) {
279
+ for (const styleElement of styleElements) {
280
+ if (styleElement.textContent) {
281
+ styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);
282
+ usages.set(styleElement.textContent, { usage: 0, elements: [styleElement] });
283
+ }
284
+ }
285
+ }
286
+ }
287
+ /**
288
+ * Creates a `link` element for the provided external style URL.
289
+ * @param url A string of the URL for the stylesheet.
290
+ * @param doc A DOM Document to use to create the element.
291
+ * @returns An HTMLLinkElement instance.
292
+ */
293
+ function createLinkElement(url, doc) {
294
+ const linkElement = doc.createElement('link');
295
+ linkElement.setAttribute('rel', 'stylesheet');
296
+ linkElement.setAttribute('href', url);
297
+ return linkElement;
298
+ }
249
299
  class SharedStylesHost {
250
300
  constructor(doc, appId, nonce, platformId = {}) {
251
301
  this.doc = doc;
252
302
  this.appId = appId;
253
303
  this.nonce = nonce;
254
- this.platformId = platformId;
255
- // Maps all registered host nodes to a list of style nodes that have been added to the host node.
256
- this.styleRef = new Map();
257
- this.hostNodes = new Set();
258
- this.styleNodesInDOM = this.collectServerRenderedStyles();
259
- this.platformIsServer = isPlatformServer(platformId);
260
- this.resetHostNodes();
304
+ /**
305
+ * Provides usage information for active inline style content and associated HTML <style> elements.
306
+ * Embedded styles typically originate from the `styles` metadata of a rendered component.
307
+ */
308
+ this.inline = new Map();
309
+ /**
310
+ * Provides usage information for active external style URLs and the associated HTML <link> elements.
311
+ * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
312
+ */
313
+ this.external = new Map();
314
+ /**
315
+ * Set of host DOM nodes that will have styles attached.
316
+ */
317
+ this.hosts = new Set();
318
+ this.isServer = isPlatformServer(platformId);
319
+ addServerStyles(doc, appId, this.inline);
320
+ this.hosts.add(doc.head);
261
321
  }
262
- addStyles(styles) {
263
- for (const style of styles) {
264
- const usageCount = this.changeUsageCount(style, 1);
265
- if (usageCount === 1) {
266
- this.onStyleAdded(style);
322
+ /**
323
+ * Adds embedded styles to the DOM via HTML `style` elements.
324
+ * @param styles An array of style content strings.
325
+ */
326
+ addStyles(styles, urls) {
327
+ for (const value of styles) {
328
+ this.addUsage(value, this.inline, createStyleElement);
329
+ }
330
+ urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));
331
+ }
332
+ /**
333
+ * Removes embedded styles from the DOM that were added as HTML `style` elements.
334
+ * @param styles An array of style content strings.
335
+ */
336
+ removeStyles(styles, urls) {
337
+ for (const value of styles) {
338
+ this.removeUsage(value, this.inline);
339
+ }
340
+ urls?.forEach((value) => this.removeUsage(value, this.external));
341
+ }
342
+ addUsage(value, usages, creator) {
343
+ // Attempt to get any current usage of the value
344
+ const record = usages.get(value);
345
+ // If existing, just increment the usage count
346
+ if (record) {
347
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && record.usage === 0) {
348
+ // A usage count of zero indicates a preexisting server generated style.
349
+ // This attribute is solely used for debugging purposes of SSR style reuse.
350
+ record.elements.forEach((element) => element.setAttribute('ng-style-reused', ''));
267
351
  }
352
+ record.usage++;
353
+ }
354
+ else {
355
+ // Otherwise, create an entry to track the elements and add element for each host
356
+ usages.set(value, {
357
+ usage: 1,
358
+ elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc))),
359
+ });
268
360
  }
269
361
  }
270
- removeStyles(styles) {
271
- for (const style of styles) {
272
- const usageCount = this.changeUsageCount(style, -1);
273
- if (usageCount <= 0) {
274
- this.onStyleRemoved(style);
362
+ removeUsage(value, usages) {
363
+ // Attempt to get any current usage of the value
364
+ const record = usages.get(value);
365
+ // If there is a record, reduce the usage count and if no longer used,
366
+ // remove from DOM and delete usage record.
367
+ if (record) {
368
+ record.usage--;
369
+ if (record.usage <= 0) {
370
+ removeElements(record.elements);
371
+ usages.delete(value);
275
372
  }
276
373
  }
277
374
  }
278
375
  ngOnDestroy() {
279
- const styleNodesInDOM = this.styleNodesInDOM;
280
- if (styleNodesInDOM) {
281
- styleNodesInDOM.forEach((node) => node.remove());
282
- styleNodesInDOM.clear();
376
+ for (const [, { elements }] of [...this.inline, ...this.external]) {
377
+ removeElements(elements);
283
378
  }
284
- for (const style of this.getAllStyles()) {
285
- this.onStyleRemoved(style);
286
- }
287
- this.resetHostNodes();
379
+ this.hosts.clear();
288
380
  }
381
+ /**
382
+ * Adds a host node to the set of style hosts and adds all existing style usage to
383
+ * the newly added host node.
384
+ *
385
+ * This is currently only used for Shadow DOM encapsulation mode.
386
+ */
289
387
  addHost(hostNode) {
290
- this.hostNodes.add(hostNode);
291
- for (const style of this.getAllStyles()) {
292
- this.addStyleToHost(hostNode, style);
388
+ this.hosts.add(hostNode);
389
+ // Add existing styles to new host
390
+ for (const [style, { elements }] of this.inline) {
391
+ elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));
293
392
  }
294
- }
295
- removeHost(hostNode) {
296
- this.hostNodes.delete(hostNode);
297
- }
298
- getAllStyles() {
299
- return this.styleRef.keys();
300
- }
301
- onStyleAdded(style) {
302
- for (const host of this.hostNodes) {
303
- this.addStyleToHost(host, style);
304
- }
305
- }
306
- onStyleRemoved(style) {
307
- const styleRef = this.styleRef;
308
- styleRef.get(style)?.elements?.forEach((node) => node.remove());
309
- styleRef.delete(style);
310
- }
311
- collectServerRenderedStyles() {
312
- const styles = this.doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${this.appId}"]`);
313
- if (styles?.length) {
314
- const styleMap = new Map();
315
- styles.forEach((style) => {
316
- if (style.textContent != null) {
317
- styleMap.set(style.textContent, style);
318
- }
319
- });
320
- return styleMap;
393
+ for (const [url, { elements }] of this.external) {
394
+ elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));
321
395
  }
322
- return null;
323
396
  }
324
- changeUsageCount(style, delta) {
325
- const map = this.styleRef;
326
- if (map.has(style)) {
327
- const styleRefValue = map.get(style);
328
- styleRefValue.usage += delta;
329
- return styleRefValue.usage;
330
- }
331
- map.set(style, { usage: delta, elements: [] });
332
- return delta;
333
- }
334
- getStyleElement(host, style) {
335
- const styleNodesInDOM = this.styleNodesInDOM;
336
- const styleEl = styleNodesInDOM?.get(style);
337
- if (styleEl?.parentNode === host) {
338
- // `styleNodesInDOM` cannot be undefined due to the above `styleNodesInDOM?.get`.
339
- styleNodesInDOM.delete(style);
340
- styleEl.removeAttribute(APP_ID_ATTRIBUTE_NAME);
341
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
342
- // This attribute is solely used for debugging purposes.
343
- styleEl.setAttribute('ng-style-reused', '');
344
- }
345
- return styleEl;
346
- }
347
- else {
348
- const styleEl = this.doc.createElement('style');
349
- if (this.nonce) {
350
- styleEl.setAttribute('nonce', this.nonce);
351
- }
352
- styleEl.textContent = style;
353
- if (this.platformIsServer) {
354
- styleEl.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
355
- }
356
- host.appendChild(styleEl);
357
- return styleEl;
358
- }
397
+ removeHost(hostNode) {
398
+ this.hosts.delete(hostNode);
359
399
  }
360
- addStyleToHost(host, style) {
361
- const styleEl = this.getStyleElement(host, style);
362
- const styleRef = this.styleRef;
363
- const styleElRef = styleRef.get(style)?.elements;
364
- if (styleElRef) {
365
- styleElRef.push(styleEl);
400
+ addElement(host, element) {
401
+ // Add a nonce if present
402
+ if (this.nonce) {
403
+ element.setAttribute('nonce', this.nonce);
366
404
  }
367
- else {
368
- styleRef.set(style, { elements: [styleEl], usage: 1 });
405
+ // Add application identifier when on the server to support client-side reuse
406
+ if (this.isServer) {
407
+ element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
369
408
  }
409
+ // Insert the element into the DOM with the host node as parent
410
+ return host.appendChild(element);
370
411
  }
371
- resetHostNodes() {
372
- const hostNodes = this.hostNodes;
373
- hostNodes.clear();
374
- // Re-add the head element back since this is the default host.
375
- hostNodes.add(this.doc.head);
376
- }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: SharedStylesHost, deps: [{ token: DOCUMENT }, { token: APP_ID }, { token: CSP_NONCE, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
378
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: SharedStylesHost }); }
412
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: SharedStylesHost, deps: [{ token: DOCUMENT }, { token: APP_ID }, { token: CSP_NONCE, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
413
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: SharedStylesHost }); }
379
414
  }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: SharedStylesHost, decorators: [{
415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: SharedStylesHost, decorators: [{
381
416
  type: Injectable
382
417
  }], ctorParameters: () => [{ type: Document, decorators: [{
383
418
  type: Inject,
@@ -491,10 +526,10 @@ class DomRendererFactory2 {
491
526
  ngOnDestroy() {
492
527
  this.rendererByCompId.clear();
493
528
  }
494
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: SharedStylesHost }, { token: APP_ID }, { token: REMOVE_STYLES_ON_COMPONENT_DESTROY }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: CSP_NONCE }], target: i0.ɵɵFactoryTarget.Injectable }); }
495
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomRendererFactory2 }); }
529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: SharedStylesHost }, { token: APP_ID }, { token: REMOVE_STYLES_ON_COMPONENT_DESTROY }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: CSP_NONCE }], target: i0.ɵɵFactoryTarget.Injectable }); }
530
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomRendererFactory2 }); }
496
531
  }
497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomRendererFactory2, decorators: [{
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomRendererFactory2, decorators: [{
498
533
  type: Injectable
499
534
  }], ctorParameters: () => [{ type: EventManager }, { type: SharedStylesHost }, { type: undefined, decorators: [{
500
535
  type: Inject,
@@ -733,15 +768,16 @@ class NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {
733
768
  this.sharedStylesHost = sharedStylesHost;
734
769
  this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
735
770
  this.styles = compId ? shimStylesContent(compId, component.styles) : component.styles;
771
+ this.styleUrls = component.getExternalStyles?.(compId);
736
772
  }
737
773
  applyStyles() {
738
- this.sharedStylesHost.addStyles(this.styles);
774
+ this.sharedStylesHost.addStyles(this.styles, this.styleUrls);
739
775
  }
740
776
  destroy() {
741
777
  if (!this.removeStylesOnCompDestroy) {
742
778
  return;
743
779
  }
744
- this.sharedStylesHost.removeStyles(this.styles);
780
+ this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
745
781
  }
746
782
  }
747
783
  class EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {
@@ -778,36 +814,10 @@ class DomEventsPlugin extends EventManagerPlugin {
778
814
  removeEventListener(target, eventName, callback) {
779
815
  return target.removeEventListener(eventName, callback);
780
816
  }
781
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
782
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomEventsPlugin }); }
817
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
818
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomEventsPlugin }); }
783
819
  }
784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomEventsPlugin, decorators: [{
785
- type: Injectable
786
- }], ctorParameters: () => [{ type: undefined, decorators: [{
787
- type: Inject,
788
- args: [DOCUMENT]
789
- }] }] });
790
-
791
- class EventDelegationPlugin extends EventManagerPlugin {
792
- constructor(doc) {
793
- super(doc);
794
- this.delegate = inject(ɵGLOBAL_EVENT_DELEGATION, { optional: true });
795
- }
796
- supports(eventName) {
797
- // If `GlobalDelegationEventPlugin` implementation is not provided,
798
- // this plugin is kept disabled.
799
- return this.delegate ? this.delegate.supports(eventName) : false;
800
- }
801
- addEventListener(element, eventName, handler) {
802
- return this.delegate.addEventListener(element, eventName, handler);
803
- }
804
- removeEventListener(element, eventName, callback) {
805
- return this.delegate.removeEventListener(element, eventName, callback);
806
- }
807
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventDelegationPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
808
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventDelegationPlugin }); }
809
- }
810
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: EventDelegationPlugin, decorators: [{
820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomEventsPlugin, decorators: [{
811
821
  type: Injectable
812
822
  }], ctorParameters: () => [{ type: undefined, decorators: [{
813
823
  type: Inject,
@@ -976,10 +986,10 @@ class KeyEventsPlugin extends EventManagerPlugin {
976
986
  static _normalizeKey(keyName) {
977
987
  return keyName === 'esc' ? 'escape' : keyName;
978
988
  }
979
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
980
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: KeyEventsPlugin }); }
989
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
990
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: KeyEventsPlugin }); }
981
991
  }
982
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: KeyEventsPlugin, decorators: [{
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: KeyEventsPlugin, decorators: [{
983
993
  type: Injectable
984
994
  }], ctorParameters: () => [{ type: undefined, decorators: [{
985
995
  type: Inject,
@@ -1143,11 +1153,6 @@ const BROWSER_MODULE_PROVIDERS = [
1143
1153
  deps: [DOCUMENT, NgZone, PLATFORM_ID],
1144
1154
  },
1145
1155
  { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
1146
- {
1147
- provide: EVENT_MANAGER_PLUGINS,
1148
- useClass: EventDelegationPlugin,
1149
- multi: true,
1150
- },
1151
1156
  DomRendererFactory2,
1152
1157
  SharedStylesHost,
1153
1158
  EventManager,
@@ -1189,11 +1194,11 @@ class BrowserModule {
1189
1194
  providers: [{ provide: APP_ID, useValue: params.appId }],
1190
1195
  };
1191
1196
  }
1192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserModule, deps: [{ token: BROWSER_MODULE_PROVIDERS_MARKER, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1193
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] }); }
1194
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserModule, providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], imports: [CommonModule, ApplicationModule] }); }
1197
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserModule, deps: [{ token: BROWSER_MODULE_PROVIDERS_MARKER, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1198
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] }); }
1199
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserModule, providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], imports: [CommonModule, ApplicationModule] }); }
1195
1200
  }
1196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: BrowserModule, decorators: [{
1201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: BrowserModule, decorators: [{
1197
1202
  type: NgModule,
1198
1203
  args: [{
1199
1204
  providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
@@ -1357,10 +1362,10 @@ class Meta {
1357
1362
  _getMetaKeyMap(prop) {
1358
1363
  return META_KEYS_MAP[prop] || prop;
1359
1364
  }
1360
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1361
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Meta, providedIn: 'root' }); }
1365
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1366
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Meta, providedIn: 'root' }); }
1362
1367
  }
1363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Meta, decorators: [{
1368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Meta, decorators: [{
1364
1369
  type: Injectable,
1365
1370
  args: [{ providedIn: 'root' }]
1366
1371
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -1401,10 +1406,10 @@ class Title {
1401
1406
  setTitle(newTitle) {
1402
1407
  this._doc.title = newTitle || '';
1403
1408
  }
1404
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1405
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Title, providedIn: 'root' }); }
1409
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1410
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Title, providedIn: 'root' }); }
1406
1411
  }
1407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: Title, decorators: [{
1412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: Title, decorators: [{
1408
1413
  type: Injectable,
1409
1414
  args: [{ providedIn: 'root' }]
1410
1415
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -1668,10 +1673,10 @@ class HammerGestureConfig {
1668
1673
  }
1669
1674
  return mc;
1670
1675
  }
1671
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1672
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGestureConfig }); }
1676
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1677
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGestureConfig }); }
1673
1678
  }
1674
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGestureConfig, decorators: [{
1679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGestureConfig, decorators: [{
1675
1680
  type: Injectable
1676
1681
  }] });
1677
1682
  /**
@@ -1764,10 +1769,10 @@ class HammerGesturesPlugin extends EventManagerPlugin {
1764
1769
  isCustomEvent(eventName) {
1765
1770
  return this._config.events.indexOf(eventName) > -1;
1766
1771
  }
1767
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1768
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin }); }
1772
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1773
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGesturesPlugin }); }
1769
1774
  }
1770
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
1775
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
1771
1776
  type: Injectable
1772
1777
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1773
1778
  type: Inject,
@@ -1793,9 +1798,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6",
1793
1798
  * @publicApi
1794
1799
  */
1795
1800
  class HammerModule {
1796
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1797
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerModule }); }
1798
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerModule, providers: [
1801
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1802
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerModule }); }
1803
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerModule, providers: [
1799
1804
  {
1800
1805
  provide: EVENT_MANAGER_PLUGINS,
1801
1806
  useClass: HammerGesturesPlugin,
@@ -1805,7 +1810,7 @@ class HammerModule {
1805
1810
  { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
1806
1811
  ] }); }
1807
1812
  }
1808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: HammerModule, decorators: [{
1813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: HammerModule, decorators: [{
1809
1814
  type: NgModule,
1810
1815
  args: [{
1811
1816
  providers: [
@@ -1852,10 +1857,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6",
1852
1857
  * @publicApi
1853
1858
  */
1854
1859
  class DomSanitizer {
1855
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1856
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(() => DomSanitizerImpl) }); }
1860
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1861
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(() => DomSanitizerImpl) }); }
1857
1862
  }
1858
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizer, decorators: [{
1863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizer, decorators: [{
1859
1864
  type: Injectable,
1860
1865
  args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
1861
1866
  }] });
@@ -1917,10 +1922,10 @@ class DomSanitizerImpl extends DomSanitizer {
1917
1922
  bypassSecurityTrustResourceUrl(value) {
1918
1923
  return ɵbypassSanitizationTrustResourceUrl(value);
1919
1924
  }
1920
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1921
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root' }); }
1925
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1926
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root' }); }
1922
1927
  }
1923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, decorators: [{
1928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: DomSanitizerImpl, decorators: [{
1924
1929
  type: Injectable,
1925
1930
  args: [{ providedIn: 'root' }]
1926
1931
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -1993,7 +1998,6 @@ function withI18nSupport() {
1993
1998
  * providers: [provideClientHydration(withEventReplay())]
1994
1999
  * });
1995
2000
  * ```
1996
- * @developerPreview
1997
2001
  * @publicApi
1998
2002
  * @see {@link provideClientHydration}
1999
2003
  */
@@ -2011,9 +2015,10 @@ function provideZoneJsCompatibilityDetector() {
2011
2015
  provide: ENVIRONMENT_INITIALIZER,
2012
2016
  useValue: () => {
2013
2017
  const ngZone = inject(NgZone);
2018
+ const isZoneless = inject(ɵZONELESS_ENABLED);
2014
2019
  // Checking `ngZone instanceof NgZone` would be insufficient here,
2015
2020
  // because custom implementations might use NgZone as a base class.
2016
- if (ngZone.constructor !== NgZone) {
2021
+ if (!isZoneless && ngZone.constructor !== NgZone) {
2017
2022
  const console = inject(ɵConsole);
2018
2023
  const message = ɵformatRuntimeError(-5000 /* RuntimeErrorCode.UNSUPPORTED_ZONEJS_INSTANCE */, 'Angular detected that hydration was enabled for an application ' +
2019
2024
  'that uses a custom or a noop Zone.js implementation. ' +
@@ -2110,7 +2115,7 @@ function provideClientHydration(...features) {
2110
2115
  /**
2111
2116
  * @publicApi
2112
2117
  */
2113
- const VERSION = new Version('19.0.0-next.6');
2118
+ const VERSION = new Version('19.0.0-next.8');
2114
2119
 
2115
2120
  /**
2116
2121
  * @module