MyRepo-Ums/node_modules/@angular/platform-browser/fesm2022/animations/async.mjs.map

1 line
18 KiB
Plaintext
Raw Normal View History

2024-01-19 10:09:11 +00:00
{"version":3,"file":"async.mjs","sources":["../../../../../../../packages/platform-browser/animations/async/src/async_animation_renderer.ts","../../../../../../../packages/platform-browser/animations/async/src/providers.ts","../../../../../../../packages/platform-browser/animations/async/src/async-animations.ts","../../../../../../../packages/platform-browser/animations/async/public_api.ts","../../../../../../../packages/platform-browser/animations/async/index.ts","../../../../../../../packages/platform-browser/animations/async/async.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.io/license\n */\n\nimport {ɵAnimationEngine as AnimationEngine, ɵAnimationRenderer as AnimationRenderer, ɵAnimationRendererFactory as AnimationRendererFactory} from '@angular/animations/browser';\nimport {NgZone, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, ɵAnimationRendererType as AnimationRendererType, ɵRuntimeError as RuntimeError} from '@angular/core';\nimport {ɵRuntimeErrorCode as RuntimeErrorCode} from '@angular/platform-browser';\n\nconst ANIMATION_PREFIX = '@';\n\nexport class AsyncAnimationRendererFactory implements RendererFactory2 {\n private _rendererFactoryPromise: Promise<AnimationRendererFactory>|null = null;\n\n /**\n *\n * @param moduleImpl allows to provide a mock implmentation (or will load the animation module)\n */\n constructor(\n private doc: Document, private delegate: RendererFactory2, private zone: NgZone,\n private animationType: 'animations'|'noop', private moduleImpl?: Promise<{\n ɵcreateEngine: (type: 'animations'|'noop', doc: Document) => AnimationEngine,\n ɵAnimationRendererFactory: typeof AnimationRendererFactory\n }>) {}\n\n /**\n * @internal\n */\n private loadImpl(): Promise<AnimationRendererFactory> {\n const moduleImpl = this.moduleImpl ?? import('@angular/animations/browser');\n\n return moduleImpl\n .catch((e) => {\n throw new RuntimeError(\n RuntimeErrorCode.ANIMATION_RENDERER_ASYNC_LOADING_FAILURE,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Async loading for animations package was ' +\n 'enabled, but loading failed. Angular falls back to using regular rendering. ' +\n 'No animations will be displayed and their styles won\\'t be applied.');\n })\n .then(({ɵcreateEngine, ɵAnimationRendererFactory}) => {\n // We can't create the renderer yet because we might need the hostElement and the type\n // Both are provided in createRenderer().\n const engine = ɵcreateEngine(this.animationType, this.doc);\n const rendererFactory = new ɵAnimationRendererFactory(this.delegate, engine, this.zone);\n this.delegate = rendererFactory;\n return rendererFactory;\n });\n }\n\n /**\n * This method is delegating the renderer creation to the factories.\n * It uses default factory while the animation factory isn't loaded\n * and will rely on the animation factory once it is loaded.\n *\n * Calling this method will trigger as side effect the loading of the animation module\n * if the renderered component uses animations.\n */\n createRenderer(hostElement: any, rendererType: RendererType2): Renderer2 {\n const renderer = this.delegate.createRenderer(hostElement, rendererType);\n\n if ((renderer as AnimationRenderer).ɵtype === AnimationRendererType.Regular) {\n // The factory is already loaded, this is an animation renderer\n return renderer;\n }\n\n // We need to prevent the DomRenderer to throw an error because of synthetic properties\n if (typeof (renderer as any).throwOnSyntheticProps === 'boolean') {\n (renderer as any).throwOnSyntheticProps = false;\n }\n\n // Using a dynamic renderer to switch the renderer implementation once the module is