@angular/core 22.0.0-next.6 → 22.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.
Files changed (71) hide show
  1. package/fesm2022/_attribute-chunk.mjs +1 -1
  2. package/fesm2022/_debug_node-chunk.mjs +1031 -943
  3. package/fesm2022/_debug_node-chunk.mjs.map +1 -1
  4. package/fesm2022/_effect-chunk.mjs +1 -1
  5. package/fesm2022/_not_found-chunk.mjs +1 -1
  6. package/fesm2022/_pending_tasks-chunk.mjs +10 -8
  7. package/fesm2022/_pending_tasks-chunk.mjs.map +1 -1
  8. package/fesm2022/_resource-chunk.mjs +25 -11
  9. package/fesm2022/_resource-chunk.mjs.map +1 -1
  10. package/fesm2022/_untracked-chunk.mjs +1 -1
  11. package/fesm2022/_weak_ref-chunk.mjs +1 -1
  12. package/fesm2022/core.mjs +285 -6
  13. package/fesm2022/core.mjs.map +1 -1
  14. package/fesm2022/primitives-di.mjs +1 -1
  15. package/fesm2022/primitives-event-dispatch.mjs +1 -5
  16. package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
  17. package/fesm2022/primitives-signals.mjs +1 -1
  18. package/fesm2022/rxjs-interop.mjs +4 -1
  19. package/fesm2022/rxjs-interop.mjs.map +1 -1
  20. package/fesm2022/testing.mjs +2 -12
  21. package/fesm2022/testing.mjs.map +1 -1
  22. package/package.json +2 -2
  23. package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
  24. package/schematics/bundles/can-match-snapshot-required.cjs +104 -0
  25. package/schematics/bundles/change-detection-eager.cjs +1 -1
  26. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  27. package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
  28. package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
  29. package/schematics/bundles/control-flow-migration.cjs +1 -1
  30. package/schematics/bundles/http-xhr-backend.cjs +1 -1
  31. package/schematics/bundles/imports-CKV-ITqD.cjs +1 -1
  32. package/schematics/bundles/incremental-hydration.cjs +91 -0
  33. package/schematics/bundles/{index-BtLcQH8g.cjs → index-DADA7AvC.cjs} +7 -3
  34. package/schematics/bundles/inject-migration.cjs +1 -1
  35. package/schematics/bundles/json-file-Drblb4E1.cjs +1916 -0
  36. package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
  37. package/schematics/bundles/{migrate_ts_type_references-Dp33iyGx.cjs → migrate_ts_type_references-B9LlDDUg.cjs} +2 -2
  38. package/schematics/bundles/ng_component_template-DPAF1aEA.cjs +1 -1
  39. package/schematics/bundles/ng_decorators-IVztR9rk.cjs +1 -1
  40. package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
  41. package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
  42. package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
  43. package/schematics/bundles/output-migration.cjs +2 -2
  44. package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
  45. package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
  46. package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
  47. package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
  48. package/schematics/bundles/route-lazy-loading.cjs +1 -1
  49. package/schematics/bundles/router-testing-module-migration.cjs +1 -1
  50. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  51. package/schematics/bundles/signal-input-migration.cjs +3 -3
  52. package/schematics/bundles/signal-queries-migration.cjs +3 -3
  53. package/schematics/bundles/signals.cjs +3 -3
  54. package/schematics/bundles/standalone-migration.cjs +29 -17
  55. package/schematics/bundles/strict-safe-navigation-narrow.cjs +32 -0
  56. package/schematics/bundles/strict-templates-default.cjs +63 -0
  57. package/schematics/migrations.json +18 -3
  58. package/types/_api-chunk.d.ts +9 -3
  59. package/types/_chrome_dev_tools_performance-chunk.d.ts +2 -2
  60. package/types/_debug_node-chunk.d.ts +136 -262
  61. package/types/_effect-chunk.d.ts +1 -1
  62. package/types/_event_dispatcher-chunk.d.ts +1 -1
  63. package/types/_formatter-chunk.d.ts +1 -1
  64. package/types/_weak_ref-chunk.d.ts +1 -1
  65. package/types/core.d.ts +666 -660
  66. package/types/primitives-di.d.ts +1 -1
  67. package/types/primitives-event-dispatch.d.ts +1 -1
  68. package/types/primitives-signals.d.ts +1 -1
  69. package/types/rxjs-interop.d.ts +1 -1
  70. package/types/testing.d.ts +2 -2
  71. package/schematics/bundles/strict-templates.cjs +0 -55
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.6
2
+ * @license Angular v22.0.0-next.8
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { attachInjectFlag, _global, resolveForwardRef, ɵɵinvalidFactoryDep as __invalidFactoryDep, ɵɵinject as __inject, ɵɵdefineInjector as __defineInjector, ɵɵdefineInjectable as __defineInjectable, newArray, assertString, EMPTY_OBJ, assertFirstCreatePass, assertDefined, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, convertToBitFlags, isRootView, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, setInjectImplementation, injectRootLimpMode, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, assertDirectiveDef, EMBEDDED_VIEW_INJECTOR, T_HOST, NG_ELEMENT_ID, assertIndexInRange, INJECTOR$1 as INJECTOR, TVIEW, isComponentDef, isComponentHost, DECLARATION_COMPONENT_VIEW, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, EMPTY_ARRAY, getComponentLViewByIndex, CONTEXT, unwrapRNode, assertLView, HOST, getLViewParent, CHILD_HEAD, NEXT, isLContainer, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, ENVIRONMENT_INITIALIZER, DOCUMENT as DOCUMENT$1, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, makeEnvironmentProviders, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, stringify, ANIMATIONS, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, NgZone, ChangeDetectionScheduler, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, INJECTOR as INJECTOR$1, CONTAINER_HEADER_OFFSET, isDestroyed, assertLContainer, MOVED_VIEWS, assertProjectionSlots, NATIVE, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertParentView, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, INTERNAL_APPLICATION_ERROR_HANDLER, assertNotSame, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, setCurrentDirectiveIndex, getCurrentDirectiveIndex, unwrapLView, enterView, leaveView, isCreationMode, markViewForRefresh, setIsInCheckNoChangesMode, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setBindingIndex, EFFECTS_TO_SCHEDULE, setBindingRootForHostBindings, viewAttachedToChangeDetector, CheckNoChangesMode, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, debugStringifyTypeForError, assertNotDefined, nextBindingIndex, getTNode, getDirectiveDefOrThrow, assertComponentType, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, runInInjectionContext, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, setInjectorProfiler, EffectRefImpl, NullInjector, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, isInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasksInternal, arrayInsert2, arraySplice, PendingTasks, decreaseElementDepthCount, assertTNodeCreationIndex, getNamespace, enterSkipHydrationBlock, isSkipHydrationRootTNode, leaveSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, incrementBindingIndex, keyValueArrayGet, keyValueArraySet, store, getBindingRoot, providerToFactory, emitProviderConfiguredEvent, isClassProvider, NG_COMP_DEF, forwardRef, ɵɵrestoreView as __restoreView, ɵɵdisableBindings as __disableBindings, ɵɵenableBindings as __enableBindings, ɵɵnamespaceSVG as __namespaceSVG, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceHTML as __namespaceHTML, ɵɵresetView as __resetView, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, PROVIDED_ZONELESS, NoopNgZone, angularZoneInstanceIdProperty, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, SCHEDULE_IN_ROOT_ZONE, getNativeByTNodeOrNull } from './_pending_tasks-chunk.mjs';
7
+ import { attachInjectFlag, _global, resolveForwardRef, ɵɵinvalidFactoryDep as __invalidFactoryDep, ɵɵinject as __inject, ɵɵdefineInjector as __defineInjector, ɵɵdefineInjectable as __defineInjectable, newArray, assertString, EMPTY_OBJ, assertFirstCreatePass, assertDefined, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, convertToBitFlags, isRootView, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, setInjectImplementation, injectRootLimpMode, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, assertDirectiveDef, EMBEDDED_VIEW_INJECTOR, T_HOST, NG_ELEMENT_ID, assertIndexInRange, INJECTOR, TVIEW, isComponentDef, isComponentHost, DECLARATION_COMPONENT_VIEW, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, EMPTY_ARRAY, getComponentLViewByIndex, CONTEXT, unwrapRNode, assertLView, HOST, getLViewParent, isLContainer, CONTAINER_HEADER_OFFSET, CHILD_HEAD, NEXT, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, ENVIRONMENT_INITIALIZER, DOCUMENT as DOCUMENT$1, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, makeEnvironmentProviders, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, stringify, ANIMATIONS, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, NgZone, ChangeDetectionScheduler, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, INJECTOR$1, isDestroyed, assertLContainer, MOVED_VIEWS, assertProjectionSlots, NATIVE, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertParentView, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, INTERNAL_APPLICATION_ERROR_HANDLER, assertNotSame, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, setCurrentDirectiveIndex, getCurrentDirectiveIndex, unwrapLView, enterView, leaveView, isCreationMode, markViewForRefresh, setIsInCheckNoChangesMode, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setBindingIndex, EFFECTS_TO_SCHEDULE, setBindingRootForHostBindings, viewAttachedToChangeDetector, CheckNoChangesMode, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, getTNode, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, debugStringifyTypeForError, assertNotDefined, nextBindingIndex, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, getDirectiveDefOrThrow, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, runInInjectionContext, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, setInjectorProfiler, EffectRefImpl, NullInjector, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, VERSION, isSignal, isInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasksInternal, arrayInsert2, arraySplice, PendingTasks, decreaseElementDepthCount, assertTNodeCreationIndex, getNamespace, enterSkipHydrationBlock, isSkipHydrationRootTNode, leaveSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, incrementBindingIndex, keyValueArrayGet, keyValueArraySet, isWritableSignal, store, getBindingRoot, providerToFactory, emitProviderConfiguredEvent, isClassProvider, NG_COMP_DEF, forwardRef, ɵɵrestoreView as __restoreView, ɵɵdisableBindings as __disableBindings, ɵɵenableBindings as __enableBindings, ɵɵnamespaceSVG as __namespaceSVG, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceHTML as __namespaceHTML, ɵɵresetView as __resetView, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, PROVIDED_ZONELESS, NoopNgZone, angularZoneInstanceIdProperty, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, SCHEDULE_IN_ROOT_ZONE, getNativeByTNodeOrNull } from './_pending_tasks-chunk.mjs';
8
8
  import { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';
9
9
  import { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './_effect-chunk.mjs';
10
10
  import { Subject, Subscription } from 'rxjs';
@@ -1711,6 +1711,57 @@ function getNearestLContainer(viewOrContainer) {
1711
1711
  }
1712
1712
  return viewOrContainer;
1713
1713
  }
1714
+ function* walkLViewChildren(tNode, lView) {
1715
+ let child = tNode.child;
1716
+ while (child) {
1717
+ yield [child, lView];
1718
+ child = child.next;
1719
+ }
1720
+ if (tNode.componentOffset > -1) {
1721
+ const componentLView = getComponentLViewByIndex(tNode.index, lView);
1722
+ if (isLView(componentLView)) {
1723
+ const componentTView = componentLView[TVIEW];
1724
+ let componentChild = componentTView.firstChild;
1725
+ while (componentChild) {
1726
+ yield [componentChild, componentLView];
1727
+ componentChild = componentChild.next;
1728
+ }
1729
+ }
1730
+ }
1731
+ const slot = lView[tNode.index];
1732
+ if (isLContainer(slot)) {
1733
+ for (let i = CONTAINER_HEADER_OFFSET; i < slot.length; i++) {
1734
+ const embeddedLView = slot[i];
1735
+ const embeddedTView = embeddedLView[TVIEW];
1736
+ let embeddedChild = embeddedTView.firstChild;
1737
+ while (embeddedChild) {
1738
+ yield [embeddedChild, embeddedLView];
1739
+ embeddedChild = embeddedChild.next;
1740
+ }
1741
+ }
1742
+ }
1743
+ }
1744
+ function* walkLViewDescendants(lView) {
1745
+ const tView = lView[TVIEW];
1746
+ let child = tView.firstChild;
1747
+ while (child) {
1748
+ yield* walkTNodeDescendants(child, lView);
1749
+ child = child.next;
1750
+ }
1751
+ }
1752
+ function* walkTNodeDescendants(tNode, lView) {
1753
+ yield [tNode, lView];
1754
+ for (const [childTNode, childLView] of walkLViewChildren(tNode, lView)) {
1755
+ yield* walkTNodeDescendants(childTNode, childLView);
1756
+ }
1757
+ }
1758
+ function* walkLViewDirectives(lView) {
1759
+ for (const [tNode, currentLView] of walkLViewDescendants(lView)) {
1760
+ if (tNode.directiveEnd > tNode.directiveStart) {
1761
+ yield [tNode, currentLView];
1762
+ }
1763
+ }
1764
+ }
1714
1765
 
1715
1766
  function getComponent(element) {
1716
1767
  ngDevMode && assertDomElement(element);
@@ -1997,7 +2048,7 @@ class TransferState {
1997
2048
  }
1998
2049
  }
1999
2050
  }
2000
- return JSON.stringify(this.store).replace(/</g, '\\u003C');
2051
+ return JSON.stringify(this.store).replace(/</g, '\\u003C').replace(/\//g, '\\u002F');
2001
2052
  }
2002
2053
  }
2003
2054
  function retrieveTransferredState(doc, appId) {
@@ -2496,7 +2547,7 @@ function resetIncrementalHydrationEnabledWarnedForTests() {
2496
2547
  function warnIncrementalHydrationNotConfigured() {
2497
2548
  if (!incrementalHydrationEnabledWarned) {
2498
2549
  incrementalHydrationEnabledWarned = true;
2499
- console.warn(formatRuntimeError(508, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' + 'but incremental hydration was not enabled. Please ensure that the `withIncrementalHydration()` ' + 'call is added as an argument for the `provideClientHydration()` function call ' + 'in your application config.'));
2550
+ console.warn(formatRuntimeError(508, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' + 'but incremental hydration was not enabled. Incremental hydration is enabled by default ' + 'with `provideClientHydration()`. Make sure `provideClientHydration()` is included in ' + 'your application config and that you have not opted out using `withNoIncrementalHydration()`.'));
2500
2551
  }
2501
2552
  }
2502
2553
  function assertSsrIdDefined(ssrUniqueId) {
@@ -7560,16 +7611,6 @@ function cleanupMatchingDehydratedViews(hostLView, currentTNode) {
7560
7611
  }
7561
7612
 
7562
7613
  let ComponentRef$1 = class ComponentRef {};
7563
- let ComponentFactory$1 = class ComponentFactory {};
7564
-
7565
- class _NullComponentFactoryResolver {
7566
- resolveComponentFactory(component) {
7567
- throw new RuntimeError(917, typeof ngDevMode !== 'undefined' && ngDevMode && `No component factory found for ${stringify(component)}.`);
7568
- }
7569
- }
7570
- let ComponentFactoryResolver$1 = class ComponentFactoryResolver {
7571
- static NULL = new _NullComponentFactoryResolver();
7572
- };
7573
7614
 
7574
7615
  class RendererFactory2 {}
7575
7616
  class Renderer2 {
@@ -7828,6 +7869,37 @@ function addSet(sourceSet, targetSet) {
7828
7869
  }
7829
7870
  const depsTracker = new DepsTracker();
7830
7871
 
7872
+ function getClosestComponentName(node) {
7873
+ let currentNode = node;
7874
+ while (currentNode) {
7875
+ const lView = readPatchedLView(currentNode);
7876
+ if (lView !== null) {
7877
+ for (let i = HEADER_OFFSET; i < lView.length; i++) {
7878
+ const current = lView[i];
7879
+ if (!isLView(current) && !isLContainer(current) || current[HOST] !== currentNode) {
7880
+ continue;
7881
+ }
7882
+ const tView = lView[TVIEW];
7883
+ const tNode = getTNode(tView, i);
7884
+ if (isComponentHost(tNode)) {
7885
+ const def = tView.data[tNode.directiveStart + tNode.componentOffset];
7886
+ const name = getComponentName(def);
7887
+ if (name !== null) {
7888
+ return name;
7889
+ } else {
7890
+ break;
7891
+ }
7892
+ }
7893
+ }
7894
+ }
7895
+ currentNode = currentNode.parentNode;
7896
+ }
7897
+ return null;
7898
+ }
7899
+ function getComponentName(def) {
7900
+ return def.debugInfo?.className || def.type.name || null;
7901
+ }
7902
+
7831
7903
  const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
7832
7904
 
7833
7905
  class ChainedInjector {
@@ -7846,960 +7918,921 @@ class ChainedInjector {
7846
7918
  }
7847
7919
  }
7848
7920
 
7849
- function computeStaticStyling(tNode, attrs, writeToHost) {
7850
- ngDevMode && assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');
7851
- let styles = writeToHost ? tNode.styles : null;
7852
- let classes = writeToHost ? tNode.classes : null;
7853
- let mode = 0;
7854
- if (attrs !== null) {
7855
- for (let i = 0; i < attrs.length; i++) {
7856
- const value = attrs[i];
7857
- if (typeof value === 'number') {
7858
- mode = value;
7859
- } else if (mode == 1) {
7860
- classes = concatStringsWithSpace(classes, value);
7861
- } else if (mode == 2) {
7862
- const style = value;
7863
- const styleValue = attrs[++i];
7864
- styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
7865
- }
7866
- }
7921
+ function isListLikeIterable(obj) {
7922
+ if (!isJsObject(obj)) return false;
7923
+ return Array.isArray(obj) || !(obj instanceof Map) && Symbol.iterator in obj;
7924
+ }
7925
+ function areIterablesEqual(a, b, comparator) {
7926
+ const iterator1 = a[Symbol.iterator]();
7927
+ const iterator2 = b[Symbol.iterator]();
7928
+ while (true) {
7929
+ const item1 = iterator1.next();
7930
+ const item2 = iterator2.next();
7931
+ if (item1.done && item2.done) return true;
7932
+ if (item1.done || item2.done) return false;
7933
+ if (!comparator(item1.value, item2.value)) return false;
7867
7934
  }
7868
- writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
7869
- writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
7870
7935
  }
7871
-
7872
- function ɵɵdirectiveInject(token, flags = 0) {
7873
- const lView = getLView();
7874
- if (lView === null) {
7875
- ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
7876
- return __inject(token, flags);
7936
+ function iterateListLike(obj, fn) {
7937
+ if (Array.isArray(obj)) {
7938
+ for (let i = 0; i < obj.length; i++) {
7939
+ fn(obj[i]);
7940
+ }
7941
+ } else {
7942
+ const iterator = obj[Symbol.iterator]();
7943
+ let item;
7944
+ while (!(item = iterator.next()).done) {
7945
+ fn(item.value);
7946
+ }
7877
7947
  }
7878
- const tNode = getCurrentTNode();
7879
- const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
7880
- ngDevMode && emitInjectEvent(token, value, flags);
7881
- return value;
7882
7948
  }
7883
- function ɵɵinvalidFactory() {
7884
- const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
7885
- throw new Error(msg);
7949
+ function isJsObject(o) {
7950
+ return o !== null && (typeof o === 'function' || typeof o === 'object');
7886
7951
  }
7887
7952
 
7888
- function resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {
7889
- ngDevMode && assertFirstCreatePass(tView);
7890
- const exportsMap = localRefs === null ? null : {
7891
- '': -1
7892
- };
7893
- const matchedDirectiveDefs = directiveMatcher(tView, tNode);
7894
- if (matchedDirectiveDefs !== null) {
7895
- let directiveDefs = matchedDirectiveDefs;
7896
- let hostDirectiveDefs = null;
7897
- let hostDirectiveRanges = null;
7898
- for (const def of matchedDirectiveDefs) {
7899
- if (def.resolveHostDirectives !== null) {
7900
- [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs);
7901
- break;
7902
- }
7953
+ function devModeEqual(a, b) {
7954
+ const isListLikeIterableA = isListLikeIterable(a);
7955
+ const isListLikeIterableB = isListLikeIterable(b);
7956
+ if (isListLikeIterableA && isListLikeIterableB) {
7957
+ return areIterablesEqual(a, b, devModeEqual);
7958
+ } else {
7959
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
7960
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
7961
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
7962
+ return true;
7963
+ } else {
7964
+ return Object.is(a, b);
7903
7965
  }
7904
- ngDevMode && assertNoDuplicateDirectives(directiveDefs);
7905
- initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);
7906
- }
7907
- if (exportsMap !== null && localRefs !== null) {
7908
- cacheMatchingLocalNames(tNode, localRefs, exportsMap);
7909
7966
  }
7910
7967
  }
7911
- function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
7912
- const localNames = tNode.localNames = [];
7913
- for (let i = 0; i < localRefs.length; i += 2) {
7914
- const index = exportsMap[localRefs[i + 1]];
7915
- if (index == null) throw new RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
7916
- localNames.push(localRefs[i], index);
7917
- }
7968
+
7969
+ function updateBinding(lView, bindingIndex, value) {
7970
+ return lView[bindingIndex] = value;
7918
7971
  }
7919
- function markAsComponentHost(tView, hostTNode, componentOffset) {
7920
- ngDevMode && assertFirstCreatePass(tView);
7921
- ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
7922
- hostTNode.componentOffset = componentOffset;
7923
- (tView.components ??= []).push(hostTNode.index);
7972
+ function getBinding(lView, bindingIndex) {
7973
+ ngDevMode && assertIndexInRange(lView, bindingIndex);
7974
+ ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
7975
+ return lView[bindingIndex];
7924
7976
  }
7925
- function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {
7926
- ngDevMode && assertFirstCreatePass(tView);
7927
- const directivesLength = directives.length;
7928
- let componentDef = null;
7929
- for (let i = 0; i < directivesLength; i++) {
7930
- const def = directives[i];
7931
- if (componentDef === null && isComponentDef(def)) {
7932
- componentDef = def;
7933
- markAsComponentHost(tView, tNode, i);
7934
- }
7935
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);
7936
- }
7937
- initTNodeFlags(tNode, tView.data.length, directivesLength);
7938
- if (componentDef?.viewProvidersResolver) {
7939
- componentDef.viewProvidersResolver(componentDef);
7940
- }
7941
- for (let i = 0; i < directivesLength; i++) {
7942
- const def = directives[i];
7943
- if (def.providersResolver) {
7944
- def.providersResolver(def);
7945
- }
7946
- }
7947
- let preOrderHooksFound = false;
7948
- let preOrderCheckHooksFound = false;
7949
- let directiveIdx = allocExpando(tView, lView, directivesLength, null);
7950
- ngDevMode && assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');
7951
- if (directivesLength > 0) {
7952
- tNode.directiveToIndex = new Map();
7977
+ function bindingUpdated(lView, bindingIndex, value) {
7978
+ ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
7979
+ if (value === NO_CHANGE) {
7980
+ return false;
7953
7981
  }
7954
- for (let i = 0; i < directivesLength; i++) {
7955
- const def = directives[i];
7956
- tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
7957
- configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
7958
- saveNameToExportMap(directiveIdx, def, exportsMap);
7959
- if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {
7960
- const [start, end] = hostDirectiveRanges.get(def);
7961
- tNode.directiveToIndex.set(def.type, [directiveIdx, start + tNode.directiveStart, end + tNode.directiveStart]);
7962
- } else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {
7963
- tNode.directiveToIndex.set(def.type, directiveIdx);
7964
- }
7965
- if (def.contentQueries !== null) tNode.flags |= 4;
7966
- if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64;
7967
- const lifeCycleHooks = def.type.prototype;
7968
- if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
7969
- (tView.preOrderHooks ??= []).push(tNode.index);
7970
- preOrderHooksFound = true;
7971
- }
7972
- if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
7973
- (tView.preOrderCheckHooks ??= []).push(tNode.index);
7974
- preOrderCheckHooksFound = true;
7982
+ const oldValue = lView[bindingIndex];
7983
+ if (Object.is(oldValue, value)) {
7984
+ return false;
7985
+ } else {
7986
+ if (ngDevMode && isInCheckNoChangesMode()) {
7987
+ const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
7988
+ if (!devModeEqual(oldValueToCompare, value)) {
7989
+ const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
7990
+ throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);
7991
+ }
7992
+ return false;
7975
7993
  }
7976
- directiveIdx++;
7994
+ lView[bindingIndex] = value;
7995
+ return true;
7977
7996
  }
7978
- initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);
7979
7997
  }
7980
- function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {
7981
- ngDevMode && assertFirstCreatePass(tView);
7982
- for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {
7983
- const directiveDef = tView.data[index];
7984
- if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {
7985
- setupSelectorMatchedInputsOrOutputs(0, tNode, directiveDef, index);
7986
- setupSelectorMatchedInputsOrOutputs(1, tNode, directiveDef, index);
7987
- setupInitialInputs(tNode, index, false);
7988
- } else {
7989
- const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);
7990
- setupHostDirectiveInputsOrOutputs(0, tNode, hostDirectiveDef, index);
7991
- setupHostDirectiveInputsOrOutputs(1, tNode, hostDirectiveDef, index);
7992
- setupInitialInputs(tNode, index, true);
7993
- }
7994
- }
7998
+ function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
7999
+ const different = bindingUpdated(lView, bindingIndex, exp1);
8000
+ return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
7995
8001
  }
7996
- function setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {
7997
- const aliasMap = mode === 0 ? def.inputs : def.outputs;
7998
- for (const publicName in aliasMap) {
7999
- if (aliasMap.hasOwnProperty(publicName)) {
8000
- let bindings;
8001
- if (mode === 0) {
8002
- bindings = tNode.inputs ??= {};
8003
- } else {
8004
- bindings = tNode.outputs ??= {};
8005
- }
8006
- bindings[publicName] ??= [];
8007
- bindings[publicName].push(directiveIndex);
8008
- setShadowStylingInputFlags(tNode, publicName);
8009
- }
8010
- }
8002
+ function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
8003
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
8004
+ return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
8011
8005
  }
8012
- function setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) {
8013
- const aliasMap = mode === 0 ? config.inputs : config.outputs;
8014
- for (const initialName in aliasMap) {
8015
- if (aliasMap.hasOwnProperty(initialName)) {
8016
- const publicName = aliasMap[initialName];
8017
- let bindings;
8018
- if (mode === 0) {
8019
- bindings = tNode.hostDirectiveInputs ??= {};
8020
- } else {
8021
- bindings = tNode.hostDirectiveOutputs ??= {};
8022
- }
8023
- bindings[publicName] ??= [];
8024
- bindings[publicName].push(directiveIndex, initialName);
8025
- setShadowStylingInputFlags(tNode, publicName);
8006
+ function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
8007
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
8008
+ return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
8009
+ }
8010
+
8011
+ function wrapListener(tNode, lView, listenerFn) {
8012
+ return function wrapListenerIn_markDirtyAndPreventDefault(event) {
8013
+ const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;
8014
+ markViewDirty(startView, 5);
8015
+ const context = lView[CONTEXT];
8016
+ let result = executeListenerWithErrorHandling(lView, context, listenerFn, event);
8017
+ let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;
8018
+ while (nextListenerFn) {
8019
+ result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result;
8020
+ nextListenerFn = nextListenerFn.__ngNextListenerFn__;
8026
8021
  }
8027
- }
8022
+ return result;
8023
+ };
8028
8024
  }
8029
- function setShadowStylingInputFlags(tNode, publicName) {
8030
- if (publicName === 'class') {
8031
- tNode.flags |= 8;
8032
- } else if (publicName === 'style') {
8033
- tNode.flags |= 16;
8025
+ function executeListenerWithErrorHandling(lView, context, listenerFn, e) {
8026
+ const prevConsumer = setActiveConsumer$1(null);
8027
+ try {
8028
+ profiler(ProfilerEvent.OutputStart, context, listenerFn);
8029
+ return listenerFn(e) !== false;
8030
+ } catch (error) {
8031
+ handleUncaughtError(lView, error);
8032
+ return false;
8033
+ } finally {
8034
+ profiler(ProfilerEvent.OutputEnd, context, listenerFn);
8035
+ setActiveConsumer$1(prevConsumer);
8034
8036
  }
8035
8037
  }
8036
- function setupInitialInputs(tNode, directiveIndex, isHostDirective) {
8037
- const {
8038
- attrs,
8039
- inputs,
8040
- hostDirectiveInputs
8041
- } = tNode;
8042
- if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null || isInlineTemplate(tNode)) {
8043
- tNode.initialInputs ??= [];
8044
- tNode.initialInputs.push(null);
8045
- return;
8038
+ function listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {
8039
+ ngDevMode && assertNotSame(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.');
8040
+ const isTNodeDirectiveHost = isDirectiveHost(tNode);
8041
+ let hasCoalesced = false;
8042
+ let existingListener = null;
8043
+ if (!eventTargetResolver && isTNodeDirectiveHost) {
8044
+ existingListener = findExistingListener(tView, lView, eventName, tNode.index);
8046
8045
  }
8047
- let inputsToStore = null;
8048
- let i = 0;
8049
- while (i < attrs.length) {
8050
- const attrName = attrs[i];
8051
- if (attrName === 0) {
8052
- i += 4;
8053
- continue;
8054
- } else if (attrName === 5) {
8055
- i += 2;
8056
- continue;
8057
- } else if (typeof attrName === 'number') {
8058
- break;
8046
+ if (existingListener !== null) {
8047
+ const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
8048
+ lastListenerFn.__ngNextListenerFn__ = originalListener;
8049
+ existingListener.__ngLastListenerFn__ = originalListener;
8050
+ hasCoalesced = true;
8051
+ } else {
8052
+ const native = getNativeByTNode(tNode, lView);
8053
+ const target = eventTargetResolver ? eventTargetResolver(native) : native;
8054
+ stashEventListenerImpl(lView, target, eventName, wrappedListener);
8055
+ const cleanupFn = renderer.listen(target, eventName, wrappedListener);
8056
+ if (!isAnimationEventType(eventName)) {
8057
+ const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;
8058
+ storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);
8059
8059
  }
8060
- if (!isHostDirective && inputs.hasOwnProperty(attrName)) {
8061
- const inputConfig = inputs[attrName];
8062
- for (const index of inputConfig) {
8063
- if (index === directiveIndex) {
8064
- inputsToStore ??= [];
8065
- inputsToStore.push(attrName, attrs[i + 1]);
8066
- break;
8067
- }
8060
+ }
8061
+ return hasCoalesced;
8062
+ }
8063
+ function isAnimationEventType(eventName) {
8064
+ return eventName.startsWith('animation') || eventName.startsWith('transition');
8065
+ }
8066
+ function findExistingListener(tView, lView, eventName, tNodeIndex) {
8067
+ const tCleanup = tView.cleanup;
8068
+ if (tCleanup != null) {
8069
+ for (let i = 0; i < tCleanup.length - 1; i += 2) {
8070
+ const cleanupEventName = tCleanup[i];
8071
+ if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {
8072
+ const lCleanup = lView[CLEANUP];
8073
+ const listenerIdxInLCleanup = tCleanup[i + 2];
8074
+ return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;
8068
8075
  }
8069
- } else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) {
8070
- const config = hostDirectiveInputs[attrName];
8071
- for (let j = 0; j < config.length; j += 2) {
8072
- if (config[j] === directiveIndex) {
8073
- inputsToStore ??= [];
8074
- inputsToStore.push(config[j + 1], attrs[i + 1]);
8075
- break;
8076
- }
8076
+ if (typeof cleanupEventName === 'string') {
8077
+ i += 2;
8077
8078
  }
8078
8079
  }
8079
- i += 2;
8080
8080
  }
8081
- tNode.initialInputs ??= [];
8082
- tNode.initialInputs.push(inputsToStore);
8081
+ return null;
8083
8082
  }
8084
- function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
8085
- ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');
8086
- tView.data[directiveIndex] = def;
8087
- const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));
8088
- const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject, ngDevMode ? def.type.name : null);
8089
- tView.blueprint[directiveIndex] = nodeInjectorFactory;
8090
- lView[directiveIndex] = nodeInjectorFactory;
8091
- registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
8083
+ function storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {
8084
+ const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;
8085
+ const lCleanup = getOrCreateLViewCleanup(lView);
8086
+ const index = lCleanup.length;
8087
+ lCleanup.push(listenerFn, cleanup);
8088
+ tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));
8092
8089
  }
8093
- function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {
8094
- ngDevMode && assertFirstCreatePass(tView);
8095
- const hostBindings = def.hostBindings;
8096
- if (hostBindings) {
8097
- let hostBindingOpCodes = tView.hostBindingOpCodes;
8098
- if (hostBindingOpCodes === null) {
8099
- hostBindingOpCodes = tView.hostBindingOpCodes = [];
8100
- }
8101
- const elementIndx = ~tNode.index;
8102
- if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {
8103
- hostBindingOpCodes.push(elementIndx);
8104
- }
8105
- hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);
8090
+
8091
+ function createOutputListener(tNode, lView, listenerFn, targetDef, eventName) {
8092
+ const wrappedListener = wrapListener(tNode, lView, listenerFn);
8093
+ const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener);
8094
+ if (!hasBound && ngDevMode) {
8095
+ throw new RuntimeError(316, `${stringifyForError(targetDef.type)} does not have an output with a public name of "${eventName}".`);
8106
8096
  }
8107
8097
  }
8108
- function lastSelectedElementIdx(hostBindingOpCodes) {
8109
- let i = hostBindingOpCodes.length;
8110
- while (i > 0) {
8111
- const value = hostBindingOpCodes[--i];
8112
- if (typeof value === 'number' && value < 0) {
8113
- return value;
8114
- }
8098
+ function listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) {
8099
+ let hostIndex = null;
8100
+ let hostDirectivesStart = null;
8101
+ let hostDirectivesEnd = null;
8102
+ let hasOutput = false;
8103
+ if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {
8104
+ throw new Error(`Node does not have a directive with type ${target.type.name}`);
8115
8105
  }
8116
- return 0;
8117
- }
8118
- function saveNameToExportMap(directiveIdx, def, exportsMap) {
8119
- if (exportsMap) {
8120
- if (def.exportAs) {
8121
- for (let i = 0; i < def.exportAs.length; i++) {
8122
- exportsMap[def.exportAs[i]] = directiveIdx;
8106
+ const data = tNode.directiveToIndex.get(target.type);
8107
+ if (typeof data === 'number') {
8108
+ hostIndex = data;
8109
+ } else {
8110
+ [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;
8111
+ }
8112
+ if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveOutputs?.hasOwnProperty(eventName)) {
8113
+ const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName];
8114
+ for (let i = 0; i < hostDirectiveOutputs.length; i += 2) {
8115
+ const index = hostDirectiveOutputs[i];
8116
+ if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {
8117
+ ngDevMode && assertIndexInRange(lView, index);
8118
+ hasOutput = true;
8119
+ listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn);
8120
+ } else if (index > hostDirectivesEnd) {
8121
+ break;
8123
8122
  }
8124
8123
  }
8125
- if (isComponentDef(def)) exportsMap[''] = directiveIdx;
8126
- }
8127
- }
8128
- function initTNodeFlags(tNode, index, numberOfDirectives) {
8129
- ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');
8130
- tNode.flags |= 1;
8131
- tNode.directiveStart = index;
8132
- tNode.directiveEnd = index + numberOfDirectives;
8133
- tNode.providerIndexes = index;
8134
- }
8135
- function assertNoDuplicateDirectives(directives) {
8136
- if (directives.length < 2) {
8137
- return;
8138
8124
  }
8139
- const seenDirectives = new Set();
8140
- for (const current of directives) {
8141
- if (seenDirectives.has(current)) {
8142
- throw new RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);
8143
- }
8144
- seenDirectives.add(current);
8125
+ if (target.outputs.hasOwnProperty(eventName)) {
8126
+ ngDevMode && assertIndexInRange(lView, hostIndex);
8127
+ hasOutput = true;
8128
+ listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn);
8145
8129
  }
8130
+ return hasOutput;
8146
8131
  }
8147
-
8148
- function directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {
8132
+ function listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {
8133
+ ngDevMode && assertIndexInRange(lView, directiveIndex);
8134
+ const instance = lView[directiveIndex];
8149
8135
  const tView = lView[TVIEW];
8150
- ngDevMode && assertFirstCreatePass(tView);
8151
- const tViewConsts = tView.consts;
8152
- const attrs = getConstant(tViewConsts, attrsIndex);
8153
- const tNode = getOrCreateTNode(tView, index, type, name, attrs);
8154
- if (bindingsEnabled) {
8155
- resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);
8156
- }
8157
- tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
8158
- if (tNode.attrs !== null) {
8159
- computeStaticStyling(tNode, tNode.attrs, false);
8136
+ const def = tView.data[directiveIndex];
8137
+ const propertyName = def.outputs[lookupName];
8138
+ const output = instance[propertyName];
8139
+ if (ngDevMode && !isOutputSubscribable(output)) {
8140
+ throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);
8160
8141
  }
8161
- if (tNode.mergedAttrs !== null) {
8162
- computeStaticStyling(tNode, tNode.mergedAttrs, true);
8142
+ const subscription = output.subscribe(listenerFn);
8143
+ storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);
8144
+ }
8145
+ function isOutputSubscribable(value) {
8146
+ return value != null && typeof value.subscribe === 'function';
8147
+ }
8148
+
8149
+ function ɵɵcontrolCreate() {
8150
+ controlCreateInternal();
8151
+ }
8152
+ function controlCreateInternal() {
8153
+ const lView = getLView();
8154
+ const tView = getTView();
8155
+ const tNode = getCurrentTNode();
8156
+ if (tView.firstCreatePass) {
8157
+ initializeControlFirstCreatePass(tView, tNode);
8163
8158
  }
8164
- if (tView.queries !== null) {
8165
- tView.queries.elementStart(tView, tNode);
8159
+ if (tNode.controlDirectiveIndex === -1) {
8160
+ return;
8166
8161
  }
8167
- return tNode;
8162
+ performanceMarkFeature('NgSignalForms');
8163
+ const instance = lView[tNode.controlDirectiveIndex];
8164
+ const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8165
+ controlDef.create(instance, new ControlDirectiveHostImpl(lView, tView, tNode));
8168
8166
  }
8169
- function directiveHostEndFirstCreatePass(tView, tNode) {
8170
- ngDevMode && assertFirstCreatePass(tView);
8171
- registerPostOrderHooks(tView, tNode);
8172
- if (isContentQueryHost(tNode)) {
8173
- tView.queries.elementEnd(tNode);
8167
+ function ɵɵcontrol() {
8168
+ controlUpdateInternal();
8169
+ }
8170
+ function controlUpdateInternal() {
8171
+ if (ngDevMode && isInCheckNoChangesMode()) {
8172
+ return;
8173
+ }
8174
+ const lView = getLView();
8175
+ const tView = getTView();
8176
+ const tNode = getSelectedTNode();
8177
+ if (tNode.controlDirectiveIndex === -1) {
8178
+ return;
8174
8179
  }
8180
+ const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8181
+ const instance = lView[tNode.controlDirectiveIndex];
8182
+ controlDef.update(instance, new ControlDirectiveHostImpl(lView, tView, tNode));
8175
8183
  }
8176
- function domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {
8177
- ngDevMode && assertFirstCreatePass(tView);
8178
- const tViewConsts = tView.consts;
8179
- const attrs = getConstant(tViewConsts, attrsIndex);
8180
- const tNode = getOrCreateTNode(tView, index, type, name, attrs);
8181
- tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
8182
- if (localRefsIndex != null) {
8183
- const refs = getConstant(tViewConsts, localRefsIndex);
8184
- tNode.localNames = [];
8185
- for (let i = 0; i < refs.length; i += 2) {
8186
- tNode.localNames.push(refs[i], -1);
8187
- }
8184
+ class ControlDirectiveHostImpl {
8185
+ lView;
8186
+ tView;
8187
+ tNode;
8188
+ hasPassThrough;
8189
+ constructor(lView, tView, tNode) {
8190
+ this.lView = lView;
8191
+ this.tView = tView;
8192
+ this.tNode = tNode;
8193
+ this.hasPassThrough = !!(tNode.flags & 4096);
8188
8194
  }
8189
- if (tNode.attrs !== null) {
8190
- computeStaticStyling(tNode, tNode.attrs, false);
8195
+ get customControl() {
8196
+ return this.tNode.customControlIndex !== -1 ? this.lView[this.tNode.customControlIndex] : undefined;
8191
8197
  }
8192
- if (tNode.mergedAttrs !== null) {
8193
- computeStaticStyling(tNode, tNode.mergedAttrs, true);
8198
+ get nativeElement() {
8199
+ return getNativeByTNode(this.tNode, this.lView);
8194
8200
  }
8195
- if (tView.queries !== null) {
8196
- tView.queries.elementStart(tView, tNode);
8201
+ get descriptor() {
8202
+ if (ngDevMode && isComponentHost(this.tNode)) {
8203
+ const componentIndex = this.tNode.directiveStart + this.tNode.componentOffset;
8204
+ const componentDef = this.tView.data[componentIndex];
8205
+ return `Component ${debugStringifyTypeForError(componentDef.type)}`;
8206
+ }
8207
+ return `<${this.tNode.value}>`;
8197
8208
  }
8198
- return tNode;
8199
- }
8200
-
8201
- function isListLikeIterable(obj) {
8202
- if (!isJsObject(obj)) return false;
8203
- return Array.isArray(obj) || !(obj instanceof Map) && Symbol.iterator in obj;
8204
- }
8205
- function areIterablesEqual(a, b, comparator) {
8206
- const iterator1 = a[Symbol.iterator]();
8207
- const iterator2 = b[Symbol.iterator]();
8208
- while (true) {
8209
- const item1 = iterator1.next();
8210
- const item2 = iterator2.next();
8211
- if (item1.done && item2.done) return true;
8212
- if (item1.done || item2.done) return false;
8213
- if (!comparator(item1.value, item2.value)) return false;
8209
+ listenToCustomControlOutput(outputName, callback) {
8210
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8211
+ listenToDirectiveOutput(this.tNode, this.lView, directiveDef, outputName, wrapListener(this.tNode, this.lView, callback));
8214
8212
  }
8215
- }
8216
- function iterateListLike(obj, fn) {
8217
- if (Array.isArray(obj)) {
8218
- for (let i = 0; i < obj.length; i++) {
8219
- fn(obj[i]);
8213
+ listenToCustomControlModel(listener) {
8214
+ const modelName = this.tNode.flags & 1024 ? 'valueChange' : 'checkedChange';
8215
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8216
+ listenToDirectiveOutput(this.tNode, this.lView, directiveDef, modelName, wrapListener(this.tNode, this.lView, listener));
8217
+ }
8218
+ listenToDom(eventName, listener) {
8219
+ listenToDomEvent(this.tNode, this.tView, this.lView, undefined, this.lView[RENDERER], eventName, listener, wrapListener(this.tNode, this.lView, listener));
8220
+ }
8221
+ setInputOnDirectives(inputName, value) {
8222
+ const directiveIndices = this.tNode.inputs?.[inputName];
8223
+ const hostDirectiveInputs = this.tNode.hostDirectiveInputs?.[inputName];
8224
+ if (!directiveIndices && !hostDirectiveInputs) {
8225
+ return false;
8220
8226
  }
8221
- } else {
8222
- const iterator = obj[Symbol.iterator]();
8223
- let item;
8224
- while (!(item = iterator.next()).done) {
8225
- fn(item.value);
8227
+ let wasSet = false;
8228
+ if (directiveIndices) {
8229
+ for (const index of directiveIndices) {
8230
+ if (index === this.tNode.controlDirectiveIndex) {
8231
+ continue;
8232
+ }
8233
+ const directiveDef = this.tView.data[index];
8234
+ const directive = this.lView[index];
8235
+ writeToDirectiveInput(directiveDef, directive, inputName, value);
8236
+ wasSet = true;
8237
+ }
8226
8238
  }
8227
- }
8228
- }
8229
- function isJsObject(o) {
8230
- return o !== null && (typeof o === 'function' || typeof o === 'object');
8231
- }
8232
-
8233
- function devModeEqual(a, b) {
8234
- const isListLikeIterableA = isListLikeIterable(a);
8235
- const isListLikeIterableB = isListLikeIterable(b);
8236
- if (isListLikeIterableA && isListLikeIterableB) {
8237
- return areIterablesEqual(a, b, devModeEqual);
8238
- } else {
8239
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
8240
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
8241
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
8242
- return true;
8243
- } else {
8244
- return Object.is(a, b);
8239
+ if (hostDirectiveInputs) {
8240
+ for (let i = 0; i < hostDirectiveInputs.length; i += 2) {
8241
+ const index = hostDirectiveInputs[i];
8242
+ if (index === this.tNode.controlDirectiveIndex) {
8243
+ continue;
8244
+ }
8245
+ const internalName = hostDirectiveInputs[i + 1];
8246
+ const directiveDef = this.tView.data[index];
8247
+ const directive = this.lView[index];
8248
+ writeToDirectiveInput(directiveDef, directive, internalName, value);
8249
+ wasSet = true;
8250
+ }
8245
8251
  }
8252
+ return wasSet;
8246
8253
  }
8247
- }
8248
-
8249
- function updateBinding(lView, bindingIndex, value) {
8250
- return lView[bindingIndex] = value;
8251
- }
8252
- function getBinding(lView, bindingIndex) {
8253
- ngDevMode && assertIndexInRange(lView, bindingIndex);
8254
- ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
8255
- return lView[bindingIndex];
8256
- }
8257
- function bindingUpdated(lView, bindingIndex, value) {
8258
- ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
8259
- if (value === NO_CHANGE) {
8260
- return false;
8254
+ setCustomControlModelInput(value) {
8255
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8256
+ const modelName = this.tNode.flags & 1024 ? 'value' : 'checked';
8257
+ setDirectiveInput(this.tNode, this.tView, this.lView, directiveDef, modelName, value);
8261
8258
  }
8262
- const oldValue = lView[bindingIndex];
8263
- if (Object.is(oldValue, value)) {
8264
- return false;
8265
- } else {
8266
- if (ngDevMode && isInCheckNoChangesMode()) {
8267
- const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
8268
- if (!devModeEqual(oldValueToCompare, value)) {
8269
- const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
8270
- throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);
8271
- }
8259
+ customControlHasInput(inputName) {
8260
+ if (this.tNode.customControlIndex === -1) {
8272
8261
  return false;
8273
8262
  }
8274
- lView[bindingIndex] = value;
8275
- return true;
8263
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8264
+ const presence = directiveDef.signalFormsInputPresence ??= this._buildCustomControlInputCache(directiveDef);
8265
+ return presence[inputName] === true;
8266
+ }
8267
+ _buildCustomControlInputCache(directiveDef) {
8268
+ const cache = {};
8269
+ for (const key in directiveDef.inputs) {
8270
+ cache[key] = true;
8271
+ }
8272
+ if (directiveDef.hostDirectives !== null) {
8273
+ const queue = [...directiveDef.hostDirectives];
8274
+ while (queue.length > 0) {
8275
+ const hostDir = queue.shift();
8276
+ if (typeof hostDir !== 'function') {
8277
+ for (const key in hostDir.inputs) {
8278
+ cache[hostDir.inputs[key]] = true;
8279
+ }
8280
+ const hostDirectives = getHostDirectives(hostDir.directive);
8281
+ if (hostDirectives !== null) {
8282
+ queue.push(...hostDirectives);
8283
+ }
8284
+ continue;
8285
+ }
8286
+ for (const config of hostDir()) {
8287
+ if (typeof config === 'function') {
8288
+ continue;
8289
+ }
8290
+ if (config.inputs) {
8291
+ for (let i = 0; i < config.inputs.length; i += 2) {
8292
+ const exposedName = config.inputs[i + 1] || config.inputs[i];
8293
+ cache[exposedName] = true;
8294
+ }
8295
+ }
8296
+ const hostDirectives = getHostDirectives(config.directive);
8297
+ if (hostDirectives !== null) {
8298
+ queue.push(...hostDirectives);
8299
+ }
8300
+ }
8301
+ }
8302
+ }
8303
+ return cache;
8276
8304
  }
8277
8305
  }
8278
- function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
8279
- const different = bindingUpdated(lView, bindingIndex, exp1);
8280
- return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
8281
- }
8282
- function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
8283
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
8284
- return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
8306
+ function getHostDirectives(directiveType) {
8307
+ if (typeof directiveType === 'function' && 'ɵdir' in directiveType) {
8308
+ return directiveType.ɵdir.hostDirectives ?? null;
8309
+ }
8310
+ return null;
8285
8311
  }
8286
- function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
8287
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
8288
- return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
8289
- }
8290
-
8291
- function wrapListener(tNode, lView, listenerFn) {
8292
- return function wrapListenerIn_markDirtyAndPreventDefault(event) {
8293
- const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;
8294
- markViewDirty(startView, 5);
8295
- const context = lView[CONTEXT];
8296
- let result = executeListenerWithErrorHandling(lView, context, listenerFn, event);
8297
- let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;
8298
- while (nextListenerFn) {
8299
- result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result;
8300
- nextListenerFn = nextListenerFn.__ngNextListenerFn__;
8312
+ function initializeControlFirstCreatePass(tView, tNode, lView) {
8313
+ ngDevMode && assertFirstCreatePass(tView);
8314
+ for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8315
+ const directiveDef = tView.data[i];
8316
+ if (directiveDef.controlDef) {
8317
+ tNode.controlDirectiveIndex = i;
8318
+ break;
8301
8319
  }
8302
- return result;
8303
- };
8304
- }
8305
- function executeListenerWithErrorHandling(lView, context, listenerFn, e) {
8306
- const prevConsumer = setActiveConsumer$1(null);
8307
- try {
8308
- profiler(ProfilerEvent.OutputStart, context, listenerFn);
8309
- return listenerFn(e) !== false;
8310
- } catch (error) {
8311
- handleUncaughtError(lView, error);
8312
- return false;
8313
- } finally {
8314
- profiler(ProfilerEvent.OutputEnd, context, listenerFn);
8315
- setActiveConsumer$1(prevConsumer);
8316
8320
  }
8317
- }
8318
- function listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {
8319
- ngDevMode && assertNotSame(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.');
8320
- const isTNodeDirectiveHost = isDirectiveHost(tNode);
8321
- let hasCoalesced = false;
8322
- let existingListener = null;
8323
- if (!eventTargetResolver && isTNodeDirectiveHost) {
8324
- existingListener = findExistingListener(tView, lView, eventName, tNode.index);
8321
+ if (tNode.controlDirectiveIndex === -1) {
8322
+ return;
8325
8323
  }
8326
- if (existingListener !== null) {
8327
- const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
8328
- lastListenerFn.__ngNextListenerFn__ = originalListener;
8329
- existingListener.__ngLastListenerFn__ = originalListener;
8330
- hasCoalesced = true;
8331
- } else {
8332
- const native = getNativeByTNode(tNode, lView);
8333
- const target = eventTargetResolver ? eventTargetResolver(native) : native;
8334
- stashEventListenerImpl(lView, target, eventName, wrappedListener);
8335
- const cleanupFn = renderer.listen(target, eventName, wrappedListener);
8336
- if (!isAnimationEventType(eventName)) {
8337
- const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;
8338
- storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);
8324
+ const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8325
+ if (controlDef.passThroughInput) {
8326
+ if ((tNode.inputs?.[controlDef.passThroughInput]?.length ?? 0) > 1) {
8327
+ tNode.flags |= 4096;
8328
+ return;
8339
8329
  }
8340
8330
  }
8341
- return hasCoalesced;
8342
- }
8343
- function isAnimationEventType(eventName) {
8344
- return eventName.startsWith('animation') || eventName.startsWith('transition');
8331
+ initializeCustomControlStatus(tView, tNode);
8345
8332
  }
8346
- function findExistingListener(tView, lView, eventName, tNodeIndex) {
8347
- const tCleanup = tView.cleanup;
8348
- if (tCleanup != null) {
8349
- for (let i = 0; i < tCleanup.length - 1; i += 2) {
8350
- const cleanupEventName = tCleanup[i];
8351
- if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {
8352
- const lCleanup = lView[CLEANUP];
8353
- const listenerIdxInLCleanup = tCleanup[i + 2];
8354
- return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;
8333
+ function initializeCustomControlStatus(tView, tNode) {
8334
+ for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8335
+ const directiveDef = tView.data[i];
8336
+ if (tNode.directiveToIndex && !tNode.directiveToIndex.has(directiveDef.type)) {
8337
+ continue;
8338
+ }
8339
+ if (hasModelInput(directiveDef, 'value')) {
8340
+ tNode.flags |= 1024;
8341
+ tNode.customControlIndex = i;
8342
+ return;
8343
+ }
8344
+ if (hasModelInput(directiveDef, 'checked')) {
8345
+ tNode.flags |= 2048;
8346
+ tNode.customControlIndex = i;
8347
+ return;
8348
+ }
8349
+ }
8350
+ if (tNode.hostDirectiveInputs !== null && tNode.hostDirectiveOutputs !== null && tNode.directiveToIndex !== null) {
8351
+ const checkModel = (modelName, flag) => {
8352
+ const inputs = tNode.hostDirectiveInputs[modelName];
8353
+ const outputs = tNode.hostDirectiveOutputs[modelName + 'Change'];
8354
+ if (!inputs || !outputs) {
8355
+ return false;
8355
8356
  }
8356
- if (typeof cleanupEventName === 'string') {
8357
- i += 2;
8357
+ for (let i = 0; i < inputs.length; i += 2) {
8358
+ const inputIndex = inputs[i];
8359
+ for (let j = 0; j < outputs.length; j += 2) {
8360
+ const outputIndex = outputs[j];
8361
+ if (inputIndex !== outputIndex) {
8362
+ continue;
8363
+ }
8364
+ for (const data of tNode.directiveToIndex.values()) {
8365
+ if (!Array.isArray(data)) {
8366
+ continue;
8367
+ }
8368
+ const [hostIndex, start, end] = data;
8369
+ if (inputIndex >= start && inputIndex <= end) {
8370
+ tNode.flags |= flag;
8371
+ tNode.customControlIndex = hostIndex;
8372
+ return true;
8373
+ }
8374
+ }
8375
+ }
8358
8376
  }
8377
+ return false;
8378
+ };
8379
+ if (checkModel('value', 1024)) {
8380
+ return;
8381
+ }
8382
+ if (checkModel('checked', 2048)) {
8383
+ return;
8359
8384
  }
8360
8385
  }
8361
- return null;
8362
8386
  }
8363
- function storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {
8364
- const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;
8365
- const lCleanup = getOrCreateLViewCleanup(lView);
8366
- const index = lCleanup.length;
8367
- lCleanup.push(listenerFn, cleanup);
8368
- tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));
8387
+ function hasModelInput(directiveDef, name) {
8388
+ return hasInput(directiveDef, name) && hasOutput(directiveDef, name + 'Change');
8369
8389
  }
8370
-
8371
- function createOutputListener(tNode, lView, listenerFn, targetDef, eventName) {
8372
- const wrappedListener = wrapListener(tNode, lView, listenerFn);
8373
- const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener);
8374
- if (!hasBound && ngDevMode) {
8375
- throw new RuntimeError(316, `${stringifyForError(targetDef.type)} does not have an output with a public name of "${eventName}".`);
8376
- }
8390
+ function hasInput(directiveDef, name) {
8391
+ return name in directiveDef.inputs;
8377
8392
  }
8378
- function listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) {
8379
- let hostIndex = null;
8380
- let hostDirectivesStart = null;
8381
- let hostDirectivesEnd = null;
8382
- let hasOutput = false;
8383
- if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {
8384
- throw new Error(`Node does not have a directive with type ${target.type.name}`);
8385
- }
8386
- const data = tNode.directiveToIndex.get(target.type);
8387
- if (typeof data === 'number') {
8388
- hostIndex = data;
8389
- } else {
8390
- [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;
8391
- }
8392
- if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveOutputs?.hasOwnProperty(eventName)) {
8393
- const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName];
8394
- for (let i = 0; i < hostDirectiveOutputs.length; i += 2) {
8395
- const index = hostDirectiveOutputs[i];
8396
- if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {
8397
- ngDevMode && assertIndexInRange(lView, index);
8398
- hasOutput = true;
8399
- listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn);
8400
- } else if (index > hostDirectivesEnd) {
8401
- break;
8393
+ function hasOutput(directiveDef, name) {
8394
+ return name in directiveDef.outputs;
8395
+ }
8396
+
8397
+ const BINDING = /* @__PURE__ */Symbol('BINDING');
8398
+ const INPUT_BINDING_METADATA = {
8399
+ kind: 'input',
8400
+ requiredVars: 1
8401
+ };
8402
+ const OUTPUT_BINDING_METADATA = {
8403
+ kind: 'output',
8404
+ requiredVars: 0
8405
+ };
8406
+ function inputBindingUpdate(targetDirectiveIdx, publicName, value) {
8407
+ const lView = getLView();
8408
+ const bindingIndex = nextBindingIndex();
8409
+ if (bindingUpdated(lView, bindingIndex, value)) {
8410
+ const tView = lView[TVIEW];
8411
+ const tNode = getSelectedTNode();
8412
+ const componentLView = getComponentLViewByIndex(tNode.index, lView);
8413
+ markViewDirty(componentLView, 1);
8414
+ const targetDef = tView.directiveRegistry[targetDirectiveIdx];
8415
+ if (ngDevMode && !targetDef) {
8416
+ throw new RuntimeError(315, `Input binding to property "${publicName}" does not have a target.`);
8417
+ }
8418
+ const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value);
8419
+ if (ngDevMode) {
8420
+ if (!hasSet) {
8421
+ throw new RuntimeError(315, `${stringifyForError(targetDef.type)} does not have an input with a public name of "${publicName}".`);
8402
8422
  }
8423
+ storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex);
8403
8424
  }
8404
8425
  }
8405
- if (target.outputs.hasOwnProperty(eventName)) {
8406
- ngDevMode && assertIndexInRange(lView, hostIndex);
8407
- hasOutput = true;
8408
- listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn);
8409
- }
8410
- return hasOutput;
8411
8426
  }
8412
- function listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {
8413
- ngDevMode && assertIndexInRange(lView, directiveIndex);
8414
- const instance = lView[directiveIndex];
8415
- const tView = lView[TVIEW];
8416
- const def = tView.data[directiveIndex];
8417
- const propertyName = def.outputs[lookupName];
8418
- const output = instance[propertyName];
8419
- if (ngDevMode && !isOutputSubscribable(output)) {
8420
- throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);
8427
+ function inputBinding(publicName, value) {
8428
+ if (publicName === 'formField') {
8429
+ const binding = {
8430
+ [BINDING]: INPUT_BINDING_METADATA,
8431
+ create: () => {
8432
+ controlCreateInternal();
8433
+ },
8434
+ update: () => {
8435
+ inputBindingUpdate(binding.targetIdx, publicName, value());
8436
+ controlUpdateInternal();
8437
+ }
8438
+ };
8439
+ return binding;
8421
8440
  }
8422
- const subscription = output.subscribe(listenerFn);
8423
- storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);
8441
+ const binding = {
8442
+ [BINDING]: INPUT_BINDING_METADATA,
8443
+ update: () => inputBindingUpdate(binding.targetIdx, publicName, value())
8444
+ };
8445
+ return binding;
8424
8446
  }
8425
- function isOutputSubscribable(value) {
8426
- return value != null && typeof value.subscribe === 'function';
8447
+ function outputBinding(eventName, listener) {
8448
+ const binding = {
8449
+ [BINDING]: OUTPUT_BINDING_METADATA,
8450
+ create: () => {
8451
+ const lView = getLView();
8452
+ const tNode = getCurrentTNode();
8453
+ const tView = lView[TVIEW];
8454
+ const targetDef = tView.directiveRegistry[binding.targetIdx];
8455
+ createOutputListener(tNode, lView, listener, targetDef, eventName);
8456
+ }
8457
+ };
8458
+ return binding;
8427
8459
  }
8428
-
8429
- function ɵɵcontrolCreate() {
8430
- controlCreateInternal();
8460
+ function twoWayBinding(publicName, value) {
8461
+ const input = inputBinding(publicName, value);
8462
+ const output = outputBinding(publicName + 'Change', eventValue => value.set(eventValue));
8463
+ ngDevMode && assertNotDefined(input.create, 'Unexpected `create` callback in inputBinding');
8464
+ ngDevMode && assertNotDefined(output.update, 'Unexpected `update` callback in outputBinding');
8465
+ const binding = {
8466
+ [BINDING]: {
8467
+ kind: 'twoWay',
8468
+ requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars
8469
+ },
8470
+ set targetIdx(idx) {
8471
+ input.targetIdx = idx;
8472
+ output.targetIdx = idx;
8473
+ },
8474
+ create: output.create,
8475
+ update: input.update
8476
+ };
8477
+ return binding;
8431
8478
  }
8432
- function controlCreateInternal() {
8433
- const lView = getLView();
8434
- const tView = getTView();
8435
- const tNode = getCurrentTNode();
8436
- if (tView.firstCreatePass) {
8437
- initializeControlFirstCreatePass(tView, tNode);
8438
- }
8439
- if (tNode.controlDirectiveIndex === -1) {
8440
- return;
8479
+
8480
+ const SHARED_STYLES_HOST = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'SHARED_STYLES_HOST' : '');
8481
+
8482
+ function computeStaticStyling(tNode, attrs, writeToHost) {
8483
+ ngDevMode && assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');
8484
+ let styles = writeToHost ? tNode.styles : null;
8485
+ let classes = writeToHost ? tNode.classes : null;
8486
+ let mode = 0;
8487
+ if (attrs !== null) {
8488
+ for (let i = 0; i < attrs.length; i++) {
8489
+ const value = attrs[i];
8490
+ if (typeof value === 'number') {
8491
+ mode = value;
8492
+ } else if (mode == 1) {
8493
+ classes = concatStringsWithSpace(classes, value);
8494
+ } else if (mode == 2) {
8495
+ const style = value;
8496
+ const styleValue = attrs[++i];
8497
+ styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
8498
+ }
8499
+ }
8441
8500
  }
8442
- performanceMarkFeature('NgSignalForms');
8443
- const instance = lView[tNode.controlDirectiveIndex];
8444
- const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8445
- controlDef.create(instance, new ControlDirectiveHostImpl(lView, tView, tNode));
8446
- }
8447
- function ɵɵcontrol() {
8448
- controlUpdateInternal();
8501
+ writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
8502
+ writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
8449
8503
  }
8450
- function controlUpdateInternal() {
8451
- if (ngDevMode && isInCheckNoChangesMode()) {
8452
- return;
8453
- }
8504
+
8505
+ function ɵɵdirectiveInject(token, flags = 0) {
8454
8506
  const lView = getLView();
8455
- const tView = getTView();
8456
- const tNode = getSelectedTNode();
8457
- if (tNode.controlDirectiveIndex === -1) {
8458
- return;
8507
+ if (lView === null) {
8508
+ ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
8509
+ return __inject(token, flags);
8459
8510
  }
8460
- const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8461
- const instance = lView[tNode.controlDirectiveIndex];
8462
- controlDef.update(instance, new ControlDirectiveHostImpl(lView, tView, tNode));
8511
+ const tNode = getCurrentTNode();
8512
+ const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
8513
+ ngDevMode && emitInjectEvent(token, value, flags);
8514
+ return value;
8463
8515
  }
8464
- class ControlDirectiveHostImpl {
8465
- lView;
8466
- tView;
8467
- tNode;
8468
- hasPassThrough;
8469
- constructor(lView, tView, tNode) {
8470
- this.lView = lView;
8471
- this.tView = tView;
8472
- this.tNode = tNode;
8473
- this.hasPassThrough = !!(tNode.flags & 4096);
8474
- }
8475
- get customControl() {
8476
- return this.tNode.customControlIndex !== -1 ? this.lView[this.tNode.customControlIndex] : undefined;
8477
- }
8478
- get nativeElement() {
8479
- return getNativeByTNode(this.tNode, this.lView);
8480
- }
8481
- get descriptor() {
8482
- if (ngDevMode && isComponentHost(this.tNode)) {
8483
- const componentIndex = this.tNode.directiveStart + this.tNode.componentOffset;
8484
- const componentDef = this.tView.data[componentIndex];
8485
- return `Component ${debugStringifyTypeForError(componentDef.type)}`;
8516
+ function ɵɵinvalidFactory() {
8517
+ const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
8518
+ throw new Error(msg);
8519
+ }
8520
+
8521
+ function resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {
8522
+ ngDevMode && assertFirstCreatePass(tView);
8523
+ const exportsMap = localRefs === null ? null : {
8524
+ '': -1
8525
+ };
8526
+ const matchedDirectiveDefs = directiveMatcher(tView, tNode);
8527
+ if (matchedDirectiveDefs !== null) {
8528
+ let directiveDefs = matchedDirectiveDefs;
8529
+ let hostDirectiveDefs = null;
8530
+ let hostDirectiveRanges = null;
8531
+ for (const def of matchedDirectiveDefs) {
8532
+ if (def.resolveHostDirectives !== null) {
8533
+ [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs);
8534
+ break;
8535
+ }
8486
8536
  }
8487
- return `<${this.tNode.value}>`;
8488
- }
8489
- listenToCustomControlOutput(outputName, callback) {
8490
- const directiveDef = this.tView.data[this.tNode.customControlIndex];
8491
- listenToDirectiveOutput(this.tNode, this.lView, directiveDef, outputName, wrapListener(this.tNode, this.lView, callback));
8537
+ ngDevMode && assertNoDuplicateDirectives(directiveDefs);
8538
+ initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);
8492
8539
  }
8493
- listenToCustomControlModel(listener) {
8494
- const modelName = this.tNode.flags & 1024 ? 'valueChange' : 'checkedChange';
8495
- const directiveDef = this.tView.data[this.tNode.customControlIndex];
8496
- listenToDirectiveOutput(this.tNode, this.lView, directiveDef, modelName, wrapListener(this.tNode, this.lView, listener));
8540
+ if (exportsMap !== null && localRefs !== null) {
8541
+ cacheMatchingLocalNames(tNode, localRefs, exportsMap);
8497
8542
  }
8498
- listenToDom(eventName, listener) {
8499
- listenToDomEvent(this.tNode, this.tView, this.lView, undefined, this.lView[RENDERER], eventName, listener, wrapListener(this.tNode, this.lView, listener));
8543
+ }
8544
+ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
8545
+ const localNames = tNode.localNames = [];
8546
+ for (let i = 0; i < localRefs.length; i += 2) {
8547
+ const index = exportsMap[localRefs[i + 1]];
8548
+ if (index == null) throw new RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
8549
+ localNames.push(localRefs[i], index);
8500
8550
  }
8501
- setInputOnDirectives(inputName, value) {
8502
- const directiveIndices = this.tNode.inputs?.[inputName];
8503
- const hostDirectiveInputs = this.tNode.hostDirectiveInputs?.[inputName];
8504
- if (!directiveIndices && !hostDirectiveInputs) {
8505
- return false;
8506
- }
8507
- let wasSet = false;
8508
- if (directiveIndices) {
8509
- for (const index of directiveIndices) {
8510
- if (index === this.tNode.controlDirectiveIndex) {
8511
- continue;
8512
- }
8513
- const directiveDef = this.tView.data[index];
8514
- const directive = this.lView[index];
8515
- writeToDirectiveInput(directiveDef, directive, inputName, value);
8516
- wasSet = true;
8517
- }
8518
- }
8519
- if (hostDirectiveInputs) {
8520
- for (let i = 0; i < hostDirectiveInputs.length; i += 2) {
8521
- const index = hostDirectiveInputs[i];
8522
- if (index === this.tNode.controlDirectiveIndex) {
8523
- continue;
8524
- }
8525
- const internalName = hostDirectiveInputs[i + 1];
8526
- const directiveDef = this.tView.data[index];
8527
- const directive = this.lView[index];
8528
- writeToDirectiveInput(directiveDef, directive, internalName, value);
8529
- wasSet = true;
8530
- }
8551
+ }
8552
+ function markAsComponentHost(tView, hostTNode, componentOffset) {
8553
+ ngDevMode && assertFirstCreatePass(tView);
8554
+ ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
8555
+ hostTNode.componentOffset = componentOffset;
8556
+ (tView.components ??= []).push(hostTNode.index);
8557
+ }
8558
+ function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {
8559
+ ngDevMode && assertFirstCreatePass(tView);
8560
+ const directivesLength = directives.length;
8561
+ let componentDef = null;
8562
+ for (let i = 0; i < directivesLength; i++) {
8563
+ const def = directives[i];
8564
+ if (componentDef === null && isComponentDef(def)) {
8565
+ componentDef = def;
8566
+ markAsComponentHost(tView, tNode, i);
8531
8567
  }
8532
- return wasSet;
8568
+ diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);
8533
8569
  }
8534
- setCustomControlModelInput(value) {
8535
- const directiveDef = this.tView.data[this.tNode.customControlIndex];
8536
- const modelName = this.tNode.flags & 1024 ? 'value' : 'checked';
8537
- setDirectiveInput(this.tNode, this.tView, this.lView, directiveDef, modelName, value);
8570
+ initTNodeFlags(tNode, tView.data.length, directivesLength);
8571
+ if (componentDef?.viewProvidersResolver) {
8572
+ componentDef.viewProvidersResolver(componentDef);
8538
8573
  }
8539
- customControlHasInput(inputName) {
8540
- if (this.tNode.customControlIndex === -1) {
8541
- return false;
8574
+ for (let i = 0; i < directivesLength; i++) {
8575
+ const def = directives[i];
8576
+ if (def.providersResolver) {
8577
+ def.providersResolver(def);
8542
8578
  }
8543
- const directiveDef = this.tView.data[this.tNode.customControlIndex];
8544
- const presence = directiveDef.signalFormsInputPresence ??= this._buildCustomControlInputCache(directiveDef);
8545
- return presence[inputName] === true;
8546
8579
  }
8547
- _buildCustomControlInputCache(directiveDef) {
8548
- const cache = {};
8549
- for (const key in directiveDef.inputs) {
8550
- cache[key] = true;
8580
+ let preOrderHooksFound = false;
8581
+ let preOrderCheckHooksFound = false;
8582
+ let directiveIdx = allocExpando(tView, lView, directivesLength, null);
8583
+ ngDevMode && assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');
8584
+ if (directivesLength > 0) {
8585
+ tNode.directiveToIndex = new Map();
8586
+ }
8587
+ for (let i = 0; i < directivesLength; i++) {
8588
+ const def = directives[i];
8589
+ tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
8590
+ configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
8591
+ saveNameToExportMap(directiveIdx, def, exportsMap);
8592
+ if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {
8593
+ const [start, end] = hostDirectiveRanges.get(def);
8594
+ tNode.directiveToIndex.set(def.type, [directiveIdx, start + tNode.directiveStart, end + tNode.directiveStart]);
8595
+ } else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {
8596
+ tNode.directiveToIndex.set(def.type, directiveIdx);
8551
8597
  }
8552
- if (directiveDef.hostDirectives !== null) {
8553
- const queue = [...directiveDef.hostDirectives];
8554
- while (queue.length > 0) {
8555
- const hostDir = queue.shift();
8556
- if (typeof hostDir !== 'function') {
8557
- for (const key in hostDir.inputs) {
8558
- cache[hostDir.inputs[key]] = true;
8559
- }
8560
- const hostDirectives = getHostDirectives(hostDir.directive);
8561
- if (hostDirectives !== null) {
8562
- queue.push(...hostDirectives);
8563
- }
8564
- continue;
8565
- }
8566
- for (const config of hostDir()) {
8567
- if (typeof config === 'function') {
8568
- continue;
8569
- }
8570
- if (config.inputs) {
8571
- for (let i = 0; i < config.inputs.length; i += 2) {
8572
- const exposedName = config.inputs[i + 1] || config.inputs[i];
8573
- cache[exposedName] = true;
8574
- }
8575
- }
8576
- const hostDirectives = getHostDirectives(config.directive);
8577
- if (hostDirectives !== null) {
8578
- queue.push(...hostDirectives);
8579
- }
8580
- }
8581
- }
8598
+ if (def.contentQueries !== null) tNode.flags |= 4;
8599
+ if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64;
8600
+ const lifeCycleHooks = def.type.prototype;
8601
+ if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
8602
+ (tView.preOrderHooks ??= []).push(tNode.index);
8603
+ preOrderHooksFound = true;
8582
8604
  }
8583
- return cache;
8584
- }
8585
- }
8586
- function getHostDirectives(directiveType) {
8587
- if (typeof directiveType === 'function' && 'ɵdir' in directiveType) {
8588
- return directiveType.ɵdir.hostDirectives ?? null;
8605
+ if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
8606
+ (tView.preOrderCheckHooks ??= []).push(tNode.index);
8607
+ preOrderCheckHooksFound = true;
8608
+ }
8609
+ directiveIdx++;
8589
8610
  }
8590
- return null;
8611
+ initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);
8591
8612
  }
8592
- function initializeControlFirstCreatePass(tView, tNode, lView) {
8613
+ function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {
8593
8614
  ngDevMode && assertFirstCreatePass(tView);
8594
- for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8595
- const directiveDef = tView.data[i];
8596
- if (directiveDef.controlDef) {
8597
- tNode.controlDirectiveIndex = i;
8598
- break;
8615
+ for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {
8616
+ const directiveDef = tView.data[index];
8617
+ if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {
8618
+ setupSelectorMatchedInputsOrOutputs(0, tNode, directiveDef, index);
8619
+ setupSelectorMatchedInputsOrOutputs(1, tNode, directiveDef, index);
8620
+ setupInitialInputs(tNode, index, false);
8621
+ } else {
8622
+ const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);
8623
+ setupHostDirectiveInputsOrOutputs(0, tNode, hostDirectiveDef, index);
8624
+ setupHostDirectiveInputsOrOutputs(1, tNode, hostDirectiveDef, index);
8625
+ setupInitialInputs(tNode, index, true);
8599
8626
  }
8600
8627
  }
8601
- if (tNode.controlDirectiveIndex === -1) {
8602
- return;
8628
+ }
8629
+ function setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {
8630
+ const aliasMap = mode === 0 ? def.inputs : def.outputs;
8631
+ for (const publicName in aliasMap) {
8632
+ if (aliasMap.hasOwnProperty(publicName)) {
8633
+ let bindings;
8634
+ if (mode === 0) {
8635
+ bindings = tNode.inputs ??= {};
8636
+ } else {
8637
+ bindings = tNode.outputs ??= {};
8638
+ }
8639
+ bindings[publicName] ??= [];
8640
+ bindings[publicName].push(directiveIndex);
8641
+ setShadowStylingInputFlags(tNode, publicName);
8642
+ }
8603
8643
  }
8604
- const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;
8605
- if (controlDef.passThroughInput) {
8606
- if ((tNode.inputs?.[controlDef.passThroughInput]?.length ?? 0) > 1) {
8607
- tNode.flags |= 4096;
8608
- return;
8644
+ }
8645
+ function setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) {
8646
+ const aliasMap = mode === 0 ? config.inputs : config.outputs;
8647
+ for (const initialName in aliasMap) {
8648
+ if (aliasMap.hasOwnProperty(initialName)) {
8649
+ const publicName = aliasMap[initialName];
8650
+ let bindings;
8651
+ if (mode === 0) {
8652
+ bindings = tNode.hostDirectiveInputs ??= {};
8653
+ } else {
8654
+ bindings = tNode.hostDirectiveOutputs ??= {};
8655
+ }
8656
+ bindings[publicName] ??= [];
8657
+ bindings[publicName].push(directiveIndex, initialName);
8658
+ setShadowStylingInputFlags(tNode, publicName);
8609
8659
  }
8610
8660
  }
8611
- initializeCustomControlStatus(tView, tNode);
8612
8661
  }
8613
- function initializeCustomControlStatus(tView, tNode) {
8614
- for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8615
- const directiveDef = tView.data[i];
8616
- if (tNode.directiveToIndex && !tNode.directiveToIndex.has(directiveDef.type)) {
8662
+ function setShadowStylingInputFlags(tNode, publicName) {
8663
+ if (publicName === 'class') {
8664
+ tNode.flags |= 8;
8665
+ } else if (publicName === 'style') {
8666
+ tNode.flags |= 16;
8667
+ }
8668
+ }
8669
+ function setupInitialInputs(tNode, directiveIndex, isHostDirective) {
8670
+ const {
8671
+ attrs,
8672
+ inputs,
8673
+ hostDirectiveInputs
8674
+ } = tNode;
8675
+ if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null || isInlineTemplate(tNode)) {
8676
+ tNode.initialInputs ??= [];
8677
+ tNode.initialInputs.push(null);
8678
+ return;
8679
+ }
8680
+ let inputsToStore = null;
8681
+ let i = 0;
8682
+ while (i < attrs.length) {
8683
+ const attrName = attrs[i];
8684
+ if (attrName === 0) {
8685
+ i += 4;
8617
8686
  continue;
8687
+ } else if (attrName === 5) {
8688
+ i += 2;
8689
+ continue;
8690
+ } else if (typeof attrName === 'number') {
8691
+ break;
8618
8692
  }
8619
- if (hasModelInput(directiveDef, 'value')) {
8620
- tNode.flags |= 1024;
8621
- tNode.customControlIndex = i;
8622
- return;
8623
- }
8624
- if (hasModelInput(directiveDef, 'checked')) {
8625
- tNode.flags |= 2048;
8626
- tNode.customControlIndex = i;
8627
- return;
8628
- }
8629
- }
8630
- if (tNode.hostDirectiveInputs !== null && tNode.hostDirectiveOutputs !== null && tNode.directiveToIndex !== null) {
8631
- const checkModel = (modelName, flag) => {
8632
- const inputs = tNode.hostDirectiveInputs[modelName];
8633
- const outputs = tNode.hostDirectiveOutputs[modelName + 'Change'];
8634
- if (!inputs || !outputs) {
8635
- return false;
8693
+ if (!isHostDirective && inputs.hasOwnProperty(attrName)) {
8694
+ const inputConfig = inputs[attrName];
8695
+ for (const index of inputConfig) {
8696
+ if (index === directiveIndex) {
8697
+ inputsToStore ??= [];
8698
+ inputsToStore.push(attrName, attrs[i + 1]);
8699
+ break;
8700
+ }
8636
8701
  }
8637
- for (let i = 0; i < inputs.length; i += 2) {
8638
- const inputIndex = inputs[i];
8639
- for (let j = 0; j < outputs.length; j += 2) {
8640
- const outputIndex = outputs[j];
8641
- if (inputIndex !== outputIndex) {
8642
- continue;
8643
- }
8644
- for (const data of tNode.directiveToIndex.values()) {
8645
- if (!Array.isArray(data)) {
8646
- continue;
8647
- }
8648
- const [hostIndex, start, end] = data;
8649
- if (inputIndex >= start && inputIndex <= end) {
8650
- tNode.flags |= flag;
8651
- tNode.customControlIndex = hostIndex;
8652
- return true;
8653
- }
8654
- }
8702
+ } else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) {
8703
+ const config = hostDirectiveInputs[attrName];
8704
+ for (let j = 0; j < config.length; j += 2) {
8705
+ if (config[j] === directiveIndex) {
8706
+ inputsToStore ??= [];
8707
+ inputsToStore.push(config[j + 1], attrs[i + 1]);
8708
+ break;
8655
8709
  }
8656
8710
  }
8657
- return false;
8658
- };
8659
- if (checkModel('value', 1024)) {
8660
- return;
8661
8711
  }
8662
- if (checkModel('checked', 2048)) {
8663
- return;
8712
+ i += 2;
8713
+ }
8714
+ tNode.initialInputs ??= [];
8715
+ tNode.initialInputs.push(inputsToStore);
8716
+ }
8717
+ function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
8718
+ ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');
8719
+ tView.data[directiveIndex] = def;
8720
+ const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));
8721
+ const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject, ngDevMode ? def.type.name : null);
8722
+ tView.blueprint[directiveIndex] = nodeInjectorFactory;
8723
+ lView[directiveIndex] = nodeInjectorFactory;
8724
+ registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
8725
+ }
8726
+ function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {
8727
+ ngDevMode && assertFirstCreatePass(tView);
8728
+ const hostBindings = def.hostBindings;
8729
+ if (hostBindings) {
8730
+ let hostBindingOpCodes = tView.hostBindingOpCodes;
8731
+ if (hostBindingOpCodes === null) {
8732
+ hostBindingOpCodes = tView.hostBindingOpCodes = [];
8733
+ }
8734
+ const elementIndx = ~tNode.index;
8735
+ if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {
8736
+ hostBindingOpCodes.push(elementIndx);
8664
8737
  }
8738
+ hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);
8665
8739
  }
8666
8740
  }
8667
- function hasModelInput(directiveDef, name) {
8668
- return hasInput(directiveDef, name) && hasOutput(directiveDef, name + 'Change');
8669
- }
8670
- function hasInput(directiveDef, name) {
8671
- return name in directiveDef.inputs;
8672
- }
8673
- function hasOutput(directiveDef, name) {
8674
- return name in directiveDef.outputs;
8675
- }
8676
-
8677
- const BINDING = /* @__PURE__ */Symbol('BINDING');
8678
- const INPUT_BINDING_METADATA = {
8679
- kind: 'input',
8680
- requiredVars: 1
8681
- };
8682
- const OUTPUT_BINDING_METADATA = {
8683
- kind: 'output',
8684
- requiredVars: 0
8685
- };
8686
- function inputBindingUpdate(targetDirectiveIdx, publicName, value) {
8687
- const lView = getLView();
8688
- const bindingIndex = nextBindingIndex();
8689
- if (bindingUpdated(lView, bindingIndex, value)) {
8690
- const tView = lView[TVIEW];
8691
- const tNode = getSelectedTNode();
8692
- const componentLView = getComponentLViewByIndex(tNode.index, lView);
8693
- markViewDirty(componentLView, 1);
8694
- const targetDef = tView.directiveRegistry[targetDirectiveIdx];
8695
- if (ngDevMode && !targetDef) {
8696
- throw new RuntimeError(315, `Input binding to property "${publicName}" does not have a target.`);
8697
- }
8698
- const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value);
8699
- if (ngDevMode) {
8700
- if (!hasSet) {
8701
- throw new RuntimeError(315, `${stringifyForError(targetDef.type)} does not have an input with a public name of "${publicName}".`);
8702
- }
8703
- storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex);
8741
+ function lastSelectedElementIdx(hostBindingOpCodes) {
8742
+ let i = hostBindingOpCodes.length;
8743
+ while (i > 0) {
8744
+ const value = hostBindingOpCodes[--i];
8745
+ if (typeof value === 'number' && value < 0) {
8746
+ return value;
8704
8747
  }
8705
8748
  }
8749
+ return 0;
8706
8750
  }
8707
- function inputBinding(publicName, value) {
8708
- if (publicName === 'formField') {
8709
- const binding = {
8710
- [BINDING]: INPUT_BINDING_METADATA,
8711
- create: () => {
8712
- controlCreateInternal();
8713
- },
8714
- update: () => {
8715
- inputBindingUpdate(binding.targetIdx, publicName, value());
8716
- controlUpdateInternal();
8751
+ function saveNameToExportMap(directiveIdx, def, exportsMap) {
8752
+ if (exportsMap) {
8753
+ if (def.exportAs) {
8754
+ for (let i = 0; i < def.exportAs.length; i++) {
8755
+ exportsMap[def.exportAs[i]] = directiveIdx;
8717
8756
  }
8718
- };
8719
- return binding;
8757
+ }
8758
+ if (isComponentDef(def)) exportsMap[''] = directiveIdx;
8720
8759
  }
8721
- const binding = {
8722
- [BINDING]: INPUT_BINDING_METADATA,
8723
- update: () => inputBindingUpdate(binding.targetIdx, publicName, value())
8724
- };
8725
- return binding;
8726
8760
  }
8727
- function outputBinding(eventName, listener) {
8728
- const binding = {
8729
- [BINDING]: OUTPUT_BINDING_METADATA,
8730
- create: () => {
8731
- const lView = getLView();
8732
- const tNode = getCurrentTNode();
8733
- const tView = lView[TVIEW];
8734
- const targetDef = tView.directiveRegistry[binding.targetIdx];
8735
- createOutputListener(tNode, lView, listener, targetDef, eventName);
8736
- }
8737
- };
8738
- return binding;
8761
+ function initTNodeFlags(tNode, index, numberOfDirectives) {
8762
+ ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');
8763
+ tNode.flags |= 1;
8764
+ tNode.directiveStart = index;
8765
+ tNode.directiveEnd = index + numberOfDirectives;
8766
+ tNode.providerIndexes = index;
8739
8767
  }
8740
- function twoWayBinding(publicName, value) {
8741
- const input = inputBinding(publicName, value);
8742
- const output = outputBinding(publicName + 'Change', eventValue => value.set(eventValue));
8743
- ngDevMode && assertNotDefined(input.create, 'Unexpected `create` callback in inputBinding');
8744
- ngDevMode && assertNotDefined(output.update, 'Unexpected `update` callback in outputBinding');
8745
- const binding = {
8746
- [BINDING]: {
8747
- kind: 'twoWay',
8748
- requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars
8749
- },
8750
- set targetIdx(idx) {
8751
- input.targetIdx = idx;
8752
- output.targetIdx = idx;
8753
- },
8754
- create: output.create,
8755
- update: input.update
8756
- };
8757
- return binding;
8768
+ function assertNoDuplicateDirectives(directives) {
8769
+ if (directives.length < 2) {
8770
+ return;
8771
+ }
8772
+ const seenDirectives = new Set();
8773
+ for (const current of directives) {
8774
+ if (seenDirectives.has(current)) {
8775
+ throw new RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);
8776
+ }
8777
+ seenDirectives.add(current);
8778
+ }
8758
8779
  }
8759
8780
 
8760
- function getClosestComponentName(node) {
8761
- let currentNode = node;
8762
- while (currentNode) {
8763
- const lView = readPatchedLView(currentNode);
8764
- if (lView !== null) {
8765
- for (let i = HEADER_OFFSET; i < lView.length; i++) {
8766
- const current = lView[i];
8767
- if (!isLView(current) && !isLContainer(current) || current[HOST] !== currentNode) {
8768
- continue;
8769
- }
8770
- const tView = lView[TVIEW];
8771
- const tNode = getTNode(tView, i);
8772
- if (isComponentHost(tNode)) {
8773
- const def = tView.data[tNode.directiveStart + tNode.componentOffset];
8774
- const name = getComponentName(def);
8775
- if (name !== null) {
8776
- return name;
8777
- } else {
8778
- break;
8779
- }
8780
- }
8781
- }
8782
- }
8783
- currentNode = currentNode.parentNode;
8781
+ function directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {
8782
+ const tView = lView[TVIEW];
8783
+ ngDevMode && assertFirstCreatePass(tView);
8784
+ const tViewConsts = tView.consts;
8785
+ const attrs = getConstant(tViewConsts, attrsIndex);
8786
+ const tNode = getOrCreateTNode(tView, index, type, name, attrs);
8787
+ if (bindingsEnabled) {
8788
+ resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);
8784
8789
  }
8785
- return null;
8790
+ tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
8791
+ if (tNode.attrs !== null) {
8792
+ computeStaticStyling(tNode, tNode.attrs, false);
8793
+ }
8794
+ if (tNode.mergedAttrs !== null) {
8795
+ computeStaticStyling(tNode, tNode.mergedAttrs, true);
8796
+ }
8797
+ if (tView.queries !== null) {
8798
+ tView.queries.elementStart(tView, tNode);
8799
+ }
8800
+ return tNode;
8786
8801
  }
8787
- function getComponentName(def) {
8788
- return def.debugInfo?.className || def.type.name || null;
8802
+ function directiveHostEndFirstCreatePass(tView, tNode) {
8803
+ ngDevMode && assertFirstCreatePass(tView);
8804
+ registerPostOrderHooks(tView, tNode);
8805
+ if (isContentQueryHost(tNode)) {
8806
+ tView.queries.elementEnd(tNode);
8807
+ }
8789
8808
  }
8790
-
8791
- class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
8792
- ngModule;
8793
- constructor(ngModule) {
8794
- super();
8795
- this.ngModule = ngModule;
8809
+ function domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {
8810
+ ngDevMode && assertFirstCreatePass(tView);
8811
+ const tViewConsts = tView.consts;
8812
+ const attrs = getConstant(tViewConsts, attrsIndex);
8813
+ const tNode = getOrCreateTNode(tView, index, type, name, attrs);
8814
+ tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
8815
+ if (localRefsIndex != null) {
8816
+ const refs = getConstant(tViewConsts, localRefsIndex);
8817
+ tNode.localNames = [];
8818
+ for (let i = 0; i < refs.length; i += 2) {
8819
+ tNode.localNames.push(refs[i], -1);
8820
+ }
8821
+ }
8822
+ if (tNode.attrs !== null) {
8823
+ computeStaticStyling(tNode, tNode.attrs, false);
8796
8824
  }
8797
- resolveComponentFactory(component) {
8798
- ngDevMode && assertComponentType(component);
8799
- const componentDef = getComponentDef(component);
8800
- return new ComponentFactory(componentDef, this.ngModule);
8825
+ if (tNode.mergedAttrs !== null) {
8826
+ computeStaticStyling(tNode, tNode.mergedAttrs, true);
8827
+ }
8828
+ if (tView.queries !== null) {
8829
+ tView.queries.elementStart(tView, tNode);
8801
8830
  }
8831
+ return tNode;
8802
8832
  }
8833
+
8834
+ const shadowRootSupported = typeof ShadowRoot !== 'undefined';
8835
+ const documentSupported = typeof Document !== 'undefined';
8803
8836
  function toInputRefArray(map) {
8804
8837
  return Object.keys(map).map(name => {
8805
8838
  const [propName, flags, transform] = map[name];
@@ -8865,7 +8898,7 @@ function createHostElement(componentDef, renderer) {
8865
8898
  function inferTagNameFromDefinition(componentDef) {
8866
8899
  return (componentDef.selectors[0][0] || 'div').toLowerCase();
8867
8900
  }
8868
- class ComponentFactory extends ComponentFactory$1 {
8901
+ class ComponentFactory {
8869
8902
  componentDef;
8870
8903
  ngModule;
8871
8904
  selector;
@@ -8883,7 +8916,6 @@ class ComponentFactory extends ComponentFactory$1 {
8883
8916
  return this.cachedOutputs;
8884
8917
  }
8885
8918
  constructor(componentDef, ngModule) {
8886
- super();
8887
8919
  this.componentDef = componentDef;
8888
8920
  this.ngModule = ngModule;
8889
8921
  this.componentType = componentDef.type;
@@ -8914,8 +8946,16 @@ class ComponentFactory extends ComponentFactory$1 {
8914
8946
  const rootTView = createRootTView(rootSelectorOrNode, cmpDef, componentBindings, directives);
8915
8947
  const hostRenderer = environment.rendererFactory.createRenderer(null, cmpDef);
8916
8948
  const hostElement = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, cmpDef.encapsulation, rootViewInjector) : createHostElement(cmpDef, hostRenderer);
8949
+ const sharedStylesHost = rootViewInjector.get(SHARED_STYLES_HOST, null);
8950
+ const styleHost = getStyleHost(hostElement, () => rootViewInjector.get(DOCUMENT$1, null) ?? getDocument());
8951
+ if (sharedStylesHost) sharedStylesHost.addHost(styleHost);
8917
8952
  const hasInputBindings = componentBindings?.some(isInputBinding) || directives?.some(d => typeof d !== 'function' && d.bindings.some(isInputBinding));
8918
8953
  const rootLView = createLView(null, rootTView, null, 512 | getInitialLViewFlagsFromDef(cmpDef), null, null, environment, hostRenderer, rootViewInjector, null, retrieveHydrationInfo(hostElement, rootViewInjector, true));
8954
+ if (sharedStylesHost && shadowRootSupported && styleHost instanceof ShadowRoot) {
8955
+ storeLViewOnDestroy(rootLView, () => {
8956
+ sharedStylesHost.removeHost(styleHost);
8957
+ });
8958
+ }
8919
8959
  rootLView[HEADER_OFFSET] = hostElement;
8920
8960
  enterView(rootLView);
8921
8961
  let componentView = null;
@@ -8946,7 +8986,7 @@ class ComponentFactory extends ComponentFactory$1 {
8946
8986
  }
8947
8987
  }
8948
8988
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
8949
- const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.6'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8989
+ const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.8'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8950
8990
  let creationBindings = null;
8951
8991
  let updateBindings = null;
8952
8992
  let varsToAllocate = 0;
@@ -8996,6 +9036,18 @@ function createRootTView(rootSelectorOrNode, componentDef, componentBindings, di
8996
9036
  const rootTView = createTView(0, null, getRootTViewTemplate(creationBindings, updateBindings), 1, varsToAllocate, directivesToApply, null, null, null, [tAttributes], null);
8997
9037
  return rootTView;
8998
9038
  }
9039
+ function getStyleHost(node, doc) {
9040
+ const rootNode = node.getRootNode?.();
9041
+ if (documentSupported && rootNode instanceof Document) {
9042
+ return rootNode.head;
9043
+ } else if (!rootNode) {
9044
+ return doc().head;
9045
+ } else if (shadowRootSupported && rootNode instanceof ShadowRoot) {
9046
+ return rootNode;
9047
+ } else {
9048
+ return doc().head;
9049
+ }
9050
+ }
8999
9051
  function getRootTViewTemplate(creationBindings, updateBindings) {
9000
9052
  if (!creationBindings && !updateBindings) {
9001
9053
  return null;
@@ -9137,34 +9189,26 @@ class R3ViewContainerRef extends ViewContainerRef {
9137
9189
  this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
9138
9190
  return viewRef;
9139
9191
  }
9140
- createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector, directives, bindings) {
9141
- const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
9192
+ createComponent(componentType, opts, injector, projectableNodes, environmentInjector, directives, bindings) {
9142
9193
  let index;
9143
- if (isComponentFactory) {
9144
- if (ngDevMode) {
9145
- assertEqual(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' + 'and an options object as the second argument. This combination of arguments ' + 'is incompatible. You can either change the first argument to provide Component ' + 'type or change the second argument to be a number (representing an index at ' + "which to insert the new component's host view into this container)");
9146
- }
9147
- index = indexOrOptions;
9148
- } else {
9149
- if (ngDevMode) {
9150
- assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`);
9151
- assertEqual(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' + "and a number (representing an index at which to insert the new component's " + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.');
9152
- }
9153
- const options = indexOrOptions || {};
9154
- if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
9155
- throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
9156
- }
9157
- index = options.index;
9158
- injector = options.injector;
9159
- projectableNodes = options.projectableNodes;
9160
- environmentInjector = options.environmentInjector || options.ngModuleRef;
9161
- directives = options.directives;
9162
- bindings = options.bindings;
9163
- }
9164
- const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory(getComponentDef(componentFactoryOrType));
9194
+ if (ngDevMode) {
9195
+ assertDefined(getComponentDef(componentType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`);
9196
+ assertEqual(typeof opts !== 'number', true, 'It looks like Component type was provided as the first argument ' + "and a number (representing an index at which to insert the new component's " + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.');
9197
+ }
9198
+ const options = opts || {};
9199
+ if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
9200
+ throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
9201
+ }
9202
+ index = options.index;
9203
+ injector = options.injector;
9204
+ projectableNodes = options.projectableNodes;
9205
+ environmentInjector = options.environmentInjector || options.ngModuleRef;
9206
+ directives = options.directives;
9207
+ bindings = options.bindings;
9208
+ const componentFactory = new ComponentFactory(getComponentDef(componentType));
9165
9209
  const contextInjector = injector || this.parentInjector;
9166
9210
  if (!environmentInjector && componentFactory.ngModule == null) {
9167
- const _injector = isComponentFactory ? contextInjector : this.parentInjector;
9211
+ const _injector = this.parentInjector;
9168
9212
  const result = _injector.get(EnvironmentInjector, null);
9169
9213
  if (result) {
9170
9214
  environmentInjector = result;
@@ -9293,7 +9337,10 @@ function populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {
9293
9337
  }
9294
9338
  const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);
9295
9339
  const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];
9296
- ngDevMode && assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');
9340
+ if (serializedViews === undefined) {
9341
+ ngDevMode && console.warn('Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');
9342
+ return false;
9343
+ }
9297
9344
  const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);
9298
9345
  if (ngDevMode) {
9299
9346
  validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);
@@ -9736,7 +9783,6 @@ class NgModuleRef extends NgModuleRef$1 {
9736
9783
  _r3Injector;
9737
9784
  instance;
9738
9785
  destroyCbs = [];
9739
- componentFactoryResolver = new ComponentFactoryResolver(this);
9740
9786
  constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {
9741
9787
  super();
9742
9788
  this.ngModuleType = ngModuleType;
@@ -9747,9 +9793,6 @@ class NgModuleRef extends NgModuleRef$1 {
9747
9793
  this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [{
9748
9794
  provide: NgModuleRef$1,
9749
9795
  useValue: this
9750
- }, {
9751
- provide: ComponentFactoryResolver$1,
9752
- useValue: this.componentFactoryResolver
9753
9796
  }, ...additionalProviders], stringify(ngModuleType), new Set(['environment']));
9754
9797
  if (runInjectorInitializers) {
9755
9798
  this.resolveInjectorInitializers();
@@ -9789,16 +9832,12 @@ function createNgModuleRefWithProviders(moduleType, parentInjector, additionalPr
9789
9832
  }
9790
9833
  class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
9791
9834
  injector;
9792
- componentFactoryResolver = new ComponentFactoryResolver(this);
9793
9835
  instance = null;
9794
9836
  constructor(config) {
9795
9837
  super();
9796
9838
  const injector = new R3Injector([...config.providers, {
9797
9839
  provide: NgModuleRef$1,
9798
9840
  useValue: this
9799
- }, {
9800
- provide: ComponentFactoryResolver$1,
9801
- useValue: this.componentFactoryResolver
9802
9841
  }], config.parent || getNullInjector(), config.debugName, new Set(['environment']));
9803
9842
  this.injector = injector;
9804
9843
  if (config.runEnvironmentInitializers) {
@@ -10306,7 +10345,7 @@ function resolveHostDirectives(matches) {
10306
10345
  const start = allDirectiveDefs.length;
10307
10346
  hostDirectiveDefs ??= new Map();
10308
10347
  hostDirectiveRanges ??= new Map();
10309
- findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs);
10348
+ findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs, matches);
10310
10349
  hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]);
10311
10350
  }
10312
10351
  if (i === 0 && isComponentDef(def)) {
@@ -10317,37 +10356,59 @@ function resolveHostDirectives(matches) {
10317
10356
  for (let i = hasComponent ? 1 : 0; i < matches.length; i++) {
10318
10357
  allDirectiveDefs.push(matches[i]);
10319
10358
  }
10359
+ if (hostDirectiveDefs !== null) {
10360
+ hostDirectiveDefs.forEach((def, hostDirectiveDef) => {
10361
+ patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);
10362
+ });
10363
+ }
10320
10364
  return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges];
10321
10365
  }
10322
- function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
10366
+ function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs, templateMatches) {
10323
10367
  if (currentDef.hostDirectives !== null) {
10324
10368
  for (const configOrFn of currentDef.hostDirectives) {
10325
10369
  if (typeof configOrFn === 'function') {
10326
10370
  const resolved = configOrFn();
10327
10371
  for (const config of resolved) {
10328
- trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs);
10372
+ trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs, templateMatches);
10329
10373
  }
10330
10374
  } else {
10331
- trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs);
10375
+ trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs, templateMatches);
10332
10376
  }
10333
10377
  }
10334
10378
  }
10335
10379
  }
10336
- function trackHostDirectiveDef(def, matchedDefs, hostDirectiveDefs) {
10380
+ function trackHostDirectiveDef(def, finalMatches, hostDirectiveDefs, templateMatches) {
10337
10381
  const hostDirectiveDef = getDirectiveDef(def.directive);
10338
10382
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
10339
10383
  validateHostDirective(def, hostDirectiveDef);
10340
10384
  }
10341
- patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);
10342
- findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);
10343
- hostDirectiveDefs.set(hostDirectiveDef, def);
10344
- matchedDefs.push(hostDirectiveDef);
10385
+ findHostDirectiveDefs(hostDirectiveDef, finalMatches, hostDirectiveDefs, templateMatches);
10386
+ if (hostDirectiveDefs.has(hostDirectiveDef)) {
10387
+ const existing = hostDirectiveDefs.get(hostDirectiveDef);
10388
+ mergeBindingMaps(existing, def.inputs, 'input');
10389
+ mergeBindingMaps(existing, def.outputs, 'output');
10390
+ } else if (!templateMatches.includes(hostDirectiveDef)) {
10391
+ hostDirectiveDefs.set(hostDirectiveDef, def);
10392
+ finalMatches.push(hostDirectiveDef);
10393
+ }
10394
+ }
10395
+ function mergeBindingMaps(existingDef, newMap, kind) {
10396
+ const targetMap = kind === 'input' ? existingDef.inputs : existingDef.outputs;
10397
+ Object.keys(newMap).forEach(publicName => {
10398
+ const alias = newMap[publicName];
10399
+ if (!targetMap.hasOwnProperty(publicName) || targetMap[publicName] === alias) {
10400
+ targetMap[publicName] = alias;
10401
+ } else if (typeof ngDevMode === 'undefined' || ngDevMode) {
10402
+ const message = `${kind === 'input' ? 'Input' : 'Output'} "${publicName}" from ${existingDef.directive.name} ` + `is exposed under the following conflicting names: "${targetMap[publicName]}" and "${alias}". ` + `An ${kind} can only be exposed under a single name.`;
10403
+ throw new RuntimeError(312, message);
10404
+ }
10405
+ });
10345
10406
  }
10346
10407
  function createHostDirectiveDef(config) {
10347
10408
  return typeof config === 'function' ? {
10348
10409
  directive: resolveForwardRef(config),
10349
- inputs: EMPTY_OBJ,
10350
- outputs: EMPTY_OBJ
10410
+ inputs: {},
10411
+ outputs: {}
10351
10412
  } : {
10352
10413
  directive: resolveForwardRef(config.directive),
10353
10414
  inputs: bindingArrayToMap(config.inputs),
@@ -10355,12 +10416,11 @@ function createHostDirectiveDef(config) {
10355
10416
  };
10356
10417
  }
10357
10418
  function bindingArrayToMap(bindings) {
10358
- if (bindings === undefined || bindings.length === 0) {
10359
- return EMPTY_OBJ;
10360
- }
10361
10419
  const result = {};
10362
- for (let i = 0; i < bindings.length; i += 2) {
10363
- result[bindings[i]] = bindings[i + 1];
10420
+ if (bindings !== undefined && bindings.length > 0) {
10421
+ for (let i = 0; i < bindings.length; i += 2) {
10422
+ result[bindings[i]] = bindings[i + 1];
10423
+ }
10364
10424
  }
10365
10425
  return result;
10366
10426
  }
@@ -11097,13 +11157,6 @@ function canBeHeldWeakly(value) {
11097
11157
  return value !== null && (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol');
11098
11158
  }
11099
11159
 
11100
- function isSignal(value) {
11101
- return typeof value === 'function' && value[SIGNAL] !== undefined;
11102
- }
11103
- function isWritableSignal(value) {
11104
- return isSignal(value) && typeof value.set === 'function';
11105
- }
11106
-
11107
11160
  function applyChanges(component) {
11108
11161
  ngDevMode && assertDefined(component, 'component');
11109
11162
  markViewDirty(getComponentViewByInstance(component), 3);
@@ -11720,6 +11773,39 @@ let changeDetectionRuns = 0;
11720
11773
  let changeDetectionSyncRuns = 0;
11721
11774
  let counter = 0;
11722
11775
  const eventsStack = [];
11776
+ function getBaseDocUrl() {
11777
+ const full = VERSION.full;
11778
+ const isPreRelease = full.includes('-next') || full.includes('-rc') || full === '22.0.0-next.8';
11779
+ const prefix = isPreRelease ? 'next' : `v${VERSION.major}`;
11780
+ return `https://${prefix}.angular.dev`;
11781
+ }
11782
+ function getLifecycleHookDocUrl(hookName) {
11783
+ const match = hookName.match(/:(ng\w+)$/);
11784
+ if (!match) return undefined;
11785
+ const lifecycleHook = match[1].toLowerCase();
11786
+ const baseUrl = getBaseDocUrl();
11787
+ return `${baseUrl}/guide/components/lifecycle#${lifecycleHook}`;
11788
+ }
11789
+ function getProfilerEventDocUrl(event, entryName) {
11790
+ const baseUrl = getBaseDocUrl();
11791
+ switch (event) {
11792
+ case ProfilerEvent.ChangeDetectionStart:
11793
+ case ProfilerEvent.ChangeDetectionEnd:
11794
+ case ProfilerEvent.ChangeDetectionSyncStart:
11795
+ case ProfilerEvent.ChangeDetectionSyncEnd:
11796
+ return `${baseUrl}/best-practices/runtime-performance`;
11797
+ case ProfilerEvent.AfterRenderHooksStart:
11798
+ case ProfilerEvent.AfterRenderHooksEnd:
11799
+ return `${baseUrl}/guide/components/lifecycle#aftereveryrender-and-afternextrender`;
11800
+ case ProfilerEvent.DeferBlockStateStart:
11801
+ case ProfilerEvent.DeferBlockStateEnd:
11802
+ return `${baseUrl}/guide/defer`;
11803
+ case ProfilerEvent.LifecycleHookStart:
11804
+ return getLifecycleHookDocUrl(entryName);
11805
+ default:
11806
+ return undefined;
11807
+ }
11808
+ }
11723
11809
  function measureStart(startEvent) {
11724
11810
  eventsStack.push([startEvent, counter]);
11725
11811
  console.timeStamp('Event_' + startEvent + '_' + counter++);
@@ -11730,7 +11816,11 @@ function measureEnd(startEvent, entryName, color) {
11730
11816
  top = eventsStack.pop();
11731
11817
  assertDefined(top, 'Profiling error: could not find start event entry ' + startEvent);
11732
11818
  } while (top[0] !== startEvent);
11733
- console.timeStamp(entryName, 'Event_' + top[0] + '_' + top[1], undefined, '\u{1F170}\uFE0F Angular', undefined, color);
11819
+ const docUrl = getProfilerEventDocUrl(startEvent, entryName);
11820
+ console.timeStamp(entryName, 'Event_' + top[0] + '_' + top[1], undefined, '\u{1F170}\uFE0F Angular', undefined, color, docUrl ? {
11821
+ description: 'Documentation',
11822
+ url: docUrl
11823
+ } : undefined);
11734
11824
  }
11735
11825
  const chromeDevToolsInjectorProfiler = event => {
11736
11826
  const eventType = event.type;
@@ -12114,9 +12204,6 @@ function publishSignalConfiguration() {
12114
12204
  throw new RuntimeError(600, errorMessage);
12115
12205
  });
12116
12206
  }
12117
- function isBoundToModule(cf) {
12118
- return cf.isBoundToModule;
12119
- }
12120
12207
  const MAXIMUM_REFRESH_RERUNS = 10;
12121
12208
  function optionsReducer(dst, objs) {
12122
12209
  if (Array.isArray(objs)) {
@@ -12178,35 +12265,34 @@ class ApplicationRef {
12178
12265
  get injector() {
12179
12266
  return this._injector;
12180
12267
  }
12181
- bootstrap(componentOrFactory, rootSelectorOrNode) {
12182
- return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode);
12268
+ bootstrap(component, rootSelectorOrNode) {
12269
+ return this.bootstrapImpl(component, rootSelectorOrNode);
12183
12270
  }
12184
- bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = Injector.NULL) {
12271
+ bootstrapImpl(component, hostElementOrOptions, injector = Injector.NULL) {
12185
12272
  const ngZone = this._injector.get(NgZone);
12186
12273
  return ngZone.run(() => {
12187
12274
  profiler(ProfilerEvent.BootstrapComponentStart);
12188
12275
  (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
12189
- const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
12190
12276
  const initStatus = this._injector.get(ApplicationInitStatus);
12191
12277
  if (!initStatus.done) {
12192
12278
  let errorMessage = '';
12193
12279
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
12194
- const standalone = !isComponentFactory && isStandalone(componentOrFactory);
12280
+ const standalone = isStandalone(component);
12195
12281
  errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' + (standalone ? '' : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');
12196
12282
  }
12197
12283
  throw new RuntimeError(405, errorMessage);
12198
12284
  }
12199
- let componentFactory;
12200
- if (isComponentFactory) {
12201
- componentFactory = componentOrFactory;
12202
- } else {
12203
- const resolver = this._injector.get(ComponentFactoryResolver$1);
12204
- componentFactory = resolver.resolveComponentFactory(componentOrFactory);
12205
- }
12206
- this.componentTypes.push(componentFactory.componentType);
12207
- const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef$1);
12208
- const selectorOrNode = rootSelectorOrNode || componentFactory.selector;
12209
- const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule);
12285
+ const componentDef = getComponentDef(component);
12286
+ const ngModule = this._injector.get(NgModuleRef$1);
12287
+ const componentFactory = new ComponentFactory(componentDef, ngModule);
12288
+ this.componentTypes.push(component);
12289
+ const {
12290
+ hostElement,
12291
+ directives,
12292
+ bindings
12293
+ } = normalizeBootstrapOptions(hostElementOrOptions);
12294
+ const selectorOrNode = hostElement || componentFactory.selector;
12295
+ const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule.injector, directives, bindings);
12210
12296
  const nativeElement = compRef.location.nativeElement;
12211
12297
  const testability = compRef.injector.get(TESTABILITY, null);
12212
12298
  testability?.registerApplication(nativeElement);
@@ -12398,6 +12484,14 @@ class ApplicationRef {
12398
12484
  }]
12399
12485
  }], () => [], null);
12400
12486
  })();
12487
+ function normalizeBootstrapOptions(hostElementOrOptions) {
12488
+ if (hostElementOrOptions === undefined || typeof hostElementOrOptions === 'string' || hostElementOrOptions instanceof Element) {
12489
+ return {
12490
+ hostElement: hostElementOrOptions
12491
+ };
12492
+ }
12493
+ return hostElementOrOptions;
12494
+ }
12401
12495
  function warnIfDestroyed(destroyed) {
12402
12496
  if (destroyed) {
12403
12497
  console.warn(formatRuntimeError(406, 'This instance of the `ApplicationRef` has already been destroyed.'));
@@ -12909,9 +13003,11 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12909
13003
  }
12910
13004
  tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {
12911
13005
  let failed = false;
13006
+ let failedReason = null;
12912
13007
  const directiveDefs = [];
12913
13008
  const pipeDefs = [];
12914
- for (const result of results) {
13009
+ for (let i = 0; i < results.length; i++) {
13010
+ const result = results[i];
12915
13011
  if (result.status === 'fulfilled') {
12916
13012
  const dependency = result.value;
12917
13013
  const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);
@@ -12925,6 +13021,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12925
13021
  }
12926
13022
  } else {
12927
13023
  failed = true;
13024
+ failedReason = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
12928
13025
  break;
12929
13026
  }
12930
13027
  }
@@ -12932,7 +13029,19 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12932
13029
  tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
12933
13030
  if (tDetails.errorTmplIndex === null) {
12934
13031
  const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';
12935
- const error = new RuntimeError(-750, ngDevMode && 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.');
13032
+ let errorMsg = '';
13033
+ if (ngDevMode) {
13034
+ errorMsg = 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.';
13035
+ const depsFn = tDetails.dependencyResolverFn;
13036
+ const errorReason = failedReason?.message;
13037
+ if (depsFn) {
13038
+ errorMsg += `\n\nAngular tried to invoke the following dependency function (compiler-generated):\n` + `\`\`\`\n${depsFn.toString()}\n\`\`\``;
13039
+ }
13040
+ if (errorReason) {
13041
+ errorMsg += depsFn ? `\n\nbut it resulted in the following error:\n\n${errorReason}` : `\n\nThe loading resulted in the following error:\n\n${errorReason}`;
13042
+ }
13043
+ }
13044
+ const error = new RuntimeError(-750, errorMsg);
12936
13045
  handleUncaughtError(lView, error);
12937
13046
  }
12938
13047
  } else {
@@ -18553,14 +18662,6 @@ function provideZonelessChangeDetectionInternal() {
18553
18662
  }];
18554
18663
  }
18555
18664
 
18556
- class ModuleWithComponentFactories {
18557
- ngModuleFactory;
18558
- componentFactories;
18559
- constructor(ngModuleFactory, componentFactories) {
18560
- this.ngModuleFactory = ngModuleFactory;
18561
- this.componentFactories = componentFactories;
18562
- }
18563
- }
18564
18665
  class Compiler {
18565
18666
  compileModuleSync(moduleType) {
18566
18667
  return new NgModuleFactory(moduleType);
@@ -18568,19 +18669,6 @@ class Compiler {
18568
18669
  compileModuleAsync(moduleType) {
18569
18670
  return Promise.resolve(this.compileModuleSync(moduleType));
18570
18671
  }
18571
- compileModuleAndAllComponentsSync(moduleType) {
18572
- const ngModuleFactory = this.compileModuleSync(moduleType);
18573
- const moduleDef = getNgModuleDef(moduleType);
18574
- const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {
18575
- const componentDef = getComponentDef(declaration);
18576
- componentDef && factories.push(new ComponentFactory(componentDef));
18577
- return factories;
18578
- }, []);
18579
- return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
18580
- }
18581
- compileModuleAndAllComponentsAsync(moduleType) {
18582
- return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
18583
- }
18584
18672
  clearCache() {}
18585
18673
  clearCacheFor(type) {}
18586
18674
  getModuleId(moduleType) {
@@ -18978,5 +19066,5 @@ function getDebugNode(nativeNode) {
18978
19066
  return null;
18979
19067
  }
18980
19068
 
18981
- export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactory$1, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, ControlFlowBlockType, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, EVENT_REPLAY_QUEUE, ElementRef, EnvironmentNgModuleRefAdapter, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MAX_ANIMATION_TIMEOUT, MULTIPLIER, MissingTranslationStrategy, ModuleWithComponentFactories, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, Optional, Output, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, Pipe, ProfilerEvent, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allLeavingAnimations, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getClosestComponentName, getCompilerFacade, getDebugNode, getDeferBlocks, getDirectives, getDocument, getHostElement, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getTDeferBlockDetails, getTransferState, inferTagNameFromDefinition, inputBinding, invokeListeners, isBoundToModule, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSignal, isSubscribable, isTNodeShape, isViewDirty, isWritableSignal, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, promiseWithResolvers, provideAppInitializer, provideIdleServiceWith, provideNgReflectAttributes, provideZonelessChangeDetection, provideZonelessChangeDetectionInternal, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetIncrementalHydrationEnabledWarnedForTests, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validAppIdInitializer, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵControlFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵanimateEnter, ɵɵanimateEnterListener, ɵɵanimateLeave, ɵɵanimateLeaveListener, ɵɵariaProperty, ɵɵarrowFunction, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵcontrol, ɵɵcontrolCreate, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };
19069
+ export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChainedInjector, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, ControlFlowBlockType, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, EVENT_REPLAY_QUEUE, ElementRef, EnvironmentNgModuleRefAdapter, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MAX_ANIMATION_TIMEOUT, MULTIPLIER, MissingTranslationStrategy, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NodeInjector, Optional, Output, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, Pipe, ProfilerEvent, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SHARED_STYLES_HOST, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allLeavingAnimations, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getClosestComponentName, getCompilerFacade, getDebugNode, getDeferBlocks, getDirectives, getDocument, getHostElement, getInjector, getInjectorMetadata, getInjectorProviders, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNodeInjectorTNode, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getSignalGraph, getTDeferBlockDetails, getTransferState, inferTagNameFromDefinition, inputBinding, invokeListeners, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, promiseWithResolvers, provideAppInitializer, provideIdleServiceWith, provideNgReflectAttributes, provideZonelessChangeDetection, provideZonelessChangeDetectionInternal, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetIncrementalHydrationEnabledWarnedForTests, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validAppIdInitializer, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, walkLViewDirectives, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵControlFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵanimateEnter, ɵɵanimateEnterListener, ɵɵanimateLeave, ɵɵanimateLeaveListener, ɵɵariaProperty, ɵɵarrowFunction, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵcontrol, ɵɵcontrolCreate, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };
18982
19070
  //# sourceMappingURL=_debug_node-chunk.mjs.map