@angular/core 16.0.0-next.4 → 16.0.0-next.6

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 (369) hide show
  1. package/esm2022/rxjs-interop/index.mjs +9 -0
  2. package/esm2022/rxjs-interop/public_api.mjs +15 -0
  3. package/esm2022/rxjs-interop/rxjs-interop.mjs +5 -0
  4. package/esm2022/rxjs-interop/src/from_observable.mjs +46 -0
  5. package/esm2022/rxjs-interop/src/from_signal.mjs +36 -0
  6. package/esm2022/rxjs-interop/src/index.mjs +11 -0
  7. package/esm2022/rxjs-interop/src/take_until_destroyed.mjs +33 -0
  8. package/{esm2020 → esm2022}/src/application_init.mjs +3 -3
  9. package/{esm2020 → esm2022}/src/application_module.mjs +4 -4
  10. package/esm2022/src/application_ref.mjs +969 -0
  11. package/{esm2020 → esm2022}/src/change_detection/change_detector_ref.mjs +6 -6
  12. package/esm2022/src/change_detection/differs/iterable_differs.mjs +81 -0
  13. package/esm2022/src/change_detection/differs/keyvalue_differs.mjs +74 -0
  14. package/{esm2020 → esm2022}/src/console.mjs +3 -3
  15. package/esm2022/src/core.mjs +56 -0
  16. package/esm2022/src/core_private_export.mjs +39 -0
  17. package/esm2022/src/core_reactivity_export_internal.mjs +12 -0
  18. package/esm2022/src/di/contextual.mjs +54 -0
  19. package/esm2022/src/di/index.mjs +29 -0
  20. package/esm2022/src/di/injector.mjs +62 -0
  21. package/esm2022/src/di/injector_compatibility.mjs +239 -0
  22. package/esm2022/src/di/provider_collection.mjs +279 -0
  23. package/esm2022/src/di/reflective_injector.mjs +311 -0
  24. package/esm2022/src/errors.mjs +49 -0
  25. package/esm2022/src/hydration/annotate.mjs +426 -0
  26. package/esm2022/src/hydration/api.mjs +176 -0
  27. package/esm2022/src/hydration/cleanup.mjs +95 -0
  28. package/esm2022/src/hydration/node_lookup_utils.mjs +273 -0
  29. package/esm2022/src/hydration/utils.mjs +219 -0
  30. package/esm2022/src/initial_render_pending_tasks.mjs +75 -0
  31. package/{esm2020 → esm2022}/src/linker/compiler.mjs +5 -5
  32. package/{esm2020 → esm2022}/src/linker/component_factory.mjs +1 -1
  33. package/esm2022/src/linker/component_factory_resolver.mjs +42 -0
  34. package/{esm2020 → esm2022}/src/linker/destroy_ref.mjs +11 -11
  35. package/{esm2020 → esm2022}/src/linker/element_ref.mjs +6 -6
  36. package/esm2022/src/linker/query_list.mjs +169 -0
  37. package/esm2022/src/linker/template_ref.mjs +102 -0
  38. package/{esm2020 → esm2022}/src/linker/view_container_ref.mjs +7 -7
  39. package/{esm2020 → esm2022}/src/linker/view_ref.mjs +2 -2
  40. package/esm2022/src/metadata/di.mjs +69 -0
  41. package/{esm2020 → esm2022}/src/metadata/directives.mjs +1 -1
  42. package/{esm2020 → esm2022}/src/metadata/do_boostrap.mjs +1 -1
  43. package/{esm2020 → esm2022}/src/metadata/ng_module.mjs +2 -2
  44. package/esm2022/src/metadata.mjs +18 -0
  45. package/{esm2020 → esm2022}/src/render/api.mjs +6 -6
  46. package/esm2022/src/render3/component_ref.mjs +393 -0
  47. package/{esm2020 → esm2022}/src/render3/context_discovery.mjs +1 -1
  48. package/esm2022/src/render3/features/standalone_feature.mjs +70 -0
  49. package/{esm2020 → esm2022}/src/render3/instructions/element.mjs +3 -2
  50. package/{esm2020 → esm2022}/src/render3/instructions/element_container.mjs +1 -2
  51. package/esm2022/src/render3/instructions/listener.mjs +244 -0
  52. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +35 -0
  53. package/{esm2020 → esm2022}/src/render3/instructions/shared.mjs +26 -38
  54. package/{esm2020 → esm2022}/src/render3/instructions/styling.mjs +5 -2
  55. package/esm2022/src/render3/interfaces/view.mjs +48 -0
  56. package/esm2022/src/render3/jit/module.mjs +531 -0
  57. package/esm2022/src/render3/ng_module_ref.mjs +134 -0
  58. package/esm2022/src/render3/node_manipulation.mjs +960 -0
  59. package/esm2022/src/render3/reactive_lview_consumer.mjs +81 -0
  60. package/esm2022/src/render3/reactivity/effect.mjs +77 -0
  61. package/{esm2020 → esm2022}/src/render3/util/change_detection_utils.mjs +2 -2
  62. package/esm2022/src/render3/view_ref.mjs +307 -0
  63. package/{esm2020 → esm2022}/src/sanitization/sanitization.mjs +3 -3
  64. package/{esm2020 → esm2022}/src/sanitization/sanitizer.mjs +7 -7
  65. package/esm2022/src/signals/index.mjs +16 -0
  66. package/esm2022/src/signals/src/api.mjs +46 -0
  67. package/esm2022/src/signals/src/computed.mjs +140 -0
  68. package/esm2022/src/signals/src/errors.mjs +18 -0
  69. package/esm2022/src/signals/src/graph.mjs +189 -0
  70. package/esm2022/src/signals/src/signal.mjs +86 -0
  71. package/esm2022/src/signals/src/watch.mjs +63 -0
  72. package/esm2022/src/signals/src/weak_ref.mjs +35 -0
  73. package/{esm2020 → esm2022}/src/testability/testability.mjs +5 -5
  74. package/esm2022/src/transfer_state.mjs +153 -0
  75. package/esm2022/src/util/ng_dev_mode.mjs +80 -0
  76. package/{esm2020 → esm2022}/src/version.mjs +1 -1
  77. package/{esm2020 → esm2022}/testing/src/logger.mjs +4 -4
  78. package/{esm2020 → esm2022}/testing/src/ng_zone_mock.mjs +4 -4
  79. package/{esm2020 → esm2022}/testing/src/test_bed.mjs +2 -2
  80. package/esm2022/testing/src/test_bed_compiler.mjs +845 -0
  81. package/{fesm2020 → fesm2022}/core.mjs +15745 -15364
  82. package/fesm2022/core.mjs.map +1 -0
  83. package/fesm2022/rxjs-interop.mjs +104 -0
  84. package/fesm2022/rxjs-interop.mjs.map +1 -0
  85. package/{fesm2020 → fesm2022}/testing.mjs +913 -176
  86. package/fesm2022/testing.mjs.map +1 -0
  87. package/index.d.ts +459 -211
  88. package/package.json +14 -16
  89. package/rxjs-interop/index.d.ts +95 -0
  90. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +694 -0
  91. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js.map +7 -0
  92. package/schematics/migrations/{router-link-with-href → remove-module-id}/bundle.js +153 -155
  93. package/schematics/migrations/remove-module-id/bundle.js.map +7 -0
  94. package/schematics/migrations.json +8 -8
  95. package/schematics/ng-generate/standalone-migration/bundle.js +928 -562
  96. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  97. package/testing/index.d.ts +1 -1
  98. package/esm2020/src/application_ref.mjs +0 -907
  99. package/esm2020/src/change_detection/differs/iterable_differs.mjs +0 -81
  100. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +0 -74
  101. package/esm2020/src/core.mjs +0 -55
  102. package/esm2020/src/core_private_export.mjs +0 -38
  103. package/esm2020/src/core_reactivity_export_internal.mjs +0 -9
  104. package/esm2020/src/di/contextual.mjs +0 -37
  105. package/esm2020/src/di/index.mjs +0 -29
  106. package/esm2020/src/di/injector.mjs +0 -62
  107. package/esm2020/src/di/injector_compatibility.mjs +0 -236
  108. package/esm2020/src/di/provider_collection.mjs +0 -279
  109. package/esm2020/src/di/reflective_injector.mjs +0 -311
  110. package/esm2020/src/errors.mjs +0 -48
  111. package/esm2020/src/hydration/annotate.mjs +0 -384
  112. package/esm2020/src/hydration/api.mjs +0 -141
  113. package/esm2020/src/hydration/cleanup.mjs +0 -101
  114. package/esm2020/src/hydration/node_lookup_utils.mjs +0 -275
  115. package/esm2020/src/hydration/utils.mjs +0 -219
  116. package/esm2020/src/linker/component_factory_resolver.mjs +0 -42
  117. package/esm2020/src/linker/query_list.mjs +0 -169
  118. package/esm2020/src/linker/template_ref.mjs +0 -102
  119. package/esm2020/src/metadata/di.mjs +0 -108
  120. package/esm2020/src/metadata.mjs +0 -18
  121. package/esm2020/src/render3/component_ref.mjs +0 -377
  122. package/esm2020/src/render3/features/standalone_feature.mjs +0 -70
  123. package/esm2020/src/render3/instructions/listener.mjs +0 -243
  124. package/esm2020/src/render3/interfaces/view.mjs +0 -47
  125. package/esm2020/src/render3/jit/module.mjs +0 -544
  126. package/esm2020/src/render3/ng_module_ref.mjs +0 -132
  127. package/esm2020/src/render3/node_manipulation.mjs +0 -961
  128. package/esm2020/src/render3/view_ref.mjs +0 -306
  129. package/esm2020/src/signals/index.mjs +0 -16
  130. package/esm2020/src/signals/src/api.mjs +0 -46
  131. package/esm2020/src/signals/src/computed.mjs +0 -142
  132. package/esm2020/src/signals/src/effect.mjs +0 -67
  133. package/esm2020/src/signals/src/graph.mjs +0 -114
  134. package/esm2020/src/signals/src/signal.mjs +0 -78
  135. package/esm2020/src/signals/src/watch.mjs +0 -54
  136. package/esm2020/src/signals/src/weak_ref.mjs +0 -27
  137. package/esm2020/src/transfer_state.mjs +0 -153
  138. package/esm2020/src/util/ng_dev_mode.mjs +0 -79
  139. package/esm2020/testing/src/test_bed_compiler.mjs +0 -846
  140. package/fesm2015/core.mjs +0 -30473
  141. package/fesm2015/core.mjs.map +0 -1
  142. package/fesm2015/testing.mjs +0 -26417
  143. package/fesm2015/testing.mjs.map +0 -1
  144. package/fesm2020/core.mjs.map +0 -1
  145. package/fesm2020/testing.mjs.map +0 -1
  146. package/schematics/migrations/relative-link-resolution/bundle.js +0 -283
  147. package/schematics/migrations/relative-link-resolution/bundle.js.map +0 -7
  148. package/schematics/migrations/router-link-with-href/bundle.js.map +0 -7
  149. /package/{esm2020 → esm2022}/core.mjs +0 -0
  150. /package/{esm2020 → esm2022}/index.mjs +0 -0
  151. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
  152. /package/{esm2020 → esm2022}/src/application_config.mjs +0 -0
  153. /package/{esm2020 → esm2022}/src/application_tokens.mjs +0 -0
  154. /package/{esm2020 → esm2022}/src/change_detection/change_detection.mjs +0 -0
  155. /package/{esm2020 → esm2022}/src/change_detection/constants.mjs +0 -0
  156. /package/{esm2020 → esm2022}/src/change_detection/differs/default_iterable_differ.mjs +0 -0
  157. /package/{esm2020 → esm2022}/src/change_detection/differs/default_keyvalue_differ.mjs +0 -0
  158. /package/{esm2020 → esm2022}/src/change_detection/pipe_transform.mjs +0 -0
  159. /package/{esm2020 → esm2022}/src/change_detection.mjs +0 -0
  160. /package/{esm2020 → esm2022}/src/compiler/compiler_facade.mjs +0 -0
  161. /package/{esm2020 → esm2022}/src/compiler/compiler_facade_interface.mjs +0 -0
  162. /package/{esm2020 → esm2022}/src/core_reactivity_export.mjs +0 -0
  163. /package/{esm2020 → esm2022}/src/core_render3_private_export.mjs +0 -0
  164. /package/{esm2020 → esm2022}/src/debug/debug_node.mjs +0 -0
  165. /package/{esm2020 → esm2022}/src/di/create_injector.mjs +0 -0
  166. /package/{esm2020 → esm2022}/src/di/forward_ref.mjs +0 -0
  167. /package/{esm2020 → esm2022}/src/di/initializer_token.mjs +0 -0
  168. /package/{esm2020 → esm2022}/src/di/inject_switch.mjs +0 -0
  169. /package/{esm2020 → esm2022}/src/di/injectable.mjs +0 -0
  170. /package/{esm2020 → esm2022}/src/di/injection_token.mjs +0 -0
  171. /package/{esm2020 → esm2022}/src/di/injector_marker.mjs +0 -0
  172. /package/{esm2020 → esm2022}/src/di/injector_token.mjs +0 -0
  173. /package/{esm2020 → esm2022}/src/di/interface/defs.mjs +0 -0
  174. /package/{esm2020 → esm2022}/src/di/interface/injector.mjs +0 -0
  175. /package/{esm2020 → esm2022}/src/di/interface/provider.mjs +0 -0
  176. /package/{esm2020 → esm2022}/src/di/internal_tokens.mjs +0 -0
  177. /package/{esm2020 → esm2022}/src/di/jit/environment.mjs +0 -0
  178. /package/{esm2020 → esm2022}/src/di/jit/injectable.mjs +0 -0
  179. /package/{esm2020 → esm2022}/src/di/jit/util.mjs +0 -0
  180. /package/{esm2020 → esm2022}/src/di/metadata.mjs +0 -0
  181. /package/{esm2020 → esm2022}/src/di/metadata_attr.mjs +0 -0
  182. /package/{esm2020 → esm2022}/src/di/null_injector.mjs +0 -0
  183. /package/{esm2020 → esm2022}/src/di/provider_token.mjs +0 -0
  184. /package/{esm2020 → esm2022}/src/di/r3_injector.mjs +0 -0
  185. /package/{esm2020 → esm2022}/src/di/reflective_errors.mjs +0 -0
  186. /package/{esm2020 → esm2022}/src/di/reflective_key.mjs +0 -0
  187. /package/{esm2020 → esm2022}/src/di/reflective_provider.mjs +0 -0
  188. /package/{esm2020 → esm2022}/src/di/scope.mjs +0 -0
  189. /package/{esm2020 → esm2022}/src/di.mjs +0 -0
  190. /package/{esm2020 → esm2022}/src/error_details_base_url.mjs +0 -0
  191. /package/{esm2020 → esm2022}/src/error_handler.mjs +0 -0
  192. /package/{esm2020 → esm2022}/src/event_emitter.mjs +0 -0
  193. /package/{esm2020 → esm2022}/src/hydration/compression.mjs +0 -0
  194. /package/{esm2020 → esm2022}/src/hydration/error_handling.mjs +0 -0
  195. /package/{esm2020 → esm2022}/src/hydration/interfaces.mjs +0 -0
  196. /package/{esm2020 → esm2022}/src/hydration/skip_hydration.mjs +0 -0
  197. /package/{esm2020 → esm2022}/src/hydration/tokens.mjs +0 -0
  198. /package/{esm2020 → esm2022}/src/hydration/views.mjs +0 -0
  199. /package/{esm2020 → esm2022}/src/i18n/locale_data_api.mjs +0 -0
  200. /package/{esm2020 → esm2022}/src/i18n/locale_en.mjs +0 -0
  201. /package/{esm2020 → esm2022}/src/i18n/localization.mjs +0 -0
  202. /package/{esm2020 → esm2022}/src/i18n/tokens.mjs +0 -0
  203. /package/{esm2020 → esm2022}/src/interface/lifecycle_hooks.mjs +0 -0
  204. /package/{esm2020 → esm2022}/src/interface/simple_change.mjs +0 -0
  205. /package/{esm2020 → esm2022}/src/interface/type.mjs +0 -0
  206. /package/{esm2020 → esm2022}/src/linker/ng_module_factory.mjs +0 -0
  207. /package/{esm2020 → esm2022}/src/linker/ng_module_factory_loader.mjs +0 -0
  208. /package/{esm2020 → esm2022}/src/linker/ng_module_factory_loader_impl.mjs +0 -0
  209. /package/{esm2020 → esm2022}/src/linker/ng_module_registration.mjs +0 -0
  210. /package/{esm2020 → esm2022}/src/linker.mjs +0 -0
  211. /package/{esm2020 → esm2022}/src/metadata/ng_module_def.mjs +0 -0
  212. /package/{esm2020 → esm2022}/src/metadata/resource_loading.mjs +0 -0
  213. /package/{esm2020 → esm2022}/src/metadata/schema.mjs +0 -0
  214. /package/{esm2020 → esm2022}/src/metadata/view.mjs +0 -0
  215. /package/{esm2020 → esm2022}/src/platform_core_providers.mjs +0 -0
  216. /package/{esm2020 → esm2022}/src/r3_symbols.mjs +0 -0
  217. /package/{esm2020 → esm2022}/src/reflection/platform_reflection_capabilities.mjs +0 -0
  218. /package/{esm2020 → esm2022}/src/reflection/reflection_capabilities.mjs +0 -0
  219. /package/{esm2020 → esm2022}/src/render/api_flags.mjs +0 -0
  220. /package/{esm2020 → esm2022}/src/render.mjs +0 -0
  221. /package/{esm2020 → esm2022}/src/render3/assert.mjs +0 -0
  222. /package/{esm2020 → esm2022}/src/render3/bindings.mjs +0 -0
  223. /package/{esm2020 → esm2022}/src/render3/collect_native_nodes.mjs +0 -0
  224. /package/{esm2020 → esm2022}/src/render3/component.mjs +0 -0
  225. /package/{esm2020 → esm2022}/src/render3/definition.mjs +0 -0
  226. /package/{esm2020 → esm2022}/src/render3/definition_factory.mjs +0 -0
  227. /package/{esm2020 → esm2022}/src/render3/di.mjs +0 -0
  228. /package/{esm2020 → esm2022}/src/render3/di_setup.mjs +0 -0
  229. /package/{esm2020 → esm2022}/src/render3/errors.mjs +0 -0
  230. /package/{esm2020 → esm2022}/src/render3/errors_di.mjs +0 -0
  231. /package/{esm2020 → esm2022}/src/render3/features/copy_definition_feature.mjs +0 -0
  232. /package/{esm2020 → esm2022}/src/render3/features/host_directives_feature.mjs +0 -0
  233. /package/{esm2020 → esm2022}/src/render3/features/inherit_definition_feature.mjs +0 -0
  234. /package/{esm2020 → esm2022}/src/render3/features/ng_onchanges_feature.mjs +0 -0
  235. /package/{esm2020 → esm2022}/src/render3/features/providers_feature.mjs +0 -0
  236. /package/{esm2020 → esm2022}/src/render3/fields.mjs +0 -0
  237. /package/{esm2020 → esm2022}/src/render3/global_utils_api.mjs +0 -0
  238. /package/{esm2020 → esm2022}/src/render3/hooks.mjs +0 -0
  239. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_apply.mjs +0 -0
  240. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_debug.mjs +0 -0
  241. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_insert_before_index.mjs +0 -0
  242. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_locale_id.mjs +0 -0
  243. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_parse.mjs +0 -0
  244. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_postprocess.mjs +0 -0
  245. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_tree_shaking.mjs +0 -0
  246. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_util.mjs +0 -0
  247. /package/{esm2020 → esm2022}/src/render3/index.mjs +0 -0
  248. /package/{esm2020 → esm2022}/src/render3/instructions/advance.mjs +0 -0
  249. /package/{esm2020 → esm2022}/src/render3/instructions/all.mjs +0 -0
  250. /package/{esm2020 → esm2022}/src/render3/instructions/attribute.mjs +0 -0
  251. /package/{esm2020 → esm2022}/src/render3/instructions/attribute_interpolation.mjs +0 -0
  252. /package/{esm2020 → esm2022}/src/render3/instructions/change_detection.mjs +0 -0
  253. /package/{esm2020 → esm2022}/src/render3/instructions/class_map_interpolation.mjs +0 -0
  254. /package/{esm2020 → esm2022}/src/render3/instructions/di.mjs +0 -0
  255. /package/{esm2020 → esm2022}/src/render3/instructions/di_attr.mjs +0 -0
  256. /package/{esm2020 → esm2022}/src/render3/instructions/element_validation.mjs +0 -0
  257. /package/{esm2020 → esm2022}/src/render3/instructions/get_current_view.mjs +0 -0
  258. /package/{esm2020 → esm2022}/src/render3/instructions/host_property.mjs +0 -0
  259. /package/{esm2020 → esm2022}/src/render3/instructions/i18n.mjs +0 -0
  260. /package/{esm2020 → esm2022}/src/render3/instructions/i18n_icu_container_visitor.mjs +0 -0
  261. /package/{esm2020 → esm2022}/src/render3/instructions/interpolation.mjs +0 -0
  262. /package/{esm2020 → esm2022}/src/render3/instructions/namespace.mjs +0 -0
  263. /package/{esm2020 → esm2022}/src/render3/instructions/next_context.mjs +0 -0
  264. /package/{esm2020 → esm2022}/src/render3/instructions/projection.mjs +0 -0
  265. /package/{esm2020 → esm2022}/src/render3/instructions/property.mjs +0 -0
  266. /package/{esm2020 → esm2022}/src/render3/instructions/property_interpolation.mjs +0 -0
  267. /package/{esm2020 → esm2022}/src/render3/instructions/storage.mjs +0 -0
  268. /package/{esm2020 → esm2022}/src/render3/instructions/style_map_interpolation.mjs +0 -0
  269. /package/{esm2020 → esm2022}/src/render3/instructions/style_prop_interpolation.mjs +0 -0
  270. /package/{esm2020 → esm2022}/src/render3/instructions/template.mjs +0 -0
  271. /package/{esm2020 → esm2022}/src/render3/instructions/text.mjs +0 -0
  272. /package/{esm2020 → esm2022}/src/render3/instructions/text_interpolation.mjs +0 -0
  273. /package/{esm2020 → esm2022}/src/render3/interfaces/container.mjs +0 -0
  274. /package/{esm2020 → esm2022}/src/render3/interfaces/context.mjs +0 -0
  275. /package/{esm2020 → esm2022}/src/render3/interfaces/definition.mjs +0 -0
  276. /package/{esm2020 → esm2022}/src/render3/interfaces/document.mjs +0 -0
  277. /package/{esm2020 → esm2022}/src/render3/interfaces/i18n.mjs +0 -0
  278. /package/{esm2020 → esm2022}/src/render3/interfaces/injector.mjs +0 -0
  279. /package/{esm2020 → esm2022}/src/render3/interfaces/lview_tracking.mjs +0 -0
  280. /package/{esm2020 → esm2022}/src/render3/interfaces/node.mjs +0 -0
  281. /package/{esm2020 → esm2022}/src/render3/interfaces/projection.mjs +0 -0
  282. /package/{esm2020 → esm2022}/src/render3/interfaces/public_definitions.mjs +0 -0
  283. /package/{esm2020 → esm2022}/src/render3/interfaces/query.mjs +0 -0
  284. /package/{esm2020 → esm2022}/src/render3/interfaces/renderer.mjs +0 -0
  285. /package/{esm2020 → esm2022}/src/render3/interfaces/renderer_dom.mjs +0 -0
  286. /package/{esm2020 → esm2022}/src/render3/interfaces/sanitization.mjs +0 -0
  287. /package/{esm2020 → esm2022}/src/render3/interfaces/styling.mjs +0 -0
  288. /package/{esm2020 → esm2022}/src/render3/interfaces/type_checks.mjs +0 -0
  289. /package/{esm2020 → esm2022}/src/render3/jit/directive.mjs +0 -0
  290. /package/{esm2020 → esm2022}/src/render3/jit/environment.mjs +0 -0
  291. /package/{esm2020 → esm2022}/src/render3/jit/jit_options.mjs +0 -0
  292. /package/{esm2020 → esm2022}/src/render3/jit/module_patch.mjs +0 -0
  293. /package/{esm2020 → esm2022}/src/render3/jit/partial.mjs +0 -0
  294. /package/{esm2020 → esm2022}/src/render3/jit/pipe.mjs +0 -0
  295. /package/{esm2020 → esm2022}/src/render3/jit/util.mjs +0 -0
  296. /package/{esm2020 → esm2022}/src/render3/metadata.mjs +0 -0
  297. /package/{esm2020 → esm2022}/src/render3/namespaces.mjs +0 -0
  298. /package/{esm2020 → esm2022}/src/render3/node_assert.mjs +0 -0
  299. /package/{esm2020 → esm2022}/src/render3/node_manipulation_i18n.mjs +0 -0
  300. /package/{esm2020 → esm2022}/src/render3/node_selector_matcher.mjs +0 -0
  301. /package/{esm2020 → esm2022}/src/render3/pipe.mjs +0 -0
  302. /package/{esm2020 → esm2022}/src/render3/profiler.mjs +0 -0
  303. /package/{esm2020 → esm2022}/src/render3/pure_function.mjs +0 -0
  304. /package/{esm2020 → esm2022}/src/render3/query.mjs +0 -0
  305. /package/{esm2020 → esm2022}/src/render3/state.mjs +0 -0
  306. /package/{esm2020 → esm2022}/src/render3/styling/class_differ.mjs +0 -0
  307. /package/{esm2020 → esm2022}/src/render3/styling/static_styling.mjs +0 -0
  308. /package/{esm2020 → esm2022}/src/render3/styling/style_binding_list.mjs +0 -0
  309. /package/{esm2020 → esm2022}/src/render3/styling/styling_parser.mjs +0 -0
  310. /package/{esm2020 → esm2022}/src/render3/tokens.mjs +0 -0
  311. /package/{esm2020 → esm2022}/src/render3/util/attrs_utils.mjs +0 -0
  312. /package/{esm2020 → esm2022}/src/render3/util/discovery_utils.mjs +0 -0
  313. /package/{esm2020 → esm2022}/src/render3/util/global_utils.mjs +0 -0
  314. /package/{esm2020 → esm2022}/src/render3/util/injector_utils.mjs +0 -0
  315. /package/{esm2020 → esm2022}/src/render3/util/misc_utils.mjs +0 -0
  316. /package/{esm2020 → esm2022}/src/render3/util/stringify_utils.mjs +0 -0
  317. /package/{esm2020 → esm2022}/src/render3/util/view_traversal_utils.mjs +0 -0
  318. /package/{esm2020 → esm2022}/src/render3/util/view_utils.mjs +0 -0
  319. /package/{esm2020 → esm2022}/src/render3/view_engine_compatibility_prebound.mjs +0 -0
  320. /package/{esm2020 → esm2022}/src/sanitization/bypass.mjs +0 -0
  321. /package/{esm2020 → esm2022}/src/sanitization/html_sanitizer.mjs +0 -0
  322. /package/{esm2020 → esm2022}/src/sanitization/iframe_attrs_validation.mjs +0 -0
  323. /package/{esm2020 → esm2022}/src/sanitization/inert_body.mjs +0 -0
  324. /package/{esm2020 → esm2022}/src/sanitization/security.mjs +0 -0
  325. /package/{esm2020 → esm2022}/src/sanitization/url_sanitizer.mjs +0 -0
  326. /package/{esm2020 → esm2022}/src/signals/src/untracked.mjs +0 -0
  327. /package/{esm2020 → esm2022}/src/util/array_utils.mjs +0 -0
  328. /package/{esm2020 → esm2022}/src/util/assert.mjs +0 -0
  329. /package/{esm2020 → esm2022}/src/util/char_code.mjs +0 -0
  330. /package/{esm2020 → esm2022}/src/util/closure.mjs +0 -0
  331. /package/{esm2020 → esm2022}/src/util/coercion.mjs +0 -0
  332. /package/{esm2020 → esm2022}/src/util/comparison.mjs +0 -0
  333. /package/{esm2020 → esm2022}/src/util/decorators.mjs +0 -0
  334. /package/{esm2020 → esm2022}/src/util/dom.mjs +0 -0
  335. /package/{esm2020 → esm2022}/src/util/empty.mjs +0 -0
  336. /package/{esm2020 → esm2022}/src/util/errors.mjs +0 -0
  337. /package/{esm2020 → esm2022}/src/util/global.mjs +0 -0
  338. /package/{esm2020 → esm2022}/src/util/is_dev_mode.mjs +0 -0
  339. /package/{esm2020 → esm2022}/src/util/iterable.mjs +0 -0
  340. /package/{esm2020 → esm2022}/src/util/lang.mjs +0 -0
  341. /package/{esm2020 → esm2022}/src/util/microtask.mjs +0 -0
  342. /package/{esm2020 → esm2022}/src/util/ng_i18n_closure_mode.mjs +0 -0
  343. /package/{esm2020 → esm2022}/src/util/ng_jit_mode.mjs +0 -0
  344. /package/{esm2020 → esm2022}/src/util/ng_reflect.mjs +0 -0
  345. /package/{esm2020 → esm2022}/src/util/noop.mjs +0 -0
  346. /package/{esm2020 → esm2022}/src/util/property.mjs +0 -0
  347. /package/{esm2020 → esm2022}/src/util/raf.mjs +0 -0
  348. /package/{esm2020 → esm2022}/src/util/security/trusted_type_defs.mjs +0 -0
  349. /package/{esm2020 → esm2022}/src/util/security/trusted_types.mjs +0 -0
  350. /package/{esm2020 → esm2022}/src/util/security/trusted_types_bypass.mjs +0 -0
  351. /package/{esm2020 → esm2022}/src/util/stringify.mjs +0 -0
  352. /package/{esm2020 → esm2022}/src/view/provider_flags.mjs +0 -0
  353. /package/{esm2020 → esm2022}/src/zone/async-stack-tagging.mjs +0 -0
  354. /package/{esm2020 → esm2022}/src/zone/ng_zone.mjs +0 -0
  355. /package/{esm2020 → esm2022}/src/zone.mjs +0 -0
  356. /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
  357. /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
  358. /package/{esm2020 → esm2022}/testing/src/async.mjs +0 -0
  359. /package/{esm2020 → esm2022}/testing/src/component_fixture.mjs +0 -0
  360. /package/{esm2020 → esm2022}/testing/src/fake_async.mjs +0 -0
  361. /package/{esm2020 → esm2022}/testing/src/metadata_override.mjs +0 -0
  362. /package/{esm2020 → esm2022}/testing/src/metadata_overrider.mjs +0 -0
  363. /package/{esm2020 → esm2022}/testing/src/resolvers.mjs +0 -0
  364. /package/{esm2020 → esm2022}/testing/src/styling.mjs +0 -0
  365. /package/{esm2020 → esm2022}/testing/src/test_bed_common.mjs +0 -0
  366. /package/{esm2020 → esm2022}/testing/src/test_hooks.mjs +0 -0
  367. /package/{esm2020 → esm2022}/testing/src/testing.mjs +0 -0
  368. /package/{esm2020 → esm2022}/testing/src/testing_internal.mjs +0 -0
  369. /package/{esm2020 → esm2022}/testing/testing.mjs +0 -0
@@ -1,13 +1,12 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.4
2
+ * @license Angular v16.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { getDebugNode, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, ɵprovideNgZoneChangeDetection, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, EnvironmentInjector as EnvironmentInjector$1, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
7
+ import { getDebugNode, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, provideZoneChangeDetection, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, EnvironmentInjector as EnvironmentInjector$1, NgZone, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
8
8
  import { ResourceLoader } from '@angular/compiler';
9
9
  import { Subject, Subscription } from 'rxjs';
10
- import { first } from 'rxjs/operators';
11
10
 
12
11
  /**
13
12
  * Wraps a test function in an asynchronous test zone. The test will automatically
@@ -838,7 +837,8 @@ const XSS_SECURITY_URL = 'https://g.co/ng/security#xss';
838
837
  *
839
838
  * Note: the `message` argument contains a descriptive error message as a string in development
840
839
  * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the
841
- * `message` argument becomes `false`, thus we account for it in the typings and the runtime logic.
840
+ * `message` argument becomes `false`, thus we account for it in the typings and the runtime
841
+ * logic.
842
842
  */
843
843
  class RuntimeError extends Error {
844
844
  constructor(code, message) {
@@ -1640,6 +1640,7 @@ function ngDevModeResetPerfCounters() {
1640
1640
  hydratedComponents: 0,
1641
1641
  dehydratedViewsRemoved: 0,
1642
1642
  dehydratedViewsCleanupRuns: 0,
1643
+ componentsSkippedHydration: 0,
1643
1644
  };
1644
1645
  // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.
1645
1646
  const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;
@@ -1842,6 +1843,9 @@ const SOURCE = '__source';
1842
1843
  * - Injector instance: Use the injector for resolution.
1843
1844
  */
1844
1845
  let _currentInjector = undefined;
1846
+ function getCurrentInjector() {
1847
+ return _currentInjector;
1848
+ }
1845
1849
  function setCurrentInjector(injector) {
1846
1850
  const former = _currentInjector;
1847
1851
  _currentInjector = injector;
@@ -1850,7 +1854,7 @@ function setCurrentInjector(injector) {
1850
1854
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
1851
1855
  if (_currentInjector === undefined) {
1852
1856
  throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
1853
- `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
1857
+ `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`runInInjectionContext\`.`);
1854
1858
  }
1855
1859
  else if (_currentInjector === null) {
1856
1860
  return injectRootLimpMode(token, undefined, flags);
@@ -3216,21 +3220,22 @@ const T_HOST = 6;
3216
3220
  const CLEANUP = 7;
3217
3221
  const CONTEXT = 8;
3218
3222
  const INJECTOR$1 = 9;
3219
- const RENDERER_FACTORY = 10;
3223
+ const ENVIRONMENT = 10;
3220
3224
  const RENDERER = 11;
3221
- const SANITIZER = 12;
3222
- const CHILD_HEAD = 13;
3223
- const CHILD_TAIL = 14;
3225
+ const CHILD_HEAD = 12;
3226
+ const CHILD_TAIL = 13;
3224
3227
  // FIXME(misko): Investigate if the three declarations aren't all same thing.
3225
- const DECLARATION_VIEW = 15;
3226
- const DECLARATION_COMPONENT_VIEW = 16;
3227
- const DECLARATION_LCONTAINER = 17;
3228
- const PREORDER_HOOK_FLAGS = 18;
3229
- const QUERIES = 19;
3230
- const ID = 20;
3231
- const EMBEDDED_VIEW_INJECTOR = 21;
3232
- const ON_DESTROY_HOOKS = 22;
3233
- const HYDRATION = 23;
3228
+ const DECLARATION_VIEW = 14;
3229
+ const DECLARATION_COMPONENT_VIEW = 15;
3230
+ const DECLARATION_LCONTAINER = 16;
3231
+ const PREORDER_HOOK_FLAGS = 17;
3232
+ const QUERIES = 18;
3233
+ const ID = 19;
3234
+ const EMBEDDED_VIEW_INJECTOR = 20;
3235
+ const ON_DESTROY_HOOKS = 21;
3236
+ const HYDRATION = 22;
3237
+ const REACTIVE_TEMPLATE_CONSUMER = 23;
3238
+ const REACTIVE_HOST_BINDING_CONSUMER = 24;
3234
3239
  /**
3235
3240
  * Size of LView's header. Necessary to adjust for it when setting slots.
3236
3241
  *
@@ -3238,7 +3243,7 @@ const HYDRATION = 23;
3238
3243
  * instruction index into `LView` index. All other indexes should be in the `LView` index space and
3239
3244
  * there should be no need to refer to `HEADER_OFFSET` anywhere else.
3240
3245
  */
3241
- const HEADER_OFFSET = 24;
3246
+ const HEADER_OFFSET = 25;
3242
3247
  // Note: This hack is necessary so we don't erroneously get a circular dependency
3243
3248
  // failure based on types.
3244
3249
  const unusedValueExportToPlacateAjd$4 = 1;
@@ -6739,6 +6744,8 @@ function detachView(lContainer, removeIndex) {
6739
6744
  function destroyLView(tView, lView) {
6740
6745
  if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
6741
6746
  const renderer = lView[RENDERER];
6747
+ lView[REACTIVE_TEMPLATE_CONSUMER]?.destroy();
6748
+ lView[REACTIVE_HOST_BINDING_CONSUMER]?.destroy();
6742
6749
  if (renderer.destroyNode) {
6743
6750
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
6744
6751
  }
@@ -7139,15 +7146,12 @@ function nativeRemoveNode(renderer, rNode, isHostElement) {
7139
7146
  }
7140
7147
  }
7141
7148
  /**
7142
- * Removes the contents of a given RElement using a given renderer.
7149
+ * Clears the contents of a given RElement.
7143
7150
  *
7144
- * @param renderer A renderer to be used
7145
7151
  * @param rElement the native RElement to be cleared
7146
7152
  */
7147
- function clearElementContents(renderer, rElement) {
7148
- while (rElement.firstChild) {
7149
- nativeRemoveChild(renderer, rElement, rElement.firstChild, false);
7150
- }
7153
+ function clearElementContents(rElement) {
7154
+ rElement.textContent = '';
7151
7155
  }
7152
7156
  /**
7153
7157
  * Performs the operation of `action` on the node. Typically this involves inserting or removing
@@ -8352,7 +8356,7 @@ function validateAgainstEventAttributes(name) {
8352
8356
  }
8353
8357
  function getSanitizer() {
8354
8358
  const lView = getLView();
8355
- return lView && lView[SANITIZER];
8359
+ return lView && lView[ENVIRONMENT].sanitizer;
8356
8360
  }
8357
8361
 
8358
8362
  /**
@@ -8540,7 +8544,7 @@ function internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {
8540
8544
  // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.
8541
8545
  const internalSource = source;
8542
8546
  if (walkProviderTree(internalSource, providersOut, [], dedup)) {
8543
- injectorTypesWithProviders || (injectorTypesWithProviders = []);
8547
+ injectorTypesWithProviders ||= [];
8544
8548
  injectorTypesWithProviders.push(internalSource);
8545
8549
  }
8546
8550
  });
@@ -8636,7 +8640,7 @@ function walkProviderTree(container, providersOut, parents, dedup) {
8636
8640
  try {
8637
8641
  deepForEach(injDef.imports, imported => {
8638
8642
  if (walkProviderTree(imported, providersOut, parents, dedup)) {
8639
- importTypesWithProviders || (importTypesWithProviders = []);
8643
+ importTypesWithProviders ||= [];
8640
8644
  // If the processed import is an injector type with providers, we store it in the
8641
8645
  // list of import types with providers, so that we can process those afterwards.
8642
8646
  importTypesWithProviders.push(imported);
@@ -9294,6 +9298,13 @@ class TransferState {
9294
9298
  this.store = {};
9295
9299
  this.onSerializeCallbacks = {};
9296
9300
  }
9301
+ /** @nocollapse */
9302
+ static { this.ɵprov =
9303
+ /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
9304
+ token: TransferState,
9305
+ providedIn: 'root',
9306
+ factory: initTransferState,
9307
+ }); }
9297
9308
  /**
9298
9309
  * Get the value corresponding to a key. Return `defaultValue` if key is not found.
9299
9310
  */
@@ -9348,13 +9359,6 @@ class TransferState {
9348
9359
  return JSON.stringify(this.store);
9349
9360
  }
9350
9361
  }
9351
- /** @nocollapse */
9352
- TransferState.ɵprov =
9353
- /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
9354
- token: TransferState,
9355
- providedIn: 'root',
9356
- factory: initTransferState,
9357
- });
9358
9362
  function retrieveTransferredState(doc, appId) {
9359
9363
  // Locate the script tag with the JSON data transferred from the server.
9360
9364
  // The id of the script tag is set to the Angular appId + 'state'.
@@ -9550,7 +9554,7 @@ function isRNodeClaimedForHydration(node) {
9550
9554
  return !!node.__claimed;
9551
9555
  }
9552
9556
  function setSegmentHead(hydrationInfo, index, node) {
9553
- hydrationInfo.segmentHeads ?? (hydrationInfo.segmentHeads = {});
9557
+ hydrationInfo.segmentHeads ??= {};
9554
9558
  hydrationInfo.segmentHeads[index] = node;
9555
9559
  }
9556
9560
  function getSegmentHead(hydrationInfo, index) {
@@ -9629,7 +9633,7 @@ class ComponentFactory$1 {
9629
9633
  }
9630
9634
 
9631
9635
  function noComponentFactoryError(component) {
9632
- const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
9636
+ const error = Error(`No component factory found for ${stringify(component)}.`);
9633
9637
  error[ERROR_COMPONENT] = component;
9634
9638
  return error;
9635
9639
  }
@@ -9658,8 +9662,8 @@ class _NullComponentFactoryResolver {
9658
9662
  * Component class can be used directly.
9659
9663
  */
9660
9664
  class ComponentFactoryResolver$1 {
9665
+ static { this.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver()); }
9661
9666
  }
9662
- ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
9663
9667
 
9664
9668
  /**
9665
9669
  * Creates an ElementRef from the most recent node.
@@ -9698,12 +9702,12 @@ class ElementRef {
9698
9702
  constructor(nativeElement) {
9699
9703
  this.nativeElement = nativeElement;
9700
9704
  }
9705
+ /**
9706
+ * @internal
9707
+ * @nocollapse
9708
+ */
9709
+ static { this.__NG_ELEMENT_ID__ = injectElementRef; }
9701
9710
  }
9702
- /**
9703
- * @internal
9704
- * @nocollapse
9705
- */
9706
- ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
9707
9711
  /**
9708
9712
  * Unwraps `ElementRef` and return the `nativeElement`.
9709
9713
  *
@@ -9737,12 +9741,12 @@ class RendererFactory2 {
9737
9741
  * @publicApi
9738
9742
  */
9739
9743
  class Renderer2 {
9744
+ /**
9745
+ * @internal
9746
+ * @nocollapse
9747
+ */
9748
+ static { this.__NG_ELEMENT_ID__ = () => injectRenderer2(); }
9740
9749
  }
9741
- /**
9742
- * @internal
9743
- * @nocollapse
9744
- */
9745
- Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
9746
9750
  /** Injects a Renderer2 for the current component. */
9747
9751
  function injectRenderer2() {
9748
9752
  // We need the Renderer to be based on the component that it's being injected into, however since
@@ -9759,13 +9763,13 @@ function injectRenderer2() {
9759
9763
  * @publicApi
9760
9764
  */
9761
9765
  class Sanitizer {
9766
+ /** @nocollapse */
9767
+ static { this.ɵprov = ɵɵdefineInjectable({
9768
+ token: Sanitizer,
9769
+ providedIn: 'root',
9770
+ factory: () => null,
9771
+ }); }
9762
9772
  }
9763
- /** @nocollapse */
9764
- Sanitizer.ɵprov = ɵɵdefineInjectable({
9765
- token: Sanitizer,
9766
- providedIn: 'root',
9767
- factory: () => null,
9768
- });
9769
9773
 
9770
9774
  /**
9771
9775
  * @description Represents the version of Angular
@@ -9783,7 +9787,7 @@ class Version {
9783
9787
  /**
9784
9788
  * @publicApi
9785
9789
  */
9786
- const VERSION = new Version('16.0.0-next.4');
9790
+ const VERSION = new Version('16.0.0-next.6');
9787
9791
 
9788
9792
  // This default value is when checking the hierarchy for a token.
9789
9793
  //
@@ -9864,11 +9868,11 @@ class ErrorHandler {
9864
9868
  }
9865
9869
  }
9866
9870
 
9867
- const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
9871
+ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
9868
9872
  /**
9869
9873
  * Internal token that specifies whether hydration is enabled.
9870
9874
  */
9871
- const IS_HYDRATION_FEATURE_ENABLED = new InjectionToken(NG_DEV_MODE ? 'IS_HYDRATION_FEATURE_ENABLED' : '');
9875
+ const IS_HYDRATION_FEATURE_ENABLED = new InjectionToken(NG_DEV_MODE$1 ? 'IS_HYDRATION_FEATURE_ENABLED' : '');
9872
9876
  // By default (in client rendering mode), we remove all the contents
9873
9877
  // of the host element and render an application after that.
9874
9878
  const PRESERVE_HOST_CONTENT_DEFAULT = false;
@@ -9876,7 +9880,7 @@ const PRESERVE_HOST_CONTENT_DEFAULT = false;
9876
9880
  * Internal token that indicates whether host element content should be
9877
9881
  * retained during the bootstrap.
9878
9882
  */
9879
- const PRESERVE_HOST_CONTENT = new InjectionToken(NG_DEV_MODE ? 'PRESERVE_HOST_CONTENT' : '', {
9883
+ const PRESERVE_HOST_CONTENT = new InjectionToken(NG_DEV_MODE$1 ? 'PRESERVE_HOST_CONTENT' : '', {
9880
9884
  providedIn: 'root',
9881
9885
  factory: () => PRESERVE_HOST_CONTENT_DEFAULT,
9882
9886
  });
@@ -9986,6 +9990,310 @@ function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValu
9986
9990
  return { propName: undefined, oldValue, newValue };
9987
9991
  }
9988
9992
 
9993
+ /**
9994
+ * A `WeakRef`-compatible reference that fakes the API with a strong reference
9995
+ * internally.
9996
+ */
9997
+ class LeakyRef {
9998
+ constructor(ref) {
9999
+ this.ref = ref;
10000
+ }
10001
+ deref() {
10002
+ return this.ref;
10003
+ }
10004
+ }
10005
+ // `WeakRef` is not always defined in every TS environment where Angular is compiled. Instead,
10006
+ // read it off of the global context if available.
10007
+ // tslint:disable-next-line: no-toplevel-property-access
10008
+ let WeakRefImpl = _global$1['WeakRef'] ?? LeakyRef;
10009
+ function newWeakRef(value) {
10010
+ if (typeof ngDevMode !== 'undefined' && ngDevMode && WeakRefImpl === undefined) {
10011
+ throw new Error(`Angular requires a browser which supports the 'WeakRef' API`);
10012
+ }
10013
+ return new WeakRefImpl(value);
10014
+ }
10015
+ function setAlternateWeakRefImpl(impl) {
10016
+ // no-op since the alternate impl is included by default by the framework. Remove once internal
10017
+ // migration is complete.
10018
+ }
10019
+
10020
+ /**
10021
+ * Counter tracking the next `ProducerId` or `ConsumerId`.
10022
+ */
10023
+ let _nextReactiveId = 0;
10024
+ /**
10025
+ * Tracks the currently active reactive consumer (or `null` if there is no active
10026
+ * consumer).
10027
+ */
10028
+ let activeConsumer = null;
10029
+ /**
10030
+ * Whether the graph is currently propagating change notifications.
10031
+ */
10032
+ let inNotificationPhase = false;
10033
+ function setActiveConsumer(consumer) {
10034
+ const prev = activeConsumer;
10035
+ activeConsumer = consumer;
10036
+ return prev;
10037
+ }
10038
+ /**
10039
+ * A node in the reactive graph.
10040
+ *
10041
+ * Nodes can be producers of reactive values, consumers of other reactive values, or both.
10042
+ *
10043
+ * Producers are nodes that produce values, and can be depended upon by consumer nodes.
10044
+ *
10045
+ * Producers expose a monotonic `valueVersion` counter, and are responsible for incrementing this
10046
+ * version when their value semantically changes. Some producers may produce their values lazily and
10047
+ * thus at times need to be polled for potential updates to their value (and by extension their
10048
+ * `valueVersion`). This is accomplished via the `onProducerUpdateValueVersion` method for
10049
+ * implemented by producers, which should perform whatever calculations are necessary to ensure
10050
+ * `valueVersion` is up to date.
10051
+ *
10052
+ * Consumers are nodes that depend on the values of producers and are notified when those values
10053
+ * might have changed.
10054
+ *
10055
+ * Consumers do not wrap the reads they consume themselves, but rather can be set as the active
10056
+ * reader via `setActiveConsumer`. Reads of producers that happen while a consumer is active will
10057
+ * result in those producers being added as dependencies of that consumer node.
10058
+ *
10059
+ * The set of dependencies of a consumer is dynamic. Implementers expose a monotonically increasing
10060
+ * `trackingVersion` counter, which increments whenever the consumer is about to re-run any reactive
10061
+ * reads it needs and establish a new set of dependencies as a result.
10062
+ *
10063
+ * Producers store the last `trackingVersion` they've seen from `Consumer`s which have read them.
10064
+ * This allows a producer to identify whether its record of the dependency is current or stale, by
10065
+ * comparing the consumer's `trackingVersion` to the version at which the dependency was
10066
+ * last observed.
10067
+ */
10068
+ class ReactiveNode {
10069
+ constructor() {
10070
+ this.id = _nextReactiveId++;
10071
+ /**
10072
+ * A cached weak reference to this node, which will be used in `ReactiveEdge`s.
10073
+ */
10074
+ this.ref = newWeakRef(this);
10075
+ /**
10076
+ * Edges to producers on which this node depends (in its consumer capacity).
10077
+ */
10078
+ this.producers = new Map();
10079
+ /**
10080
+ * Edges to consumers on which this node depends (in its producer capacity).
10081
+ */
10082
+ this.consumers = new Map();
10083
+ /**
10084
+ * Monotonically increasing counter representing a version of this `Consumer`'s
10085
+ * dependencies.
10086
+ */
10087
+ this.trackingVersion = 0;
10088
+ /**
10089
+ * Monotonically increasing counter which increases when the value of this `Producer`
10090
+ * semantically changes.
10091
+ */
10092
+ this.valueVersion = 0;
10093
+ }
10094
+ /**
10095
+ * Polls dependencies of a consumer to determine if they have actually changed.
10096
+ *
10097
+ * If this returns `false`, then even though the consumer may have previously been notified of a
10098
+ * change, the values of its dependencies have not actually changed and the consumer should not
10099
+ * rerun any reactions.
10100
+ */
10101
+ consumerPollProducersForChange() {
10102
+ for (const [producerId, edge] of this.producers) {
10103
+ const producer = edge.producerNode.deref();
10104
+ if (producer === undefined || edge.atTrackingVersion !== this.trackingVersion) {
10105
+ // This dependency edge is stale, so remove it.
10106
+ this.producers.delete(producerId);
10107
+ producer?.consumers.delete(this.id);
10108
+ continue;
10109
+ }
10110
+ if (producer.producerPollStatus(edge.seenValueVersion)) {
10111
+ // One of the dependencies reports a real value change.
10112
+ return true;
10113
+ }
10114
+ }
10115
+ // No dependency reported a real value change, so the `Consumer` has also not been
10116
+ // impacted.
10117
+ return false;
10118
+ }
10119
+ /**
10120
+ * Notify all consumers of this producer that its value may have changed.
10121
+ */
10122
+ producerMayHaveChanged() {
10123
+ // Prevent signal reads when we're updating the graph
10124
+ const prev = inNotificationPhase;
10125
+ inNotificationPhase = true;
10126
+ try {
10127
+ for (const [consumerId, edge] of this.consumers) {
10128
+ const consumer = edge.consumerNode.deref();
10129
+ if (consumer === undefined || consumer.trackingVersion !== edge.atTrackingVersion) {
10130
+ this.consumers.delete(consumerId);
10131
+ consumer?.producers.delete(this.id);
10132
+ continue;
10133
+ }
10134
+ consumer.onConsumerDependencyMayHaveChanged();
10135
+ }
10136
+ }
10137
+ finally {
10138
+ inNotificationPhase = prev;
10139
+ }
10140
+ }
10141
+ /**
10142
+ * Mark that this producer node has been accessed in the current reactive context.
10143
+ */
10144
+ producerAccessed() {
10145
+ if (inNotificationPhase) {
10146
+ throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode ?
10147
+ `Assertion error: signal read during notification phase` :
10148
+ '');
10149
+ }
10150
+ if (activeConsumer === null) {
10151
+ return;
10152
+ }
10153
+ // Either create or update the dependency `Edge` in both directions.
10154
+ let edge = activeConsumer.producers.get(this.id);
10155
+ if (edge === undefined) {
10156
+ edge = {
10157
+ consumerNode: activeConsumer.ref,
10158
+ producerNode: this.ref,
10159
+ seenValueVersion: this.valueVersion,
10160
+ atTrackingVersion: activeConsumer.trackingVersion,
10161
+ };
10162
+ activeConsumer.producers.set(this.id, edge);
10163
+ this.consumers.set(activeConsumer.id, edge);
10164
+ }
10165
+ else {
10166
+ edge.seenValueVersion = this.valueVersion;
10167
+ edge.atTrackingVersion = activeConsumer.trackingVersion;
10168
+ }
10169
+ }
10170
+ /**
10171
+ * Whether this consumer currently has any producers registered.
10172
+ */
10173
+ get hasProducers() {
10174
+ return this.producers.size > 0;
10175
+ }
10176
+ /**
10177
+ * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,
10178
+ * based on the current consumer context.
10179
+ */
10180
+ get producerUpdatesAllowed() {
10181
+ return activeConsumer?.consumerAllowSignalWrites !== false;
10182
+ }
10183
+ /**
10184
+ * Checks if a `Producer` has a current value which is different than the value
10185
+ * last seen at a specific version by a `Consumer` which recorded a dependency on
10186
+ * this `Producer`.
10187
+ */
10188
+ producerPollStatus(lastSeenValueVersion) {
10189
+ // `producer.valueVersion` may be stale, but a mismatch still means that the value
10190
+ // last seen by the `Consumer` is also stale.
10191
+ if (this.valueVersion !== lastSeenValueVersion) {
10192
+ return true;
10193
+ }
10194
+ // Trigger the `Producer` to update its `valueVersion` if necessary.
10195
+ this.onProducerUpdateValueVersion();
10196
+ // At this point, we can trust `producer.valueVersion`.
10197
+ return this.valueVersion !== lastSeenValueVersion;
10198
+ }
10199
+ }
10200
+
10201
+ /**
10202
+ * Marks current view and all ancestors dirty.
10203
+ *
10204
+ * Returns the root view because it is found as a byproduct of marking the view tree
10205
+ * dirty, and can be used by methods that consume markViewDirty() to easily schedule
10206
+ * change detection. Otherwise, such methods would need to traverse up the view tree
10207
+ * an additional time to get the root view and schedule a tick on it.
10208
+ *
10209
+ * @param lView The starting LView to mark dirty
10210
+ * @returns the root LView
10211
+ */
10212
+ function markViewDirty(lView) {
10213
+ while (lView) {
10214
+ lView[FLAGS] |= 32 /* LViewFlags.Dirty */;
10215
+ const parent = getLViewParent(lView);
10216
+ // Stop traversing up as soon as you find a root view that wasn't attached to any container
10217
+ if (isRootView(lView) && !parent) {
10218
+ return lView;
10219
+ }
10220
+ // continue otherwise
10221
+ lView = parent;
10222
+ }
10223
+ return null;
10224
+ }
10225
+
10226
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
10227
+ class ReactiveLViewConsumer extends ReactiveNode {
10228
+ constructor() {
10229
+ super(...arguments);
10230
+ this.consumerAllowSignalWrites = false;
10231
+ this._lView = null;
10232
+ }
10233
+ set lView(lView) {
10234
+ NG_DEV_MODE && assertEqual(this._lView, null, 'Consumer already associated with a view.');
10235
+ this._lView = lView;
10236
+ }
10237
+ onConsumerDependencyMayHaveChanged() {
10238
+ NG_DEV_MODE &&
10239
+ assertDefined(this._lView, 'Updating a signal during template or host binding execution is not allowed.');
10240
+ markViewDirty(this._lView);
10241
+ }
10242
+ onProducerUpdateValueVersion() {
10243
+ // This type doesn't implement the producer side of a `ReactiveNode`.
10244
+ }
10245
+ get hasReadASignal() {
10246
+ return this.hasProducers;
10247
+ }
10248
+ runInContext(fn, rf, ctx) {
10249
+ const prevConsumer = setActiveConsumer(this);
10250
+ this.trackingVersion++;
10251
+ try {
10252
+ fn(rf, ctx);
10253
+ }
10254
+ finally {
10255
+ setActiveConsumer(prevConsumer);
10256
+ }
10257
+ }
10258
+ destroy() {
10259
+ // Incrementing the version means that every producer which tries to update this consumer will
10260
+ // consider its record stale, and not notify.
10261
+ this.trackingVersion++;
10262
+ }
10263
+ }
10264
+ let currentConsumer = null;
10265
+ function getOrCreateCurrentLViewConsumer() {
10266
+ currentConsumer ??= new ReactiveLViewConsumer();
10267
+ return currentConsumer;
10268
+ }
10269
+ /**
10270
+ * Create a new template consumer pointing at the specified LView.
10271
+ * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that
10272
+ * case, the LView will be updated.
10273
+ */
10274
+ function getReactiveLViewConsumer(lView, slot) {
10275
+ return lView[slot] ?? getOrCreateCurrentLViewConsumer();
10276
+ }
10277
+ /**
10278
+ * Assigns the `currentTemplateContext` to its LView's `REACTIVE_CONSUMER` slot if there are tracked
10279
+ * producers.
10280
+ *
10281
+ * The presence of producers means that a signal was read while the consumer was the active
10282
+ * consumer.
10283
+ *
10284
+ * If no producers are present, we do not assign the current template context. This also means we
10285
+ * can just reuse the template context for the next LView.
10286
+ */
10287
+ function commitLViewConsumerIfHasProducers(lView, slot) {
10288
+ const consumer = getOrCreateCurrentLViewConsumer();
10289
+ if (!consumer.hasReadASignal) {
10290
+ return;
10291
+ }
10292
+ lView[slot] = currentConsumer;
10293
+ consumer.lView = lView;
10294
+ currentConsumer = new ReactiveLViewConsumer();
10295
+ }
10296
+
9989
10297
  /** A special value which designates that a value has not changed. */
9990
10298
  const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {};
9991
10299
 
@@ -10068,6 +10376,22 @@ function runInInjectionContext(injector, fn) {
10068
10376
  setInjectImplementation(previousInjectImplementation);
10069
10377
  }
10070
10378
  }
10379
+ /**
10380
+ * Asserts that the current stack frame is within an injection context and has access to `inject`.
10381
+ *
10382
+ * @param debugFn a reference to the function making the assertion (used for the error message).
10383
+ *
10384
+ * @publicApi
10385
+ */
10386
+ function assertInInjectionContext(debugFn) {
10387
+ // Taking a `Function` instead of a string name here prevents the unminified name of the function
10388
+ // from being retained in the bundle regardless of minification.
10389
+ if (!getInjectImplementation() && !getCurrentInjector()) {
10390
+ throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
10391
+ (debugFn.name +
10392
+ '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`'));
10393
+ }
10394
+ }
10071
10395
 
10072
10396
  /**
10073
10397
  * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.
@@ -10220,6 +10544,8 @@ function createInjectorWithoutInjectorInstances(defType, parent = null, addition
10220
10544
  * @publicApi
10221
10545
  */
10222
10546
  class Injector {
10547
+ static { this.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND; }
10548
+ static { this.NULL = ( /* @__PURE__ */new NullInjector()); }
10223
10549
  static create(options, parent) {
10224
10550
  if (Array.isArray(options)) {
10225
10551
  return createInjector({ name: '' }, parent, options, '');
@@ -10229,20 +10555,18 @@ class Injector {
10229
10555
  return createInjector({ name }, options.parent, options.providers, name);
10230
10556
  }
10231
10557
  }
10558
+ /** @nocollapse */
10559
+ static { this.ɵprov = ɵɵdefineInjectable({
10560
+ token: Injector,
10561
+ providedIn: 'any',
10562
+ factory: () => ɵɵinject(INJECTOR),
10563
+ }); }
10564
+ /**
10565
+ * @internal
10566
+ * @nocollapse
10567
+ */
10568
+ static { this.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */; }
10232
10569
  }
10233
- Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;
10234
- Injector.NULL = ( /* @__PURE__ */new NullInjector());
10235
- /** @nocollapse */
10236
- Injector.ɵprov = ɵɵdefineInjectable({
10237
- token: Injector,
10238
- providedIn: 'any',
10239
- factory: () => ɵɵinject(INJECTOR),
10240
- });
10241
- /**
10242
- * @internal
10243
- * @nocollapse
10244
- */
10245
- Injector.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */;
10246
10570
 
10247
10571
  function findFirstClosedCycle(keys) {
10248
10572
  const res = [];
@@ -10843,6 +11167,7 @@ class ReflectiveInjector {
10843
11167
  }
10844
11168
  }
10845
11169
  class ReflectiveInjector_ {
11170
+ static { this.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector)); }
10846
11171
  /**
10847
11172
  * Private
10848
11173
  */
@@ -10998,7 +11323,6 @@ class ReflectiveInjector_ {
10998
11323
  return this.displayName;
10999
11324
  }
11000
11325
  }
11001
- ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
11002
11326
  function _mapProviders(injector, fn) {
11003
11327
  const res = [];
11004
11328
  for (let i = 0; i < injector._providers.length; ++i) {
@@ -11072,6 +11396,7 @@ function processHostBindingOpCodes(tView, lView) {
11072
11396
  const hostBindingOpCodes = tView.hostBindingOpCodes;
11073
11397
  if (hostBindingOpCodes === null)
11074
11398
  return;
11399
+ const consumer = getReactiveLViewConsumer(lView, REACTIVE_HOST_BINDING_CONSUMER);
11075
11400
  try {
11076
11401
  for (let i = 0; i < hostBindingOpCodes.length; i++) {
11077
11402
  const opCode = hostBindingOpCodes[i];
@@ -11086,11 +11411,13 @@ function processHostBindingOpCodes(tView, lView) {
11086
11411
  const hostBindingFn = hostBindingOpCodes[++i];
11087
11412
  setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
11088
11413
  const context = lView[directiveIdx];
11089
- hostBindingFn(2 /* RenderFlags.Update */, context);
11414
+ consumer.runInContext(hostBindingFn, 2 /* RenderFlags.Update */, context);
11090
11415
  }
11091
11416
  }
11092
11417
  }
11093
11418
  finally {
11419
+ lView[REACTIVE_HOST_BINDING_CONSUMER] === null &&
11420
+ commitLViewConsumerIfHasProducers(lView, REACTIVE_HOST_BINDING_CONSUMER);
11094
11421
  setSelectedIndex(-1);
11095
11422
  }
11096
11423
  }
@@ -11124,7 +11451,7 @@ function renderChildComponents(hostLView, components) {
11124
11451
  renderComponent(hostLView, components[i]);
11125
11452
  }
11126
11453
  }
11127
- function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector, hydrationInfo) {
11454
+ function createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {
11128
11455
  const lView = tView.blueprint.slice();
11129
11456
  lView[HOST] = host;
11130
11457
  lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
@@ -11136,16 +11463,16 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
11136
11463
  ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
11137
11464
  lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;
11138
11465
  lView[CONTEXT] = context;
11139
- lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]);
11140
- ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');
11466
+ lView[ENVIRONMENT] = (environment || parentLView && parentLView[ENVIRONMENT]);
11467
+ ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');
11141
11468
  lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]);
11142
11469
  ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');
11143
- lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null;
11144
11470
  lView[INJECTOR$1] = injector || parentLView && parentLView[INJECTOR$1] || null;
11145
11471
  lView[T_HOST] = tHostNode;
11146
11472
  lView[ID] = getUniqueLViewId();
11147
11473
  lView[HYDRATION] = hydrationInfo;
11148
11474
  lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
11475
+ lView[REACTIVE_TEMPLATE_CONSUMER] = null;
11149
11476
  ngDevMode &&
11150
11477
  assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
11151
11478
  lView[DECLARATION_COMPONENT_VIEW] =
@@ -11318,10 +11645,11 @@ function refreshView(tView, lView, templateFn, context) {
11318
11645
  const flags = lView[FLAGS];
11319
11646
  if ((flags & 128 /* LViewFlags.Destroyed */) === 128 /* LViewFlags.Destroyed */)
11320
11647
  return;
11321
- enterView(lView);
11322
11648
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
11323
11649
  // since they were assigned. We do not want to execute lifecycle hooks in that mode.
11324
11650
  const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
11651
+ !isInCheckNoChangesPass && lView[ENVIRONMENT].effectManager?.flush();
11652
+ enterView(lView);
11325
11653
  try {
11326
11654
  resetPreOrderHookFlags(lView);
11327
11655
  setBindingIndex(tView.bindingStartIndex);
@@ -11430,6 +11758,7 @@ function refreshView(tView, lView, templateFn, context) {
11430
11758
  }
11431
11759
  }
11432
11760
  function executeTemplate(tView, lView, templateFn, rf, context) {
11761
+ const consumer = getReactiveLViewConsumer(lView, REACTIVE_TEMPLATE_CONSUMER);
11433
11762
  const prevSelectedIndex = getSelectedIndex();
11434
11763
  const isUpdatePhase = rf & 2 /* RenderFlags.Update */;
11435
11764
  try {
@@ -11441,9 +11770,12 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
11441
11770
  }
11442
11771
  const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;
11443
11772
  profiler(preHookType, context);
11444
- templateFn(rf, context);
11773
+ consumer.runInContext(templateFn, rf, context);
11445
11774
  }
11446
11775
  finally {
11776
+ if (lView[REACTIVE_TEMPLATE_CONSUMER] === null) {
11777
+ commitLViewConsumerIfHasProducers(lView, REACTIVE_TEMPLATE_CONSUMER);
11778
+ }
11447
11779
  setSelectedIndex(prevSelectedIndex);
11448
11780
  const postHookType = isUpdatePhase ? 3 /* ProfilerEvent.TemplateUpdateEnd */ : 1 /* ProfilerEvent.TemplateCreateEnd */;
11449
11781
  profiler(postHookType, context);
@@ -12233,8 +12565,8 @@ function addComponentLogic(lView, hostTNode, def) {
12233
12565
  const tView = getOrCreateComponentTView(def);
12234
12566
  // Only component views should be added to the view tree directly. Embedded views are
12235
12567
  // accessed through their containers because they may be removed / re-added later.
12236
- const rendererFactory = lView[RENDERER_FACTORY];
12237
- const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null, null));
12568
+ const rendererFactory = lView[ENVIRONMENT].rendererFactory;
12569
+ const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));
12238
12570
  // Component view will always be created before any injected LContainers,
12239
12571
  // so this is a regular element, wrap it with the component view
12240
12572
  lView[hostTNode.index] = componentView;
@@ -12547,32 +12879,8 @@ function addToViewTree(lView, lViewOrLContainer) {
12547
12879
  ///////////////////////////////
12548
12880
  //// Change detection
12549
12881
  ///////////////////////////////
12550
- /**
12551
- * Marks current view and all ancestors dirty.
12552
- *
12553
- * Returns the root view because it is found as a byproduct of marking the view tree
12554
- * dirty, and can be used by methods that consume markViewDirty() to easily schedule
12555
- * change detection. Otherwise, such methods would need to traverse up the view tree
12556
- * an additional time to get the root view and schedule a tick on it.
12557
- *
12558
- * @param lView The starting LView to mark dirty
12559
- * @returns the root LView
12560
- */
12561
- function markViewDirty(lView) {
12562
- while (lView) {
12563
- lView[FLAGS] |= 32 /* LViewFlags.Dirty */;
12564
- const parent = getLViewParent(lView);
12565
- // Stop traversing up as soon as you find a root view that wasn't attached to any container
12566
- if (isRootView(lView) && !parent) {
12567
- return lView;
12568
- }
12569
- // continue otherwise
12570
- lView = parent;
12571
- }
12572
- return null;
12573
- }
12574
12882
  function detectChangesInternal(tView, lView, context, notifyErrorHandler = true) {
12575
- const rendererFactory = lView[RENDERER_FACTORY];
12883
+ const rendererFactory = lView[ENVIRONMENT].rendererFactory;
12576
12884
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
12577
12885
  // since they were assigned. We do not want to invoke renderer factory functions in that mode
12578
12886
  // to avoid any possible side-effects.
@@ -12591,6 +12899,9 @@ function detectChangesInternal(tView, lView, context, notifyErrorHandler = true)
12591
12899
  finally {
12592
12900
  if (!checkNoChangesMode && rendererFactory.end)
12593
12901
  rendererFactory.end();
12902
+ // One final flush of the effects queue to catch any effects created in `ngAfterViewInit` or
12903
+ // other post-order hooks.
12904
+ !checkNoChangesMode && lView[ENVIRONMENT].effectManager?.flush();
12594
12905
  }
12595
12906
  }
12596
12907
  function checkNoChangesInternal(tView, lView, context, notifyErrorHandler = true) {
@@ -12713,6 +13024,433 @@ function textBindingInternal(lView, index, value) {
12713
13024
  updateTextNode(lView[RENDERER], element, value);
12714
13025
  }
12715
13026
 
13027
+ /**
13028
+ * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
13029
+ * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
13030
+ * is injected in a component or directive, the callbacks run when that component or
13031
+ * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.
13032
+ *
13033
+ * @publicApi
13034
+ */
13035
+ class DestroyRef {
13036
+ /**
13037
+ * @internal
13038
+ * @nocollapse
13039
+ */
13040
+ static { this.__NG_ELEMENT_ID__ = injectDestroyRef; }
13041
+ /**
13042
+ * @internal
13043
+ * @nocollapse
13044
+ */
13045
+ static { this.__NG_ENV_ID__ = (injector) => injector; }
13046
+ }
13047
+ class NodeInjectorDestroyRef extends DestroyRef {
13048
+ constructor(_lView) {
13049
+ super();
13050
+ this._lView = _lView;
13051
+ }
13052
+ onDestroy(callback) {
13053
+ storeLViewOnDestroy(this._lView, callback);
13054
+ return () => removeLViewOnDestroy(this._lView, callback);
13055
+ }
13056
+ }
13057
+ function injectDestroyRef() {
13058
+ return new NodeInjectorDestroyRef(getLView());
13059
+ }
13060
+
13061
+ /**
13062
+ * Symbol used to tell `Signal`s apart from other functions.
13063
+ *
13064
+ * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
13065
+ */
13066
+ const SIGNAL = Symbol('SIGNAL');
13067
+ /**
13068
+ * Checks if the given `value` function is a reactive `Signal`.
13069
+ */
13070
+ function isSignal(value) {
13071
+ return value[SIGNAL] !== undefined;
13072
+ }
13073
+ /**
13074
+ * Converts `fn` into a marked signal function (where `isSignal(fn)` will be `true`), and
13075
+ * potentially add some set of extra properties (passed as an object record `extraApi`).
13076
+ */
13077
+ function createSignalFromFunction(node, fn, extraApi = {}) {
13078
+ fn[SIGNAL] = node;
13079
+ // Copy properties from `extraApi` to `fn` to complete the desired API of the `Signal`.
13080
+ return Object.assign(fn, extraApi);
13081
+ }
13082
+ /**
13083
+ * The default equality function used for `signal` and `computed`, which treats objects and arrays
13084
+ * as never equal, and all other primitive values using identity semantics.
13085
+ *
13086
+ * This allows signals to hold non-primitive values (arrays, objects, other collections) and still
13087
+ * propagate change notification upon explicit mutation without identity change.
13088
+ *
13089
+ * @developerPreview
13090
+ */
13091
+ function defaultEquals(a, b) {
13092
+ // `Object.is` compares two values using identity semantics which is desired behavior for
13093
+ // primitive values. If `Object.is` determines two values to be equal we need to make sure that
13094
+ // those don't represent objects (we want to make sure that 2 objects are always considered
13095
+ // "unequal"). The null check is needed for the special case of JavaScript reporting null values
13096
+ // as objects (`typeof null === 'object'`).
13097
+ return (a === null || typeof a !== 'object') && Object.is(a, b);
13098
+ }
13099
+
13100
+ /**
13101
+ * Create a computed `Signal` which derives a reactive value from an expression.
13102
+ *
13103
+ * @developerPreview
13104
+ */
13105
+ function computed(computation, options) {
13106
+ const node = new ComputedImpl(computation, options?.equal ?? defaultEquals);
13107
+ // Casting here is required for g3, as TS inference behavior is slightly different between our
13108
+ // version/options and g3's.
13109
+ return createSignalFromFunction(node, node.signal.bind(node));
13110
+ }
13111
+ /**
13112
+ * A dedicated symbol used before a computed value has been calculated for the first time.
13113
+ * Explicitly typed as `any` so we can use it as signal's value.
13114
+ */
13115
+ const UNSET = Symbol('UNSET');
13116
+ /**
13117
+ * A dedicated symbol used in place of a computed signal value to indicate that a given computation
13118
+ * is in progress. Used to detect cycles in computation chains.
13119
+ * Explicitly typed as `any` so we can use it as signal's value.
13120
+ */
13121
+ const COMPUTING = Symbol('COMPUTING');
13122
+ /**
13123
+ * A dedicated symbol used in place of a computed signal value to indicate that a given computation
13124
+ * failed. The thrown error is cached until the computation gets dirty again.
13125
+ * Explicitly typed as `any` so we can use it as signal's value.
13126
+ */
13127
+ const ERRORED = Symbol('ERRORED');
13128
+ /**
13129
+ * A computation, which derives a value from a declarative reactive expression.
13130
+ *
13131
+ * `Computed`s are both producers and consumers of reactivity.
13132
+ */
13133
+ class ComputedImpl extends ReactiveNode {
13134
+ constructor(computation, equal) {
13135
+ super();
13136
+ this.computation = computation;
13137
+ this.equal = equal;
13138
+ /**
13139
+ * Current value of the computation.
13140
+ *
13141
+ * This can also be one of the special values `UNSET`, `COMPUTING`, or `ERRORED`.
13142
+ */
13143
+ this.value = UNSET;
13144
+ /**
13145
+ * If `value` is `ERRORED`, the error caught from the last computation attempt which will
13146
+ * be re-thrown.
13147
+ */
13148
+ this.error = null;
13149
+ /**
13150
+ * Flag indicating that the computation is currently stale, meaning that one of the
13151
+ * dependencies has notified of a potential change.
13152
+ *
13153
+ * It's possible that no dependency has _actually_ changed, in which case the `stale`
13154
+ * state can be resolved without recomputing the value.
13155
+ */
13156
+ this.stale = true;
13157
+ this.consumerAllowSignalWrites = false;
13158
+ }
13159
+ onConsumerDependencyMayHaveChanged() {
13160
+ if (this.stale) {
13161
+ // We've already notified consumers that this value has potentially changed.
13162
+ return;
13163
+ }
13164
+ // Record that the currently cached value may be stale.
13165
+ this.stale = true;
13166
+ // Notify any consumers about the potential change.
13167
+ this.producerMayHaveChanged();
13168
+ }
13169
+ onProducerUpdateValueVersion() {
13170
+ if (!this.stale) {
13171
+ // The current value and its version are already up to date.
13172
+ return;
13173
+ }
13174
+ // The current value is stale. Check whether we need to produce a new one.
13175
+ if (this.value !== UNSET && this.value !== COMPUTING &&
13176
+ !this.consumerPollProducersForChange()) {
13177
+ // Even though we were previously notified of a potential dependency update, all of
13178
+ // our dependencies report that they have not actually changed in value, so we can
13179
+ // resolve the stale state without needing to recompute the current value.
13180
+ this.stale = false;
13181
+ return;
13182
+ }
13183
+ // The current value is stale, and needs to be recomputed. It still may not change -
13184
+ // that depends on whether the newly computed value is equal to the old.
13185
+ this.recomputeValue();
13186
+ }
13187
+ recomputeValue() {
13188
+ if (this.value === COMPUTING) {
13189
+ // Our computation somehow led to a cyclic read of itself.
13190
+ throw new Error('Detected cycle in computations.');
13191
+ }
13192
+ const oldValue = this.value;
13193
+ this.value = COMPUTING;
13194
+ // As we're re-running the computation, update our dependent tracking version number.
13195
+ this.trackingVersion++;
13196
+ const prevConsumer = setActiveConsumer(this);
13197
+ let newValue;
13198
+ try {
13199
+ newValue = this.computation();
13200
+ }
13201
+ catch (err) {
13202
+ newValue = ERRORED;
13203
+ this.error = err;
13204
+ }
13205
+ finally {
13206
+ setActiveConsumer(prevConsumer);
13207
+ }
13208
+ this.stale = false;
13209
+ if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED &&
13210
+ this.equal(oldValue, newValue)) {
13211
+ // No change to `valueVersion` - old and new values are
13212
+ // semantically equivalent.
13213
+ this.value = oldValue;
13214
+ return;
13215
+ }
13216
+ this.value = newValue;
13217
+ this.valueVersion++;
13218
+ }
13219
+ signal() {
13220
+ // Check if the value needs updating before returning it.
13221
+ this.onProducerUpdateValueVersion();
13222
+ // Record that someone looked at this signal.
13223
+ this.producerAccessed();
13224
+ if (this.value === ERRORED) {
13225
+ throw this.error;
13226
+ }
13227
+ return this.value;
13228
+ }
13229
+ }
13230
+
13231
+ function defaultThrowError() {
13232
+ throw new Error();
13233
+ }
13234
+ let throwInvalidWriteToSignalErrorFn = defaultThrowError;
13235
+ function throwInvalidWriteToSignalError() {
13236
+ throwInvalidWriteToSignalErrorFn();
13237
+ }
13238
+ function setThrowInvalidWriteToSignalError(fn) {
13239
+ throwInvalidWriteToSignalErrorFn = fn;
13240
+ }
13241
+
13242
+ class WritableSignalImpl extends ReactiveNode {
13243
+ constructor(value, equal) {
13244
+ super();
13245
+ this.value = value;
13246
+ this.equal = equal;
13247
+ this.consumerAllowSignalWrites = false;
13248
+ }
13249
+ onConsumerDependencyMayHaveChanged() {
13250
+ // This never happens for writable signals as they're not consumers.
13251
+ }
13252
+ onProducerUpdateValueVersion() {
13253
+ // Writable signal value versions are always up to date.
13254
+ }
13255
+ /**
13256
+ * Directly update the value of the signal to a new value, which may or may not be
13257
+ * equal to the previous.
13258
+ *
13259
+ * In the event that `newValue` is semantically equal to the current value, `set` is
13260
+ * a no-op.
13261
+ */
13262
+ set(newValue) {
13263
+ if (!this.producerUpdatesAllowed) {
13264
+ throwInvalidWriteToSignalError();
13265
+ }
13266
+ if (!this.equal(this.value, newValue)) {
13267
+ this.value = newValue;
13268
+ this.valueVersion++;
13269
+ this.producerMayHaveChanged();
13270
+ }
13271
+ }
13272
+ /**
13273
+ * Derive a new value for the signal from its current value using the `updater` function.
13274
+ *
13275
+ * This is equivalent to calling `set` on the result of running `updater` on the current
13276
+ * value.
13277
+ */
13278
+ update(updater) {
13279
+ if (!this.producerUpdatesAllowed) {
13280
+ throwInvalidWriteToSignalError();
13281
+ }
13282
+ this.set(updater(this.value));
13283
+ }
13284
+ /**
13285
+ * Calls `mutator` on the current value and assumes that it has been mutated.
13286
+ */
13287
+ mutate(mutator) {
13288
+ if (!this.producerUpdatesAllowed) {
13289
+ throwInvalidWriteToSignalError();
13290
+ }
13291
+ // Mutate bypasses equality checks as it's by definition changing the value.
13292
+ mutator(this.value);
13293
+ this.valueVersion++;
13294
+ this.producerMayHaveChanged();
13295
+ }
13296
+ signal() {
13297
+ this.producerAccessed();
13298
+ return this.value;
13299
+ }
13300
+ }
13301
+ /**
13302
+ * Create a `Signal` that can be set or updated directly.
13303
+ *
13304
+ * @developerPreview
13305
+ */
13306
+ function signal(initialValue, options) {
13307
+ const signalNode = new WritableSignalImpl(initialValue, options?.equal ?? defaultEquals);
13308
+ // Casting here is required for g3, as TS inference behavior is slightly different between our
13309
+ // version/options and g3's.
13310
+ const signalFn = createSignalFromFunction(signalNode, signalNode.signal.bind(signalNode), {
13311
+ set: signalNode.set.bind(signalNode),
13312
+ update: signalNode.update.bind(signalNode),
13313
+ mutate: signalNode.mutate.bind(signalNode),
13314
+ });
13315
+ return signalFn;
13316
+ }
13317
+
13318
+ /**
13319
+ * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
13320
+ * can, optionally, return a value.
13321
+ *
13322
+ * @developerPreview
13323
+ */
13324
+ function untracked(nonReactiveReadsFn) {
13325
+ const prevConsumer = setActiveConsumer(null);
13326
+ // We are not trying to catch any particular errors here, just making sure that the consumers
13327
+ // stack is restored in case of errors.
13328
+ try {
13329
+ return nonReactiveReadsFn();
13330
+ }
13331
+ finally {
13332
+ setActiveConsumer(prevConsumer);
13333
+ }
13334
+ }
13335
+
13336
+ const NOOP_CLEANUP_FN = () => { };
13337
+ /**
13338
+ * Watches a reactive expression and allows it to be scheduled to re-run
13339
+ * when any dependencies notify of a change.
13340
+ *
13341
+ * `Watch` doesn't run reactive expressions itself, but relies on a consumer-
13342
+ * provided scheduling operation to coordinate calling `Watch.run()`.
13343
+ */
13344
+ class Watch extends ReactiveNode {
13345
+ constructor(watch, schedule, allowSignalWrites) {
13346
+ super();
13347
+ this.watch = watch;
13348
+ this.schedule = schedule;
13349
+ this.dirty = false;
13350
+ this.cleanupFn = NOOP_CLEANUP_FN;
13351
+ this.consumerAllowSignalWrites = allowSignalWrites;
13352
+ }
13353
+ notify() {
13354
+ if (!this.dirty) {
13355
+ this.schedule(this);
13356
+ }
13357
+ this.dirty = true;
13358
+ }
13359
+ onConsumerDependencyMayHaveChanged() {
13360
+ this.notify();
13361
+ }
13362
+ onProducerUpdateValueVersion() {
13363
+ // Watches are not producers.
13364
+ }
13365
+ /**
13366
+ * Execute the reactive expression in the context of this `Watch` consumer.
13367
+ *
13368
+ * Should be called by the user scheduling algorithm when the provided
13369
+ * `schedule` hook is called by `Watch`.
13370
+ */
13371
+ run() {
13372
+ this.dirty = false;
13373
+ if (this.trackingVersion !== 0 && !this.consumerPollProducersForChange()) {
13374
+ return;
13375
+ }
13376
+ const prevConsumer = setActiveConsumer(this);
13377
+ this.trackingVersion++;
13378
+ try {
13379
+ this.cleanupFn();
13380
+ this.cleanupFn = this.watch() ?? NOOP_CLEANUP_FN;
13381
+ }
13382
+ finally {
13383
+ setActiveConsumer(prevConsumer);
13384
+ }
13385
+ }
13386
+ cleanup() {
13387
+ this.cleanupFn();
13388
+ }
13389
+ }
13390
+
13391
+ /**
13392
+ * Tracks all effects registered within a given application and runs them via `flush`.
13393
+ */
13394
+ class EffectManager {
13395
+ constructor() {
13396
+ this.all = new Set();
13397
+ this.queue = new Map();
13398
+ }
13399
+ create(effectFn, destroyRef, allowSignalWrites) {
13400
+ const zone = Zone.current;
13401
+ const watch = new Watch(effectFn, (watch) => {
13402
+ if (!this.all.has(watch)) {
13403
+ return;
13404
+ }
13405
+ this.queue.set(watch, zone);
13406
+ }, allowSignalWrites);
13407
+ this.all.add(watch);
13408
+ // Effects start dirty.
13409
+ watch.notify();
13410
+ let unregisterOnDestroy;
13411
+ const destroy = () => {
13412
+ watch.cleanup();
13413
+ unregisterOnDestroy?.();
13414
+ this.all.delete(watch);
13415
+ this.queue.delete(watch);
13416
+ };
13417
+ unregisterOnDestroy = destroyRef?.onDestroy(destroy);
13418
+ return {
13419
+ destroy,
13420
+ };
13421
+ }
13422
+ flush() {
13423
+ if (this.queue.size === 0) {
13424
+ return;
13425
+ }
13426
+ for (const [watch, zone] of this.queue) {
13427
+ this.queue.delete(watch);
13428
+ zone.run(() => watch.run());
13429
+ }
13430
+ }
13431
+ get isQueueEmpty() {
13432
+ return this.queue.size === 0;
13433
+ }
13434
+ /** @nocollapse */
13435
+ static { this.ɵprov = ɵɵdefineInjectable({
13436
+ token: EffectManager,
13437
+ providedIn: 'root',
13438
+ factory: () => new EffectManager(),
13439
+ }); }
13440
+ }
13441
+ /**
13442
+ * Create a global `Effect` for the given reactive function.
13443
+ *
13444
+ * @developerPreview
13445
+ */
13446
+ function effect(effectFn, options) {
13447
+ !options?.injector && assertInInjectionContext(effect);
13448
+ const injector = options?.injector ?? inject$1(Injector);
13449
+ const effectManager = injector.get(EffectManager);
13450
+ const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
13451
+ return effectManager.create(effectFn, destroyRef, !!options?.allowSignalWrites);
13452
+ }
13453
+
12716
13454
  /**
12717
13455
  * Compute the static styling (class/style) from `TAttributes`.
12718
13456
  *
@@ -13180,6 +13918,12 @@ class ComponentFactory extends ComponentFactory$1 {
13180
13918
  'Make sure that any injector used to create this component has a correct parent.');
13181
13919
  }
13182
13920
  const sanitizer = rootViewInjector.get(Sanitizer, null);
13921
+ const effectManager = rootViewInjector.get(EffectManager, null);
13922
+ const environment = {
13923
+ rendererFactory,
13924
+ sanitizer,
13925
+ effectManager,
13926
+ };
13183
13927
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
13184
13928
  // Determine a tag name used for creating host elements when this component is created
13185
13929
  // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
@@ -13191,7 +13935,7 @@ class ComponentFactory extends ComponentFactory$1 {
13191
13935
  16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
13192
13936
  // Create the root view. Uses empty TView and ContentTemplate.
13193
13937
  const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null, null);
13194
- const rootLView = createLView(null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null, null);
13938
+ const rootLView = createLView(null, rootTView, null, rootFlags, null, null, environment, hostRenderer, rootViewInjector, null, null);
13195
13939
  // rootView is the parent when bootstrapping
13196
13940
  // TODO(misko): it looks like we are entering view here but we don't really need to as
13197
13941
  // `renderView` does that. However as the code is written it is needed because
@@ -13214,7 +13958,7 @@ class ComponentFactory extends ComponentFactory$1 {
13214
13958
  rootDirectives = [rootComponentDef];
13215
13959
  }
13216
13960
  const hostTNode = createRootComponentTNode(rootLView, hostRNode);
13217
- const componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, rendererFactory, hostRenderer);
13961
+ const componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, environment, hostRenderer);
13218
13962
  tElementNode = getTNode(rootTView, HEADER_OFFSET);
13219
13963
  // TODO(crisbeto): in practice `hostRNode` should always be defined, but there are some tests
13220
13964
  // where the renderer is mocked out and `undefined` is returned. We should update the tests so
@@ -13251,6 +13995,7 @@ class ComponentRef extends ComponentRef$1 {
13251
13995
  this.location = location;
13252
13996
  this._rootLView = _rootLView;
13253
13997
  this._tNode = _tNode;
13998
+ this.previousInputValues = null;
13254
13999
  this.instance = instance;
13255
14000
  this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
13256
14001
  this.componentType = componentType;
@@ -13259,8 +14004,16 @@ class ComponentRef extends ComponentRef$1 {
13259
14004
  const inputData = this._tNode.inputs;
13260
14005
  let dataValue;
13261
14006
  if (inputData !== null && (dataValue = inputData[name])) {
14007
+ this.previousInputValues ??= new Map();
14008
+ // Do not set the input if it is the same as the last value
14009
+ // This behavior matches `bindingUpdated` when binding inputs in templates.
14010
+ if (this.previousInputValues.has(name) &&
14011
+ Object.is(this.previousInputValues.get(name), value)) {
14012
+ return;
14013
+ }
13262
14014
  const lView = this._rootLView;
13263
14015
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
14016
+ this.previousInputValues.set(name, value);
13264
14017
  markDirtyIfOnPush(lView, this._tNode.index);
13265
14018
  }
13266
14019
  else {
@@ -13311,7 +14064,7 @@ function createRootComponentTNode(lView, rNode) {
13311
14064
  *
13312
14065
  * @returns Component view created
13313
14066
  */
13314
- function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
14067
+ function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, environment, hostRenderer) {
13315
14068
  const tView = rootView[TVIEW];
13316
14069
  applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);
13317
14070
  // Hydration info is on the host element and needs to be retreived
@@ -13320,8 +14073,8 @@ function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirecti
13320
14073
  if (hostRNode !== null) {
13321
14074
  hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR$1]);
13322
14075
  }
13323
- const viewRenderer = rendererFactory.createRenderer(hostRNode, rootComponentDef);
13324
- const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, rootComponentDef.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[tNode.index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null, hydrationInfo);
14076
+ const viewRenderer = environment.rendererFactory.createRenderer(hostRNode, rootComponentDef);
14077
+ const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, rootComponentDef.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[tNode.index], tNode, environment, viewRenderer, null, null, hydrationInfo);
13325
14078
  if (tView.firstCreatePass) {
13326
14079
  markAsComponentHost(tView, tNode, rootDirectives.length - 1);
13327
14080
  }
@@ -14991,10 +15744,9 @@ function siblingAfter(skip, from) {
14991
15744
  */
14992
15745
  function stringifyNavigationInstructions(instructions) {
14993
15746
  const container = [];
14994
- let i = 0;
14995
- while (i < instructions.length) {
14996
- const step = instructions[i++];
14997
- const repeat = instructions[i++];
15747
+ for (let i = 0; i < instructions.length; i += 2) {
15748
+ const step = instructions[i];
15749
+ const repeat = instructions[i + 1];
14998
15750
  for (let r = 0; r < repeat; r++) {
14999
15751
  container.push(step === NodeNavigationStep.FirstChild ? 'firstChild' : 'nextSibling');
15000
15752
  }
@@ -15007,10 +15759,9 @@ function stringifyNavigationInstructions(instructions) {
15007
15759
  */
15008
15760
  function navigateToNode(from, instructions) {
15009
15761
  let node = from;
15010
- let i = 0;
15011
- while (i < instructions.length) {
15012
- const step = instructions[i++];
15013
- const repeat = instructions[i++];
15762
+ for (let i = 0; i < instructions.length; i += 2) {
15763
+ const step = instructions[i];
15764
+ const repeat = instructions[i + 1];
15014
15765
  for (let r = 0; r < repeat; r++) {
15015
15766
  if (ngDevMode && !node) {
15016
15767
  throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
@@ -15531,7 +16282,8 @@ function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, inde
15531
16282
  enterSkipHydrationBlock(tNode);
15532
16283
  // Since this isn't hydratable, we need to empty the node
15533
16284
  // so there's no duplicate content after render
15534
- clearElementContents(renderer, native);
16285
+ clearElementContents(native);
16286
+ ngDevMode && ngDevMode.componentsSkippedHydration++;
15535
16287
  }
15536
16288
  else if (ngDevMode) {
15537
16289
  // If this is not a component host, throw an error.
@@ -15588,7 +16340,6 @@ function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {
15588
16340
  elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex) :
15589
16341
  tView.data[adjustedIndex];
15590
16342
  setCurrentTNode(tNode, true);
15591
- ngDevMode && ngDevMode.rendererCreateComment++;
15592
16343
  const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);
15593
16344
  lView[adjustedIndex] = comment;
15594
16345
  if (wasLastNodeCreated()) {
@@ -17977,8 +18728,11 @@ function isStylingValuePresent(value) {
17977
18728
  * @param suffix
17978
18729
  */
17979
18730
  function normalizeSuffix(value, suffix) {
17980
- if (value == null /** || value === undefined */) {
18731
+ if (value == null || value === '') {
17981
18732
  // do nothing
18733
+ // Do not add the suffix if the value is going to be empty.
18734
+ // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.
18735
+ // Example: `"left": "px;"` instead of `"left": ""`.
17982
18736
  }
17983
18737
  else if (typeof suffix === 'string') {
17984
18738
  value = value + suffix;
@@ -21773,17 +22527,19 @@ function createNgModuleRefWithProviders(moduleType, parentInjector, additionalPr
21773
22527
  return new NgModuleRef(moduleType, parentInjector, additionalProviders);
21774
22528
  }
21775
22529
  class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
21776
- constructor(providers, parent, source) {
22530
+ constructor(config) {
21777
22531
  super();
21778
22532
  this.componentFactoryResolver = new ComponentFactoryResolver(this);
21779
22533
  this.instance = null;
21780
22534
  const injector = new R3Injector([
21781
- ...providers,
22535
+ ...config.providers,
21782
22536
  { provide: NgModuleRef$1, useValue: this },
21783
22537
  { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
21784
- ], parent || getNullInjector(), source, new Set(['environment']));
22538
+ ], config.parent || getNullInjector(), config.debugName, new Set(['environment']));
21785
22539
  this.injector = injector;
21786
- injector.resolveInjectorInitializers();
22540
+ if (config.runEnvironmentInitializers) {
22541
+ injector.resolveInjectorInitializers();
22542
+ }
21787
22543
  }
21788
22544
  destroy() {
21789
22545
  this.injector.destroy();
@@ -21806,7 +22562,7 @@ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
21806
22562
  * @publicApi
21807
22563
  */
21808
22564
  function createEnvironmentInjector(providers, parent, debugName = null) {
21809
- const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
22565
+ const adapter = new EnvironmentNgModuleRefAdapter({ providers, parent, debugName, runEnvironmentInitializers: true });
21810
22566
  return adapter.injector;
21811
22567
  }
21812
22568
 
@@ -21845,13 +22601,13 @@ class StandaloneService {
21845
22601
  this.cachedInjectors.clear();
21846
22602
  }
21847
22603
  }
22604
+ /** @nocollapse */
22605
+ static { this.ɵprov = ɵɵdefineInjectable({
22606
+ token: StandaloneService,
22607
+ providedIn: 'environment',
22608
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
22609
+ }); }
21848
22610
  }
21849
- /** @nocollapse */
21850
- StandaloneService.ɵprov = ɵɵdefineInjectable({
21851
- token: StandaloneService,
21852
- providedIn: 'environment',
21853
- factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
21854
- });
21855
22611
  /**
21856
22612
  * A feature that acts as a setup code for the {@link StandaloneService}.
21857
22613
  *
@@ -22893,6 +23649,7 @@ function symbolIterator() {
22893
23649
  * @publicApi
22894
23650
  */
22895
23651
  class QueryList {
23652
+ static { Symbol.iterator; }
22896
23653
  /**
22897
23654
  * Returns `Observable` of `QueryList` notifying the subscriber of changes.
22898
23655
  */
@@ -23020,7 +23777,6 @@ class QueryList {
23020
23777
  this.changes.unsubscribe();
23021
23778
  }
23022
23779
  }
23023
- Symbol.iterator;
23024
23780
 
23025
23781
  /**
23026
23782
  * Represents an embedded template that can be used to instantiate embedded views.
@@ -23041,12 +23797,12 @@ Symbol.iterator;
23041
23797
  * @publicApi
23042
23798
  */
23043
23799
  class TemplateRef {
23800
+ /**
23801
+ * @internal
23802
+ * @nocollapse
23803
+ */
23804
+ static { this.__NG_ELEMENT_ID__ = injectTemplateRef; }
23044
23805
  }
23045
- /**
23046
- * @internal
23047
- * @nocollapse
23048
- */
23049
- TemplateRef.__NG_ELEMENT_ID__ = injectTemplateRef;
23050
23806
  const ViewEngineTemplateRef = TemplateRef;
23051
23807
  // TODO(alxhub): combine interface and implementation. Currently this is challenging since something
23052
23808
  // in g3 depends on them being separate.
@@ -23074,7 +23830,7 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
23074
23830
  */
23075
23831
  createEmbeddedViewImpl(context, injector, hydrationInfo) {
23076
23832
  const embeddedTView = this._declarationTContainer.tView;
23077
- const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null, hydrationInfo || null);
23833
+ const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, injector || null, hydrationInfo || null);
23078
23834
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
23079
23835
  ngDevMode && assertLContainer(declarationLContainer);
23080
23836
  embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
@@ -23177,21 +23933,16 @@ function cleanupLView(lView) {
23177
23933
  * all dehydrated views from all `LContainer`s along the way.
23178
23934
  */
23179
23935
  function cleanupDehydratedViews(appRef) {
23180
- // Wait once an app becomes stable and cleanup all views that
23181
- // were not claimed during the application bootstrap process.
23182
- // The timing is similar to when we kick off serialization on the server.
23183
- return appRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => {
23184
- const viewRefs = appRef._views;
23185
- for (const viewRef of viewRefs) {
23186
- const lView = getComponentLViewForHydration(viewRef);
23187
- // An `lView` might be `null` if a `ViewRef` represents
23188
- // an embedded view (not a component view).
23189
- if (lView !== null && lView[HOST] !== null) {
23190
- cleanupLView(lView);
23191
- ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;
23192
- }
23936
+ const viewRefs = appRef._views;
23937
+ for (const viewRef of viewRefs) {
23938
+ const lView = getComponentLViewForHydration(viewRef);
23939
+ // An `lView` might be `null` if a `ViewRef` represents
23940
+ // an embedded view (not a component view).
23941
+ if (lView !== null && lView[HOST] !== null) {
23942
+ cleanupLView(lView);
23943
+ ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;
23193
23944
  }
23194
- });
23945
+ }
23195
23946
  }
23196
23947
 
23197
23948
  /**
@@ -23275,7 +24026,7 @@ function findMatchingDehydratedView(lContainer, template) {
23275
24026
  * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
23276
24027
  *
23277
24028
  * A view container instance can contain other view containers,
23278
- * creating a [view hierarchy](guide/glossary#view-tree).
24029
+ * creating a [view hierarchy](guide/glossary#view-hierarchy).
23279
24030
  *
23280
24031
  * @see `ComponentRef`
23281
24032
  * @see `EmbeddedViewRef`
@@ -23283,12 +24034,12 @@ function findMatchingDehydratedView(lContainer, template) {
23283
24034
  * @publicApi
23284
24035
  */
23285
24036
  class ViewContainerRef {
24037
+ /**
24038
+ * @internal
24039
+ * @nocollapse
24040
+ */
24041
+ static { this.__NG_ELEMENT_ID__ = injectViewContainerRef; }
23286
24042
  }
23287
- /**
23288
- * @internal
23289
- * @nocollapse
23290
- */
23291
- ViewContainerRef.__NG_ELEMENT_ID__ = injectViewContainerRef;
23292
24043
  /**
23293
24044
  * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
23294
24045
  * already exists, retrieves the existing ViewContainerRef.
@@ -24454,7 +25205,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
24454
25205
  ];
24455
25206
  exports.forEach(verifyExportsAreDeclaredOrReExported);
24456
25207
  declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
24457
- declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);
24458
25208
  const ngModule = getAnnotation(moduleType, 'NgModule');
24459
25209
  if (ngModule) {
24460
25210
  ngModule.imports &&
@@ -24464,8 +25214,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
24464
25214
  });
24465
25215
  ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);
24466
25216
  ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);
24467
- ngModule.entryComponents &&
24468
- deepForEach(ngModule.entryComponents, verifyComponentIsPartOfNgModule);
24469
25217
  }
24470
25218
  // Throw Error if any errors were detected.
24471
25219
  if (errors.length) {
@@ -24543,16 +25291,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
24543
25291
  `function for bootstrap instead.`);
24544
25292
  }
24545
25293
  }
24546
- function verifyComponentEntryComponentsIsPartOfNgModule(type) {
24547
- type = resolveForwardRef(type);
24548
- if (getComponentDef$1(type)) {
24549
- // We know we are component
24550
- const component = getAnnotation(type, 'Component');
24551
- if (component && component.entryComponents) {
24552
- deepForEach(component.entryComponents, verifyComponentIsPartOfNgModule);
24553
- }
24554
- }
24555
- }
24556
25294
  function verifySemanticsOfNgModuleImport(type, importingModule) {
24557
25295
  type = resolveForwardRef(type);
24558
25296
  const directiveDef = getComponentDef$1(type) || getDirectiveDef(type);
@@ -25621,9 +26359,8 @@ class TestBedCompiler {
25621
26359
  ɵcompileNgModuleDefs(RootScopeModule, {
25622
26360
  providers: [...this.rootProviderOverrides],
25623
26361
  });
25624
- const ngZone = new NgZone({ enableLongStackTrace: true });
25625
26362
  const providers = [
25626
- ɵprovideNgZoneChangeDetection(ngZone),
26363
+ provideZoneChangeDetection(),
25627
26364
  { provide: Compiler, useFactory: () => new R3TestCompiler(this) },
25628
26365
  ...this.providers,
25629
26366
  ...this.providerOverrides,
@@ -25852,6 +26589,7 @@ class TestBedImpl {
25852
26589
  */
25853
26590
  this.globalCompilationChecked = false;
25854
26591
  }
26592
+ static { this._INSTANCE = null; }
25855
26593
  static get INSTANCE() {
25856
26594
  return TestBedImpl._INSTANCE = TestBedImpl._INSTANCE || new TestBedImpl();
25857
26595
  }
@@ -26261,7 +26999,6 @@ class TestBedImpl {
26261
26999
  }
26262
27000
  }
26263
27001
  }
26264
- TestBedImpl._INSTANCE = null;
26265
27002
  /**
26266
27003
  * @description
26267
27004
  * Configures and initializes environment for unit testing and provides methods for