{"version":3,"file":"static.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/component_info.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/util.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_component_adapter.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/promise_util.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_component.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_injectable.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/security/trusted_types.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/upgrade_helper.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/angular1_providers.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/util.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/downgrade_module.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/upgrade_component.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/upgrade_module.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 * A `PropertyBinding` represents a mapping between a property name\n * and an attribute name. It is parsed from a string of the form\n * `\"prop: attr\"`; or simply `\"propAndAttr\" where the property\n * and attribute have the same identifier.\n */\nexport class PropertyBinding {\n  bracketAttr: string;\n  bracketParenAttr: string;\n  parenAttr: string;\n  onAttr: string;\n  bindAttr: string;\n  bindonAttr: string;\n\n  constructor(\n    public prop: string,\n    public attr: string,\n  ) {\n    this.bracketAttr = `[${this.attr}]`;\n    this.parenAttr = `(${this.attr})`;\n    this.bracketParenAttr = `[(${this.attr})]`;\n    const capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.slice(1);\n    this.onAttr = `on${capitalAttr}`;\n    this.bindAttr = `bind${capitalAttr}`;\n    this.bindonAttr = `bindon${capitalAttr}`;\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 {Injector, Type, ɵNG_MOD_DEF} from '@angular/core';\n\nimport {\n  element as angularElement,\n  IAugmentedJQuery,\n  IInjectorService,\n  INgModelController,\n  IRootScopeService,\n} from './angular1';\nimport {\n  $ROOT_ELEMENT,\n  $ROOT_SCOPE,\n  DOWNGRADED_MODULE_COUNT_KEY,\n  UPGRADE_APP_TYPE_KEY,\n} from './constants';\n\nconst DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\nconst DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n\nexport function onError(e: any) {\n  // TODO: (misko): We seem to not have a stack trace here!\n  console.error(e, e.stack);\n  throw e;\n}\n\n/**\n * Clean the jqLite/jQuery data on the element and all its descendants.\n * Equivalent to how jqLite/jQuery invoke `cleanData()` on an Element when removed:\n *   https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n *   https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n *\n * NOTE:\n * `cleanData()` will also invoke the AngularJS `$destroy` DOM event on the element:\n *   https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/Angular.js#L1932-L1945\n *\n * @param node The DOM node whose data needs to be cleaned.\n */\nexport function cleanData(node: Node): void {\n  angularElement.cleanData([node]);\n  if (isParentNode(node)) {\n    angularElement.cleanData(node.querySelectorAll('*'));\n  }\n}\n\nexport function controllerKey(name: string): string {\n  return '$' + name + 'Controller';\n}\n\n/**\n * Destroy an AngularJS app given the app `$injector`.\n *\n * NOTE: Destroying an app is not officially supported by AngularJS, but try to do our best by\n *       destroying `$rootScope` and clean the jqLite/jQuery data on `$rootElement` and all\n *       descendants.\n *\n * @param $injector The `$injector` of the AngularJS app to destroy.\n */\nexport function destroyApp($injector: IInjectorService): void {\n  const $rootElement: IAugmentedJQuery = $injector.get($ROOT_ELEMENT);\n  const $rootScope: IRootScopeService = $injector.get($ROOT_SCOPE);\n\n  $rootScope.$destroy();\n  cleanData($rootElement[0]);\n}\n\nexport function directiveNormalize(name: string): string {\n  return name\n    .replace(DIRECTIVE_PREFIX_REGEXP, '')\n    .replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());\n}\n\nexport function getTypeName(type: Type<any>): string {\n  // Return the name of the type or the first line of its stringified version.\n  return (type as any).overriddenName || type.name || type.toString().split('\\n')[0];\n}\n\nexport function getDowngradedModuleCount($injector: IInjectorService): number {\n  return $injector.has(DOWNGRADED_MODULE_COUNT_KEY)\n    ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY)\n    : 0;\n}\n\nexport function getUpgradeAppType($injector: IInjectorService): UpgradeAppType {\n  return $injector.has(UPGRADE_APP_TYPE_KEY)\n    ? $injector.get(UPGRADE_APP_TYPE_KEY)\n    : UpgradeAppType.None;\n}\n\nexport function isFunction(value: any): value is Function {\n  return typeof value === 'function';\n}\n\nexport function isNgModuleType(value: any): value is Type<unknown> {\n  // NgModule class should have the `ɵmod` static property attached by AOT or JIT compiler.\n  return isFunction(value) && !!value[ɵNG_MOD_DEF];\n}\n\nfunction isParentNode(node: Node | ParentNode): node is ParentNode {\n  return isFunction((node as unknown as ParentNode).querySelectorAll);\n}\n\nexport function validateInjectionKey(\n  $injector: IInjectorService,\n  downgradedModule: string,\n  injectionKey: string,\n  attemptedAction: string,\n): void {\n  const upgradeAppType = getUpgradeAppType($injector);\n  const downgradedModuleCount = getDowngradedModuleCount($injector);\n\n  // Check for common errors.\n  switch (upgradeAppType) {\n    case UpgradeAppType.Dynamic:\n    case UpgradeAppType.Static:\n      if (downgradedModule) {\n        throw new Error(\n          `Error while ${attemptedAction}: 'downgradedModule' unexpectedly specified.\\n` +\n            \"You should not specify a value for 'downgradedModule', unless you are downgrading \" +\n            \"more than one Angular module (via 'downgradeModule()').\",\n        );\n      }\n      break;\n    case UpgradeAppType.Lite:\n      if (!downgradedModule && downgradedModuleCount >= 2) {\n        throw new Error(\n          `Error while ${attemptedAction}: 'downgradedModule' not specified.\\n` +\n            'This application contains more than one downgraded Angular module, thus you need to ' +\n            \"always specify 'downgradedModule' when downgrading components and injectables.\",\n        );\n      }\n\n      if (!$injector.has(injectionKey)) {\n        throw new Error(\n          `Error while ${attemptedAction}: Unable to find the specified downgraded module.\\n` +\n            'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n            'application?',\n        );\n      }\n\n      break;\n    default:\n      throw new Error(\n        `Error while ${attemptedAction}: Not a valid '@angular/upgrade' application.\\n` +\n          'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n          'application?',\n      );\n  }\n}\n\nexport class Deferred<R> {\n  promise: Promise<R>;\n  resolve!: (value: R | PromiseLike<R>) => void;\n  reject!: (error?: any) => void;\n\n  constructor() {\n    this.promise = new Promise((res, rej) => {\n      this.resolve = res;\n      this.reject = rej;\n    });\n  }\n}\n\nexport interface LazyModuleRef {\n  injector?: Injector;\n  promise?: Promise<Injector>;\n}\n\nexport const enum UpgradeAppType {\n  // App NOT using `@angular/upgrade`. (This should never happen in an `ngUpgrade` app.)\n  None,\n\n  // App using the deprecated `@angular/upgrade` APIs (a.k.a. dynamic `ngUpgrade`).\n  Dynamic,\n\n  // App using `@angular/upgrade/static` with `UpgradeModule`.\n  Static,\n\n  // App using @angular/upgrade/static` with `downgradeModule()` (a.k.a `ngUpgrade`-lite ).\n  Lite,\n}\n\n/**\n * @return Whether the passed-in component implements the subset of the\n *     `ControlValueAccessor` interface needed for AngularJS `ng-model`\n *     compatibility.\n */\nfunction supportsNgModel(component: any) {\n  return (\n    typeof component.writeValue === 'function' && typeof component.registerOnChange === 'function'\n  );\n}\n\n/**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n */\nexport function hookupNgModel(ngModel: INgModelController, component: any) {\n  if (ngModel && supportsNgModel(component)) {\n    ngModel.$render = () => {\n      component.writeValue(ngModel.$viewValue);\n    };\n    component.registerOnChange(ngModel.$setViewValue.bind(ngModel));\n    if (typeof component.registerOnTouched === 'function') {\n      component.registerOnTouched(ngModel.$setTouched.bind(ngModel));\n    }\n  }\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(val1: any, val2: any): boolean {\n  return val1 === val2 || (val1 !== val1 && val2 !== val2);\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  ApplicationRef,\n  ChangeDetectorRef,\n  ComponentFactory,\n  ComponentRef,\n  type EventEmitter,\n  Injector,\n  OnChanges,\n  SimpleChange,\n  SimpleChanges,\n  StaticProvider,\n  Testability,\n  TestabilityRegistry,\n  type OutputEmitterRef,\n  type ɵInputSignalNode as InputSignalNode,\n  ɵSIGNAL as SIGNAL,\n} from '@angular/core';\n\nimport {\n  IAttributes,\n  IAugmentedJQuery,\n  ICompileService,\n  INgModelController,\n  IParseService,\n  IScope,\n} from './angular1';\nimport {PropertyBinding} from './component_info';\nimport {$SCOPE} from './constants';\nimport {cleanData, getTypeName, hookupNgModel, strictEquals} from './util';\n\nconst INITIAL_VALUE = {\n  __UNINITIALIZED__: true,\n};\n\nexport class DowngradeComponentAdapter {\n  private implementsOnChanges = false;\n  private inputChangeCount: number = 0;\n  private inputChanges: SimpleChanges = {};\n  private componentScope: IScope;\n\n  constructor(\n    private element: IAugmentedJQuery,\n    private attrs: IAttributes,\n    private scope: IScope,\n    private ngModel: INgModelController,\n    private parentInjector: Injector,\n    private $compile: ICompileService,\n    private $parse: IParseService,\n    private componentFactory: ComponentFactory<any>,\n    private wrapCallback: <T>(cb: () => T) => () => T,\n    private readonly unsafelyOverwriteSignalInputs: boolean,\n  ) {\n    this.componentScope = scope.$new();\n  }\n\n  compileContents(): Node[][] {\n    const compiledProjectableNodes: Node[][] = [];\n    const projectableNodes: Node[][] = this.groupProjectableNodes();\n    const linkFns = projectableNodes.map((nodes) => this.$compile(nodes));\n\n    this.element.empty!();\n\n    linkFns.forEach((linkFn) => {\n      linkFn(this.scope, (clone: Node[]) => {\n        compiledProjectableNodes.push(clone);\n        this.element.append!(clone);\n      });\n    });\n\n    return compiledProjectableNodes;\n  }\n\n  createComponentAndSetup(\n    projectableNodes: Node[][],\n    manuallyAttachView = false,\n    propagateDigest = true,\n  ): ComponentRef<any> {\n    const component = this.createComponent(projectableNodes);\n    this.setupInputs(manuallyAttachView, propagateDigest, component);\n    this.setupOutputs(component.componentRef);\n    this.registerCleanup(component.componentRef);\n\n    return component.componentRef;\n  }\n\n  private createComponent(projectableNodes: Node[][]): ComponentInfo {\n    const providers: StaticProvider[] = [{provide: $SCOPE, useValue: this.componentScope}];\n    const childInjector = Injector.create({\n      providers: providers,\n      parent: this.parentInjector,\n      name: 'DowngradeComponentAdapter',\n    });\n\n    const componentRef = this.componentFactory.create(\n      childInjector,\n      projectableNodes,\n      this.element[0],\n    );\n    const viewChangeDetector = componentRef.injector.get(ChangeDetectorRef);\n    const changeDetector = componentRef.changeDetectorRef;\n\n    // testability hook is commonly added during component bootstrap in\n    // packages/core/src/application_ref.bootstrap()\n    // in downgraded application, component creation will take place here as well as adding the\n    // testability hook.\n    const testability = componentRef.injector.get(Testability, null);\n    if (testability) {\n      componentRef.injector\n        .get(TestabilityRegistry)\n        .registerApplication(componentRef.location.nativeElement, testability);\n    }\n\n    hookupNgModel(this.ngModel, componentRef.instance);\n\n    return {viewChangeDetector, componentRef, changeDetector};\n  }\n\n  private setupInputs(\n    manuallyAttachView: boolean,\n    propagateDigest = true,\n    {componentRef, changeDetector, viewChangeDetector}: ComponentInfo,\n  ): void {\n    const attrs = this.attrs;\n    const inputs = this.componentFactory.inputs || [];\n    for (const input of inputs) {\n      const inputBinding = new PropertyBinding(input.propName, input.templateName);\n      let expr: string | null = null;\n\n      if (attrs.hasOwnProperty(inputBinding.attr)) {\n        const observeFn = ((prop, isSignal) => {\n          let prevValue = INITIAL_VALUE;\n          return (currValue: any) => {\n            // Initially, both `$observe()` and `$watch()` will call this function.\n            if (!strictEquals(prevValue, currValue)) {\n              if (prevValue === INITIAL_VALUE) {\n                prevValue = currValue;\n              }\n\n              this.updateInput(componentRef, prop, prevValue, currValue, isSignal);\n              prevValue = currValue;\n            }\n          };\n        })(inputBinding.prop, input.isSignal);\n        attrs.$observe(inputBinding.attr, observeFn);\n\n        // Use `$watch()` (in addition to `$observe()`) in order to initialize the input in time\n        // for `ngOnChanges()`. This is necessary if we are already in a `$digest`, which means that\n        // `ngOnChanges()` (which is called by a watcher) will run before the `$observe()` callback.\n        let unwatch: Function | null = this.componentScope.$watch(() => {\n          unwatch!();\n          unwatch = null;\n          observeFn(attrs[inputBinding.attr]);\n        });\n      } else if (attrs.hasOwnProperty(inputBinding.bindAttr)) {\n        expr = attrs[inputBinding.bindAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bracketAttr)) {\n        expr = attrs[inputBinding.bracketAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bindonAttr)) {\n        expr = attrs[inputBinding.bindonAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bracketParenAttr)) {\n        expr = attrs[inputBinding.bracketParenAttr];\n      }\n      if (expr != null) {\n        const watchFn = (\n          (prop, isSignal) => (currValue: unknown, prevValue: unknown) =>\n            this.updateInput(componentRef, prop, prevValue, currValue, isSignal)\n        )(inputBinding.prop, input.isSignal);\n        this.componentScope.$watch(expr, watchFn);\n      }\n    }\n\n    // Invoke `ngOnChanges()` and Change Detection (when necessary)\n    const detectChanges = () => changeDetector.detectChanges();\n    const prototype = this.componentFactory.componentType.prototype;\n    this.implementsOnChanges = !!(prototype && (<OnChanges>prototype).ngOnChanges);\n\n    this.componentScope.$watch(\n      () => this.inputChangeCount,\n      this.wrapCallback(() => {\n        // Invoke `ngOnChanges()`\n        if (this.implementsOnChanges) {\n          const inputChanges = this.inputChanges;\n          this.inputChanges = {};\n          (<OnChanges>componentRef.instance).ngOnChanges(inputChanges);\n        }\n\n        viewChangeDetector.markForCheck();\n\n        // If opted out of propagating digests, invoke change detection when inputs change.\n        if (!propagateDigest) {\n          detectChanges();\n        }\n      }),\n    );\n\n    // If not opted out of propagating digests, invoke change detection on every digest\n    if (propagateDigest) {\n      this.componentScope.$watch(this.wrapCallback(detectChanges));\n    }\n\n    // If necessary, attach the view so that it will be dirty-checked.\n    // (Allow time for the initial input values to be set and `ngOnChanges()` to be called.)\n    if (manuallyAttachView || !propagateDigest) {\n      let unwatch: Function | null = this.componentScope.$watch(() => {\n        unwatch!();\n        unwatch = null;\n\n        const appRef = this.parentInjector.get<ApplicationRef>(ApplicationRef);\n        appRef.attachView(componentRef.hostView);\n      });\n    }\n  }\n\n  private setupOutputs(componentRef: ComponentRef<any>) {\n    const attrs = this.attrs;\n    const outputs = this.componentFactory.outputs || [];\n    for (const output of outputs) {\n      const outputBindings = new PropertyBinding(output.propName, output.templateName);\n      const bindonAttr = outputBindings.bindonAttr.substring(\n        0,\n        outputBindings.bindonAttr.length - 6,\n      );\n      const bracketParenAttr = `[(${outputBindings.bracketParenAttr.substring(\n        2,\n        outputBindings.bracketParenAttr.length - 8,\n      )})]`;\n      // order below is important - first update bindings then evaluate expressions\n      if (attrs.hasOwnProperty(bindonAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[bindonAttr], true);\n      }\n      if (attrs.hasOwnProperty(bracketParenAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[bracketParenAttr], true);\n      }\n      if (attrs.hasOwnProperty(outputBindings.onAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.onAttr]);\n      }\n      if (attrs.hasOwnProperty(outputBindings.parenAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.parenAttr]);\n      }\n    }\n  }\n\n  private subscribeToOutput(\n    componentRef: ComponentRef<any>,\n    output: PropertyBinding,\n    expr: string,\n    isAssignment: boolean = false,\n  ) {\n    const getter = this.$parse(expr);\n    const setter = getter.assign;\n    if (isAssignment && !setter) {\n      throw new Error(`Expression '${expr}' is not assignable!`);\n    }\n    const emitter = componentRef.instance[output.prop] as EventEmitter<any> | OutputEmitterRef<any>;\n    if (emitter) {\n      const subscription = emitter.subscribe(\n        isAssignment\n          ? (v: any) => setter!(this.scope, v)\n          : (v: any) => getter(this.scope, {'$event': v}),\n      );\n      componentRef.onDestroy(() => subscription.unsubscribe());\n    } else {\n      throw new Error(\n        `Missing emitter '${output.prop}' on component '${getTypeName(\n          this.componentFactory.componentType,\n        )}'!`,\n      );\n    }\n  }\n\n  private registerCleanup(componentRef: ComponentRef<any>) {\n    const testabilityRegistry = componentRef.injector.get(TestabilityRegistry);\n    const destroyComponentRef = this.wrapCallback(() => componentRef.destroy());\n    let destroyed = false;\n\n    this.element.on!('$destroy', () => {\n      // The `$destroy` event may have been triggered by the `cleanData()` call in the\n      // `componentScope` `$destroy` handler below. In that case, we don't want to call\n      // `componentScope.$destroy()` again.\n      if (!destroyed) this.componentScope.$destroy();\n    });\n    this.componentScope.$on('$destroy', () => {\n      if (!destroyed) {\n        destroyed = true;\n        testabilityRegistry.unregisterApplication(componentRef.location.nativeElement);\n\n        // The `componentScope` might be getting destroyed, because an ancestor element is being\n        // removed/destroyed. If that is the case, jqLite/jQuery would normally invoke `cleanData()`\n        // on the removed element and all descendants.\n        //   https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n        //   https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n        //\n        // Here, however, `destroyComponentRef()` may under some circumstances remove the element\n        // from the DOM and therefore it will no longer be a descendant of the removed element when\n        // `cleanData()` is called. This would result in a memory leak, because the element's data\n        // and event handlers (and all objects directly or indirectly referenced by them) would be\n        // retained.\n        //\n        // To ensure the element is always properly cleaned up, we manually call `cleanData()` on\n        // this element and its descendants before destroying the `ComponentRef`.\n        cleanData(this.element[0]);\n\n        destroyComponentRef();\n      }\n    });\n  }\n\n  private updateInput(\n    componentRef: ComponentRef<any>,\n    prop: string,\n    prevValue: any,\n    currValue: any,\n    isSignal: boolean,\n  ) {\n    if (this.implementsOnChanges) {\n      this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n    }\n\n    this.inputChangeCount++;\n    if (isSignal && !this.unsafelyOverwriteSignalInputs) {\n      const node = componentRef.instance[prop][SIGNAL] as InputSignalNode<unknown, unknown>;\n      node.applyValueToInputSignal(node, currValue);\n    } else {\n      componentRef.instance[prop] = currValue;\n    }\n  }\n\n  private groupProjectableNodes() {\n    let ngContentSelectors = this.componentFactory.ngContentSelectors;\n    return groupNodesBySelector(ngContentSelectors, this.element.contents!());\n  }\n}\n\n/**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n */\nexport function groupNodesBySelector(ngContentSelectors: string[], nodes: Node[]): Node[][] {\n  const projectableNodes: Node[][] = [];\n\n  for (let i = 0, ii = ngContentSelectors.length; i < ii; ++i) {\n    projectableNodes[i] = [];\n  }\n\n  for (let j = 0, jj = nodes.length; j < jj; ++j) {\n    const node = nodes[j];\n    const ngContentIndex = findMatchingNgContentIndex(node, ngContentSelectors);\n    if (ngContentIndex != null) {\n      projectableNodes[ngContentIndex].push(node);\n    }\n  }\n\n  return projectableNodes;\n}\n\nfunction findMatchingNgContentIndex(element: any, ngContentSelectors: string[]): number | null {\n  const ngContentIndices: number[] = [];\n  let wildcardNgContentIndex: number = -1;\n  for (let i = 0; i < ngContentSelectors.length; i++) {\n    const selector = ngContentSelectors[i];\n    if (selector === '*') {\n      wildcardNgContentIndex = i;\n    } else {\n      if (matchesSelector(element, selector)) {\n        ngContentIndices.push(i);\n      }\n    }\n  }\n  ngContentIndices.sort();\n\n  if (wildcardNgContentIndex !== -1) {\n    ngContentIndices.push(wildcardNgContentIndex);\n  }\n  return ngContentIndices.length ? ngContentIndices[0] : null;\n}\n\nfunction matchesSelector(el: any, selector: string): boolean {\n  const elProto = <any>Element.prototype;\n\n  return el.nodeType === Node.ELEMENT_NODE\n    ? // matches is supported by all browsers from 2014 onwards except non-chromium edge\n      (elProto.matches ?? elProto.msMatchesSelector).call(el, selector)\n    : false;\n}\n\ninterface ComponentInfo {\n  componentRef: ComponentRef<any>;\n  changeDetector: ChangeDetectorRef;\n  viewChangeDetector: ChangeDetectorRef;\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 {isFunction} from './util';\n\nexport interface Thenable<T> {\n  then(callback: (value: T) => any): any;\n}\n\nexport function isThenable<T>(obj: unknown): obj is Thenable<T> {\n  return !!obj && isFunction((obj as any).then);\n}\n\n/**\n * Synchronous, promise-like object.\n */\nexport class SyncPromise<T> {\n  protected value: T | undefined;\n  private resolved = false;\n  private callbacks: ((value: T) => unknown)[] = [];\n\n  static all<T>(valuesOrPromises: (T | Thenable<T>)[]): SyncPromise<T[]> {\n    const aggrPromise = new SyncPromise<T[]>();\n\n    let resolvedCount = 0;\n    const results: T[] = [];\n    const resolve = (idx: number, value: T) => {\n      results[idx] = value;\n      if (++resolvedCount === valuesOrPromises.length) aggrPromise.resolve(results);\n    };\n\n    valuesOrPromises.forEach((p, idx) => {\n      if (isThenable(p)) {\n        p.then((v) => resolve(idx, v));\n      } else {\n        resolve(idx, p);\n      }\n    });\n\n    return aggrPromise;\n  }\n\n  resolve(value: T): void {\n    // Do nothing, if already resolved.\n    if (this.resolved) return;\n\n    this.value = value;\n    this.resolved = true;\n\n    // Run the queued callbacks.\n    this.callbacks.forEach((callback) => callback(value));\n    this.callbacks.length = 0;\n  }\n\n  then(callback: (value: T) => unknown): void {\n    if (this.resolved) {\n      callback(this.value!);\n    } else {\n      this.callbacks.push(callback);\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 */\n\nimport {ComponentFactory, ComponentFactoryResolver, Injector, NgZone, Type} from '@angular/core';\n\nimport {\n  IAnnotatedFunction,\n  IAttributes,\n  IAugmentedJQuery,\n  ICompileService,\n  IDirective,\n  IInjectorService,\n  INgModelController,\n  IParseService,\n  IScope,\n} from './angular1';\nimport {\n  $COMPILE,\n  $INJECTOR,\n  $PARSE,\n  INJECTOR_KEY,\n  LAZY_MODULE_REF,\n  REQUIRE_INJECTOR,\n  REQUIRE_NG_MODEL,\n} from './constants';\nimport {DowngradeComponentAdapter} from './downgrade_component_adapter';\nimport {SyncPromise, Thenable} from './promise_util';\nimport {\n  controllerKey,\n  getDowngradedModuleCount,\n  getTypeName,\n  getUpgradeAppType,\n  LazyModuleRef,\n  UpgradeAppType,\n  validateInjectionKey,\n} from './util';\n\n/**\n * @description\n *\n * A helper function that allows an Angular component to be used from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function to be used for registering\n * an AngularJS wrapper directive for \"downgrading\" an Angular component.\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an Angular component called `ng2Heroes` that needs\n * to be made available in AngularJS templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes\"}\n *\n * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)\n * that will make this Angular component available inside AngularJS templates.\n * The `downgradeComponent()` function returns a factory function that we\n * can use to define the AngularJS directive that wraps the \"downgraded\" component.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-wrapper\"}\n *\n * For more details and examples on downgrading Angular components to AngularJS components please\n * visit the [Upgrade guide](https://angular.io/guide/upgrade#using-angular-components-from-angularjs-code).\n *\n * @param info contains information about the Component that is being downgraded:\n *\n * - `component: Type<any>`: The type of the Component that will be downgraded\n * - `downgradedModule?: string`: The name of the downgraded module (if any) that the component\n *   \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose\n *   corresponding Angular module will be bootstrapped, when the component needs to be instantiated.\n *   <br />\n *   (This option is only necessary when using `downgradeModule()` to downgrade more than one\n *   Angular module.)\n * - `propagateDigest?: boolean`: Whether to perform {@link /api/core/ChangeDetectorRef#detectChanges detectChanges} on the\n * component on every {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest $digest}.\n *   If set to `false`, change detection will still be performed when any of the component's inputs changes.\n *   (Default: true)\n *\n * @returns a factory function that can be used to register the component in an\n * AngularJS module.\n *\n * @publicApi\n */\nexport function downgradeComponent(info: {\n  component: Type<any>;\n  downgradedModule?: string;\n  propagateDigest?: boolean;\n  /** @deprecated since v4. This parameter is no longer used */\n  inputs?: string[];\n  /** @deprecated since v4. This parameter is no longer used */\n  outputs?: string[];\n  /** @deprecated since v4. This parameter is no longer used */\n  selectors?: string[];\n}): any /* angular.IInjectable */ {\n  const directiveFactory: IAnnotatedFunction = function (\n    $compile: ICompileService,\n    $injector: IInjectorService,\n    $parse: IParseService,\n  ): IDirective {\n    const unsafelyOverwriteSignalInputs =\n      (info as {unsafelyOverwriteSignalInputs?: boolean}).unsafelyOverwriteSignalInputs ?? false;\n    // When using `downgradeModule()`, we need to handle certain things specially. For example:\n    // - We always need to attach the component view to the `ApplicationRef` for it to be\n    //   dirty-checked.\n    // - We need to ensure callbacks to Angular APIs (e.g. change detection) are run inside the\n    //   Angular zone.\n    //   NOTE: This is not needed, when using `UpgradeModule`, because `$digest()` will be run\n    //         inside the Angular zone (except if explicitly escaped, in which case we shouldn't\n    //         force it back in).\n    const isNgUpgradeLite = getUpgradeAppType($injector) === UpgradeAppType.Lite;\n    const wrapCallback: <T>(cb: () => T) => typeof cb = !isNgUpgradeLite\n      ? (cb) => cb\n      : (cb) => () => (NgZone.isInAngularZone() ? cb() : ngZone.run(cb));\n    let ngZone: NgZone;\n\n    // When downgrading multiple modules, special handling is needed wrt injectors.\n    const hasMultipleDowngradedModules = isNgUpgradeLite && getDowngradedModuleCount($injector) > 1;\n\n    return {\n      restrict: 'E',\n      terminal: true,\n      require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n      // Controller needs to be set so that `angular-component-router.js` (from beta Angular 2)\n      // configuration properties can be made available. See:\n      // See G3: javascript/angular2/angular1_router_lib.js\n      // https://github.com/angular/angular.js/blob/47bf11ee94664367a26ed8c91b9b586d3dd420f5/src/ng/compile.js#L1670-L1691.\n      controller: function () {},\n      link: (scope: IScope, element: IAugmentedJQuery, attrs: IAttributes, required: any[]) => {\n        // We might have to compile the contents asynchronously, because this might have been\n        // triggered by `UpgradeNg1ComponentAdapterBuilder`, before the Angular templates have\n        // been compiled.\n\n        const ngModel: INgModelController = required[1];\n        const parentInjector: Injector | Thenable<Injector> | undefined = required[0];\n        let moduleInjector: Injector | Thenable<Injector> | undefined = undefined;\n        let ranAsync = false;\n\n        if (!parentInjector || hasMultipleDowngradedModules) {\n          const downgradedModule = info.downgradedModule || '';\n          const lazyModuleRefKey = `${LAZY_MODULE_REF}${downgradedModule}`;\n          const attemptedAction = `instantiating component '${getTypeName(info.component)}'`;\n\n          validateInjectionKey($injector, downgradedModule, lazyModuleRefKey, attemptedAction);\n\n          const lazyModuleRef = $injector.get(lazyModuleRefKey) as LazyModuleRef;\n          moduleInjector = lazyModuleRef.injector ?? lazyModuleRef.promise;\n        }\n\n        // Notes:\n        //\n        // There are two injectors: `finalModuleInjector` and `finalParentInjector` (they might be\n        // the same instance, but that is irrelevant):\n        // - `finalModuleInjector` is used to retrieve `ComponentFactoryResolver`, thus it must be\n        //   on the same tree as the `NgModule` that declares this downgraded component.\n        // - `finalParentInjector` is used for all other injection purposes.\n        //   (Note that Angular knows to only traverse the component-tree part of that injector,\n        //   when looking for an injectable and then switch to the module injector.)\n        //\n        // There are basically three cases:\n        // - If there is no parent component (thus no `parentInjector`), we bootstrap the downgraded\n        //   `NgModule` and use its injector as both `finalModuleInjector` and\n        //   `finalParentInjector`.\n        // - If there is a parent component (and thus a `parentInjector`) and we are sure that it\n        //   belongs to the same `NgModule` as this downgraded component (e.g. because there is only\n        //   one downgraded module, we use that `parentInjector` as both `finalModuleInjector` and\n        //   `finalParentInjector`.\n        // - If there is a parent component, but it may belong to a different `NgModule`, then we\n        //   use the `parentInjector` as `finalParentInjector` and this downgraded component's\n        //   declaring `NgModule`'s injector as `finalModuleInjector`.\n        //   Note 1: If the `NgModule` is already bootstrapped, we just get its injector (we don't\n        //           bootstrap again).\n        //   Note 2: It is possible that (while there are multiple downgraded modules) this\n        //           downgraded component and its parent component both belong to the same NgModule.\n        //           In that case, we could have used the `parentInjector` as both\n        //           `finalModuleInjector` and `finalParentInjector`, but (for simplicity) we are\n        //           treating this case as if they belong to different `NgModule`s. That doesn't\n        //           really affect anything, since `parentInjector` has `moduleInjector` as ancestor\n        //           and trying to resolve `ComponentFactoryResolver` from either one will return\n        //           the same instance.\n\n        // If there is a parent component, use its injector as parent injector.\n        // If this is a \"top-level\" Angular component, use the module injector.\n        const finalParentInjector = parentInjector || moduleInjector!;\n\n        // If this is a \"top-level\" Angular component or the parent component may belong to a\n        // different `NgModule`, use the module injector for module-specific dependencies.\n        // If there is a parent component that belongs to the same `NgModule`, use its injector.\n        const finalModuleInjector = moduleInjector || parentInjector!;\n\n        const doDowngrade = (injector: Injector, moduleInjector: Injector) => {\n          // Retrieve `ComponentFactoryResolver` from the injector tied to the `NgModule` this\n          // component belongs to.\n          const componentFactoryResolver: ComponentFactoryResolver =\n            moduleInjector.get(ComponentFactoryResolver);\n          const componentFactory: ComponentFactory<any> =\n            componentFactoryResolver.resolveComponentFactory(info.component)!;\n\n          if (!componentFactory) {\n            throw new Error(`Expecting ComponentFactory for: ${getTypeName(info.component)}`);\n          }\n\n          const injectorPromise = new ParentInjectorPromise(element);\n          const facade = new DowngradeComponentAdapter(\n            element,\n            attrs,\n            scope,\n            ngModel,\n            injector,\n            $compile,\n            $parse,\n            componentFactory,\n            wrapCallback,\n            unsafelyOverwriteSignalInputs,\n          );\n\n          const projectableNodes = facade.compileContents();\n          const componentRef = facade.createComponentAndSetup(\n            projectableNodes,\n            isNgUpgradeLite,\n            info.propagateDigest,\n          );\n\n          injectorPromise.resolve(componentRef.injector);\n\n          if (ranAsync) {\n            // If this is run async, it is possible that it is not run inside a\n            // digest and initial input values will not be detected.\n            scope.$evalAsync(() => {});\n          }\n        };\n\n        const downgradeFn = !isNgUpgradeLite\n          ? doDowngrade\n          : (pInjector: Injector, mInjector: Injector) => {\n              if (!ngZone) {\n                ngZone = pInjector.get(NgZone);\n              }\n\n              wrapCallback(() => doDowngrade(pInjector, mInjector))();\n            };\n\n        // NOTE:\n        // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because\n        // Closure Compiler (or some related tool) complains:\n        // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function`\n        SyncPromise.all([finalParentInjector, finalModuleInjector]).then(([pInjector, mInjector]) =>\n          downgradeFn(pInjector, mInjector),\n        );\n\n        ranAsync = true;\n      },\n    };\n  };\n\n  // bracket-notation because of closure - see #14441\n  directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n  return directiveFactory;\n}\n\n/**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's `$compile`.\n */\nclass ParentInjectorPromise extends SyncPromise<Injector> {\n  private injectorKey: string = controllerKey(INJECTOR_KEY);\n\n  constructor(private element: IAugmentedJQuery) {\n    super();\n\n    // Store the promise on the element.\n    element.data!(this.injectorKey, this);\n  }\n\n  override resolve(injector: Injector): void {\n    // Store the real injector on the element.\n    this.element.data!(this.injectorKey, injector);\n\n    // Release the element to prevent memory leaks.\n    this.element = null!;\n\n    // Resolve the promise.\n    super.resolve(injector);\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 {Injector} from '@angular/core';\n\nimport {IInjectorService} from './angular1';\nimport {$INJECTOR, INJECTOR_KEY} from './constants';\nimport {getTypeName, isFunction, validateInjectionKey} from './util';\n\n/**\n * @description\n *\n * A helper function to allow an Angular service to be accessible from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function that provides access to the Angular\n * service identified by the `token` parameter.\n *\n * @usageNotes\n * ### Examples\n *\n * First ensure that the service to be downgraded is provided in an `NgModule`\n * that will be part of the upgrade application. For example, let's assume we have\n * defined `HeroesService`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-service\"}\n *\n * and that we have included this in our upgrade app `NgModule`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-module\"}\n *\n * Now we can register the `downgradeInjectable` factory function for the service\n * on an AngularJS module.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"downgrade-ng2-heroes-service\"}\n *\n * Inside an AngularJS component's controller we can get hold of the\n * downgraded service via the name we gave when downgrading.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"example-app\"}\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n *   When using `downgradeModule()`, downgraded injectables will not be available until the Angular\n *   module that provides them is instantiated. In order to be safe, you need to ensure that the\n *   downgraded injectables are not used anywhere _outside_ the part of the app where it is\n *   guaranteed that their module has been instantiated.\n *\n *   For example, it is _OK_ to use a downgraded service in an upgraded component that is only used\n *   from a downgraded Angular component provided by the same Angular module as the injectable, but\n *   it is _not OK_ to use it in an AngularJS component that may be used independently of Angular or\n *   use it in a downgraded Angular component from a different module.\n *\n * </div>\n *\n * @param token an `InjectionToken` that identifies a service provided from Angular.\n * @param downgradedModule the name of the downgraded module (if any) that the injectable\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose injector will\n * be used for instantiating the injectable.<br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one Angular\n * module.)\n *\n * @returns a [factory function](https://docs.angularjs.org/guide/di) that can be\n * used to register the service on an AngularJS module.\n *\n * @publicApi\n */\nexport function downgradeInjectable(token: any, downgradedModule: string = ''): Function {\n  const factory = function ($injector: IInjectorService) {\n    const injectorKey = `${INJECTOR_KEY}${downgradedModule}`;\n    const injectableName = isFunction(token) ? getTypeName(token) : String(token);\n    const attemptedAction = `instantiating injectable '${injectableName}'`;\n\n    validateInjectionKey($injector, downgradedModule, injectorKey, attemptedAction);\n\n    try {\n      const injector: Injector = $injector.get(injectorKey);\n      return injector.get(token);\n    } catch (err) {\n      throw new Error(`Error while ${attemptedAction}: ${(err as Error).message || err}`);\n    }\n  };\n  (factory as any)['$inject'] = [$INJECTOR];\n\n  return factory;\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 * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * the upgrade package. It lazily constructs the Trusted Types policy, providing\n * helper utilities for promoting strings to Trusted Types. When Trusted Types\n * are not available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n\nimport {TrustedHTML, TrustedTypePolicy, TrustedTypePolicyFactory} from './trusted_types_defs';\n\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy | null | undefined;\n\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy(): TrustedTypePolicy | null {\n  if (policy === undefined) {\n    policy = null;\n    const windowWithTrustedTypes = window as unknown as {trustedTypes?: TrustedTypePolicyFactory};\n    if (windowWithTrustedTypes.trustedTypes) {\n      try {\n        policy = windowWithTrustedTypes.trustedTypes.createPolicy('angular#unsafe-upgrade', {\n          createHTML: (s: string) => s,\n        });\n      } catch {\n        // trustedTypes.createPolicy throws if called with a name that is\n        // already registered, even in report-only mode. Until the API changes,\n        // catch the error not to break the applications functionally. In such\n        // cases, the code will fall back to using strings.\n      }\n    }\n  }\n  return policy;\n}\n\n/**\n * Unsafely promote a legacy AngularJS template to a TrustedHTML, falling back\n * to strings when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, the template string should\n * always be under full control of the application author, as untrusted input\n * can cause an XSS vulnerability.\n */\nexport function trustedHTMLFromLegacyTemplate(html: string): TrustedHTML | string {\n  return getPolicy()?.createHTML(html) || html;\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 {ElementRef, Injector, SimpleChanges} from '@angular/core';\n\nimport {\n  DirectiveRequireProperty,\n  element as angularElement,\n  IAugmentedJQuery,\n  ICloneAttachFunction,\n  ICompileService,\n  IController,\n  IControllerService,\n  IDirective,\n  IHttpBackendService,\n  IInjectorService,\n  ILinkFn,\n  IScope,\n  ITemplateCacheService,\n  SingleOrListOrMap,\n} from './angular1';\nimport {$COMPILE, $CONTROLLER, $HTTP_BACKEND, $INJECTOR, $TEMPLATE_CACHE} from './constants';\nimport {cleanData, controllerKey, directiveNormalize, isFunction} from './util';\nimport {TrustedHTML} from './security/trusted_types_defs';\nimport {trustedHTMLFromLegacyTemplate} from './security/trusted_types';\n\n// Constants\nconst REQUIRE_PREFIX_RE = /^(\\^\\^?)?(\\?)?(\\^\\^?)?/;\n\n// Interfaces\nexport interface IBindingDestination {\n  [key: string]: any;\n  $onChanges?: (changes: SimpleChanges) => void;\n}\n\nexport interface IControllerInstance extends IBindingDestination {\n  $doCheck?: () => void;\n  $onDestroy?: () => void;\n  $onInit?: () => void;\n  $postLink?: () => void;\n}\n\n// Classes\nexport class UpgradeHelper {\n  public readonly $injector: IInjectorService;\n  public readonly element: Element;\n  public readonly $element: IAugmentedJQuery;\n  public readonly directive: IDirective;\n\n  private readonly $compile: ICompileService;\n  private readonly $controller: IControllerService;\n\n  constructor(\n    injector: Injector,\n    private name: string,\n    elementRef: ElementRef,\n    directive?: IDirective,\n  ) {\n    this.$injector = injector.get($INJECTOR);\n    this.$compile = this.$injector.get($COMPILE);\n    this.$controller = this.$injector.get($CONTROLLER);\n\n    this.element = elementRef.nativeElement;\n    this.$element = angularElement(this.element);\n\n    this.directive = directive ?? UpgradeHelper.getDirective(this.$injector, name);\n  }\n\n  static getDirective($injector: IInjectorService, name: string): IDirective {\n    const directives: IDirective[] = $injector.get(name + 'Directive');\n    if (directives.length > 1) {\n      throw new Error(`Only support single directive definition for: ${name}`);\n    }\n\n    const directive = directives[0];\n\n    // AngularJS will transform `link: xyz` to `compile: () => xyz`. So we can only tell there was a\n    // user-defined `compile` if there is no `link`. In other cases, we will just ignore `compile`.\n    if (directive.compile && !directive.link) notSupported(name, 'compile');\n    if (directive.replace) notSupported(name, 'replace');\n    if (directive.terminal) notSupported(name, 'terminal');\n\n    return directive;\n  }\n\n  static getTemplate(\n    $injector: IInjectorService,\n    directive: IDirective,\n    fetchRemoteTemplate = false,\n    $element?: IAugmentedJQuery,\n  ): string | TrustedHTML | Promise<string | TrustedHTML> {\n    if (directive.template !== undefined) {\n      return trustedHTMLFromLegacyTemplate(getOrCall<string>(directive.template, $element));\n    } else if (directive.templateUrl) {\n      const $templateCache = $injector.get($TEMPLATE_CACHE) as ITemplateCacheService;\n      const url = getOrCall<string>(directive.templateUrl, $element);\n      const template = $templateCache.get(url);\n\n      if (template !== undefined) {\n        return trustedHTMLFromLegacyTemplate(template);\n      } else if (!fetchRemoteTemplate) {\n        throw new Error('loading directive templates asynchronously is not supported');\n      }\n\n      return new Promise((resolve, reject) => {\n        const $httpBackend = $injector.get($HTTP_BACKEND) as IHttpBackendService;\n        $httpBackend('GET', url, null, (status: number, response: string) => {\n          if (status === 200) {\n            resolve(trustedHTMLFromLegacyTemplate($templateCache.put(url, response)));\n          } else {\n            reject(`GET component template from '${url}' returned '${status}: ${response}'`);\n          }\n        });\n      });\n    } else {\n      throw new Error(`Directive '${directive.name}' is not a component, it is missing template.`);\n    }\n  }\n\n  buildController(controllerType: IController, $scope: IScope) {\n    // TODO: Document that we do not pre-assign bindings on the controller instance.\n    // Quoted properties below so that this code can be optimized with Closure Compiler.\n    const locals = {'$scope': $scope, '$element': this.$element};\n    const controller = this.$controller(controllerType, locals, null, this.directive.controllerAs);\n\n    this.$element.data?.(controllerKey(this.directive.name!), controller);\n\n    return controller;\n  }\n\n  compileTemplate(template?: string | TrustedHTML): ILinkFn {\n    if (template === undefined) {\n      template = UpgradeHelper.getTemplate(this.$injector, this.directive, false, this.$element) as\n        | string\n        | TrustedHTML;\n    }\n\n    return this.compileHtml(template);\n  }\n\n  onDestroy($scope: IScope, controllerInstance?: any) {\n    if (controllerInstance && isFunction(controllerInstance.$onDestroy)) {\n      controllerInstance.$onDestroy();\n    }\n    $scope.$destroy();\n    cleanData(this.element);\n  }\n\n  prepareTransclusion(): ILinkFn | undefined {\n    const transclude = this.directive.transclude;\n    const contentChildNodes = this.extractChildNodes();\n    const attachChildrenFn: ILinkFn = (scope, cloneAttachFn) => {\n      // Since AngularJS v1.5.8, `cloneAttachFn` will try to destroy the transclusion scope if\n      // `$template` is empty. Since the transcluded content comes from Angular, not AngularJS,\n      // there will be no transclusion scope here.\n      // Provide a dummy `scope.$destroy()` method to prevent `cloneAttachFn` from throwing.\n      scope = scope || {$destroy: () => undefined};\n      return cloneAttachFn!($template, scope);\n    };\n    let $template = contentChildNodes;\n\n    if (transclude) {\n      const slots = Object.create(null);\n\n      if (typeof transclude === 'object') {\n        $template = [];\n\n        const slotMap = Object.create(null);\n        const filledSlots = Object.create(null);\n\n        // Parse the element selectors.\n        Object.keys(transclude).forEach((slotName) => {\n          let selector = transclude[slotName];\n          const optional = selector.charAt(0) === '?';\n          selector = optional ? selector.substring(1) : selector;\n\n          slotMap[selector] = slotName;\n          slots[slotName] = null; // `null`: Defined but not yet filled.\n          filledSlots[slotName] = optional; // Consider optional slots as filled.\n        });\n\n        // Add the matching elements into their slot.\n        contentChildNodes.forEach((node) => {\n          const slotName = slotMap[directiveNormalize(node.nodeName.toLowerCase())];\n          if (slotName) {\n            filledSlots[slotName] = true;\n            slots[slotName] = slots[slotName] || [];\n            slots[slotName].push(node);\n          } else {\n            $template.push(node);\n          }\n        });\n\n        // Check for required slots that were not filled.\n        Object.keys(filledSlots).forEach((slotName) => {\n          if (!filledSlots[slotName]) {\n            throw new Error(`Required transclusion slot '${slotName}' on directive: ${this.name}`);\n          }\n        });\n\n        Object.keys(slots)\n          .filter((slotName) => slots[slotName])\n          .forEach((slotName) => {\n            const nodes = slots[slotName];\n            slots[slotName] = (scope: IScope, cloneAttach: ICloneAttachFunction) => {\n              return cloneAttach!(nodes, scope);\n            };\n          });\n      }\n\n      // Attach `$$slots` to default slot transclude fn.\n      attachChildrenFn.$$slots = slots;\n\n      // AngularJS v1.6+ ignores empty or whitespace-only transcluded text nodes. But Angular\n      // removes all text content after the first interpolation and updates it later, after\n      // evaluating the expressions. This would result in AngularJS failing to recognize text\n      // nodes that start with an interpolation as transcluded content and use the fallback\n      // content instead.\n      // To avoid this issue, we add a\n      // [zero-width non-joiner character](https://en.wikipedia.org/wiki/Zero-width_non-joiner)\n      // to empty text nodes (which can only be a result of Angular removing their initial content).\n      // NOTE: Transcluded text content that starts with whitespace followed by an interpolation\n      //       will still fail to be detected by AngularJS v1.6+\n      $template.forEach((node) => {\n        if (node.nodeType === Node.TEXT_NODE && !node.nodeValue) {\n          node.nodeValue = '\\u200C';\n        }\n      });\n    }\n\n    return attachChildrenFn;\n  }\n\n  resolveAndBindRequiredControllers(controllerInstance: IControllerInstance | null) {\n    const directiveRequire = this.getDirectiveRequire();\n    const requiredControllers = this.resolveRequire(directiveRequire);\n\n    if (controllerInstance && this.directive.bindToController && isMap(directiveRequire)) {\n      const requiredControllersMap = requiredControllers as {[key: string]: IControllerInstance};\n      Object.keys(requiredControllersMap).forEach((key) => {\n        controllerInstance[key] = requiredControllersMap[key];\n      });\n    }\n\n    return requiredControllers;\n  }\n\n  private compileHtml(html: string | TrustedHTML): ILinkFn {\n    this.element.innerHTML = html;\n    return this.$compile(this.element.childNodes);\n  }\n\n  private extractChildNodes(): Node[] {\n    const childNodes: Node[] = [];\n    let childNode: Node | null;\n\n    while ((childNode = this.element.firstChild)) {\n      (childNode as Element | Comment | Text).remove();\n      childNodes.push(childNode);\n    }\n\n    return childNodes;\n  }\n\n  private getDirectiveRequire(): DirectiveRequireProperty {\n    const require = this.directive.require || (this.directive.controller && this.directive.name)!;\n\n    if (isMap(require)) {\n      Object.entries(require).forEach(([key, value]) => {\n        const match = value.match(REQUIRE_PREFIX_RE)!;\n        const name = value.substring(match[0].length);\n\n        if (!name) {\n          require[key] = match[0] + key;\n        }\n      });\n    }\n\n    return require;\n  }\n\n  private resolveRequire(\n    require: DirectiveRequireProperty,\n  ): SingleOrListOrMap<IControllerInstance> | null {\n    if (!require) {\n      return null;\n    } else if (Array.isArray(require)) {\n      return require.map((req) => this.resolveRequire(req));\n    } else if (typeof require === 'object') {\n      const value: {[key: string]: IControllerInstance} = {};\n      Object.keys(require).forEach((key) => (value[key] = this.resolveRequire(require[key])!));\n      return value;\n    } else if (typeof require === 'string') {\n      const match = require.match(REQUIRE_PREFIX_RE)!;\n      const inheritType = match[1] || match[3];\n\n      const name = require.substring(match[0].length);\n      const isOptional = !!match[2];\n      const searchParents = !!inheritType;\n      const startOnParent = inheritType === '^^';\n\n      const ctrlKey = controllerKey(name);\n      const elem = startOnParent ? this.$element.parent!() : this.$element;\n      const value = searchParents ? elem.inheritedData!(ctrlKey) : elem.data!(ctrlKey);\n\n      if (!value && !isOptional) {\n        throw new Error(\n          `Unable to find required '${require}' in upgraded directive '${this.name}'.`,\n        );\n      }\n\n      return value;\n    } else {\n      throw new Error(\n        `Unrecognized 'require' syntax on upgraded directive '${this.name}': ${require}`,\n      );\n    }\n  }\n}\n\nfunction getOrCall<T>(property: T | Function, ...args: any[]): T {\n  return isFunction(property) ? property(...args) : property;\n}\n\n// NOTE: Only works for `typeof T !== 'object'`.\nfunction isMap<T>(value: SingleOrListOrMap<T>): value is {[key: string]: T} {\n  return value && !Array.isArray(value) && typeof value === 'object';\n}\n\nfunction notSupported(name: string, feature: string) {\n  throw new Error(`Upgraded directive '${name}' contains unsupported feature: '${feature}'.`);\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 {IInjectorService} from '../../src/common/src/angular1';\n\n// We have to do a little dance to get the ng1 injector into the module injector.\n// We store the ng1 injector so that the provider in the module injector can access it\n// Then we \"get\" the ng1 injector from the module injector, which triggers the provider to read\n// the stored injector and release the reference to it.\nlet tempInjectorRef: IInjectorService | null = null;\nexport function setTempInjectorRef(injector: IInjectorService) {\n  tempInjectorRef = injector;\n}\nexport function injectorFactory() {\n  if (!tempInjectorRef) {\n    throw new Error('Trying to get the AngularJS injector before it being set.');\n  }\n\n  const injector: IInjectorService = tempInjectorRef;\n  tempInjectorRef = null; // clear the value to prevent memory leaks\n  return injector;\n}\n\nexport function rootScopeFactory(i: IInjectorService) {\n  return i.get('$rootScope');\n}\n\nexport function compileFactory(i: IInjectorService) {\n  return i.get('$compile');\n}\n\nexport function parseFactory(i: IInjectorService) {\n  return i.get('$parse');\n}\n\nexport const angular1Providers = [\n  // We must use exported named functions for the ng2 factories to keep the compiler happy:\n  // > Metadata collected contains an error that will be reported at runtime:\n  // >   Function calls are not supported.\n  // >   Consider replacing the function or lambda with a reference to an exported function\n  {provide: '$injector', useFactory: injectorFactory, deps: []},\n  {provide: '$rootScope', useFactory: rootScopeFactory, deps: ['$injector']},\n  {provide: '$compile', useFactory: compileFactory, deps: ['$injector']},\n  {provide: '$parse', useFactory: parseFactory, deps: ['$injector']},\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  Injector,\n  ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,\n} from '@angular/core';\n\nexport class NgAdapterInjector implements Injector {\n  constructor(private modInjector: Injector) {}\n\n  // When Angular locate a service in the component injector tree, the not found value is set to\n  // `NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR`. In such a case we should not walk up to the module\n  // injector.\n  // AngularJS only supports a single tree and should always check the module injector.\n  get(token: any, notFoundValue?: any): any {\n    if (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n      return notFoundValue;\n    }\n\n    return this.modInjector.get(token, notFoundValue);\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  Injector,\n  NgModuleFactory,\n  NgModuleRef,\n  PlatformRef,\n  StaticProvider,\n  Type,\n  ɵinternalProvideZoneChangeDetection as internalProvideZoneChangeDetection,\n} from '@angular/core';\nimport {platformBrowser} from '@angular/platform-browser';\n\nimport {ɵangular1, ɵconstants, ɵutil} from '../common';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\nlet moduleUid = 0;\n\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n *   `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n *   that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n *   You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n *   Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n *    inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n *    [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n *    detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-helpful\">\n *\n *   You can manually trigger a change detection run in AngularJS using\n *   [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n *   [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n *   You can manually trigger a change detection run in Angular using {@link NgZone#run\n *   ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n *   module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n *   `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n *   `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n *   {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n *   downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n *   will be created for every injectable provided in `\"root\"` (via\n *   {@link /api/core/Injectable#providedIn providedIn}\n *   If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n *   module) and create all downgraded modules using that module's injector:\n *\n *   {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nexport function downgradeModule<T>(\n  moduleOrBootstrapFn: Type<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>),\n): string;\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n *   `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n *   that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n *   You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n *   Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n *    inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n *    [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n *    detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-helpful\">\n *\n *   You can manually trigger a change detection run in AngularJS using\n *   [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n *   [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n *   You can manually trigger a change detection run in Angular using {@link NgZone#run\n *   ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n *   module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n *   `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n *   `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n *   {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n *   downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n *   will be created for every injectable provided in `\"root\"` (via\n *   {@link /api/core/Injectable#providedIn providedIn}\n *   If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n *   module) and create all downgraded modules using that module's injector:\n *\n *   {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n *\n * @deprecated Passing `NgModuleFactory` as the `downgradeModule` function argument is deprecated,\n *     please pass an NgModule class reference instead.\n */\nexport function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): string;\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n *   `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n *   that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"docs-alert docs-alert-important\">\n *\n *   You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n *   Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n *    inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n *    [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n *    detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-helpful\">\n *\n *   You can manually trigger a change detection run in AngularJS using\n *   [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n *   [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n *   You can manually trigger a change detection run in Angular using {@link NgZone#run\n *   ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n *   module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n *   `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n *   `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n *   {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n *   downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n *   will be created for every injectable provided in `\"root\"` (via\n *   {@link /api/core/Injectable#providedIn providedIn}\n *   If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n *   module) and create all downgraded modules using that module's injector:\n *\n *   {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nexport function downgradeModule<T>(\n  moduleOrBootstrapFn:\n    | Type<T>\n    | NgModuleFactory<T>\n    | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>),\n): string {\n  const lazyModuleName = `${ɵconstants.UPGRADE_MODULE_NAME}.lazy${++moduleUid}`;\n  const lazyModuleRefKey = `${ɵconstants.LAZY_MODULE_REF}${lazyModuleName}`;\n  const lazyInjectorKey = `${ɵconstants.INJECTOR_KEY}${lazyModuleName}`;\n\n  let bootstrapFn: (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>;\n  if (ɵutil.isNgModuleType(moduleOrBootstrapFn)) {\n    // NgModule class\n    bootstrapFn = (extraProviders: StaticProvider[]) =>\n      platformBrowser(extraProviders).bootstrapModule(moduleOrBootstrapFn, {\n        applicationProviders: [internalProvideZoneChangeDetection({})],\n      });\n  } else if (!ɵutil.isFunction(moduleOrBootstrapFn)) {\n    // NgModule factory\n    bootstrapFn = (extraProviders: StaticProvider[]) =>\n      platformBrowser(extraProviders).bootstrapModuleFactory(moduleOrBootstrapFn, {\n        applicationProviders: [internalProvideZoneChangeDetection({})],\n      });\n  } else {\n    // bootstrap function\n    bootstrapFn = moduleOrBootstrapFn;\n  }\n\n  let injector: Injector;\n\n  // Create an ng1 module to bootstrap.\n  ɵangular1\n    .module_(lazyModuleName, [])\n    .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, ɵutil.UpgradeAppType.Lite)\n    .factory(ɵconstants.INJECTOR_KEY, [lazyInjectorKey, identity])\n    .factory(lazyInjectorKey, () => {\n      if (!injector) {\n        throw new Error(\n          'Trying to get the Angular injector before bootstrapping the corresponding ' +\n            'Angular module.',\n        );\n      }\n      return injector;\n    })\n    .factory(ɵconstants.LAZY_MODULE_REF, [lazyModuleRefKey, identity])\n    .factory(lazyModuleRefKey, [\n      ɵconstants.$INJECTOR,\n      ($injector: ɵangular1.IInjectorService) => {\n        setTempInjectorRef($injector);\n        const result: ɵutil.LazyModuleRef = {\n          promise: bootstrapFn(angular1Providers).then((ref) => {\n            injector = result.injector = new NgAdapterInjector(ref.injector);\n            injector.get(ɵconstants.$INJECTOR);\n\n            // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n            // This does not happen in a typical SPA scenario, but it might be useful for\n            // other use-cases where disposing of an Angular/AngularJS app is necessary\n            // (such as Hot Module Replacement (HMR)).\n            // See https://github.com/angular/angular/issues/39935.\n            injector.get(PlatformRef).onDestroy(() => ɵutil.destroyApp($injector));\n\n            return injector;\n          }),\n        };\n        return result;\n      },\n    ])\n    .config([\n      ɵconstants.$INJECTOR,\n      ɵconstants.$PROVIDE,\n      ($injector: ɵangular1.IInjectorService, $provide: ɵangular1.IProvideService) => {\n        $provide.constant(\n          ɵconstants.DOWNGRADED_MODULE_COUNT_KEY,\n          ɵutil.getDowngradedModuleCount($injector) + 1,\n        );\n      },\n    ]);\n\n  return lazyModuleName;\n}\n\nfunction identity<T = any>(x: T): T {\n  return x;\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  Directive,\n  DoCheck,\n  ElementRef,\n  EventEmitter,\n  Injector,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n  SimpleChanges,\n} from '@angular/core';\n\nimport {ɵangular1, ɵconstants, ɵupgradeHelper, ɵutil} from '../common';\n\nconst NOT_SUPPORTED: any = 'NOT_SUPPORTED';\nconst INITIAL_VALUE = {\n  __UNINITIALIZED__: true,\n};\n\nclass Bindings {\n  twoWayBoundProperties: string[] = [];\n  twoWayBoundLastValues: any[] = [];\n\n  expressionBoundProperties: string[] = [];\n\n  propertyToOutputMap: {[propName: string]: string} = {};\n}\n\n/**\n * @description\n *\n * A helper class that allows an AngularJS component to be used from Angular.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation.*\n *\n * This helper class should be used as a base class for creating Angular directives\n * that wrap AngularJS components that need to be \"upgraded\".\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an AngularJS component called `ng1Hero` that needs\n * to be made available in Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero\"}\n *\n * We must create a `Directive` that will make this AngularJS component\n * available inside Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\"}\n *\n * In this example you can see that we must derive from the `UpgradeComponent`\n * base class but also provide an {@link Directive `@Directive`} decorator. This is\n * because the AOT compiler requires that this information is statically available at\n * compile time.\n *\n * Note that we must do the following:\n * * specify the directive's selector (`ng1-hero`)\n * * specify all inputs and outputs that the AngularJS component expects\n * * derive from `UpgradeComponent`\n * * call the base class from the constructor, passing\n *   * the AngularJS name of the component (`ng1Hero`)\n *   * the `ElementRef` and `Injector` for the component wrapper\n *\n * @publicApi\n * @extensible\n */\n@Directive()\nexport class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {\n  private helper: ɵupgradeHelper.UpgradeHelper;\n\n  private $element: ɵangular1.IAugmentedJQuery;\n  private $componentScope: ɵangular1.IScope;\n\n  private directive: ɵangular1.IDirective;\n  private bindings: Bindings;\n\n  private controllerInstance?: ɵupgradeHelper.IControllerInstance;\n  private bindingDestination?: ɵupgradeHelper.IBindingDestination;\n\n  // We will be instantiating the controller in the `ngOnInit` hook, when the\n  // first `ngOnChanges` will have been already triggered. We store the\n  // `SimpleChanges` and \"play them back\" later.\n  private pendingChanges: SimpleChanges | null = null;\n\n  private unregisterDoCheckWatcher?: Function;\n\n  /**\n   * Create a new `UpgradeComponent` instance. You should not normally need to do this.\n   * Instead you should derive a new class from this one and call the super constructor\n   * from the base class.\n   *\n   * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\" }\n   *\n   * * The `name` parameter should be the name of the AngularJS directive.\n   * * The `elementRef` and `injector` parameters should be acquired from Angular by dependency\n   *   injection into the base class constructor.\n   */\n  constructor(name: string, elementRef: ElementRef, injector: Injector) {\n    this.helper = new ɵupgradeHelper.UpgradeHelper(injector, name, elementRef);\n\n    this.$element = this.helper.$element;\n\n    this.directive = this.helper.directive;\n    this.bindings = this.initializeBindings(this.directive, name);\n\n    // We ask for the AngularJS scope from the Angular injector, since\n    // we will put the new component scope onto the new injector for each component\n    const $parentScope = injector.get(ɵconstants.$SCOPE);\n    // QUESTION 1: Should we create an isolated scope if the scope is only true?\n    // QUESTION 2: Should we make the scope accessible through `$element.scope()/isolateScope()`?\n    this.$componentScope = $parentScope.$new(!!this.directive.scope);\n\n    this.initializeOutputs();\n  }\n\n  /** @docs-private */\n  ngOnInit() {\n    // Collect contents, insert and compile template\n    const attachChildNodes: ɵangular1.ILinkFn | undefined = this.helper.prepareTransclusion();\n    const linkFn = this.helper.compileTemplate();\n\n    // Instantiate controller\n    const controllerType = this.directive.controller;\n    const bindToController = this.directive.bindToController;\n    let controllerInstance = controllerType\n      ? this.helper.buildController(controllerType, this.$componentScope)\n      : undefined;\n    let bindingDestination: ɵupgradeHelper.IBindingDestination;\n\n    if (!bindToController) {\n      bindingDestination = this.$componentScope;\n    } else if (controllerType && controllerInstance) {\n      bindingDestination = controllerInstance;\n    } else {\n      throw new Error(\n        `Upgraded directive '${this.directive.name}' specifies 'bindToController' but no controller.`,\n      );\n    }\n    this.controllerInstance = controllerInstance;\n    this.bindingDestination = bindingDestination;\n\n    // Set up outputs\n    this.bindOutputs(bindingDestination);\n\n    // Require other controllers\n    const requiredControllers = this.helper.resolveAndBindRequiredControllers(controllerInstance);\n\n    // Hook: $onChanges\n    if (this.pendingChanges) {\n      this.forwardChanges(this.pendingChanges, bindingDestination);\n      this.pendingChanges = null;\n    }\n\n    // Hook: $onInit\n    if (this.controllerInstance && ɵutil.isFunction(this.controllerInstance.$onInit)) {\n      this.controllerInstance.$onInit();\n    }\n\n    // Hook: $doCheck\n    if (controllerInstance && ɵutil.isFunction(controllerInstance.$doCheck)) {\n      const callDoCheck = () => controllerInstance?.$doCheck?.();\n\n      this.unregisterDoCheckWatcher = this.$componentScope.$parent.$watch(callDoCheck);\n      callDoCheck();\n    }\n\n    // Linking\n    const link = this.directive.link;\n    const preLink = typeof link == 'object' && link.pre;\n    const postLink = typeof link == 'object' ? link.post : link;\n    const attrs: ɵangular1.IAttributes = NOT_SUPPORTED;\n    const transcludeFn: ɵangular1.ITranscludeFunction = NOT_SUPPORTED;\n    if (preLink) {\n      preLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n    }\n\n    linkFn(this.$componentScope, null!, {parentBoundTranscludeFn: attachChildNodes});\n\n    if (postLink) {\n      postLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n    }\n\n    // Hook: $postLink\n    if (this.controllerInstance && ɵutil.isFunction(this.controllerInstance.$postLink)) {\n      this.controllerInstance.$postLink();\n    }\n  }\n\n  /** @docs-private */\n  ngOnChanges(changes: SimpleChanges) {\n    if (!this.bindingDestination) {\n      this.pendingChanges = changes;\n    } else {\n      this.forwardChanges(changes, this.bindingDestination);\n    }\n  }\n\n  /** @docs-private */\n  ngDoCheck() {\n    const twoWayBoundProperties = this.bindings.twoWayBoundProperties;\n    const twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;\n    const propertyToOutputMap = this.bindings.propertyToOutputMap;\n\n    twoWayBoundProperties.forEach((propName, idx) => {\n      const newValue = this.bindingDestination?.[propName];\n      const oldValue = twoWayBoundLastValues[idx];\n\n      if (!Object.is(newValue, oldValue)) {\n        const outputName = propertyToOutputMap[propName];\n        const eventEmitter: EventEmitter<any> = (this as any)[outputName];\n\n        eventEmitter.emit(newValue);\n        twoWayBoundLastValues[idx] = newValue;\n      }\n    });\n  }\n\n  /** @docs-private */\n  ngOnDestroy() {\n    if (ɵutil.isFunction(this.unregisterDoCheckWatcher)) {\n      this.unregisterDoCheckWatcher();\n    }\n    this.helper.onDestroy(this.$componentScope, this.controllerInstance);\n  }\n\n  private initializeBindings(directive: ɵangular1.IDirective, name: string) {\n    const btcIsObject = typeof directive.bindToController === 'object';\n    if (btcIsObject && Object.keys(directive.scope!).length) {\n      throw new Error(\n        `Binding definitions on scope and controller at the same time is not supported.`,\n      );\n    }\n\n    const context = btcIsObject ? directive.bindToController : directive.scope;\n    const bindings = new Bindings();\n\n    if (typeof context == 'object') {\n      Object.keys(context).forEach((propName) => {\n        const definition = context[propName];\n        const bindingType = definition.charAt(0);\n\n        // QUESTION: What about `=*`? Ignore? Throw? Support?\n\n        switch (bindingType) {\n          case '@':\n          case '<':\n            // We don't need to do anything special. They will be defined as inputs on the\n            // upgraded component facade and the change propagation will be handled by\n            // `ngOnChanges()`.\n            break;\n          case '=':\n            bindings.twoWayBoundProperties.push(propName);\n            bindings.twoWayBoundLastValues.push(INITIAL_VALUE);\n            bindings.propertyToOutputMap[propName] = propName + 'Change';\n            break;\n          case '&':\n            bindings.expressionBoundProperties.push(propName);\n            bindings.propertyToOutputMap[propName] = propName;\n            break;\n          default:\n            let json = JSON.stringify(context);\n            throw new Error(\n              `Unexpected mapping '${bindingType}' in '${json}' in '${name}' directive.`,\n            );\n        }\n      });\n    }\n\n    return bindings;\n  }\n\n  private initializeOutputs() {\n    // Initialize the outputs for `=` and `&` bindings\n    this.bindings.twoWayBoundProperties\n      .concat(this.bindings.expressionBoundProperties)\n      .forEach((propName) => {\n        const outputName = this.bindings.propertyToOutputMap[propName];\n        (this as any)[outputName] = new EventEmitter();\n      });\n  }\n\n  private bindOutputs(bindingDestination: ɵupgradeHelper.IBindingDestination) {\n    // Bind `&` bindings to the corresponding outputs\n    this.bindings.expressionBoundProperties.forEach((propName) => {\n      const outputName = this.bindings.propertyToOutputMap[propName];\n      const emitter: EventEmitter<any> = (this as any)[outputName];\n\n      bindingDestination[propName] = (value: any) => emitter.emit(value);\n    });\n  }\n\n  private forwardChanges(\n    changes: SimpleChanges,\n    bindingDestination: ɵupgradeHelper.IBindingDestination,\n  ) {\n    // Forward input changes to `bindingDestination`\n    Object.keys(changes).forEach(\n      (propName) => (bindingDestination[propName] = changes[propName].currentValue),\n    );\n\n    if (ɵutil.isFunction(bindingDestination.$onChanges)) {\n      bindingDestination.$onChanges(changes);\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 */\n\nimport {\n  Injector,\n  ApplicationRef,\n  NgModule,\n  NgZone,\n  PlatformRef,\n  Testability,\n  ɵNoopNgZone,\n  ɵinternalProvideZoneChangeDetection,\n} from '@angular/core';\n\nimport {ɵangular1, ɵconstants, ɵutil} from '../common';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\n/**\n * @description\n *\n * An `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * The `upgrade/static` package contains helpers that allow AngularJS and Angular components\n * to be used together inside a hybrid upgrade application, which supports AOT compilation.\n *\n * Specifically, the classes and functions in the `upgrade/static` module allow the following:\n *\n * 1. Creation of an Angular directive that wraps and exposes an AngularJS component so\n *    that it can be used in an Angular template. See `UpgradeComponent`.\n * 2. Creation of an AngularJS directive that wraps and exposes an Angular component so\n *    that it can be used in an AngularJS template. See `downgradeComponent`.\n * 3. Creation of an Angular root injector provider that wraps and exposes an AngularJS\n *    service so that it can be injected into an Angular context. See\n *    {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.\n * 4. Creation of an AngularJS service that wraps and exposes an Angular injectable\n *    so that it can be injected into an AngularJS context. See `downgradeInjectable`.\n * 5. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n *    coexisting in a single application.\n *\n * @usageNotes\n *\n * ```ts\n * import {UpgradeModule} from '@angular/upgrade/static';\n * ```\n *\n * See also the {@link UpgradeModule#examples examples} below.\n *\n * ### Mental Model\n *\n * When reasoning about how a hybrid application works it is useful to have a mental model which\n * describes what is happening and explains what is happening at the lowest level.\n *\n * 1. There are two independent frameworks running in a single application, each framework treats\n *    the other as a black box.\n * 2. Each DOM element on the page is owned exactly by one framework. Whichever framework\n *    instantiated the element is the owner. Each framework only updates/interacts with its own\n *    DOM elements and ignores others.\n * 3. AngularJS directives always execute inside the AngularJS framework codebase regardless of\n *    where they are instantiated.\n * 4. Angular components always execute inside the Angular framework codebase regardless of\n *    where they are instantiated.\n * 5. An AngularJS component can be \"upgraded\"\" to an Angular component. This is achieved by\n *    defining an Angular directive, which bootstraps the AngularJS component at its location\n *    in the DOM. See `UpgradeComponent`.\n * 6. An Angular component can be \"downgraded\" to an AngularJS component. This is achieved by\n *    defining an AngularJS directive, which bootstraps the Angular component at its location\n *    in the DOM. See `downgradeComponent`.\n * 7. Whenever an \"upgraded\"/\"downgraded\" component is instantiated the host element is owned by\n *    the framework doing the instantiation. The other framework then instantiates and owns the\n *    view for that component.\n *    1. This implies that the component bindings will always follow the semantics of the\n *       instantiation framework.\n *    2. The DOM attributes are parsed by the framework that owns the current template. So\n *       attributes in AngularJS templates must use kebab-case, while AngularJS templates must use\n *       camelCase.\n *    3. However the template binding syntax will always use the Angular style, e.g. square\n *       brackets (`[...]`) for property binding.\n * 8. Angular is bootstrapped first; AngularJS is bootstrapped second. AngularJS always owns the\n *    root component of the application.\n * 9. The new application is running in an Angular zone, and therefore it no longer needs calls to\n *    `$apply()`.\n *\n * ### The `UpgradeModule` class\n *\n * This class is an `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * * Core AngularJS services<br />\n *   Importing this `NgModule` will add providers for the core\n *   [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.\n *\n * * Bootstrap<br />\n *   The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}\n *   method, which you use to bootstrap the top level AngularJS module onto an element in the\n *   DOM for the hybrid upgrade app.\n *\n *   It also contains properties to access the {@link UpgradeModule#injector root injector}, the\n *   bootstrap `NgZone` and the\n *   [AngularJS $injector](https://docs.angularjs.org/api/auto/service/$injector).\n *\n * ### Examples\n *\n * Import the `UpgradeModule` into your top level Angular {@link NgModule NgModule}.\n *\n * {@example upgrade/static/ts/full/module.ts region='ng2-module'}\n *\n * Then inject `UpgradeModule` into your Angular `NgModule` and use it to bootstrap the top level\n * [AngularJS module](https://docs.angularjs.org/api/ng/type/angular.Module) in the\n * `ngDoBootstrap()` method.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng1'}\n *\n * Finally, kick off the whole process, by bootstrapping your top level Angular `NgModule`.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng2'}\n *\n * ### Upgrading an AngularJS service\n *\n * There is no specific API for upgrading an AngularJS service. Instead you should just follow the\n * following recipe:\n *\n * Let's say you have an AngularJS service:\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-text-formatter-service\"}\n *\n * Then you should define an Angular provider to be included in your `NgModule` `providers`\n * property.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"upgrade-ng1-service\"}\n *\n * Then you can use the \"upgraded\" AngularJS service by injecting it into an Angular component\n * or service.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"use-ng1-upgraded-service\"}\n *\n * @publicApi\n */\n@NgModule({providers: [angular1Providers, ɵinternalProvideZoneChangeDetection({})]})\nexport class UpgradeModule {\n  /**\n   * The AngularJS `$injector` for the upgrade application.\n   */\n  public $injector: any /*angular.IInjectorService*/;\n  /** The Angular Injector **/\n  public injector: Injector;\n  private readonly applicationRef: ApplicationRef;\n\n  constructor(\n    /** The root `Injector` for the upgrade application. */\n    injector: Injector,\n    /** The bootstrap zone for the upgrade application */\n    public ngZone: NgZone,\n    /**\n     * The owning `NgModuleRef`s `PlatformRef` instance.\n     * This is used to tie the lifecycle of the bootstrapped AngularJS apps to that of the Angular\n     * `PlatformRef`.\n     */\n    private platformRef: PlatformRef,\n  ) {\n    this.injector = new NgAdapterInjector(injector);\n    this.applicationRef = this.injector.get(ApplicationRef);\n  }\n\n  /**\n   * Bootstrap an AngularJS application from this NgModule\n   * @param element the element on which to bootstrap the AngularJS application\n   * @param [modules] the AngularJS modules to bootstrap for this application\n   * @param [config] optional extra AngularJS bootstrap configuration\n   * @return The value returned by\n   *     [angular.bootstrap()](https://docs.angularjs.org/api/ng/function/angular.bootstrap).\n   */\n  bootstrap(\n    element: Element,\n    modules: string[] = [],\n    config?: any /*angular.IAngularBootstrapConfig*/,\n  ): any /*ReturnType<typeof angular.bootstrap>*/ {\n    const INIT_MODULE_NAME = ɵconstants.UPGRADE_MODULE_NAME + '.init';\n\n    // Create an ng1 module to bootstrap\n    ɵangular1\n      .module_(INIT_MODULE_NAME, [])\n\n      .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, ɵutil.UpgradeAppType.Static)\n\n      .value(ɵconstants.INJECTOR_KEY, this.injector)\n\n      .factory(ɵconstants.LAZY_MODULE_REF, [\n        ɵconstants.INJECTOR_KEY,\n        (injector: Injector) => ({injector}) as ɵutil.LazyModuleRef,\n      ])\n\n      .config([\n        ɵconstants.$PROVIDE,\n        ɵconstants.$INJECTOR,\n        ($provide: ɵangular1.IProvideService, $injector: ɵangular1.IInjectorService) => {\n          if ($injector.has(ɵconstants.$$TESTABILITY)) {\n            $provide.decorator(ɵconstants.$$TESTABILITY, [\n              ɵconstants.$DELEGATE,\n              (testabilityDelegate: ɵangular1.ITestabilityService) => {\n                const originalWhenStable: Function = testabilityDelegate.whenStable;\n                const injector = this.injector;\n                // Cannot use arrow function below because we need the context\n                const newWhenStable = function (callback: Function) {\n                  originalWhenStable.call(testabilityDelegate, function () {\n                    const ng2Testability: Testability = injector.get(Testability);\n                    if (ng2Testability.isStable()) {\n                      callback();\n                    } else {\n                      ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate, callback));\n                    }\n                  });\n                };\n\n                testabilityDelegate.whenStable = newWhenStable;\n                return testabilityDelegate;\n              },\n            ]);\n          }\n\n          if ($injector.has(ɵconstants.$INTERVAL)) {\n            $provide.decorator(ɵconstants.$INTERVAL, [\n              ɵconstants.$DELEGATE,\n              (intervalDelegate: ɵangular1.IIntervalService) => {\n                // Wrap the $interval service so that setInterval is called outside NgZone,\n                // but the callback is still invoked within it. This is so that $interval\n                // won't block stability, which preserves the behavior from AngularJS.\n                let wrappedInterval = (\n                  fn: Function,\n                  delay: number,\n                  count?: number,\n                  invokeApply?: boolean,\n                  ...pass: any[]\n                ) => {\n                  return this.ngZone.runOutsideAngular(() => {\n                    return intervalDelegate(\n                      (...args: any[]) => {\n                        // Run callback in the next VM turn - $interval calls\n                        // $rootScope.$apply, and running the callback in NgZone will\n                        // cause a '$digest already in progress' error if it's in the\n                        // same vm turn.\n                        setTimeout(() => {\n                          this.ngZone.run(() => fn(...args));\n                        });\n                      },\n                      delay,\n                      count,\n                      invokeApply,\n                      ...pass,\n                    );\n                  });\n                };\n\n                (Object.keys(intervalDelegate) as (keyof ɵangular1.IIntervalService)[]).forEach(\n                  (prop) => ((wrappedInterval as any)[prop] = intervalDelegate[prop]),\n                );\n\n                // the `flush` method will be present when ngMocks is used\n                if (intervalDelegate.hasOwnProperty('flush')) {\n                  (wrappedInterval as any)['flush'] = () => {\n                    (intervalDelegate as any)['flush']();\n                    return wrappedInterval;\n                  };\n                }\n\n                return wrappedInterval;\n              },\n            ]);\n          }\n        },\n      ])\n\n      .run([\n        ɵconstants.$INJECTOR,\n        ($injector: ɵangular1.IInjectorService) => {\n          this.$injector = $injector;\n          const $rootScope = $injector.get('$rootScope');\n\n          // Initialize the ng1 $injector provider\n          setTempInjectorRef($injector);\n          this.injector.get(ɵconstants.$INJECTOR);\n\n          // Put the injector on the DOM, so that it can be \"required\"\n          ɵangular1.element(element).data!(\n            ɵutil.controllerKey(ɵconstants.INJECTOR_KEY),\n            this.injector,\n          );\n\n          // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n          // This does not happen in a typical SPA scenario, but it might be useful for\n          // other use-cases where disposing of an Angular/AngularJS app is necessary\n          // (such as Hot Module Replacement (HMR)).\n          // See https://github.com/angular/angular/issues/39935.\n          this.platformRef.onDestroy(() => ɵutil.destroyApp($injector));\n\n          // Wire up the ng1 rootScope to run a digest cycle whenever the zone settles\n          // We need to do this in the next tick so that we don't prevent the bootup stabilizing\n          setTimeout(() => {\n            const synchronize = () => {\n              this.ngZone.run(() => {\n                if ($rootScope.$$phase) {\n                  if (typeof ngDevMode === 'undefined' || ngDevMode) {\n                    console.warn(\n                      'A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.',\n                    );\n                  }\n\n                  $rootScope.$evalAsync();\n                } else {\n                  $rootScope.$digest();\n                }\n              });\n            };\n            const subscription =\n              // We _DO NOT_ usually want to have any code that does one thing for zoneless and another for ZoneJS.\n              // This is only here because there is not enough coverage for hybrid apps anymore so we cannot\n              // be confident that making UpgradeModule work with zoneless is a non-breaking change.\n              this.ngZone instanceof ɵNoopNgZone\n                ? (this.applicationRef as any).afterTick.subscribe(() => synchronize())\n                : this.ngZone.onMicrotaskEmpty.subscribe(() => synchronize());\n            $rootScope.$on('$destroy', () => {\n              subscription.unsubscribe();\n            });\n          }, 0);\n        },\n      ]);\n\n    const upgradeModule = ɵangular1.module_(\n      ɵconstants.UPGRADE_MODULE_NAME,\n      [INIT_MODULE_NAME].concat(modules),\n    );\n\n    // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n    const windowAngular = (window as any)['angular'];\n    windowAngular.resumeBootstrap = undefined;\n\n    // Bootstrap the AngularJS application inside our zone\n    const returnValue = this.ngZone.run(() =>\n      ɵangular1.bootstrap(element, [upgradeModule.name], config),\n    );\n\n    // Patch resumeBootstrap() to run inside the ngZone\n    if (windowAngular.resumeBootstrap) {\n      const originalResumeBootstrap: () => void = windowAngular.resumeBootstrap;\n      const ngZone = this.ngZone;\n      windowAngular.resumeBootstrap = function () {\n        let args = arguments;\n        windowAngular.resumeBootstrap = originalResumeBootstrap;\n        return ngZone.run(() => windowAngular.resumeBootstrap.apply(this, args));\n      };\n    }\n\n    return returnValue;\n  }\n}\n"],"names":["PropertyBinding","prop","attr","bracketAttr","bracketParenAttr","parenAttr","onAttr","bindAttr","bindonAttr","constructor","capitalAttr","charAt","toUpperCase","slice","DIRECTIVE_PREFIX_REGEXP","DIRECTIVE_SPECIAL_CHARS_REGEXP","onError","e","console","error","stack","cleanData","node","angularElement","isParentNode","querySelectorAll","controllerKey","name","destroyApp","$injector","$rootElement","get","$ROOT_ELEMENT","$rootScope","$ROOT_SCOPE","$destroy","directiveNormalize","replace","_","letter","getTypeName","type","overriddenName","toString","split","getDowngradedModuleCount","has","DOWNGRADED_MODULE_COUNT_KEY","getUpgradeAppType","UPGRADE_APP_TYPE_KEY","isFunction","value","isNgModuleType","ɵNG_MOD_DEF","validateInjectionKey","downgradedModule","injectionKey","attemptedAction","upgradeAppType","downgradedModuleCount","Error","Deferred","promise","resolve","reject","Promise","res","rej","supportsNgModel","component","writeValue","registerOnChange","hookupNgModel","ngModel","$render","$viewValue","$setViewValue","bind","registerOnTouched","$setTouched","strictEquals","val1","val2","INITIAL_VALUE","__UNINITIALIZED__","DowngradeComponentAdapter","element","attrs","scope","parentInjector","$compile","$parse","componentFactory","wrapCallback","unsafelyOverwriteSignalInputs","implementsOnChanges","inputChangeCount","inputChanges","componentScope","$new","compileContents","compiledProjectableNodes","projectableNodes","groupProjectableNodes","linkFns","map","nodes","empty","forEach","linkFn","clone","push","append","createComponentAndSetup","manuallyAttachView","propagateDigest","createComponent","setupInputs","setupOutputs","componentRef","registerCleanup","providers","provide","$SCOPE","useValue","childInjector","Injector","create","parent","viewChangeDetector","injector","ChangeDetectorRef","changeDetector","changeDetectorRef","testability","Testability","TestabilityRegistry","registerApplication","location","nativeElement","instance","inputs","input","inputBinding","propName","templateName","expr","hasOwnProperty","observeFn","isSignal","prevValue","currValue","updateInput","$observe","unwatch","$watch","watchFn","detectChanges","prototype","componentType","ngOnChanges","markForCheck","appRef","ApplicationRef","attachView","hostView","outputs","output","outputBindings","substring","length","subscribeToOutput","isAssignment","getter","setter","assign","emitter","subscription","subscribe","v","onDestroy","unsubscribe","testabilityRegistry","destroyComponentRef","destroy","destroyed","on","$on","unregisterApplication","SimpleChange","SIGNAL","applyValueToInputSignal","ngContentSelectors","groupNodesBySelector","contents","i","ii","j","jj","ngContentIndex","findMatchingNgContentIndex","ngContentIndices","wildcardNgContentIndex","selector","matchesSelector","sort","el","elProto","Element","nodeType","Node","ELEMENT_NODE","matches","msMatchesSelector","call","isThenable","obj","then","SyncPromise","resolved","callbacks","all","valuesOrPromises","aggrPromise","resolvedCount","results","idx","p","callback","downgradeComponent","info","directiveFactory","isNgUpgradeLite","cb","NgZone","isInAngularZone","ngZone","run","hasMultipleDowngradedModules","restrict","terminal","require","REQUIRE_INJECTOR","REQUIRE_NG_MODEL","controller","link","required","moduleInjector","undefined","ranAsync","lazyModuleRefKey","LAZY_MODULE_REF","lazyModuleRef","finalParentInjector","finalModuleInjector","doDowngrade","componentFactoryResolver","ComponentFactoryResolver","resolveComponentFactory","injectorPromise","ParentInjectorPromise","facade","$evalAsync","downgradeFn","pInjector","mInjector","$COMPILE","$INJECTOR","$PARSE","injectorKey","INJECTOR_KEY","data","downgradeInjectable","token","factory","injectableName","String","err","message","policy","getPolicy","windowWithTrustedTypes","window","trustedTypes","createPolicy","createHTML","s","trustedHTMLFromLegacyTemplate","html","REQUIRE_PREFIX_RE","UpgradeHelper","$element","directive","$controller","elementRef","$CONTROLLER","getDirective","directives","compile","notSupported","getTemplate","fetchRemoteTemplate","template","getOrCall","templateUrl","$templateCache","$TEMPLATE_CACHE","url","$httpBackend","$HTTP_BACKEND","status","response","put","buildController","controllerType","$scope","locals","controllerAs","compileTemplate","compileHtml","controllerInstance","$onDestroy","prepareTransclusion","transclude","contentChildNodes","extractChildNodes","attachChildrenFn","cloneAttachFn","$template","slots","Object","slotMap","filledSlots","keys","slotName","optional","nodeName","toLowerCase","filter","cloneAttach","$$slots","TEXT_NODE","nodeValue","resolveAndBindRequiredControllers","directiveRequire","getDirectiveRequire","requiredControllers","resolveRequire","bindToController","isMap","requiredControllersMap","key","innerHTML","childNodes","childNode","firstChild","remove","entries","match","Array","isArray","req","inheritType","isOptional","searchParents","startOnParent","ctrlKey","elem","inheritedData","property","args","feature","tempInjectorRef","setTempInjectorRef","injectorFactory","rootScopeFactory","compileFactory","parseFactory","angular1Providers","useFactory","deps","NgAdapterInjector","modInjector","notFoundValue","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","moduleUid","downgradeModule","moduleOrBootstrapFn","lazyModuleName","ɵconstants","lazyInjectorKey","bootstrapFn","ɵutil","extraProviders","platformBrowser","bootstrapModule","applicationProviders","internalProvideZoneChangeDetection","bootstrapModuleFactory","ɵangular1","constant","identity","result","ref","PlatformRef","config","$provide","x","NOT_SUPPORTED","Bindings","twoWayBoundProperties","twoWayBoundLastValues","expressionBoundProperties","propertyToOutputMap","UpgradeComponent","helper","$componentScope","bindings","bindingDestination","pendingChanges","unregisterDoCheckWatcher","ɵupgradeHelper","initializeBindings","$parentScope","initializeOutputs","ngOnInit","attachChildNodes","bindOutputs","forwardChanges","$onInit","$doCheck","callDoCheck","$parent","preLink","pre","postLink","post","transcludeFn","parentBoundTranscludeFn","$postLink","changes","ngDoCheck","newValue","oldValue","is","outputName","eventEmitter","emit","ngOnDestroy","btcIsObject","context","definition","bindingType","json","JSON","stringify","concat","EventEmitter","currentValue","$onChanges","target","i0","ɵɵFactoryTarget","Directive","isStandalone","usesOnChanges","ngImport","decorators","UpgradeModule","platformRef","applicationRef","bootstrap","modules","INIT_MODULE_NAME","decorator","testabilityDelegate","originalWhenStable","whenStable","newWhenStable","ng2Testability","isStable","intervalDelegate","wrappedInterval","fn","delay","count","invokeApply","pass","runOutsideAngular","setTimeout","synchronize","$$phase","ngDevMode","warn","$digest","ɵNoopNgZone","afterTick","onMicrotaskEmpty","upgradeModule","windowAngular","resumeBootstrap","returnValue","originalResumeBootstrap","arguments","apply","NgModule","ɵinternalProvideZoneChangeDetection"],"mappings":";;;;;;;;;;;;;MAcaA,eAAe,CAAA;EASjBC,IAAA;EACAC,IAAA;EATTC,WAAW;EACXC,gBAAgB;EAChBC,SAAS;EACTC,MAAM;EACNC,QAAQ;EACRC,UAAU;AAEVC,EAAAA,WAAAA,CACSR,IAAY,EACZC,IAA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