summaryrefslogtreecommitdiff
path: root/node_modules/@babel/helper-define-polyfill-provider
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/helper-define-polyfill-provider')
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs199
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map2
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs199
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map2
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/lib/imports-cache.js96
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/lib/index.js32
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js2
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/lib/utils.js12
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js66
-rw-r--r--node_modules/@babel/helper-define-polyfill-provider/package.json4
10 files changed, 348 insertions, 266 deletions
diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs
index 9e9defb3..c666f5e1 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs
+++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs
@@ -126,13 +126,13 @@ function createUtilsGetter(cache) {
return path => {
const prog = path.findParent(p => p.isProgram());
return {
- injectGlobalImport(url) {
- cache.storeAnonymous(prog, url, (isScript, source) => {
+ injectGlobalImport(url, moduleName) {
+ cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {
return isScript ? template.statement.ast`require(${source})` : t$1.importDeclaration([], source);
});
},
- injectNamedImport(url, name, hint = name) {
- return cache.storeNamed(prog, url, name, (isScript, source, name) => {
+ injectNamedImport(url, name, hint = name, moduleName) {
+ return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`
@@ -142,8 +142,8 @@ function createUtilsGetter(cache) {
};
});
},
- injectDefaultImport(url, hint = url) {
- return cache.storeNamed(prog, url, "default", (isScript, source) => {
+ injectDefaultImport(url, hint = url, moduleName) {
+ return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t$1.importDeclaration([t$1.importDefaultSpecifier(id)], source),
@@ -158,24 +158,23 @@ function createUtilsGetter(cache) {
const {
types: t
} = _babel.default || _babel;
-class ImportsCache {
- constructor(resolver) {
+class ImportsCachedInjector {
+ constructor(resolver, getPreferredIndex) {
this._imports = new WeakMap();
this._anonymousImports = new WeakMap();
this._lastImports = new WeakMap();
this._resolver = resolver;
+ this._getPreferredIndex = getPreferredIndex;
}
- storeAnonymous(programPath, url,
- // eslint-disable-next-line no-undef
- getVal) {
+ storeAnonymous(programPath, url, moduleName, getVal) {
const key = this._normalizeKey(programPath, url);
const imports = this._ensure(this._anonymousImports, programPath, Set);
if (imports.has(key)) return;
const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)));
imports.add(key);
- this._injectImport(programPath, node);
+ this._injectImport(programPath, node, moduleName);
}
- storeNamed(programPath, url, name, getVal) {
+ storeNamed(programPath, url, name, moduleName, getVal) {
const key = this._normalizeKey(programPath, url, name);
const imports = this._ensure(this._imports, programPath, Map);
if (!imports.has(key)) {
@@ -184,46 +183,58 @@ class ImportsCache {
name: id
} = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name));
imports.set(key, id);
- this._injectImport(programPath, node);
+ this._injectImport(programPath, node, moduleName);
}
return t.identifier(imports.get(key));
}
- _injectImport(programPath, node) {
- const lastImport = this._lastImports.get(programPath);
- let newNodes;
- if (lastImport && lastImport.node &&
+ _injectImport(programPath, node, moduleName) {
+ var _this$_lastImports$ge;
+ const newIndex = this._getPreferredIndex(moduleName);
+ const lastImports = (_this$_lastImports$ge = this._lastImports.get(programPath)) != null ? _this$_lastImports$ge : [];
+ const isPathStillValid = path => path.node &&
// Sometimes the AST is modified and the "last import"
// we have has been replaced
- lastImport.parent === programPath.node && lastImport.container === programPath.node.body) {
- newNodes = lastImport.insertAfter(node);
- } else {
- newNodes = programPath.unshiftContainer("body", node);
- }
- const newNode = newNodes[newNodes.length - 1];
- this._lastImports.set(programPath, newNode);
-
- /*
- let lastImport;
- programPath.get("body").forEach(path => {
- if (path.isImportDeclaration()) lastImport = path;
- if (
- path.isExpressionStatement() &&
- isRequireCall(path.get("expression"))
- ) {
- lastImport = path;
+ path.parent === programPath.node && path.container === programPath.node.body;
+ let last;
+ if (newIndex === Infinity) {
+ // Fast path: we can always just insert at the end if newIndex is `Infinity`
+ if (lastImports.length > 0) {
+ last = lastImports[lastImports.length - 1].path;
+ if (!isPathStillValid(last)) last = undefined;
}
- if (
- path.isVariableDeclaration() &&
- path.get("declarations").length === 1 &&
- (isRequireCall(path.get("declarations.0.init")) ||
- (path.get("declarations.0.init").isMemberExpression() &&
- isRequireCall(path.get("declarations.0.init.object"))))
- ) {
- lastImport = path;
+ } else {
+ for (const [i, data] of lastImports.entries()) {
+ const {
+ path,
+ index
+ } = data;
+ if (isPathStillValid(path)) {
+ if (newIndex < index) {
+ const [newPath] = path.insertBefore(node);
+ lastImports.splice(i, 0, {
+ path: newPath,
+ index: newIndex
+ });
+ return;
+ }
+ last = path;
+ }
}
- });*/
+ }
+ if (last) {
+ const [newPath] = last.insertAfter(node);
+ lastImports.push({
+ path: newPath,
+ index: newIndex
+ });
+ } else {
+ const [newPath] = programPath.unshiftContainer("body", node);
+ this._lastImports.set(programPath, [{
+ path: newPath,
+ index: newIndex
+ }]);
+ }
}
-
_ensure(map, programPath, Collection) {
let collection = map.get(programPath);
if (!collection) {
@@ -271,7 +282,7 @@ function validateIncludeExclude(provider, polyfills, includePatterns, excludePat
const regexp = patternToRegExp(pattern);
if (!regexp) return false;
let matched = false;
- for (const polyfill of polyfills) {
+ for (const polyfill of polyfills.keys()) {
if (regexp.test(polyfill)) {
matched = true;
current.add(polyfill);
@@ -314,6 +325,17 @@ function applyMissingDependenciesDefaults(options, babelApi) {
};
}
+function isRemoved(path) {
+ if (path.removed) return true;
+ if (!path.parentPath) return false;
+ if (path.listKey) {
+ var _path$parentPath$node;
+ if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true;
+ } else {
+ if (path.parentPath.node[path.key] !== path.node) return true;
+ }
+ return isRemoved(path.parentPath);
+}
var usage = (callProvider => {
function property(object, key, placement, path) {
return callProvider({
@@ -323,31 +345,58 @@ var usage = (callProvider => {
placement
}, path);
}
+ function handleReferencedIdentifier(path) {
+ const {
+ node: {
+ name
+ },
+ scope
+ } = path;
+ if (scope.getBindingIdentifier(name)) return;
+ callProvider({
+ kind: "global",
+ name
+ }, path);
+ }
+ function analyzeMemberExpression(path) {
+ const key = resolveKey(path.get("property"), path.node.computed);
+ return {
+ key,
+ handleAsMemberExpression: !!key && key !== "prototype"
+ };
+ }
return {
// Symbol(), new Promise
ReferencedIdentifier(path) {
const {
- node: {
- name
- },
- scope
+ parentPath
} = path;
- if (scope.getBindingIdentifier(name)) return;
- callProvider({
- kind: "global",
- name
- }, path);
+ if (parentPath.isMemberExpression({
+ object: path.node
+ }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) {
+ return;
+ }
+ handleReferencedIdentifier(path);
},
MemberExpression(path) {
- const key = resolveKey(path.get("property"), path.node.computed);
- if (!key || key === "prototype") return;
+ const {
+ key,
+ handleAsMemberExpression
+ } = analyzeMemberExpression(path);
+ if (!handleAsMemberExpression) return;
const object = path.get("object");
- if (object.isIdentifier()) {
+ let objectIsGlobalIdentifier = object.isIdentifier();
+ if (objectIsGlobalIdentifier) {
const binding = object.scope.getBinding(object.node.name);
- if (binding && binding.path.isImportNamespaceSpecifier()) return;
+ if (binding) {
+ if (binding.path.isImportNamespaceSpecifier()) return;
+ objectIsGlobalIdentifier = false;
+ }
}
const source = resolveSource(object);
- return property(source.id, key, source.placement, path);
+ let skipObject = property(source.id, key, source.placement, path);
+ skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
+ if (!skipObject) handleReferencedIdentifier(object);
},
ObjectPattern(path) {
const {
@@ -559,13 +608,16 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
providerOptions,
absoluteImports
} = resolveOptions(options, babelApi);
- const getUtils = createUtilsGetter(new ImportsCache(moduleName => resolve(dirname, moduleName, absoluteImports)));
// eslint-disable-next-line prefer-const
let include, exclude;
let polyfillsSupport;
let polyfillsNames;
let filterPolyfills;
+ const getUtils = createUtilsGetter(new ImportsCachedInjector(moduleName => resolve(dirname, moduleName, absoluteImports), name => {
+ var _polyfillsNames$get, _polyfillsNames;
+ return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity;
+ }));
const depsCache = new Map();
const api = {
babel: babelApi,
@@ -623,29 +675,40 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`);
}
if (Array.isArray(provider.polyfills)) {
- polyfillsNames = new Set(provider.polyfills);
+ polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index]));
filterPolyfills = provider.filterPolyfills;
} else if (provider.polyfills) {
- polyfillsNames = new Set(Object.keys(provider.polyfills));
+ polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index]));
polyfillsSupport = provider.polyfills;
filterPolyfills = provider.filterPolyfills;
} else {
- polyfillsNames = new Set();
+ polyfillsNames = new Map();
}
({
include,
exclude
} = validateIncludeExclude(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || []));
+ let callProvider;
+ if (methodName === "usageGlobal") {
+ callProvider = (payload, path) => {
+ var _ref;
+ const utils = getUtils(path);
+ return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false;
+ };
+ } else {
+ callProvider = (payload, path) => {
+ const utils = getUtils(path);
+ provider[methodName](payload, utils, path);
+ return false;
+ };
+ }
return {
debug,
method,
targets,
provider,
providerName,
- callProvider(payload, path) {
- const utils = getUtils(path);
- provider[methodName](payload, utils, path);
- }
+ callProvider
};
}
function definePolyfillProvider(factory) {
diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map
index 9be4b34f..78486ac3 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map
+++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map
@@ -1 +1 @@
-{"version":3,"file":"index.browser.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/browser/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<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>();\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 if (path.isPure()) {\n const { deopt } = path.evaluate();\n if (deopt && deopt.isIdentifier()) {\n return deopt.node.name;\n }\n }\n}\n\nexport function resolveKey(\n path: NodePath<t.Expression | t.PrivateName>,\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 (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\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 if (obj.isRegExpLiteral()) {\n return { id: \"RegExp\", placement: \"prototype\" };\n } else if (obj.isFunction()) {\n return { id: \"Function\", placement: \"prototype\" };\n } else if (obj.isPure()) {\n const { value } = obj.evaluate();\n if (value !== undefined) {\n return { id: getType(value), placement: \"prototype\" };\n }\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath<t.ImportDeclaration>) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath<t.Statement>) {\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<t.Program>;\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<K> = Map<string, K>;\n\nexport default class ImportsCache {\n _imports: WeakMap<NodePath<t.Program>, StrMap<string>>;\n _anonymousImports: WeakMap<NodePath<t.Program>, Set<string>>;\n _lastImports: WeakMap<NodePath<t.Program>, NodePath<t.Node>>;\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<t.Program>,\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<Set<string>>(\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<t.Program>,\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<Map<string, any>>(\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<t.Program>, 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<C extends Map<string, any> | Set<string>>(\n map: WeakMap<NodePath<t.Program>, C>,\n programPath: NodePath<t.Program>,\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<t.Program>,\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<string>,\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<string> ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set<string> ();\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<t.Identifier>) {\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<t.MemberExpression>) {\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<t.ObjectPattern>) {\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<t.BinaryExpression>) {\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<t.ImportDeclaration>) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath<t.Program>) {\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","export function resolve(\n dirname: string,\n moduleName: string,\n absoluteImports: boolean | string,\n): string {\n if (absoluteImports === false) return moduleName;\n\n throw new Error(\n `\"absoluteImports\" is not supported in bundles prepared for the browser.`,\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function has(basedir: string, name: string) {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function logMissing(missingDeps: Set<string>) {}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function laterLogMissing(missingDeps: Set<string>) {}\n","import type {\n MetaDescriptor,\n ResolverPolyfills,\n ResolvedPolyfill,\n} from \"./types\";\n\nimport { has } from \"./utils\";\n\ntype ResolverFn<T> = (meta: MetaDescriptor) => void | ResolvedPolyfill<T>;\n\nconst PossibleGlobalObjects = new Set<string>([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver<T>(\n polyfills: ResolverPolyfills<T>,\n): ResolverFn<T> {\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<Options>(\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<Options>;\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 [\"<plugin name>\", { 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<Options>,\n };\n}\n\nfunction instantiateProvider<Options>(\n factory: PolyfillProvider<Options>,\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>(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<Options>(\n factory: PolyfillProvider<Options>,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\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<Options>(\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","isPure","deopt","evaluate","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","get","sym","resolveSource","obj","id","placement","isRegExpLiteral","isFunction","undefined","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","resolve","dirname","moduleName","absoluteImports","basedir","logMissing","missingDeps","laterLogMissing","PossibleGlobalObjects","createMetaResolver","static","staticP","instance","instanceP","global","globalP","meta","desc","getTargets","_getTargets","resolveOptions","method","targetsOption","ignoreBrowserslistConfig","configPath","debug","shouldInjectPolyfill","providerOptions","isEmpty","methodName","targetsObj","isArray","browsers","instantiateProvider","factory","debugLog","getUtils","deps","polyfillsSupport","polyfillsNames","filterPolyfills","depsCache","api","babel","console","warn","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","replace","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,MAAM,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ACrE,GAAG,CACR,OAAMuE,YAAa,0CACtB,CAAC;;QAGH,KAAK,MAAMhM,IAAI,IAAIqL,QAAQ,CAAC/E,SAAS,EAAE;UAAA,IAAA2H,sBAAA;UACrC,KAAAA,sBAAA,GAAI5C,QAAQ,CAACG,gBAAgB,aAAzByC,sBAAA,CAA4BjO,IAAI,CAAC,EAAE;YACrC,MAAMkO,eAAe,GAAGC,mBAAmB,CACzCnO,IAAI,EACJkF,OAAO,EACPmG,QAAQ,CAACG,gBACX,CAAC;YAED,MAAM4C,gBAAgB,GAAGjJ,IAAI,CAACC,SAAS,CAAC8I,eAAe,CAAC,CACrDG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CACnBA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CACtBA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;YAEzBvC,OAAO,CAACrE,GAAG,CAAE,KAAIzH,IAAK,IAAGoO,gBAAiB,EAAC,CAAC;WAC7C,MAAM;YACLtC,OAAO,CAACrE,GAAG,CAAE,KAAIzH,IAAK,EAAC,CAAC;;;;KAI/B;GACF,CAAC;AACJ;AAEA,SAAS4M,QAAQA,CAAC/H,GAAG,EAAE5F,GAAG,EAAEqP,UAAU,EAAE;EACtC,IAAIC,GAAG,GAAG1J,GAAG,CAACnE,GAAG,CAACzB,GAAG,CAAC;EACtB,IAAIsP,GAAG,KAAKrN,SAAS,EAAE;IACrBqN,GAAG,GAAGD,UAAU,EAAE;IAClBzJ,GAAG,CAACR,GAAG,CAACpF,GAAG,EAAEsP,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAASzD,OAAOA,CAACjK,GAAG,EAAE;EACpB,OAAO3B,MAAM,CAAC2N,IAAI,CAAChM,GAAG,CAAC,CAACQ,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file
+{"version":3,"file":"index.browser.mjs","sources":["../src/utils.ts","../src/imports-injector.ts","../src/debug-utils.ts","../src/normalize-options.ts","../src/visitors/usage.ts","../src/visitors/entry.ts","../src/browser/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 ImportsCachedInjector from \"./imports-injector\";\n\nexport function intersection<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>();\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 if (path.isPure()) {\n const { deopt } = path.evaluate();\n if (deopt && deopt.isIdentifier()) {\n return deopt.node.name;\n }\n }\n}\n\nexport function resolveKey(\n path: NodePath<t.Expression | t.PrivateName>,\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 (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\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 if (obj.isRegExpLiteral()) {\n return { id: \"RegExp\", placement: \"prototype\" };\n } else if (obj.isFunction()) {\n return { id: \"Function\", placement: \"prototype\" };\n } else if (obj.isPure()) {\n const { value } = obj.evaluate();\n if (value !== undefined) {\n return { id: getType(value), placement: \"prototype\" };\n }\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath<t.ImportDeclaration>) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath<t.Statement>) {\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: ImportsCachedInjector) {\n return (path: NodePath): Utils => {\n const prog = path.findParent(p => p.isProgram()) as NodePath<t.Program>;\n\n return {\n injectGlobalImport(url, moduleName) {\n cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {\n return isScript\n ? template.statement.ast`require(${source})`\n : t.importDeclaration([], source);\n });\n },\n injectNamedImport(url, name, hint = name, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n name,\n moduleName,\n (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 },\n injectDefaultImport(url, hint = url, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n \"default\",\n moduleName,\n (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}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\ntype StrMap<K> = Map<string, K>;\n\nexport default class ImportsCachedInjector {\n _imports: WeakMap<NodePath<t.Program>, StrMap<string>>;\n _anonymousImports: WeakMap<NodePath<t.Program>, Set<string>>;\n _lastImports: WeakMap<\n NodePath<t.Program>,\n Array<{ path: NodePath<t.Node>; index: number }>\n >;\n _resolver: (url: string) => string;\n _getPreferredIndex: (url: string) => number;\n\n constructor(\n resolver: (url: string) => string,\n getPreferredIndex: (url: string) => number,\n ) {\n this._imports = new WeakMap();\n this._anonymousImports = new WeakMap();\n this._lastImports = new WeakMap();\n this._resolver = resolver;\n this._getPreferredIndex = getPreferredIndex;\n }\n\n storeAnonymous(\n programPath: NodePath<t.Program>,\n url: string,\n moduleName: string,\n getVal: (isScript: boolean, source: t.StringLiteral) => t.Node,\n ) {\n const key = this._normalizeKey(programPath, url);\n const imports = this._ensure<Set<string>>(\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, moduleName);\n }\n\n storeNamed(\n programPath: NodePath<t.Program>,\n url: string,\n name: string,\n moduleName: 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<Map<string, any>>(\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, moduleName);\n }\n\n return t.identifier(imports.get(key));\n }\n\n _injectImport(\n programPath: NodePath<t.Program>,\n node: t.Node,\n moduleName: string,\n ) {\n const newIndex = this._getPreferredIndex(moduleName);\n const lastImports = this._lastImports.get(programPath) ?? [];\n\n const isPathStillValid = (path: NodePath) =>\n path.node &&\n // Sometimes the AST is modified and the \"last import\"\n // we have has been replaced\n path.parent === programPath.node &&\n path.container === programPath.node.body;\n\n let last: NodePath;\n\n if (newIndex === Infinity) {\n // Fast path: we can always just insert at the end if newIndex is `Infinity`\n if (lastImports.length > 0) {\n last = lastImports[lastImports.length - 1].path;\n if (!isPathStillValid(last)) last = undefined;\n }\n } else {\n for (const [i, data] of lastImports.entries()) {\n const { path, index } = data;\n if (isPathStillValid(path)) {\n if (newIndex < index) {\n const [newPath] = path.insertBefore(node);\n lastImports.splice(i, 0, { path: newPath, index: newIndex });\n return;\n }\n last = path;\n }\n }\n }\n\n if (last) {\n const [newPath] = last.insertAfter(node);\n lastImports.push({ path: newPath, index: newIndex });\n } else {\n const [newPath] = programPath.unshiftContainer(\"body\", node);\n this._lastImports.set(programPath, [{ path: newPath, index: newIndex }]);\n }\n }\n\n _ensure<C extends Map<string, any> | Set<string>>(\n map: WeakMap<NodePath<t.Program>, C>,\n programPath: NodePath<t.Program>,\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<t.Program>,\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: Map<string, unknown>,\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.keys()) {\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<string> ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set<string> ();\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 { CallProvider } from \"./index\";\n\nimport { resolveKey, resolveSource } from \"../utils\";\n\nfunction isRemoved(path: NodePath) {\n if (path.removed) return true;\n if (!path.parentPath) return false;\n if (path.listKey) {\n if (!path.parentPath.node?.[path.listKey]?.includes(path.node)) return true;\n } else {\n if (path.parentPath.node[path.key] !== path.node) return true;\n }\n return isRemoved(path.parentPath);\n}\n\nexport default (callProvider: CallProvider) => {\n function property(object, key, placement, path) {\n return callProvider({ kind: \"property\", object, key, placement }, path);\n }\n\n function handleReferencedIdentifier(path) {\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 function analyzeMemberExpression(path: NodePath<t.MemberExpression>) {\n const key = resolveKey(path.get(\"property\"), path.node.computed);\n return { key, handleAsMemberExpression: !!key && key !== \"prototype\" };\n }\n\n return {\n // Symbol(), new Promise\n ReferencedIdentifier(path: NodePath<t.Identifier>) {\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression({ object: path.node }) &&\n analyzeMemberExpression(parentPath).handleAsMemberExpression\n ) {\n return;\n }\n handleReferencedIdentifier(path);\n },\n\n MemberExpression(path: NodePath<t.MemberExpression>) {\n const { key, handleAsMemberExpression } = analyzeMemberExpression(path);\n if (!handleAsMemberExpression) return;\n\n const object = path.get(\"object\");\n let objectIsGlobalIdentifier = object.isIdentifier();\n if (objectIsGlobalIdentifier) {\n const binding = object.scope.getBinding(\n (object.node as t.Identifier).name,\n );\n if (binding) {\n if (binding.path.isImportNamespaceSpecifier()) return;\n objectIsGlobalIdentifier = false;\n }\n }\n\n const source = resolveSource(object);\n let skipObject = property(source.id, key, source.placement, path);\n skipObject ||=\n !objectIsGlobalIdentifier ||\n path.shouldSkip ||\n object.shouldSkip ||\n isRemoved(object);\n\n if (!skipObject) handleReferencedIdentifier(object);\n },\n\n ObjectPattern(path: NodePath<t.ObjectPattern>) {\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<t.BinaryExpression>) {\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 { CallProvider } from \"./index\";\n\nimport { getImportSource, getRequireSource } from \"../utils\";\n\nexport default (callProvider: CallProvider) => ({\n ImportDeclaration(path: NodePath<t.ImportDeclaration>) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath<t.Program>) {\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","export function resolve(\n dirname: string,\n moduleName: string,\n absoluteImports: boolean | string,\n): string {\n if (absoluteImports === false) return moduleName;\n\n throw new Error(\n `\"absoluteImports\" is not supported in bundles prepared for the browser.`,\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function has(basedir: string, name: string) {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function logMissing(missingDeps: Set<string>) {}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function laterLogMissing(missingDeps: Set<string>) {}\n","import type {\n MetaDescriptor,\n ResolverPolyfills,\n ResolvedPolyfill,\n} from \"./types\";\n\nimport { has } from \"./utils\";\n\ntype ResolverFn<T> = (meta: MetaDescriptor) => void | ResolvedPolyfill<T>;\n\nconst PossibleGlobalObjects = new Set<string>([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver<T>(\n polyfills: ResolverPolyfills<T>,\n): ResolverFn<T> {\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 ImportsCachedInjector from \"./imports-injector\";\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<Options>(\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<Options>;\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 [\"<plugin name>\", { 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<Options>,\n };\n}\n\nfunction instantiateProvider<Options>(\n factory: PolyfillProvider<Options>,\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>(options, babelApi);\n\n // eslint-disable-next-line prefer-const\n let include, exclude;\n let polyfillsSupport;\n let polyfillsNames: Map<string, number> | undefined;\n let filterPolyfills;\n\n const getUtils = createUtilsGetter(\n new ImportsCachedInjector(\n moduleName => deps.resolve(dirname, moduleName, absoluteImports),\n (name: string) => polyfillsNames?.get(name) ?? Infinity,\n ),\n );\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 Map(\n provider.polyfills.map((name, index) => [name, index]),\n );\n filterPolyfills = provider.filterPolyfills;\n } else if (provider.polyfills) {\n polyfillsNames = new Map(\n Object.keys(provider.polyfills).map((name, index) => [name, index]),\n );\n polyfillsSupport = provider.polyfills;\n filterPolyfills = provider.filterPolyfills;\n } else {\n polyfillsNames = new Map();\n }\n\n ({ include, exclude } = validateIncludeExclude(\n providerName,\n polyfillsNames,\n providerOptions.include || [],\n providerOptions.exclude || [],\n ));\n\n let callProvider: (payload: MetaDescriptor, path: NodePath) => boolean;\n if (methodName === \"usageGlobal\") {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n return (\n (provider[methodName](payload, utils, path) satisfies boolean) ?? false\n );\n };\n } else {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n provider[methodName](payload, utils, path) satisfies void;\n return false;\n };\n }\n\n return {\n debug,\n method,\n targets,\n provider,\n providerName,\n callProvider,\n };\n}\n\nexport default function definePolyfillProvider<Options>(\n factory: PolyfillProvider<Options>,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\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<Options>(\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","isPure","deopt","evaluate","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","get","sym","resolveSource","obj","id","placement","isRegExpLiteral","isFunction","undefined","getImportSource","specifiers","length","source","getRequireSource","isExpressionStatement","expression","isCallExpression","callee","arguments","hoist","_blockHoist","createUtilsGetter","cache","prog","findParent","p","isProgram","injectGlobalImport","url","moduleName","storeAnonymous","isScript","statement","ast","importDeclaration","injectNamedImport","hint","storeNamed","generateUidIdentifier","importSpecifier","injectDefaultImport","importDefaultSpecifier","ImportsCachedInjector","constructor","resolver","getPreferredIndex","_imports","WeakMap","_anonymousImports","_lastImports","_resolver","_getPreferredIndex","programPath","getVal","_normalizeKey","imports","_ensure","sourceType","stringLiteral","_injectImport","Map","identifier","set","_this$_lastImports$ge","newIndex","lastImports","isPathStillValid","container","body","last","Infinity","i","data","entries","index","newPath","insertBefore","splice","insertAfter","push","unshiftContainer","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","keys","test","include","unusedInclude","exclude","unusedExclude","Error","applyMissingDependenciesDefaults","options","babelApi","missingDependencies","caller","log","inject","all","isRemoved","removed","parentPath","listKey","_path$parentPath$node","includes","callProvider","property","kind","handleReferencedIdentifier","getBindingIdentifier","analyzeMemberExpression","handleAsMemberExpression","ReferencedIdentifier","MemberExpression","objectIsGlobalIdentifier","binding","getBinding","isImportNamespaceSpecifier","skipObject","shouldSkip","ObjectPattern","isVariableDeclarator","isAssignmentExpression","grand","isNewExpression","prop","isObjectProperty","BinaryExpression","operator","ImportDeclaration","Program","bodyPath","resolve","dirname","absoluteImports","basedir","logMissing","missingDeps","laterLogMissing","PossibleGlobalObjects","createMetaResolver","static","staticP","instance","instanceP","global","globalP","meta","desc","getTargets","_getTargets","resolveOptions","method","targetsOption","ignoreBrowserslistConfig","configPath","debug","shouldInjectPolyfill","providerOptions","isEmpty","methodName","targetsObj","isArray","browsers","instantiateProvider","factory","debugLog","polyfillsSupport","polyfillsNames","filterPolyfills","getUtils","deps","_polyfillsNames$get","_polyfillsNames","depsCache","api","babel","console","warn","providerName","shouldInject","isRequired","compatData","excludes","_debugLog","_debugLog$polyfillsSu","found","assertDependency","version","dep","mapGetOr","payload","_ref","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","replace","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,MAAM,CAACK,GAAG,CAACF,CAAC,CAAC,CAAC;EACzC,OAAOH,MAAM;AACf;AAEO,SAASI,KAAGA,CAACE,MAAW,EAAEC,GAAW,EAAE;EAC5C,OAAOC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;AAC1D;AAEA,SAASK,OAAOA,CAACC,MAAW,EAAU;EACpC,OAAOL,MAAM,CAACC,SAAS,CAACK,QAAQ,CAACH,IAAI,CAACE,MAAM,CAAC,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D;AAEA,SAASC,SAASA,CAACC,IAAI,EAAU;EAC/B,IACEA,IAAI,CAACC,YAAY,EAAE,IACnB,CAACD,IAAI,CAACE,KAAK,CAACC,UAAU,CA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IgR,GAAG,KAAK/O,SAAS,EAAE;IACrB+O,GAAG,GAAGD,UAAU,EAAE;IAClBrK,GAAG,CAACnB,GAAG,CAACvF,GAAG,EAAEgR,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAAS1D,OAAOA,CAAC1L,GAAG,EAAE;EACpB,OAAO3B,MAAM,CAAC0I,IAAI,CAAC/G,GAAG,CAAC,CAACQ,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file
diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs
index b6a4adfc..f049a734 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs
+++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs
@@ -130,13 +130,13 @@ function createUtilsGetter(cache) {
return path => {
const prog = path.findParent(p => p.isProgram());
return {
- injectGlobalImport(url) {
- cache.storeAnonymous(prog, url, (isScript, source) => {
+ injectGlobalImport(url, moduleName) {
+ cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {
return isScript ? template.statement.ast`require(${source})` : t$1.importDeclaration([], source);
});
},
- injectNamedImport(url, name, hint = name) {
- return cache.storeNamed(prog, url, name, (isScript, source, name) => {
+ injectNamedImport(url, name, hint = name, moduleName) {
+ return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`
@@ -146,8 +146,8 @@ function createUtilsGetter(cache) {
};
});
},
- injectDefaultImport(url, hint = url) {
- return cache.storeNamed(prog, url, "default", (isScript, source) => {
+ injectDefaultImport(url, hint = url, moduleName) {
+ return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t$1.importDeclaration([t$1.importDefaultSpecifier(id)], source),
@@ -162,24 +162,23 @@ function createUtilsGetter(cache) {
const {
types: t
} = _babel.default || _babel;
-class ImportsCache {
- constructor(resolver) {
+class ImportsCachedInjector {
+ constructor(resolver, getPreferredIndex) {
this._imports = new WeakMap();
this._anonymousImports = new WeakMap();
this._lastImports = new WeakMap();
this._resolver = resolver;
+ this._getPreferredIndex = getPreferredIndex;
}
- storeAnonymous(programPath, url,
- // eslint-disable-next-line no-undef
- getVal) {
+ storeAnonymous(programPath, url, moduleName, getVal) {
const key = this._normalizeKey(programPath, url);
const imports = this._ensure(this._anonymousImports, programPath, Set);
if (imports.has(key)) return;
const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)));
imports.add(key);
- this._injectImport(programPath, node);
+ this._injectImport(programPath, node, moduleName);
}
- storeNamed(programPath, url, name, getVal) {
+ storeNamed(programPath, url, name, moduleName, getVal) {
const key = this._normalizeKey(programPath, url, name);
const imports = this._ensure(this._imports, programPath, Map);
if (!imports.has(key)) {
@@ -188,46 +187,58 @@ class ImportsCache {
name: id
} = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name));
imports.set(key, id);
- this._injectImport(programPath, node);
+ this._injectImport(programPath, node, moduleName);
}
return t.identifier(imports.get(key));
}
- _injectImport(programPath, node) {
- const lastImport = this._lastImports.get(programPath);
- let newNodes;
- if (lastImport && lastImport.node &&
+ _injectImport(programPath, node, moduleName) {
+ var _this$_lastImports$ge;
+ const newIndex = this._getPreferredIndex(moduleName);
+ const lastImports = (_this$_lastImports$ge = this._lastImports.get(programPath)) != null ? _this$_lastImports$ge : [];
+ const isPathStillValid = path => path.node &&
// Sometimes the AST is modified and the "last import"
// we have has been replaced
- lastImport.parent === programPath.node && lastImport.container === programPath.node.body) {
- newNodes = lastImport.insertAfter(node);
- } else {
- newNodes = programPath.unshiftContainer("body", node);
- }
- const newNode = newNodes[newNodes.length - 1];
- this._lastImports.set(programPath, newNode);
-
- /*
- let lastImport;
- programPath.get("body").forEach(path => {
- if (path.isImportDeclaration()) lastImport = path;
- if (
- path.isExpressionStatement() &&
- isRequireCall(path.get("expression"))
- ) {
- lastImport = path;
+ path.parent === programPath.node && path.container === programPath.node.body;
+ let last;
+ if (newIndex === Infinity) {
+ // Fast path: we can always just insert at the end if newIndex is `Infinity`
+ if (lastImports.length > 0) {
+ last = lastImports[lastImports.length - 1].path;
+ if (!isPathStillValid(last)) last = undefined;
}
- if (
- path.isVariableDeclaration() &&
- path.get("declarations").length === 1 &&
- (isRequireCall(path.get("declarations.0.init")) ||
- (path.get("declarations.0.init").isMemberExpression() &&
- isRequireCall(path.get("declarations.0.init.object"))))
- ) {
- lastImport = path;
+ } else {
+ for (const [i, data] of lastImports.entries()) {
+ const {
+ path,
+ index
+ } = data;
+ if (isPathStillValid(path)) {
+ if (newIndex < index) {
+ const [newPath] = path.insertBefore(node);
+ lastImports.splice(i, 0, {
+ path: newPath,
+ index: newIndex
+ });
+ return;
+ }
+ last = path;
+ }
}
- });*/
+ }
+ if (last) {
+ const [newPath] = last.insertAfter(node);
+ lastImports.push({
+ path: newPath,
+ index: newIndex
+ });
+ } else {
+ const [newPath] = programPath.unshiftContainer("body", node);
+ this._lastImports.set(programPath, [{
+ path: newPath,
+ index: newIndex
+ }]);
+ }
}
-
_ensure(map, programPath, Collection) {
let collection = map.get(programPath);
if (!collection) {
@@ -275,7 +286,7 @@ function validateIncludeExclude(provider, polyfills, includePatterns, excludePat
const regexp = patternToRegExp(pattern);
if (!regexp) return false;
let matched = false;
- for (const polyfill of polyfills) {
+ for (const polyfill of polyfills.keys()) {
if (regexp.test(polyfill)) {
matched = true;
current.add(polyfill);
@@ -318,6 +329,17 @@ function applyMissingDependenciesDefaults(options, babelApi) {
};
}
+function isRemoved(path) {
+ if (path.removed) return true;
+ if (!path.parentPath) return false;
+ if (path.listKey) {
+ var _path$parentPath$node;
+ if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true;
+ } else {
+ if (path.parentPath.node[path.key] !== path.node) return true;
+ }
+ return isRemoved(path.parentPath);
+}
var usage = (callProvider => {
function property(object, key, placement, path) {
return callProvider({
@@ -327,31 +349,58 @@ var usage = (callProvider => {
placement
}, path);
}
+ function handleReferencedIdentifier(path) {
+ const {
+ node: {
+ name
+ },
+ scope
+ } = path;
+ if (scope.getBindingIdentifier(name)) return;
+ callProvider({
+ kind: "global",
+ name
+ }, path);
+ }
+ function analyzeMemberExpression(path) {
+ const key = resolveKey(path.get("property"), path.node.computed);
+ return {
+ key,
+ handleAsMemberExpression: !!key && key !== "prototype"
+ };
+ }
return {
// Symbol(), new Promise
ReferencedIdentifier(path) {
const {
- node: {
- name
- },
- scope
+ parentPath
} = path;
- if (scope.getBindingIdentifier(name)) return;
- callProvider({
- kind: "global",
- name
- }, path);
+ if (parentPath.isMemberExpression({
+ object: path.node
+ }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) {
+ return;
+ }
+ handleReferencedIdentifier(path);
},
MemberExpression(path) {
- const key = resolveKey(path.get("property"), path.node.computed);
- if (!key || key === "prototype") return;
+ const {
+ key,
+ handleAsMemberExpression
+ } = analyzeMemberExpression(path);
+ if (!handleAsMemberExpression) return;
const object = path.get("object");
- if (object.isIdentifier()) {
+ let objectIsGlobalIdentifier = object.isIdentifier();
+ if (objectIsGlobalIdentifier) {
const binding = object.scope.getBinding(object.node.name);
- if (binding && binding.path.isImportNamespaceSpecifier()) return;
+ if (binding) {
+ if (binding.path.isImportNamespaceSpecifier()) return;
+ objectIsGlobalIdentifier = false;
+ }
}
const source = resolveSource(object);
- return property(source.id, key, source.placement, path);
+ let skipObject = property(source.id, key, source.placement, path);
+ skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
+ if (!skipObject) handleReferencedIdentifier(object);
},
ObjectPattern(path) {
const {
@@ -603,13 +652,16 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
providerOptions,
absoluteImports
} = resolveOptions(options, babelApi);
- const getUtils = createUtilsGetter(new ImportsCache(moduleName => resolve(dirname, moduleName, absoluteImports)));
// eslint-disable-next-line prefer-const
let include, exclude;
let polyfillsSupport;
let polyfillsNames;
let filterPolyfills;
+ const getUtils = createUtilsGetter(new ImportsCachedInjector(moduleName => resolve(dirname, moduleName, absoluteImports), name => {
+ var _polyfillsNames$get, _polyfillsNames;
+ return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity;
+ }));
const depsCache = new Map();
const api = {
babel: babelApi,
@@ -667,29 +719,40 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`);
}
if (Array.isArray(provider.polyfills)) {
- polyfillsNames = new Set(provider.polyfills);
+ polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index]));
filterPolyfills = provider.filterPolyfills;
} else if (provider.polyfills) {
- polyfillsNames = new Set(Object.keys(provider.polyfills));
+ polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index]));
polyfillsSupport = provider.polyfills;
filterPolyfills = provider.filterPolyfills;
} else {
- polyfillsNames = new Set();
+ polyfillsNames = new Map();
}
({
include,
exclude
} = validateIncludeExclude(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || []));
+ let callProvider;
+ if (methodName === "usageGlobal") {
+ callProvider = (payload, path) => {
+ var _ref;
+ const utils = getUtils(path);
+ return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false;
+ };
+ } else {
+ callProvider = (payload, path) => {
+ const utils = getUtils(path);
+ provider[methodName](payload, utils, path);
+ return false;
+ };
+ }
return {
debug,
method,
targets,
provider,
providerName,
- callProvider(payload, path) {
- const utils = getUtils(path);
- provider[methodName](payload, utils, path);
- }
+ callProvider
};
}
function definePolyfillProvider(factory) {
diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map
index a02a5699..a8ad67f0 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map
+++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map
@@ -1 +1 @@
-{"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<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>();\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 if (path.isPure()) {\n const { deopt } = path.evaluate();\n if (deopt && deopt.isIdentifier()) {\n return deopt.node.name;\n }\n }\n}\n\nexport function resolveKey(\n path: NodePath<t.Expression | t.PrivateName>,\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 (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\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 if (obj.isRegExpLiteral()) {\n return { id: \"RegExp\", placement: \"prototype\" };\n } else if (obj.isFunction()) {\n return { id: \"Function\", placement: \"prototype\" };\n } else if (obj.isPure()) {\n const { value } = obj.evaluate();\n if (value !== undefined) {\n return { id: getType(value), placement: \"prototype\" };\n }\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath<t.ImportDeclaration>) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath<t.Statement>) {\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<t.Program>;\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<K> = Map<string, K>;\n\nexport default class ImportsCache {\n _imports: WeakMap<NodePath<t.Program>, StrMap<string>>;\n _anonymousImports: WeakMap<NodePath<t.Program>, Set<string>>;\n _lastImports: WeakMap<NodePath<t.Program>, NodePath<t.Node>>;\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<t.Program>,\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<Set<string>>(\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<t.Program>,\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<Map<string, any>>(\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<t.Program>, 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<C extends Map<string, any> | Set<string>>(\n map: WeakMap<NodePath<t.Program>, C>,\n programPath: NodePath<t.Program>,\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<t.Program>,\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<string>,\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<string> ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set<string> ();\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<t.Identifier>) {\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<t.MemberExpression>) {\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<t.ObjectPattern>) {\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<t.BinaryExpression>) {\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<t.ImportDeclaration>) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath<t.Program>) {\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<string>) {\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<string>();\n\nconst laterLogMissingDependencies = debounce(() => {\n logMissing(allMissingDeps);\n allMissingDeps = new Set<string>();\n}, 100);\n\nexport function laterLogMissing(missingDeps: Set<string>) {\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<T> = (meta: MetaDescriptor) => void | ResolvedPolyfill<T>;\n\nconst PossibleGlobalObjects = new Set<string>([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver<T>(\n polyfills: ResolverPolyfills<T>,\n): ResolverFn<T> {\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<Options>(\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<Options>;\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 [\"<plugin name>\", { 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<Options>,\n };\n}\n\nfunction instantiateProvider<Options>(\n factory: PolyfillProvider<Options>,\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>(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<Options>(\n factory: PolyfillProvider<Options>,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\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<Options>(\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","isPure","deopt","evaluate","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","get","sym","resolveSource","obj","id","placement","isRegExpLiteral","isFunction","undefined","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,MAAM,CAACK,GAAG,CAACF,CAAC,CAAC,CAAC;EACzC,OAAOH,MAAM;AACf;AAEO,SAASI,KAAGA,CAACE,MAAW,EAAEC,GAAW,EAAE;EAC5C,OAAOC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;AAC1D;AAEA,SAASK,OAAOA,CAACC,MAAW,EAAU;EACpC,OAAOL,MAAM,CAACC,SAAS,CAACK,QAAQ,CAACH,IAAI,CAACE,MAAM,CAAC,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D;AAEA,SAASC,SAASA,CAACC,IAAI,EAAU;EAC/B,IACEA,IAAI,CAACC,YAAY,EAAE,IACnB,CAACD,IAAI,CAACE,KAAK,CAACC,UAAU,CAACH,IAAI,CAACI,IAAI,CAACC,IAAI,iBAAkB,IAAI,CAAC,EAC5D;IACA,OAAOL,IAAI,CAACI,IAAI,CAACC,IAAI;;EAGvB,IAAIL,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AMpN,IAAI,IAAI4M,QAAQ,CAACtG,SAAS,EAAE;UAAA,IAAA+I,sBAAA;UACrC,KAAAA,sBAAA,GAAIzC,QAAQ,CAACE,gBAAgB,aAAzBuC,sBAAA,CAA4BrP,IAAI,CAAC,EAAE;YACrC,MAAMsP,eAAe,GAAGC,mBAAmB,CACzCvP,IAAI,EACJkF,OAAO,EACP0H,QAAQ,CAACE,gBACX,CAAC;YAED,MAAM0C,gBAAgB,GAAGrK,IAAI,CAACC,SAAS,CAACkK,eAAe,CAAC,CACrDxF,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CACnBA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CACtBA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;YAEzBa,OAAO,CAAClD,GAAG,CAAE,KAAIzH,IAAK,IAAGwP,gBAAiB,EAAC,CAAC;WAC7C,MAAM;YACL7E,OAAO,CAAClD,GAAG,CAAE,KAAIzH,IAAK,EAAC,CAAC;;;;KAI/B;GACF,CAAC;AACJ;AAEA,SAASgO,QAAQA,CAACnJ,GAAG,EAAE5F,GAAG,EAAEwQ,UAAU,EAAE;EACtC,IAAIC,GAAG,GAAG7K,GAAG,CAACnE,GAAG,CAACzB,GAAG,CAAC;EACtB,IAAIyQ,GAAG,KAAKxO,SAAS,EAAE;IACrBwO,GAAG,GAAGD,UAAU,EAAE;IAClB5K,GAAG,CAACR,GAAG,CAACpF,GAAG,EAAEyQ,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAASrD,OAAOA,CAACxL,GAAG,EAAE;EACpB,OAAO3B,MAAM,CAAC+O,IAAI,CAACpN,GAAG,CAAC,CAACQ,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file
+{"version":3,"file":"index.node.mjs","sources":["../src/utils.ts","../src/imports-injector.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 ImportsCachedInjector from \"./imports-injector\";\n\nexport function intersection<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>();\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 if (path.isPure()) {\n const { deopt } = path.evaluate();\n if (deopt && deopt.isIdentifier()) {\n return deopt.node.name;\n }\n }\n}\n\nexport function resolveKey(\n path: NodePath<t.Expression | t.PrivateName>,\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 (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\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 if (obj.isRegExpLiteral()) {\n return { id: \"RegExp\", placement: \"prototype\" };\n } else if (obj.isFunction()) {\n return { id: \"Function\", placement: \"prototype\" };\n } else if (obj.isPure()) {\n const { value } = obj.evaluate();\n if (value !== undefined) {\n return { id: getType(value), placement: \"prototype\" };\n }\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath<t.ImportDeclaration>) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath<t.Statement>) {\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: ImportsCachedInjector) {\n return (path: NodePath): Utils => {\n const prog = path.findParent(p => p.isProgram()) as NodePath<t.Program>;\n\n return {\n injectGlobalImport(url, moduleName) {\n cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {\n return isScript\n ? template.statement.ast`require(${source})`\n : t.importDeclaration([], source);\n });\n },\n injectNamedImport(url, name, hint = name, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n name,\n moduleName,\n (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 },\n injectDefaultImport(url, hint = url, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n \"default\",\n moduleName,\n (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}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\ntype StrMap<K> = Map<string, K>;\n\nexport default class ImportsCachedInjector {\n _imports: WeakMap<NodePath<t.Program>, StrMap<string>>;\n _anonymousImports: WeakMap<NodePath<t.Program>, Set<string>>;\n _lastImports: WeakMap<\n NodePath<t.Program>,\n Array<{ path: NodePath<t.Node>; index: number }>\n >;\n _resolver: (url: string) => string;\n _getPreferredIndex: (url: string) => number;\n\n constructor(\n resolver: (url: string) => string,\n getPreferredIndex: (url: string) => number,\n ) {\n this._imports = new WeakMap();\n this._anonymousImports = new WeakMap();\n this._lastImports = new WeakMap();\n this._resolver = resolver;\n this._getPreferredIndex = getPreferredIndex;\n }\n\n storeAnonymous(\n programPath: NodePath<t.Program>,\n url: string,\n moduleName: string,\n getVal: (isScript: boolean, source: t.StringLiteral) => t.Node,\n ) {\n const key = this._normalizeKey(programPath, url);\n const imports = this._ensure<Set<string>>(\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, moduleName);\n }\n\n storeNamed(\n programPath: NodePath<t.Program>,\n url: string,\n name: string,\n moduleName: 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<Map<string, any>>(\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, moduleName);\n }\n\n return t.identifier(imports.get(key));\n }\n\n _injectImport(\n programPath: NodePath<t.Program>,\n node: t.Node,\n moduleName: string,\n ) {\n const newIndex = this._getPreferredIndex(moduleName);\n const lastImports = this._lastImports.get(programPath) ?? [];\n\n const isPathStillValid = (path: NodePath) =>\n path.node &&\n // Sometimes the AST is modified and the \"last import\"\n // we have has been replaced\n path.parent === programPath.node &&\n path.container === programPath.node.body;\n\n let last: NodePath;\n\n if (newIndex === Infinity) {\n // Fast path: we can always just insert at the end if newIndex is `Infinity`\n if (lastImports.length > 0) {\n last = lastImports[lastImports.length - 1].path;\n if (!isPathStillValid(last)) last = undefined;\n }\n } else {\n for (const [i, data] of lastImports.entries()) {\n const { path, index } = data;\n if (isPathStillValid(path)) {\n if (newIndex < index) {\n const [newPath] = path.insertBefore(node);\n lastImports.splice(i, 0, { path: newPath, index: newIndex });\n return;\n }\n last = path;\n }\n }\n }\n\n if (last) {\n const [newPath] = last.insertAfter(node);\n lastImports.push({ path: newPath, index: newIndex });\n } else {\n const [newPath] = programPath.unshiftContainer(\"body\", node);\n this._lastImports.set(programPath, [{ path: newPath, index: newIndex }]);\n }\n }\n\n _ensure<C extends Map<string, any> | Set<string>>(\n map: WeakMap<NodePath<t.Program>, C>,\n programPath: NodePath<t.Program>,\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<t.Program>,\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: Map<string, unknown>,\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.keys()) {\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<string> ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set<string> ();\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 { CallProvider } from \"./index\";\n\nimport { resolveKey, resolveSource } from \"../utils\";\n\nfunction isRemoved(path: NodePath) {\n if (path.removed) return true;\n if (!path.parentPath) return false;\n if (path.listKey) {\n if (!path.parentPath.node?.[path.listKey]?.includes(path.node)) return true;\n } else {\n if (path.parentPath.node[path.key] !== path.node) return true;\n }\n return isRemoved(path.parentPath);\n}\n\nexport default (callProvider: CallProvider) => {\n function property(object, key, placement, path) {\n return callProvider({ kind: \"property\", object, key, placement }, path);\n }\n\n function handleReferencedIdentifier(path) {\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 function analyzeMemberExpression(path: NodePath<t.MemberExpression>) {\n const key = resolveKey(path.get(\"property\"), path.node.computed);\n return { key, handleAsMemberExpression: !!key && key !== \"prototype\" };\n }\n\n return {\n // Symbol(), new Promise\n ReferencedIdentifier(path: NodePath<t.Identifier>) {\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression({ object: path.node }) &&\n analyzeMemberExpression(parentPath).handleAsMemberExpression\n ) {\n return;\n }\n handleReferencedIdentifier(path);\n },\n\n MemberExpression(path: NodePath<t.MemberExpression>) {\n const { key, handleAsMemberExpression } = analyzeMemberExpression(path);\n if (!handleAsMemberExpression) return;\n\n const object = path.get(\"object\");\n let objectIsGlobalIdentifier = object.isIdentifier();\n if (objectIsGlobalIdentifier) {\n const binding = object.scope.getBinding(\n (object.node as t.Identifier).name,\n );\n if (binding) {\n if (binding.path.isImportNamespaceSpecifier()) return;\n objectIsGlobalIdentifier = false;\n }\n }\n\n const source = resolveSource(object);\n let skipObject = property(source.id, key, source.placement, path);\n skipObject ||=\n !objectIsGlobalIdentifier ||\n path.shouldSkip ||\n object.shouldSkip ||\n isRemoved(object);\n\n if (!skipObject) handleReferencedIdentifier(object);\n },\n\n ObjectPattern(path: NodePath<t.ObjectPattern>) {\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<t.BinaryExpression>) {\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 { CallProvider } from \"./index\";\n\nimport { getImportSource, getRequireSource } from \"../utils\";\n\nexport default (callProvider: CallProvider) => ({\n ImportDeclaration(path: NodePath<t.ImportDeclaration>) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath<t.Program>) {\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<string>) {\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<string>();\n\nconst laterLogMissingDependencies = debounce(() => {\n logMissing(allMissingDeps);\n allMissingDeps = new Set<string>();\n}, 100);\n\nexport function laterLogMissing(missingDeps: Set<string>) {\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<T> = (meta: MetaDescriptor) => void | ResolvedPolyfill<T>;\n\nconst PossibleGlobalObjects = new Set<string>([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver<T>(\n polyfills: ResolverPolyfills<T>,\n): ResolverFn<T> {\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 ImportsCachedInjector from \"./imports-injector\";\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<Options>(\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<Options>;\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 [\"<plugin name>\", { 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<Options>,\n };\n}\n\nfunction instantiateProvider<Options>(\n factory: PolyfillProvider<Options>,\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>(options, babelApi);\n\n // eslint-disable-next-line prefer-const\n let include, exclude;\n let polyfillsSupport;\n let polyfillsNames: Map<string, number> | undefined;\n let filterPolyfills;\n\n const getUtils = createUtilsGetter(\n new ImportsCachedInjector(\n moduleName => deps.resolve(dirname, moduleName, absoluteImports),\n (name: string) => polyfillsNames?.get(name) ?? Infinity,\n ),\n );\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 Map(\n provider.polyfills.map((name, index) => [name, index]),\n );\n filterPolyfills = provider.filterPolyfills;\n } else if (provider.polyfills) {\n polyfillsNames = new Map(\n Object.keys(provider.polyfills).map((name, index) => [name, index]),\n );\n polyfillsSupport = provider.polyfills;\n filterPolyfills = provider.filterPolyfills;\n } else {\n polyfillsNames = new Map();\n }\n\n ({ include, exclude } = validateIncludeExclude(\n providerName,\n polyfillsNames,\n providerOptions.include || [],\n providerOptions.exclude || [],\n ));\n\n let callProvider: (payload: MetaDescriptor, path: NodePath) => boolean;\n if (methodName === \"usageGlobal\") {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n return (\n (provider[methodName](payload, utils, path) satisfies boolean) ?? false\n );\n };\n } else {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n provider[methodName](payload, utils, path) satisfies void;\n return false;\n };\n }\n\n return {\n debug,\n method,\n targets,\n provider,\n providerName,\n callProvider,\n };\n}\n\nexport default function definePolyfillProvider<Options>(\n factory: PolyfillProvider<Options>,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\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<Options>(\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","isPure","deopt","evaluate","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","get","sym","resolveSource","obj","id","placement","isRegExpLiteral","isFunction","undefined","getImportSource","specifiers","length","source","getRequireSource","isExpressionStatement","expression","isCallExpression","callee","arguments","hoist","_blockHoist","createUtilsGetter","cache","prog","findParent","p","isProgram","injectGlobalImport","url","moduleName","storeAnonymous","isScript","statement","ast","importDeclaration","injectNamedImport","hint","storeNamed","generateUidIdentifier","importSpecifier","injectDefaultImport","importDefaultSpecifier","ImportsCachedInjector","constructor","resolver","getPreferredIndex","_imports","WeakMap","_anonymousImports","_lastImports","_resolver","_getPreferredIndex","programPath","getVal","_normalizeKey","imports","_ensure","sourceType","stringLiteral","_injectImport","Map","identifier","set","_this$_lastImports$ge","newIndex","lastImports","isPathStillValid","container","body","last","Infinity","i","data","entries","index","newPath","insertBefore","splice","insertAfter","push","unshiftContainer","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","keys","test","include","unusedInclude","exclude","unusedExclude","Error","applyMissingDependenciesDefaults","options","babelApi","missingDependencies","caller","log","inject","all","isRemoved","removed","parentPath","listKey","_path$parentPath$node","includes","callProvider","property","kind","handleReferencedIdentifier","getBindingIdentifier","analyzeMemberExpression","handleAsMemberExpression","ReferencedIdentifier","MemberExpression","objectIsGlobalIdentifier","binding","getBinding","isImportNamespaceSpecifier","skipObject","shouldSkip","ObjectPattern","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","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","polyfillsSupport","polyfillsNames","filterPolyfills","getUtils","_polyfillsNames$get","_polyfillsNames","depsCache","api","babel","providerName","shouldInject","isRequired","compatData","excludes","_debugLog","_debugLog$polyfillsSu","found","assertDependency","version","dep","mapGetOr","payload","_ref","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,MAAM,CAACK,GAAG,CAACF,CAAC,CAAC,CAAC;EACzC,OAAOH,MAAM;AACf;AAEO,SAASI,KAAGA,CAACE,MAAW,EAAEC,GAAW,EAAE;EAC5C,OAAOC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;AAC1D;AAEA,SAASK,OAAOA,CAACC,MAAW,EAAU;EACpC,OAAOL,MAAM,CAACC,SAAS,CAACK,QAAQ,CAACH,IAAI,CAACE,MAAM,CAAC,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D;AAEA,SAASC,SAASA,CAACC,IAAI,EAAU;EAC/B,IACEA,IAAI,CAACC,YAAY,EAAE,IACnB,CAACD,IAAI,CAACE,KAAK,CAACC,UAAU,CAACH,IAAI,CAACI,IAAI,CAACC,IAAI,iBAAkB,IAAI,CAAC,EAC5D;IACA,OAAOL,IAAI,CAACI,IAAI,CAACC,IAAI;;EAGvB,IAAIL,IAAI,CAACM,MAAM,EAAE,EAAE;IACjB,MAAM;MAAEC;KAAO,GAAGP,IAAI,CAACQ,QAAQ,EAAE;IACjC,IAAID,KAAK,IAAIA,KAAK,CAACN,YAAY,EAAE,EAAE;MACjC,OAAOM,KAAK,CAACH,IAAI,CAACC,IAAI;;;AAG5B;AAEO,SAASI,U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kR,gBAAiB,EAAC,CAAC;WAC7C,MAAM;YACL9E,OAAO,CAAC5D,GAAG,CAAE,KAAIxI,IAAK,EAAC,CAAC;;;;KAI/B;GACF,CAAC;AACJ;AAEA,SAAS0P,QAAQA,CAAC/J,GAAG,EAAE1G,GAAG,EAAEkS,UAAU,EAAE;EACtC,IAAIC,GAAG,GAAGzL,GAAG,CAACjF,GAAG,CAACzB,GAAG,CAAC;EACtB,IAAImS,GAAG,KAAKlQ,SAAS,EAAE;IACrBkQ,GAAG,GAAGD,UAAU,EAAE;IAClBxL,GAAG,CAACnB,GAAG,CAACvF,GAAG,EAAEmS,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAAStD,OAAOA,CAACjN,GAAG,EAAE;EACpB,OAAO3B,MAAM,CAAC0I,IAAI,CAAC/G,GAAG,CAAC,CAACQ,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/imports-cache.js b/node_modules/@babel/helper-define-polyfill-provider/lib/imports-cache.js
deleted file mode 100644
index 553c8930..00000000
--- a/node_modules/@babel/helper-define-polyfill-provider/lib/imports-cache.js
+++ /dev/null
@@ -1,96 +0,0 @@
-"use strict";
-
-exports.__esModule = true;
-exports.default = void 0;
-var _babel = _interopRequireWildcard(require("@babel/core"));
-function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-const {
- types: t
-} = _babel.default || _babel;
-class ImportsCache {
- constructor(resolver) {
- this._imports = new WeakMap();
- this._anonymousImports = new WeakMap();
- this._lastImports = new WeakMap();
- this._resolver = resolver;
- }
- storeAnonymous(programPath, url,
- // eslint-disable-next-line no-undef
- getVal) {
- const key = this._normalizeKey(programPath, url);
- const imports = this._ensure(this._anonymousImports, programPath, Set);
- if (imports.has(key)) return;
- const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)));
- imports.add(key);
- this._injectImport(programPath, node);
- }
- storeNamed(programPath, url, name, getVal) {
- const key = this._normalizeKey(programPath, url, name);
- const imports = this._ensure(this._imports, programPath, Map);
- if (!imports.has(key)) {
- const {
- node,
- name: id
- } = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name));
- imports.set(key, id);
- this._injectImport(programPath, node);
- }
- return t.identifier(imports.get(key));
- }
- _injectImport(programPath, node) {
- const lastImport = this._lastImports.get(programPath);
- let newNodes;
- if (lastImport && lastImport.node &&
- // Sometimes the AST is modified and the "last import"
- // we have has been replaced
- lastImport.parent === programPath.node && lastImport.container === programPath.node.body) {
- newNodes = lastImport.insertAfter(node);
- } else {
- newNodes = programPath.unshiftContainer("body", node);
- }
- const newNode = newNodes[newNodes.length - 1];
- this._lastImports.set(programPath, newNode);
-
- /*
- let lastImport;
- programPath.get("body").forEach(path => {
- if (path.isImportDeclaration()) lastImport = path;
- if (
- path.isExpressionStatement() &&
- isRequireCall(path.get("expression"))
- ) {
- lastImport = path;
- }
- if (
- path.isVariableDeclaration() &&
- path.get("declarations").length === 1 &&
- (isRequireCall(path.get("declarations.0.init")) ||
- (path.get("declarations.0.init").isMemberExpression() &&
- isRequireCall(path.get("declarations.0.init.object"))))
- ) {
- lastImport = path;
- }
- });*/
- }
-
- _ensure(map, programPath, Collection) {
- let collection = map.get(programPath);
- if (!collection) {
- collection = new Collection();
- map.set(programPath, collection);
- }
- return collection;
- }
- _normalizeKey(programPath, url, name = "") {
- const {
- sourceType
- } = programPath.node;
-
- // If we rely on the imported binding (the "name" parameter), we also need to cache
- // based on the sourceType. This is because the module transforms change the names
- // of the import variables.
- return `${name && sourceType}::${url}::${name}`;
- }
-}
-exports.default = ImportsCache; \ No newline at end of file
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/index.js b/node_modules/@babel/helper-define-polyfill-provider/lib/index.js
index 4ea2980f..b0dc90b7 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/lib/index.js
+++ b/node_modules/@babel/helper-define-polyfill-provider/lib/index.js
@@ -5,7 +5,7 @@ exports.default = definePolyfillProvider;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperCompilationTargets = _interopRequireWildcard(require("@babel/helper-compilation-targets"));
var _utils = require("./utils");
-var _importsCache = _interopRequireDefault(require("./imports-cache"));
+var _importsInjector = _interopRequireDefault(require("./imports-injector"));
var _debugUtils = require("./debug-utils");
var _normalizeOptions = require("./normalize-options");
var v = _interopRequireWildcard(require("./visitors"));
@@ -90,13 +90,16 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
providerOptions,
absoluteImports
} = resolveOptions(options, babelApi);
- const getUtils = (0, _utils.createUtilsGetter)(new _importsCache.default(moduleName => deps.resolve(dirname, moduleName, absoluteImports)));
// eslint-disable-next-line prefer-const
let include, exclude;
let polyfillsSupport;
let polyfillsNames;
let filterPolyfills;
+ const getUtils = (0, _utils.createUtilsGetter)(new _importsInjector.default(moduleName => deps.resolve(dirname, moduleName, absoluteImports), name => {
+ var _polyfillsNames$get, _polyfillsNames;
+ return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity;
+ }));
const depsCache = new Map();
const api = {
babel: babelApi,
@@ -154,29 +157,40 @@ function instantiateProvider(factory, options, missingDependencies, dirname, deb
throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`);
}
if (Array.isArray(provider.polyfills)) {
- polyfillsNames = new Set(provider.polyfills);
+ polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index]));
filterPolyfills = provider.filterPolyfills;
} else if (provider.polyfills) {
- polyfillsNames = new Set(Object.keys(provider.polyfills));
+ polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index]));
polyfillsSupport = provider.polyfills;
filterPolyfills = provider.filterPolyfills;
} else {
- polyfillsNames = new Set();
+ polyfillsNames = new Map();
}
({
include,
exclude
} = (0, _normalizeOptions.validateIncludeExclude)(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || []));
+ let callProvider;
+ if (methodName === "usageGlobal") {
+ callProvider = (payload, path) => {
+ var _ref;
+ const utils = getUtils(path);
+ return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false;
+ };
+ } else {
+ callProvider = (payload, path) => {
+ const utils = getUtils(path);
+ provider[methodName](payload, utils, path);
+ return false;
+ };
+ }
return {
debug,
method,
targets,
provider,
providerName,
- callProvider(payload, path) {
- const utils = getUtils(path);
- provider[methodName](payload, utils, path);
- }
+ callProvider
};
}
function definePolyfillProvider(factory) {
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js b/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js
index 62937764..16b196a9 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js
+++ b/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js
@@ -26,7 +26,7 @@ function validateIncludeExclude(provider, polyfills, includePatterns, excludePat
const regexp = patternToRegExp(pattern);
if (!regexp) return false;
let matched = false;
- for (const polyfill of polyfills) {
+ for (const polyfill of polyfills.keys()) {
if (regexp.test(polyfill)) {
matched = true;
current.add(polyfill);
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js b/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js
index 0aff88b1..0f13a007 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js
+++ b/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js
@@ -135,13 +135,13 @@ function createUtilsGetter(cache) {
return path => {
const prog = path.findParent(p => p.isProgram());
return {
- injectGlobalImport(url) {
- cache.storeAnonymous(prog, url, (isScript, source) => {
+ injectGlobalImport(url, moduleName) {
+ cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {
return isScript ? template.statement.ast`require(${source})` : t.importDeclaration([], source);
});
},
- injectNamedImport(url, name, hint = name) {
- return cache.storeNamed(prog, url, name, (isScript, source, name) => {
+ injectNamedImport(url, name, hint = name, moduleName) {
+ return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`
@@ -151,8 +151,8 @@ function createUtilsGetter(cache) {
};
});
},
- injectDefaultImport(url, hint = url) {
- return cache.storeNamed(prog, url, "default", (isScript, source) => {
+ injectDefaultImport(url, hint = url, moduleName) {
+ return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => {
const id = prog.scope.generateUidIdentifier(hint);
return {
node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t.importDeclaration([t.importDefaultSpecifier(id)], source),
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js
index 4a4c5472..77def9f8 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js
+++ b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js
@@ -3,6 +3,17 @@
exports.__esModule = true;
exports.default = void 0;
var _utils = require("../utils");
+function isRemoved(path) {
+ if (path.removed) return true;
+ if (!path.parentPath) return false;
+ if (path.listKey) {
+ var _path$parentPath$node;
+ if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true;
+ } else {
+ if (path.parentPath.node[path.key] !== path.node) return true;
+ }
+ return isRemoved(path.parentPath);
+}
var _default = callProvider => {
function property(object, key, placement, path) {
return callProvider({
@@ -12,31 +23,58 @@ var _default = callProvider => {
placement
}, path);
}
+ function handleReferencedIdentifier(path) {
+ const {
+ node: {
+ name
+ },
+ scope
+ } = path;
+ if (scope.getBindingIdentifier(name)) return;
+ callProvider({
+ kind: "global",
+ name
+ }, path);
+ }
+ function analyzeMemberExpression(path) {
+ const key = (0, _utils.resolveKey)(path.get("property"), path.node.computed);
+ return {
+ key,
+ handleAsMemberExpression: !!key && key !== "prototype"
+ };
+ }
return {
// Symbol(), new Promise
ReferencedIdentifier(path) {
const {
- node: {
- name
- },
- scope
+ parentPath
} = path;
- if (scope.getBindingIdentifier(name)) return;
- callProvider({
- kind: "global",
- name
- }, path);
+ if (parentPath.isMemberExpression({
+ object: path.node
+ }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) {
+ return;
+ }
+ handleReferencedIdentifier(path);
},
MemberExpression(path) {
- const key = (0, _utils.resolveKey)(path.get("property"), path.node.computed);
- if (!key || key === "prototype") return;
+ const {
+ key,
+ handleAsMemberExpression
+ } = analyzeMemberExpression(path);
+ if (!handleAsMemberExpression) return;
const object = path.get("object");
- if (object.isIdentifier()) {
+ let objectIsGlobalIdentifier = object.isIdentifier();
+ if (objectIsGlobalIdentifier) {
const binding = object.scope.getBinding(object.node.name);
- if (binding && binding.path.isImportNamespaceSpecifier()) return;
+ if (binding) {
+ if (binding.path.isImportNamespaceSpecifier()) return;
+ objectIsGlobalIdentifier = false;
+ }
}
const source = (0, _utils.resolveSource)(object);
- return property(source.id, key, source.placement, path);
+ let skipObject = property(source.id, key, source.placement, path);
+ skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
+ if (!skipObject) handleReferencedIdentifier(object);
},
ObjectPattern(path) {
const {
diff --git a/node_modules/@babel/helper-define-polyfill-provider/package.json b/node_modules/@babel/helper-define-polyfill-provider/package.json
index c2bd9832..7e03f2e1 100644
--- a/node_modules/@babel/helper-define-polyfill-provider/package.json
+++ b/node_modules/@babel/helper-define-polyfill-provider/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/helper-define-polyfill-provider",
- "version": "0.4.4",
+ "version": "0.6.2",
"description": "Babel helper to create your own polyfill provider",
"repository": {
"type": "git",
@@ -55,5 +55,5 @@
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
},
- "gitHead": "984c56c59568283889c3f0f89e58d370e4fd10f8"
+ "gitHead": "2da4da8e1a3d87640c88a3cd7e650cbb1c049a33"
} \ No newline at end of file