{"version":3,"file":"debug_node-Dn-GvQJo.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/closure.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/decorators.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/metadata.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/compiler/compiler_facade.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/environment.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/interface/type.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/reflection/reflection_capabilities.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/interface/simple_change.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/apply_value_input_field.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/ng_onchanges_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/profiler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/hooks.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/injector.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/node.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_assert.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/attrs_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/injector_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/di.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/di_attr.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/metadata_attr.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/util.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/injectable.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injectable.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/element_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/query_list.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/skip_hydration.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/constants.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/lview_tracking.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/context.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/context_discovery.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/view_traversal_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/discovery_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/document.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_tokens.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/transfer_state.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/interfaces.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/tokens.ts","../../../../../../packages/core/primitives/defer/src/triggers.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/event_delegation_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/registry.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query_execution.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/view.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/security/trusted_types.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/security/trusted_types_bypass.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/bypass.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/inert_body.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/url_sanitizer.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/html_sanitizer.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/security.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/sanitization.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/dom.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/ng_reflect.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/schema.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element_validation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/misc_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/errors.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/class_differ.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_selector_matcher.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/tokens.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/dom_node_manipulation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/construction.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/advance.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/input_flags.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/write_to_directive_input.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/shared.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/render.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_manipulation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/use_exhaustive_check_no_changes.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_tree_shaking.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render/api_flags.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_manipulation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/collect_native_nodes.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/view.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactive_lview_consumer.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/view_effect_runner.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/change_detection.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/mark_view_dirty.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/container.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/template_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/error_handling.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_manipulation_i18n.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/tnode_manipulation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_insert_before_index.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_util.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_icu_container_visitor.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/compression.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/node_lookup_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/i18n.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/cleanup.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/views.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/component_factory.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/component_factory_resolver.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render/api.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/sanitizer.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/util.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/deps_tracker/deps_tracker.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/view/provider_flags.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/chained_injector.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/static_styling.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/di.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/directives.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/elements.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/iterable.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/comparison.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/bindings.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/listeners.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/directive_outputs.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/dynamic_bindings.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/component_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/view_container_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query_reactive.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/resource_loading.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_registration.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/iframe_attrs_validation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/performance.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_factory.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/ng_module_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/standalone_service.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/definition.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/inherit_definition_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/copy_definition_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/host_directives_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/template.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/interfaces.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/cleanup.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/tracing.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/flags.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/event_emitter.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/callback_scheduler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/zone/async-stack-tagging.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/zone/ng_zone.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/manager.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/hooks.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/dom_triggers.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/idle_scheduler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/timer_scheduler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/cached_injector_service.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/rendering.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/metadata.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/console.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/framework_injector_profiler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/change_detection_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/discovery.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/defer.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/injector_discovery_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/signal_debug.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/chrome_dev_tools_performance.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/global_utils.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/testability/testability.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/lang.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_init.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/triggering.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/instructions.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/attribute.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/component_instance.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/list_reconciliation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/control_flow.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/property.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element_container.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/get_current_view.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/dom_property.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/locale_en.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/locale_data_api.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/localization.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/i18n.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_locale_id.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_apply.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_debug.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_parse.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_postprocess.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/i18n.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/listener.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/next_context.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/projection.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/queries.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/queries_signals.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/storage.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/styling.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/style_binding_list.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/styling_parser.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/styling.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/text.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/interpolation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/text_interpolation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/two_way.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/let_declaration.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/attach_source_locations.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/value_interpolation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/di_setup.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/providers_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/external_styles_feature.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/scope.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/pure_function.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/pipe.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_engine_compatibility_prebound.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/local_compilation.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/set_debug_info.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/hmr.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/environment.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/jit_options.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/module.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/directive.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/pipe.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/directives.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/ng_module.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/compiler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/ng_zone_scheduling.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/tokens.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/debug/debug_node.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nexport function noSideEffects(fn: () => T): T {\n return {toString: fn}.toString() as unknown as T;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Type} from '../interface/type';\n\nimport {noSideEffects} from './closure';\n\n/**\n * An interface implemented by all Angular type decorators, which allows them to be used as\n * decorators as well as Angular syntax.\n *\n * ```ts\n * @ng.Component({...})\n * class MyClass {...}\n * ```\n *\n * @publicApi\n */\nexport interface TypeDecorator {\n /**\n * Invoke as decorator.\n */\n >(type: T): T;\n\n // Make TypeDecorator assignable to built-in ParameterDecorator type.\n // ParameterDecorator is declared in lib.d.ts as a `declare type`\n // so we cannot declare this interface as a subtype.\n // see https://github.com/angular/angular/issues/3379#issuecomment-126169417\n (target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;\n // Standard (non-experimental) Decorator signature that avoids direct usage of\n // any TS 5.0+ specific types.\n (target: unknown, context: unknown): void;\n}\n\nexport const ANNOTATIONS = '__annotations__';\nexport const PARAMETERS = '__parameters__';\nexport const PROP_METADATA = '__prop__metadata__';\n\n/**\n * @suppress {globalThis}\n */\nexport function makeDecorator(\n name: string,\n props?: (...args: any[]) => any,\n parentClass?: any,\n additionalProcessing?: (type: Type) => void,\n typeFn?: (type: Type, ...args: any[]) => void,\n): {new (...args: any[]): any; (...args: any[]): any; (...args: any[]): (cls: any) => any} {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n\n function DecoratorFactory(\n this: unknown | typeof DecoratorFactory,\n ...args: any[]\n ): (cls: Type) => any {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this as typeof DecoratorFactory;\n }\n\n const annotationInstance = new (DecoratorFactory as any)(...args);\n return function TypeDecorator(cls: Type) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS)\n ? (cls as any)[ANNOTATIONS]\n : (Object.defineProperty(cls, ANNOTATIONS, {value: []}) as any)[ANNOTATIONS];\n annotations.push(annotationInstance);\n\n if (additionalProcessing) additionalProcessing(cls);\n\n return cls;\n };\n }\n\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n DecoratorFactory.prototype.ngMetadataName = name;\n (DecoratorFactory as any).annotationCls = DecoratorFactory;\n return DecoratorFactory as any;\n });\n}\n\nfunction makeMetadataCtor(props?: (...args: any[]) => any): any {\n return function ctor(this: any, ...args: any[]) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\n\nexport function makeParamDecorator(\n name: string,\n props?: (...args: any[]) => any,\n parentClass?: any,\n): any {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(\n this: unknown | typeof ParamDecoratorFactory,\n ...args: any[]\n ): any {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new (ParamDecoratorFactory)(...args);\n\n (ParamDecorator).annotation = annotationInstance;\n return ParamDecorator;\n\n function ParamDecorator(cls: any, unusedKey: any, index: number): any {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS)\n ? (cls as any)[PARAMETERS]\n : Object.defineProperty(cls, PARAMETERS, {value: []})[PARAMETERS];\n\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n (ParamDecoratorFactory).annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\n\nexport function makePropDecorator(\n name: string,\n props?: (...args: any[]) => any,\n parentClass?: any,\n additionalProcessing?: (target: any, name: string, ...args: any[]) => void,\n): any {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n\n function PropDecoratorFactory(\n this: unknown | typeof PropDecoratorFactory,\n ...args: any[]\n ): any {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n\n const decoratorInstance = new (PropDecoratorFactory)(...args);\n\n function PropDecorator(target: any, name: string) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA)\n ? (constructor as any)[PROP_METADATA]\n : Object.defineProperty(constructor, PROP_METADATA, {value: {}})[PROP_METADATA];\n meta[name] = (meta.hasOwnProperty(name) && meta[name]) || [];\n meta[name].unshift(decoratorInstance);\n\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n\n return PropDecorator;\n }\n\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n PropDecoratorFactory.prototype.ngMetadataName = name;\n (PropDecoratorFactory).annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {makeParamDecorator} from '../util/decorators';\n\nimport {attachInjectFlag} from './injector_compatibility';\nimport {DecoratorFlags, InternalInjectFlags} from './interface/injector';\n\n/**\n * Type of the Inject decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectDecorator {\n /**\n * Warning: String tokens are not recommended.\n *\n * Use an InjectionToken or a class as a token instead.\n */\n (token: string): any;\n new (token: string): Inject;\n\n /**\n * Parameter decorator on a dependency parameter of a class constructor\n * that specifies a custom provider of the dependency.\n *\n * @usageNotes\n * The following example shows a class constructor that specifies a\n * custom provider of a dependency using the parameter decorator.\n *\n * When `@Inject()` is not present, the injector uses the type annotation of the\n * parameter as the provider.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}\n *\n * @see [Dependency Injection Guide](guide/di/dependency-injection\n *\n */\n (token: any): any;\n new (token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n *\n * @publicApi\n */\nexport interface Inject {\n /**\n * A DI token that maps to the dependency to be injected.\n */\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Inject: InjectDecorator = attachInjectFlag(\n // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\n makeParamDecorator('Inject', (token: any) => ({token})),\n // tslint:disable-next-line: no-toplevel-property-access\n DecoratorFlags.Inject,\n);\n\n/**\n * Type of the Optional decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OptionalDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which marks the parameter as being an optional dependency.\n * The DI framework provides `null` if the dependency is not found.\n *\n * Can be used together with other parameter decorators\n * that modify how dependency injection operates.\n *\n * @usageNotes\n *\n * The following code allows the possibility of a `null` result:\n *\n * {@example core/di/ts/metadata_spec.ts region='Optional'}\n *\n * @see [Dependency Injection Guide](guide/di/dependency-injection.\n */\n (): any;\n new (): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n *\n * @publicApi\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Optional: OptionalDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Optional'), InternalInjectFlags.Optional);\n\n/**\n * Type of the Self decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SelfDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the local injector.\n *\n * Resolution works upward through the injector hierarchy, so the children\n * of this class must configure their own providers or be prepared for a `null` result.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved\n * by the local injector when instantiating the class itself, but not\n * when instantiating a child.\n *\n * {@example core/di/ts/metadata_spec.ts region='Self'}\n *\n * @see {@link SkipSelf}\n * @see {@link Optional}\n *\n */\n (): any;\n new (): Self;\n}\n\n/**\n * Type of the Self metadata.\n *\n * @publicApi\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Self: SelfDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Self'), InternalInjectFlags.Self);\n\n/**\n * Type of the `SkipSelf` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SkipSelfDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the parent injector.\n * Resolution works upward through the injector hierarchy, so the local injector\n * is not checked for a provider.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved when\n * instantiating a child, but not when instantiating the class itself.\n *\n * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}\n *\n * @see [Dependency Injection guide](guide/di/di-in-action#skip).\n * @see {@link Self}\n * @see {@link Optional}\n *\n */\n (): any;\n new (): SkipSelf;\n}\n\n/**\n * Type of the `SkipSelf` metadata.\n *\n * @publicApi\n */\nexport interface SkipSelf {}\n\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const SkipSelf: SkipSelfDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('SkipSelf'), InternalInjectFlags.SkipSelf);\n\n/**\n * Type of the `Host` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostDecorator {\n /**\n * Parameter decorator on a view-provider parameter of a class constructor\n * that tells the DI framework to resolve the view by checking injectors of child\n * elements, and stop when reaching the host element of the current component.\n *\n * @usageNotes\n *\n * The following shows use with the `@Optional` decorator, and allows for a `null` result.\n *\n * {@example core/di/ts/metadata_spec.ts region='Host'}\n *\n * For an extended example, see [\"Dependency Injection\n * Guide\"](guide/di/di-in-action#optional).\n */\n (): any;\n new (): Host;\n}\n\n/**\n * Type of the Host metadata.\n *\n * @publicApi\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Host: HostDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Host'), InternalInjectFlags.Host);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {global} from '../util/global';\nimport {CompilerFacade, ExportedCompilerFacade, Type} from './compiler_facade_interface';\nexport * from './compiler_facade_interface';\n\nexport const enum JitCompilerUsage {\n Decorator,\n PartialDeclaration,\n}\n\ninterface JitCompilerUsageRequest {\n usage: JitCompilerUsage;\n kind: 'directive' | 'component' | 'pipe' | 'injectable' | 'NgModule';\n type: Type;\n}\n\nexport function getCompilerFacade(request: JitCompilerUsageRequest): CompilerFacade {\n const globalNg: ExportedCompilerFacade = global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === JitCompilerUsage.PartialDeclaration) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n } else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n } else {\n throw new Error('JIT compiler unavailable');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {resolveForwardRef} from '../forward_ref';\nimport {ɵɵinject, ɵɵinvalidFactoryDep} from '../injector_compatibility';\nimport {ɵɵdefineInjectable, ɵɵdefineInjector} from '../interface/defs';\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nexport const angularCoreDiEnv: {[name: string]: Function} = {\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef,\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nexport const Type = Function;\n\nexport function isType(v: any): v is Type {\n return typeof v === 'function';\n}\n\n/**\n * @description\n *\n * Represents an abstract class `T`, if applied to a concrete class it would stop being\n * instantiable.\n *\n * @publicApi\n */\nexport interface AbstractType extends Function {\n prototype: T;\n}\n\nexport interface Type extends Function {\n new (...args: any[]): T;\n}\n\n/**\n * Returns a writable type version of type.\n *\n * USAGE:\n * Given:\n * ```ts\n * interface Person {readonly name: string}\n * ```\n *\n * We would like to get a read/write version of `Person`.\n * ```ts\n * const WritablePerson = Writable;\n * ```\n *\n * The result is that you can do:\n *\n * ```ts\n * const readonlyPerson: Person = {name: 'Marry'};\n * readonlyPerson.name = 'John'; // TypeError\n * (readonlyPerson as WritablePerson).name = 'John'; // OK\n *\n * // Error: Correctly detects that `Person` did not have `age` property.\n * (readonlyPerson as WritablePerson).age = 30;\n * ```\n */\nexport type Writable = {\n -readonly [K in keyof T]: T[K];\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {isType, Type} from '../interface/type';\nimport {newArray} from '../util/array_utils';\nimport {ANNOTATIONS, PARAMETERS, PROP_METADATA} from '../util/decorators';\nimport {global} from '../util/global';\n\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nexport const ES5_DELEGATE_CTOR =\n /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nexport const ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nexport const ES2015_INHERITED_CLASS_WITH_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nexport const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nexport function isDelegateCtor(typeStr: string): boolean {\n return (\n ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr))\n );\n}\n\nexport class ReflectionCapabilities implements PlatformReflectionCapabilities {\n private _reflect: any;\n\n constructor(reflect?: any) {\n this._reflect = reflect || global['Reflect'];\n }\n\n factory(t: Type): (args: any[]) => T {\n return (...args: any[]) => new t(...args);\n }\n\n /** @internal */\n _zipTypesAndAnnotations(paramTypes: any[], paramAnnotations: any[]): any[][] {\n let result: any[][];\n\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n\n private _ownParameters(type: Type, parentCtor: any): any[][] | null {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n\n // Prefer the direct API.\n if ((type).parameters && (type).parameters !== parentCtor.parameters) {\n return (type).parameters;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = (type).ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters =\n typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(\n (ctorParam: any) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators),\n );\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && (type as any)[PARAMETERS];\n const paramTypes =\n this._reflect &&\n this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n\n parameters(type: Type): any[][] {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n\n private _ownAnnotations(typeOrFunc: Type, parentCtor: any): any[] | null {\n // Prefer the direct API.\n if ((typeOrFunc).annotations && (typeOrFunc).annotations !== parentCtor.annotations) {\n let annotations = (typeOrFunc).annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((typeOrFunc).decorators && (typeOrFunc).decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata((typeOrFunc).decorators);\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return (typeOrFunc as any)[ANNOTATIONS];\n }\n return null;\n }\n\n annotations(typeOrFunc: Type): any[] {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n\n private _ownPropMetadata(typeOrFunc: any, parentCtor: any): {[key: string]: any[]} | null {\n // Prefer the direct API.\n if (\n (typeOrFunc).propMetadata &&\n (typeOrFunc).propMetadata !== parentCtor.propMetadata\n ) {\n let propMetadata = (typeOrFunc).propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if (\n (typeOrFunc).propDecorators &&\n (typeOrFunc).propDecorators !== parentCtor.propDecorators\n ) {\n const propDecorators = (typeOrFunc).propDecorators;\n const propMetadata = <{[key: string]: any[]}>{};\n Object.keys(propDecorators).forEach((prop) => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return (typeOrFunc as any)[PROP_METADATA];\n }\n return null;\n }\n\n propMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata: {[key: string]: any[]} = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators: any[] = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n\n ownPropMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\n\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map((decoratorInvocation) => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\n\nfunction getParentCtor(ctor: Function): Type {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nexport class SimpleChange {\n constructor(\n public previousValue: any,\n public currentValue: any,\n public firstChange: boolean,\n ) {}\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange(): boolean {\n return this.firstChange;\n }\n}\n\n/**\n * A hashtable of changes represented by {@link SimpleChange} objects stored\n * at the declared property name they belong to on a Directive or Component. This is\n * the type passed to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nexport interface SimpleChanges {\n [propName: string]: SimpleChange;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InputSignalNode} from '../authoring/input/input_signal_node';\n\nexport function applyValueToInputField(\n instance: T,\n inputSignalNode: null | InputSignalNode,\n privateName: string,\n value: unknown,\n) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n } else {\n (instance as any)[privateName] = value;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InputSignalNode} from '../../authoring/input/input_signal_node';\nimport {OnChanges} from '../../interface/lifecycle_hooks';\nimport {SimpleChange, SimpleChanges} from '../../interface/simple_change';\nimport {assertString} from '../../util/assert';\nimport {EMPTY_OBJ} from '../../util/empty';\nimport {applyValueToInputField} from '../apply_value_input_field';\nimport {DirectiveDef, DirectiveDefFeature} from '../interfaces/definition';\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```ts\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nexport const ɵɵNgOnChangesFeature: () => DirectiveDefFeature = /* @__PURE__ */ (() => {\n const ɵɵNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;\n\n // This option ensures that the ngOnChanges lifecycle hook will be inherited\n // from superclasses (in InheritDefinitionFeature).\n /** @nocollapse */\n ɵɵNgOnChangesFeatureImpl.ngInherit = true;\n\n return ɵɵNgOnChangesFeatureImpl;\n})();\n\nexport function NgOnChangesFeatureImpl(definition: DirectiveDef) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook(this: OnChanges) {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n\n if (current) {\n const previous = simpleChangesStore!.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore!.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore!.current = null;\n this.ngOnChanges(current);\n }\n}\n\nfunction ngOnChangesSetInput(\n this: DirectiveDef,\n instance: T,\n inputSignalNode: null | InputSignalNode,\n value: unknown,\n publicName: string,\n privateName: string,\n): void {\n const declaredName = (this.declaredInputs as {[key: string]: string})[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore =\n getSimpleChangesStore(instance) ||\n setSimpleChangesStore(instance, {previous: EMPTY_OBJ, current: null});\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(\n previousChange && previousChange.currentValue,\n value,\n previous === EMPTY_OBJ,\n );\n\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\n\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\n\nfunction getSimpleChangesStore(instance: any): null | NgSimpleChangesStore {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\n\nfunction setSimpleChangesStore(instance: any, store: NgSimpleChangesStore): NgSimpleChangesStore {\n return (instance[SIMPLE_CHANGES_STORE] = store);\n}\n\n/**\n * Data structure which is monkey-patched on the component instance and used by `ngOnChanges`\n * life-cycle hook to track previous input values.\n */\ninterface NgSimpleChangesStore {\n previous: SimpleChanges;\n current: SimpleChanges | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {type Profiler} from './profiler_types';\n\nconst profilerCallbacks: Profiler[] = [];\n\nconst NOOP_PROFILER_REMOVAL = () => {};\n\nfunction removeProfiler(profiler: Profiler) {\n const profilerIdx = profilerCallbacks.indexOf(profiler);\n if (profilerIdx !== -1) {\n profilerCallbacks.splice(profilerIdx, 1);\n }\n}\n\n/**\n * Adds a callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection). Multiple profiler callbacks can be set:\n * in this case profiling events are reported to every registered callback.\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable all profilers.\n * @returns a cleanup function that, when invoked, removes a given profiler callback.\n */\nexport function setProfiler(profiler: Profiler | null): () => void {\n if (profiler !== null) {\n if (!profilerCallbacks.includes(profiler)) {\n profilerCallbacks.push(profiler);\n }\n return () => removeProfiler(profiler);\n } else {\n profilerCallbacks.length = 0;\n return NOOP_PROFILER_REMOVAL;\n }\n}\n\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param eventFn function associated with event.\n * For example a template function, lifecycle hook, or output listener.\n * The value depends on the execution context\n */\nexport const profiler: Profiler = function (event, instance = null, eventFn): void {\n for (let i = 0; i < profilerCallbacks.length; i++) {\n const profilerCallback = profilerCallbacks[i];\n profilerCallback(event, instance, eventFn);\n }\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {setActiveConsumer} from '../../primitives/signals';\n\nimport {\n AfterContentChecked,\n AfterContentInit,\n AfterViewChecked,\n AfterViewInit,\n DoCheck,\n OnChanges,\n OnDestroy,\n OnInit,\n} from '../interface/lifecycle_hooks';\nimport {assertDefined, assertEqual, assertNotEqual} from '../util/assert';\n\nimport {assertFirstCreatePass} from './assert';\nimport {NgOnChangesFeatureImpl} from './features/ng_onchanges_feature';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TNode} from './interfaces/node';\nimport {\n FLAGS,\n HookData,\n InitPhaseState,\n LView,\n LViewFlags,\n PREORDER_HOOK_FLAGS,\n PreOrderHookFlags,\n TView,\n} from './interfaces/view';\nimport {profiler} from './profiler';\nimport {ProfilerEvent} from './profiler_types';\nimport {isInCheckNoChangesMode} from './state';\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nexport function registerPreOrderHooks(\n directiveIndex: number,\n directiveDef: DirectiveDef,\n tView: TView,\n): void {\n ngDevMode && assertFirstCreatePass(tView);\n const {ngOnChanges, ngOnInit, ngDoCheck} = directiveDef.type.prototype as OnChanges &\n OnInit &\n DoCheck;\n\n if (ngOnChanges as Function | undefined) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nexport function registerPostOrderHooks(tView: TView, tNode: TNode): void {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i] as DirectiveDef;\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks: AfterContentInit &\n AfterContentChecked &\n AfterViewInit &\n AfterViewChecked &\n OnDestroy = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy,\n } = lifecycleHooks;\n\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nexport function executeCheckHooks(lView: LView, hooks: HookData, nodeIndex?: number | null) {\n callHooks(lView, hooks, InitPhaseState.InitPhaseCompleted, nodeIndex);\n}\n\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nexport function executeInitAndCheckHooks(\n lView: LView,\n hooks: HookData,\n initPhase: InitPhaseState,\n nodeIndex?: number | null,\n) {\n ngDevMode &&\n assertNotEqual(\n initPhase,\n InitPhaseState.InitPhaseCompleted,\n 'Init pre-order hooks should not be called more than once',\n );\n if ((lView[FLAGS] & LViewFlags.InitPhaseStateMask) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\n\nexport function incrementInitPhaseFlags(lView: LView, initPhase: InitPhaseState): void {\n ngDevMode &&\n assertNotEqual(\n initPhase,\n InitPhaseState.InitPhaseCompleted,\n 'Init hooks phase should not be incremented after all init hooks have been run.',\n );\n let flags = lView[FLAGS];\n if ((flags & LViewFlags.InitPhaseStateMask) === initPhase) {\n flags &= LViewFlags.IndexWithinInitPhaseReset;\n flags += LViewFlags.InitPhaseStateIncrementer;\n lView[FLAGS] = flags;\n }\n}\n\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(\n currentView: LView,\n arr: HookData,\n initPhase: InitPhaseState,\n currentNodeIndex: number | null | undefined,\n): void {\n ngDevMode &&\n assertEqual(\n isInCheckNoChangesMode(),\n false,\n 'Hooks should never be run when in check no changes mode.',\n );\n const startIndex =\n currentNodeIndex !== undefined\n ? currentView[PREORDER_HOOK_FLAGS] & PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask\n : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1] as number | (() => void);\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i] as number;\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = (arr[i] as number) < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += PreOrderHookFlags.NumberOfInitHooksCalledIncrementer;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] =\n (currentView[PREORDER_HOOK_FLAGS] & PreOrderHookFlags.NumberOfInitHooksCalledMask) +\n i +\n 2;\n }\n i++;\n }\n }\n}\n\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive: any, hook: () => void) {\n profiler(ProfilerEvent.LifecycleHookStart, directive, hook);\n const prevConsumer = setActiveConsumer(null);\n try {\n hook.call(directive);\n } finally {\n setActiveConsumer(prevConsumer);\n profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);\n }\n}\n\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView: LView, initPhase: InitPhaseState, arr: HookData, i: number) {\n const isInitHook = (arr[i] as number) < 0;\n const hook = arr[i + 1] as () => void;\n const directiveIndex = isInitHook ? -arr[i] : (arr[i] as number);\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> LViewFlags.IndexWithinInitPhaseShift;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (\n indexWithintInitPhase <\n currentView[PREORDER_HOOK_FLAGS] >> PreOrderHookFlags.NumberOfInitHooksCalledShift &&\n (currentView[FLAGS] & LViewFlags.InitPhaseStateMask) === initPhase\n ) {\n currentView[FLAGS] += LViewFlags.IndexWithinInitPhaseIncrementer;\n callHookInternal(directive, hook);\n }\n } else {\n callHookInternal(directive, hook);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InternalInjectFlags} from '../../di/interface/injector';\nimport {ProviderToken} from '../../di/provider_token';\nimport {assertDefined, assertEqual} from '../../util/assert';\n\nimport {TDirectiveHostNode} from './node';\nimport {LView, TData} from './view';\n\n/**\n * Offsets of the `NodeInjector` data structure in the expando.\n *\n * `NodeInjector` is stored in both `LView` as well as `TView.data`. All storage requires 9 words.\n * First 8 are reserved for bloom filter and the 9th is reserved for the associated `TNode` as well\n * as parent `NodeInjector` pointer. All indexes are starting with `index` and have an offset as\n * shown.\n *\n * `LView` layout:\n * ```\n * index + 0: cumulative bloom filter\n * index + 1: cumulative bloom filter\n * index + 2: cumulative bloom filter\n * index + 3: cumulative bloom filter\n * index + 4: cumulative bloom filter\n * index + 5: cumulative bloom filter\n * index + 6: cumulative bloom filter\n * index + 7: cumulative bloom filter\n * index + 8: cumulative bloom filter\n * index + PARENT: Index to the parent injector. See `RelativeInjectorLocation`\n * `const parent = lView[index + NodeInjectorOffset.PARENT]`\n * ```\n *\n * `TViewData` layout:\n * ```\n * index + 0: cumulative bloom filter\n * index + 1: cumulative bloom filter\n * index + 2: cumulative bloom filter\n * index + 3: cumulative bloom filter\n * index + 4: cumulative bloom filter\n * index + 5: cumulative bloom filter\n * index + 6: cumulative bloom filter\n * index + 7: cumulative bloom filter\n * index + 8: cumulative bloom filter\n * index + TNODE: TNode associated with this `NodeInjector`\n * `const tNode = tView.data[index + NodeInjectorOffset.TNODE]`\n * ```\n */\nexport const enum NodeInjectorOffset {\n TNODE = 8,\n PARENT = 8,\n BLOOM_SIZE = 8,\n SIZE = 9,\n}\n\n/**\n * Represents a relative location of parent injector.\n *\n * The interfaces encodes number of parents `LView`s to traverse and index in the `LView`\n * pointing to the parent injector.\n */\nexport type RelativeInjectorLocation = number & {\n __brand__: 'RelativeInjectorLocationFlags';\n};\n\nexport const enum RelativeInjectorLocationFlags {\n InjectorIndexMask = 0b111111111111111,\n ViewOffsetShift = 16,\n NO_PARENT = -1,\n}\n\nexport const NO_PARENT_INJECTOR = -1 as RelativeInjectorLocation;\n\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nexport class NodeInjectorFactory {\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl: null | ((token: ProviderToken, flags?: InternalInjectFlags) => T);\n\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders: boolean;\n\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi?: Array<() => any>;\n\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```ts\n * component:\n * providers: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * providers: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```ts\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders?: number;\n\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index?: number;\n\n /**\n * Because the same `multi` provider can be declared in `providers` and `viewProviders` it is\n * possible for `viewProviders` to shadow the `providers`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```ts\n * providers: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProviders`\n * `Factory` has a pointer to the shadowed `providers` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory?: NodeInjectorFactory | null;\n\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n public factory: (\n this: NodeInjectorFactory,\n _: undefined,\n /**\n * array where injectables tokens are stored. This is used in\n * case of an error reporting to produce friendlier errors.\n */\n tData: TData,\n /**\n * array where existing instances of injectables are stored. This is used in case\n * of multi shadow is needed. See `multi` field documentation.\n */\n lView: LView,\n /**\n * The TNode of the same element injector.\n */\n tNode: TDirectiveHostNode,\n ) => any,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider: boolean,\n injectImplementation: null | ((token: ProviderToken, flags?: InternalInjectFlags) => T),\n ) {\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {Type} from '../../interface/type';\nimport {KeyValueArray} from '../../util/array_utils';\nimport {TStylingRange} from '../interfaces/styling';\nimport {AttributeMarker} from './attribute_marker';\n\nimport {TIcu} from './i18n';\nimport {CssSelector} from './projection';\nimport {RNode} from './renderer_dom';\nimport type {LView, TView} from './view';\n\n/**\n * TNodeType corresponds to the {@link TNode} `type` property.\n *\n * NOTE: type IDs are such that we use each bit to denote a type. This is done so that we can easily\n * check if the `TNode` is of more than one type.\n *\n * `if (tNode.type === TNodeType.Text || tNode.type === TNode.Element)`\n * can be written as:\n * `if (tNode.type & (TNodeType.Text | TNodeType.Element))`\n *\n * However any given `TNode` can only be of one type.\n */\nexport const enum TNodeType {\n /**\n * The TNode contains information about a DOM element aka {@link RText}.\n */\n Text = 0b1,\n\n /**\n * The TNode contains information about a DOM element aka {@link RElement}.\n */\n Element = 0b10,\n\n /**\n * The TNode contains information about an {@link LContainer} for embedded views.\n */\n Container = 0b100,\n\n /**\n * The TNode contains information about an `` element {@link RNode}.\n */\n ElementContainer = 0b1000,\n\n /**\n * The TNode contains information about an `` projection\n */\n Projection = 0b10000,\n\n /**\n * The TNode contains information about an ICU comment used in `i18n`.\n */\n Icu = 0b100000,\n\n /**\n * Special node type representing a placeholder for future `TNode` at this location.\n *\n * I18n translation blocks are created before the element nodes which they contain. (I18n blocks\n * can span over many elements.) Because i18n `TNode`s (representing text) are created first they\n * often may need to point to element `TNode`s which are not yet created. In such a case we create\n * a `Placeholder` `TNode`. This allows the i18n to structurally link the `TNode`s together\n * without knowing any information about the future nodes which will be at that location.\n *\n * On `firstCreatePass` When element instruction executes it will try to create a `TNode` at that\n * location. Seeing a `Placeholder` `TNode` already there tells the system that it should reuse\n * existing `TNode` (rather than create a new one) and just update the missing information.\n */\n Placeholder = 0b1000000,\n\n /**\n * The TNode contains information about a `@let` declaration.\n */\n LetDeclaration = 0b10000000,\n\n // Combined Types These should never be used for `TNode.type` only as a useful way to check\n // if `TNode.type` is one of several choices.\n\n // See: https://github.com/microsoft/TypeScript/issues/35875 why we can't refer to existing enum.\n AnyRNode = 0b11, // Text | Element\n AnyContainer = 0b1100, // Container | ElementContainer\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nexport function toTNodeTypeAsString(tNodeType: TNodeType): string {\n let text = '';\n tNodeType & TNodeType.Text && (text += '|Text');\n tNodeType & TNodeType.Element && (text += '|Element');\n tNodeType & TNodeType.Container && (text += '|Container');\n tNodeType & TNodeType.ElementContainer && (text += '|ElementContainer');\n tNodeType & TNodeType.Projection && (text += '|Projection');\n tNodeType & TNodeType.Icu && (text += '|IcuContainer');\n tNodeType & TNodeType.Placeholder && (text += '|Placeholder');\n tNodeType & TNodeType.LetDeclaration && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\n\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nexport function isTNodeShape(value: unknown): value is TNode {\n return (\n value != null &&\n typeof value === 'object' &&\n ((value as TNode).insertBeforeIndex === null ||\n typeof (value as TNode).insertBeforeIndex === 'number' ||\n Array.isArray((value as TNode).insertBeforeIndex))\n );\n}\n\nexport function isLetDeclaration(tNode: TNode): boolean {\n return !!(tNode.type & TNodeType.LetDeclaration);\n}\n\n/**\n * Corresponds to the TNode.flags property.\n */\nexport const enum TNodeFlags {\n /** Bit #1 - This bit is set if the node is a host for any directive (including a component) */\n isDirectiveHost = 0x1,\n\n /** Bit #2 - This bit is set if the node has been projected */\n isProjected = 0x2,\n\n /** Bit #3 - This bit is set if any directive on this node has content queries */\n hasContentQuery = 0x4,\n\n /** Bit #4 - This bit is set if the node has any \"class\" inputs */\n hasClassInput = 0x8,\n\n /** Bit #5 - This bit is set if the node has any \"style\" inputs */\n hasStyleInput = 0x10,\n\n /** Bit #6 - This bit is set if the node has been detached by i18n */\n isDetached = 0x20,\n\n /**\n * Bit #7 - This bit is set if the node has directives with host bindings.\n *\n * This flags allows us to guard host-binding logic and invoke it only on nodes\n * that actually have directives with host bindings.\n */\n hasHostBindings = 0x40,\n\n /**\n * Bit #8 - This bit is set if the node is a located inside skip hydration block.\n */\n inSkipHydrationBlock = 0x80,\n\n /**\n * Bit #9 - This bit is set if the node is a start of a set of control flow blocks.\n */\n isControlFlowStart = 0x100,\n\n /**\n * Bit #10 - This bit is set if the node is within a set of control flow blocks.\n */\n isInControlFlow = 0x200,\n}\n\n/**\n * Corresponds to the TNode.providerIndexes property.\n */\nexport const enum TNodeProviderIndexes {\n /** The index of the first provider on this node is encoded on the least significant bits. */\n ProvidersStartIndexMask = 0b00000000000011111111111111111111,\n\n /**\n * The count of view providers from the component on this node is\n * encoded on the 20 most significant bits.\n */\n CptViewProvidersCountShift = 20,\n CptViewProvidersCountShifter = 0b00000000000100000000000000000000,\n}\n\n/**\n * A combination of:\n * - Attribute names and values.\n * - Special markers acting as flags to alter attributes processing.\n * - Parsed ngProjectAs selectors.\n */\nexport type TAttributes = (string | AttributeMarker | CssSelector)[];\n\n/**\n * Constants that are associated with a view. Includes:\n * - Attribute arrays.\n * - Local definition arrays.\n * - Translated messages (i18n).\n */\nexport type TConstants = (TAttributes | string)[];\n\n/**\n * Factory function that returns an array of consts. Consts can be represented as a function in\n * case any additional statements are required to define consts in the list. An example is i18n\n * where additional i18n calls are generated, which should be executed when consts are requested\n * for the first time.\n */\nexport type TConstantsFactory = () => TConstants;\n\n/**\n * TConstants type that describes how the `consts` field is generated on ComponentDef: it can be\n * either an array or a factory function that returns that array.\n */\nexport type TConstantsOrFactory = TConstants | TConstantsFactory;\n\n/**\n * Binding data (flyweight) for a particular node that is shared between all templates\n * of a specific type.\n *\n * If a property is:\n * - PropertyAliases: that property's data was generated and this is it\n * - Null: that property's data was already generated and nothing was found.\n * - Undefined: that property's data has not yet been generated\n *\n * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern\n */\nexport interface TNode {\n /** The type of the TNode. See TNodeType. */\n type: TNodeType;\n\n /**\n * Index of the TNode in TView.data and corresponding native element in LView.\n *\n * This is necessary to get from any TNode to its corresponding native element when\n * traversing the node tree.\n *\n * If index is -1, this is a dynamically created container node or embedded view node.\n */\n index: number;\n\n /**\n * Insert before existing DOM node index.\n *\n * When DOM nodes are being inserted, normally they are being appended as they are created.\n * Under i18n case, the translated text nodes are created ahead of time as part of the\n * `ɵɵi18nStart` instruction which means that this `TNode` can't just be appended and instead\n * needs to be inserted using `insertBeforeIndex` semantics.\n *\n * Additionally sometimes it is necessary to insert new text nodes as a child of this `TNode`. In\n * such a case the value stores an array of text nodes to insert.\n *\n * Example:\n * ```html\n *
\n * Hello World!\n *
\n * ```\n * In the above example the `ɵɵi18nStart` instruction can create `Hello `, `World` and `!` text\n * nodes. It can also insert `Hello ` and `!` text node as a child of `
`, but it can't\n * insert `World` because the `` node has not yet been created. In such a case the\n * `` `TNode` will have an array which will direct the `` to not only insert\n * itself in front of `!` but also to insert the `World` (created by `ɵɵi18nStart`) into\n * `` itself.\n *\n * Pseudo code:\n * ```ts\n * if (insertBeforeIndex === null) {\n * // append as normal\n * } else if (Array.isArray(insertBeforeIndex)) {\n * // First insert current `TNode` at correct location\n * const currentNode = lView[this.index];\n * parentNode.insertBefore(currentNode, lView[this.insertBeforeIndex[0]]);\n * // Now append all of the children\n * for(let i=1; i`\n * - a component is referenced, ex.: ``\n * - a directive is referenced, ex.: ``.\n *\n * A given element might have different local names and those names can be associated\n * with a directive. We store local names at even indexes while odd indexes are reserved\n * for directive index in a view (or `-1` if there is no associated directive).\n *\n * Some examples:\n * - `
` => `[\"foo\", -1]`\n * - `` => `[\"foo\", myCmptIdx]`\n * - `` => `[\"foo\", myCmptIdx, \"bar\", directiveIdx]`\n * - `
` => `[\"foo\", -1, \"bar\", directiveIdx]`\n */\n localNames: (string | number)[] | null;\n\n /** Information about input properties that need to be set once from attribute data. */\n initialInputs: InitialInputData | null;\n\n /**\n * Input data for all directives on this node. `null` means that there are no directives with\n * inputs on this node.\n */\n inputs: NodeInputBindings | null;\n\n /**\n * Input data for host directives applied to the node.\n */\n hostDirectiveInputs: HostDirectiveInputs | null;\n\n /**\n * Output data for all directives on this node. `null` means that there are no directives with\n * outputs on this node.\n */\n outputs: NodeOutputBindings | null;\n\n /**\n * Input data for host directives applied to the node.\n */\n hostDirectiveOutputs: HostDirectiveOutputs | null;\n\n /**\n * Mapping between directive classes applied to the node and their indexes.\n */\n directiveToIndex: DirectiveIndexMap | null;\n\n /**\n * The TView attached to this node.\n *\n * If this TNode corresponds to an LContainer with a template (e.g. structural\n * directive), the template's TView will be stored here.\n *\n * If this TNode corresponds to an element, tView will be `null`.\n */\n tView: TView | null;\n\n /**\n * The next sibling node. Necessary so we can propagate through the root nodes of a view\n * to insert them or remove them from the DOM.\n */\n next: TNode | null;\n\n /**\n * The previous sibling node.\n * This simplifies operations when we need a pointer to the previous node.\n */\n prev: TNode | null;\n\n /**\n * The next projected sibling. Since in Angular content projection works on the node-by-node\n * basis the act of projecting nodes might change nodes relationship at the insertion point\n * (target view). At the same time we need to keep initial relationship between nodes as\n * expressed in content view.\n */\n projectionNext: TNode | null;\n\n /**\n * First child of the current node.\n *\n * For component nodes, the child will always be a ContentChild (in same view).\n * For embedded view nodes, the child will be in their child view.\n */\n child: TNode | null;\n\n /**\n * Parent node (in the same view only).\n *\n * We need a reference to a node's parent so we can append the node to its parent's native\n * element at the appropriate time.\n *\n * If the parent would be in a different view (e.g. component host), this property will be null.\n * It's important that we don't try to cross component boundaries when retrieving the parent\n * because the parent will change (e.g. index, attrs) depending on where the component was\n * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through\n * LView.node instead (which will be instance-specific).\n *\n * If this is an inline view node (V), the parent will be its container.\n */\n parent: TElementNode | TContainerNode | null;\n\n /**\n * List of projected TNodes for a given component host element OR index into the said nodes.\n *\n * For easier discussion assume this example:\n * ``'s view definition:\n * ```html\n * content1\n * content2\n * ```\n * ``'s view definition:\n * ```html\n * \n * ```\n *\n * If `Array.isArray(projection)` then `TNode` is a host element:\n * - `projection` stores the content nodes which are to be projected.\n * - The nodes represent categories defined by the selector: For example:\n * `` would represent the heads for ``\n * and `` respectively.\n * - The nodes we store in `projection` are heads only, we used `.next` to get their\n * siblings.\n * - The nodes `.next` is sorted/rewritten as part of the projection setup.\n * - `projection` size is equal to the number of projections ``. The size of\n * `c1` will be `1` because `` has only one ``.\n * - we store `projection` with the host (`c1`, `c2`) rather than the `` (`cont1`)\n * because the same component (``) can be used in multiple locations (`c1`, `c2`) and\n * as a result have different set of nodes to project.\n * - without `projection` it would be difficult to efficiently traverse nodes to be projected.\n *\n * If `typeof projection == 'number'` then `TNode` is a `` element:\n * - `projection` is an index of the host's `projection`Nodes.\n * - This would return the first head node to project:\n * `getHost(currentTNode).projection[currentTNode.projection]`.\n * - When projecting nodes the parent node retrieved may be a `` node, in which case\n * the process is recursive in nature.\n *\n * If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as\n * projectable nodes during dynamic component creation.\n */\n projection: (TNode | RNode[])[] | number | null;\n\n /**\n * A collection of all `style` static values for an element (including from host).\n *\n * This field will be populated if and when:\n *\n * - There are one or more initial `style`s on an element (e.g. `
`)\n * - There are one or more initial `style`s on a directive/component host\n * (e.g. `@Directive({host: {style: \"width:200px;\" } }`)\n */\n styles: string | null;\n\n /**\n * A collection of all `style` static values for an element excluding host sources.\n *\n * Populated when there are one or more initial `style`s on an element\n * (e.g. `
`)\n * Must be stored separately from `tNode.styles` to facilitate setting directive\n * inputs that shadow the `style` property. If we used `tNode.styles` as is for shadowed inputs,\n * we would feed host styles back into directives as \"inputs\". If we used `tNode.attrs`, we\n * would have to concatenate the attributes on every template pass. Instead, we process once on\n * first create pass and store here.\n */\n stylesWithoutHost: string | null;\n\n /**\n * A `KeyValueArray` version of residual `styles`.\n *\n * When there are styling instructions than each instruction stores the static styling\n * which is of lower priority than itself. This means that there may be a higher priority\n * styling than the instruction.\n *\n * Imagine:\n * ```angular-ts\n *
\n *\n * @Directive({\n * host: {\n * style: 'color: lowest; ',\n * '[styles.color]': 'exp' // ɵɵstyleProp('color', ctx.exp);\n * }\n * })\n * ```\n *\n * In the above case:\n * - `color: lowest` is stored with `ɵɵstyleProp('color', ctx.exp);` instruction\n * - `color: highest` is the residual and is stored here.\n *\n * - `undefined': not initialized.\n * - `null`: initialized but `styles` is `null`\n * - `KeyValueArray`: parsed version of `styles`.\n */\n residualStyles: KeyValueArray | undefined | null;\n\n /**\n * A collection of all class static values for an element (including from host).\n *\n * This field will be populated if and when:\n *\n * - There are one or more initial classes on an element (e.g. `
`)\n * - There are one or more initial classes on an directive/component host\n * (e.g. `@Directive({host: {class: \"SOME_CLASS\" } }`)\n */\n classes: string | null;\n\n /**\n * A collection of all class static values for an element excluding host sources.\n *\n * Populated when there are one or more initial classes on an element\n * (e.g. `
`)\n * Must be stored separately from `tNode.classes` to facilitate setting directive\n * inputs that shadow the `class` property. If we used `tNode.classes` as is for shadowed\n * inputs, we would feed host classes back into directives as \"inputs\". If we used\n * `tNode.attrs`, we would have to concatenate the attributes on every template pass. Instead,\n * we process once on first create pass and store here.\n */\n classesWithoutHost: string | null;\n\n /**\n * A `KeyValueArray` version of residual `classes`.\n *\n * Same as `TNode.residualStyles` but for classes.\n *\n * - `undefined': not initialized.\n * - `null`: initialized but `classes` is `null`\n * - `KeyValueArray`: parsed version of `classes`.\n */\n residualClasses: KeyValueArray | undefined | null;\n\n /**\n * Stores the head/tail index of the class bindings.\n *\n * - If no bindings, the head and tail will both be 0.\n * - If there are template bindings, stores the head/tail of the class bindings in the template.\n * - If no template bindings but there are host bindings, the head value will point to the last\n * host binding for \"class\" (not the head of the linked list), tail will be 0.\n *\n * See: `style_binding_list.ts` for details.\n *\n * This is used by `insertTStylingBinding` to know where the next styling binding should be\n * inserted so that they can be sorted in priority order.\n */\n classBindings: TStylingRange;\n\n /**\n * Stores the head/tail index of the class bindings.\n *\n * - If no bindings, the head and tail will both be 0.\n * - If there are template bindings, stores the head/tail of the style bindings in the template.\n * - If no template bindings but there are host bindings, the head value will point to the last\n * host binding for \"style\" (not the head of the linked list), tail will be 0.\n *\n * See: `style_binding_list.ts` for details.\n *\n * This is used by `insertTStylingBinding` to know where the next styling binding should be\n * inserted so that they can be sorted in priority order.\n */\n styleBindings: TStylingRange;\n}\n\n/**\n * See `TNode.insertBeforeIndex`\n */\nexport type InsertBeforeIndex = null | number | number[];\n\n/** Static data for an element */\nexport interface TElementNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: TElementNode | TTextNode | TElementContainerNode | TContainerNode | TProjectionNode | null;\n /**\n * Element nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using viewData[HOST_NODE]).\n */\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n\n /**\n * If this is a component TNode with projection, this will be an array of projected\n * TNodes or native nodes (see TNode.projection for more info). If it's a regular element node\n * or a component without projection, it will be null.\n */\n projection: (TNode | RNode[])[] | null;\n\n /**\n * Stores TagName\n */\n value: string;\n}\n\n/** Static data for a text node */\nexport interface TTextNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: null;\n /**\n * Text nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n projection: null;\n}\n\n/** Static data for an LContainer */\nexport interface TContainerNode extends TNode {\n /**\n * Index in the data[] array.\n *\n * If it's -1, this is a dynamically created container node that isn't stored in\n * data[] (e.g. when you inject ViewContainerRef) .\n */\n index: number;\n child: null;\n\n /**\n * Container nodes will have parents unless:\n *\n * - They are the first node of a component or embedded view\n * - They are dynamically created\n */\n parent: TElementNode | TElementContainerNode | null;\n tView: TView | null;\n projection: null;\n value: null;\n}\n\n/** Static data for an */\nexport interface TElementContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode | TTextNode | TContainerNode | TElementContainerNode | TProjectionNode | null;\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n projection: null;\n}\n\n/** Static data for an ICU expression */\nexport interface TIcuContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: null;\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n projection: null;\n value: TIcu;\n}\n\n/** Static data for an LProjectionNode */\nexport interface TProjectionNode extends TNode {\n /** Index in the data[] array */\n child: null;\n /**\n * Projection nodes will have parents unless they are the first node of a component\n * or embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n\n /** Index of the projection node. (See TNode.projection for more info.) */\n projection: number;\n value: null;\n}\n\n/**\n * Static data for a `@let` declaration. This node is necessary, because the expression of a\n * `@let` declaration can contain code that uses the node injector (e.g. pipes). In order for\n * the node injector to work, it needs this `TNode`.\n */\nexport interface TLetDeclarationNode extends TNode {\n index: number;\n child: null;\n parent: TElementNode | TElementContainerNode | null;\n tView: null;\n projection: null;\n value: null; // TODO(crisbeto): capture the name here? Might come in handy for the dev tools.\n}\n\n/**\n * A union type representing all TNode types that can host a directive.\n */\nexport type TDirectiveHostNode = TElementNode | TContainerNode | TElementContainerNode;\n\n/**\n * Maps the public names of outputs available on a specific node to the index\n * of the directive instance that defines the output, for example:\n *\n * ```\n * {\n * \"publicName\": [0, 5]\n * }\n * ```\n */\nexport type NodeOutputBindings = Record;\n\n/**\n * Maps the public names of inputs applied to a specific node to the index of the\n * directive instance to which the input value should be written, for example:\n *\n * ```\n * {\n * \"publicName\": [0, 5]\n * }\n * ```\n */\nexport type NodeInputBindings = Record;\n\n/**\n * This array contains information about input properties that\n * need to be set once from attribute data. It's ordered by\n * directive index (relative to element) so it's simple to\n * look up a specific directive's initial input data.\n *\n * Within each sub-array:\n *\n * i+0: public name\n * i+1: initial value\n *\n * If a directive on a node does not have any input properties\n * that should be set from attributes, its index is set to null\n * to avoid a sparse array.\n *\n * e.g. [null, ['role-min', 'minified-input', 'button']]\n */\nexport type InitialInputData = (InitialInputs | null)[];\n\n/**\n * Used by InitialInputData to store input properties\n * that should be set once from attributes.\n *\n * i+0: attribute name\n * i+1: minified/internal input name\n * i+2: input flags\n * i+3: initial value\n *\n * e.g. ['role-min', 'minified-input', 'button']\n */\nexport type InitialInputs = string[];\n\n/**\n * Represents inputs coming from a host directive and exposed on a TNode.\n *\n * - The key is the public name of an input as it is exposed on the specific node.\n * - The value is an array where:\n * - i+0: Index of the host directive that should be written to.\n * - i+1: Public name of the input as it was defined on the host directive before aliasing.\n */\nexport type HostDirectiveInputs = Record;\n\n/**\n * Represents outputs coming from a host directive and exposed on a TNode.\n *\n * - The key is the public name of an output as it is exposed on the specific node.\n * - The value is an array where:\n * - i+0: Index of the host directive on which the output is defined..\n * - i+1: Public name of the output as it was defined on the host directive before aliasing.\n */\nexport type HostDirectiveOutputs = Record;\n\n/**\n * Represents a map between a class reference and the index at which its directive is available on\n * a specific TNode. The value can be either:\n * 1. A number means that there's only one selector-matched directive on the node and it\n * doesn't have any host directives.\n * 2. An array means that there's a selector-matched directive and it has host directives.\n * The array is structured as follows:\n * - 0: Index of the selector-matched directive.\n * - 1: Start index of the range within which the host directives are defined.\n * - 2: End of the host directive range.\n *\n * Example:\n * ```\n * Map {\n * [NoHostDirectives]: 5,\n * [HasHostDirectives]: [10, 6, 8],\n * }\n * ```\n */\nexport type DirectiveIndexMap = Map<\n Type,\n number | [directiveIndex: number, hostDirectivesStart: number, hostDirectivesEnd: number]\n>;\n\n/**\n * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.\n */\nexport type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;\n\n/**\n * Type for a function that extracts a value for a local refs.\n * Example:\n * - `
` - `nativeDivEl` should point to the native `
` element;\n * - `` - `tplRef` should point to the `TemplateRef` instance;\n */\nexport type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;\n\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```html\n *
\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nexport function hasClassInput(tNode: TNode) {\n return (tNode.flags & TNodeFlags.hasClassInput) !== 0;\n}\n\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```html\n *
\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nexport function hasStyleInput(tNode: TNode) {\n return (tNode.flags & TNodeFlags.hasStyleInput) !== 0;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertDefined, throwError} from '../util/assert';\nimport {TNode, TNodeType, toTNodeTypeAsString} from './interfaces/node';\n\nexport function assertTNodeType(\n tNode: TNode | null,\n expectedTypes: TNodeType,\n message?: string,\n): void {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(\n message ||\n `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(\n tNode.type,\n )}.`,\n );\n }\n}\n\nexport function assertPureTNodeType(type: TNodeType) {\n if (\n !(\n type === TNodeType.Element ||\n type === TNodeType.Text ||\n type === TNodeType.Container ||\n type === TNodeType.ElementContainer ||\n type === TNodeType.Icu ||\n type === TNodeType.Projection ||\n type === TNodeType.Placeholder ||\n type === TNodeType.LetDeclaration\n )\n ) {\n throwError(\n `Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(\n type,\n )}.`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {CharCode} from '../../util/char_code';\nimport {AttributeMarker} from '../interfaces/attribute_marker';\nimport {TAttributes} from '../interfaces/node';\nimport {CssSelector} from '../interfaces/projection';\nimport {Renderer} from '../interfaces/renderer';\nimport {RElement} from '../interfaces/renderer_dom';\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nexport function setUpAttributes(renderer: Renderer, native: RElement, attrs: TAttributes): number {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== AttributeMarker.NamespaceURI) {\n break;\n }\n\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n\n const namespaceURI = attrs[i++] as string;\n const attrName = attrs[i++] as string;\n const attrVal = attrs[i++] as string;\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n // attrName is string;\n const attrName = value as string;\n const attrVal = attrs[++i];\n // Standard attributes\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal as string);\n }\n i++;\n }\n }\n\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nexport function isNameOnlyAttributeMarker(marker: string | AttributeMarker | CssSelector) {\n return (\n marker === AttributeMarker.Bindings ||\n marker === AttributeMarker.Template ||\n marker === AttributeMarker.I18n\n );\n}\n\nexport function isAnimationProp(name: string): boolean {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === CharCode.AT_SIGN;\n}\n\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nexport function mergeHostAttrs(\n dst: TAttributes | null,\n src: TAttributes | null,\n): TAttributes | null {\n if (src === null || src.length === 0) {\n // do nothing\n } else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n } else {\n let srcMarker: AttributeMarker = AttributeMarker.ImplicitAttributes;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === AttributeMarker.NamespaceURI) {\n // Case where we need to consume `key1`, `key2`, `value` items.\n } else if (\n srcMarker === AttributeMarker.ImplicitAttributes ||\n srcMarker === AttributeMarker.Styles\n ) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item as string, null, src[++i] as string);\n } else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item as string, null, null);\n }\n }\n }\n }\n return dst;\n}\n\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nexport function mergeHostAttribute(\n dst: TAttributes,\n marker: AttributeMarker,\n key1: string,\n key2: string | null,\n value: string | null,\n): void {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === AttributeMarker.ImplicitAttributes) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n } else if (item === key1) {\n // We already have same token\n if (key2 === null) {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n } else if (key2 === dst[i + 1]) {\n dst[i + 2] = value!;\n return;\n }\n }\n // Increment counter.\n i++;\n if (key2 !== null) i++;\n if (value !== null) i++;\n }\n\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (key2 !== null) {\n dst.splice(i++, 0, key2);\n }\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {type Injector} from '../../di/injector';\nimport {assertGreaterThan, assertNotEqual, assertNumber} from '../../util/assert';\nimport {ChainedInjector} from '../chained_injector';\nimport {\n NO_PARENT_INJECTOR,\n RelativeInjectorLocation,\n RelativeInjectorLocationFlags,\n} from '../interfaces/injector';\nimport {DECLARATION_VIEW, HEADER_OFFSET, LView} from '../interfaces/view';\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nexport function hasParentInjector(parentLocation: RelativeInjectorLocation): boolean {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\n\nexport function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation as any, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask;\n\n assertGreaterThan(\n parentInjectorIndex,\n HEADER_OFFSET,\n 'Parent injector must be pointing past HEADER_OFFSET.',\n );\n }\n return parentLocation & RelativeInjectorLocationFlags.InjectorIndexMask;\n}\n\nexport function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number {\n return parentLocation >> RelativeInjectorLocationFlags.ViewOffsetShift;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nexport function getParentInjectorView(location: RelativeInjectorLocation, startView: LView): LView {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW]!;\n viewOffset--;\n }\n return parentView;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {isForwardRef, resolveForwardRef} from '../di/forward_ref';\nimport {injectRootLimpMode, setInjectImplementation} from '../di/inject_switch';\nimport {Injector} from '../di/injector';\nimport {BackwardsCompatibleInjector, convertToBitFlags} from '../di/injector_compatibility';\nimport {InjectorMarkers} from '../di/injector_marker';\nimport {InternalInjectFlags, InjectOptions} from '../di/interface/injector';\nimport {ProviderToken} from '../di/provider_token';\nimport {Type} from '../interface/type';\nimport {assertDefined, assertEqual, assertIndexInRange} from '../util/assert';\nimport {noSideEffects} from '../util/closure';\n\nimport {assertDirectiveDef, assertNodeInjector, assertTNodeForLView} from './assert';\nimport {\n emitInjectorToCreateInstanceEvent,\n emitInstanceCreatedByInjectorEvent,\n InjectorProfilerContext,\n runInInjectorProfilerContext,\n setInjectorProfilerContext,\n} from './debug/injector_profiler';\nimport {getFactoryDef} from './definition_factory';\nimport {throwCyclicDependencyError, throwProviderNotFoundError} from './errors_di';\nimport {NG_ELEMENT_ID, NG_FACTORY_DEF} from './fields';\nimport {registerPreOrderHooks} from './hooks';\nimport {AttributeMarker} from './interfaces/attribute_marker';\nimport {ComponentDef, DirectiveDef} from './interfaces/definition';\nimport {\n NO_PARENT_INJECTOR,\n NodeInjectorFactory,\n NodeInjectorOffset,\n RelativeInjectorLocation,\n RelativeInjectorLocationFlags,\n} from './interfaces/injector';\nimport {\n TContainerNode,\n TDirectiveHostNode,\n TElementContainerNode,\n TElementNode,\n TNode,\n TNodeProviderIndexes,\n TNodeType,\n} from './interfaces/node';\nimport {isComponentDef, isComponentHost, isRootView} from './interfaces/type_checks';\nimport {\n DECLARATION_COMPONENT_VIEW,\n DECLARATION_VIEW,\n EMBEDDED_VIEW_INJECTOR,\n FLAGS,\n INJECTOR,\n LView,\n LViewFlags,\n T_HOST,\n TData,\n TVIEW,\n TView,\n TViewType,\n} from './interfaces/view';\nimport {assertTNodeType} from './node_assert';\nimport {enterDI, getCurrentTNode, getLView, leaveDI} from './state';\nimport {isNameOnlyAttributeMarker} from './util/attrs_utils';\nimport {\n getParentInjectorIndex,\n getParentInjectorView,\n hasParentInjector,\n} from './util/injector_utils';\nimport {stringifyForError} from './util/stringify_utils';\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```ts\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\n\nexport function setIncludeViewProviders(v: boolean): boolean {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nexport function bloomAdd(\n injectorIndex: number,\n tView: TView,\n type: ProviderToken | string,\n): void {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id: number | undefined;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = (type as any)[NG_ELEMENT_ID];\n }\n\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = (type as any)[NG_ELEMENT_ID] = nextNgElementId++;\n }\n\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n (tView.data as number[])[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nexport function getOrCreateNodeInjectorForNode(\n tNode: TElementNode | TContainerNode | TElementContainerNode,\n lView: LView,\n): number {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data as any;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < NodeInjectorOffset.BLOOM_SIZE; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n\n lView[injectorIndex + NodeInjectorOffset.PARENT] = parentLoc;\n return injectorIndex;\n}\n\nfunction insertBloom(arr: any[], footer: TNode | null): void {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\n\nexport function getInjectorIndex(tNode: TNode, lView: LView): number {\n if (\n tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + NodeInjectorOffset.PARENT] === null\n ) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nexport function getParentInjectorLocation(tNode: TNode, lView: LView): RelativeInjectorLocation {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex as RelativeInjectorLocation; // ViewOffset is 0\n }\n\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode: TNode | null = null;\n let lViewCursor: LView | null = lView;\n\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode!, lViewCursor[DECLARATION_VIEW]!);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return (parentTNode.injectorIndex |\n (declarationViewOffset <<\n RelativeInjectorLocationFlags.ViewOffsetShift)) as RelativeInjectorLocation;\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nexport function diPublicInInjector(\n injectorIndex: number,\n tView: TView,\n token: ProviderToken,\n): void {\n bloomAdd(injectorIndex, tView, token);\n}\n\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```ts\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```html\n * \n * ```\n *\n * Then factory method generated is:\n * ```ts\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nexport function injectAttributeImpl(tNode: TNode, attrNameToInject: string): string | null {\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyContainer | TNodeType.AnyRNode);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value)) break;\n\n // Skip namespaced attributes\n if (value === AttributeMarker.NamespaceURI) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n } else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1] as string;\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\n\nfunction notFoundValueOrThrow(\n notFoundValue: T | null,\n token: ProviderToken,\n flags: InternalInjectFlags,\n): T | null {\n if (flags & InternalInjectFlags.Optional || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(\n lView: LView,\n token: ProviderToken,\n flags: InternalInjectFlags,\n notFoundValue?: any,\n): T | null {\n if (flags & InternalInjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n\n if ((flags & (InternalInjectFlags.Self | InternalInjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return (moduleInjector as BackwardsCompatibleInjector).get(\n token,\n notFoundValue,\n flags & InternalInjectFlags.Optional,\n );\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InternalInjectFlags.Optional);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nexport function getOrCreateInjectable(\n tNode: TDirectiveHostNode | null,\n lView: LView,\n token: ProviderToken,\n flags: InternalInjectFlags = InternalInjectFlags.Default,\n notFoundValue?: any,\n): T | null {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (\n lView[FLAGS] & LViewFlags.HasEmbeddedViewInjector &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & InternalInjectFlags.Self)\n ) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(\n tNode,\n lView,\n token,\n flags,\n NOT_FOUND,\n );\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(\n tNode: TDirectiveHostNode,\n lView: LView,\n token: ProviderToken,\n flags: InternalInjectFlags,\n notFoundValue?: any,\n) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & InternalInjectFlags.Host\n ? notFoundValueOrThrow(notFoundValue, token, flags)\n : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value: unknown;\n\n if (ngDevMode) {\n runInInjectorProfilerContext(\n new NodeInjector(getCurrentTNode() as TElementNode, getLView()),\n token as Type,\n () => {\n emitInjectorToCreateInstanceEvent(token);\n value = bloomHash(flags);\n emitInstanceCreatedByInjectorEvent(value);\n },\n );\n } else {\n value = bloomHash(flags);\n }\n\n if (value == null && !(flags & InternalInjectFlags.Optional)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView: TView | null = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode: TNode | null =\n flags & InternalInjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & InternalInjectFlags.SkipSelf) {\n parentLocation =\n injectorIndex === -1\n ? getParentInjectorLocation(tNode, lView)\n : lView[injectorIndex + NodeInjectorOffset.PARENT];\n\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode &&\n assertTNodeForLView(tView.data[injectorIndex + NodeInjectorOffset.TNODE] as TNode, lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance: T | {} | null = searchTokensOnInjector(\n injectorIndex,\n lView,\n token,\n previousTView,\n flags,\n hostTElementNode,\n );\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + NodeInjectorOffset.PARENT];\n if (\n parentLocation !== NO_PARENT_INJECTOR &&\n shouldSearchParent(\n flags,\n lView[TVIEW].data[injectorIndex + NodeInjectorOffset.TNODE] === hostTElementNode,\n ) &&\n bloomHasToken(bloomHash, injectorIndex, lView)\n ) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n\n return notFoundValue;\n}\n\nfunction searchTokensOnInjector(\n injectorIndex: number,\n lView: LView,\n token: ProviderToken,\n previousTView: TView | null,\n flags: InternalInjectFlags,\n hostTElementNode: TNode | null,\n) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + NodeInjectorOffset.TNODE] as TNode;\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders =\n previousTView == null\n ? // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders\n : // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & TNodeType.AnyRNode) !== 0;\n\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & InternalInjectFlags.Host && hostTElementNode === tNode;\n\n const injectableIdx = locateDirectiveOrProvider(\n tNode,\n currentTView,\n token,\n canAccessViewProviders,\n isHostSpecialCase,\n );\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode as TElementNode);\n } else {\n return NOT_FOUND;\n }\n}\n\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nexport function locateDirectiveOrProvider(\n tNode: TNode,\n tView: TView,\n token: ProviderToken | string,\n canAccessViewProviders: boolean,\n isHostSpecialCase: boolean | number,\n): number | null {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n\n const injectablesStart = nodeProviderIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount =\n nodeProviderIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n const startingIndex = canAccessViewProviders\n ? injectablesStart\n : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i] as ProviderToken | DirectiveDef | string;\n if (\n (i < directivesStart && token === providerTokenOrDef) ||\n (i >= directivesStart && (providerTokenOrDef as DirectiveDef).type === token)\n ) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart] as DirectiveDef;\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nexport function getNodeInjectable(\n lView: LView,\n tView: TView,\n index: number,\n tNode: TDirectiveHostNode,\n): any {\n let value = lView[index];\n const tData = tView.data;\n if (value instanceof NodeInjectorFactory) {\n const factory: NodeInjectorFactory = value;\n if (factory.resolving) {\n throwCyclicDependencyError(stringifyForError(tData[index]));\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instance itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token =\n (tData[index] as DirectiveDef | ComponentDef).type || tData[index];\n\n let prevInjectContext: InjectorProfilerContext | undefined;\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({injector, token});\n }\n\n const previousInjectImplementation = factory.injectImpl\n ? setInjectImplementation(factory.injectImpl)\n : null;\n const success = enterDI(lView, tNode, InternalInjectFlags.Default);\n ngDevMode &&\n assertEqual(\n success,\n true,\n \"Because flags do not contain `SkipSelf' we expect this to always succeed.\",\n );\n try {\n ngDevMode && emitInjectorToCreateInstanceEvent(token);\n\n value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index] as DirectiveDef, tView);\n }\n } finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext!);\n\n previousInjectImplementation !== null &&\n setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n }\n }\n return value;\n}\n\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nexport function bloomHashBitOrFactory(\n token: ProviderToken | string,\n): number | Function | undefined {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId: number | undefined =\n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? (token as any)[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode &&\n assertEqual(tokenId, InjectorMarkers.Injector, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\n\nexport function bloomHasToken(\n bloomHash: number,\n injectorIndex: number,\n injectorView: LView | TData,\n) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(\n flags: InternalInjectFlags,\n isFirstHostTNode: boolean,\n): boolean | number {\n return (\n !(flags & InternalInjectFlags.Self) && !(flags & InternalInjectFlags.Host && isFirstHostTNode)\n );\n}\n\nexport function getNodeInjectorLView(nodeInjector: NodeInjector): LView {\n return (nodeInjector as any)._lView as LView;\n}\n\nexport function getNodeInjectorTNode(\n nodeInjector: NodeInjector,\n): TElementNode | TContainerNode | TElementContainerNode | null {\n return (nodeInjector as any)._tNode as\n | TElementNode\n | TContainerNode\n | TElementContainerNode\n | null;\n}\n\nexport class NodeInjector implements Injector {\n constructor(\n private _tNode: TElementNode | TContainerNode | TElementContainerNode | null,\n private _lView: LView,\n ) {}\n\n get(token: any, notFoundValue?: any, flags?: InternalInjectFlags | InjectOptions): any {\n return getOrCreateInjectable(\n this._tNode,\n this._lView,\n token,\n convertToBitFlags(flags),\n notFoundValue,\n );\n }\n}\n\n/** Creates a `NodeInjector` for the current node. */\nexport function createNodeInjector(): Injector {\n return new NodeInjector(getCurrentTNode()! as TDirectiveHostNode, getLView()) as any;\n}\n\n/**\n * @codeGenApi\n */\nexport function ɵɵgetInheritedFactory(type: Type): (type: Type) => T {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n\n parent = Object.getPrototypeOf(parent);\n }\n\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return (t: Type) => new t();\n });\n}\n\nfunction getFactoryOf(type: Type): ((type?: Type) => T | null) | null {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(\n tNode: TDirectiveHostNode,\n lView: LView,\n token: ProviderToken,\n flags: InternalInjectFlags,\n notFoundValue?: any,\n) {\n let currentTNode: TDirectiveHostNode | null = tNode;\n let currentLView: LView | null = lView;\n\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (\n currentTNode !== null &&\n currentLView !== null &&\n currentLView[FLAGS] & LViewFlags.HasEmbeddedViewInjector &&\n !isRootView(currentLView)\n ) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(\n currentTNode,\n currentLView,\n token,\n flags | InternalInjectFlags.Self,\n NOT_FOUND,\n );\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode: TElementNode | TContainerNode | null = currentTNode.parent;\n\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = (embeddedViewInjector as BackwardsCompatibleInjector).get(\n token,\n NOT_FOUND as T | {},\n flags,\n );\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n\n currentTNode = parentTNode;\n }\n\n return notFoundValue;\n}\n\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView: LView): TElementNode | TElementContainerNode | null {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n\n // The parent pointer differs based on `TView.type`.\n if (tViewType === TViewType.Embedded) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode as TElementContainerNode;\n } else if (tViewType === TViewType.Component) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST] as TElementNode;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {injectAttributeImpl} from '../di';\nimport {getCurrentTNode} from '../state';\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nexport function ɵɵinjectAttribute(attrNameToInject: string): string | null {\n return injectAttributeImpl(getCurrentTNode()!, attrNameToInject);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ɵɵinjectAttribute} from '../render3/instructions/di_attr';\nimport {makeParamDecorator} from '../util/decorators';\n\n/**\n * Type of the Attribute decorator / constructor function.\n *\n * @publicApi\n */\nexport interface AttributeDecorator {\n /**\n * Parameter decorator for a directive constructor that designates\n * a host-element attribute whose value is injected as a constant string literal.\n *\n * @usageNotes\n *\n * Suppose we have an `` element and want to know its `type`.\n *\n * ```html\n * \n * ```\n *\n * The following example uses the decorator to inject the string literal `text` in a directive.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * The following example uses the decorator in a component constructor.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeFactory'}\n *\n */\n (name: string): any;\n new (name: string): Attribute;\n}\n\n/**\n * Type of the Attribute metadata.\n *\n * @publicApi\n */\nexport interface Attribute {\n /**\n * The name of the attribute whose value can be injected.\n */\n attributeName: string;\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Attribute: AttributeDecorator = makeParamDecorator(\n 'Attribute',\n (attributeName?: string) => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName!),\n }),\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {R3DependencyMetadataFacade} from '../../compiler/compiler_facade';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Type} from '../../interface/type';\nimport {ReflectionCapabilities} from '../../reflection/reflection_capabilities';\nimport {Host, Inject, Optional, Self, SkipSelf} from '../metadata';\nimport {Attribute} from '../metadata_attr';\n\nlet _reflect: ReflectionCapabilities | null = null;\n\nexport function getReflect(): ReflectionCapabilities {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\n\nexport function reflectDependencies(type: Type): R3DependencyMetadataFacade[] {\n return convertDependencies(getReflect().parameters(type));\n}\n\nexport function convertDependencies(deps: any[]): R3DependencyMetadataFacade[] {\n return deps.map((dep) => reflectDependency(dep));\n}\n\nfunction reflectDependency(dep: any | any[]): R3DependencyMetadataFacade {\n const meta: R3DependencyMetadataFacade = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false,\n };\n\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n\n const proto = Object.getPrototypeOf(param);\n\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode && `Attribute name must be defined.`,\n );\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n getCompilerFacade,\n JitCompilerUsage,\n R3InjectableMetadataFacade,\n} from '../../compiler/compiler_facade';\nimport {Type} from '../../interface/type';\nimport {NG_FACTORY_DEF} from '../../render3/fields';\nimport {getClosureSafeProperty} from '../../util/property';\nimport {resolveForwardRef} from '../forward_ref';\nimport type {Injectable} from '../injectable';\nimport {NG_PROV_DEF} from '../interface/defs';\nimport {\n ClassSansProvider,\n ExistingSansProvider,\n FactorySansProvider,\n ValueProvider,\n ValueSansProvider,\n} from '../interface/provider';\n\nimport {angularCoreDiEnv} from './environment';\nimport {convertDependencies, reflectDependencies} from './util';\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nexport function compileInjectable(type: Type, meta?: Injectable): void {\n let ngInjectableDef: any = null;\n let ngFactoryDef: any = null;\n\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: JitCompilerUsage.Decorator,\n kind: 'injectable',\n type,\n });\n ngInjectableDef = compiler.compileInjectable(\n angularCoreDiEnv,\n `ng:///${type.name}/ɵprov.js`,\n getInjectableMetadata(type, meta),\n );\n }\n return ngInjectableDef;\n },\n });\n }\n\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: JitCompilerUsage.Decorator,\n kind: 'injectable',\n type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0, // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable,\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true,\n });\n }\n}\n\ntype UseClassProvider = Injectable & ClassSansProvider & {deps?: any[]};\n\nconst USE_VALUE = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty,\n});\n\nfunction isUseClassProvider(meta: Injectable): meta is UseClassProvider {\n return (meta as UseClassProvider).useClass !== undefined;\n}\n\nfunction isUseValueProvider(meta: Injectable): meta is Injectable & ValueSansProvider {\n return USE_VALUE in meta;\n}\n\nfunction isUseFactoryProvider(meta: Injectable): meta is Injectable & FactorySansProvider {\n return (meta as FactorySansProvider).useFactory !== undefined;\n}\n\nfunction isUseExistingProvider(meta: Injectable): meta is Injectable & ExistingSansProvider {\n return (meta as ExistingSansProvider).useExisting !== undefined;\n}\n\nfunction getInjectableMetadata(type: Type, srcMeta?: Injectable): R3InjectableMetadataFacade {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta: Injectable = srcMeta || {providedIn: null};\n const compilerMeta: R3InjectableMetadataFacade = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn,\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Type} from '../interface/type';\nimport {makeDecorator, TypeDecorator} from '../util/decorators';\n\nimport {\n ClassSansProvider,\n ConstructorSansProvider,\n ExistingSansProvider,\n FactorySansProvider,\n StaticClassSansProvider,\n ValueSansProvider,\n} from './interface/provider';\nimport {compileInjectable} from './jit/injectable';\n\nexport {compileInjectable};\n\n/**\n * Injectable providers used in `@Injectable` decorator.\n *\n * @publicApi\n */\nexport type InjectableProvider =\n | ValueSansProvider\n | ExistingSansProvider\n | StaticClassSansProvider\n | ConstructorSansProvider\n | FactorySansProvider\n | ClassSansProvider;\n\n/**\n * Type of the Injectable decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectableDecorator {\n /**\n * Decorator that marks a class as available to be\n * provided and injected as a dependency.\n *\n * @see [Introduction to Services and DI](guide/di)\n * @see [Dependency Injection Guide](guide/di/dependency-injection\n *\n * @usageNotes\n *\n * Marking a class with `@Injectable` ensures that the compiler\n * will generate the necessary metadata to create the class's\n * dependencies when the class is injected.\n *\n * The following example shows how a service class is properly\n * marked so that a supporting service can be injected upon creation.\n *\n * {@example core/di/ts/metadata_spec.ts region='Injectable'}\n *\n */\n (): TypeDecorator;\n (\n options?: {providedIn: Type | 'root' | 'platform' | 'any' | null} & InjectableProvider,\n ): TypeDecorator;\n new (): Injectable;\n new (\n options?: {providedIn: Type | 'root' | 'platform' | 'any' | null} & InjectableProvider,\n ): Injectable;\n}\n\n/**\n * Type of the Injectable metadata.\n *\n * @publicApi\n */\nexport interface Injectable {\n /**\n * Determines which injectors will provide the injectable.\n *\n * - `Type` - associates the injectable with an `@NgModule` or other `InjectorType`. This\n * option is DEPRECATED.\n * - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically\n * and must be added to a `providers` array of an [@NgModule](api/core/NgModule#providers),\n * [@Component](api/core/Directive#providers) or [@Directive](api/core/Directive#providers).\n *\n * The following options specify that this injectable should be provided in one of the following\n * injectors:\n * - 'root' : The application-level injector in most apps.\n * - 'platform' : A special singleton platform injector shared by all\n * applications on the page.\n * - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded\n * modules share one instance. This option is DEPRECATED.\n *\n */\n providedIn?: Type | 'root' | 'platform' | 'any' | null;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Injectable: InjectableDecorator = makeDecorator(\n 'Injectable',\n undefined,\n undefined,\n undefined,\n (type: Type, meta: Injectable) => compileInjectable(type as any, meta),\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {TNode} from '../render3/interfaces/node';\nimport {RElement} from '../render3/interfaces/renderer_dom';\nimport {LView} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getNativeByTNode} from '../render3/util/view_utils';\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nexport function injectElementRef(): ElementRef {\n return createElementRef(getCurrentTNode()!, getLView());\n}\n\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nexport function createElementRef(tNode: TNode, lView: LView): ElementRef {\n return new ElementRef(getNativeByTNode(tNode, lView) as RElement);\n}\n\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nexport class ElementRef {\n /**\n *
\n *
Use with caution
\n *

\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. If used, it is recommended in combination with\n * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}\n * for maxiumum security;\n *

\n *
\n */\n public nativeElement: T;\n\n constructor(nativeElement: T) {\n this.nativeElement = nativeElement;\n }\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: () => ElementRef = injectElementRef;\n}\n\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nexport function unwrapElementRef(value: T | ElementRef): T | R {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Observable, Subject} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {Writable} from '../interface/type';\nimport {arrayEquals, flatten} from '../util/array_utils';\n\nfunction symbolIterator(this: QueryList): Iterator {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```ts\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList;\n * }\n * ```\n *\n * @publicApi\n */\nexport class QueryList implements Iterable {\n public readonly dirty = true;\n private _onDirty?: () => void = undefined;\n private _results: Array = [];\n private _changesDetected: boolean = false;\n private _changes: Subject> | undefined = undefined;\n\n readonly length: number = 0;\n readonly first: T = undefined!;\n readonly last: T = undefined!;\n\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes(): Observable {\n return (this._changes ??= new Subject());\n }\n\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(private _emitDistinctChangesOnly: boolean = false) {}\n\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index: number): T | undefined {\n return this._results[index];\n }\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn: (item: T, index: number, array: T[]) => U): U[] {\n return this._results.map(fn);\n }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(predicate: (value: T, index: number, array: readonly T[]) => value is S): S[];\n filter(predicate: (value: T, index: number, array: readonly T[]) => unknown): T[];\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T | undefined {\n return this._results.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void {\n this._results.forEach(fn);\n }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray(): T[] {\n return this._results.slice();\n }\n\n toString(): string {\n return this._results.toString();\n }\n\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree: Array, identityAccessor?: (value: T) => unknown): void {\n (this as {dirty: boolean}).dirty = false;\n const newResultFlat = flatten(resultsTree);\n if ((this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor))) {\n this._results = newResultFlat;\n (this as Writable).length = newResultFlat.length;\n (this as Writable).last = newResultFlat[this.length - 1];\n (this as Writable).first = newResultFlat[0];\n }\n }\n\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges(): void {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))\n this._changes.next(this);\n }\n\n /** @internal */\n onDirty(cb: () => void) {\n this._onDirty = cb;\n }\n\n /** internal */\n setDirty() {\n (this as {dirty: boolean}).dirty = true;\n this._onDirty?.();\n }\n\n /** internal */\n destroy(): void {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n\n [Symbol.iterator]: () => Iterator = /** @__PURE__*/ (() => symbolIterator)();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {TNode, TNodeFlags} from '../render3/interfaces/node';\nimport {RElement} from '../render3/interfaces/renderer_dom';\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nexport const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nexport function hasSkipHydrationAttrOnTNode(tNode: TNode): boolean {\n const attrs = tNode.mergedAttrs;\n if (attrs === null) return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number') return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nexport function hasSkipHydrationAttrOnRElement(rNode: RElement): boolean {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nexport function hasInSkipHydrationBlockFlag(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.inSkipHydrationBlock) === TNodeFlags.inSkipHydrationBlock;\n}\n\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nexport function isInSkipHydrationBlock(tNode: TNode): boolean {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode: TNode | null = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n\n/**\n * Check if an i18n block is in a skip hydration section by looking at a parent TNode\n * to determine if this TNode is in a skip hydration section or the TNode has\n * the `ngSkipHydration` attribute.\n */\nexport function isI18nInSkipHydrationBlock(parentTNode: TNode): boolean {\n return (\n hasInSkipHydrationBlockFlag(parentTNode) ||\n hasSkipHydrationAttrOnTNode(parentTNode) ||\n isInSkipHydrationBlock(parentTNode)\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}\n * @see {@link /best-practices/skipping-subtrees Skipping component subtrees}\n *\n * @publicApi\n */\nexport enum ChangeDetectionStrategy {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n OnPush = 0,\n\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n Default = 1,\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertNumber} from '../../util/assert';\n\nimport {ID, LView} from './view';\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map();\n\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n\n/** Gets a unique ID that can be assigned to an LView. */\nexport function getUniqueLViewId(): number {\n return uniqueIdCounter++;\n}\n\n/** Starts tracking an LView. */\nexport function registerLView(lView: LView): void {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n\n/** Gets an LView by its unique ID. */\nexport function getLViewById(id: number): LView | null {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n\n/** Stops tracking an LView. */\nexport function unregisterLView(lView: LView): void {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n\n/** Gets the currently-tracked views. */\nexport function getTrackedLViews(): ReadonlyMap {\n return TRACKED_LVIEWS;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {getLViewById} from './lview_tracking';\nimport {RNode} from './renderer_dom';\nimport {LView} from './view';\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nexport class LContext {\n /**\n * The instance of the Component node.\n */\n public component: {} | null | undefined;\n\n /**\n * The list of active directives that exist on this element.\n */\n public directives: any[] | null | undefined;\n\n /**\n * The map of local references (local reference name => element or directive instance) that\n * exist on this element.\n */\n public localRefs: {[key: string]: any} | null | undefined;\n\n /** Component's parent view data. */\n get lView(): LView | null {\n return getLViewById(this.lViewId);\n }\n\n constructor(\n /**\n * ID of the component's parent view data.\n */\n private lViewId: number,\n\n /**\n * The index instance of the node.\n */\n public nodeIndex: number,\n\n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n public native: RNode,\n ) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport '../util/ng_dev_mode';\n\nimport {assertDefined, assertDomNode} from '../util/assert';\nimport {EMPTY_ARRAY} from '../util/empty';\n\nimport {assertLView} from './assert';\nimport {LContext} from './interfaces/context';\nimport {getLViewById, registerLView} from './interfaces/lview_tracking';\nimport {TNode} from './interfaces/node';\nimport {RElement, RNode} from './interfaces/renderer_dom';\nimport {isComponentHost, isLView} from './interfaces/type_checks';\nimport {CONTEXT, HEADER_OFFSET, HOST, ID, LView, TVIEW} from './interfaces/view';\nimport {getComponentLViewByIndex, unwrapRNode} from './util/view_utils';\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nexport function getLContext(target: any): LContext | null {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView: LView = mpValue!;\n let nodeIndex: number;\n let component: any = undefined;\n let directives: any[] | null | undefined = undefined;\n\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n } else {\n nodeIndex = findViaNativeElement(lView, target as RElement);\n if (nodeIndex == -1) {\n return null;\n }\n }\n\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context: LContext =\n existingCtx && !Array.isArray(existingCtx)\n ? existingCtx\n : createLContext(lView, nodeIndex, native);\n\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target as RElement;\n ngDevMode && assertDomNode(rElement);\n\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement as any;\n while ((parent = parent.parentNode)) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? (parentContext as LView) : parentContext.lView;\n\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return (mpValue as LContext) || null;\n}\n\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView: LView, nodeIndex: number, native: RNode): LContext {\n return new LContext(lView[ID], nodeIndex, native);\n}\n\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nexport function getComponentViewByInstance(componentInstance: {}): LView {\n let patchedData = readPatchedData(componentInstance);\n let lView: LView;\n\n if (isLView(patchedData)) {\n const contextLView: LView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST] as RElement);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = patchedData as unknown as LContext;\n const contextLView = context.lView!;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\n\nexport function attachLViewId(target: any, data: LView) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n}\n\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nexport function readLView(target: any): LView | null {\n const data = readPatchedData(target);\n if (isLView(data)) {\n return data;\n }\n return data ? data.lView : null;\n}\n\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nexport function attachPatchData(target: any, data: LView | LContext) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n } else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nexport function readPatchedData(target: any): LView | LContext | null {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\n\nexport function readPatchedLView(target: any): LView | null {\n const value = readPatchedData(target);\n if (value) {\n return (isLView(value) ? value : value.lView) as LView;\n }\n return null;\n}\n\nexport function isComponentInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\n\nexport function isDirectiveInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView: LView, target: RElement): number {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode: TNode): TNode | null {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template:
text
\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView: LView, componentInstance: {}): number {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView: LView, directiveInstance: {}): number {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nexport function getDirectivesAtNodeIndex(nodeIndex: number, lView: LView): any[] | null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode.directiveStart === 0) return EMPTY_ARRAY;\n const results: any[] = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\n\nexport function getComponentAtNodeIndex(nodeIndex: number, lView: LView): {} | null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n return isComponentHost(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null;\n}\n\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nexport function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: string]: any} | null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode && tNode.localNames) {\n const result: {[key: string]: any} = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertDefined} from '../../util/assert';\nimport {assertLView} from '../assert';\nimport {readPatchedLView} from '../context_discovery';\nimport {LContainer} from '../interfaces/container';\nimport {isLContainer, isLView, isRootView} from '../interfaces/type_checks';\nimport {CHILD_HEAD, CONTEXT, LView, NEXT} from '../interfaces/view';\n\nimport {getLViewParent} from './view_utils';\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nexport function getRootView(componentOrLView: LView | {}): LView {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView)!;\n while (lView && !isRootView(lView)) {\n lView = getLViewParent(lView)!;\n }\n ngDevMode && assertLView(lView);\n return lView as LView;\n}\n\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nexport function getRootContext(viewOrComponent: LView | {}): T {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT] as T;\n}\n\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nexport function getFirstLContainer(lView: LView): LContainer | null {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nexport function getNextLContainer(container: LContainer): LContainer | null {\n return getNearestLContainer(container[NEXT]);\n}\n\nfunction getNearestLContainer(viewOrContainer: LContainer | LView | null) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer as LContainer | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectionStrategy} from '../../change_detection/constants';\nimport {Injector} from '../../di/injector';\nimport {ViewEncapsulation} from '../../metadata/view';\nimport {assertLView} from '../assert';\nimport {\n discoverLocalRefs,\n getComponentAtNodeIndex,\n getDirectivesAtNodeIndex,\n getLContext,\n readPatchedLView,\n} from '../context_discovery';\nimport {getComponentDef, getDirectiveDef} from '../def_getters';\nimport {NodeInjector} from '../di';\nimport {DirectiveDef} from '../interfaces/definition';\nimport {TElementNode, TNode, TNodeProviderIndexes} from '../interfaces/node';\nimport {isRootView} from '../interfaces/type_checks';\nimport {CLEANUP, CONTEXT, LView, TVIEW, TViewType} from '../interfaces/view';\n\nimport {getRootContext} from './view_traversal_utils';\nimport {getLViewParent, unwrapRNode} from './view_utils';\n\n/**\n * Retrieves the component instance associated with a given DOM element.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * \n *
\n * \n *
\n *
\n * ```\n *\n * Calling `getComponent` on `` will return the instance of `ChildComponent`\n * associated with this DOM element.\n *\n * Calling the function on `` will return the `MyApp` instance.\n *\n *\n * @param element DOM element from which the component should be retrieved.\n * @returns Component instance associated with the element or `null` if there\n * is no component associated with it.\n *\n * @publicApi\n */\nexport function getComponent(element: Element): T | null {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null) return null;\n\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n\n return context.component as unknown as T;\n}\n\n/**\n * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n * view that the element is part of. Otherwise retrieves the instance of the component whose view\n * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n *\n * @param element Element for which to get the surrounding component instance.\n * @returns Instance of the component that is around the element or null if the element isn't\n * inside any component.\n *\n * @publicApi\n */\nexport function getContext(element: Element): T | null {\n assertDomElement(element);\n const context = getLContext(element)!;\n const lView = context ? context.lView : null;\n return lView === null ? null : (lView[CONTEXT] as T);\n}\n\n/**\n * Retrieves the component instance whose view contains the DOM element.\n *\n * For example, if `` is used in the template of ``\n * (i.e. a `ViewChild` of ``), calling `getOwningComponent` on ``\n * would return ``.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Component instance whose view owns the DOM element or null if the element is not\n * part of a component view.\n *\n * @publicApi\n */\nexport function getOwningComponent(elementOrDir: Element | {}): T | null {\n const context = getLContext(elementOrDir)!;\n let lView = context ? context.lView : null;\n if (lView === null) return null;\n\n let parent: LView | null;\n while (lView[TVIEW].type === TViewType.Embedded && (parent = getLViewParent(lView)!)) {\n lView = parent;\n }\n return isRootView(lView) ? null : (lView[CONTEXT] as unknown as T);\n}\n\n/**\n * Retrieves all root components associated with a DOM element, directive or component instance.\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Root components associated with the target object.\n *\n * @publicApi\n */\nexport function getRootComponents(elementOrDir: Element | {}): {}[] {\n const lView = readPatchedLView<{}>(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\n\n/**\n * Retrieves an `Injector` associated with an element, component or directive instance.\n *\n * @param elementOrDir DOM element, component or directive instance for which to\n * retrieve the injector.\n * @returns Injector associated with the element, component or directive instance.\n *\n * @publicApi\n */\nexport function getInjector(elementOrDir: Element | {}): Injector {\n const context = getLContext(elementOrDir)!;\n const lView = context ? context.lView : null;\n if (lView === null) return Injector.NULL;\n\n const tNode = lView[TVIEW].data[context.nodeIndex] as TElementNode;\n return new NodeInjector(tNode, lView);\n}\n\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n */\nexport function getInjectionTokens(element: Element): any[] {\n const context = getLContext(element)!;\n const lView = context ? context.lView : null;\n if (lView === null) return [];\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex] as TNode;\n const providerTokens: any[] = [];\n const startIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n\n/**\n * Retrieves directive instances associated with a given DOM node. Does not include\n * component instances.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * \n * \n * \n * \n * ```\n *\n * Calling `getDirectives` on `