/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define("@angular/compiler-cli/src/transformers/program", ["require", "exports", "tslib", "@angular/compiler", "fs", "path", "typescript", "@angular/compiler-cli/src/diagnostics/translate_diagnostics", "@angular/compiler-cli/src/metadata/index", "@angular/compiler-cli/src/ngtsc/core/src/compiler", "@angular/compiler-cli/src/ngtsc/program", "@angular/compiler-cli/src/ngtsc/reflection", "@angular/compiler-cli/src/typescript_support", "@angular/compiler-cli/src/transformers/api", "@angular/compiler-cli/src/transformers/compiler_host", "@angular/compiler-cli/src/transformers/downlevel_decorators_transform", "@angular/compiler-cli/src/transformers/i18n", "@angular/compiler-cli/src/transformers/inline_resources", "@angular/compiler-cli/src/transformers/lower_expressions", "@angular/compiler-cli/src/transformers/metadata_cache", "@angular/compiler-cli/src/transformers/node_emitter_transform", "@angular/compiler-cli/src/transformers/r3_metadata_transform", "@angular/compiler-cli/src/transformers/r3_transform", "@angular/compiler-cli/src/transformers/util"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSrcToOutPathMapper = exports.createProgram = exports.resetTempProgramHandlerForTest = exports.setTempProgramHandlerForTest = void 0; var tslib_1 = require("tslib"); var compiler_1 = require("@angular/compiler"); var fs = require("fs"); var path = require("path"); var ts = require("typescript"); var translate_diagnostics_1 = require("@angular/compiler-cli/src/diagnostics/translate_diagnostics"); var metadata_1 = require("@angular/compiler-cli/src/metadata/index"); var compiler_2 = require("@angular/compiler-cli/src/ngtsc/core/src/compiler"); var program_1 = require("@angular/compiler-cli/src/ngtsc/program"); var reflection_1 = require("@angular/compiler-cli/src/ngtsc/reflection"); var typescript_support_1 = require("@angular/compiler-cli/src/typescript_support"); var api_1 = require("@angular/compiler-cli/src/transformers/api"); var compiler_host_1 = require("@angular/compiler-cli/src/transformers/compiler_host"); var downlevel_decorators_transform_1 = require("@angular/compiler-cli/src/transformers/downlevel_decorators_transform"); var i18n_1 = require("@angular/compiler-cli/src/transformers/i18n"); var inline_resources_1 = require("@angular/compiler-cli/src/transformers/inline_resources"); var lower_expressions_1 = require("@angular/compiler-cli/src/transformers/lower_expressions"); var metadata_cache_1 = require("@angular/compiler-cli/src/transformers/metadata_cache"); var node_emitter_transform_1 = require("@angular/compiler-cli/src/transformers/node_emitter_transform"); var r3_metadata_transform_1 = require("@angular/compiler-cli/src/transformers/r3_metadata_transform"); var r3_transform_1 = require("@angular/compiler-cli/src/transformers/r3_transform"); var util_1 = require("@angular/compiler-cli/src/transformers/util"); /** * Maximum number of files that are emitable via calling ts.Program.emit * passing individual targetSourceFiles. */ var MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT = 20; /** * Fields to lower within metadata in render2 mode. */ var LOWER_FIELDS = ['useValue', 'useFactory', 'data', 'id', 'loadChildren']; /** * Fields to lower within metadata in render3 mode. */ var R3_LOWER_FIELDS = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(LOWER_FIELDS)), ['providers', 'imports', 'exports']); /** * Installs a handler for testing purposes to allow inspection of the temporary program. */ var tempProgramHandlerForTest = null; function setTempProgramHandlerForTest(handler) { tempProgramHandlerForTest = handler; } exports.setTempProgramHandlerForTest = setTempProgramHandlerForTest; function resetTempProgramHandlerForTest() { tempProgramHandlerForTest = null; } exports.resetTempProgramHandlerForTest = resetTempProgramHandlerForTest; var emptyModules = { ngModules: [], ngModuleByPipeOrDirective: new Map(), files: [] }; var defaultEmitCallback = function (_a) { var program = _a.program, targetSourceFile = _a.targetSourceFile, writeFile = _a.writeFile, cancellationToken = _a.cancellationToken, emitOnlyDtsFiles = _a.emitOnlyDtsFiles, customTransformers = _a.customTransformers; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }; var AngularCompilerProgram = /** @class */ (function () { function AngularCompilerProgram(rootNames, options, host, oldProgram) { var _a; var _this = this; this.options = options; this.host = host; this._optionsDiagnostics = []; this._transformTsDiagnostics = []; this._isCompilingAngularCore = null; this.rootNames = tslib_1.__spreadArray([], tslib_1.__read(rootNames)); if (!options.disableTypeScriptVersionCheck) { typescript_support_1.verifySupportedTypeScriptVersion(); } this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined; if (oldProgram) { this.oldProgramLibrarySummaries = oldProgram.getLibrarySummaries(); this.oldProgramEmittedGeneratedFiles = oldProgram.getEmittedGeneratedFiles(); this.oldProgramEmittedSourceFiles = oldProgram.getEmittedSourceFiles(); } if (options.flatModuleOutFile) { var _b = metadata_1.createBundleIndexHost(options, this.rootNames, host, function () { return _this.flatModuleMetadataCache; }), bundleHost = _b.host, indexName = _b.indexName, errors = _b.errors; if (errors) { (_a = this._optionsDiagnostics).push.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(errors.map(function (e) { return ({ category: e.category, messageText: e.messageText, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE }); })))); } else { this.rootNames.push(indexName); this.host = bundleHost; } } this.loweringMetadataTransform = new lower_expressions_1.LowerMetadataTransform(options.enableIvy !== false ? R3_LOWER_FIELDS : LOWER_FIELDS); this.metadataCache = this.createMetadataCache([this.loweringMetadataTransform]); } AngularCompilerProgram.prototype.createMetadataCache = function (transformers) { return new metadata_cache_1.MetadataCache(new metadata_1.MetadataCollector({ quotedNames: true }), !!this.options.strictMetadataEmit, transformers); }; AngularCompilerProgram.prototype.getLibrarySummaries = function () { var result = new Map(); if (this.oldProgramLibrarySummaries) { this.oldProgramLibrarySummaries.forEach(function (summary, fileName) { return result.set(fileName, summary); }); } if (this.emittedLibrarySummaries) { this.emittedLibrarySummaries.forEach(function (summary, fileName) { return result.set(summary.fileName, summary); }); } return result; }; AngularCompilerProgram.prototype.getEmittedGeneratedFiles = function () { var result = new Map(); if (this.oldProgramEmittedGeneratedFiles) { this.oldProgramEmittedGeneratedFiles.forEach(function (genFile, fileName) { return result.set(fileName, genFile); }); } if (this.emittedGeneratedFiles) { this.emittedGeneratedFiles.forEach(function (genFile) { return result.set(genFile.genFileUrl, genFile); }); } return result; }; AngularCompilerProgram.prototype.getEmittedSourceFiles = function () { var result = new Map(); if (this.oldProgramEmittedSourceFiles) { this.oldProgramEmittedSourceFiles.forEach(function (sf, fileName) { return result.set(fileName, sf); }); } if (this.emittedSourceFiles) { this.emittedSourceFiles.forEach(function (sf) { return result.set(sf.fileName, sf); }); } return result; }; AngularCompilerProgram.prototype.getTsProgram = function () { return this.tsProgram; }; AngularCompilerProgram.prototype.getTsOptionDiagnostics = function (cancellationToken) { return this.tsProgram.getOptionsDiagnostics(cancellationToken); }; AngularCompilerProgram.prototype.getNgOptionDiagnostics = function (cancellationToken) { return tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(this._optionsDiagnostics)), tslib_1.__read(getNgOptionDiagnostics(this.options))); }; AngularCompilerProgram.prototype.getTsSyntacticDiagnostics = function (sourceFile, cancellationToken) { return this.tsProgram.getSyntacticDiagnostics(sourceFile, cancellationToken); }; AngularCompilerProgram.prototype.getNgStructuralDiagnostics = function (cancellationToken) { return this.structuralDiagnostics; }; AngularCompilerProgram.prototype.getTsSemanticDiagnostics = function (sourceFile, cancellationToken) { var _this = this; var sourceFiles = sourceFile ? [sourceFile] : this.tsProgram.getSourceFiles(); var diags = []; sourceFiles.forEach(function (sf) { if (!util_1.GENERATED_FILES.test(sf.fileName)) { diags.push.apply(diags, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSemanticDiagnostics(sf, cancellationToken)))); } }); return diags; }; AngularCompilerProgram.prototype.getNgSemanticDiagnostics = function (fileName, cancellationToken) { var _this = this; var diags = []; this.tsProgram.getSourceFiles().forEach(function (sf) { if (util_1.GENERATED_FILES.test(sf.fileName) && !sf.isDeclarationFile) { diags.push.apply(diags, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSemanticDiagnostics(sf, cancellationToken)))); } }); var ng = translate_diagnostics_1.translateDiagnostics(this.hostAdapter, diags).ng; return ng; }; AngularCompilerProgram.prototype.loadNgStructureAsync = function () { var _this = this; if (this._analyzedModules) { throw new Error('Angular structure already loaded'); } return Promise.resolve() .then(function () { var _a = _this._createProgramWithBasicStubs(), tmpProgram = _a.tmpProgram, sourceFiles = _a.sourceFiles, tsFiles = _a.tsFiles, rootNames = _a.rootNames; return _this.compiler.loadFilesAsync(sourceFiles, tsFiles) .then(function (_a) { var analyzedModules = _a.analyzedModules, analyzedInjectables = _a.analyzedInjectables; if (_this._analyzedModules) { throw new Error('Angular structure loaded both synchronously and asynchronously'); } _this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, analyzedInjectables, rootNames); }); }) .catch(function (e) { return _this._createProgramOnError(e); }); }; AngularCompilerProgram.prototype.listLazyRoutes = function (route) { // Note: Don't analyzedModules if a route is given // to be fast enough. return this.compiler.listLazyRoutes(route, route ? undefined : this.analyzedModules); }; AngularCompilerProgram.prototype.emit = function (parameters) { if (parameters === void 0) { parameters = {}; } if (this.options.enableIvy !== false) { throw new Error('Cannot run legacy compiler in ngtsc mode'); } return this._emitRender2(parameters); }; AngularCompilerProgram.prototype._emitRender2 = function (_a) { var e_1, _b, e_2, _c; var _this = this; var _d = _a === void 0 ? {} : _a, _e = _d.emitFlags, emitFlags = _e === void 0 ? api_1.EmitFlags.Default : _e, cancellationToken = _d.cancellationToken, customTransformers = _d.customTransformers, _f = _d.emitCallback, emitCallback = _f === void 0 ? defaultEmitCallback : _f, _g = _d.mergeEmitResultsCallback, mergeEmitResultsCallback = _g === void 0 ? mergeEmitResults : _g; var emitStart = Date.now(); if (emitFlags & api_1.EmitFlags.I18nBundle) { var locale = this.options.i18nOutLocale || null; var file = this.options.i18nOutFile || null; var format = this.options.i18nOutFormat || null; var bundle = this.compiler.emitMessageBundle(this.analyzedModules, locale); i18n_1.i18nExtract(format, file, this.host, this.options, bundle); } if ((emitFlags & (api_1.EmitFlags.JS | api_1.EmitFlags.DTS | api_1.EmitFlags.Metadata | api_1.EmitFlags.Codegen)) === 0) { return { emitSkipped: true, diagnostics: [], emittedFiles: [] }; } var _h = this.generateFilesForEmit(emitFlags), genFiles = _h.genFiles, genDiags = _h.genDiags; if (genDiags.length) { return { diagnostics: genDiags, emitSkipped: true, emittedFiles: [], }; } this.emittedGeneratedFiles = genFiles; var outSrcMapping = []; var genFileByFileName = new Map(); genFiles.forEach(function (genFile) { return genFileByFileName.set(genFile.genFileUrl, genFile); }); this.emittedLibrarySummaries = []; this._transformTsDiagnostics = []; var emittedSourceFiles = []; var writeTsFile = function (outFileName, outData, writeByteOrderMark, onError, sourceFiles) { var sourceFile = sourceFiles && sourceFiles.length == 1 ? sourceFiles[0] : null; var genFile; if (sourceFile) { outSrcMapping.push({ outFileName: outFileName, sourceFile: sourceFile }); genFile = genFileByFileName.get(sourceFile.fileName); if (!sourceFile.isDeclarationFile && !util_1.GENERATED_FILES.test(sourceFile.fileName)) { // Note: sourceFile is the transformed sourcefile, not the original one! var originalFile = _this.tsProgram.getSourceFile(sourceFile.fileName); if (originalFile) { emittedSourceFiles.push(originalFile); } } } _this.writeFile(outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles); }; var modules = this._analyzedInjectables && this.compiler.emitAllPartialModules2(this._analyzedInjectables); var tsCustomTransformers = this.calculateTransforms(genFileByFileName, modules, customTransformers); var emitOnlyDtsFiles = (emitFlags & (api_1.EmitFlags.DTS | api_1.EmitFlags.JS)) == api_1.EmitFlags.DTS; // Restore the original references before we emit so TypeScript doesn't emit // a reference to the .d.ts file. var augmentedReferences = new Map(); try { for (var _j = tslib_1.__values(this.tsProgram.getSourceFiles()), _k = _j.next(); !_k.done; _k = _j.next()) { var sourceFile = _k.value; var originalReferences = compiler_host_1.getOriginalReferences(sourceFile); if (originalReferences) { augmentedReferences.set(sourceFile, sourceFile.referencedFiles); sourceFile.referencedFiles = originalReferences; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_k && !_k.done && (_b = _j.return)) _b.call(_j); } finally { if (e_1) throw e_1.error; } } var genTsFiles = []; var genJsonFiles = []; genFiles.forEach(function (gf) { if (gf.stmts) { genTsFiles.push(gf); } if (gf.source) { genJsonFiles.push(gf); } }); var emitResult; var emittedUserTsCount; try { var sourceFilesToEmit = this.getSourceFilesForEmit(); if (sourceFilesToEmit && (sourceFilesToEmit.length + genTsFiles.length) < MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT) { var fileNamesToEmit = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(sourceFilesToEmit.map(function (sf) { return sf.fileName; }))), tslib_1.__read(genTsFiles.map(function (gf) { return gf.genFileUrl; }))); emitResult = mergeEmitResultsCallback(fileNamesToEmit.map(function (fileName) { return emitResult = emitCallback({ program: _this.tsProgram, host: _this.host, options: _this.options, writeFile: writeTsFile, emitOnlyDtsFiles: emitOnlyDtsFiles, customTransformers: tsCustomTransformers, targetSourceFile: _this.tsProgram.getSourceFile(fileName), }); })); emittedUserTsCount = sourceFilesToEmit.length; } else { emitResult = emitCallback({ program: this.tsProgram, host: this.host, options: this.options, writeFile: writeTsFile, emitOnlyDtsFiles: emitOnlyDtsFiles, customTransformers: tsCustomTransformers }); emittedUserTsCount = this.tsProgram.getSourceFiles().length - genTsFiles.length; } } finally { try { // Restore the references back to the augmented value to ensure that the // checks that TypeScript makes for project structure reuse will succeed. for (var _l = tslib_1.__values(Array.from(augmentedReferences)), _m = _l.next(); !_m.done; _m = _l.next()) { var _o = tslib_1.__read(_m.value, 2), sourceFile = _o[0], references = _o[1]; // TODO(chuckj): Remove any cast after updating build to 2.6 sourceFile.referencedFiles = references; } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_m && !_m.done && (_c = _l.return)) _c.call(_l); } finally { if (e_2) throw e_2.error; } } } this.emittedSourceFiles = emittedSourceFiles; // Match behavior of tsc: only produce emit diagnostics if it would block // emit. If noEmitOnError is false, the emit will happen in spite of any // errors, so we should not report them. if (emitResult && this.options.noEmitOnError === true) { // translate the diagnostics in the emitResult as well. var translatedEmitDiags = translate_diagnostics_1.translateDiagnostics(this.hostAdapter, emitResult.diagnostics); emitResult.diagnostics = translatedEmitDiags.ts.concat(this.structuralDiagnostics.concat(translatedEmitDiags.ng).map(util_1.ngToTsDiagnostic)); } if (emitResult && !outSrcMapping.length) { // if no files were emitted by TypeScript, also don't emit .json files emitResult.diagnostics = emitResult.diagnostics.concat([util_1.createMessageDiagnostic("Emitted no files.")]); return emitResult; } var sampleSrcFileName; var sampleOutFileName; if (outSrcMapping.length) { sampleSrcFileName = outSrcMapping[0].sourceFile.fileName; sampleOutFileName = outSrcMapping[0].outFileName; } var srcToOutPath = createSrcToOutPathMapper(this.options.outDir, sampleSrcFileName, sampleOutFileName); if (emitFlags & api_1.EmitFlags.Codegen) { genJsonFiles.forEach(function (gf) { var outFileName = srcToOutPath(gf.genFileUrl); _this.writeFile(outFileName, gf.source, false, undefined, gf); }); } var metadataJsonCount = 0; if (emitFlags & api_1.EmitFlags.Metadata) { this.tsProgram.getSourceFiles().forEach(function (sf) { if (!sf.isDeclarationFile && !util_1.GENERATED_FILES.test(sf.fileName)) { metadataJsonCount++; var metadata = _this.metadataCache.getMetadata(sf); if (metadata) { var metadataText = JSON.stringify([metadata]); var outFileName = srcToOutPath(sf.fileName.replace(/\.tsx?$/, '.metadata.json')); _this.writeFile(outFileName, metadataText, false, undefined, undefined, [sf]); } } }); } var emitEnd = Date.now(); if (emitResult && this.options.diagnostics) { emitResult.diagnostics = emitResult.diagnostics.concat([util_1.createMessageDiagnostic([ "Emitted in " + (emitEnd - emitStart) + "ms", "- " + emittedUserTsCount + " user ts files", "- " + genTsFiles.length + " generated ts files", "- " + (genJsonFiles.length + metadataJsonCount) + " generated json files", ].join('\n'))]); } return emitResult; }; Object.defineProperty(AngularCompilerProgram.prototype, "compiler", { // Private members get: function () { if (!this._compiler) { this._createCompiler(); } return this._compiler; }, enumerable: false, configurable: true }); Object.defineProperty(AngularCompilerProgram.prototype, "hostAdapter", { get: function () { if (!this._hostAdapter) { this._createCompiler(); } return this._hostAdapter; }, enumerable: false, configurable: true }); Object.defineProperty(AngularCompilerProgram.prototype, "analyzedModules", { get: function () { if (!this._analyzedModules) { this.initSync(); } return this._analyzedModules; }, enumerable: false, configurable: true }); Object.defineProperty(AngularCompilerProgram.prototype, "structuralDiagnostics", { get: function () { var diagnostics = this._structuralDiagnostics; if (!diagnostics) { this.initSync(); diagnostics = (this._structuralDiagnostics = this._structuralDiagnostics || []); } return diagnostics; }, enumerable: false, configurable: true }); Object.defineProperty(AngularCompilerProgram.prototype, "tsProgram", { get: function () { if (!this._tsProgram) { this.initSync(); } return this._tsProgram; }, enumerable: false, configurable: true }); Object.defineProperty(AngularCompilerProgram.prototype, "isCompilingAngularCore", { /** Whether the program is compiling the Angular core package. */ get: function () { if (this._isCompilingAngularCore !== null) { return this._isCompilingAngularCore; } return this._isCompilingAngularCore = compiler_2.isAngularCorePackage(this.tsProgram); }, enumerable: false, configurable: true }); AngularCompilerProgram.prototype.calculateTransforms = function (genFiles, partialModules, customTransformers) { var beforeTs = []; var metadataTransforms = []; var flatModuleMetadataTransforms = []; var annotateForClosureCompiler = this.options.annotateForClosureCompiler || false; if (this.options.enableResourceInlining) { beforeTs.push(inline_resources_1.getInlineResourcesTransformFactory(this.tsProgram, this.hostAdapter)); var transformer = new inline_resources_1.InlineResourcesMetadataTransformer(this.hostAdapter); metadataTransforms.push(transformer); flatModuleMetadataTransforms.push(transformer); } if (!this.options.disableExpressionLowering) { beforeTs.push(lower_expressions_1.getExpressionLoweringTransformFactory(this.loweringMetadataTransform, this.tsProgram)); metadataTransforms.push(this.loweringMetadataTransform); } if (genFiles) { beforeTs.push(node_emitter_transform_1.getAngularEmitterTransformFactory(genFiles, this.getTsProgram(), annotateForClosureCompiler)); } if (partialModules) { beforeTs.push(r3_transform_1.getAngularClassTransformerFactory(partialModules, annotateForClosureCompiler)); // If we have partial modules, the cached metadata might be incorrect as it doesn't reflect // the partial module transforms. var transformer = new r3_metadata_transform_1.PartialModuleMetadataTransformer(partialModules); metadataTransforms.push(transformer); flatModuleMetadataTransforms.push(transformer); } if (customTransformers && customTransformers.beforeTs) { beforeTs.push.apply(beforeTs, tslib_1.__spreadArray([], tslib_1.__read(customTransformers.beforeTs))); } // If decorators should be converted to static fields (enabled by default), we set up // the decorator downlevel transform. Note that we set it up as last transform as that // allows custom transformers to strip Angular decorators without having to deal with // identifying static properties. e.g. it's more difficult handling `<..>.decorators` // or `<..>.ctorParameters` compared to the `ts.Decorator` AST nodes. if (this.options.annotationsAs !== 'decorators') { var typeChecker = this.getTsProgram().getTypeChecker(); var reflectionHost = new reflection_1.TypeScriptReflectionHost(typeChecker); // Similarly to how we handled tsickle decorator downleveling in the past, we just // ignore diagnostics that have been collected by the transformer. These are // non-significant failures that shouldn't prevent apps from compiling. beforeTs.push(downlevel_decorators_transform_1.getDownlevelDecoratorsTransform(typeChecker, reflectionHost, [], this.isCompilingAngularCore, annotateForClosureCompiler, /* skipClassDecorators */ false)); } if (metadataTransforms.length > 0) { this.metadataCache = this.createMetadataCache(metadataTransforms); } if (flatModuleMetadataTransforms.length > 0) { this.flatModuleMetadataCache = this.createMetadataCache(flatModuleMetadataTransforms); } var afterTs = customTransformers ? customTransformers.afterTs : undefined; return { before: beforeTs, after: afterTs }; }; AngularCompilerProgram.prototype.initSync = function () { if (this._analyzedModules) { return; } try { var _a = this._createProgramWithBasicStubs(), tmpProgram = _a.tmpProgram, sourceFiles = _a.sourceFiles, tsFiles = _a.tsFiles, rootNames = _a.rootNames; var _b = this.compiler.loadFilesSync(sourceFiles, tsFiles), analyzedModules = _b.analyzedModules, analyzedInjectables = _b.analyzedInjectables; this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, analyzedInjectables, rootNames); } catch (e) { this._createProgramOnError(e); } }; AngularCompilerProgram.prototype._createCompiler = function () { var _this = this; var codegen = { generateFile: function (genFileName, baseFileName) { return _this._compiler.emitBasicStub(genFileName, baseFileName); }, findGeneratedFileNames: function (fileName) { return _this._compiler.findGeneratedFileNames(fileName); }, }; this._hostAdapter = new compiler_host_1.TsCompilerAotCompilerTypeCheckHostAdapter(this.rootNames, this.options, this.host, this.metadataCache, codegen, this.oldProgramLibrarySummaries); var aotOptions = getAotCompilerOptions(this.options); var errorCollector = (this.options.collectAllErrors || this.options.fullTemplateTypeCheck) ? function (err) { return _this._addStructuralDiagnostics(err); } : undefined; this._compiler = compiler_1.createAotCompiler(this._hostAdapter, aotOptions, errorCollector).compiler; }; AngularCompilerProgram.prototype._createProgramWithBasicStubs = function () { var _this = this; if (this._analyzedModules) { throw new Error("Internal Error: already initialized!"); } // Note: This is important to not produce a memory leak! var oldTsProgram = this.oldTsProgram; this.oldTsProgram = undefined; var codegen = { generateFile: function (genFileName, baseFileName) { return _this.compiler.emitBasicStub(genFileName, baseFileName); }, findGeneratedFileNames: function (fileName) { return _this.compiler.findGeneratedFileNames(fileName); }, }; var rootNames = tslib_1.__spreadArray([], tslib_1.__read(this.rootNames)); if (this.options.generateCodeForLibraries !== false) { // if we should generateCodeForLibraries, never include // generated files in the program as otherwise we will // overwrite them and typescript will report the error // TS5055: Cannot write file ... because it would overwrite input file. rootNames = rootNames.filter(function (fn) { return !util_1.GENERATED_FILES.test(fn); }); } if (this.options.noResolve) { this.rootNames.forEach(function (rootName) { if (_this.hostAdapter.shouldGenerateFilesFor(rootName)) { rootNames.push.apply(rootNames, tslib_1.__spreadArray([], tslib_1.__read(_this.compiler.findGeneratedFileNames(rootName)))); } }); } var tmpProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram); if (tempProgramHandlerForTest !== null) { tempProgramHandlerForTest(tmpProgram); } var sourceFiles = []; var tsFiles = []; tmpProgram.getSourceFiles().forEach(function (sf) { if (_this.hostAdapter.isSourceFile(sf.fileName)) { sourceFiles.push(sf.fileName); } if (util_1.TS.test(sf.fileName) && !util_1.DTS.test(sf.fileName)) { tsFiles.push(sf.fileName); } }); return { tmpProgram: tmpProgram, sourceFiles: sourceFiles, tsFiles: tsFiles, rootNames: rootNames }; }; AngularCompilerProgram.prototype._updateProgramWithTypeCheckStubs = function (tmpProgram, analyzedModules, analyzedInjectables, rootNames) { var _this = this; this._analyzedModules = analyzedModules; this._analyzedInjectables = analyzedInjectables; tmpProgram.getSourceFiles().forEach(function (sf) { if (sf.fileName.endsWith('.ngfactory.ts')) { var _a = _this.hostAdapter.shouldGenerateFile(sf.fileName), generate = _a.generate, baseFileName = _a.baseFileName; if (generate) { // Note: ! is ok as hostAdapter.shouldGenerateFile will always return a baseFileName // for .ngfactory.ts files. var genFile = _this.compiler.emitTypeCheckStub(sf.fileName, baseFileName); if (genFile) { _this.hostAdapter.updateGeneratedFile(genFile); } } } }); this._tsProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, tmpProgram); // Note: the new ts program should be completely reusable by TypeScript as: // - we cache all the files in the hostAdapter // - new new stubs use the exactly same imports/exports as the old once (we assert that in // hostAdapter.updateGeneratedFile). if (util_1.tsStructureIsReused(this._tsProgram) !== 2 /* Completely */) { throw new Error("Internal Error: The structure of the program changed during codegen."); } }; AngularCompilerProgram.prototype._createProgramOnError = function (e) { // Still fill the analyzedModules and the tsProgram // so that we don't cause other errors for users who e.g. want to emit the ngProgram. this._analyzedModules = emptyModules; this.oldTsProgram = undefined; this._hostAdapter.isSourceFile = function () { return false; }; this._tsProgram = ts.createProgram(this.rootNames, this.options, this.hostAdapter); if (compiler_1.isSyntaxError(e)) { this._addStructuralDiagnostics(e); return; } throw e; }; AngularCompilerProgram.prototype._addStructuralDiagnostics = function (error) { var diagnostics = this._structuralDiagnostics || (this._structuralDiagnostics = []); if (compiler_1.isSyntaxError(error)) { diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(syntaxErrorToDiagnostics(error, this.tsProgram)))); } else { diagnostics.push({ messageText: error.toString(), category: ts.DiagnosticCategory.Error, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE }); } }; // Note: this returns a ts.Diagnostic so that we // can return errors in a ts.EmitResult AngularCompilerProgram.prototype.generateFilesForEmit = function (emitFlags) { var _this = this; try { if (!(emitFlags & api_1.EmitFlags.Codegen)) { return { genFiles: [], genDiags: [] }; } // TODO(tbosch): allow generating files that are not in the rootDir // See https://github.com/angular/angular/issues/19337 var genFiles = this.compiler.emitAllImpls(this.analyzedModules) .filter(function (genFile) { return util_1.isInRootDir(genFile.genFileUrl, _this.options); }); if (this.oldProgramEmittedGeneratedFiles) { var oldProgramEmittedGeneratedFiles_1 = this.oldProgramEmittedGeneratedFiles; genFiles = genFiles.filter(function (genFile) { var oldGenFile = oldProgramEmittedGeneratedFiles_1.get(genFile.genFileUrl); return !oldGenFile || !genFile.isEquivalent(oldGenFile); }); } return { genFiles: genFiles, genDiags: [] }; } catch (e) { // TODO(tbosch): check whether we can actually have syntax errors here, // as we already parsed the metadata and templates before to create the type check block. if (compiler_1.isSyntaxError(e)) { var genDiags = [{ file: undefined, start: undefined, length: undefined, messageText: e.message, category: ts.DiagnosticCategory.Error, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE }]; return { genFiles: [], genDiags: genDiags }; } throw e; } }; /** * Returns undefined if all files should be emitted. */ AngularCompilerProgram.prototype.getSourceFilesForEmit = function () { var _this = this; // TODO(tbosch): if one of the files contains a `const enum` // always emit all files -> return undefined! var sourceFilesToEmit = this.tsProgram.getSourceFiles().filter(function (sf) { return !sf.isDeclarationFile && !util_1.GENERATED_FILES.test(sf.fileName); }); if (this.oldProgramEmittedSourceFiles) { sourceFilesToEmit = sourceFilesToEmit.filter(function (sf) { var oldFile = _this.oldProgramEmittedSourceFiles.get(sf.fileName); return sf !== oldFile; }); } return sourceFilesToEmit; }; AngularCompilerProgram.prototype.writeFile = function (outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles) { // collect emittedLibrarySummaries var baseFile; if (genFile) { baseFile = this.tsProgram.getSourceFile(genFile.srcFileUrl); if (baseFile) { if (!this.emittedLibrarySummaries) { this.emittedLibrarySummaries = []; } if (genFile.genFileUrl.endsWith('.ngsummary.json') && baseFile.fileName.endsWith('.d.ts')) { this.emittedLibrarySummaries.push({ fileName: baseFile.fileName, text: baseFile.text, sourceFile: baseFile, }); this.emittedLibrarySummaries.push({ fileName: genFile.genFileUrl, text: outData }); if (!this.options.declaration) { // If we don't emit declarations, still record an empty .ngfactory.d.ts file, // as we might need it later on for resolving module names from summaries. var ngFactoryDts = genFile.genFileUrl.substring(0, genFile.genFileUrl.length - 15) + '.ngfactory.d.ts'; this.emittedLibrarySummaries.push({ fileName: ngFactoryDts, text: '' }); } } else if (outFileName.endsWith('.d.ts') && baseFile.fileName.endsWith('.d.ts')) { var dtsSourceFilePath = genFile.genFileUrl.replace(/\.ts$/, '.d.ts'); // Note: Don't use sourceFiles here as the created .d.ts has a path in the outDir, // but we need one that is next to the .ts file this.emittedLibrarySummaries.push({ fileName: dtsSourceFilePath, text: outData }); } } } // Filter out generated files for which we didn't generate code. // This can happen as the stub calculation is not completely exact. // Note: sourceFile refers to the .ngfactory.ts / .ngsummary.ts file // node_emitter_transform already set the file contents to be empty, // so this code only needs to skip the file if !allowEmptyCodegenFiles. var isGenerated = util_1.GENERATED_FILES.test(outFileName); if (isGenerated && !this.options.allowEmptyCodegenFiles && (!genFile || !genFile.stmts || genFile.stmts.length === 0)) { return; } if (baseFile) { sourceFiles = sourceFiles ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(sourceFiles)), [baseFile]) : [baseFile]; } // TODO: remove any when TS 2.4 support is removed. this.host.writeFile(outFileName, outData, writeByteOrderMark, onError, sourceFiles); }; return AngularCompilerProgram; }()); function createProgram(_a) { var rootNames = _a.rootNames, options = _a.options, host = _a.host, oldProgram = _a.oldProgram; if (options.enableIvy !== false) { return new program_1.NgtscProgram(rootNames, options, host, oldProgram); } else { return new AngularCompilerProgram(rootNames, options, host, oldProgram); } } exports.createProgram = createProgram; // Compute the AotCompiler options function getAotCompilerOptions(options) { var missingTranslation = compiler_1.core.MissingTranslationStrategy.Warning; switch (options.i18nInMissingTranslations) { case 'ignore': missingTranslation = compiler_1.core.MissingTranslationStrategy.Ignore; break; case 'error': missingTranslation = compiler_1.core.MissingTranslationStrategy.Error; break; } var translations = ''; if (options.i18nInFile) { if (!options.i18nInLocale) { throw new Error("The translation file (" + options.i18nInFile + ") locale must be provided."); } translations = fs.readFileSync(options.i18nInFile, 'utf8'); } else { // No translations are provided, ignore any errors // We still go through i18n to remove i18n attributes missingTranslation = compiler_1.core.MissingTranslationStrategy.Ignore; } return { locale: options.i18nInLocale, i18nFormat: options.i18nInFormat || options.i18nOutFormat, i18nUseExternalIds: options.i18nUseExternalIds, translations: translations, missingTranslation: missingTranslation, enableSummariesForJit: options.enableSummariesForJit, preserveWhitespaces: options.preserveWhitespaces, fullTemplateTypeCheck: options.fullTemplateTypeCheck, allowEmptyCodegenFiles: options.allowEmptyCodegenFiles, enableIvy: options.enableIvy, createExternalSymbolFactoryReexports: options.createExternalSymbolFactoryReexports, }; } function getNgOptionDiagnostics(options) { if (options.annotationsAs) { switch (options.annotationsAs) { case 'decorators': case 'static fields': break; default: return [{ messageText: 'Angular compiler options "annotationsAs" only supports "static fields" and "decorators"', category: ts.DiagnosticCategory.Error, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE }]; } } return []; } function normalizeSeparators(path) { return path.replace(/\\/g, '/'); } /** * Returns a function that can adjust a path from source path to out path, * based on an existing mapping from source to out path. * * TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir` * if none was specified. * * Note: This function works on normalized paths from typescript but should always return * POSIX normalized paths for output paths. */ function createSrcToOutPathMapper(outDir, sampleSrcFileName, sampleOutFileName, host) { if (host === void 0) { host = path; } if (outDir) { var path_1 = {}; // Ensure we error if we use `path` instead of `host`. if (sampleSrcFileName == null || sampleOutFileName == null) { throw new Error("Can't calculate the rootDir without a sample srcFileName / outFileName. "); } var srcFileDir = normalizeSeparators(host.dirname(sampleSrcFileName)); var outFileDir = normalizeSeparators(host.dirname(sampleOutFileName)); if (srcFileDir === outFileDir) { return function (srcFileName) { return srcFileName; }; } // calculate the common suffix, stopping // at `outDir`. var srcDirParts = srcFileDir.split('/'); var outDirParts = normalizeSeparators(host.relative(outDir, outFileDir)).split('/'); var i = 0; while (i < Math.min(srcDirParts.length, outDirParts.length) && srcDirParts[srcDirParts.length - 1 - i] === outDirParts[outDirParts.length - 1 - i]) i++; var rootDir_1 = srcDirParts.slice(0, srcDirParts.length - i).join('/'); return function (srcFileName) { // Note: Before we return the mapped output path, we need to normalize the path delimiters // because the output path is usually passed to TypeScript which sometimes only expects // posix normalized paths (e.g. if a custom compiler host is used) return normalizeSeparators(host.resolve(outDir, host.relative(rootDir_1, srcFileName))); }; } else { // Note: Before we return the output path, we need to normalize the path delimiters because // the output path is usually passed to TypeScript which only passes around posix // normalized paths (e.g. if a custom compiler host is used) return function (srcFileName) { return normalizeSeparators(srcFileName); }; } } exports.createSrcToOutPathMapper = createSrcToOutPathMapper; function mergeEmitResults(emitResults) { var e_3, _a; var diagnostics = []; var emitSkipped = false; var emittedFiles = []; try { for (var emitResults_1 = tslib_1.__values(emitResults), emitResults_1_1 = emitResults_1.next(); !emitResults_1_1.done; emitResults_1_1 = emitResults_1.next()) { var er = emitResults_1_1.value; diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(er.diagnostics))); emitSkipped = emitSkipped || er.emitSkipped; emittedFiles.push.apply(emittedFiles, tslib_1.__spreadArray([], tslib_1.__read((er.emittedFiles || [])))); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (emitResults_1_1 && !emitResults_1_1.done && (_a = emitResults_1.return)) _a.call(emitResults_1); } finally { if (e_3) throw e_3.error; } } return { diagnostics: diagnostics, emitSkipped: emitSkipped, emittedFiles: emittedFiles }; } function diagnosticSourceOfSpan(span) { // For diagnostics, TypeScript only uses the fileName and text properties. // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly. return { fileName: span.start.file.url, text: span.start.file.content }; } function diagnosticSourceOfFileName(fileName, program) { var sourceFile = program.getSourceFile(fileName); if (sourceFile) return sourceFile; // If we are reporting diagnostics for a source file that is not in the project then we need // to fake a source file so the diagnostic formatting routines can emit the file name. // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly. return { fileName: fileName, text: '' }; } function diagnosticChainFromFormattedDiagnosticChain(chain) { return { messageText: chain.message, next: chain.next && chain.next.map(diagnosticChainFromFormattedDiagnosticChain), position: chain.position }; } function syntaxErrorToDiagnostics(error, program) { var parserErrors = compiler_1.getParseErrors(error); if (parserErrors && parserErrors.length) { return parserErrors.map(function (e) { return ({ messageText: e.contextualMessage(), file: diagnosticSourceOfSpan(e.span), start: e.span.start.offset, length: e.span.end.offset - e.span.start.offset, category: ts.DiagnosticCategory.Error, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE }); }); } else if (compiler_1.isFormattedError(error)) { return [{ messageText: error.message, chain: error.chain && diagnosticChainFromFormattedDiagnosticChain(error.chain), category: ts.DiagnosticCategory.Error, source: api_1.SOURCE, code: api_1.DEFAULT_ERROR_CODE, position: error.position }]; } var ngModuleErrorData = compiler_1.getMissingNgModuleMetadataErrorData(error); if (ngModuleErrorData !== null) { // This error represents the import or export of an `NgModule` that didn't have valid metadata. // This _might_ happen because the NgModule in question is an Ivy-compiled library, and we want // to show a more useful error if that's the case. var ngModuleClass = getDtsClass(program, ngModuleErrorData.fileName, ngModuleErrorData.className); if (ngModuleClass !== null && isIvyNgModule(ngModuleClass)) { return [{ messageText: "The NgModule '" + ngModuleErrorData.className + "' in '" + ngModuleErrorData .fileName + "' is imported by this compilation, but appears to be part of a library compiled for Angular Ivy. This may occur because:\n\n 1) the library was processed with 'ngcc'. Removing and reinstalling node_modules may fix this problem.\n\n 2) the library was published for Angular Ivy and v12+ applications only. Check its peer dependencies carefully and ensure that you're using a compatible version of Angular.\n\nSee https://angular.io/errors/NG6999 for more information.\n", category: ts.DiagnosticCategory.Error, code: api_1.DEFAULT_ERROR_CODE, source: api_1.SOURCE, }]; } } // Produce a Diagnostic anyway since we know for sure `error` is a SyntaxError return [{ messageText: error.message, category: ts.DiagnosticCategory.Error, code: api_1.DEFAULT_ERROR_CODE, source: api_1.SOURCE, }]; } function getDtsClass(program, fileName, className) { var e_4, _a; var sf = program.getSourceFile(fileName); if (sf === undefined || !sf.isDeclarationFile) { return null; } try { for (var _b = tslib_1.__values(sf.statements), _c = _b.next(); !_c.done; _c = _b.next()) { var stmt = _c.value; if (!ts.isClassDeclaration(stmt)) { continue; } if (stmt.name === undefined || stmt.name.text !== className) { continue; } return stmt; } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } // No classes found that matched the given name. return null; } function isIvyNgModule(clazz) { var e_5, _a; try { for (var _b = tslib_1.__values(clazz.members), _c = _b.next(); !_c.done; _c = _b.next()) { var member = _c.value; if (!ts.isPropertyDeclaration(member)) { continue; } if (ts.isIdentifier(member.name) && member.name.text === 'ɵmod') { return true; } } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_5) throw e_5.error; } } // No Ivy 'ɵmod' property found. return false; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvdHJhbnNmb3JtZXJzL3Byb2dyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0E7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUVILDhDQUF3VDtJQUN4VCx1QkFBeUI7SUFDekIsMkJBQTZCO0lBQzdCLCtCQUFpQztJQUVqQyxxR0FBMEU7S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cy5ob3N0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGU6IHdyaXRlVHNGaWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVtaXRPbmx5RHRzRmlsZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VzdG9tVHJhbnNmb3JtZXJzOiB0c0N1c3RvbVRyYW5zZm9ybWVycyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRTb3VyY2VGaWxlOiB0aGlzLnRzUHJvZ3JhbS5nZXRTb3VyY2VGaWxlKGZpbGVOYW1lKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpKTtcbiAgICAgICAgZW1pdHRlZFVzZXJUc0NvdW50ID0gc291cmNlRmlsZXNUb0VtaXQubGVuZ3RoO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZW1pdFJlc3VsdCA9IGVtaXRDYWxsYmFjayh7XG4gICAgICAgICAgcHJvZ3JhbTogdGhpcy50c1Byb2dyYW0sXG4gICAgICAgICAgaG9zdDogdGhpcy5ob3N0LFxuICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICB3cml0ZUZpbGU6IHdyaXRlVHNGaWxlLFxuICAgICAgICAgIGVtaXRPbmx5RHRzRmlsZXMsXG4gICAgICAgICAgY3VzdG9tVHJhbnNmb3JtZXJzOiB0c0N1c3RvbVRyYW5zZm9ybWVyc1xuICAgICAgICB9KTtcbiAgICAgICAgZW1pdHRlZFVzZXJUc0NvdW50ID0gdGhpcy50c1Byb2dyYW0uZ2V0U291cmNlRmlsZXMoKS5sZW5ndGggLSBnZW5Uc0ZpbGVzLmxlbmd0aDtcbiAgICAgIH1cbiAgICB9IGZpbmFsbHkge1xuICAgICAgLy8gU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1xuICBpZiAocGFyc2VyRXJyb3JzICYmIHBhcnNlckVycm9ycy5sZW5ndGgpIHtcbiAgICByZXR1cm4gcGFyc2VyRXJyb3JzLm1hcDxEaWFnbm9zdGljPihlID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlVGV4dDogZS5jb250ZXh0dWFsTWVzc2FnZSgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZTogZGlhZ25vc3RpY1NvdXJjZU9mU3BhbihlLnNwYW4pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGUuc3Bhbi5zdGFydC5vZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGg6IGUuc3Bhbi5lbmQub2Zmc2V0IC0gZS5zcGFuLnN0YXJ0Lm9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiB0cy5EaWFnbm9zdGljQ2F0ZWdvcnkuRXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6IFNPVVJDRSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IERFRkFVTFRfRVJST1JfQ09ERVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgfSBlbHNlIGlmIChpc0Zvcm1hdHRlZEVycm9yKGVycm9yKSkge1xuICAgIHJldHVybiBbe1xuICAgICAgbWVzc2FnZVRleHQ6IGVycm9yLm1lc3NhZ2UsXG4gICAgICBjaGFpbjogZXJyb3IuY2hhaW4gJiYgZGlhZ25vc3RpY0NoYWluRnJvbUZvcm1hdHRlZERpYWdub3N0aWNDaGFpbihlcnJvci5jaGFpbiksXG4gICAgICBjYXRlZ29yeTogdHMuRG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