summaryrefslogtreecommitdiff
path: root/chromium/third_party/devtools-frontend/src/node_modules/@rollup
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-20 09:47:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-06-07 11:15:42 +0000
commit189d4fd8fad9e3c776873be51938cd31a42b6177 (patch)
tree6497caeff5e383937996768766ab3bb2081a40b2 /chromium/third_party/devtools-frontend/src/node_modules/@rollup
parent8bc75099d364490b22f43a7ce366b366c08f4164 (diff)
downloadqtwebengine-chromium-189d4fd8fad9e3c776873be51938cd31a42b6177.tar.gz
BASELINE: Update Chromium to 90.0.4430.221
Change-Id: Iff4d9d18d2fcf1a576f3b1f453010f744a232920 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/devtools-frontend/src/node_modules/@rollup')
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/CHANGELOG.md95
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/README.md209
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js2342
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js.map2
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js2351
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js.map2
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/CHANGELOG.md79
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/README.md48
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js135
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js.map1
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/package.json32
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/estree-walker.js125
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/index.ts144
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/types/index.d.ts13
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/package.json119
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/types/index.d.ts155
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/@types/estree/package.json16
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/estree-walker/package.json34
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/CHANGELOG.md113
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/LICENSE21
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/README.md691
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/index.js3
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js179
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js1078
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js339
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js383
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js64
-rwxr-xr-xchromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/package.json81
-rw-r--r--chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/package.json120
29 files changed, 3327 insertions, 5647 deletions
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/CHANGELOG.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/CHANGELOG.md
index 710be21980b..62e8adb80cc 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/CHANGELOG.md
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/CHANGELOG.md
@@ -1,5 +1,100 @@
# @rollup/plugin-commonjs ChangeLog
+## v17.1.0
+
+_2021-01-29_
+
+### Bugfixes
+
+- fix: correctly replace shorthand `require` (#764)
+
+### Features
+
+- feature: load dynamic commonjs modules from es `import` (#766)
+- feature: support cache/resolve access inside dynamic modules (#728)
+- feature: allow keeping `require` calls inside try-catch (#729)
+
+### Updates
+
+- chore: fix lint error (#719)
+
+## v17.0.0
+
+_2020-11-30_
+
+### Breaking Changes
+
+- feat!: reconstruct real es module from \_\_esModule marker (#537)
+
+## v16.0.0
+
+_2020-10-27_
+
+### Breaking Changes
+
+- feat!: Expose cjs detection and support offline caching (#604)
+
+### Bugfixes
+
+- fix: avoid wrapping `commonjsRegister` call in `createCommonjsModule(...)` (#602)
+- fix: register dynamic modules when a different loader (i.e typescript) loads the entry file (#599)
+- fix: fixed access to node_modules dynamic module with subfolder (i.e 'logform/json') (#601)
+
+### Features
+
+- feat: pass type of import to node-resolve (#611)
+
+## v15.1.0
+
+_2020-09-21_
+
+### Features
+
+- feat: inject \_\_esModule marker into ES namespaces and add Object prototype (#552)
+- feat: add requireReturnsDefault to types (#579)
+
+## v15.0.0
+
+_2020-08-13_
+
+### Breaking Changes
+
+- feat!: return the namespace by default when requiring ESM (#507)
+- fix!: fix interop when importing CJS that is transpiled ESM from an actual ESM (#501)
+
+### Bugfixes
+
+- fix: add .cjs to default file extensions. (#524)
+
+### Updates
+
+- chore: update dependencies (fe399e2)
+
+## v14.0.0
+
+_2020-07-13_
+
+### Release Notes
+
+This restores the fixes from v13.0.1, but as a semver compliant major version.
+
+## v13.0.2
+
+_2020-07-13_
+
+### Rollback
+
+Rolls back breaking change in v13.0.1 whereby the exported `unwrapExports` method was removed.
+
+## v13.0.1
+
+_2020-07-12_
+
+### Bugfixes
+
+- fix: prevent rewrite require.resolve (#446)
+- fix: Support \_\_esModule packages with a default export (#465)
+
## v13.0.0
_2020-06-05_
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/README.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/README.md
index 5d67d347cbf..dd3bddd7e2e 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/README.md
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/README.md
@@ -46,7 +46,7 @@ Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#comma
### `dynamicRequireTargets`
-Type: `String|Array[String]`<br>
+Type: `string | string[]`<br>
Default: `[]`
Some modules contain dynamic `require` calls, or require modules that contain circular dependencies, which are not handled well by static imports.
@@ -73,52 +73,213 @@ commonjs({
### `exclude`
-Type: `String` | `Array[...String]`<br>
+Type: `string | string[]`<br>
Default: `null`
-A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default non-CommonJS modules are ignored.
+A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default, all files with extensions other than those in `extensions` or `".cjs"` are ignored, but you can exclude additional files. See also the `include` option.
### `include`
-Type: `String` | `Array[...String]`<br>
+Type: `string | string[]`<br>
Default: `null`
-A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default CommonJS modules are targeted.
+A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default, all files with extension `".cjs"` or those in `extensions` are included, but you can narrow this list by only including specific files. These files will be analyzed and transpiled if either the analysis does not find ES module specific statements or `transformMixedEsModules` is `true`.
### `extensions`
-Type: `Array[...String]`<br>
+Type: `string[]`<br>
Default: `['.js']`
-Search for extensions other than .js in the order specified.
+For extensionless imports, search for extensions other than .js in the order specified. Note that you need to make sure that non-JavaScript files are transpiled by another plugin first.
### `ignoreGlobal`
-Type: `Boolean`<br>
+Type: `boolean`<br>
Default: `false`
If true, uses of `global` won't be dealt with by this plugin.
### `sourceMap`
-Type: `Boolean`<br>
+Type: `boolean`<br>
Default: `true`
-If false, skips source map generation for CommonJS modules.
+If false, skips source map generation for CommonJS modules. This will improve performance.
### `transformMixedEsModules`
-Type: `Boolean`<br>
+Type: `boolean`<br>
Default: `false`
-Instructs the plugin whether or not to enable mixed module transformations. This is useful in scenarios with mixed ES and CommonJS modules. Set to `true` if it's known that `require` calls should be transformed, or `false` if the code contains env detection and the `require` should survive a transformation.
+Instructs the plugin whether to enable mixed module transformations. This is useful in scenarios with modules that contain a mix of ES `import` statements and CommonJS `require` expressions. Set to `true` if `require` calls should be transformed to imports in mixed modules, or `false` if the `require` expressions should survive the transformation. The latter can be important if the code contains environment detection, or you are coding for an environment with special treatment for `require` calls such as [ElectronJS](https://www.electronjs.org/). See also the "ignore" option.
### `ignore`
-Type: `Array[...String | (String) => Boolean]`<br>
+Type: `string[] | ((id: string) => boolean)`<br>
Default: `[]`
-Sometimes you have to leave require statements unconverted. Pass an array containing the IDs or an `id => boolean` function. Only use this option if you know what you're doing!
+Sometimes you have to leave require statements unconverted. Pass an array containing the IDs or an `id => boolean` function.
+
+### `ignoreTryCatch`
+
+Type: `boolean | 'remove' | string[] | ((id: string) => boolean)`<br>
+Default: `false`
+
+In most cases, where `require` calls are inside a `try-catch` clause, they should be left unconverted as it requires an optional dependency that may or may not be installed beside the rolled up package.
+Due to the conversion of `require` to a static `import` - the call is hoisted to the top of the file, outside of the `try-catch` clause.
+
+- `true`: All `require` calls inside a `try` will be left unconverted.
+- `false`: All `require` calls inside a `try` will be converted as if the `try-catch` clause is not there.
+- `remove`: Remove all `require` calls from inside any `try` block.
+- `string[]`: Pass an array containing the IDs to left unconverted.
+- `((id: string) => boolean|'remove')`: Pass a function that control individual IDs.
+
+### `esmExternals`
+
+Type: `boolean | string[] | ((id: string) => boolean)`
+Default: `false`
+
+Controls how to render imports from external dependencies. By default, this plugin assumes that all external dependencies are CommonJS. This means they are rendered as default imports to be compatible with e.g. NodeJS where ES modules can only import a default export from a CommonJS dependency:
+
+```js
+// input
+const foo = require('foo');
+
+// output
+import foo from 'foo';
+```
+
+This is likely not desired for ES module dependencies: Here `require` should usually return the namespace to be compatible with how bundled modules are handled.
+
+If you set `esmExternals` to `true`, this plugins assumes that all external dependencies are ES modules and will adhere to the `requireReturnsDefault` option. If that option is not set, they will be rendered as namespace imports.
+
+You can also supply an array of ids to be treated as ES modules, or a function that will be passed each external id to determine if it is an ES module.
+
+### `requireReturnsDefault`
+
+Type: `boolean | "namespace" | "auto" | "preferred" | ((id: string) => boolean | "auto" | "preferred")`<br>
+Default: `false`
+
+Controls what is returned when requiring an ES module from a CommonJS file. When using the `esmExternals` option, this will also apply to external modules. By default, this plugin will render those imports as namespace imports, i.e.
+
+```js
+// input
+const foo = require('foo');
+
+// output
+import * as foo from 'foo';
+```
+
+This is in line with how other bundlers handle this situation and is also the most likely behaviour in case Node should ever support this. However there are some situations where this may not be desired:
+
+- There is code in an external dependency that cannot be changed where a `require` statement expects the default export to be returned from an ES module.
+- If the imported module is in the same bundle, Rollup will generate a namespace object for the imported module which can increase bundle size unnecessarily:
+
+ ```js
+ // input: main.js
+ const dep = require('./dep.js');
+ console.log(dep.default);
+
+ // input: dep.js
+ export default 'foo';
+
+ // output
+ var dep = 'foo';
+
+ var dep$1 = /*#__PURE__*/ Object.freeze({
+ __proto__: null,
+ default: dep
+ });
+
+ console.log(dep$1.default);
+ ```
+
+For these situations, you can change Rollup's behaviour either globally or per module. To change it globally, set the `requireReturnsDefault` option to one of the following values:
+
+- `false`: This is the default, requiring an ES module returns its namespace. This is the only option that will also add a marker `__esModule: true` to the namespace to support interop patterns in CommonJS modules that are transpiled ES modules.
+
+ ```js
+ // input
+ const dep = require('dep');
+ console.log(dep);
+
+ // output
+ import * as dep$1 from 'dep';
+
+ function getAugmentedNamespace(n) {
+ var a = Object.defineProperty({}, '__esModule', { value: true });
+ Object.keys(n).forEach(function (k) {
+ var d = Object.getOwnPropertyDescriptor(n, k);
+ Object.defineProperty(
+ a,
+ k,
+ d.get
+ ? d
+ : {
+ enumerable: true,
+ get: function () {
+ return n[k];
+ }
+ }
+ );
+ });
+ return a;
+ }
+
+ var dep = /*@__PURE__*/ getAugmentedNamespace(dep$1);
+
+ console.log(dep);
+ ```
+
+- `"namespace"`: Like `false`, requiring an ES module returns its namespace, but the plugin does not add the `__esModule` marker and thus creates more efficient code. For external dependencies when using `esmExternals: true`, no additional interop code is generated.
+
+ ```js
+ // output
+ import * as dep from 'dep';
+
+ console.log(dep);
+ ```
+
+- `"auto"`: This is complementary to how [`output.exports`](https://rollupjs.org/guide/en/#outputexports): `"auto"` works in Rollup: If a module has a default export and no named exports, requiring that module returns the default export. In all other cases, the namespace is returned. For external dependencies when using `esmExternals: true`, a corresponding interop helper is added:
+
+ ```js
+ // output
+ import * as dep$1 from 'dep';
+
+ function getDefaultExportFromNamespaceIfNotNamed(n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
+ }
+
+ var dep = getDefaultExportFromNamespaceIfNotNamed(dep$1);
+
+ console.log(dep);
+ ```
+
+- `"preferred"`: If a module has a default export, requiring that module always returns the default export, no matter whether additional named exports exist. This is similar to how previous versions of this plugin worked. Again for external dependencies when using `esmExternals: true`, an interop helper is added:
+
+ ```js
+ // output
+ import * as dep$1 from 'dep';
+
+ function getDefaultExportFromNamespaceIfPresent(n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
+ }
+
+ var dep = getDefaultExportFromNamespaceIfPresent(dep$1);
+
+ console.log(dep);
+ ```
+
+- `true`: This will always try to return the default export on require without checking if it actually exists. This can throw at build time if there is no default export. This is how external dependencies are handled when `esmExternals` is not used. The advantage over the other options is that, like `false`, this does not add an interop helper for external dependencies, keeping the code lean:
+
+ ```js
+ // output
+ import dep from 'dep';
+
+ console.log(dep);
+ ```
+
+To change this for individual modules, you can supply a function for `requireReturnsDefault` instead. This function will then be called once for each required ES module or external dependency with the corresponding id and allows you to return different values for different modules.
## Using with @rollup/plugin-node-resolve
@@ -158,6 +319,26 @@ ES modules are _always_ parsed in strict mode. That means that certain non-stric
Luckily, there is absolutely no good reason _not_ to use strict mode for everything — so the solution to this problem is to lobby the authors of those modules to update them.
+## Inter-plugin-communication
+
+This plugin exposes the result of its CommonJS file type detection for other plugins to use. You can access it via `this.getModuleInfo` or the `moduleParsed` hook:
+
+```js
+function cjsDetectionPlugin() {
+ return {
+ name: 'cjs-detection',
+ moduleParsed({
+ id,
+ meta: {
+ commonjs: { isCommonJS }
+ }
+ }) {
+ console.log(`File ${id} is CommonJS: ${isCommonJS}`);
+ }
+ };
+}
+```
+
## Meta
[CONTRIBUTING](/.github/CONTRIBUTING.md)
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js
index 0e99bcfe9e2..d38bae195cc 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js
@@ -1,223 +1,153 @@
-import { statSync, existsSync, readFileSync } from 'fs';
-import { basename, extname, dirname, sep, resolve, join } from 'path';
+import { basename, extname, dirname, sep, join, resolve } from 'path';
import { makeLegalIdentifier, attachScopes, extractAssignedNames, createFilter } from '@rollup/pluginutils';
import getCommonDir from 'commondir';
+import { existsSync, readFileSync, statSync } from 'fs';
import glob from 'glob';
import { walk } from 'estree-walker';
import MagicString from 'magic-string';
-import { sync } from 'resolve';
import isReference from 'is-reference';
+import { sync } from 'resolve';
-function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
-}
-
-function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
-}
-
-function _iterableToArrayLimit(arr, i) {
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
+var peerDependencies = {
+ rollup: "^2.30.0"
+};
+function tryParse(parse, code, id) {
try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
-
- if (i && _arr.length === i) break;
- }
+ return parse(code, { allowReturnOutsideFunction: true });
} catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
+ err.message += ` in ${id}`;
+ throw err;
}
-
- return _arr;
-}
-
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(n);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
-
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
- return arr2;
-}
+const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
-function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+function hasCjsKeywords(code, ignoreGlobal) {
+ const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
+ return firstpass.test(code);
}
-function _createForOfIteratorHelper(o) {
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
- if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) {
- var i = 0;
-
- var F = function () {};
+/* eslint-disable no-underscore-dangle */
- return {
- s: F,
- n: function () {
- if (i >= o.length) return {
- done: true
- };
- return {
- done: false,
- value: o[i++]
- };
- },
- e: function (e) {
- throw e;
- },
- f: F
- };
- }
+function analyzeTopLevelStatements(parse, code, id) {
+ const ast = tryParse(parse, code, id);
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
+ let isEsModule = false;
+ let hasDefaultExport = false;
+ let hasNamedExports = false;
- var it,
- normalCompletion = true,
- didErr = false,
- err;
- return {
- s: function () {
- it = o[Symbol.iterator]();
- },
- n: function () {
- var step = it.next();
- normalCompletion = step.done;
- return step;
- },
- e: function (e) {
- didErr = true;
- err = e;
- },
- f: function () {
- try {
- if (!normalCompletion && it.return != null) it.return();
- } finally {
- if (didErr) throw err;
- }
+ for (const node of ast.body) {
+ switch (node.type) {
+ case 'ExportDefaultDeclaration':
+ isEsModule = true;
+ hasDefaultExport = true;
+ break;
+ case 'ExportNamedDeclaration':
+ isEsModule = true;
+ if (node.declaration) {
+ hasNamedExports = true;
+ } else {
+ for (const specifier of node.specifiers) {
+ if (specifier.exported.name === 'default') {
+ hasDefaultExport = true;
+ } else {
+ hasNamedExports = true;
+ }
+ }
+ }
+ break;
+ case 'ExportAllDeclaration':
+ isEsModule = true;
+ if (node.exported && node.exported.name === 'default') {
+ hasDefaultExport = true;
+ } else {
+ hasNamedExports = true;
+ }
+ break;
+ case 'ImportDeclaration':
+ isEsModule = true;
+ break;
}
- };
-}
-
-var peerDependencies = {
- rollup: "^2.3.4"
-};
-
-/* eslint-disable no-undefined */
-const operators = {
- '==': x => equals(x.left, x.right, false),
- '!=': x => not(operators['=='](x)),
- '===': x => equals(x.left, x.right, true),
- '!==': x => not(operators['==='](x)),
- '!': x => isFalsy(x.argument),
- '&&': x => isTruthy(x.left) && isTruthy(x.right),
- '||': x => isTruthy(x.left) || isTruthy(x.right)
-};
-function flatten(node) {
- const parts = [];
-
- while (node.type === 'MemberExpression') {
- if (node.computed) return null;
- parts.unshift(node.property.name); // eslint-disable-next-line no-param-reassign
-
- node = node.object;
}
- if (node.type !== 'Identifier') return null;
- const _node = node,
- name = _node.name;
- parts.unshift(name);
- return {
- name,
- keypath: parts.join('.')
- };
+ return { isEsModule, hasDefaultExport, hasNamedExports, ast };
}
-function isTruthy(node) {
- if (node.type === 'Literal') return !!node.value;
- if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
- if (node.operator in operators) return operators[node.operator](node);
- return undefined;
-}
-function isFalsy(node) {
- return not(isTruthy(node));
-}
-
-function not(value) {
- return value === undefined ? value : !value;
-}
-
-function equals(a, b, strict) {
- if (a.type !== b.type) return undefined; // eslint-disable-next-line eqeqeq
-
- if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
- return undefined;
-}
+const isWrappedId = (id, suffix) => id.endsWith(suffix);
+const wrapId = (id, suffix) => `\0${id}${suffix}`;
+const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
const PROXY_SUFFIX = '?commonjs-proxy';
-const getProxyId = id => `\0${id}${PROXY_SUFFIX}`;
-const getIdFromProxyId = proxyId => proxyId.slice(1, -PROXY_SUFFIX.length);
+const REQUIRE_SUFFIX = '?commonjs-require';
const EXTERNAL_SUFFIX = '?commonjs-external';
-const getExternalProxyId = id => `\0${id}${EXTERNAL_SUFFIX}`;
-const getIdFromExternalProxyId = proxyId => proxyId.slice(1, -EXTERNAL_SUFFIX.length);
-const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
-const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
- if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);
- return path;
-};
-const DYNAMIC_REGISTER_PREFIX = '\0commonjs-dynamic-register:';
+
+const DYNAMIC_REGISTER_SUFFIX = '?commonjs-dynamic-register';
const DYNAMIC_JSON_PREFIX = '\0commonjs-dynamic-json:';
const DYNAMIC_PACKAGES_ID = '\0commonjs-dynamic-packages';
-const HELPERS_ID = '\0commonjsHelpers.js'; // `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
+
+const HELPERS_ID = '\0commonjsHelpers.js';
+
+// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
+// This will no longer be necessary once Rollup switches to ES6 output, likely
+// in Rollup 3
const HELPERS = `
export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-export function unwrapExports (x) {
+export function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
-export function createCommonjsModule(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
- }
- }, fn(module, module.exports), module.exports;
+export function getDefaultExportFromNamespaceIfPresent (n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
}
-export function getCjsExportFromNamespace (n) {
- return n && n['default'] || n;
+export function getDefaultExportFromNamespaceIfNotNamed (n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
+}
+
+export function getAugmentedNamespace(n) {
+ if (n.__esModule) return n;
+ var a = Object.defineProperty({}, '__esModule', {value: true});
+ Object.keys(n).forEach(function (k) {
+ var d = Object.getOwnPropertyDescriptor(n, k);
+ Object.defineProperty(a, k, d.get ? d : {
+ enumerable: true,
+ get: function () {
+ return n[k];
+ }
+ });
+ });
+ return a;
}
`;
+
const HELPER_NON_DYNAMIC = `
-export function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
+export function createCommonjsModule(fn) {
+ var module = { exports: {} }
+ return fn(module, module.exports), module.exports;
+}
+
+export function commonjsRequire (target) {
+ throw new Error('Could not dynamically require "' + target + '". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.');
}
`;
+
const HELPERS_DYNAMIC = `
+export function createCommonjsModule(fn, basedir, module) {
+ return module = {
+ path: basedir,
+ exports: {},
+ require: function (path, base) {
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
+ }
+ }, fn(module, module.exports), module.exports;
+}
+
export function commonjsRegister (path, loader) {
DYNAMIC_REQUIRE_LOADERS[path] = loader;
}
@@ -304,10 +234,13 @@ function dirname (path) {
return '.';
}
-export function commonjsRequire (path, originalModuleDir) {
+export function commonjsResolveImpl (path, originalModuleDir, testCache) {
const shouldTryNodeModules = isPossibleNodeModulesPath(path);
path = normalize(path);
let relPath;
+ if (path[0] === '/') {
+ originalModuleDir = '/';
+ }
while (true) {
if (!shouldTryNodeModules) {
relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;
@@ -316,33 +249,18 @@ export function commonjsRequire (path, originalModuleDir) {
} else {
relPath = normalize(join('node_modules', path));
}
+
+ if (relPath.endsWith('/..')) {
+ break; // Travelled too far up, avoid infinite loop
+ }
+
for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {
const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];
- let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
- if (cachedModule) return cachedModule.exports;
- const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
- if (loader) {
- DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
- id: resolvedPath,
- filename: resolvedPath,
- path: dirname(resolvedPath),
- exports: {},
- parent: DEFAULT_PARENT_MODULE,
- loaded: false,
- children: [],
- paths: [],
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
- }
- };
- try {
- loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
- } catch (error) {
- delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
- throw error;
- }
- cachedModule.loaded = true;
- return cachedModule.exports;
+ if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {
+ return resolvedPath;
+ };
+ if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {
+ return resolvedPath;
};
}
if (!shouldTryNodeModules) break;
@@ -350,870 +268,1413 @@ export function commonjsRequire (path, originalModuleDir) {
if (nextDir === originalModuleDir) break;
originalModuleDir = nextDir;
}
+ return null;
+}
+
+export function commonjsResolve (path, originalModuleDir) {
+ const resolvedPath = commonjsResolveImpl(path, originalModuleDir);
+ if (resolvedPath !== null) {
+ return resolvedPath;
+ }
+ return require.resolve(path);
+}
+
+export function commonjsRequire (path, originalModuleDir) {
+ const resolvedPath = commonjsResolveImpl(path, originalModuleDir, true);
+ if (resolvedPath !== null) {
+ let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
+ if (cachedModule) return cachedModule.exports;
+ const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
+ if (loader) {
+ DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
+ id: resolvedPath,
+ filename: resolvedPath,
+ path: dirname(resolvedPath),
+ exports: {},
+ parent: DEFAULT_PARENT_MODULE,
+ loaded: false,
+ children: [],
+ paths: [],
+ require: function (path, base) {
+ return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
+ }
+ };
+ try {
+ loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
+ } catch (error) {
+ delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
+ throw error;
+ }
+ cachedModule.loaded = true;
+ return cachedModule.exports;
+ };
+ }
return require(path);
}
commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;
+commonjsRequire.resolve = commonjsResolve;
`;
-/* eslint-disable import/prefer-default-export */
-function getName(id) {
- const name = makeLegalIdentifier(basename(id, extname(id)));
-
- if (name !== 'index') {
- return name;
- }
-
- const segments = dirname(id).split(sep);
- return makeLegalIdentifier(segments[segments.length - 1]);
+function getHelpersModule(isDynamicRequireModulesEnabled) {
+ return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;
}
-const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(' ');
-const blacklist = {
- __esModule: true
-};
-reserved.forEach(word => blacklist[word] = true);
-const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
-const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
-const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
-const importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;
-const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
+/* eslint-disable import/prefer-default-export */
function deconflict(scope, globals, identifier) {
let i = 1;
let deconflicted = makeLegalIdentifier(identifier);
- while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
- deconflicted = `${identifier}_${i}`;
+ while (scope.contains(deconflicted) || globals.has(deconflicted)) {
+ deconflicted = makeLegalIdentifier(`${identifier}_${i}`);
i += 1;
}
-
+ // eslint-disable-next-line no-param-reassign
scope.declarations[deconflicted] = true;
+
return deconflicted;
}
-function tryParse(parse, code, id) {
- try {
- return parse(code, {
- allowReturnOutsideFunction: true
- });
- } catch (err) {
- err.message += ` in ${id}`;
- throw err;
+function getName(id) {
+ const name = makeLegalIdentifier(basename(id, extname(id)));
+ if (name !== 'index') {
+ return name;
}
+ const segments = dirname(id).split(sep);
+ return makeLegalIdentifier(segments[segments.length - 1]);
}
function normalizePathSlashes(path) {
return path.replace(/\\/g, '/');
}
-function hasCjsKeywords(code, ignoreGlobal) {
- const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
- return firstpass.test(code);
-}
-function checkEsModule(parse, code, id) {
- const ast = tryParse(parse, code, id);
- let isEsModule = false;
-
- var _iterator = _createForOfIteratorHelper(ast.body),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const node = _step.value;
- if (node.type === 'ExportDefaultDeclaration') return {
- isEsModule: true,
- hasDefaultExport: true,
- ast
- };
- if (node.type === 'ExportNamedDeclaration') {
- isEsModule = true;
-
- var _iterator2 = _createForOfIteratorHelper(node.specifiers),
- _step2;
+const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
+const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
+ const normalizedPath = normalizePathSlashes(path);
+ return normalizedPath.startsWith(commonDir)
+ ? VIRTUAL_PATH_BASE + normalizedPath.slice(commonDir.length)
+ : normalizedPath;
+};
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- const specifier = _step2.value;
+function getPackageEntryPoint(dirPath) {
+ let entryPoint = 'index.js';
- if (specifier.exported.name === 'default') {
- return {
- isEsModule: true,
- hasDefaultExport: true,
- ast
- };
- }
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- } else if (importExportDeclaration.test(node.type)) isEsModule = true;
+ try {
+ if (existsSync(join(dirPath, 'package.json'))) {
+ entryPoint =
+ JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main ||
+ entryPoint;
}
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
+ } catch (ignored) {
+ // ignored
}
- return {
- isEsModule,
- hasDefaultExport: false,
- ast
- };
+ return entryPoint;
}
-function getDefinePropertyCallName(node, targetName) {
- if (node.type !== 'CallExpression') return;
- const _node$callee = node.callee,
- object = _node$callee.object,
- property = _node$callee.property;
- if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
- if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
- if (node.arguments.length !== 3) return;
+function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {
+ let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;
+ for (const dir of dynamicRequireModuleDirPaths) {
+ const entryPoint = getPackageEntryPoint(dir);
+
+ code += `\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(dir, commonDir)
+ )}, function (module, exports) {
+ module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});
+});`;
+ }
+ return code;
+}
- const _node$arguments = _slicedToArray(node.arguments, 2),
- target = _node$arguments[0],
- val = _node$arguments[1];
+function getDynamicPackagesEntryIntro(
+ dynamicRequireModuleDirPaths,
+ dynamicRequireModuleSet
+) {
+ let dynamicImports = Array.from(
+ dynamicRequireModuleSet,
+ (dynamicId) => `require(${JSON.stringify(wrapModuleRegisterProxy(dynamicId))});`
+ ).join('\n');
- if (target.type !== 'Identifier' || target.name !== targetName) return; // eslint-disable-next-line consistent-return
+ if (dynamicRequireModuleDirPaths.length) {
+ dynamicImports += `require(${JSON.stringify(wrapModuleRegisterProxy(DYNAMIC_PACKAGES_ID))});`;
+ }
- return val.value;
+ return dynamicImports;
}
-function transformCommonjs(parse, code, id, isEntry, hasImporters, isEsModule, ignoreGlobal, ignoreRequire, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModuleSet, commonDir, astCache) {
- const ast = astCache || tryParse(parse, code, id);
- const magicString = new MagicString(code);
- const required = {}; // Because objects have no guaranteed ordering, yet we need it,
- // we need to keep track of the order in a array
+function wrapModuleRegisterProxy(id) {
+ return wrapId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- const sources = [];
- let uid = 0;
- let scope = attachScopes(ast, 'scope');
- const uses = {
- module: false,
- exports: false,
- global: false,
- require: false
- };
- let lexicalDepth = 0;
- let programDepth = 0;
- const globals = new Set(); // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
+function unwrapModuleRegisterProxy(id) {
+ return unwrapId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
- const namedExports = {}; // TODO handle transpiled modules
+function isModuleRegisterProxy(id) {
+ return isWrappedId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- let shouldWrap = /__esModule/.test(code);
- let usesCommonjsHelpers = false;
+function isDynamicModuleImport(id, dynamicRequireModuleSet) {
+ const normalizedPath = normalizePathSlashes(id);
+ return dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json');
+}
- function isRequireStatement(node) {
- if (!node) return false;
- if (node.type !== 'CallExpression') return false; // Weird case of `require()` or `module.require()` without arguments
+function isDirectory(path) {
+ try {
+ if (statSync(path).isDirectory()) return true;
+ } catch (ignored) {
+ // Nothing to do here
+ }
+ return false;
+}
- if (node.arguments.length === 0) return false;
- return isRequireIdentifier(node.callee);
+function getDynamicRequirePaths(patterns) {
+ const dynamicRequireModuleSet = new Set();
+ for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
+ const isNegated = pattern.startsWith('!');
+ const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
+ for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {
+ modifySet(normalizePathSlashes(resolve(path)));
+ if (isDirectory(path)) {
+ modifySet(normalizePathSlashes(resolve(join(path, getPackageEntryPoint(path)))));
+ }
+ }
}
+ const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter((path) =>
+ isDirectory(path)
+ );
+ return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };
+}
- function isRequireIdentifier(node) {
- if (!node) return false;
+const isCjsPromises = new Map();
- if (node.type === 'Identifier' && node.name === 'require'
- /* `require` */
- ) {
- // `require` is hidden by a variable in local scope
- if (scope.contains('require')) return false;
- return true;
- } else if (node.type === 'MemberExpression'
- /* `[something].[something]` */
- ) {
- // `module.[something]`
- if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false; // `module` is hidden by a variable in local scope
+function getIsCjsPromise(id) {
+ let isCjsPromise = isCjsPromises.get(id);
+ if (isCjsPromise) return isCjsPromise.promise;
- if (scope.contains('module')) return false; // `module.require(...)`
+ const promise = new Promise((resolve) => {
+ isCjsPromise = {
+ resolve,
+ promise: null
+ };
+ isCjsPromises.set(id, isCjsPromise);
+ });
+ isCjsPromise.promise = promise;
- if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;
- return true;
- }
+ return promise;
+}
- return false;
+function setIsCjsPromise(id, resolution) {
+ const isCjsPromise = isCjsPromises.get(id);
+ if (isCjsPromise) {
+ if (isCjsPromise.resolve) {
+ isCjsPromise.resolve(resolution);
+ isCjsPromise.resolve = null;
+ }
+ } else {
+ isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: null });
}
+}
- function hasDynamicArguments(node) {
- return node.arguments.length > 1 || node.arguments[0].type !== 'Literal' && (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0);
- }
+// e.g. id === "commonjsHelpers?commonjsRegister"
+function getSpecificHelperProxy(id) {
+ return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;
+}
- function isStaticRequireStatement(node) {
- if (!isRequireStatement(node)) return false;
- if (hasDynamicArguments(node)) return false;
- return true;
+function getUnknownRequireProxy(id, requireReturnsDefault) {
+ if (requireReturnsDefault === true || id.endsWith('.json')) {
+ return `export {default} from ${JSON.stringify(id)};`;
}
+ const name = getName(id);
+ const exported =
+ requireReturnsDefault === 'auto'
+ ? `import {getDefaultExportFromNamespaceIfNotNamed} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
+ : requireReturnsDefault === 'preferred'
+ ? `import {getDefaultExportFromNamespaceIfPresent} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
+ : !requireReturnsDefault
+ ? `import {getAugmentedNamespace} from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
+ : `export default ${name};`;
+ return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
+}
- function isIgnoredRequireStatement(requiredNode) {
- return ignoreRequire(requiredNode.arguments[0].value);
- }
+function getDynamicJsonProxy(id, commonDir) {
+ const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));
+ return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
+ )}, function (module, exports) {
+ module.exports = require(${JSON.stringify(normalizedPath)});
+});`;
+}
+
+function getDynamicRequireProxy(normalizedPath, commonDir) {
+ return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
+ )}, function (module, exports) {
+ ${readFileSync(normalizedPath, { encoding: 'utf8' })}
+});`;
+}
- function getRequireStringArg(node) {
- return node.arguments[0].type === 'Literal' ? node.arguments[0].value : node.arguments[0].quasis[0].value.cooked;
+async function getStaticRequireProxy(
+ id,
+ requireReturnsDefault,
+ esModulesWithDefaultExport,
+ esModulesWithNamedExports
+) {
+ const name = getName(id);
+ const isCjs = await getIsCjsPromise(id);
+ if (isCjs) {
+ return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;
+ } else if (isCjs === null) {
+ return getUnknownRequireProxy(id, requireReturnsDefault);
+ } else if (!requireReturnsDefault) {
+ return `import {getAugmentedNamespace} from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
+ id
+ )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
+ } else if (
+ requireReturnsDefault !== true &&
+ (requireReturnsDefault === 'namespace' ||
+ !esModulesWithDefaultExport.has(id) ||
+ (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))
+ ) {
+ return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
}
+ return `export {default} from ${JSON.stringify(id)};`;
+}
- function getRequired(node, name) {
- let sourceId = getRequireStringArg(node);
- const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);
+/* eslint-disable no-param-reassign, no-undefined */
- if (isDynamicRegister) {
- sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);
- }
+function getCandidatesForExtension(resolved, extension) {
+ return [resolved + extension, `${resolved}${sep}index${extension}`];
+}
- const existing = required[sourceId]; // eslint-disable-next-line no-undefined
+function getCandidates(resolved, extensions) {
+ return extensions.reduce(
+ (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
+ [resolved]
+ );
+}
- if (existing === undefined) {
- const isDynamic = hasDynamicModuleForPath(sourceId);
+function getResolveId(extensions) {
+ function resolveExtensions(importee, importer) {
+ // not our problem
+ if (importee[0] !== '.' || !importer) return undefined;
- if (!name) {
- do {
- name = `require$$${uid}`;
- uid += 1;
- } while (scope.contains(name));
- }
+ const resolved = resolve(dirname(importer), importee);
+ const candidates = getCandidates(resolved, extensions);
- if (isDynamicRegister && sourceId.endsWith('.json')) {
- sourceId = DYNAMIC_JSON_PREFIX + sourceId;
+ for (let i = 0; i < candidates.length; i += 1) {
+ try {
+ const stats = statSync(candidates[i]);
+ if (stats.isFile()) return { id: candidates[i] };
+ } catch (err) {
+ /* noop */
}
+ }
- if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {
- sources.push([sourceId, !isDynamicRegister]);
- }
+ return undefined;
+ }
- required[sourceId] = {
- source: sourceId,
- name,
- importsDefault: false,
- isDynamic
- };
+ return function resolveId(importee, rawImporter) {
+ const importer =
+ rawImporter && isModuleRegisterProxy(rawImporter)
+ ? unwrapModuleRegisterProxy(rawImporter)
+ : rawImporter;
+
+ // Proxies are only importing resolved ids, no need to resolve again
+ if (importer && isWrappedId(importer, PROXY_SUFFIX)) {
+ return importee;
}
- return required[sourceId];
- }
+ const isProxyModule = isWrappedId(importee, PROXY_SUFFIX);
+ const isRequiredModule = isWrappedId(importee, REQUIRE_SUFFIX);
+ let isModuleRegistration = false;
- function hasDynamicModuleForPath(source) {
- if (!/[/\\]/.test(source)) {
- try {
- const resolvedPath = normalizePathSlashes(sync(source, {
- basedir: dirname(id)
- }));
+ if (isProxyModule) {
+ importee = unwrapId(importee, PROXY_SUFFIX);
+ } else if (isRequiredModule) {
+ importee = unwrapId(importee, REQUIRE_SUFFIX);
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
- }
- } catch (ex) {
- // Probably a node.js internal module
- return false;
+ isModuleRegistration = isModuleRegisterProxy(importee);
+ if (isModuleRegistration) {
+ importee = unwrapModuleRegisterProxy(importee);
}
+ }
- return false;
+ if (
+ importee.startsWith(HELPERS_ID) ||
+ importee === DYNAMIC_PACKAGES_ID ||
+ importee.startsWith(DYNAMIC_JSON_PREFIX)
+ ) {
+ return importee;
}
- for (var _i = 0, _arr = ['', '.js', '.json']; _i < _arr.length; _i++) {
- const attemptExt = _arr[_i];
- const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));
+ if (importee.startsWith('\0')) {
+ return null;
+ }
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
+ return this.resolve(importee, importer, {
+ skipSelf: true,
+ custom: { 'node-resolve': { isRequire: isProxyModule || isRequiredModule } }
+ }).then((resolved) => {
+ if (!resolved) {
+ resolved = resolveExtensions(importee, importer);
}
- }
+ if (resolved && isProxyModule) {
+ resolved.id = wrapId(resolved.id, resolved.external ? EXTERNAL_SUFFIX : PROXY_SUFFIX);
+ resolved.external = false;
+ } else if (resolved && isModuleRegistration) {
+ resolved.id = wrapModuleRegisterProxy(resolved.id);
+ } else if (!resolved && (isProxyModule || isRequiredModule)) {
+ return { id: wrapId(importee, EXTERNAL_SUFFIX), external: false };
+ }
+ return resolved;
+ });
+ };
+}
- return false;
+function validateRollupVersion(rollupVersion, peerDependencyVersion) {
+ const [major, minor] = rollupVersion.split('.').map(Number);
+ const versionRegexp = /\^(\d+\.\d+)\.\d+/g;
+ let minMajor = Infinity;
+ let minMinor = Infinity;
+ let foundVersion;
+ // eslint-disable-next-line no-cond-assign
+ while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {
+ const [foundMajor, foundMinor] = foundVersion[1].split('.').map(Number);
+ if (foundMajor < minMajor) {
+ minMajor = foundMajor;
+ minMinor = foundMinor;
+ }
+ }
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
+ throw new Error(
+ `Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minMajor}.${minMinor} but found rollup@${rollupVersion}.`
+ );
}
+}
- function shouldUseSimulatedRequire(required) {
- return hasDynamicModuleForPath(required.source) && ( // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.
- required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'));
- } // do a first pass, see which names are assigned to. This is necessary to prevent
- // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
- // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
+const operators = {
+ '==': (x) => equals(x.left, x.right, false),
+ '!=': (x) => not(operators['=='](x)),
- const assignedTo = new Set();
- walk(ast, {
- enter(node) {
- if (node.type !== 'AssignmentExpression') return;
- if (node.left.type === 'MemberExpression') return;
- extractAssignedNames(node.left).forEach(name => {
- assignedTo.add(name);
- });
- }
+ '===': (x) => equals(x.left, x.right, true),
- });
- walk(ast, {
- enter(node, parent) {
- if (sourceMap) {
- magicString.addSourcemapLocation(node.start);
- magicString.addSourcemapLocation(node.end);
- } // skip dead branches
+ '!==': (x) => not(operators['==='](x)),
+ '!': (x) => isFalsy(x.argument),
- if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {
- if (node === parent.consequent && isFalsy(parent.test)) {
- this.skip();
- return;
- }
+ '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
- if (node === parent.alternate && isTruthy(parent.test)) {
- this.skip();
- return;
- }
- }
+ '||': (x) => isTruthy(x.left) || isTruthy(x.right)
+};
- if (node._skip) {
- this.skip();
- return;
- }
+function not(value) {
+ return value === null ? value : !value;
+}
- programDepth += 1;
+function equals(a, b, strict) {
+ if (a.type !== b.type) return null;
+ // eslint-disable-next-line eqeqeq
+ if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
+ return null;
+}
- if (node.scope) {
- scope = node.scope;
- }
+function isTruthy(node) {
+ if (!node) return false;
+ if (node.type === 'Literal') return !!node.value;
+ if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
+ if (node.operator in operators) return operators[node.operator](node);
+ return null;
+}
- if (functionType.test(node.type)) lexicalDepth += 1; // if toplevel return, we need to wrap it
+function isFalsy(node) {
+ return not(isTruthy(node));
+}
- if (node.type === 'ReturnStatement' && lexicalDepth === 0) {
- shouldWrap = true;
- } // rewrite `this` as `commonjsHelpers.commonjsGlobal`
+function getKeypath(node) {
+ const parts = [];
+ while (node.type === 'MemberExpression') {
+ if (node.computed) return null;
- if (node.type === 'ThisExpression' && lexicalDepth === 0) {
- uses.global = true;
+ parts.unshift(node.property.name);
+ // eslint-disable-next-line no-param-reassign
+ node = node.object;
+ }
- if (!ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
+ if (node.type !== 'Identifier') return null;
- return;
- } // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
+ const { name } = node;
+ parts.unshift(name);
+ return { name, keypath: parts.join('.') };
+}
- if (node.type === 'UnaryExpression' && node.operator === 'typeof') {
- const flattened = flatten(node.argument);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
+const KEY_COMPILED_ESM = '__esModule';
- if (flattened.keypath === 'module.exports' || flattened.keypath === 'module' || flattened.keypath === 'exports') {
- magicString.overwrite(node.start, node.end, `'object'`, {
- storeName: false
- });
- }
- } // rewrite `require` (if not already handled) `global` and `define`, and handle free references to
- // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule
+function isDefineCompiledEsm(node) {
+ const definedProperty =
+ getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');
+ if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {
+ return isTruthy(definedProperty.value);
+ }
+ return false;
+}
+function getDefinePropertyCallName(node, targetName) {
+ const targetNames = targetName.split('.');
- if (node.type === 'Identifier') {
- if (isReference(node, parent) && !scope.contains(node.name)) {
- if (node.name in uses) {
- if (isRequireIdentifier(node)) {
- if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {
- return;
- }
+ const {
+ callee: { object, property }
+ } = node;
+ if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
+ if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
+ if (node.arguments.length !== 3) return;
- if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {
- magicString.appendLeft(parent.end - 1, `,${JSON.stringify(dirname(id) === '.' ? null
- /* default behavior */
- : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir))}`);
- }
+ const [target, key, value] = node.arguments;
+ if (targetNames.length === 1) {
+ if (target.type !== 'Identifier' || target.name !== targetNames[0]) {
+ return;
+ }
+ }
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
+ if (targetNames.length === 2) {
+ if (
+ target.type !== 'MemberExpression' ||
+ target.object.name !== targetNames[0] ||
+ target.property.name !== targetNames[1]
+ ) {
+ return;
+ }
+ }
- uses[node.name] = true;
+ if (value.type !== 'ObjectExpression' || !value.properties) return;
- if (node.name === 'global' && !ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- } // if module or exports are used outside the context of an assignment
- // expression, we need to wrap the module
+ const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value');
+ if (!valueProperty || !valueProperty.value) return;
+ // eslint-disable-next-line consistent-return
+ return { key: key.value, value: valueProperty.value };
+}
- if (node.name === 'module' || node.name === 'exports') {
- shouldWrap = true;
- }
- }
+function isLocallyShadowed(name, scope) {
+ while (scope.parent) {
+ if (scope.declarations[name]) {
+ return true;
+ }
+ // eslint-disable-next-line no-param-reassign
+ scope = scope.parent;
+ }
+ return false;
+}
- if (node.name === 'define') {
- magicString.overwrite(node.start, node.end, 'undefined', {
- storeName: true
- });
- }
+function isShorthandProperty(parent) {
+ return parent && parent.type === 'Property' && parent.shorthand;
+}
- globals.add(node.name);
- }
+function wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath) {
+ const args = `module${uses.exports ? ', exports' : ''}`;
- return;
- } // Is this an assignment to exports or module.exports?
-
-
- if (node.type === 'AssignmentExpression') {
- if (node.left.type !== 'MemberExpression') return;
- const flattened = flatten(node.left);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
- const match = exportsPattern.exec(flattened.keypath);
- if (!match || flattened.keypath === 'exports') return;
- uses[flattened.name] = true; // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
- // if this isn't top-level, we'll need to wrap the module
-
- if (programDepth > 3) shouldWrap = true;
- node.left._skip = true;
-
- if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
- node.right.properties.forEach(prop => {
- if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
- const name = prop.key.name;
- if (name === makeLegalIdentifier(name)) namedExports[name] = true;
- });
- return;
- }
+ magicString
+ .trim()
+ .prepend(`var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`)
+ .append(
+ `\n}${virtualDynamicRequirePath ? `, ${JSON.stringify(virtualDynamicRequirePath)}` : ''});`
+ );
+}
- if (match[1]) namedExports[match[1]] = true;
- return;
+function rewriteExportsAndGetExportsBlock(
+ magicString,
+ moduleName,
+ wrapped,
+ topLevelModuleExportsAssignments,
+ topLevelExportsAssignmentsByName,
+ defineCompiledEsmExpressions,
+ deconflict,
+ isRestorableCompiledEsm,
+ code,
+ uses,
+ HELPERS_NAME
+) {
+ const namedExportDeclarations = [`export { ${moduleName} as __moduleExports };`];
+ const moduleExportsPropertyAssignments = [];
+ let deconflictedDefaultExportName;
+
+ if (!wrapped) {
+ let hasModuleExportsAssignment = false;
+ const namedExportProperties = [];
+
+ // Collect and rewrite module.exports assignments
+ for (const { left } of topLevelModuleExportsAssignments) {
+ hasModuleExportsAssignment = true;
+ magicString.overwrite(left.start, left.end, `var ${moduleName}`);
+ }
+
+ // Collect and rewrite named exports
+ for (const [exportName, node] of topLevelExportsAssignmentsByName) {
+ const deconflicted = deconflict(exportName);
+ magicString.overwrite(node.start, node.left.end, `var ${deconflicted}`);
+
+ if (exportName === 'default') {
+ deconflictedDefaultExportName = deconflicted;
+ } else {
+ namedExportDeclarations.push(
+ exportName === deconflicted
+ ? `export { ${exportName} };`
+ : `export { ${deconflicted} as ${exportName} };`
+ );
}
- const name = getDefinePropertyCallName(node, 'exports');
- if (name && name === makeLegalIdentifier(name)) namedExports[name] = true; // if this is `var x = require('x')`, we can do `import x from 'x'`
+ if (hasModuleExportsAssignment) {
+ moduleExportsPropertyAssignments.push(`${moduleName}.${exportName} = ${deconflicted};`);
+ } else {
+ namedExportProperties.push(`\t${exportName}: ${deconflicted}`);
+ }
+ }
- if (node.type === 'VariableDeclarator' && node.id.type === 'Identifier' && isStaticRequireStatement(node.init) && !isIgnoredRequireStatement(node.init)) {
- // for now, only do this for top-level requires. maybe fix this in future
- if (scope.parent) return; // edge case — CJS allows you to assign to imports. ES doesn't
+ // Regenerate CommonJS namespace
+ if (!hasModuleExportsAssignment) {
+ const moduleExports = `{\n${namedExportProperties.join(',\n')}\n}`;
+ magicString
+ .trim()
+ .append(
+ `\n\nvar ${moduleName} = ${
+ isRestorableCompiledEsm
+ ? `/*#__PURE__*/Object.defineProperty(${moduleExports}, '__esModule', {value: true})`
+ : moduleExports
+ };`
+ );
+ }
+ }
- if (assignedTo.has(node.id.name)) return;
- const required = getRequired(node.init, node.id.name);
- required.importsDefault = true;
+ // Generate default export
+ const defaultExport = [];
+ if (isRestorableCompiledEsm) {
+ defaultExport.push(`export default ${deconflictedDefaultExportName || moduleName};`);
+ } else if (
+ (wrapped || deconflictedDefaultExportName) &&
+ (defineCompiledEsmExpressions.length > 0 || code.indexOf('__esModule') >= 0)
+ ) {
+ // eslint-disable-next-line no-param-reassign
+ uses.commonjsHelpers = true;
+ defaultExport.push(
+ `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`
+ );
+ } else {
+ defaultExport.push(`export default ${moduleName};`);
+ }
- if (required.name === node.id.name && !required.isDynamic) {
- node._shouldRemove = true;
- }
- }
+ return `\n\n${defaultExport
+ .concat(namedExportDeclarations)
+ .concat(moduleExportsPropertyAssignments)
+ .join('\n')}`;
+}
- if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {
- return;
- }
+function isRequireStatement(node, scope) {
+ if (!node) return false;
+ if (node.type !== 'CallExpression') return false;
- const required = getRequired(node);
+ // Weird case of `require()` or `module.require()` without arguments
+ if (node.arguments.length === 0) return false;
- if (parent.type === 'ExpressionStatement') {
- // is a bare import, e.g. `require('foo');`
- magicString.remove(parent.start, parent.end);
- } else {
- required.importsDefault = true;
+ return isRequire(node.callee, scope);
+}
- if (shouldUseSimulatedRequire(required)) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir))}, ${JSON.stringify(dirname(id) === '.' ? null
- /* default behavior */
- : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir))})`);
- usesCommonjsHelpers = true;
- } else {
- magicString.overwrite(node.start, node.end, required.name);
- }
- }
+function isRequire(node, scope) {
+ return (
+ (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) ||
+ (node.type === 'MemberExpression' && isModuleRequire(node, scope))
+ );
+}
- node.callee._skip = true;
- },
+function isModuleRequire({ object, property }, scope) {
+ return (
+ object.type === 'Identifier' &&
+ object.name === 'module' &&
+ property.type === 'Identifier' &&
+ property.name === 'require' &&
+ !scope.contains('module')
+ );
+}
- leave(node) {
- programDepth -= 1;
- if (node.scope) scope = scope.parent;
- if (functionType.test(node.type)) lexicalDepth -= 1;
+function isStaticRequireStatement(node, scope) {
+ if (!isRequireStatement(node, scope)) return false;
+ return !hasDynamicArguments(node);
+}
- if (node.type === 'VariableDeclaration') {
- let keepDeclaration = false;
- let c = node.declarations[0].start;
+function hasDynamicArguments(node) {
+ return (
+ node.arguments.length > 1 ||
+ (node.arguments[0].type !== 'Literal' &&
+ (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
+ );
+}
- for (let i = 0; i < node.declarations.length; i += 1) {
- const declarator = node.declarations[i];
+const reservedMethod = { resolve: true, cache: true, main: true };
- if (declarator._shouldRemove) {
- magicString.remove(c, declarator.end);
- } else {
- if (!keepDeclaration) {
- magicString.remove(c, declarator.start);
- keepDeclaration = true;
- }
+function isNodeRequirePropertyAccess(parent) {
+ return parent && parent.property && reservedMethod[parent.property.name];
+}
- c = declarator.end;
- }
- }
+function isIgnoredRequireStatement(requiredNode, ignoreRequire) {
+ return ignoreRequire(requiredNode.arguments[0].value);
+}
- if (!keepDeclaration) {
- magicString.remove(node.start, node.end);
- }
+function getRequireStringArg(node) {
+ return node.arguments[0].type === 'Literal'
+ ? node.arguments[0].value
+ : node.arguments[0].quasis[0].value.cooked;
+}
+
+function hasDynamicModuleForPath(source, id, dynamicRequireModuleSet) {
+ if (!/^(?:\.{0,2}[/\\]|[A-Za-z]:[/\\])/.test(source)) {
+ try {
+ const resolvedPath = normalizePathSlashes(sync(source, { basedir: dirname(id) }));
+ if (dynamicRequireModuleSet.has(resolvedPath)) {
+ return true;
}
+ } catch (ex) {
+ // Probably a node.js internal module
+ return false;
}
- });
+ return false;
+ }
- if (!sources.length && !uses.module && !uses.exports && !uses.require && (ignoreGlobal || !uses.global)) {
- // not a CommonJS module
- return null;
- } // If `isEsModule` is on, it means it has ES6 import/export statements,
- // which just can't be wrapped in a function.
-
-
- if (isEsModule) shouldWrap = false;
- usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;
- const importBlock = `${(usesCommonjsHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : []).concat(sources.map(([source]) => // import the actual module before the proxy, so that we know
- // what kind of proxy to build
- `import '${source}';`), sources.filter(([, importProxy]) => importProxy).map(([source]) => {
- const _required$source = required[source],
- name = _required$source.name,
- importsDefault = _required$source.importsDefault;
- return `import ${importsDefault ? `${name} from ` : ``}'${getProxyId(source)}';`;
- })).join('\n')}\n\n`;
- const namedExportDeclarations = [];
- let wrapperStart = '';
- let wrapperEnd = '';
- const moduleName = deconflict(scope, globals, getName(id));
+ for (const attemptExt of ['', '.js', '.json']) {
+ const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));
+ if (dynamicRequireModuleSet.has(resolvedPath)) {
+ return true;
+ }
+ }
- if ((!isEntry || hasImporters) && !isEsModule) {
- const exportModuleExports = {
- str: `export { ${moduleName} as __moduleExports };`,
- name: '__moduleExports'
- };
- namedExportDeclarations.push(exportModuleExports);
+ return false;
+}
+
+function getRequireHandlers() {
+ const requiredSources = [];
+ const requiredBySource = Object.create(null);
+ const requiredByNode = new Map();
+ const requireExpressionsWithUsedReturnValue = [];
+
+ function addRequireStatement(sourceId, node, scope, usesReturnValue) {
+ const required = getRequired(sourceId);
+ requiredByNode.set(node, { scope, required });
+ if (usesReturnValue) {
+ required.nodesUsingRequired.push(node);
+ requireExpressionsWithUsedReturnValue.push(node);
+ }
}
- const defaultExportPropertyAssignments = [];
- let hasDefaultExport = false;
+ function getRequired(sourceId) {
+ if (!requiredBySource[sourceId]) {
+ requiredSources.push(sourceId);
- if (shouldWrap) {
- const args = `module${uses.exports ? ', exports' : ''}`;
- wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`;
- wrapperEnd = `\n}`;
+ requiredBySource[sourceId] = {
+ source: sourceId,
+ name: null,
+ nodesUsingRequired: []
+ };
+ }
- if (isDynamicRequireModulesEnabled) {
- wrapperEnd += `, ${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir))}`;
+ return requiredBySource[sourceId];
+ }
+
+ function rewriteRequireExpressionsAndGetImportBlock(
+ magicString,
+ topLevelDeclarations,
+ topLevelRequireDeclarators,
+ reassignedNames,
+ helpersNameIfUsed,
+ dynamicRegisterSources
+ ) {
+ const removedDeclarators = getDeclaratorsReplacedByImportsAndSetImportNames(
+ topLevelRequireDeclarators,
+ requiredByNode,
+ reassignedNames
+ );
+ setRemainingImportNamesAndRewriteRequires(
+ requireExpressionsWithUsedReturnValue,
+ requiredByNode,
+ magicString
+ );
+ removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString);
+ const importBlock = `${(helpersNameIfUsed
+ ? [`import * as ${helpersNameIfUsed} from '${HELPERS_ID}';`]
+ : []
+ )
+ .concat(
+ // dynamic registers first, as the may be required in the other modules
+ [...dynamicRegisterSources].map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),
+
+ // now the actual modules so that they are analyzed before creating the proxies;
+ // no need to do this for virtual modules as we never proxy them
+ requiredSources
+ .filter((source) => !source.startsWith('\0'))
+ .map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),
+
+ // now the proxy modules
+ requiredSources.map((source) => {
+ const { name, nodesUsingRequired } = requiredBySource[source];
+ return `import ${nodesUsingRequired.length ? `${name} from ` : ``}'${
+ source.startsWith('\0') ? source : wrapId(source, PROXY_SUFFIX)
+ }';`;
+ })
+ )
+ .join('\n')}`;
+ return importBlock ? `${importBlock}\n\n` : '';
+ }
+
+ return {
+ addRequireStatement,
+ requiredSources,
+ rewriteRequireExpressionsAndGetImportBlock
+ };
+}
+
+function getDeclaratorsReplacedByImportsAndSetImportNames(
+ topLevelRequireDeclarators,
+ requiredByNode,
+ reassignedNames
+) {
+ const removedDeclarators = new Set();
+ for (const declarator of topLevelRequireDeclarators) {
+ const { required } = requiredByNode.get(declarator.init);
+ if (!required.name) {
+ const potentialName = declarator.id.name;
+ if (
+ !reassignedNames.has(potentialName) &&
+ !required.nodesUsingRequired.some((node) =>
+ isLocallyShadowed(potentialName, requiredByNode.get(node).scope)
+ )
+ ) {
+ required.name = potentialName;
+ removedDeclarators.add(declarator);
+ }
}
+ }
+ return removedDeclarators;
+}
- wrapperEnd += `);`;
- } else {
- const names = [];
+function setRemainingImportNamesAndRewriteRequires(
+ requireExpressionsWithUsedReturnValue,
+ requiredByNode,
+ magicString
+) {
+ let uid = 0;
+ for (const requireExpression of requireExpressionsWithUsedReturnValue) {
+ const { required } = requiredByNode.get(requireExpression);
+ if (!required.name) {
+ let potentialName;
+ const isUsedName = (node) => requiredByNode.get(node).scope.contains(potentialName);
+ do {
+ potentialName = `require$$${uid}`;
+ uid += 1;
+ } while (required.nodesUsingRequired.some(isUsedName));
+ required.name = potentialName;
+ }
+ magicString.overwrite(requireExpression.start, requireExpression.end, required.name);
+ }
+}
- var _iterator3 = _createForOfIteratorHelper(ast.body),
- _step3;
+function removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString) {
+ for (const declaration of topLevelDeclarations) {
+ let keepDeclaration = false;
+ let [{ start }] = declaration.declarations;
+ for (const declarator of declaration.declarations) {
+ if (removedDeclarators.has(declarator)) {
+ magicString.remove(start, declarator.end);
+ } else if (!keepDeclaration) {
+ magicString.remove(start, declarator.start);
+ keepDeclaration = true;
+ }
+ start = declarator.end;
+ }
+ if (!keepDeclaration) {
+ magicString.remove(declaration.start, declaration.end);
+ }
+ }
+}
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- const node = _step3.value;
+/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
- if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {
- const left = node.expression.left;
- const flattened = flatten(left);
+const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
- if (!flattened) {
- continue;
- }
+const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
- const match = exportsPattern.exec(flattened.keypath);
+function transformCommonjs(
+ parse,
+ code,
+ id,
+ isEsModule,
+ ignoreGlobal,
+ ignoreRequire,
+ getIgnoreTryCatchRequireStatementMode,
+ sourceMap,
+ isDynamicRequireModulesEnabled,
+ dynamicRequireModuleSet,
+ disableWrap,
+ commonDir,
+ astCache
+) {
+ const ast = astCache || tryParse(parse, code, id);
+ const magicString = new MagicString(code);
+ const uses = {
+ module: false,
+ exports: false,
+ global: false,
+ require: false,
+ commonjsHelpers: false
+ };
+ const virtualDynamicRequirePath =
+ isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname(id), commonDir);
+ let scope = attachScopes(ast, 'scope');
+ let lexicalDepth = 0;
+ let programDepth = 0;
+ let currentTryBlockEnd = null;
+ let shouldWrap = false;
+ const defineCompiledEsmExpressions = [];
- if (!match) {
- continue;
- }
+ const globals = new Set();
- if (flattened.keypath === 'module.exports') {
- hasDefaultExport = true;
- magicString.overwrite(left.start, left.end, `var ${moduleName}`);
- } else {
- const _match = _slicedToArray(match, 2),
- name = _match[1];
+ // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
+ const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
+ const namedExports = {};
+ const dynamicRegisterSources = new Set();
+ let hasRemovedRequire = false;
- const deconflicted = deconflict(scope, globals, name);
- names.push({
- name,
- deconflicted
- });
- magicString.overwrite(node.start, left.end, `var ${deconflicted}`);
- const declaration = name === deconflicted ? `export { ${name} };` : `export { ${deconflicted} as ${name} };`;
+ const {
+ addRequireStatement,
+ requiredSources,
+ rewriteRequireExpressionsAndGetImportBlock
+ } = getRequireHandlers();
- if (name !== 'default') {
- namedExportDeclarations.push({
- str: declaration,
- name
- });
- }
+ // See which names are assigned to. This is necessary to prevent
+ // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
+ // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
+ const reassignedNames = new Set();
+ const topLevelDeclarations = [];
+ const topLevelRequireDeclarators = new Set();
+ const skippedNodes = new Set();
+ const topLevelModuleExportsAssignments = [];
+ const topLevelExportsAssignmentsByName = new Map();
- defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);
- }
- }
+ walk(ast, {
+ enter(node, parent) {
+ if (skippedNodes.has(node)) {
+ this.skip();
+ return;
}
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- if (!hasDefaultExport && (names.length || (!isEntry || hasImporters) && !isEsModule)) {
- wrapperEnd = `\n\nvar ${moduleName} = {\n${names.map(({
- name,
- deconflicted
- }) => `\t${name}: ${deconflicted}`).join(',\n')}\n};`;
- }
- }
+ if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) {
+ currentTryBlockEnd = null;
+ }
- const defaultExport = /__esModule/.test(code) ? `export default /*@__PURE__*/${HELPERS_NAME}.unwrapExports(${moduleName});` : `export default ${moduleName};`;
- const named = namedExportDeclarations.filter(x => x.name !== 'default' || !hasDefaultExport).map(x => x.str);
- const exportBlock = `\n\n${(isEsModule ? [] : [defaultExport]).concat(named).concat(hasDefaultExport ? defaultExportPropertyAssignments : []).join('\n')}`;
- magicString.trim().prepend(importBlock + wrapperStart).trim().append(wrapperEnd);
- const injectExportBlock = hasDefaultExport || named.length > 0 || shouldWrap || !isEntry || hasImporters;
+ programDepth += 1;
+ if (node.scope) ({ scope } = node);
+ if (functionType.test(node.type)) lexicalDepth += 1;
+ if (sourceMap) {
+ magicString.addSourcemapLocation(node.start);
+ magicString.addSourcemapLocation(node.end);
+ }
- if (injectExportBlock) {
- magicString.append(exportBlock);
- }
+ // eslint-disable-next-line default-case
+ switch (node.type) {
+ case 'TryStatement':
+ if (currentTryBlockEnd === null) {
+ currentTryBlockEnd = node.block.end;
+ }
+ return;
+ case 'AssignmentExpression':
+ if (node.left.type === 'MemberExpression') {
+ const flattened = getKeypath(node.left);
+ if (!flattened || scope.contains(flattened.name)) return;
- code = magicString.toString();
- const map = sourceMap ? magicString.generateMap() : null;
- return {
- code,
- map,
- syntheticNamedExports: injectExportBlock
- };
-}
+ const exportsPatternMatch = exportsPattern.exec(flattened.keypath);
+ if (!exportsPatternMatch || flattened.keypath === 'exports') return;
-function getDynamicRequirePaths(patterns) {
- const dynamicRequireModuleSet = new Set();
+ const [, exportName] = exportsPatternMatch;
+ uses[flattened.name] = true;
- var _iterator = _createForOfIteratorHelper(!patterns || Array.isArray(patterns) ? patterns || [] : [patterns]),
- _step;
+ // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
+ if (programDepth > 3) {
+ shouldWrap = true;
+ } else if (exportName === KEY_COMPILED_ESM) {
+ defineCompiledEsmExpressions.push(parent);
+ } else if (flattened.keypath === 'module.exports') {
+ topLevelModuleExportsAssignments.push(node);
+ } else if (!topLevelExportsAssignmentsByName.has(exportName)) {
+ topLevelExportsAssignmentsByName.set(exportName, node);
+ } else {
+ shouldWrap = true;
+ }
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const pattern = _step.value;
- const isNegated = pattern.startsWith('!');
- const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
+ skippedNodes.add(node.left);
- var _iterator2 = _createForOfIteratorHelper(glob.sync(isNegated ? pattern.substr(1) : pattern)),
- _step2;
+ if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
+ node.right.properties.forEach((prop) => {
+ if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
+ const { name } = prop.key;
+ if (name === makeLegalIdentifier(name)) namedExports[name] = true;
+ });
+ return;
+ }
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- const path = _step2.value;
- modifySet(normalizePathSlashes(resolve(path)));
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
+ if (exportsPatternMatch[1]) namedExports[exportsPatternMatch[1]] = true;
+ } else {
+ for (const name of extractAssignedNames(node.left)) {
+ reassignedNames.add(name);
+ }
+ }
+ return;
+ case 'CallExpression': {
+ if (isDefineCompiledEsm(node)) {
+ if (programDepth === 3 && parent.type === 'ExpressionStatement') {
+ // skip special handling for [module.]exports until we know we render this
+ skippedNodes.add(node.arguments[0]);
+ defineCompiledEsmExpressions.push(parent);
+ } else {
+ shouldWrap = true;
+ }
+ return;
+ }
- const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(path => {
- try {
- if (statSync(path).isDirectory()) return true;
- } catch (ignored) {// Nothing to do here
- }
+ if (
+ node.callee.object &&
+ node.callee.object.name === 'require' &&
+ node.callee.property.name === 'resolve' &&
+ hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)
+ ) {
+ const requireNode = node.callee.object;
+ magicString.appendLeft(
+ node.end - 1,
+ `,${JSON.stringify(
+ dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )}`
+ );
+ magicString.overwrite(
+ requireNode.start,
+ requireNode.end,
+ `${HELPERS_NAME}.commonjsRequire`,
+ {
+ storeName: true
+ }
+ );
+ uses.commonjsHelpers = true;
+ return;
+ }
- return false;
- });
- return {
- dynamicRequireModuleSet,
- dynamicRequireModuleDirPaths
- };
-}
+ if (!isStaticRequireStatement(node, scope)) return;
+ if (!isDynamicRequireModulesEnabled) {
+ skippedNodes.add(node.callee);
+ }
+ if (!isIgnoredRequireStatement(node, ignoreRequire)) {
+ skippedNodes.add(node.callee);
+ const usesReturnValue = parent.type !== 'ExpressionStatement';
-/* eslint-disable no-undefined */
-const isCjsPromises = new Map();
-function getIsCjsPromise(id) {
- let isCjsPromise = isCjsPromises.get(id);
- if (isCjsPromise) return isCjsPromise.promise;
- const promise = new Promise(resolve => {
- isCjsPromise = {
- resolve,
- promise: undefined
- };
- isCjsPromises.set(id, isCjsPromise);
- });
- isCjsPromise.promise = promise;
- return promise;
-}
-function setIsCjsPromise(id, resolution) {
- const isCjsPromise = isCjsPromises.get(id);
+ let canConvertRequire = true;
+ let shouldRemoveRequireStatement = false;
- if (isCjsPromise) {
- if (isCjsPromise.resolve) {
- isCjsPromise.resolve(resolution);
- isCjsPromise.resolve = undefined;
- }
- } else {
- isCjsPromises.set(id, {
- promise: Promise.resolve(resolution),
- resolve: undefined
- });
- }
-}
+ if (currentTryBlockEnd !== null) {
+ ({
+ canConvertRequire,
+ shouldRemoveRequireStatement
+ } = getIgnoreTryCatchRequireStatementMode(node.arguments[0].value));
-/* eslint-disable no-param-reassign, no-undefined */
+ if (shouldRemoveRequireStatement) {
+ hasRemovedRequire = true;
+ }
+ }
-function getCandidatesForExtension(resolved, extension) {
- return [resolved + extension, `${resolved}${sep}index${extension}`];
-}
+ let sourceId = getRequireStringArg(node);
+ const isDynamicRegister = isModuleRegisterProxy(sourceId);
+ if (isDynamicRegister) {
+ sourceId = unwrapModuleRegisterProxy(sourceId);
+ if (sourceId.endsWith('.json')) {
+ sourceId = DYNAMIC_JSON_PREFIX + sourceId;
+ }
+ dynamicRegisterSources.add(wrapModuleRegisterProxy(sourceId));
+ } else {
+ if (
+ !sourceId.endsWith('.json') &&
+ hasDynamicModuleForPath(sourceId, id, dynamicRequireModuleSet)
+ ) {
+ if (shouldRemoveRequireStatement) {
+ magicString.overwrite(node.start, node.end, `undefined`);
+ } else if (canConvertRequire) {
+ magicString.overwrite(
+ node.start,
+ node.end,
+ `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(sourceId, commonDir)
+ )}, ${JSON.stringify(
+ dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )})`
+ );
+ uses.commonjsHelpers = true;
+ }
+ return;
+ }
-function getCandidates(resolved, extensions) {
- return extensions.reduce((paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)), [resolved]);
-}
+ if (canConvertRequire) {
+ addRequireStatement(sourceId, node, scope, usesReturnValue);
+ }
+ }
-function getResolveId(extensions) {
- function resolveExtensions(importee, importer) {
- // not our problem
- if (importee[0] !== '.' || !importer) return undefined;
- const resolved = resolve(dirname(importer), importee);
- const candidates = getCandidates(resolved, extensions);
+ if (usesReturnValue) {
+ if (shouldRemoveRequireStatement) {
+ magicString.overwrite(node.start, node.end, `undefined`);
+ return;
+ }
- for (let i = 0; i < candidates.length; i += 1) {
- try {
- const stats = statSync(candidates[i]);
- if (stats.isFile()) return {
- id: candidates[i]
- };
- } catch (err) {
- /* noop */
- }
- }
+ if (
+ parent.type === 'VariableDeclarator' &&
+ !scope.parent &&
+ parent.id.type === 'Identifier'
+ ) {
+ // This will allow us to reuse this variable name as the imported variable if it is not reassigned
+ // and does not conflict with variables in other places where this is imported
+ topLevelRequireDeclarators.add(parent);
+ }
+ } else {
+ // This is a bare import, e.g. `require('foo');`
- return undefined;
- }
+ if (!canConvertRequire && !shouldRemoveRequireStatement) {
+ return;
+ }
- function resolveId(importee, importer) {
- const isProxyModule = importee.endsWith(PROXY_SUFFIX);
+ magicString.remove(parent.start, parent.end);
+ }
+ }
+ return;
+ }
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ // skip dead branches
+ if (isFalsy(node.test)) {
+ skippedNodes.add(node.consequent);
+ } else if (node.alternate && isTruthy(node.test)) {
+ skippedNodes.add(node.alternate);
+ }
+ return;
+ case 'Identifier': {
+ const { name } = node;
+ if (!(isReference(node, parent) && !scope.contains(name))) return;
+ switch (name) {
+ case 'require':
+ if (isNodeRequirePropertyAccess(parent)) {
+ if (hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)) {
+ if (parent.property.name === 'cache') {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ }
- if (isProxyModule) {
- importee = getIdFromProxyId(importee);
- } else if (importee.startsWith('\0')) {
- if (importee === HELPERS_ID || importee === DYNAMIC_PACKAGES_ID || importee.startsWith(DYNAMIC_JSON_PREFIX)) {
- return importee;
+ return;
+ }
+
+ if (isDynamicRequireModulesEnabled && isRequireStatement(parent, scope)) {
+ magicString.appendLeft(
+ parent.end - 1,
+ `,${JSON.stringify(
+ dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )}`
+ );
+ }
+ if (isShorthandProperty(parent)) {
+ magicString.appendRight(node.end, `: ${HELPERS_NAME}.commonjsRequire`);
+ } else {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ }
+
+ uses.commonjsHelpers = true;
+ return;
+ case 'module':
+ case 'exports':
+ shouldWrap = true;
+ uses[name] = true;
+ return;
+ case 'global':
+ uses.global = true;
+ if (!ignoreGlobal) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ return;
+ case 'define':
+ magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });
+ return;
+ default:
+ globals.add(name);
+ return;
+ }
+ }
+ case 'MemberExpression':
+ if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ skippedNodes.add(node.object);
+ skippedNodes.add(node.property);
+ }
+ return;
+ case 'ReturnStatement':
+ // if top-level return, we need to wrap it
+ if (lexicalDepth === 0) {
+ shouldWrap = true;
+ }
+ return;
+ case 'ThisExpression':
+ // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal`
+ if (lexicalDepth === 0) {
+ uses.global = true;
+ if (!ignoreGlobal) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ }
+ return;
+ case 'UnaryExpression':
+ // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
+ if (node.operator === 'typeof') {
+ const flattened = getKeypath(node.argument);
+ if (!flattened) return;
+
+ if (scope.contains(flattened.name)) return;
+
+ if (
+ flattened.keypath === 'module.exports' ||
+ flattened.keypath === 'module' ||
+ flattened.keypath === 'exports'
+ ) {
+ magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });
+ }
+ }
+ return;
+ case 'VariableDeclaration':
+ if (!scope.parent) {
+ topLevelDeclarations.push(node);
+ }
}
+ },
- return null;
+ leave(node) {
+ programDepth -= 1;
+ if (node.scope) scope = scope.parent;
+ if (functionType.test(node.type)) lexicalDepth -= 1;
}
+ });
- if (importee.startsWith(DYNAMIC_JSON_PREFIX)) {
- return importee;
+ let isRestorableCompiledEsm = false;
+ if (defineCompiledEsmExpressions.length > 0) {
+ if (!shouldWrap && defineCompiledEsmExpressions.length === 1) {
+ isRestorableCompiledEsm = true;
+ magicString.remove(
+ defineCompiledEsmExpressions[0].start,
+ defineCompiledEsmExpressions[0].end
+ );
+ } else {
+ shouldWrap = true;
+ uses.exports = true;
}
+ }
- if (importer && importer.endsWith(PROXY_SUFFIX)) {
- importer = getIdFromProxyId(importer);
- }
+ // We cannot wrap ES/mixed modules
+ shouldWrap = shouldWrap && !disableWrap && !isEsModule;
+ uses.commonjsHelpers = uses.commonjsHelpers || shouldWrap;
+
+ if (
+ !(
+ requiredSources.length ||
+ dynamicRegisterSources.size ||
+ uses.module ||
+ uses.exports ||
+ uses.require ||
+ uses.commonjsHelpers ||
+ hasRemovedRequire
+ ) &&
+ (ignoreGlobal || !uses.global)
+ ) {
+ return { meta: { commonjs: { isCommonJS: false } } };
+ }
- return this.resolve(importee, importer, {
- skipSelf: true
- }).then(resolved => {
- if (!resolved) {
- resolved = resolveExtensions(importee, importer);
- }
+ const moduleName = deconflict(scope, globals, getName(id));
- if (isProxyModule) {
- if (!resolved) {
- return {
- id: getExternalProxyId(importee),
- external: false
- };
- }
+ let leadingComment = '';
+ if (code.startsWith('/*')) {
+ const commentEnd = code.indexOf('*/', 2) + 2;
+ leadingComment = `${code.slice(0, commentEnd)}\n`;
+ magicString.remove(0, commentEnd).trim();
+ }
- resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);
- resolved.external = false;
- return resolved;
- }
+ const exportBlock = isEsModule
+ ? ''
+ : rewriteExportsAndGetExportsBlock(
+ magicString,
+ moduleName,
+ shouldWrap,
+ topLevelModuleExportsAssignments,
+ topLevelExportsAssignmentsByName,
+ defineCompiledEsmExpressions,
+ (name) => deconflict(scope, globals, name),
+ isRestorableCompiledEsm,
+ code,
+ uses,
+ HELPERS_NAME
+ );
+
+ const importBlock = rewriteRequireExpressionsAndGetImportBlock(
+ magicString,
+ topLevelDeclarations,
+ topLevelRequireDeclarators,
+ reassignedNames,
+ uses.commonjsHelpers && HELPERS_NAME,
+ dynamicRegisterSources
+ );
- return resolved;
- });
+ if (shouldWrap) {
+ wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath);
}
- return resolveId;
+ magicString
+ .trim()
+ .prepend(leadingComment + importBlock)
+ .append(exportBlock);
+
+ return {
+ code: magicString.toString(),
+ map: sourceMap ? magicString.generateMap() : null,
+ syntheticNamedExports: isEsModule ? false : '__moduleExports',
+ meta: { commonjs: { isCommonJS: !isEsModule } }
+ };
}
function commonjs(options = {}) {
const extensions = options.extensions || ['.js'];
const filter = createFilter(options.include, options.exclude);
- const ignoreGlobal = options.ignoreGlobal;
-
- const _getDynamicRequirePat = getDynamicRequirePaths(options.dynamicRequireTargets),
- dynamicRequireModuleSet = _getDynamicRequirePat.dynamicRequireModuleSet,
- dynamicRequireModuleDirPaths = _getDynamicRequirePat.dynamicRequireModuleDirPaths;
-
+ const {
+ ignoreGlobal,
+ requireReturnsDefault: requireReturnsDefaultOption,
+ esmExternals
+ } = options;
+ const getRequireReturnsDefault =
+ typeof requireReturnsDefaultOption === 'function'
+ ? requireReturnsDefaultOption
+ : () => requireReturnsDefaultOption;
+ let esmExternalIds;
+ const isEsmExternal =
+ typeof esmExternals === 'function'
+ ? esmExternals
+ : Array.isArray(esmExternals)
+ ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
+ : () => esmExternals;
+
+ const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(
+ options.dynamicRequireTargets
+ );
const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;
- const commonDir = isDynamicRequireModulesEnabled ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd())) : null;
- const esModulesWithoutDefaultExport = new Set();
+ const commonDir = isDynamicRequireModulesEnabled
+ ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))
+ : null;
+
const esModulesWithDefaultExport = new Set();
- const ignoreRequire = typeof options.ignore === 'function' ? options.ignore : Array.isArray(options.ignore) ? id => options.ignore.includes(id) : () => false;
+ const esModulesWithNamedExports = new Set();
+
+ const ignoreRequire =
+ typeof options.ignore === 'function'
+ ? options.ignore
+ : Array.isArray(options.ignore)
+ ? (id) => options.ignore.includes(id)
+ : () => false;
+
+ const getIgnoreTryCatchRequireStatementMode = (id) => {
+ const mode =
+ typeof options.ignoreTryCatch === 'function'
+ ? options.ignoreTryCatch(id)
+ : Array.isArray(options.ignoreTryCatch)
+ ? options.ignoreTryCatch.includes(id)
+ : options.ignoreTryCatch || false;
+
+ return {
+ canConvertRequire: mode !== 'remove' && mode !== true,
+ shouldRemoveRequireStatement: mode === 'remove'
+ };
+ };
+
const resolveId = getResolveId(extensions);
+
const sourceMap = options.sourceMap !== false;
function transformAndCheckExports(code, id) {
- const _checkEsModule = checkEsModule(this.parse, code, id),
- isEsModule = _checkEsModule.isEsModule,
- hasDefaultExport = _checkEsModule.hasDefaultExport,
- ast = _checkEsModule.ast;
-
- const isDynamicRequireModule = dynamicRequireModuleSet.has(normalizePathSlashes(id));
+ if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
+ code =
+ getDynamicPackagesEntryIntro(dynamicRequireModuleDirPaths, dynamicRequireModuleSet) + code;
+ }
- if (isEsModule && (!isDynamicRequireModule || !options.transformMixedEsModules)) {
- (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport).add(id);
+ const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(
+ this.parse,
+ code,
+ id
+ );
+ if (hasDefaultExport) {
+ esModulesWithDefaultExport.add(id);
+ }
+ if (hasNamedExports) {
+ esModulesWithNamedExports.add(id);
+ }
- if (!options.transformMixedEsModules) {
- setIsCjsPromise(id, false);
- return null;
- }
- } // it is not an ES module AND it does not have CJS-specific elements.
- else if (!hasCjsKeywords(code, ignoreGlobal)) {
- esModulesWithoutDefaultExport.add(id);
- setIsCjsPromise(id, false);
- return null;
- }
+ if (
+ !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&
+ (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))
+ ) {
+ return { meta: { commonjs: { isCommonJS: false } } };
+ }
- const moduleInfo = this.getModuleInfo(id);
- const transformed = transformCommonjs(this.parse, code, id, moduleInfo.isEntry, moduleInfo.importers && moduleInfo.importers.length > 0, isEsModule, ignoreGlobal || isEsModule, ignoreRequire, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModuleSet, commonDir, ast);
- setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));
+ let disableWrap = false;
- if (!transformed) {
- if (!isEsModule || isDynamicRequireModule) esModulesWithoutDefaultExport.add(id);
- return null;
+ // avoid wrapping in createCommonjsModule, as this is a commonjsRegister call
+ if (isModuleRegisterProxy(id)) {
+ disableWrap = true;
+ id = unwrapModuleRegisterProxy(id);
}
- return transformed;
+ return transformCommonjs(
+ this.parse,
+ code,
+ id,
+ isEsModule,
+ ignoreGlobal || isEsModule,
+ ignoreRequire,
+ getIgnoreTryCatchRequireStatementMode,
+ sourceMap,
+ isDynamicRequireModulesEnabled,
+ dynamicRequireModuleSet,
+ disableWrap,
+ commonDir,
+ ast
+ );
}
return {
name: 'commonjs',
buildStart() {
+ validateRollupVersion(this.meta.rollupVersion, peerDependencies.rollup);
if (options.namedExports != null) {
- this.warn('The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.');
- }
-
- const _this$meta$rollupVers = this.meta.rollupVersion.split('.').map(Number),
- _this$meta$rollupVers2 = _slicedToArray(_this$meta$rollupVers, 2),
- major = _this$meta$rollupVers2[0],
- minor = _this$meta$rollupVers2[1];
-
- const minVersion = peerDependencies.rollup.slice(2);
-
- const _minVersion$split$map = minVersion.split('.').map(Number),
- _minVersion$split$map2 = _slicedToArray(_minVersion$split$map, 2),
- minMajor = _minVersion$split$map2[0],
- minMinor = _minVersion$split$map2[1];
-
- if (major < minMajor || major === minMajor && minor < minMinor) {
- this.error(`Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`);
+ this.warn(
+ 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
+ );
}
},
@@ -1221,136 +1682,87 @@ function commonjs(options = {}) {
load(id) {
if (id === HELPERS_ID) {
- let code = HELPERS; // Do not bloat everyone's code with the module manager code
-
- if (isDynamicRequireModulesEnabled) code += HELPERS_DYNAMIC;else code += HELPER_NON_DYNAMIC;
- return code;
- } // generate proxy modules
-
-
- if (id.endsWith(EXTERNAL_SUFFIX)) {
- const actualId = getIdFromExternalProxyId(id);
- const name = getName(actualId);
- if (actualId === HELPERS_ID || actualId === DYNAMIC_PACKAGES_ID) // These do not export default
- return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;
- return `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;
+ return getHelpersModule(isDynamicRequireModulesEnabled);
}
- if (id === DYNAMIC_PACKAGES_ID) {
- let code = `const { commonjsRegister } = require('${HELPERS_ID}');`;
-
- var _iterator = _createForOfIteratorHelper(dynamicRequireModuleDirPaths),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const dir = _step.value;
- let entryPoint = 'index.js';
-
- try {
- if (existsSync(join(dir, 'package.json'))) {
- entryPoint = JSON.parse(readFileSync(join(dir, 'package.json'), {
- encoding: 'utf8'
- })).main || entryPoint;
- }
- } catch (ignored) {// ignored
- }
-
- code += `\ncommonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(dir, commonDir))}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});
-});`;
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
-
- return code;
+ if (id.startsWith(HELPERS_ID)) {
+ return getSpecificHelperProxy(id);
}
- let actualId = id;
- const isDynamicJson = actualId.startsWith(DYNAMIC_JSON_PREFIX);
-
- if (isDynamicJson) {
- actualId = actualId.slice(DYNAMIC_JSON_PREFIX.length);
+ if (isWrappedId(id, EXTERNAL_SUFFIX)) {
+ const actualId = unwrapId(id, EXTERNAL_SUFFIX);
+ return getUnknownRequireProxy(
+ actualId,
+ isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
+ );
}
- const normalizedPath = normalizePathSlashes(actualId);
-
- if (isDynamicJson) {
- return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizedPath, commonDir))}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizedPath)});
-});`;
+ if (id === DYNAMIC_PACKAGES_ID) {
+ return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);
}
- if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {
- // Try our best to still export the module fully.
- // The commonjs polyfill should take care of circular references.
- return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizedPath, commonDir))}, function (module, exports) {
- ${readFileSync(normalizedPath, {
- encoding: 'utf8'
- })}
-});`;
+ if (id.startsWith(DYNAMIC_JSON_PREFIX)) {
+ return getDynamicJsonProxy(id, commonDir);
}
- if (actualId.endsWith(PROXY_SUFFIX)) {
- actualId = getIdFromProxyId(actualId);
- const name = getName(actualId);
- return getIsCjsPromise(actualId).then(isCjs => {
- if (dynamicRequireModuleSet.has(normalizePathSlashes(actualId)) && !actualId.endsWith('.json')) return `import {commonjsRequire} from '${HELPERS_ID}'; const ${name} = commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(actualId), commonDir))}); export default (${name} && ${name}['default']) || ${name}`;else if (isCjs) return `import { __moduleExports } from ${JSON.stringify(actualId)}; export default __moduleExports;`;else if (esModulesWithoutDefaultExport.has(actualId)) return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;else if (esModulesWithDefaultExport.has(actualId)) {
- return `export {default} from ${JSON.stringify(actualId)};`;
- }
- return `import * as ${name} from ${JSON.stringify(actualId)}; import {getCjsExportFromNamespace} from "${HELPERS_ID}"; export default getCjsExportFromNamespace(${name})`;
- });
+ if (isDynamicModuleImport(id, dynamicRequireModuleSet)) {
+ return `export default require(${JSON.stringify(normalizePathSlashes(id))});`;
}
- if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
- let code;
-
- try {
- code = readFileSync(actualId, {
- encoding: 'utf8'
- });
- } catch (ex) {
- this.warn(`Failed to read file ${actualId}, dynamic modules might not work correctly`);
- return null;
- }
-
- let dynamicImports = Array.from(dynamicRequireModuleSet).map(dynamicId => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`).join('\n');
-
- if (dynamicRequireModuleDirPaths.length) {
- dynamicImports += `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID)});`;
- }
+ if (isModuleRegisterProxy(id)) {
+ return getDynamicRequireProxy(
+ normalizePathSlashes(unwrapModuleRegisterProxy(id)),
+ commonDir
+ );
+ }
- code = `${dynamicImports}\n${code}`;
- return code;
+ if (isWrappedId(id, PROXY_SUFFIX)) {
+ const actualId = unwrapId(id, PROXY_SUFFIX);
+ return getStaticRequireProxy(
+ actualId,
+ getRequireReturnsDefault(actualId),
+ esModulesWithDefaultExport,
+ esModulesWithNamedExports
+ );
}
return null;
},
- transform(code, id) {
- if (id !== DYNAMIC_PACKAGES_ID && !id.startsWith(DYNAMIC_JSON_PREFIX)) {
- if (!filter(id) || extensions.indexOf(extname(id)) === -1) {
- setIsCjsPromise(id, null);
- return null;
- }
+ transform(code, rawId) {
+ let id = rawId;
+
+ if (isModuleRegisterProxy(id)) {
+ id = unwrapModuleRegisterProxy(id);
}
- let transformed;
+ const extName = extname(id);
+ if (
+ extName !== '.cjs' &&
+ id !== DYNAMIC_PACKAGES_ID &&
+ !id.startsWith(DYNAMIC_JSON_PREFIX) &&
+ (!filter(id) || !extensions.includes(extName))
+ ) {
+ return null;
+ }
try {
- transformed = transformAndCheckExports.call(this, code, id);
+ return transformAndCheckExports.call(this, code, rawId);
} catch (err) {
- transformed = null;
- setIsCjsPromise(id, false);
- this.error(err, err.loc);
+ return this.error(err, err.loc);
}
+ },
- return transformed;
+ moduleParsed({ id, meta: { commonjs } }) {
+ if (commonjs) {
+ const isCjs = commonjs.isCommonJS;
+ if (isCjs != null) {
+ setIsCjsPromise(id, isCjs);
+ return;
+ }
+ }
+ setIsCjsPromise(id, null);
}
-
};
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js.map b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js.map
index 784ab3ed8e5..4133eb4d3aa 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js.map
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.es.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.es.js","sources":["../src/ast-utils.js","../src/helpers.js","../src/utils.js","../src/transform.js","../src/dynamic-require-paths.js","../src/is-cjs.js","../src/resolve-id.js","../src/index.js"],"sourcesContent":["/* eslint-disable no-undefined */\nexport { default as isReference } from 'is-reference';\n\nconst operators = {\n '==': (x) => equals(x.left, x.right, false),\n\n '!=': (x) => not(operators['=='](x)),\n\n '===': (x) => equals(x.left, x.right, true),\n\n '!==': (x) => not(operators['==='](x)),\n\n '!': (x) => isFalsy(x.argument),\n\n '&&': (x) => isTruthy(x.left) && isTruthy(x.right),\n\n '||': (x) => isTruthy(x.left) || isTruthy(x.right)\n};\n\nconst extractors = {\n Identifier(names, node) {\n names.push(node.name);\n },\n\n ObjectPattern(names, node) {\n node.properties.forEach((prop) => {\n getExtractor(prop.value.type)(names, prop.value);\n });\n },\n\n ArrayPattern(names, node) {\n node.elements.forEach((element) => {\n if (!element) return;\n getExtractor(element.type)(names, element);\n });\n },\n\n RestElement(names, node) {\n getExtractor(node.argument.type)(names, node.argument);\n },\n\n AssignmentPattern(names, node) {\n getExtractor(node.left.type)(names, node.left);\n }\n};\n\nexport function flatten(node) {\n const parts = [];\n\n while (node.type === 'MemberExpression') {\n if (node.computed) return null;\n\n parts.unshift(node.property.name);\n // eslint-disable-next-line no-param-reassign\n node = node.object;\n }\n\n if (node.type !== 'Identifier') return null;\n\n const { name } = node;\n parts.unshift(name);\n\n return { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n const names = [];\n extractors[node.type](names, node);\n return names;\n}\n\nfunction getExtractor(type) {\n const extractor = extractors[type];\n if (!extractor) throw new SyntaxError(`${type} pattern not supported.`);\n return extractor;\n}\n\nexport function isTruthy(node) {\n if (node.type === 'Literal') return !!node.value;\n if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n if (node.operator in operators) return operators[node.operator](node);\n return undefined;\n}\n\nexport function isFalsy(node) {\n return not(isTruthy(node));\n}\n\nfunction not(value) {\n return value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n if (a.type !== b.type) return undefined;\n // eslint-disable-next-line eqeqeq\n if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n return undefined;\n}\n","export const PROXY_SUFFIX = '?commonjs-proxy';\nexport const getProxyId = (id) => `\\0${id}${PROXY_SUFFIX}`;\nexport const getIdFromProxyId = (proxyId) => proxyId.slice(1, -PROXY_SUFFIX.length);\n\nexport const EXTERNAL_SUFFIX = '?commonjs-external';\nexport const getExternalProxyId = (id) => `\\0${id}${EXTERNAL_SUFFIX}`;\nexport const getIdFromExternalProxyId = (proxyId) => proxyId.slice(1, -EXTERNAL_SUFFIX.length);\n\nexport const VIRTUAL_PATH_BASE = '/$$rollup_base$$';\nexport const getVirtualPathForDynamicRequirePath = (path, commonDir) => {\n if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);\n return path;\n};\n\nexport const DYNAMIC_REGISTER_PREFIX = '\\0commonjs-dynamic-register:';\nexport const DYNAMIC_JSON_PREFIX = '\\0commonjs-dynamic-json:';\nexport const DYNAMIC_PACKAGES_ID = '\\0commonjs-dynamic-packages';\n\nexport const HELPERS_ID = '\\0commonjsHelpers.js';\n\n// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.\n// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.\nexport const HELPERS = `\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t path: basedir,\n\t exports: {},\n\t require: function (path, base) {\n return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n }\n\t}, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}\n`;\n\nexport const HELPER_NON_DYNAMIC = `\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n`;\n\nexport const HELPERS_DYNAMIC = `\nexport function commonjsRegister (path, loader) {\n\tDYNAMIC_REQUIRE_LOADERS[path] = loader;\n}\n\nconst DYNAMIC_REQUIRE_LOADERS = Object.create(null);\nconst DYNAMIC_REQUIRE_CACHE = Object.create(null);\nconst DEFAULT_PARENT_MODULE = {\n\tid: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []\n};\nconst CHECKED_EXTENSIONS = ['', '.js', '.json'];\n\nfunction normalize (path) {\n\tpath = path.replace(/\\\\\\\\/g, '/');\n\tconst parts = path.split('/');\n\tconst slashed = parts[0] === '';\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] === '.' || parts[i] === '') {\n\t\t\tparts.splice(i--, 1);\n\t\t}\n\t}\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] !== '..') continue;\n\t\tif (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {\n\t\t\tparts.splice(--i, 2);\n\t\t\ti--;\n\t\t}\n\t}\n\tpath = parts.join('/');\n\tif (slashed && path[0] !== '/')\n\t path = '/' + path;\n\telse if (path.length === 0)\n\t path = '.';\n\treturn path;\n}\n\nfunction join () {\n\tif (arguments.length === 0)\n\t return '.';\n\tlet joined;\n\tfor (let i = 0; i < arguments.length; ++i) {\n\t let arg = arguments[i];\n\t if (arg.length > 0) {\n\t\tif (joined === undefined)\n\t\t joined = arg;\n\t\telse\n\t\t joined += '/' + arg;\n\t }\n\t}\n\tif (joined === undefined)\n\t return '.';\n\n\treturn joined;\n}\n\nfunction isPossibleNodeModulesPath (modulePath) {\n\tlet c0 = modulePath[0];\n\tif (c0 === '/' || c0 === '\\\\\\\\') return false;\n\tlet c1 = modulePath[1], c2 = modulePath[2];\n\tif ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\\\\\')) ||\n\t\t(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\\\\\'))) return false;\n\tif (c1 === ':' && (c2 === '/' || c2 === '\\\\\\\\'))\n\t\treturn false;\n\treturn true;\n}\n\nfunction dirname (path) {\n if (path.length === 0)\n return '.';\n\n let i = path.length - 1;\n while (i > 0) {\n const c = path.charCodeAt(i);\n if ((c === 47 || c === 92) && i !== path.length - 1)\n break;\n i--;\n }\n\n if (i > 0)\n return path.substr(0, i);\n\n if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)\n return path.charAt(0);\n\n return '.';\n}\n\nexport function commonjsRequire (path, originalModuleDir) {\n\tconst shouldTryNodeModules = isPossibleNodeModulesPath(path);\n\tpath = normalize(path);\n\tlet relPath;\n\twhile (true) {\n\t\tif (!shouldTryNodeModules) {\n\t\t\trelPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;\n\t\t} else if (originalModuleDir) {\n\t\t\trelPath = normalize(originalModuleDir + '/node_modules/' + path);\n\t\t} else {\n\t\t\trelPath = normalize(join('node_modules', path));\n\t\t}\n\t\tfor (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {\n\t\t\tconst resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];\n\t\t\tlet cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\tif (cachedModule) return cachedModule.exports;\n\t\t\tconst loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];\n\t\t\tif (loader) {\n\t\t\t\tDYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {\n\t\t\t\t\tid: resolvedPath,\n\t\t\t\t\tfilename: resolvedPath,\n\t\t\t\t\tpath: dirname(resolvedPath),\n\t\t\t\t\texports: {},\n\t\t\t\t\tparent: DEFAULT_PARENT_MODULE,\n\t\t\t\t\tloaded: false,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\tpaths: [],\n\t\t\t\t\trequire: function (path, base) {\n\t\t\t\t\t return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tloader.call(commonjsGlobal, cachedModule, cachedModule.exports);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tdelete DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tcachedModule.loaded = true;\n\t\t\t\treturn cachedModule.exports;\n\t\t\t};\n\t\t}\n\t\tif (!shouldTryNodeModules) break;\n\t\tconst nextDir = normalize(originalModuleDir + '/..');\n\t\tif (nextDir === originalModuleDir) break;\n\t\toriginalModuleDir = nextDir;\n\t}\n\treturn require(path);\n}\n\ncommonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;\n`;\n","/* eslint-disable import/prefer-default-export */\nimport { basename, dirname, extname, sep } from 'path';\n\nimport { makeLegalIdentifier } from '@rollup/pluginutils';\n\nexport function getName(id) {\n const name = makeLegalIdentifier(basename(id, extname(id)));\n if (name !== 'index') {\n return name;\n }\n const segments = dirname(id).split(sep);\n return makeLegalIdentifier(segments[segments.length - 1]);\n}\n","/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */\nimport { resolve, dirname } from 'path';\n\nimport { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, extractAssignedNames, makeLegalIdentifier } from '@rollup/pluginutils';\n\nimport { sync as nodeResolveSync } from 'resolve';\n\nimport { flatten, isFalsy, isReference, isTruthy } from './ast-utils';\nimport {\n getProxyId,\n getVirtualPathForDynamicRequirePath,\n HELPERS_ID,\n DYNAMIC_REGISTER_PREFIX,\n DYNAMIC_JSON_PREFIX\n} from './helpers';\nimport { getName } from './utils';\n// TODO can this be async?\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n ' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach((word) => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n let i = 1;\n let deconflicted = makeLegalIdentifier(identifier);\n\n while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {\n deconflicted = `${identifier}_${i}`;\n i += 1;\n }\n scope.declarations[deconflicted] = true;\n\n return deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n try {\n return parse(code, { allowReturnOutsideFunction: true });\n } catch (err) {\n err.message += ` in ${id}`;\n throw err;\n }\n}\n\nexport function normalizePathSlashes(path) {\n return path.replace(/\\\\/g, '/');\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n return firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n const ast = tryParse(parse, code, id);\n\n let isEsModule = false;\n for (const node of ast.body) {\n if (node.type === 'ExportDefaultDeclaration')\n return { isEsModule: true, hasDefaultExport: true, ast };\n if (node.type === 'ExportNamedDeclaration') {\n isEsModule = true;\n for (const specifier of node.specifiers) {\n if (specifier.exported.name === 'default') {\n return { isEsModule: true, hasDefaultExport: true, ast };\n }\n }\n } else if (importExportDeclaration.test(node.type)) isEsModule = true;\n }\n\n return { isEsModule, hasDefaultExport: false, ast };\n}\n\nfunction getDefinePropertyCallName(node, targetName) {\n if (node.type !== 'CallExpression') return;\n\n const {\n callee: { object, property }\n } = node;\n\n if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;\n\n if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;\n\n if (node.arguments.length !== 3) return;\n\n const [target, val] = node.arguments;\n if (target.type !== 'Identifier' || target.name !== targetName) return;\n // eslint-disable-next-line consistent-return\n return val.value;\n}\n\nexport function transformCommonjs(\n parse,\n code,\n id,\n isEntry,\n hasImporters,\n isEsModule,\n ignoreGlobal,\n ignoreRequire,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n commonDir,\n astCache\n) {\n const ast = astCache || tryParse(parse, code, id);\n\n const magicString = new MagicString(code);\n\n const required = {};\n // Because objects have no guaranteed ordering, yet we need it,\n // we need to keep track of the order in a array\n const sources = [];\n\n let uid = 0;\n\n let scope = attachScopes(ast, 'scope');\n const uses = { module: false, exports: false, global: false, require: false };\n\n let lexicalDepth = 0;\n let programDepth = 0;\n\n const globals = new Set();\n\n // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');\n\n const namedExports = {};\n\n // TODO handle transpiled modules\n let shouldWrap = /__esModule/.test(code);\n let usesCommonjsHelpers = false;\n\n function isRequireStatement(node) {\n if (!node) return false;\n if (node.type !== 'CallExpression') return false;\n\n // Weird case of `require()` or `module.require()` without arguments\n if (node.arguments.length === 0) return false;\n\n return isRequireIdentifier(node.callee);\n }\n\n function isRequireIdentifier(node) {\n if (!node) return false;\n\n if (node.type === 'Identifier' && node.name === 'require' /* `require` */) {\n // `require` is hidden by a variable in local scope\n if (scope.contains('require')) return false;\n\n return true;\n } else if (node.type === 'MemberExpression' /* `[something].[something]` */) {\n // `module.[something]`\n if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false;\n\n // `module` is hidden by a variable in local scope\n if (scope.contains('module')) return false;\n\n // `module.require(...)`\n if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;\n\n return true;\n }\n\n return false;\n }\n\n function hasDynamicArguments(node) {\n return (\n node.arguments.length > 1 ||\n (node.arguments[0].type !== 'Literal' &&\n (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n );\n }\n\n function isStaticRequireStatement(node) {\n if (!isRequireStatement(node)) return false;\n if (hasDynamicArguments(node)) return false;\n return true;\n }\n\n function isIgnoredRequireStatement(requiredNode) {\n return ignoreRequire(requiredNode.arguments[0].value);\n }\n\n function getRequireStringArg(node) {\n return node.arguments[0].type === 'Literal'\n ? node.arguments[0].value\n : node.arguments[0].quasis[0].value.cooked;\n }\n\n function getRequired(node, name) {\n let sourceId = getRequireStringArg(node);\n const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);\n if (isDynamicRegister) {\n sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);\n }\n\n const existing = required[sourceId];\n // eslint-disable-next-line no-undefined\n if (existing === undefined) {\n const isDynamic = hasDynamicModuleForPath(sourceId);\n\n if (!name) {\n do {\n name = `require$$${uid}`;\n uid += 1;\n } while (scope.contains(name));\n }\n\n if (isDynamicRegister && sourceId.endsWith('.json')) {\n sourceId = DYNAMIC_JSON_PREFIX + sourceId;\n }\n\n if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {\n sources.push([sourceId, !isDynamicRegister]);\n }\n\n required[sourceId] = { source: sourceId, name, importsDefault: false, isDynamic };\n }\n\n return required[sourceId];\n }\n\n function hasDynamicModuleForPath(source) {\n if (!/[/\\\\]/.test(source)) {\n try {\n const resolvedPath = normalizePathSlashes(\n nodeResolveSync(source, { basedir: dirname(id) })\n );\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n } catch (ex) {\n // Probably a node.js internal module\n return false;\n }\n\n return false;\n }\n\n for (const attemptExt of ['', '.js', '.json']) {\n const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n }\n\n return false;\n }\n\n function shouldUseSimulatedRequire(required) {\n return (\n hasDynamicModuleForPath(required.source) &&\n // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.\n (required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'))\n );\n }\n\n // do a first pass, see which names are assigned to. This is necessary to prevent\n // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n const assignedTo = new Set();\n walk(ast, {\n enter(node) {\n if (node.type !== 'AssignmentExpression') return;\n if (node.left.type === 'MemberExpression') return;\n\n extractAssignedNames(node.left).forEach((name) => {\n assignedTo.add(name);\n });\n }\n });\n\n walk(ast, {\n enter(node, parent) {\n if (sourceMap) {\n magicString.addSourcemapLocation(node.start);\n magicString.addSourcemapLocation(node.end);\n }\n\n // skip dead branches\n if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n if (node === parent.consequent && isFalsy(parent.test)) {\n this.skip();\n return;\n }\n if (node === parent.alternate && isTruthy(parent.test)) {\n this.skip();\n return;\n }\n }\n\n if (node._skip) {\n this.skip();\n return;\n }\n\n programDepth += 1;\n\n if (node.scope) ({ scope } = node);\n if (functionType.test(node.type)) lexicalDepth += 1;\n\n // if toplevel return, we need to wrap it\n if (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n shouldWrap = true;\n }\n\n // rewrite `this` as `commonjsHelpers.commonjsGlobal`\n if (node.type === 'ThisExpression' && lexicalDepth === 0) {\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n return;\n }\n\n // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n if (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n const flattened = flatten(node.argument);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n if (\n flattened.keypath === 'module.exports' ||\n flattened.keypath === 'module' ||\n flattened.keypath === 'exports'\n ) {\n magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n }\n }\n\n // rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n if (node.type === 'Identifier') {\n if (isReference(node, parent) && !scope.contains(node.name)) {\n if (node.name in uses) {\n if (isRequireIdentifier(node)) {\n if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {\n return;\n }\n\n if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {\n magicString.appendLeft(\n parent.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.'\n ? null /* default behavior */\n : getVirtualPathForDynamicRequirePath(\n normalizePathSlashes(dirname(id)),\n commonDir\n )\n )}`\n );\n }\n\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n\n uses[node.name] = true;\n if (node.name === 'global' && !ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n\n // if module or exports are used outside the context of an assignment\n // expression, we need to wrap the module\n if (node.name === 'module' || node.name === 'exports') {\n shouldWrap = true;\n }\n }\n\n if (node.name === 'define') {\n magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n }\n\n globals.add(node.name);\n }\n\n return;\n }\n\n // Is this an assignment to exports or module.exports?\n if (node.type === 'AssignmentExpression') {\n if (node.left.type !== 'MemberExpression') return;\n\n const flattened = flatten(node.left);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n const match = exportsPattern.exec(flattened.keypath);\n if (!match || flattened.keypath === 'exports') return;\n\n uses[flattened.name] = true;\n\n // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n // if this isn't top-level, we'll need to wrap the module\n if (programDepth > 3) shouldWrap = true;\n\n node.left._skip = true;\n\n if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n node.right.properties.forEach((prop) => {\n if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;\n const { name } = prop.key;\n if (name === makeLegalIdentifier(name)) namedExports[name] = true;\n });\n return;\n }\n\n if (match[1]) namedExports[match[1]] = true;\n return;\n }\n\n const name = getDefinePropertyCallName(node, 'exports');\n if (name && name === makeLegalIdentifier(name)) namedExports[name] = true;\n\n // if this is `var x = require('x')`, we can do `import x from 'x'`\n if (\n node.type === 'VariableDeclarator' &&\n node.id.type === 'Identifier' &&\n isStaticRequireStatement(node.init) &&\n !isIgnoredRequireStatement(node.init)\n ) {\n // for now, only do this for top-level requires. maybe fix this in future\n if (scope.parent) return;\n\n // edge case — CJS allows you to assign to imports. ES doesn't\n if (assignedTo.has(node.id.name)) return;\n\n const required = getRequired(node.init, node.id.name);\n required.importsDefault = true;\n\n if (required.name === node.id.name && !required.isDynamic) {\n node._shouldRemove = true;\n }\n }\n\n if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {\n return;\n }\n\n const required = getRequired(node);\n\n if (parent.type === 'ExpressionStatement') {\n // is a bare import, e.g. `require('foo');`\n magicString.remove(parent.start, parent.end);\n } else {\n required.importsDefault = true;\n\n if (shouldUseSimulatedRequire(required)) {\n magicString.overwrite(\n node.start,\n node.end,\n `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir)\n )}, ${JSON.stringify(\n dirname(id) === '.'\n ? null /* default behavior */\n : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)\n )})`\n );\n usesCommonjsHelpers = true;\n } else {\n magicString.overwrite(node.start, node.end, required.name);\n }\n }\n\n node.callee._skip = true;\n },\n\n leave(node) {\n programDepth -= 1;\n if (node.scope) scope = scope.parent;\n if (functionType.test(node.type)) lexicalDepth -= 1;\n\n if (node.type === 'VariableDeclaration') {\n let keepDeclaration = false;\n let c = node.declarations[0].start;\n\n for (let i = 0; i < node.declarations.length; i += 1) {\n const declarator = node.declarations[i];\n\n if (declarator._shouldRemove) {\n magicString.remove(c, declarator.end);\n } else {\n if (!keepDeclaration) {\n magicString.remove(c, declarator.start);\n keepDeclaration = true;\n }\n\n c = declarator.end;\n }\n }\n\n if (!keepDeclaration) {\n magicString.remove(node.start, node.end);\n }\n }\n }\n });\n\n if (\n !sources.length &&\n !uses.module &&\n !uses.exports &&\n !uses.require &&\n (ignoreGlobal || !uses.global)\n ) {\n // not a CommonJS module\n return null;\n }\n\n // If `isEsModule` is on, it means it has ES6 import/export statements,\n // which just can't be wrapped in a function.\n if (isEsModule) shouldWrap = false;\n\n usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;\n\n const importBlock = `${(usesCommonjsHelpers\n ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`]\n : []\n )\n .concat(\n sources.map(\n ([source]) =>\n // import the actual module before the proxy, so that we know\n // what kind of proxy to build\n `import '${source}';`\n ),\n sources\n .filter(([, importProxy]) => importProxy)\n .map(([source]) => {\n const { name, importsDefault } = required[source];\n return `import ${importsDefault ? `${name} from ` : ``}'${getProxyId(source)}';`;\n })\n )\n .join('\\n')}\\n\\n`;\n\n const namedExportDeclarations = [];\n let wrapperStart = '';\n let wrapperEnd = '';\n\n const moduleName = deconflict(scope, globals, getName(id));\n if ((!isEntry || hasImporters) && !isEsModule) {\n const exportModuleExports = {\n str: `export { ${moduleName} as __moduleExports };`,\n name: '__moduleExports'\n };\n\n namedExportDeclarations.push(exportModuleExports);\n }\n\n const defaultExportPropertyAssignments = [];\n let hasDefaultExport = false;\n\n if (shouldWrap) {\n const args = `module${uses.exports ? ', exports' : ''}`;\n\n wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\n wrapperEnd = `\\n}`;\n if (isDynamicRequireModulesEnabled) {\n wrapperEnd += `, ${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)\n )}`;\n }\n\n wrapperEnd += `);`;\n } else {\n const names = [];\n\n for (const node of ast.body) {\n if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n const { left } = node.expression;\n const flattened = flatten(left);\n\n if (!flattened) {\n continue;\n }\n\n const match = exportsPattern.exec(flattened.keypath);\n if (!match) {\n continue;\n }\n\n if (flattened.keypath === 'module.exports') {\n hasDefaultExport = true;\n magicString.overwrite(left.start, left.end, `var ${moduleName}`);\n } else {\n const [, name] = match;\n const deconflicted = deconflict(scope, globals, name);\n\n names.push({ name, deconflicted });\n\n magicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n const declaration =\n name === deconflicted\n ? `export { ${name} };`\n : `export { ${deconflicted} as ${name} };`;\n\n if (name !== 'default') {\n namedExportDeclarations.push({\n str: declaration,\n name\n });\n }\n\n defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n }\n }\n }\n\n if (!hasDefaultExport && (names.length || ((!isEntry || hasImporters) && !isEsModule))) {\n wrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n .map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n .join(',\\n')}\\n};`;\n }\n }\n\n const defaultExport = /__esModule/.test(code)\n ? `export default /*@__PURE__*/${HELPERS_NAME}.unwrapExports(${moduleName});`\n : `export default ${moduleName};`;\n\n const named = namedExportDeclarations\n .filter((x) => x.name !== 'default' || !hasDefaultExport)\n .map((x) => x.str);\n\n const exportBlock = `\\n\\n${(isEsModule ? [] : [defaultExport])\n .concat(named)\n .concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n .join('\\n')}`;\n\n magicString\n .trim()\n .prepend(importBlock + wrapperStart)\n .trim()\n .append(wrapperEnd);\n\n const injectExportBlock =\n hasDefaultExport || named.length > 0 || shouldWrap || !isEntry || hasImporters;\n if (injectExportBlock) {\n magicString.append(exportBlock);\n }\n\n code = magicString.toString();\n const map = sourceMap ? magicString.generateMap() : null;\n\n return { code, map, syntheticNamedExports: injectExportBlock };\n}\n","import { statSync } from 'fs';\n\nimport { resolve } from 'path';\n\nimport glob from 'glob';\n\nimport { normalizePathSlashes } from './transform';\n\nexport default function getDynamicRequirePaths(patterns) {\n const dynamicRequireModuleSet = new Set();\n for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {\n const isNegated = pattern.startsWith('!');\n const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);\n for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {\n modifySet(normalizePathSlashes(resolve(path)));\n }\n }\n const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(\n (path) => {\n try {\n if (statSync(path).isDirectory()) return true;\n } catch (ignored) {\n // Nothing to do here\n }\n return false;\n }\n );\n return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };\n}\n","/* eslint-disable no-undefined */\nconst isCjsPromises = new Map();\n\nexport function getIsCjsPromise(id) {\n let isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) return isCjsPromise.promise;\n\n const promise = new Promise((resolve) => {\n isCjsPromise = {\n resolve,\n promise: undefined\n };\n isCjsPromises.set(id, isCjsPromise);\n });\n isCjsPromise.promise = promise;\n\n return promise;\n}\n\nexport function setIsCjsPromise(id, resolution) {\n const isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) {\n if (isCjsPromise.resolve) {\n isCjsPromise.resolve(resolution);\n isCjsPromise.resolve = undefined;\n }\n } else {\n isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });\n }\n}\n","/* eslint-disable no-param-reassign, no-undefined */\nimport { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n getExternalProxyId,\n getIdFromProxyId,\n getProxyId,\n HELPERS_ID,\n PROXY_SUFFIX\n} from './helpers';\n\nfunction getCandidatesForExtension(resolved, extension) {\n return [resolved + extension, `${resolved}${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n return extensions.reduce(\n (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n [resolved]\n );\n}\n\nexport default function getResolveId(extensions) {\n function resolveExtensions(importee, importer) {\n // not our problem\n if (importee[0] !== '.' || !importer) return undefined;\n\n const resolved = resolve(dirname(importer), importee);\n const candidates = getCandidates(resolved, extensions);\n\n for (let i = 0; i < candidates.length; i += 1) {\n try {\n const stats = statSync(candidates[i]);\n if (stats.isFile()) return { id: candidates[i] };\n } catch (err) {\n /* noop */\n }\n }\n\n return undefined;\n }\n\n function resolveId(importee, importer) {\n const isProxyModule = importee.endsWith(PROXY_SUFFIX);\n if (isProxyModule) {\n importee = getIdFromProxyId(importee);\n } else if (importee.startsWith('\\0')) {\n if (\n importee === HELPERS_ID ||\n importee === DYNAMIC_PACKAGES_ID ||\n importee.startsWith(DYNAMIC_JSON_PREFIX)\n ) {\n return importee;\n }\n return null;\n }\n\n if (importee.startsWith(DYNAMIC_JSON_PREFIX)) {\n return importee;\n }\n\n if (importer && importer.endsWith(PROXY_SUFFIX)) {\n importer = getIdFromProxyId(importer);\n }\n\n return this.resolve(importee, importer, { skipSelf: true }).then((resolved) => {\n if (!resolved) {\n resolved = resolveExtensions(importee, importer);\n }\n if (isProxyModule) {\n if (!resolved) {\n return { id: getExternalProxyId(importee), external: false };\n }\n resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);\n resolved.external = false;\n return resolved;\n }\n return resolved;\n });\n }\n\n return resolveId;\n}\n","import { existsSync, readFileSync } from 'fs';\nimport { extname, join } from 'path';\n\nimport { createFilter } from '@rollup/pluginutils';\n\nimport getCommonDir from 'commondir';\n\nimport { peerDependencies } from '../package.json';\n\nimport getDynamicRequirePaths from './dynamic-require-paths';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n DYNAMIC_REGISTER_PREFIX,\n getVirtualPathForDynamicRequirePath,\n EXTERNAL_SUFFIX,\n getIdFromExternalProxyId,\n getIdFromProxyId,\n HELPERS,\n HELPERS_ID,\n HELPER_NON_DYNAMIC,\n HELPERS_DYNAMIC,\n PROXY_SUFFIX\n} from './helpers';\n\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport getResolveId from './resolve-id';\nimport {\n checkEsModule,\n normalizePathSlashes,\n hasCjsKeywords,\n transformCommonjs\n} from './transform';\nimport { getName } from './utils';\n\nexport default function commonjs(options = {}) {\n const extensions = options.extensions || ['.js'];\n const filter = createFilter(options.include, options.exclude);\n const { ignoreGlobal } = options;\n\n const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(\n options.dynamicRequireTargets\n );\n const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;\n const commonDir = isDynamicRequireModulesEnabled\n ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))\n : null;\n\n const esModulesWithoutDefaultExport = new Set();\n const esModulesWithDefaultExport = new Set();\n\n const ignoreRequire =\n typeof options.ignore === 'function'\n ? options.ignore\n : Array.isArray(options.ignore)\n ? (id) => options.ignore.includes(id)\n : () => false;\n\n const resolveId = getResolveId(extensions);\n\n const sourceMap = options.sourceMap !== false;\n\n function transformAndCheckExports(code, id) {\n const { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\n const isDynamicRequireModule = dynamicRequireModuleSet.has(normalizePathSlashes(id));\n\n if (isEsModule && (!isDynamicRequireModule || !options.transformMixedEsModules)) {\n (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport).add(id);\n if (!options.transformMixedEsModules) {\n setIsCjsPromise(id, false);\n return null;\n }\n }\n // it is not an ES module AND it does not have CJS-specific elements.\n else if (!hasCjsKeywords(code, ignoreGlobal)) {\n esModulesWithoutDefaultExport.add(id);\n setIsCjsPromise(id, false);\n return null;\n }\n\n const moduleInfo = this.getModuleInfo(id);\n\n const transformed = transformCommonjs(\n this.parse,\n code,\n id,\n moduleInfo.isEntry,\n moduleInfo.importers && moduleInfo.importers.length > 0,\n isEsModule,\n ignoreGlobal || isEsModule,\n ignoreRequire,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n commonDir,\n ast\n );\n\n setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));\n\n if (!transformed) {\n if (!isEsModule || isDynamicRequireModule) esModulesWithoutDefaultExport.add(id);\n return null;\n }\n\n return transformed;\n }\n\n return {\n name: 'commonjs',\n\n buildStart() {\n if (options.namedExports != null) {\n this.warn(\n 'The namedExports option from \"@rollup/plugin-commonjs\" is deprecated. Named exports are now handled automatically.'\n );\n }\n\n const [major, minor] = this.meta.rollupVersion.split('.').map(Number);\n const minVersion = peerDependencies.rollup.slice(2);\n const [minMajor, minMinor] = minVersion.split('.').map(Number);\n if (major < minMajor || (major === minMajor && minor < minMinor)) {\n this.error(\n `Insufficient Rollup version: \"@rollup/plugin-commonjs\" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`\n );\n }\n },\n\n resolveId,\n\n load(id) {\n if (id === HELPERS_ID) {\n let code = HELPERS;\n\n // Do not bloat everyone's code with the module manager code\n if (isDynamicRequireModulesEnabled) code += HELPERS_DYNAMIC;\n else code += HELPER_NON_DYNAMIC;\n\n return code;\n }\n\n // generate proxy modules\n if (id.endsWith(EXTERNAL_SUFFIX)) {\n const actualId = getIdFromExternalProxyId(id);\n const name = getName(actualId);\n\n if (actualId === HELPERS_ID || actualId === DYNAMIC_PACKAGES_ID)\n // These do not export default\n return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\n return `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n }\n\n if (id === DYNAMIC_PACKAGES_ID) {\n let code = `const { commonjsRegister } = require('${HELPERS_ID}');`;\n for (const dir of dynamicRequireModuleDirPaths) {\n let entryPoint = 'index.js';\n\n try {\n if (existsSync(join(dir, 'package.json'))) {\n entryPoint =\n JSON.parse(readFileSync(join(dir, 'package.json'), { encoding: 'utf8' })).main ||\n entryPoint;\n }\n } catch (ignored) {\n // ignored\n }\n\n code += `\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(dir, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});\n});`;\n }\n return code;\n }\n\n let actualId = id;\n\n const isDynamicJson = actualId.startsWith(DYNAMIC_JSON_PREFIX);\n if (isDynamicJson) {\n actualId = actualId.slice(DYNAMIC_JSON_PREFIX.length);\n }\n\n const normalizedPath = normalizePathSlashes(actualId);\n\n if (isDynamicJson) {\n return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizedPath)});\n});`;\n }\n\n if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {\n // Try our best to still export the module fully.\n // The commonjs polyfill should take care of circular references.\n\n return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n ${readFileSync(normalizedPath, { encoding: 'utf8' })}\n});`;\n }\n\n if (actualId.endsWith(PROXY_SUFFIX)) {\n actualId = getIdFromProxyId(actualId);\n const name = getName(actualId);\n\n return getIsCjsPromise(actualId).then((isCjs) => {\n if (\n dynamicRequireModuleSet.has(normalizePathSlashes(actualId)) &&\n !actualId.endsWith('.json')\n )\n return `import {commonjsRequire} from '${HELPERS_ID}'; const ${name} = commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(actualId), commonDir)\n )}); export default (${name} && ${name}['default']) || ${name}`;\n else if (isCjs)\n return `import { __moduleExports } from ${JSON.stringify(\n actualId\n )}; export default __moduleExports;`;\n else if (esModulesWithoutDefaultExport.has(actualId))\n return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n else if (esModulesWithDefaultExport.has(actualId)) {\n return `export {default} from ${JSON.stringify(actualId)};`;\n }\n return `import * as ${name} from ${JSON.stringify(\n actualId\n )}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n });\n }\n\n if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {\n let code;\n\n try {\n code = readFileSync(actualId, { encoding: 'utf8' });\n } catch (ex) {\n this.warn(`Failed to read file ${actualId}, dynamic modules might not work correctly`);\n return null;\n }\n\n let dynamicImports = Array.from(dynamicRequireModuleSet)\n .map((dynamicId) => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`)\n .join('\\n');\n\n if (dynamicRequireModuleDirPaths.length) {\n dynamicImports += `require(${JSON.stringify(\n DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID\n )});`;\n }\n\n code = `${dynamicImports}\\n${code}`;\n\n return code;\n }\n\n return null;\n },\n\n transform(code, id) {\n if (id !== DYNAMIC_PACKAGES_ID && !id.startsWith(DYNAMIC_JSON_PREFIX)) {\n if (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n setIsCjsPromise(id, null);\n return null;\n }\n }\n\n let transformed;\n try {\n transformed = transformAndCheckExports.call(this, code, id);\n } catch (err) {\n transformed = null;\n setIsCjsPromise(id, false);\n this.error(err, err.loc);\n }\n\n return transformed;\n }\n };\n}\n"],"names":["operators","x","equals","left","right","not","isFalsy","argument","isTruthy","flatten","node","parts","type","computed","unshift","property","name","object","keypath","join","value","expression","operator","undefined","a","b","strict","PROXY_SUFFIX","getProxyId","id","getIdFromProxyId","proxyId","slice","length","EXTERNAL_SUFFIX","getExternalProxyId","getIdFromExternalProxyId","VIRTUAL_PATH_BASE","getVirtualPathForDynamicRequirePath","path","commonDir","startsWith","DYNAMIC_REGISTER_PREFIX","DYNAMIC_JSON_PREFIX","DYNAMIC_PACKAGES_ID","HELPERS_ID","HELPERS","HELPER_NON_DYNAMIC","HELPERS_DYNAMIC","getName","makeLegalIdentifier","basename","extname","segments","dirname","split","sep","reserved","blacklist","__esModule","forEach","word","exportsPattern","firstpassGlobal","firstpassNoGlobal","importExportDeclaration","functionType","deconflict","scope","globals","identifier","i","deconflicted","contains","has","declarations","tryParse","parse","code","allowReturnOutsideFunction","err","message","normalizePathSlashes","replace","hasCjsKeywords","ignoreGlobal","firstpass","test","checkEsModule","ast","isEsModule","body","hasDefaultExport","specifiers","specifier","exported","getDefinePropertyCallName","targetName","callee","arguments","target","val","transformCommonjs","isEntry","hasImporters","ignoreRequire","sourceMap","isDynamicRequireModulesEnabled","dynamicRequireModuleSet","astCache","magicString","MagicString","required","sources","uid","attachScopes","uses","module","exports","global","require","lexicalDepth","programDepth","Set","HELPERS_NAME","namedExports","shouldWrap","usesCommonjsHelpers","isRequireStatement","isRequireIdentifier","hasDynamicArguments","expressions","isStaticRequireStatement","isIgnoredRequireStatement","requiredNode","getRequireStringArg","quasis","cooked","getRequired","sourceId","isDynamicRegister","substr","existing","isDynamic","hasDynamicModuleForPath","endsWith","push","source","importsDefault","resolvedPath","nodeResolveSync","basedir","ex","attemptExt","resolve","shouldUseSimulatedRequire","assignedTo","walk","enter","extractAssignedNames","add","parent","addSourcemapLocation","start","end","consequent","skip","alternate","_skip","overwrite","storeName","flattened","isReference","appendLeft","JSON","stringify","match","exec","properties","prop","key","init","_shouldRemove","remove","leave","keepDeclaration","c","declarator","importBlock","concat","map","filter","importProxy","namedExportDeclarations","wrapperStart","wrapperEnd","moduleName","exportModuleExports","str","defaultExportPropertyAssignments","args","names","declaration","defaultExport","named","exportBlock","trim","prepend","append","injectExportBlock","toString","generateMap","syntheticNamedExports","getDynamicRequirePaths","patterns","Array","isArray","pattern","isNegated","modifySet","prototype","bind","glob","sync","dynamicRequireModuleDirPaths","from","values","statSync","isDirectory","ignored","isCjsPromises","Map","getIsCjsPromise","isCjsPromise","get","promise","Promise","set","setIsCjsPromise","resolution","getCandidatesForExtension","resolved","extension","getCandidates","extensions","reduce","paths","getResolveId","resolveExtensions","importee","importer","candidates","stats","isFile","resolveId","isProxyModule","skipSelf","then","external","commonjs","options","createFilter","include","exclude","dynamicRequireTargets","size","getCommonDir","process","cwd","esModulesWithoutDefaultExport","esModulesWithDefaultExport","ignore","includes","transformAndCheckExports","isDynamicRequireModule","transformMixedEsModules","moduleInfo","getModuleInfo","transformed","importers","Boolean","buildStart","warn","meta","rollupVersion","Number","major","minor","minVersion","peerDependencies","rollup","minMajor","minMinor","error","load","actualId","dir","entryPoint","existsSync","readFileSync","encoding","main","isDynamicJson","normalizedPath","isCjs","dynamicImports","dynamicId","transform","indexOf","call","loc"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA,MAAMA,SAAS,GAAG;AAChB,QAAOC,CAAD,IAAOC,MAAM,CAACD,CAAC,CAACE,IAAH,EAASF,CAAC,CAACG,KAAX,EAAkB,KAAlB,CADH;AAGhB,QAAOH,CAAD,IAAOI,GAAG,CAACL,SAAS,CAAC,IAAD,CAAT,CAAgBC,CAAhB,CAAD,CAHA;AAKhB,SAAQA,CAAD,IAAOC,MAAM,CAACD,CAAC,CAACE,IAAH,EAASF,CAAC,CAACG,KAAX,EAAkB,IAAlB,CALJ;AAOhB,SAAQH,CAAD,IAAOI,GAAG,CAACL,SAAS,CAAC,KAAD,CAAT,CAAiBC,CAAjB,CAAD,CAPD;AAShB,OAAMA,CAAD,IAAOK,OAAO,CAACL,CAAC,CAACM,QAAH,CATH;AAWhB,QAAON,CAAD,IAAOO,QAAQ,CAACP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AS,CAACrO,IAAD,EAAOjD,EAAP,EAAW;AAClB,UAAIA,EAAE,KAAKe,mBAAP,IAA8B,CAACf,EAAE,CAACY,UAAH,CAAcE,mBAAd,CAAnC,EAAuE;AACrE,YAAI,CAACoJ,MAAM,CAAClK,EAAD,CAAP,IAAeuN,UAAU,CAACgE,OAAX,CAAmBhQ,OAAO,CAACvB,EAAD,CAA1B,MAAoC,CAAC,CAAxD,EAA2D;AACzDiN,UAAAA,eAAe,CAACjN,EAAD,EAAK,IAAL,CAAf;AACA,iBAAO,IAAP;AACD;AACF;;AAED,UAAIyP,WAAJ;;AACA,UAAI;AACFA,QAAAA,WAAW,GAAGL,wBAAwB,CAACoC,IAAzB,CAA8B,IAA9B,EAAoCvO,IAApC,EAA0CjD,EAA1C,CAAd;AACD,OAFD,CAEE,OAAOmD,GAAP,EAAY;AACZsM,QAAAA,WAAW,GAAG,IAAd;AACAxC,QAAAA,eAAe,CAACjN,EAAD,EAAK,KAAL,CAAf;AACA,aAAKwQ,KAAL,CAAWrN,GAAX,EAAgBA,GAAG,CAACsO,GAApB;AACD;;AAED,aAAOhC,WAAP;AACD;;AA1KI,GAAP;AA4KD;;;;"} \ No newline at end of file
+{"version":3,"file":"index.es.js","sources":["../src/parse.js","../src/analyze-top-level-statements.js","../src/helpers.js","../src/utils.js","../src/dynamic-packages-manager.js","../src/dynamic-require-paths.js","../src/is-cjs.js","../src/proxies.js","../src/resolve-id.js","../src/rollup-version.js","../src/ast-utils.js","../src/generate-exports.js","../src/generate-imports.js","../src/transform-commonjs.js","../src/index.js"],"sourcesContent":["export function tryParse(parse, code, id) {\n try {\n return parse(code, { allowReturnOutsideFunction: true });\n } catch (err) {\n err.message += ` in ${id}`;\n throw err;\n }\n}\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\n\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n return firstpass.test(code);\n}\n","/* eslint-disable no-underscore-dangle */\n\nimport { tryParse } from './parse';\n\nexport default function analyzeTopLevelStatements(parse, code, id) {\n const ast = tryParse(parse, code, id);\n\n let isEsModule = false;\n let hasDefaultExport = false;\n let hasNamedExports = false;\n\n for (const node of ast.body) {\n switch (node.type) {\n case 'ExportDefaultDeclaration':\n isEsModule = true;\n hasDefaultExport = true;\n break;\n case 'ExportNamedDeclaration':\n isEsModule = true;\n if (node.declaration) {\n hasNamedExports = true;\n } else {\n for (const specifier of node.specifiers) {\n if (specifier.exported.name === 'default') {\n hasDefaultExport = true;\n } else {\n hasNamedExports = true;\n }\n }\n }\n break;\n case 'ExportAllDeclaration':\n isEsModule = true;\n if (node.exported && node.exported.name === 'default') {\n hasDefaultExport = true;\n } else {\n hasNamedExports = true;\n }\n break;\n case 'ImportDeclaration':\n isEsModule = true;\n break;\n default:\n }\n }\n\n return { isEsModule, hasDefaultExport, hasNamedExports, ast };\n}\n","export const isWrappedId = (id, suffix) => id.endsWith(suffix);\nexport const wrapId = (id, suffix) => `\\0${id}${suffix}`;\nexport const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);\n\nexport const PROXY_SUFFIX = '?commonjs-proxy';\nexport const REQUIRE_SUFFIX = '?commonjs-require';\nexport const EXTERNAL_SUFFIX = '?commonjs-external';\n\nexport const DYNAMIC_REGISTER_SUFFIX = '?commonjs-dynamic-register';\nexport const DYNAMIC_JSON_PREFIX = '\\0commonjs-dynamic-json:';\nexport const DYNAMIC_PACKAGES_ID = '\\0commonjs-dynamic-packages';\n\nexport const HELPERS_ID = '\\0commonjsHelpers.js';\n\n// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.\n// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.\n// This will no longer be necessary once Rollup switches to ES6 output, likely\n// in Rollup 3\n\nconst HELPERS = `\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function getDefaultExportFromNamespaceIfPresent (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;\n}\n\nexport function getDefaultExportFromNamespaceIfNotNamed (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;\n}\n\nexport function getAugmentedNamespace(n) {\n\tif (n.__esModule) return n;\n\tvar a = Object.defineProperty({}, '__esModule', {value: true});\n\tObject.keys(n).forEach(function (k) {\n\t\tvar d = Object.getOwnPropertyDescriptor(n, k);\n\t\tObject.defineProperty(a, k, d.get ? d : {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\treturn n[k];\n\t\t\t}\n\t\t});\n\t});\n\treturn a;\n}\n`;\n\nconst HELPER_NON_DYNAMIC = `\nexport function createCommonjsModule(fn) {\n var module = { exports: {} }\n\treturn fn(module, module.exports), module.exports;\n}\n\nexport function commonjsRequire (target) {\n\tthrow new Error('Could not dynamically require \"' + target + '\". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.');\n}\n`;\n\nconst HELPERS_DYNAMIC = `\nexport function createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t\tpath: basedir,\n\t\texports: {},\n\t\trequire: function (path, base) {\n\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t}\n\t}, fn(module, module.exports), module.exports;\n}\n\nexport function commonjsRegister (path, loader) {\n\tDYNAMIC_REQUIRE_LOADERS[path] = loader;\n}\n\nconst DYNAMIC_REQUIRE_LOADERS = Object.create(null);\nconst DYNAMIC_REQUIRE_CACHE = Object.create(null);\nconst DEFAULT_PARENT_MODULE = {\n\tid: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []\n};\nconst CHECKED_EXTENSIONS = ['', '.js', '.json'];\n\nfunction normalize (path) {\n\tpath = path.replace(/\\\\\\\\/g, '/');\n\tconst parts = path.split('/');\n\tconst slashed = parts[0] === '';\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] === '.' || parts[i] === '') {\n\t\t\tparts.splice(i--, 1);\n\t\t}\n\t}\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] !== '..') continue;\n\t\tif (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {\n\t\t\tparts.splice(--i, 2);\n\t\t\ti--;\n\t\t}\n\t}\n\tpath = parts.join('/');\n\tif (slashed && path[0] !== '/')\n\t path = '/' + path;\n\telse if (path.length === 0)\n\t path = '.';\n\treturn path;\n}\n\nfunction join () {\n\tif (arguments.length === 0)\n\t return '.';\n\tlet joined;\n\tfor (let i = 0; i < arguments.length; ++i) {\n\t let arg = arguments[i];\n\t if (arg.length > 0) {\n\t\tif (joined === undefined)\n\t\t joined = arg;\n\t\telse\n\t\t joined += '/' + arg;\n\t }\n\t}\n\tif (joined === undefined)\n\t return '.';\n\n\treturn joined;\n}\n\nfunction isPossibleNodeModulesPath (modulePath) {\n\tlet c0 = modulePath[0];\n\tif (c0 === '/' || c0 === '\\\\\\\\') return false;\n\tlet c1 = modulePath[1], c2 = modulePath[2];\n\tif ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\\\\\')) ||\n\t\t(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\\\\\'))) return false;\n\tif (c1 === ':' && (c2 === '/' || c2 === '\\\\\\\\'))\n\t\treturn false;\n\treturn true;\n}\n\nfunction dirname (path) {\n if (path.length === 0)\n return '.';\n\n let i = path.length - 1;\n while (i > 0) {\n const c = path.charCodeAt(i);\n if ((c === 47 || c === 92) && i !== path.length - 1)\n break;\n i--;\n }\n\n if (i > 0)\n return path.substr(0, i);\n\n if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)\n return path.charAt(0);\n\n return '.';\n}\n\nexport function commonjsResolveImpl (path, originalModuleDir, testCache) {\n\tconst shouldTryNodeModules = isPossibleNodeModulesPath(path);\n\tpath = normalize(path);\n\tlet relPath;\n\tif (path[0] === '/') {\n\t\toriginalModuleDir = '/';\n\t}\n\twhile (true) {\n\t\tif (!shouldTryNodeModules) {\n\t\t\trelPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;\n\t\t} else if (originalModuleDir) {\n\t\t\trelPath = normalize(originalModuleDir + '/node_modules/' + path);\n\t\t} else {\n\t\t\trelPath = normalize(join('node_modules', path));\n\t\t}\n\n\t\tif (relPath.endsWith('/..')) {\n\t\t\tbreak; // Travelled too far up, avoid infinite loop\n\t\t}\n\n\t\tfor (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {\n\t\t\tconst resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];\n\t\t\tif (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {\n\t\t\t\treturn resolvedPath;\n\t\t\t};\n\t\t\tif (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {\n\t\t\t\treturn resolvedPath;\n\t\t\t};\n\t\t}\n\t\tif (!shouldTryNodeModules) break;\n\t\tconst nextDir = normalize(originalModuleDir + '/..');\n\t\tif (nextDir === originalModuleDir) break;\n\t\toriginalModuleDir = nextDir;\n\t}\n\treturn null;\n}\n\nexport function commonjsResolve (path, originalModuleDir) {\n\tconst resolvedPath = commonjsResolveImpl(path, originalModuleDir);\n\tif (resolvedPath !== null) {\n\t\treturn resolvedPath;\n\t}\n\treturn require.resolve(path);\n}\n\nexport function commonjsRequire (path, originalModuleDir) {\n\tconst resolvedPath = commonjsResolveImpl(path, originalModuleDir, true);\n\tif (resolvedPath !== null) {\n let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];\n if (cachedModule) return cachedModule.exports;\n const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];\n if (loader) {\n DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {\n id: resolvedPath,\n filename: resolvedPath,\n path: dirname(resolvedPath),\n exports: {},\n parent: DEFAULT_PARENT_MODULE,\n loaded: false,\n children: [],\n paths: [],\n require: function (path, base) {\n return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);\n }\n };\n try {\n loader.call(commonjsGlobal, cachedModule, cachedModule.exports);\n } catch (error) {\n delete DYNAMIC_REQUIRE_CACHE[resolvedPath];\n throw error;\n }\n cachedModule.loaded = true;\n return cachedModule.exports;\n };\n\t}\n\treturn require(path);\n}\n\ncommonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;\ncommonjsRequire.resolve = commonjsResolve;\n`;\n\nexport function getHelpersModule(isDynamicRequireModulesEnabled) {\n return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;\n}\n","/* eslint-disable import/prefer-default-export */\n\nimport { basename, dirname, extname, sep } from 'path';\n\nimport { makeLegalIdentifier } from '@rollup/pluginutils';\n\nexport function deconflict(scope, globals, identifier) {\n let i = 1;\n let deconflicted = makeLegalIdentifier(identifier);\n\n while (scope.contains(deconflicted) || globals.has(deconflicted)) {\n deconflicted = makeLegalIdentifier(`${identifier}_${i}`);\n i += 1;\n }\n // eslint-disable-next-line no-param-reassign\n scope.declarations[deconflicted] = true;\n\n return deconflicted;\n}\n\nexport function getName(id) {\n const name = makeLegalIdentifier(basename(id, extname(id)));\n if (name !== 'index') {\n return name;\n }\n const segments = dirname(id).split(sep);\n return makeLegalIdentifier(segments[segments.length - 1]);\n}\n\nexport function normalizePathSlashes(path) {\n return path.replace(/\\\\/g, '/');\n}\n\nconst VIRTUAL_PATH_BASE = '/$$rollup_base$$';\nexport const getVirtualPathForDynamicRequirePath = (path, commonDir) => {\n const normalizedPath = normalizePathSlashes(path);\n return normalizedPath.startsWith(commonDir)\n ? VIRTUAL_PATH_BASE + normalizedPath.slice(commonDir.length)\n : normalizedPath;\n};\n","import { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n DYNAMIC_PACKAGES_ID,\n DYNAMIC_REGISTER_SUFFIX,\n HELPERS_ID,\n isWrappedId,\n unwrapId,\n wrapId\n} from './helpers';\nimport { getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils';\n\nexport function getPackageEntryPoint(dirPath) {\n let entryPoint = 'index.js';\n\n try {\n if (existsSync(join(dirPath, 'package.json'))) {\n entryPoint =\n JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main ||\n entryPoint;\n }\n } catch (ignored) {\n // ignored\n }\n\n return entryPoint;\n}\n\nexport function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {\n let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;\n for (const dir of dynamicRequireModuleDirPaths) {\n const entryPoint = getPackageEntryPoint(dir);\n\n code += `\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(dir, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});\n});`;\n }\n return code;\n}\n\nexport function getDynamicPackagesEntryIntro(\n dynamicRequireModuleDirPaths,\n dynamicRequireModuleSet\n) {\n let dynamicImports = Array.from(\n dynamicRequireModuleSet,\n (dynamicId) => `require(${JSON.stringify(wrapModuleRegisterProxy(dynamicId))});`\n ).join('\\n');\n\n if (dynamicRequireModuleDirPaths.length) {\n dynamicImports += `require(${JSON.stringify(wrapModuleRegisterProxy(DYNAMIC_PACKAGES_ID))});`;\n }\n\n return dynamicImports;\n}\n\nexport function wrapModuleRegisterProxy(id) {\n return wrapId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function unwrapModuleRegisterProxy(id) {\n return unwrapId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function isModuleRegisterProxy(id) {\n return isWrappedId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function isDynamicModuleImport(id, dynamicRequireModuleSet) {\n const normalizedPath = normalizePathSlashes(id);\n return dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json');\n}\n","import { statSync } from 'fs';\n\nimport { join, resolve } from 'path';\n\nimport glob from 'glob';\n\nimport { normalizePathSlashes } from './utils';\nimport { getPackageEntryPoint } from './dynamic-packages-manager';\n\nfunction isDirectory(path) {\n try {\n if (statSync(path).isDirectory()) return true;\n } catch (ignored) {\n // Nothing to do here\n }\n return false;\n}\n\nexport default function getDynamicRequirePaths(patterns) {\n const dynamicRequireModuleSet = new Set();\n for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {\n const isNegated = pattern.startsWith('!');\n const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);\n for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {\n modifySet(normalizePathSlashes(resolve(path)));\n if (isDirectory(path)) {\n modifySet(normalizePathSlashes(resolve(join(path, getPackageEntryPoint(path)))));\n }\n }\n }\n const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter((path) =>\n isDirectory(path)\n );\n return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };\n}\n","const isCjsPromises = new Map();\n\nexport function getIsCjsPromise(id) {\n let isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) return isCjsPromise.promise;\n\n const promise = new Promise((resolve) => {\n isCjsPromise = {\n resolve,\n promise: null\n };\n isCjsPromises.set(id, isCjsPromise);\n });\n isCjsPromise.promise = promise;\n\n return promise;\n}\n\nexport function setIsCjsPromise(id, resolution) {\n const isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) {\n if (isCjsPromise.resolve) {\n isCjsPromise.resolve(resolution);\n isCjsPromise.resolve = null;\n }\n } else {\n isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: null });\n }\n}\n","import { readFileSync } from 'fs';\n\nimport { DYNAMIC_JSON_PREFIX, HELPERS_ID } from './helpers';\nimport { getIsCjsPromise } from './is-cjs';\nimport { getName, getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils';\n\n// e.g. id === \"commonjsHelpers?commonjsRegister\"\nexport function getSpecificHelperProxy(id) {\n return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;\n}\n\nexport function getUnknownRequireProxy(id, requireReturnsDefault) {\n if (requireReturnsDefault === true || id.endsWith('.json')) {\n return `export {default} from ${JSON.stringify(id)};`;\n }\n const name = getName(id);\n const exported =\n requireReturnsDefault === 'auto'\n ? `import {getDefaultExportFromNamespaceIfNotNamed} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`\n : requireReturnsDefault === 'preferred'\n ? `import {getDefaultExportFromNamespaceIfPresent} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`\n : !requireReturnsDefault\n ? `import {getAugmentedNamespace} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getAugmentedNamespace(${name});`\n : `export default ${name};`;\n return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;\n}\n\nexport function getDynamicJsonProxy(id, commonDir) {\n const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));\n return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizedPath)});\n});`;\n}\n\nexport function getDynamicRequireProxy(normalizedPath, commonDir) {\n return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n ${readFileSync(normalizedPath, { encoding: 'utf8' })}\n});`;\n}\n\nexport async function getStaticRequireProxy(\n id,\n requireReturnsDefault,\n esModulesWithDefaultExport,\n esModulesWithNamedExports\n) {\n const name = getName(id);\n const isCjs = await getIsCjsPromise(id);\n if (isCjs) {\n return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;\n } else if (isCjs === null) {\n return getUnknownRequireProxy(id, requireReturnsDefault);\n } else if (!requireReturnsDefault) {\n return `import {getAugmentedNamespace} from \"${HELPERS_ID}\"; import * as ${name} from ${JSON.stringify(\n id\n )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;\n } else if (\n requireReturnsDefault !== true &&\n (requireReturnsDefault === 'namespace' ||\n !esModulesWithDefaultExport.has(id) ||\n (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))\n ) {\n return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;\n }\n return `export {default} from ${JSON.stringify(id)};`;\n}\n","/* eslint-disable no-param-reassign, no-undefined */\n\nimport { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n EXTERNAL_SUFFIX,\n HELPERS_ID,\n isWrappedId,\n PROXY_SUFFIX,\n REQUIRE_SUFFIX,\n unwrapId,\n wrapId\n} from './helpers';\nimport {\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy,\n wrapModuleRegisterProxy\n} from './dynamic-packages-manager';\n\nfunction getCandidatesForExtension(resolved, extension) {\n return [resolved + extension, `${resolved}${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n return extensions.reduce(\n (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n [resolved]\n );\n}\n\nexport default function getResolveId(extensions) {\n function resolveExtensions(importee, importer) {\n // not our problem\n if (importee[0] !== '.' || !importer) return undefined;\n\n const resolved = resolve(dirname(importer), importee);\n const candidates = getCandidates(resolved, extensions);\n\n for (let i = 0; i < candidates.length; i += 1) {\n try {\n const stats = statSync(candidates[i]);\n if (stats.isFile()) return { id: candidates[i] };\n } catch (err) {\n /* noop */\n }\n }\n\n return undefined;\n }\n\n return function resolveId(importee, rawImporter) {\n const importer =\n rawImporter && isModuleRegisterProxy(rawImporter)\n ? unwrapModuleRegisterProxy(rawImporter)\n : rawImporter;\n\n // Proxies are only importing resolved ids, no need to resolve again\n if (importer && isWrappedId(importer, PROXY_SUFFIX)) {\n return importee;\n }\n\n const isProxyModule = isWrappedId(importee, PROXY_SUFFIX);\n const isRequiredModule = isWrappedId(importee, REQUIRE_SUFFIX);\n let isModuleRegistration = false;\n\n if (isProxyModule) {\n importee = unwrapId(importee, PROXY_SUFFIX);\n } else if (isRequiredModule) {\n importee = unwrapId(importee, REQUIRE_SUFFIX);\n\n isModuleRegistration = isModuleRegisterProxy(importee);\n if (isModuleRegistration) {\n importee = unwrapModuleRegisterProxy(importee);\n }\n }\n\n if (\n importee.startsWith(HELPERS_ID) ||\n importee === DYNAMIC_PACKAGES_ID ||\n importee.startsWith(DYNAMIC_JSON_PREFIX)\n ) {\n return importee;\n }\n\n if (importee.startsWith('\\0')) {\n return null;\n }\n\n return this.resolve(importee, importer, {\n skipSelf: true,\n custom: { 'node-resolve': { isRequire: isProxyModule || isRequiredModule } }\n }).then((resolved) => {\n if (!resolved) {\n resolved = resolveExtensions(importee, importer);\n }\n if (resolved && isProxyModule) {\n resolved.id = wrapId(resolved.id, resolved.external ? EXTERNAL_SUFFIX : PROXY_SUFFIX);\n resolved.external = false;\n } else if (resolved && isModuleRegistration) {\n resolved.id = wrapModuleRegisterProxy(resolved.id);\n } else if (!resolved && (isProxyModule || isRequiredModule)) {\n return { id: wrapId(importee, EXTERNAL_SUFFIX), external: false };\n }\n return resolved;\n });\n };\n}\n","export default function validateRollupVersion(rollupVersion, peerDependencyVersion) {\n const [major, minor] = rollupVersion.split('.').map(Number);\n const versionRegexp = /\\^(\\d+\\.\\d+)\\.\\d+/g;\n let minMajor = Infinity;\n let minMinor = Infinity;\n let foundVersion;\n // eslint-disable-next-line no-cond-assign\n while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {\n const [foundMajor, foundMinor] = foundVersion[1].split('.').map(Number);\n if (foundMajor < minMajor) {\n minMajor = foundMajor;\n minMinor = foundMinor;\n }\n }\n if (major < minMajor || (major === minMajor && minor < minMinor)) {\n throw new Error(\n `Insufficient Rollup version: \"@rollup/plugin-commonjs\" requires at least rollup@${minMajor}.${minMinor} but found rollup@${rollupVersion}.`\n );\n }\n}\n","export { default as isReference } from 'is-reference';\n\nconst operators = {\n '==': (x) => equals(x.left, x.right, false),\n\n '!=': (x) => not(operators['=='](x)),\n\n '===': (x) => equals(x.left, x.right, true),\n\n '!==': (x) => not(operators['==='](x)),\n\n '!': (x) => isFalsy(x.argument),\n\n '&&': (x) => isTruthy(x.left) && isTruthy(x.right),\n\n '||': (x) => isTruthy(x.left) || isTruthy(x.right)\n};\n\nfunction not(value) {\n return value === null ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n if (a.type !== b.type) return null;\n // eslint-disable-next-line eqeqeq\n if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n return null;\n}\n\nexport function isTruthy(node) {\n if (!node) return false;\n if (node.type === 'Literal') return !!node.value;\n if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n if (node.operator in operators) return operators[node.operator](node);\n return null;\n}\n\nexport function isFalsy(node) {\n return not(isTruthy(node));\n}\n\nexport function getKeypath(node) {\n const parts = [];\n\n while (node.type === 'MemberExpression') {\n if (node.computed) return null;\n\n parts.unshift(node.property.name);\n // eslint-disable-next-line no-param-reassign\n node = node.object;\n }\n\n if (node.type !== 'Identifier') return null;\n\n const { name } = node;\n parts.unshift(name);\n\n return { name, keypath: parts.join('.') };\n}\n\nexport const KEY_COMPILED_ESM = '__esModule';\n\nexport function isDefineCompiledEsm(node) {\n const definedProperty =\n getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');\n if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {\n return isTruthy(definedProperty.value);\n }\n return false;\n}\n\nfunction getDefinePropertyCallName(node, targetName) {\n const targetNames = targetName.split('.');\n\n const {\n callee: { object, property }\n } = node;\n if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;\n if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;\n if (node.arguments.length !== 3) return;\n\n const [target, key, value] = node.arguments;\n if (targetNames.length === 1) {\n if (target.type !== 'Identifier' || target.name !== targetNames[0]) {\n return;\n }\n }\n\n if (targetNames.length === 2) {\n if (\n target.type !== 'MemberExpression' ||\n target.object.name !== targetNames[0] ||\n target.property.name !== targetNames[1]\n ) {\n return;\n }\n }\n\n if (value.type !== 'ObjectExpression' || !value.properties) return;\n\n const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value');\n if (!valueProperty || !valueProperty.value) return;\n\n // eslint-disable-next-line consistent-return\n return { key: key.value, value: valueProperty.value };\n}\n\nexport function isLocallyShadowed(name, scope) {\n while (scope.parent) {\n if (scope.declarations[name]) {\n return true;\n }\n // eslint-disable-next-line no-param-reassign\n scope = scope.parent;\n }\n return false;\n}\n\nexport function isShorthandProperty(parent) {\n return parent && parent.type === 'Property' && parent.shorthand;\n}\n","export function wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath) {\n const args = `module${uses.exports ? ', exports' : ''}`;\n\n magicString\n .trim()\n .prepend(`var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`)\n .append(\n `\\n}${virtualDynamicRequirePath ? `, ${JSON.stringify(virtualDynamicRequirePath)}` : ''});`\n );\n}\n\nexport function rewriteExportsAndGetExportsBlock(\n magicString,\n moduleName,\n wrapped,\n topLevelModuleExportsAssignments,\n topLevelExportsAssignmentsByName,\n defineCompiledEsmExpressions,\n deconflict,\n isRestorableCompiledEsm,\n code,\n uses,\n HELPERS_NAME\n) {\n const namedExportDeclarations = [`export { ${moduleName} as __moduleExports };`];\n const moduleExportsPropertyAssignments = [];\n let deconflictedDefaultExportName;\n\n if (!wrapped) {\n let hasModuleExportsAssignment = false;\n const namedExportProperties = [];\n\n // Collect and rewrite module.exports assignments\n for (const { left } of topLevelModuleExportsAssignments) {\n hasModuleExportsAssignment = true;\n magicString.overwrite(left.start, left.end, `var ${moduleName}`);\n }\n\n // Collect and rewrite named exports\n for (const [exportName, node] of topLevelExportsAssignmentsByName) {\n const deconflicted = deconflict(exportName);\n magicString.overwrite(node.start, node.left.end, `var ${deconflicted}`);\n\n if (exportName === 'default') {\n deconflictedDefaultExportName = deconflicted;\n } else {\n namedExportDeclarations.push(\n exportName === deconflicted\n ? `export { ${exportName} };`\n : `export { ${deconflicted} as ${exportName} };`\n );\n }\n\n if (hasModuleExportsAssignment) {\n moduleExportsPropertyAssignments.push(`${moduleName}.${exportName} = ${deconflicted};`);\n } else {\n namedExportProperties.push(`\\t${exportName}: ${deconflicted}`);\n }\n }\n\n // Regenerate CommonJS namespace\n if (!hasModuleExportsAssignment) {\n const moduleExports = `{\\n${namedExportProperties.join(',\\n')}\\n}`;\n magicString\n .trim()\n .append(\n `\\n\\nvar ${moduleName} = ${\n isRestorableCompiledEsm\n ? `/*#__PURE__*/Object.defineProperty(${moduleExports}, '__esModule', {value: true})`\n : moduleExports\n };`\n );\n }\n }\n\n // Generate default export\n const defaultExport = [];\n if (isRestorableCompiledEsm) {\n defaultExport.push(`export default ${deconflictedDefaultExportName || moduleName};`);\n } else if (\n (wrapped || deconflictedDefaultExportName) &&\n (defineCompiledEsmExpressions.length > 0 || code.indexOf('__esModule') >= 0)\n ) {\n // eslint-disable-next-line no-param-reassign\n uses.commonjsHelpers = true;\n defaultExport.push(\n `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`\n );\n } else {\n defaultExport.push(`export default ${moduleName};`);\n }\n\n return `\\n\\n${defaultExport\n .concat(namedExportDeclarations)\n .concat(moduleExportsPropertyAssignments)\n .join('\\n')}`;\n}\n","import { dirname, resolve } from 'path';\n\nimport { sync as nodeResolveSync } from 'resolve';\n\nimport { isLocallyShadowed } from './ast-utils';\nimport { HELPERS_ID, PROXY_SUFFIX, REQUIRE_SUFFIX, wrapId } from './helpers';\nimport { normalizePathSlashes } from './utils';\n\nexport function isRequireStatement(node, scope) {\n if (!node) return false;\n if (node.type !== 'CallExpression') return false;\n\n // Weird case of `require()` or `module.require()` without arguments\n if (node.arguments.length === 0) return false;\n\n return isRequire(node.callee, scope);\n}\n\nfunction isRequire(node, scope) {\n return (\n (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) ||\n (node.type === 'MemberExpression' && isModuleRequire(node, scope))\n );\n}\n\nexport function isModuleRequire({ object, property }, scope) {\n return (\n object.type === 'Identifier' &&\n object.name === 'module' &&\n property.type === 'Identifier' &&\n property.name === 'require' &&\n !scope.contains('module')\n );\n}\n\nexport function isStaticRequireStatement(node, scope) {\n if (!isRequireStatement(node, scope)) return false;\n return !hasDynamicArguments(node);\n}\n\nfunction hasDynamicArguments(node) {\n return (\n node.arguments.length > 1 ||\n (node.arguments[0].type !== 'Literal' &&\n (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n );\n}\n\nconst reservedMethod = { resolve: true, cache: true, main: true };\n\nexport function isNodeRequirePropertyAccess(parent) {\n return parent && parent.property && reservedMethod[parent.property.name];\n}\n\nexport function isIgnoredRequireStatement(requiredNode, ignoreRequire) {\n return ignoreRequire(requiredNode.arguments[0].value);\n}\n\nexport function getRequireStringArg(node) {\n return node.arguments[0].type === 'Literal'\n ? node.arguments[0].value\n : node.arguments[0].quasis[0].value.cooked;\n}\n\nexport function hasDynamicModuleForPath(source, id, dynamicRequireModuleSet) {\n if (!/^(?:\\.{0,2}[/\\\\]|[A-Za-z]:[/\\\\])/.test(source)) {\n try {\n const resolvedPath = normalizePathSlashes(nodeResolveSync(source, { basedir: dirname(id) }));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n } catch (ex) {\n // Probably a node.js internal module\n return false;\n }\n\n return false;\n }\n\n for (const attemptExt of ['', '.js', '.json']) {\n const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getRequireHandlers() {\n const requiredSources = [];\n const requiredBySource = Object.create(null);\n const requiredByNode = new Map();\n const requireExpressionsWithUsedReturnValue = [];\n\n function addRequireStatement(sourceId, node, scope, usesReturnValue) {\n const required = getRequired(sourceId);\n requiredByNode.set(node, { scope, required });\n if (usesReturnValue) {\n required.nodesUsingRequired.push(node);\n requireExpressionsWithUsedReturnValue.push(node);\n }\n }\n\n function getRequired(sourceId) {\n if (!requiredBySource[sourceId]) {\n requiredSources.push(sourceId);\n\n requiredBySource[sourceId] = {\n source: sourceId,\n name: null,\n nodesUsingRequired: []\n };\n }\n\n return requiredBySource[sourceId];\n }\n\n function rewriteRequireExpressionsAndGetImportBlock(\n magicString,\n topLevelDeclarations,\n topLevelRequireDeclarators,\n reassignedNames,\n helpersNameIfUsed,\n dynamicRegisterSources\n ) {\n const removedDeclarators = getDeclaratorsReplacedByImportsAndSetImportNames(\n topLevelRequireDeclarators,\n requiredByNode,\n reassignedNames\n );\n setRemainingImportNamesAndRewriteRequires(\n requireExpressionsWithUsedReturnValue,\n requiredByNode,\n magicString\n );\n removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString);\n const importBlock = `${(helpersNameIfUsed\n ? [`import * as ${helpersNameIfUsed} from '${HELPERS_ID}';`]\n : []\n )\n .concat(\n // dynamic registers first, as the may be required in the other modules\n [...dynamicRegisterSources].map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),\n\n // now the actual modules so that they are analyzed before creating the proxies;\n // no need to do this for virtual modules as we never proxy them\n requiredSources\n .filter((source) => !source.startsWith('\\0'))\n .map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),\n\n // now the proxy modules\n requiredSources.map((source) => {\n const { name, nodesUsingRequired } = requiredBySource[source];\n return `import ${nodesUsingRequired.length ? `${name} from ` : ``}'${\n source.startsWith('\\0') ? source : wrapId(source, PROXY_SUFFIX)\n }';`;\n })\n )\n .join('\\n')}`;\n return importBlock ? `${importBlock}\\n\\n` : '';\n }\n\n return {\n addRequireStatement,\n requiredSources,\n rewriteRequireExpressionsAndGetImportBlock\n };\n}\n\nfunction getDeclaratorsReplacedByImportsAndSetImportNames(\n topLevelRequireDeclarators,\n requiredByNode,\n reassignedNames\n) {\n const removedDeclarators = new Set();\n for (const declarator of topLevelRequireDeclarators) {\n const { required } = requiredByNode.get(declarator.init);\n if (!required.name) {\n const potentialName = declarator.id.name;\n if (\n !reassignedNames.has(potentialName) &&\n !required.nodesUsingRequired.some((node) =>\n isLocallyShadowed(potentialName, requiredByNode.get(node).scope)\n )\n ) {\n required.name = potentialName;\n removedDeclarators.add(declarator);\n }\n }\n }\n return removedDeclarators;\n}\n\nfunction setRemainingImportNamesAndRewriteRequires(\n requireExpressionsWithUsedReturnValue,\n requiredByNode,\n magicString\n) {\n let uid = 0;\n for (const requireExpression of requireExpressionsWithUsedReturnValue) {\n const { required } = requiredByNode.get(requireExpression);\n if (!required.name) {\n let potentialName;\n const isUsedName = (node) => requiredByNode.get(node).scope.contains(potentialName);\n do {\n potentialName = `require$$${uid}`;\n uid += 1;\n } while (required.nodesUsingRequired.some(isUsedName));\n required.name = potentialName;\n }\n magicString.overwrite(requireExpression.start, requireExpression.end, required.name);\n }\n}\n\nfunction removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString) {\n for (const declaration of topLevelDeclarations) {\n let keepDeclaration = false;\n let [{ start }] = declaration.declarations;\n for (const declarator of declaration.declarations) {\n if (removedDeclarators.has(declarator)) {\n magicString.remove(start, declarator.end);\n } else if (!keepDeclaration) {\n magicString.remove(start, declarator.start);\n keepDeclaration = true;\n }\n start = declarator.end;\n }\n if (!keepDeclaration) {\n magicString.remove(declaration.start, declaration.end);\n }\n }\n}\n","/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */\n\nimport { dirname } from 'path';\n\nimport { attachScopes, extractAssignedNames, makeLegalIdentifier } from '@rollup/pluginutils';\nimport { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\n\nimport {\n getKeypath,\n isDefineCompiledEsm,\n isFalsy,\n isReference,\n isShorthandProperty,\n isTruthy,\n KEY_COMPILED_ESM\n} from './ast-utils';\nimport { rewriteExportsAndGetExportsBlock, wrapCode } from './generate-exports';\nimport {\n getRequireHandlers,\n getRequireStringArg,\n hasDynamicModuleForPath,\n isIgnoredRequireStatement,\n isModuleRequire,\n isNodeRequirePropertyAccess,\n isRequireStatement,\n isStaticRequireStatement\n} from './generate-imports';\nimport { DYNAMIC_JSON_PREFIX } from './helpers';\nimport { tryParse } from './parse';\nimport { deconflict, getName, getVirtualPathForDynamicRequirePath } from './utils';\nimport {\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy,\n wrapModuleRegisterProxy\n} from './dynamic-packages-manager';\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nexport default function transformCommonjs(\n parse,\n code,\n id,\n isEsModule,\n ignoreGlobal,\n ignoreRequire,\n getIgnoreTryCatchRequireStatementMode,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n disableWrap,\n commonDir,\n astCache\n) {\n const ast = astCache || tryParse(parse, code, id);\n const magicString = new MagicString(code);\n const uses = {\n module: false,\n exports: false,\n global: false,\n require: false,\n commonjsHelpers: false\n };\n const virtualDynamicRequirePath =\n isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname(id), commonDir);\n let scope = attachScopes(ast, 'scope');\n let lexicalDepth = 0;\n let programDepth = 0;\n let currentTryBlockEnd = null;\n let shouldWrap = false;\n const defineCompiledEsmExpressions = [];\n\n const globals = new Set();\n\n // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');\n const namedExports = {};\n const dynamicRegisterSources = new Set();\n let hasRemovedRequire = false;\n\n const {\n addRequireStatement,\n requiredSources,\n rewriteRequireExpressionsAndGetImportBlock\n } = getRequireHandlers();\n\n // See which names are assigned to. This is necessary to prevent\n // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n const reassignedNames = new Set();\n const topLevelDeclarations = [];\n const topLevelRequireDeclarators = new Set();\n const skippedNodes = new Set();\n const topLevelModuleExportsAssignments = [];\n const topLevelExportsAssignmentsByName = new Map();\n\n walk(ast, {\n enter(node, parent) {\n if (skippedNodes.has(node)) {\n this.skip();\n return;\n }\n\n if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) {\n currentTryBlockEnd = null;\n }\n\n programDepth += 1;\n if (node.scope) ({ scope } = node);\n if (functionType.test(node.type)) lexicalDepth += 1;\n if (sourceMap) {\n magicString.addSourcemapLocation(node.start);\n magicString.addSourcemapLocation(node.end);\n }\n\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'TryStatement':\n if (currentTryBlockEnd === null) {\n currentTryBlockEnd = node.block.end;\n }\n return;\n case 'AssignmentExpression':\n if (node.left.type === 'MemberExpression') {\n const flattened = getKeypath(node.left);\n if (!flattened || scope.contains(flattened.name)) return;\n\n const exportsPatternMatch = exportsPattern.exec(flattened.keypath);\n if (!exportsPatternMatch || flattened.keypath === 'exports') return;\n\n const [, exportName] = exportsPatternMatch;\n uses[flattened.name] = true;\n\n // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n if (programDepth > 3) {\n shouldWrap = true;\n } else if (exportName === KEY_COMPILED_ESM) {\n defineCompiledEsmExpressions.push(parent);\n } else if (flattened.keypath === 'module.exports') {\n topLevelModuleExportsAssignments.push(node);\n } else if (!topLevelExportsAssignmentsByName.has(exportName)) {\n topLevelExportsAssignmentsByName.set(exportName, node);\n } else {\n shouldWrap = true;\n }\n\n skippedNodes.add(node.left);\n\n if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n node.right.properties.forEach((prop) => {\n if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;\n const { name } = prop.key;\n if (name === makeLegalIdentifier(name)) namedExports[name] = true;\n });\n return;\n }\n\n if (exportsPatternMatch[1]) namedExports[exportsPatternMatch[1]] = true;\n } else {\n for (const name of extractAssignedNames(node.left)) {\n reassignedNames.add(name);\n }\n }\n return;\n case 'CallExpression': {\n if (isDefineCompiledEsm(node)) {\n if (programDepth === 3 && parent.type === 'ExpressionStatement') {\n // skip special handling for [module.]exports until we know we render this\n skippedNodes.add(node.arguments[0]);\n defineCompiledEsmExpressions.push(parent);\n } else {\n shouldWrap = true;\n }\n return;\n }\n\n if (\n node.callee.object &&\n node.callee.object.name === 'require' &&\n node.callee.property.name === 'resolve' &&\n hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)\n ) {\n const requireNode = node.callee.object;\n magicString.appendLeft(\n node.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )}`\n );\n magicString.overwrite(\n requireNode.start,\n requireNode.end,\n `${HELPERS_NAME}.commonjsRequire`,\n {\n storeName: true\n }\n );\n uses.commonjsHelpers = true;\n return;\n }\n\n if (!isStaticRequireStatement(node, scope)) return;\n if (!isDynamicRequireModulesEnabled) {\n skippedNodes.add(node.callee);\n }\n if (!isIgnoredRequireStatement(node, ignoreRequire)) {\n skippedNodes.add(node.callee);\n const usesReturnValue = parent.type !== 'ExpressionStatement';\n\n let canConvertRequire = true;\n let shouldRemoveRequireStatement = false;\n\n if (currentTryBlockEnd !== null) {\n ({\n canConvertRequire,\n shouldRemoveRequireStatement\n } = getIgnoreTryCatchRequireStatementMode(node.arguments[0].value));\n\n if (shouldRemoveRequireStatement) {\n hasRemovedRequire = true;\n }\n }\n\n let sourceId = getRequireStringArg(node);\n const isDynamicRegister = isModuleRegisterProxy(sourceId);\n if (isDynamicRegister) {\n sourceId = unwrapModuleRegisterProxy(sourceId);\n if (sourceId.endsWith('.json')) {\n sourceId = DYNAMIC_JSON_PREFIX + sourceId;\n }\n dynamicRegisterSources.add(wrapModuleRegisterProxy(sourceId));\n } else {\n if (\n !sourceId.endsWith('.json') &&\n hasDynamicModuleForPath(sourceId, id, dynamicRequireModuleSet)\n ) {\n if (shouldRemoveRequireStatement) {\n magicString.overwrite(node.start, node.end, `undefined`);\n } else if (canConvertRequire) {\n magicString.overwrite(\n node.start,\n node.end,\n `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(sourceId, commonDir)\n )}, ${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )})`\n );\n uses.commonjsHelpers = true;\n }\n return;\n }\n\n if (canConvertRequire) {\n addRequireStatement(sourceId, node, scope, usesReturnValue);\n }\n }\n\n if (usesReturnValue) {\n if (shouldRemoveRequireStatement) {\n magicString.overwrite(node.start, node.end, `undefined`);\n return;\n }\n\n if (\n parent.type === 'VariableDeclarator' &&\n !scope.parent &&\n parent.id.type === 'Identifier'\n ) {\n // This will allow us to reuse this variable name as the imported variable if it is not reassigned\n // and does not conflict with variables in other places where this is imported\n topLevelRequireDeclarators.add(parent);\n }\n } else {\n // This is a bare import, e.g. `require('foo');`\n\n if (!canConvertRequire && !shouldRemoveRequireStatement) {\n return;\n }\n\n magicString.remove(parent.start, parent.end);\n }\n }\n return;\n }\n case 'ConditionalExpression':\n case 'IfStatement':\n // skip dead branches\n if (isFalsy(node.test)) {\n skippedNodes.add(node.consequent);\n } else if (node.alternate && isTruthy(node.test)) {\n skippedNodes.add(node.alternate);\n }\n return;\n case 'Identifier': {\n const { name } = node;\n if (!(isReference(node, parent) && !scope.contains(name))) return;\n switch (name) {\n case 'require':\n if (isNodeRequirePropertyAccess(parent)) {\n if (hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)) {\n if (parent.property.name === 'cache') {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n }\n\n return;\n }\n\n if (isDynamicRequireModulesEnabled && isRequireStatement(parent, scope)) {\n magicString.appendLeft(\n parent.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )}`\n );\n }\n if (isShorthandProperty(parent)) {\n magicString.appendRight(node.end, `: ${HELPERS_NAME}.commonjsRequire`);\n } else {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n }\n\n uses.commonjsHelpers = true;\n return;\n case 'module':\n case 'exports':\n shouldWrap = true;\n uses[name] = true;\n return;\n case 'global':\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n return;\n case 'define':\n magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n return;\n default:\n globals.add(name);\n return;\n }\n }\n case 'MemberExpression':\n if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n skippedNodes.add(node.object);\n skippedNodes.add(node.property);\n }\n return;\n case 'ReturnStatement':\n // if top-level return, we need to wrap it\n if (lexicalDepth === 0) {\n shouldWrap = true;\n }\n return;\n case 'ThisExpression':\n // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal`\n if (lexicalDepth === 0) {\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n }\n return;\n case 'UnaryExpression':\n // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n if (node.operator === 'typeof') {\n const flattened = getKeypath(node.argument);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n if (\n flattened.keypath === 'module.exports' ||\n flattened.keypath === 'module' ||\n flattened.keypath === 'exports'\n ) {\n magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n }\n }\n return;\n case 'VariableDeclaration':\n if (!scope.parent) {\n topLevelDeclarations.push(node);\n }\n }\n },\n\n leave(node) {\n programDepth -= 1;\n if (node.scope) scope = scope.parent;\n if (functionType.test(node.type)) lexicalDepth -= 1;\n }\n });\n\n let isRestorableCompiledEsm = false;\n if (defineCompiledEsmExpressions.length > 0) {\n if (!shouldWrap && defineCompiledEsmExpressions.length === 1) {\n isRestorableCompiledEsm = true;\n magicString.remove(\n defineCompiledEsmExpressions[0].start,\n defineCompiledEsmExpressions[0].end\n );\n } else {\n shouldWrap = true;\n uses.exports = true;\n }\n }\n\n // We cannot wrap ES/mixed modules\n shouldWrap = shouldWrap && !disableWrap && !isEsModule;\n uses.commonjsHelpers = uses.commonjsHelpers || shouldWrap;\n\n if (\n !(\n requiredSources.length ||\n dynamicRegisterSources.size ||\n uses.module ||\n uses.exports ||\n uses.require ||\n uses.commonjsHelpers ||\n hasRemovedRequire\n ) &&\n (ignoreGlobal || !uses.global)\n ) {\n return { meta: { commonjs: { isCommonJS: false } } };\n }\n\n const moduleName = deconflict(scope, globals, getName(id));\n\n let leadingComment = '';\n if (code.startsWith('/*')) {\n const commentEnd = code.indexOf('*/', 2) + 2;\n leadingComment = `${code.slice(0, commentEnd)}\\n`;\n magicString.remove(0, commentEnd).trim();\n }\n\n const exportBlock = isEsModule\n ? ''\n : rewriteExportsAndGetExportsBlock(\n magicString,\n moduleName,\n shouldWrap,\n topLevelModuleExportsAssignments,\n topLevelExportsAssignmentsByName,\n defineCompiledEsmExpressions,\n (name) => deconflict(scope, globals, name),\n isRestorableCompiledEsm,\n code,\n uses,\n HELPERS_NAME\n );\n\n const importBlock = rewriteRequireExpressionsAndGetImportBlock(\n magicString,\n topLevelDeclarations,\n topLevelRequireDeclarators,\n reassignedNames,\n uses.commonjsHelpers && HELPERS_NAME,\n dynamicRegisterSources\n );\n\n if (shouldWrap) {\n wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath);\n }\n\n magicString\n .trim()\n .prepend(leadingComment + importBlock)\n .append(exportBlock);\n\n return {\n code: magicString.toString(),\n map: sourceMap ? magicString.generateMap() : null,\n syntheticNamedExports: isEsModule ? false : '__moduleExports',\n meta: { commonjs: { isCommonJS: !isEsModule } }\n };\n}\n","import { extname } from 'path';\n\nimport { createFilter } from '@rollup/pluginutils';\nimport getCommonDir from 'commondir';\n\nimport { peerDependencies } from '../package.json';\n\nimport analyzeTopLevelStatements from './analyze-top-level-statements';\n\nimport {\n getDynamicPackagesEntryIntro,\n getDynamicPackagesModule,\n isDynamicModuleImport,\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy\n} from './dynamic-packages-manager';\nimport getDynamicRequirePaths from './dynamic-require-paths';\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n EXTERNAL_SUFFIX,\n getHelpersModule,\n HELPERS_ID,\n isWrappedId,\n PROXY_SUFFIX,\n unwrapId\n} from './helpers';\nimport { setIsCjsPromise } from './is-cjs';\nimport { hasCjsKeywords } from './parse';\nimport {\n getDynamicJsonProxy,\n getDynamicRequireProxy,\n getSpecificHelperProxy,\n getStaticRequireProxy,\n getUnknownRequireProxy\n} from './proxies';\nimport getResolveId from './resolve-id';\nimport validateRollupVersion from './rollup-version';\nimport transformCommonjs from './transform-commonjs';\nimport { normalizePathSlashes } from './utils';\n\nexport default function commonjs(options = {}) {\n const extensions = options.extensions || ['.js'];\n const filter = createFilter(options.include, options.exclude);\n const {\n ignoreGlobal,\n requireReturnsDefault: requireReturnsDefaultOption,\n esmExternals\n } = options;\n const getRequireReturnsDefault =\n typeof requireReturnsDefaultOption === 'function'\n ? requireReturnsDefaultOption\n : () => requireReturnsDefaultOption;\n let esmExternalIds;\n const isEsmExternal =\n typeof esmExternals === 'function'\n ? esmExternals\n : Array.isArray(esmExternals)\n ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))\n : () => esmExternals;\n\n const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(\n options.dynamicRequireTargets\n );\n const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;\n const commonDir = isDynamicRequireModulesEnabled\n ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))\n : null;\n\n const esModulesWithDefaultExport = new Set();\n const esModulesWithNamedExports = new Set();\n\n const ignoreRequire =\n typeof options.ignore === 'function'\n ? options.ignore\n : Array.isArray(options.ignore)\n ? (id) => options.ignore.includes(id)\n : () => false;\n\n const getIgnoreTryCatchRequireStatementMode = (id) => {\n const mode =\n typeof options.ignoreTryCatch === 'function'\n ? options.ignoreTryCatch(id)\n : Array.isArray(options.ignoreTryCatch)\n ? options.ignoreTryCatch.includes(id)\n : options.ignoreTryCatch || false;\n\n return {\n canConvertRequire: mode !== 'remove' && mode !== true,\n shouldRemoveRequireStatement: mode === 'remove'\n };\n };\n\n const resolveId = getResolveId(extensions);\n\n const sourceMap = options.sourceMap !== false;\n\n function transformAndCheckExports(code, id) {\n if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {\n code =\n getDynamicPackagesEntryIntro(dynamicRequireModuleDirPaths, dynamicRequireModuleSet) + code;\n }\n\n const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(\n this.parse,\n code,\n id\n );\n if (hasDefaultExport) {\n esModulesWithDefaultExport.add(id);\n }\n if (hasNamedExports) {\n esModulesWithNamedExports.add(id);\n }\n\n if (\n !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&\n (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))\n ) {\n return { meta: { commonjs: { isCommonJS: false } } };\n }\n\n let disableWrap = false;\n\n // avoid wrapping in createCommonjsModule, as this is a commonjsRegister call\n if (isModuleRegisterProxy(id)) {\n disableWrap = true;\n id = unwrapModuleRegisterProxy(id);\n }\n\n return transformCommonjs(\n this.parse,\n code,\n id,\n isEsModule,\n ignoreGlobal || isEsModule,\n ignoreRequire,\n getIgnoreTryCatchRequireStatementMode,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n disableWrap,\n commonDir,\n ast\n );\n }\n\n return {\n name: 'commonjs',\n\n buildStart() {\n validateRollupVersion(this.meta.rollupVersion, peerDependencies.rollup);\n if (options.namedExports != null) {\n this.warn(\n 'The namedExports option from \"@rollup/plugin-commonjs\" is deprecated. Named exports are now handled automatically.'\n );\n }\n },\n\n resolveId,\n\n load(id) {\n if (id === HELPERS_ID) {\n return getHelpersModule(isDynamicRequireModulesEnabled);\n }\n\n if (id.startsWith(HELPERS_ID)) {\n return getSpecificHelperProxy(id);\n }\n\n if (isWrappedId(id, EXTERNAL_SUFFIX)) {\n const actualId = unwrapId(id, EXTERNAL_SUFFIX);\n return getUnknownRequireProxy(\n actualId,\n isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true\n );\n }\n\n if (id === DYNAMIC_PACKAGES_ID) {\n return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);\n }\n\n if (id.startsWith(DYNAMIC_JSON_PREFIX)) {\n return getDynamicJsonProxy(id, commonDir);\n }\n\n if (isDynamicModuleImport(id, dynamicRequireModuleSet)) {\n return `export default require(${JSON.stringify(normalizePathSlashes(id))});`;\n }\n\n if (isModuleRegisterProxy(id)) {\n return getDynamicRequireProxy(\n normalizePathSlashes(unwrapModuleRegisterProxy(id)),\n commonDir\n );\n }\n\n if (isWrappedId(id, PROXY_SUFFIX)) {\n const actualId = unwrapId(id, PROXY_SUFFIX);\n return getStaticRequireProxy(\n actualId,\n getRequireReturnsDefault(actualId),\n esModulesWithDefaultExport,\n esModulesWithNamedExports\n );\n }\n\n return null;\n },\n\n transform(code, rawId) {\n let id = rawId;\n\n if (isModuleRegisterProxy(id)) {\n id = unwrapModuleRegisterProxy(id);\n }\n\n const extName = extname(id);\n if (\n extName !== '.cjs' &&\n id !== DYNAMIC_PACKAGES_ID &&\n !id.startsWith(DYNAMIC_JSON_PREFIX) &&\n (!filter(id) || !extensions.includes(extName))\n ) {\n return null;\n }\n\n try {\n return transformAndCheckExports.call(this, code, rawId);\n } catch (err) {\n return this.error(err, err.loc);\n }\n },\n\n moduleParsed({ id, meta: { commonjs } }) {\n if (commonjs) {\n const isCjs = commonjs.isCommonJS;\n if (isCjs != null) {\n setIsCjsPromise(id, isCjs);\n return;\n }\n }\n setIsCjsPromise(id, null);\n }\n };\n}\n"],"names":["nodeResolveSync"],"mappings":";;;;;;;;;;;;;;AAAO,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;AAC1C,EAAE,IAAI;AACN,IAAI,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,GAAG,CAAC,OAAO,GAAG,EAAE;AAChB,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/B,IAAI,MAAM,GAAG,CAAC;AACd,GAAG;AACH,CAAC;AACD;AACA,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE;AACA,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAC3D;AACO,SAAS,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE;AACnD,EAAE,MAAM,SAAS,GAAG,YAAY,GAAG,iBAAiB,GAAG,eAAe,CAAC;AACvE,EAAE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B;;AChBA;AAGA;AACe,SAAS,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;AACnE,EAAE,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACxC;AACA,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,EAAE,GAAG,EAAE,CAAC;AAChE;;AC/CO,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACxD,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAClD,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClF;AACO,MAAM,YAAY,GAAG,iBAAiB,CAAC;AACvC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD;AACO,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AAC7D,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AACjE;AACO,MAAM,UAAU,GAAG,sBAAsB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACA,MAAM,kBAAkB,GAAG,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACA,MAAM,eAAe,GAAG,CAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACO,SAAS,gBAAgB,CAAC,8BAA8B,EAAE;AACjE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,8BAA8B,GAAG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC;AAC9F;;AClPA;AAKA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;AACvD,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,EAAE,IAAI,YAAY,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;AACrD;AACA,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;AACpE,IAAI,YAAY,GAAG,mBAAmB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,GAAG;AAC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Ae,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAChC,KAAK;AACL,GAAG,CAAC;AACJ;;;;"} \ No newline at end of file
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js
index 659193fdeb9..712f6a7d81b 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js
@@ -1,227 +1,162 @@
'use strict';
-function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-
-var fs = require('fs');
var path = require('path');
var pluginutils = require('@rollup/pluginutils');
-var getCommonDir = _interopDefault(require('commondir'));
-var glob = _interopDefault(require('glob'));
+var getCommonDir = require('commondir');
+var fs = require('fs');
+var glob = require('glob');
var estreeWalker = require('estree-walker');
-var MagicString = _interopDefault(require('magic-string'));
+var MagicString = require('magic-string');
+var isReference = require('is-reference');
var resolve = require('resolve');
-var isReference = _interopDefault(require('is-reference'));
-function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
-}
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
-}
+var getCommonDir__default = /*#__PURE__*/_interopDefaultLegacy(getCommonDir);
+var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob);
+var MagicString__default = /*#__PURE__*/_interopDefaultLegacy(MagicString);
+var isReference__default = /*#__PURE__*/_interopDefaultLegacy(isReference);
-function _iterableToArrayLimit(arr, i) {
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
+var peerDependencies = {
+ rollup: "^2.30.0"
+};
+function tryParse(parse, code, id) {
try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
-
- if (i && _arr.length === i) break;
- }
+ return parse(code, { allowReturnOutsideFunction: true });
} catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
+ err.message += ` in ${id}`;
+ throw err;
}
-
- return _arr;
}
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(n);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
-}
-
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
-
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
- return arr2;
-}
+const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
-function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+function hasCjsKeywords(code, ignoreGlobal) {
+ const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
+ return firstpass.test(code);
}
-function _createForOfIteratorHelper(o) {
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
- if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) {
- var i = 0;
-
- var F = function () {};
+/* eslint-disable no-underscore-dangle */
- return {
- s: F,
- n: function () {
- if (i >= o.length) return {
- done: true
- };
- return {
- done: false,
- value: o[i++]
- };
- },
- e: function (e) {
- throw e;
- },
- f: F
- };
- }
+function analyzeTopLevelStatements(parse, code, id) {
+ const ast = tryParse(parse, code, id);
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
+ let isEsModule = false;
+ let hasDefaultExport = false;
+ let hasNamedExports = false;
- var it,
- normalCompletion = true,
- didErr = false,
- err;
- return {
- s: function () {
- it = o[Symbol.iterator]();
- },
- n: function () {
- var step = it.next();
- normalCompletion = step.done;
- return step;
- },
- e: function (e) {
- didErr = true;
- err = e;
- },
- f: function () {
- try {
- if (!normalCompletion && it.return != null) it.return();
- } finally {
- if (didErr) throw err;
- }
+ for (const node of ast.body) {
+ switch (node.type) {
+ case 'ExportDefaultDeclaration':
+ isEsModule = true;
+ hasDefaultExport = true;
+ break;
+ case 'ExportNamedDeclaration':
+ isEsModule = true;
+ if (node.declaration) {
+ hasNamedExports = true;
+ } else {
+ for (const specifier of node.specifiers) {
+ if (specifier.exported.name === 'default') {
+ hasDefaultExport = true;
+ } else {
+ hasNamedExports = true;
+ }
+ }
+ }
+ break;
+ case 'ExportAllDeclaration':
+ isEsModule = true;
+ if (node.exported && node.exported.name === 'default') {
+ hasDefaultExport = true;
+ } else {
+ hasNamedExports = true;
+ }
+ break;
+ case 'ImportDeclaration':
+ isEsModule = true;
+ break;
}
- };
-}
-
-var peerDependencies = {
- rollup: "^2.3.4"
-};
-
-/* eslint-disable no-undefined */
-const operators = {
- '==': x => equals(x.left, x.right, false),
- '!=': x => not(operators['=='](x)),
- '===': x => equals(x.left, x.right, true),
- '!==': x => not(operators['==='](x)),
- '!': x => isFalsy(x.argument),
- '&&': x => isTruthy(x.left) && isTruthy(x.right),
- '||': x => isTruthy(x.left) || isTruthy(x.right)
-};
-function flatten(node) {
- const parts = [];
-
- while (node.type === 'MemberExpression') {
- if (node.computed) return null;
- parts.unshift(node.property.name); // eslint-disable-next-line no-param-reassign
-
- node = node.object;
}
- if (node.type !== 'Identifier') return null;
- const _node = node,
- name = _node.name;
- parts.unshift(name);
- return {
- name,
- keypath: parts.join('.')
- };
-}
-
-function isTruthy(node) {
- if (node.type === 'Literal') return !!node.value;
- if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
- if (node.operator in operators) return operators[node.operator](node);
- return undefined;
-}
-function isFalsy(node) {
- return not(isTruthy(node));
-}
-
-function not(value) {
- return value === undefined ? value : !value;
+ return { isEsModule, hasDefaultExport, hasNamedExports, ast };
}
-function equals(a, b, strict) {
- if (a.type !== b.type) return undefined; // eslint-disable-next-line eqeqeq
-
- if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
- return undefined;
-}
+const isWrappedId = (id, suffix) => id.endsWith(suffix);
+const wrapId = (id, suffix) => `\0${id}${suffix}`;
+const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
const PROXY_SUFFIX = '?commonjs-proxy';
-const getProxyId = id => `\0${id}${PROXY_SUFFIX}`;
-const getIdFromProxyId = proxyId => proxyId.slice(1, -PROXY_SUFFIX.length);
+const REQUIRE_SUFFIX = '?commonjs-require';
const EXTERNAL_SUFFIX = '?commonjs-external';
-const getExternalProxyId = id => `\0${id}${EXTERNAL_SUFFIX}`;
-const getIdFromExternalProxyId = proxyId => proxyId.slice(1, -EXTERNAL_SUFFIX.length);
-const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
-const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
- if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);
- return path;
-};
-const DYNAMIC_REGISTER_PREFIX = '\0commonjs-dynamic-register:';
+
+const DYNAMIC_REGISTER_SUFFIX = '?commonjs-dynamic-register';
const DYNAMIC_JSON_PREFIX = '\0commonjs-dynamic-json:';
const DYNAMIC_PACKAGES_ID = '\0commonjs-dynamic-packages';
-const HELPERS_ID = '\0commonjsHelpers.js'; // `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
+
+const HELPERS_ID = '\0commonjsHelpers.js';
+
+// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
+// This will no longer be necessary once Rollup switches to ES6 output, likely
+// in Rollup 3
const HELPERS = `
export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-export function unwrapExports (x) {
+export function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
-export function createCommonjsModule(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
- }
- }, fn(module, module.exports), module.exports;
+export function getDefaultExportFromNamespaceIfPresent (n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
}
-export function getCjsExportFromNamespace (n) {
- return n && n['default'] || n;
+export function getDefaultExportFromNamespaceIfNotNamed (n) {
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
+}
+
+export function getAugmentedNamespace(n) {
+ if (n.__esModule) return n;
+ var a = Object.defineProperty({}, '__esModule', {value: true});
+ Object.keys(n).forEach(function (k) {
+ var d = Object.getOwnPropertyDescriptor(n, k);
+ Object.defineProperty(a, k, d.get ? d : {
+ enumerable: true,
+ get: function () {
+ return n[k];
+ }
+ });
+ });
+ return a;
}
`;
+
const HELPER_NON_DYNAMIC = `
-export function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
+export function createCommonjsModule(fn) {
+ var module = { exports: {} }
+ return fn(module, module.exports), module.exports;
+}
+
+export function commonjsRequire (target) {
+ throw new Error('Could not dynamically require "' + target + '". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.');
}
`;
+
const HELPERS_DYNAMIC = `
+export function createCommonjsModule(fn, basedir, module) {
+ return module = {
+ path: basedir,
+ exports: {},
+ require: function (path, base) {
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
+ }
+ }, fn(module, module.exports), module.exports;
+}
+
export function commonjsRegister (path, loader) {
DYNAMIC_REQUIRE_LOADERS[path] = loader;
}
@@ -308,10 +243,13 @@ function dirname (path) {
return '.';
}
-export function commonjsRequire (path, originalModuleDir) {
+export function commonjsResolveImpl (path, originalModuleDir, testCache) {
const shouldTryNodeModules = isPossibleNodeModulesPath(path);
path = normalize(path);
let relPath;
+ if (path[0] === '/') {
+ originalModuleDir = '/';
+ }
while (true) {
if (!shouldTryNodeModules) {
relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;
@@ -320,33 +258,18 @@ export function commonjsRequire (path, originalModuleDir) {
} else {
relPath = normalize(join('node_modules', path));
}
+
+ if (relPath.endsWith('/..')) {
+ break; // Travelled too far up, avoid infinite loop
+ }
+
for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {
const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];
- let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
- if (cachedModule) return cachedModule.exports;
- const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
- if (loader) {
- DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
- id: resolvedPath,
- filename: resolvedPath,
- path: dirname(resolvedPath),
- exports: {},
- parent: DEFAULT_PARENT_MODULE,
- loaded: false,
- children: [],
- paths: [],
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
- }
- };
- try {
- loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
- } catch (error) {
- delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
- throw error;
- }
- cachedModule.loaded = true;
- return cachedModule.exports;
+ if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {
+ return resolvedPath;
+ };
+ if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {
+ return resolvedPath;
};
}
if (!shouldTryNodeModules) break;
@@ -354,870 +277,1413 @@ export function commonjsRequire (path, originalModuleDir) {
if (nextDir === originalModuleDir) break;
originalModuleDir = nextDir;
}
+ return null;
+}
+
+export function commonjsResolve (path, originalModuleDir) {
+ const resolvedPath = commonjsResolveImpl(path, originalModuleDir);
+ if (resolvedPath !== null) {
+ return resolvedPath;
+ }
+ return require.resolve(path);
+}
+
+export function commonjsRequire (path, originalModuleDir) {
+ const resolvedPath = commonjsResolveImpl(path, originalModuleDir, true);
+ if (resolvedPath !== null) {
+ let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
+ if (cachedModule) return cachedModule.exports;
+ const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
+ if (loader) {
+ DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
+ id: resolvedPath,
+ filename: resolvedPath,
+ path: dirname(resolvedPath),
+ exports: {},
+ parent: DEFAULT_PARENT_MODULE,
+ loaded: false,
+ children: [],
+ paths: [],
+ require: function (path, base) {
+ return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
+ }
+ };
+ try {
+ loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
+ } catch (error) {
+ delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
+ throw error;
+ }
+ cachedModule.loaded = true;
+ return cachedModule.exports;
+ };
+ }
return require(path);
}
commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;
+commonjsRequire.resolve = commonjsResolve;
`;
-/* eslint-disable import/prefer-default-export */
-function getName(id) {
- const name = pluginutils.makeLegalIdentifier(path.basename(id, path.extname(id)));
-
- if (name !== 'index') {
- return name;
- }
-
- const segments = path.dirname(id).split(path.sep);
- return pluginutils.makeLegalIdentifier(segments[segments.length - 1]);
+function getHelpersModule(isDynamicRequireModulesEnabled) {
+ return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;
}
-const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(' ');
-const blacklist = {
- __esModule: true
-};
-reserved.forEach(word => blacklist[word] = true);
-const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
-const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
-const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
-const importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;
-const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
+/* eslint-disable import/prefer-default-export */
function deconflict(scope, globals, identifier) {
let i = 1;
let deconflicted = pluginutils.makeLegalIdentifier(identifier);
- while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
- deconflicted = `${identifier}_${i}`;
+ while (scope.contains(deconflicted) || globals.has(deconflicted)) {
+ deconflicted = pluginutils.makeLegalIdentifier(`${identifier}_${i}`);
i += 1;
}
-
+ // eslint-disable-next-line no-param-reassign
scope.declarations[deconflicted] = true;
+
return deconflicted;
}
-function tryParse(parse, code, id) {
- try {
- return parse(code, {
- allowReturnOutsideFunction: true
- });
- } catch (err) {
- err.message += ` in ${id}`;
- throw err;
+function getName(id) {
+ const name = pluginutils.makeLegalIdentifier(path.basename(id, path.extname(id)));
+ if (name !== 'index') {
+ return name;
}
+ const segments = path.dirname(id).split(path.sep);
+ return pluginutils.makeLegalIdentifier(segments[segments.length - 1]);
}
function normalizePathSlashes(path) {
return path.replace(/\\/g, '/');
}
-function hasCjsKeywords(code, ignoreGlobal) {
- const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
- return firstpass.test(code);
-}
-function checkEsModule(parse, code, id) {
- const ast = tryParse(parse, code, id);
- let isEsModule = false;
-
- var _iterator = _createForOfIteratorHelper(ast.body),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const node = _step.value;
- if (node.type === 'ExportDefaultDeclaration') return {
- isEsModule: true,
- hasDefaultExport: true,
- ast
- };
- if (node.type === 'ExportNamedDeclaration') {
- isEsModule = true;
-
- var _iterator2 = _createForOfIteratorHelper(node.specifiers),
- _step2;
+const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
+const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
+ const normalizedPath = normalizePathSlashes(path);
+ return normalizedPath.startsWith(commonDir)
+ ? VIRTUAL_PATH_BASE + normalizedPath.slice(commonDir.length)
+ : normalizedPath;
+};
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- const specifier = _step2.value;
+function getPackageEntryPoint(dirPath) {
+ let entryPoint = 'index.js';
- if (specifier.exported.name === 'default') {
- return {
- isEsModule: true,
- hasDefaultExport: true,
- ast
- };
- }
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- } else if (importExportDeclaration.test(node.type)) isEsModule = true;
+ try {
+ if (fs.existsSync(path.join(dirPath, 'package.json'))) {
+ entryPoint =
+ JSON.parse(fs.readFileSync(path.join(dirPath, 'package.json'), { encoding: 'utf8' })).main ||
+ entryPoint;
}
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
+ } catch (ignored) {
+ // ignored
}
- return {
- isEsModule,
- hasDefaultExport: false,
- ast
- };
+ return entryPoint;
}
-function getDefinePropertyCallName(node, targetName) {
- if (node.type !== 'CallExpression') return;
- const _node$callee = node.callee,
- object = _node$callee.object,
- property = _node$callee.property;
- if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
- if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
- if (node.arguments.length !== 3) return;
+function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {
+ let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;
+ for (const dir of dynamicRequireModuleDirPaths) {
+ const entryPoint = getPackageEntryPoint(dir);
+
+ code += `\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(dir, commonDir)
+ )}, function (module, exports) {
+ module.exports = require(${JSON.stringify(normalizePathSlashes(path.join(dir, entryPoint)))});
+});`;
+ }
+ return code;
+}
- const _node$arguments = _slicedToArray(node.arguments, 2),
- target = _node$arguments[0],
- val = _node$arguments[1];
+function getDynamicPackagesEntryIntro(
+ dynamicRequireModuleDirPaths,
+ dynamicRequireModuleSet
+) {
+ let dynamicImports = Array.from(
+ dynamicRequireModuleSet,
+ (dynamicId) => `require(${JSON.stringify(wrapModuleRegisterProxy(dynamicId))});`
+ ).join('\n');
- if (target.type !== 'Identifier' || target.name !== targetName) return; // eslint-disable-next-line consistent-return
+ if (dynamicRequireModuleDirPaths.length) {
+ dynamicImports += `require(${JSON.stringify(wrapModuleRegisterProxy(DYNAMIC_PACKAGES_ID))});`;
+ }
- return val.value;
+ return dynamicImports;
}
-function transformCommonjs(parse, code, id, isEntry, hasImporters, isEsModule, ignoreGlobal, ignoreRequire, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModuleSet, commonDir, astCache) {
- const ast = astCache || tryParse(parse, code, id);
- const magicString = new MagicString(code);
- const required = {}; // Because objects have no guaranteed ordering, yet we need it,
- // we need to keep track of the order in a array
+function wrapModuleRegisterProxy(id) {
+ return wrapId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- const sources = [];
- let uid = 0;
- let scope = pluginutils.attachScopes(ast, 'scope');
- const uses = {
- module: false,
- exports: false,
- global: false,
- require: false
- };
- let lexicalDepth = 0;
- let programDepth = 0;
- const globals = new Set(); // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
+function unwrapModuleRegisterProxy(id) {
+ return unwrapId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
- const namedExports = {}; // TODO handle transpiled modules
+function isModuleRegisterProxy(id) {
+ return isWrappedId(id, DYNAMIC_REGISTER_SUFFIX);
+}
- let shouldWrap = /__esModule/.test(code);
- let usesCommonjsHelpers = false;
+function isDynamicModuleImport(id, dynamicRequireModuleSet) {
+ const normalizedPath = normalizePathSlashes(id);
+ return dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json');
+}
- function isRequireStatement(node) {
- if (!node) return false;
- if (node.type !== 'CallExpression') return false; // Weird case of `require()` or `module.require()` without arguments
+function isDirectory(path) {
+ try {
+ if (fs.statSync(path).isDirectory()) return true;
+ } catch (ignored) {
+ // Nothing to do here
+ }
+ return false;
+}
- if (node.arguments.length === 0) return false;
- return isRequireIdentifier(node.callee);
+function getDynamicRequirePaths(patterns) {
+ const dynamicRequireModuleSet = new Set();
+ for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
+ const isNegated = pattern.startsWith('!');
+ const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
+ for (const path$1 of glob__default['default'].sync(isNegated ? pattern.substr(1) : pattern)) {
+ modifySet(normalizePathSlashes(path.resolve(path$1)));
+ if (isDirectory(path$1)) {
+ modifySet(normalizePathSlashes(path.resolve(path.join(path$1, getPackageEntryPoint(path$1)))));
+ }
+ }
}
+ const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter((path) =>
+ isDirectory(path)
+ );
+ return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };
+}
- function isRequireIdentifier(node) {
- if (!node) return false;
+const isCjsPromises = new Map();
- if (node.type === 'Identifier' && node.name === 'require'
- /* `require` */
- ) {
- // `require` is hidden by a variable in local scope
- if (scope.contains('require')) return false;
- return true;
- } else if (node.type === 'MemberExpression'
- /* `[something].[something]` */
- ) {
- // `module.[something]`
- if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false; // `module` is hidden by a variable in local scope
+function getIsCjsPromise(id) {
+ let isCjsPromise = isCjsPromises.get(id);
+ if (isCjsPromise) return isCjsPromise.promise;
- if (scope.contains('module')) return false; // `module.require(...)`
+ const promise = new Promise((resolve) => {
+ isCjsPromise = {
+ resolve,
+ promise: null
+ };
+ isCjsPromises.set(id, isCjsPromise);
+ });
+ isCjsPromise.promise = promise;
- if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;
- return true;
- }
+ return promise;
+}
- return false;
+function setIsCjsPromise(id, resolution) {
+ const isCjsPromise = isCjsPromises.get(id);
+ if (isCjsPromise) {
+ if (isCjsPromise.resolve) {
+ isCjsPromise.resolve(resolution);
+ isCjsPromise.resolve = null;
+ }
+ } else {
+ isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: null });
}
+}
- function hasDynamicArguments(node) {
- return node.arguments.length > 1 || node.arguments[0].type !== 'Literal' && (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0);
- }
+// e.g. id === "commonjsHelpers?commonjsRegister"
+function getSpecificHelperProxy(id) {
+ return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;
+}
- function isStaticRequireStatement(node) {
- if (!isRequireStatement(node)) return false;
- if (hasDynamicArguments(node)) return false;
- return true;
+function getUnknownRequireProxy(id, requireReturnsDefault) {
+ if (requireReturnsDefault === true || id.endsWith('.json')) {
+ return `export {default} from ${JSON.stringify(id)};`;
}
+ const name = getName(id);
+ const exported =
+ requireReturnsDefault === 'auto'
+ ? `import {getDefaultExportFromNamespaceIfNotNamed} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
+ : requireReturnsDefault === 'preferred'
+ ? `import {getDefaultExportFromNamespaceIfPresent} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
+ : !requireReturnsDefault
+ ? `import {getAugmentedNamespace} from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
+ : `export default ${name};`;
+ return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
+}
- function isIgnoredRequireStatement(requiredNode) {
- return ignoreRequire(requiredNode.arguments[0].value);
- }
+function getDynamicJsonProxy(id, commonDir) {
+ const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));
+ return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
+ )}, function (module, exports) {
+ module.exports = require(${JSON.stringify(normalizedPath)});
+});`;
+}
+
+function getDynamicRequireProxy(normalizedPath, commonDir) {
+ return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
+ )}, function (module, exports) {
+ ${fs.readFileSync(normalizedPath, { encoding: 'utf8' })}
+});`;
+}
- function getRequireStringArg(node) {
- return node.arguments[0].type === 'Literal' ? node.arguments[0].value : node.arguments[0].quasis[0].value.cooked;
+async function getStaticRequireProxy(
+ id,
+ requireReturnsDefault,
+ esModulesWithDefaultExport,
+ esModulesWithNamedExports
+) {
+ const name = getName(id);
+ const isCjs = await getIsCjsPromise(id);
+ if (isCjs) {
+ return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;
+ } else if (isCjs === null) {
+ return getUnknownRequireProxy(id, requireReturnsDefault);
+ } else if (!requireReturnsDefault) {
+ return `import {getAugmentedNamespace} from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
+ id
+ )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
+ } else if (
+ requireReturnsDefault !== true &&
+ (requireReturnsDefault === 'namespace' ||
+ !esModulesWithDefaultExport.has(id) ||
+ (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))
+ ) {
+ return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
}
+ return `export {default} from ${JSON.stringify(id)};`;
+}
- function getRequired(node, name) {
- let sourceId = getRequireStringArg(node);
- const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);
+/* eslint-disable no-param-reassign, no-undefined */
- if (isDynamicRegister) {
- sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);
- }
+function getCandidatesForExtension(resolved, extension) {
+ return [resolved + extension, `${resolved}${path.sep}index${extension}`];
+}
- const existing = required[sourceId]; // eslint-disable-next-line no-undefined
+function getCandidates(resolved, extensions) {
+ return extensions.reduce(
+ (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
+ [resolved]
+ );
+}
- if (existing === undefined) {
- const isDynamic = hasDynamicModuleForPath(sourceId);
+function getResolveId(extensions) {
+ function resolveExtensions(importee, importer) {
+ // not our problem
+ if (importee[0] !== '.' || !importer) return undefined;
- if (!name) {
- do {
- name = `require$$${uid}`;
- uid += 1;
- } while (scope.contains(name));
- }
+ const resolved = path.resolve(path.dirname(importer), importee);
+ const candidates = getCandidates(resolved, extensions);
- if (isDynamicRegister && sourceId.endsWith('.json')) {
- sourceId = DYNAMIC_JSON_PREFIX + sourceId;
+ for (let i = 0; i < candidates.length; i += 1) {
+ try {
+ const stats = fs.statSync(candidates[i]);
+ if (stats.isFile()) return { id: candidates[i] };
+ } catch (err) {
+ /* noop */
}
+ }
- if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {
- sources.push([sourceId, !isDynamicRegister]);
- }
+ return undefined;
+ }
- required[sourceId] = {
- source: sourceId,
- name,
- importsDefault: false,
- isDynamic
- };
+ return function resolveId(importee, rawImporter) {
+ const importer =
+ rawImporter && isModuleRegisterProxy(rawImporter)
+ ? unwrapModuleRegisterProxy(rawImporter)
+ : rawImporter;
+
+ // Proxies are only importing resolved ids, no need to resolve again
+ if (importer && isWrappedId(importer, PROXY_SUFFIX)) {
+ return importee;
}
- return required[sourceId];
- }
+ const isProxyModule = isWrappedId(importee, PROXY_SUFFIX);
+ const isRequiredModule = isWrappedId(importee, REQUIRE_SUFFIX);
+ let isModuleRegistration = false;
- function hasDynamicModuleForPath(source) {
- if (!/[/\\]/.test(source)) {
- try {
- const resolvedPath = normalizePathSlashes(resolve.sync(source, {
- basedir: path.dirname(id)
- }));
+ if (isProxyModule) {
+ importee = unwrapId(importee, PROXY_SUFFIX);
+ } else if (isRequiredModule) {
+ importee = unwrapId(importee, REQUIRE_SUFFIX);
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
- }
- } catch (ex) {
- // Probably a node.js internal module
- return false;
+ isModuleRegistration = isModuleRegisterProxy(importee);
+ if (isModuleRegistration) {
+ importee = unwrapModuleRegisterProxy(importee);
}
+ }
- return false;
+ if (
+ importee.startsWith(HELPERS_ID) ||
+ importee === DYNAMIC_PACKAGES_ID ||
+ importee.startsWith(DYNAMIC_JSON_PREFIX)
+ ) {
+ return importee;
}
- for (var _i = 0, _arr = ['', '.js', '.json']; _i < _arr.length; _i++) {
- const attemptExt = _arr[_i];
- const resolvedPath = normalizePathSlashes(path.resolve(path.dirname(id), source + attemptExt));
+ if (importee.startsWith('\0')) {
+ return null;
+ }
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
+ return this.resolve(importee, importer, {
+ skipSelf: true,
+ custom: { 'node-resolve': { isRequire: isProxyModule || isRequiredModule } }
+ }).then((resolved) => {
+ if (!resolved) {
+ resolved = resolveExtensions(importee, importer);
}
- }
+ if (resolved && isProxyModule) {
+ resolved.id = wrapId(resolved.id, resolved.external ? EXTERNAL_SUFFIX : PROXY_SUFFIX);
+ resolved.external = false;
+ } else if (resolved && isModuleRegistration) {
+ resolved.id = wrapModuleRegisterProxy(resolved.id);
+ } else if (!resolved && (isProxyModule || isRequiredModule)) {
+ return { id: wrapId(importee, EXTERNAL_SUFFIX), external: false };
+ }
+ return resolved;
+ });
+ };
+}
- return false;
+function validateRollupVersion(rollupVersion, peerDependencyVersion) {
+ const [major, minor] = rollupVersion.split('.').map(Number);
+ const versionRegexp = /\^(\d+\.\d+)\.\d+/g;
+ let minMajor = Infinity;
+ let minMinor = Infinity;
+ let foundVersion;
+ // eslint-disable-next-line no-cond-assign
+ while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {
+ const [foundMajor, foundMinor] = foundVersion[1].split('.').map(Number);
+ if (foundMajor < minMajor) {
+ minMajor = foundMajor;
+ minMinor = foundMinor;
+ }
+ }
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
+ throw new Error(
+ `Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minMajor}.${minMinor} but found rollup@${rollupVersion}.`
+ );
}
+}
- function shouldUseSimulatedRequire(required) {
- return hasDynamicModuleForPath(required.source) && ( // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.
- required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'));
- } // do a first pass, see which names are assigned to. This is necessary to prevent
- // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
- // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
+const operators = {
+ '==': (x) => equals(x.left, x.right, false),
+ '!=': (x) => not(operators['=='](x)),
- const assignedTo = new Set();
- estreeWalker.walk(ast, {
- enter(node) {
- if (node.type !== 'AssignmentExpression') return;
- if (node.left.type === 'MemberExpression') return;
- pluginutils.extractAssignedNames(node.left).forEach(name => {
- assignedTo.add(name);
- });
- }
+ '===': (x) => equals(x.left, x.right, true),
- });
- estreeWalker.walk(ast, {
- enter(node, parent) {
- if (sourceMap) {
- magicString.addSourcemapLocation(node.start);
- magicString.addSourcemapLocation(node.end);
- } // skip dead branches
+ '!==': (x) => not(operators['==='](x)),
+ '!': (x) => isFalsy(x.argument),
- if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {
- if (node === parent.consequent && isFalsy(parent.test)) {
- this.skip();
- return;
- }
+ '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
- if (node === parent.alternate && isTruthy(parent.test)) {
- this.skip();
- return;
- }
- }
+ '||': (x) => isTruthy(x.left) || isTruthy(x.right)
+};
- if (node._skip) {
- this.skip();
- return;
- }
+function not(value) {
+ return value === null ? value : !value;
+}
- programDepth += 1;
+function equals(a, b, strict) {
+ if (a.type !== b.type) return null;
+ // eslint-disable-next-line eqeqeq
+ if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
+ return null;
+}
- if (node.scope) {
- scope = node.scope;
- }
+function isTruthy(node) {
+ if (!node) return false;
+ if (node.type === 'Literal') return !!node.value;
+ if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
+ if (node.operator in operators) return operators[node.operator](node);
+ return null;
+}
- if (functionType.test(node.type)) lexicalDepth += 1; // if toplevel return, we need to wrap it
+function isFalsy(node) {
+ return not(isTruthy(node));
+}
- if (node.type === 'ReturnStatement' && lexicalDepth === 0) {
- shouldWrap = true;
- } // rewrite `this` as `commonjsHelpers.commonjsGlobal`
+function getKeypath(node) {
+ const parts = [];
+ while (node.type === 'MemberExpression') {
+ if (node.computed) return null;
- if (node.type === 'ThisExpression' && lexicalDepth === 0) {
- uses.global = true;
+ parts.unshift(node.property.name);
+ // eslint-disable-next-line no-param-reassign
+ node = node.object;
+ }
- if (!ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
+ if (node.type !== 'Identifier') return null;
- return;
- } // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
+ const { name } = node;
+ parts.unshift(name);
+ return { name, keypath: parts.join('.') };
+}
- if (node.type === 'UnaryExpression' && node.operator === 'typeof') {
- const flattened = flatten(node.argument);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
+const KEY_COMPILED_ESM = '__esModule';
- if (flattened.keypath === 'module.exports' || flattened.keypath === 'module' || flattened.keypath === 'exports') {
- magicString.overwrite(node.start, node.end, `'object'`, {
- storeName: false
- });
- }
- } // rewrite `require` (if not already handled) `global` and `define`, and handle free references to
- // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule
+function isDefineCompiledEsm(node) {
+ const definedProperty =
+ getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');
+ if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {
+ return isTruthy(definedProperty.value);
+ }
+ return false;
+}
+function getDefinePropertyCallName(node, targetName) {
+ const targetNames = targetName.split('.');
- if (node.type === 'Identifier') {
- if (isReference(node, parent) && !scope.contains(node.name)) {
- if (node.name in uses) {
- if (isRequireIdentifier(node)) {
- if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {
- return;
- }
+ const {
+ callee: { object, property }
+ } = node;
+ if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
+ if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
+ if (node.arguments.length !== 3) return;
- if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {
- magicString.appendLeft(parent.end - 1, `,${JSON.stringify(path.dirname(id) === '.' ? null
- /* default behavior */
- : getVirtualPathForDynamicRequirePath(normalizePathSlashes(path.dirname(id)), commonDir))}`);
- }
+ const [target, key, value] = node.arguments;
+ if (targetNames.length === 1) {
+ if (target.type !== 'Identifier' || target.name !== targetNames[0]) {
+ return;
+ }
+ }
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
+ if (targetNames.length === 2) {
+ if (
+ target.type !== 'MemberExpression' ||
+ target.object.name !== targetNames[0] ||
+ target.property.name !== targetNames[1]
+ ) {
+ return;
+ }
+ }
- uses[node.name] = true;
+ if (value.type !== 'ObjectExpression' || !value.properties) return;
- if (node.name === 'global' && !ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- } // if module or exports are used outside the context of an assignment
- // expression, we need to wrap the module
+ const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value');
+ if (!valueProperty || !valueProperty.value) return;
+ // eslint-disable-next-line consistent-return
+ return { key: key.value, value: valueProperty.value };
+}
- if (node.name === 'module' || node.name === 'exports') {
- shouldWrap = true;
- }
- }
+function isLocallyShadowed(name, scope) {
+ while (scope.parent) {
+ if (scope.declarations[name]) {
+ return true;
+ }
+ // eslint-disable-next-line no-param-reassign
+ scope = scope.parent;
+ }
+ return false;
+}
- if (node.name === 'define') {
- magicString.overwrite(node.start, node.end, 'undefined', {
- storeName: true
- });
- }
+function isShorthandProperty(parent) {
+ return parent && parent.type === 'Property' && parent.shorthand;
+}
- globals.add(node.name);
- }
+function wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath) {
+ const args = `module${uses.exports ? ', exports' : ''}`;
- return;
- } // Is this an assignment to exports or module.exports?
-
-
- if (node.type === 'AssignmentExpression') {
- if (node.left.type !== 'MemberExpression') return;
- const flattened = flatten(node.left);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
- const match = exportsPattern.exec(flattened.keypath);
- if (!match || flattened.keypath === 'exports') return;
- uses[flattened.name] = true; // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
- // if this isn't top-level, we'll need to wrap the module
-
- if (programDepth > 3) shouldWrap = true;
- node.left._skip = true;
-
- if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
- node.right.properties.forEach(prop => {
- if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
- const name = prop.key.name;
- if (name === pluginutils.makeLegalIdentifier(name)) namedExports[name] = true;
- });
- return;
- }
+ magicString
+ .trim()
+ .prepend(`var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`)
+ .append(
+ `\n}${virtualDynamicRequirePath ? `, ${JSON.stringify(virtualDynamicRequirePath)}` : ''});`
+ );
+}
- if (match[1]) namedExports[match[1]] = true;
- return;
+function rewriteExportsAndGetExportsBlock(
+ magicString,
+ moduleName,
+ wrapped,
+ topLevelModuleExportsAssignments,
+ topLevelExportsAssignmentsByName,
+ defineCompiledEsmExpressions,
+ deconflict,
+ isRestorableCompiledEsm,
+ code,
+ uses,
+ HELPERS_NAME
+) {
+ const namedExportDeclarations = [`export { ${moduleName} as __moduleExports };`];
+ const moduleExportsPropertyAssignments = [];
+ let deconflictedDefaultExportName;
+
+ if (!wrapped) {
+ let hasModuleExportsAssignment = false;
+ const namedExportProperties = [];
+
+ // Collect and rewrite module.exports assignments
+ for (const { left } of topLevelModuleExportsAssignments) {
+ hasModuleExportsAssignment = true;
+ magicString.overwrite(left.start, left.end, `var ${moduleName}`);
+ }
+
+ // Collect and rewrite named exports
+ for (const [exportName, node] of topLevelExportsAssignmentsByName) {
+ const deconflicted = deconflict(exportName);
+ magicString.overwrite(node.start, node.left.end, `var ${deconflicted}`);
+
+ if (exportName === 'default') {
+ deconflictedDefaultExportName = deconflicted;
+ } else {
+ namedExportDeclarations.push(
+ exportName === deconflicted
+ ? `export { ${exportName} };`
+ : `export { ${deconflicted} as ${exportName} };`
+ );
}
- const name = getDefinePropertyCallName(node, 'exports');
- if (name && name === pluginutils.makeLegalIdentifier(name)) namedExports[name] = true; // if this is `var x = require('x')`, we can do `import x from 'x'`
+ if (hasModuleExportsAssignment) {
+ moduleExportsPropertyAssignments.push(`${moduleName}.${exportName} = ${deconflicted};`);
+ } else {
+ namedExportProperties.push(`\t${exportName}: ${deconflicted}`);
+ }
+ }
- if (node.type === 'VariableDeclarator' && node.id.type === 'Identifier' && isStaticRequireStatement(node.init) && !isIgnoredRequireStatement(node.init)) {
- // for now, only do this for top-level requires. maybe fix this in future
- if (scope.parent) return; // edge case — CJS allows you to assign to imports. ES doesn't
+ // Regenerate CommonJS namespace
+ if (!hasModuleExportsAssignment) {
+ const moduleExports = `{\n${namedExportProperties.join(',\n')}\n}`;
+ magicString
+ .trim()
+ .append(
+ `\n\nvar ${moduleName} = ${
+ isRestorableCompiledEsm
+ ? `/*#__PURE__*/Object.defineProperty(${moduleExports}, '__esModule', {value: true})`
+ : moduleExports
+ };`
+ );
+ }
+ }
- if (assignedTo.has(node.id.name)) return;
- const required = getRequired(node.init, node.id.name);
- required.importsDefault = true;
+ // Generate default export
+ const defaultExport = [];
+ if (isRestorableCompiledEsm) {
+ defaultExport.push(`export default ${deconflictedDefaultExportName || moduleName};`);
+ } else if (
+ (wrapped || deconflictedDefaultExportName) &&
+ (defineCompiledEsmExpressions.length > 0 || code.indexOf('__esModule') >= 0)
+ ) {
+ // eslint-disable-next-line no-param-reassign
+ uses.commonjsHelpers = true;
+ defaultExport.push(
+ `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`
+ );
+ } else {
+ defaultExport.push(`export default ${moduleName};`);
+ }
- if (required.name === node.id.name && !required.isDynamic) {
- node._shouldRemove = true;
- }
- }
+ return `\n\n${defaultExport
+ .concat(namedExportDeclarations)
+ .concat(moduleExportsPropertyAssignments)
+ .join('\n')}`;
+}
- if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {
- return;
- }
+function isRequireStatement(node, scope) {
+ if (!node) return false;
+ if (node.type !== 'CallExpression') return false;
- const required = getRequired(node);
+ // Weird case of `require()` or `module.require()` without arguments
+ if (node.arguments.length === 0) return false;
- if (parent.type === 'ExpressionStatement') {
- // is a bare import, e.g. `require('foo');`
- magicString.remove(parent.start, parent.end);
- } else {
- required.importsDefault = true;
+ return isRequire(node.callee, scope);
+}
- if (shouldUseSimulatedRequire(required)) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir))}, ${JSON.stringify(path.dirname(id) === '.' ? null
- /* default behavior */
- : getVirtualPathForDynamicRequirePath(normalizePathSlashes(path.dirname(id)), commonDir))})`);
- usesCommonjsHelpers = true;
- } else {
- magicString.overwrite(node.start, node.end, required.name);
- }
- }
+function isRequire(node, scope) {
+ return (
+ (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) ||
+ (node.type === 'MemberExpression' && isModuleRequire(node, scope))
+ );
+}
- node.callee._skip = true;
- },
+function isModuleRequire({ object, property }, scope) {
+ return (
+ object.type === 'Identifier' &&
+ object.name === 'module' &&
+ property.type === 'Identifier' &&
+ property.name === 'require' &&
+ !scope.contains('module')
+ );
+}
- leave(node) {
- programDepth -= 1;
- if (node.scope) scope = scope.parent;
- if (functionType.test(node.type)) lexicalDepth -= 1;
+function isStaticRequireStatement(node, scope) {
+ if (!isRequireStatement(node, scope)) return false;
+ return !hasDynamicArguments(node);
+}
+
+function hasDynamicArguments(node) {
+ return (
+ node.arguments.length > 1 ||
+ (node.arguments[0].type !== 'Literal' &&
+ (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
+ );
+}
- if (node.type === 'VariableDeclaration') {
- let keepDeclaration = false;
- let c = node.declarations[0].start;
+const reservedMethod = { resolve: true, cache: true, main: true };
- for (let i = 0; i < node.declarations.length; i += 1) {
- const declarator = node.declarations[i];
+function isNodeRequirePropertyAccess(parent) {
+ return parent && parent.property && reservedMethod[parent.property.name];
+}
- if (declarator._shouldRemove) {
- magicString.remove(c, declarator.end);
- } else {
- if (!keepDeclaration) {
- magicString.remove(c, declarator.start);
- keepDeclaration = true;
- }
+function isIgnoredRequireStatement(requiredNode, ignoreRequire) {
+ return ignoreRequire(requiredNode.arguments[0].value);
+}
- c = declarator.end;
- }
- }
+function getRequireStringArg(node) {
+ return node.arguments[0].type === 'Literal'
+ ? node.arguments[0].value
+ : node.arguments[0].quasis[0].value.cooked;
+}
- if (!keepDeclaration) {
- magicString.remove(node.start, node.end);
- }
+function hasDynamicModuleForPath(source, id, dynamicRequireModuleSet) {
+ if (!/^(?:\.{0,2}[/\\]|[A-Za-z]:[/\\])/.test(source)) {
+ try {
+ const resolvedPath = normalizePathSlashes(resolve.sync(source, { basedir: path.dirname(id) }));
+ if (dynamicRequireModuleSet.has(resolvedPath)) {
+ return true;
}
+ } catch (ex) {
+ // Probably a node.js internal module
+ return false;
}
- });
+ return false;
+ }
- if (!sources.length && !uses.module && !uses.exports && !uses.require && (ignoreGlobal || !uses.global)) {
- // not a CommonJS module
- return null;
- } // If `isEsModule` is on, it means it has ES6 import/export statements,
- // which just can't be wrapped in a function.
-
-
- if (isEsModule) shouldWrap = false;
- usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;
- const importBlock = `${(usesCommonjsHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : []).concat(sources.map(([source]) => // import the actual module before the proxy, so that we know
- // what kind of proxy to build
- `import '${source}';`), sources.filter(([, importProxy]) => importProxy).map(([source]) => {
- const _required$source = required[source],
- name = _required$source.name,
- importsDefault = _required$source.importsDefault;
- return `import ${importsDefault ? `${name} from ` : ``}'${getProxyId(source)}';`;
- })).join('\n')}\n\n`;
- const namedExportDeclarations = [];
- let wrapperStart = '';
- let wrapperEnd = '';
- const moduleName = deconflict(scope, globals, getName(id));
+ for (const attemptExt of ['', '.js', '.json']) {
+ const resolvedPath = normalizePathSlashes(path.resolve(path.dirname(id), source + attemptExt));
+ if (dynamicRequireModuleSet.has(resolvedPath)) {
+ return true;
+ }
+ }
- if ((!isEntry || hasImporters) && !isEsModule) {
- const exportModuleExports = {
- str: `export { ${moduleName} as __moduleExports };`,
- name: '__moduleExports'
- };
- namedExportDeclarations.push(exportModuleExports);
+ return false;
+}
+
+function getRequireHandlers() {
+ const requiredSources = [];
+ const requiredBySource = Object.create(null);
+ const requiredByNode = new Map();
+ const requireExpressionsWithUsedReturnValue = [];
+
+ function addRequireStatement(sourceId, node, scope, usesReturnValue) {
+ const required = getRequired(sourceId);
+ requiredByNode.set(node, { scope, required });
+ if (usesReturnValue) {
+ required.nodesUsingRequired.push(node);
+ requireExpressionsWithUsedReturnValue.push(node);
+ }
}
- const defaultExportPropertyAssignments = [];
- let hasDefaultExport = false;
+ function getRequired(sourceId) {
+ if (!requiredBySource[sourceId]) {
+ requiredSources.push(sourceId);
- if (shouldWrap) {
- const args = `module${uses.exports ? ', exports' : ''}`;
- wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`;
- wrapperEnd = `\n}`;
+ requiredBySource[sourceId] = {
+ source: sourceId,
+ name: null,
+ nodesUsingRequired: []
+ };
+ }
+
+ return requiredBySource[sourceId];
+ }
+
+ function rewriteRequireExpressionsAndGetImportBlock(
+ magicString,
+ topLevelDeclarations,
+ topLevelRequireDeclarators,
+ reassignedNames,
+ helpersNameIfUsed,
+ dynamicRegisterSources
+ ) {
+ const removedDeclarators = getDeclaratorsReplacedByImportsAndSetImportNames(
+ topLevelRequireDeclarators,
+ requiredByNode,
+ reassignedNames
+ );
+ setRemainingImportNamesAndRewriteRequires(
+ requireExpressionsWithUsedReturnValue,
+ requiredByNode,
+ magicString
+ );
+ removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString);
+ const importBlock = `${(helpersNameIfUsed
+ ? [`import * as ${helpersNameIfUsed} from '${HELPERS_ID}';`]
+ : []
+ )
+ .concat(
+ // dynamic registers first, as the may be required in the other modules
+ [...dynamicRegisterSources].map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),
+
+ // now the actual modules so that they are analyzed before creating the proxies;
+ // no need to do this for virtual modules as we never proxy them
+ requiredSources
+ .filter((source) => !source.startsWith('\0'))
+ .map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),
+
+ // now the proxy modules
+ requiredSources.map((source) => {
+ const { name, nodesUsingRequired } = requiredBySource[source];
+ return `import ${nodesUsingRequired.length ? `${name} from ` : ``}'${
+ source.startsWith('\0') ? source : wrapId(source, PROXY_SUFFIX)
+ }';`;
+ })
+ )
+ .join('\n')}`;
+ return importBlock ? `${importBlock}\n\n` : '';
+ }
+
+ return {
+ addRequireStatement,
+ requiredSources,
+ rewriteRequireExpressionsAndGetImportBlock
+ };
+}
- if (isDynamicRequireModulesEnabled) {
- wrapperEnd += `, ${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(path.dirname(id)), commonDir))}`;
+function getDeclaratorsReplacedByImportsAndSetImportNames(
+ topLevelRequireDeclarators,
+ requiredByNode,
+ reassignedNames
+) {
+ const removedDeclarators = new Set();
+ for (const declarator of topLevelRequireDeclarators) {
+ const { required } = requiredByNode.get(declarator.init);
+ if (!required.name) {
+ const potentialName = declarator.id.name;
+ if (
+ !reassignedNames.has(potentialName) &&
+ !required.nodesUsingRequired.some((node) =>
+ isLocallyShadowed(potentialName, requiredByNode.get(node).scope)
+ )
+ ) {
+ required.name = potentialName;
+ removedDeclarators.add(declarator);
+ }
}
+ }
+ return removedDeclarators;
+}
- wrapperEnd += `);`;
- } else {
- const names = [];
+function setRemainingImportNamesAndRewriteRequires(
+ requireExpressionsWithUsedReturnValue,
+ requiredByNode,
+ magicString
+) {
+ let uid = 0;
+ for (const requireExpression of requireExpressionsWithUsedReturnValue) {
+ const { required } = requiredByNode.get(requireExpression);
+ if (!required.name) {
+ let potentialName;
+ const isUsedName = (node) => requiredByNode.get(node).scope.contains(potentialName);
+ do {
+ potentialName = `require$$${uid}`;
+ uid += 1;
+ } while (required.nodesUsingRequired.some(isUsedName));
+ required.name = potentialName;
+ }
+ magicString.overwrite(requireExpression.start, requireExpression.end, required.name);
+ }
+}
- var _iterator3 = _createForOfIteratorHelper(ast.body),
- _step3;
+function removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString) {
+ for (const declaration of topLevelDeclarations) {
+ let keepDeclaration = false;
+ let [{ start }] = declaration.declarations;
+ for (const declarator of declaration.declarations) {
+ if (removedDeclarators.has(declarator)) {
+ magicString.remove(start, declarator.end);
+ } else if (!keepDeclaration) {
+ magicString.remove(start, declarator.start);
+ keepDeclaration = true;
+ }
+ start = declarator.end;
+ }
+ if (!keepDeclaration) {
+ magicString.remove(declaration.start, declaration.end);
+ }
+ }
+}
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- const node = _step3.value;
+/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
- if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {
- const left = node.expression.left;
- const flattened = flatten(left);
+const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
- if (!flattened) {
- continue;
- }
+const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
- const match = exportsPattern.exec(flattened.keypath);
+function transformCommonjs(
+ parse,
+ code,
+ id,
+ isEsModule,
+ ignoreGlobal,
+ ignoreRequire,
+ getIgnoreTryCatchRequireStatementMode,
+ sourceMap,
+ isDynamicRequireModulesEnabled,
+ dynamicRequireModuleSet,
+ disableWrap,
+ commonDir,
+ astCache
+) {
+ const ast = astCache || tryParse(parse, code, id);
+ const magicString = new MagicString__default['default'](code);
+ const uses = {
+ module: false,
+ exports: false,
+ global: false,
+ require: false,
+ commonjsHelpers: false
+ };
+ const virtualDynamicRequirePath =
+ isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(path.dirname(id), commonDir);
+ let scope = pluginutils.attachScopes(ast, 'scope');
+ let lexicalDepth = 0;
+ let programDepth = 0;
+ let currentTryBlockEnd = null;
+ let shouldWrap = false;
+ const defineCompiledEsmExpressions = [];
- if (!match) {
- continue;
- }
+ const globals = new Set();
- if (flattened.keypath === 'module.exports') {
- hasDefaultExport = true;
- magicString.overwrite(left.start, left.end, `var ${moduleName}`);
- } else {
- const _match = _slicedToArray(match, 2),
- name = _match[1];
+ // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
+ const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
+ const namedExports = {};
+ const dynamicRegisterSources = new Set();
+ let hasRemovedRequire = false;
- const deconflicted = deconflict(scope, globals, name);
- names.push({
- name,
- deconflicted
- });
- magicString.overwrite(node.start, left.end, `var ${deconflicted}`);
- const declaration = name === deconflicted ? `export { ${name} };` : `export { ${deconflicted} as ${name} };`;
+ const {
+ addRequireStatement,
+ requiredSources,
+ rewriteRequireExpressionsAndGetImportBlock
+ } = getRequireHandlers();
- if (name !== 'default') {
- namedExportDeclarations.push({
- str: declaration,
- name
- });
- }
+ // See which names are assigned to. This is necessary to prevent
+ // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
+ // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
+ const reassignedNames = new Set();
+ const topLevelDeclarations = [];
+ const topLevelRequireDeclarators = new Set();
+ const skippedNodes = new Set();
+ const topLevelModuleExportsAssignments = [];
+ const topLevelExportsAssignmentsByName = new Map();
- defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);
- }
- }
+ estreeWalker.walk(ast, {
+ enter(node, parent) {
+ if (skippedNodes.has(node)) {
+ this.skip();
+ return;
}
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- if (!hasDefaultExport && (names.length || (!isEntry || hasImporters) && !isEsModule)) {
- wrapperEnd = `\n\nvar ${moduleName} = {\n${names.map(({
- name,
- deconflicted
- }) => `\t${name}: ${deconflicted}`).join(',\n')}\n};`;
- }
- }
+ if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) {
+ currentTryBlockEnd = null;
+ }
- const defaultExport = /__esModule/.test(code) ? `export default /*@__PURE__*/${HELPERS_NAME}.unwrapExports(${moduleName});` : `export default ${moduleName};`;
- const named = namedExportDeclarations.filter(x => x.name !== 'default' || !hasDefaultExport).map(x => x.str);
- const exportBlock = `\n\n${(isEsModule ? [] : [defaultExport]).concat(named).concat(hasDefaultExport ? defaultExportPropertyAssignments : []).join('\n')}`;
- magicString.trim().prepend(importBlock + wrapperStart).trim().append(wrapperEnd);
- const injectExportBlock = hasDefaultExport || named.length > 0 || shouldWrap || !isEntry || hasImporters;
+ programDepth += 1;
+ if (node.scope) ({ scope } = node);
+ if (functionType.test(node.type)) lexicalDepth += 1;
+ if (sourceMap) {
+ magicString.addSourcemapLocation(node.start);
+ magicString.addSourcemapLocation(node.end);
+ }
- if (injectExportBlock) {
- magicString.append(exportBlock);
- }
+ // eslint-disable-next-line default-case
+ switch (node.type) {
+ case 'TryStatement':
+ if (currentTryBlockEnd === null) {
+ currentTryBlockEnd = node.block.end;
+ }
+ return;
+ case 'AssignmentExpression':
+ if (node.left.type === 'MemberExpression') {
+ const flattened = getKeypath(node.left);
+ if (!flattened || scope.contains(flattened.name)) return;
- code = magicString.toString();
- const map = sourceMap ? magicString.generateMap() : null;
- return {
- code,
- map,
- syntheticNamedExports: injectExportBlock
- };
-}
+ const exportsPatternMatch = exportsPattern.exec(flattened.keypath);
+ if (!exportsPatternMatch || flattened.keypath === 'exports') return;
-function getDynamicRequirePaths(patterns) {
- const dynamicRequireModuleSet = new Set();
+ const [, exportName] = exportsPatternMatch;
+ uses[flattened.name] = true;
- var _iterator = _createForOfIteratorHelper(!patterns || Array.isArray(patterns) ? patterns || [] : [patterns]),
- _step;
+ // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
+ if (programDepth > 3) {
+ shouldWrap = true;
+ } else if (exportName === KEY_COMPILED_ESM) {
+ defineCompiledEsmExpressions.push(parent);
+ } else if (flattened.keypath === 'module.exports') {
+ topLevelModuleExportsAssignments.push(node);
+ } else if (!topLevelExportsAssignmentsByName.has(exportName)) {
+ topLevelExportsAssignmentsByName.set(exportName, node);
+ } else {
+ shouldWrap = true;
+ }
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const pattern = _step.value;
- const isNegated = pattern.startsWith('!');
- const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
+ skippedNodes.add(node.left);
- var _iterator2 = _createForOfIteratorHelper(glob.sync(isNegated ? pattern.substr(1) : pattern)),
- _step2;
+ if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
+ node.right.properties.forEach((prop) => {
+ if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
+ const { name } = prop.key;
+ if (name === pluginutils.makeLegalIdentifier(name)) namedExports[name] = true;
+ });
+ return;
+ }
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- const path$1 = _step2.value;
- modifySet(normalizePathSlashes(path.resolve(path$1)));
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
+ if (exportsPatternMatch[1]) namedExports[exportsPatternMatch[1]] = true;
+ } else {
+ for (const name of pluginutils.extractAssignedNames(node.left)) {
+ reassignedNames.add(name);
+ }
+ }
+ return;
+ case 'CallExpression': {
+ if (isDefineCompiledEsm(node)) {
+ if (programDepth === 3 && parent.type === 'ExpressionStatement') {
+ // skip special handling for [module.]exports until we know we render this
+ skippedNodes.add(node.arguments[0]);
+ defineCompiledEsmExpressions.push(parent);
+ } else {
+ shouldWrap = true;
+ }
+ return;
+ }
- const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(path => {
- try {
- if (fs.statSync(path).isDirectory()) return true;
- } catch (ignored) {// Nothing to do here
- }
+ if (
+ node.callee.object &&
+ node.callee.object.name === 'require' &&
+ node.callee.property.name === 'resolve' &&
+ hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)
+ ) {
+ const requireNode = node.callee.object;
+ magicString.appendLeft(
+ node.end - 1,
+ `,${JSON.stringify(
+ path.dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )}`
+ );
+ magicString.overwrite(
+ requireNode.start,
+ requireNode.end,
+ `${HELPERS_NAME}.commonjsRequire`,
+ {
+ storeName: true
+ }
+ );
+ uses.commonjsHelpers = true;
+ return;
+ }
- return false;
- });
- return {
- dynamicRequireModuleSet,
- dynamicRequireModuleDirPaths
- };
-}
+ if (!isStaticRequireStatement(node, scope)) return;
+ if (!isDynamicRequireModulesEnabled) {
+ skippedNodes.add(node.callee);
+ }
+ if (!isIgnoredRequireStatement(node, ignoreRequire)) {
+ skippedNodes.add(node.callee);
+ const usesReturnValue = parent.type !== 'ExpressionStatement';
-/* eslint-disable no-undefined */
-const isCjsPromises = new Map();
-function getIsCjsPromise(id) {
- let isCjsPromise = isCjsPromises.get(id);
- if (isCjsPromise) return isCjsPromise.promise;
- const promise = new Promise(resolve => {
- isCjsPromise = {
- resolve,
- promise: undefined
- };
- isCjsPromises.set(id, isCjsPromise);
- });
- isCjsPromise.promise = promise;
- return promise;
-}
-function setIsCjsPromise(id, resolution) {
- const isCjsPromise = isCjsPromises.get(id);
+ let canConvertRequire = true;
+ let shouldRemoveRequireStatement = false;
- if (isCjsPromise) {
- if (isCjsPromise.resolve) {
- isCjsPromise.resolve(resolution);
- isCjsPromise.resolve = undefined;
- }
- } else {
- isCjsPromises.set(id, {
- promise: Promise.resolve(resolution),
- resolve: undefined
- });
- }
-}
+ if (currentTryBlockEnd !== null) {
+ ({
+ canConvertRequire,
+ shouldRemoveRequireStatement
+ } = getIgnoreTryCatchRequireStatementMode(node.arguments[0].value));
-/* eslint-disable no-param-reassign, no-undefined */
+ if (shouldRemoveRequireStatement) {
+ hasRemovedRequire = true;
+ }
+ }
-function getCandidatesForExtension(resolved, extension) {
- return [resolved + extension, `${resolved}${path.sep}index${extension}`];
-}
+ let sourceId = getRequireStringArg(node);
+ const isDynamicRegister = isModuleRegisterProxy(sourceId);
+ if (isDynamicRegister) {
+ sourceId = unwrapModuleRegisterProxy(sourceId);
+ if (sourceId.endsWith('.json')) {
+ sourceId = DYNAMIC_JSON_PREFIX + sourceId;
+ }
+ dynamicRegisterSources.add(wrapModuleRegisterProxy(sourceId));
+ } else {
+ if (
+ !sourceId.endsWith('.json') &&
+ hasDynamicModuleForPath(sourceId, id, dynamicRequireModuleSet)
+ ) {
+ if (shouldRemoveRequireStatement) {
+ magicString.overwrite(node.start, node.end, `undefined`);
+ } else if (canConvertRequire) {
+ magicString.overwrite(
+ node.start,
+ node.end,
+ `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(
+ getVirtualPathForDynamicRequirePath(sourceId, commonDir)
+ )}, ${JSON.stringify(
+ path.dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )})`
+ );
+ uses.commonjsHelpers = true;
+ }
+ return;
+ }
-function getCandidates(resolved, extensions) {
- return extensions.reduce((paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)), [resolved]);
-}
+ if (canConvertRequire) {
+ addRequireStatement(sourceId, node, scope, usesReturnValue);
+ }
+ }
-function getResolveId(extensions) {
- function resolveExtensions(importee, importer) {
- // not our problem
- if (importee[0] !== '.' || !importer) return undefined;
- const resolved = path.resolve(path.dirname(importer), importee);
- const candidates = getCandidates(resolved, extensions);
+ if (usesReturnValue) {
+ if (shouldRemoveRequireStatement) {
+ magicString.overwrite(node.start, node.end, `undefined`);
+ return;
+ }
- for (let i = 0; i < candidates.length; i += 1) {
- try {
- const stats = fs.statSync(candidates[i]);
- if (stats.isFile()) return {
- id: candidates[i]
- };
- } catch (err) {
- /* noop */
- }
- }
+ if (
+ parent.type === 'VariableDeclarator' &&
+ !scope.parent &&
+ parent.id.type === 'Identifier'
+ ) {
+ // This will allow us to reuse this variable name as the imported variable if it is not reassigned
+ // and does not conflict with variables in other places where this is imported
+ topLevelRequireDeclarators.add(parent);
+ }
+ } else {
+ // This is a bare import, e.g. `require('foo');`
- return undefined;
- }
+ if (!canConvertRequire && !shouldRemoveRequireStatement) {
+ return;
+ }
- function resolveId(importee, importer) {
- const isProxyModule = importee.endsWith(PROXY_SUFFIX);
+ magicString.remove(parent.start, parent.end);
+ }
+ }
+ return;
+ }
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ // skip dead branches
+ if (isFalsy(node.test)) {
+ skippedNodes.add(node.consequent);
+ } else if (node.alternate && isTruthy(node.test)) {
+ skippedNodes.add(node.alternate);
+ }
+ return;
+ case 'Identifier': {
+ const { name } = node;
+ if (!(isReference__default['default'](node, parent) && !scope.contains(name))) return;
+ switch (name) {
+ case 'require':
+ if (isNodeRequirePropertyAccess(parent)) {
+ if (hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)) {
+ if (parent.property.name === 'cache') {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ }
- if (isProxyModule) {
- importee = getIdFromProxyId(importee);
- } else if (importee.startsWith('\0')) {
- if (importee === HELPERS_ID || importee === DYNAMIC_PACKAGES_ID || importee.startsWith(DYNAMIC_JSON_PREFIX)) {
- return importee;
+ return;
+ }
+
+ if (isDynamicRequireModulesEnabled && isRequireStatement(parent, scope)) {
+ magicString.appendLeft(
+ parent.end - 1,
+ `,${JSON.stringify(
+ path.dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath
+ )}`
+ );
+ }
+ if (isShorthandProperty(parent)) {
+ magicString.appendRight(node.end, `: ${HELPERS_NAME}.commonjsRequire`);
+ } else {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ }
+
+ uses.commonjsHelpers = true;
+ return;
+ case 'module':
+ case 'exports':
+ shouldWrap = true;
+ uses[name] = true;
+ return;
+ case 'global':
+ uses.global = true;
+ if (!ignoreGlobal) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ return;
+ case 'define':
+ magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });
+ return;
+ default:
+ globals.add(name);
+ return;
+ }
+ }
+ case 'MemberExpression':
+ if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ skippedNodes.add(node.object);
+ skippedNodes.add(node.property);
+ }
+ return;
+ case 'ReturnStatement':
+ // if top-level return, we need to wrap it
+ if (lexicalDepth === 0) {
+ shouldWrap = true;
+ }
+ return;
+ case 'ThisExpression':
+ // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal`
+ if (lexicalDepth === 0) {
+ uses.global = true;
+ if (!ignoreGlobal) {
+ magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
+ storeName: true
+ });
+ uses.commonjsHelpers = true;
+ }
+ }
+ return;
+ case 'UnaryExpression':
+ // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
+ if (node.operator === 'typeof') {
+ const flattened = getKeypath(node.argument);
+ if (!flattened) return;
+
+ if (scope.contains(flattened.name)) return;
+
+ if (
+ flattened.keypath === 'module.exports' ||
+ flattened.keypath === 'module' ||
+ flattened.keypath === 'exports'
+ ) {
+ magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });
+ }
+ }
+ return;
+ case 'VariableDeclaration':
+ if (!scope.parent) {
+ topLevelDeclarations.push(node);
+ }
}
+ },
- return null;
+ leave(node) {
+ programDepth -= 1;
+ if (node.scope) scope = scope.parent;
+ if (functionType.test(node.type)) lexicalDepth -= 1;
}
+ });
- if (importee.startsWith(DYNAMIC_JSON_PREFIX)) {
- return importee;
+ let isRestorableCompiledEsm = false;
+ if (defineCompiledEsmExpressions.length > 0) {
+ if (!shouldWrap && defineCompiledEsmExpressions.length === 1) {
+ isRestorableCompiledEsm = true;
+ magicString.remove(
+ defineCompiledEsmExpressions[0].start,
+ defineCompiledEsmExpressions[0].end
+ );
+ } else {
+ shouldWrap = true;
+ uses.exports = true;
}
+ }
- if (importer && importer.endsWith(PROXY_SUFFIX)) {
- importer = getIdFromProxyId(importer);
- }
+ // We cannot wrap ES/mixed modules
+ shouldWrap = shouldWrap && !disableWrap && !isEsModule;
+ uses.commonjsHelpers = uses.commonjsHelpers || shouldWrap;
+
+ if (
+ !(
+ requiredSources.length ||
+ dynamicRegisterSources.size ||
+ uses.module ||
+ uses.exports ||
+ uses.require ||
+ uses.commonjsHelpers ||
+ hasRemovedRequire
+ ) &&
+ (ignoreGlobal || !uses.global)
+ ) {
+ return { meta: { commonjs: { isCommonJS: false } } };
+ }
- return this.resolve(importee, importer, {
- skipSelf: true
- }).then(resolved => {
- if (!resolved) {
- resolved = resolveExtensions(importee, importer);
- }
+ const moduleName = deconflict(scope, globals, getName(id));
- if (isProxyModule) {
- if (!resolved) {
- return {
- id: getExternalProxyId(importee),
- external: false
- };
- }
+ let leadingComment = '';
+ if (code.startsWith('/*')) {
+ const commentEnd = code.indexOf('*/', 2) + 2;
+ leadingComment = `${code.slice(0, commentEnd)}\n`;
+ magicString.remove(0, commentEnd).trim();
+ }
- resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);
- resolved.external = false;
- return resolved;
- }
+ const exportBlock = isEsModule
+ ? ''
+ : rewriteExportsAndGetExportsBlock(
+ magicString,
+ moduleName,
+ shouldWrap,
+ topLevelModuleExportsAssignments,
+ topLevelExportsAssignmentsByName,
+ defineCompiledEsmExpressions,
+ (name) => deconflict(scope, globals, name),
+ isRestorableCompiledEsm,
+ code,
+ uses,
+ HELPERS_NAME
+ );
+
+ const importBlock = rewriteRequireExpressionsAndGetImportBlock(
+ magicString,
+ topLevelDeclarations,
+ topLevelRequireDeclarators,
+ reassignedNames,
+ uses.commonjsHelpers && HELPERS_NAME,
+ dynamicRegisterSources
+ );
- return resolved;
- });
+ if (shouldWrap) {
+ wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath);
}
- return resolveId;
+ magicString
+ .trim()
+ .prepend(leadingComment + importBlock)
+ .append(exportBlock);
+
+ return {
+ code: magicString.toString(),
+ map: sourceMap ? magicString.generateMap() : null,
+ syntheticNamedExports: isEsModule ? false : '__moduleExports',
+ meta: { commonjs: { isCommonJS: !isEsModule } }
+ };
}
function commonjs(options = {}) {
const extensions = options.extensions || ['.js'];
const filter = pluginutils.createFilter(options.include, options.exclude);
- const ignoreGlobal = options.ignoreGlobal;
-
- const _getDynamicRequirePat = getDynamicRequirePaths(options.dynamicRequireTargets),
- dynamicRequireModuleSet = _getDynamicRequirePat.dynamicRequireModuleSet,
- dynamicRequireModuleDirPaths = _getDynamicRequirePat.dynamicRequireModuleDirPaths;
-
+ const {
+ ignoreGlobal,
+ requireReturnsDefault: requireReturnsDefaultOption,
+ esmExternals
+ } = options;
+ const getRequireReturnsDefault =
+ typeof requireReturnsDefaultOption === 'function'
+ ? requireReturnsDefaultOption
+ : () => requireReturnsDefaultOption;
+ let esmExternalIds;
+ const isEsmExternal =
+ typeof esmExternals === 'function'
+ ? esmExternals
+ : Array.isArray(esmExternals)
+ ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
+ : () => esmExternals;
+
+ const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(
+ options.dynamicRequireTargets
+ );
const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;
- const commonDir = isDynamicRequireModulesEnabled ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd())) : null;
- const esModulesWithoutDefaultExport = new Set();
+ const commonDir = isDynamicRequireModulesEnabled
+ ? getCommonDir__default['default'](null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))
+ : null;
+
const esModulesWithDefaultExport = new Set();
- const ignoreRequire = typeof options.ignore === 'function' ? options.ignore : Array.isArray(options.ignore) ? id => options.ignore.includes(id) : () => false;
+ const esModulesWithNamedExports = new Set();
+
+ const ignoreRequire =
+ typeof options.ignore === 'function'
+ ? options.ignore
+ : Array.isArray(options.ignore)
+ ? (id) => options.ignore.includes(id)
+ : () => false;
+
+ const getIgnoreTryCatchRequireStatementMode = (id) => {
+ const mode =
+ typeof options.ignoreTryCatch === 'function'
+ ? options.ignoreTryCatch(id)
+ : Array.isArray(options.ignoreTryCatch)
+ ? options.ignoreTryCatch.includes(id)
+ : options.ignoreTryCatch || false;
+
+ return {
+ canConvertRequire: mode !== 'remove' && mode !== true,
+ shouldRemoveRequireStatement: mode === 'remove'
+ };
+ };
+
const resolveId = getResolveId(extensions);
+
const sourceMap = options.sourceMap !== false;
function transformAndCheckExports(code, id) {
- const _checkEsModule = checkEsModule(this.parse, code, id),
- isEsModule = _checkEsModule.isEsModule,
- hasDefaultExport = _checkEsModule.hasDefaultExport,
- ast = _checkEsModule.ast;
-
- const isDynamicRequireModule = dynamicRequireModuleSet.has(normalizePathSlashes(id));
+ if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
+ code =
+ getDynamicPackagesEntryIntro(dynamicRequireModuleDirPaths, dynamicRequireModuleSet) + code;
+ }
- if (isEsModule && (!isDynamicRequireModule || !options.transformMixedEsModules)) {
- (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport).add(id);
+ const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(
+ this.parse,
+ code,
+ id
+ );
+ if (hasDefaultExport) {
+ esModulesWithDefaultExport.add(id);
+ }
+ if (hasNamedExports) {
+ esModulesWithNamedExports.add(id);
+ }
- if (!options.transformMixedEsModules) {
- setIsCjsPromise(id, false);
- return null;
- }
- } // it is not an ES module AND it does not have CJS-specific elements.
- else if (!hasCjsKeywords(code, ignoreGlobal)) {
- esModulesWithoutDefaultExport.add(id);
- setIsCjsPromise(id, false);
- return null;
- }
+ if (
+ !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&
+ (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))
+ ) {
+ return { meta: { commonjs: { isCommonJS: false } } };
+ }
- const moduleInfo = this.getModuleInfo(id);
- const transformed = transformCommonjs(this.parse, code, id, moduleInfo.isEntry, moduleInfo.importers && moduleInfo.importers.length > 0, isEsModule, ignoreGlobal || isEsModule, ignoreRequire, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModuleSet, commonDir, ast);
- setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));
+ let disableWrap = false;
- if (!transformed) {
- if (!isEsModule || isDynamicRequireModule) esModulesWithoutDefaultExport.add(id);
- return null;
+ // avoid wrapping in createCommonjsModule, as this is a commonjsRegister call
+ if (isModuleRegisterProxy(id)) {
+ disableWrap = true;
+ id = unwrapModuleRegisterProxy(id);
}
- return transformed;
+ return transformCommonjs(
+ this.parse,
+ code,
+ id,
+ isEsModule,
+ ignoreGlobal || isEsModule,
+ ignoreRequire,
+ getIgnoreTryCatchRequireStatementMode,
+ sourceMap,
+ isDynamicRequireModulesEnabled,
+ dynamicRequireModuleSet,
+ disableWrap,
+ commonDir,
+ ast
+ );
}
return {
name: 'commonjs',
buildStart() {
+ validateRollupVersion(this.meta.rollupVersion, peerDependencies.rollup);
if (options.namedExports != null) {
- this.warn('The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.');
- }
-
- const _this$meta$rollupVers = this.meta.rollupVersion.split('.').map(Number),
- _this$meta$rollupVers2 = _slicedToArray(_this$meta$rollupVers, 2),
- major = _this$meta$rollupVers2[0],
- minor = _this$meta$rollupVers2[1];
-
- const minVersion = peerDependencies.rollup.slice(2);
-
- const _minVersion$split$map = minVersion.split('.').map(Number),
- _minVersion$split$map2 = _slicedToArray(_minVersion$split$map, 2),
- minMajor = _minVersion$split$map2[0],
- minMinor = _minVersion$split$map2[1];
-
- if (major < minMajor || major === minMajor && minor < minMinor) {
- this.error(`Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`);
+ this.warn(
+ 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
+ );
}
},
@@ -1225,136 +1691,87 @@ function commonjs(options = {}) {
load(id) {
if (id === HELPERS_ID) {
- let code = HELPERS; // Do not bloat everyone's code with the module manager code
-
- if (isDynamicRequireModulesEnabled) code += HELPERS_DYNAMIC;else code += HELPER_NON_DYNAMIC;
- return code;
- } // generate proxy modules
-
-
- if (id.endsWith(EXTERNAL_SUFFIX)) {
- const actualId = getIdFromExternalProxyId(id);
- const name = getName(actualId);
- if (actualId === HELPERS_ID || actualId === DYNAMIC_PACKAGES_ID) // These do not export default
- return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;
- return `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;
+ return getHelpersModule(isDynamicRequireModulesEnabled);
}
- if (id === DYNAMIC_PACKAGES_ID) {
- let code = `const { commonjsRegister } = require('${HELPERS_ID}');`;
-
- var _iterator = _createForOfIteratorHelper(dynamicRequireModuleDirPaths),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- const dir = _step.value;
- let entryPoint = 'index.js';
-
- try {
- if (fs.existsSync(path.join(dir, 'package.json'))) {
- entryPoint = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), {
- encoding: 'utf8'
- })).main || entryPoint;
- }
- } catch (ignored) {// ignored
- }
-
- code += `\ncommonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(dir, commonDir))}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizePathSlashes(path.join(dir, entryPoint)))});
-});`;
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
-
- return code;
+ if (id.startsWith(HELPERS_ID)) {
+ return getSpecificHelperProxy(id);
}
- let actualId = id;
- const isDynamicJson = actualId.startsWith(DYNAMIC_JSON_PREFIX);
-
- if (isDynamicJson) {
- actualId = actualId.slice(DYNAMIC_JSON_PREFIX.length);
+ if (isWrappedId(id, EXTERNAL_SUFFIX)) {
+ const actualId = unwrapId(id, EXTERNAL_SUFFIX);
+ return getUnknownRequireProxy(
+ actualId,
+ isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
+ );
}
- const normalizedPath = normalizePathSlashes(actualId);
-
- if (isDynamicJson) {
- return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizedPath, commonDir))}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizedPath)});
-});`;
+ if (id === DYNAMIC_PACKAGES_ID) {
+ return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);
}
- if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {
- // Try our best to still export the module fully.
- // The commonjs polyfill should take care of circular references.
- return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizedPath, commonDir))}, function (module, exports) {
- ${fs.readFileSync(normalizedPath, {
- encoding: 'utf8'
- })}
-});`;
+ if (id.startsWith(DYNAMIC_JSON_PREFIX)) {
+ return getDynamicJsonProxy(id, commonDir);
}
- if (actualId.endsWith(PROXY_SUFFIX)) {
- actualId = getIdFromProxyId(actualId);
- const name = getName(actualId);
- return getIsCjsPromise(actualId).then(isCjs => {
- if (dynamicRequireModuleSet.has(normalizePathSlashes(actualId)) && !actualId.endsWith('.json')) return `import {commonjsRequire} from '${HELPERS_ID}'; const ${name} = commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(actualId), commonDir))}); export default (${name} && ${name}['default']) || ${name}`;else if (isCjs) return `import { __moduleExports } from ${JSON.stringify(actualId)}; export default __moduleExports;`;else if (esModulesWithoutDefaultExport.has(actualId)) return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;else if (esModulesWithDefaultExport.has(actualId)) {
- return `export {default} from ${JSON.stringify(actualId)};`;
- }
- return `import * as ${name} from ${JSON.stringify(actualId)}; import {getCjsExportFromNamespace} from "${HELPERS_ID}"; export default getCjsExportFromNamespace(${name})`;
- });
+ if (isDynamicModuleImport(id, dynamicRequireModuleSet)) {
+ return `export default require(${JSON.stringify(normalizePathSlashes(id))});`;
}
- if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
- let code;
-
- try {
- code = fs.readFileSync(actualId, {
- encoding: 'utf8'
- });
- } catch (ex) {
- this.warn(`Failed to read file ${actualId}, dynamic modules might not work correctly`);
- return null;
- }
-
- let dynamicImports = Array.from(dynamicRequireModuleSet).map(dynamicId => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`).join('\n');
-
- if (dynamicRequireModuleDirPaths.length) {
- dynamicImports += `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID)});`;
- }
+ if (isModuleRegisterProxy(id)) {
+ return getDynamicRequireProxy(
+ normalizePathSlashes(unwrapModuleRegisterProxy(id)),
+ commonDir
+ );
+ }
- code = `${dynamicImports}\n${code}`;
- return code;
+ if (isWrappedId(id, PROXY_SUFFIX)) {
+ const actualId = unwrapId(id, PROXY_SUFFIX);
+ return getStaticRequireProxy(
+ actualId,
+ getRequireReturnsDefault(actualId),
+ esModulesWithDefaultExport,
+ esModulesWithNamedExports
+ );
}
return null;
},
- transform(code, id) {
- if (id !== DYNAMIC_PACKAGES_ID && !id.startsWith(DYNAMIC_JSON_PREFIX)) {
- if (!filter(id) || extensions.indexOf(path.extname(id)) === -1) {
- setIsCjsPromise(id, null);
- return null;
- }
+ transform(code, rawId) {
+ let id = rawId;
+
+ if (isModuleRegisterProxy(id)) {
+ id = unwrapModuleRegisterProxy(id);
}
- let transformed;
+ const extName = path.extname(id);
+ if (
+ extName !== '.cjs' &&
+ id !== DYNAMIC_PACKAGES_ID &&
+ !id.startsWith(DYNAMIC_JSON_PREFIX) &&
+ (!filter(id) || !extensions.includes(extName))
+ ) {
+ return null;
+ }
try {
- transformed = transformAndCheckExports.call(this, code, id);
+ return transformAndCheckExports.call(this, code, rawId);
} catch (err) {
- transformed = null;
- setIsCjsPromise(id, false);
- this.error(err, err.loc);
+ return this.error(err, err.loc);
}
+ },
- return transformed;
+ moduleParsed({ id, meta: { commonjs } }) {
+ if (commonjs) {
+ const isCjs = commonjs.isCommonJS;
+ if (isCjs != null) {
+ setIsCjsPromise(id, isCjs);
+ return;
+ }
+ }
+ setIsCjsPromise(id, null);
}
-
};
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js.map b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js.map
index 3455bee9a25..335d1b3f01a 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js.map
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sources":["../src/ast-utils.js","../src/helpers.js","../src/utils.js","../src/transform.js","../src/dynamic-require-paths.js","../src/is-cjs.js","../src/resolve-id.js","../src/index.js"],"sourcesContent":["/* eslint-disable no-undefined */\nexport { default as isReference } from 'is-reference';\n\nconst operators = {\n '==': (x) => equals(x.left, x.right, false),\n\n '!=': (x) => not(operators['=='](x)),\n\n '===': (x) => equals(x.left, x.right, true),\n\n '!==': (x) => not(operators['==='](x)),\n\n '!': (x) => isFalsy(x.argument),\n\n '&&': (x) => isTruthy(x.left) && isTruthy(x.right),\n\n '||': (x) => isTruthy(x.left) || isTruthy(x.right)\n};\n\nconst extractors = {\n Identifier(names, node) {\n names.push(node.name);\n },\n\n ObjectPattern(names, node) {\n node.properties.forEach((prop) => {\n getExtractor(prop.value.type)(names, prop.value);\n });\n },\n\n ArrayPattern(names, node) {\n node.elements.forEach((element) => {\n if (!element) return;\n getExtractor(element.type)(names, element);\n });\n },\n\n RestElement(names, node) {\n getExtractor(node.argument.type)(names, node.argument);\n },\n\n AssignmentPattern(names, node) {\n getExtractor(node.left.type)(names, node.left);\n }\n};\n\nexport function flatten(node) {\n const parts = [];\n\n while (node.type === 'MemberExpression') {\n if (node.computed) return null;\n\n parts.unshift(node.property.name);\n // eslint-disable-next-line no-param-reassign\n node = node.object;\n }\n\n if (node.type !== 'Identifier') return null;\n\n const { name } = node;\n parts.unshift(name);\n\n return { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n const names = [];\n extractors[node.type](names, node);\n return names;\n}\n\nfunction getExtractor(type) {\n const extractor = extractors[type];\n if (!extractor) throw new SyntaxError(`${type} pattern not supported.`);\n return extractor;\n}\n\nexport function isTruthy(node) {\n if (node.type === 'Literal') return !!node.value;\n if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n if (node.operator in operators) return operators[node.operator](node);\n return undefined;\n}\n\nexport function isFalsy(node) {\n return not(isTruthy(node));\n}\n\nfunction not(value) {\n return value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n if (a.type !== b.type) return undefined;\n // eslint-disable-next-line eqeqeq\n if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n return undefined;\n}\n","export const PROXY_SUFFIX = '?commonjs-proxy';\nexport const getProxyId = (id) => `\\0${id}${PROXY_SUFFIX}`;\nexport const getIdFromProxyId = (proxyId) => proxyId.slice(1, -PROXY_SUFFIX.length);\n\nexport const EXTERNAL_SUFFIX = '?commonjs-external';\nexport const getExternalProxyId = (id) => `\\0${id}${EXTERNAL_SUFFIX}`;\nexport const getIdFromExternalProxyId = (proxyId) => proxyId.slice(1, -EXTERNAL_SUFFIX.length);\n\nexport const VIRTUAL_PATH_BASE = '/$$rollup_base$$';\nexport const getVirtualPathForDynamicRequirePath = (path, commonDir) => {\n if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);\n return path;\n};\n\nexport const DYNAMIC_REGISTER_PREFIX = '\\0commonjs-dynamic-register:';\nexport const DYNAMIC_JSON_PREFIX = '\\0commonjs-dynamic-json:';\nexport const DYNAMIC_PACKAGES_ID = '\\0commonjs-dynamic-packages';\n\nexport const HELPERS_ID = '\\0commonjsHelpers.js';\n\n// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.\n// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.\nexport const HELPERS = `\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t path: basedir,\n\t exports: {},\n\t require: function (path, base) {\n return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n }\n\t}, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}\n`;\n\nexport const HELPER_NON_DYNAMIC = `\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n`;\n\nexport const HELPERS_DYNAMIC = `\nexport function commonjsRegister (path, loader) {\n\tDYNAMIC_REQUIRE_LOADERS[path] = loader;\n}\n\nconst DYNAMIC_REQUIRE_LOADERS = Object.create(null);\nconst DYNAMIC_REQUIRE_CACHE = Object.create(null);\nconst DEFAULT_PARENT_MODULE = {\n\tid: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []\n};\nconst CHECKED_EXTENSIONS = ['', '.js', '.json'];\n\nfunction normalize (path) {\n\tpath = path.replace(/\\\\\\\\/g, '/');\n\tconst parts = path.split('/');\n\tconst slashed = parts[0] === '';\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] === '.' || parts[i] === '') {\n\t\t\tparts.splice(i--, 1);\n\t\t}\n\t}\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] !== '..') continue;\n\t\tif (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {\n\t\t\tparts.splice(--i, 2);\n\t\t\ti--;\n\t\t}\n\t}\n\tpath = parts.join('/');\n\tif (slashed && path[0] !== '/')\n\t path = '/' + path;\n\telse if (path.length === 0)\n\t path = '.';\n\treturn path;\n}\n\nfunction join () {\n\tif (arguments.length === 0)\n\t return '.';\n\tlet joined;\n\tfor (let i = 0; i < arguments.length; ++i) {\n\t let arg = arguments[i];\n\t if (arg.length > 0) {\n\t\tif (joined === undefined)\n\t\t joined = arg;\n\t\telse\n\t\t joined += '/' + arg;\n\t }\n\t}\n\tif (joined === undefined)\n\t return '.';\n\n\treturn joined;\n}\n\nfunction isPossibleNodeModulesPath (modulePath) {\n\tlet c0 = modulePath[0];\n\tif (c0 === '/' || c0 === '\\\\\\\\') return false;\n\tlet c1 = modulePath[1], c2 = modulePath[2];\n\tif ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\\\\\')) ||\n\t\t(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\\\\\'))) return false;\n\tif (c1 === ':' && (c2 === '/' || c2 === '\\\\\\\\'))\n\t\treturn false;\n\treturn true;\n}\n\nfunction dirname (path) {\n if (path.length === 0)\n return '.';\n\n let i = path.length - 1;\n while (i > 0) {\n const c = path.charCodeAt(i);\n if ((c === 47 || c === 92) && i !== path.length - 1)\n break;\n i--;\n }\n\n if (i > 0)\n return path.substr(0, i);\n\n if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)\n return path.charAt(0);\n\n return '.';\n}\n\nexport function commonjsRequire (path, originalModuleDir) {\n\tconst shouldTryNodeModules = isPossibleNodeModulesPath(path);\n\tpath = normalize(path);\n\tlet relPath;\n\twhile (true) {\n\t\tif (!shouldTryNodeModules) {\n\t\t\trelPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;\n\t\t} else if (originalModuleDir) {\n\t\t\trelPath = normalize(originalModuleDir + '/node_modules/' + path);\n\t\t} else {\n\t\t\trelPath = normalize(join('node_modules', path));\n\t\t}\n\t\tfor (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {\n\t\t\tconst resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];\n\t\t\tlet cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\tif (cachedModule) return cachedModule.exports;\n\t\t\tconst loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];\n\t\t\tif (loader) {\n\t\t\t\tDYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {\n\t\t\t\t\tid: resolvedPath,\n\t\t\t\t\tfilename: resolvedPath,\n\t\t\t\t\tpath: dirname(resolvedPath),\n\t\t\t\t\texports: {},\n\t\t\t\t\tparent: DEFAULT_PARENT_MODULE,\n\t\t\t\t\tloaded: false,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\tpaths: [],\n\t\t\t\t\trequire: function (path, base) {\n\t\t\t\t\t return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tloader.call(commonjsGlobal, cachedModule, cachedModule.exports);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tdelete DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tcachedModule.loaded = true;\n\t\t\t\treturn cachedModule.exports;\n\t\t\t};\n\t\t}\n\t\tif (!shouldTryNodeModules) break;\n\t\tconst nextDir = normalize(originalModuleDir + '/..');\n\t\tif (nextDir === originalModuleDir) break;\n\t\toriginalModuleDir = nextDir;\n\t}\n\treturn require(path);\n}\n\ncommonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;\n`;\n","/* eslint-disable import/prefer-default-export */\nimport { basename, dirname, extname, sep } from 'path';\n\nimport { makeLegalIdentifier } from '@rollup/pluginutils';\n\nexport function getName(id) {\n const name = makeLegalIdentifier(basename(id, extname(id)));\n if (name !== 'index') {\n return name;\n }\n const segments = dirname(id).split(sep);\n return makeLegalIdentifier(segments[segments.length - 1]);\n}\n","/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */\nimport { resolve, dirname } from 'path';\n\nimport { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, extractAssignedNames, makeLegalIdentifier } from '@rollup/pluginutils';\n\nimport { sync as nodeResolveSync } from 'resolve';\n\nimport { flatten, isFalsy, isReference, isTruthy } from './ast-utils';\nimport {\n getProxyId,\n getVirtualPathForDynamicRequirePath,\n HELPERS_ID,\n DYNAMIC_REGISTER_PREFIX,\n DYNAMIC_JSON_PREFIX\n} from './helpers';\nimport { getName } from './utils';\n// TODO can this be async?\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n ' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach((word) => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n let i = 1;\n let deconflicted = makeLegalIdentifier(identifier);\n\n while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {\n deconflicted = `${identifier}_${i}`;\n i += 1;\n }\n scope.declarations[deconflicted] = true;\n\n return deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n try {\n return parse(code, { allowReturnOutsideFunction: true });\n } catch (err) {\n err.message += ` in ${id}`;\n throw err;\n }\n}\n\nexport function normalizePathSlashes(path) {\n return path.replace(/\\\\/g, '/');\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n return firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n const ast = tryParse(parse, code, id);\n\n let isEsModule = false;\n for (const node of ast.body) {\n if (node.type === 'ExportDefaultDeclaration')\n return { isEsModule: true, hasDefaultExport: true, ast };\n if (node.type === 'ExportNamedDeclaration') {\n isEsModule = true;\n for (const specifier of node.specifiers) {\n if (specifier.exported.name === 'default') {\n return { isEsModule: true, hasDefaultExport: true, ast };\n }\n }\n } else if (importExportDeclaration.test(node.type)) isEsModule = true;\n }\n\n return { isEsModule, hasDefaultExport: false, ast };\n}\n\nfunction getDefinePropertyCallName(node, targetName) {\n if (node.type !== 'CallExpression') return;\n\n const {\n callee: { object, property }\n } = node;\n\n if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;\n\n if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;\n\n if (node.arguments.length !== 3) return;\n\n const [target, val] = node.arguments;\n if (target.type !== 'Identifier' || target.name !== targetName) return;\n // eslint-disable-next-line consistent-return\n return val.value;\n}\n\nexport function transformCommonjs(\n parse,\n code,\n id,\n isEntry,\n hasImporters,\n isEsModule,\n ignoreGlobal,\n ignoreRequire,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n commonDir,\n astCache\n) {\n const ast = astCache || tryParse(parse, code, id);\n\n const magicString = new MagicString(code);\n\n const required = {};\n // Because objects have no guaranteed ordering, yet we need it,\n // we need to keep track of the order in a array\n const sources = [];\n\n let uid = 0;\n\n let scope = attachScopes(ast, 'scope');\n const uses = { module: false, exports: false, global: false, require: false };\n\n let lexicalDepth = 0;\n let programDepth = 0;\n\n const globals = new Set();\n\n // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');\n\n const namedExports = {};\n\n // TODO handle transpiled modules\n let shouldWrap = /__esModule/.test(code);\n let usesCommonjsHelpers = false;\n\n function isRequireStatement(node) {\n if (!node) return false;\n if (node.type !== 'CallExpression') return false;\n\n // Weird case of `require()` or `module.require()` without arguments\n if (node.arguments.length === 0) return false;\n\n return isRequireIdentifier(node.callee);\n }\n\n function isRequireIdentifier(node) {\n if (!node) return false;\n\n if (node.type === 'Identifier' && node.name === 'require' /* `require` */) {\n // `require` is hidden by a variable in local scope\n if (scope.contains('require')) return false;\n\n return true;\n } else if (node.type === 'MemberExpression' /* `[something].[something]` */) {\n // `module.[something]`\n if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false;\n\n // `module` is hidden by a variable in local scope\n if (scope.contains('module')) return false;\n\n // `module.require(...)`\n if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;\n\n return true;\n }\n\n return false;\n }\n\n function hasDynamicArguments(node) {\n return (\n node.arguments.length > 1 ||\n (node.arguments[0].type !== 'Literal' &&\n (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n );\n }\n\n function isStaticRequireStatement(node) {\n if (!isRequireStatement(node)) return false;\n if (hasDynamicArguments(node)) return false;\n return true;\n }\n\n function isIgnoredRequireStatement(requiredNode) {\n return ignoreRequire(requiredNode.arguments[0].value);\n }\n\n function getRequireStringArg(node) {\n return node.arguments[0].type === 'Literal'\n ? node.arguments[0].value\n : node.arguments[0].quasis[0].value.cooked;\n }\n\n function getRequired(node, name) {\n let sourceId = getRequireStringArg(node);\n const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);\n if (isDynamicRegister) {\n sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);\n }\n\n const existing = required[sourceId];\n // eslint-disable-next-line no-undefined\n if (existing === undefined) {\n const isDynamic = hasDynamicModuleForPath(sourceId);\n\n if (!name) {\n do {\n name = `require$$${uid}`;\n uid += 1;\n } while (scope.contains(name));\n }\n\n if (isDynamicRegister && sourceId.endsWith('.json')) {\n sourceId = DYNAMIC_JSON_PREFIX + sourceId;\n }\n\n if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {\n sources.push([sourceId, !isDynamicRegister]);\n }\n\n required[sourceId] = { source: sourceId, name, importsDefault: false, isDynamic };\n }\n\n return required[sourceId];\n }\n\n function hasDynamicModuleForPath(source) {\n if (!/[/\\\\]/.test(source)) {\n try {\n const resolvedPath = normalizePathSlashes(\n nodeResolveSync(source, { basedir: dirname(id) })\n );\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n } catch (ex) {\n // Probably a node.js internal module\n return false;\n }\n\n return false;\n }\n\n for (const attemptExt of ['', '.js', '.json']) {\n const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n }\n\n return false;\n }\n\n function shouldUseSimulatedRequire(required) {\n return (\n hasDynamicModuleForPath(required.source) &&\n // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.\n (required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'))\n );\n }\n\n // do a first pass, see which names are assigned to. This is necessary to prevent\n // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n const assignedTo = new Set();\n walk(ast, {\n enter(node) {\n if (node.type !== 'AssignmentExpression') return;\n if (node.left.type === 'MemberExpression') return;\n\n extractAssignedNames(node.left).forEach((name) => {\n assignedTo.add(name);\n });\n }\n });\n\n walk(ast, {\n enter(node, parent) {\n if (sourceMap) {\n magicString.addSourcemapLocation(node.start);\n magicString.addSourcemapLocation(node.end);\n }\n\n // skip dead branches\n if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n if (node === parent.consequent && isFalsy(parent.test)) {\n this.skip();\n return;\n }\n if (node === parent.alternate && isTruthy(parent.test)) {\n this.skip();\n return;\n }\n }\n\n if (node._skip) {\n this.skip();\n return;\n }\n\n programDepth += 1;\n\n if (node.scope) ({ scope } = node);\n if (functionType.test(node.type)) lexicalDepth += 1;\n\n // if toplevel return, we need to wrap it\n if (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n shouldWrap = true;\n }\n\n // rewrite `this` as `commonjsHelpers.commonjsGlobal`\n if (node.type === 'ThisExpression' && lexicalDepth === 0) {\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n return;\n }\n\n // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n if (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n const flattened = flatten(node.argument);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n if (\n flattened.keypath === 'module.exports' ||\n flattened.keypath === 'module' ||\n flattened.keypath === 'exports'\n ) {\n magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n }\n }\n\n // rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n if (node.type === 'Identifier') {\n if (isReference(node, parent) && !scope.contains(node.name)) {\n if (node.name in uses) {\n if (isRequireIdentifier(node)) {\n if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {\n return;\n }\n\n if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {\n magicString.appendLeft(\n parent.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.'\n ? null /* default behavior */\n : getVirtualPathForDynamicRequirePath(\n normalizePathSlashes(dirname(id)),\n commonDir\n )\n )}`\n );\n }\n\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n\n uses[node.name] = true;\n if (node.name === 'global' && !ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n usesCommonjsHelpers = true;\n }\n\n // if module or exports are used outside the context of an assignment\n // expression, we need to wrap the module\n if (node.name === 'module' || node.name === 'exports') {\n shouldWrap = true;\n }\n }\n\n if (node.name === 'define') {\n magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n }\n\n globals.add(node.name);\n }\n\n return;\n }\n\n // Is this an assignment to exports or module.exports?\n if (node.type === 'AssignmentExpression') {\n if (node.left.type !== 'MemberExpression') return;\n\n const flattened = flatten(node.left);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n const match = exportsPattern.exec(flattened.keypath);\n if (!match || flattened.keypath === 'exports') return;\n\n uses[flattened.name] = true;\n\n // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n // if this isn't top-level, we'll need to wrap the module\n if (programDepth > 3) shouldWrap = true;\n\n node.left._skip = true;\n\n if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n node.right.properties.forEach((prop) => {\n if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;\n const { name } = prop.key;\n if (name === makeLegalIdentifier(name)) namedExports[name] = true;\n });\n return;\n }\n\n if (match[1]) namedExports[match[1]] = true;\n return;\n }\n\n const name = getDefinePropertyCallName(node, 'exports');\n if (name && name === makeLegalIdentifier(name)) namedExports[name] = true;\n\n // if this is `var x = require('x')`, we can do `import x from 'x'`\n if (\n node.type === 'VariableDeclarator' &&\n node.id.type === 'Identifier' &&\n isStaticRequireStatement(node.init) &&\n !isIgnoredRequireStatement(node.init)\n ) {\n // for now, only do this for top-level requires. maybe fix this in future\n if (scope.parent) return;\n\n // edge case — CJS allows you to assign to imports. ES doesn't\n if (assignedTo.has(node.id.name)) return;\n\n const required = getRequired(node.init, node.id.name);\n required.importsDefault = true;\n\n if (required.name === node.id.name && !required.isDynamic) {\n node._shouldRemove = true;\n }\n }\n\n if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {\n return;\n }\n\n const required = getRequired(node);\n\n if (parent.type === 'ExpressionStatement') {\n // is a bare import, e.g. `require('foo');`\n magicString.remove(parent.start, parent.end);\n } else {\n required.importsDefault = true;\n\n if (shouldUseSimulatedRequire(required)) {\n magicString.overwrite(\n node.start,\n node.end,\n `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir)\n )}, ${JSON.stringify(\n dirname(id) === '.'\n ? null /* default behavior */\n : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)\n )})`\n );\n usesCommonjsHelpers = true;\n } else {\n magicString.overwrite(node.start, node.end, required.name);\n }\n }\n\n node.callee._skip = true;\n },\n\n leave(node) {\n programDepth -= 1;\n if (node.scope) scope = scope.parent;\n if (functionType.test(node.type)) lexicalDepth -= 1;\n\n if (node.type === 'VariableDeclaration') {\n let keepDeclaration = false;\n let c = node.declarations[0].start;\n\n for (let i = 0; i < node.declarations.length; i += 1) {\n const declarator = node.declarations[i];\n\n if (declarator._shouldRemove) {\n magicString.remove(c, declarator.end);\n } else {\n if (!keepDeclaration) {\n magicString.remove(c, declarator.start);\n keepDeclaration = true;\n }\n\n c = declarator.end;\n }\n }\n\n if (!keepDeclaration) {\n magicString.remove(node.start, node.end);\n }\n }\n }\n });\n\n if (\n !sources.length &&\n !uses.module &&\n !uses.exports &&\n !uses.require &&\n (ignoreGlobal || !uses.global)\n ) {\n // not a CommonJS module\n return null;\n }\n\n // If `isEsModule` is on, it means it has ES6 import/export statements,\n // which just can't be wrapped in a function.\n if (isEsModule) shouldWrap = false;\n\n usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;\n\n const importBlock = `${(usesCommonjsHelpers\n ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`]\n : []\n )\n .concat(\n sources.map(\n ([source]) =>\n // import the actual module before the proxy, so that we know\n // what kind of proxy to build\n `import '${source}';`\n ),\n sources\n .filter(([, importProxy]) => importProxy)\n .map(([source]) => {\n const { name, importsDefault } = required[source];\n return `import ${importsDefault ? `${name} from ` : ``}'${getProxyId(source)}';`;\n })\n )\n .join('\\n')}\\n\\n`;\n\n const namedExportDeclarations = [];\n let wrapperStart = '';\n let wrapperEnd = '';\n\n const moduleName = deconflict(scope, globals, getName(id));\n if ((!isEntry || hasImporters) && !isEsModule) {\n const exportModuleExports = {\n str: `export { ${moduleName} as __moduleExports };`,\n name: '__moduleExports'\n };\n\n namedExportDeclarations.push(exportModuleExports);\n }\n\n const defaultExportPropertyAssignments = [];\n let hasDefaultExport = false;\n\n if (shouldWrap) {\n const args = `module${uses.exports ? ', exports' : ''}`;\n\n wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\n wrapperEnd = `\\n}`;\n if (isDynamicRequireModulesEnabled) {\n wrapperEnd += `, ${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)\n )}`;\n }\n\n wrapperEnd += `);`;\n } else {\n const names = [];\n\n for (const node of ast.body) {\n if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n const { left } = node.expression;\n const flattened = flatten(left);\n\n if (!flattened) {\n continue;\n }\n\n const match = exportsPattern.exec(flattened.keypath);\n if (!match) {\n continue;\n }\n\n if (flattened.keypath === 'module.exports') {\n hasDefaultExport = true;\n magicString.overwrite(left.start, left.end, `var ${moduleName}`);\n } else {\n const [, name] = match;\n const deconflicted = deconflict(scope, globals, name);\n\n names.push({ name, deconflicted });\n\n magicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n const declaration =\n name === deconflicted\n ? `export { ${name} };`\n : `export { ${deconflicted} as ${name} };`;\n\n if (name !== 'default') {\n namedExportDeclarations.push({\n str: declaration,\n name\n });\n }\n\n defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n }\n }\n }\n\n if (!hasDefaultExport && (names.length || ((!isEntry || hasImporters) && !isEsModule))) {\n wrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n .map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n .join(',\\n')}\\n};`;\n }\n }\n\n const defaultExport = /__esModule/.test(code)\n ? `export default /*@__PURE__*/${HELPERS_NAME}.unwrapExports(${moduleName});`\n : `export default ${moduleName};`;\n\n const named = namedExportDeclarations\n .filter((x) => x.name !== 'default' || !hasDefaultExport)\n .map((x) => x.str);\n\n const exportBlock = `\\n\\n${(isEsModule ? [] : [defaultExport])\n .concat(named)\n .concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n .join('\\n')}`;\n\n magicString\n .trim()\n .prepend(importBlock + wrapperStart)\n .trim()\n .append(wrapperEnd);\n\n const injectExportBlock =\n hasDefaultExport || named.length > 0 || shouldWrap || !isEntry || hasImporters;\n if (injectExportBlock) {\n magicString.append(exportBlock);\n }\n\n code = magicString.toString();\n const map = sourceMap ? magicString.generateMap() : null;\n\n return { code, map, syntheticNamedExports: injectExportBlock };\n}\n","import { statSync } from 'fs';\n\nimport { resolve } from 'path';\n\nimport glob from 'glob';\n\nimport { normalizePathSlashes } from './transform';\n\nexport default function getDynamicRequirePaths(patterns) {\n const dynamicRequireModuleSet = new Set();\n for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {\n const isNegated = pattern.startsWith('!');\n const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);\n for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {\n modifySet(normalizePathSlashes(resolve(path)));\n }\n }\n const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(\n (path) => {\n try {\n if (statSync(path).isDirectory()) return true;\n } catch (ignored) {\n // Nothing to do here\n }\n return false;\n }\n );\n return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };\n}\n","/* eslint-disable no-undefined */\nconst isCjsPromises = new Map();\n\nexport function getIsCjsPromise(id) {\n let isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) return isCjsPromise.promise;\n\n const promise = new Promise((resolve) => {\n isCjsPromise = {\n resolve,\n promise: undefined\n };\n isCjsPromises.set(id, isCjsPromise);\n });\n isCjsPromise.promise = promise;\n\n return promise;\n}\n\nexport function setIsCjsPromise(id, resolution) {\n const isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) {\n if (isCjsPromise.resolve) {\n isCjsPromise.resolve(resolution);\n isCjsPromise.resolve = undefined;\n }\n } else {\n isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });\n }\n}\n","/* eslint-disable no-param-reassign, no-undefined */\nimport { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n getExternalProxyId,\n getIdFromProxyId,\n getProxyId,\n HELPERS_ID,\n PROXY_SUFFIX\n} from './helpers';\n\nfunction getCandidatesForExtension(resolved, extension) {\n return [resolved + extension, `${resolved}${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n return extensions.reduce(\n (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n [resolved]\n );\n}\n\nexport default function getResolveId(extensions) {\n function resolveExtensions(importee, importer) {\n // not our problem\n if (importee[0] !== '.' || !importer) return undefined;\n\n const resolved = resolve(dirname(importer), importee);\n const candidates = getCandidates(resolved, extensions);\n\n for (let i = 0; i < candidates.length; i += 1) {\n try {\n const stats = statSync(candidates[i]);\n if (stats.isFile()) return { id: candidates[i] };\n } catch (err) {\n /* noop */\n }\n }\n\n return undefined;\n }\n\n function resolveId(importee, importer) {\n const isProxyModule = importee.endsWith(PROXY_SUFFIX);\n if (isProxyModule) {\n importee = getIdFromProxyId(importee);\n } else if (importee.startsWith('\\0')) {\n if (\n importee === HELPERS_ID ||\n importee === DYNAMIC_PACKAGES_ID ||\n importee.startsWith(DYNAMIC_JSON_PREFIX)\n ) {\n return importee;\n }\n return null;\n }\n\n if (importee.startsWith(DYNAMIC_JSON_PREFIX)) {\n return importee;\n }\n\n if (importer && importer.endsWith(PROXY_SUFFIX)) {\n importer = getIdFromProxyId(importer);\n }\n\n return this.resolve(importee, importer, { skipSelf: true }).then((resolved) => {\n if (!resolved) {\n resolved = resolveExtensions(importee, importer);\n }\n if (isProxyModule) {\n if (!resolved) {\n return { id: getExternalProxyId(importee), external: false };\n }\n resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);\n resolved.external = false;\n return resolved;\n }\n return resolved;\n });\n }\n\n return resolveId;\n}\n","import { existsSync, readFileSync } from 'fs';\nimport { extname, join } from 'path';\n\nimport { createFilter } from '@rollup/pluginutils';\n\nimport getCommonDir from 'commondir';\n\nimport { peerDependencies } from '../package.json';\n\nimport getDynamicRequirePaths from './dynamic-require-paths';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n DYNAMIC_REGISTER_PREFIX,\n getVirtualPathForDynamicRequirePath,\n EXTERNAL_SUFFIX,\n getIdFromExternalProxyId,\n getIdFromProxyId,\n HELPERS,\n HELPERS_ID,\n HELPER_NON_DYNAMIC,\n HELPERS_DYNAMIC,\n PROXY_SUFFIX\n} from './helpers';\n\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport getResolveId from './resolve-id';\nimport {\n checkEsModule,\n normalizePathSlashes,\n hasCjsKeywords,\n transformCommonjs\n} from './transform';\nimport { getName } from './utils';\n\nexport default function commonjs(options = {}) {\n const extensions = options.extensions || ['.js'];\n const filter = createFilter(options.include, options.exclude);\n const { ignoreGlobal } = options;\n\n const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(\n options.dynamicRequireTargets\n );\n const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;\n const commonDir = isDynamicRequireModulesEnabled\n ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))\n : null;\n\n const esModulesWithoutDefaultExport = new Set();\n const esModulesWithDefaultExport = new Set();\n\n const ignoreRequire =\n typeof options.ignore === 'function'\n ? options.ignore\n : Array.isArray(options.ignore)\n ? (id) => options.ignore.includes(id)\n : () => false;\n\n const resolveId = getResolveId(extensions);\n\n const sourceMap = options.sourceMap !== false;\n\n function transformAndCheckExports(code, id) {\n const { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\n const isDynamicRequireModule = dynamicRequireModuleSet.has(normalizePathSlashes(id));\n\n if (isEsModule && (!isDynamicRequireModule || !options.transformMixedEsModules)) {\n (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport).add(id);\n if (!options.transformMixedEsModules) {\n setIsCjsPromise(id, false);\n return null;\n }\n }\n // it is not an ES module AND it does not have CJS-specific elements.\n else if (!hasCjsKeywords(code, ignoreGlobal)) {\n esModulesWithoutDefaultExport.add(id);\n setIsCjsPromise(id, false);\n return null;\n }\n\n const moduleInfo = this.getModuleInfo(id);\n\n const transformed = transformCommonjs(\n this.parse,\n code,\n id,\n moduleInfo.isEntry,\n moduleInfo.importers && moduleInfo.importers.length > 0,\n isEsModule,\n ignoreGlobal || isEsModule,\n ignoreRequire,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n commonDir,\n ast\n );\n\n setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));\n\n if (!transformed) {\n if (!isEsModule || isDynamicRequireModule) esModulesWithoutDefaultExport.add(id);\n return null;\n }\n\n return transformed;\n }\n\n return {\n name: 'commonjs',\n\n buildStart() {\n if (options.namedExports != null) {\n this.warn(\n 'The namedExports option from \"@rollup/plugin-commonjs\" is deprecated. Named exports are now handled automatically.'\n );\n }\n\n const [major, minor] = this.meta.rollupVersion.split('.').map(Number);\n const minVersion = peerDependencies.rollup.slice(2);\n const [minMajor, minMinor] = minVersion.split('.').map(Number);\n if (major < minMajor || (major === minMajor && minor < minMinor)) {\n this.error(\n `Insufficient Rollup version: \"@rollup/plugin-commonjs\" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`\n );\n }\n },\n\n resolveId,\n\n load(id) {\n if (id === HELPERS_ID) {\n let code = HELPERS;\n\n // Do not bloat everyone's code with the module manager code\n if (isDynamicRequireModulesEnabled) code += HELPERS_DYNAMIC;\n else code += HELPER_NON_DYNAMIC;\n\n return code;\n }\n\n // generate proxy modules\n if (id.endsWith(EXTERNAL_SUFFIX)) {\n const actualId = getIdFromExternalProxyId(id);\n const name = getName(actualId);\n\n if (actualId === HELPERS_ID || actualId === DYNAMIC_PACKAGES_ID)\n // These do not export default\n return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\n return `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n }\n\n if (id === DYNAMIC_PACKAGES_ID) {\n let code = `const { commonjsRegister } = require('${HELPERS_ID}');`;\n for (const dir of dynamicRequireModuleDirPaths) {\n let entryPoint = 'index.js';\n\n try {\n if (existsSync(join(dir, 'package.json'))) {\n entryPoint =\n JSON.parse(readFileSync(join(dir, 'package.json'), { encoding: 'utf8' })).main ||\n entryPoint;\n }\n } catch (ignored) {\n // ignored\n }\n\n code += `\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(dir, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});\n});`;\n }\n return code;\n }\n\n let actualId = id;\n\n const isDynamicJson = actualId.startsWith(DYNAMIC_JSON_PREFIX);\n if (isDynamicJson) {\n actualId = actualId.slice(DYNAMIC_JSON_PREFIX.length);\n }\n\n const normalizedPath = normalizePathSlashes(actualId);\n\n if (isDynamicJson) {\n return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizedPath)});\n});`;\n }\n\n if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {\n // Try our best to still export the module fully.\n // The commonjs polyfill should take care of circular references.\n\n return `require('${HELPERS_ID}').commonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n ${readFileSync(normalizedPath, { encoding: 'utf8' })}\n});`;\n }\n\n if (actualId.endsWith(PROXY_SUFFIX)) {\n actualId = getIdFromProxyId(actualId);\n const name = getName(actualId);\n\n return getIsCjsPromise(actualId).then((isCjs) => {\n if (\n dynamicRequireModuleSet.has(normalizePathSlashes(actualId)) &&\n !actualId.endsWith('.json')\n )\n return `import {commonjsRequire} from '${HELPERS_ID}'; const ${name} = commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizePathSlashes(actualId), commonDir)\n )}); export default (${name} && ${name}['default']) || ${name}`;\n else if (isCjs)\n return `import { __moduleExports } from ${JSON.stringify(\n actualId\n )}; export default __moduleExports;`;\n else if (esModulesWithoutDefaultExport.has(actualId))\n return `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n else if (esModulesWithDefaultExport.has(actualId)) {\n return `export {default} from ${JSON.stringify(actualId)};`;\n }\n return `import * as ${name} from ${JSON.stringify(\n actualId\n )}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n });\n }\n\n if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {\n let code;\n\n try {\n code = readFileSync(actualId, { encoding: 'utf8' });\n } catch (ex) {\n this.warn(`Failed to read file ${actualId}, dynamic modules might not work correctly`);\n return null;\n }\n\n let dynamicImports = Array.from(dynamicRequireModuleSet)\n .map((dynamicId) => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`)\n .join('\\n');\n\n if (dynamicRequireModuleDirPaths.length) {\n dynamicImports += `require(${JSON.stringify(\n DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID\n )});`;\n }\n\n code = `${dynamicImports}\\n${code}`;\n\n return code;\n }\n\n return null;\n },\n\n transform(code, id) {\n if (id !== DYNAMIC_PACKAGES_ID && !id.startsWith(DYNAMIC_JSON_PREFIX)) {\n if (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n setIsCjsPromise(id, null);\n return null;\n }\n }\n\n let transformed;\n try {\n transformed = transformAndCheckExports.call(this, code, id);\n } catch (err) {\n transformed = null;\n setIsCjsPromise(id, false);\n this.error(err, err.loc);\n }\n\n return transformed;\n }\n };\n}\n"],"names":["operators","x","equals","left","right","not","isFalsy","argument","isTruthy","flatten","node","parts","type","computed","unshift","property","name","object","keypath","join","value","expression","operator","undefined","a","b","strict","PROXY_SUFFIX","getProxyId","id","getIdFromProxyId","proxyId","slice","length","EXTERNAL_SUFFIX","getExternalProxyId","getIdFromExternalProxyId","VIRTUAL_PATH_BASE","getVirtualPathForDynamicRequirePath","path","commonDir","startsWith","DYNAMIC_REGISTER_PREFIX","DYNAMIC_JSON_PREFIX","DYNAMIC_PACKAGES_ID","HELPERS_ID","HELPERS","HELPER_NON_DYNAMIC","HELPERS_DYNAMIC","getName","makeLegalIdentifier","basename","extname","segments","dirname","split","sep","reserved","blacklist","__esModule","forEach","word","exportsPattern","firstpassGlobal","firstpassNoGlobal","importExportDeclaration","functionType","deconflict","scope","globals","identifier","i","deconflicted","contains","has","declarations","tryParse","parse","code","allowReturnOutsideFunction","err","message","normalizePathSlashes","replace","hasCjsKeywords","ignoreGlobal","firstpass","test","checkEsModule","ast","isEsModule","body","hasDefaultExport","specifiers","specifier","exported","getDefinePropertyCallName","targetName","callee","arguments","target","val","transformCommonjs","isEntry","hasImporters","ignoreRequire","sourceMap","isDynamicRequireModulesEnabled","dynamicRequireModuleSet","astCache","magicString","MagicString","required","sources","uid","attachScopes","uses","module","exports","global","require","lexicalDepth","programDepth","Set","HELPERS_NAME","namedExports","shouldWrap","usesCommonjsHelpers","isRequireStatement","isRequireIdentifier","hasDynamicArguments","expressions","isStaticRequireStatement","isIgnoredRequireStatement","requiredNode","getRequireStringArg","quasis","cooked","getRequired","sourceId","isDynamicRegister","substr","existing","isDynamic","hasDynamicModuleForPath","endsWith","push","source","importsDefault","resolvedPath","nodeResolveSync","basedir","ex","attemptExt","resolve","shouldUseSimulatedRequire","assignedTo","walk","enter","extractAssignedNames","add","parent","addSourcemapLocation","start","end","consequent","skip","alternate","_skip","overwrite","storeName","flattened","isReference","appendLeft","JSON","stringify","match","exec","properties","prop","key","init","_shouldRemove","remove","leave","keepDeclaration","c","declarator","importBlock","concat","map","filter","importProxy","namedExportDeclarations","wrapperStart","wrapperEnd","moduleName","exportModuleExports","str","defaultExportPropertyAssignments","args","names","declaration","defaultExport","named","exportBlock","trim","prepend","append","injectExportBlock","toString","generateMap","syntheticNamedExports","getDynamicRequirePaths","patterns","Array","isArray","pattern","isNegated","modifySet","prototype","bind","glob","sync","dynamicRequireModuleDirPaths","from","values","statSync","isDirectory","ignored","isCjsPromises","Map","getIsCjsPromise","isCjsPromise","get","promise","Promise","set","setIsCjsPromise","resolution","getCandidatesForExtension","resolved","extension","getCandidates","extensions","reduce","paths","getResolveId","resolveExtensions","importee","importer","candidates","stats","isFile","resolveId","isProxyModule","skipSelf","then","external","commonjs","options","createFilter","include","exclude","dynamicRequireTargets","size","getCommonDir","process","cwd","esModulesWithoutDefaultExport","esModulesWithDefaultExport","ignore","includes","transformAndCheckExports","isDynamicRequireModule","transformMixedEsModules","moduleInfo","getModuleInfo","transformed","importers","Boolean","buildStart","warn","meta","rollupVersion","Number","major","minor","minVersion","peerDependencies","rollup","minMajor","minMinor","error","load","actualId","dir","entryPoint","existsSync","readFileSync","encoding","main","isDynamicJson","normalizedPath","isCjs","dynamicImports","dynamicId","transform","indexOf","call","loc"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA,MAAMA,SAAS,GAAG;AAChB,QAAOC,CAAD,IAAOC,MAAM,CAACD,CAAC,CAACE,IAAH,EAASF,CAAC,CAACG,KAAX,EAAkB,KAAlB,CADH;AAGhB,QAAOH,CAAD,IAAOI,GAAG,CAACL,SAAS,CAAC,IAAD,CAAT,CAAgBC,CAAhB,CAAD,CAHA;AAKhB,SAAQA,CAAD,IAAOC,MAAM,CAACD,CAAC,CAACE,IAAH,EAASF,CAAC,CAACG,KAAX,EAAkB,IAAlB,CALJ;AAOhB,SAAQH,CAAD,IAAOI,GAAG,CAACL,SAAS,CAAC,KAAD,CAAT,CAAiBC,CAAjB,CAAD,CAPD;AAShB,OAAMA,CAAD,IAAOK,OAAO,CAACL,CAAC,CAACM,QAAH,CATH;AAWhB,QAAON,CAAD,IAAOO,QAAQ,CAACP,CAAC,CAACE,IAAH,CAAR,IAAoBK,QAAQ,CAACP,CAAC,CAACG,KAAH,CAXzB;AAahB,QAAOH,CAAD,IAAOO,QAAQ,CAACP,CAAC,CAACE,IAAH,CAAR,IAAoBK,QAAQ,CAACP,CAAC,CAACG,KAAH;AAbzB,CAAlB;AA2CO,SAASK,OAAT,CAAiBC,IAAjB,EA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AACvB,EAAD,CAA1B,MAAoC,CAAC,CAAxD,EAA2D;AACzDiN,UAAAA,eAAe,CAACjN,EAAD,EAAK,IAAL,CAAf;AACA,iBAAO,IAAP;AACD;AACF;;AAED,UAAIyP,WAAJ;;AACA,UAAI;AACFA,QAAAA,WAAW,GAAGL,wBAAwB,CAACoC,IAAzB,CAA8B,IAA9B,EAAoCvO,IAApC,EAA0CjD,EAA1C,CAAd;AACD,OAFD,CAEE,OAAOmD,GAAP,EAAY;AACZsM,QAAAA,WAAW,GAAG,IAAd;AACAxC,QAAAA,eAAe,CAACjN,EAAD,EAAK,KAAL,CAAf;AACA,aAAKwQ,KAAL,CAAWrN,GAAX,EAAgBA,GAAG,CAACsO,GAApB;AACD;;AAED,aAAOhC,WAAP;AACD;;AA1KI,GAAP;AA4KD;;;;"} \ No newline at end of file
+{"version":3,"file":"index.js","sources":["../src/parse.js","../src/analyze-top-level-statements.js","../src/helpers.js","../src/utils.js","../src/dynamic-packages-manager.js","../src/dynamic-require-paths.js","../src/is-cjs.js","../src/proxies.js","../src/resolve-id.js","../src/rollup-version.js","../src/ast-utils.js","../src/generate-exports.js","../src/generate-imports.js","../src/transform-commonjs.js","../src/index.js"],"sourcesContent":["export function tryParse(parse, code, id) {\n try {\n return parse(code, { allowReturnOutsideFunction: true });\n } catch (err) {\n err.message += ` in ${id}`;\n throw err;\n }\n}\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\n\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n return firstpass.test(code);\n}\n","/* eslint-disable no-underscore-dangle */\n\nimport { tryParse } from './parse';\n\nexport default function analyzeTopLevelStatements(parse, code, id) {\n const ast = tryParse(parse, code, id);\n\n let isEsModule = false;\n let hasDefaultExport = false;\n let hasNamedExports = false;\n\n for (const node of ast.body) {\n switch (node.type) {\n case 'ExportDefaultDeclaration':\n isEsModule = true;\n hasDefaultExport = true;\n break;\n case 'ExportNamedDeclaration':\n isEsModule = true;\n if (node.declaration) {\n hasNamedExports = true;\n } else {\n for (const specifier of node.specifiers) {\n if (specifier.exported.name === 'default') {\n hasDefaultExport = true;\n } else {\n hasNamedExports = true;\n }\n }\n }\n break;\n case 'ExportAllDeclaration':\n isEsModule = true;\n if (node.exported && node.exported.name === 'default') {\n hasDefaultExport = true;\n } else {\n hasNamedExports = true;\n }\n break;\n case 'ImportDeclaration':\n isEsModule = true;\n break;\n default:\n }\n }\n\n return { isEsModule, hasDefaultExport, hasNamedExports, ast };\n}\n","export const isWrappedId = (id, suffix) => id.endsWith(suffix);\nexport const wrapId = (id, suffix) => `\\0${id}${suffix}`;\nexport const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);\n\nexport const PROXY_SUFFIX = '?commonjs-proxy';\nexport const REQUIRE_SUFFIX = '?commonjs-require';\nexport const EXTERNAL_SUFFIX = '?commonjs-external';\n\nexport const DYNAMIC_REGISTER_SUFFIX = '?commonjs-dynamic-register';\nexport const DYNAMIC_JSON_PREFIX = '\\0commonjs-dynamic-json:';\nexport const DYNAMIC_PACKAGES_ID = '\\0commonjs-dynamic-packages';\n\nexport const HELPERS_ID = '\\0commonjsHelpers.js';\n\n// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.\n// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.\n// This will no longer be necessary once Rollup switches to ES6 output, likely\n// in Rollup 3\n\nconst HELPERS = `\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function getDefaultExportFromNamespaceIfPresent (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;\n}\n\nexport function getDefaultExportFromNamespaceIfNotNamed (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;\n}\n\nexport function getAugmentedNamespace(n) {\n\tif (n.__esModule) return n;\n\tvar a = Object.defineProperty({}, '__esModule', {value: true});\n\tObject.keys(n).forEach(function (k) {\n\t\tvar d = Object.getOwnPropertyDescriptor(n, k);\n\t\tObject.defineProperty(a, k, d.get ? d : {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\treturn n[k];\n\t\t\t}\n\t\t});\n\t});\n\treturn a;\n}\n`;\n\nconst HELPER_NON_DYNAMIC = `\nexport function createCommonjsModule(fn) {\n var module = { exports: {} }\n\treturn fn(module, module.exports), module.exports;\n}\n\nexport function commonjsRequire (target) {\n\tthrow new Error('Could not dynamically require \"' + target + '\". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.');\n}\n`;\n\nconst HELPERS_DYNAMIC = `\nexport function createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t\tpath: basedir,\n\t\texports: {},\n\t\trequire: function (path, base) {\n\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t}\n\t}, fn(module, module.exports), module.exports;\n}\n\nexport function commonjsRegister (path, loader) {\n\tDYNAMIC_REQUIRE_LOADERS[path] = loader;\n}\n\nconst DYNAMIC_REQUIRE_LOADERS = Object.create(null);\nconst DYNAMIC_REQUIRE_CACHE = Object.create(null);\nconst DEFAULT_PARENT_MODULE = {\n\tid: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []\n};\nconst CHECKED_EXTENSIONS = ['', '.js', '.json'];\n\nfunction normalize (path) {\n\tpath = path.replace(/\\\\\\\\/g, '/');\n\tconst parts = path.split('/');\n\tconst slashed = parts[0] === '';\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] === '.' || parts[i] === '') {\n\t\t\tparts.splice(i--, 1);\n\t\t}\n\t}\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] !== '..') continue;\n\t\tif (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {\n\t\t\tparts.splice(--i, 2);\n\t\t\ti--;\n\t\t}\n\t}\n\tpath = parts.join('/');\n\tif (slashed && path[0] !== '/')\n\t path = '/' + path;\n\telse if (path.length === 0)\n\t path = '.';\n\treturn path;\n}\n\nfunction join () {\n\tif (arguments.length === 0)\n\t return '.';\n\tlet joined;\n\tfor (let i = 0; i < arguments.length; ++i) {\n\t let arg = arguments[i];\n\t if (arg.length > 0) {\n\t\tif (joined === undefined)\n\t\t joined = arg;\n\t\telse\n\t\t joined += '/' + arg;\n\t }\n\t}\n\tif (joined === undefined)\n\t return '.';\n\n\treturn joined;\n}\n\nfunction isPossibleNodeModulesPath (modulePath) {\n\tlet c0 = modulePath[0];\n\tif (c0 === '/' || c0 === '\\\\\\\\') return false;\n\tlet c1 = modulePath[1], c2 = modulePath[2];\n\tif ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\\\\\')) ||\n\t\t(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\\\\\'))) return false;\n\tif (c1 === ':' && (c2 === '/' || c2 === '\\\\\\\\'))\n\t\treturn false;\n\treturn true;\n}\n\nfunction dirname (path) {\n if (path.length === 0)\n return '.';\n\n let i = path.length - 1;\n while (i > 0) {\n const c = path.charCodeAt(i);\n if ((c === 47 || c === 92) && i !== path.length - 1)\n break;\n i--;\n }\n\n if (i > 0)\n return path.substr(0, i);\n\n if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)\n return path.charAt(0);\n\n return '.';\n}\n\nexport function commonjsResolveImpl (path, originalModuleDir, testCache) {\n\tconst shouldTryNodeModules = isPossibleNodeModulesPath(path);\n\tpath = normalize(path);\n\tlet relPath;\n\tif (path[0] === '/') {\n\t\toriginalModuleDir = '/';\n\t}\n\twhile (true) {\n\t\tif (!shouldTryNodeModules) {\n\t\t\trelPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;\n\t\t} else if (originalModuleDir) {\n\t\t\trelPath = normalize(originalModuleDir + '/node_modules/' + path);\n\t\t} else {\n\t\t\trelPath = normalize(join('node_modules', path));\n\t\t}\n\n\t\tif (relPath.endsWith('/..')) {\n\t\t\tbreak; // Travelled too far up, avoid infinite loop\n\t\t}\n\n\t\tfor (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {\n\t\t\tconst resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];\n\t\t\tif (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {\n\t\t\t\treturn resolvedPath;\n\t\t\t};\n\t\t\tif (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {\n\t\t\t\treturn resolvedPath;\n\t\t\t};\n\t\t}\n\t\tif (!shouldTryNodeModules) break;\n\t\tconst nextDir = normalize(originalModuleDir + '/..');\n\t\tif (nextDir === originalModuleDir) break;\n\t\toriginalModuleDir = nextDir;\n\t}\n\treturn null;\n}\n\nexport function commonjsResolve (path, originalModuleDir) {\n\tconst resolvedPath = commonjsResolveImpl(path, originalModuleDir);\n\tif (resolvedPath !== null) {\n\t\treturn resolvedPath;\n\t}\n\treturn require.resolve(path);\n}\n\nexport function commonjsRequire (path, originalModuleDir) {\n\tconst resolvedPath = commonjsResolveImpl(path, originalModuleDir, true);\n\tif (resolvedPath !== null) {\n let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];\n if (cachedModule) return cachedModule.exports;\n const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];\n if (loader) {\n DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {\n id: resolvedPath,\n filename: resolvedPath,\n path: dirname(resolvedPath),\n exports: {},\n parent: DEFAULT_PARENT_MODULE,\n loaded: false,\n children: [],\n paths: [],\n require: function (path, base) {\n return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);\n }\n };\n try {\n loader.call(commonjsGlobal, cachedModule, cachedModule.exports);\n } catch (error) {\n delete DYNAMIC_REQUIRE_CACHE[resolvedPath];\n throw error;\n }\n cachedModule.loaded = true;\n return cachedModule.exports;\n };\n\t}\n\treturn require(path);\n}\n\ncommonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;\ncommonjsRequire.resolve = commonjsResolve;\n`;\n\nexport function getHelpersModule(isDynamicRequireModulesEnabled) {\n return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;\n}\n","/* eslint-disable import/prefer-default-export */\n\nimport { basename, dirname, extname, sep } from 'path';\n\nimport { makeLegalIdentifier } from '@rollup/pluginutils';\n\nexport function deconflict(scope, globals, identifier) {\n let i = 1;\n let deconflicted = makeLegalIdentifier(identifier);\n\n while (scope.contains(deconflicted) || globals.has(deconflicted)) {\n deconflicted = makeLegalIdentifier(`${identifier}_${i}`);\n i += 1;\n }\n // eslint-disable-next-line no-param-reassign\n scope.declarations[deconflicted] = true;\n\n return deconflicted;\n}\n\nexport function getName(id) {\n const name = makeLegalIdentifier(basename(id, extname(id)));\n if (name !== 'index') {\n return name;\n }\n const segments = dirname(id).split(sep);\n return makeLegalIdentifier(segments[segments.length - 1]);\n}\n\nexport function normalizePathSlashes(path) {\n return path.replace(/\\\\/g, '/');\n}\n\nconst VIRTUAL_PATH_BASE = '/$$rollup_base$$';\nexport const getVirtualPathForDynamicRequirePath = (path, commonDir) => {\n const normalizedPath = normalizePathSlashes(path);\n return normalizedPath.startsWith(commonDir)\n ? VIRTUAL_PATH_BASE + normalizedPath.slice(commonDir.length)\n : normalizedPath;\n};\n","import { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n DYNAMIC_PACKAGES_ID,\n DYNAMIC_REGISTER_SUFFIX,\n HELPERS_ID,\n isWrappedId,\n unwrapId,\n wrapId\n} from './helpers';\nimport { getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils';\n\nexport function getPackageEntryPoint(dirPath) {\n let entryPoint = 'index.js';\n\n try {\n if (existsSync(join(dirPath, 'package.json'))) {\n entryPoint =\n JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main ||\n entryPoint;\n }\n } catch (ignored) {\n // ignored\n }\n\n return entryPoint;\n}\n\nexport function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {\n let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;\n for (const dir of dynamicRequireModuleDirPaths) {\n const entryPoint = getPackageEntryPoint(dir);\n\n code += `\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(dir, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});\n});`;\n }\n return code;\n}\n\nexport function getDynamicPackagesEntryIntro(\n dynamicRequireModuleDirPaths,\n dynamicRequireModuleSet\n) {\n let dynamicImports = Array.from(\n dynamicRequireModuleSet,\n (dynamicId) => `require(${JSON.stringify(wrapModuleRegisterProxy(dynamicId))});`\n ).join('\\n');\n\n if (dynamicRequireModuleDirPaths.length) {\n dynamicImports += `require(${JSON.stringify(wrapModuleRegisterProxy(DYNAMIC_PACKAGES_ID))});`;\n }\n\n return dynamicImports;\n}\n\nexport function wrapModuleRegisterProxy(id) {\n return wrapId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function unwrapModuleRegisterProxy(id) {\n return unwrapId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function isModuleRegisterProxy(id) {\n return isWrappedId(id, DYNAMIC_REGISTER_SUFFIX);\n}\n\nexport function isDynamicModuleImport(id, dynamicRequireModuleSet) {\n const normalizedPath = normalizePathSlashes(id);\n return dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json');\n}\n","import { statSync } from 'fs';\n\nimport { join, resolve } from 'path';\n\nimport glob from 'glob';\n\nimport { normalizePathSlashes } from './utils';\nimport { getPackageEntryPoint } from './dynamic-packages-manager';\n\nfunction isDirectory(path) {\n try {\n if (statSync(path).isDirectory()) return true;\n } catch (ignored) {\n // Nothing to do here\n }\n return false;\n}\n\nexport default function getDynamicRequirePaths(patterns) {\n const dynamicRequireModuleSet = new Set();\n for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {\n const isNegated = pattern.startsWith('!');\n const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);\n for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {\n modifySet(normalizePathSlashes(resolve(path)));\n if (isDirectory(path)) {\n modifySet(normalizePathSlashes(resolve(join(path, getPackageEntryPoint(path)))));\n }\n }\n }\n const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter((path) =>\n isDirectory(path)\n );\n return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };\n}\n","const isCjsPromises = new Map();\n\nexport function getIsCjsPromise(id) {\n let isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) return isCjsPromise.promise;\n\n const promise = new Promise((resolve) => {\n isCjsPromise = {\n resolve,\n promise: null\n };\n isCjsPromises.set(id, isCjsPromise);\n });\n isCjsPromise.promise = promise;\n\n return promise;\n}\n\nexport function setIsCjsPromise(id, resolution) {\n const isCjsPromise = isCjsPromises.get(id);\n if (isCjsPromise) {\n if (isCjsPromise.resolve) {\n isCjsPromise.resolve(resolution);\n isCjsPromise.resolve = null;\n }\n } else {\n isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: null });\n }\n}\n","import { readFileSync } from 'fs';\n\nimport { DYNAMIC_JSON_PREFIX, HELPERS_ID } from './helpers';\nimport { getIsCjsPromise } from './is-cjs';\nimport { getName, getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils';\n\n// e.g. id === \"commonjsHelpers?commonjsRegister\"\nexport function getSpecificHelperProxy(id) {\n return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;\n}\n\nexport function getUnknownRequireProxy(id, requireReturnsDefault) {\n if (requireReturnsDefault === true || id.endsWith('.json')) {\n return `export {default} from ${JSON.stringify(id)};`;\n }\n const name = getName(id);\n const exported =\n requireReturnsDefault === 'auto'\n ? `import {getDefaultExportFromNamespaceIfNotNamed} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`\n : requireReturnsDefault === 'preferred'\n ? `import {getDefaultExportFromNamespaceIfPresent} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`\n : !requireReturnsDefault\n ? `import {getAugmentedNamespace} from \"${HELPERS_ID}\"; export default /*@__PURE__*/getAugmentedNamespace(${name});`\n : `export default ${name};`;\n return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;\n}\n\nexport function getDynamicJsonProxy(id, commonDir) {\n const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));\n return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n module.exports = require(${JSON.stringify(normalizedPath)});\n});`;\n}\n\nexport function getDynamicRequireProxy(normalizedPath, commonDir) {\n return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\\ncommonjsRegister(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)\n )}, function (module, exports) {\n ${readFileSync(normalizedPath, { encoding: 'utf8' })}\n});`;\n}\n\nexport async function getStaticRequireProxy(\n id,\n requireReturnsDefault,\n esModulesWithDefaultExport,\n esModulesWithNamedExports\n) {\n const name = getName(id);\n const isCjs = await getIsCjsPromise(id);\n if (isCjs) {\n return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;\n } else if (isCjs === null) {\n return getUnknownRequireProxy(id, requireReturnsDefault);\n } else if (!requireReturnsDefault) {\n return `import {getAugmentedNamespace} from \"${HELPERS_ID}\"; import * as ${name} from ${JSON.stringify(\n id\n )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;\n } else if (\n requireReturnsDefault !== true &&\n (requireReturnsDefault === 'namespace' ||\n !esModulesWithDefaultExport.has(id) ||\n (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))\n ) {\n return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;\n }\n return `export {default} from ${JSON.stringify(id)};`;\n}\n","/* eslint-disable no-param-reassign, no-undefined */\n\nimport { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\n\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n EXTERNAL_SUFFIX,\n HELPERS_ID,\n isWrappedId,\n PROXY_SUFFIX,\n REQUIRE_SUFFIX,\n unwrapId,\n wrapId\n} from './helpers';\nimport {\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy,\n wrapModuleRegisterProxy\n} from './dynamic-packages-manager';\n\nfunction getCandidatesForExtension(resolved, extension) {\n return [resolved + extension, `${resolved}${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n return extensions.reduce(\n (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n [resolved]\n );\n}\n\nexport default function getResolveId(extensions) {\n function resolveExtensions(importee, importer) {\n // not our problem\n if (importee[0] !== '.' || !importer) return undefined;\n\n const resolved = resolve(dirname(importer), importee);\n const candidates = getCandidates(resolved, extensions);\n\n for (let i = 0; i < candidates.length; i += 1) {\n try {\n const stats = statSync(candidates[i]);\n if (stats.isFile()) return { id: candidates[i] };\n } catch (err) {\n /* noop */\n }\n }\n\n return undefined;\n }\n\n return function resolveId(importee, rawImporter) {\n const importer =\n rawImporter && isModuleRegisterProxy(rawImporter)\n ? unwrapModuleRegisterProxy(rawImporter)\n : rawImporter;\n\n // Proxies are only importing resolved ids, no need to resolve again\n if (importer && isWrappedId(importer, PROXY_SUFFIX)) {\n return importee;\n }\n\n const isProxyModule = isWrappedId(importee, PROXY_SUFFIX);\n const isRequiredModule = isWrappedId(importee, REQUIRE_SUFFIX);\n let isModuleRegistration = false;\n\n if (isProxyModule) {\n importee = unwrapId(importee, PROXY_SUFFIX);\n } else if (isRequiredModule) {\n importee = unwrapId(importee, REQUIRE_SUFFIX);\n\n isModuleRegistration = isModuleRegisterProxy(importee);\n if (isModuleRegistration) {\n importee = unwrapModuleRegisterProxy(importee);\n }\n }\n\n if (\n importee.startsWith(HELPERS_ID) ||\n importee === DYNAMIC_PACKAGES_ID ||\n importee.startsWith(DYNAMIC_JSON_PREFIX)\n ) {\n return importee;\n }\n\n if (importee.startsWith('\\0')) {\n return null;\n }\n\n return this.resolve(importee, importer, {\n skipSelf: true,\n custom: { 'node-resolve': { isRequire: isProxyModule || isRequiredModule } }\n }).then((resolved) => {\n if (!resolved) {\n resolved = resolveExtensions(importee, importer);\n }\n if (resolved && isProxyModule) {\n resolved.id = wrapId(resolved.id, resolved.external ? EXTERNAL_SUFFIX : PROXY_SUFFIX);\n resolved.external = false;\n } else if (resolved && isModuleRegistration) {\n resolved.id = wrapModuleRegisterProxy(resolved.id);\n } else if (!resolved && (isProxyModule || isRequiredModule)) {\n return { id: wrapId(importee, EXTERNAL_SUFFIX), external: false };\n }\n return resolved;\n });\n };\n}\n","export default function validateRollupVersion(rollupVersion, peerDependencyVersion) {\n const [major, minor] = rollupVersion.split('.').map(Number);\n const versionRegexp = /\\^(\\d+\\.\\d+)\\.\\d+/g;\n let minMajor = Infinity;\n let minMinor = Infinity;\n let foundVersion;\n // eslint-disable-next-line no-cond-assign\n while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {\n const [foundMajor, foundMinor] = foundVersion[1].split('.').map(Number);\n if (foundMajor < minMajor) {\n minMajor = foundMajor;\n minMinor = foundMinor;\n }\n }\n if (major < minMajor || (major === minMajor && minor < minMinor)) {\n throw new Error(\n `Insufficient Rollup version: \"@rollup/plugin-commonjs\" requires at least rollup@${minMajor}.${minMinor} but found rollup@${rollupVersion}.`\n );\n }\n}\n","export { default as isReference } from 'is-reference';\n\nconst operators = {\n '==': (x) => equals(x.left, x.right, false),\n\n '!=': (x) => not(operators['=='](x)),\n\n '===': (x) => equals(x.left, x.right, true),\n\n '!==': (x) => not(operators['==='](x)),\n\n '!': (x) => isFalsy(x.argument),\n\n '&&': (x) => isTruthy(x.left) && isTruthy(x.right),\n\n '||': (x) => isTruthy(x.left) || isTruthy(x.right)\n};\n\nfunction not(value) {\n return value === null ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n if (a.type !== b.type) return null;\n // eslint-disable-next-line eqeqeq\n if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n return null;\n}\n\nexport function isTruthy(node) {\n if (!node) return false;\n if (node.type === 'Literal') return !!node.value;\n if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n if (node.operator in operators) return operators[node.operator](node);\n return null;\n}\n\nexport function isFalsy(node) {\n return not(isTruthy(node));\n}\n\nexport function getKeypath(node) {\n const parts = [];\n\n while (node.type === 'MemberExpression') {\n if (node.computed) return null;\n\n parts.unshift(node.property.name);\n // eslint-disable-next-line no-param-reassign\n node = node.object;\n }\n\n if (node.type !== 'Identifier') return null;\n\n const { name } = node;\n parts.unshift(name);\n\n return { name, keypath: parts.join('.') };\n}\n\nexport const KEY_COMPILED_ESM = '__esModule';\n\nexport function isDefineCompiledEsm(node) {\n const definedProperty =\n getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');\n if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {\n return isTruthy(definedProperty.value);\n }\n return false;\n}\n\nfunction getDefinePropertyCallName(node, targetName) {\n const targetNames = targetName.split('.');\n\n const {\n callee: { object, property }\n } = node;\n if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;\n if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;\n if (node.arguments.length !== 3) return;\n\n const [target, key, value] = node.arguments;\n if (targetNames.length === 1) {\n if (target.type !== 'Identifier' || target.name !== targetNames[0]) {\n return;\n }\n }\n\n if (targetNames.length === 2) {\n if (\n target.type !== 'MemberExpression' ||\n target.object.name !== targetNames[0] ||\n target.property.name !== targetNames[1]\n ) {\n return;\n }\n }\n\n if (value.type !== 'ObjectExpression' || !value.properties) return;\n\n const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value');\n if (!valueProperty || !valueProperty.value) return;\n\n // eslint-disable-next-line consistent-return\n return { key: key.value, value: valueProperty.value };\n}\n\nexport function isLocallyShadowed(name, scope) {\n while (scope.parent) {\n if (scope.declarations[name]) {\n return true;\n }\n // eslint-disable-next-line no-param-reassign\n scope = scope.parent;\n }\n return false;\n}\n\nexport function isShorthandProperty(parent) {\n return parent && parent.type === 'Property' && parent.shorthand;\n}\n","export function wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath) {\n const args = `module${uses.exports ? ', exports' : ''}`;\n\n magicString\n .trim()\n .prepend(`var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`)\n .append(\n `\\n}${virtualDynamicRequirePath ? `, ${JSON.stringify(virtualDynamicRequirePath)}` : ''});`\n );\n}\n\nexport function rewriteExportsAndGetExportsBlock(\n magicString,\n moduleName,\n wrapped,\n topLevelModuleExportsAssignments,\n topLevelExportsAssignmentsByName,\n defineCompiledEsmExpressions,\n deconflict,\n isRestorableCompiledEsm,\n code,\n uses,\n HELPERS_NAME\n) {\n const namedExportDeclarations = [`export { ${moduleName} as __moduleExports };`];\n const moduleExportsPropertyAssignments = [];\n let deconflictedDefaultExportName;\n\n if (!wrapped) {\n let hasModuleExportsAssignment = false;\n const namedExportProperties = [];\n\n // Collect and rewrite module.exports assignments\n for (const { left } of topLevelModuleExportsAssignments) {\n hasModuleExportsAssignment = true;\n magicString.overwrite(left.start, left.end, `var ${moduleName}`);\n }\n\n // Collect and rewrite named exports\n for (const [exportName, node] of topLevelExportsAssignmentsByName) {\n const deconflicted = deconflict(exportName);\n magicString.overwrite(node.start, node.left.end, `var ${deconflicted}`);\n\n if (exportName === 'default') {\n deconflictedDefaultExportName = deconflicted;\n } else {\n namedExportDeclarations.push(\n exportName === deconflicted\n ? `export { ${exportName} };`\n : `export { ${deconflicted} as ${exportName} };`\n );\n }\n\n if (hasModuleExportsAssignment) {\n moduleExportsPropertyAssignments.push(`${moduleName}.${exportName} = ${deconflicted};`);\n } else {\n namedExportProperties.push(`\\t${exportName}: ${deconflicted}`);\n }\n }\n\n // Regenerate CommonJS namespace\n if (!hasModuleExportsAssignment) {\n const moduleExports = `{\\n${namedExportProperties.join(',\\n')}\\n}`;\n magicString\n .trim()\n .append(\n `\\n\\nvar ${moduleName} = ${\n isRestorableCompiledEsm\n ? `/*#__PURE__*/Object.defineProperty(${moduleExports}, '__esModule', {value: true})`\n : moduleExports\n };`\n );\n }\n }\n\n // Generate default export\n const defaultExport = [];\n if (isRestorableCompiledEsm) {\n defaultExport.push(`export default ${deconflictedDefaultExportName || moduleName};`);\n } else if (\n (wrapped || deconflictedDefaultExportName) &&\n (defineCompiledEsmExpressions.length > 0 || code.indexOf('__esModule') >= 0)\n ) {\n // eslint-disable-next-line no-param-reassign\n uses.commonjsHelpers = true;\n defaultExport.push(\n `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`\n );\n } else {\n defaultExport.push(`export default ${moduleName};`);\n }\n\n return `\\n\\n${defaultExport\n .concat(namedExportDeclarations)\n .concat(moduleExportsPropertyAssignments)\n .join('\\n')}`;\n}\n","import { dirname, resolve } from 'path';\n\nimport { sync as nodeResolveSync } from 'resolve';\n\nimport { isLocallyShadowed } from './ast-utils';\nimport { HELPERS_ID, PROXY_SUFFIX, REQUIRE_SUFFIX, wrapId } from './helpers';\nimport { normalizePathSlashes } from './utils';\n\nexport function isRequireStatement(node, scope) {\n if (!node) return false;\n if (node.type !== 'CallExpression') return false;\n\n // Weird case of `require()` or `module.require()` without arguments\n if (node.arguments.length === 0) return false;\n\n return isRequire(node.callee, scope);\n}\n\nfunction isRequire(node, scope) {\n return (\n (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) ||\n (node.type === 'MemberExpression' && isModuleRequire(node, scope))\n );\n}\n\nexport function isModuleRequire({ object, property }, scope) {\n return (\n object.type === 'Identifier' &&\n object.name === 'module' &&\n property.type === 'Identifier' &&\n property.name === 'require' &&\n !scope.contains('module')\n );\n}\n\nexport function isStaticRequireStatement(node, scope) {\n if (!isRequireStatement(node, scope)) return false;\n return !hasDynamicArguments(node);\n}\n\nfunction hasDynamicArguments(node) {\n return (\n node.arguments.length > 1 ||\n (node.arguments[0].type !== 'Literal' &&\n (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n );\n}\n\nconst reservedMethod = { resolve: true, cache: true, main: true };\n\nexport function isNodeRequirePropertyAccess(parent) {\n return parent && parent.property && reservedMethod[parent.property.name];\n}\n\nexport function isIgnoredRequireStatement(requiredNode, ignoreRequire) {\n return ignoreRequire(requiredNode.arguments[0].value);\n}\n\nexport function getRequireStringArg(node) {\n return node.arguments[0].type === 'Literal'\n ? node.arguments[0].value\n : node.arguments[0].quasis[0].value.cooked;\n}\n\nexport function hasDynamicModuleForPath(source, id, dynamicRequireModuleSet) {\n if (!/^(?:\\.{0,2}[/\\\\]|[A-Za-z]:[/\\\\])/.test(source)) {\n try {\n const resolvedPath = normalizePathSlashes(nodeResolveSync(source, { basedir: dirname(id) }));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n } catch (ex) {\n // Probably a node.js internal module\n return false;\n }\n\n return false;\n }\n\n for (const attemptExt of ['', '.js', '.json']) {\n const resolvedPath = normalizePathSlashes(resolve(dirname(id), source + attemptExt));\n if (dynamicRequireModuleSet.has(resolvedPath)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getRequireHandlers() {\n const requiredSources = [];\n const requiredBySource = Object.create(null);\n const requiredByNode = new Map();\n const requireExpressionsWithUsedReturnValue = [];\n\n function addRequireStatement(sourceId, node, scope, usesReturnValue) {\n const required = getRequired(sourceId);\n requiredByNode.set(node, { scope, required });\n if (usesReturnValue) {\n required.nodesUsingRequired.push(node);\n requireExpressionsWithUsedReturnValue.push(node);\n }\n }\n\n function getRequired(sourceId) {\n if (!requiredBySource[sourceId]) {\n requiredSources.push(sourceId);\n\n requiredBySource[sourceId] = {\n source: sourceId,\n name: null,\n nodesUsingRequired: []\n };\n }\n\n return requiredBySource[sourceId];\n }\n\n function rewriteRequireExpressionsAndGetImportBlock(\n magicString,\n topLevelDeclarations,\n topLevelRequireDeclarators,\n reassignedNames,\n helpersNameIfUsed,\n dynamicRegisterSources\n ) {\n const removedDeclarators = getDeclaratorsReplacedByImportsAndSetImportNames(\n topLevelRequireDeclarators,\n requiredByNode,\n reassignedNames\n );\n setRemainingImportNamesAndRewriteRequires(\n requireExpressionsWithUsedReturnValue,\n requiredByNode,\n magicString\n );\n removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString);\n const importBlock = `${(helpersNameIfUsed\n ? [`import * as ${helpersNameIfUsed} from '${HELPERS_ID}';`]\n : []\n )\n .concat(\n // dynamic registers first, as the may be required in the other modules\n [...dynamicRegisterSources].map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),\n\n // now the actual modules so that they are analyzed before creating the proxies;\n // no need to do this for virtual modules as we never proxy them\n requiredSources\n .filter((source) => !source.startsWith('\\0'))\n .map((source) => `import '${wrapId(source, REQUIRE_SUFFIX)}';`),\n\n // now the proxy modules\n requiredSources.map((source) => {\n const { name, nodesUsingRequired } = requiredBySource[source];\n return `import ${nodesUsingRequired.length ? `${name} from ` : ``}'${\n source.startsWith('\\0') ? source : wrapId(source, PROXY_SUFFIX)\n }';`;\n })\n )\n .join('\\n')}`;\n return importBlock ? `${importBlock}\\n\\n` : '';\n }\n\n return {\n addRequireStatement,\n requiredSources,\n rewriteRequireExpressionsAndGetImportBlock\n };\n}\n\nfunction getDeclaratorsReplacedByImportsAndSetImportNames(\n topLevelRequireDeclarators,\n requiredByNode,\n reassignedNames\n) {\n const removedDeclarators = new Set();\n for (const declarator of topLevelRequireDeclarators) {\n const { required } = requiredByNode.get(declarator.init);\n if (!required.name) {\n const potentialName = declarator.id.name;\n if (\n !reassignedNames.has(potentialName) &&\n !required.nodesUsingRequired.some((node) =>\n isLocallyShadowed(potentialName, requiredByNode.get(node).scope)\n )\n ) {\n required.name = potentialName;\n removedDeclarators.add(declarator);\n }\n }\n }\n return removedDeclarators;\n}\n\nfunction setRemainingImportNamesAndRewriteRequires(\n requireExpressionsWithUsedReturnValue,\n requiredByNode,\n magicString\n) {\n let uid = 0;\n for (const requireExpression of requireExpressionsWithUsedReturnValue) {\n const { required } = requiredByNode.get(requireExpression);\n if (!required.name) {\n let potentialName;\n const isUsedName = (node) => requiredByNode.get(node).scope.contains(potentialName);\n do {\n potentialName = `require$$${uid}`;\n uid += 1;\n } while (required.nodesUsingRequired.some(isUsedName));\n required.name = potentialName;\n }\n magicString.overwrite(requireExpression.start, requireExpression.end, required.name);\n }\n}\n\nfunction removeDeclaratorsFromDeclarations(topLevelDeclarations, removedDeclarators, magicString) {\n for (const declaration of topLevelDeclarations) {\n let keepDeclaration = false;\n let [{ start }] = declaration.declarations;\n for (const declarator of declaration.declarations) {\n if (removedDeclarators.has(declarator)) {\n magicString.remove(start, declarator.end);\n } else if (!keepDeclaration) {\n magicString.remove(start, declarator.start);\n keepDeclaration = true;\n }\n start = declarator.end;\n }\n if (!keepDeclaration) {\n magicString.remove(declaration.start, declaration.end);\n }\n }\n}\n","/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */\n\nimport { dirname } from 'path';\n\nimport { attachScopes, extractAssignedNames, makeLegalIdentifier } from '@rollup/pluginutils';\nimport { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\n\nimport {\n getKeypath,\n isDefineCompiledEsm,\n isFalsy,\n isReference,\n isShorthandProperty,\n isTruthy,\n KEY_COMPILED_ESM\n} from './ast-utils';\nimport { rewriteExportsAndGetExportsBlock, wrapCode } from './generate-exports';\nimport {\n getRequireHandlers,\n getRequireStringArg,\n hasDynamicModuleForPath,\n isIgnoredRequireStatement,\n isModuleRequire,\n isNodeRequirePropertyAccess,\n isRequireStatement,\n isStaticRequireStatement\n} from './generate-imports';\nimport { DYNAMIC_JSON_PREFIX } from './helpers';\nimport { tryParse } from './parse';\nimport { deconflict, getName, getVirtualPathForDynamicRequirePath } from './utils';\nimport {\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy,\n wrapModuleRegisterProxy\n} from './dynamic-packages-manager';\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nexport default function transformCommonjs(\n parse,\n code,\n id,\n isEsModule,\n ignoreGlobal,\n ignoreRequire,\n getIgnoreTryCatchRequireStatementMode,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n disableWrap,\n commonDir,\n astCache\n) {\n const ast = astCache || tryParse(parse, code, id);\n const magicString = new MagicString(code);\n const uses = {\n module: false,\n exports: false,\n global: false,\n require: false,\n commonjsHelpers: false\n };\n const virtualDynamicRequirePath =\n isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname(id), commonDir);\n let scope = attachScopes(ast, 'scope');\n let lexicalDepth = 0;\n let programDepth = 0;\n let currentTryBlockEnd = null;\n let shouldWrap = false;\n const defineCompiledEsmExpressions = [];\n\n const globals = new Set();\n\n // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');\n const namedExports = {};\n const dynamicRegisterSources = new Set();\n let hasRemovedRequire = false;\n\n const {\n addRequireStatement,\n requiredSources,\n rewriteRequireExpressionsAndGetImportBlock\n } = getRequireHandlers();\n\n // See which names are assigned to. This is necessary to prevent\n // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n const reassignedNames = new Set();\n const topLevelDeclarations = [];\n const topLevelRequireDeclarators = new Set();\n const skippedNodes = new Set();\n const topLevelModuleExportsAssignments = [];\n const topLevelExportsAssignmentsByName = new Map();\n\n walk(ast, {\n enter(node, parent) {\n if (skippedNodes.has(node)) {\n this.skip();\n return;\n }\n\n if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) {\n currentTryBlockEnd = null;\n }\n\n programDepth += 1;\n if (node.scope) ({ scope } = node);\n if (functionType.test(node.type)) lexicalDepth += 1;\n if (sourceMap) {\n magicString.addSourcemapLocation(node.start);\n magicString.addSourcemapLocation(node.end);\n }\n\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'TryStatement':\n if (currentTryBlockEnd === null) {\n currentTryBlockEnd = node.block.end;\n }\n return;\n case 'AssignmentExpression':\n if (node.left.type === 'MemberExpression') {\n const flattened = getKeypath(node.left);\n if (!flattened || scope.contains(flattened.name)) return;\n\n const exportsPatternMatch = exportsPattern.exec(flattened.keypath);\n if (!exportsPatternMatch || flattened.keypath === 'exports') return;\n\n const [, exportName] = exportsPatternMatch;\n uses[flattened.name] = true;\n\n // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n if (programDepth > 3) {\n shouldWrap = true;\n } else if (exportName === KEY_COMPILED_ESM) {\n defineCompiledEsmExpressions.push(parent);\n } else if (flattened.keypath === 'module.exports') {\n topLevelModuleExportsAssignments.push(node);\n } else if (!topLevelExportsAssignmentsByName.has(exportName)) {\n topLevelExportsAssignmentsByName.set(exportName, node);\n } else {\n shouldWrap = true;\n }\n\n skippedNodes.add(node.left);\n\n if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n node.right.properties.forEach((prop) => {\n if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;\n const { name } = prop.key;\n if (name === makeLegalIdentifier(name)) namedExports[name] = true;\n });\n return;\n }\n\n if (exportsPatternMatch[1]) namedExports[exportsPatternMatch[1]] = true;\n } else {\n for (const name of extractAssignedNames(node.left)) {\n reassignedNames.add(name);\n }\n }\n return;\n case 'CallExpression': {\n if (isDefineCompiledEsm(node)) {\n if (programDepth === 3 && parent.type === 'ExpressionStatement') {\n // skip special handling for [module.]exports until we know we render this\n skippedNodes.add(node.arguments[0]);\n defineCompiledEsmExpressions.push(parent);\n } else {\n shouldWrap = true;\n }\n return;\n }\n\n if (\n node.callee.object &&\n node.callee.object.name === 'require' &&\n node.callee.property.name === 'resolve' &&\n hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)\n ) {\n const requireNode = node.callee.object;\n magicString.appendLeft(\n node.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )}`\n );\n magicString.overwrite(\n requireNode.start,\n requireNode.end,\n `${HELPERS_NAME}.commonjsRequire`,\n {\n storeName: true\n }\n );\n uses.commonjsHelpers = true;\n return;\n }\n\n if (!isStaticRequireStatement(node, scope)) return;\n if (!isDynamicRequireModulesEnabled) {\n skippedNodes.add(node.callee);\n }\n if (!isIgnoredRequireStatement(node, ignoreRequire)) {\n skippedNodes.add(node.callee);\n const usesReturnValue = parent.type !== 'ExpressionStatement';\n\n let canConvertRequire = true;\n let shouldRemoveRequireStatement = false;\n\n if (currentTryBlockEnd !== null) {\n ({\n canConvertRequire,\n shouldRemoveRequireStatement\n } = getIgnoreTryCatchRequireStatementMode(node.arguments[0].value));\n\n if (shouldRemoveRequireStatement) {\n hasRemovedRequire = true;\n }\n }\n\n let sourceId = getRequireStringArg(node);\n const isDynamicRegister = isModuleRegisterProxy(sourceId);\n if (isDynamicRegister) {\n sourceId = unwrapModuleRegisterProxy(sourceId);\n if (sourceId.endsWith('.json')) {\n sourceId = DYNAMIC_JSON_PREFIX + sourceId;\n }\n dynamicRegisterSources.add(wrapModuleRegisterProxy(sourceId));\n } else {\n if (\n !sourceId.endsWith('.json') &&\n hasDynamicModuleForPath(sourceId, id, dynamicRequireModuleSet)\n ) {\n if (shouldRemoveRequireStatement) {\n magicString.overwrite(node.start, node.end, `undefined`);\n } else if (canConvertRequire) {\n magicString.overwrite(\n node.start,\n node.end,\n `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(\n getVirtualPathForDynamicRequirePath(sourceId, commonDir)\n )}, ${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )})`\n );\n uses.commonjsHelpers = true;\n }\n return;\n }\n\n if (canConvertRequire) {\n addRequireStatement(sourceId, node, scope, usesReturnValue);\n }\n }\n\n if (usesReturnValue) {\n if (shouldRemoveRequireStatement) {\n magicString.overwrite(node.start, node.end, `undefined`);\n return;\n }\n\n if (\n parent.type === 'VariableDeclarator' &&\n !scope.parent &&\n parent.id.type === 'Identifier'\n ) {\n // This will allow us to reuse this variable name as the imported variable if it is not reassigned\n // and does not conflict with variables in other places where this is imported\n topLevelRequireDeclarators.add(parent);\n }\n } else {\n // This is a bare import, e.g. `require('foo');`\n\n if (!canConvertRequire && !shouldRemoveRequireStatement) {\n return;\n }\n\n magicString.remove(parent.start, parent.end);\n }\n }\n return;\n }\n case 'ConditionalExpression':\n case 'IfStatement':\n // skip dead branches\n if (isFalsy(node.test)) {\n skippedNodes.add(node.consequent);\n } else if (node.alternate && isTruthy(node.test)) {\n skippedNodes.add(node.alternate);\n }\n return;\n case 'Identifier': {\n const { name } = node;\n if (!(isReference(node, parent) && !scope.contains(name))) return;\n switch (name) {\n case 'require':\n if (isNodeRequirePropertyAccess(parent)) {\n if (hasDynamicModuleForPath(id, '/', dynamicRequireModuleSet)) {\n if (parent.property.name === 'cache') {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n }\n\n return;\n }\n\n if (isDynamicRequireModulesEnabled && isRequireStatement(parent, scope)) {\n magicString.appendLeft(\n parent.end - 1,\n `,${JSON.stringify(\n dirname(id) === '.' ? null /* default behavior */ : virtualDynamicRequirePath\n )}`\n );\n }\n if (isShorthandProperty(parent)) {\n magicString.appendRight(node.end, `: ${HELPERS_NAME}.commonjsRequire`);\n } else {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n }\n\n uses.commonjsHelpers = true;\n return;\n case 'module':\n case 'exports':\n shouldWrap = true;\n uses[name] = true;\n return;\n case 'global':\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n return;\n case 'define':\n magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n return;\n default:\n globals.add(name);\n return;\n }\n }\n case 'MemberExpression':\n if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n skippedNodes.add(node.object);\n skippedNodes.add(node.property);\n }\n return;\n case 'ReturnStatement':\n // if top-level return, we need to wrap it\n if (lexicalDepth === 0) {\n shouldWrap = true;\n }\n return;\n case 'ThisExpression':\n // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal`\n if (lexicalDepth === 0) {\n uses.global = true;\n if (!ignoreGlobal) {\n magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n storeName: true\n });\n uses.commonjsHelpers = true;\n }\n }\n return;\n case 'UnaryExpression':\n // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n if (node.operator === 'typeof') {\n const flattened = getKeypath(node.argument);\n if (!flattened) return;\n\n if (scope.contains(flattened.name)) return;\n\n if (\n flattened.keypath === 'module.exports' ||\n flattened.keypath === 'module' ||\n flattened.keypath === 'exports'\n ) {\n magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n }\n }\n return;\n case 'VariableDeclaration':\n if (!scope.parent) {\n topLevelDeclarations.push(node);\n }\n }\n },\n\n leave(node) {\n programDepth -= 1;\n if (node.scope) scope = scope.parent;\n if (functionType.test(node.type)) lexicalDepth -= 1;\n }\n });\n\n let isRestorableCompiledEsm = false;\n if (defineCompiledEsmExpressions.length > 0) {\n if (!shouldWrap && defineCompiledEsmExpressions.length === 1) {\n isRestorableCompiledEsm = true;\n magicString.remove(\n defineCompiledEsmExpressions[0].start,\n defineCompiledEsmExpressions[0].end\n );\n } else {\n shouldWrap = true;\n uses.exports = true;\n }\n }\n\n // We cannot wrap ES/mixed modules\n shouldWrap = shouldWrap && !disableWrap && !isEsModule;\n uses.commonjsHelpers = uses.commonjsHelpers || shouldWrap;\n\n if (\n !(\n requiredSources.length ||\n dynamicRegisterSources.size ||\n uses.module ||\n uses.exports ||\n uses.require ||\n uses.commonjsHelpers ||\n hasRemovedRequire\n ) &&\n (ignoreGlobal || !uses.global)\n ) {\n return { meta: { commonjs: { isCommonJS: false } } };\n }\n\n const moduleName = deconflict(scope, globals, getName(id));\n\n let leadingComment = '';\n if (code.startsWith('/*')) {\n const commentEnd = code.indexOf('*/', 2) + 2;\n leadingComment = `${code.slice(0, commentEnd)}\\n`;\n magicString.remove(0, commentEnd).trim();\n }\n\n const exportBlock = isEsModule\n ? ''\n : rewriteExportsAndGetExportsBlock(\n magicString,\n moduleName,\n shouldWrap,\n topLevelModuleExportsAssignments,\n topLevelExportsAssignmentsByName,\n defineCompiledEsmExpressions,\n (name) => deconflict(scope, globals, name),\n isRestorableCompiledEsm,\n code,\n uses,\n HELPERS_NAME\n );\n\n const importBlock = rewriteRequireExpressionsAndGetImportBlock(\n magicString,\n topLevelDeclarations,\n topLevelRequireDeclarators,\n reassignedNames,\n uses.commonjsHelpers && HELPERS_NAME,\n dynamicRegisterSources\n );\n\n if (shouldWrap) {\n wrapCode(magicString, uses, moduleName, HELPERS_NAME, virtualDynamicRequirePath);\n }\n\n magicString\n .trim()\n .prepend(leadingComment + importBlock)\n .append(exportBlock);\n\n return {\n code: magicString.toString(),\n map: sourceMap ? magicString.generateMap() : null,\n syntheticNamedExports: isEsModule ? false : '__moduleExports',\n meta: { commonjs: { isCommonJS: !isEsModule } }\n };\n}\n","import { extname } from 'path';\n\nimport { createFilter } from '@rollup/pluginutils';\nimport getCommonDir from 'commondir';\n\nimport { peerDependencies } from '../package.json';\n\nimport analyzeTopLevelStatements from './analyze-top-level-statements';\n\nimport {\n getDynamicPackagesEntryIntro,\n getDynamicPackagesModule,\n isDynamicModuleImport,\n isModuleRegisterProxy,\n unwrapModuleRegisterProxy\n} from './dynamic-packages-manager';\nimport getDynamicRequirePaths from './dynamic-require-paths';\nimport {\n DYNAMIC_JSON_PREFIX,\n DYNAMIC_PACKAGES_ID,\n EXTERNAL_SUFFIX,\n getHelpersModule,\n HELPERS_ID,\n isWrappedId,\n PROXY_SUFFIX,\n unwrapId\n} from './helpers';\nimport { setIsCjsPromise } from './is-cjs';\nimport { hasCjsKeywords } from './parse';\nimport {\n getDynamicJsonProxy,\n getDynamicRequireProxy,\n getSpecificHelperProxy,\n getStaticRequireProxy,\n getUnknownRequireProxy\n} from './proxies';\nimport getResolveId from './resolve-id';\nimport validateRollupVersion from './rollup-version';\nimport transformCommonjs from './transform-commonjs';\nimport { normalizePathSlashes } from './utils';\n\nexport default function commonjs(options = {}) {\n const extensions = options.extensions || ['.js'];\n const filter = createFilter(options.include, options.exclude);\n const {\n ignoreGlobal,\n requireReturnsDefault: requireReturnsDefaultOption,\n esmExternals\n } = options;\n const getRequireReturnsDefault =\n typeof requireReturnsDefaultOption === 'function'\n ? requireReturnsDefaultOption\n : () => requireReturnsDefaultOption;\n let esmExternalIds;\n const isEsmExternal =\n typeof esmExternals === 'function'\n ? esmExternals\n : Array.isArray(esmExternals)\n ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))\n : () => esmExternals;\n\n const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(\n options.dynamicRequireTargets\n );\n const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;\n const commonDir = isDynamicRequireModulesEnabled\n ? getCommonDir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))\n : null;\n\n const esModulesWithDefaultExport = new Set();\n const esModulesWithNamedExports = new Set();\n\n const ignoreRequire =\n typeof options.ignore === 'function'\n ? options.ignore\n : Array.isArray(options.ignore)\n ? (id) => options.ignore.includes(id)\n : () => false;\n\n const getIgnoreTryCatchRequireStatementMode = (id) => {\n const mode =\n typeof options.ignoreTryCatch === 'function'\n ? options.ignoreTryCatch(id)\n : Array.isArray(options.ignoreTryCatch)\n ? options.ignoreTryCatch.includes(id)\n : options.ignoreTryCatch || false;\n\n return {\n canConvertRequire: mode !== 'remove' && mode !== true,\n shouldRemoveRequireStatement: mode === 'remove'\n };\n };\n\n const resolveId = getResolveId(extensions);\n\n const sourceMap = options.sourceMap !== false;\n\n function transformAndCheckExports(code, id) {\n if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {\n code =\n getDynamicPackagesEntryIntro(dynamicRequireModuleDirPaths, dynamicRequireModuleSet) + code;\n }\n\n const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(\n this.parse,\n code,\n id\n );\n if (hasDefaultExport) {\n esModulesWithDefaultExport.add(id);\n }\n if (hasNamedExports) {\n esModulesWithNamedExports.add(id);\n }\n\n if (\n !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&\n (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))\n ) {\n return { meta: { commonjs: { isCommonJS: false } } };\n }\n\n let disableWrap = false;\n\n // avoid wrapping in createCommonjsModule, as this is a commonjsRegister call\n if (isModuleRegisterProxy(id)) {\n disableWrap = true;\n id = unwrapModuleRegisterProxy(id);\n }\n\n return transformCommonjs(\n this.parse,\n code,\n id,\n isEsModule,\n ignoreGlobal || isEsModule,\n ignoreRequire,\n getIgnoreTryCatchRequireStatementMode,\n sourceMap,\n isDynamicRequireModulesEnabled,\n dynamicRequireModuleSet,\n disableWrap,\n commonDir,\n ast\n );\n }\n\n return {\n name: 'commonjs',\n\n buildStart() {\n validateRollupVersion(this.meta.rollupVersion, peerDependencies.rollup);\n if (options.namedExports != null) {\n this.warn(\n 'The namedExports option from \"@rollup/plugin-commonjs\" is deprecated. Named exports are now handled automatically.'\n );\n }\n },\n\n resolveId,\n\n load(id) {\n if (id === HELPERS_ID) {\n return getHelpersModule(isDynamicRequireModulesEnabled);\n }\n\n if (id.startsWith(HELPERS_ID)) {\n return getSpecificHelperProxy(id);\n }\n\n if (isWrappedId(id, EXTERNAL_SUFFIX)) {\n const actualId = unwrapId(id, EXTERNAL_SUFFIX);\n return getUnknownRequireProxy(\n actualId,\n isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true\n );\n }\n\n if (id === DYNAMIC_PACKAGES_ID) {\n return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);\n }\n\n if (id.startsWith(DYNAMIC_JSON_PREFIX)) {\n return getDynamicJsonProxy(id, commonDir);\n }\n\n if (isDynamicModuleImport(id, dynamicRequireModuleSet)) {\n return `export default require(${JSON.stringify(normalizePathSlashes(id))});`;\n }\n\n if (isModuleRegisterProxy(id)) {\n return getDynamicRequireProxy(\n normalizePathSlashes(unwrapModuleRegisterProxy(id)),\n commonDir\n );\n }\n\n if (isWrappedId(id, PROXY_SUFFIX)) {\n const actualId = unwrapId(id, PROXY_SUFFIX);\n return getStaticRequireProxy(\n actualId,\n getRequireReturnsDefault(actualId),\n esModulesWithDefaultExport,\n esModulesWithNamedExports\n );\n }\n\n return null;\n },\n\n transform(code, rawId) {\n let id = rawId;\n\n if (isModuleRegisterProxy(id)) {\n id = unwrapModuleRegisterProxy(id);\n }\n\n const extName = extname(id);\n if (\n extName !== '.cjs' &&\n id !== DYNAMIC_PACKAGES_ID &&\n !id.startsWith(DYNAMIC_JSON_PREFIX) &&\n (!filter(id) || !extensions.includes(extName))\n ) {\n return null;\n }\n\n try {\n return transformAndCheckExports.call(this, code, rawId);\n } catch (err) {\n return this.error(err, err.loc);\n }\n },\n\n moduleParsed({ id, meta: { commonjs } }) {\n if (commonjs) {\n const isCjs = commonjs.isCommonJS;\n if (isCjs != null) {\n setIsCjsPromise(id, isCjs);\n return;\n }\n }\n setIsCjsPromise(id, null);\n }\n };\n}\n"],"names":["makeLegalIdentifier","basename","extname","dirname","sep","existsSync","join","readFileSync","statSync","path","glob","resolve","nodeResolveSync","MagicString","attachScopes","walk","extractAssignedNames","isReference","createFilter","getCommonDir"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;AAC1C,EAAE,IAAI;AACN,IAAI,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,GAAG,CAAC,OAAO,GAAG,EAAE;AAChB,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/B,IAAI,MAAM,GAAG,CAAC;AACd,GAAG;AACH,CAAC;AACD;AACA,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE;AACA,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAC3D;AACO,SAAS,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE;AACnD,EAAE,MAAM,SAAS,GAAG,YAAY,GAAG,iBAAiB,GAAG,eAAe,CAAC;AACvE,EAAE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B;;AChBA;AAGA;AACe,SAAS,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;AACnE,EAAE,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACxC;AACA,EAAE,IAAI,UAAU,GAAG,KAAK,CAAC;AACzB,EAAE,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAC/B,EAAE,IAAI,eAAe,G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CAAC,MAAM,CAAC,CAAC;AACxD,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAClD,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClF;AACO,MAAM,YAAY,GAAG,iBAAiB,CAAC;AACvC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD;AACO,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AAC7D,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AACjE;AACO,MAAM,UAAU,GAAG,sBAAsB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACA,MAAM,kBAAkB,GAAG,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACA,MAAM,eAAe,GAAG,CAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AACO,SAAS,gBAAgB,CAAC,8BAA8B,EAAE;AACjE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,8BAA8B,GAAG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC;AAC9F;;AClPA;AAKA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;AACvD,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,EAAE,IAAI,YAAY,GAAGA,+BAAmB,CAAC,UAAU,CAAC,CAAC;AACrD;AACA,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;AACpE,IAAI,YAAY,GAAGA,+BAAmB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,GAAG;AACH;AACA,EAAE,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;AAC1C;AACA,EAAE,OAAO,YAAY,CAAC;A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CAAC;AACJ;;;;"} \ No newline at end of file
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/CHANGELOG.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/CHANGELOG.md
deleted file mode 100644
index d7c878c9a16..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/CHANGELOG.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# changelog
-
-## 1.0.1
-
-* Relax node type to `BaseNode` ([#17](https://github.com/Rich-Harris/estree-walker/pull/17))
-
-## 1.0.0
-
-* Don't cache child keys
-
-## 0.9.0
-
-* Add `this.remove()` method
-
-## 0.8.1
-
-* Fix pkg.files
-
-## 0.8.0
-
-* Adopt `estree` types
-
-## 0.7.0
-
-* Add a `this.replace(node)` method
-
-## 0.6.1
-
-* Only traverse nodes that exist and have a type ([#9](https://github.com/Rich-Harris/estree-walker/pull/9))
-* Only cache keys for nodes with a type ([#8](https://github.com/Rich-Harris/estree-walker/pull/8))
-
-## 0.6.0
-
-* Fix walker context type
-* Update deps, remove unncessary Bublé transformation
-
-## 0.5.2
-
-* Add types to package
-
-## 0.5.1
-
-* Prevent context corruption when `walk()` is called during a walk
-
-## 0.5.0
-
-* Export `childKeys`, for manually fixing in case of malformed ASTs
-
-## 0.4.0
-
-* Add TypeScript typings ([#3](https://github.com/Rich-Harris/estree-walker/pull/3))
-
-## 0.3.1
-
-* Include `pkg.repository` ([#2](https://github.com/Rich-Harris/estree-walker/pull/2))
-
-## 0.3.0
-
-* More predictable ordering
-
-## 0.2.1
-
-* Keep `context` shape
-
-## 0.2.0
-
-* Add ES6 build
-
-## 0.1.3
-
-* npm snafu
-
-## 0.1.2
-
-* Pass current prop and index to `enter`/`leave` callbacks
-
-## 0.1.1
-
-* First release
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/README.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/README.md
deleted file mode 100644
index d877af36d49..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# estree-walker
-
-Simple utility for walking an [ESTree](https://github.com/estree/estree)-compliant AST, such as one generated by [acorn](https://github.com/marijnh/acorn).
-
-
-## Installation
-
-```bash
-npm i estree-walker
-```
-
-
-## Usage
-
-```js
-var walk = require( 'estree-walker' ).walk;
-var acorn = require( 'acorn' );
-
-ast = acorn.parse( sourceCode, options ); // https://github.com/acornjs/acorn
-
-walk( ast, {
- enter: function ( node, parent, prop, index ) {
- // some code happens
- },
- leave: function ( node, parent, prop, index ) {
- // some code happens
- }
-});
-```
-
-Inside the `enter` function, calling `this.skip()` will prevent the node's children being walked, or the `leave` function (which is optional) being called.
-
-Call `this.replace(new_node)` in either `enter` or `leave` to replace the current node with a new one.
-
-Call `this.remove()` in either `enter` or `leave` to remove the current node.
-
-## Why not use estraverse?
-
-The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where [estraverse](https://github.com/estools/estraverse) was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys.
-
-estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.)
-
-None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful.
-
-
-## License
-
-MIT
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js
deleted file mode 100644
index f2e012a7d0b..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js
+++ /dev/null
@@ -1,135 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.estreeWalker = {})));
-}(this, (function (exports) { 'use strict';
-
- function walk(ast, { enter, leave }) {
- return visit(ast, null, enter, leave);
- }
-
- let should_skip = false;
- let should_remove = false;
- let replacement = null;
- const context = {
- skip: () => should_skip = true,
- remove: () => should_remove = true,
- replace: (node) => replacement = node
- };
-
- function replace(parent, prop, index, node) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
- }
-
- function remove(parent, prop, index) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
- }
-
- function visit(
- node,
- parent,
- enter,
- leave,
- prop,
- index
- ) {
- if (node) {
- if (enter) {
- const _should_skip = should_skip;
- const _should_remove = should_remove;
- const _replacement = replacement;
- should_skip = false;
- should_remove = false;
- replacement = null;
-
- enter.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const skipped = should_skip;
- const removed = should_remove;
-
- should_skip = _should_skip;
- should_remove = _should_remove;
- replacement = _replacement;
-
- if (skipped) return node;
- if (removed) return null;
- }
-
- for (const key in node) {
- const value = (node )[key];
-
- if (typeof value !== 'object') {
- continue;
- }
-
- else if (Array.isArray(value)) {
- for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
- if (value[j] !== null && typeof value[j].type === 'string') {
- if (!visit(value[j], node, enter, leave, key, k)) {
- // removed
- j--;
- }
- }
- }
- }
-
- else if (value !== null && typeof value.type === 'string') {
- visit(value, node, enter, leave, key, null);
- }
- }
-
- if (leave) {
- const _replacement = replacement;
- const _should_remove = should_remove;
- replacement = null;
- should_remove = false;
-
- leave.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const removed = should_remove;
-
- replacement = _replacement;
- should_remove = _should_remove;
-
- if (removed) return null;
- }
- }
-
- return node;
- }
-
- exports.walk = walk;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js.map b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js.map
deleted file mode 100644
index 7ea22970e73..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/estree-walker.umd.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"estree-walker.umd.js","sources":["../src/estree-walker.js"],"sourcesContent":["export function walk(ast, { enter, leave }) {\n\tvisit(ast, null, enter, leave);\n}\n\nlet shouldSkip = false;\nconst context = { skip: () => shouldSkip = true };\n\nexport const childKeys = {};\n\nconst toString = Object.prototype.toString;\n\nfunction isArray(thing) {\n\treturn toString.call(thing) === '[object Array]';\n}\n\nfunction visit(node, parent, enter, leave, prop, index) {\n\tif (!node) return;\n\n\tif (enter) {\n\t\tconst _shouldSkip = shouldSkip;\n\t\tshouldSkip = false;\n\t\tenter.call(context, node, parent, prop, index);\n\t\tconst skipped = shouldSkip;\n\t\tshouldSkip = _shouldSkip;\n\n\t\tif (skipped) return;\n\t}\n\n\tconst keys = childKeys[node.type] || (\n\t\tchildKeys[node.type] = Object.keys(node).filter(key => typeof node[key] === 'object')\n\t);\n\n\tfor (let i = 0; i < keys.length; i += 1) {\n\t\tconst key = keys[i];\n\t\tconst value = node[key];\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let j = 0; j < value.length; j += 1) {\n\t\t\t\tvisit(value[j], node, enter, leave, key, j);\n\t\t\t}\n\t\t}\n\n\t\telse if (value && value.type) {\n\t\t\tvisit(value, node, enter, leave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AAI,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC;CACvF,EAAE,CAAC;;CAEH,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;CAC1C,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CACtB,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;;CAE1B,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;CACtB,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;CAC7C,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;CAChD,IAAI;CACJ,GAAG;;CAEH,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE;CAChC,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;CAC/C,GAAG;CACH,EAAE;;CAEF,CAAC,IAAI,KAAK,EAAE;CACZ,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;CACnC,EAAE;CACF,CAAC;;;;;;;;;;;;;"} \ No newline at end of file
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/package.json
deleted file mode 100644
index 5a42e80e471..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "author": "Rich Harris",
- "description": "Traverse an ESTree-compliant AST",
- "devDependencies": {
- "@types/estree": "0.0.39",
- "mocha": "^5.2.0",
- "rollup": "^0.67.3",
- "rollup-plugin-sucrase": "^2.1.0",
- "typescript": "^3.6.3"
- },
- "files": [
- "src",
- "dist",
- "types",
- "README.md"
- ],
- "license": "MIT",
- "main": "dist/estree-walker.umd.js",
- "module": "src/estree-walker.js",
- "name": "estree-walker",
- "repository": {
- "type": "git",
- "url": "https://github.com/Rich-Harris/estree-walker"
- },
- "scripts": {
- "build": "tsc && rollup -c",
- "prepublishOnly": "npm run build && npm test",
- "test": "mocha --opts mocha.opts"
- },
- "types": "types/index.d.ts",
- "version": "1.0.1"
-}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/estree-walker.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/estree-walker.js
deleted file mode 100644
index e1b01dfa3bb..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/estree-walker.js
+++ /dev/null
@@ -1,125 +0,0 @@
-function walk(ast, { enter, leave }) {
- return visit(ast, null, enter, leave);
-}
-
-let should_skip = false;
-let should_remove = false;
-let replacement = null;
-const context = {
- skip: () => should_skip = true,
- remove: () => should_remove = true,
- replace: (node) => replacement = node
-};
-
-function replace(parent, prop, index, node) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
-}
-
-function remove(parent, prop, index) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
-}
-
-function visit(
- node,
- parent,
- enter,
- leave,
- prop,
- index
-) {
- if (node) {
- if (enter) {
- const _should_skip = should_skip;
- const _should_remove = should_remove;
- const _replacement = replacement;
- should_skip = false;
- should_remove = false;
- replacement = null;
-
- enter.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const skipped = should_skip;
- const removed = should_remove;
-
- should_skip = _should_skip;
- should_remove = _should_remove;
- replacement = _replacement;
-
- if (skipped) return node;
- if (removed) return null;
- }
-
- for (const key in node) {
- const value = (node )[key];
-
- if (typeof value !== 'object') {
- continue;
- }
-
- else if (Array.isArray(value)) {
- for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
- if (value[j] !== null && typeof value[j].type === 'string') {
- if (!visit(value[j], node, enter, leave, key, k)) {
- // removed
- j--;
- }
- }
- }
- }
-
- else if (value !== null && typeof value.type === 'string') {
- visit(value, node, enter, leave, key, null);
- }
- }
-
- if (leave) {
- const _replacement = replacement;
- const _should_remove = should_remove;
- replacement = null;
- should_remove = false;
-
- leave.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const removed = should_remove;
-
- replacement = _replacement;
- should_remove = _should_remove;
-
- if (removed) return null;
- }
- }
-
- return node;
-}
-
-export { walk };
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/index.ts b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/index.ts
deleted file mode 100644
index 09ed5160b2c..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/index.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { BaseNode } from "estree";
-
-type WalkerContext = {
- skip: () => void;
- remove: () => void;
- replace: (node: BaseNode) => void;
-};
-
-type WalkerHandler = (
- this: WalkerContext,
- node: BaseNode,
- parent: BaseNode,
- key: string,
- index: number
-) => void
-
-type Walker = {
- enter?: WalkerHandler;
- leave?: WalkerHandler;
-}
-
-export function walk(ast: BaseNode, { enter, leave }: Walker) {
- return visit(ast, null, enter, leave);
-}
-
-let should_skip = false;
-let should_remove = false;
-let replacement: BaseNode = null;
-const context: WalkerContext = {
- skip: () => should_skip = true,
- remove: () => should_remove = true,
- replace: (node: BaseNode) => replacement = node
-};
-
-function replace(parent: any, prop: string, index: number, node: BaseNode) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
-}
-
-function remove(parent: any, prop: string, index: number) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
-}
-
-function visit(
- node: BaseNode,
- parent: BaseNode,
- enter: WalkerHandler,
- leave: WalkerHandler,
- prop?: string,
- index?: number
-) {
- if (node) {
- if (enter) {
- const _should_skip = should_skip;
- const _should_remove = should_remove;
- const _replacement = replacement;
- should_skip = false;
- should_remove = false;
- replacement = null;
-
- enter.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const skipped = should_skip;
- const removed = should_remove;
-
- should_skip = _should_skip;
- should_remove = _should_remove;
- replacement = _replacement;
-
- if (skipped) return node;
- if (removed) return null;
- }
-
- for (const key in node) {
- const value = (node as any)[key];
-
- if (typeof value !== 'object') {
- continue;
- }
-
- else if (Array.isArray(value)) {
- for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
- if (value[j] !== null && typeof value[j].type === 'string') {
- if (!visit(value[j], node, enter, leave, key, k)) {
- // removed
- j--;
- }
- }
- }
- }
-
- else if (value !== null && typeof value.type === 'string') {
- visit(value, node, enter, leave, key, null);
- }
- }
-
- if (leave) {
- const _replacement = replacement;
- const _should_remove = should_remove;
- replacement = null;
- should_remove = false;
-
- leave.call(context, node, parent, prop, index);
-
- if (replacement) {
- node = replacement;
- replace(parent, prop, index, node);
- }
-
- if (should_remove) {
- remove(parent, prop, index);
- }
-
- const removed = should_remove;
-
- replacement = _replacement;
- should_remove = _should_remove;
-
- if (removed) return null;
- }
- }
-
- return node;
-}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/types/index.d.ts b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/types/index.d.ts
deleted file mode 100644
index 7540a907f09..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/types/index.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { BaseNode } from "estree";
-declare type WalkerContext = {
- skip: () => void;
- remove: () => void;
- replace: (node: BaseNode) => void;
-};
-declare type WalkerHandler = (this: WalkerContext, node: BaseNode, parent: BaseNode, key: string, index: number) => void;
-declare type Walker = {
- enter?: WalkerHandler;
- leave?: WalkerHandler;
-};
-export declare function walk(ast: BaseNode, { enter, leave }: Walker): BaseNode;
-export {};
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/package.json
index 7647d9cb302..804ccdedafa 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/package.json
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/package.json
@@ -1,51 +1,43 @@
{
- "author": "Rich Harris <richard.a.harris@gmail.com>",
- "ava": {
- "files": [
- "!**/fixtures/**",
- "!**/helpers/**",
- "!**/recipes/**",
- "!**/types.ts"
- ]
- },
- "bugs": "https://github.com/rollup/plugins/issues",
- "dependencies": {
- "@rollup/pluginutils": "^3.0.8",
- "commondir": "^1.0.1",
- "estree-walker": "^1.0.1",
- "glob": "^7.1.2",
- "is-reference": "^1.1.2",
- "magic-string": "^0.25.2",
- "resolve": "^1.11.0"
+ "name": "@rollup/plugin-commonjs",
+ "version": "17.1.0",
+ "publishConfig": {
+ "access": "public"
},
"description": "Convert CommonJS modules to ES2015",
- "devDependencies": {
- "@babel/core": "^7.9.0",
- "@babel/preset-env": "^7.9.0",
- "@babel/register": "^7.9.0",
- "@rollup/plugin-json": "^4.0.1",
- "@rollup/plugin-node-resolve": "^7.0.0",
- "acorn": "^7.1.1",
- "locate-character": "^2.0.5",
- "prettier": "^1.19.1",
- "require-relative": "^0.8.7",
- "rollup": "^2.3.4",
- "rollup-plugin-babel": "^4.3.3",
- "shx": "^0.3.2",
- "source-map": "^0.6.1",
- "source-map-support": "^0.5.16",
- "typescript": "^3.7.4"
- },
+ "license": "MIT",
+ "repository": "rollup/plugins",
+ "author": "Rich Harris <richard.a.harris@gmail.com>",
+ "homepage": "https://github.com/rollup/plugins/tree/master/packages/commonjs/#readme",
+ "bugs": "https://github.com/rollup/plugins/issues",
+ "main": "dist/index.js",
+ "module": "dist/index.es.js",
"engines": {
"node": ">= 8.0.0"
},
+ "scripts": {
+ "build": "rollup -c",
+ "ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
+ "ci:lint": "pnpm run build && pnpm run lint",
+ "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
+ "ci:test": "pnpm run test -- --verbose && pnpm run test:ts",
+ "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
+ "lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
+ "lint:js": "eslint --fix --cache src test types --ext .js,.ts",
+ "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
+ "prebuild": "del-cli dist",
+ "prepare": "pnpm run build",
+ "prepublishOnly": "pnpm run lint && pnpm run test:ts",
+ "pretest": "pnpm run build",
+ "test": "ava",
+ "test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
+ },
"files": [
"dist",
"types",
"README.md",
"LICENSE"
],
- "homepage": "https://github.com/rollup/plugins/tree/master/packages/commonjs/#readme",
"keywords": [
"rollup",
"plugin",
@@ -54,34 +46,39 @@
"commonjs",
"require"
],
- "license": "MIT",
- "main": "dist/index.js",
- "module": "dist/index.es.js",
- "name": "@rollup/plugin-commonjs",
"peerDependencies": {
- "rollup": "^2.3.4"
+ "rollup": "^2.30.0"
},
- "publishConfig": {
- "access": "public"
+ "dependencies": {
+ "@rollup/pluginutils": "^3.1.0",
+ "commondir": "^1.0.1",
+ "estree-walker": "^2.0.1",
+ "glob": "^7.1.6",
+ "is-reference": "^1.2.1",
+ "magic-string": "^0.25.7",
+ "resolve": "^1.17.0"
},
- "repository": "rollup/plugins",
- "scripts": {
- "build": "rollup -c",
- "ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
- "ci:lint": "pnpm run build && pnpm run lint",
- "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
- "ci:test": "pnpm run test -- --verbose && pnpm run test:ts",
- "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
- "lint:docs": "prettier --single-quote --write README.md",
- "lint:js": "eslint --fix --cache src test types --ext .js,.ts",
- "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
- "prebuild": "del-cli dist",
- "prepare": "pnpm run build",
- "prepublishOnly": "pnpm run lint && pnpm run test:ts",
- "pretest": "pnpm run build",
- "test": "ava",
- "test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
+ "devDependencies": {
+ "@rollup/plugin-json": "^4.1.0",
+ "@rollup/plugin-node-resolve": "^8.4.0",
+ "locate-character": "^2.0.5",
+ "require-relative": "^0.8.7",
+ "rollup": "^2.30.0",
+ "shx": "^0.3.2",
+ "source-map": "^0.7.3",
+ "source-map-support": "^0.5.19",
+ "typescript": "^3.9.7"
},
"types": "types/index.d.ts",
- "version": "13.0.0"
+ "ava": {
+ "babel": {
+ "compileEnhancements": false
+ },
+ "files": [
+ "!**/fixtures/**",
+ "!**/helpers/**",
+ "!**/recipes/**",
+ "!**/types.ts"
+ ]
+ }
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/types/index.d.ts b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/types/index.d.ts
index 579e8914d35..87b0b3f6184 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/types/index.d.ts
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/plugin-commonjs/types/index.d.ts
@@ -1,58 +1,165 @@
import { FilterPattern } from '@rollup/pluginutils';
import { Plugin } from 'rollup';
+type RequireReturnsDefaultOption = boolean | 'auto' | 'preferred' | 'namespace';
+
interface RollupCommonJSOptions {
/**
- * non-CommonJS modules will be ignored, but you can also
- * specifically include/exclude files
+ * A minimatch pattern, or array of patterns, which specifies the files in
+ * the build the plugin should operate on. By default, all files with
+ * extension `".cjs"` or those in `extensions` are included, but you can narrow
+ * this list by only including specific files. These files will be analyzed
+ * and transpiled if either the analysis does not find ES module specific
+ * statements or `transformMixedEsModules` is `true`.
* @default undefined
*/
include?: FilterPattern;
/**
- * non-CommonJS modules will be ignored, but you can also
- * specifically include/exclude files
+ * A minimatch pattern, or array of patterns, which specifies the files in
+ * the build the plugin should _ignore_. By default, all files with
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
+ * can exclude additional files. See also the `include` option.
* @default undefined
*/
exclude?: FilterPattern;
/**
- * search for files other than .js files (must already
- * be transpiled by a previous plugin!)
+ * For extensionless imports, search for extensions other than .js in the
+ * order specified. Note that you need to make sure that non-JavaScript files
+ * are transpiled by another plugin first.
* @default [ '.js' ]
*/
- extensions?: ReadonlyArray<string | RegExp>;
+ extensions?: ReadonlyArray<string>;
/**
- * if true then uses of `global` won't be dealt with by this plugin
+ * If true then uses of `global` won't be dealt with by this plugin
* @default false
*/
ignoreGlobal?: boolean;
/**
- * if false then skip sourceMap generation for CommonJS modules
+ * If false, skips source map generation for CommonJS modules. This will improve performance.
* @default true
*/
sourceMap?: boolean;
/**
- * Instructs the plugin whether or not to enable mixed module transformations. This is useful in scenarios with mixed ES and CommonJS modules. Set to `true` if it's known that `require` calls should be transformed, or `false` if the code contains env detection and the `require` should survive a transformation.
+ * Instructs the plugin whether to enable mixed module transformations. This
+ * is useful in scenarios with modules that contain a mix of ES `import`
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
+ * calls should be transformed to imports in mixed modules, or `false` if the
+ * `require` expressions should survive the transformation. The latter can be
+ * important if the code contains environment detection, or you are coding
+ * for an environment with special treatment for `require` calls such as
+ * ElectronJS. See also the `ignore` option.
* @default false
*/
transformMixedEsModules?: boolean;
/**
- * sometimes you have to leave require statements
- * unconverted. Pass an array containing the IDs
- * or a `id => boolean` function. Only use this
- * option if you know what you're doing!
+ * Sometimes you have to leave require statements unconverted. Pass an array
+ * containing the IDs or a `id => boolean` function.
+ * @default []
+ */
+ ignore?: ReadonlyArray<string> | ((id: string) => boolean);
+ /**
+ * In most cases, where `require` calls are inside a `try-catch` clause,
+ * they should be left unconverted as it requires an optional dependency
+ * that may or may not be installed beside the rolled up package.
+ * Due to the conversion of `require` to a static `import` - the call is hoisted
+ * to the top of the file, outside of the `try-catch` clause.
+ *
+ * - `true`: All `require` calls inside a `try` will be left unconverted.
+ * - `false`: All `require` calls inside a `try` will be converted as if the `try-catch` clause is not there.
+ * - `remove`: Remove all `require` calls from inside any `try` block.
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
+ * - `((id: string) => boolean|'remove')`: Pass a function that control individual IDs.
+ *
+ * @default false
+ */
+ ignoreTryCatch?:
+ | boolean
+ | 'remove'
+ | ReadonlyArray<string>
+ | ((id: string) => boolean | 'remove');
+ /**
+ * Controls how to render imports from external dependencies. By default,
+ * this plugin assumes that all external dependencies are CommonJS. This
+ * means they are rendered as default imports to be compatible with e.g.
+ * NodeJS where ES modules can only import a default export from a CommonJS
+ * dependency.
+ *
+ * If you set `esmExternals` to `true`, this plugins assumes that all
+ * external dependencies are ES modules and respect the
+ * `requireReturnsDefault` option. If that option is not set, they will be
+ * rendered as namespace imports.
+ *
+ * You can also supply an array of ids to be treated as ES modules, or a
+ * function that will be passed each external id to determine if it is an ES
+ * module.
+ * @default false
+ */
+ esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
+ /**
+ * Controls what is returned when requiring an ES module from a CommonJS file.
+ * When using the `esmExternals` option, this will also apply to external
+ * modules. By default, this plugin will render those imports as namespace
+ * imports i.e.
+ *
+ * ```js
+ * // input
+ * const foo = require('foo');
+ *
+ * // output
+ * import * as foo from 'foo';
+ * ```
+ *
+ * However there are some situations where this may not be desired.
+ * For these situations, you can change Rollup's behaviour either globally or
+ * per module. To change it globally, set the `requireReturnsDefault` option
+ * to one of the following values:
+ *
+ * - `false`: This is the default, requiring an ES module returns its
+ * namespace. This is the only option that will also add a marker
+ * `__esModule: true` to the namespace to support interop patterns in
+ * CommonJS modules that are transpiled ES modules.
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
+ * namespace, but the plugin does not add the `__esModule` marker and thus
+ * creates more efficient code. For external dependencies when using
+ * `esmExternals: true`, no additional interop code is generated.
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
+ * Rollup: If a module has a default export and no named exports, requiring
+ * that module returns the default export. In all other cases, the namespace
+ * is returned. For external dependencies when using `esmExternals: true`, a
+ * corresponding interop helper is added.
+ * - `"preferred"`: If a module has a default export, requiring that module
+ * always returns the default export, no matter whether additional named
+ * exports exist. This is similar to how previous versions of this plugin
+ * worked. Again for external dependencies when using `esmExternals: true`,
+ * an interop helper is added.
+ * - `true`: This will always try to return the default export on require
+ * without checking if it actually exists. This can throw at build time if
+ * there is no default export. This is how external dependencies are handled
+ * when `esmExternals` is not used. The advantage over the other options is
+ * that, like `false`, this does not add an interop helper for external
+ * dependencies, keeping the code lean.
+ *
+ * To change this for individual modules, you can supply a function for
+ * `requireReturnsDefault` instead. This function will then be called once for
+ * each required ES module or external dependency with the corresponding id
+ * and allows you to return different values for different modules.
+ * @default false
*/
- ignore?: ReadonlyArray<string | ((id: string) => boolean)>;
+ requireReturnsDefault?:
+ | RequireReturnsDefaultOption
+ | ((id: string) => RequireReturnsDefaultOption);
/**
- * Some modules contain dynamic `require` calls, or require modules that contain
- * circular dependencies, which are not handled well by static imports.
- * Including those modules as `dynamicRequireTargets` will simulate a CommonJS (NodeJS-like)
- * environment for them with support for dynamic and circular dependencies.
+ * Some modules contain dynamic `require` calls, or require modules that
+ * contain circular dependencies, which are not handled well by static
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
+ * CommonJS (NodeJS-like) environment for them with support for dynamic and
+ * circular dependencies.
*
- * Note: In extreme cases, this feature may result in some paths being rendered as
- * absolute in the final bundle. The plugin tries to avoid exposing paths from
- * the local machine, but if you are `dynamicRequirePaths` with paths that are
- * far away from your project's folder, that may require replacing strings
- * like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
+ * Note: In extreme cases, this feature may result in some paths being
+ * rendered as absolute in the final bundle. The plugin tries to avoid
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
+ * with paths that are far away from your project's folder, that may require
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
*/
dynamicRequireTargets?: string | ReadonlyArray<string>;
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/@types/estree/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/@types/estree/package.json
index acdd79a3766..e04ee1e811c 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/@types/estree/package.json
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/@types/estree/package.json
@@ -1,22 +1,22 @@
{
+ "name": "@types/estree",
+ "version": "0.0.39",
+ "description": "TypeScript definitions for ESTree AST specification",
+ "license": "MIT",
"contributors": [
{
- "githubUsername": "RReverser",
"name": "RReverser",
- "url": "https://github.com/RReverser"
+ "url": "https://github.com/RReverser",
+ "githubUsername": "RReverser"
}
],
- "dependencies": {},
- "description": "TypeScript definitions for ESTree AST specification",
- "license": "MIT",
"main": "",
- "name": "@types/estree",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
- "typeScriptVersion": "2.0",
+ "dependencies": {},
"typesPublisherContentHash": "427ba878ebb5570e15aab870f708720d146a1c4b272e4a9d9990db4d1d033170",
- "version": "0.0.39"
+ "typeScriptVersion": "2.0"
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/estree-walker/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/estree-walker/package.json
index 5a42e80e471..7f07583e446 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/estree-walker/package.json
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/estree-walker/package.json
@@ -1,6 +1,21 @@
{
- "author": "Rich Harris",
+ "name": "estree-walker",
"description": "Traverse an ESTree-compliant AST",
+ "version": "1.0.1",
+ "author": "Rich Harris",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Rich-Harris/estree-walker"
+ },
+ "main": "dist/estree-walker.umd.js",
+ "module": "src/estree-walker.js",
+ "types": "types/index.d.ts",
+ "scripts": {
+ "prepublishOnly": "npm run build && npm test",
+ "build": "tsc && rollup -c",
+ "test": "mocha --opts mocha.opts"
+ },
"devDependencies": {
"@types/estree": "0.0.39",
"mocha": "^5.2.0",
@@ -13,20 +28,5 @@
"dist",
"types",
"README.md"
- ],
- "license": "MIT",
- "main": "dist/estree-walker.umd.js",
- "module": "src/estree-walker.js",
- "name": "estree-walker",
- "repository": {
- "type": "git",
- "url": "https://github.com/Rich-Harris/estree-walker"
- },
- "scripts": {
- "build": "tsc && rollup -c",
- "prepublishOnly": "npm run build && npm test",
- "test": "mocha --opts mocha.opts"
- },
- "types": "types/index.d.ts",
- "version": "1.0.1"
+ ]
}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/CHANGELOG.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/CHANGELOG.md
deleted file mode 100755
index 7af58619f75..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/CHANGELOG.md
+++ /dev/null
@@ -1,113 +0,0 @@
-# Release history
-
-**All notable changes to this project will be documented in this file.**
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-<details>
- <summary><strong>Guiding Principles</strong></summary>
-
-- Changelogs are for humans, not machines.
-- There should be an entry for every single version.
-- The same types of changes should be grouped.
-- Versions and sections should be linkable.
-- The latest version comes first.
-- The release date of each versions is displayed.
-- Mention whether you follow Semantic Versioning.
-
-</details>
-
-<details>
- <summary><strong>Types of changes</strong></summary>
-
-Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
-
-- `Added` for new features.
-- `Changed` for changes in existing functionality.
-- `Deprecated` for soon-to-be removed features.
-- `Removed` for now removed features.
-- `Fixed` for any bug fixes.
-- `Security` in case of vulnerabilities.
-
-</details>
-
-## 2.2.2 (2020-03-21)
-
-### Fixed
-
-* Correctly handle parts of the pattern after parentheses in the `scan` method ([e15b920](https://github.com/micromatch/picomatch/commit/e15b920)).
-
-## 2.2.1 (2020-01-04)
-
-* Fixes [#49](https://github.com/micromatch/picomatch/issues/49), so that braces with no sets or ranges are now propertly treated as literals.
-
-## 2.2.0 (2020-01-04)
-
-* Disable fastpaths mode for the parse method ([5b8d33f](https://github.com/micromatch/picomatch/commit/5b8d33f))
-* Add `tokens`, `slashes`, and `parts` to the object returned by `picomatch.scan()`.
-
-## 2.1.0 (2019-10-31)
-
-* add benchmarks for scan ([4793b92](https://github.com/micromatch/picomatch/commit/4793b92))
-* Add eslint object-curly-spacing rule ([707c650](https://github.com/micromatch/picomatch/commit/707c650))
-* Add prefer-const eslint rule ([5c7501c](https://github.com/micromatch/picomatch/commit/5c7501c))
-* Add support for nonegate in scan API ([275c9b9](https://github.com/micromatch/picomatch/commit/275c9b9))
-* Change lets to consts. Move root import up. ([4840625](https://github.com/micromatch/picomatch/commit/4840625))
-* closes https://github.com/micromatch/picomatch/issues/21 ([766bcb0](https://github.com/micromatch/picomatch/commit/766bcb0))
-* Fix "Extglobs" table in readme ([eb19da8](https://github.com/micromatch/picomatch/commit/eb19da8))
-* fixes https://github.com/micromatch/picomatch/issues/20 ([9caca07](https://github.com/micromatch/picomatch/commit/9caca07))
-* fixes https://github.com/micromatch/picomatch/issues/26 ([fa58f45](https://github.com/micromatch/picomatch/commit/fa58f45))
-* Lint test ([d433a34](https://github.com/micromatch/picomatch/commit/d433a34))
-* lint unit tests ([0159b55](https://github.com/micromatch/picomatch/commit/0159b55))
-* Make scan work with noext ([6c02e03](https://github.com/micromatch/picomatch/commit/6c02e03))
-* minor linting ([c2a2b87](https://github.com/micromatch/picomatch/commit/c2a2b87))
-* minor parser improvements ([197671d](https://github.com/micromatch/picomatch/commit/197671d))
-* remove eslint since it... ([07876fa](https://github.com/micromatch/picomatch/commit/07876fa))
-* remove funding file ([8ebe96d](https://github.com/micromatch/picomatch/commit/8ebe96d))
-* Remove unused funks ([cbc6d54](https://github.com/micromatch/picomatch/commit/cbc6d54))
-* Run eslint during pretest, fix existing eslint findings ([0682367](https://github.com/micromatch/picomatch/commit/0682367))
-* support `noparen` in scan ([3d37569](https://github.com/micromatch/picomatch/commit/3d37569))
-* update changelog ([7b34e77](https://github.com/micromatch/picomatch/commit/7b34e77))
-* update travis ([777f038](https://github.com/micromatch/picomatch/commit/777f038))
-* Use eslint-disable-next-line instead of eslint-disable ([4e7c1fd](https://github.com/micromatch/picomatch/commit/4e7c1fd))
-
-## 2.0.7 (2019-05-14)
-
-* 2.0.7 ([9eb9a71](https://github.com/micromatch/picomatch/commit/9eb9a71))
-* supports lookbehinds ([1f63f7e](https://github.com/micromatch/picomatch/commit/1f63f7e))
-* update .verb.md file with typo change ([2741279](https://github.com/micromatch/picomatch/commit/2741279))
-* fix: typo in README ([0753e44](https://github.com/micromatch/picomatch/commit/0753e44))
-
-## 2.0.4 (2019-04-10)
-
-### Fixed
-
-- Readme link [fixed](https://github.com/micromatch/picomatch/pull/13/commits/a96ab3aa2b11b6861c23289964613d85563b05df) by @danez.
-- `options.capture` now works as expected when fastpaths are enabled. See https://github.com/micromatch/picomatch/pull/12/commits/26aefd71f1cfaf95c37f1c1fcab68a693b037304. Thanks to @DrPizza.
-
-## 2.0.0 (2019-04-10)
-
-### Added
-
-- Adds support for `options.onIgnore`. See the readme for details
-- Adds support for `options.onResult`. See the readme for details
-
-### Breaking changes
-
-- The unixify option was renamed to `windows`
-- caching and all related options and methods have been removed
-
-## 1.0.0 (2018-11-05)
-
-- adds `.onMatch` option
-- improvements to `.scan` method
-- numerous improvements and optimizations for matching and parsing
-- better windows path handling
-
-## 0.1.0 - 2017-04-13
-
-First release.
-
-
-[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/LICENSE b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/LICENSE
deleted file mode 100755
index 3608dca25e3..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2017-present, Jon Schlinkert.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/README.md b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/README.md
deleted file mode 100755
index 7737151bf7b..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/README.md
+++ /dev/null
@@ -1,691 +0,0 @@
-<h1 align="center">Picomatch</h1>
-
-<p align="center">
- <a href="https://npmjs.org/package/picomatch">
- <img src="https://img.shields.io/npm/v/picomatch.svg" alt="version">
- </a>
- <a href="https://github.com/micromatch/picomatch/actions?workflow=Tests">
- <img src="https://github.com/micromatch/picomatch/workflows/Tests/badge.svg" alt="test status">
- </a>
- <a href="https://coveralls.io/github/micromatch/picomatch">
- <img src="https://img.shields.io/coveralls/github/micromatch/picomatch/master.svg" alt="coverage status">
- </a>
- <a href="https://npmjs.org/package/picomatch">
- <img src="https://img.shields.io/npm/dm/picomatch.svg" alt="downloads">
- </a>
-</p>
-
-<br>
-<br>
-
-<p align="center">
-<strong>Blazing fast and accurate glob matcher written in JavaScript.</strong></br>
-<em>No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.</em>
-</p>
-
-<br>
-<br>
-
-## Why picomatch?
-
-* **Lightweight** - No dependencies
-* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
-* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps)
-* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files)
-* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes.
-* **Well tested** - Thousands of unit tests
-
-See the [library comparison](#library-comparisons) to other libraries.
-
-<br>
-<br>
-
-## Table of Contents
-
-<details><summary> Click to expand </summary>
-
-- [Install](#install)
-- [Usage](#usage)
-- [API](#api)
- * [picomatch](#picomatch)
- * [.test](#test)
- * [.matchBase](#matchbase)
- * [.isMatch](#ismatch)
- * [.parse](#parse)
- * [.scan](#scan)
- * [.compileRe](#compilere)
- * [.toRegex](#toregex)
-- [Options](#options)
- * [Picomatch options](#picomatch-options)
- * [Scan Options](#scan-options)
- * [Options Examples](#options-examples)
-- [Globbing features](#globbing-features)
- * [Basic globbing](#basic-globbing)
- * [Advanced globbing](#advanced-globbing)
- * [Braces](#braces)
- * [Matching special characters as literals](#matching-special-characters-as-literals)
-- [Library Comparisons](#library-comparisons)
-- [Benchmarks](#benchmarks)
-- [Philosophies](#philosophies)
-- [About](#about)
- * [Author](#author)
- * [License](#license)
-
-_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
-
-</details>
-
-<br>
-<br>
-
-## Install
-
-Install with [npm](https://www.npmjs.com/):
-
-```sh
-npm install --save picomatch
-```
-
-<br>
-
-## Usage
-
-The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.
-
-```js
-const pm = require('picomatch');
-const isMatch = pm('*.js');
-
-console.log(isMatch('abcd')); //=> false
-console.log(isMatch('a.js')); //=> true
-console.log(isMatch('a.md')); //=> false
-console.log(isMatch('a/b.js')); //=> false
-```
-
-<br>
-
-## API
-
-### [picomatch](lib/picomatch.js#L32)
-
-Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
-
-**Params**
-
-* `globs` **{String|Array}**: One or more glob patterns.
-* `options` **{Object=}**
-* `returns` **{Function=}**: Returns a matcher function.
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch(glob[, options]);
-
-const isMatch = picomatch('*.!(*a)');
-console.log(isMatch('a.a')); //=> false
-console.log(isMatch('a.b')); //=> true
-```
-
-### [.test](lib/picomatch.js#L117)
-
-Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
-
-**Params**
-
-* `input` **{String}**: String to test.
-* `regex` **{RegExp}**
-* `returns` **{Object}**: Returns an object with matching info.
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch.test(input, regex[, options]);
-
-console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
-// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
-```
-
-### [.matchBase](lib/picomatch.js#L161)
-
-Match the basename of a filepath.
-
-**Params**
-
-* `input` **{String}**: String to test.
-* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe).
-* `returns` **{Boolean}**
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch.matchBase(input, glob[, options]);
-console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
-```
-
-### [.isMatch](lib/picomatch.js#L183)
-
-Returns true if **any** of the given glob `patterns` match the specified `string`.
-
-**Params**
-
-* **{String|Array}**: str The string to test.
-* **{String|Array}**: patterns One or more glob patterns to use for matching.
-* **{Object}**: See available [options](#options).
-* `returns` **{Boolean}**: Returns true if any patterns match `str`
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch.isMatch(string, patterns[, options]);
-
-console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
-console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
-```
-
-### [.parse](lib/picomatch.js#L199)
-
-Parse a glob pattern to create the source string for a regular expression.
-
-**Params**
-
-* `pattern` **{String}**
-* `options` **{Object}**
-* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string.
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-const result = picomatch.parse(pattern[, options]);
-```
-
-### [.scan](lib/picomatch.js#L231)
-
-Scan a glob pattern to separate the pattern into segments.
-
-**Params**
-
-* `input` **{String}**: Glob pattern to scan.
-* `options` **{Object}**
-* `returns` **{Object}**: Returns an object with
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch.scan(input[, options]);
-
-const result = picomatch.scan('!./foo/*.js');
-console.log(result);
-{ prefix: '!./',
- input: '!./foo/*.js',
- start: 3,
- base: 'foo',
- glob: '*.js',
- isBrace: false,
- isBracket: false,
- isGlob: true,
- isExtglob: false,
- isGlobstar: false,
- negated: true }
-```
-
-### [.compileRe](lib/picomatch.js#L250)
-
-Create a regular expression from a parsed glob pattern.
-
-**Params**
-
-* `state` **{String}**: The object returned from the `.parse` method.
-* `options` **{Object}**
-* `returns` **{RegExp}**: Returns a regex created from the given pattern.
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-const state = picomatch.parse('*.js');
-// picomatch.compileRe(state[, options]);
-
-console.log(picomatch.compileRe(state));
-//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
-```
-
-### [.toRegex](lib/picomatch.js#L318)
-
-Create a regular expression from the given regex source string.
-
-**Params**
-
-* `source` **{String}**: Regular expression source string.
-* `options` **{Object}**
-* `returns` **{RegExp}**
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-// picomatch.toRegex(source[, options]);
-
-const { output } = picomatch.parse('*.js');
-console.log(picomatch.toRegex(output));
-//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
-```
-
-<br>
-
-## Options
-
-### Picomatch options
-
-The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API.
-
-| **Option** | **Type** | **Default value** | **Description** |
-| --- | --- | --- | --- |
-| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
-| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
-| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
-| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
-| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` |
-| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
-| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true |
-| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. |
-| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. |
-| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
-| `flags` | `boolean` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
-| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
-| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
-| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
-| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
-| `lookbehinds` | `boolean` | `true` | Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. |
-| `matchBase` | `boolean` | `false` | Alias for `basename` |
-| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
-| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
-| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
-| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. |
-| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
-| `noext` | `boolean` | `false` | Alias for `noextglob` |
-| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) |
-| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
-| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
-| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. |
-| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
-| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
-| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
-| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). |
-| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
-| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
-| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
-| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
-| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
-| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
-| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. |
-
-### Scan Options
-
-In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method.
-
-| **Option** | **Type** | **Default value** | **Description** |
-| --- | --- | --- | --- |
-| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern |
-| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true |
-
-**Example**
-
-```js
-const picomatch = require('picomatch');
-const result = picomatch.scan('!./foo/*.js', { tokens: true });
-console.log(result);
-// {
-// prefix: '!./',
-// input: '!./foo/*.js',
-// start: 3,
-// base: 'foo',
-// glob: '*.js',
-// isBrace: false,
-// isBracket: false,
-// isGlob: true,
-// isExtglob: false,
-// isGlobstar: false,
-// negated: true,
-// maxDepth: 2,
-// tokens: [
-// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
-// { value: 'foo', depth: 1, isGlob: false },
-// { value: '*.js', depth: 1, isGlob: true }
-// ],
-// slashes: [ 2, 6 ],
-// parts: [ 'foo', '*.js' ]
-// }
-```
-
-<br>
-
-### Options Examples
-
-#### options.expandRange
-
-**Type**: `function`
-
-**Default**: `undefined`
-
-Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
-
-**Example**
-
-The following example shows how to create a glob that matches a folder
-
-```js
-const fill = require('fill-range');
-const regex = pm.makeRe('foo/{01..25}/bar', {
- expandRange(a, b) {
- return `(${fill(a, b, { toRegex: true })})`;
- }
-});
-
-console.log(regex);
-//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
-
-console.log(regex.test('foo/00/bar')) // false
-console.log(regex.test('foo/01/bar')) // true
-console.log(regex.test('foo/10/bar')) // true
-console.log(regex.test('foo/22/bar')) // true
-console.log(regex.test('foo/25/bar')) // true
-console.log(regex.test('foo/26/bar')) // false
-```
-
-#### options.format
-
-**Type**: `function`
-
-**Default**: `undefined`
-
-Custom function for formatting strings before they're matched.
-
-**Example**
-
-```js
-// strip leading './' from strings
-const format = str => str.replace(/^\.\//, '');
-const isMatch = picomatch('foo/*.js', { format });
-console.log(isMatch('./foo/bar.js')); //=> true
-```
-
-#### options.onMatch
-
-```js
-const onMatch = ({ glob, regex, input, output }) => {
- console.log({ glob, regex, input, output });
-};
-
-const isMatch = picomatch('*', { onMatch });
-isMatch('foo');
-isMatch('bar');
-isMatch('baz');
-```
-
-#### options.onIgnore
-
-```js
-const onIgnore = ({ glob, regex, input, output }) => {
- console.log({ glob, regex, input, output });
-};
-
-const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
-isMatch('foo');
-isMatch('bar');
-isMatch('baz');
-```
-
-#### options.onResult
-
-```js
-const onResult = ({ glob, regex, input, output }) => {
- console.log({ glob, regex, input, output });
-};
-
-const isMatch = picomatch('*', { onResult, ignore: 'f*' });
-isMatch('foo');
-isMatch('bar');
-isMatch('baz');
-```
-
-<br>
-<br>
-
-## Globbing features
-
-* [Basic globbing](#basic-globbing) (Wildcard matching)
-* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching)
-
-### Basic globbing
-
-| **Character** | **Description** |
-| --- | --- |
-| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
-| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
-| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
-| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
-
-#### Matching behavior vs. Bash
-
-Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:
-
-* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`.
-* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`.
-
-<br>
-
-### Advanced globbing
-
-* [extglobs](#extglobs)
-* [POSIX brackets](#posix-brackets)
-* [Braces](#brace-expansion)
-
-#### Extglobs
-
-| **Pattern** | **Description** |
-| --- | --- |
-| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` |
-| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` |
-| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` |
-| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` |
-| `!(pattern)` | Match _anything but_ `pattern` |
-
-**Examples**
-
-```js
-const pm = require('picomatch');
-
-// *(pattern) matches ZERO or more of "pattern"
-console.log(pm.isMatch('a', 'a*(z)')); // true
-console.log(pm.isMatch('az', 'a*(z)')); // true
-console.log(pm.isMatch('azzz', 'a*(z)')); // true
-
-// +(pattern) matches ONE or more of "pattern"
-console.log(pm.isMatch('a', 'a*(z)')); // true
-console.log(pm.isMatch('az', 'a*(z)')); // true
-console.log(pm.isMatch('azzz', 'a*(z)')); // true
-
-// supports multiple extglobs
-console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
-
-// supports nested extglobs
-console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true
-```
-
-#### POSIX brackets
-
-POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true.
-
-**Enable POSIX bracket support**
-
-```js
-console.log(pm.makeRe('[[:word:]]+', { posix: true }));
-//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/
-```
-
-**Supported POSIX classes**
-
-The following named POSIX bracket expressions are supported:
-
-* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]`
-* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`.
-* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`.
-* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`.
-* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`.
-* `[:digit:]` - Numerical digits, equivalent to `[0-9]`.
-* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`.
-* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`.
-* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`.
-* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`.
-* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`.
-* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`.
-* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`.
-* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`.
-
-See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information.
-
-### Braces
-
-Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces.
-
-### Matching special characters as literals
-
-If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:
-
-**Special Characters**
-
-Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
-
-To match any of the following characters as literals: `$^*+?()[]
-
-Examples:
-
-```js
-console.log(pm.makeRe('foo/bar \\(1\\)'));
-console.log(pm.makeRe('foo/bar \\(1\\)'));
-```
-
-<br>
-<br>
-
-## Library Comparisons
-
-The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets).
-
-| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` |
-| --- | --- | --- | --- | --- | --- | --- | --- |
-| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - |
-| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - |
-| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - |
-| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - |
-| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - |
-| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ |
-| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ |
-| File system operations | - | - | - | - | - | - | - |
-
-<br>
-<br>
-
-## Benchmarks
-
-Performance comparison of picomatch and minimatch.
-
-```
-# .makeRe star
- picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled)
- minimatch x 627,206 ops/sec ±1.96% (87 runs sampled))
-
-# .makeRe star; dot=true
- picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled)
- minimatch x 525,876 ops/sec ±0.60% (88 runs sampled)
-
-# .makeRe globstar
- picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled)
- minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d)
-
-# .makeRe globstars
- picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled)
- minimatch x 477,179 ops/sec ±1.33% (91 runs sampled)
-
-# .makeRe with leading star
- picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled)
- minimatch x 453,564 ops/sec ±1.43% (94 runs sampled)
-
-# .makeRe - basic braces
- picomatch x 392,067 ops/sec ±0.70% (90 runs sampled)
- minimatch x 99,532 ops/sec ±2.03% (87 runs sampled))
-```
-
-<br>
-<br>
-
-## Philosophies
-
-The goal of this library is to be blazing fast, without compromising on accuracy.
-
-**Accuracy**
-
-The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`.
-
-Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.
-
-**Performance**
-
-Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.
-
-<br>
-<br>
-
-## About
-
-<details>
-<summary><strong>Contributing</strong></summary>
-
-Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
-
-Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
-
-</details>
-
-<details>
-<summary><strong>Running Tests</strong></summary>
-
-Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
-
-```sh
-npm install && npm test
-```
-
-</details>
-
-<details>
-<summary><strong>Building docs</strong></summary>
-
-_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
-
-To generate the readme, run the following command:
-
-```sh
-npm install -g verbose/verb#dev verb-generate-readme && verb
-```
-
-</details>
-
-### Author
-
-**Jon Schlinkert**
-
-* [GitHub Profile](https://github.com/jonschlinkert)
-* [Twitter Profile](https://twitter.com/jonschlinkert)
-* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
-
-### License
-
-Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
-Released under the [MIT License](LICENSE).
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/index.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/index.js
deleted file mode 100755
index d2f2bc59d0a..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-module.exports = require('./lib/picomatch');
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js
deleted file mode 100755
index a62ef387955..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js
+++ /dev/null
@@ -1,179 +0,0 @@
-'use strict';
-
-const path = require('path');
-const WIN_SLASH = '\\\\/';
-const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
-
-/**
- * Posix glob regex
- */
-
-const DOT_LITERAL = '\\.';
-const PLUS_LITERAL = '\\+';
-const QMARK_LITERAL = '\\?';
-const SLASH_LITERAL = '\\/';
-const ONE_CHAR = '(?=.)';
-const QMARK = '[^/]';
-const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
-const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
-const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
-const NO_DOT = `(?!${DOT_LITERAL})`;
-const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
-const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
-const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
-const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
-const STAR = `${QMARK}*?`;
-
-const POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
-};
-
-/**
- * Windows glob regex
- */
-
-const WINDOWS_CHARS = {
- ...POSIX_CHARS,
-
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
-};
-
-/**
- * POSIX Bracket Regex
- */
-
-const POSIX_REGEX_SOURCE = {
- alnum: 'a-zA-Z0-9',
- alpha: 'a-zA-Z',
- ascii: '\\x00-\\x7F',
- blank: ' \\t',
- cntrl: '\\x00-\\x1F\\x7F',
- digit: '0-9',
- graph: '\\x21-\\x7E',
- lower: 'a-z',
- print: '\\x20-\\x7E ',
- punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
- space: ' \\t\\r\\n\\v\\f',
- upper: 'A-Z',
- word: 'A-Za-z0-9_',
- xdigit: 'A-Fa-f0-9'
-};
-
-module.exports = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE,
-
- // regular expressions
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
-
- // Replace globs with equivalent patterns to reduce parsing time.
- REPLACEMENTS: {
- '***': '*',
- '**/**': '**',
- '**/**/**': '**'
- },
-
- // Digits
- CHAR_0: 48, /* 0 */
- CHAR_9: 57, /* 9 */
-
- // Alphabet chars.
- CHAR_UPPERCASE_A: 65, /* A */
- CHAR_LOWERCASE_A: 97, /* a */
- CHAR_UPPERCASE_Z: 90, /* Z */
- CHAR_LOWERCASE_Z: 122, /* z */
-
- CHAR_LEFT_PARENTHESES: 40, /* ( */
- CHAR_RIGHT_PARENTHESES: 41, /* ) */
-
- CHAR_ASTERISK: 42, /* * */
-
- // Non-alphabetic chars.
- CHAR_AMPERSAND: 38, /* & */
- CHAR_AT: 64, /* @ */
- CHAR_BACKWARD_SLASH: 92, /* \ */
- CHAR_CARRIAGE_RETURN: 13, /* \r */
- CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
- CHAR_COLON: 58, /* : */
- CHAR_COMMA: 44, /* , */
- CHAR_DOT: 46, /* . */
- CHAR_DOUBLE_QUOTE: 34, /* " */
- CHAR_EQUAL: 61, /* = */
- CHAR_EXCLAMATION_MARK: 33, /* ! */
- CHAR_FORM_FEED: 12, /* \f */
- CHAR_FORWARD_SLASH: 47, /* / */
- CHAR_GRAVE_ACCENT: 96, /* ` */
- CHAR_HASH: 35, /* # */
- CHAR_HYPHEN_MINUS: 45, /* - */
- CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
- CHAR_LEFT_CURLY_BRACE: 123, /* { */
- CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
- CHAR_LINE_FEED: 10, /* \n */
- CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
- CHAR_PERCENT: 37, /* % */
- CHAR_PLUS: 43, /* + */
- CHAR_QUESTION_MARK: 63, /* ? */
- CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
- CHAR_RIGHT_CURLY_BRACE: 125, /* } */
- CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
- CHAR_SEMICOLON: 59, /* ; */
- CHAR_SINGLE_QUOTE: 39, /* ' */
- CHAR_SPACE: 32, /* */
- CHAR_TAB: 9, /* \t */
- CHAR_UNDERSCORE: 95, /* _ */
- CHAR_VERTICAL_LINE: 124, /* | */
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
-
- SEP: path.sep,
-
- /**
- * Create EXTGLOB_CHARS
- */
-
- extglobChars(chars) {
- return {
- '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
- '?': { type: 'qmark', open: '(?:', close: ')?' },
- '+': { type: 'plus', open: '(?:', close: ')+' },
- '*': { type: 'star', open: '(?:', close: ')*' },
- '@': { type: 'at', open: '(?:', close: ')' }
- };
- },
-
- /**
- * Create GLOB_CHARS
- */
-
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
-};
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js
deleted file mode 100755
index 34bdc2f90e5..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js
+++ /dev/null
@@ -1,1078 +0,0 @@
-'use strict';
-
-const constants = require('./constants');
-const utils = require('./utils');
-
-/**
- * Constants
- */
-
-const {
- MAX_LENGTH,
- POSIX_REGEX_SOURCE,
- REGEX_NON_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_BACKREF,
- REPLACEMENTS
-} = constants;
-
-/**
- * Helpers
- */
-
-const expandRange = (args, options) => {
- if (typeof options.expandRange === 'function') {
- return options.expandRange(...args, options);
- }
-
- args.sort();
- const value = `[${args.join('-')}]`;
-
- try {
- /* eslint-disable-next-line no-new */
- new RegExp(value);
- } catch (ex) {
- return args.map(v => utils.escapeRegex(v)).join('..');
- }
-
- return value;
-};
-
-/**
- * Create the message for a syntax error
- */
-
-const syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
-};
-
-/**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
-
-const parse = (input, options) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- input = REPLACEMENTS[input] || input;
-
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
-
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
- const tokens = [bos];
-
- const capture = opts.capture ? '' : '?:';
- const win32 = utils.isWindows(options);
-
- // create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants.globChars(win32);
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
-
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
-
- const globstar = (opts) => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const nodot = opts.dot ? '' : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- // minimatch options support
- if (typeof opts.noext === 'boolean') {
- opts.noextglob = opts.noext;
- }
-
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: '',
- output: '',
- prefix: '',
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
-
- input = utils.removePrefix(input, state);
- len = input.length;
-
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
-
- /**
- * Tokenizing helpers
- */
-
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index];
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = '', num = 0) => {
- state.consumed += value;
- state.index += num;
- };
- const append = token => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
-
- const negate = () => {
- let count = 1;
-
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
- advance();
- state.start++;
- count++;
- }
-
- if (count % 2 === 0) {
- return false;
- }
-
- state.negated = true;
- state.start++;
- return true;
- };
-
- const increment = type => {
- state[type]++;
- stack.push(type);
- };
-
- const decrement = type => {
- state[type]--;
- stack.pop();
- };
-
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
-
- const push = tok => {
- if (prev.type === 'globstar') {
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
-
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = 'star';
- prev.value = '*';
- prev.output = star;
- state.output += prev.output;
- }
- }
-
- if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
-
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === 'text' && tok.type === 'text') {
- prev.value += tok.value;
- prev.output = (prev.output || '') + tok.value;
- return;
- }
-
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
-
- const extglobOpen = (type, value) => {
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
-
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? '(' : '') + token.open;
-
- increment('parens');
- push({ type, value, output: state.output ? '' : ONE_CHAR });
- push({ type: 'paren', extglob: true, value: advance(), output });
- extglobs.push(token);
- };
-
- const extglobClose = token => {
- let output = token.close + (opts.capture ? ')' : '');
-
- if (token.type === 'negate') {
- let extglobStar = star;
-
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
- extglobStar = globstar(opts);
- }
-
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
-
- if (token.prev.type === 'bos' && eos()) {
- state.negatedExtglob = true;
- }
- }
-
- push({ type: 'paren', extglob: true, value, output });
- decrement('parens');
- };
-
- /**
- * Fast paths
- */
-
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
-
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === '\\') {
- backslashes = true;
- return m;
- }
-
- if (first === '?') {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
- }
- return QMARK.repeat(chars.length);
- }
-
- if (first === '.') {
- return DOT_LITERAL.repeat(chars.length);
- }
-
- if (first === '*') {
- if (esc) {
- return esc + first + (rest ? star : '');
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
-
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, '');
- } else {
- output = output.replace(/\\+/g, m => {
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
- });
- }
- }
-
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
-
- state.output = utils.wrapOutput(output, state, options);
- return state;
- }
-
- /**
- * Tokenize input until we reach end-of-string
- */
-
- while (!eos()) {
- value = advance();
-
- if (value === '\u0000') {
- continue;
- }
-
- /**
- * Escaped characters
- */
-
- if (value === '\\') {
- const next = peek();
-
- if (next === '/' && opts.bash !== true) {
- continue;
- }
-
- if (next === '.' || next === ';') {
- continue;
- }
-
- if (!next) {
- value += '\\';
- push({ type: 'text', value });
- continue;
- }
-
- // collapse slashes to reduce potential for exploits
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
-
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += '\\';
- }
- }
-
- if (opts.unescape === true) {
- value = advance() || '';
- } else {
- value += advance() || '';
- }
-
- if (state.brackets === 0) {
- push({ type: 'text', value });
- continue;
- }
- }
-
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
-
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
- if (opts.posix !== false && value === ':') {
- const inner = prev.value.slice(1);
- if (inner.includes('[')) {
- prev.posix = true;
-
- if (inner.includes(':')) {
- const idx = prev.value.lastIndexOf('[');
- const pre = prev.value.slice(0, idx);
- const rest = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE[rest];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
-
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
-
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
- value = `\\${value}`;
- }
-
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
- value = `\\${value}`;
- }
-
- if (opts.posix === true && value === '!' && prev.value === '[') {
- value = '^';
- }
-
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
-
- if (state.quotes === 1 && value !== '"') {
- value = utils.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
-
- /**
- * Double quotes
- */
-
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({ type: 'text', value });
- }
- continue;
- }
-
- /**
- * Parentheses
- */
-
- if (value === '(') {
- increment('parens');
- push({ type: 'paren', value });
- continue;
- }
-
- if (value === ')') {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '('));
- }
-
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
-
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
- decrement('parens');
- continue;
- }
-
- /**
- * Square brackets
- */
-
- if (value === '[') {
- if (opts.nobracket === true || !remaining().includes(']')) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('closing', ']'));
- }
-
- value = `\\${value}`;
- } else {
- increment('brackets');
- }
-
- push({ type: 'bracket', value });
- continue;
- }
-
- if (value === ']') {
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '['));
- }
-
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
-
- decrement('brackets');
-
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
- value = `/${value}`;
- }
-
- prev.value += value;
- append({ value });
-
- // when literal brackets are explicitly disabled
- // assume we should match with a regex character class
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
- continue;
- }
-
- const escaped = utils.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
-
- // when literal brackets are explicitly enabled
- // assume we should escape the brackets to match literal characters
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
-
- // when the user specifies nothing, try to match both
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
-
- /**
- * Braces
- */
-
- if (value === '{' && opts.nobrace !== true) {
- increment('braces');
-
- const open = {
- type: 'brace',
- value,
- output: '(',
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
-
- braces.push(open);
- push(open);
- continue;
- }
-
- if (value === '}') {
- const brace = braces[braces.length - 1];
-
- if (opts.nobrace === true || !brace) {
- push({ type: 'text', value, output: value });
- continue;
- }
-
- let output = ')';
-
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
-
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === 'brace') {
- break;
- }
- if (arr[i].type !== 'dots') {
- range.unshift(arr[i].value);
- }
- }
-
- output = expandRange(range, opts);
- state.backtrack = true;
- }
-
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = '\\{';
- value = output = '\\}';
- state.output = out;
- for (const t of toks) {
- state.output += (t.output || t.value);
- }
- }
-
- push({ type: 'brace', value, output });
- decrement('braces');
- braces.pop();
- continue;
- }
-
- /**
- * Pipes
- */
-
- if (value === '|') {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Commas
- */
-
- if (value === ',') {
- let output = value;
-
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === 'braces') {
- brace.comma = true;
- output = '|';
- }
-
- push({ type: 'comma', value, output });
- continue;
- }
-
- /**
- * Slashes
- */
-
- if (value === '/') {
- // if the beginning of the glob is "./", advance the start
- // to the current index, and don't add the "./" characters
- // to the state. This greatly simplifies lookbehinds when
- // checking for BOS characters like "!" and "." (not "./")
- if (prev.type === 'dot' && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = '';
- state.output = '';
- tokens.pop();
- prev = bos; // reset "prev" to the first token
- continue;
- }
-
- push({ type: 'slash', value, output: SLASH_LITERAL });
- continue;
- }
-
- /**
- * Dots
- */
-
- if (value === '.') {
- if (state.braces > 0 && prev.type === 'dot') {
- if (prev.value === '.') prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = 'dots';
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
-
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
- push({ type: 'text', value, output: DOT_LITERAL });
- continue;
- }
-
- push({ type: 'dot', value, output: DOT_LITERAL });
- continue;
- }
-
- /**
- * Question marks
- */
-
- if (value === '?') {
- const isGroup = prev && prev.value === '(';
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('qmark', value);
- continue;
- }
-
- if (prev && prev.type === 'paren') {
- const next = peek();
- let output = value;
-
- if (next === '<' && !utils.supportsLookbehinds()) {
- throw new Error('Node.js v10 or higher is required for regex lookbehinds');
- }
-
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
- output = `\\${value}`;
- }
-
- push({ type: 'text', value, output });
- continue;
- }
-
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
- continue;
- }
-
- push({ type: 'qmark', value, output: QMARK });
- continue;
- }
-
- /**
- * Exclamation
- */
-
- if (value === '!') {
- if (opts.noextglob !== true && peek() === '(') {
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
- extglobOpen('negate', value);
- continue;
- }
- }
-
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
-
- /**
- * Plus
- */
-
- if (value === '+') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('plus', value);
- continue;
- }
-
- if ((prev && prev.value === '(') || opts.regex === false) {
- push({ type: 'plus', value, output: PLUS_LITERAL });
- continue;
- }
-
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
- push({ type: 'plus', value });
- continue;
- }
-
- push({ type: 'plus', value: PLUS_LITERAL });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value === '@') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- push({ type: 'at', extglob: true, value, output: '' });
- continue;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Plain text
- */
-
- if (value !== '*') {
- if (value === '$' || value === '^') {
- value = `\\${value}`;
- }
-
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
-
- push({ type: 'text', value });
- continue;
- }
-
- /**
- * Stars
- */
-
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
- prev.type = 'star';
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen('star', value);
- continue;
- }
-
- if (prev.type === 'star') {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
-
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === 'slash' || prior.type === 'bos';
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
-
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
- push({ type: 'star', value, output: '' });
- continue;
- }
-
- // strip consecutive `/**/`
- while (rest.slice(0, 3) === '/**') {
- const after = input[state.index + 4];
- if (after && after !== '/') {
- break;
- }
- rest = rest.slice(3);
- consume('/**', 3);
- }
-
- if (prior.type === 'bos' && eos()) {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
-
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
- const end = rest[1] !== void 0 ? '|$' : '';
-
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
-
- prev.type = 'globstar';
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
-
- state.output += prior.output + prev.output;
- state.globstar = true;
-
- consume(value + advance());
-
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- if (prior.type === 'bos' && rest[0] === '/') {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
-
- // remove single star from output
- state.output = state.output.slice(0, -prev.output.length);
-
- // reset previous token to globstar
- prev.type = 'globstar';
- prev.output = globstar(opts);
- prev.value += value;
-
- // reset output with globstar
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
-
- const token = { type: 'star', value, output: star };
-
- if (opts.bash === true) {
- token.output = '.*?';
- if (prev.type === 'bos' || prev.type === 'slash') {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
-
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
-
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
- if (prev.type === 'dot') {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
-
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
-
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
-
- if (peek() !== '*') {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
-
- push(token);
- }
-
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
- state.output = utils.escapeLast(state.output, '[');
- decrement('brackets');
- }
-
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
- state.output = utils.escapeLast(state.output, '(');
- decrement('parens');
- }
-
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
- state.output = utils.escapeLast(state.output, '{');
- decrement('braces');
- }
-
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
- }
-
- // rebuild the output if we had to backtrack at any point
- if (state.backtrack === true) {
- state.output = '';
-
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
-
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
-
- return state;
-};
-
-/**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
-
-parse.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
-
- input = REPLACEMENTS[input] || input;
- const win32 = utils.isWindows(options);
-
- // create constants based on platform, for windows or posix
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants.globChars(win32);
-
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? '' : '?:';
- const state = { negated: false, prefix: '' };
- let star = opts.bash === true ? '.*?' : STAR;
-
- if (opts.capture) {
- star = `(${star})`;
- }
-
- const globstar = (opts) => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
-
- const create = str => {
- switch (str) {
- case '*':
- return `${nodot}${ONE_CHAR}${star}`;
-
- case '.*':
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*.*':
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '*/*':
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
-
- case '**':
- return nodot + globstar(opts);
-
- case '**/*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
-
- case '**/*.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- case '**/.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
-
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
-
- const source = create(match[1]);
- if (!source) return;
-
- return source + DOT_LITERAL + match[2];
- }
- }
- };
-
- const output = utils.removePrefix(input, state);
- let source = create(output);
-
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
-
- return source;
-};
-
-module.exports = parse;
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js
deleted file mode 100755
index df7438a94f8..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js
+++ /dev/null
@@ -1,339 +0,0 @@
-'use strict';
-
-const path = require('path');
-const scan = require('./scan');
-const parse = require('./parse');
-const utils = require('./utils');
-const constants = require('./constants');
-const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
-
-/**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
-
-const picomatch = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map(input => picomatch(input, options, returnState));
- const arrayMatcher = str => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
-
- const isState = isObject(glob) && glob.tokens && glob.input;
-
- if (glob === '' || (typeof glob !== 'string' && !isState)) {
- throw new TypeError('Expected pattern to be a non-empty string');
- }
-
- const opts = options || {};
- const posix = utils.isWindows(options);
- const regex = isState
- ? picomatch.compileRe(glob, options)
- : picomatch.makeRe(glob, options, false, true);
-
- const state = regex.state;
- delete regex.state;
-
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
- }
-
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
- const result = { glob, state, regex, posix, input, output, match, isMatch };
-
- if (typeof opts.onResult === 'function') {
- opts.onResult(result);
- }
-
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === 'function') {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
-
- if (typeof opts.onMatch === 'function') {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
-
- if (returnState) {
- matcher.state = state;
- }
-
- return matcher;
-};
-
-/**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
-
-picomatch.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected input to be a string');
- }
-
- if (input === '') {
- return { isMatch: false, output: '' };
- }
-
- const opts = options || {};
- const format = opts.format || (posix ? utils.toPosixSlashes : null);
- let match = input === glob;
- let output = (match && format) ? format(input) : input;
-
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
-
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
-
- return { isMatch: Boolean(match), match, output };
-};
-
-/**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
-
-picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
- const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
- return regex.test(path.basename(input));
-};
-
-/**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
-
-picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
-
-/**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
-
-picomatch.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
- return parse(pattern, { ...options, fastpaths: false });
-};
-
-/**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
-
-picomatch.scan = (input, options) => scan(input, options);
-
-/**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
-
-picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return parsed.output;
- }
-
- const opts = options || {};
- const prepend = opts.contains ? '' : '^';
- const append = opts.contains ? '' : '$';
-
- let source = `${prepend}(?:${parsed.output})${append}`;
- if (parsed && parsed.negated === true) {
- source = `^(?!${source}).*$`;
- }
-
- const regex = picomatch.toRegex(source, options);
- if (returnState === true) {
- regex.state = parsed;
- }
-
- return regex;
-};
-
-picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== 'string') {
- throw new TypeError('Expected a non-empty string');
- }
-
- const opts = options || {};
- let parsed = { negated: false, fastpaths: true };
- let prefix = '';
- let output;
-
- if (input.startsWith('./')) {
- input = input.slice(2);
- prefix = parsed.prefix = './';
- }
-
- if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
- output = parse.fastpaths(input, options);
- }
-
- if (output === undefined) {
- parsed = parse(input, options);
- parsed.prefix = prefix + (parsed.prefix || '');
- } else {
- parsed.output = output;
- }
-
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
-};
-
-/**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
-
-picomatch.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
-};
-
-/**
- * Picomatch constants.
- * @return {Object}
- */
-
-picomatch.constants = constants;
-
-/**
- * Expose "picomatch"
- */
-
-module.exports = picomatch;
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js
deleted file mode 100755
index 31ae6adbe8a..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js
+++ /dev/null
@@ -1,383 +0,0 @@
-'use strict';
-
-const utils = require('./utils');
-const {
- CHAR_ASTERISK, /* * */
- CHAR_AT, /* @ */
- CHAR_BACKWARD_SLASH, /* \ */
- CHAR_COMMA, /* , */
- CHAR_DOT, /* . */
- CHAR_EXCLAMATION_MARK, /* ! */
- CHAR_FORWARD_SLASH, /* / */
- CHAR_LEFT_CURLY_BRACE, /* { */
- CHAR_LEFT_PARENTHESES, /* ( */
- CHAR_LEFT_SQUARE_BRACKET, /* [ */
- CHAR_PLUS, /* + */
- CHAR_QUESTION_MARK, /* ? */
- CHAR_RIGHT_CURLY_BRACE, /* } */
- CHAR_RIGHT_PARENTHESES, /* ) */
- CHAR_RIGHT_SQUARE_BRACKET /* ] */
-} = require('./constants');
-
-const isPathSeparator = code => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
-};
-
-const depth = token => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
-};
-
-/**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), and `negated` (true if the path starts with `!`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
-
-const scan = (input, options) => {
- const opts = options || {};
-
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
-
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = { value: '', depth: 0, isGlob: false };
-
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
-
- while (index < length) {
- code = advance();
- let next;
-
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
-
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braceEscaped = true;
- }
- continue;
- }
-
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
-
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- continue;
- }
-
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (braceEscaped !== true && code === CHAR_COMMA) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_RIGHT_CURLY_BRACE) {
- braces--;
-
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
-
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = { value: '', depth: 0, isGlob: false };
-
- if (finished === true) continue;
- if (prev === CHAR_DOT && index === (start + 1)) {
- start += 2;
- continue;
- }
-
- lastIndex = index + 1;
- continue;
- }
-
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS
- || code === CHAR_AT
- || code === CHAR_ASTERISK
- || code === CHAR_QUESTION_MARK
- || code === CHAR_EXCLAMATION_MARK;
-
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
-
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
-
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
-
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- }
- }
-
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
-
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
-
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
-
- if (code === CHAR_RIGHT_PARENTHESES) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
-
- if (isGlob === true) {
- finished = true;
-
- if (scanToEnd === true) {
- continue;
- }
-
- break;
- }
- }
-
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
-
- let base = str;
- let prefix = '';
- let glob = '';
-
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
-
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = '';
- glob = str;
- } else {
- base = str;
- }
-
- if (base && base !== '' && base !== '/' && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
-
- if (opts.unescape === true) {
- if (glob) glob = utils.removeBackslashes(glob);
-
- if (base && backslashes === true) {
- base = utils.removeBackslashes(base);
- }
- }
-
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated
- };
-
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
-
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
-
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== '') {
- parts.push(value);
- }
- prevIndex = i;
- }
-
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
-
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
-
- state.slashes = slashes;
- state.parts = parts;
- }
-
- return state;
-};
-
-module.exports = scan;
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js
deleted file mode 100755
index c3ca766a7be..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js
+++ /dev/null
@@ -1,64 +0,0 @@
-'use strict';
-
-const path = require('path');
-const win32 = process.platform === 'win32';
-const {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
-} = require('./constants');
-
-exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
-exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
-exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
-exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
-exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
-
-exports.removeBackslashes = str => {
- return str.replace(REGEX_REMOVE_BACKSLASH, match => {
- return match === '\\' ? '' : match;
- });
-};
-
-exports.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split('.').map(Number);
- if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
- return true;
- }
- return false;
-};
-
-exports.isWindows = options => {
- if (options && typeof options.windows === 'boolean') {
- return options.windows;
- }
- return win32 === true || path.sep === '\\';
-};
-
-exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
-};
-
-exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith('./')) {
- output = output.slice(2);
- state.prefix = './';
- }
- return output;
-};
-
-exports.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? '' : '^';
- const append = options.contains ? '' : '$';
-
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
-};
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/package.json
deleted file mode 100755
index 8be8a413db0..00000000000
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/node_modules/picomatch/package.json
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
- "bugs": {
- "url": "https://github.com/micromatch/picomatch/issues"
- },
- "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
- "devDependencies": {
- "eslint": "^6.8.0",
- "fill-range": "^7.0.1",
- "gulp-format-md": "^2.0.0",
- "mocha": "^6.2.2",
- "nyc": "^15.0.0",
- "time-require": "github:jonschlinkert/time-require"
- },
- "engines": {
- "node": ">=8.6"
- },
- "files": [
- "index.js",
- "lib"
- ],
- "funding": "https://github.com/sponsors/jonschlinkert",
- "homepage": "https://github.com/micromatch/picomatch",
- "keywords": [
- "glob",
- "match",
- "picomatch"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "picomatch",
- "nyc": {
- "reporter": [
- "html",
- "lcov",
- "text-summary"
- ]
- },
- "repository": "micromatch/picomatch",
- "scripts": {
- "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
- "mocha": "mocha --reporter dot",
- "test": "npm run lint && npm run mocha",
- "test:ci": "npm run test:cover",
- "test:cover": "nyc npm run mocha"
- },
- "verb": {
- "layout": "empty",
- "lint": {
- "reflinks": true
- },
- "plugins": [
- "gulp-format-md"
- ],
- "reflinks": [
- "braces",
- "expand-brackets",
- "extglob",
- "fill-range",
- "micromatch",
- "minimatch",
- "nanomatch",
- "picomatch"
- ],
- "related": {
- "list": [
- "braces",
- "micromatch"
- ]
- },
- "tasks": [
- "readme"
- ],
- "toc": {
- "maxdepth": 3,
- "method": "preWrite",
- "render": true
- }
- },
- "version": "2.2.2"
-}
diff --git a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/package.json b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/package.json
index cdba75f48d5..0f57f419291 100644
--- a/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/package.json
+++ b/chromium/third_party/devtools-frontend/src/node_modules/@rollup/pluginutils/package.json
@@ -1,29 +1,56 @@
{
- "author": "Rich Harris <richard.a.harris@gmail.com>",
- "ava": {
- "compileEnhancements": false,
- "extensions": [
- "ts"
- ],
- "files": [
- "!**/fixtures/**",
- "!**/helpers/**",
- "!**/recipes/**",
- "!**/types.ts"
- ],
- "require": [
- "ts-node/register"
- ]
+ "name": "@rollup/pluginutils",
+ "version": "3.1.0",
+ "publishConfig": {
+ "access": "public"
},
+ "description": "A set of utility functions commonly used by Rollup plugins",
+ "license": "MIT",
+ "repository": "rollup/plugins",
+ "author": "Rich Harris <richard.a.harris@gmail.com>",
+ "homepage": "https://github.com/rollup/plugins/tree/master/packages/pluginutils#readme",
"bugs": {
"url": "https://github.com/rollup/plugins/issues"
},
+ "main": "./dist/cjs/index.js",
+ "engines": {
+ "node": ">= 8.0.0"
+ },
+ "scripts": {
+ "build": "rollup -c",
+ "ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
+ "ci:lint": "pnpm run build && pnpm run lint",
+ "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
+ "ci:test": "pnpm run test -- --verbose",
+ "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
+ "lint:docs": "prettier --single-quote --write README.md",
+ "lint:js": "eslint --fix --cache src test types --ext .js,.ts",
+ "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
+ "prebuild": "del-cli dist",
+ "prepare": "pnpm run build",
+ "prepublishOnly": "pnpm run lint && pnpm run build",
+ "pretest": "pnpm run build -- --sourcemap",
+ "test": "ava"
+ },
+ "files": [
+ "dist",
+ "types",
+ "README.md",
+ "LICENSE"
+ ],
+ "keywords": [
+ "rollup",
+ "plugin",
+ "utils"
+ ],
+ "peerDependencies": {
+ "rollup": "^1.20.0||^2.0.0"
+ },
"dependencies": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"picomatch": "^2.2.2"
},
- "description": "A set of utility functions commonly used by Rollup plugins",
"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
@@ -33,59 +60,32 @@
"@types/picomatch": "^2.2.1",
"typescript": "^3.7.5"
},
- "engines": {
- "node": ">= 8.0.0"
+ "ava": {
+ "compileEnhancements": false,
+ "extensions": [
+ "ts"
+ ],
+ "require": [
+ "ts-node/register"
+ ],
+ "files": [
+ "!**/fixtures/**",
+ "!**/helpers/**",
+ "!**/recipes/**",
+ "!**/types.ts"
+ ]
},
"exports": {
- "import": "./dist/es/index.js",
- "require": "./dist/cjs/index.js"
+ "require": "./dist/cjs/index.js",
+ "import": "./dist/es/index.js"
},
- "files": [
- "dist",
- "types",
- "README.md",
- "LICENSE"
- ],
- "homepage": "https://github.com/rollup/plugins/tree/master/packages/pluginutils#readme",
- "keywords": [
- "rollup",
- "plugin",
- "utils"
- ],
- "license": "MIT",
- "main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
- "name": "@rollup/pluginutils",
"nyc": {
"extension": [
".js",
".ts"
]
},
- "peerDependencies": {
- "rollup": "^1.20.0||^2.0.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "repository": "rollup/plugins",
- "scripts": {
- "build": "rollup -c",
- "ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
- "ci:lint": "pnpm run build && pnpm run lint",
- "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
- "ci:test": "pnpm run test -- --verbose",
- "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
- "lint:docs": "prettier --single-quote --write README.md",
- "lint:js": "eslint --fix --cache src test types --ext .js,.ts",
- "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
- "prebuild": "del-cli dist",
- "prepare": "pnpm run build",
- "prepublishOnly": "pnpm run lint && pnpm run build",
- "pretest": "pnpm run build -- --sourcemap",
- "test": "ava"
- },
"type": "commonjs",
- "types": "types/index.d.ts",
- "version": "3.1.0"
+ "types": "types/index.d.ts"
}