{"version":3,"file":"index.node.mjs","sources":["../src/utils.ts","../src/imports-cache.ts","../src/debug-utils.ts","../src/normalize-options.ts","../src/visitors/usage.ts","../src/visitors/entry.ts","../src/node/dependencies.ts","../src/meta-resolver.ts","../src/index.ts"],"sourcesContent":["import { types as t, template } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type { Utils } from \"./types\";\nimport type ImportsCache from \"./imports-cache\";\n\nexport function intersection(a: Set, b: Set): Set {\n const result = new Set();\n a.forEach(v => b.has(v) && result.add(v));\n return result;\n}\n\nexport function has(object: any, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction getType(target: any): string {\n return Object.prototype.toString.call(target).slice(8, -1);\n}\n\nfunction resolveId(path): string {\n if (\n path.isIdentifier() &&\n !path.scope.hasBinding(path.node.name, /* noGlobals */ true)\n ) {\n return path.node.name;\n }\n\n const { deopt } = path.evaluate();\n if (deopt && deopt.isIdentifier()) {\n return deopt.node.name;\n }\n}\n\nexport function resolveKey(\n path: NodePath,\n computed: boolean = false,\n) {\n const { scope } = path;\n if (path.isStringLiteral()) return path.node.value;\n const isIdentifier = path.isIdentifier();\n if (\n isIdentifier &&\n !(computed || (path.parent as t.MemberExpression).computed)\n ) {\n return path.node.name;\n }\n\n if (\n computed &&\n path.isMemberExpression() &&\n path.get(\"object\").isIdentifier({ name: \"Symbol\" }) &&\n !scope.hasBinding(\"Symbol\", /* noGlobals */ true)\n ) {\n const sym = resolveKey(path.get(\"property\"), path.node.computed);\n if (sym) return \"Symbol.\" + sym;\n }\n\n if (!isIdentifier || scope.hasBinding(path.node.name, /* noGlobals */ true)) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n}\n\nexport function resolveSource(obj: NodePath): {\n id: string | null;\n placement: \"prototype\" | \"static\" | null;\n} {\n if (\n obj.isMemberExpression() &&\n obj.get(\"property\").isIdentifier({ name: \"prototype\" })\n ) {\n const id = resolveId(obj.get(\"object\"));\n\n if (id) {\n return { id, placement: \"prototype\" };\n }\n return { id: null, placement: null };\n }\n\n const id = resolveId(obj);\n if (id) {\n return { id, placement: \"static\" };\n }\n\n const { value } = obj.evaluate();\n if (value !== undefined) {\n return { id: getType(value), placement: \"prototype\" };\n } else if (obj.isRegExpLiteral()) {\n return { id: \"RegExp\", placement: \"prototype\" };\n } else if (obj.isFunction()) {\n return { id: \"Function\", placement: \"prototype\" };\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n if (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0])\n ) {\n return expression.arguments[0].value;\n }\n}\n\nfunction hoist(node: t.Node) {\n // @ts-expect-error\n node._blockHoist = 3;\n return node;\n}\n\nexport function createUtilsGetter(cache: ImportsCache) {\n return (path: NodePath): Utils => {\n const prog = path.findParent(p => p.isProgram()) as NodePath;\n\n return {\n injectGlobalImport(url) {\n cache.storeAnonymous(prog, url, (isScript, source) => {\n return isScript\n ? template.statement.ast`require(${source})`\n : t.importDeclaration([], source);\n });\n },\n injectNamedImport(url, name, hint = name) {\n return cache.storeNamed(prog, url, name, (isScript, source, name) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`\n var ${id} = require(${source}).${name}\n `)\n : t.importDeclaration([t.importSpecifier(id, name)], source),\n name: id.name,\n };\n });\n },\n injectDefaultImport(url, hint = url) {\n return cache.storeNamed(prog, url, \"default\", (isScript, source) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`var ${id} = require(${source})`)\n : t.importDeclaration([t.importDefaultSpecifier(id)], source),\n name: id.name,\n };\n });\n },\n };\n };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\ntype StrMap = Map;\n\nexport default class ImportsCache {\n _imports: WeakMap, StrMap>;\n _anonymousImports: WeakMap, Set>;\n _lastImports: WeakMap, NodePath>;\n _resolver: (url: string) => string;\n\n constructor(resolver: (url: string) => string) {\n this._imports = new WeakMap();\n this._anonymousImports = new WeakMap();\n this._lastImports = new WeakMap();\n this._resolver = resolver;\n }\n\n storeAnonymous(\n programPath: NodePath,\n url: string,\n // eslint-disable-next-line no-undef\n getVal: (isScript: boolean, source: t.StringLiteral) => t.Node,\n ) {\n const key = this._normalizeKey(programPath, url);\n const imports = this._ensure>(\n this._anonymousImports,\n programPath,\n Set,\n );\n\n if (imports.has(key)) return;\n\n const node = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n );\n imports.add(key);\n this._injectImport(programPath, node);\n }\n\n storeNamed(\n programPath: NodePath,\n url: string,\n name: string,\n getVal: (\n isScript: boolean,\n // eslint-disable-next-line no-undef\n source: t.StringLiteral,\n // eslint-disable-next-line no-undef\n name: t.Identifier,\n ) => { node: t.Node; name: string },\n ) {\n const key = this._normalizeKey(programPath, url, name);\n const imports = this._ensure>(\n this._imports,\n programPath,\n Map,\n );\n\n if (!imports.has(key)) {\n const { node, name: id } = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n t.identifier(name),\n );\n imports.set(key, id);\n this._injectImport(programPath, node);\n }\n\n return t.identifier(imports.get(key));\n }\n\n _injectImport(programPath: NodePath, node: t.Node) {\n const lastImport = this._lastImports.get(programPath);\n let newNodes: [NodePath];\n if (\n lastImport &&\n lastImport.node &&\n // Sometimes the AST is modified and the \"last import\"\n // we have has been replaced\n lastImport.parent === programPath.node &&\n lastImport.container === programPath.node.body\n ) {\n newNodes = lastImport.insertAfter(node);\n } else {\n newNodes = programPath.unshiftContainer(\"body\", node);\n }\n const newNode = newNodes[newNodes.length - 1];\n this._lastImports.set(programPath, newNode);\n\n /*\n let lastImport;\n\n programPath.get(\"body\").forEach(path => {\n if (path.isImportDeclaration()) lastImport = path;\n if (\n path.isExpressionStatement() &&\n isRequireCall(path.get(\"expression\"))\n ) {\n lastImport = path;\n }\n if (\n path.isVariableDeclaration() &&\n path.get(\"declarations\").length === 1 &&\n (isRequireCall(path.get(\"declarations.0.init\")) ||\n (path.get(\"declarations.0.init\").isMemberExpression() &&\n isRequireCall(path.get(\"declarations.0.init.object\"))))\n ) {\n lastImport = path;\n }\n });*/\n }\n\n _ensure | Set>(\n map: WeakMap, C>,\n programPath: NodePath,\n Collection: { new (...args: any): C },\n ): C {\n let collection = map.get(programPath);\n if (!collection) {\n collection = new Collection();\n map.set(programPath, collection);\n }\n return collection;\n }\n\n _normalizeKey(\n programPath: NodePath,\n url: string,\n name: string = \"\",\n ): string {\n const { sourceType } = programPath.node;\n\n // If we rely on the imported binding (the \"name\" parameter), we also need to cache\n // based on the sourceType. This is because the module transforms change the names\n // of the import variables.\n return `${name && sourceType}::${url}::${name}`;\n }\n}\n","import { prettifyTargets } from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"./types\";\n\nexport const presetEnvSilentDebugHeader =\n \"#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets\";\n\nexport function stringifyTargetsMultiline(targets: Targets): string {\n return JSON.stringify(prettifyTargets(targets), null, 2);\n}\n\nexport function stringifyTargets(targets: Targets): string {\n return JSON.stringify(targets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n}\n","import { intersection } from \"./utils\";\nimport type {\n Pattern,\n PluginOptions,\n MissingDependenciesOption,\n} from \"./types\";\n\nfunction patternToRegExp(pattern: Pattern): RegExp | null {\n if (pattern instanceof RegExp) return pattern;\n\n try {\n return new RegExp(`^${pattern}$`);\n } catch {\n return null;\n }\n}\n\nfunction buildUnusedError(label, unused) {\n if (!unused.length) return \"\";\n return (\n ` - The following \"${label}\" patterns didn't match any polyfill:\\n` +\n unused.map(original => ` ${String(original)}\\n`).join(\"\")\n );\n}\n\nfunction buldDuplicatesError(duplicates) {\n if (!duplicates.size) return \"\";\n return (\n ` - The following polyfills were matched both by \"include\" and \"exclude\" patterns:\\n` +\n Array.from(duplicates, name => ` ${name}\\n`).join(\"\")\n );\n}\n\nexport function validateIncludeExclude(\n provider: string,\n polyfills: Set,\n includePatterns: Pattern[],\n excludePatterns: Pattern[],\n) {\n let current;\n const filter = pattern => {\n const regexp = patternToRegExp(pattern);\n if (!regexp) return false;\n\n let matched = false;\n for (const polyfill of polyfills) {\n if (regexp.test(polyfill)) {\n matched = true;\n current.add(polyfill);\n }\n }\n return !matched;\n };\n\n // prettier-ignore\n const include = current = new Set ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set ();\n const unusedExclude = Array.from(excludePatterns).filter(filter);\n\n const duplicates = intersection(include, exclude);\n\n if (\n duplicates.size > 0 ||\n unusedInclude.length > 0 ||\n unusedExclude.length > 0\n ) {\n throw new Error(\n `Error while validating the \"${provider}\" provider options:\\n` +\n buildUnusedError(\"include\", unusedInclude) +\n buildUnusedError(\"exclude\", unusedExclude) +\n buldDuplicatesError(duplicates),\n );\n }\n\n return { include, exclude };\n}\n\nexport function applyMissingDependenciesDefaults(\n options: PluginOptions,\n babelApi: any,\n): MissingDependenciesOption {\n const { missingDependencies = {} } = options;\n if (missingDependencies === false) return false;\n\n const caller = babelApi.caller(caller => caller?.name);\n\n const {\n log = \"deferred\",\n inject = caller === \"rollup-plugin-babel\" ? \"throw\" : \"import\",\n all = false,\n } = missingDependencies;\n\n return { log, inject, all };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { MetaDescriptor } from \"../types\";\n\nimport { resolveKey, resolveSource } from \"../utils\";\n\nexport default (\n callProvider: (payload: MetaDescriptor, path: NodePath) => void,\n) => {\n function property(object, key, placement, path) {\n return callProvider({ kind: \"property\", object, key, placement }, path);\n }\n\n return {\n // Symbol(), new Promise\n ReferencedIdentifier(path: NodePath) {\n const {\n node: { name },\n scope,\n } = path;\n if (scope.getBindingIdentifier(name)) return;\n\n callProvider({ kind: \"global\", name }, path);\n },\n\n MemberExpression(path: NodePath) {\n const key = resolveKey(path.get(\"property\"), path.node.computed);\n if (!key || key === \"prototype\") return;\n\n const object = path.get(\"object\");\n if (object.isIdentifier()) {\n const binding = object.scope.getBinding(object.node.name);\n if (binding && binding.path.isImportNamespaceSpecifier()) return;\n }\n\n const source = resolveSource(object);\n return property(source.id, key, source.placement, path);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent } = path;\n let obj;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n obj = parentPath.get(\"init\");\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n obj = parentPath.get(\"right\");\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunction()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n obj = grand.get(\"arguments\")[path.key];\n }\n }\n }\n\n let id = null;\n let placement = null;\n if (obj) ({ id, placement } = resolveSource(obj));\n\n for (const prop of path.get(\"properties\")) {\n if (prop.isObjectProperty()) {\n const key = resolveKey(prop.get(\"key\"));\n if (key) property(id, key, placement, prop);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n if (!key) return;\n\n callProvider(\n {\n kind: \"in\",\n object: source.id,\n key,\n placement: source.placement,\n },\n path,\n );\n },\n };\n};\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { MetaDescriptor } from \"../types\";\n\nimport { getImportSource, getRequireSource } from \"../utils\";\n\nexport default (\n callProvider: (payload: MetaDescriptor, path: NodePath) => void,\n) => ({\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n callProvider({ kind: \"import\", source }, bodyPath);\n });\n },\n});\n","import path from \"path\";\nimport debounce from \"lodash.debounce\";\nimport requireResolve from \"resolve\";\n\nconst nativeRequireResolve = parseFloat(process.versions.node) >= 8.9;\n\nimport { createRequire } from \"module\";\nconst require = createRequire(import /*::(_)*/.meta.url); // eslint-disable-line\n\nfunction myResolve(name: string, basedir: string) {\n if (nativeRequireResolve) {\n return require\n .resolve(name, {\n paths: [basedir],\n })\n .replace(/\\\\/g, \"/\");\n } else {\n return requireResolve.sync(name, { basedir }).replace(/\\\\/g, \"/\");\n }\n}\n\nexport function resolve(\n dirname: string,\n moduleName: string,\n absoluteImports: boolean | string,\n): string {\n if (absoluteImports === false) return moduleName;\n\n let basedir = dirname;\n if (typeof absoluteImports === \"string\") {\n basedir = path.resolve(basedir, absoluteImports);\n }\n\n try {\n return myResolve(moduleName, basedir);\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") throw err;\n\n throw Object.assign(\n new Error(`Failed to resolve \"${moduleName}\" relative to \"${dirname}\"`),\n {\n code: \"BABEL_POLYFILL_NOT_FOUND\",\n polyfill: moduleName,\n dirname,\n },\n );\n }\n}\n\nexport function has(basedir: string, name: string) {\n try {\n myResolve(name, basedir);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function logMissing(missingDeps: Set) {\n if (missingDeps.size === 0) return;\n\n const deps = Array.from(missingDeps).sort().join(\" \");\n\n console.warn(\n \"\\nSome polyfills have been added but are not present in your dependencies.\\n\" +\n \"Please run one of the following commands:\\n\" +\n `\\tnpm install --save ${deps}\\n` +\n `\\tyarn add ${deps}\\n`,\n );\n\n process.exitCode = 1;\n}\n\nlet allMissingDeps = new Set();\n\nconst laterLogMissingDependencies = debounce(() => {\n logMissing(allMissingDeps);\n allMissingDeps = new Set();\n}, 100);\n\nexport function laterLogMissing(missingDeps: Set) {\n if (missingDeps.size === 0) return;\n\n missingDeps.forEach(name => allMissingDeps.add(name));\n laterLogMissingDependencies();\n}\n","import type {\n MetaDescriptor,\n ResolverPolyfills,\n ResolvedPolyfill,\n} from \"./types\";\n\nimport { has } from \"./utils\";\n\ntype ResolverFn = (meta: MetaDescriptor) => void | ResolvedPolyfill;\n\nconst PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver(\n polyfills: ResolverPolyfills,\n): ResolverFn {\n const { static: staticP, instance: instanceP, global: globalP } = polyfills;\n\n return meta => {\n if (meta.kind === \"global\" && globalP && has(globalP, meta.name)) {\n return { kind: \"global\", desc: globalP[meta.name], name: meta.name };\n }\n\n if (meta.kind === \"property\" || meta.kind === \"in\") {\n const { placement, object, key } = meta;\n\n if (object && placement === \"static\") {\n if (globalP && PossibleGlobalObjects.has(object) && has(globalP, key)) {\n return { kind: \"global\", desc: globalP[key], name: key };\n }\n\n if (staticP && has(staticP, object) && has(staticP[object], key)) {\n return {\n kind: \"static\",\n desc: staticP[object][key],\n name: `${object}$${key}`,\n };\n }\n }\n\n if (instanceP && has(instanceP, key)) {\n return { kind: \"instance\", desc: instanceP[key], name: `${key}` };\n }\n }\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nimport _getTargets, {\n isRequired,\n getInclusionReasons,\n} from \"@babel/helper-compilation-targets\";\nconst getTargets = _getTargets.default || _getTargets;\n\nimport { createUtilsGetter } from \"./utils\";\nimport ImportsCache from \"./imports-cache\";\nimport {\n stringifyTargetsMultiline,\n presetEnvSilentDebugHeader,\n} from \"./debug-utils\";\nimport {\n validateIncludeExclude,\n applyMissingDependenciesDefaults,\n} from \"./normalize-options\";\n\nimport type {\n ProviderApi,\n MethodString,\n Targets,\n MetaDescriptor,\n PolyfillProvider,\n PluginOptions,\n ProviderOptions,\n} from \"./types\";\n\nimport * as v from \"./visitors\";\nimport * as deps from \"./node/dependencies\";\n\nimport createMetaResolver from \"./meta-resolver\";\n\nexport type { PolyfillProvider, MetaDescriptor, Utils, Targets } from \"./types\";\n\nfunction resolveOptions(\n options: PluginOptions,\n babelApi,\n): {\n method: MethodString;\n methodName: \"usageGlobal\" | \"entryGlobal\" | \"usagePure\";\n targets: Targets;\n debug: boolean | typeof presetEnvSilentDebugHeader;\n shouldInjectPolyfill:\n | ((name: string, shouldInject: boolean) => boolean)\n | undefined;\n providerOptions: ProviderOptions;\n absoluteImports: string | boolean;\n} {\n const {\n method,\n targets: targetsOption,\n ignoreBrowserslistConfig,\n configPath,\n debug,\n shouldInjectPolyfill,\n absoluteImports,\n ...providerOptions\n } = options;\n\n if (isEmpty(options)) {\n throw new Error(\n `\\\nThis plugin requires options, for example:\n {\n \"plugins\": [\n [\"\", { method: \"usage-pure\" }]\n ]\n }\n\nSee more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`,\n );\n }\n\n let methodName;\n if (method === \"usage-global\") methodName = \"usageGlobal\";\n else if (method === \"entry-global\") methodName = \"entryGlobal\";\n else if (method === \"usage-pure\") methodName = \"usagePure\";\n else if (typeof method !== \"string\") {\n throw new Error(\".method must be a string\");\n } else {\n throw new Error(\n `.method must be one of \"entry-global\", \"usage-global\"` +\n ` or \"usage-pure\" (received ${JSON.stringify(method)})`,\n );\n }\n\n if (typeof shouldInjectPolyfill === \"function\") {\n if (options.include || options.exclude) {\n throw new Error(\n `.include and .exclude are not supported when using the` +\n ` .shouldInjectPolyfill function.`,\n );\n }\n } else if (shouldInjectPolyfill != null) {\n throw new Error(\n `.shouldInjectPolyfill must be a function, or undefined` +\n ` (received ${JSON.stringify(shouldInjectPolyfill)})`,\n );\n }\n\n if (\n absoluteImports != null &&\n typeof absoluteImports !== \"boolean\" &&\n typeof absoluteImports !== \"string\"\n ) {\n throw new Error(\n `.absoluteImports must be a boolean, a string, or undefined` +\n ` (received ${JSON.stringify(absoluteImports)})`,\n );\n }\n\n let targets;\n\n if (\n // If any browserslist-related option is specified, fallback to the old\n // behavior of not using the targets specified in the top-level options.\n targetsOption ||\n configPath ||\n ignoreBrowserslistConfig\n ) {\n const targetsObj =\n typeof targetsOption === \"string\" || Array.isArray(targetsOption)\n ? { browsers: targetsOption }\n : targetsOption;\n\n targets = getTargets(targetsObj, {\n ignoreBrowserslistConfig,\n configPath,\n });\n } else {\n targets = babelApi.targets();\n }\n\n return {\n method,\n methodName,\n targets,\n absoluteImports: absoluteImports ?? false,\n shouldInjectPolyfill,\n debug: !!debug,\n providerOptions: providerOptions as any as ProviderOptions,\n };\n}\n\nfunction instantiateProvider(\n factory: PolyfillProvider,\n options: PluginOptions,\n missingDependencies,\n dirname,\n debugLog,\n babelApi,\n) {\n const {\n method,\n methodName,\n targets,\n debug,\n shouldInjectPolyfill,\n providerOptions,\n absoluteImports,\n } = resolveOptions(options, babelApi);\n\n const getUtils = createUtilsGetter(\n new ImportsCache(moduleName =>\n deps.resolve(dirname, moduleName, absoluteImports),\n ),\n );\n\n // eslint-disable-next-line prefer-const\n let include, exclude;\n let polyfillsSupport;\n let polyfillsNames;\n let filterPolyfills;\n\n const depsCache = new Map();\n\n const api: ProviderApi = {\n babel: babelApi,\n getUtils,\n method: options.method,\n targets,\n createMetaResolver,\n shouldInjectPolyfill(name) {\n if (polyfillsNames === undefined) {\n throw new Error(\n `Internal error in the ${factory.name} provider: ` +\n `shouldInjectPolyfill() can't be called during initialization.`,\n );\n }\n if (!polyfillsNames.has(name)) {\n console.warn(\n `Internal error in the ${providerName} provider: ` +\n `unknown polyfill \"${name}\".`,\n );\n }\n\n if (filterPolyfills && !filterPolyfills(name)) return false;\n\n let shouldInject = isRequired(name, targets, {\n compatData: polyfillsSupport,\n includes: include,\n excludes: exclude,\n });\n\n if (shouldInjectPolyfill) {\n shouldInject = shouldInjectPolyfill(name, shouldInject);\n if (typeof shouldInject !== \"boolean\") {\n throw new Error(`.shouldInjectPolyfill must return a boolean.`);\n }\n }\n\n return shouldInject;\n },\n debug(name) {\n debugLog().found = true;\n\n if (!debug || !name) return;\n\n if (debugLog().polyfills.has(providerName)) return;\n debugLog().polyfills.add(name);\n debugLog().polyfillsSupport ??= polyfillsSupport;\n },\n assertDependency(name, version = \"*\") {\n if (missingDependencies === false) return;\n if (absoluteImports) {\n // If absoluteImports is not false, we will try resolving\n // the dependency and throw if it's not possible. We can\n // skip the check here.\n return;\n }\n\n const dep = version === \"*\" ? name : `${name}@^${version}`;\n\n const found = missingDependencies.all\n ? false\n : mapGetOr(depsCache, `${name} :: ${dirname}`, () =>\n deps.has(dirname, name),\n );\n\n if (!found) {\n debugLog().missingDeps.add(dep);\n }\n },\n };\n\n const provider = factory(api, providerOptions, dirname);\n const providerName = provider.name || factory.name;\n\n if (typeof provider[methodName] !== \"function\") {\n throw new Error(\n `The \"${providerName}\" provider doesn't support the \"${method}\" polyfilling method.`,\n );\n }\n\n if (Array.isArray(provider.polyfills)) {\n polyfillsNames = new Set(provider.polyfills);\n filterPolyfills = provider.filterPolyfills;\n } else if (provider.polyfills) {\n polyfillsNames = new Set(Object.keys(provider.polyfills));\n polyfillsSupport = provider.polyfills;\n filterPolyfills = provider.filterPolyfills;\n } else {\n polyfillsNames = new Set();\n }\n\n ({ include, exclude } = validateIncludeExclude(\n providerName,\n polyfillsNames,\n providerOptions.include || [],\n providerOptions.exclude || [],\n ));\n\n return {\n debug,\n method,\n targets,\n provider,\n providerName,\n callProvider(payload: MetaDescriptor, path: NodePath) {\n const utils = getUtils(path);\n provider[methodName](payload, utils, path);\n },\n };\n}\n\nexport default function definePolyfillProvider(\n factory: PolyfillProvider,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(7);\n const { traverse } = babelApi;\n\n let debugLog;\n\n const missingDependencies = applyMissingDependenciesDefaults(\n options,\n babelApi,\n );\n\n const { debug, method, targets, provider, providerName, callProvider } =\n instantiateProvider(\n factory,\n options,\n missingDependencies,\n dirname,\n () => debugLog,\n babelApi,\n );\n\n const createVisitor = method === \"entry-global\" ? v.entry : v.usage;\n\n const visitor = provider.visitor\n ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor])\n : createVisitor(callProvider);\n\n if (debug && debug !== presetEnvSilentDebugHeader) {\n console.log(`${providerName}: \\`DEBUG\\` option`);\n console.log(`\\nUsing targets: ${stringifyTargetsMultiline(targets)}`);\n console.log(`\\nUsing polyfills with \\`${method}\\` method:`);\n }\n\n const { runtimeName } = provider;\n\n return {\n name: \"inject-polyfills\",\n visitor,\n\n pre(file) {\n if (runtimeName) {\n if (\n file.get(\"runtimeHelpersModuleName\") &&\n file.get(\"runtimeHelpersModuleName\") !== runtimeName\n ) {\n console.warn(\n `Two different polyfill providers` +\n ` (${file.get(\"runtimeHelpersModuleProvider\")}` +\n ` and ${providerName}) are trying to define two` +\n ` conflicting @babel/runtime alternatives:` +\n ` ${file.get(\"runtimeHelpersModuleName\")} and ${runtimeName}.` +\n ` The second one will be ignored.`,\n );\n } else {\n file.set(\"runtimeHelpersModuleName\", runtimeName);\n file.set(\"runtimeHelpersModuleProvider\", providerName);\n }\n }\n\n debugLog = {\n polyfills: new Set(),\n polyfillsSupport: undefined,\n found: false,\n providers: new Set(),\n missingDeps: new Set(),\n };\n\n provider.pre?.apply(this, arguments);\n },\n post() {\n provider.post?.apply(this, arguments);\n\n if (missingDependencies !== false) {\n if (missingDependencies.log === \"per-file\") {\n deps.logMissing(debugLog.missingDeps);\n } else {\n deps.laterLogMissing(debugLog.missingDeps);\n }\n }\n\n if (!debug) return;\n\n if (this.filename) console.log(`\\n[${this.filename}]`);\n\n if (debugLog.polyfills.size === 0) {\n console.log(\n method === \"entry-global\"\n ? debugLog.found\n ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.`\n : `The entry point for the ${providerName} polyfill has not been found.`\n : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`,\n );\n\n return;\n }\n\n if (method === \"entry-global\") {\n console.log(\n `The ${providerName} polyfill entry has been replaced with ` +\n `the following polyfills:`,\n );\n } else {\n console.log(\n `The ${providerName} polyfill added the following polyfills:`,\n );\n }\n\n for (const name of debugLog.polyfills) {\n if (debugLog.polyfillsSupport?.[name]) {\n const filteredTargets = getInclusionReasons(\n name,\n targets,\n debugLog.polyfillsSupport,\n );\n\n const formattedTargets = JSON.stringify(filteredTargets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${name} ${formattedTargets}`);\n } else {\n console.log(` ${name}`);\n }\n }\n },\n };\n });\n}\n\nfunction mapGetOr(map, key, getDefault) {\n let val = map.get(key);\n if (val === undefined) {\n val = getDefault();\n map.set(key, val);\n }\n return val;\n}\n\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n"],"names":["types","t","template","_babel","default","intersection","a","b","result","Set","forEach","v","has","add","object","key","Object","prototype","hasOwnProperty","call","getType","target","toString","slice","resolveId","path","isIdentifier","scope","hasBinding","node","name","deopt","evaluate","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","get","sym","resolveSource","obj","id","placement","undefined","isRegExpLiteral","isFunction","getImportSource","specifiers","length","source","getRequireSource","isExpressionStatement","expression","isCallExpression","callee","arguments","hoist","_blockHoist","createUtilsGetter","cache","prog","findParent","p","isProgram","injectGlobalImport","url","storeAnonymous","isScript","statement","ast","importDeclaration","injectNamedImport","hint","storeNamed","generateUidIdentifier","importSpecifier","injectDefaultImport","importDefaultSpecifier","ImportsCache","constructor","resolver","_imports","WeakMap","_anonymousImports","_lastImports","_resolver","programPath","getVal","_normalizeKey","imports","_ensure","sourceType","stringLiteral","_injectImport","Map","identifier","set","lastImport","newNodes","container","body","insertAfter","unshiftContainer","newNode","map","Collection","collection","presetEnvSilentDebugHeader","stringifyTargetsMultiline","targets","JSON","stringify","prettifyTargets","patternToRegExp","pattern","RegExp","buildUnusedError","label","unused","original","String","join","buldDuplicatesError","duplicates","size","Array","from","validateIncludeExclude","provider","polyfills","includePatterns","excludePatterns","current","filter","regexp","matched","polyfill","test","include","unusedInclude","exclude","unusedExclude","Error","applyMissingDependenciesDefaults","options","babelApi","missingDependencies","caller","log","inject","all","callProvider","property","kind","ReferencedIdentifier","getBindingIdentifier","MemberExpression","binding","getBinding","isImportNamespaceSpecifier","ObjectPattern","parentPath","isVariableDeclarator","isAssignmentExpression","grand","isNewExpression","prop","isObjectProperty","BinaryExpression","operator","ImportDeclaration","Program","bodyPath","nativeRequireResolve","parseFloat","process","versions","require","createRequire","import","meta","myResolve","basedir","resolve","paths","replace","requireResolve","sync","dirname","moduleName","absoluteImports","err","code","assign","logMissing","missingDeps","deps","sort","console","warn","exitCode","allMissingDeps","laterLogMissingDependencies","debounce","laterLogMissing","PossibleGlobalObjects","createMetaResolver","static","staticP","instance","instanceP","global","globalP","desc","getTargets","_getTargets","resolveOptions","method","targetsOption","ignoreBrowserslistConfig","configPath","debug","shouldInjectPolyfill","providerOptions","isEmpty","methodName","targetsObj","isArray","browsers","instantiateProvider","factory","debugLog","getUtils","polyfillsSupport","polyfillsNames","filterPolyfills","depsCache","api","babel","providerName","shouldInject","isRequired","compatData","includes","excludes","_debugLog","_debugLog$polyfillsSu","found","assertDependency","version","dep","mapGetOr","keys","payload","utils","definePolyfillProvider","declare","assertVersion","traverse","createVisitor","visitor","visitors","merge","runtimeName","pre","file","_provider$pre","providers","apply","post","_provider$post","filename","_debugLog$polyfillsSu2","filteredTargets","getInclusionReasons","formattedTargets","getDefault","val"],"mappings":";;;;;;;;;EAASA,KAAK,EAAIC,GAAC;EAAEC,QAAQ,EAARA;AAAQ,IAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA;AAKtB,SAASE,YAAYA,CAAIC,CAAS,EAAEC,CAAS,EAAU;EAC5D,MAAMC,MAAM,GAAG,IAAIC,GAAG,EAAK;EAC3BH,CAAC,CAACI,OAAO,CAACC,CAAC,IAAIJ,CAAC,CAACK,GAAG,CAACD,CAAC,CAAC,IAAIH,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