{"version":3,"sources":["/Users/wessberg/Developer/libraries/DI-compiler/dist/chunk-F7W7B6QD.cjs","../src/transformer/transform.ts","../src/transformer/get-base-visitor-context.ts","../src/transformer/constant.ts","../src/type/type.ts","../src/util/ts-util.ts","../src/util/util.ts","../src/transformer/before/util.ts","../src/transformer/before/visitor/visit-class-like-declaration.ts","../src/transformer/before/visitor/visit-call-expression.ts","../src/transformer/before/visitor/visit-node.ts","../src/transformer/before/before-transformer.ts"],"names":["needsImportPreservationLogic"],"mappings":"AAAA;ACAA,4FAAiB;ADEjB;AACA;AEAA,2CAAuB;AACvB,uFAAqB;AFErB;AACA;AGPO,IAAM,wCAAA,EAA0C,CAAA,eAAA,CAAA;AAChD,IAAM,kBAAA,EAAoB,aAAA;AHSjC;AACA;AIXA;AJaA;AACA;AKFA,IAAM,QAAA,EAAU;AAAA,EACf,mBAAA,EAAqB;AAAA,IACpB,IAAA,EAAM,kCAAA;AAAA,IACN,MAAA,EAAQ,KAAA;AAAA,IACR,IAAA,EAAM;AAAA,EACP,CAAA;AAAA,EACA,gBAAA,EAAkB;AAAA,IACjB,IAAA,EAAM,+BAAA;AAAA,IACN,MAAA,EAAQ,KAAA;AAAA,IACR,IAAA,EAAM;AAAA,EACP;AACD,CAAA;AAIO,SAAS,4BAAA,CACf,mBAAA,EACA,0BAAA,EACU;AACV,EAAA,MAAM,WAAA,EAAa,SAAA,CAAU,OAAA,GAAU,EAAA,EAAK,oBAAA,EAAqC,mBAAA,CAAmF,UAAA;AACpK,EAAA,MAAM,gBAAA,EAAkB,SAAA,CAAU,OAAA,GAAU,EAAA,EAAI,2BAAA,EAA+B,mBAAA,CAAmF,eAAA;AAIlK,EAAA,MAAM,qBAAA,EAAuB,CAAC,OAAA,CAAQ,eAAA,CAAgB,oBAAoB,EAAA,GAAK,OAAA,CAAQ,eAAA,CAAgB,oBAAoB,CAAA;AAC3H,EAAA,GAAA,CAAI,CAAC,OAAA,CAAQ,oBAAoB,CAAA,EAAG,OAAO,IAAA;A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L,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACD,IAAA;AAEM,IAAA;AACL,MAAA;AACA,MAAA;AACA,MAAA;AACD,IAAA;AAEM,IAAA;AACA,IAAA;AACE,IAAA;AAEF,IAAA;AACF,IAAA;AACE,MAAA;AACL,MAAA;AACD,IAAA;AAEA,IAAA;AACO,MAAA;AAAe;AAEhB,MAAA;AACN,IAAA;AACM,EAAA;AACN,IAAA;AACO,MAAA;AACP,IAAA;AACD,EAAA;AAEI,EAAA;AACK,IAAA;AACT,EAAA;AAEO,EAAA;AACR;AAES;AAEJ,EAAA;AAEE,EAAA;AACI,EAAA;AACN,EAAA;AACI,IAAA;AACR,EAAA;AAEO,EAAA;AACA,EAAA;AACR;AAES;AACJ,EAAA;AAGG,IAAA;AACA,IAAA;AACC,IAAA;AACR,EAAA;AACM,EAAA;AACA,EAAA;AAEC,EAAA;AACR;AD8qBY;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/wessberg/Developer/libraries/DI-compiler/dist/chunk-F7W7B6QD.cjs","sourcesContent":[null,"import path from \"crosspath\";\nimport {getBaseVisitorContext} from \"./get-base-visitor-context.js\";\nimport type {TransformOptions, TransformResult} from \"./transform-options.js\";\nimport {ensureArray, sha1} from \"../util/util.js\";\nimport type {BaseVisitorContext} from \"./visitor-context.js\";\nimport type {TSEmitHost, TSExtended, TSExtendedPrinter, TSSourceMapGenerator, TSSourceMapGeneratorOptions} from \"../type/type.js\";\nimport {ensureNodeFactory} from \"compatfactory\";\nimport {transformSourceFile} from \"./before/before-transformer.js\";\n\n/**\n * CustomTransformer that associates constructor arguments with any given class declaration\n */\nexport function transform(source: string, options?: TransformOptions): TransformResult;\nexport function transform(source: string, filename: string, options?: TransformOptions): TransformResult;\nexport function transform(source: string, filenameOrOptions: string | TransformOptions | undefined, optionsOrUndefined?: TransformOptions): TransformResult {\n\tconst filename = typeof filenameOrOptions === \"string\" ? filenameOrOptions : \"file.ts\";\n\tconst options = typeof filenameOrOptions === \"string\" ? optionsOrUndefined : filenameOrOptions;\n\n\tconst baseVisitorContext = getBaseVisitorContext(options);\n\n\t// By preserving value imports, we can avoid the `after` transformer entirely,\n\t// as well as adding/tracking imports,since nothing will be stripped away.\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tbaseVisitorContext.compilerOptions.preserveValueImports = true;\n\n\tconst {compilerOptions} = baseVisitorContext;\n\tconst typescript = baseVisitorContext.typescript as TSExtended;\n\n\tconst hash = generateCacheKey(source, baseVisitorContext, options);\n\tconst cacheHit = hash == null ? undefined : options?.cache?.get(hash);\n\n\tif (cacheHit != null) {\n\t\treturn cacheHit;\n\t}\n\n\tconst newLine = typescript.sys.newLine;\n\tconst printer = (options?.printer ?? typescript.createPrinter()) as TSExtendedPrinter;\n\tconst factory = ensureNodeFactory(typescript);\n\n\t// An undocumented internal helper can be leveraged here\n\tconst transformationContext = typescript.nullTransformationContext;\n\tconst visitorContext = {...baseVisitorContext, transformationContext, factory};\n\n\tconst sourceFile = typescript.createSourceFile(filename, source, typescript.ScriptTarget.ESNext, true);\n\tconst transformedSourceFile = transformSourceFile(sourceFile, visitorContext);\n\n\tlet result: TransformResult;\n\n\tif (Boolean(compilerOptions.sourceMap)) {\n\t\tconst sourceMapOptions: TSSourceMapGeneratorOptions = {\n\t\t\tsourceMap: Boolean(compilerOptions.sourceMap),\n\t\t\tsourceRoot: \"\",\n\t\t\tmapRoot: \"\",\n\t\t\textendedDiagnostics: false\n\t\t};\n\n\t\tconst emitHost: TSEmitHost = {\n\t\t\tgetCanonicalFileName: typescript.createGetCanonicalFileName(typescript.sys.useCaseSensitiveFileNames),\n\t\t\tgetCompilerOptions: () => compilerOptions,\n\t\t\tgetCurrentDirectory: () => path.dirname(filename)\n\t\t};\n\n\t\tconst sourceMapGenerator = typescript.createSourceMapGenerator(emitHost, path.basename(filename), sourceMapOptions.sourceRoot, path.dirname(filename), sourceMapOptions);\n\t\tconst writer = typescript.createTextWriter(newLine);\n\t\tprinter.writeFile(transformedSourceFile, writer, sourceMapGenerator);\n\n\t\tconst sourceMappingUrl = getSourceMappingUrl(sourceMapGenerator, filename, Boolean(compilerOptions.inlineSourceMap));\n\t\tif (sourceMappingUrl.length > 0) {\n\t\t\tif (!writer.isAtStartOfLine()) writer.rawWrite(newLine);\n\t\t\twriter.writeComment(\"//# \".concat(\"sourceMappingURL\", \"=\").concat(sourceMappingUrl)); // Tools can sometimes see this line as a source mapping url comment\n\t\t}\n\n\t\tresult = {\n\t\t\tcode: writer.getText(),\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tmap: Boolean(compilerOptions.inlineSourceMap) ? undefined : sourceMapGenerator.toString()\n\t\t};\n\t} else {\n\t\tresult = {\n\t\t\tcode: printer.printFile(transformedSourceFile)\n\t\t};\n\t}\n\n\tif (hash != null && options?.cache != null) {\n\t\toptions.cache.set(hash, result);\n\t}\n\n\treturn result;\n}\n\nfunction generateCacheKey(source: string, context: BaseVisitorContext, options: TransformOptions | undefined): string | undefined {\n\t// No point in calculating a hash if there's no cache in use\n\tif (options?.cache == null) return undefined;\n\n\tconst identifier = \"identifier\" in options ? options.identifier : undefined;\n\tlet key = source;\n\tif (identifier != null) {\n\t\tkey += ensureArray(identifier).join(\",\");\n\t}\n\n\tkey += String(Boolean(context.compilerOptions.sourceMap));\n\treturn sha1(key);\n}\n\nfunction getSourceMappingUrl(sourceMapGenerator: TSSourceMapGenerator, filePath: string, inline: boolean) {\n\tif (inline) {\n\t\t// Encode the sourceMap into the sourceMap url\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tconst sourceMapText = sourceMapGenerator.toString();\n\t\tconst base64SourceMapText = Buffer.from(sourceMapText).toString(\"base64\");\n\t\treturn \"data:application/json;base64,\".concat(base64SourceMapText);\n\t}\n\tconst sourceMapFilePath = `${filePath}.map`;\n\tconst sourceMapFile = path.basename(sourceMapFilePath);\n\n\treturn encodeURI(sourceMapFile);\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport type {DiOptions} from \"./di-options.js\";\nimport type {BaseVisitorContext} from \"./visitor-context.js\";\nimport {evaluate} from \"ts-evaluator\";\nimport TSModule from \"typescript\";\nimport {DI_CONTAINER_NAME} from \"./constant.js\";\nimport {needsImportPreservationLogic} from \"../util/ts-util.js\";\nimport type {TS} from \"../type/type.js\";\n\n/**\n * Shim the @wessberg/di module\n */\nconst EVALUATE_MODULE_OVERRIDES = {\n\t\"@wessberg/di\": {\n\t\t// eslint-disable-next-line @typescript-eslint/no-extraneous-class\n\t\t[DI_CONTAINER_NAME]: class {}\n\t}\n};\n\nexport function getBaseVisitorContext({typescript = TSModule as typeof TS, ...rest}: DiOptions = {}): BaseVisitorContext {\n\t// Prepare a VisitorContext\n\tconst visitorContextShared = {\n\t\tsourceFileToAddTslibDefinition: new Map(),\n\t\tsourceFileToRequiredImportedSymbolSet: new Map()\n\t};\n\n\tif (\"program\" in rest) {\n\t\tconst typeChecker = rest.program.getTypeChecker();\n\t\tconst compilerOptions = rest.program.getCompilerOptions();\n\t\treturn {\n\t\t\t...rest,\n\t\t\t...visitorContextShared,\n\t\t\tneedsImportPreservationLogic: needsImportPreservationLogic(typescript, compilerOptions),\n\t\t\ttypescript,\n\t\t\ttypeChecker,\n\t\t\tcompilerOptions,\n\n\t\t\tevaluate: node =>\n\t\t\t\tevaluate({\n\t\t\t\t\tnode,\n\t\t\t\t\ttypeChecker,\n\t\t\t\t\ttypescript,\n\t\t\t\t\tmoduleOverrides: EVALUATE_MODULE_OVERRIDES\n\t\t\t\t})\n\t\t};\n\t} else {\n\t\tconst compilerOptions = rest.compilerOptions ?? typescript.getDefaultCompilerOptions();\n\t\treturn {\n\t\t\tidentifier: [],\n\n\t\t\t...rest,\n\t\t\t...visitorContextShared,\n\t\t\tneedsImportPreservationLogic: needsImportPreservationLogic(typescript, compilerOptions),\n\t\t\ttypescript,\n\t\t\tcompilerOptions,\n\n\t\t\tevaluate: node =>\n\t\t\t\tevaluate({\n\t\t\t\t\tnode,\n\t\t\t\t\ttypescript,\n\t\t\t\t\tmoduleOverrides: EVALUATE_MODULE_OVERRIDES\n\t\t\t\t})\n\t\t};\n\t}\n}\n","export const CONSTRUCTOR_ARGUMENTS_SYMBOL_IDENTIFIER = `___CTOR_ARGS___`;\nexport const DI_CONTAINER_NAME = \"DIContainer\";\n","import * as TS from \"typescript\";\nexport {TS};\n\nexport interface TSTextWriter {\n\trawWrite(text: string): void;\n\tisAtStartOfLine(): boolean;\n\tgetText(): string;\n\twriteComment(comment: string): void;\n}\n\nexport interface TSSourceMapGenerator {}\n\nexport interface TSSourceMapGeneratorOptions {\n\tsourceMap: boolean;\n\tsourceRoot: string;\n\tmapRoot: string;\n\textendedDiagnostics: boolean;\n}\n\nexport interface TSEmitHost {\n\tgetCanonicalFileName(input: string): string;\n\tgetCompilerOptions(): TS.CompilerOptions;\n\tgetCurrentDirectory(): string;\n}\n\nexport type TSExtended = typeof TS & {\n\tnullTransformationContext: TS.TransformationContext;\n\tcreateGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (input: string) => string;\n\tcreateSourceMapGenerator(emitHost: TSEmitHost, file: string, sourceRoot: string, sourcesDirectoryPath: string, mapOptions: TSSourceMapGeneratorOptions): TSSourceMapGenerator;\n\tcreateTextWriter(newLine: string): TSTextWriter;\n};\n\nexport type TSExtendedPrinter = TS.Printer & {\n\twriteFile(file: TS.SourceFile, writer: TSTextWriter, sourceMapGenerator: TSSourceMapGenerator): void;\n};\n","import {TS} from \"../type/type.js\";\nimport type {ImportedSymbol} from \"../type/imported-symbol.js\";\nimport type {BaseVisitorContext, VisitorContext} from \"../transformer/visitor-context.js\";\nimport type {RootBlock} from \"../type/root-block.js\";\n\ntype TSWithHelpers = typeof TS & {\n\timportDefaultHelper?: TS.EmitHelper;\n\timportStarHelper?: TS.EmitHelper;\n};\n\n// For some TypeScript versions, such as 3.1, these helpers are not exposed by TypeScript,\n// so they will have to be duplicated and reused from here in these rare cases\nconst HELPERS = {\n\timportDefaultHelper: {\n\t\tname: \"typescript:commonjsimportdefault\",\n\t\tscoped: false,\n\t\ttext: '\\nvar __importDefault = (this && this.__importDefault) || function (mod) {\\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\\n};'\n\t},\n\timportStarHelper: {\n\t\tname: \"typescript:commonjsimportstar\",\n\t\tscoped: false,\n\t\ttext: '\\nvar __importStar = (this && this.__importStar) || function (mod) {\\n    if (mod && mod.__esModule) return mod;\\n    var result = {};\\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\\n    result[\"default\"] = mod;\\n    return result;\\n};'\n\t}\n} as const;\n\nexport function needsImportPreservationLogic(context: Pick<BaseVisitorContext, \"compilerOptions\" | \"typescript\">): boolean;\nexport function needsImportPreservationLogic(typescript: typeof TS, compilerOptions: TS.CompilerOptions): boolean;\nexport function needsImportPreservationLogic(\n\ttypescriptOrContext: Pick<BaseVisitorContext, \"compilerOptions\" | \"typescript\"> | typeof TS,\n\tcompilerOptionsOrUndefined?: TS.CompilerOptions\n): boolean {\n\tconst typescript = arguments.length >= 2 ? (typescriptOrContext as typeof TS) : (typescriptOrContext as Pick<BaseVisitorContext, \"compilerOptions\" | \"typescript\">).typescript;\n\tconst compilerOptions = arguments.length >= 2 ? compilerOptionsOrUndefined! : (typescriptOrContext as Pick<BaseVisitorContext, \"compilerOptions\" | \"typescript\">).compilerOptions;\n\n\t// If value imports shouldn't always be preserved, we'll have to perform import preservation logic\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tconst preserveValueImports = !Boolean(compilerOptions.verbatimModuleSyntax) && Boolean(compilerOptions.preserveValueImports);\n\tif (!Boolean(preserveValueImports)) return true;\n\n\t// Only TypeScript v4.5 and newer supports the `preserValueImports` Compiler option\n\tif (parseFloat(typescript.version) < 4.5) return true;\n\n\tswitch (compilerOptions.module) {\n\t\tcase typescript.ModuleKind.AMD:\n\t\tcase typescript.ModuleKind.UMD:\n\t\tcase typescript.ModuleKind.CommonJS:\n\t\tcase typescript.ModuleKind.System:\n\t\tcase typescript.ModuleKind.None:\n\t\t\t// None of these module systems support the `preserValueImports` Compiler option\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function getImportDefaultHelper(typescript: TSWithHelpers): TS.EmitHelper {\n\treturn typescript.importDefaultHelper ?? HELPERS.importDefaultHelper;\n}\n\nexport function getImportStarHelper(typescript: TSWithHelpers): TS.EmitHelper {\n\treturn typescript.importStarHelper ?? HELPERS.importStarHelper;\n}\n\nexport function moduleKindSupportsImportHelpers(moduleKind: TS.ModuleKind = TS.ModuleKind.CommonJS, typescript: typeof TS): boolean {\n\tswitch (moduleKind) {\n\t\tcase typescript.ModuleKind.CommonJS:\n\t\tcase typescript.ModuleKind.UMD:\n\t\tcase typescript.ModuleKind.AMD:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function moduleKindDefinesDependencies(moduleKind: TS.ModuleKind = TS.ModuleKind.CommonJS, typescript: typeof TS): boolean {\n\tswitch (moduleKind) {\n\t\tcase typescript.ModuleKind.UMD:\n\t\tcase typescript.ModuleKind.AMD:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\ninterface EmitHelperFactory {\n\tgetUnscopedHelperName(helperName: string): TS.Identifier;\n}\n\ntype TSWithEmitHelpers = typeof TS &\n\t(\n\t\t| EmitHelperFactory\n\t\t| {\n\t\t\t\tcreateEmitHelperFactory(factory: TS.TransformationContext): EmitHelperFactory;\n\t\t  }\n\t\t| {\n\t\t\t\tgetHelperName(helperName: string): TS.Identifier;\n\t\t  }\n\t);\n\nexport function getUnscopedHelperName(context: VisitorContext, helperName: string): TS.Identifier {\n\tconst typescript = context.typescript as TSWithEmitHelpers;\n\tif (\"getUnscopedHelperName\" in typescript) {\n\t\treturn typescript.getUnscopedHelperName(helperName);\n\t} else if (\"createEmitHelperFactory\" in typescript) {\n\t\treturn typescript.createEmitHelperFactory(context.transformationContext).getUnscopedHelperName(helperName);\n\t} else {\n\t\treturn typescript.getHelperName(helperName);\n\t}\n}\n\nexport function getRootBlockInsertionPosition(rootBlock: RootBlock, typescript: typeof TS): number {\n\tlet insertPosition = 0;\n\n\tfor (let i = 0; i < rootBlock.statements.length; i++) {\n\t\tconst statement = rootBlock.statements[i]!;\n\n\t\tconst isUseStrict = typescript.isExpressionStatement(statement) && typescript.isStringLiteralLike(statement.expression) && statement.expression.text === \"use strict\";\n\n\t\tconst isEsModuleSymbol =\n\t\t\ttypescript.isExpressionStatement(statement) &&\n\t\t\ttypescript.isCallExpression(statement.expression) &&\n\t\t\ttypescript.isPropertyAccessExpression(statement.expression.expression) &&\n\t\t\ttypescript.isIdentifier(statement.expression.expression.expression) &&\n\t\t\ttypescript.isIdentifier(statement.expression.expression.name) &&\n\t\t\tstatement.expression.expression.expression.text === \"Object\" &&\n\t\t\tstatement.expression.expression.name.text === \"defineProperty\" &&\n\t\t\tstatement.expression.arguments.length >= 2 &&\n\t\t\ttypescript.isIdentifier(statement.expression.arguments[0]!) &&\n\t\t\tstatement.expression.arguments[0].text === \"exports\" &&\n\t\t\ttypescript.isStringLiteralLike(statement.expression.arguments[1]!) &&\n\t\t\tstatement.expression.arguments[1].text === \"__esModule\";\n\n\t\tif (isUseStrict || isEsModuleSymbol) {\n\t\t\tinsertPosition = Math.max(insertPosition, i + 1);\n\t\t}\n\t}\n\treturn insertPosition;\n}\n\nexport function getDefineArrayLiteralExpression(sourceFile: TS.SourceFile, context: VisitorContext): TS.ArrayLiteralExpression | undefined {\n\tconst {compilerOptions, typescript} = context;\n\n\tswitch (compilerOptions.module) {\n\t\tcase typescript.ModuleKind.ESNext:\n\t\tcase typescript.ModuleKind.ES2015:\n\t\tcase typescript.ModuleKind.ES2020:\n\t\tcase typescript.ModuleKind.ES2022:\n\t\t\t// There are no such thing for these module types\n\t\t\treturn undefined;\n\n\t\t// If we're targeting UMD, the root block won't be the root scope, but the Function Body of an iife\n\t\tcase typescript.ModuleKind.UMD: {\n\t\t\tfor (const statement of sourceFile.statements) {\n\t\t\t\tif (\n\t\t\t\t\ttypescript.isExpressionStatement(statement) &&\n\t\t\t\t\ttypescript.isCallExpression(statement.expression) &&\n\t\t\t\t\ttypescript.isParenthesizedExpression(statement.expression.expression) &&\n\t\t\t\t\ttypescript.isFunctionExpression(statement.expression.expression.expression) &&\n\t\t\t\t\tstatement.expression.expression.expression.parameters.length === 1\n\t\t\t\t) {\n\t\t\t\t\tconst [firstParameter] = statement.expression.expression.expression.parameters;\n\t\t\t\t\tif (firstParameter != null && typescript.isIdentifier(firstParameter.name)) {\n\t\t\t\t\t\tif (firstParameter.name.text === \"factory\") {\n\t\t\t\t\t\t\tfor (const subStatement of statement.expression.expression.expression.body.statements) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\ttypescript.isIfStatement(subStatement) &&\n\t\t\t\t\t\t\t\t\tsubStatement.elseStatement != null &&\n\t\t\t\t\t\t\t\t\ttypescript.isIfStatement(subStatement.elseStatement) &&\n\t\t\t\t\t\t\t\t\ttypescript.isBlock(subStatement.elseStatement.thenStatement)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tfor (const subSubStatement of subStatement.elseStatement.thenStatement.statements) {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\ttypescript.isExpressionStatement(subSubStatement) &&\n\t\t\t\t\t\t\t\t\t\t\ttypescript.isCallExpression(subSubStatement.expression) &&\n\t\t\t\t\t\t\t\t\t\t\tsubSubStatement.expression.arguments.length === 2 &&\n\t\t\t\t\t\t\t\t\t\t\ttypescript.isIdentifier(subSubStatement.expression.expression) &&\n\t\t\t\t\t\t\t\t\t\t\tsubSubStatement.expression.expression.text === \"define\"\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tconst [firstSubSubStatementExpressionArgument] = subSubStatement.expression.arguments;\n\t\t\t\t\t\t\t\t\t\t\tif (firstSubSubStatementExpressionArgument != null && typescript.isArrayLiteralExpression(firstSubSubStatementExpressionArgument)) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn firstSubSubStatementExpressionArgument;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase typescript.ModuleKind.AMD: {\n\t\t\tfor (const statement of sourceFile.statements) {\n\t\t\t\tif (\n\t\t\t\t\ttypescript.isExpressionStatement(statement) &&\n\t\t\t\t\ttypescript.isCallExpression(statement.expression) &&\n\t\t\t\t\ttypescript.isIdentifier(statement.expression.expression) &&\n\t\t\t\t\tstatement.expression.expression.text === \"define\" &&\n\t\t\t\t\tstatement.expression.arguments.length === 2\n\t\t\t\t) {\n\t\t\t\t\tconst [firstArgument, secondArgument] = statement.expression.arguments;\n\t\t\t\t\tif (firstArgument != null && secondArgument != null && typescript.isArrayLiteralExpression(firstArgument)) {\n\t\t\t\t\t\tif (typescript.isFunctionExpression(secondArgument) && secondArgument.parameters.length >= 2) {\n\t\t\t\t\t\t\tconst [firstParameter, secondParameter] = secondArgument.parameters;\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tfirstParameter != null &&\n\t\t\t\t\t\t\t\tsecondParameter != null &&\n\t\t\t\t\t\t\t\ttypescript.isIdentifier(firstParameter.name) &&\n\t\t\t\t\t\t\t\ttypescript.isIdentifier(secondParameter.name) &&\n\t\t\t\t\t\t\t\tfirstParameter.name.text === \"require\" &&\n\t\t\t\t\t\t\t\tsecondParameter.name.text === \"exports\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn firstArgument;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function getRootBlock(sourceFile: TS.SourceFile, context: VisitorContext): RootBlock {\n\tconst {compilerOptions, typescript} = context;\n\n\tswitch (compilerOptions.module) {\n\t\t// If we're targeting UMD, the root block won't be the root scope, but the Function Body of an iife\n\t\tcase typescript.ModuleKind.UMD: {\n\t\t\tfor (const statement of sourceFile.statements) {\n\t\t\t\tif (typescript.isExpressionStatement(statement) && typescript.isCallExpression(statement.expression) && statement.expression.arguments.length === 1) {\n\t\t\t\t\tconst [firstArgument] = statement.expression.arguments;\n\t\t\t\t\tif (firstArgument != null && typescript.isFunctionExpression(firstArgument) && firstArgument.parameters.length === 2) {\n\t\t\t\t\t\tconst [firstParameter, secondParameter] = firstArgument.parameters;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tfirstParameter != null &&\n\t\t\t\t\t\t\tsecondParameter != null &&\n\t\t\t\t\t\t\ttypescript.isIdentifier(firstParameter.name) &&\n\t\t\t\t\t\t\ttypescript.isIdentifier(secondParameter.name) &&\n\t\t\t\t\t\t\tfirstParameter.name.text === \"require\" &&\n\t\t\t\t\t\t\tsecondParameter.name.text === \"exports\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn firstArgument.body;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t// If we're targeting AMD, the root block won't be the root scope, but the Function Body of the\n\t\t// anonymous function provided as a second argument to the define() function\n\t\tcase typescript.ModuleKind.AMD: {\n\t\t\tfor (const statement of sourceFile.statements) {\n\t\t\t\tif (\n\t\t\t\t\ttypescript.isExpressionStatement(statement) &&\n\t\t\t\t\ttypescript.isCallExpression(statement.expression) &&\n\t\t\t\t\ttypescript.isIdentifier(statement.expression.expression) &&\n\t\t\t\t\tstatement.expression.expression.text === \"define\" &&\n\t\t\t\t\tstatement.expression.arguments.length === 2\n\t\t\t\t) {\n\t\t\t\t\tconst [, secondArgument] = statement.expression.arguments;\n\t\t\t\t\tif (secondArgument != null && typescript.isFunctionExpression(secondArgument) && secondArgument.parameters.length >= 2) {\n\t\t\t\t\t\tconst [firstParameter, secondParameter] = secondArgument.parameters;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tfirstParameter != null &&\n\t\t\t\t\t\t\tsecondParameter != null &&\n\t\t\t\t\t\t\ttypescript.isIdentifier(firstParameter.name) &&\n\t\t\t\t\t\t\ttypescript.isIdentifier(secondParameter.name) &&\n\t\t\t\t\t\t\tfirstParameter.name.text === \"require\" &&\n\t\t\t\t\t\t\tsecondParameter.name.text === \"exports\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn secondArgument.body;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn sourceFile;\n}\n\nexport function isImportedSymbolImported(importedSymbol: ImportedSymbol, rootBlock: RootBlock, context: VisitorContext): boolean {\n\tconst {compilerOptions, typescript} = context;\n\n\tswitch (compilerOptions.module) {\n\t\tcase typescript.ModuleKind.ES2022:\n\t\tcase typescript.ModuleKind.ES2020:\n\t\tcase typescript.ModuleKind.ES2015:\n\t\tcase typescript.ModuleKind.ESNext: {\n\t\t\tfor (const statement of rootBlock.statements) {\n\t\t\t\tif (!typescript.isImportDeclaration(statement)) continue;\n\t\t\t\tif (!typescript.isStringLiteralLike(statement.moduleSpecifier)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (statement.moduleSpecifier.text !== importedSymbol.moduleSpecifier) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (statement.importClause == null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (\"isDefaultImport\" in importedSymbol) {\n\t\t\t\t\tif (importedSymbol.isDefaultImport) {\n\t\t\t\t\t\tif (statement.importClause.name == null) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (statement.importClause.name.text !== importedSymbol.name) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (statement.importClause.namedBindings == null) continue;\n\t\t\t\t\t\tif (!typescript.isNamedImports(statement.importClause.namedBindings)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const importSpecifier of statement.importClause.namedBindings.elements) {\n\t\t\t\t\t\t\tif (importSpecifier.name.text !== importedSymbol.name) continue;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (\"isNamespaceImport\" in importedSymbol) {\n\t\t\t\t\tif (statement.importClause.namedBindings == null) continue;\n\t\t\t\t\tif (!typescript.isNamespaceImport(statement.importClause.namedBindings)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (statement.importClause.namedBindings.name.text !== importedSymbol.name) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tcase typescript.ModuleKind.CommonJS:\n\t\tcase typescript.ModuleKind.AMD:\n\t\tcase typescript.ModuleKind.UMD: {\n\t\t\tfor (const statement of rootBlock.statements) {\n\t\t\t\tif (!typescript.isVariableStatement(statement)) continue;\n\t\t\t\tfor (const declaration of statement.declarationList.declarations) {\n\t\t\t\t\tif (!typescript.isIdentifier(declaration.name)) continue;\n\t\t\t\t\tif (declaration.name.text !== importedSymbol.name) continue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Add support for other module systems\n\treturn false;\n}\n\nexport function generateImportStatementForImportedSymbolInContext(importedSymbol: ImportedSymbol, context: VisitorContext): TS.Statement | undefined {\n\tconst {compilerOptions, typescript, factory} = context;\n\n\tswitch (compilerOptions.module) {\n\t\tcase typescript.ModuleKind.ES2022:\n\t\tcase typescript.ModuleKind.ES2020:\n\t\tcase typescript.ModuleKind.ES2015:\n\t\tcase typescript.ModuleKind.ESNext: {\n\t\t\treturn factory.createImportDeclaration(\n\t\t\t\tundefined,\n\t\t\t\t\"isDefaultImport\" in importedSymbol\n\t\t\t\t\t? factory.createImportClause(\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t!importedSymbol.isDefaultImport ? undefined : factory.createIdentifier(importedSymbol.name),\n\t\t\t\t\t\t\timportedSymbol.isDefaultImport\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: factory.createNamedImports([\n\t\t\t\t\t\t\t\t\t\tfactory.createImportSpecifier(\n\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\timportedSymbol.propertyName === importedSymbol.name ? undefined : factory.createIdentifier(importedSymbol.propertyName),\n\t\t\t\t\t\t\t\t\t\t\tfactory.createIdentifier(importedSymbol.name)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t)\n\t\t\t\t\t: \"isNamespaceImport\" in importedSymbol\n\t\t\t\t\t\t? factory.createImportClause(false, undefined, factory.createNamespaceImport(factory.createIdentifier(importedSymbol.name)))\n\t\t\t\t\t\t: undefined,\n\t\t\t\tfactory.createStringLiteral(importedSymbol.moduleSpecifier)\n\t\t\t);\n\t\t}\n\n\t\tcase typescript.ModuleKind.CommonJS:\n\t\tcase typescript.ModuleKind.AMD:\n\t\tcase typescript.ModuleKind.UMD: {\n\t\t\tconst requireCall = factory.createCallExpression(factory.createIdentifier(\"require\"), undefined, [factory.createStringLiteral(importedSymbol.moduleSpecifier)]);\n\n\t\t\tlet wrappedRequireCall = requireCall;\n\n\t\t\t// We'll need to use a helper, '__importDefault', and wrap the require call with it\n\t\t\tif (\n\t\t\t\tcompilerOptions.esModuleInterop === true &&\n\t\t\t\t((\"isDefaultImport\" in importedSymbol && importedSymbol.isDefaultImport) || (!(\"isDefaultImport\" in importedSymbol) && Boolean(importedSymbol.isNamespaceImport)))\n\t\t\t) {\n\t\t\t\t// If tslib is being used, we can do something like 'require(\"tslib\").__import{Default|Star}(<requireCall>)'\n\t\t\t\tif (compilerOptions.importHelpers === true) {\n\t\t\t\t\twrappedRequireCall = factory.createCallExpression(\n\t\t\t\t\t\tfactory.createPropertyAccessExpression(\n\t\t\t\t\t\t\tfactory.createCallExpression(factory.createIdentifier(\"require\"), undefined, [factory.createStringLiteral(\"tslib\")]),\n\t\t\t\t\t\t\tgetUnscopedHelperName(context, \"isDefaultImport\" in importedSymbol ? \"__importDefault\" : \"__importStar\")\n\t\t\t\t\t\t),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t[requireCall]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, we'll have to make sure that the helper is being inlined in an transformation step later\n\t\t\t\telse {\n\t\t\t\t\t// We've already requested the __importDefault helper in the before transformer under these\n\t\t\t\t\t// circumstances\n\t\t\t\t\twrappedRequireCall = factory.createCallExpression(getUnscopedHelperName(context, \"isDefaultImport\" in importedSymbol ? \"__importDefault\" : \"__importStar\"), undefined, [\n\t\t\t\t\t\trequireCall\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn factory.createVariableStatement(\n\t\t\t\tundefined,\n\t\t\t\tfactory.createVariableDeclarationList(\n\t\t\t\t\t[factory.createVariableDeclaration(factory.createIdentifier(importedSymbol.name), undefined, undefined, wrappedRequireCall)],\n\t\t\t\t\ttypescript.NodeFlags.Const\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t// TODO: Handle other module types as well\n\treturn undefined;\n}\n","import type {Nullable} from \"helpertypes\";\nimport crypto from \"crypto\";\n\n/**\n * Ensures that the given item is an array\n */\nexport function ensureArray<T>(item: T[] | T): T[] {\n\treturn Array.isArray(item) ? item : [item];\n}\n\n/**\n * Converts the given string to a boolean\n */\nexport function booleanize(str: string | boolean | undefined): boolean {\n\tif (str == null) return false;\n\tif (typeof str === \"boolean\") return str;\n\n\tif (isTrueLike(str)) {\n\t\treturn true;\n\t} else if (isFalseLike(str)) {\n\t\treturn false;\n\t} else {\n\t\treturn Boolean(str);\n\t}\n}\n\nexport function isTrueLike(str: Nullable<string | boolean>): boolean {\n\tif (typeof str === \"boolean\") return str;\n\tif (str == null) return false;\n\n\tswitch (str.toLowerCase().trim()) {\n\t\tcase \"true\":\n\t\tcase \"yes\":\n\t\tcase \"1\":\n\t\tcase \"\":\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function isFalseLike(str: Nullable<string | boolean>): boolean {\n\tif (typeof str === \"boolean\") return !str;\n\tif (str == null) return true;\n\n\tswitch (str.toLowerCase().trim()) {\n\t\tcase \"false\":\n\t\tcase \"no\":\n\t\tcase \"0\":\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const sha1 = (data: string) => crypto.createHash(\"sha1\").update(data).digest(\"hex\");\nexport const NOOP = () => {\n\t// Noop\n};\n","import type {TS} from \"../../type/type.js\";\nimport type {VisitorContext} from \"../visitor-context.js\";\n\n/**\n * A TypeNode such as IFoo<string> should still yield the service name \"IFoo\".\n * This helper generates a proper service name from a TypeNode\n */\nexport function pickServiceOrImplementationName(node: TS.Expression | TS.TypeNode | TS.EntityName, context: VisitorContext): string {\n\tconst {typescript} = context;\n\n\tif (typescript.isTypeReferenceNode(node)) {\n\t\treturn pickServiceOrImplementationName(node.typeName, context);\n\t} else if (typescript.isIndexedAccessTypeNode(node)) {\n\t\treturn `${pickServiceOrImplementationName(node.objectType, context)}[${pickServiceOrImplementationName(node.indexType, context)}]`;\n\t} else {\n\t\treturn node.getText().trim();\n\t}\n}\n\nexport function getModifierLikes(node: TS.Node): readonly TS.ModifierLike[] | undefined {\n\tconst modifiers = \"modifiers\" in node && Array.isArray(node.modifiers) ? node.modifiers : [];\n\tif (\"decorators\" in node && Array.isArray(node.decorators)) {\n\t\treturn [...(node as {decorators: TS.Decorator[]}).decorators, ...(modifiers as TS.Modifier[])];\n\t} else {\n\t\treturn modifiers as TS.ModifierLike[];\n\t}\n}\n","import {CONSTRUCTOR_ARGUMENTS_SYMBOL_IDENTIFIER} from \"../../constant.js\";\nimport type {TS} from \"../../../type/type.js\";\nimport type {BeforeVisitorOptions} from \"../before-visitor-options.js\";\nimport type {VisitorContext} from \"../../visitor-context.js\";\nimport {getModifierLikes, pickServiceOrImplementationName} from \"../util.js\";\n\nexport function visitClassLikeDeclaration(options: BeforeVisitorOptions<TS.ClassLikeDeclaration>): TS.VisitResult<TS.Node> {\n\tconst {node, childContinuation, continuation, context} = options;\n\tconst {typescript, factory} = context;\n\tconst constructorDeclaration = node.members.find(typescript.isConstructorDeclaration);\n\n\t// If there are no constructor declaration for the ClassLikeDeclaration, there's nothing to do\n\tif (constructorDeclaration == null) {\n\t\treturn childContinuation(node);\n\t}\n\n\tconst updatedClassMembers: readonly TS.ClassElement[] = [\n\t\t...(node.members.map(continuation) as TS.ClassElement[]),\n\t\tfactory.createGetAccessorDeclaration(\n\t\t\t[factory.createModifier(typescript.SyntaxKind.StaticKeyword)],\n\t\t\tfactory.createComputedPropertyName(factory.createIdentifier(`Symbol.for(\"${CONSTRUCTOR_ARGUMENTS_SYMBOL_IDENTIFIER}\")`)),\n\t\t\t[],\n\t\t\tundefined,\n\t\t\tfactory.createBlock([factory.createReturnStatement(getParameterTypeNamesAsArrayLiteral(constructorDeclaration.parameters, context))])\n\t\t)\n\t];\n\n\tconst modifierLikes = getModifierLikes(node);\n\n\tif (typescript.isClassDeclaration(node)) {\n\t\treturn factory.updateClassDeclaration(node, modifierLikes, node.name, node.typeParameters, node.heritageClauses, updatedClassMembers);\n\t} else {\n\t\treturn factory.updateClassExpression(node, modifierLikes, node.name, node.typeParameters, node.heritageClauses, updatedClassMembers);\n\t}\n}\n\n/**\n * Takes ConstructorParams for the given NodeArray of ParameterDeclarations\n */\nfunction getParameterTypeNamesAsArrayLiteral(parameters: TS.NodeArray<TS.ParameterDeclaration>, context: VisitorContext): TS.ArrayLiteralExpression {\n\tconst {factory} = context;\n\tconst constructorParams: TS.Expression[] = [];\n\n\tfor (let i = 0; i < parameters.length; i++) {\n\t\tconst parameter = parameters[i]!;\n\t\t// If the parameter has no type, there's nothing to extract\n\t\tif (parameter.type == null) {\n\t\t\tconstructorParams[i] = factory.createIdentifier(\"undefined\");\n\t\t} else {\n\t\t\tconstructorParams[i] = factory.createNoSubstitutionTemplateLiteral(pickServiceOrImplementationName(parameter.type, context));\n\t\t}\n\t}\n\n\treturn factory.createArrayLiteralExpression(constructorParams);\n}\n","import {DI_CONTAINER_NAME} from \"../../constant.js\";\nimport type {TS} from \"../../../type/type.js\";\nimport type {BeforeVisitorOptions} from \"../before-visitor-options.js\";\nimport type {DiMethodName} from \"../../di-method-kind.js\";\nimport type {VisitorContext} from \"../../visitor-context.js\";\nimport {getImportDefaultHelper, getImportStarHelper, moduleKindDefinesDependencies, moduleKindSupportsImportHelpers} from \"../../../util/ts-util.js\";\nimport {pickServiceOrImplementationName} from \"../util.js\";\nimport {ensureArray} from \"../../../util/util.js\";\n\nexport function visitCallExpression(options: BeforeVisitorOptions<TS.CallExpression>): TS.VisitResult<TS.Node> {\n\tconst {node, childContinuation, continuation, context, addTslibDefinition, requireImportedSymbol} = options;\n\tconst {typescript, factory, compilerOptions, transformationContext, needsImportPreservationLogic} = context;\n\n\tconst diMethod = getDiMethodName(node.expression, context);\n\n\tif (diMethod != null) {\n\t\tswitch (diMethod) {\n\t\t\tcase \"get\":\n\t\t\tcase \"has\": {\n\t\t\t\t// If no type arguments are given, don't modify the node at all\n\t\t\t\tif (node.typeArguments?.[0] == null) {\n\t\t\t\t\treturn childContinuation(node);\n\t\t\t\t}\n\n\t\t\t\tconst [firstTypeArgument] = node.typeArguments;\n\n\t\t\t\treturn factory.updateCallExpression(node, node.expression, node.typeArguments, [\n\t\t\t\t\tfactory.createObjectLiteralExpression([\n\t\t\t\t\t\tfactory.createPropertyAssignment(\"identifier\", factory.createStringLiteral((firstTypeArgument.getFirstToken()?.getText() ?? firstTypeArgument.getText()).trim()))\n\t\t\t\t\t])\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tcase \"registerSingleton\":\n\t\t\tcase \"registerTransient\": {\n\t\t\t\tconst [typeArg, secondTypeArg] = (node.typeArguments ?? []) as unknown as [TS.TypeNode | undefined, TS.TypeNode | TS.Expression | undefined];\n\t\t\t\tconst [firstArgument] = (node as {arguments?: TS.NodeArray<TS.Expression>}).arguments ?? [];\n\n\t\t\t\t// The user may explicitly pass 'undefined' as a value here, which shouldn't count as a custom implementation\n\t\t\t\tconst customImplementation = firstArgument == null || (typescript.isIdentifier(firstArgument) && firstArgument.text === \"undefined\") ? undefined : firstArgument;\n\n\t\t\t\tconst implementationArg =\n\t\t\t\t\t// If another implementation is passed, used that one instead\n\t\t\t\t\tcustomImplementation ??\n\t\t\t\t\t// If not implementation is provided, use the type argument *as* the implementation\n\t\t\t\t\tsecondTypeArg ??\n\t\t\t\t\ttypeArg;\n\n\t\t\t\tif (typeArg == null || implementationArg == null) {\n\t\t\t\t\treturn childContinuation(node);\n\t\t\t\t}\n\n\t\t\t\tconst typeArgText = pickServiceOrImplementationName(typeArg, context);\n\t\t\t\tconst implementationArgText = pickServiceOrImplementationName(implementationArg, context);\n\n\t\t\t\t// If the Implementation is a TypeNode, and if it originates from an ImportDeclaration, it may be stripped from the file since Typescript won't Type-check the updates from\n\t\t\t\t// a CustomTransformer and such a node would normally be removed from the imports.\n\t\t\t\t// to fix it, add an ImportDeclaration if needed. This is only needed if `preserveValueImports` is falsy\n\t\t\t\tif (needsImportPreservationLogic && customImplementation == null) {\n\t\t\t\t\tconst matchingImport = findMatchingImportDeclarationForIdentifier(implementationArgText, options);\n\t\t\t\t\tif (matchingImport != null && typescript.isStringLiteralLike(matchingImport.importDeclaration.moduleSpecifier)) {\n\t\t\t\t\t\tswitch (matchingImport.kind) {\n\t\t\t\t\t\t\tcase \"default\": {\n\t\t\t\t\t\t\t\t// Log a request for the __importDefault helper already if we will\n\t\t\t\t\t\t\t\t// need it in a later transformation step\n\t\t\t\t\t\t\t\tif (moduleKindSupportsImportHelpers(compilerOptions.module, typescript) && compilerOptions.esModuleInterop === true && compilerOptions.importHelpers !== true) {\n\t\t\t\t\t\t\t\t\ttransformationContext.requestEmitHelper(getImportDefaultHelper(typescript));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Log a request for adding 'tslib' to the define([...]) array for the current\n\t\t\t\t\t\t\t\t// module system if it relies on declaring dependencies (such as UMD, AMD, and SystemJS does)\n\t\t\t\t\t\t\t\tif (moduleKindDefinesDependencies(compilerOptions.module, typescript) && compilerOptions.esModuleInterop === true && compilerOptions.importHelpers === true) {\n\t\t\t\t\t\t\t\t\taddTslibDefinition();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\trequireImportedSymbol({\n\t\t\t\t\t\t\t\t\tisDefaultImport: true,\n\t\t\t\t\t\t\t\t\tmoduleSpecifier: matchingImport.importDeclaration.moduleSpecifier.text,\n\t\t\t\t\t\t\t\t\tname: matchingImport.identifier.text,\n\t\t\t\t\t\t\t\t\tpropertyName: matchingImport.identifier.text\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcase \"namedImport\": {\n\t\t\t\t\t\t\t\trequireImportedSymbol({\n\t\t\t\t\t\t\t\t\tisDefaultImport: false,\n\t\t\t\t\t\t\t\t\tmoduleSpecifier: matchingImport.importDeclaration.moduleSpecifier.text,\n\t\t\t\t\t\t\t\t\tname: matchingImport.importSpecifier.name.text,\n\t\t\t\t\t\t\t\t\tpropertyName: matchingImport.importSpecifier.propertyName?.text ?? matchingImport.importSpecifier.name.text\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcase \"namespace\": {\n\t\t\t\t\t\t\t\t// Log a request for the __importStar helper already if you will\n\t\t\t\t\t\t\t\t// need it in a later transformation step\n\t\t\t\t\t\t\t\tif (moduleKindSupportsImportHelpers(compilerOptions.module, typescript) && compilerOptions.esModuleInterop === true && compilerOptions.importHelpers !== true) {\n\t\t\t\t\t\t\t\t\ttransformationContext.requestEmitHelper(getImportStarHelper(typescript));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\trequireImportedSymbol({\n\t\t\t\t\t\t\t\t\tisNamespaceImport: true,\n\t\t\t\t\t\t\t\t\tmoduleSpecifier: matchingImport.importDeclaration.moduleSpecifier.text,\n\t\t\t\t\t\t\t\t\tname: matchingImport.identifier.text\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn factory.updateCallExpression(node, node.expression, node.typeArguments, [\n\t\t\t\t\tcustomImplementation == null ? factory.createIdentifier(\"undefined\") : (continuation(implementationArg) as TS.Expression),\n\t\t\t\t\tfactory.createObjectLiteralExpression([\n\t\t\t\t\t\tfactory.createPropertyAssignment(\"identifier\", factory.createNoSubstitutionTemplateLiteral(typeArgText)),\n\t\t\t\t\t\t...(customImplementation != null\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [factory.createPropertyAssignment(\"implementation\", factory.createIdentifier(rewriteImplementationName(implementationArgText, options)))])\n\t\t\t\t\t])\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn childContinuation(node);\n}\n\ninterface FindMatchingImportDeclarationForIdentifierBaseResult {\n\tkind: \"default\" | \"namespace\" | \"namedImport\";\n\timportDeclaration: TS.ImportDeclaration;\n}\n\ninterface FindMatchingImportDeclarationForIdentifierNamedImportResult extends FindMatchingImportDeclarationForIdentifierBaseResult {\n\tkind: \"namedImport\";\n\timportSpecifier: TS.ImportSpecifier;\n}\n\ninterface FindMatchingImportDeclarationForIdentifierDefaultResult extends FindMatchingImportDeclarationForIdentifierBaseResult {\n\tkind: \"default\";\n\tidentifier: TS.Identifier;\n}\n\ninterface FindMatchingImportDeclarationForIdentifierNamespaceResult extends FindMatchingImportDeclarationForIdentifierBaseResult {\n\tkind: \"namespace\";\n\tidentifier: TS.Identifier;\n}\n\ntype FindMatchingImportDeclarationForIdentifierResult =\n\t| FindMatchingImportDeclarationForIdentifierNamedImportResult\n\t| FindMatchingImportDeclarationForIdentifierDefaultResult\n\t| FindMatchingImportDeclarationForIdentifierNamespaceResult;\n\nfunction findMatchingImportDeclarationForIdentifier(\n\tidentifier: string,\n\toptions: BeforeVisitorOptions<TS.CallExpression>\n): FindMatchingImportDeclarationForIdentifierResult | undefined {\n\tconst {\n\t\tsourceFile,\n\t\tcontext: {typescript}\n\t} = options;\n\n\t// Find the matching import\n\tconst importDeclarations = sourceFile.statements.filter(typescript.isImportDeclaration);\n\n\tfor (const importDeclaration of importDeclarations) {\n\t\tif (importDeclaration.importClause == null) continue;\n\n\t\t// Default import\n\t\tif (importDeclaration.importClause.name?.text === identifier) {\n\t\t\treturn {\n\t\t\t\timportDeclaration,\n\t\t\t\tkind: \"default\",\n\t\t\t\tidentifier: importDeclaration.importClause.name\n\t\t\t};\n\t\t} else if (importDeclaration.importClause.namedBindings != null) {\n\t\t\tif (typescript.isNamespaceImport(importDeclaration.importClause.namedBindings)) {\n\t\t\t\tif (importDeclaration.importClause.namedBindings.name.text === identifier) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\timportDeclaration,\n\t\t\t\t\t\tkind: \"namespace\",\n\t\t\t\t\t\tidentifier: importDeclaration.importClause.namedBindings.name\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const importSpecifier of importDeclaration.importClause.namedBindings.elements) {\n\t\t\t\t\tif (importSpecifier.name.text === identifier) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\timportDeclaration,\n\t\t\t\t\t\t\tkind: \"namedImport\",\n\t\t\t\t\t\t\timportSpecifier: importSpecifier\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// No import was matched\n\treturn undefined;\n}\n\nfunction rewriteImplementationName(name: string, options: BeforeVisitorOptions<TS.CallExpression>): string {\n\tconst {\n\t\tcontext: {typescript, compilerOptions}\n\t} = options;\n\n\tswitch (compilerOptions.module) {\n\t\tcase typescript.ModuleKind.ES2022:\n\t\tcase typescript.ModuleKind.ES2020:\n\t\tcase typescript.ModuleKind.ES2015:\n\t\tcase typescript.ModuleKind.ESNext:\n\t\t\treturn name;\n\n\t\tcase typescript.ModuleKind.CommonJS:\n\t\tcase typescript.ModuleKind.AMD:\n\t\tcase typescript.ModuleKind.UMD: {\n\t\t\t// Find the matching import\n\t\t\tconst match = findMatchingImportDeclarationForIdentifier(name, options);\n\t\t\tif (match == null) {\n\t\t\t\treturn name;\n\t\t\t}\n\n\t\t\tswitch (match.kind) {\n\t\t\t\tcase \"default\":\n\t\t\t\t\treturn `${name}.default`;\n\t\t\t\tcase \"namespace\":\n\t\t\t\t\treturn name;\n\t\t\t\tcase \"namedImport\":\n\t\t\t\t\treturn `${name}.${(match.importSpecifier.propertyName ?? match.importSpecifier.name).text}`;\n\t\t\t}\n\n\t\t\t// Fall back to returning the original name\n\t\t\treturn name;\n\t\t}\n\n\t\tdefault:\n\t\t\t// TODO: Add support for SystemJS here\n\t\t\treturn name;\n\t}\n}\n\nfunction getDiMethodName(node: TS.Expression, context: VisitorContext): DiMethodName | undefined {\n\tif (!context.typescript.isPropertyAccessExpression(node) && !context.typescript.isElementAccessExpression(node)) {\n\t\treturn undefined;\n\t}\n\n\t// If it is an element access expression, evaluate the argument expression\n\tif (context.typescript.isElementAccessExpression(node)) {\n\t\t// Do nothing at this point if this isn't a DIContainer instance, as we can avoid invoking evaluate at this point\n\t\tif (!isDiContainerInstance(node, context)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst evaluationResult = context.evaluate(node.argumentExpression);\n\n\t\t// If no value could be computed, or if the value isn't of type string, do nothing\n\t\tif (!evaluationResult.success || typeof evaluationResult.value !== \"string\") {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\treturn isDiContainerMethodName(evaluationResult.value) ? evaluationResult.value : undefined;\n\t\t}\n\t} else {\n\t\t// If the name is any of the relevant ones, assert that it is invoked on an instance of DIContainer\n\t\treturn isDiContainerMethodName(node.name.text) && isDiContainerInstance(node, context) ? node.name.text : undefined;\n\t}\n}\n\nfunction isDiContainerMethodName(name: string): name is DiMethodName {\n\tswitch (name) {\n\t\tcase \"get\":\n\t\tcase \"has\":\n\t\tcase \"registerSingleton\":\n\t\tcase \"registerTransient\":\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction isDiContainerInstance(node: TS.PropertyAccessExpression | TS.ElementAccessExpression, context: VisitorContext): boolean {\n\tif (\"typeChecker\" in context) {\n\t\t// Don't proceed unless the left-hand expression is the DIServiceContainer\n\t\tconst type = context.typeChecker.getTypeAtLocation(node.expression);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison, @typescript-eslint/no-unnecessary-condition\n\t\tif (type?.symbol == null || type.symbol.escapedName !== DI_CONTAINER_NAME) {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\t// If one or more variable names were passed in, check those directly\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\tif (context.identifier != null && context.identifier.length > 0) {\n\t\t\t// Pick the left-hand side of the expression here\n\t\t\tconst name = (node.expression.getFirstToken()?.getText() ?? node.expression.getText()).trim();\n\t\t\t// If not a single matcher matches the text, this does not represent an instance of DIContainer.\n\t\t\tif (!ensureArray(context.identifier).some(matcher => name === matcher)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t// Otherwise, attempt to resolve the value of the expression and check if it is an instance of DIContainer\n\t\t\tconst evaluationResult = context.evaluate(node.expression);\n\n\t\t\tif (\n\t\t\t\t!evaluationResult.success ||\n\t\t\t\tevaluationResult.value == null ||\n\t\t\t\ttypeof evaluationResult.value !== \"object\" ||\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t\t\tevaluationResult.value.constructor?.name !== DI_CONTAINER_NAME\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n","import type {BeforeVisitorOptions} from \"../before-visitor-options.js\";\nimport type {TS} from \"../../../type/type.js\";\nimport {visitClassLikeDeclaration} from \"./visit-class-like-declaration.js\";\nimport {visitCallExpression} from \"./visit-call-expression.js\";\n\nexport function visitNode<T extends TS.Node>(options: BeforeVisitorOptions<T>): TS.VisitResult<TS.Node> {\n\tif (options.context.typescript.isClassLike(options.node)) {\n\t\treturn visitClassLikeDeclaration({...options, node: options.node});\n\t} else if (options.context.typescript.isCallExpression(options.node)) {\n\t\treturn visitCallExpression({...options, node: options.node});\n\t}\n\n\treturn options.childContinuation(options.node);\n}\n","import type {BaseVisitorContext, VisitorContext} from \"../visitor-context.js\";\nimport type {TS} from \"../../type/type.js\";\nimport type {BeforeVisitorOptions} from \"./before-visitor-options.js\";\nimport {visitNode} from \"./visitor/visit-node.js\";\nimport type {ImportedSymbol} from \"../../type/imported-symbol.js\";\nimport {ensureNodeFactory} from \"compatfactory\";\n\nexport function beforeTransformer(context: BaseVisitorContext): TS.TransformerFactory<TS.SourceFile> {\n\treturn transformationContext => {\n\t\tconst factory = ensureNodeFactory((transformationContext as {factory?: TS.NodeFactory}).factory ?? context.typescript);\n\n\t\treturn sourceFile =>\n\t\t\ttransformSourceFile(sourceFile, {\n\t\t\t\t...context,\n\t\t\t\ttransformationContext,\n\t\t\t\tfactory\n\t\t\t});\n\t};\n}\n\nexport function transformSourceFile(sourceFile: TS.SourceFile, context: VisitorContext): TS.SourceFile {\n\tconst requiredImportedSymbolSet = new Set<ImportedSymbol>();\n\n\t/**\n\t * An optimization in which every imported symbol is converted into\n\t * a string that can be matched against directly to guard against\n\t * duplicates\n\t */\n\tconst requiredImportedSymbolSetFlags = new Set<string>();\n\n\tif (context.needsImportPreservationLogic) {\n\t\tcontext.sourceFileToAddTslibDefinition.set(sourceFile.fileName, false);\n\t\tcontext.sourceFileToRequiredImportedSymbolSet.set(sourceFile.fileName, requiredImportedSymbolSet);\n\t}\n\n\tconst computeImportedSymbolFlag = (symbol: ImportedSymbol): string =>\n\t\t[\"name\", \"propertyName\", \"moduleSpecifier\", \"isNamespaceImport\", \"isDefaultImport\"]\n\t\t\t.map(property => `${property}:${(symbol[property as keyof ImportedSymbol] as (typeof symbol)[keyof ImportedSymbol] | undefined) ?? false}`)\n\t\t\t.join(\"|\");\n\n\tconst visitorOptions: Omit<BeforeVisitorOptions<TS.Node>, \"node\" | \"sourceFile\"> = {\n\t\tcontext,\n\n\t\taddTslibDefinition: (): void => {\n\t\t\tif (!context.needsImportPreservationLogic) return;\n\t\t\tcontext.sourceFileToAddTslibDefinition.set(sourceFile.fileName, true);\n\t\t},\n\n\t\trequireImportedSymbol: (importedSymbol: ImportedSymbol): void => {\n\t\t\tif (!context.needsImportPreservationLogic) return;\n\n\t\t\t// Guard against duplicates and compute a string so we can do\n\t\t\t// constant time lookups to compare against existing symbols\n\t\t\tconst flag = computeImportedSymbolFlag(importedSymbol);\n\t\t\tif (requiredImportedSymbolSetFlags.has(flag)) return;\n\t\t\trequiredImportedSymbolSetFlags.add(flag);\n\n\t\t\trequiredImportedSymbolSet.add(importedSymbol);\n\t\t},\n\n\t\tcontinuation: node =>\n\t\t\tvisitNode({\n\t\t\t\t...visitorOptions,\n\t\t\t\tsourceFile,\n\t\t\t\tnode\n\t\t\t}),\n\t\tchildContinuation: node =>\n\t\t\tcontext.typescript.visitEachChild(\n\t\t\t\tnode,\n\t\t\t\tcbNode =>\n\t\t\t\t\tvisitNode({\n\t\t\t\t\t\t...visitorOptions,\n\t\t\t\t\t\tsourceFile,\n\t\t\t\t\t\tnode: cbNode\n\t\t\t\t\t}),\n\t\t\t\tcontext.transformationContext\n\t\t\t)\n\t};\n\n\treturn visitorOptions.continuation(sourceFile) as TS.SourceFile;\n}\n"]}