diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..7ba59b6f --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": [ + ["@babel/preset-env", { + "targets": { + "browsers": "last 2 versions, chrome >= 78" + } + }] + ] +} \ No newline at end of file diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 00000000..cf767603 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 120000 index 00000000..3cd991b2 --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/node_modules/.bin/esbuild b/node_modules/.bin/esbuild new file mode 120000 index 00000000..c83ac070 --- /dev/null +++ b/node_modules/.bin/esbuild @@ -0,0 +1 @@ +../esbuild/bin/esbuild \ No newline at end of file diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 120000 index 00000000..7237604c --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1 @@ +../jsesc/bin/jsesc \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 00000000..217f3798 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 120000 index 00000000..e2be547b --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1 @@ +../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 120000 index 00000000..ce7bf97e --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/node_modules/.bin/regjsparser b/node_modules/.bin/regjsparser new file mode 120000 index 00000000..91cec777 --- /dev/null +++ b/node_modules/.bin/regjsparser @@ -0,0 +1 @@ +../regjsparser/bin/parser \ No newline at end of file diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 120000 index 00000000..b6afda6c --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/node_modules/.bin/rollup b/node_modules/.bin/rollup new file mode 120000 index 00000000..5939621c --- /dev/null +++ b/node_modules/.bin/rollup @@ -0,0 +1 @@ +../rollup/dist/bin/rollup \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 00000000..5aaadf42 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.bin/tldts b/node_modules/.bin/tldts new file mode 120000 index 00000000..85001241 --- /dev/null +++ b/node_modules/.bin/tldts @@ -0,0 +1 @@ +../tldts/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 120000 index 00000000..b11e16f3 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1 @@ +../update-browserslist-db/cli.js \ No newline at end of file diff --git a/node_modules/.bin/vite b/node_modules/.bin/vite new file mode 120000 index 00000000..6d1e3bea --- /dev/null +++ b/node_modules/.bin/vite @@ -0,0 +1 @@ +../vite/bin/vite.js \ No newline at end of file diff --git a/node_modules/.bin/vite-node b/node_modules/.bin/vite-node new file mode 120000 index 00000000..d68f74cb --- /dev/null +++ b/node_modules/.bin/vite-node @@ -0,0 +1 @@ +../vite-node/vite-node.mjs \ No newline at end of file diff --git a/node_modules/.bin/vitest b/node_modules/.bin/vitest new file mode 120000 index 00000000..22734979 --- /dev/null +++ b/node_modules/.bin/vitest @@ -0,0 +1 @@ +../vitest/vitest.mjs \ No newline at end of file diff --git a/node_modules/.bin/why-is-node-running b/node_modules/.bin/why-is-node-running new file mode 120000 index 00000000..f08a594c --- /dev/null +++ b/node_modules/.bin/why-is-node-running @@ -0,0 +1 @@ +../why-is-node-running/cli.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 00000000..ca794501 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,3346 @@ +{ + "name": "mailgeek-chrome-extension", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.2.tgz", + "integrity": "sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz", + "integrity": "sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helpers": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/template": "^7.27.1", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", + "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.27.1", + "@babel/types": "^7.27.1", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.1.tgz", + "integrity": "sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz", + "integrity": "sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.27.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.1.tgz", + "integrity": "sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "regexpu-core": "^6.2.0", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.4.tgz", + "integrity": "sha512-jljfR1rGnXXNWnmQg2K3+bvhkxB51Rl32QRaOTuwwjviGrHzIbSc8+x9CpraDtbT7mfyjXObULP4w/adunNwAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz", + "integrity": "sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.1.tgz", + "integrity": "sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz", + "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.27.1.tgz", + "integrity": "sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-wrap-function": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz", + "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz", + "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.27.1.tgz", + "integrity": "sha512-NFJK2sHUvrjo8wAU/nQTWU890/zB2jj0qBcCbZbbf+005cAsv6tMjXz31fBign6M5ov1o0Bllu+9nbqkfsjjJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.1", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", + "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.27.1.tgz", + "integrity": "sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.27.1.tgz", + "integrity": "sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.27.1.tgz", + "integrity": "sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.27.1.tgz", + "integrity": "sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.27.1.tgz", + "integrity": "sha512-6BpaYGDavZqkI6yT+KSPdpZFfpnd68UKXbcjI9pJ13pvHhPrCKWOOLp+ysvMeA+DxnhuPpgIaRpxRxo5A9t5jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.27.1.tgz", + "integrity": "sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.27.1.tgz", + "integrity": "sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.27.1.tgz", + "integrity": "sha512-eST9RrwlpaoJBDHShc+DS2SG4ATTi2MYNb4OxYkf3n+7eb49LWpnS+HSpVfW4x927qQwgk8A2hGNVaajAEw0EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.27.1.tgz", + "integrity": "sha512-NREkZsZVJS4xmTr8qzE5y8AfIPqsdQfRuUiLRTEzb7Qii8iFWCyDKaUV2c0rCuh4ljDZ98ALHP/PetiBV2nddA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.27.1.tgz", + "integrity": "sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.27.1.tgz", + "integrity": "sha512-QEcFlMl9nGTgh1rn2nIeU5bkfb9BAjaQcWbiP4LvKxUot52ABcTkpcyJ7f2Q2U2RuQ84BNLgts3jRme2dTx6Fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", + "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.27.1.tgz", + "integrity": "sha512-s734HmYU78MVzZ++joYM+NkJusItbdRcbm+AGRgJCt3iA+yux0QpD9cBVdz3tKyrjVYWRl7j0mHSmv4lhV0aoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.27.1.tgz", + "integrity": "sha512-7iLhfFAubmpeJe/Wo2TVuDrykh/zlWXLzPNdL0Jqn/Xu8R3QQ8h9ff8FQoISZOsw74/HFqFI7NX63HN7QFIHKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/traverse": "^7.27.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.27.1.tgz", + "integrity": "sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/template": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.27.1.tgz", + "integrity": "sha512-ttDCqhfvpE9emVkXbPD8vyxxh4TWYACVybGkDj+oReOGwnp066ITEivDlLwe0b1R0+evJ13IXQuLNB5w1fhC5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.27.1.tgz", + "integrity": "sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.27.1.tgz", + "integrity": "sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.27.1.tgz", + "integrity": "sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.27.1.tgz", + "integrity": "sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.27.1.tgz", + "integrity": "sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.27.1.tgz", + "integrity": "sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.27.1.tgz", + "integrity": "sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.27.1.tgz", + "integrity": "sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.27.1.tgz", + "integrity": "sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.27.1.tgz", + "integrity": "sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.27.1.tgz", + "integrity": "sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.27.1.tgz", + "integrity": "sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz", + "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.27.1.tgz", + "integrity": "sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.27.1.tgz", + "integrity": "sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.27.1.tgz", + "integrity": "sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", + "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.27.1.tgz", + "integrity": "sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.27.2.tgz", + "integrity": "sha512-AIUHD7xJ1mCrj3uPozvtngY3s0xpv7Nu7DoUSnzNY6Xam1Cy4rUznR//pvMHOhQ4AvbCexhbqXCtpxGHOGOO6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.27.1", + "@babel/plugin-transform-parameters": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.27.1.tgz", + "integrity": "sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.27.1.tgz", + "integrity": "sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", + "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.1.tgz", + "integrity": "sha512-018KRk76HWKeZ5l4oTj2zPpSh+NbGdt0st5S6x0pga6HgrjBOJb24mMDHorFopOOd6YHkLgOZ+zaCjZGPO4aKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz", + "integrity": "sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.27.1.tgz", + "integrity": "sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.27.1.tgz", + "integrity": "sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.27.1.tgz", + "integrity": "sha512-B19lbbL7PMrKr52BNPjCqg1IyNUIjTcxKj8uX9zHO+PmWN93s19NDr/f69mIkEp2x9nmDJ08a7lgHaTTzvW7mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.27.1.tgz", + "integrity": "sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.27.1.tgz", + "integrity": "sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.27.1.tgz", + "integrity": "sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.27.1.tgz", + "integrity": "sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.27.1.tgz", + "integrity": "sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz", + "integrity": "sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.27.1.tgz", + "integrity": "sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.27.1.tgz", + "integrity": "sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.27.1.tgz", + "integrity": "sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.27.1.tgz", + "integrity": "sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.27.1.tgz", + "integrity": "sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.27.2.tgz", + "integrity": "sha512-Ma4zSuYSlGNRlCLO+EAzLnCmJK2vdstgv+n7aUP+/IKZrOfWHOJVdSJtuub8RzHTj3ahD37k5OKJWvzf16TQyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.27.1", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.27.1", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.27.1", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.27.1", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.27.1", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-import-assertions": "^7.27.1", + "@babel/plugin-syntax-import-attributes": "^7.27.1", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.27.1", + "@babel/plugin-transform-async-generator-functions": "^7.27.1", + "@babel/plugin-transform-async-to-generator": "^7.27.1", + "@babel/plugin-transform-block-scoped-functions": "^7.27.1", + "@babel/plugin-transform-block-scoping": "^7.27.1", + "@babel/plugin-transform-class-properties": "^7.27.1", + "@babel/plugin-transform-class-static-block": "^7.27.1", + "@babel/plugin-transform-classes": "^7.27.1", + "@babel/plugin-transform-computed-properties": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.27.1", + "@babel/plugin-transform-dotall-regex": "^7.27.1", + "@babel/plugin-transform-duplicate-keys": "^7.27.1", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-dynamic-import": "^7.27.1", + "@babel/plugin-transform-exponentiation-operator": "^7.27.1", + "@babel/plugin-transform-export-namespace-from": "^7.27.1", + "@babel/plugin-transform-for-of": "^7.27.1", + "@babel/plugin-transform-function-name": "^7.27.1", + "@babel/plugin-transform-json-strings": "^7.27.1", + "@babel/plugin-transform-literals": "^7.27.1", + "@babel/plugin-transform-logical-assignment-operators": "^7.27.1", + "@babel/plugin-transform-member-expression-literals": "^7.27.1", + "@babel/plugin-transform-modules-amd": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/plugin-transform-modules-systemjs": "^7.27.1", + "@babel/plugin-transform-modules-umd": "^7.27.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-new-target": "^7.27.1", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1", + "@babel/plugin-transform-numeric-separator": "^7.27.1", + "@babel/plugin-transform-object-rest-spread": "^7.27.2", + "@babel/plugin-transform-object-super": "^7.27.1", + "@babel/plugin-transform-optional-catch-binding": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.27.1", + "@babel/plugin-transform-parameters": "^7.27.1", + "@babel/plugin-transform-private-methods": "^7.27.1", + "@babel/plugin-transform-private-property-in-object": "^7.27.1", + "@babel/plugin-transform-property-literals": "^7.27.1", + "@babel/plugin-transform-regenerator": "^7.27.1", + "@babel/plugin-transform-regexp-modifiers": "^7.27.1", + "@babel/plugin-transform-reserved-words": "^7.27.1", + "@babel/plugin-transform-shorthand-properties": "^7.27.1", + "@babel/plugin-transform-spread": "^7.27.1", + "@babel/plugin-transform-sticky-regex": "^7.27.1", + "@babel/plugin-transform-template-literals": "^7.27.1", + "@babel/plugin-transform-typeof-symbol": "^7.27.1", + "@babel/plugin-transform-unicode-escapes": "^7.27.1", + "@babel/plugin-transform-unicode-property-regex": "^7.27.1", + "@babel/plugin-transform-unicode-regex": "^7.27.1", + "@babel/plugin-transform-unicode-sets-regex": "^7.27.1", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.11.0", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.40.0", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz", + "integrity": "sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.3.tgz", + "integrity": "sha512-XBG3talrhid44BY1x3MHzUx/aTG8+x/Zi57M4aTKK9RFB4aLlF3TTSzfzn8nWVHWL3FgAXAxmupmDd6VWww+pw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.9.tgz", + "integrity": "sha512-wILs5Zk7BU86UArYBJTPy/FMPPKVKHMj1ycCEyf3VUptol0JNRLFU/BZsJ4aiIHJEbSLiizzRrw8Pc1uAEDrXw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", + "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", + "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai-subset": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.6.tgz", + "integrity": "sha512-m8lERkkQj+uek18hXOZuec3W/fCRTrU4hrnXjH3qhHy96ytuPaPiWGgu7sJb7tZxZonO75vYAjCvpe/e4VUwRw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/chai": "<5.2.0" + } + }, + "node_modules/@types/node": { + "version": "22.15.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", + "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@vitest/expect": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.33.0.tgz", + "integrity": "sha512-sVNf+Gla3mhTCxNJx+wJLDPp/WcstOe0Ksqz4Vec51MmgMth/ia0MGFEkIZmVGeTL5HtjYR4Wl/ZxBxBXZJTzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "0.33.0", + "@vitest/utils": "0.33.0", + "chai": "^4.3.7" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.33.0.tgz", + "integrity": "sha512-UPfACnmCB6HKRHTlcgCoBh6ppl6fDn+J/xR8dTufWiKt/74Y9bHci5CKB8tESSV82zKYtkBJo9whU3mNvfaisg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "0.33.0", + "p-limit": "^4.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.33.0.tgz", + "integrity": "sha512-tJjrl//qAHbyHajpFvr8Wsk8DIOODEebTu7pgBrP07iOepR5jYkLFiqLq2Ltxv+r0uptUb4izv1J8XBOwKkVYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.33.0.tgz", + "integrity": "sha512-Kv+yZ4hnH1WdiAkPUQTpRxW8kGtH8VRTnus7ZTGovFYM1ZezJpvGtb9nPIjPnptHbsyIAxYZsEpVPYgtpjGnrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^2.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.33.0.tgz", + "integrity": "sha512-pF1w22ic965sv+EN6uoePkAOTkAPWM03Ri/jXNyMIKBb/XHLDPfhLvf/Fa9g0YECevAIz56oVYXhodLvLQ/awA==", + "dev": true, + "license": "MIT", + "dependencies": { + "diff-sequences": "^29.4.3", + "loupe": "^2.3.6", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.13.tgz", + "integrity": "sha512-3sX/eOms8kd3q2KZ6DAhKPc0dgm525Gqq5NtWKZ7QYYZEv57OQ54KtblzJzH1lQF/eQxO8KjWGIK9IPUJNus5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.4", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", + "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.3", + "core-js-compat": "^3.40.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.4.tgz", + "integrity": "sha512-7gD3pRadPrbjhjLyxebmx/WrFYcuSjZ0XbdUujQMZ/fcE9oeewk2U/7PCvez84UeuK3oSjmPZ0Ch0dlupQvGzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.4" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.24.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", + "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001716", + "electron-to-chromium": "^1.5.149", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001718", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", + "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.42.0.tgz", + "integrity": "sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.24.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cssstyle": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.3.1.tgz", + "integrity": "sha512-ZgW+Jgdd7i52AaLYCriF8Mxqft0gD/R9i9wi6RWBhs1pqdPEzPjym7rvRKi397WmQFf3SlyUsszhw+VVCbx79Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.1.2", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.5.0.tgz", + "integrity": "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.157", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz", + "integrity": "sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==", + "dev": true, + "license": "ISC" + }, + "node_modules/entities": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.0.tgz", + "integrity": "sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/local-pkg": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/mlly": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", + "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "pathe": "^2.0.1", + "pkg-types": "^1.3.0", + "ufo": "^1.5.4" + } + }, + "node_modules/mlly/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nwsapi": { + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.20.tgz", + "integrity": "sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", + "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexpu-core": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", + "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.2.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.12.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.0.2" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "3.29.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", + "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", + "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.6.0.tgz", + "integrity": "sha512-FdswUUo5SxRizcBc6b1GSuLpLjisa8N8qMyYoP3rl+bym+QauhtJP5bvZY1ytt8krKGmMLYIRl36HBZfeAoqhQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ufo": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", + "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "4.5.14", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.14.tgz", + "integrity": "sha512-+v57oAaoYNnO3hIu5Z/tJRZjq5aHM2zDve9YZ8HngVHbhk66RStobhb1sqPMIPEleV6cNKYK4eGrAbE9Ulbl2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.33.0.tgz", + "integrity": "sha512-19FpHYbwWWxDr73ruNahC+vtEdza52kA90Qb3La98yZ0xULqV8A5JLNPUff0f5zID4984tW7l3DH2przTJUZSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.4.0", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.33.0.tgz", + "integrity": "sha512-1CxaugJ50xskkQ0e969R/hW47za4YXDUfWJDxip1hwbnhUjYolpfUn2AMOulqG/Dtd9WYAtkHmM/m3yKVrEejQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.33.0", + "@vitest/runner": "0.33.0", + "@vitest/snapshot": "0.33.0", + "@vitest/spy": "0.33.0", + "@vitest/utils": "0.33.0", + "acorn": "^8.9.0", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.7", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.3.3", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.6.0", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.33.0", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*", + "playwright": "*", + "safaridriver": "*", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/.vitest/results.json b/node_modules/.vitest/results.json new file mode 100644 index 00000000..94a98d4b --- /dev/null +++ b/node_modules/.vitest/results.json @@ -0,0 +1 @@ +{"version":"0.33.0","results":[[":tests/content.test.js",{"duration":36,"failed":true}],[":tests/popup.test.js",{"duration":83,"failed":false}]]} \ No newline at end of file diff --git a/node_modules/@ampproject/remapping/LICENSE b/node_modules/@ampproject/remapping/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/node_modules/@ampproject/remapping/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@ampproject/remapping/README.md b/node_modules/@ampproject/remapping/README.md new file mode 100644 index 00000000..1463c9f6 --- /dev/null +++ b/node_modules/@ampproject/remapping/README.md @@ -0,0 +1,218 @@ +# @ampproject/remapping + +> Remap sequential sourcemaps through transformations to point at the original source code + +Remapping allows you to take the sourcemaps generated through transforming your code and "remap" +them to the original source locations. Think "my minified code, transformed with babel and bundled +with webpack", all pointing to the correct location in your original source code. + +With remapping, none of your source code transformations need to be aware of the input's sourcemap, +they only need to generate an output sourcemap. This greatly simplifies building custom +transformations (think a find-and-replace). + +## Installation + +```sh +npm install @ampproject/remapping +``` + +## Usage + +```typescript +function remapping( + map: SourceMap | SourceMap[], + loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), + options?: { excludeContent: boolean, decodedMappings: boolean } +): SourceMap; + +// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the +// "source" location (where child sources are resolved relative to, or the location of original +// source), and the ability to override the "content" of an original source for inclusion in the +// output sourcemap. +type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +} +``` + +`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer +in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents +a transformed file (it has a sourcmap associated with it), then the `loader` should return that +sourcemap. If not, the path will be treated as an original, untransformed source code. + +```js +// Babel transformed "helloworld.js" into "transformed.js" +const transformedMap = JSON.stringify({ + file: 'transformed.js', + // 1st column of 2nd line of output file translates into the 1st source + // file, line 3, column 2 + mappings: ';CAEE', + sources: ['helloworld.js'], + version: 3, +}); + +// Uglify minified "transformed.js" into "transformed.min.js" +const minifiedTransformedMap = JSON.stringify({ + file: 'transformed.min.js', + // 0th column of 1st line of output file translates into the 1st source + // file, line 2, column 1. + mappings: 'AACC', + names: [], + sources: ['transformed.js'], + version: 3, +}); + +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + // The "transformed.js" file is an transformed file. + if (file === 'transformed.js') { + // The root importer is empty. + console.assert(ctx.importer === ''); + // The depth in the sourcemap tree we're currently loading. + // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. + console.assert(ctx.depth === 1); + + return transformedMap; + } + + // Loader will be called to load transformedMap's source file pointers as well. + console.assert(file === 'helloworld.js'); + // `transformed.js`'s sourcemap points into `helloworld.js`. + console.assert(ctx.importer === 'transformed.js'); + // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. + console.assert(ctx.depth === 2); + return null; + } +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +In this example, `loader` will be called twice: + +1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the + associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can + be traced through it into the source files it represents. +2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so + we return `null`. + +The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If +you were to read the `mappings`, it says "0th column of the first line output line points to the 1st +column of the 2nd line of the file `helloworld.js`". + +### Multiple transformations of a file + +As a convenience, if you have multiple single-source transformations of a file, you may pass an +array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this +changes the `importer` and `depth` of each call to our loader. So our above example could have been +written as: + +```js +const remapped = remapping( + [minifiedTransformedMap, transformedMap], + () => null +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +### Advanced control of the loading graph + +#### `source` + +The `source` property can overridden to any value to change the location of the current load. Eg, +for an original source file, it allows us to change the location to the original source regardless +of what the sourcemap source entry says. And for transformed files, it allows us to change the +relative resolving location for child sources of the loaded sourcemap. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested + // source files are loaded, they will now be relative to `src/`. + ctx.source = 'src/transformed.js'; + return transformedMap; + } + + console.assert(file === 'src/helloworld.js'); + // We could futher change the source of this original file, eg, to be inside a nested directory + // itself. This will be reflected in the remapped sourcemap. + ctx.source = 'src/nested/transformed.js'; + return null; + } +); + +console.log(remapped); +// { +// …, +// sources: ['src/nested/helloworld.js'], +// }; +``` + + +#### `content` + +The `content` property can be overridden when we encounter an original source file. Eg, this allows +you to manually provide the source content of the original file regardless of whether the +`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove +the source content. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap + // would not include any `sourcesContent` values. + return transformedMap; + } + + console.assert(file === 'helloworld.js'); + // We can read the file to provide the source content. + ctx.content = fs.readFileSync(file, 'utf8'); + return null; + } +); + +console.log(remapped); +// { +// …, +// sourcesContent: [ +// 'console.log("Hello world!")', +// ], +// }; +``` + +### Options + +#### excludeContent + +By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the +`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce +the size out the sourcemap. + +#### decodedMappings + +By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the +`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of +encoding into a VLQ string. diff --git a/node_modules/@ampproject/remapping/dist/remapping.mjs b/node_modules/@ampproject/remapping/dist/remapping.mjs new file mode 100644 index 00000000..f3875999 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.mjs @@ -0,0 +1,197 @@ +import { decodedMappings, traceSegment, TraceMap } from '@jridgewell/trace-mapping'; +import { GenMapping, maybeAddSegment, setSourceContent, setIgnore, toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping'; + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); +const EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore, + }; +} +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +function MapSource(map, sources) { + return Source(map, sources, '', null, false); +} +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source, ignore } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + setSourceContent(gen, source, content); + if (ignore) + setIgnore(gen, source, true); + } + } + return gen; +} +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); +} + +function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; +} +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?'); + } + } + let tree = build(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + ignore: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build(new TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +} + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +function remapping(input, loader, options) { + const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} + +export { remapping as default }; +//# sourceMappingURL=remapping.mjs.map diff --git a/node_modules/@ampproject/remapping/dist/remapping.mjs.map b/node_modules/@ampproject/remapping/dist/remapping.mjs.map new file mode 100644 index 00000000..0eb007bf --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.mjs","sources":["../src/source-map-tree.ts","../src/build-source-map-tree.ts","../src/source-map.ts","../src/remapping.ts"],"sourcesContent":["import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping';\nimport { traceSegment, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport type { TraceMap } from '@jridgewell/trace-mapping';\n\nexport type SourceMapSegmentObject = {\n column: number;\n line: number;\n name: string;\n source: string;\n content: string | null;\n ignore: boolean;\n};\n\nexport type OriginalSource = {\n map: null;\n sources: Sources[];\n source: string;\n content: string | null;\n ignore: boolean;\n};\n\nexport type MapSource = {\n map: TraceMap;\n sources: Sources[];\n source: string;\n content: null;\n ignore: false;\n};\n\nexport type Sources = OriginalSource | MapSource;\n\nconst SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);\nconst EMPTY_SOURCES: Sources[] = [];\n\nfunction SegmentObject(\n source: string,\n line: number,\n column: number,\n name: string,\n content: string | null,\n ignore: boolean\n): SourceMapSegmentObject {\n return { source, line, column, name, content, ignore };\n}\n\nfunction Source(\n map: TraceMap,\n sources: Sources[],\n source: '',\n content: null,\n ignore: false\n): MapSource;\nfunction Source(\n map: null,\n sources: Sources[],\n source: string,\n content: string | null,\n ignore: boolean\n): OriginalSource;\nfunction Source(\n map: TraceMap | null,\n sources: Sources[],\n source: string | '',\n content: string | null,\n ignore: boolean\n): Sources {\n return {\n map,\n sources,\n source,\n content,\n ignore,\n } as any;\n}\n\n/**\n * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes\n * (which may themselves be SourceMapTrees).\n */\nexport function MapSource(map: TraceMap, sources: Sources[]): MapSource {\n return Source(map, sources, '', null, false);\n}\n\n/**\n * A \"leaf\" node in the sourcemap tree, representing an original, unmodified source file. Recursive\n * segment tracing ends at the `OriginalSource`.\n */\nexport function OriginalSource(\n source: string,\n content: string | null,\n ignore: boolean\n): OriginalSource {\n return Source(null, EMPTY_SOURCES, source, content, ignore);\n}\n\n/**\n * traceMappings is only called on the root level SourceMapTree, and begins the process of\n * resolving each mapping in terms of the original source files.\n */\nexport function traceMappings(tree: MapSource): GenMapping {\n // TODO: Eventually support sourceRoot, which has to be removed because the sources are already\n // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.\n const gen = new GenMapping({ file: tree.map.file });\n const { sources: rootSources, map } = tree;\n const rootNames = map.names;\n const rootMappings = decodedMappings(map);\n\n for (let i = 0; i < rootMappings.length; i++) {\n const segments = rootMappings[i];\n\n for (let j = 0; j < segments.length; j++) {\n const segment = segments[j];\n const genCol = segment[0];\n let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING;\n\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length !== 1) {\n const source = rootSources[segment[1]];\n traced = originalPositionFor(\n source,\n segment[2],\n segment[3],\n segment.length === 5 ? rootNames[segment[4]] : ''\n );\n\n // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a\n // respective segment into an original source.\n if (traced == null) continue;\n }\n\n const { column, line, name, content, source, ignore } = traced;\n\n maybeAddSegment(gen, i, genCol, source, line, column, name);\n if (source && content != null) setSourceContent(gen, source, content);\n if (ignore) setIgnore(gen, source, true);\n }\n }\n\n return gen;\n}\n\n/**\n * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own\n * child SourceMapTrees, until we find the original source map.\n */\nexport function originalPositionFor(\n source: Sources,\n line: number,\n column: number,\n name: string\n): SourceMapSegmentObject | null {\n if (!source.map) {\n return SegmentObject(source.source, line, column, name, source.content, source.ignore);\n }\n\n const segment = traceSegment(source.map, line, column);\n\n // If we couldn't find a segment, then this doesn't exist in the sourcemap.\n if (segment == null) return null;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length === 1) return SOURCELESS_MAPPING;\n\n return originalPositionFor(\n source.sources[segment[1]],\n segment[2],\n segment[3],\n segment.length === 5 ? source.map.names[segment[4]] : name\n );\n}\n","import { TraceMap } from '@jridgewell/trace-mapping';\n\nimport { OriginalSource, MapSource } from './source-map-tree';\n\nimport type { Sources, MapSource as MapSourceType } from './source-map-tree';\nimport type { SourceMapInput, SourceMapLoader, LoaderContext } from './types';\n\nfunction asArray(value: T | T[]): T[] {\n if (Array.isArray(value)) return value;\n return [value];\n}\n\n/**\n * Recursively builds a tree structure out of sourcemap files, with each node\n * being either an `OriginalSource` \"leaf\" or a `SourceMapTree` composed of\n * `OriginalSource`s and `SourceMapTree`s.\n *\n * Every sourcemap is composed of a collection of source files and mappings\n * into locations of those source files. When we generate a `SourceMapTree` for\n * the sourcemap, we attempt to load each source file's own sourcemap. If it\n * does not have an associated sourcemap, it is considered an original,\n * unmodified source file.\n */\nexport default function buildSourceMapTree(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader\n): MapSourceType {\n const maps = asArray(input).map((m) => new TraceMap(m, ''));\n const map = maps.pop()!;\n\n for (let i = 0; i < maps.length; i++) {\n if (maps[i].sources.length > 1) {\n throw new Error(\n `Transformation map ${i} must have exactly one source file.\\n` +\n 'Did you specify these with the most recent transformation maps first?'\n );\n }\n }\n\n let tree = build(map, loader, '', 0);\n for (let i = maps.length - 1; i >= 0; i--) {\n tree = MapSource(maps[i], [tree]);\n }\n return tree;\n}\n\nfunction build(\n map: TraceMap,\n loader: SourceMapLoader,\n importer: string,\n importerDepth: number\n): MapSourceType {\n const { resolvedSources, sourcesContent, ignoreList } = map;\n\n const depth = importerDepth + 1;\n const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => {\n // The loading context gives the loader more information about why this file is being loaded\n // (eg, from which importer). It also allows the loader to override the location of the loaded\n // sourcemap/original source, or to override the content in the sourcesContent field if it's\n // an unmodified source file.\n const ctx: LoaderContext = {\n importer,\n depth,\n source: sourceFile || '',\n content: undefined,\n ignore: undefined,\n };\n\n // Use the provided loader callback to retrieve the file's sourcemap.\n // TODO: We should eventually support async loading of sourcemap files.\n const sourceMap = loader(ctx.source, ctx);\n\n const { source, content, ignore } = ctx;\n\n // If there is a sourcemap, then we need to recurse into it to load its source files.\n if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);\n\n // Else, it's an unmodified source file.\n // The contents of this unmodified source file can be overridden via the loader context,\n // allowing it to be explicitly null or a string. If it remains undefined, we fall back to\n // the importing sourcemap's `sourcesContent` field.\n const sourceContent =\n content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;\n const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;\n return OriginalSource(source, sourceContent, ignored);\n });\n\n return MapSource(map, children);\n}\n","import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';\n\nimport type { GenMapping } from '@jridgewell/gen-mapping';\nimport type { DecodedSourceMap, EncodedSourceMap, Options } from './types';\n\n/**\n * A SourceMap v3 compatible sourcemap, which only includes fields that were\n * provided to it.\n */\nexport default class SourceMap {\n declare file?: string | null;\n declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];\n declare sourceRoot?: string;\n declare names: string[];\n declare sources: (string | null)[];\n declare sourcesContent?: (string | null)[];\n declare version: 3;\n declare ignoreList: number[] | undefined;\n\n constructor(map: GenMapping, options: Options) {\n const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);\n this.version = out.version; // SourceMap spec says this should be first.\n this.file = out.file;\n this.mappings = out.mappings as SourceMap['mappings'];\n this.names = out.names as SourceMap['names'];\n this.ignoreList = out.ignoreList as SourceMap['ignoreList'];\n this.sourceRoot = out.sourceRoot;\n\n this.sources = out.sources as SourceMap['sources'];\n if (!options.excludeContent) {\n this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];\n }\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n}\n","import buildSourceMapTree from './build-source-map-tree';\nimport { traceMappings } from './source-map-tree';\nimport SourceMap from './source-map';\n\nimport type { SourceMapInput, SourceMapLoader, Options } from './types';\nexport type {\n SourceMapSegment,\n EncodedSourceMap,\n EncodedSourceMap as RawSourceMap,\n DecodedSourceMap,\n SourceMapInput,\n SourceMapLoader,\n LoaderContext,\n Options,\n} from './types';\nexport type { SourceMap };\n\n/**\n * Traces through all the mappings in the root sourcemap, through the sources\n * (and their sourcemaps), all the way back to the original source location.\n *\n * `loader` will be called every time we encounter a source file. If it returns\n * a sourcemap, we will recurse into that sourcemap to continue the trace. If\n * it returns a falsey value, that source file is treated as an original,\n * unmodified source file.\n *\n * Pass `excludeContent` to exclude any self-containing source file content\n * from the output sourcemap.\n *\n * Pass `decodedMappings` to receive a SourceMap with decoded (instead of\n * VLQ encoded) mappings.\n */\nexport default function remapping(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader,\n options?: boolean | Options\n): SourceMap {\n const opts =\n typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}\n"],"names":[],"mappings":";;;AAgCA,MAAM,kBAAkB,mBAAmB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACtF,MAAM,aAAa,GAAc,EAAE,CAAC;AAEpC,SAAS,aAAa,CACpB,MAAc,EACd,IAAY,EACZ,MAAc,EACd,IAAY,EACZ,OAAsB,EACtB,MAAe,EAAA;AAEf,IAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACzD,CAAC;AAgBD,SAAS,MAAM,CACb,GAAoB,EACpB,OAAkB,EAClB,MAAmB,EACnB,OAAsB,EACtB,MAAe,EAAA;IAEf,OAAO;QACL,GAAG;QACH,OAAO;QACP,MAAM;QACN,OAAO;QACP,MAAM;KACA,CAAC;AACX,CAAC;AAED;;;AAGG;AACa,SAAA,SAAS,CAAC,GAAa,EAAE,OAA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AChG,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/node_modules/@ampproject/remapping/dist/remapping.umd.js b/node_modules/@ampproject/remapping/dist/remapping.umd.js new file mode 100644 index 00000000..6b7b3bb5 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.umd.js @@ -0,0 +1,202 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@jridgewell/trace-mapping'), require('@jridgewell/gen-mapping')) : + typeof define === 'function' && define.amd ? define(['@jridgewell/trace-mapping', '@jridgewell/gen-mapping'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remapping = factory(global.traceMapping, global.genMapping)); +})(this, (function (traceMapping, genMapping) { 'use strict'; + + const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); + const EMPTY_SOURCES = []; + function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; + } + function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore, + }; + } + /** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ + function MapSource(map, sources) { + return Source(map, sources, '', null, false); + } + /** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ + function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); + } + /** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ + function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new genMapping.GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = traceMapping.decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source, ignore } = traced; + genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + genMapping.setSourceContent(gen, source, content); + if (ignore) + genMapping.setIgnore(gen, source, true); + } + } + return gen; + } + /** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ + function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = traceMapping.traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); + } + + function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; + } + /** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ + function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?'); + } + } + let tree = build(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; + } + function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + ignore: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); + } + + /** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ + class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } + } + + /** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ + function remapping(input, loader, options) { + const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); + } + + return remapping; + +})); +//# sourceMappingURL=remapping.umd.js.map diff --git a/node_modules/@ampproject/remapping/dist/remapping.umd.js.map b/node_modules/@ampproject/remapping/dist/remapping.umd.js.map new file mode 100644 index 00000000..d3f0f87d --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.umd.js","sources":["../src/source-map-tree.ts","../src/build-source-map-tree.ts","../src/source-map.ts","../src/remapping.ts"],"sourcesContent":["import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping';\nimport { traceSegment, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport type { TraceMap } from '@jridgewell/trace-mapping';\n\nexport type SourceMapSegmentObject = {\n column: number;\n line: number;\n name: string;\n source: string;\n content: string | null;\n ignore: boolean;\n};\n\nexport type OriginalSource = {\n map: null;\n sources: Sources[];\n source: string;\n content: string | null;\n ignore: boolean;\n};\n\nexport type MapSource = {\n map: TraceMap;\n sources: Sources[];\n source: string;\n content: null;\n ignore: false;\n};\n\nexport type Sources = OriginalSource | MapSource;\n\nconst SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);\nconst EMPTY_SOURCES: Sources[] = [];\n\nfunction SegmentObject(\n source: string,\n line: number,\n column: number,\n name: string,\n content: string | null,\n ignore: boolean\n): SourceMapSegmentObject {\n return { source, line, column, name, content, ignore };\n}\n\nfunction Source(\n map: TraceMap,\n sources: Sources[],\n source: '',\n content: null,\n ignore: false\n): MapSource;\nfunction Source(\n map: null,\n sources: Sources[],\n source: string,\n content: string | null,\n ignore: boolean\n): OriginalSource;\nfunction Source(\n map: TraceMap | null,\n sources: Sources[],\n source: string | '',\n content: string | null,\n ignore: boolean\n): Sources {\n return {\n map,\n sources,\n source,\n content,\n ignore,\n } as any;\n}\n\n/**\n * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes\n * (which may themselves be SourceMapTrees).\n */\nexport function MapSource(map: TraceMap, sources: Sources[]): MapSource {\n return Source(map, sources, '', null, false);\n}\n\n/**\n * A \"leaf\" node in the sourcemap tree, representing an original, unmodified source file. Recursive\n * segment tracing ends at the `OriginalSource`.\n */\nexport function OriginalSource(\n source: string,\n content: string | null,\n ignore: boolean\n): OriginalSource {\n return Source(null, EMPTY_SOURCES, source, content, ignore);\n}\n\n/**\n * traceMappings is only called on the root level SourceMapTree, and begins the process of\n * resolving each mapping in terms of the original source files.\n */\nexport function traceMappings(tree: MapSource): GenMapping {\n // TODO: Eventually support sourceRoot, which has to be removed because the sources are already\n // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.\n const gen = new GenMapping({ file: tree.map.file });\n const { sources: rootSources, map } = tree;\n const rootNames = map.names;\n const rootMappings = decodedMappings(map);\n\n for (let i = 0; i < rootMappings.length; i++) {\n const segments = rootMappings[i];\n\n for (let j = 0; j < segments.length; j++) {\n const segment = segments[j];\n const genCol = segment[0];\n let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING;\n\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length !== 1) {\n const source = rootSources[segment[1]];\n traced = originalPositionFor(\n source,\n segment[2],\n segment[3],\n segment.length === 5 ? rootNames[segment[4]] : ''\n );\n\n // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a\n // respective segment into an original source.\n if (traced == null) continue;\n }\n\n const { column, line, name, content, source, ignore } = traced;\n\n maybeAddSegment(gen, i, genCol, source, line, column, name);\n if (source && content != null) setSourceContent(gen, source, content);\n if (ignore) setIgnore(gen, source, true);\n }\n }\n\n return gen;\n}\n\n/**\n * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own\n * child SourceMapTrees, until we find the original source map.\n */\nexport function originalPositionFor(\n source: Sources,\n line: number,\n column: number,\n name: string\n): SourceMapSegmentObject | null {\n if (!source.map) {\n return SegmentObject(source.source, line, column, name, source.content, source.ignore);\n }\n\n const segment = traceSegment(source.map, line, column);\n\n // If we couldn't find a segment, then this doesn't exist in the sourcemap.\n if (segment == null) return null;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length === 1) return SOURCELESS_MAPPING;\n\n return originalPositionFor(\n source.sources[segment[1]],\n segment[2],\n segment[3],\n segment.length === 5 ? source.map.names[segment[4]] : name\n );\n}\n","import { TraceMap } from '@jridgewell/trace-mapping';\n\nimport { OriginalSource, MapSource } from './source-map-tree';\n\nimport type { Sources, MapSource as MapSourceType } from './source-map-tree';\nimport type { SourceMapInput, SourceMapLoader, LoaderContext } from './types';\n\nfunction asArray(value: T | T[]): T[] {\n if (Array.isArray(value)) return value;\n return [value];\n}\n\n/**\n * Recursively builds a tree structure out of sourcemap files, with each node\n * being either an `OriginalSource` \"leaf\" or a `SourceMapTree` composed of\n * `OriginalSource`s and `SourceMapTree`s.\n *\n * Every sourcemap is composed of a collection of source files and mappings\n * into locations of those source files. When we generate a `SourceMapTree` for\n * the sourcemap, we attempt to load each source file's own sourcemap. If it\n * does not have an associated sourcemap, it is considered an original,\n * unmodified source file.\n */\nexport default function buildSourceMapTree(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader\n): MapSourceType {\n const maps = asArray(input).map((m) => new TraceMap(m, ''));\n const map = maps.pop()!;\n\n for (let i = 0; i < maps.length; i++) {\n if (maps[i].sources.length > 1) {\n throw new Error(\n `Transformation map ${i} must have exactly one source file.\\n` +\n 'Did you specify these with the most recent transformation maps first?'\n );\n }\n }\n\n let tree = build(map, loader, '', 0);\n for (let i = maps.length - 1; i >= 0; i--) {\n tree = MapSource(maps[i], [tree]);\n }\n return tree;\n}\n\nfunction build(\n map: TraceMap,\n loader: SourceMapLoader,\n importer: string,\n importerDepth: number\n): MapSourceType {\n const { resolvedSources, sourcesContent, ignoreList } = map;\n\n const depth = importerDepth + 1;\n const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => {\n // The loading context gives the loader more information about why this file is being loaded\n // (eg, from which importer). It also allows the loader to override the location of the loaded\n // sourcemap/original source, or to override the content in the sourcesContent field if it's\n // an unmodified source file.\n const ctx: LoaderContext = {\n importer,\n depth,\n source: sourceFile || '',\n content: undefined,\n ignore: undefined,\n };\n\n // Use the provided loader callback to retrieve the file's sourcemap.\n // TODO: We should eventually support async loading of sourcemap files.\n const sourceMap = loader(ctx.source, ctx);\n\n const { source, content, ignore } = ctx;\n\n // If there is a sourcemap, then we need to recurse into it to load its source files.\n if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);\n\n // Else, it's an unmodified source file.\n // The contents of this unmodified source file can be overridden via the loader context,\n // allowing it to be explicitly null or a string. If it remains undefined, we fall back to\n // the importing sourcemap's `sourcesContent` field.\n const sourceContent =\n content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;\n const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;\n return OriginalSource(source, sourceContent, ignored);\n });\n\n return MapSource(map, children);\n}\n","import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';\n\nimport type { GenMapping } from '@jridgewell/gen-mapping';\nimport type { DecodedSourceMap, EncodedSourceMap, Options } from './types';\n\n/**\n * A SourceMap v3 compatible sourcemap, which only includes fields that were\n * provided to it.\n */\nexport default class SourceMap {\n declare file?: string | null;\n declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];\n declare sourceRoot?: string;\n declare names: string[];\n declare sources: (string | null)[];\n declare sourcesContent?: (string | null)[];\n declare version: 3;\n declare ignoreList: number[] | undefined;\n\n constructor(map: GenMapping, options: Options) {\n const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);\n this.version = out.version; // SourceMap spec says this should be first.\n this.file = out.file;\n this.mappings = out.mappings as SourceMap['mappings'];\n this.names = out.names as SourceMap['names'];\n this.ignoreList = out.ignoreList as SourceMap['ignoreList'];\n this.sourceRoot = out.sourceRoot;\n\n this.sources = out.sources as SourceMap['sources'];\n if (!options.excludeContent) {\n this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];\n }\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n}\n","import buildSourceMapTree from './build-source-map-tree';\nimport { traceMappings } from './source-map-tree';\nimport SourceMap from './source-map';\n\nimport type { SourceMapInput, SourceMapLoader, Options } from './types';\nexport type {\n SourceMapSegment,\n EncodedSourceMap,\n EncodedSourceMap as RawSourceMap,\n DecodedSourceMap,\n SourceMapInput,\n SourceMapLoader,\n LoaderContext,\n Options,\n} from './types';\nexport type { SourceMap };\n\n/**\n * Traces through all the mappings in the root sourcemap, through the sources\n * (and their sourcemaps), all the way back to the original source location.\n *\n * `loader` will be called every time we encounter a source file. If it returns\n * a sourcemap, we will recurse into that sourcemap to continue the trace. If\n * it returns a falsey value, that source file is treated as an original,\n * unmodified source file.\n *\n * Pass `excludeContent` to exclude any self-containing source file content\n * from the output sourcemap.\n *\n * Pass `decodedMappings` to receive a SourceMap with decoded (instead of\n * VLQ encoded) mappings.\n */\nexport default function remapping(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader,\n options?: boolean | Options\n): SourceMap {\n const opts =\n typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}\n"],"names":["GenMapping","decodedMappings","maybeAddSegment","setSourceContent","setIgnore","traceSegment","TraceMap","toDecodedMap","toEncodedMap"],"mappings":";;;;;;IAgCA,MAAM,kBAAkB,mBAAmB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,E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AAG,GAAG,CAAC,UAAU,CAAC;IAEjC,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAA+B,CAAC;IACnD,QAAA,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;IAC3B,YAAA,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC,cAA6C,CAAC;IACzE,SAAA;SACF;QAED,QAAQ,GAAA;IACN,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;SAC7B;IACF;;ICpBD;;;;;;;;;;;;;;IAcG;IACqB,SAAA,SAAS,CAC/B,KAAwC,EACxC,MAAuB,EACvB,OAA2B,EAAA;QAE3B,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;QAChG,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAClD;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts b/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts new file mode 100644 index 00000000..f87fceab --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts @@ -0,0 +1,14 @@ +import type { MapSource as MapSourceType } from './source-map-tree'; +import type { SourceMapInput, SourceMapLoader } from './types'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; diff --git a/node_modules/@ampproject/remapping/dist/types/remapping.d.ts b/node_modules/@ampproject/remapping/dist/types/remapping.d.ts new file mode 100644 index 00000000..771fe307 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/remapping.d.ts @@ -0,0 +1,20 @@ +import SourceMap from './source-map'; +import type { SourceMapInput, SourceMapLoader, Options } from './types'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types'; +export type { SourceMap }; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; diff --git a/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts b/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts new file mode 100644 index 00000000..935bc698 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts @@ -0,0 +1,45 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export declare type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; +export declare type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; +export declare type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; +export declare type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; diff --git a/node_modules/@ampproject/remapping/dist/types/source-map.d.ts b/node_modules/@ampproject/remapping/dist/types/source-map.d.ts new file mode 100644 index 00000000..cbd7f0af --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/source-map.d.ts @@ -0,0 +1,18 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList: number[] | undefined; + constructor(map: GenMapping, options: Options); + toString(): string; +} diff --git a/node_modules/@ampproject/remapping/dist/types/types.d.ts b/node_modules/@ampproject/remapping/dist/types/types.d.ts new file mode 100644 index 00000000..4d78c4bc --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/types.d.ts @@ -0,0 +1,15 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export declare type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; +export declare type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export declare type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; diff --git a/node_modules/@ampproject/remapping/package.json b/node_modules/@ampproject/remapping/package.json new file mode 100644 index 00000000..091224c6 --- /dev/null +++ b/node_modules/@ampproject/remapping/package.json @@ -0,0 +1,75 @@ +{ + "name": "@ampproject/remapping", + "version": "2.3.0", + "description": "Remap sequential sourcemaps through transformations to point at the original source code", + "keywords": [ + "source", + "map", + "remap" + ], + "main": "dist/remapping.umd.js", + "module": "dist/remapping.mjs", + "types": "dist/types/remapping.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/remapping.d.ts", + "browser": "./dist/remapping.umd.js", + "require": "./dist/remapping.umd.js", + "import": "./dist/remapping.mjs" + }, + "./dist/remapping.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "author": "Justin Ridgewell ", + "repository": { + "type": "git", + "url": "git+https://github.com/ampproject/remapping.git" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "test": "run-s -n test:lint test:only", + "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "jest --coverage", + "test:watch": "jest --coverage --watch" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.2", + "@types/jest": "27.4.1", + "@typescript-eslint/eslint-plugin": "5.20.0", + "@typescript-eslint/parser": "5.20.0", + "eslint": "8.14.0", + "eslint-config-prettier": "8.5.0", + "jest": "27.5.1", + "jest-config": "27.5.1", + "npm-run-all": "4.1.5", + "prettier": "2.6.2", + "rollup": "2.70.2", + "ts-jest": "27.1.4", + "tslib": "2.4.0", + "typescript": "4.6.3" + }, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } +} diff --git a/node_modules/@asamuzakjp/css-color/LICENSE b/node_modules/@asamuzakjp/css-color/LICENSE new file mode 100644 index 00000000..5ed027bd --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 asamuzaK (Kazz) + +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/node_modules/@asamuzakjp/css-color/README.md b/node_modules/@asamuzakjp/css-color/README.md new file mode 100644 index 00000000..0f964019 --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/README.md @@ -0,0 +1,316 @@ +# CSS color + +[![build](https://github.com/asamuzaK/cssColor/actions/workflows/node.js.yml/badge.svg)](https://github.com/asamuzaK/cssColor/actions/workflows/node.js.yml) +[![CodeQL](https://github.com/asamuzaK/cssColor/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/asamuzaK/cssColor/actions/workflows/github-code-scanning/codeql) +[![npm (scoped)](https://img.shields.io/npm/v/@asamuzakjp/css-color)](https://www.npmjs.com/package/@asamuzakjp/css-color) + +Resolve and convert CSS colors. + +## Install + +```console +npm i @asamuzakjp/css-color +``` + +## Usage + +```javascript +import { convert, resolve, utils } from '@asamuzakjp/css-color'; + +const resolvedValue = resolve( + 'color-mix(in oklab, lch(67.5345 42.5 258.2), color(srgb 0 0.5 0))' +); +// 'oklab(0.620754 -0.0931934 -0.00374881)' + +const convertedValue = covert.colorToHex('lab(46.2775% -47.5621 48.5837)'); +// '#008000' + +const result = utils.isColor('green'); +// true +``` + + + +### resolve(color, opt) + +resolves CSS color + +#### Parameters + +- `color` **[string][133]** color value + - system colors are not supported +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.currentColor` **[string][133]?** + - color to use for `currentcolor` keyword + - if omitted, it will be treated as a missing color, + i.e. `rgb(none none none / none)` + - `opt.customProperty` **[object][135]?** + - custom properties + - pair of `--` prefixed property name as a key and it's value, + e.g. + ```javascript + const opt = { + customProperty: { + '--some-color': '#008000', + '--some-length': '16px' + } + }; + ``` + - and/or `callback` function to get the value of the custom property, + e.g. + ```javascript + const node = document.getElementById('foo'); + const opt = { + customProperty: { + callback: node.style.getPropertyValue + } + }; + ``` + - `opt.dimension` **[object][135]?** + - dimension, e.g. for converting relative length to pixels + - pair of unit as a key and number in pixels as it's value, + e.g. suppose `1em === 12px`, `1rem === 16px` and `100vw === 1024px`, then + ```javascript + const opt = { + dimension: { + em: 12, + rem: 16, + vw: 10.24 + } + }; + ``` + - and/or `callback` function to get the value as a number in pixels, + e.g. + ```javascript + const opt = { + dimension: { + callback: unit => { + switch (unit) { + case 'em': + return 12; + case 'rem': + return 16; + case 'vw': + return 10.24; + default: + return; + } + } + } + }; + ``` + - `opt.format` **[string][133]?** + - output format, one of below + - `computedValue` (default), [computed value][139] of the color + - `specifiedValue`, [specified value][140] of the color + - `hex`, hex color notation, i.e. `#rrggbb` + - `hexAlpha`, hex color notation with alpha channel, i.e. `#rrggbbaa` + +Returns **[string][133]?** one of `rgba?()`, `#rrggbb(aa)?`, `color-name`, `color(color-space r g b / alpha)`, `color(color-space x y z / alpha)`, `(ok)?lab(l a b / alpha)`, `(ok)?lch(l c h / alpha)`, `'(empty-string)'`, `null` + +- in `computedValue`, values are numbers, however `rgb()` values are integers +- in `specifiedValue`, returns `empty string` for unknown and/or invalid color +- in `hex`, returns `null` for `transparent`, and also returns `null` if any of `r`, `g`, `b`, `alpha` is not a number +- in `hexAlpha`, returns `#00000000` for `transparent`, however returns `null` if any of `r`, `g`, `b`, `alpha` is not a number + +### convert + +Contains various color conversion functions. + +### convert.numberToHex(value) + +convert number to hex string + +#### Parameters + +- `value` **[number][134]** color value + +Returns **[string][133]** hex string: 00..ff + +### convert.colorToHex(value, opt) + +convert color to hex + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.alpha` **[boolean][136]?** return in #rrggbbaa notation + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[string][133]** #rrggbb(aa)? + +### convert.colorToHsl(value, opt) + +convert color to hsl + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[h, s, l, alpha] + +### convert.colorToHwb(value, opt) + +convert color to hwb + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[h, w, b, alpha] + +### convert.colorToLab(value, opt) + +convert color to lab + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, a, b, alpha] + +### convert.colorToLch(value, opt) + +convert color to lch + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, c, h, alpha] + +### convert.colorToOklab(value, opt) + +convert color to oklab + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, a, b, alpha] + +### convert.colorToOklch(value, opt) + +convert color to oklch + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[l, c, h, alpha] + +### convert.colorToRgb(value, opt) + +convert color to rgb + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[r, g, b, alpha] + +### convert.colorToXyz(value, opt) + +convert color to xyz + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + - `opt.d50` **[boolean][136]?** xyz in d50 white point + +Returns **[Array][137]<[number][134]>** \[x, y, z, alpha] + +### convert.colorToXyzD50(value, opt) + +convert color to xyz-d50 + +#### Parameters + +- `value` **[string][133]** color value +- `opt` **[object][135]?** options (optional, default `{}`) + - `opt.customProperty` **[object][135]?** + - custom properties, see `resolve()` function above + - `opt.dimension` **[object][135]?** + - dimension, see `resolve()` function above + +Returns **[Array][137]<[number][134]>** \[x, y, z, alpha] + +### utils + +Contains utility functions. + +### utils.isColor(color) + +is valid color type + +#### Parameters + +- `color` **[string][133]** color value + - system colors are not supported + +Returns **[boolean][136]** + +## Acknowledgments + +The following resources have been of great help in the development of the CSS color. + +- [csstools/postcss-plugins](https://github.com/csstools/postcss-plugins) +- [lru-cache](https://github.com/isaacs/node-lru-cache) + +--- + +Copyright (c) 2024 [asamuzaK (Kazz)](https://github.com/asamuzaK/) + +[133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[134]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[135]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[136]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[137]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[138]: https://w3c.github.io/csswg-drafts/css-color-4/#color-conversion-code +[139]: https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value +[140]: https://developer.mozilla.org/en-US/docs/Web/CSS/specified_value +[141]: https://www.npmjs.com/package/@csstools/css-calc diff --git a/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js b/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js new file mode 100644 index 00000000..10726cbf --- /dev/null +++ b/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js @@ -0,0 +1,220 @@ +var al=Object.defineProperty,to=t=>{throw TypeError(t)},ol=(t,e,n)=>e in t?al(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K=(t,e,n)=>ol(t,typeof e!="symbol"?e+"":e,n),Hs=(t,e,n)=>e.has(t)||to("Cannot "+n),u=(t,e,n)=>(Hs(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?to("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),C=(t,e,n,r)=>(Hs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),I=(t,e,n)=>(Hs(t,e,"access private method"),n),Us=(t,e,n,r)=>({set _(s){C(t,e,s,n)},get _(){return u(t,e,r)}});class dr extends Error{constructor(e,n,r,s){super(e),K(this,"sourceStart"),K(this,"sourceEnd"),K(this,"parserState"),this.name="ParseError",this.sourceStart=n,this.sourceEnd=r,this.parserState=s}}class an extends dr{constructor(e,n,r,s,a){super(e,n,r,s),K(this,"token"),this.token=a}}const qe={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'};function Ve(...t){let e="";for(let n=0;n=48&&t<=57}function ll(t){return t>=65&&t<=90}function cl(t){return t>=97&&t<=122}function bn(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function ul(t){return cl(t)||ll(t)}function On(t){return ul(t)||hl(t)||t===95}function zs(t){return On(t)||ne(t)||t===St}function hl(t){return t===183||t===8204||t===8205||t===8255||t===8256||t===8204||192<=t&&t<=214||216<=t&&t<=246||248<=t&&t<=893||895<=t&&t<=8191||8304<=t&&t<=8591||11264<=t&&t<=12271||12289<=t&&t<=55295||63744<=t&&t<=64975||65008<=t&&t<=65533||t===0||!!Wn(t)||t>=65536}function Xr(t){return t===Dn||t===Mn||t===12}function wn(t){return t===32||t===Dn||t===9||t===Mn||t===12}function Wn(t){return t>=55296&&t<=57343}function Tn(t){return t.source.codePointAt(t.cursor)===92&&!Xr(t.source.codePointAt(t.cursor+1)??-1)}function Yr(t,e){return e.source.codePointAt(e.cursor)===St?e.source.codePointAt(e.cursor+1)===St||!!On(e.source.codePointAt(e.cursor+1)??-1)||e.source.codePointAt(e.cursor+1)===92&&!Xr(e.source.codePointAt(e.cursor+2)??-1):!!On(e.source.codePointAt(e.cursor)??-1)||Tn(e)}function eo(t){return t.source.codePointAt(t.cursor)===Bn||t.source.codePointAt(t.cursor)===St?!!ne(t.source.codePointAt(t.cursor+1)??-1)||t.source.codePointAt(t.cursor+1)===46&&ne(t.source.codePointAt(t.cursor+2)??-1):t.source.codePointAt(t.cursor)===46?ne(t.source.codePointAt(t.cursor+1)??-1):ne(t.source.codePointAt(t.cursor)??-1)}function fl(t){return t.source.codePointAt(t.cursor)===47&&t.source.codePointAt(t.cursor+1)===42}function pl(t){return t.source.codePointAt(t.cursor)===St&&t.source.codePointAt(t.cursor+1)===St&&t.source.codePointAt(t.cursor+2)===62}var v,x,Zr;function dl(t){switch(t){case v.OpenParen:return v.CloseParen;case v.CloseParen:return v.OpenParen;case v.OpenCurly:return v.CloseCurly;case v.CloseCurly:return v.OpenCurly;case v.OpenSquare:return v.CloseSquare;case v.CloseSquare:return v.OpenSquare;default:return null}}function ml(t){switch(t[0]){case v.OpenParen:return[v.CloseParen,")",-1,-1,void 0];case v.CloseParen:return[v.OpenParen,"(",-1,-1,void 0];case v.OpenCurly:return[v.CloseCurly,"}",-1,-1,void 0];case v.CloseCurly:return[v.OpenCurly,"{",-1,-1,void 0];case v.OpenSquare:return[v.CloseSquare,"]",-1,-1,void 0];case v.CloseSquare:return[v.OpenSquare,"[",-1,-1,void 0];default:return null}}function gl(t,e){for(e.advanceCodePoint(2);;){const n=e.readCodePoint();if(n===void 0){const r=[v.Comment,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedEOFInComment,e.representationStart,e.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],r)),r}if(n===42&&e.source.codePointAt(e.cursor)!==void 0&&e.source.codePointAt(e.cursor)===47){e.advanceCodePoint();break}}return[v.Comment,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function Jr(t,e){const n=e.readCodePoint();if(n===void 0)return t.onParseError(new dr(qe.UnexpectedEOFInEscapedCodePoint,e.representationStart,e.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),Rn;if(bn(n)){const r=[n];let s;for(;(s=e.source.codePointAt(e.cursor))!==void 0&&bn(s)&&r.length<6;)r.push(s),e.advanceCodePoint();wn(e.source.codePointAt(e.cursor)??-1)&&(e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn&&e.advanceCodePoint(),e.advanceCodePoint());const a=parseInt(String.fromCodePoint(...r),16);return a===0||Wn(a)||a>1114111?Rn:a}return n===0||Wn(n)?Rn:n}function Qr(t,e){const n=[];for(;;){const r=e.source.codePointAt(e.cursor)??-1;if(r===0||Wn(r))n.push(Rn),e.advanceCodePoint(+(r>65535)+1);else if(zs(r))n.push(r),e.advanceCodePoint(+(r>65535)+1);else{if(!Tn(e))return n;e.advanceCodePoint(),n.push(Jr(t,e))}}}function vl(t,e){e.advanceCodePoint();const n=e.source.codePointAt(e.cursor);if(n!==void 0&&(zs(n)||Tn(e))){let r=Zr.Unrestricted;Yr(0,e)&&(r=Zr.ID);const s=Qr(t,e);return[v.Hash,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...s),type:r}]}return[v.Delim,"#",e.representationStart,e.representationEnd,{value:"#"}]}function bl(t,e){let n=x.Integer;for(e.source.codePointAt(e.cursor)!==Bn&&e.source.codePointAt(e.cursor)!==St||e.advanceCodePoint();ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===46&&ne(e.source.codePointAt(e.cursor+1)??-1))for(e.advanceCodePoint(2),n=x.Number;ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===101||e.source.codePointAt(e.cursor)===69){if(ne(e.source.codePointAt(e.cursor+1)??-1))e.advanceCodePoint(2);else{if(e.source.codePointAt(e.cursor+1)!==St&&e.source.codePointAt(e.cursor+1)!==Bn||!ne(e.source.codePointAt(e.cursor+2)??-1))return n;e.advanceCodePoint(3)}for(n=x.Number;ne(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint()}return n}function js(t,e){let n;{const a=e.source.codePointAt(e.cursor);a===St?n="-":a===Bn&&(n="+")}const r=bl(0,e),s=parseFloat(e.source.slice(e.representationStart,e.representationEnd+1));if(Yr(0,e)){const a=Qr(t,e);return[v.Dimension,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n,type:r,unit:String.fromCodePoint(...a)}]}return e.source.codePointAt(e.cursor)===37?(e.advanceCodePoint(),[v.Percentage,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n}]):[v.Number,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:s,signCharacter:n,type:r}]}function wl(t){for(;wn(t.source.codePointAt(t.cursor)??-1);)t.advanceCodePoint();return[v.Whitespace,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0]}(function(t){t.Comment="comment",t.AtKeyword="at-keyword-token",t.BadString="bad-string-token",t.BadURL="bad-url-token",t.CDC="CDC-token",t.CDO="CDO-token",t.Colon="colon-token",t.Comma="comma-token",t.Delim="delim-token",t.Dimension="dimension-token",t.EOF="EOF-token",t.Function="function-token",t.Hash="hash-token",t.Ident="ident-token",t.Number="number-token",t.Percentage="percentage-token",t.Semicolon="semicolon-token",t.String="string-token",t.URL="url-token",t.Whitespace="whitespace-token",t.OpenParen="(-token",t.CloseParen=")-token",t.OpenSquare="[-token",t.CloseSquare="]-token",t.OpenCurly="{-token",t.CloseCurly="}-token",t.UnicodeRange="unicode-range-token"})(v||(v={})),function(t){t.Integer="integer",t.Number="number"}(x||(x={})),function(t){t.Unrestricted="unrestricted",t.ID="id"}(Zr||(Zr={}));class $l{constructor(e){K(this,"cursor",0),K(this,"source",""),K(this,"representationStart",0),K(this,"representationEnd",-1),this.source=e}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.cursor-1}readCodePoint(){const e=this.source.codePointAt(this.cursor);if(e!==void 0)return this.cursor=this.cursor+1,this.representationEnd=this.cursor-1,e}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.cursor-1}resetRepresentation(){this.representationStart=this.cursor,this.representationEnd=-1}}function yl(t,e){let n="";const r=e.readCodePoint();for(;;){const s=e.readCodePoint();if(s===void 0){const a=[v.String,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInString,e.representationStart,e.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],a)),a}if(Xr(s)){e.unreadCodePoint();const a=[v.BadString,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedNewLineInString,e.representationStart,e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn?e.representationEnd+2:e.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],a)),a}if(s===r)return[v.String,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];if(s!==92)s===0||Wn(s)?n+=String.fromCodePoint(Rn):n+=String.fromCodePoint(s);else{if(e.source.codePointAt(e.cursor)===void 0)continue;if(Xr(e.source.codePointAt(e.cursor)??-1)){e.source.codePointAt(e.cursor)===Mn&&e.source.codePointAt(e.cursor+1)===Dn&&e.advanceCodePoint(),e.advanceCodePoint();continue}n+=String.fromCodePoint(Jr(t,e))}}}function Nl(t){return!(t.length!==3||t[0]!==117&&t[0]!==85||t[1]!==114&&t[1]!==82||t[2]!==108&&t[2]!==76)}function Gs(t,e){for(;;){const n=e.source.codePointAt(e.cursor);if(n===void 0)return;if(n===41)return void e.advanceCodePoint();Tn(e)?(e.advanceCodePoint(),Jr(t,e)):e.advanceCodePoint()}}function El(t,e){for(;wn(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();let n="";for(;;){if(e.source.codePointAt(e.cursor)===void 0){const a=[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],a)),a}if(e.source.codePointAt(e.cursor)===41)return e.advanceCodePoint(),[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];if(wn(e.source.codePointAt(e.cursor)??-1)){for(e.advanceCodePoint();wn(e.source.codePointAt(e.cursor)??-1);)e.advanceCodePoint();if(e.source.codePointAt(e.cursor)===void 0){const a=[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}];return t.onParseError(new an(qe.UnexpectedEOFInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],a)),a}return e.source.codePointAt(e.cursor)===41?(e.advanceCodePoint(),[v.URL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:n}]):(Gs(t,e),[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0])}const s=e.source.codePointAt(e.cursor);if(s===34||s===39||s===40||(r=s??-1)===11||r===127||0<=r&&r<=8||14<=r&&r<=31){Gs(t,e);const a=[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.UnexpectedCharacterInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token",`Unexpected U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point`],a)),a}if(s===92){if(Tn(e)){e.advanceCodePoint(),n+=String.fromCodePoint(Jr(t,e));continue}Gs(t,e);const a=[v.BadURL,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0];return t.onParseError(new an(qe.InvalidEscapeSequenceInURL,e.representationStart,e.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],a)),a}e.source.codePointAt(e.cursor)===0||Wn(e.source.codePointAt(e.cursor)??-1)?(n+=String.fromCodePoint(Rn),e.advanceCodePoint()):(n+=e.source[e.cursor],e.advanceCodePoint())}var r}function qs(t,e){const n=Qr(t,e);if(e.source.codePointAt(e.cursor)!==40)return[v.Ident,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}];if(Nl(n)){e.advanceCodePoint();let r=0;for(;;){const s=wn(e.source.codePointAt(e.cursor)??-1),a=wn(e.source.codePointAt(e.cursor+1)??-1);if(s&&a){r+=1,e.advanceCodePoint(1);continue}const o=s?e.source.codePointAt(e.cursor+1):e.source.codePointAt(e.cursor);if(o===34||o===39)return r>0&&e.unreadCodePoint(r),[v.Function,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}];break}return El(t,e)}return e.advanceCodePoint(),[v.Function,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{value:String.fromCodePoint(...n)}]}function Cl(t){return!(t.source.codePointAt(t.cursor)!==117&&t.source.codePointAt(t.cursor)!==85||t.source.codePointAt(t.cursor+1)!==Bn||t.source.codePointAt(t.cursor+2)!==63&&!bn(t.source.codePointAt(t.cursor+2)??-1))}function kl(t,e){e.advanceCodePoint(2);const n=[],r=[];let s;for(;(s=e.source.codePointAt(e.cursor))!==void 0&&n.length<6&&bn(s);)n.push(s),e.advanceCodePoint();for(;(s=e.source.codePointAt(e.cursor))!==void 0&&n.length<6&&s===63;)r.length===0&&r.push(...n),n.push(48),r.push(70),e.advanceCodePoint();if(!r.length&&e.source.codePointAt(e.cursor)===St&&bn(e.source.codePointAt(e.cursor+1)??-1))for(e.advanceCodePoint();(s=e.source.codePointAt(e.cursor))!==void 0&&r.length<6&&bn(s);)r.push(s),e.advanceCodePoint();if(!r.length){const i=parseInt(String.fromCodePoint(...n),16);return[v.UnicodeRange,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{startOfRange:i,endOfRange:i}]}const a=parseInt(String.fromCodePoint(...n),16),o=parseInt(String.fromCodePoint(...r),16);return[v.UnicodeRange,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,{startOfRange:a,endOfRange:o}]}function Ke(t,e){const n=no(t),r=[];for(;!n.endOfFile();)r.push(n.nextToken());return r.push(n.nextToken()),r}function no(t,e){const n=t.css.valueOf(),r=t.unicodeRangesAllowed??!1,s=new $l(n),a={onParseError:Fl};return{nextToken:function(){s.resetRepresentation();const o=s.source.codePointAt(s.cursor);if(o===void 0)return[v.EOF,"",-1,-1,void 0];if(o===47&&fl(s))return gl(a,s);if(r&&(o===117||o===85)&&Cl(s))return kl(0,s);if(On(o))return qs(a,s);if(ne(o))return js(a,s);switch(o){case 44:return s.advanceCodePoint(),[v.Comma,",",s.representationStart,s.representationEnd,void 0];case 58:return s.advanceCodePoint(),[v.Colon,":",s.representationStart,s.representationEnd,void 0];case 59:return s.advanceCodePoint(),[v.Semicolon,";",s.representationStart,s.representationEnd,void 0];case 40:return s.advanceCodePoint(),[v.OpenParen,"(",s.representationStart,s.representationEnd,void 0];case 41:return s.advanceCodePoint(),[v.CloseParen,")",s.representationStart,s.representationEnd,void 0];case 91:return s.advanceCodePoint(),[v.OpenSquare,"[",s.representationStart,s.representationEnd,void 0];case 93:return s.advanceCodePoint(),[v.CloseSquare,"]",s.representationStart,s.representationEnd,void 0];case 123:return s.advanceCodePoint(),[v.OpenCurly,"{",s.representationStart,s.representationEnd,void 0];case 125:return s.advanceCodePoint(),[v.CloseCurly,"}",s.representationStart,s.representationEnd,void 0];case 39:case 34:return yl(a,s);case 35:return vl(a,s);case Bn:case 46:return eo(s)?js(a,s):(s.advanceCodePoint(),[v.Delim,s.source[s.representationStart],s.representationStart,s.representationEnd,{value:s.source[s.representationStart]}]);case Dn:case Mn:case 12:case 9:case 32:return wl(s);case St:return eo(s)?js(a,s):pl(s)?(s.advanceCodePoint(3),[v.CDC,"-->",s.representationStart,s.representationEnd,void 0]):Yr(0,s)?qs(a,s):(s.advanceCodePoint(),[v.Delim,"-",s.representationStart,s.representationEnd,{value:"-"}]);case 60:return il(s)?(s.advanceCodePoint(4),[v.CDO,"\n // class Foo {} export { Foo as default }\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.splitExportDeclaration ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.splitExportDeclaration;\n }\n path.splitExportDeclaration();\n } else {\n // @ts-expect-error Anonymous class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAMA,IAAAO,WAAA,GAAAP,OAAA;AAIA,MAAMQ,UAAU,GAAG,sCAAsC;AAYlD,SAASC,wBAAwBA,CAAC;EACvCC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,iBAAiB;EACjBC,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;gBAE/D,CAAAA,qBAAA,GAAAzE,IAAI,CAAC0E,sBAAsB,YAAAD,qBAAA,GAA3BzE,IAAI,CAAC0E,sBAAsB,GAEzBxH,OAAO,CAAC,iBAAiB,CAAC,CAACiF,QAAQ,CAACC,SAAS,CAACsC,sBAAsB;cACxE;cACA1E,IAAI,CAAC0E,sBAAsB,CAAC,CAAC;YAC/B,CAAC,MAAM;cAGLF,IAAI,CAAC/D,IAAI,CAACkE,IAAI,GAAG,iBAAiB;YACpC;UACF;QACF;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js b/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js new file mode 100644 index 00000000..2fd33fe1 --- /dev/null +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js @@ -0,0 +1,136 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.extractComputedKeys = extractComputedKeys; +exports.injectInitialization = injectInitialization; +exports.memoiseComputedKey = memoiseComputedKey; +var _core = require("@babel/core"); +var _traverse = require("@babel/traverse"); +const findBareSupers = _traverse.visitors.environmentVisitor({ + Super(path) { + const { + node, + parentPath + } = path; + if (parentPath.isCallExpression({ + callee: node + })) { + this.push(parentPath); + } + } +}); +const referenceVisitor = { + "TSTypeAnnotation|TypeAnnotation"(path) { + path.skip(); + }, + ReferencedIdentifier(path, { + scope + }) { + if (scope.hasOwnBinding(path.node.name)) { + scope.rename(path.node.name); + path.skip(); + } + } +}; +function handleClassTDZ(path, state) { + if (state.classBinding && state.classBinding === path.scope.getBinding(path.node.name)) { + const classNameTDZError = state.file.addHelper("classNameTDZError"); + const throwNode = _core.types.callExpression(classNameTDZError, [_core.types.stringLiteral(path.node.name)]); + path.replaceWith(_core.types.sequenceExpression([throwNode, path.node])); + path.skip(); + } +} +const classFieldDefinitionEvaluationTDZVisitor = { + ReferencedIdentifier: handleClassTDZ, + "TSTypeAnnotation|TypeAnnotation"(path) { + path.skip(); + } +}; +function injectInitialization(path, constructor, nodes, renamer, lastReturnsThis) { + if (!nodes.length) return; + const isDerived = !!path.node.superClass; + if (!constructor) { + const newConstructor = _core.types.classMethod("constructor", _core.types.identifier("constructor"), [], _core.types.blockStatement([])); + if (isDerived) { + newConstructor.params = [_core.types.restElement(_core.types.identifier("args"))]; + newConstructor.body.body.push(_core.template.statement.ast`super(...args)`); + } + [constructor] = path.get("body").unshiftContainer("body", newConstructor); + } + if (renamer) { + renamer(referenceVisitor, { + scope: constructor.scope + }); + } + if (isDerived) { + const bareSupers = []; + constructor.traverse(findBareSupers, bareSupers); + let isFirst = true; + for (const bareSuper of bareSupers) { + if (isFirst) { + isFirst = false; + } else { + nodes = nodes.map(n => _core.types.cloneNode(n)); + } + if (!bareSuper.parentPath.isExpressionStatement()) { + const allNodes = [bareSuper.node, ...nodes.map(n => _core.types.toExpression(n))]; + if (!lastReturnsThis) allNodes.push(_core.types.thisExpression()); + bareSuper.replaceWith(_core.types.sequenceExpression(allNodes)); + } else { + bareSuper.insertAfter(nodes); + } + } + } else { + constructor.get("body").unshiftContainer("body", nodes); + } +} +function memoiseComputedKey(keyNode, scope, hint) { + const isUidReference = _core.types.isIdentifier(keyNode) && scope.hasUid(keyNode.name); + if (isUidReference) { + return; + } + const isMemoiseAssignment = _core.types.isAssignmentExpression(keyNode, { + operator: "=" + }) && _core.types.isIdentifier(keyNode.left) && scope.hasUid(keyNode.left.name); + if (isMemoiseAssignment) { + return _core.types.cloneNode(keyNode); + } else { + const ident = _core.types.identifier(hint); + scope.push({ + id: ident, + kind: "let" + }); + return _core.types.assignmentExpression("=", _core.types.cloneNode(ident), keyNode); + } +} +function extractComputedKeys(path, computedPaths, file) { + const { + scope + } = path; + const declarations = []; + const state = { + classBinding: path.node.id && scope.getBinding(path.node.id.name), + file + }; + for (const computedPath of computedPaths) { + const computedKey = computedPath.get("key"); + if (computedKey.isReferencedIdentifier()) { + handleClassTDZ(computedKey, state); + } else { + computedKey.traverse(classFieldDefinitionEvaluationTDZVisitor, state); + } + const computedNode = computedPath.node; + if (!computedKey.isConstantExpression()) { + const assignment = memoiseComputedKey(computedKey.node, scope, scope.generateUidBasedOnNode(computedKey.node)); + if (assignment) { + declarations.push(_core.types.expressionStatement(assignment)); + computedNode.key = _core.types.cloneNode(assignment.left); + } + } + } + return declarations; +} + +//# sourceMappingURL=misc.js.map diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js.map new file mode 100644 index 00000000..341ce2b4 --- /dev/null +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/misc.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","_traverse","findBareSupers","visitors","environmentVisitor","Super","path","node","parentPath","isCallExpression","callee","push","referenceVisitor","TSTypeAnnotation|TypeAnnotation","skip","ReferencedIdentifier","scope","hasOwnBinding","name","rename","handleClassTDZ","state","classBinding","getBinding","classNameTDZError","file","addHelper","throwNode","t","callExpression","stringLiteral","replaceWith","sequenceExpression","classFieldDefinitionEvaluationTDZVisitor","injectInitialization","constructor","nodes","renamer","lastReturnsThis","length","isDerived","superClass","newConstructor","classMethod","identifier","blockStatement","params","restElement","body","template","statement","ast","get","unshiftContainer","bareSupers","traverse","isFirst","bareSuper","map","n","cloneNode","isExpressionStatement","allNodes","toExpression","thisExpression","insertAfter","memoiseComputedKey","keyNode","hint","isUidReference","isIdentifier","hasUid","isMemoiseAssignment","isAssignmentExpression","operator","left","ident","id","kind","assignmentExpression","extractComputedKeys","computedPaths","declarations","computedPath","computedKey","isReferencedIdentifier","computedNode","isConstantExpression","assignment","generateUidBasedOnNode","expressionStatement","key"],"sources":["../src/misc.ts"],"sourcesContent":["import { template, types as t } from \"@babel/core\";\nimport type { File, NodePath, Scope, Visitor } from \"@babel/core\";\nimport { visitors } from \"@babel/traverse\";\n\nconst findBareSupers = visitors.environmentVisitor<\n NodePath[]\n>({\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n this.push(parentPath);\n }\n },\n});\n\nconst referenceVisitor: Visitor<{ scope: Scope }> = {\n \"TSTypeAnnotation|TypeAnnotation\"(\n path: NodePath,\n ) {\n path.skip();\n },\n\n ReferencedIdentifier(path: NodePath, { scope }) {\n if (scope.hasOwnBinding(path.node.name)) {\n scope.rename(path.node.name);\n path.skip();\n }\n },\n};\n\ntype HandleClassTDZState = {\n classBinding: Scope.Binding;\n file: File;\n};\n\nfunction handleClassTDZ(\n path: NodePath,\n state: HandleClassTDZState,\n) {\n if (\n state.classBinding &&\n state.classBinding === path.scope.getBinding(path.node.name)\n ) {\n const classNameTDZError = state.file.addHelper(\"classNameTDZError\");\n const throwNode = t.callExpression(classNameTDZError, [\n t.stringLiteral(path.node.name),\n ]);\n\n path.replaceWith(t.sequenceExpression([throwNode, path.node]));\n path.skip();\n }\n}\n\nconst classFieldDefinitionEvaluationTDZVisitor: Visitor = {\n ReferencedIdentifier: handleClassTDZ,\n \"TSTypeAnnotation|TypeAnnotation\"(path) {\n path.skip();\n },\n};\n\ninterface RenamerState {\n scope: Scope;\n}\n\nexport function injectInitialization(\n path: NodePath,\n constructor: NodePath | undefined,\n nodes: t.ExpressionStatement[],\n renamer?: (visitor: Visitor, state: RenamerState) => void,\n lastReturnsThis?: boolean,\n) {\n if (!nodes.length) return;\n\n const isDerived = !!path.node.superClass;\n\n if (!constructor) {\n const newConstructor = t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n [],\n t.blockStatement([]),\n );\n\n if (isDerived) {\n newConstructor.params = [t.restElement(t.identifier(\"args\"))];\n newConstructor.body.body.push(template.statement.ast`super(...args)`);\n }\n\n [constructor] = path\n .get(\"body\")\n .unshiftContainer(\"body\", newConstructor) as NodePath[];\n }\n\n if (renamer) {\n renamer(referenceVisitor, { scope: constructor.scope });\n }\n\n if (isDerived) {\n const bareSupers: NodePath[] = [];\n constructor.traverse(findBareSupers, bareSupers);\n let isFirst = true;\n for (const bareSuper of bareSupers) {\n if (isFirst) {\n isFirst = false;\n } else {\n nodes = nodes.map(n => t.cloneNode(n));\n }\n if (!bareSuper.parentPath.isExpressionStatement()) {\n const allNodes: t.Expression[] = [\n bareSuper.node,\n ...nodes.map(n => t.toExpression(n)),\n ];\n if (!lastReturnsThis) allNodes.push(t.thisExpression());\n bareSuper.replaceWith(t.sequenceExpression(allNodes));\n } else {\n bareSuper.insertAfter(nodes);\n }\n }\n } else {\n constructor.get(\"body\").unshiftContainer(\"body\", nodes);\n }\n}\n\ntype ComputedKeyAssignmentExpression = t.AssignmentExpression & {\n left: t.Identifier;\n};\n\n/**\n * Try to memoise a computed key.\n * It returns undefined when the computed key is an uid reference, otherwise\n * an assignment expression `memoiserId = computed key`\n * @export\n * @param {t.Expression} keyNode Computed key\n * @param {Scope} scope The scope where memoiser id should be registered\n * @param {string} hint The memoiser id hint\n * @returns {(ComputedKeyAssignmentExpression | undefined)}\n */\nexport function memoiseComputedKey(\n keyNode: t.Expression,\n scope: Scope,\n hint: string,\n): ComputedKeyAssignmentExpression | undefined {\n const isUidReference = t.isIdentifier(keyNode) && scope.hasUid(keyNode.name);\n if (isUidReference) {\n return;\n }\n const isMemoiseAssignment =\n t.isAssignmentExpression(keyNode, { operator: \"=\" }) &&\n t.isIdentifier(keyNode.left) &&\n scope.hasUid(keyNode.left.name);\n if (isMemoiseAssignment) {\n return t.cloneNode(keyNode as ComputedKeyAssignmentExpression);\n } else {\n const ident = t.identifier(hint);\n // Declaring in the same block scope\n // Ref: https://github.com/babel/babel/pull/10029/files#diff-fbbdd83e7a9c998721c1484529c2ce92\n scope.push({\n id: ident,\n kind: \"let\",\n });\n return t.assignmentExpression(\n \"=\",\n t.cloneNode(ident),\n keyNode,\n ) as ComputedKeyAssignmentExpression;\n }\n}\n\nexport function extractComputedKeys(\n path: NodePath,\n computedPaths: NodePath[],\n file: File,\n) {\n const { scope } = path;\n const declarations: t.ExpressionStatement[] = [];\n const state = {\n classBinding: path.node.id && scope.getBinding(path.node.id.name),\n file,\n };\n for (const computedPath of computedPaths) {\n const computedKey = computedPath.get(\"key\");\n if (computedKey.isReferencedIdentifier()) {\n handleClassTDZ(computedKey, state);\n } else {\n computedKey.traverse(classFieldDefinitionEvaluationTDZVisitor, state);\n }\n\n const computedNode = computedPath.node;\n // Make sure computed property names are only evaluated once (upon class definition)\n // and in the right order in combination with static properties\n if (!computedKey.isConstantExpression()) {\n const assignment = memoiseComputedKey(\n computedKey.node,\n scope,\n scope.generateUidBasedOnNode(computedKey.node),\n );\n if (assignment) {\n declarations.push(t.expressionStatement(assignment));\n computedNode.key = t.cloneNode(assignment.left);\n }\n }\n }\n\n return declarations;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAEA,MAAME,cAAc,GAAGC,kBAAQ,CAACC,kBAAkB,CAEhD;EACAC,KAAKA,CAACC,IAAI,EAAE;IACV,MAAM;MAAEC,IAAI;MAAEC;IAAW,CAAC,GAAGF,IAAI;IACjC,IAAIE,UAAU,CAACC,gBAAgB,CAAC;MAAEC,MAAM,EAAEH;IAAK,CAAC,CAAC,EAAE;MACjD,IAAI,CAACI,IAAI,CAACH,UAAU,CAAC;IACvB;EACF;AACF,CAAC,CAAC;AAEF,MAAMI,gBAA2C,GAAG;EAClD,iCAAiCC,CAC/BP,IAAqD,EACrD;IACAA,IAAI,CAACQ,IAAI,CAAC,CAAC;EACb,CAAC;EAEDC,oBAAoBA,CAACT,IAA4B,EAAE;IAAEU;EAAM,CAAC,EAAE;IAC5D,IAAIA,KAAK,CAACC,aAAa,CAACX,IAAI,CAACC,IAAI,CAACW,IAAI,CAAC,EAAE;MACvCF,KAAK,CAACG,MAAM,CAACb,IAAI,CAACC,IAAI,CAACW,IAAI,CAAC;MAC5BZ,IAAI,CAACQ,IAAI,CAAC,CAAC;IACb;EACF;AACF,CAAC;AAOD,SAASM,cAAcA,CACrBd,IAA4B,EAC5Be,KAA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ACC,IAAI,CAACsE,EAAE,CAAC3D,IAAI,CAAC;IACjEO;EACF,CAAC;EACD,KAAK,MAAM0D,YAAY,IAAIF,aAAa,EAAE;IACxC,MAAMG,WAAW,GAAGD,YAAY,CAAC/B,GAAG,CAAC,KAAK,CAAC;IAC3C,IAAIgC,WAAW,CAACC,sBAAsB,CAAC,CAAC,EAAE;MACxCjE,cAAc,CAACgE,WAAW,EAAE/D,KAAK,CAAC;IACpC,CAAC,MAAM;MACL+D,WAAW,CAAC7B,QAAQ,CAACtB,wCAAwC,EAAEZ,KAAK,CAAC;IACvE;IAEA,MAAMiE,YAAY,GAAGH,YAAY,CAAC5E,IAAI;IAGtC,IAAI,CAAC6E,WAAW,CAACG,oBAAoB,CAAC,CAAC,EAAE;MACvC,MAAMC,UAAU,GAAGtB,kBAAkB,CACnCkB,WAAW,CAAC7E,IAAI,EAChBS,KAAK,EACLA,KAAK,CAACyE,sBAAsB,CAACL,WAAW,CAAC7E,IAAI,CAC/C,CAAC;MACD,IAAIiF,UAAU,EAAE;QACdN,YAAY,CAACvE,IAAI,CAACiB,WAAC,CAAC8D,mBAAmB,CAACF,UAAU,CAAC,CAAC;QACpDF,YAAY,CAACK,GAAG,GAAG/D,WAAC,CAACgC,SAAS,CAAC4B,UAAU,CAACb,IAAI,CAAC;MACjD;IACF;EACF;EAEA,OAAOO,YAAY;AACrB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js b/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js new file mode 100644 index 00000000..e68d5de8 --- /dev/null +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assertFieldTransformed = assertFieldTransformed; +function assertFieldTransformed(path) { + if (path.node.declare || false) { + throw path.buildCodeFrameError(`TypeScript 'declare' fields must first be transformed by ` + `@babel/plugin-transform-typescript.\n` + `If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` + `that it runs before any plugin related to additional class features:\n` + ` - @babel/plugin-transform-class-properties\n` + ` - @babel/plugin-transform-private-methods\n` + ` - @babel/plugin-proposal-decorators`); + } +} + +//# sourceMappingURL=typescript.js.map diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js.map new file mode 100644 index 00000000..497ebe07 --- /dev/null +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js.map @@ -0,0 +1 @@ +{"version":3,"names":["assertFieldTransformed","path","node","declare","buildCodeFrameError"],"sources":["../src/typescript.ts"],"sourcesContent":["import type { NodePath, types as t } from \"@babel/core\";\n\nexport function assertFieldTransformed(\n path: NodePath,\n) {\n if (\n path.node.declare ||\n (process.env.BABEL_8_BREAKING\n ? path.isClassProperty({ definite: true })\n : false)\n ) {\n throw path.buildCodeFrameError(\n `TypeScript 'declare' fields must first be transformed by ` +\n `@babel/plugin-transform-typescript.\\n` +\n `If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` +\n `that it runs before any plugin related to additional class features:\\n` +\n ` - @babel/plugin-transform-class-properties\\n` +\n ` - @babel/plugin-transform-private-methods\\n` +\n ` - @babel/plugin-proposal-decorators`,\n );\n }\n}\n"],"mappings":";;;;;;AAEO,SAASA,sBAAsBA,CACpCC,IAAoD,EACpD;EACA,IACEA,IAAI,CAACC,IAAI,CAACC,OAAO,IAGb,KAAM,EACV;IACA,MAAMF,IAAI,CAACG,mBAAmB,CAC5B,2DAA2D,GACzD,uCAAuC,GACvC,qFAAqF,GACrF,wEAAwE,GACxE,+CAA+C,GAC/C,8CAA8C,GAC9C,sCACJ,CAAC;EACH;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/package.json b/node_modules/@babel/helper-create-class-features-plugin/package.json new file mode 100644 index 00000000..3b3f2b61 --- /dev/null +++ b/node_modules/@babel/helper-create-class-features-plugin/package.json @@ -0,0 +1,43 @@ +{ + "name": "@babel/helper-create-class-features-plugin", + "version": "7.27.1", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "description": "Compile class public and private fields, private methods and decorators to ES6", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-create-class-features-plugin" + }, + "main": "./lib/index.js", + "publishConfig": { + "access": "public" + }, + "keywords": [ + "babel", + "babel-plugin" + ], + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.27.1", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "devDependencies": { + "@babel/core": "^7.27.1", + "@babel/helper-plugin-test-runner": "^7.27.1", + "@babel/preset-env": "^7.27.1", + "@types/charcodes": "^0.2.0", + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/LICENSE b/node_modules/@babel/helper-create-regexp-features-plugin/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-create-regexp-features-plugin/README.md b/node_modules/@babel/helper-create-regexp-features-plugin/README.md new file mode 100644 index 00000000..e75d162a --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/README.md @@ -0,0 +1,19 @@ +# @babel/helper-create-regexp-features-plugin + +> Compile ESNext Regular Expressions to ES5 + +See our website [@babel/helper-create-regexp-features-plugin](https://babeljs.io/docs/babel-helper-create-regexp-features-plugin) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-create-regexp-features-plugin +``` + +or using yarn: + +```sh +yarn add @babel/helper-create-regexp-features-plugin +``` diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js b/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js new file mode 100644 index 00000000..2769a1b2 --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FEATURES = void 0; +exports.enableFeature = enableFeature; +exports.featuresKey = void 0; +exports.hasFeature = hasFeature; +exports.runtimeKey = void 0; +const FEATURES = exports.FEATURES = Object.freeze({ + unicodeFlag: 1 << 0, + dotAllFlag: 1 << 1, + unicodePropertyEscape: 1 << 2, + namedCaptureGroups: 1 << 3, + unicodeSetsFlag_syntax: 1 << 4, + unicodeSetsFlag: 1 << 5, + duplicateNamedCaptureGroups: 1 << 6, + modifiers: 1 << 7 +}); +const featuresKey = exports.featuresKey = "@babel/plugin-regexp-features/featuresKey"; +const runtimeKey = exports.runtimeKey = "@babel/plugin-regexp-features/runtimeKey"; +function enableFeature(features, feature) { + return features | feature; +} +function hasFeature(features, feature) { + return !!(features & feature); +} + +//# sourceMappingURL=features.js.map diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js.map b/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js.map new file mode 100644 index 00000000..b0a1437c --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/features.js.map @@ -0,0 +1 @@ +{"version":3,"names":["FEATURES","exports","Object","freeze","unicodeFlag","dotAllFlag","unicodePropertyEscape","namedCaptureGroups","unicodeSetsFlag_syntax","unicodeSetsFlag","duplicateNamedCaptureGroups","modifiers","featuresKey","runtimeKey","enableFeature","features","feature","hasFeature"],"sources":["../src/features.ts"],"sourcesContent":["export const FEATURES = Object.freeze({\n unicodeFlag: 1 << 0,\n dotAllFlag: 1 << 1,\n unicodePropertyEscape: 1 << 2,\n namedCaptureGroups: 1 << 3,\n // Not used, for backward compatibility with syntax-unicode-sets-regex\n unicodeSetsFlag_syntax: 1 << 4,\n unicodeSetsFlag: 1 << 5,\n duplicateNamedCaptureGroups: 1 << 6,\n modifiers: 1 << 7,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-regexp-features\n// - @babel/plugin-transform-unicode-property-regex\n// - node_modules\n// - @babel-plugin-regexp-features\nexport const featuresKey = \"@babel/plugin-regexp-features/featuresKey\";\nexport const runtimeKey = \"@babel/plugin-regexp-features/runtimeKey\";\n\ntype FeatureType = (typeof FEATURES)[keyof typeof FEATURES];\n\nexport function enableFeature(features: number, feature: FeatureType): number {\n return features | feature;\n}\n\nexport function hasFeature(features: number, feature: FeatureType) {\n return !!(features & feature);\n}\n"],"mappings":";;;;;;;;;;AAAO,MAAMA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EACpCC,WAAW,EAAE,CAAC,IAAI,CAAC;EACnBC,UAAU,EAAE,CAAC,IAAI,CAAC;EAClBC,qBAAqB,EAAE,CAAC,IAAI,CAAC;EAC7BC,kBAAkB,EAAE,CAAC,IAAI,CAAC;EAE1BC,sBAAsB,EAAE,CAAC,IAAI,CAAC;EAC9BC,eAAe,EAAE,CAAC,IAAI,CAAC;EACvBC,2BAA2B,EAAE,CAAC,IAAI,CAAC;EACnCC,SAAS,EAAE,CAAC,IAAI;AAClB,CAAC,CAAC;AASK,MAAMC,WAAW,GAAAX,OAAA,CAAAW,WAAA,GAAG,2CAA2C;AAC/D,MAAMC,UAAU,GAAAZ,OAAA,CAAAY,UAAA,GAAG,0CAA0C;AAI7D,SAASC,aAAaA,CAACC,QAAgB,EAAEC,OAAoB,EAAU;EAC5E,OAAOD,QAAQ,GAAGC,OAAO;AAC3B;AAEO,SAASC,UAAUA,CAACF,QAAgB,EAAEC,OAAoB,EAAE;EACjE,OAAO,CAAC,EAAED,QAAQ,GAAGC,OAAO,CAAC;AAC/B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js new file mode 100644 index 00000000..7fc8dadb --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js @@ -0,0 +1,116 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRegExpFeaturePlugin = createRegExpFeaturePlugin; +var _regexpuCore = require("regexpu-core"); +var _core = require("@babel/core"); +var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); +var _semver = require("semver"); +var _features = require("./features.js"); +var _util = require("./util.js"); +const versionKey = "@babel/plugin-regexp-features/version"; +function createRegExpFeaturePlugin({ + name, + feature, + options = {}, + manipulateOptions = () => {} +}) { + return { + name, + manipulateOptions, + pre() { + var _file$get; + const { + file + } = this; + const features = (_file$get = file.get(_features.featuresKey)) != null ? _file$get : 0; + let newFeatures = (0, _features.enableFeature)(features, _features.FEATURES[feature]); + const { + useUnicodeFlag, + runtime + } = options; + if (useUnicodeFlag === false) { + newFeatures = (0, _features.enableFeature)(newFeatures, _features.FEATURES.unicodeFlag); + } + if (newFeatures !== features) { + file.set(_features.featuresKey, newFeatures); + } + if (runtime !== undefined) { + if (file.has(_features.runtimeKey) && file.get(_features.runtimeKey) !== runtime && (0, _features.hasFeature)(newFeatures, _features.FEATURES.duplicateNamedCaptureGroups)) { + throw new Error(`The 'runtime' option must be the same for ` + `'@babel/plugin-transform-named-capturing-groups-regex' and ` + `'@babel/plugin-transform-duplicate-named-capturing-groups-regex'.`); + } + if (feature === "namedCaptureGroups") { + if (!runtime || !file.has(_features.runtimeKey)) file.set(_features.runtimeKey, runtime); + } else { + file.set(_features.runtimeKey, runtime); + } + } + { + if (typeof file.get(versionKey) === "number") { + file.set(versionKey, "7.27.1"); + return; + } + } + if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.27.1")) { + file.set(versionKey, "7.27.1"); + } + }, + visitor: { + RegExpLiteral(path) { + var _file$get2; + const { + node + } = path; + const { + file + } = this; + const features = file.get(_features.featuresKey); + const runtime = (_file$get2 = file.get(_features.runtimeKey)) != null ? _file$get2 : true; + const regexpuOptions = (0, _util.generateRegexpuOptions)(node.pattern, features); + if ((0, _util.canSkipRegexpu)(node, regexpuOptions)) { + return; + } + const namedCaptureGroups = { + __proto__: null + }; + if (regexpuOptions.namedGroups === "transform") { + regexpuOptions.onNamedGroup = (name, index) => { + const prev = namedCaptureGroups[name]; + if (typeof prev === "number") { + namedCaptureGroups[name] = [prev, index]; + } else if (Array.isArray(prev)) { + prev.push(index); + } else { + namedCaptureGroups[name] = index; + } + }; + } + let newFlags; + if (regexpuOptions.modifiers === "transform") { + regexpuOptions.onNewFlags = flags => { + newFlags = flags; + }; + } + node.pattern = _regexpuCore(node.pattern, node.flags, regexpuOptions); + if (regexpuOptions.namedGroups === "transform" && Object.keys(namedCaptureGroups).length > 0 && runtime && !isRegExpTest(path)) { + const call = _core.types.callExpression(this.addHelper("wrapRegExp"), [node, _core.types.valueToNode(namedCaptureGroups)]); + (0, _helperAnnotateAsPure.default)(call); + path.replaceWith(call); + } + node.flags = (0, _util.transformFlags)(regexpuOptions, newFlags != null ? newFlags : node.flags); + } + } + }; +} +function isRegExpTest(path) { + return path.parentPath.isMemberExpression({ + object: path.node, + computed: false + }) && path.parentPath.get("property").isIdentifier({ + name: "test" + }); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js.map b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js.map new file mode 100644 index 00000000..03f5becc --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regexpuCore","require","_core","_helperAnnotateAsPure","_semver","_features","_util","versionKey","createRegExpFeaturePlugin","name","feature","options","manipulateOptions","pre","_file$get","file","features","get","featuresKey","newFeatures","enableFeature","FEATURES","useUnicodeFlag","runtime","unicodeFlag","set","undefined","has","runtimeKey","hasFeature","duplicateNamedCaptureGroups","Error","semver","lt","visitor","RegExpLiteral","path","_file$get2","node","regexpuOptions","generateRegexpuOptions","pattern","canSkipRegexpu","namedCaptureGroups","__proto__","namedGroups","onNamedGroup","index","prev","Array","isArray","push","newFlags","modifiers","onNewFlags","flags","rewritePattern","Object","keys","length","isRegExpTest","call","t","callExpression","addHelper","valueToNode","annotateAsPure","replaceWith","transformFlags","parentPath","isMemberExpression","object","computed","isIdentifier"],"sources":["../src/index.ts"],"sourcesContent":["import rewritePattern from \"regexpu-core\";\nimport { types as t, type PluginObject, type NodePath } from \"@babel/core\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nimport semver from \"semver\";\n\nimport {\n featuresKey,\n FEATURES,\n enableFeature,\n runtimeKey,\n hasFeature,\n} from \"./features.ts\";\nimport {\n generateRegexpuOptions,\n canSkipRegexpu,\n transformFlags,\n} from \"./util.ts\";\n\nconst versionKey = \"@babel/plugin-regexp-features/version\";\n\nexport interface Options {\n name: string;\n feature: keyof typeof FEATURES;\n options?: {\n useUnicodeFlag?: boolean;\n runtime?: boolean;\n };\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n}\n\nexport function createRegExpFeaturePlugin({\n name,\n feature,\n options = {},\n manipulateOptions = () => {},\n}: Options): PluginObject {\n return {\n name,\n\n manipulateOptions,\n\n pre() {\n const { file } = this;\n const features = file.get(featuresKey) ?? 0;\n let newFeatures = enableFeature(features, FEATURES[feature]);\n\n const { useUnicodeFlag, runtime } = options;\n if (useUnicodeFlag === false) {\n newFeatures = enableFeature(newFeatures, FEATURES.unicodeFlag);\n }\n if (newFeatures !== features) {\n file.set(featuresKey, newFeatures);\n }\n\n if (runtime !== undefined) {\n if (\n file.has(runtimeKey) &&\n file.get(runtimeKey) !== runtime &&\n (process.env.BABEL_8_BREAKING ||\n // This check. Is necessary because in Babel 7 we allow multiple\n // copies of transform-named-capturing-groups-regex with\n // conflicting 'runtime' options.\n hasFeature(newFeatures, FEATURES.duplicateNamedCaptureGroups))\n ) {\n throw new Error(\n `The 'runtime' option must be the same for ` +\n `'@babel/plugin-transform-named-capturing-groups-regex' and ` +\n `'@babel/plugin-transform-duplicate-named-capturing-groups-regex'.`,\n );\n }\n\n if (process.env.BABEL_8_BREAKING) {\n file.set(runtimeKey, runtime);\n } else if (\n // This check. Is necessary because in Babel 7 we allow multiple\n // copies of transform-named-capturing-groups-regex with\n // conflicting 'runtime' options.\n feature === \"namedCaptureGroups\"\n ) {\n if (!runtime || !file.has(runtimeKey)) file.set(runtimeKey, runtime);\n } else {\n file.set(runtimeKey, runtime);\n }\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n // Until 7.21.4, we used to encode the version as a number.\n // If file.get(versionKey) is a number, it has thus been\n // set by an older version of this plugin.\n if (typeof file.get(versionKey) === \"number\") {\n file.set(versionKey, PACKAGE_JSON.version);\n return;\n }\n }\n if (\n !file.get(versionKey) ||\n semver.lt(file.get(versionKey), PACKAGE_JSON.version)\n ) {\n file.set(versionKey, PACKAGE_JSON.version);\n }\n },\n\n visitor: {\n RegExpLiteral(path) {\n const { node } = path;\n const { file } = this;\n const features = file.get(featuresKey);\n const runtime = file.get(runtimeKey) ?? true;\n\n const regexpuOptions = generateRegexpuOptions(node.pattern, features);\n if (canSkipRegexpu(node, regexpuOptions)) {\n return;\n }\n\n const namedCaptureGroups: Record = {\n __proto__: null,\n };\n if (regexpuOptions.namedGroups === \"transform\") {\n regexpuOptions.onNamedGroup = (name, index) => {\n const prev = namedCaptureGroups[name];\n if (typeof prev === \"number\") {\n namedCaptureGroups[name] = [prev, index];\n } else if (Array.isArray(prev)) {\n prev.push(index);\n } else {\n namedCaptureGroups[name] = index;\n }\n };\n }\n\n let newFlags;\n if (regexpuOptions.modifiers === \"transform\") {\n regexpuOptions.onNewFlags = flags => {\n newFlags = flags;\n };\n }\n\n node.pattern = rewritePattern(node.pattern, node.flags, regexpuOptions);\n\n if (\n regexpuOptions.namedGroups === \"transform\" &&\n Object.keys(namedCaptureGroups).length > 0 &&\n runtime &&\n !isRegExpTest(path)\n ) {\n const call = t.callExpression(this.addHelper(\"wrapRegExp\"), [\n node,\n t.valueToNode(namedCaptureGroups),\n ]);\n annotateAsPure(call);\n\n path.replaceWith(call);\n }\n\n node.flags = transformFlags(regexpuOptions, newFlags ?? node.flags);\n },\n },\n };\n}\n\nfunction isRegExpTest(path: NodePath) {\n return (\n path.parentPath.isMemberExpression({\n object: path.node,\n computed: false,\n }) && path.parentPath.get(\"property\").isIdentifier({ name: \"test\" })\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAOA,IAAAK,KAAA,GAAAL,OAAA;AAMA,MAAMM,UAAU,GAAG,uCAAuC;AAYnD,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,IAAI;IACjBkC,QAAQ,EAAE;EACZ,CAAC,CAAC,IAAIpC,IAAI,CAACiC,UAAU,CAACpD,GAAG,CAAC,UAAU,CAAC,CAACwD,YAAY,CAAC;IAAEhE,IAAI,EAAE;EAAO,CAAC,CAAC;AAExE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js b/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js new file mode 100644 index 00000000..508587ec --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.canSkipRegexpu = canSkipRegexpu; +exports.generateRegexpuOptions = generateRegexpuOptions; +exports.transformFlags = transformFlags; +var _features = require("./features.js"); +function generateRegexpuOptions(pattern, toTransform) { + const feat = name => { + return (0, _features.hasFeature)(toTransform, _features.FEATURES[name]) ? "transform" : false; + }; + const featDuplicateNamedGroups = () => { + if (!feat("duplicateNamedCaptureGroups")) return false; + const regex = /\(\?<([^>]+)(>|$)/g; + const seen = new Set(); + for (let match; (match = regex.exec(pattern)) && match[2]; seen.add(match[1])) { + if (seen.has(match[1])) return "transform"; + } + return false; + }; + return { + unicodeFlag: feat("unicodeFlag"), + unicodeSetsFlag: feat("unicodeSetsFlag"), + dotAllFlag: feat("dotAllFlag"), + unicodePropertyEscapes: feat("unicodePropertyEscape"), + namedGroups: feat("namedCaptureGroups") || featDuplicateNamedGroups(), + onNamedGroup: () => {}, + modifiers: feat("modifiers") + }; +} +function canSkipRegexpu(node, options) { + const { + flags, + pattern + } = node; + if (flags.includes("v")) { + if (options.unicodeSetsFlag === "transform") return false; + } + if (flags.includes("u")) { + if (options.unicodeFlag === "transform") return false; + if (options.unicodePropertyEscapes === "transform" && /\\p\{/i.test(pattern)) { + return false; + } + } + if (flags.includes("s")) { + if (options.dotAllFlag === "transform") return false; + } + if (options.namedGroups === "transform" && /\(\?<(?![=!])/.test(pattern)) { + return false; + } + if (options.modifiers === "transform" && /\(\?[\w-]+:/.test(pattern)) { + return false; + } + return true; +} +function transformFlags(regexpuOptions, flags) { + if (regexpuOptions.unicodeSetsFlag === "transform") { + flags = flags.replace("v", "u"); + } + if (regexpuOptions.unicodeFlag === "transform") { + flags = flags.replace("u", ""); + } + if (regexpuOptions.dotAllFlag === "transform") { + flags = flags.replace("s", ""); + } + return flags; +} + +//# sourceMappingURL=util.js.map diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js.map b/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js.map new file mode 100644 index 00000000..39cd8e5f --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/util.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_features","require","generateRegexpuOptions","pattern","toTransform","feat","name","hasFeature","FEATURES","featDuplicateNamedGroups","regex","seen","Set","match","exec","add","has","unicodeFlag","unicodeSetsFlag","dotAllFlag","unicodePropertyEscapes","namedGroups","onNamedGroup","modifiers","canSkipRegexpu","node","options","flags","includes","test","transformFlags","regexpuOptions","replace"],"sources":["../src/util.ts"],"sourcesContent":["import type { types as t } from \"@babel/core\";\nimport { FEATURES, hasFeature } from \"./features.ts\";\n\nimport type { RegexpuOptions } from \"regexpu-core\";\n\nexport function generateRegexpuOptions(\n pattern: string,\n toTransform: number,\n): RegexpuOptions {\n const feat = (name: keyof typeof FEATURES) => {\n return hasFeature(toTransform, FEATURES[name]) ? \"transform\" : false;\n };\n\n const featDuplicateNamedGroups = (): \"transform\" | false => {\n if (!feat(\"duplicateNamedCaptureGroups\")) return false;\n\n // This can return false positive, for example for /\\(?\\)/.\n // However, it's such a rare occurrence that it's ok to compile\n // the regexp even if we only need to compile regexps with\n // duplicate named capturing groups.\n // The $ is to exit early for malicious input such as \\(?<\\(?<\\(?<...\n const regex = /\\(\\?<([^>]+)(>|$)/g;\n const seen = new Set();\n for (\n let match;\n (match = regex.exec(pattern)) && match[2];\n seen.add(match[1])\n ) {\n if (seen.has(match[1])) return \"transform\";\n }\n return false;\n };\n\n return {\n unicodeFlag: feat(\"unicodeFlag\"),\n unicodeSetsFlag: feat(\"unicodeSetsFlag\"),\n dotAllFlag: feat(\"dotAllFlag\"),\n unicodePropertyEscapes: feat(\"unicodePropertyEscape\"),\n namedGroups: feat(\"namedCaptureGroups\") || featDuplicateNamedGroups(),\n onNamedGroup: () => {},\n modifiers: feat(\"modifiers\"),\n };\n}\n\nexport function canSkipRegexpu(\n node: t.RegExpLiteral,\n options: RegexpuOptions,\n): boolean {\n const { flags, pattern } = node;\n\n if (flags.includes(\"v\")) {\n if (options.unicodeSetsFlag === \"transform\") return false;\n }\n\n if (flags.includes(\"u\")) {\n if (options.unicodeFlag === \"transform\") return false;\n if (\n options.unicodePropertyEscapes === \"transform\" &&\n /\\\\p\\{/i.test(pattern)\n ) {\n return false;\n }\n }\n\n if (flags.includes(\"s\")) {\n if (options.dotAllFlag === \"transform\") return false;\n }\n\n if (options.namedGroups === \"transform\" && /\\(\\?<(?![=!])/.test(pattern)) {\n return false;\n }\n\n if (options.modifiers === \"transform\" && /\\(\\?[\\w-]+:/.test(pattern)) {\n return false;\n }\n\n return true;\n}\n\nexport function transformFlags(regexpuOptions: RegexpuOptions, flags: string) {\n if (regexpuOptions.unicodeSetsFlag === \"transform\") {\n flags = flags.replace(\"v\", \"u\");\n }\n if (regexpuOptions.unicodeFlag === \"transform\") {\n flags = flags.replace(\"u\", \"\");\n }\n if (regexpuOptions.dotAllFlag === \"transform\") {\n flags = flags.replace(\"s\", \"\");\n }\n return flags;\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAIO,SAASC,sBAAsBA,CACpCC,OAAe,EACfC,WAAmB,EACH;EAChB,MAAMC,IAAI,GAAIC,IAA2B,IAAK;IAC5C,OAAO,IAAAC,oBAAU,EAACH,WAAW,EAAEI,kBAAQ,CAACF,IAAI,CAAC,CAAC,GAAG,WAAW,GAAG,KAAK;EACtE,CAA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D,IACES,OAAO,CAACN,sBAAsB,KAAK,WAAW,IAC9C,QAAQ,CAACS,IAAI,CAAC1B,OAAO,CAAC,EACtB;MACA,OAAO,KAAK;IACd;EACF;EAEA,IAAIwB,KAAK,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;IACvB,IAAIF,OAAO,CAACP,UAAU,KAAK,WAAW,EAAE,OAAO,KAAK;EACtD;EAEA,IAAIO,OAAO,CAACL,WAAW,KAAK,WAAW,IAAI,eAAe,CAACQ,IAAI,CAAC1B,OAAO,CAAC,EAAE;IACxE,OAAO,KAAK;EACd;EAEA,IAAIuB,OAAO,CAACH,SAAS,KAAK,WAAW,IAAI,aAAa,CAACM,IAAI,CAAC1B,OAAO,CAAC,EAAE;IACpE,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb;AAEO,SAAS2B,cAAcA,CAACC,cAA8B,EAAEJ,KAAa,EAAE;EAC5E,IAAII,cAAc,CAACb,eAAe,KAAK,WAAW,EAAE;IAClDS,KAAK,GAAGA,KAAK,CAACK,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;EACjC;EACA,IAAID,cAAc,CAACd,WAAW,KAAK,WAAW,EAAE;IAC9CU,KAAK,GAAGA,KAAK,CAACK,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAChC;EACA,IAAID,cAAc,CAACZ,UAAU,KAAK,WAAW,EAAE;IAC7CQ,KAAK,GAAGA,KAAK,CAACK,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAChC;EACA,OAAOL,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/package.json b/node_modules/@babel/helper-create-regexp-features-plugin/package.json new file mode 100644 index 00000000..db55d3e3 --- /dev/null +++ b/node_modules/@babel/helper-create-regexp-features-plugin/package.json @@ -0,0 +1,36 @@ +{ + "name": "@babel/helper-create-regexp-features-plugin", + "version": "7.27.1", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "description": "Compile ESNext Regular Expressions to ES5", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-create-regexp-features-plugin" + }, + "main": "./lib/index.js", + "publishConfig": { + "access": "public" + }, + "keywords": [ + "babel", + "babel-plugin" + ], + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "regexpu-core": "^6.2.0", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "devDependencies": { + "@babel/core": "^7.27.1", + "@babel/helper-plugin-test-runner": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/LICENSE b/node_modules/@babel/helper-define-polyfill-provider/LICENSE new file mode 100644 index 00000000..b74971fe --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Nicolò Ribaudo and other contributors + +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/node_modules/@babel/helper-define-polyfill-provider/README.md b/node_modules/@babel/helper-define-polyfill-provider/README.md new file mode 100644 index 00000000..21989fca --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/README.md @@ -0,0 +1,15 @@ +# @babel/helper-define-polyfill-provider + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-define-polyfill-provider +``` + +or using yarn: + +```sh +yarn add @babel/helper-define-polyfill-provider --dev +``` diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs new file mode 100644 index 00000000..1508b3b7 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs @@ -0,0 +1,835 @@ +import { declare } from '@babel/helper-plugin-utils'; +import _getTargets, { prettifyTargets, getInclusionReasons, isRequired } from '@babel/helper-compilation-targets'; +import * as _babel from '@babel/core'; + +const { + types: t$1, + template: template +} = _babel.default || _babel; +function intersection(a, b) { + const result = new Set(); + a.forEach(v => b.has(v) && result.add(v)); + return result; +} +function has$1(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); +} +function resolve$1(path, resolved = new Set()) { + if (resolved.has(path)) return; + resolved.add(path); + if (path.isVariableDeclarator()) { + if (path.get("id").isIdentifier()) { + return resolve$1(path.get("init"), resolved); + } + } else if (path.isReferencedIdentifier()) { + const binding = path.scope.getBinding(path.node.name); + if (!binding) return path; + if (!binding.constant) return; + return resolve$1(binding.path, resolved); + } + return path; +} +function resolveId(path) { + if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) { + return path.node.name; + } + const resolved = resolve$1(path); + if (resolved != null && resolved.isIdentifier()) { + return resolved.node.name; + } +} +function resolveKey(path, computed = false) { + const { + scope + } = path; + if (path.isStringLiteral()) return path.node.value; + const isIdentifier = path.isIdentifier(); + if (isIdentifier && !(computed || path.parent.computed)) { + return path.node.name; + } + if (computed && path.isMemberExpression() && path.get("object").isIdentifier({ + name: "Symbol" + }) && !scope.hasBinding("Symbol", /* noGlobals */true)) { + const sym = resolveKey(path.get("property"), path.node.computed); + if (sym) return "Symbol." + sym; + } + if (isIdentifier ? scope.hasBinding(path.node.name, /* noGlobals */true) : path.isPure()) { + const { + value + } = path.evaluate(); + if (typeof value === "string") return value; + } +} +function resolveSource(obj) { + if (obj.isMemberExpression() && obj.get("property").isIdentifier({ + name: "prototype" + })) { + const id = resolveId(obj.get("object")); + if (id) { + return { + id, + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; + } + const id = resolveId(obj); + if (id) { + return { + id, + placement: "static" + }; + } + const path = resolve$1(obj); + switch (path == null ? void 0 : path.type) { + case "RegExpLiteral": + return { + id: "RegExp", + placement: "prototype" + }; + case "FunctionExpression": + return { + id: "Function", + placement: "prototype" + }; + case "StringLiteral": + return { + id: "String", + placement: "prototype" + }; + case "NumberLiteral": + return { + id: "Number", + placement: "prototype" + }; + case "BooleanLiteral": + return { + id: "Boolean", + placement: "prototype" + }; + case "ObjectExpression": + return { + id: "Object", + placement: "prototype" + }; + case "ArrayExpression": + return { + id: "Array", + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; +} +function getImportSource({ + node +}) { + if (node.specifiers.length === 0) return node.source.value; +} +function getRequireSource({ + node +}) { + if (!t$1.isExpressionStatement(node)) return; + const { + expression + } = node; + if (t$1.isCallExpression(expression) && t$1.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t$1.isStringLiteral(expression.arguments[0])) { + return expression.arguments[0].value; + } +} +function hoist(node) { + // @ts-expect-error + node._blockHoist = 3; + return node; +} +function createUtilsGetter(cache) { + return path => { + const prog = path.findParent(p => p.isProgram()); + return { + injectGlobalImport(url, moduleName) { + cache.storeAnonymous(prog, url, moduleName, (isScript, source) => { + return isScript ? template.statement.ast`require(${source})` : t$1.importDeclaration([], source); + }); + }, + injectNamedImport(url, name, hint = name, moduleName) { + return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast` + var ${id} = require(${source}).${name} + `) : t$1.importDeclaration([t$1.importSpecifier(id, name)], source), + name: id.name + }; + }); + }, + injectDefaultImport(url, hint = url, moduleName) { + return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t$1.importDeclaration([t$1.importDefaultSpecifier(id)], source), + name: id.name + }; + }); + } + }; + }; +} + +const { + types: t +} = _babel.default || _babel; +class ImportsCachedInjector { + constructor(resolver, getPreferredIndex) { + this._imports = new WeakMap(); + this._anonymousImports = new WeakMap(); + this._lastImports = new WeakMap(); + this._resolver = resolver; + this._getPreferredIndex = getPreferredIndex; + } + storeAnonymous(programPath, url, moduleName, getVal) { + const key = this._normalizeKey(programPath, url); + const imports = this._ensure(this._anonymousImports, programPath, Set); + if (imports.has(key)) return; + const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url))); + imports.add(key); + this._injectImport(programPath, node, moduleName); + } + storeNamed(programPath, url, name, moduleName, getVal) { + const key = this._normalizeKey(programPath, url, name); + const imports = this._ensure(this._imports, programPath, Map); + if (!imports.has(key)) { + const { + node, + name: id + } = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name)); + imports.set(key, id); + this._injectImport(programPath, node, moduleName); + } + return t.identifier(imports.get(key)); + } + _injectImport(programPath, node, moduleName) { + var _this$_lastImports$ge; + const newIndex = this._getPreferredIndex(moduleName); + const lastImports = (_this$_lastImports$ge = this._lastImports.get(programPath)) != null ? _this$_lastImports$ge : []; + const isPathStillValid = path => path.node && + // Sometimes the AST is modified and the "last import" + // we have has been replaced + path.parent === programPath.node && path.container === programPath.node.body; + let last; + if (newIndex === Infinity) { + // Fast path: we can always just insert at the end if newIndex is `Infinity` + if (lastImports.length > 0) { + last = lastImports[lastImports.length - 1].path; + if (!isPathStillValid(last)) last = undefined; + } + } else { + for (const [i, data] of lastImports.entries()) { + const { + path, + index + } = data; + if (isPathStillValid(path)) { + if (newIndex < index) { + const [newPath] = path.insertBefore(node); + lastImports.splice(i, 0, { + path: newPath, + index: newIndex + }); + return; + } + last = path; + } + } + } + if (last) { + const [newPath] = last.insertAfter(node); + lastImports.push({ + path: newPath, + index: newIndex + }); + } else { + const [newPath] = programPath.unshiftContainer("body", node); + this._lastImports.set(programPath, [{ + path: newPath, + index: newIndex + }]); + } + } + _ensure(map, programPath, Collection) { + let collection = map.get(programPath); + if (!collection) { + collection = new Collection(); + map.set(programPath, collection); + } + return collection; + } + _normalizeKey(programPath, url, name = "") { + const { + sourceType + } = programPath.node; + + // If we rely on the imported binding (the "name" parameter), we also need to cache + // based on the sourceType. This is because the module transforms change the names + // of the import variables. + return `${name && sourceType}::${url}::${name}`; + } +} + +const presetEnvSilentDebugHeader = "#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets"; +function stringifyTargetsMultiline(targets) { + return JSON.stringify(prettifyTargets(targets), null, 2); +} + +function patternToRegExp(pattern) { + if (pattern instanceof RegExp) return pattern; + try { + return new RegExp(`^${pattern}$`); + } catch { + return null; + } +} +function buildUnusedError(label, unused) { + if (!unused.length) return ""; + return ` - The following "${label}" patterns didn't match any polyfill:\n` + unused.map(original => ` ${String(original)}\n`).join(""); +} +function buldDuplicatesError(duplicates) { + if (!duplicates.size) return ""; + return ` - The following polyfills were matched both by "include" and "exclude" patterns:\n` + Array.from(duplicates, name => ` ${name}\n`).join(""); +} +function validateIncludeExclude(provider, polyfills, includePatterns, excludePatterns) { + let current; + const filter = pattern => { + const regexp = patternToRegExp(pattern); + if (!regexp) return false; + let matched = false; + for (const polyfill of polyfills.keys()) { + if (regexp.test(polyfill)) { + matched = true; + current.add(polyfill); + } + } + return !matched; + }; + + // prettier-ignore + const include = current = new Set(); + const unusedInclude = Array.from(includePatterns).filter(filter); + + // prettier-ignore + const exclude = current = new Set(); + const unusedExclude = Array.from(excludePatterns).filter(filter); + const duplicates = intersection(include, exclude); + if (duplicates.size > 0 || unusedInclude.length > 0 || unusedExclude.length > 0) { + throw new Error(`Error while validating the "${provider}" provider options:\n` + buildUnusedError("include", unusedInclude) + buildUnusedError("exclude", unusedExclude) + buldDuplicatesError(duplicates)); + } + return { + include, + exclude + }; +} +function applyMissingDependenciesDefaults(options, babelApi) { + const { + missingDependencies = {} + } = options; + if (missingDependencies === false) return false; + const caller = babelApi.caller(caller => caller == null ? void 0 : caller.name); + const { + log = "deferred", + inject = caller === "rollup-plugin-babel" ? "throw" : "import", + all = false + } = missingDependencies; + return { + log, + inject, + all + }; +} + +function isRemoved(path) { + if (path.removed) return true; + if (!path.parentPath) return false; + if (path.listKey) { + var _path$parentPath$node; + if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true; + } else { + if (path.parentPath.node[path.key] !== path.node) return true; + } + return isRemoved(path.parentPath); +} +var usage = (callProvider => { + function property(object, key, placement, path) { + return callProvider({ + kind: "property", + object, + key, + placement + }, path); + } + function handleReferencedIdentifier(path) { + const { + node: { + name + }, + scope + } = path; + if (scope.getBindingIdentifier(name)) return; + callProvider({ + kind: "global", + name + }, path); + } + function analyzeMemberExpression(path) { + const key = resolveKey(path.get("property"), path.node.computed); + return { + key, + handleAsMemberExpression: !!key && key !== "prototype" + }; + } + return { + // Symbol(), new Promise + ReferencedIdentifier(path) { + const { + parentPath + } = path; + if (parentPath.isMemberExpression({ + object: path.node + }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) { + return; + } + handleReferencedIdentifier(path); + }, + "MemberExpression|OptionalMemberExpression"(path) { + const { + key, + handleAsMemberExpression + } = analyzeMemberExpression(path); + if (!handleAsMemberExpression) return; + const object = path.get("object"); + let objectIsGlobalIdentifier = object.isIdentifier(); + if (objectIsGlobalIdentifier) { + const binding = object.scope.getBinding(object.node.name); + if (binding) { + if (binding.path.isImportNamespaceSpecifier()) return; + objectIsGlobalIdentifier = false; + } + } + const source = resolveSource(object); + let skipObject = property(source.id, key, source.placement, path); + skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object)); + if (!skipObject) handleReferencedIdentifier(object); + }, + ObjectPattern(path) { + const { + parentPath, + parent + } = path; + let obj; + + // const { keys, values } = Object + if (parentPath.isVariableDeclarator()) { + obj = parentPath.get("init"); + // ({ keys, values } = Object) + } else if (parentPath.isAssignmentExpression()) { + obj = parentPath.get("right"); + // !function ({ keys, values }) {...} (Object) + // resolution does not work after properties transform :-( + } else if (parentPath.isFunction()) { + const grand = parentPath.parentPath; + if (grand.isCallExpression() || grand.isNewExpression()) { + if (grand.node.callee === parent) { + obj = grand.get("arguments")[path.key]; + } + } + } + let id = null; + let placement = null; + if (obj) ({ + id, + placement + } = resolveSource(obj)); + for (const prop of path.get("properties")) { + if (prop.isObjectProperty()) { + const key = resolveKey(prop.get("key")); + if (key) property(id, key, placement, prop); + } + } + }, + BinaryExpression(path) { + if (path.node.operator !== "in") return; + const source = resolveSource(path.get("right")); + const key = resolveKey(path.get("left"), true); + if (!key) return; + callProvider({ + kind: "in", + object: source.id, + key, + placement: source.placement + }, path); + } + }; +}); + +var entry = (callProvider => ({ + ImportDeclaration(path) { + const source = getImportSource(path); + if (!source) return; + callProvider({ + kind: "import", + source + }, path); + }, + Program(path) { + path.get("body").forEach(bodyPath => { + const source = getRequireSource(bodyPath); + if (!source) return; + callProvider({ + kind: "import", + source + }, bodyPath); + }); + } +})); + +function resolve(dirname, moduleName, absoluteImports) { + if (absoluteImports === false) return moduleName; + throw new Error(`"absoluteImports" is not supported in bundles prepared for the browser.`); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function has(basedir, name) { + return true; +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function logMissing(missingDeps) {} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function laterLogMissing(missingDeps) {} + +const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]); +function createMetaResolver(polyfills) { + const { + static: staticP, + instance: instanceP, + global: globalP + } = polyfills; + return meta => { + if (meta.kind === "global" && globalP && has$1(globalP, meta.name)) { + return { + kind: "global", + desc: globalP[meta.name], + name: meta.name + }; + } + if (meta.kind === "property" || meta.kind === "in") { + const { + placement, + object, + key + } = meta; + if (object && placement === "static") { + if (globalP && PossibleGlobalObjects.has(object) && has$1(globalP, key)) { + return { + kind: "global", + desc: globalP[key], + name: key + }; + } + if (staticP && has$1(staticP, object) && has$1(staticP[object], key)) { + return { + kind: "static", + desc: staticP[object][key], + name: `${object}$${key}` + }; + } + } + if (instanceP && has$1(instanceP, key)) { + return { + kind: "instance", + desc: instanceP[key], + name: `${key}` + }; + } + } + }; +} + +const getTargets = _getTargets.default || _getTargets; +function resolveOptions(options, babelApi) { + const { + method, + targets: targetsOption, + ignoreBrowserslistConfig, + configPath, + debug, + shouldInjectPolyfill, + absoluteImports, + ...providerOptions + } = options; + if (isEmpty(options)) { + throw new Error(`\ +This plugin requires options, for example: + { + "plugins": [ + ["", { method: "usage-pure" }] + ] + } + +See more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`); + } + let methodName; + if (method === "usage-global") methodName = "usageGlobal";else if (method === "entry-global") methodName = "entryGlobal";else if (method === "usage-pure") methodName = "usagePure";else if (typeof method !== "string") { + throw new Error(".method must be a string"); + } else { + throw new Error(`.method must be one of "entry-global", "usage-global"` + ` or "usage-pure" (received ${JSON.stringify(method)})`); + } + if (typeof shouldInjectPolyfill === "function") { + if (options.include || options.exclude) { + throw new Error(`.include and .exclude are not supported when using the` + ` .shouldInjectPolyfill function.`); + } + } else if (shouldInjectPolyfill != null) { + throw new Error(`.shouldInjectPolyfill must be a function, or undefined` + ` (received ${JSON.stringify(shouldInjectPolyfill)})`); + } + if (absoluteImports != null && typeof absoluteImports !== "boolean" && typeof absoluteImports !== "string") { + throw new Error(`.absoluteImports must be a boolean, a string, or undefined` + ` (received ${JSON.stringify(absoluteImports)})`); + } + let targets; + if ( + // If any browserslist-related option is specified, fallback to the old + // behavior of not using the targets specified in the top-level options. + targetsOption || configPath || ignoreBrowserslistConfig) { + const targetsObj = typeof targetsOption === "string" || Array.isArray(targetsOption) ? { + browsers: targetsOption + } : targetsOption; + targets = getTargets(targetsObj, { + ignoreBrowserslistConfig, + configPath + }); + } else { + targets = babelApi.targets(); + } + return { + method, + methodName, + targets, + absoluteImports: absoluteImports != null ? absoluteImports : false, + shouldInjectPolyfill, + debug: !!debug, + providerOptions: providerOptions + }; +} +function instantiateProvider(factory, options, missingDependencies, dirname, debugLog, babelApi) { + const { + method, + methodName, + targets, + debug, + shouldInjectPolyfill, + providerOptions, + absoluteImports + } = resolveOptions(options, babelApi); + + // eslint-disable-next-line prefer-const + let include, exclude; + let polyfillsSupport; + let polyfillsNames; + let filterPolyfills; + const getUtils = createUtilsGetter(new ImportsCachedInjector(moduleName => resolve(dirname, moduleName, absoluteImports), name => { + var _polyfillsNames$get, _polyfillsNames; + return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity; + })); + const depsCache = new Map(); + const api = { + babel: babelApi, + getUtils, + method: options.method, + targets, + createMetaResolver, + shouldInjectPolyfill(name) { + if (polyfillsNames === undefined) { + throw new Error(`Internal error in the ${factory.name} provider: ` + `shouldInjectPolyfill() can't be called during initialization.`); + } + if (!polyfillsNames.has(name)) { + console.warn(`Internal error in the ${providerName} provider: ` + `unknown polyfill "${name}".`); + } + if (filterPolyfills && !filterPolyfills(name)) return false; + let shouldInject = isRequired(name, targets, { + compatData: polyfillsSupport, + includes: include, + excludes: exclude + }); + if (shouldInjectPolyfill) { + shouldInject = shouldInjectPolyfill(name, shouldInject); + if (typeof shouldInject !== "boolean") { + throw new Error(`.shouldInjectPolyfill must return a boolean.`); + } + } + return shouldInject; + }, + debug(name) { + var _debugLog, _debugLog$polyfillsSu; + debugLog().found = true; + if (!debug || !name) return; + if (debugLog().polyfills.has(providerName)) return; + debugLog().polyfills.add(name); + (_debugLog$polyfillsSu = (_debugLog = debugLog()).polyfillsSupport) != null ? _debugLog$polyfillsSu : _debugLog.polyfillsSupport = polyfillsSupport; + }, + assertDependency(name, version = "*") { + if (missingDependencies === false) return; + if (absoluteImports) { + // If absoluteImports is not false, we will try resolving + // the dependency and throw if it's not possible. We can + // skip the check here. + return; + } + const dep = version === "*" ? name : `${name}@^${version}`; + const found = missingDependencies.all ? false : mapGetOr(depsCache, `${name} :: ${dirname}`, () => has()); + if (!found) { + debugLog().missingDeps.add(dep); + } + } + }; + const provider = factory(api, providerOptions, dirname); + const providerName = provider.name || factory.name; + if (typeof provider[methodName] !== "function") { + throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`); + } + if (Array.isArray(provider.polyfills)) { + polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index])); + filterPolyfills = provider.filterPolyfills; + } else if (provider.polyfills) { + polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index])); + polyfillsSupport = provider.polyfills; + filterPolyfills = provider.filterPolyfills; + } else { + polyfillsNames = new Map(); + } + ({ + include, + exclude + } = validateIncludeExclude(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || [])); + let callProvider; + if (methodName === "usageGlobal") { + callProvider = (payload, path) => { + var _ref; + const utils = getUtils(path); + return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false; + }; + } else { + callProvider = (payload, path) => { + const utils = getUtils(path); + provider[methodName](payload, utils, path); + return false; + }; + } + return { + debug, + method, + targets, + provider, + providerName, + callProvider + }; +} +function definePolyfillProvider(factory) { + return declare((babelApi, options, dirname) => { + babelApi.assertVersion("^7.0.0 || ^8.0.0-alpha.0"); + const { + traverse + } = babelApi; + let debugLog; + const missingDependencies = applyMissingDependenciesDefaults(options, babelApi); + const { + debug, + method, + targets, + provider, + providerName, + callProvider + } = instantiateProvider(factory, options, missingDependencies, dirname, () => debugLog, babelApi); + const createVisitor = method === "entry-global" ? entry : usage; + const visitor = provider.visitor ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor]) : createVisitor(callProvider); + if (debug && debug !== presetEnvSilentDebugHeader) { + console.log(`${providerName}: \`DEBUG\` option`); + console.log(`\nUsing targets: ${stringifyTargetsMultiline(targets)}`); + console.log(`\nUsing polyfills with \`${method}\` method:`); + } + const { + runtimeName + } = provider; + return { + name: "inject-polyfills", + visitor, + pre(file) { + var _provider$pre; + if (runtimeName) { + if (file.get("runtimeHelpersModuleName") && file.get("runtimeHelpersModuleName") !== runtimeName) { + console.warn(`Two different polyfill providers` + ` (${file.get("runtimeHelpersModuleProvider")}` + ` and ${providerName}) are trying to define two` + ` conflicting @babel/runtime alternatives:` + ` ${file.get("runtimeHelpersModuleName")} and ${runtimeName}.` + ` The second one will be ignored.`); + } else { + file.set("runtimeHelpersModuleName", runtimeName); + file.set("runtimeHelpersModuleProvider", providerName); + } + } + debugLog = { + polyfills: new Set(), + polyfillsSupport: undefined, + found: false, + providers: new Set(), + missingDeps: new Set() + }; + (_provider$pre = provider.pre) == null ? void 0 : _provider$pre.apply(this, arguments); + }, + post() { + var _provider$post; + (_provider$post = provider.post) == null ? void 0 : _provider$post.apply(this, arguments); + if (missingDependencies !== false) { + if (missingDependencies.log === "per-file") { + logMissing(debugLog.missingDeps); + } else { + laterLogMissing(debugLog.missingDeps); + } + } + if (!debug) return; + if (this.filename) console.log(`\n[${this.filename}]`); + if (debugLog.polyfills.size === 0) { + console.log(method === "entry-global" ? debugLog.found ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.` : `The entry point for the ${providerName} polyfill has not been found.` : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`); + return; + } + if (method === "entry-global") { + console.log(`The ${providerName} polyfill entry has been replaced with ` + `the following polyfills:`); + } else { + console.log(`The ${providerName} polyfill added the following polyfills:`); + } + for (const name of debugLog.polyfills) { + var _debugLog$polyfillsSu2; + if ((_debugLog$polyfillsSu2 = debugLog.polyfillsSupport) != null && _debugLog$polyfillsSu2[name]) { + const filteredTargets = getInclusionReasons(name, targets, debugLog.polyfillsSupport); + const formattedTargets = JSON.stringify(filteredTargets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }'); + console.log(` ${name} ${formattedTargets}`); + } else { + console.log(` ${name}`); + } + } + } + }; + }); +} +function mapGetOr(map, key, getDefault) { + let val = map.get(key); + if (val === undefined) { + val = getDefault(); + map.set(key, val); + } + return val; +} +function isEmpty(obj) { + return Object.keys(obj).length === 0; +} + +export default definePolyfillProvider; +//# sourceMappingURL=index.browser.mjs.map diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map new file mode 100644 index 00000000..3bd29042 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.browser.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.browser.mjs","sources":["../src/utils.ts","../src/imports-injector.ts","../src/debug-utils.ts","../src/normalize-options.ts","../src/visitors/usage.ts","../src/visitors/entry.ts","../src/browser/dependencies.ts","../src/meta-resolver.ts","../src/index.ts"],"sourcesContent":["import { types as t, template } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type { Utils } from \"./types\";\nimport type ImportsCachedInjector from \"./imports-injector\";\n\nexport function intersection(a: Set, b: Set): Set {\n const result = new Set();\n a.forEach(v => b.has(v) && result.add(v));\n return result;\n}\n\nexport function has(object: any, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction resolve(\n path: NodePath,\n resolved: Set = new Set(),\n): NodePath | undefined {\n if (resolved.has(path)) return;\n resolved.add(path);\n\n if (path.isVariableDeclarator()) {\n if (path.get(\"id\").isIdentifier()) {\n return resolve(path.get(\"init\"), resolved);\n }\n } else if (path.isReferencedIdentifier()) {\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return path;\n if (!binding.constant) return;\n return resolve(binding.path, resolved);\n }\n return path;\n}\n\nfunction resolveId(path: NodePath): string {\n if (\n path.isIdentifier() &&\n !path.scope.hasBinding(path.node.name, /* noGlobals */ true)\n ) {\n return path.node.name;\n }\n\n const resolved = resolve(path);\n if (resolved?.isIdentifier()) {\n return resolved.node.name;\n }\n}\n\nexport function resolveKey(\n path: NodePath,\n computed: boolean = false,\n) {\n const { scope } = path;\n if (path.isStringLiteral()) return path.node.value;\n const isIdentifier = path.isIdentifier();\n if (\n isIdentifier &&\n !(computed || (path.parent as t.MemberExpression).computed)\n ) {\n return path.node.name;\n }\n\n if (\n computed &&\n path.isMemberExpression() &&\n path.get(\"object\").isIdentifier({ name: \"Symbol\" }) &&\n !scope.hasBinding(\"Symbol\", /* noGlobals */ true)\n ) {\n const sym = resolveKey(path.get(\"property\"), path.node.computed);\n if (sym) return \"Symbol.\" + sym;\n }\n\n if (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n}\n\nexport function resolveSource(obj: NodePath): {\n id: string | null;\n placement: \"prototype\" | \"static\" | null;\n} {\n if (\n obj.isMemberExpression() &&\n obj.get(\"property\").isIdentifier({ name: \"prototype\" })\n ) {\n const id = resolveId(obj.get(\"object\"));\n\n if (id) {\n return { id, placement: \"prototype\" };\n }\n return { id: null, placement: null };\n }\n\n const id = resolveId(obj);\n if (id) {\n return { id, placement: \"static\" };\n }\n\n const path = resolve(obj);\n switch (path?.type) {\n case \"RegExpLiteral\":\n return { id: \"RegExp\", placement: \"prototype\" };\n case \"FunctionExpression\":\n return { id: \"Function\", placement: \"prototype\" };\n case \"StringLiteral\":\n return { id: \"String\", placement: \"prototype\" };\n case \"NumberLiteral\":\n return { id: \"Number\", placement: \"prototype\" };\n case \"BooleanLiteral\":\n return { id: \"Boolean\", placement: \"prototype\" };\n case \"ObjectExpression\":\n return { id: \"Object\", placement: \"prototype\" };\n case \"ArrayExpression\":\n return { id: \"Array\", placement: \"prototype\" };\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n if (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0])\n ) {\n return expression.arguments[0].value;\n }\n}\n\nfunction hoist(node: t.Node) {\n // @ts-expect-error\n node._blockHoist = 3;\n return node;\n}\n\nexport function createUtilsGetter(cache: ImportsCachedInjector) {\n return (path: NodePath): Utils => {\n const prog = path.findParent(p => p.isProgram()) as NodePath;\n\n return {\n injectGlobalImport(url, moduleName) {\n cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {\n return isScript\n ? template.statement.ast`require(${source})`\n : t.importDeclaration([], source);\n });\n },\n injectNamedImport(url, name, hint = name, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n name,\n moduleName,\n (isScript, source, name) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`\n var ${id} = require(${source}).${name}\n `)\n : t.importDeclaration([t.importSpecifier(id, name)], source),\n name: id.name,\n };\n },\n );\n },\n injectDefaultImport(url, hint = url, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n \"default\",\n moduleName,\n (isScript, source) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`var ${id} = require(${source})`)\n : t.importDeclaration([t.importDefaultSpecifier(id)], source),\n name: id.name,\n };\n },\n );\n },\n };\n };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\ntype StrMap = Map;\n\nexport default class ImportsCachedInjector {\n _imports: WeakMap, StrMap>;\n _anonymousImports: WeakMap, Set>;\n _lastImports: WeakMap<\n NodePath,\n Array<{ path: NodePath; index: number }>\n >;\n _resolver: (url: string) => string;\n _getPreferredIndex: (url: string) => number;\n\n constructor(\n resolver: (url: string) => string,\n getPreferredIndex: (url: string) => number,\n ) {\n this._imports = new WeakMap();\n this._anonymousImports = new WeakMap();\n this._lastImports = new WeakMap();\n this._resolver = resolver;\n this._getPreferredIndex = getPreferredIndex;\n }\n\n storeAnonymous(\n programPath: NodePath,\n url: string,\n moduleName: string,\n getVal: (isScript: boolean, source: t.StringLiteral) => t.Node,\n ) {\n const key = this._normalizeKey(programPath, url);\n const imports = this._ensure>(\n this._anonymousImports,\n programPath,\n Set,\n );\n\n if (imports.has(key)) return;\n\n const node = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n );\n imports.add(key);\n this._injectImport(programPath, node, moduleName);\n }\n\n storeNamed(\n programPath: NodePath,\n url: string,\n name: string,\n moduleName: string,\n getVal: (\n isScript: boolean,\n // eslint-disable-next-line no-undef\n source: t.StringLiteral,\n // eslint-disable-next-line no-undef\n name: t.Identifier,\n ) => { node: t.Node; name: string },\n ) {\n const key = this._normalizeKey(programPath, url, name);\n const imports = this._ensure>(\n this._imports,\n programPath,\n Map,\n );\n\n if (!imports.has(key)) {\n const { node, name: id } = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n t.identifier(name),\n );\n imports.set(key, id);\n this._injectImport(programPath, node, moduleName);\n }\n\n return t.identifier(imports.get(key));\n }\n\n _injectImport(\n programPath: NodePath,\n node: t.Node,\n moduleName: string,\n ) {\n const newIndex = this._getPreferredIndex(moduleName);\n const lastImports = this._lastImports.get(programPath) ?? [];\n\n const isPathStillValid = (path: NodePath) =>\n path.node &&\n // Sometimes the AST is modified and the \"last import\"\n // we have has been replaced\n path.parent === programPath.node &&\n path.container === programPath.node.body;\n\n let last: NodePath;\n\n if (newIndex === Infinity) {\n // Fast path: we can always just insert at the end if newIndex is `Infinity`\n if (lastImports.length > 0) {\n last = lastImports[lastImports.length - 1].path;\n if (!isPathStillValid(last)) last = undefined;\n }\n } else {\n for (const [i, data] of lastImports.entries()) {\n const { path, index } = data;\n if (isPathStillValid(path)) {\n if (newIndex < index) {\n const [newPath] = path.insertBefore(node);\n lastImports.splice(i, 0, { path: newPath, index: newIndex });\n return;\n }\n last = path;\n }\n }\n }\n\n if (last) {\n const [newPath] = last.insertAfter(node);\n lastImports.push({ path: newPath, index: newIndex });\n } else {\n const [newPath] = programPath.unshiftContainer(\"body\", node);\n this._lastImports.set(programPath, [{ path: newPath, index: newIndex }]);\n }\n }\n\n _ensure | Set>(\n map: WeakMap, C>,\n programPath: NodePath,\n Collection: { new (...args: any): C },\n ): C {\n let collection = map.get(programPath);\n if (!collection) {\n collection = new Collection();\n map.set(programPath, collection);\n }\n return collection;\n }\n\n _normalizeKey(\n programPath: NodePath,\n url: string,\n name: string = \"\",\n ): string {\n const { sourceType } = programPath.node;\n\n // If we rely on the imported binding (the \"name\" parameter), we also need to cache\n // based on the sourceType. This is because the module transforms change the names\n // of the import variables.\n return `${name && sourceType}::${url}::${name}`;\n }\n}\n","import { prettifyTargets } from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"./types\";\n\nexport const presetEnvSilentDebugHeader =\n \"#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets\";\n\nexport function stringifyTargetsMultiline(targets: Targets): string {\n return JSON.stringify(prettifyTargets(targets), null, 2);\n}\n\nexport function stringifyTargets(targets: Targets): string {\n return JSON.stringify(targets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n}\n","import { intersection } from \"./utils\";\nimport type {\n Pattern,\n PluginOptions,\n MissingDependenciesOption,\n} from \"./types\";\n\nfunction patternToRegExp(pattern: Pattern): RegExp | null {\n if (pattern instanceof RegExp) return pattern;\n\n try {\n return new RegExp(`^${pattern}$`);\n } catch {\n return null;\n }\n}\n\nfunction buildUnusedError(label, unused) {\n if (!unused.length) return \"\";\n return (\n ` - The following \"${label}\" patterns didn't match any polyfill:\\n` +\n unused.map(original => ` ${String(original)}\\n`).join(\"\")\n );\n}\n\nfunction buldDuplicatesError(duplicates) {\n if (!duplicates.size) return \"\";\n return (\n ` - The following polyfills were matched both by \"include\" and \"exclude\" patterns:\\n` +\n Array.from(duplicates, name => ` ${name}\\n`).join(\"\")\n );\n}\n\nexport function validateIncludeExclude(\n provider: string,\n polyfills: Map,\n includePatterns: Pattern[],\n excludePatterns: Pattern[],\n) {\n let current;\n const filter = pattern => {\n const regexp = patternToRegExp(pattern);\n if (!regexp) return false;\n\n let matched = false;\n for (const polyfill of polyfills.keys()) {\n if (regexp.test(polyfill)) {\n matched = true;\n current.add(polyfill);\n }\n }\n return !matched;\n };\n\n // prettier-ignore\n const include = current = new Set ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set ();\n const unusedExclude = Array.from(excludePatterns).filter(filter);\n\n const duplicates = intersection(include, exclude);\n\n if (\n duplicates.size > 0 ||\n unusedInclude.length > 0 ||\n unusedExclude.length > 0\n ) {\n throw new Error(\n `Error while validating the \"${provider}\" provider options:\\n` +\n buildUnusedError(\"include\", unusedInclude) +\n buildUnusedError(\"exclude\", unusedExclude) +\n buldDuplicatesError(duplicates),\n );\n }\n\n return { include, exclude };\n}\n\nexport function applyMissingDependenciesDefaults(\n options: PluginOptions,\n babelApi: any,\n): MissingDependenciesOption {\n const { missingDependencies = {} } = options;\n if (missingDependencies === false) return false;\n\n const caller = babelApi.caller(caller => caller?.name);\n\n const {\n log = \"deferred\",\n inject = caller === \"rollup-plugin-babel\" ? \"throw\" : \"import\",\n all = false,\n } = missingDependencies;\n\n return { log, inject, all };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { CallProvider } from \"./index\";\n\nimport { resolveKey, resolveSource } from \"../utils\";\n\nfunction isRemoved(path: NodePath) {\n if (path.removed) return true;\n if (!path.parentPath) return false;\n if (path.listKey) {\n if (!path.parentPath.node?.[path.listKey]?.includes(path.node)) return true;\n } else {\n if (path.parentPath.node[path.key] !== path.node) return true;\n }\n return isRemoved(path.parentPath);\n}\n\nexport default (callProvider: CallProvider) => {\n function property(object, key, placement, path) {\n return callProvider({ kind: \"property\", object, key, placement }, path);\n }\n\n function handleReferencedIdentifier(path) {\n const {\n node: { name },\n scope,\n } = path;\n if (scope.getBindingIdentifier(name)) return;\n\n callProvider({ kind: \"global\", name }, path);\n }\n\n function analyzeMemberExpression(\n path: NodePath,\n ) {\n const key = resolveKey(path.get(\"property\"), path.node.computed);\n return { key, handleAsMemberExpression: !!key && key !== \"prototype\" };\n }\n\n return {\n // Symbol(), new Promise\n ReferencedIdentifier(path: NodePath) {\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression({ object: path.node }) &&\n analyzeMemberExpression(parentPath).handleAsMemberExpression\n ) {\n return;\n }\n handleReferencedIdentifier(path);\n },\n\n \"MemberExpression|OptionalMemberExpression\"(\n path: NodePath,\n ) {\n const { key, handleAsMemberExpression } = analyzeMemberExpression(path);\n if (!handleAsMemberExpression) return;\n\n const object = path.get(\"object\");\n let objectIsGlobalIdentifier = object.isIdentifier();\n if (objectIsGlobalIdentifier) {\n const binding = object.scope.getBinding(\n (object.node as t.Identifier).name,\n );\n if (binding) {\n if (binding.path.isImportNamespaceSpecifier()) return;\n objectIsGlobalIdentifier = false;\n }\n }\n\n const source = resolveSource(object);\n let skipObject = property(source.id, key, source.placement, path);\n skipObject ||=\n !objectIsGlobalIdentifier ||\n path.shouldSkip ||\n object.shouldSkip ||\n isRemoved(object);\n\n if (!skipObject) handleReferencedIdentifier(object);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent } = path;\n let obj;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n obj = parentPath.get(\"init\");\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n obj = parentPath.get(\"right\");\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunction()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n obj = grand.get(\"arguments\")[path.key];\n }\n }\n }\n\n let id = null;\n let placement = null;\n if (obj) ({ id, placement } = resolveSource(obj));\n\n for (const prop of path.get(\"properties\")) {\n if (prop.isObjectProperty()) {\n const key = resolveKey(prop.get(\"key\"));\n if (key) property(id, key, placement, prop);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n if (!key) return;\n\n callProvider(\n {\n kind: \"in\",\n object: source.id,\n key,\n placement: source.placement,\n },\n path,\n );\n },\n };\n};\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { CallProvider } from \"./index\";\n\nimport { getImportSource, getRequireSource } from \"../utils\";\n\nexport default (callProvider: CallProvider) => ({\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n callProvider({ kind: \"import\", source }, bodyPath);\n });\n },\n});\n","export function resolve(\n dirname: string,\n moduleName: string,\n absoluteImports: boolean | string,\n): string {\n if (absoluteImports === false) return moduleName;\n\n throw new Error(\n `\"absoluteImports\" is not supported in bundles prepared for the browser.`,\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function has(basedir: string, name: string) {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function logMissing(missingDeps: Set) {}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function laterLogMissing(missingDeps: Set) {}\n","import type {\n MetaDescriptor,\n ResolverPolyfills,\n ResolvedPolyfill,\n} from \"./types\";\n\nimport { has } from \"./utils\";\n\ntype ResolverFn = (meta: MetaDescriptor) => void | ResolvedPolyfill;\n\nconst PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver(\n polyfills: ResolverPolyfills,\n): ResolverFn {\n const { static: staticP, instance: instanceP, global: globalP } = polyfills;\n\n return meta => {\n if (meta.kind === \"global\" && globalP && has(globalP, meta.name)) {\n return { kind: \"global\", desc: globalP[meta.name], name: meta.name };\n }\n\n if (meta.kind === \"property\" || meta.kind === \"in\") {\n const { placement, object, key } = meta;\n\n if (object && placement === \"static\") {\n if (globalP && PossibleGlobalObjects.has(object) && has(globalP, key)) {\n return { kind: \"global\", desc: globalP[key], name: key };\n }\n\n if (staticP && has(staticP, object) && has(staticP[object], key)) {\n return {\n kind: \"static\",\n desc: staticP[object][key],\n name: `${object}$${key}`,\n };\n }\n }\n\n if (instanceP && has(instanceP, key)) {\n return { kind: \"instance\", desc: instanceP[key], name: `${key}` };\n }\n }\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nimport _getTargets, {\n isRequired,\n getInclusionReasons,\n} from \"@babel/helper-compilation-targets\";\nconst getTargets = _getTargets.default || _getTargets;\n\nimport { createUtilsGetter } from \"./utils\";\nimport ImportsCachedInjector from \"./imports-injector\";\nimport {\n stringifyTargetsMultiline,\n presetEnvSilentDebugHeader,\n} from \"./debug-utils\";\nimport {\n validateIncludeExclude,\n applyMissingDependenciesDefaults,\n} from \"./normalize-options\";\n\nimport type {\n ProviderApi,\n MethodString,\n Targets,\n MetaDescriptor,\n PolyfillProvider,\n PluginOptions,\n ProviderOptions,\n} from \"./types\";\n\nimport * as v from \"./visitors\";\nimport * as deps from \"./node/dependencies\";\n\nimport createMetaResolver from \"./meta-resolver\";\n\nexport type { PolyfillProvider, MetaDescriptor, Utils, Targets } from \"./types\";\n\nfunction resolveOptions(\n options: PluginOptions,\n babelApi,\n): {\n method: MethodString;\n methodName: \"usageGlobal\" | \"entryGlobal\" | \"usagePure\";\n targets: Targets;\n debug: boolean | typeof presetEnvSilentDebugHeader;\n shouldInjectPolyfill:\n | ((name: string, shouldInject: boolean) => boolean)\n | undefined;\n providerOptions: ProviderOptions;\n absoluteImports: string | boolean;\n} {\n const {\n method,\n targets: targetsOption,\n ignoreBrowserslistConfig,\n configPath,\n debug,\n shouldInjectPolyfill,\n absoluteImports,\n ...providerOptions\n } = options;\n\n if (isEmpty(options)) {\n throw new Error(\n `\\\nThis plugin requires options, for example:\n {\n \"plugins\": [\n [\"\", { method: \"usage-pure\" }]\n ]\n }\n\nSee more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`,\n );\n }\n\n let methodName;\n if (method === \"usage-global\") methodName = \"usageGlobal\";\n else if (method === \"entry-global\") methodName = \"entryGlobal\";\n else if (method === \"usage-pure\") methodName = \"usagePure\";\n else if (typeof method !== \"string\") {\n throw new Error(\".method must be a string\");\n } else {\n throw new Error(\n `.method must be one of \"entry-global\", \"usage-global\"` +\n ` or \"usage-pure\" (received ${JSON.stringify(method)})`,\n );\n }\n\n if (typeof shouldInjectPolyfill === \"function\") {\n if (options.include || options.exclude) {\n throw new Error(\n `.include and .exclude are not supported when using the` +\n ` .shouldInjectPolyfill function.`,\n );\n }\n } else if (shouldInjectPolyfill != null) {\n throw new Error(\n `.shouldInjectPolyfill must be a function, or undefined` +\n ` (received ${JSON.stringify(shouldInjectPolyfill)})`,\n );\n }\n\n if (\n absoluteImports != null &&\n typeof absoluteImports !== \"boolean\" &&\n typeof absoluteImports !== \"string\"\n ) {\n throw new Error(\n `.absoluteImports must be a boolean, a string, or undefined` +\n ` (received ${JSON.stringify(absoluteImports)})`,\n );\n }\n\n let targets;\n\n if (\n // If any browserslist-related option is specified, fallback to the old\n // behavior of not using the targets specified in the top-level options.\n targetsOption ||\n configPath ||\n ignoreBrowserslistConfig\n ) {\n const targetsObj =\n typeof targetsOption === \"string\" || Array.isArray(targetsOption)\n ? { browsers: targetsOption }\n : targetsOption;\n\n targets = getTargets(targetsObj, {\n ignoreBrowserslistConfig,\n configPath,\n });\n } else {\n targets = babelApi.targets();\n }\n\n return {\n method,\n methodName,\n targets,\n absoluteImports: absoluteImports ?? false,\n shouldInjectPolyfill,\n debug: !!debug,\n providerOptions: providerOptions as any as ProviderOptions,\n };\n}\n\nfunction instantiateProvider(\n factory: PolyfillProvider,\n options: PluginOptions,\n missingDependencies,\n dirname,\n debugLog,\n babelApi,\n) {\n const {\n method,\n methodName,\n targets,\n debug,\n shouldInjectPolyfill,\n providerOptions,\n absoluteImports,\n } = resolveOptions(options, babelApi);\n\n // eslint-disable-next-line prefer-const\n let include, exclude;\n let polyfillsSupport;\n let polyfillsNames: Map | undefined;\n let filterPolyfills;\n\n const getUtils = createUtilsGetter(\n new ImportsCachedInjector(\n moduleName => deps.resolve(dirname, moduleName, absoluteImports),\n (name: string) => polyfillsNames?.get(name) ?? Infinity,\n ),\n );\n\n const depsCache = new Map();\n\n const api: ProviderApi = {\n babel: babelApi,\n getUtils,\n method: options.method,\n targets,\n createMetaResolver,\n shouldInjectPolyfill(name) {\n if (polyfillsNames === undefined) {\n throw new Error(\n `Internal error in the ${factory.name} provider: ` +\n `shouldInjectPolyfill() can't be called during initialization.`,\n );\n }\n if (!polyfillsNames.has(name)) {\n console.warn(\n `Internal error in the ${providerName} provider: ` +\n `unknown polyfill \"${name}\".`,\n );\n }\n\n if (filterPolyfills && !filterPolyfills(name)) return false;\n\n let shouldInject = isRequired(name, targets, {\n compatData: polyfillsSupport,\n includes: include,\n excludes: exclude,\n });\n\n if (shouldInjectPolyfill) {\n shouldInject = shouldInjectPolyfill(name, shouldInject);\n if (typeof shouldInject !== \"boolean\") {\n throw new Error(`.shouldInjectPolyfill must return a boolean.`);\n }\n }\n\n return shouldInject;\n },\n debug(name) {\n debugLog().found = true;\n\n if (!debug || !name) return;\n\n if (debugLog().polyfills.has(providerName)) return;\n debugLog().polyfills.add(name);\n debugLog().polyfillsSupport ??= polyfillsSupport;\n },\n assertDependency(name, version = \"*\") {\n if (missingDependencies === false) return;\n if (absoluteImports) {\n // If absoluteImports is not false, we will try resolving\n // the dependency and throw if it's not possible. We can\n // skip the check here.\n return;\n }\n\n const dep = version === \"*\" ? name : `${name}@^${version}`;\n\n const found = missingDependencies.all\n ? false\n : mapGetOr(depsCache, `${name} :: ${dirname}`, () =>\n deps.has(dirname, name),\n );\n\n if (!found) {\n debugLog().missingDeps.add(dep);\n }\n },\n };\n\n const provider = factory(api, providerOptions, dirname);\n const providerName = provider.name || factory.name;\n\n if (typeof provider[methodName] !== \"function\") {\n throw new Error(\n `The \"${providerName}\" provider doesn't support the \"${method}\" polyfilling method.`,\n );\n }\n\n if (Array.isArray(provider.polyfills)) {\n polyfillsNames = new Map(\n provider.polyfills.map((name, index) => [name, index]),\n );\n filterPolyfills = provider.filterPolyfills;\n } else if (provider.polyfills) {\n polyfillsNames = new Map(\n Object.keys(provider.polyfills).map((name, index) => [name, index]),\n );\n polyfillsSupport = provider.polyfills;\n filterPolyfills = provider.filterPolyfills;\n } else {\n polyfillsNames = new Map();\n }\n\n ({ include, exclude } = validateIncludeExclude(\n providerName,\n polyfillsNames,\n providerOptions.include || [],\n providerOptions.exclude || [],\n ));\n\n let callProvider: (payload: MetaDescriptor, path: NodePath) => boolean;\n if (methodName === \"usageGlobal\") {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n return (\n (provider[methodName](payload, utils, path) satisfies boolean) ?? false\n );\n };\n } else {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n provider[methodName](payload, utils, path) satisfies void;\n return false;\n };\n }\n\n return {\n debug,\n method,\n targets,\n provider,\n providerName,\n callProvider,\n };\n}\n\nexport default function definePolyfillProvider(\n factory: PolyfillProvider,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\n const { traverse } = babelApi;\n\n let debugLog;\n\n const missingDependencies = applyMissingDependenciesDefaults(\n options,\n babelApi,\n );\n\n const { debug, method, targets, provider, providerName, callProvider } =\n instantiateProvider(\n factory,\n options,\n missingDependencies,\n dirname,\n () => debugLog,\n babelApi,\n );\n\n const createVisitor = method === \"entry-global\" ? v.entry : v.usage;\n\n const visitor = provider.visitor\n ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor])\n : createVisitor(callProvider);\n\n if (debug && debug !== presetEnvSilentDebugHeader) {\n console.log(`${providerName}: \\`DEBUG\\` option`);\n console.log(`\\nUsing targets: ${stringifyTargetsMultiline(targets)}`);\n console.log(`\\nUsing polyfills with \\`${method}\\` method:`);\n }\n\n const { runtimeName } = provider;\n\n return {\n name: \"inject-polyfills\",\n visitor,\n\n pre(file) {\n if (runtimeName) {\n if (\n file.get(\"runtimeHelpersModuleName\") &&\n file.get(\"runtimeHelpersModuleName\") !== runtimeName\n ) {\n console.warn(\n `Two different polyfill providers` +\n ` (${file.get(\"runtimeHelpersModuleProvider\")}` +\n ` and ${providerName}) are trying to define two` +\n ` conflicting @babel/runtime alternatives:` +\n ` ${file.get(\"runtimeHelpersModuleName\")} and ${runtimeName}.` +\n ` The second one will be ignored.`,\n );\n } else {\n file.set(\"runtimeHelpersModuleName\", runtimeName);\n file.set(\"runtimeHelpersModuleProvider\", providerName);\n }\n }\n\n debugLog = {\n polyfills: new Set(),\n polyfillsSupport: undefined,\n found: false,\n providers: new Set(),\n missingDeps: new Set(),\n };\n\n provider.pre?.apply(this, arguments);\n },\n post() {\n provider.post?.apply(this, arguments);\n\n if (missingDependencies !== false) {\n if (missingDependencies.log === \"per-file\") {\n deps.logMissing(debugLog.missingDeps);\n } else {\n deps.laterLogMissing(debugLog.missingDeps);\n }\n }\n\n if (!debug) return;\n\n if (this.filename) console.log(`\\n[${this.filename}]`);\n\n if (debugLog.polyfills.size === 0) {\n console.log(\n method === \"entry-global\"\n ? debugLog.found\n ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.`\n : `The entry point for the ${providerName} polyfill has not been found.`\n : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`,\n );\n\n return;\n }\n\n if (method === \"entry-global\") {\n console.log(\n `The ${providerName} polyfill entry has been replaced with ` +\n `the following polyfills:`,\n );\n } else {\n console.log(\n `The ${providerName} polyfill added the following polyfills:`,\n );\n }\n\n for (const name of debugLog.polyfills) {\n if (debugLog.polyfillsSupport?.[name]) {\n const filteredTargets = getInclusionReasons(\n name,\n targets,\n debugLog.polyfillsSupport,\n );\n\n const formattedTargets = JSON.stringify(filteredTargets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${name} ${formattedTargets}`);\n } else {\n console.log(` ${name}`);\n }\n }\n },\n };\n });\n}\n\nfunction mapGetOr(map, key, getDefault) {\n let val = map.get(key);\n if (val === undefined) {\n val = getDefault();\n map.set(key, val);\n }\n return val;\n}\n\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n"],"names":["types","t","template","_babel","default","intersection","a","b","result","Set","forEach","v","has","add","object","key","Object","prototype","hasOwnProperty","call","resolve","path","resolved","isVariableDeclarator","get","isIdentifier","isReferencedIdentifier","binding","scope","getBinding","node","name","constant","resolveId","hasBinding","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","sym","isPure","evaluate","resolveSource","obj","id","placement","type","getImportSource","specifiers","length","source","getRequireSource","isExpressionStatement","expression","isCallExpression","callee","arguments","hoist","_blockHoist","createUtilsGetter","cache","prog","findParent","p","isProgram","injectGlobalImport","url","moduleName","storeAnonymous","isScript","statement","ast","importDeclaration","injectNamedImport","hint","storeNamed","generateUidIdentifier","importSpecifier","injectDefaultImport","importDefaultSpecifier","ImportsCachedInjector","constructor","resolver","getPreferredIndex","_imports","WeakMap","_anonymousImports","_lastImports","_resolver","_getPreferredIndex","programPath","getVal","_normalizeKey","imports","_ensure","sourceType","stringLiteral","_injectImport","Map","identifier","set","_this$_lastImports$ge","newIndex","lastImports","isPathStillValid","container","body","last","Infinity","undefined","i","data","entries","index","newPath","insertBefore","splice","insertAfter","push","unshiftContainer","map","Collection","collection","presetEnvSilentDebugHeader","stringifyTargetsMultiline","targets","JSON","stringify","prettifyTargets","patternToRegExp","pattern","RegExp","buildUnusedError","label","unused","original","String","join","buldDuplicatesError","duplicates","size","Array","from","validateIncludeExclude","provider","polyfills","includePatterns","excludePatterns","current","filter","regexp","matched","polyfill","keys","test","include","unusedInclude","exclude","unusedExclude","Error","applyMissingDependenciesDefaults","options","babelApi","missingDependencies","caller","log","inject","all","isRemoved","removed","parentPath","listKey","_path$parentPath$node","includes","callProvider","property","kind","handleReferencedIdentifier","getBindingIdentifier","analyzeMemberExpression","handleAsMemberExpression","ReferencedIdentifier","MemberExpression|OptionalMemberExpression","objectIsGlobalIdentifier","isImportNamespaceSpecifier","skipObject","shouldSkip","ObjectPattern","isAssignmentExpression","isFunction","grand","isNewExpression","prop","isObjectProperty","BinaryExpression","operator","ImportDeclaration","Program","bodyPath","dirname","absoluteImports","basedir","logMissing","missingDeps","laterLogMissing","PossibleGlobalObjects","createMetaResolver","static","staticP","instance","instanceP","global","globalP","meta","desc","getTargets","_getTargets","resolveOptions","method","targetsOption","ignoreBrowserslistConfig","configPath","debug","shouldInjectPolyfill","providerOptions","isEmpty","methodName","targetsObj","isArray","browsers","instantiateProvider","factory","debugLog","polyfillsSupport","polyfillsNames","filterPolyfills","getUtils","deps","_polyfillsNames$get","_polyfillsNames","depsCache","api","babel","console","warn","providerName","shouldInject","isRequired","compatData","excludes","_debugLog","_debugLog$polyfillsSu","found","assertDependency","version","dep","mapGetOr","payload","_ref","utils","definePolyfillProvider","declare","assertVersion","traverse","createVisitor","visitor","visitors","merge","runtimeName","pre","file","_provider$pre","providers","apply","post","_provider$post","filename","_debugLog$polyfillsSu2","filteredTargets","getInclusionReasons","formattedTargets","replace","getDefault","val"],"mappings":";;;;;EAASA,KAAK,EAAIC,GAAC;EAAEC,QAAQ,EAARA;AAAQ,IAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA;AAKtB,SAASE,YAAYA,CAAIC,CAAS,EAAEC,CA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3G,GAAG,EAAE6Q,UAAU,EAAE;EACtC,IAAIC,GAAG,GAAGnK,GAAG,CAAClG,GAAG,CAACT,GAAG,CAAC;EACtB,IAAI8Q,GAAG,KAAK9K,SAAS,EAAE;IACrB8K,GAAG,GAAGD,UAAU,EAAE;IAClBlK,GAAG,CAACpB,GAAG,CAACvF,GAAG,EAAE8Q,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAAS1D,OAAOA,CAACtL,GAAG,EAAE;EACpB,OAAO7B,MAAM,CAAC2I,IAAI,CAAC9G,GAAG,CAAC,CAACM,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs new file mode 100644 index 00000000..e8d60303 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs @@ -0,0 +1,879 @@ +import { declare } from '@babel/helper-plugin-utils'; +import _getTargets, { prettifyTargets, getInclusionReasons, isRequired } from '@babel/helper-compilation-targets'; +import * as _babel from '@babel/core'; +import path from 'path'; +import debounce from 'lodash.debounce'; +import requireResolve from 'resolve'; +import { createRequire } from 'module'; + +const { + types: t$1, + template: template +} = _babel.default || _babel; +function intersection(a, b) { + const result = new Set(); + a.forEach(v => b.has(v) && result.add(v)); + return result; +} +function has$1(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); +} +function resolve$1(path, resolved = new Set()) { + if (resolved.has(path)) return; + resolved.add(path); + if (path.isVariableDeclarator()) { + if (path.get("id").isIdentifier()) { + return resolve$1(path.get("init"), resolved); + } + } else if (path.isReferencedIdentifier()) { + const binding = path.scope.getBinding(path.node.name); + if (!binding) return path; + if (!binding.constant) return; + return resolve$1(binding.path, resolved); + } + return path; +} +function resolveId(path) { + if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) { + return path.node.name; + } + const resolved = resolve$1(path); + if (resolved != null && resolved.isIdentifier()) { + return resolved.node.name; + } +} +function resolveKey(path, computed = false) { + const { + scope + } = path; + if (path.isStringLiteral()) return path.node.value; + const isIdentifier = path.isIdentifier(); + if (isIdentifier && !(computed || path.parent.computed)) { + return path.node.name; + } + if (computed && path.isMemberExpression() && path.get("object").isIdentifier({ + name: "Symbol" + }) && !scope.hasBinding("Symbol", /* noGlobals */true)) { + const sym = resolveKey(path.get("property"), path.node.computed); + if (sym) return "Symbol." + sym; + } + if (isIdentifier ? scope.hasBinding(path.node.name, /* noGlobals */true) : path.isPure()) { + const { + value + } = path.evaluate(); + if (typeof value === "string") return value; + } +} +function resolveSource(obj) { + if (obj.isMemberExpression() && obj.get("property").isIdentifier({ + name: "prototype" + })) { + const id = resolveId(obj.get("object")); + if (id) { + return { + id, + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; + } + const id = resolveId(obj); + if (id) { + return { + id, + placement: "static" + }; + } + const path = resolve$1(obj); + switch (path == null ? void 0 : path.type) { + case "RegExpLiteral": + return { + id: "RegExp", + placement: "prototype" + }; + case "FunctionExpression": + return { + id: "Function", + placement: "prototype" + }; + case "StringLiteral": + return { + id: "String", + placement: "prototype" + }; + case "NumberLiteral": + return { + id: "Number", + placement: "prototype" + }; + case "BooleanLiteral": + return { + id: "Boolean", + placement: "prototype" + }; + case "ObjectExpression": + return { + id: "Object", + placement: "prototype" + }; + case "ArrayExpression": + return { + id: "Array", + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; +} +function getImportSource({ + node +}) { + if (node.specifiers.length === 0) return node.source.value; +} +function getRequireSource({ + node +}) { + if (!t$1.isExpressionStatement(node)) return; + const { + expression + } = node; + if (t$1.isCallExpression(expression) && t$1.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t$1.isStringLiteral(expression.arguments[0])) { + return expression.arguments[0].value; + } +} +function hoist(node) { + // @ts-expect-error + node._blockHoist = 3; + return node; +} +function createUtilsGetter(cache) { + return path => { + const prog = path.findParent(p => p.isProgram()); + return { + injectGlobalImport(url, moduleName) { + cache.storeAnonymous(prog, url, moduleName, (isScript, source) => { + return isScript ? template.statement.ast`require(${source})` : t$1.importDeclaration([], source); + }); + }, + injectNamedImport(url, name, hint = name, moduleName) { + return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast` + var ${id} = require(${source}).${name} + `) : t$1.importDeclaration([t$1.importSpecifier(id, name)], source), + name: id.name + }; + }); + }, + injectDefaultImport(url, hint = url, moduleName) { + return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t$1.importDeclaration([t$1.importDefaultSpecifier(id)], source), + name: id.name + }; + }); + } + }; + }; +} + +const { + types: t +} = _babel.default || _babel; +class ImportsCachedInjector { + constructor(resolver, getPreferredIndex) { + this._imports = new WeakMap(); + this._anonymousImports = new WeakMap(); + this._lastImports = new WeakMap(); + this._resolver = resolver; + this._getPreferredIndex = getPreferredIndex; + } + storeAnonymous(programPath, url, moduleName, getVal) { + const key = this._normalizeKey(programPath, url); + const imports = this._ensure(this._anonymousImports, programPath, Set); + if (imports.has(key)) return; + const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url))); + imports.add(key); + this._injectImport(programPath, node, moduleName); + } + storeNamed(programPath, url, name, moduleName, getVal) { + const key = this._normalizeKey(programPath, url, name); + const imports = this._ensure(this._imports, programPath, Map); + if (!imports.has(key)) { + const { + node, + name: id + } = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name)); + imports.set(key, id); + this._injectImport(programPath, node, moduleName); + } + return t.identifier(imports.get(key)); + } + _injectImport(programPath, node, moduleName) { + var _this$_lastImports$ge; + const newIndex = this._getPreferredIndex(moduleName); + const lastImports = (_this$_lastImports$ge = this._lastImports.get(programPath)) != null ? _this$_lastImports$ge : []; + const isPathStillValid = path => path.node && + // Sometimes the AST is modified and the "last import" + // we have has been replaced + path.parent === programPath.node && path.container === programPath.node.body; + let last; + if (newIndex === Infinity) { + // Fast path: we can always just insert at the end if newIndex is `Infinity` + if (lastImports.length > 0) { + last = lastImports[lastImports.length - 1].path; + if (!isPathStillValid(last)) last = undefined; + } + } else { + for (const [i, data] of lastImports.entries()) { + const { + path, + index + } = data; + if (isPathStillValid(path)) { + if (newIndex < index) { + const [newPath] = path.insertBefore(node); + lastImports.splice(i, 0, { + path: newPath, + index: newIndex + }); + return; + } + last = path; + } + } + } + if (last) { + const [newPath] = last.insertAfter(node); + lastImports.push({ + path: newPath, + index: newIndex + }); + } else { + const [newPath] = programPath.unshiftContainer("body", node); + this._lastImports.set(programPath, [{ + path: newPath, + index: newIndex + }]); + } + } + _ensure(map, programPath, Collection) { + let collection = map.get(programPath); + if (!collection) { + collection = new Collection(); + map.set(programPath, collection); + } + return collection; + } + _normalizeKey(programPath, url, name = "") { + const { + sourceType + } = programPath.node; + + // If we rely on the imported binding (the "name" parameter), we also need to cache + // based on the sourceType. This is because the module transforms change the names + // of the import variables. + return `${name && sourceType}::${url}::${name}`; + } +} + +const presetEnvSilentDebugHeader = "#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets"; +function stringifyTargetsMultiline(targets) { + return JSON.stringify(prettifyTargets(targets), null, 2); +} + +function patternToRegExp(pattern) { + if (pattern instanceof RegExp) return pattern; + try { + return new RegExp(`^${pattern}$`); + } catch { + return null; + } +} +function buildUnusedError(label, unused) { + if (!unused.length) return ""; + return ` - The following "${label}" patterns didn't match any polyfill:\n` + unused.map(original => ` ${String(original)}\n`).join(""); +} +function buldDuplicatesError(duplicates) { + if (!duplicates.size) return ""; + return ` - The following polyfills were matched both by "include" and "exclude" patterns:\n` + Array.from(duplicates, name => ` ${name}\n`).join(""); +} +function validateIncludeExclude(provider, polyfills, includePatterns, excludePatterns) { + let current; + const filter = pattern => { + const regexp = patternToRegExp(pattern); + if (!regexp) return false; + let matched = false; + for (const polyfill of polyfills.keys()) { + if (regexp.test(polyfill)) { + matched = true; + current.add(polyfill); + } + } + return !matched; + }; + + // prettier-ignore + const include = current = new Set(); + const unusedInclude = Array.from(includePatterns).filter(filter); + + // prettier-ignore + const exclude = current = new Set(); + const unusedExclude = Array.from(excludePatterns).filter(filter); + const duplicates = intersection(include, exclude); + if (duplicates.size > 0 || unusedInclude.length > 0 || unusedExclude.length > 0) { + throw new Error(`Error while validating the "${provider}" provider options:\n` + buildUnusedError("include", unusedInclude) + buildUnusedError("exclude", unusedExclude) + buldDuplicatesError(duplicates)); + } + return { + include, + exclude + }; +} +function applyMissingDependenciesDefaults(options, babelApi) { + const { + missingDependencies = {} + } = options; + if (missingDependencies === false) return false; + const caller = babelApi.caller(caller => caller == null ? void 0 : caller.name); + const { + log = "deferred", + inject = caller === "rollup-plugin-babel" ? "throw" : "import", + all = false + } = missingDependencies; + return { + log, + inject, + all + }; +} + +function isRemoved(path) { + if (path.removed) return true; + if (!path.parentPath) return false; + if (path.listKey) { + var _path$parentPath$node; + if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true; + } else { + if (path.parentPath.node[path.key] !== path.node) return true; + } + return isRemoved(path.parentPath); +} +var usage = (callProvider => { + function property(object, key, placement, path) { + return callProvider({ + kind: "property", + object, + key, + placement + }, path); + } + function handleReferencedIdentifier(path) { + const { + node: { + name + }, + scope + } = path; + if (scope.getBindingIdentifier(name)) return; + callProvider({ + kind: "global", + name + }, path); + } + function analyzeMemberExpression(path) { + const key = resolveKey(path.get("property"), path.node.computed); + return { + key, + handleAsMemberExpression: !!key && key !== "prototype" + }; + } + return { + // Symbol(), new Promise + ReferencedIdentifier(path) { + const { + parentPath + } = path; + if (parentPath.isMemberExpression({ + object: path.node + }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) { + return; + } + handleReferencedIdentifier(path); + }, + "MemberExpression|OptionalMemberExpression"(path) { + const { + key, + handleAsMemberExpression + } = analyzeMemberExpression(path); + if (!handleAsMemberExpression) return; + const object = path.get("object"); + let objectIsGlobalIdentifier = object.isIdentifier(); + if (objectIsGlobalIdentifier) { + const binding = object.scope.getBinding(object.node.name); + if (binding) { + if (binding.path.isImportNamespaceSpecifier()) return; + objectIsGlobalIdentifier = false; + } + } + const source = resolveSource(object); + let skipObject = property(source.id, key, source.placement, path); + skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object)); + if (!skipObject) handleReferencedIdentifier(object); + }, + ObjectPattern(path) { + const { + parentPath, + parent + } = path; + let obj; + + // const { keys, values } = Object + if (parentPath.isVariableDeclarator()) { + obj = parentPath.get("init"); + // ({ keys, values } = Object) + } else if (parentPath.isAssignmentExpression()) { + obj = parentPath.get("right"); + // !function ({ keys, values }) {...} (Object) + // resolution does not work after properties transform :-( + } else if (parentPath.isFunction()) { + const grand = parentPath.parentPath; + if (grand.isCallExpression() || grand.isNewExpression()) { + if (grand.node.callee === parent) { + obj = grand.get("arguments")[path.key]; + } + } + } + let id = null; + let placement = null; + if (obj) ({ + id, + placement + } = resolveSource(obj)); + for (const prop of path.get("properties")) { + if (prop.isObjectProperty()) { + const key = resolveKey(prop.get("key")); + if (key) property(id, key, placement, prop); + } + } + }, + BinaryExpression(path) { + if (path.node.operator !== "in") return; + const source = resolveSource(path.get("right")); + const key = resolveKey(path.get("left"), true); + if (!key) return; + callProvider({ + kind: "in", + object: source.id, + key, + placement: source.placement + }, path); + } + }; +}); + +var entry = (callProvider => ({ + ImportDeclaration(path) { + const source = getImportSource(path); + if (!source) return; + callProvider({ + kind: "import", + source + }, path); + }, + Program(path) { + path.get("body").forEach(bodyPath => { + const source = getRequireSource(bodyPath); + if (!source) return; + callProvider({ + kind: "import", + source + }, bodyPath); + }); + } +})); + +const nativeRequireResolve = parseFloat(process.versions.node) >= 8.9; +const require = createRequire(import /*::(_)*/.meta.url); // eslint-disable-line + +function myResolve(name, basedir) { + if (nativeRequireResolve) { + return require.resolve(name, { + paths: [basedir] + }).replace(/\\/g, "/"); + } else { + return requireResolve.sync(name, { + basedir + }).replace(/\\/g, "/"); + } +} +function resolve(dirname, moduleName, absoluteImports) { + if (absoluteImports === false) return moduleName; + let basedir = dirname; + if (typeof absoluteImports === "string") { + basedir = path.resolve(basedir, absoluteImports); + } + try { + return myResolve(moduleName, basedir); + } catch (err) { + if (err.code !== "MODULE_NOT_FOUND") throw err; + throw Object.assign(new Error(`Failed to resolve "${moduleName}" relative to "${dirname}"`), { + code: "BABEL_POLYFILL_NOT_FOUND", + polyfill: moduleName, + dirname + }); + } +} +function has(basedir, name) { + try { + myResolve(name, basedir); + return true; + } catch { + return false; + } +} +function logMissing(missingDeps) { + if (missingDeps.size === 0) return; + const deps = Array.from(missingDeps).sort().join(" "); + console.warn("\nSome polyfills have been added but are not present in your dependencies.\n" + "Please run one of the following commands:\n" + `\tnpm install --save ${deps}\n` + `\tyarn add ${deps}\n`); + process.exitCode = 1; +} +let allMissingDeps = new Set(); +const laterLogMissingDependencies = debounce(() => { + logMissing(allMissingDeps); + allMissingDeps = new Set(); +}, 100); +function laterLogMissing(missingDeps) { + if (missingDeps.size === 0) return; + missingDeps.forEach(name => allMissingDeps.add(name)); + laterLogMissingDependencies(); +} + +const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]); +function createMetaResolver(polyfills) { + const { + static: staticP, + instance: instanceP, + global: globalP + } = polyfills; + return meta => { + if (meta.kind === "global" && globalP && has$1(globalP, meta.name)) { + return { + kind: "global", + desc: globalP[meta.name], + name: meta.name + }; + } + if (meta.kind === "property" || meta.kind === "in") { + const { + placement, + object, + key + } = meta; + if (object && placement === "static") { + if (globalP && PossibleGlobalObjects.has(object) && has$1(globalP, key)) { + return { + kind: "global", + desc: globalP[key], + name: key + }; + } + if (staticP && has$1(staticP, object) && has$1(staticP[object], key)) { + return { + kind: "static", + desc: staticP[object][key], + name: `${object}$${key}` + }; + } + } + if (instanceP && has$1(instanceP, key)) { + return { + kind: "instance", + desc: instanceP[key], + name: `${key}` + }; + } + } + }; +} + +const getTargets = _getTargets.default || _getTargets; +function resolveOptions(options, babelApi) { + const { + method, + targets: targetsOption, + ignoreBrowserslistConfig, + configPath, + debug, + shouldInjectPolyfill, + absoluteImports, + ...providerOptions + } = options; + if (isEmpty(options)) { + throw new Error(`\ +This plugin requires options, for example: + { + "plugins": [ + ["", { method: "usage-pure" }] + ] + } + +See more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`); + } + let methodName; + if (method === "usage-global") methodName = "usageGlobal";else if (method === "entry-global") methodName = "entryGlobal";else if (method === "usage-pure") methodName = "usagePure";else if (typeof method !== "string") { + throw new Error(".method must be a string"); + } else { + throw new Error(`.method must be one of "entry-global", "usage-global"` + ` or "usage-pure" (received ${JSON.stringify(method)})`); + } + if (typeof shouldInjectPolyfill === "function") { + if (options.include || options.exclude) { + throw new Error(`.include and .exclude are not supported when using the` + ` .shouldInjectPolyfill function.`); + } + } else if (shouldInjectPolyfill != null) { + throw new Error(`.shouldInjectPolyfill must be a function, or undefined` + ` (received ${JSON.stringify(shouldInjectPolyfill)})`); + } + if (absoluteImports != null && typeof absoluteImports !== "boolean" && typeof absoluteImports !== "string") { + throw new Error(`.absoluteImports must be a boolean, a string, or undefined` + ` (received ${JSON.stringify(absoluteImports)})`); + } + let targets; + if ( + // If any browserslist-related option is specified, fallback to the old + // behavior of not using the targets specified in the top-level options. + targetsOption || configPath || ignoreBrowserslistConfig) { + const targetsObj = typeof targetsOption === "string" || Array.isArray(targetsOption) ? { + browsers: targetsOption + } : targetsOption; + targets = getTargets(targetsObj, { + ignoreBrowserslistConfig, + configPath + }); + } else { + targets = babelApi.targets(); + } + return { + method, + methodName, + targets, + absoluteImports: absoluteImports != null ? absoluteImports : false, + shouldInjectPolyfill, + debug: !!debug, + providerOptions: providerOptions + }; +} +function instantiateProvider(factory, options, missingDependencies, dirname, debugLog, babelApi) { + const { + method, + methodName, + targets, + debug, + shouldInjectPolyfill, + providerOptions, + absoluteImports + } = resolveOptions(options, babelApi); + + // eslint-disable-next-line prefer-const + let include, exclude; + let polyfillsSupport; + let polyfillsNames; + let filterPolyfills; + const getUtils = createUtilsGetter(new ImportsCachedInjector(moduleName => resolve(dirname, moduleName, absoluteImports), name => { + var _polyfillsNames$get, _polyfillsNames; + return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity; + })); + const depsCache = new Map(); + const api = { + babel: babelApi, + getUtils, + method: options.method, + targets, + createMetaResolver, + shouldInjectPolyfill(name) { + if (polyfillsNames === undefined) { + throw new Error(`Internal error in the ${factory.name} provider: ` + `shouldInjectPolyfill() can't be called during initialization.`); + } + if (!polyfillsNames.has(name)) { + console.warn(`Internal error in the ${providerName} provider: ` + `unknown polyfill "${name}".`); + } + if (filterPolyfills && !filterPolyfills(name)) return false; + let shouldInject = isRequired(name, targets, { + compatData: polyfillsSupport, + includes: include, + excludes: exclude + }); + if (shouldInjectPolyfill) { + shouldInject = shouldInjectPolyfill(name, shouldInject); + if (typeof shouldInject !== "boolean") { + throw new Error(`.shouldInjectPolyfill must return a boolean.`); + } + } + return shouldInject; + }, + debug(name) { + var _debugLog, _debugLog$polyfillsSu; + debugLog().found = true; + if (!debug || !name) return; + if (debugLog().polyfills.has(providerName)) return; + debugLog().polyfills.add(name); + (_debugLog$polyfillsSu = (_debugLog = debugLog()).polyfillsSupport) != null ? _debugLog$polyfillsSu : _debugLog.polyfillsSupport = polyfillsSupport; + }, + assertDependency(name, version = "*") { + if (missingDependencies === false) return; + if (absoluteImports) { + // If absoluteImports is not false, we will try resolving + // the dependency and throw if it's not possible. We can + // skip the check here. + return; + } + const dep = version === "*" ? name : `${name}@^${version}`; + const found = missingDependencies.all ? false : mapGetOr(depsCache, `${name} :: ${dirname}`, () => has(dirname, name)); + if (!found) { + debugLog().missingDeps.add(dep); + } + } + }; + const provider = factory(api, providerOptions, dirname); + const providerName = provider.name || factory.name; + if (typeof provider[methodName] !== "function") { + throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`); + } + if (Array.isArray(provider.polyfills)) { + polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index])); + filterPolyfills = provider.filterPolyfills; + } else if (provider.polyfills) { + polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index])); + polyfillsSupport = provider.polyfills; + filterPolyfills = provider.filterPolyfills; + } else { + polyfillsNames = new Map(); + } + ({ + include, + exclude + } = validateIncludeExclude(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || [])); + let callProvider; + if (methodName === "usageGlobal") { + callProvider = (payload, path) => { + var _ref; + const utils = getUtils(path); + return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false; + }; + } else { + callProvider = (payload, path) => { + const utils = getUtils(path); + provider[methodName](payload, utils, path); + return false; + }; + } + return { + debug, + method, + targets, + provider, + providerName, + callProvider + }; +} +function definePolyfillProvider(factory) { + return declare((babelApi, options, dirname) => { + babelApi.assertVersion("^7.0.0 || ^8.0.0-alpha.0"); + const { + traverse + } = babelApi; + let debugLog; + const missingDependencies = applyMissingDependenciesDefaults(options, babelApi); + const { + debug, + method, + targets, + provider, + providerName, + callProvider + } = instantiateProvider(factory, options, missingDependencies, dirname, () => debugLog, babelApi); + const createVisitor = method === "entry-global" ? entry : usage; + const visitor = provider.visitor ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor]) : createVisitor(callProvider); + if (debug && debug !== presetEnvSilentDebugHeader) { + console.log(`${providerName}: \`DEBUG\` option`); + console.log(`\nUsing targets: ${stringifyTargetsMultiline(targets)}`); + console.log(`\nUsing polyfills with \`${method}\` method:`); + } + const { + runtimeName + } = provider; + return { + name: "inject-polyfills", + visitor, + pre(file) { + var _provider$pre; + if (runtimeName) { + if (file.get("runtimeHelpersModuleName") && file.get("runtimeHelpersModuleName") !== runtimeName) { + console.warn(`Two different polyfill providers` + ` (${file.get("runtimeHelpersModuleProvider")}` + ` and ${providerName}) are trying to define two` + ` conflicting @babel/runtime alternatives:` + ` ${file.get("runtimeHelpersModuleName")} and ${runtimeName}.` + ` The second one will be ignored.`); + } else { + file.set("runtimeHelpersModuleName", runtimeName); + file.set("runtimeHelpersModuleProvider", providerName); + } + } + debugLog = { + polyfills: new Set(), + polyfillsSupport: undefined, + found: false, + providers: new Set(), + missingDeps: new Set() + }; + (_provider$pre = provider.pre) == null ? void 0 : _provider$pre.apply(this, arguments); + }, + post() { + var _provider$post; + (_provider$post = provider.post) == null ? void 0 : _provider$post.apply(this, arguments); + if (missingDependencies !== false) { + if (missingDependencies.log === "per-file") { + logMissing(debugLog.missingDeps); + } else { + laterLogMissing(debugLog.missingDeps); + } + } + if (!debug) return; + if (this.filename) console.log(`\n[${this.filename}]`); + if (debugLog.polyfills.size === 0) { + console.log(method === "entry-global" ? debugLog.found ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.` : `The entry point for the ${providerName} polyfill has not been found.` : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`); + return; + } + if (method === "entry-global") { + console.log(`The ${providerName} polyfill entry has been replaced with ` + `the following polyfills:`); + } else { + console.log(`The ${providerName} polyfill added the following polyfills:`); + } + for (const name of debugLog.polyfills) { + var _debugLog$polyfillsSu2; + if ((_debugLog$polyfillsSu2 = debugLog.polyfillsSupport) != null && _debugLog$polyfillsSu2[name]) { + const filteredTargets = getInclusionReasons(name, targets, debugLog.polyfillsSupport); + const formattedTargets = JSON.stringify(filteredTargets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }'); + console.log(` ${name} ${formattedTargets}`); + } else { + console.log(` ${name}`); + } + } + } + }; + }); +} +function mapGetOr(map, key, getDefault) { + let val = map.get(key); + if (val === undefined) { + val = getDefault(); + map.set(key, val); + } + return val; +} +function isEmpty(obj) { + return Object.keys(obj).length === 0; +} + +export default definePolyfillProvider; +//# sourceMappingURL=index.node.mjs.map diff --git a/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map new file mode 100644 index 00000000..bfb76031 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/esm/index.node.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.node.mjs","sources":["../src/utils.ts","../src/imports-injector.ts","../src/debug-utils.ts","../src/normalize-options.ts","../src/visitors/usage.ts","../src/visitors/entry.ts","../src/node/dependencies.ts","../src/meta-resolver.ts","../src/index.ts"],"sourcesContent":["import { types as t, template } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type { Utils } from \"./types\";\nimport type ImportsCachedInjector from \"./imports-injector\";\n\nexport function intersection(a: Set, b: Set): Set {\n const result = new Set();\n a.forEach(v => b.has(v) && result.add(v));\n return result;\n}\n\nexport function has(object: any, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction resolve(\n path: NodePath,\n resolved: Set = new Set(),\n): NodePath | undefined {\n if (resolved.has(path)) return;\n resolved.add(path);\n\n if (path.isVariableDeclarator()) {\n if (path.get(\"id\").isIdentifier()) {\n return resolve(path.get(\"init\"), resolved);\n }\n } else if (path.isReferencedIdentifier()) {\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return path;\n if (!binding.constant) return;\n return resolve(binding.path, resolved);\n }\n return path;\n}\n\nfunction resolveId(path: NodePath): string {\n if (\n path.isIdentifier() &&\n !path.scope.hasBinding(path.node.name, /* noGlobals */ true)\n ) {\n return path.node.name;\n }\n\n const resolved = resolve(path);\n if (resolved?.isIdentifier()) {\n return resolved.node.name;\n }\n}\n\nexport function resolveKey(\n path: NodePath,\n computed: boolean = false,\n) {\n const { scope } = path;\n if (path.isStringLiteral()) return path.node.value;\n const isIdentifier = path.isIdentifier();\n if (\n isIdentifier &&\n !(computed || (path.parent as t.MemberExpression).computed)\n ) {\n return path.node.name;\n }\n\n if (\n computed &&\n path.isMemberExpression() &&\n path.get(\"object\").isIdentifier({ name: \"Symbol\" }) &&\n !scope.hasBinding(\"Symbol\", /* noGlobals */ true)\n ) {\n const sym = resolveKey(path.get(\"property\"), path.node.computed);\n if (sym) return \"Symbol.\" + sym;\n }\n\n if (\n isIdentifier\n ? scope.hasBinding(path.node.name, /* noGlobals */ true)\n : path.isPure()\n ) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n}\n\nexport function resolveSource(obj: NodePath): {\n id: string | null;\n placement: \"prototype\" | \"static\" | null;\n} {\n if (\n obj.isMemberExpression() &&\n obj.get(\"property\").isIdentifier({ name: \"prototype\" })\n ) {\n const id = resolveId(obj.get(\"object\"));\n\n if (id) {\n return { id, placement: \"prototype\" };\n }\n return { id: null, placement: null };\n }\n\n const id = resolveId(obj);\n if (id) {\n return { id, placement: \"static\" };\n }\n\n const path = resolve(obj);\n switch (path?.type) {\n case \"RegExpLiteral\":\n return { id: \"RegExp\", placement: \"prototype\" };\n case \"FunctionExpression\":\n return { id: \"Function\", placement: \"prototype\" };\n case \"StringLiteral\":\n return { id: \"String\", placement: \"prototype\" };\n case \"NumberLiteral\":\n return { id: \"Number\", placement: \"prototype\" };\n case \"BooleanLiteral\":\n return { id: \"Boolean\", placement: \"prototype\" };\n case \"ObjectExpression\":\n return { id: \"Object\", placement: \"prototype\" };\n case \"ArrayExpression\":\n return { id: \"Array\", placement: \"prototype\" };\n }\n\n return { id: null, placement: null };\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n if (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0])\n ) {\n return expression.arguments[0].value;\n }\n}\n\nfunction hoist(node: t.Node) {\n // @ts-expect-error\n node._blockHoist = 3;\n return node;\n}\n\nexport function createUtilsGetter(cache: ImportsCachedInjector) {\n return (path: NodePath): Utils => {\n const prog = path.findParent(p => p.isProgram()) as NodePath;\n\n return {\n injectGlobalImport(url, moduleName) {\n cache.storeAnonymous(prog, url, moduleName, (isScript, source) => {\n return isScript\n ? template.statement.ast`require(${source})`\n : t.importDeclaration([], source);\n });\n },\n injectNamedImport(url, name, hint = name, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n name,\n moduleName,\n (isScript, source, name) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`\n var ${id} = require(${source}).${name}\n `)\n : t.importDeclaration([t.importSpecifier(id, name)], source),\n name: id.name,\n };\n },\n );\n },\n injectDefaultImport(url, hint = url, moduleName) {\n return cache.storeNamed(\n prog,\n url,\n \"default\",\n moduleName,\n (isScript, source) => {\n const id = prog.scope.generateUidIdentifier(hint);\n return {\n node: isScript\n ? hoist(template.statement.ast`var ${id} = require(${source})`)\n : t.importDeclaration([t.importDefaultSpecifier(id)], source),\n name: id.name,\n };\n },\n );\n },\n };\n };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\ntype StrMap = Map;\n\nexport default class ImportsCachedInjector {\n _imports: WeakMap, StrMap>;\n _anonymousImports: WeakMap, Set>;\n _lastImports: WeakMap<\n NodePath,\n Array<{ path: NodePath; index: number }>\n >;\n _resolver: (url: string) => string;\n _getPreferredIndex: (url: string) => number;\n\n constructor(\n resolver: (url: string) => string,\n getPreferredIndex: (url: string) => number,\n ) {\n this._imports = new WeakMap();\n this._anonymousImports = new WeakMap();\n this._lastImports = new WeakMap();\n this._resolver = resolver;\n this._getPreferredIndex = getPreferredIndex;\n }\n\n storeAnonymous(\n programPath: NodePath,\n url: string,\n moduleName: string,\n getVal: (isScript: boolean, source: t.StringLiteral) => t.Node,\n ) {\n const key = this._normalizeKey(programPath, url);\n const imports = this._ensure>(\n this._anonymousImports,\n programPath,\n Set,\n );\n\n if (imports.has(key)) return;\n\n const node = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n );\n imports.add(key);\n this._injectImport(programPath, node, moduleName);\n }\n\n storeNamed(\n programPath: NodePath,\n url: string,\n name: string,\n moduleName: string,\n getVal: (\n isScript: boolean,\n // eslint-disable-next-line no-undef\n source: t.StringLiteral,\n // eslint-disable-next-line no-undef\n name: t.Identifier,\n ) => { node: t.Node; name: string },\n ) {\n const key = this._normalizeKey(programPath, url, name);\n const imports = this._ensure>(\n this._imports,\n programPath,\n Map,\n );\n\n if (!imports.has(key)) {\n const { node, name: id } = getVal(\n programPath.node.sourceType === \"script\",\n t.stringLiteral(this._resolver(url)),\n t.identifier(name),\n );\n imports.set(key, id);\n this._injectImport(programPath, node, moduleName);\n }\n\n return t.identifier(imports.get(key));\n }\n\n _injectImport(\n programPath: NodePath,\n node: t.Node,\n moduleName: string,\n ) {\n const newIndex = this._getPreferredIndex(moduleName);\n const lastImports = this._lastImports.get(programPath) ?? [];\n\n const isPathStillValid = (path: NodePath) =>\n path.node &&\n // Sometimes the AST is modified and the \"last import\"\n // we have has been replaced\n path.parent === programPath.node &&\n path.container === programPath.node.body;\n\n let last: NodePath;\n\n if (newIndex === Infinity) {\n // Fast path: we can always just insert at the end if newIndex is `Infinity`\n if (lastImports.length > 0) {\n last = lastImports[lastImports.length - 1].path;\n if (!isPathStillValid(last)) last = undefined;\n }\n } else {\n for (const [i, data] of lastImports.entries()) {\n const { path, index } = data;\n if (isPathStillValid(path)) {\n if (newIndex < index) {\n const [newPath] = path.insertBefore(node);\n lastImports.splice(i, 0, { path: newPath, index: newIndex });\n return;\n }\n last = path;\n }\n }\n }\n\n if (last) {\n const [newPath] = last.insertAfter(node);\n lastImports.push({ path: newPath, index: newIndex });\n } else {\n const [newPath] = programPath.unshiftContainer(\"body\", node);\n this._lastImports.set(programPath, [{ path: newPath, index: newIndex }]);\n }\n }\n\n _ensure | Set>(\n map: WeakMap, C>,\n programPath: NodePath,\n Collection: { new (...args: any): C },\n ): C {\n let collection = map.get(programPath);\n if (!collection) {\n collection = new Collection();\n map.set(programPath, collection);\n }\n return collection;\n }\n\n _normalizeKey(\n programPath: NodePath,\n url: string,\n name: string = \"\",\n ): string {\n const { sourceType } = programPath.node;\n\n // If we rely on the imported binding (the \"name\" parameter), we also need to cache\n // based on the sourceType. This is because the module transforms change the names\n // of the import variables.\n return `${name && sourceType}::${url}::${name}`;\n }\n}\n","import { prettifyTargets } from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"./types\";\n\nexport const presetEnvSilentDebugHeader =\n \"#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets\";\n\nexport function stringifyTargetsMultiline(targets: Targets): string {\n return JSON.stringify(prettifyTargets(targets), null, 2);\n}\n\nexport function stringifyTargets(targets: Targets): string {\n return JSON.stringify(targets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n}\n","import { intersection } from \"./utils\";\nimport type {\n Pattern,\n PluginOptions,\n MissingDependenciesOption,\n} from \"./types\";\n\nfunction patternToRegExp(pattern: Pattern): RegExp | null {\n if (pattern instanceof RegExp) return pattern;\n\n try {\n return new RegExp(`^${pattern}$`);\n } catch {\n return null;\n }\n}\n\nfunction buildUnusedError(label, unused) {\n if (!unused.length) return \"\";\n return (\n ` - The following \"${label}\" patterns didn't match any polyfill:\\n` +\n unused.map(original => ` ${String(original)}\\n`).join(\"\")\n );\n}\n\nfunction buldDuplicatesError(duplicates) {\n if (!duplicates.size) return \"\";\n return (\n ` - The following polyfills were matched both by \"include\" and \"exclude\" patterns:\\n` +\n Array.from(duplicates, name => ` ${name}\\n`).join(\"\")\n );\n}\n\nexport function validateIncludeExclude(\n provider: string,\n polyfills: Map,\n includePatterns: Pattern[],\n excludePatterns: Pattern[],\n) {\n let current;\n const filter = pattern => {\n const regexp = patternToRegExp(pattern);\n if (!regexp) return false;\n\n let matched = false;\n for (const polyfill of polyfills.keys()) {\n if (regexp.test(polyfill)) {\n matched = true;\n current.add(polyfill);\n }\n }\n return !matched;\n };\n\n // prettier-ignore\n const include = current = new Set ();\n const unusedInclude = Array.from(includePatterns).filter(filter);\n\n // prettier-ignore\n const exclude = current = new Set ();\n const unusedExclude = Array.from(excludePatterns).filter(filter);\n\n const duplicates = intersection(include, exclude);\n\n if (\n duplicates.size > 0 ||\n unusedInclude.length > 0 ||\n unusedExclude.length > 0\n ) {\n throw new Error(\n `Error while validating the \"${provider}\" provider options:\\n` +\n buildUnusedError(\"include\", unusedInclude) +\n buildUnusedError(\"exclude\", unusedExclude) +\n buldDuplicatesError(duplicates),\n );\n }\n\n return { include, exclude };\n}\n\nexport function applyMissingDependenciesDefaults(\n options: PluginOptions,\n babelApi: any,\n): MissingDependenciesOption {\n const { missingDependencies = {} } = options;\n if (missingDependencies === false) return false;\n\n const caller = babelApi.caller(caller => caller?.name);\n\n const {\n log = \"deferred\",\n inject = caller === \"rollup-plugin-babel\" ? \"throw\" : \"import\",\n all = false,\n } = missingDependencies;\n\n return { log, inject, all };\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { CallProvider } from \"./index\";\n\nimport { resolveKey, resolveSource } from \"../utils\";\n\nfunction isRemoved(path: NodePath) {\n if (path.removed) return true;\n if (!path.parentPath) return false;\n if (path.listKey) {\n if (!path.parentPath.node?.[path.listKey]?.includes(path.node)) return true;\n } else {\n if (path.parentPath.node[path.key] !== path.node) return true;\n }\n return isRemoved(path.parentPath);\n}\n\nexport default (callProvider: CallProvider) => {\n function property(object, key, placement, path) {\n return callProvider({ kind: \"property\", object, key, placement }, path);\n }\n\n function handleReferencedIdentifier(path) {\n const {\n node: { name },\n scope,\n } = path;\n if (scope.getBindingIdentifier(name)) return;\n\n callProvider({ kind: \"global\", name }, path);\n }\n\n function analyzeMemberExpression(\n path: NodePath,\n ) {\n const key = resolveKey(path.get(\"property\"), path.node.computed);\n return { key, handleAsMemberExpression: !!key && key !== \"prototype\" };\n }\n\n return {\n // Symbol(), new Promise\n ReferencedIdentifier(path: NodePath) {\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression({ object: path.node }) &&\n analyzeMemberExpression(parentPath).handleAsMemberExpression\n ) {\n return;\n }\n handleReferencedIdentifier(path);\n },\n\n \"MemberExpression|OptionalMemberExpression\"(\n path: NodePath,\n ) {\n const { key, handleAsMemberExpression } = analyzeMemberExpression(path);\n if (!handleAsMemberExpression) return;\n\n const object = path.get(\"object\");\n let objectIsGlobalIdentifier = object.isIdentifier();\n if (objectIsGlobalIdentifier) {\n const binding = object.scope.getBinding(\n (object.node as t.Identifier).name,\n );\n if (binding) {\n if (binding.path.isImportNamespaceSpecifier()) return;\n objectIsGlobalIdentifier = false;\n }\n }\n\n const source = resolveSource(object);\n let skipObject = property(source.id, key, source.placement, path);\n skipObject ||=\n !objectIsGlobalIdentifier ||\n path.shouldSkip ||\n object.shouldSkip ||\n isRemoved(object);\n\n if (!skipObject) handleReferencedIdentifier(object);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent } = path;\n let obj;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n obj = parentPath.get(\"init\");\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n obj = parentPath.get(\"right\");\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunction()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n obj = grand.get(\"arguments\")[path.key];\n }\n }\n }\n\n let id = null;\n let placement = null;\n if (obj) ({ id, placement } = resolveSource(obj));\n\n for (const prop of path.get(\"properties\")) {\n if (prop.isObjectProperty()) {\n const key = resolveKey(prop.get(\"key\"));\n if (key) property(id, key, placement, prop);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n if (!key) return;\n\n callProvider(\n {\n kind: \"in\",\n object: source.id,\n key,\n placement: source.placement,\n },\n path,\n );\n },\n };\n};\n","import type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\nimport type { CallProvider } from \"./index\";\n\nimport { getImportSource, getRequireSource } from \"../utils\";\n\nexport default (callProvider: CallProvider) => ({\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n callProvider({ kind: \"import\", source }, path);\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n callProvider({ kind: \"import\", source }, bodyPath);\n });\n },\n});\n","import path from \"path\";\nimport debounce from \"lodash.debounce\";\nimport requireResolve from \"resolve\";\n\nconst nativeRequireResolve = parseFloat(process.versions.node) >= 8.9;\n\nimport { createRequire } from \"module\";\nconst require = createRequire(import /*::(_)*/.meta.url); // eslint-disable-line\n\nfunction myResolve(name: string, basedir: string) {\n if (nativeRequireResolve) {\n return require\n .resolve(name, {\n paths: [basedir],\n })\n .replace(/\\\\/g, \"/\");\n } else {\n return requireResolve.sync(name, { basedir }).replace(/\\\\/g, \"/\");\n }\n}\n\nexport function resolve(\n dirname: string,\n moduleName: string,\n absoluteImports: boolean | string,\n): string {\n if (absoluteImports === false) return moduleName;\n\n let basedir = dirname;\n if (typeof absoluteImports === \"string\") {\n basedir = path.resolve(basedir, absoluteImports);\n }\n\n try {\n return myResolve(moduleName, basedir);\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") throw err;\n\n throw Object.assign(\n new Error(`Failed to resolve \"${moduleName}\" relative to \"${dirname}\"`),\n {\n code: \"BABEL_POLYFILL_NOT_FOUND\",\n polyfill: moduleName,\n dirname,\n },\n );\n }\n}\n\nexport function has(basedir: string, name: string) {\n try {\n myResolve(name, basedir);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function logMissing(missingDeps: Set) {\n if (missingDeps.size === 0) return;\n\n const deps = Array.from(missingDeps).sort().join(\" \");\n\n console.warn(\n \"\\nSome polyfills have been added but are not present in your dependencies.\\n\" +\n \"Please run one of the following commands:\\n\" +\n `\\tnpm install --save ${deps}\\n` +\n `\\tyarn add ${deps}\\n`,\n );\n\n process.exitCode = 1;\n}\n\nlet allMissingDeps = new Set();\n\nconst laterLogMissingDependencies = debounce(() => {\n logMissing(allMissingDeps);\n allMissingDeps = new Set();\n}, 100);\n\nexport function laterLogMissing(missingDeps: Set) {\n if (missingDeps.size === 0) return;\n\n missingDeps.forEach(name => allMissingDeps.add(name));\n laterLogMissingDependencies();\n}\n","import type {\n MetaDescriptor,\n ResolverPolyfills,\n ResolvedPolyfill,\n} from \"./types\";\n\nimport { has } from \"./utils\";\n\ntype ResolverFn = (meta: MetaDescriptor) => void | ResolvedPolyfill;\n\nconst PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n\nexport default function createMetaResolver(\n polyfills: ResolverPolyfills,\n): ResolverFn {\n const { static: staticP, instance: instanceP, global: globalP } = polyfills;\n\n return meta => {\n if (meta.kind === \"global\" && globalP && has(globalP, meta.name)) {\n return { kind: \"global\", desc: globalP[meta.name], name: meta.name };\n }\n\n if (meta.kind === \"property\" || meta.kind === \"in\") {\n const { placement, object, key } = meta;\n\n if (object && placement === \"static\") {\n if (globalP && PossibleGlobalObjects.has(object) && has(globalP, key)) {\n return { kind: \"global\", desc: globalP[key], name: key };\n }\n\n if (staticP && has(staticP, object) && has(staticP[object], key)) {\n return {\n kind: \"static\",\n desc: staticP[object][key],\n name: `${object}$${key}`,\n };\n }\n }\n\n if (instanceP && has(instanceP, key)) {\n return { kind: \"instance\", desc: instanceP[key], name: `${key}` };\n }\n }\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nimport _getTargets, {\n isRequired,\n getInclusionReasons,\n} from \"@babel/helper-compilation-targets\";\nconst getTargets = _getTargets.default || _getTargets;\n\nimport { createUtilsGetter } from \"./utils\";\nimport ImportsCachedInjector from \"./imports-injector\";\nimport {\n stringifyTargetsMultiline,\n presetEnvSilentDebugHeader,\n} from \"./debug-utils\";\nimport {\n validateIncludeExclude,\n applyMissingDependenciesDefaults,\n} from \"./normalize-options\";\n\nimport type {\n ProviderApi,\n MethodString,\n Targets,\n MetaDescriptor,\n PolyfillProvider,\n PluginOptions,\n ProviderOptions,\n} from \"./types\";\n\nimport * as v from \"./visitors\";\nimport * as deps from \"./node/dependencies\";\n\nimport createMetaResolver from \"./meta-resolver\";\n\nexport type { PolyfillProvider, MetaDescriptor, Utils, Targets } from \"./types\";\n\nfunction resolveOptions(\n options: PluginOptions,\n babelApi,\n): {\n method: MethodString;\n methodName: \"usageGlobal\" | \"entryGlobal\" | \"usagePure\";\n targets: Targets;\n debug: boolean | typeof presetEnvSilentDebugHeader;\n shouldInjectPolyfill:\n | ((name: string, shouldInject: boolean) => boolean)\n | undefined;\n providerOptions: ProviderOptions;\n absoluteImports: string | boolean;\n} {\n const {\n method,\n targets: targetsOption,\n ignoreBrowserslistConfig,\n configPath,\n debug,\n shouldInjectPolyfill,\n absoluteImports,\n ...providerOptions\n } = options;\n\n if (isEmpty(options)) {\n throw new Error(\n `\\\nThis plugin requires options, for example:\n {\n \"plugins\": [\n [\"\", { method: \"usage-pure\" }]\n ]\n }\n\nSee more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`,\n );\n }\n\n let methodName;\n if (method === \"usage-global\") methodName = \"usageGlobal\";\n else if (method === \"entry-global\") methodName = \"entryGlobal\";\n else if (method === \"usage-pure\") methodName = \"usagePure\";\n else if (typeof method !== \"string\") {\n throw new Error(\".method must be a string\");\n } else {\n throw new Error(\n `.method must be one of \"entry-global\", \"usage-global\"` +\n ` or \"usage-pure\" (received ${JSON.stringify(method)})`,\n );\n }\n\n if (typeof shouldInjectPolyfill === \"function\") {\n if (options.include || options.exclude) {\n throw new Error(\n `.include and .exclude are not supported when using the` +\n ` .shouldInjectPolyfill function.`,\n );\n }\n } else if (shouldInjectPolyfill != null) {\n throw new Error(\n `.shouldInjectPolyfill must be a function, or undefined` +\n ` (received ${JSON.stringify(shouldInjectPolyfill)})`,\n );\n }\n\n if (\n absoluteImports != null &&\n typeof absoluteImports !== \"boolean\" &&\n typeof absoluteImports !== \"string\"\n ) {\n throw new Error(\n `.absoluteImports must be a boolean, a string, or undefined` +\n ` (received ${JSON.stringify(absoluteImports)})`,\n );\n }\n\n let targets;\n\n if (\n // If any browserslist-related option is specified, fallback to the old\n // behavior of not using the targets specified in the top-level options.\n targetsOption ||\n configPath ||\n ignoreBrowserslistConfig\n ) {\n const targetsObj =\n typeof targetsOption === \"string\" || Array.isArray(targetsOption)\n ? { browsers: targetsOption }\n : targetsOption;\n\n targets = getTargets(targetsObj, {\n ignoreBrowserslistConfig,\n configPath,\n });\n } else {\n targets = babelApi.targets();\n }\n\n return {\n method,\n methodName,\n targets,\n absoluteImports: absoluteImports ?? false,\n shouldInjectPolyfill,\n debug: !!debug,\n providerOptions: providerOptions as any as ProviderOptions,\n };\n}\n\nfunction instantiateProvider(\n factory: PolyfillProvider,\n options: PluginOptions,\n missingDependencies,\n dirname,\n debugLog,\n babelApi,\n) {\n const {\n method,\n methodName,\n targets,\n debug,\n shouldInjectPolyfill,\n providerOptions,\n absoluteImports,\n } = resolveOptions(options, babelApi);\n\n // eslint-disable-next-line prefer-const\n let include, exclude;\n let polyfillsSupport;\n let polyfillsNames: Map | undefined;\n let filterPolyfills;\n\n const getUtils = createUtilsGetter(\n new ImportsCachedInjector(\n moduleName => deps.resolve(dirname, moduleName, absoluteImports),\n (name: string) => polyfillsNames?.get(name) ?? Infinity,\n ),\n );\n\n const depsCache = new Map();\n\n const api: ProviderApi = {\n babel: babelApi,\n getUtils,\n method: options.method,\n targets,\n createMetaResolver,\n shouldInjectPolyfill(name) {\n if (polyfillsNames === undefined) {\n throw new Error(\n `Internal error in the ${factory.name} provider: ` +\n `shouldInjectPolyfill() can't be called during initialization.`,\n );\n }\n if (!polyfillsNames.has(name)) {\n console.warn(\n `Internal error in the ${providerName} provider: ` +\n `unknown polyfill \"${name}\".`,\n );\n }\n\n if (filterPolyfills && !filterPolyfills(name)) return false;\n\n let shouldInject = isRequired(name, targets, {\n compatData: polyfillsSupport,\n includes: include,\n excludes: exclude,\n });\n\n if (shouldInjectPolyfill) {\n shouldInject = shouldInjectPolyfill(name, shouldInject);\n if (typeof shouldInject !== \"boolean\") {\n throw new Error(`.shouldInjectPolyfill must return a boolean.`);\n }\n }\n\n return shouldInject;\n },\n debug(name) {\n debugLog().found = true;\n\n if (!debug || !name) return;\n\n if (debugLog().polyfills.has(providerName)) return;\n debugLog().polyfills.add(name);\n debugLog().polyfillsSupport ??= polyfillsSupport;\n },\n assertDependency(name, version = \"*\") {\n if (missingDependencies === false) return;\n if (absoluteImports) {\n // If absoluteImports is not false, we will try resolving\n // the dependency and throw if it's not possible. We can\n // skip the check here.\n return;\n }\n\n const dep = version === \"*\" ? name : `${name}@^${version}`;\n\n const found = missingDependencies.all\n ? false\n : mapGetOr(depsCache, `${name} :: ${dirname}`, () =>\n deps.has(dirname, name),\n );\n\n if (!found) {\n debugLog().missingDeps.add(dep);\n }\n },\n };\n\n const provider = factory(api, providerOptions, dirname);\n const providerName = provider.name || factory.name;\n\n if (typeof provider[methodName] !== \"function\") {\n throw new Error(\n `The \"${providerName}\" provider doesn't support the \"${method}\" polyfilling method.`,\n );\n }\n\n if (Array.isArray(provider.polyfills)) {\n polyfillsNames = new Map(\n provider.polyfills.map((name, index) => [name, index]),\n );\n filterPolyfills = provider.filterPolyfills;\n } else if (provider.polyfills) {\n polyfillsNames = new Map(\n Object.keys(provider.polyfills).map((name, index) => [name, index]),\n );\n polyfillsSupport = provider.polyfills;\n filterPolyfills = provider.filterPolyfills;\n } else {\n polyfillsNames = new Map();\n }\n\n ({ include, exclude } = validateIncludeExclude(\n providerName,\n polyfillsNames,\n providerOptions.include || [],\n providerOptions.exclude || [],\n ));\n\n let callProvider: (payload: MetaDescriptor, path: NodePath) => boolean;\n if (methodName === \"usageGlobal\") {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n return (\n (provider[methodName](payload, utils, path) satisfies boolean) ?? false\n );\n };\n } else {\n callProvider = (payload, path) => {\n const utils = getUtils(path);\n provider[methodName](payload, utils, path) satisfies void;\n return false;\n };\n }\n\n return {\n debug,\n method,\n targets,\n provider,\n providerName,\n callProvider,\n };\n}\n\nexport default function definePolyfillProvider(\n factory: PolyfillProvider,\n) {\n return declare((babelApi, options: PluginOptions, dirname: string) => {\n babelApi.assertVersion(\"^7.0.0 || ^8.0.0-alpha.0\");\n const { traverse } = babelApi;\n\n let debugLog;\n\n const missingDependencies = applyMissingDependenciesDefaults(\n options,\n babelApi,\n );\n\n const { debug, method, targets, provider, providerName, callProvider } =\n instantiateProvider(\n factory,\n options,\n missingDependencies,\n dirname,\n () => debugLog,\n babelApi,\n );\n\n const createVisitor = method === \"entry-global\" ? v.entry : v.usage;\n\n const visitor = provider.visitor\n ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor])\n : createVisitor(callProvider);\n\n if (debug && debug !== presetEnvSilentDebugHeader) {\n console.log(`${providerName}: \\`DEBUG\\` option`);\n console.log(`\\nUsing targets: ${stringifyTargetsMultiline(targets)}`);\n console.log(`\\nUsing polyfills with \\`${method}\\` method:`);\n }\n\n const { runtimeName } = provider;\n\n return {\n name: \"inject-polyfills\",\n visitor,\n\n pre(file) {\n if (runtimeName) {\n if (\n file.get(\"runtimeHelpersModuleName\") &&\n file.get(\"runtimeHelpersModuleName\") !== runtimeName\n ) {\n console.warn(\n `Two different polyfill providers` +\n ` (${file.get(\"runtimeHelpersModuleProvider\")}` +\n ` and ${providerName}) are trying to define two` +\n ` conflicting @babel/runtime alternatives:` +\n ` ${file.get(\"runtimeHelpersModuleName\")} and ${runtimeName}.` +\n ` The second one will be ignored.`,\n );\n } else {\n file.set(\"runtimeHelpersModuleName\", runtimeName);\n file.set(\"runtimeHelpersModuleProvider\", providerName);\n }\n }\n\n debugLog = {\n polyfills: new Set(),\n polyfillsSupport: undefined,\n found: false,\n providers: new Set(),\n missingDeps: new Set(),\n };\n\n provider.pre?.apply(this, arguments);\n },\n post() {\n provider.post?.apply(this, arguments);\n\n if (missingDependencies !== false) {\n if (missingDependencies.log === \"per-file\") {\n deps.logMissing(debugLog.missingDeps);\n } else {\n deps.laterLogMissing(debugLog.missingDeps);\n }\n }\n\n if (!debug) return;\n\n if (this.filename) console.log(`\\n[${this.filename}]`);\n\n if (debugLog.polyfills.size === 0) {\n console.log(\n method === \"entry-global\"\n ? debugLog.found\n ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.`\n : `The entry point for the ${providerName} polyfill has not been found.`\n : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`,\n );\n\n return;\n }\n\n if (method === \"entry-global\") {\n console.log(\n `The ${providerName} polyfill entry has been replaced with ` +\n `the following polyfills:`,\n );\n } else {\n console.log(\n `The ${providerName} polyfill added the following polyfills:`,\n );\n }\n\n for (const name of debugLog.polyfills) {\n if (debugLog.polyfillsSupport?.[name]) {\n const filteredTargets = getInclusionReasons(\n name,\n targets,\n debugLog.polyfillsSupport,\n );\n\n const formattedTargets = JSON.stringify(filteredTargets)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${name} ${formattedTargets}`);\n } else {\n console.log(` ${name}`);\n }\n }\n },\n };\n });\n}\n\nfunction mapGetOr(map, key, getDefault) {\n let val = map.get(key);\n if (val === undefined) {\n val = getDefault();\n map.set(key, val);\n }\n return val;\n}\n\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n"],"names":["types","t","template","_babel","default","intersection","a","b","result","Set","forEach","v","has","add","object","key","Object","prototype","hasOwnProperty","call","resolve","path","resolved","isVariableDeclarator","get","isIdentifier","isReferencedIdentifier","binding","scope","getBinding","node","name","constant","resolveId","hasBinding","resolveKey","computed","isStringLiteral","value","parent","isMemberExpression","sym","isPure","evaluate","resolveSource","obj","id","placement","type","getImportSource","specifiers","length","source","getRequireSource","isExpressionStatement","expression","isCallExpression","callee","arguments","hoist","_blockHoist","createUtilsGetter","cache","prog","findParent","p","isProgram","injectGlobalImport","url","moduleName","storeAnonymous","isScript","statement","ast","importDeclaration","injectNamedImport","hint","storeNamed","generateUidIdentifier","importSpecifier","injectDefaultImport","importDefaultSpecifier","ImportsCachedInjector","constructor","resolver","getPreferredIndex","_imports","WeakMap","_anonymousImports","_lastImports","_resolver","_getPreferredIndex","programPath","getVal","_normalizeKey","imports","_ensure","sourceType","stringLiteral","_injectImport","Map","identifier","set","_this$_lastImports$ge","newIndex","lastImports","isPathStillValid","container","body","last","Infinity","undefined","i","data","entries","index","newPath","insertBefore","splice","insertAfter","push","unshiftContainer","map","Collection","collection","presetEnvSilentDebugHeader","stringifyTargetsMultiline","targets","JSON","stringify","prettifyTargets","patternToRegExp","pattern","RegExp","buildUnusedError","label","unused","original","String","join","buldDuplicatesError","duplicates","size","Array","from","validateIncludeExclude","provider","polyfills","includePatterns","excludePatterns","current","filter","regexp","matched","polyfill","keys","test","include","unusedInclude","exclude","unusedExclude","Error","applyMissingDependenciesDefaults","options","babelApi","missingDependencies","caller","log","inject","all","isRemoved","removed","parentPath","listKey","_path$parentPath$node","includes","callProvider","property","kind","handleReferencedIdentifier","getBindingIdentifier","analyzeMemberExpression","handleAsMemberExpression","ReferencedIdentifier","MemberExpression|OptionalMemberExpression","objectIsGlobalIdentifier","isImportNamespaceSpecifier","skipObject","shouldSkip","ObjectPattern","isAssignmentExpression","isFunction","grand","isNewExpression","prop","isObjectProperty","BinaryExpression","operator","ImportDeclaration","Program","bodyPath","nativeRequireResolve","parseFloat","process","versions","require","createRequire","import","meta","myResolve","basedir","paths","replace","requireResolve","sync","dirname","absoluteImports","err","code","assign","logMissing","missingDeps","deps","sort","console","warn","exitCode","allMissingDeps","laterLogMissingDependencies","debounce","laterLogMissing","PossibleGlobalObjects","createMetaResolver","static","staticP","instance","instanceP","global","globalP","desc","getTargets","_getTargets","resolveOptions","method","targetsOption","ignoreBrowserslistConfig","configPath","debug","shouldInjectPolyfill","providerOptions","isEmpty","methodName","targetsObj","isArray","browsers","instantiateProvider","factory","debugLog","polyfillsSupport","polyfillsNames","filterPolyfills","getUtils","_polyfillsNames$get","_polyfillsNames","depsCache","api","babel","providerName","shouldInject","isRequired","compatData","excludes","_debugLog","_debugLog$polyfillsSu","found","assertDependency","version","dep","mapGetOr","payload","_ref","utils","definePolyfillProvider","declare","assertVersion","traverse","createVisitor","visitor","visitors","merge","runtimeName","pre","file","_provider$pre","providers","apply","post","_provider$post","filename","_debugLog$polyfillsSu2","filteredTargets","getInclusionReasons","formattedTargets","getDefault","val"],"mappings":";;;;;;;;;EAASA,KAAK,EAAIC,GAAC;EAAEC,QAAQ,EAARA;AAAQ,IAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA;AAKtB,SAASE,YAAYA,CAAIC,CAAS,EAAEC,CAAS,EAAU;EAC5D,MAAMC,MAAM,GAAG,IAAIC,GAAG,EAAK;EAC3BH,CAAC,CAACI,OAAO,CAACC,CAAC,IAAIJ,CAAC,CAACK,GAAG,CAACD,CAAC,CAAC,IAAIH,MAAM,CAACK,GAAG,CAACF,CAAC,CAAC,CAAC;EACzC,OAAOH,MAAM;AACf;AAEO,SAASI,KAAGA,CAACE,MAAW,EAAEC,GAAW,EAAE;EAC5C,OAAOC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;AAC1D;AAEA,SAASK,SAAOA,CACdC,IAAc,EACdC,QAAuB,GAAG,IAAIb,GAAG,EAAE,EACb;EACtB,IAAIa,QAAQ,CAACV,GAAG,CAACS,IAAI,CAAC,EAAE;EACxBC,QAAQ,CAACT,GAAG,CAACQ,IAAI,CAAC;EAElB,IAAIA,IAAI,CAACE,oBAAoB,EAAE,EAAE;IAC/B,IAAIF,IAAI,CAACG,GAAG,CAAC,IAAI,CAAC,CAACC,YAA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U,EAAE;EACtC,IAAIC,GAAG,GAAGtL,GAAG,CAAClG,GAAG,CAACT,GAAG,CAAC;EACtB,IAAIiS,GAAG,KAAKjM,SAAS,EAAE;IACrBiM,GAAG,GAAGD,UAAU,EAAE;IAClBrL,GAAG,CAACpB,GAAG,CAACvF,GAAG,EAAEiS,GAAG,CAAC;;EAEnB,OAAOA,GAAG;AACZ;AAEA,SAAStD,OAAOA,CAAC7M,GAAG,EAAE;EACpB,OAAO7B,MAAM,CAAC2I,IAAI,CAAC9G,GAAG,CAAC,CAACM,MAAM,KAAK,CAAC;AACtC;;;;"} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/browser/dependencies.js b/node_modules/@babel/helper-define-polyfill-provider/lib/browser/dependencies.js new file mode 100644 index 00000000..b676f61c --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/browser/dependencies.js @@ -0,0 +1,22 @@ +"use strict"; + +exports.__esModule = true; +exports.has = has; +exports.laterLogMissing = laterLogMissing; +exports.logMissing = logMissing; +exports.resolve = resolve; +function resolve(dirname, moduleName, absoluteImports) { + if (absoluteImports === false) return moduleName; + throw new Error(`"absoluteImports" is not supported in bundles prepared for the browser.`); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function has(basedir, name) { + return true; +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function logMissing(missingDeps) {} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function laterLogMissing(missingDeps) {} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/debug-utils.js b/node_modules/@babel/helper-define-polyfill-provider/lib/debug-utils.js new file mode 100644 index 00000000..0f30c856 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/debug-utils.js @@ -0,0 +1,15 @@ +"use strict"; + +exports.__esModule = true; +exports.presetEnvSilentDebugHeader = void 0; +exports.stringifyTargets = stringifyTargets; +exports.stringifyTargetsMultiline = stringifyTargetsMultiline; +var _helperCompilationTargets = require("@babel/helper-compilation-targets"); +const presetEnvSilentDebugHeader = "#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets"; +exports.presetEnvSilentDebugHeader = presetEnvSilentDebugHeader; +function stringifyTargetsMultiline(targets) { + return JSON.stringify((0, _helperCompilationTargets.prettifyTargets)(targets), null, 2); +} +function stringifyTargets(targets) { + return JSON.stringify(targets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }'); +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/define-provider.js b/node_modules/@babel/helper-define-polyfill-provider/lib/define-provider.js new file mode 100644 index 00000000..e5a6f0e5 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/define-provider.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__esModule = true; +exports.defineProvider = defineProvider; +function defineProvider(factory) { + // This will allow us to do some things + + return factory; +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/imports-injector.js b/node_modules/@babel/helper-define-polyfill-provider/lib/imports-injector.js new file mode 100644 index 00000000..d83c00cf --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/imports-injector.js @@ -0,0 +1,107 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _babel = _interopRequireWildcard(require("@babel/core")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const { + types: t +} = _babel.default || _babel; +class ImportsCachedInjector { + constructor(resolver, getPreferredIndex) { + this._imports = new WeakMap(); + this._anonymousImports = new WeakMap(); + this._lastImports = new WeakMap(); + this._resolver = resolver; + this._getPreferredIndex = getPreferredIndex; + } + storeAnonymous(programPath, url, moduleName, getVal) { + const key = this._normalizeKey(programPath, url); + const imports = this._ensure(this._anonymousImports, programPath, Set); + if (imports.has(key)) return; + const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url))); + imports.add(key); + this._injectImport(programPath, node, moduleName); + } + storeNamed(programPath, url, name, moduleName, getVal) { + const key = this._normalizeKey(programPath, url, name); + const imports = this._ensure(this._imports, programPath, Map); + if (!imports.has(key)) { + const { + node, + name: id + } = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)), t.identifier(name)); + imports.set(key, id); + this._injectImport(programPath, node, moduleName); + } + return t.identifier(imports.get(key)); + } + _injectImport(programPath, node, moduleName) { + var _this$_lastImports$ge; + const newIndex = this._getPreferredIndex(moduleName); + const lastImports = (_this$_lastImports$ge = this._lastImports.get(programPath)) != null ? _this$_lastImports$ge : []; + const isPathStillValid = path => path.node && + // Sometimes the AST is modified and the "last import" + // we have has been replaced + path.parent === programPath.node && path.container === programPath.node.body; + let last; + if (newIndex === Infinity) { + // Fast path: we can always just insert at the end if newIndex is `Infinity` + if (lastImports.length > 0) { + last = lastImports[lastImports.length - 1].path; + if (!isPathStillValid(last)) last = undefined; + } + } else { + for (const [i, data] of lastImports.entries()) { + const { + path, + index + } = data; + if (isPathStillValid(path)) { + if (newIndex < index) { + const [newPath] = path.insertBefore(node); + lastImports.splice(i, 0, { + path: newPath, + index: newIndex + }); + return; + } + last = path; + } + } + } + if (last) { + const [newPath] = last.insertAfter(node); + lastImports.push({ + path: newPath, + index: newIndex + }); + } else { + const [newPath] = programPath.unshiftContainer("body", node); + this._lastImports.set(programPath, [{ + path: newPath, + index: newIndex + }]); + } + } + _ensure(map, programPath, Collection) { + let collection = map.get(programPath); + if (!collection) { + collection = new Collection(); + map.set(programPath, collection); + } + return collection; + } + _normalizeKey(programPath, url, name = "") { + const { + sourceType + } = programPath.node; + + // If we rely on the imported binding (the "name" parameter), we also need to cache + // based on the sourceType. This is because the module transforms change the names + // of the import variables. + return `${name && sourceType}::${url}::${name}`; + } +} +exports.default = ImportsCachedInjector; \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/index.js b/node_modules/@babel/helper-define-polyfill-provider/lib/index.js new file mode 100644 index 00000000..b0dc90b7 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/index.js @@ -0,0 +1,289 @@ +"use strict"; + +exports.__esModule = true; +exports.default = definePolyfillProvider; +var _helperPluginUtils = require("@babel/helper-plugin-utils"); +var _helperCompilationTargets = _interopRequireWildcard(require("@babel/helper-compilation-targets")); +var _utils = require("./utils"); +var _importsInjector = _interopRequireDefault(require("./imports-injector")); +var _debugUtils = require("./debug-utils"); +var _normalizeOptions = require("./normalize-options"); +var v = _interopRequireWildcard(require("./visitors")); +var deps = _interopRequireWildcard(require("./node/dependencies")); +var _metaResolver = _interopRequireDefault(require("./meta-resolver")); +const _excluded = ["method", "targets", "ignoreBrowserslistConfig", "configPath", "debug", "shouldInjectPolyfill", "absoluteImports"]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } +const getTargets = _helperCompilationTargets.default.default || _helperCompilationTargets.default; +function resolveOptions(options, babelApi) { + const { + method, + targets: targetsOption, + ignoreBrowserslistConfig, + configPath, + debug, + shouldInjectPolyfill, + absoluteImports + } = options, + providerOptions = _objectWithoutPropertiesLoose(options, _excluded); + if (isEmpty(options)) { + throw new Error(`\ +This plugin requires options, for example: + { + "plugins": [ + ["", { method: "usage-pure" }] + ] + } + +See more options at https://github.com/babel/babel-polyfills/blob/main/docs/usage.md`); + } + let methodName; + if (method === "usage-global") methodName = "usageGlobal";else if (method === "entry-global") methodName = "entryGlobal";else if (method === "usage-pure") methodName = "usagePure";else if (typeof method !== "string") { + throw new Error(".method must be a string"); + } else { + throw new Error(`.method must be one of "entry-global", "usage-global"` + ` or "usage-pure" (received ${JSON.stringify(method)})`); + } + if (typeof shouldInjectPolyfill === "function") { + if (options.include || options.exclude) { + throw new Error(`.include and .exclude are not supported when using the` + ` .shouldInjectPolyfill function.`); + } + } else if (shouldInjectPolyfill != null) { + throw new Error(`.shouldInjectPolyfill must be a function, or undefined` + ` (received ${JSON.stringify(shouldInjectPolyfill)})`); + } + if (absoluteImports != null && typeof absoluteImports !== "boolean" && typeof absoluteImports !== "string") { + throw new Error(`.absoluteImports must be a boolean, a string, or undefined` + ` (received ${JSON.stringify(absoluteImports)})`); + } + let targets; + if ( + // If any browserslist-related option is specified, fallback to the old + // behavior of not using the targets specified in the top-level options. + targetsOption || configPath || ignoreBrowserslistConfig) { + const targetsObj = typeof targetsOption === "string" || Array.isArray(targetsOption) ? { + browsers: targetsOption + } : targetsOption; + targets = getTargets(targetsObj, { + ignoreBrowserslistConfig, + configPath + }); + } else { + targets = babelApi.targets(); + } + return { + method, + methodName, + targets, + absoluteImports: absoluteImports != null ? absoluteImports : false, + shouldInjectPolyfill, + debug: !!debug, + providerOptions: providerOptions + }; +} +function instantiateProvider(factory, options, missingDependencies, dirname, debugLog, babelApi) { + const { + method, + methodName, + targets, + debug, + shouldInjectPolyfill, + providerOptions, + absoluteImports + } = resolveOptions(options, babelApi); + + // eslint-disable-next-line prefer-const + let include, exclude; + let polyfillsSupport; + let polyfillsNames; + let filterPolyfills; + const getUtils = (0, _utils.createUtilsGetter)(new _importsInjector.default(moduleName => deps.resolve(dirname, moduleName, absoluteImports), name => { + var _polyfillsNames$get, _polyfillsNames; + return (_polyfillsNames$get = (_polyfillsNames = polyfillsNames) == null ? void 0 : _polyfillsNames.get(name)) != null ? _polyfillsNames$get : Infinity; + })); + const depsCache = new Map(); + const api = { + babel: babelApi, + getUtils, + method: options.method, + targets, + createMetaResolver: _metaResolver.default, + shouldInjectPolyfill(name) { + if (polyfillsNames === undefined) { + throw new Error(`Internal error in the ${factory.name} provider: ` + `shouldInjectPolyfill() can't be called during initialization.`); + } + if (!polyfillsNames.has(name)) { + console.warn(`Internal error in the ${providerName} provider: ` + `unknown polyfill "${name}".`); + } + if (filterPolyfills && !filterPolyfills(name)) return false; + let shouldInject = (0, _helperCompilationTargets.isRequired)(name, targets, { + compatData: polyfillsSupport, + includes: include, + excludes: exclude + }); + if (shouldInjectPolyfill) { + shouldInject = shouldInjectPolyfill(name, shouldInject); + if (typeof shouldInject !== "boolean") { + throw new Error(`.shouldInjectPolyfill must return a boolean.`); + } + } + return shouldInject; + }, + debug(name) { + var _debugLog, _debugLog$polyfillsSu; + debugLog().found = true; + if (!debug || !name) return; + if (debugLog().polyfills.has(providerName)) return; + debugLog().polyfills.add(name); + (_debugLog$polyfillsSu = (_debugLog = debugLog()).polyfillsSupport) != null ? _debugLog$polyfillsSu : _debugLog.polyfillsSupport = polyfillsSupport; + }, + assertDependency(name, version = "*") { + if (missingDependencies === false) return; + if (absoluteImports) { + // If absoluteImports is not false, we will try resolving + // the dependency and throw if it's not possible. We can + // skip the check here. + return; + } + const dep = version === "*" ? name : `${name}@^${version}`; + const found = missingDependencies.all ? false : mapGetOr(depsCache, `${name} :: ${dirname}`, () => deps.has(dirname, name)); + if (!found) { + debugLog().missingDeps.add(dep); + } + } + }; + const provider = factory(api, providerOptions, dirname); + const providerName = provider.name || factory.name; + if (typeof provider[methodName] !== "function") { + throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`); + } + if (Array.isArray(provider.polyfills)) { + polyfillsNames = new Map(provider.polyfills.map((name, index) => [name, index])); + filterPolyfills = provider.filterPolyfills; + } else if (provider.polyfills) { + polyfillsNames = new Map(Object.keys(provider.polyfills).map((name, index) => [name, index])); + polyfillsSupport = provider.polyfills; + filterPolyfills = provider.filterPolyfills; + } else { + polyfillsNames = new Map(); + } + ({ + include, + exclude + } = (0, _normalizeOptions.validateIncludeExclude)(providerName, polyfillsNames, providerOptions.include || [], providerOptions.exclude || [])); + let callProvider; + if (methodName === "usageGlobal") { + callProvider = (payload, path) => { + var _ref; + const utils = getUtils(path); + return (_ref = provider[methodName](payload, utils, path)) != null ? _ref : false; + }; + } else { + callProvider = (payload, path) => { + const utils = getUtils(path); + provider[methodName](payload, utils, path); + return false; + }; + } + return { + debug, + method, + targets, + provider, + providerName, + callProvider + }; +} +function definePolyfillProvider(factory) { + return (0, _helperPluginUtils.declare)((babelApi, options, dirname) => { + babelApi.assertVersion("^7.0.0 || ^8.0.0-alpha.0"); + const { + traverse + } = babelApi; + let debugLog; + const missingDependencies = (0, _normalizeOptions.applyMissingDependenciesDefaults)(options, babelApi); + const { + debug, + method, + targets, + provider, + providerName, + callProvider + } = instantiateProvider(factory, options, missingDependencies, dirname, () => debugLog, babelApi); + const createVisitor = method === "entry-global" ? v.entry : v.usage; + const visitor = provider.visitor ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor]) : createVisitor(callProvider); + if (debug && debug !== _debugUtils.presetEnvSilentDebugHeader) { + console.log(`${providerName}: \`DEBUG\` option`); + console.log(`\nUsing targets: ${(0, _debugUtils.stringifyTargetsMultiline)(targets)}`); + console.log(`\nUsing polyfills with \`${method}\` method:`); + } + const { + runtimeName + } = provider; + return { + name: "inject-polyfills", + visitor, + pre(file) { + var _provider$pre; + if (runtimeName) { + if (file.get("runtimeHelpersModuleName") && file.get("runtimeHelpersModuleName") !== runtimeName) { + console.warn(`Two different polyfill providers` + ` (${file.get("runtimeHelpersModuleProvider")}` + ` and ${providerName}) are trying to define two` + ` conflicting @babel/runtime alternatives:` + ` ${file.get("runtimeHelpersModuleName")} and ${runtimeName}.` + ` The second one will be ignored.`); + } else { + file.set("runtimeHelpersModuleName", runtimeName); + file.set("runtimeHelpersModuleProvider", providerName); + } + } + debugLog = { + polyfills: new Set(), + polyfillsSupport: undefined, + found: false, + providers: new Set(), + missingDeps: new Set() + }; + (_provider$pre = provider.pre) == null ? void 0 : _provider$pre.apply(this, arguments); + }, + post() { + var _provider$post; + (_provider$post = provider.post) == null ? void 0 : _provider$post.apply(this, arguments); + if (missingDependencies !== false) { + if (missingDependencies.log === "per-file") { + deps.logMissing(debugLog.missingDeps); + } else { + deps.laterLogMissing(debugLog.missingDeps); + } + } + if (!debug) return; + if (this.filename) console.log(`\n[${this.filename}]`); + if (debugLog.polyfills.size === 0) { + console.log(method === "entry-global" ? debugLog.found ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.` : `The entry point for the ${providerName} polyfill has not been found.` : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`); + return; + } + if (method === "entry-global") { + console.log(`The ${providerName} polyfill entry has been replaced with ` + `the following polyfills:`); + } else { + console.log(`The ${providerName} polyfill added the following polyfills:`); + } + for (const name of debugLog.polyfills) { + var _debugLog$polyfillsSu2; + if ((_debugLog$polyfillsSu2 = debugLog.polyfillsSupport) != null && _debugLog$polyfillsSu2[name]) { + const filteredTargets = (0, _helperCompilationTargets.getInclusionReasons)(name, targets, debugLog.polyfillsSupport); + const formattedTargets = JSON.stringify(filteredTargets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }'); + console.log(` ${name} ${formattedTargets}`); + } else { + console.log(` ${name}`); + } + } + } + }; + }); +} +function mapGetOr(map, key, getDefault) { + let val = map.get(key); + if (val === undefined) { + val = getDefault(); + map.set(key, val); + } + return val; +} +function isEmpty(obj) { + return Object.keys(obj).length === 0; +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/meta-resolver.js b/node_modules/@babel/helper-define-polyfill-provider/lib/meta-resolver.js new file mode 100644 index 00000000..502320bc --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/meta-resolver.js @@ -0,0 +1,52 @@ +"use strict"; + +exports.__esModule = true; +exports.default = createMetaResolver; +var _utils = require("./utils"); +const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]); +function createMetaResolver(polyfills) { + const { + static: staticP, + instance: instanceP, + global: globalP + } = polyfills; + return meta => { + if (meta.kind === "global" && globalP && (0, _utils.has)(globalP, meta.name)) { + return { + kind: "global", + desc: globalP[meta.name], + name: meta.name + }; + } + if (meta.kind === "property" || meta.kind === "in") { + const { + placement, + object, + key + } = meta; + if (object && placement === "static") { + if (globalP && PossibleGlobalObjects.has(object) && (0, _utils.has)(globalP, key)) { + return { + kind: "global", + desc: globalP[key], + name: key + }; + } + if (staticP && (0, _utils.has)(staticP, object) && (0, _utils.has)(staticP[object], key)) { + return { + kind: "static", + desc: staticP[object][key], + name: `${object}$${key}` + }; + } + } + if (instanceP && (0, _utils.has)(instanceP, key)) { + return { + kind: "instance", + desc: instanceP[key], + name: `${key}` + }; + } + } + }; +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/node/dependencies.js b/node_modules/@babel/helper-define-polyfill-provider/lib/node/dependencies.js new file mode 100644 index 00000000..44900240 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/node/dependencies.js @@ -0,0 +1,67 @@ +"use strict"; + +exports.__esModule = true; +exports.has = has; +exports.laterLogMissing = laterLogMissing; +exports.logMissing = logMissing; +exports.resolve = resolve; +var _path = _interopRequireDefault(require("path")); +var _lodash = _interopRequireDefault(require("lodash.debounce")); +var _resolve = _interopRequireDefault(require("resolve")); +var _module = require("module"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const nativeRequireResolve = parseFloat(process.versions.node) >= 8.9; +// eslint-disable-line + +function myResolve(name, basedir) { + if (nativeRequireResolve) { + return require.resolve(name, { + paths: [basedir] + }).replace(/\\/g, "/"); + } else { + return _resolve.default.sync(name, { + basedir + }).replace(/\\/g, "/"); + } +} +function resolve(dirname, moduleName, absoluteImports) { + if (absoluteImports === false) return moduleName; + let basedir = dirname; + if (typeof absoluteImports === "string") { + basedir = _path.default.resolve(basedir, absoluteImports); + } + try { + return myResolve(moduleName, basedir); + } catch (err) { + if (err.code !== "MODULE_NOT_FOUND") throw err; + throw Object.assign(new Error(`Failed to resolve "${moduleName}" relative to "${dirname}"`), { + code: "BABEL_POLYFILL_NOT_FOUND", + polyfill: moduleName, + dirname + }); + } +} +function has(basedir, name) { + try { + myResolve(name, basedir); + return true; + } catch (_unused) { + return false; + } +} +function logMissing(missingDeps) { + if (missingDeps.size === 0) return; + const deps = Array.from(missingDeps).sort().join(" "); + console.warn("\nSome polyfills have been added but are not present in your dependencies.\n" + "Please run one of the following commands:\n" + `\tnpm install --save ${deps}\n` + `\tyarn add ${deps}\n`); + process.exitCode = 1; +} +let allMissingDeps = new Set(); +const laterLogMissingDependencies = (0, _lodash.default)(() => { + logMissing(allMissingDeps); + allMissingDeps = new Set(); +}, 100); +function laterLogMissing(missingDeps) { + if (missingDeps.size === 0) return; + missingDeps.forEach(name => allMissingDeps.add(name)); + laterLogMissingDependencies(); +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js b/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js new file mode 100644 index 00000000..16b196a9 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/normalize-options.js @@ -0,0 +1,70 @@ +"use strict"; + +exports.__esModule = true; +exports.applyMissingDependenciesDefaults = applyMissingDependenciesDefaults; +exports.validateIncludeExclude = validateIncludeExclude; +var _utils = require("./utils"); +function patternToRegExp(pattern) { + if (pattern instanceof RegExp) return pattern; + try { + return new RegExp(`^${pattern}$`); + } catch (_unused) { + return null; + } +} +function buildUnusedError(label, unused) { + if (!unused.length) return ""; + return ` - The following "${label}" patterns didn't match any polyfill:\n` + unused.map(original => ` ${String(original)}\n`).join(""); +} +function buldDuplicatesError(duplicates) { + if (!duplicates.size) return ""; + return ` - The following polyfills were matched both by "include" and "exclude" patterns:\n` + Array.from(duplicates, name => ` ${name}\n`).join(""); +} +function validateIncludeExclude(provider, polyfills, includePatterns, excludePatterns) { + let current; + const filter = pattern => { + const regexp = patternToRegExp(pattern); + if (!regexp) return false; + let matched = false; + for (const polyfill of polyfills.keys()) { + if (regexp.test(polyfill)) { + matched = true; + current.add(polyfill); + } + } + return !matched; + }; + + // prettier-ignore + const include = current = new Set(); + const unusedInclude = Array.from(includePatterns).filter(filter); + + // prettier-ignore + const exclude = current = new Set(); + const unusedExclude = Array.from(excludePatterns).filter(filter); + const duplicates = (0, _utils.intersection)(include, exclude); + if (duplicates.size > 0 || unusedInclude.length > 0 || unusedExclude.length > 0) { + throw new Error(`Error while validating the "${provider}" provider options:\n` + buildUnusedError("include", unusedInclude) + buildUnusedError("exclude", unusedExclude) + buldDuplicatesError(duplicates)); + } + return { + include, + exclude + }; +} +function applyMissingDependenciesDefaults(options, babelApi) { + const { + missingDependencies = {} + } = options; + if (missingDependencies === false) return false; + const caller = babelApi.caller(caller => caller == null ? void 0 : caller.name); + const { + log = "deferred", + inject = caller === "rollup-plugin-babel" ? "throw" : "import", + all = false + } = missingDependencies; + return { + log, + inject, + all + }; +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/types.js b/node_modules/@babel/helper-define-polyfill-provider/lib/types.js new file mode 100644 index 00000000..bf95ee70 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/types.js @@ -0,0 +1,3 @@ +"use strict"; + +exports.__esModule = true; \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js b/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js new file mode 100644 index 00000000..b2b88591 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/utils.js @@ -0,0 +1,190 @@ +"use strict"; + +exports.__esModule = true; +exports.createUtilsGetter = createUtilsGetter; +exports.getImportSource = getImportSource; +exports.getRequireSource = getRequireSource; +exports.has = has; +exports.intersection = intersection; +exports.resolveKey = resolveKey; +exports.resolveSource = resolveSource; +var _babel = _interopRequireWildcard(require("@babel/core")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const { + types: t, + template: template +} = _babel.default || _babel; +function intersection(a, b) { + const result = new Set(); + a.forEach(v => b.has(v) && result.add(v)); + return result; +} +function has(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); +} +function resolve(path, resolved = new Set()) { + if (resolved.has(path)) return; + resolved.add(path); + if (path.isVariableDeclarator()) { + if (path.get("id").isIdentifier()) { + return resolve(path.get("init"), resolved); + } + } else if (path.isReferencedIdentifier()) { + const binding = path.scope.getBinding(path.node.name); + if (!binding) return path; + if (!binding.constant) return; + return resolve(binding.path, resolved); + } + return path; +} +function resolveId(path) { + if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) { + return path.node.name; + } + const resolved = resolve(path); + if (resolved != null && resolved.isIdentifier()) { + return resolved.node.name; + } +} +function resolveKey(path, computed = false) { + const { + scope + } = path; + if (path.isStringLiteral()) return path.node.value; + const isIdentifier = path.isIdentifier(); + if (isIdentifier && !(computed || path.parent.computed)) { + return path.node.name; + } + if (computed && path.isMemberExpression() && path.get("object").isIdentifier({ + name: "Symbol" + }) && !scope.hasBinding("Symbol", /* noGlobals */true)) { + const sym = resolveKey(path.get("property"), path.node.computed); + if (sym) return "Symbol." + sym; + } + if (isIdentifier ? scope.hasBinding(path.node.name, /* noGlobals */true) : path.isPure()) { + const { + value + } = path.evaluate(); + if (typeof value === "string") return value; + } +} +function resolveSource(obj) { + if (obj.isMemberExpression() && obj.get("property").isIdentifier({ + name: "prototype" + })) { + const id = resolveId(obj.get("object")); + if (id) { + return { + id, + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; + } + const id = resolveId(obj); + if (id) { + return { + id, + placement: "static" + }; + } + const path = resolve(obj); + switch (path == null ? void 0 : path.type) { + case "RegExpLiteral": + return { + id: "RegExp", + placement: "prototype" + }; + case "FunctionExpression": + return { + id: "Function", + placement: "prototype" + }; + case "StringLiteral": + return { + id: "String", + placement: "prototype" + }; + case "NumberLiteral": + return { + id: "Number", + placement: "prototype" + }; + case "BooleanLiteral": + return { + id: "Boolean", + placement: "prototype" + }; + case "ObjectExpression": + return { + id: "Object", + placement: "prototype" + }; + case "ArrayExpression": + return { + id: "Array", + placement: "prototype" + }; + } + return { + id: null, + placement: null + }; +} +function getImportSource({ + node +}) { + if (node.specifiers.length === 0) return node.source.value; +} +function getRequireSource({ + node +}) { + if (!t.isExpressionStatement(node)) return; + const { + expression + } = node; + if (t.isCallExpression(expression) && t.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t.isStringLiteral(expression.arguments[0])) { + return expression.arguments[0].value; + } +} +function hoist(node) { + // @ts-expect-error + node._blockHoist = 3; + return node; +} +function createUtilsGetter(cache) { + return path => { + const prog = path.findParent(p => p.isProgram()); + return { + injectGlobalImport(url, moduleName) { + cache.storeAnonymous(prog, url, moduleName, (isScript, source) => { + return isScript ? template.statement.ast`require(${source})` : t.importDeclaration([], source); + }); + }, + injectNamedImport(url, name, hint = name, moduleName) { + return cache.storeNamed(prog, url, name, moduleName, (isScript, source, name) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast` + var ${id} = require(${source}).${name} + `) : t.importDeclaration([t.importSpecifier(id, name)], source), + name: id.name + }; + }); + }, + injectDefaultImport(url, hint = url, moduleName) { + return cache.storeNamed(prog, url, "default", moduleName, (isScript, source) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript ? hoist(template.statement.ast`var ${id} = require(${source})`) : t.importDeclaration([t.importDefaultSpecifier(id)], source), + name: id.name + }; + }); + } + }; + }; +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js new file mode 100644 index 00000000..e8b09030 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js @@ -0,0 +1,26 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _utils = require("../utils"); +var _default = callProvider => ({ + ImportDeclaration(path) { + const source = (0, _utils.getImportSource)(path); + if (!source) return; + callProvider({ + kind: "import", + source + }, path); + }, + Program(path) { + path.get("body").forEach(bodyPath => { + const source = (0, _utils.getRequireSource)(bodyPath); + if (!source) return; + callProvider({ + kind: "import", + source + }, bodyPath); + }); + } +}); +exports.default = _default; \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js new file mode 100644 index 00000000..056559b9 --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__esModule = true; +exports.usage = exports.entry = void 0; +var _usage = _interopRequireDefault(require("./usage")); +exports.usage = _usage.default; +var _entry = _interopRequireDefault(require("./entry")); +exports.entry = _entry.default; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js new file mode 100644 index 00000000..8b29474d --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js @@ -0,0 +1,129 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _utils = require("../utils"); +function isRemoved(path) { + if (path.removed) return true; + if (!path.parentPath) return false; + if (path.listKey) { + var _path$parentPath$node; + if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true; + } else { + if (path.parentPath.node[path.key] !== path.node) return true; + } + return isRemoved(path.parentPath); +} +var _default = callProvider => { + function property(object, key, placement, path) { + return callProvider({ + kind: "property", + object, + key, + placement + }, path); + } + function handleReferencedIdentifier(path) { + const { + node: { + name + }, + scope + } = path; + if (scope.getBindingIdentifier(name)) return; + callProvider({ + kind: "global", + name + }, path); + } + function analyzeMemberExpression(path) { + const key = (0, _utils.resolveKey)(path.get("property"), path.node.computed); + return { + key, + handleAsMemberExpression: !!key && key !== "prototype" + }; + } + return { + // Symbol(), new Promise + ReferencedIdentifier(path) { + const { + parentPath + } = path; + if (parentPath.isMemberExpression({ + object: path.node + }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) { + return; + } + handleReferencedIdentifier(path); + }, + "MemberExpression|OptionalMemberExpression"(path) { + const { + key, + handleAsMemberExpression + } = analyzeMemberExpression(path); + if (!handleAsMemberExpression) return; + const object = path.get("object"); + let objectIsGlobalIdentifier = object.isIdentifier(); + if (objectIsGlobalIdentifier) { + const binding = object.scope.getBinding(object.node.name); + if (binding) { + if (binding.path.isImportNamespaceSpecifier()) return; + objectIsGlobalIdentifier = false; + } + } + const source = (0, _utils.resolveSource)(object); + let skipObject = property(source.id, key, source.placement, path); + skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object)); + if (!skipObject) handleReferencedIdentifier(object); + }, + ObjectPattern(path) { + const { + parentPath, + parent + } = path; + let obj; + + // const { keys, values } = Object + if (parentPath.isVariableDeclarator()) { + obj = parentPath.get("init"); + // ({ keys, values } = Object) + } else if (parentPath.isAssignmentExpression()) { + obj = parentPath.get("right"); + // !function ({ keys, values }) {...} (Object) + // resolution does not work after properties transform :-( + } else if (parentPath.isFunction()) { + const grand = parentPath.parentPath; + if (grand.isCallExpression() || grand.isNewExpression()) { + if (grand.node.callee === parent) { + obj = grand.get("arguments")[path.key]; + } + } + } + let id = null; + let placement = null; + if (obj) ({ + id, + placement + } = (0, _utils.resolveSource)(obj)); + for (const prop of path.get("properties")) { + if (prop.isObjectProperty()) { + const key = (0, _utils.resolveKey)(prop.get("key")); + if (key) property(id, key, placement, prop); + } + } + }, + BinaryExpression(path) { + if (path.node.operator !== "in") return; + const source = (0, _utils.resolveSource)(path.get("right")); + const key = (0, _utils.resolveKey)(path.get("left"), true); + if (!key) return; + callProvider({ + kind: "in", + object: source.id, + key, + placement: source.placement + }, path); + } + }; +}; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/package.json b/node_modules/@babel/helper-define-polyfill-provider/package.json new file mode 100644 index 00000000..02cb6e0a --- /dev/null +++ b/node_modules/@babel/helper-define-polyfill-provider/package.json @@ -0,0 +1,59 @@ +{ + "name": "@babel/helper-define-polyfill-provider", + "version": "0.6.4", + "description": "Babel helper to create your own polyfill provider", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel-polyfills.git", + "directory": "packages/babel-helper-define-polyfill-provider" + }, + "keywords": [ + "babel-plugin" + ], + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "browser": { + "./lib/node/dependencies.js": "./lib/browser/dependencies.js", + "./src/node/dependencies.js": "./src/browser/dependencies.js" + }, + "exports": { + ".": [ + { + "import": { + "node": "./esm/index.node.mjs", + "browser": "./esm/index.browser.mjs" + }, + "default": "./lib/index.js" + }, + "./lib/index.js" + ], + "./package.json": "./package.json" + }, + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + }, + "devDependencies": { + "@babel/cli": "^7.22.6", + "@babel/core": "^7.22.6", + "@babel/generator": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/traverse": "^7.22.6", + "babel-loader": "^8.1.0", + "rollup": "^2.3.2", + "rollup-plugin-babel": "^4.4.0", + "strip-ansi": "^6.0.0", + "webpack": "^4.42.1", + "webpack-cli": "^3.3.11" + }, + "gitHead": "d87c29c909148920ad18690b63d450c561842298" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-member-expression-to-functions/LICENSE b/node_modules/@babel/helper-member-expression-to-functions/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-member-expression-to-functions/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-member-expression-to-functions/README.md b/node_modules/@babel/helper-member-expression-to-functions/README.md new file mode 100644 index 00000000..0e880e79 --- /dev/null +++ b/node_modules/@babel/helper-member-expression-to-functions/README.md @@ -0,0 +1,19 @@ +# @babel/helper-member-expression-to-functions + +> Helper function to replace certain member expressions with function calls + +See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/babel-helper-member-expression-to-functions) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-member-expression-to-functions +``` + +or using yarn: + +```sh +yarn add @babel/helper-member-expression-to-functions +``` diff --git a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js new file mode 100644 index 00000000..a17c7943 --- /dev/null +++ b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js @@ -0,0 +1,398 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var _t = require('@babel/types'); + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var _t__namespace = /*#__PURE__*/_interopNamespace(_t); + +function willPathCastToBoolean(path) { + const maybeWrapped = path; + const { + node, + parentPath + } = maybeWrapped; + if (parentPath.isLogicalExpression()) { + const { + operator, + right + } = parentPath.node; + if (operator === "&&" || operator === "||" || operator === "??" && node === right) { + return willPathCastToBoolean(parentPath); + } + } + if (parentPath.isSequenceExpression()) { + const { + expressions + } = parentPath.node; + if (expressions[expressions.length - 1] === node) { + return willPathCastToBoolean(parentPath); + } else { + return true; + } + } + return parentPath.isConditional({ + test: node + }) || parentPath.isUnaryExpression({ + operator: "!" + }) || parentPath.isLoop({ + test: node + }); +} + +const { + LOGICAL_OPERATORS, + arrowFunctionExpression, + assignmentExpression, + binaryExpression, + booleanLiteral, + callExpression, + cloneNode, + conditionalExpression, + identifier, + isMemberExpression, + isOptionalCallExpression, + isOptionalMemberExpression, + isUpdateExpression, + logicalExpression, + memberExpression, + nullLiteral, + optionalCallExpression, + optionalMemberExpression, + sequenceExpression, + updateExpression +} = _t__namespace; +class AssignmentMemoiser { + constructor() { + this._map = void 0; + this._map = new WeakMap(); + } + has(key) { + return this._map.has(key); + } + get(key) { + if (!this.has(key)) return; + const record = this._map.get(key); + const { + value + } = record; + record.count--; + if (record.count === 0) { + return assignmentExpression("=", value, key); + } + return value; + } + set(key, value, count) { + return this._map.set(key, { + count, + value + }); + } +} +function toNonOptional(path, base) { + const { + node + } = path; + if (isOptionalMemberExpression(node)) { + return memberExpression(base, node.property, node.computed); + } + if (path.isOptionalCallExpression()) { + const callee = path.get("callee"); + if (path.node.optional && callee.isOptionalMemberExpression()) { + const object = callee.node.object; + const context = path.scope.maybeGenerateMemoised(object); + callee.get("object").replaceWith(assignmentExpression("=", context, object)); + return callExpression(memberExpression(base, identifier("call")), [context, ...path.node.arguments]); + } + return callExpression(base, path.node.arguments); + } + return path.node; +} +function isInDetachedTree(path) { + while (path) { + if (path.isProgram()) break; + const { + parentPath, + container, + listKey + } = path; + const parentNode = parentPath.node; + if (listKey) { + if (container !== parentNode[listKey]) { + return true; + } + } else { + if (container !== parentNode) return true; + } + path = parentPath; + } + return false; +} +const handle = { + memoise() {}, + handle(member, noDocumentAll) { + const { + node, + parent, + parentPath, + scope + } = member; + if (member.isOptionalMemberExpression()) { + if (isInDetachedTree(member)) return; + const endPath = member.find(({ + node, + parent + }) => { + if (isOptionalMemberExpression(parent)) { + return parent.optional || parent.object !== node; + } + if (isOptionalCallExpression(parent)) { + return (node !== member.node && parent.optional || parent.callee !== node + ); + } + return true; + }); + if (scope.path.isPattern()) { + endPath.replaceWith(callExpression(arrowFunctionExpression([], endPath.node), [])); + return; + } + const willEndPathCastToBoolean = willPathCastToBoolean(endPath); + const rootParentPath = endPath.parentPath; + if (rootParentPath.isUpdateExpression({ + argument: node + })) { + throw member.buildCodeFrameError(`can't handle update expression`); + } + const isAssignment = rootParentPath.isAssignmentExpression({ + left: endPath.node + }); + const isDeleteOperation = rootParentPath.isUnaryExpression({ + operator: "delete" + }); + if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get("property").isPrivateName()) { + throw member.buildCodeFrameError(`can't delete a private class element`); + } + let startingOptional = member; + for (;;) { + if (startingOptional.isOptionalMemberExpression()) { + if (startingOptional.node.optional) break; + startingOptional = startingOptional.get("object"); + continue; + } else if (startingOptional.isOptionalCallExpression()) { + if (startingOptional.node.optional) break; + startingOptional = startingOptional.get("callee"); + continue; + } + throw new Error(`Internal error: unexpected ${startingOptional.node.type}`); + } + const startingNode = startingOptional.isOptionalMemberExpression() ? startingOptional.node.object : startingOptional.node.callee; + const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode); + const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode; + const parentIsOptionalCall = parentPath.isOptionalCallExpression({ + callee: node + }); + const isOptionalCall = parent => parentIsOptionalCall; + const parentIsCall = parentPath.isCallExpression({ + callee: node + }); + startingOptional.replaceWith(toNonOptional(startingOptional, baseRef)); + if (isOptionalCall()) { + if (parent.optional) { + parentPath.replaceWith(this.optionalCall(member, parent.arguments)); + } else { + parentPath.replaceWith(this.call(member, parent.arguments)); + } + } else if (parentIsCall) { + member.replaceWith(this.boundGet(member)); + } else if (this.delete && parentPath.isUnaryExpression({ + operator: "delete" + })) { + parentPath.replaceWith(this.delete(member)); + } else if (parentPath.isAssignmentExpression()) { + handleAssignment(this, member, parentPath); + } else { + member.replaceWith(this.get(member)); + } + let regular = member.node; + for (let current = member; current !== endPath;) { + const parentPath = current.parentPath; + if (parentPath === endPath && isOptionalCall() && parent.optional) { + regular = parentPath.node; + break; + } + regular = toNonOptional(parentPath, regular); + current = parentPath; + } + let context; + const endParentPath = endPath.parentPath; + if (isMemberExpression(regular) && endParentPath.isOptionalCallExpression({ + callee: endPath.node, + optional: true + })) { + const { + object + } = regular; + context = member.scope.maybeGenerateMemoised(object); + if (context) { + regular.object = assignmentExpression("=", context, object); + } + } + let replacementPath = endPath; + if (isDeleteOperation || isAssignment) { + replacementPath = endParentPath; + regular = endParentPath.node; + } + const baseMemoised = baseNeedsMemoised ? assignmentExpression("=", cloneNode(baseRef), cloneNode(startingNode)) : cloneNode(baseRef); + if (willEndPathCastToBoolean) { + let nonNullishCheck; + if (noDocumentAll) { + nonNullishCheck = binaryExpression("!=", baseMemoised, nullLiteral()); + } else { + nonNullishCheck = logicalExpression("&&", binaryExpression("!==", baseMemoised, nullLiteral()), binaryExpression("!==", cloneNode(baseRef), scope.buildUndefinedNode())); + } + replacementPath.replaceWith(logicalExpression("&&", nonNullishCheck, regular)); + } else { + let nullishCheck; + if (noDocumentAll) { + nullishCheck = binaryExpression("==", baseMemoised, nullLiteral()); + } else { + nullishCheck = logicalExpression("||", binaryExpression("===", baseMemoised, nullLiteral()), binaryExpression("===", cloneNode(baseRef), scope.buildUndefinedNode())); + } + replacementPath.replaceWith(conditionalExpression(nullishCheck, isDeleteOperation ? booleanLiteral(true) : scope.buildUndefinedNode(), regular)); + } + if (context) { + const endParent = endParentPath.node; + endParentPath.replaceWith(optionalCallExpression(optionalMemberExpression(endParent.callee, identifier("call"), false, true), [cloneNode(context), ...endParent.arguments], false)); + } + return; + } + if (isUpdateExpression(parent, { + argument: node + })) { + if (this.simpleSet) { + member.replaceWith(this.simpleSet(member)); + return; + } + const { + operator, + prefix + } = parent; + this.memoise(member, 2); + const ref = scope.generateUidIdentifierBasedOnNode(node); + scope.push({ + id: ref + }); + const seq = [assignmentExpression("=", cloneNode(ref), this.get(member))]; + if (prefix) { + seq.push(updateExpression(operator, cloneNode(ref), prefix)); + const value = sequenceExpression(seq); + parentPath.replaceWith(this.set(member, value)); + return; + } else { + const ref2 = scope.generateUidIdentifierBasedOnNode(node); + scope.push({ + id: ref2 + }); + seq.push(assignmentExpression("=", cloneNode(ref2), updateExpression(operator, cloneNode(ref), prefix)), cloneNode(ref)); + const value = sequenceExpression(seq); + parentPath.replaceWith(sequenceExpression([this.set(member, value), cloneNode(ref2)])); + return; + } + } + if (parentPath.isAssignmentExpression({ + left: node + })) { + handleAssignment(this, member, parentPath); + return; + } + if (parentPath.isCallExpression({ + callee: node + })) { + parentPath.replaceWith(this.call(member, parentPath.node.arguments)); + return; + } + if (parentPath.isOptionalCallExpression({ + callee: node + })) { + if (scope.path.isPattern()) { + parentPath.replaceWith(callExpression(arrowFunctionExpression([], parentPath.node), [])); + return; + } + parentPath.replaceWith(this.optionalCall(member, parentPath.node.arguments)); + return; + } + if (this.delete && parentPath.isUnaryExpression({ + operator: "delete" + })) { + parentPath.replaceWith(this.delete(member)); + return; + } + if (parentPath.isForXStatement({ + left: node + }) || parentPath.isObjectProperty({ + value: node + }) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({ + left: node + }) && parentPath.parentPath.isObjectProperty({ + value: parent + }) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({ + left: node + }) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) { + member.replaceWith(this.destructureSet(member)); + return; + } + if (parentPath.isTaggedTemplateExpression()) { + member.replaceWith(this.boundGet(member)); + } else { + member.replaceWith(this.get(member)); + } + } +}; +function handleAssignment(state, member, parentPath) { + if (state.simpleSet) { + member.replaceWith(state.simpleSet(member)); + return; + } + const { + operator, + right: value + } = parentPath.node; + if (operator === "=") { + parentPath.replaceWith(state.set(member, value)); + } else { + const operatorTrunc = operator.slice(0, -1); + if (LOGICAL_OPERATORS.includes(operatorTrunc)) { + state.memoise(member, 1); + parentPath.replaceWith(logicalExpression(operatorTrunc, state.get(member), state.set(member, value))); + } else { + state.memoise(member, 2); + parentPath.replaceWith(state.set(member, binaryExpression(operatorTrunc, state.get(member), value))); + } + } +} +function memberExpressionToFunctions(path, visitor, state) { + path.traverse(visitor, Object.assign({}, handle, state, { + memoiser: new AssignmentMemoiser() + })); +} + +exports.default = memberExpressionToFunctions; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map new file mode 100644 index 00000000..b21f082e --- /dev/null +++ b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/util.ts","../src/index.ts"],"sourcesContent":["import type { NodePath } from \"@babel/traverse\";\n\n/**\n * Test if a NodePath will be cast to boolean when evaluated.\n *\n * @example\n * // returns true\n * const nodePathAQDotB = NodePath(\"if (a?.#b) {}\").get(\"test\"); // a?.#b\n * willPathCastToBoolean(nodePathAQDotB)\n * @example\n * // returns false\n * willPathCastToBoolean(NodePath(\"a?.#b\"))\n * @todo Respect transparent expression wrappers\n * @see {@link packages/babel-plugin-transform-optional-chaining/src/util.js}\n * @param {NodePath} path\n * @returns {boolean}\n */\nexport function willPathCastToBoolean(path: NodePath): boolean {\n const maybeWrapped = path;\n const { node, parentPath } = maybeWrapped;\n if (parentPath.isLogicalExpression()) {\n const { operator, right } = parentPath.node;\n if (\n operator === \"&&\" ||\n operator === \"||\" ||\n (operator === \"??\" && node === right)\n ) {\n return willPathCastToBoolean(parentPath);\n }\n }\n if (parentPath.isSequenceExpression()) {\n const { expressions } = parentPath.node;\n if (expressions[expressions.length - 1] === node) {\n return willPathCastToBoolean(parentPath);\n } else {\n // if it is in the middle of a sequence expression, we don't\n // care the return value so just cast to boolean for smaller\n // output\n return true;\n }\n }\n return (\n parentPath.isConditional({ test: node }) ||\n parentPath.isUnaryExpression({ operator: \"!\" }) ||\n parentPath.isLoop({ test: node })\n );\n}\n","import type { NodePath, Visitor } from \"@babel/traverse\";\nimport {\n LOGICAL_OPERATORS,\n arrowFunctionExpression,\n assignmentExpression,\n binaryExpression,\n booleanLiteral,\n callExpression,\n cloneNode,\n conditionalExpression,\n identifier,\n isMemberExpression,\n isOptionalCallExpression,\n isOptionalMemberExpression,\n isUpdateExpression,\n logicalExpression,\n memberExpression,\n nullLiteral,\n optionalCallExpression,\n optionalMemberExpression,\n sequenceExpression,\n updateExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { willPathCastToBoolean } from \"./util.ts\";\n\nclass AssignmentMemoiser {\n private _map: WeakMap;\n constructor() {\n this._map = new WeakMap();\n }\n\n has(key: t.Expression) {\n return this._map.has(key);\n }\n\n get(key: t.Expression) {\n if (!this.has(key)) return;\n\n const record = this._map.get(key);\n const { value } = record;\n\n record.count--;\n if (record.count === 0) {\n // The `count` access is the outermost function call (hopefully), so it\n // does the assignment.\n return assignmentExpression(\"=\", value, key);\n }\n return value;\n }\n\n set(key: t.Expression, value: t.Identifier, count: number) {\n return this._map.set(key, { count, value });\n }\n}\n\nfunction toNonOptional(\n path: NodePath,\n base: t.Expression,\n): t.Expression {\n const { node } = path;\n if (isOptionalMemberExpression(node)) {\n return memberExpression(base, node.property, node.computed);\n }\n\n if (path.isOptionalCallExpression()) {\n const callee = path.get(\"callee\");\n if (path.node.optional && callee.isOptionalMemberExpression()) {\n // object must be a conditional expression because the optional private access in object has been transformed\n const object = callee.node.object as t.ConditionalExpression;\n const context = path.scope.maybeGenerateMemoised(object);\n callee\n .get(\"object\")\n .replaceWith(assignmentExpression(\"=\", context, object));\n\n return callExpression(memberExpression(base, identifier(\"call\")), [\n context,\n ...path.node.arguments,\n ]);\n }\n\n return callExpression(base, path.node.arguments);\n }\n\n return path.node;\n}\n\n// Determines if the current path is in a detached tree. This can happen when\n// we are iterating on a path, and replace an ancestor with a new node. Babel\n// doesn't always stop traversing the old node tree, and that can cause\n// inconsistencies.\nfunction isInDetachedTree(path: NodePath) {\n while (path) {\n if (path.isProgram()) break;\n\n const { parentPath, container, listKey } = path;\n const parentNode = parentPath.node;\n if (listKey) {\n if (\n container !==\n // @ts-expect-error listKey must be a valid parent node key\n parentNode[listKey]\n ) {\n return true;\n }\n } else {\n if (container !== parentNode) return true;\n }\n\n path = parentPath;\n }\n\n return false;\n}\n\ntype Member = NodePath;\n\nconst handle = {\n memoise() {\n // noop.\n },\n\n handle(this: HandlerState, member: Member, noDocumentAll: boolean) {\n const { node, parent, parentPath, scope } = member;\n\n if (member.isOptionalMemberExpression()) {\n // Transforming optional chaining requires we replace ancestors.\n if (isInDetachedTree(member)) return;\n\n // We're looking for the end of _this_ optional chain, which is actually\n // the \"rightmost\" property access of the chain. This is because\n // everything up to that property access is \"optional\".\n //\n // Let's take the case of `FOO?.BAR.baz?.qux`, with `FOO?.BAR` being our\n // member. The \"end\" to most users would be `qux` property access.\n // Everything up to it could be skipped if it `FOO` were nullish. But\n // actually, we can consider the `baz` access to be the end. So we're\n // looking for the nearest optional chain that is `optional: true`.\n const endPath = member.find(({ node, parent }) => {\n if (isOptionalMemberExpression(parent)) {\n // We need to check `parent.object` since we could be inside the\n // computed expression of a `bad?.[FOO?.BAR]`. In this case, the\n // endPath is the `FOO?.BAR` member itself.\n return parent.optional || parent.object !== node;\n }\n if (isOptionalCallExpression(parent)) {\n // Checking `parent.callee` since we could be in the arguments, eg\n // `bad?.(FOO?.BAR)`.\n // Also skip `FOO?.BAR` in `FOO?.BAR?.()` since we need to transform the optional call to ensure proper this\n return (\n // In FOO?.#BAR?.(), endPath points the optional call expression so we skip FOO?.#BAR\n (node !== member.node && parent.optional) || parent.callee !== node\n );\n }\n return true;\n }) as NodePath;\n\n // Replace `function (a, x = a.b?.#c) {}` to `function (a, x = (() => a.b?.#c)() ){}`\n // so the temporary variable can be injected in correct scope\n // This can be further optimized to avoid unnecessary IIFE\n if (scope.path.isPattern()) {\n endPath.replaceWith(\n // The injected member will be queued and eventually transformed when visited\n callExpression(arrowFunctionExpression([], endPath.node), []),\n );\n return;\n }\n\n const willEndPathCastToBoolean = willPathCastToBoolean(endPath);\n\n const rootParentPath = endPath.parentPath;\n if (rootParentPath.isUpdateExpression({ argument: node })) {\n throw member.buildCodeFrameError(`can't handle update expression`);\n }\n const isAssignment = rootParentPath.isAssignmentExpression({\n left: endPath.node,\n });\n const isDeleteOperation = rootParentPath.isUnaryExpression({\n operator: \"delete\",\n });\n if (\n isDeleteOperation &&\n endPath.isOptionalMemberExpression() &&\n endPath.get(\"property\").isPrivateName()\n ) {\n // @babel/parser will throw error on `delete obj?.#x`.\n // This error serves as fallback when `delete obj?.#x` is constructed from babel types\n throw member.buildCodeFrameError(\n `can't delete a private class element`,\n );\n }\n\n // Now, we're looking for the start of this optional chain, which is\n // optional to the left of this member.\n //\n // Let's take the case of `foo?.bar?.baz.QUX?.BAM`, with `QUX?.BAM` being\n // our member. The \"start\" to most users would be `foo` object access.\n // But actually, we can consider the `bar` access to be the start. So\n // we're looking for the nearest optional chain that is `optional: true`,\n // which is guaranteed to be somewhere in the object/callee tree.\n let startingOptional: NodePath = member;\n for (;;) {\n if (startingOptional.isOptionalMemberExpression()) {\n if (startingOptional.node.optional) break;\n startingOptional = startingOptional.get(\"object\");\n continue;\n } else if (startingOptional.isOptionalCallExpression()) {\n if (startingOptional.node.optional) break;\n startingOptional = startingOptional.get(\"callee\");\n continue;\n }\n // prevent infinite loop: unreachable if the AST is well-formed\n throw new Error(\n `Internal error: unexpected ${startingOptional.node.type}`,\n );\n }\n\n const startingNode = startingOptional.isOptionalMemberExpression()\n ? startingOptional.node.object\n : startingOptional.node.callee;\n const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);\n const baseRef = baseNeedsMemoised ?? startingNode;\n\n // Compute parentIsOptionalCall before `startingOptional` is replaced\n // as `node` may refer to `startingOptional.node` before replaced.\n const parentIsOptionalCall = parentPath.isOptionalCallExpression({\n callee: node,\n });\n // here we use a function to wrap `parentIsOptionalCall` to get type\n // for parent, do not use it anywhere else\n // See https://github.com/microsoft/TypeScript/issues/10421\n const isOptionalCall = (\n parent: t.Node,\n ): parent is t.OptionalCallExpression => parentIsOptionalCall;\n // if parentIsCall is true, it implies that node.extra.parenthesized is always true\n const parentIsCall = parentPath.isCallExpression({ callee: node });\n startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));\n if (isOptionalCall(parent)) {\n if (parent.optional) {\n parentPath.replaceWith(this.optionalCall(member, parent.arguments));\n } else {\n parentPath.replaceWith(this.call(member, parent.arguments));\n }\n } else if (parentIsCall) {\n // `(a?.#b)()` to `(a == null ? void 0 : a.#b.bind(a))()`\n member.replaceWith(this.boundGet(member));\n } else if (\n (process.env.BABEL_8_BREAKING || this.delete) &&\n parentPath.isUnaryExpression({ operator: \"delete\" })\n ) {\n parentPath.replaceWith(this.delete(member));\n } else if (parentPath.isAssignmentExpression()) {\n // `a?.#b = c` to `(a == null ? void 0 : a.#b = c)`\n handleAssignment(this, member, parentPath);\n } else {\n member.replaceWith(this.get(member));\n }\n\n let regular: t.Expression = member.node;\n for (let current: NodePath = member; current !== endPath; ) {\n const parentPath = current.parentPath as NodePath;\n // skip transforming `Foo.#BAR?.call(FOO)`\n if (\n parentPath === endPath &&\n isOptionalCall(parent) &&\n parent.optional\n ) {\n regular = parentPath.node;\n break;\n }\n regular = toNonOptional(parentPath, regular);\n current = parentPath;\n }\n\n let context: t.Identifier;\n const endParentPath = endPath.parentPath as NodePath;\n if (\n isMemberExpression(regular) &&\n endParentPath.isOptionalCallExpression({\n callee: endPath.node,\n optional: true,\n })\n ) {\n const { object } = regular;\n context = member.scope.maybeGenerateMemoised(object);\n if (context) {\n regular.object = assignmentExpression(\n \"=\",\n context,\n // object must not be Super when `context` is an identifier\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n object as t.Expression,\n );\n }\n }\n\n let replacementPath: NodePath = endPath;\n if (isDeleteOperation || isAssignment) {\n replacementPath = endParentPath;\n regular = endParentPath.node;\n }\n\n const baseMemoised = baseNeedsMemoised\n ? assignmentExpression(\n \"=\",\n // When base needs memoised, the baseRef must be an identifier\n cloneNode(baseRef as t.Identifier),\n cloneNode(startingNode),\n )\n : cloneNode(baseRef);\n\n if (willEndPathCastToBoolean) {\n let nonNullishCheck;\n if (noDocumentAll) {\n nonNullishCheck = binaryExpression(\"!=\", baseMemoised, nullLiteral());\n } else {\n nonNullishCheck = logicalExpression(\n \"&&\",\n binaryExpression(\"!==\", baseMemoised, nullLiteral()),\n binaryExpression(\n \"!==\",\n cloneNode(baseRef),\n scope.buildUndefinedNode(),\n ),\n );\n }\n replacementPath.replaceWith(\n logicalExpression(\"&&\", nonNullishCheck, regular),\n );\n } else {\n let nullishCheck;\n if (noDocumentAll) {\n nullishCheck = binaryExpression(\"==\", baseMemoised, nullLiteral());\n } else {\n nullishCheck = logicalExpression(\n \"||\",\n binaryExpression(\"===\", baseMemoised, nullLiteral()),\n binaryExpression(\n \"===\",\n cloneNode(baseRef),\n scope.buildUndefinedNode(),\n ),\n );\n }\n\n replacementPath.replaceWith(\n conditionalExpression(\n nullishCheck,\n isDeleteOperation\n ? booleanLiteral(true)\n : scope.buildUndefinedNode(),\n regular,\n ),\n );\n }\n\n // context and isDeleteOperation can not be both truthy\n if (context) {\n const endParent = endParentPath.node as t.OptionalCallExpression;\n endParentPath.replaceWith(\n optionalCallExpression(\n optionalMemberExpression(\n endParent.callee,\n identifier(\"call\"),\n false,\n true,\n ),\n [cloneNode(context), ...endParent.arguments],\n false,\n ),\n );\n }\n\n return;\n }\n\n // MEMBER++ -> _set(MEMBER, (ref = _get(MEMBER), ref2 = ref++, ref)), ref2\n // ++MEMBER -> _set(MEMBER, (ref = _get(MEMBER), ++ref))\n if (isUpdateExpression(parent, { argument: node })) {\n if (this.simpleSet) {\n member.replaceWith(this.simpleSet(member));\n return;\n }\n\n const { operator, prefix } = parent;\n\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n const ref = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({ id: ref });\n\n const seq: t.Expression[] = [\n // ref = _get(MEMBER)\n assignmentExpression(\"=\", cloneNode(ref), this.get(member)),\n ];\n\n if (prefix) {\n seq.push(updateExpression(operator, cloneNode(ref), prefix));\n\n // (ref = _get(MEMBER), ++ref)\n const value = sequenceExpression(seq);\n parentPath.replaceWith(this.set(member, value));\n\n return;\n } else {\n const ref2 = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({ id: ref2 });\n\n seq.push(\n assignmentExpression(\n \"=\",\n cloneNode(ref2),\n updateExpression(operator, cloneNode(ref), prefix),\n ),\n cloneNode(ref),\n );\n\n // (ref = _get(MEMBER), ref2 = ref++, ref)\n const value = sequenceExpression(seq);\n parentPath.replaceWith(\n sequenceExpression([this.set(member, value), cloneNode(ref2)]),\n );\n\n return;\n }\n }\n\n // MEMBER = VALUE -> _set(MEMBER, VALUE)\n // MEMBER += VALUE -> _set(MEMBER, _get(MEMBER) + VALUE)\n // MEMBER ??= VALUE -> _get(MEMBER) ?? _set(MEMBER, VALUE)\n if (parentPath.isAssignmentExpression({ left: node })) {\n handleAssignment(this, member, parentPath);\n return;\n }\n\n // MEMBER(ARGS) -> _call(MEMBER, ARGS)\n if (parentPath.isCallExpression({ callee: node })) {\n parentPath.replaceWith(this.call(member, parentPath.node.arguments));\n return;\n }\n\n // MEMBER?.(ARGS) -> _optionalCall(MEMBER, ARGS)\n if (parentPath.isOptionalCallExpression({ callee: node })) {\n // Replace `function (a, x = a.b.#c?.()) {}` to `function (a, x = (() => a.b.#c?.())() ){}`\n // so the temporary variable can be injected in correct scope\n // This can be further optimized to avoid unnecessary IIFE\n if (scope.path.isPattern()) {\n parentPath.replaceWith(\n // The injected member will be queued and eventually transformed when visited\n callExpression(arrowFunctionExpression([], parentPath.node), []),\n );\n return;\n }\n parentPath.replaceWith(\n this.optionalCall(member, parentPath.node.arguments),\n );\n return;\n }\n\n // delete MEMBER -> _delete(MEMBER)\n if (\n (process.env.BABEL_8_BREAKING || this.delete) &&\n parentPath.isUnaryExpression({ operator: \"delete\" })\n ) {\n parentPath.replaceWith(this.delete(member));\n return;\n }\n\n // for (MEMBER of ARR)\n // for (MEMBER in ARR)\n // { KEY: MEMBER } = OBJ -> { KEY: _destructureSet(MEMBER) } = OBJ\n // { KEY: MEMBER = _VALUE } = OBJ -> { KEY: _destructureSet(MEMBER) = _VALUE } = OBJ\n // {...MEMBER} -> {..._destructureSet(MEMBER)}\n //\n // [MEMBER] = ARR -> [_destructureSet(MEMBER)] = ARR\n // [MEMBER = _VALUE] = ARR -> [_destructureSet(MEMBER) = _VALUE] = ARR\n // [...MEMBER] -> [..._destructureSet(MEMBER)]\n if (\n // for (MEMBER of ARR)\n // for (MEMBER in ARR)\n parentPath.isForXStatement({ left: node }) ||\n // { KEY: MEMBER } = OBJ\n (parentPath.isObjectProperty({ value: node }) &&\n parentPath.parentPath.isObjectPattern()) ||\n // { KEY: MEMBER = _VALUE } = OBJ\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isObjectProperty({ value: parent }) &&\n parentPath.parentPath.parentPath.isObjectPattern()) ||\n // [MEMBER] = ARR\n parentPath.isArrayPattern() ||\n // [MEMBER = _VALUE] = ARR\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isArrayPattern()) ||\n // {...MEMBER}\n // [...MEMBER]\n parentPath.isRestElement()\n ) {\n member.replaceWith(this.destructureSet(member));\n return;\n }\n\n if (parentPath.isTaggedTemplateExpression()) {\n // MEMBER -> _get(MEMBER).bind(this)\n member.replaceWith(this.boundGet(member));\n } else {\n // MEMBER -> _get(MEMBER)\n member.replaceWith(this.get(member));\n }\n },\n};\n\nfunction handleAssignment(\n state: HandlerState,\n member: NodePath,\n parentPath: NodePath,\n) {\n if (state.simpleSet) {\n member.replaceWith(state.simpleSet(member));\n return;\n }\n\n const { operator, right: value } = parentPath.node;\n\n if (operator === \"=\") {\n parentPath.replaceWith(state.set(member, value));\n } else {\n const operatorTrunc = operator.slice(0, -1);\n if (LOGICAL_OPERATORS.includes(operatorTrunc)) {\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The first access (the get) should do the memo\n // assignment.\n state.memoise(member, 1);\n parentPath.replaceWith(\n logicalExpression(\n operatorTrunc as t.LogicalExpression[\"operator\"],\n state.get(member),\n state.set(member, value),\n ),\n );\n } else {\n // Here, the second access (the set) is evaluated first.\n state.memoise(member, 2);\n parentPath.replaceWith(\n state.set(\n member,\n binaryExpression(\n operatorTrunc as t.BinaryExpression[\"operator\"],\n state.get(member),\n value,\n ),\n ),\n );\n }\n }\n}\n\nexport interface Handler {\n memoise?(\n this: HandlerState & State,\n member: Member,\n count: number,\n ): void;\n destructureSet(\n this: HandlerState & State,\n member: Member,\n ): t.Expression;\n boundGet(this: HandlerState & State, member: Member): t.Expression;\n simpleSet?(this: HandlerState & State, member: Member): t.Expression;\n get(this: HandlerState & State, member: Member): t.Expression;\n set(\n this: HandlerState & State,\n member: Member,\n value: t.Expression,\n ): t.Expression;\n call(\n this: HandlerState & State,\n member: Member,\n args: t.CallExpression[\"arguments\"],\n ): t.Expression;\n optionalCall(\n this: HandlerState & State,\n member: Member,\n args: t.OptionalCallExpression[\"arguments\"],\n ): t.Expression;\n delete(this: HandlerState & State, member: Member): t.Expression;\n}\n\nexport interface HandlerState extends Handler {\n handle(\n this: HandlerState & State,\n member: Member,\n noDocumentAll?: boolean,\n ): void;\n memoiser: AssignmentMemoiser;\n}\n\n// We do not provide a default traversal visitor\n// Instead, caller passes one, and must call `state.handle` on the members\n// it wishes to be transformed.\n// Additionally, the caller must pass in a state object with at least\n// get, set, and call methods.\n// Optionally, a memoise method may be defined on the state, which will be\n// called when the member is a self-referential update.\nexport default function memberExpressionToFunctions(\n path: NodePath,\n visitor: Visitor>,\n state: Handler & CustomState,\n) {\n path.traverse(visitor, {\n ...handle,\n ...state,\n memoiser: new AssignmentMemoiser(),\n });\n}\n"],"names":["willPathCastToBoolean","path","maybeWrapped","node","parentPath","isLogicalExpression","operator","right","isSequenceExpression","expressions","length","isConditional","test","isUnaryExpression","isLoop","LOGICAL_OPERATORS","arrowFunctionExpression","assignmentExpression","binaryExpression","booleanLiteral","callExpression","cloneNode","conditionalExpression","identifier","isMemberExpression","isOptionalCallExpression","isOptionalMemberExpression","isUpdateExpression","logicalExpression","memberExpression","nullLiteral","optionalCallExpression","optionalMemberExpression","sequenceExpression","updateExpression","_t","AssignmentMemoiser","constructor","_map","WeakMap","has","key","get","record","value","count","set","toNonOptional","base","property","computed","callee","optional","object","context","scope","maybeGenerateMemoised","replaceWith","arguments","isInDetachedTree","isProgram","container","listKey","parentNode","handle","memoise","member","noDocumentAll","parent","endPath","find","isPattern","willEndPathCastToBoolean","rootParentPath","argument","buildCodeFrameError","isAssignment","isAssignmentExpression","left","isDeleteOperation","isPrivateName","startingOptional","Error","type","startingNode","baseNeedsMemoised","baseRef","parentIsOptionalCall","isOptionalCall","parentIsCall","isCallExpression","optionalCall","call","boundGet","delete","handleAssignment","regular","current","endParentPath","replacementPath","baseMemoised","nonNullishCheck","buildUndefinedNode","nullishCheck","endParent","simpleSet","prefix","ref","generateUidIdentifierBasedOnNode","push","id","seq","ref2","isForXStatement","isObjectProperty","isObjectPattern","isAssignmentPattern","isArrayPattern","isRestElement","destructureSet","isTaggedTemplateExpression","state","operatorTrunc","slice","includes","memberExpressionToFunctions","visitor","traverse","Object","assign","memoiser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,SAASA,qBAAqBA,CAACC,IAAc,EAAW;EAC7D,MAAMC,YAAY,GAAGD,IAAI,CAAA;EACzB,MAAM;IAAEE,IAAI;AAAEC,IAAAA,UAAAA;AAAW,GAAC,GAAGF,YAAY,CAAA;AACzC,EAAA,IAAIE,UAAU,CAACC,mBAAmB,EAAE,EAAE;IACpC,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,KAAAA;KAAO,GAAGH,UAAU,CAACD,IAAI,CAAA;AAC3C,IAAA,IACEG,QAAQ,KAAK,IAAI,IACjBA,QAAQ,KAAK,IAAI,IAChBA,QAAQ,KAAK,IAAI,IAAIH,IAAI,KAAKI,KAAM,EACrC;MACA,OAAOP,qBAAqB,CAACI,UAAU,CAAC,CAAA;AAC1C,KAAA;AACF,GAAA;AACA,EAAA,IAAIA,UAAU,CAACI,oBAAoB,EAAE,EAAE;IACrC,MAAM;AAAEC,MAAAA,WAAAA;KAAa,GAAGL,UAAU,CAACD,IAAI,CAAA;IACvC,IAAIM,WAAW,CAACA,WAAW,CAACC,MAAM,GAAG,CAAC,CAAC,KAAKP,IAAI,EAAE;MAChD,OAAOH,qBAAqB,CAACI,UAAU,CAAC,CAAA;AAC1C,KAAC,MAAM;AAIL,MAAA,OAAO,IAAI,CAAA;AACb,KAAA;AACF,GAA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AAQ,EAAE,IAAI9F,kBAAkB,EAAC;AAAC,GAAA,CACnC,CAAC,CAAA;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/@babel/helper-member-expression-to-functions/package.json b/node_modules/@babel/helper-member-expression-to-functions/package.json new file mode 100644 index 00000000..c143fa3d --- /dev/null +++ b/node_modules/@babel/helper-member-expression-to-functions/package.json @@ -0,0 +1,25 @@ +{ + "name": "@babel/helper-member-expression-to-functions", + "version": "7.27.1", + "description": "Helper function to replace certain member expressions with function calls", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-member-expression-to-functions" + }, + "homepage": "https://babel.dev/docs/en/next/babel-helper-member-expression-to-functions", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "author": "The Babel Team (https://babel.dev/team)", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/LICENSE b/node_modules/@babel/helper-module-imports/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-module-imports/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-module-imports/README.md b/node_modules/@babel/helper-module-imports/README.md new file mode 100644 index 00000000..aa47726f --- /dev/null +++ b/node_modules/@babel/helper-module-imports/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-imports + +> Babel helper functions for inserting module loads + +See our website [@babel/helper-module-imports](https://babeljs.io/docs/babel-helper-module-imports) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-module-imports +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-imports +``` diff --git a/node_modules/@babel/helper-module-imports/lib/import-builder.js b/node_modules/@babel/helper-module-imports/lib/import-builder.js new file mode 100644 index 00000000..b01187f9 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-builder.js @@ -0,0 +1,122 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _assert = require("assert"); +var _t = require("@babel/types"); +const { + callExpression, + cloneNode, + expressionStatement, + identifier, + importDeclaration, + importDefaultSpecifier, + importNamespaceSpecifier, + importSpecifier, + memberExpression, + stringLiteral, + variableDeclaration, + variableDeclarator +} = _t; +class ImportBuilder { + constructor(importedSource, scope, hub) { + this._statements = []; + this._resultName = null; + this._importedSource = void 0; + this._scope = scope; + this._hub = hub; + this._importedSource = importedSource; + } + done() { + return { + statements: this._statements, + resultName: this._resultName + }; + } + import() { + this._statements.push(importDeclaration([], stringLiteral(this._importedSource))); + return this; + } + require() { + this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)]))); + return this; + } + namespace(name = "namespace") { + const local = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importNamespaceSpecifier(local)]; + this._resultName = cloneNode(local); + return this; + } + default(name) { + const id = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importDefaultSpecifier(id)]; + this._resultName = cloneNode(id); + return this; + } + named(name, importName) { + if (importName === "default") return this.default(name); + const id = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importSpecifier(id, identifier(importName))]; + this._resultName = cloneNode(id); + return this; + } + var(name) { + const id = this._scope.generateUidIdentifier(name); + let statement = this._statements[this._statements.length - 1]; + if (statement.type !== "ExpressionStatement") { + _assert(this._resultName); + statement = expressionStatement(this._resultName); + this._statements.push(statement); + } + this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]); + this._resultName = cloneNode(id); + return this; + } + defaultInterop() { + return this._interop(this._hub.addHelper("interopRequireDefault")); + } + wildcardInterop() { + return this._interop(this._hub.addHelper("interopRequireWildcard")); + } + _interop(callee) { + const statement = this._statements[this._statements.length - 1]; + if (statement.type === "ExpressionStatement") { + statement.expression = callExpression(callee, [statement.expression]); + } else if (statement.type === "VariableDeclaration") { + _assert(statement.declarations.length === 1); + statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]); + } else { + _assert.fail("Unexpected type."); + } + return this; + } + prop(name) { + const statement = this._statements[this._statements.length - 1]; + if (statement.type === "ExpressionStatement") { + statement.expression = memberExpression(statement.expression, identifier(name)); + } else if (statement.type === "VariableDeclaration") { + _assert(statement.declarations.length === 1); + statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name)); + } else { + _assert.fail("Unexpected type:" + statement.type); + } + return this; + } + read(name) { + this._resultName = memberExpression(this._resultName, identifier(name)); + } +} +exports.default = ImportBuilder; + +//# sourceMappingURL=import-builder.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/import-builder.js.map b/node_modules/@babel/helper-module-imports/lib/import-builder.js.map new file mode 100644 index 00000000..920accc3 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-builder.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_t","callExpression","cloneNode","expressionStatement","identifier","importDeclaration","importDefaultSpecifier","importNamespaceSpecifier","importSpecifier","memberExpression","stringLiteral","variableDeclaration","variableDeclarator","ImportBuilder","constructor","importedSource","scope","hub","_statements","_resultName","_importedSource","_scope","_hub","done","statements","resultName","import","push","namespace","name","local","generateUidIdentifier","statement","length","assert","type","specifiers","default","id","named","importName","var","expression","defaultInterop","_interop","addHelper","wildcardInterop","callee","declarations","init","fail","prop","read","exports"],"sources":["../src/import-builder.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n callExpression,\n cloneNode,\n expressionStatement,\n identifier,\n importDeclaration,\n importDefaultSpecifier,\n importNamespaceSpecifier,\n importSpecifier,\n memberExpression,\n stringLiteral,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Scope, HubInterface } from \"@babel/traverse\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n private _statements: t.Statement[] = [];\n private _resultName: t.Identifier | t.MemberExpression = null;\n\n declare _scope: Scope;\n declare _hub: HubInterface;\n private _importedSource: string;\n\n constructor(importedSource: string, scope: Scope, hub: HubInterface) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n importDeclaration([], stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n expressionStatement(\n callExpression(identifier(\"require\"), [\n stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n const local = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importNamespaceSpecifier(local)];\n this._resultName = cloneNode(local);\n return this;\n }\n default(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importDefaultSpecifier(id)];\n this._resultName = cloneNode(id);\n return this;\n }\n named(name: string, importName: string) {\n if (importName === \"default\") return this.default(name);\n\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importSpecifier(id, identifier(importName))];\n this._resultName = cloneNode(id);\n return this;\n }\n\n var(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = variableDeclaration(\"var\", [\n variableDeclarator(id, statement.expression),\n ]);\n this._resultName = cloneNode(id);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee: t.Expression) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name: string) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = memberExpression(\n statement.expression,\n identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = memberExpression(\n statement.declarations[0].init,\n identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name: string) {\n this._resultName = memberExpression(this._resultName, identifier(name));\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAasB;EAZpBE,cAAc;EACdC,SAAS;EACTC,mBAAmB;EACnBC,UAAU;EACVC,iBAAiB;EACjBC,sBAAsB;EACtBC,wBAAwB;EACxBC,eAAe;EACfC,gBAAgB;EAChBC,aAAa;EACbC,mBAAmB;EACnBC;AAAkB,IAAAZ,EAAA;AASL,MAAMa,aAAa,CAAC;EAQjCC,WAAWA,CAACC,cAAsB,EAAEC,KAAY,EAAEC,GAAiB,EAAE;IAAA,KAP7DC,WAAW,GAAkB,EAAE;IAAA,KAC/BC,WAAW,GAAsC,IAAI;IAAA,KAIrDC,eAAe;IAGrB,IAAI,CAACC,MAAM,GAAGL,KAAK;IACnB,IAAI,CAACM,IAAI,GAAGL,GAAG;IACf,IAAI,CAACG,eAAe,GAAGL,cAAc;EACvC;EAEAQ,IAAIA,CAAA,EAAG;IACL,OAAO;MACLC,UAAU,EAAE,IAAI,CAACN,WAAW;MAC5BO,UAAU,EAAE,IAAI,CAACN;IACnB,CAAC;EACH;EAEAO,MAAMA,CAAA,EAAG;IACP,IAAI,CAACR,WAAW,CAACS,IAAI,CACnBtB,iBAAiB,CAAC,EAAE,EAAEK,aAAa,CAAC,IAAI,CAACU,eAAe,CAAC,CAC3D,CAAC;IACD,OAAO,IAAI;EACb;EAEArB,OAAOA,CAAA,EAAG;IACR,IAAI,CAACmB,WAAW,CAACS,IAAI,CACnBxB,mBAAmB,CACjBF,cAAc,CAACG,UAAU,CAAC,SAAS,CAAC,EAAE,CACpCM,aAAa,CAAC,IAAI,CAACU,eAAe,CAAC,CACpC,CACH,CACF,CAAC;IACD,OAAO,IAAI;EACb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,IAAI,GAAGxC,gBAAgB,CAC/CuB,SAAS,CAACgB,YAAY,CAAC,CAAC,CAAC,CAACC,IAAI,EAC9B7C,UAAU,CAACyB,IAAI,CACjB,CAAC;IACH,CAAC,MAAM;MACLK,OAAM,CAACgB,IAAI,CAAC,kBAAkB,GAAGlB,SAAS,CAACG,IAAI,CAAC;IAClD;IACA,OAAO,IAAI;EACb;EAEAiB,IAAIA,CAACvB,IAAY,EAAE;IACjB,IAAI,CAACV,WAAW,GAAGV,gBAAgB,CAAC,IAAI,CAACU,WAAW,EAAEf,UAAU,CAACyB,IAAI,CAAC,CAAC;EACzE;AACF;AAACwB,OAAA,CAAAhB,OAAA,GAAAxB,aAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/import-injector.js b/node_modules/@babel/helper-module-imports/lib/import-injector.js new file mode 100644 index 00000000..0c61c565 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-injector.js @@ -0,0 +1,304 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _assert = require("assert"); +var _t = require("@babel/types"); +var _importBuilder = require("./import-builder.js"); +var _isModule = require("./is-module.js"); +const { + identifier, + importSpecifier, + numericLiteral, + sequenceExpression, + isImportDeclaration +} = _t; +class ImportInjector { + constructor(path, importedSource, opts) { + this._defaultOpts = { + importedSource: null, + importedType: "commonjs", + importedInterop: "babel", + importingInterop: "babel", + ensureLiveReference: false, + ensureNoContext: false, + importPosition: "before" + }; + const programPath = path.find(p => p.isProgram()); + this._programPath = programPath; + this._programScope = programPath.scope; + this._hub = programPath.hub; + this._defaultOpts = this._applyDefaults(importedSource, opts, true); + } + addDefault(importedSourceIn, opts) { + return this.addNamed("default", importedSourceIn, opts); + } + addNamed(importName, importedSourceIn, opts) { + _assert(typeof importName === "string"); + return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName); + } + addNamespace(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), null); + } + addSideEffect(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0); + } + _applyDefaults(importedSource, opts, isInit = false) { + let newOpts; + if (typeof importedSource === "string") { + newOpts = Object.assign({}, this._defaultOpts, { + importedSource + }, opts); + } else { + _assert(!opts, "Unexpected secondary arguments."); + newOpts = Object.assign({}, this._defaultOpts, importedSource); + } + if (!isInit && opts) { + if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint; + if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist; + } + return newOpts; + } + _generateImport(opts, importName) { + const isDefault = importName === "default"; + const isNamed = !!importName && !isDefault; + const isNamespace = importName === null; + const { + importedSource, + importedType, + importedInterop, + importingInterop, + ensureLiveReference, + ensureNoContext, + nameHint, + importPosition, + blockHoist + } = opts; + let name = nameHint || importName; + const isMod = (0, _isModule.default)(this._programPath); + const isModuleForNode = isMod && importingInterop === "node"; + const isModuleForBabel = isMod && importingInterop === "babel"; + if (importPosition === "after" && !isMod) { + throw new Error(`"importPosition": "after" is only supported in modules`); + } + const builder = new _importBuilder.default(importedSource, this._programScope, this._hub); + if (importedType === "es6") { + if (!isModuleForNode && !isModuleForBabel) { + throw new Error("Cannot import an ES6 module from CommonJS"); + } + builder.import(); + if (isNamespace) { + builder.namespace(nameHint || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else if (importedType !== "commonjs") { + throw new Error(`Unexpected interopType "${importedType}"`); + } else if (importedInterop === "babel") { + if (isModuleForNode) { + name = name !== "default" ? name : importedSource; + const es6Default = `${importedSource}$es6Default`; + builder.import(); + if (isNamespace) { + builder.default(es6Default).var(name || importedSource).wildcardInterop(); + } else if (isDefault) { + if (ensureLiveReference) { + builder.default(es6Default).var(name || importedSource).defaultInterop().read("default"); + } else { + builder.default(es6Default).var(name).defaultInterop().prop(importName); + } + } else if (isNamed) { + builder.default(es6Default).read(importName); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource).wildcardInterop(); + } else if ((isDefault || isNamed) && ensureLiveReference) { + if (isDefault) { + name = name !== "default" ? name : importedSource; + builder.var(name).read(importName); + builder.defaultInterop(); + } else { + builder.var(importedSource).read(importName); + } + } else if (isDefault) { + builder.var(name).defaultInterop().prop(importName); + } else if (isNamed) { + builder.var(name).prop(importName); + } + } + } else if (importedInterop === "compiled") { + if (isModuleForNode) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault || isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault || isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.prop(importName).var(name); + } + } + } + } else if (importedInterop === "uncompiled") { + if (isDefault && ensureLiveReference) { + throw new Error("No live reference for commonjs default"); + } + if (isModuleForNode) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault) { + builder.var(name); + } else if (isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.var(name).prop(importName); + } + } + } + } else { + throw new Error(`Unknown importedInterop "${importedInterop}".`); + } + const { + statements, + resultName + } = builder.done(); + this._insertStatements(statements, importPosition, blockHoist); + if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") { + return sequenceExpression([numericLiteral(0), resultName]); + } + return resultName; + } + _insertStatements(statements, importPosition = "before", blockHoist = 3) { + if (importPosition === "after") { + if (this._insertStatementsAfter(statements)) return; + } else { + if (this._insertStatementsBefore(statements, blockHoist)) return; + } + this._programPath.unshiftContainer("body", statements); + } + _insertStatementsBefore(statements, blockHoist) { + if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) { + const firstImportDecl = this._programPath.get("body").find(p => { + return p.isImportDeclaration() && isValueImport(p.node); + }); + if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) { + return true; + } + } + statements.forEach(node => { + node._blockHoist = blockHoist; + }); + const targetPath = this._programPath.get("body").find(p => { + const val = p.node._blockHoist; + return Number.isFinite(val) && val < 4; + }); + if (targetPath) { + targetPath.insertBefore(statements); + return true; + } + return false; + } + _insertStatementsAfter(statements) { + const statementsSet = new Set(statements); + const importDeclarations = new Map(); + for (const statement of statements) { + if (isImportDeclaration(statement) && isValueImport(statement)) { + const source = statement.source.value; + if (!importDeclarations.has(source)) importDeclarations.set(source, []); + importDeclarations.get(source).push(statement); + } + } + let lastImportPath = null; + for (const bodyStmt of this._programPath.get("body")) { + if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) { + lastImportPath = bodyStmt; + const source = bodyStmt.node.source.value; + const newImports = importDeclarations.get(source); + if (!newImports) continue; + for (const decl of newImports) { + if (!statementsSet.has(decl)) continue; + if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) { + statementsSet.delete(decl); + } + } + } + } + if (statementsSet.size === 0) return true; + if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet)); + return !!lastImportPath; + } +} +exports.default = ImportInjector; +function isValueImport(node) { + return node.importKind !== "type" && node.importKind !== "typeof"; +} +function hasNamespaceImport(node) { + return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier"; +} +function hasDefaultImport(node) { + return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier"; +} +function maybeAppendImportSpecifiers(target, source) { + if (!target.specifiers.length) { + target.specifiers = source.specifiers; + return true; + } + if (!source.specifiers.length) return true; + if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false; + if (hasDefaultImport(source)) { + if (hasDefaultImport(target)) { + source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default")); + } else { + target.specifiers.unshift(source.specifiers.shift()); + } + } + target.specifiers.push(...source.specifiers); + return true; +} + +//# sourceMappingURL=import-injector.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/import-injector.js.map b/node_modules/@babel/helper-module-imports/lib/import-injector.js.map new file mode 100644 index 00000000..8fe3a982 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-injector.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_t","_importBuilder","_isModule","identifier","importSpecifier","numericLiteral","sequenceExpression","isImportDeclaration","ImportInjector","constructor","path","importedSource","opts","_defaultOpts","importedType","importedInterop","importingInterop","ensureLiveReference","ensureNoContext","importPosition","programPath","find","p","isProgram","_programPath","_programScope","scope","_hub","hub","_applyDefaults","addDefault","importedSourceIn","addNamed","importName","assert","_generateImport","addNamespace","addSideEffect","isInit","newOpts","Object","assign","nameHint","undefined","blockHoist","isDefault","isNamed","isNamespace","name","isMod","isModule","isModuleForNode","isModuleForBabel","Error","builder","ImportBuilder","import","namespace","named","es6Default","default","var","wildcardInterop","defaultInterop","read","prop","statements","resultName","done","_insertStatements","type","_insertStatementsAfter","_insertStatementsBefore","unshiftContainer","length","isValueImport","firstImportDecl","get","node","source","value","maybeAppendImportSpecifiers","forEach","_blockHoist","targetPath","val","Number","isFinite","insertBefore","statementsSet","Set","importDeclarations","Map","statement","has","set","push","lastImportPath","bodyStmt","newImports","decl","delete","size","insertAfter","Array","from","exports","importKind","hasNamespaceImport","specifiers","hasDefaultImport","target","local","unshift","shift"],"sources":["../src/import-injector.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n identifier,\n importSpecifier,\n numericLiteral,\n sequenceExpression,\n isImportDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath, Scope, HubInterface } from \"@babel/traverse\";\n\nimport ImportBuilder from \"./import-builder.ts\";\nimport isModule from \"./is-module.ts\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null;\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\";\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\";\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\";\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean;\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean;\n /**\n * Define whether the import should be loaded before or after the existing imports.\n * \"after\" is only allowed inside ECMAScript modules, since it's not possible to\n * reliably pick the location _after_ require() calls but _before_ other code in CJS.\n */\n importPosition: \"before\" | \"after\";\n\n nameHint?: string;\n blockHoist?: number;\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n declare _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n declare _programScope: Scope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n declare _hub: HubInterface;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n importPosition: \"before\",\n };\n\n constructor(\n path: NodePath,\n importedSource?: string,\n opts?: Partial,\n ) {\n const programPath = path.find(p => p.isProgram()) as NodePath;\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn: string, opts: Partial) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(\n importName: string,\n importedSourceIn: string,\n opts: Partial,\n ) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn: string, opts: Partial) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn: string, opts: Partial) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n void 0,\n );\n }\n\n _applyDefaults(\n importedSource: string | Partial,\n opts: Partial | undefined,\n isInit = false,\n ) {\n let newOpts: ImportOptions;\n if (typeof importedSource === \"string\") {\n newOpts = { ...this._defaultOpts, importedSource, ...opts };\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n newOpts = { ...this._defaultOpts, ...importedSource };\n }\n\n if (!isInit && opts) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n return newOpts;\n }\n\n _generateImport(\n opts: Partial,\n importName: string | null | undefined,\n ) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n importPosition,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n // This is ignored when \"importPosition\" is \"after\".\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n if (importPosition === \"after\" && !isMod) {\n throw new Error(`\"importPosition\": \"after\" is only supported in modules`);\n }\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder.var(name).defaultInterop().prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, importPosition, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return sequenceExpression([numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(\n statements: t.Statement[],\n importPosition = \"before\",\n blockHoist = 3,\n ) {\n if (importPosition === \"after\") {\n if (this._insertStatementsAfter(statements)) return;\n } else {\n if (this._insertStatementsBefore(statements, blockHoist)) return;\n }\n\n this._programPath.unshiftContainer(\"body\", statements);\n }\n\n _insertStatementsBefore(statements: t.Statement[], blockHoist: number) {\n if (\n statements.length === 1 &&\n isImportDeclaration(statements[0]) &&\n isValueImport(statements[0])\n ) {\n const firstImportDecl = this._programPath\n .get(\"body\")\n .find((p): p is NodePath => {\n return p.isImportDeclaration() && isValueImport(p.node);\n });\n\n if (\n firstImportDecl?.node.source.value === statements[0].source.value &&\n maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])\n ) {\n return true;\n }\n }\n\n statements.forEach(node => {\n // @ts-expect-error handle _blockHoist\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n // @ts-expect-error todo(flow->ts): avoid mutations\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n return true;\n }\n\n return false;\n }\n\n _insertStatementsAfter(statements: t.Statement[]): boolean {\n const statementsSet = new Set(statements);\n const importDeclarations: Map = new Map();\n\n for (const statement of statements) {\n if (isImportDeclaration(statement) && isValueImport(statement)) {\n const source = statement.source.value;\n if (!importDeclarations.has(source)) importDeclarations.set(source, []);\n importDeclarations.get(source).push(statement);\n }\n }\n\n let lastImportPath = null;\n for (const bodyStmt of this._programPath.get(\"body\")) {\n if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {\n lastImportPath = bodyStmt;\n\n const source = bodyStmt.node.source.value;\n const newImports = importDeclarations.get(source);\n if (!newImports) continue;\n\n for (const decl of newImports) {\n if (!statementsSet.has(decl)) continue;\n if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {\n statementsSet.delete(decl);\n }\n }\n }\n }\n\n if (statementsSet.size === 0) return true;\n\n if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));\n\n return !!lastImportPath;\n }\n}\n\nfunction isValueImport(node: t.ImportDeclaration) {\n return node.importKind !== \"type\" && node.importKind !== \"typeof\";\n}\n\nfunction hasNamespaceImport(node: t.ImportDeclaration) {\n return (\n (node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ImportNamespaceSpecifier\") ||\n (node.specifiers.length === 2 &&\n node.specifiers[1].type === \"ImportNamespaceSpecifier\")\n );\n}\n\nfunction hasDefaultImport(node: t.ImportDeclaration) {\n return (\n node.specifiers.length > 0 &&\n node.specifiers[0].type === \"ImportDefaultSpecifier\"\n );\n}\n\nfunction maybeAppendImportSpecifiers(\n target: t.ImportDeclaration,\n source: t.ImportDeclaration,\n): boolean {\n if (!target.specifiers.length) {\n target.specifiers = source.specifiers;\n return true;\n }\n if (!source.specifiers.length) return true;\n\n if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;\n\n if (hasDefaultImport(source)) {\n if (hasDefaultImport(target)) {\n source.specifiers[0] = importSpecifier(\n source.specifiers[0].local,\n identifier(\"default\"),\n );\n } else {\n target.specifiers.unshift(source.specifiers.shift());\n }\n }\n\n target.specifiers.push(...source.specifiers);\n\n return true;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAUA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAsC;EAVpCI,UAAU;EACVC,eAAe;EACfC,cAAc;EACdC,kBAAkB;EAClBC;AAAmB,IAAAP,EAAA;AAsGN,MAAMQ,cAAc,CAAC;EA6BlCC,WAAWA,CACTC,IAAc,EACdC,cAAuB,EACvBC,IAA6B,EAC7B;IAAA,KAdFC,YAAY,GAAkB;MAC5BF,cAAc,EAAE,IAAI;MACpBG,YAAY,EAAE,UAAU;MACxBC,eAAe,EAAE,OAAO;MACxBC,gBAAgB,EAAE,OAAO;MACzBC,mBAAmB,EAAE,KAAK;MAC1BC,eAAe,EAAE,KAAK;MACtBC,cAAc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0B,IACvDQ,IAAI,CAAC+B,UAAU,CAACnC,MAAM,KAAK,CAAC,IAC3BI,IAAI,CAAC+B,UAAU,CAAC,CAAC,CAAC,CAACvC,IAAI,KAAK,0BAA2B;AAE7D;AAEA,SAASwC,gBAAgBA,CAAChC,IAAyB,EAAE;EACnD,OACEA,IAAI,CAAC+B,UAAU,CAACnC,MAAM,GAAG,CAAC,IAC1BI,IAAI,CAAC+B,UAAU,CAAC,CAAC,CAAC,CAACvC,IAAI,KAAK,wBAAwB;AAExD;AAEA,SAASW,2BAA2BA,CAClC8B,MAA2B,EAC3BhC,MAA2B,EAClB;EACT,IAAI,CAACgC,MAAM,CAACF,UAAU,CAACnC,MAAM,EAAE;IAC7BqC,MAAM,CAACF,UAAU,GAAG9B,MAAM,CAAC8B,UAAU;IACrC,OAAO,IAAI;EACb;EACA,IAAI,CAAC9B,MAAM,CAAC8B,UAAU,CAACnC,MAAM,EAAE,OAAO,IAAI;EAE1C,IAAIkC,kBAAkB,CAACG,MAAM,CAAC,IAAIH,kBAAkB,CAAC7B,MAAM,CAAC,EAAE,OAAO,KAAK;EAE1E,IAAI+B,gBAAgB,CAAC/B,MAAM,CAAC,EAAE;IAC5B,IAAI+B,gBAAgB,CAACC,MAAM,CAAC,EAAE;MAC5BhC,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,GAAGzG,eAAe,CACpC2E,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,CAACG,KAAK,EAC1B7G,UAAU,CAAC,SAAS,CACtB,CAAC;IACH,CAAC,MAAM;MACL4G,MAAM,CAACF,UAAU,CAACI,OAAO,CAAClC,MAAM,CAAC8B,UAAU,CAACK,KAAK,CAAC,CAAC,CAAC;IACtD;EACF;EAEAH,MAAM,CAACF,UAAU,CAACb,IAAI,CAAC,GAAGjB,MAAM,CAAC8B,UAAU,CAAC;EAE5C,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/index.js b/node_modules/@babel/helper-module-imports/lib/index.js new file mode 100644 index 00000000..84f97fc5 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/index.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ImportInjector", { + enumerable: true, + get: function () { + return _importInjector.default; + } +}); +exports.addDefault = addDefault; +exports.addNamed = addNamed; +exports.addNamespace = addNamespace; +exports.addSideEffect = addSideEffect; +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _isModule.default; + } +}); +var _importInjector = require("./import-injector.js"); +var _isModule = require("./is-module.js"); +function addDefault(path, importedSource, opts) { + return new _importInjector.default(path).addDefault(importedSource, opts); +} +function addNamed(path, name, importedSource, opts) { + return new _importInjector.default(path).addNamed(name, importedSource, opts); +} +function addNamespace(path, importedSource, opts) { + return new _importInjector.default(path).addNamespace(importedSource, opts); +} +function addSideEffect(path, importedSource, opts) { + return new _importInjector.default(path).addSideEffect(importedSource, opts); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/index.js.map b/node_modules/@babel/helper-module-imports/lib/index.js.map new file mode 100644 index 00000000..787cfd39 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_importInjector","require","_isModule","addDefault","path","importedSource","opts","ImportInjector","addNamed","name","addNamespace","addSideEffect"],"sources":["../src/index.ts"],"sourcesContent":["import ImportInjector, { type ImportOptions } from \"./import-injector.ts\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module.ts\";\n\nexport function addDefault(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<\n Partial,\n \"ensureLiveReference\" | \"ensureNoContext\"\n >,\n): t.Identifier;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit, \"ensureLiveReference\"> & {\n ensureLiveReference: true;\n },\n): t.MemberExpression;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit, \"ensureNoContext\"> & {\n ensureNoContext: true;\n },\n): t.SequenceExpression;\n/**\n * add a named import to the program path of given path\n *\n * @export\n * @param {NodePath} path The starting path to find a program path\n * @param {string} name The name of the generated binding. Babel will prefix it with `_`\n * @param {string} importedSource The source of the import\n * @param {Partial} [opts]\n * @returns {t.Identifier | t.MemberExpression | t.SequenceExpression} If opts.ensureNoContext is true, returns a SequenceExpression,\n * else if opts.ensureLiveReference is true, returns a MemberExpression, else returns an Identifier\n */\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\nexport { addNamed };\n\nexport function addNamespace(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEO,SAASE,UAAUA,CACxBC,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACD,UAAU,CAACE,cAAc,EAAEC,IAAI,CAAC;AAClE;AAsCA,SAASE,QAAQA,CACfJ,IAAc,EACdK,IAAY,EACZJ,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACI,QAAQ,CAACC,IAAI,EAAEJ,cAAc,EAAEC,IAAI,CAAC;AACtE;AAGO,SAASI,YAAYA,CAC1BN,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACM,YAAY,CAACL,cAAc,EAAEC,IAAI,CAAC;AACpE;AAEO,SAASK,aAAaA,CAC3BP,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACO,aAAa,CAACN,cAAc,EAAEC,IAAI,CAAC;AACrE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/is-module.js b/node_modules/@babel/helper-module-imports/lib/is-module.js new file mode 100644 index 00000000..0bbda013 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/is-module.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isModule; +function isModule(path) { + return path.node.sourceType === "module"; +} + +//# sourceMappingURL=is-module.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/is-module.js.map b/node_modules/@babel/helper-module-imports/lib/is-module.js.map new file mode 100644 index 00000000..c4608069 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/is-module.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isModule","path","node","sourceType"],"sources":["../src/is-module.ts"],"sourcesContent":["import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\n/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n return path.node.sourceType === \"module\";\n}\n"],"mappings":";;;;;;AAMe,SAASA,QAAQA,CAACC,IAAyB,EAAE;EAC1D,OAAOA,IAAI,CAACC,IAAI,CAACC,UAAU,KAAK,QAAQ;AAC1C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/package.json b/node_modules/@babel/helper-module-imports/package.json new file mode 100644 index 00000000..f9dee72b --- /dev/null +++ b/node_modules/@babel/helper-module-imports/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/helper-module-imports", + "version": "7.27.1", + "description": "Babel helper functions for inserting module loads", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helper-module-imports", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-imports" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "devDependencies": { + "@babel/core": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/LICENSE b/node_modules/@babel/helper-module-transforms/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-module-transforms/README.md b/node_modules/@babel/helper-module-transforms/README.md new file mode 100644 index 00000000..d0f82fe0 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-transforms + +> Babel helper functions for implementing ES6 module transformations + +See our website [@babel/helper-module-transforms](https://babeljs.io/docs/babel-helper-module-transforms) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-module-transforms +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-transforms +``` diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js new file mode 100644 index 00000000..90fcea61 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildDynamicImport = buildDynamicImport; +var _core = require("@babel/core"); +{ + exports.getDynamicImportSource = function getDynamicImportSource(node) { + const [source] = node.arguments; + return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``; + }; +} +function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) { + const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source; + if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) { + if (deferToThen) { + return _core.template.expression.ast` + Promise.resolve().then(() => ${builder(specifier)}) + `; + } else return builder(specifier); + } + const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({ + raw: "" + }), _core.types.templateElement({ + raw: "" + })], [_core.types.identifier("specifier")]); + if (deferToThen) { + return _core.template.expression.ast` + (specifier => + new Promise(r => r(${specifierToString})) + .then(s => ${builder(_core.types.identifier("s"))}) + )(${specifier}) + `; + } else if (wrapWithPromise) { + return _core.template.expression.ast` + (specifier => + new Promise(r => r(${builder(specifierToString)})) + )(${specifier}) + `; + } else { + return _core.template.expression.ast` + (specifier => ${builder(specifierToString)})(${specifier}) + `; + } +} + +//# sourceMappingURL=dynamic-import.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map new file mode 100644 index 00000000..1ae8dc39 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","exports","getDynamicImportSource","node","source","arguments","t","isStringLiteral","isTemplateLiteral","template","expression","ast","buildDynamicImport","deferToThen","wrapWithPromise","builder","specifier","isCallExpression","quasis","length","specifierToString","identifier","templateLiteral","templateElement","raw"],"sources":["../src/dynamic-import.ts"],"sourcesContent":["// Heavily inspired by\n// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js\n\nimport { types as t, template } from \"@babel/core\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource = function getDynamicImportSource(\n node: t.CallExpression,\n ): t.StringLiteral | t.TemplateLiteral {\n const [source] = node.arguments;\n\n return t.isStringLiteral(source) || t.isTemplateLiteral(source)\n ? source\n : (template.expression.ast`\\`\\${${source}}\\`` as t.TemplateLiteral);\n };\n}\n\nexport function buildDynamicImport(\n node: t.CallExpression | t.ImportExpression,\n deferToThen: boolean,\n wrapWithPromise: boolean,\n builder: (specifier: t.Expression) => t.Expression,\n): t.Expression {\n const specifier = t.isCallExpression(node) ? node.arguments[0] : node.source;\n\n if (\n t.isStringLiteral(specifier) ||\n (t.isTemplateLiteral(specifier) && specifier.quasis.length === 0)\n ) {\n if (deferToThen) {\n return template.expression.ast`\n Promise.resolve().then(() => ${builder(specifier)})\n `;\n } else return builder(specifier);\n }\n\n const specifierToString = t.isTemplateLiteral(specifier)\n ? t.identifier(\"specifier\")\n : t.templateLiteral(\n [t.templateElement({ raw: \"\" }), t.templateElement({ raw: \"\" })],\n [t.identifier(\"specifier\")],\n );\n\n if (deferToThen) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${specifierToString}))\n .then(s => ${builder(t.identifier(\"s\"))})\n )(${specifier})\n `;\n } else if (wrapWithPromise) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${builder(specifierToString)}))\n )(${specifier})\n `;\n } else {\n return template.expression.ast`\n (specifier => ${builder(specifierToString)})(${specifier})\n `;\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEiE;EAE/DC,OAAO,CAACC,sBAAsB,GAAG,SAASA,sBAAsBA,CAC9DC,IAAsB,EACe;IACrC,MAAM,CAACC,MAAM,CAAC,GAAGD,IAAI,CAACE,SAAS;IAE/B,OAAOC,WAAC,CAACC,eAAe,CAACH,MAAM,CAAC,IAAIE,WAAC,CAACE,iBAAiB,CAACJ,MAAM,CAAC,GAC3DA,MAAM,GACLK,cAAQ,CAACC,UAAU,CAACC,GAAG,QAAQP,MAAM,KAA2B;EACvE,CAAC;AACH;AAEO,SAASQ,kBAAkBA,CAChCT,IAA2C,EAC3CU,WAAoB,EACpBC,eAAwB,EACxBC,OAAkD,EACpC;EACd,MAAMC,SAAS,GAAGV,WAAC,CAACW,gBAAgB,CAACd,IAAI,CAAC,GAAGA,IAAI,CAACE,SAAS,CAAC,CAAC,CAAC,GAAGF,IAAI,CAACC,MAAM;EAE5E,IACEE,WAAC,CAACC,eAAe,CAACS,SAAS,CAAC,IAC3BV,WAAC,CAACE,iBAAiB,CAACQ,SAAS,CAAC,IAAIA,SAAS,CAACE,MAAM,CAACC,MAAM,KAAK,CAAE,EACjE;IACA,IAAIN,WAAW,EAAE;MACf,OAAOJ,cAAQ,CAACC,UAAU,CAACC,GAAG;AACpC,uCAAuCI,OAAO,CAACC,SAAS,CAAC;AACzD,OAAO;IACH,CAAC,MAAM,OAAOD,OAAO,CAACC,SAAS,CAAC;EAClC;EAEA,MAAMI,iBAAiB,GAAGd,WAAC,CAACE,iBAAiB,CAACQ,SAAS,CAAC,GACpDV,WAAC,CAACe,UAAU,CAAC,WAAW,CAAC,GACzBf,WAAC,CAACgB,eAAe,CACf,CAAChB,WAAC,CAACiB,eAAe,CAAC;IAAEC,GAAG,EAAE;EAAG,CAAC,CAAC,EAAElB,WAAC,CAACiB,eAAe,CAAC;IAAEC,GAAG,EAAE;EAAG,CAAC,CAAC,CAAC,EAChE,CAAClB,WAAC,CAACe,UAAU,CAAC,WAAW,CAAC,CAC5B,CAAC;EAEL,IAAIR,WAAW,EAAE;IACf,OAAOJ,cAAQ,CAACC,UAAU,CAACC,GAAG;AAClC;AACA,6BAA6BS,iBAAiB;AAC9C,uBAAuBL,OAAO,CAACT,WAAC,CAACe,UAAU,CAAC,GAAG,CAAC,CAAC;AACjD,UAAUL,SAAS;AACnB,KAAK;EACH,CAAC,MAAM,IAAIF,eAAe,EAAE;IAC1B,OAAOL,cAAQ,CAACC,UAAU,CAACC,GAAG;AAClC;AACA,6BAA6BI,OAAO,CAACK,iBAAiB,CAAC;AACvD,UAAUJ,SAAS;AACnB,KAAK;EACH,CAAC,MAAM;IACL,OAAOP,cAAQ,CAACC,UAAU,CAACC,GAAG;AAClC,sBAAsBI,OAAO,CAACK,iBAAiB,CAAC,KAAKJ,SAAS;AAC9D,KAAK;EACH;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js new file mode 100644 index 00000000..b1a6ed70 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getModuleName; +{ + const originalGetModuleName = getModuleName; + exports.default = getModuleName = function getModuleName(rootOpts, pluginOpts) { + var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo; + return originalGetModuleName(rootOpts, { + moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId, + moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds, + getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId, + moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot + }); + }; +} +function getModuleName(rootOpts, pluginOpts) { + const { + filename, + filenameRelative = filename, + sourceRoot = pluginOpts.moduleRoot + } = rootOpts; + const { + moduleId, + moduleIds = !!moduleId, + getModuleId, + moduleRoot = sourceRoot + } = pluginOpts; + if (!moduleIds) return null; + if (moduleId != null && !getModuleId) { + return moduleId; + } + let moduleName = moduleRoot != null ? moduleRoot + "/" : ""; + if (filenameRelative) { + const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : ""; + moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, ""); + } + moduleName = moduleName.replace(/\\/g, "/"); + if (getModuleId) { + return getModuleId(moduleName) || moduleName; + } else { + return moduleName; + } +} + +//# sourceMappingURL=get-module-name.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map new file mode 100644 index 00000000..fd69f3bb --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map @@ -0,0 +1 @@ +{"version":3,"names":["originalGetModuleName","getModuleName","exports","default","rootOpts","pluginOpts","_pluginOpts$moduleId","_pluginOpts$moduleIds","_pluginOpts$getModule","_pluginOpts$moduleRoo","moduleId","moduleIds","getModuleId","moduleRoot","filename","filenameRelative","sourceRoot","moduleName","sourceRootReplacer","RegExp","replace"],"sources":["../src/get-module-name.ts"],"sourcesContent":["type RootOptions = {\n filename?: string;\n filenameRelative?: string;\n sourceRoot?: string;\n};\n\nexport type PluginOptions = {\n moduleId?: string;\n moduleIds?: boolean;\n getModuleId?: (moduleName: string) => string | null | undefined;\n moduleRoot?: string;\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n const originalGetModuleName = getModuleName;\n\n // @ts-expect-error TS doesn't like reassigning a function.\n getModuleName = function getModuleName(\n rootOpts: RootOptions & PluginOptions,\n pluginOpts: PluginOptions,\n ): string | null {\n return originalGetModuleName(rootOpts, {\n moduleId: pluginOpts.moduleId ?? rootOpts.moduleId,\n moduleIds: pluginOpts.moduleIds ?? rootOpts.moduleIds,\n getModuleId: pluginOpts.getModuleId ?? rootOpts.getModuleId,\n moduleRoot: pluginOpts.moduleRoot ?? rootOpts.moduleRoot,\n });\n };\n}\n\nexport default function getModuleName(\n rootOpts: RootOptions,\n pluginOpts: PluginOptions,\n): string | null {\n const {\n filename,\n filenameRelative = filename,\n sourceRoot = pluginOpts.moduleRoot,\n } = rootOpts;\n\n const {\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n moduleRoot = sourceRoot,\n } = pluginOpts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.\\w*$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n}\n"],"mappings":";;;;;;AAamC;EACjC,MAAMA,qBAAqB,GAAGC,aAAa;EAG3CC,OAAA,CAAAC,OAAA,GAAAF,aAAa,GAAG,SAASA,aAAaA,CACpCG,QAAqC,EACrCC,UAAyB,EACV;IAAA,IAAAC,oBAAA,EAAAC,qBAAA,EAAAC,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QAAQ,EAAE,EAAE,CAAC;EAC1B;EAGAH,UAAU,GAAGA,UAAU,CAACG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAE3C,IAAIR,WAAW,EAAE;IAEf,OAAOA,WAAW,CAACK,UAAU,CAAC,IAAIA,UAAU;EAC9C,CAAC,MAAM;IACL,OAAOA,UAAU;EACnB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js b/node_modules/@babel/helper-module-transforms/lib/index.js new file mode 100644 index 00000000..ac884d25 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/index.js @@ -0,0 +1,398 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "buildDynamicImport", { + enumerable: true, + get: function () { + return _dynamicImport.buildDynamicImport; + } +}); +exports.buildNamespaceInitStatements = buildNamespaceInitStatements; +exports.ensureStatementsHoisted = ensureStatementsHoisted; +Object.defineProperty(exports, "getModuleName", { + enumerable: true, + get: function () { + return _getModuleName.default; + } +}); +Object.defineProperty(exports, "hasExports", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.hasExports; + } +}); +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _helperModuleImports.isModule; + } +}); +Object.defineProperty(exports, "isSideEffectImport", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.isSideEffectImport; + } +}); +exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader; +Object.defineProperty(exports, "rewriteThis", { + enumerable: true, + get: function () { + return _rewriteThis.default; + } +}); +exports.wrapInterop = wrapInterop; +var _assert = require("assert"); +var _core = require("@babel/core"); +var _helperModuleImports = require("@babel/helper-module-imports"); +var _rewriteThis = require("./rewrite-this.js"); +var _rewriteLiveReferences = require("./rewrite-live-references.js"); +var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js"); +var Lazy = require("./lazy-modules.js"); +var _dynamicImport = require("./dynamic-import.js"); +var _getModuleName = require("./get-module-name.js"); +{ + exports.getDynamicImportSource = require("./dynamic-import").getDynamicImportSource; +} +function rewriteModuleStatementsAndPrepareHeader(path, { + exportName, + strict, + allowTopLevelThis, + strictMode, + noInterop, + importInterop = noInterop ? "none" : "babel", + lazy, + getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false), + wrapReference = Lazy.wrapReference, + esNamespaceOnly, + filename, + constantReexports = arguments[1].loose, + enumerableModuleMeta = arguments[1].loose, + noIncompleteNsImportDetection +}) { + (0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop); + _assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script"); + path.node.sourceType = "script"; + const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, { + importInterop, + initializeReexports: constantReexports, + getWrapperPayload, + esNamespaceOnly, + filename + }); + if (!allowTopLevelThis) { + (0, _rewriteThis.default)(path); + } + (0, _rewriteLiveReferences.default)(path, meta, wrapReference); + if (strictMode !== false) { + const hasStrict = path.node.directives.some(directive => { + return directive.value.value === "use strict"; + }); + if (!hasStrict) { + path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict"))); + } + } + const headers = []; + if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) { + headers.push(buildESModuleHeader(meta, enumerableModuleMeta)); + } + const nameList = buildExportNameListDeclaration(path, meta); + if (nameList) { + meta.exportNameListName = nameList.name; + headers.push(nameList.statement); + } + headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection)); + return { + meta, + headers + }; +} +function ensureStatementsHoisted(statements) { + statements.forEach(header => { + header._blockHoist = 3; + }); +} +function wrapInterop(programPath, expr, type) { + if (type === "none") { + return null; + } + if (type === "node-namespace") { + return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]); + } else if (type === "node-default") { + return null; + } + let helper; + if (type === "default") { + helper = "interopRequireDefault"; + } else if (type === "namespace") { + helper = "interopRequireWildcard"; + } else { + throw new Error(`Unknown interop: ${type}`); + } + return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]); +} +function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) { + var _wrapReference; + const statements = []; + const srcNamespaceId = _core.types.identifier(sourceMetadata.name); + for (const localName of sourceMetadata.importsNamespace) { + if (localName === sourceMetadata.name) continue; + statements.push(_core.template.statement`var NAME = SOURCE;`({ + NAME: localName, + SOURCE: _core.types.cloneNode(srcNamespaceId) + })); + } + const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId; + if (constantReexports) { + statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference)); + } + for (const exportName of sourceMetadata.reexportNamespace) { + statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement` + Object.defineProperty(EXPORTS, "NAME", { + enumerable: true, + get: function() { + return NAMESPACE; + } + }); + ` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({ + EXPORTS: metadata.exportName, + NAME: exportName, + NAMESPACE: _core.types.cloneNode(srcNamespace) + })); + } + if (sourceMetadata.reexportAll) { + const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports); + statement.loc = sourceMetadata.reexportAll.loc; + statements.push(statement); + } + return statements; +} +const ReexportTemplate = { + constant: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + ${exports}.${exportName} = ${namespaceImport}; + `, + constantComputed: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + ${exports}["${exportName}"] = ${namespaceImport}; + `, + spec: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + Object.defineProperty(${exports}, "${exportName}", { + enumerable: true, + get: function() { + return ${namespaceImport}; + }, + }); + ` +}; +function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) { + var _wrapReference2; + let namespace = _core.types.identifier(metadata.name); + namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace; + const { + stringSpecifiers + } = meta; + return Array.from(metadata.reexports, ([exportName, importName]) => { + let namespaceImport = _core.types.cloneNode(namespace); + if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) { + namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true); + } else { + namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName)); + } + const astNodes = { + exports: meta.exportName, + exportName, + namespaceImport + }; + if (constantReexports || _core.types.isIdentifier(namespaceImport)) { + if (stringSpecifiers.has(exportName)) { + return ReexportTemplate.constantComputed(astNodes); + } else { + return ReexportTemplate.constant(astNodes); + } + } else { + return ReexportTemplate.spec(astNodes); + } + }); +} +function buildESModuleHeader(metadata, enumerableModuleMeta = false) { + return (enumerableModuleMeta ? _core.template.statement` + EXPORTS.__esModule = true; + ` : _core.template.statement` + Object.defineProperty(EXPORTS, "__esModule", { + value: true, + }); + `)({ + EXPORTS: metadata.exportName + }); +} +function buildNamespaceReexport(metadata, namespace, constantReexports) { + return (constantReexports ? _core.template.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + EXPORTS[key] = NAMESPACE[key]; + }); + ` : _core.template.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + Object.defineProperty(EXPORTS, key, { + enumerable: true, + get: function() { + return NAMESPACE[key]; + }, + }); + }); + `)({ + NAMESPACE: namespace, + EXPORTS: metadata.exportName, + VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)` + if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return; + `({ + EXPORTS_LIST: metadata.exportNameListName + }) : null + }); +} +function buildExportNameListDeclaration(programPath, metadata) { + const exportedVars = Object.create(null); + for (const data of metadata.local.values()) { + for (const name of data.names) { + exportedVars[name] = true; + } + } + let hasReexport = false; + for (const data of metadata.source.values()) { + for (const exportName of data.reexports.keys()) { + exportedVars[exportName] = true; + } + for (const exportName of data.reexportNamespace) { + exportedVars[exportName] = true; + } + hasReexport = hasReexport || !!data.reexportAll; + } + if (!hasReexport || Object.keys(exportedVars).length === 0) return null; + const name = programPath.scope.generateUidIdentifier("exportNames"); + delete exportedVars.default; + return { + name: name.name, + statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))]) + }; +} +function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) { + const initStatements = []; + for (const [localName, data] of metadata.local) { + if (data.kind === "import") {} else if (data.kind === "hoisted") { + initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]); + } else if (!noIncompleteNsImportDetection) { + for (const exportName of data.names) { + initStatements.push([exportName, null]); + } + } + } + for (const data of metadata.source.values()) { + if (!constantReexports) { + const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference); + const reexports = [...data.reexports.keys()]; + for (let i = 0; i < reexportsStatements.length; i++) { + initStatements.push([reexports[i], reexportsStatements[i]]); + } + } + if (!noIncompleteNsImportDetection) { + for (const exportName of data.reexportNamespace) { + initStatements.push([exportName, null]); + } + } + } + initStatements.sort(([a], [b]) => { + if (a < b) return -1; + if (b < a) return 1; + return 0; + }); + const results = []; + if (noIncompleteNsImportDetection) { + for (const [, initStatement] of initStatements) { + results.push(initStatement); + } + } else { + const chunkSize = 100; + for (let i = 0; i < initStatements.length; i += chunkSize) { + let uninitializedExportNames = []; + for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) { + const [exportName, initStatement] = initStatements[i + j]; + if (initStatement !== null) { + if (uninitializedExportNames.length > 0) { + results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); + uninitializedExportNames = []; + } + results.push(initStatement); + } else { + uninitializedExportNames.push(exportName); + } + } + if (uninitializedExportNames.length > 0) { + results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); + } + } + } + return results; +} +const InitTemplate = { + computed: ({ + exports, + name, + value + }) => _core.template.expression.ast`${exports}["${name}"] = ${value}`, + default: ({ + exports, + name, + value + }) => _core.template.expression.ast`${exports}.${name} = ${value}`, + define: ({ + exports, + name, + value + }) => _core.template.expression.ast` + Object.defineProperty(${exports}, "${name}", { + enumerable: true, + value: void 0, + writable: true + })["${name}"] = ${value}` +}; +function buildInitStatement(metadata, exportNames, initExpr) { + const { + stringSpecifiers, + exportName: exports + } = metadata; + return _core.types.expressionStatement(exportNames.reduce((value, name) => { + const params = { + exports, + name, + value + }; + if (name === "__proto__") { + return InitTemplate.define(params); + } + if (stringSpecifiers.has(name)) { + return InitTemplate.computed(params); + } + return InitTemplate.default(params); + }, initExpr)); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js.map b/node_modules/@babel/helper-module-transforms/lib/index.js.map new file mode 100644 index 00000000..27978478 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_core","_helperModuleImports","_rewriteThis","_rewriteLiveReferences","_normalizeAndLoadMetadata","Lazy","_dynamicImport","_getModuleName","exports","getDynamicImportSource","rewriteModuleStatementsAndPrepareHeader","path","exportName","strict","allowTopLevelThis","strictMode","noInterop","importInterop","lazy","getWrapperPayload","toGetWrapperPayload","wrapReference","esNamespaceOnly","filename","constantReexports","arguments","loose","enumerableModuleMeta","noIncompleteNsImportDetection","validateImportInteropOption","assert","isModule","node","sourceType","meta","normalizeModuleAndLoadMetadata","initializeReexports","rewriteThis","rewriteLiveReferences","hasStrict","directives","some","directive","value","unshiftContainer","t","directiveLiteral","headers","hasExports","push","buildESModuleHeader","nameList","buildExportNameListDeclaration","exportNameListName","name","statement","buildExportInitializationStatements","ensureStatementsHoisted","statements","forEach","header","_blockHoist","wrapInterop","programPath","expr","type","callExpression","hub","addHelper","booleanLiteral","helper","Error","buildNamespaceInitStatements","metadata","sourceMetadata","_wrapReference","srcNamespaceId","identifier","localName","importsNamespace","template","NAME","SOURCE","cloneNode","srcNamespace","wrap","buildReexportsFromMeta","reexportNamespace","isIdentifier","EXPORTS","NAMESPACE","reexportAll","buildNamespaceReexport","loc","ReexportTemplate","constant","namespaceImport","ast","constantComputed","spec","_wrapReference2","namespace","stringSpecifiers","Array","from","reexports","importName","interop","has","memberExpression","stringLiteral","astNodes","VERIFY_NAME_LIST","EXPORTS_LIST","exportedVars","Object","create","data","local","values","names","hasReexport","source","keys","length","scope","generateUidIdentifier","default","variableDeclaration","variableDeclarator","valueToNode","initStatements","kind","buildInitStatement","reexportsStatements","i","sort","a","b","results","initStatement","chunkSize","uninitializedExportNames","j","buildUndefinedNode","InitTemplate","computed","expression","define","exportNames","initExpr","expressionStatement","reduce","params"],"sources":["../src/index.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport { template, types as t } from \"@babel/core\";\n\nimport { isModule } from \"@babel/helper-module-imports\";\n\nimport rewriteThis from \"./rewrite-this.ts\";\nimport rewriteLiveReferences from \"./rewrite-live-references.ts\";\nimport normalizeModuleAndLoadMetadata, {\n hasExports,\n isSideEffectImport,\n validateImportInteropOption,\n} from \"./normalize-and-load-metadata.ts\";\nimport type {\n ImportInterop,\n InteropType,\n ModuleMetadata,\n SourceModuleMetadata,\n} from \"./normalize-and-load-metadata.ts\";\nimport * as Lazy from \"./lazy-modules.ts\";\nimport type { NodePath } from \"@babel/core\";\n\nexport { buildDynamicImport } from \"./dynamic-import.ts\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource =\n // eslint-disable-next-line no-restricted-globals, import/extensions\n require(\"./dynamic-import\").getDynamicImportSource;\n}\n\nexport { default as getModuleName } from \"./get-module-name.ts\";\nexport type { PluginOptions } from \"./get-module-name.ts\";\n\nexport { hasExports, isSideEffectImport, isModule, rewriteThis };\n\nexport interface RewriteModuleStatementsAndPrepareHeaderOptions {\n exportName?: string;\n strict: boolean;\n allowTopLevelThis?: boolean;\n strictMode: boolean;\n loose?: boolean;\n importInterop?: ImportInterop;\n noInterop?: boolean;\n lazy?: Lazy.Lazy;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n wrapReference?: (ref: t.Expression, payload: unknown) => t.Expression | null;\n esNamespaceOnly?: boolean;\n filename: string | undefined;\n constantReexports?: boolean | void;\n enumerableModuleMeta?: boolean | void;\n noIncompleteNsImportDetection?: boolean | void;\n}\n\n/**\n * Perform all of the generic ES6 module rewriting needed to handle initial\n * module processing. This function will rewrite the majority of the given\n * program to reference the modules described by the returned metadata,\n * and returns a list of statements for use when initializing the module.\n */\nexport function rewriteModuleStatementsAndPrepareHeader(\n path: NodePath,\n {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n noInterop,\n importInterop = noInterop ? \"none\" : \"babel\",\n // TODO(Babel 8): After that `lazy` implementation is moved to the CJS\n // transform, remove this parameter.\n lazy,\n getWrapperPayload = Lazy.toGetWrapperPayload(lazy ?? false),\n wrapReference = Lazy.wrapReference,\n esNamespaceOnly,\n filename,\n\n constantReexports = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n enumerableModuleMeta = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n noIncompleteNsImportDetection,\n }: RewriteModuleStatementsAndPrepareHeaderOptions,\n) {\n validateImportInteropOption(importInterop);\n assert(isModule(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n\n const meta = normalizeModuleAndLoadMetadata(path, exportName, {\n importInterop,\n initializeReexports: constantReexports,\n getWrapperPayload,\n esNamespaceOnly,\n filename,\n });\n\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n\n rewriteLiveReferences(path, meta, wrapReference);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n if (!hasStrict) {\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n }\n\n const headers = [];\n if (hasExports(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, enumerableModuleMeta));\n }\n\n const nameList = buildExportNameListDeclaration(path, meta);\n\n if (nameList) {\n meta.exportNameListName = nameList.name;\n headers.push(nameList.statement);\n }\n\n // Create all of the statically known named exports.\n headers.push(\n ...buildExportInitializationStatements(\n path,\n meta,\n wrapReference,\n constantReexports,\n noIncompleteNsImportDetection,\n ),\n );\n\n return { meta, headers };\n}\n\n/**\n * Flag a set of statements as hoisted above all else so that module init\n * statements all run before user code.\n */\nexport function ensureStatementsHoisted(statements: t.Statement[]) {\n // Force all of the header fields to be at the top of the file.\n statements.forEach(header => {\n // @ts-expect-error Fixme: handle _blockHoist property\n header._blockHoist = 3;\n });\n}\n\n/**\n * Given an expression for a standard import object, like \"require('foo')\",\n * wrap it in a call to the interop helpers based on the type.\n */\nexport function wrapInterop(\n programPath: NodePath,\n expr: t.Expression,\n type: InteropType,\n): t.CallExpression {\n if (type === \"none\") {\n return null;\n }\n\n if (type === \"node-namespace\") {\n return t.callExpression(\n programPath.hub.addHelper(\"interopRequireWildcard\"),\n [expr, t.booleanLiteral(true)],\n );\n } else if (type === \"node-default\") {\n return null;\n }\n\n let helper;\n if (type === \"default\") {\n helper = \"interopRequireDefault\";\n } else if (type === \"namespace\") {\n helper = \"interopRequireWildcard\";\n } else {\n throw new Error(`Unknown interop: ${type}`);\n }\n\n return t.callExpression(programPath.hub.addHelper(helper), [expr]);\n}\n\n/**\n * Create the runtime initialization statements for a given requested source.\n * These will initialize all of the runtime import/export logic that\n * can't be handled statically by the statements created by\n * buildExportInitializationStatements().\n */\nexport function buildNamespaceInitStatements(\n metadata: ModuleMetadata,\n sourceMetadata: SourceModuleMetadata,\n constantReexports: boolean | void = false,\n wrapReference: (\n ref: t.Identifier,\n payload: unknown,\n ) => t.Expression | null = Lazy.wrapReference,\n) {\n const statements = [];\n\n const srcNamespaceId = t.identifier(sourceMetadata.name);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n\n // Create and assign binding to namespace object\n statements.push(\n template.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespaceId),\n }),\n );\n }\n\n const srcNamespace =\n wrapReference(srcNamespaceId, sourceMetadata.wrap) ?? srcNamespaceId;\n\n if (constantReexports) {\n statements.push(\n ...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference),\n );\n }\n for (const exportName of sourceMetadata.reexportNamespace) {\n // Assign export to namespace object.\n statements.push(\n (!t.isIdentifier(srcNamespace)\n ? template.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n `\n : template.statement`EXPORTS.NAME = NAMESPACE;`)({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n NAMESPACE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (sourceMetadata.reexportAll) {\n const statement = buildNamespaceReexport(\n metadata,\n t.cloneNode(srcNamespace),\n constantReexports,\n );\n statement.loc = sourceMetadata.reexportAll.loc;\n\n // Iterate props creating getter for each prop.\n statements.push(statement);\n }\n return statements;\n}\n\ninterface ReexportParts {\n exports: string;\n exportName: string;\n namespaceImport: t.Expression;\n}\n\nconst ReexportTemplate = {\n constant: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}.${exportName} = ${namespaceImport};\n `,\n constantComputed: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}[\"${exportName}\"] = ${namespaceImport};\n `,\n spec: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n Object.defineProperty(${exports}, \"${exportName}\", {\n enumerable: true,\n get: function() {\n return ${namespaceImport};\n },\n });\n `,\n};\n\nfunction buildReexportsFromMeta(\n meta: ModuleMetadata,\n metadata: SourceModuleMetadata,\n constantReexports: boolean,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n): t.Statement[] {\n let namespace: t.Expression = t.identifier(metadata.name);\n namespace = wrapReference(namespace, metadata.wrap) ?? namespace;\n\n const { stringSpecifiers } = meta;\n return Array.from(metadata.reexports, ([exportName, importName]) => {\n let namespaceImport: t.Expression = t.cloneNode(namespace);\n if (importName === \"default\" && metadata.interop === \"node-default\") {\n // Nothing, it's ok as-is\n } else if (stringSpecifiers.has(importName)) {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.stringLiteral(importName),\n true,\n );\n } else {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.identifier(importName),\n );\n }\n const astNodes: ReexportParts = {\n exports: meta.exportName,\n exportName,\n namespaceImport,\n };\n if (constantReexports || t.isIdentifier(namespaceImport)) {\n if (stringSpecifiers.has(exportName)) {\n return ReexportTemplate.constantComputed(astNodes);\n } else {\n return ReexportTemplate.constant(astNodes);\n }\n } else {\n return ReexportTemplate.spec(astNodes);\n }\n });\n}\n\n/**\n * Build an \"__esModule\" header statement setting the property on a given object.\n */\nfunction buildESModuleHeader(\n metadata: ModuleMetadata,\n enumerableModuleMeta: boolean | void = false,\n) {\n return (\n enumerableModuleMeta\n ? template.statement`\n EXPORTS.__esModule = true;\n `\n : template.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `\n )({ EXPORTS: metadata.exportName });\n}\n\n/**\n * Create a re-export initialization loop for a specific imported namespace.\n */\nfunction buildNamespaceReexport(\n metadata: ModuleMetadata,\n namespace: t.Expression,\n constantReexports: boolean | void,\n) {\n return (\n constantReexports\n ? template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n `\n : // Also skip already assigned bindings if they are strictly equal\n // to be somewhat more spec-compliant when a file has multiple\n // namespace re-exports that would cause a binding to be exported\n // multiple times. However, multiple bindings of the same name that\n // export the same primitive value are silently skipped\n // (the spec requires an \"ambiguous bindings\" early error here).\n template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n `\n )({\n NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName\n ? template`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({ EXPORTS_LIST: metadata.exportNameListName })\n : null,\n });\n}\n\n/**\n * Build a statement declaring a variable that contains all of the exported\n * variable names in an object so they can easily be referenced from an\n * export * from statement to check for conflicts.\n */\nfunction buildExportNameListDeclaration(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const exportedVars = Object.create(null);\n for (const data of metadata.local.values()) {\n for (const name of data.names) {\n exportedVars[name] = true;\n }\n }\n\n let hasReexport = false;\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\n for (const exportName of data.reexportNamespace) {\n exportedVars[exportName] = true;\n }\n\n hasReexport = hasReexport || !!data.reexportAll;\n }\n\n if (!hasReexport || Object.keys(exportedVars).length === 0) return null;\n\n const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n\n delete exportedVars.default;\n\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [\n t.variableDeclarator(name, t.valueToNode(exportedVars)),\n ]),\n };\n}\n\n/**\n * Create a set of statements that will initialize all of the statically-known\n * export names with their expected values.\n */\nfunction buildExportInitializationStatements(\n programPath: NodePath,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n constantReexports: boolean | void = false,\n noIncompleteNsImportDetection: boolean | void = false,\n) {\n const initStatements: Array<[string, t.Statement | null]> = [];\n\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {\n // No-open since these are explicitly set with the \"reexports\" block.\n } else if (data.kind === \"hoisted\") {\n initStatements.push([\n // data.names is always of length 1 because a hoisted export\n // name must be id of a function declaration\n data.names[0],\n buildInitStatement(metadata, data.names, t.identifier(localName)),\n ]);\n } else if (!noIncompleteNsImportDetection) {\n for (const exportName of data.names) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!constantReexports) {\n const reexportsStatements = buildReexportsFromMeta(\n metadata,\n data,\n false,\n wrapReference,\n );\n const reexports = [...data.reexports.keys()];\n for (let i = 0; i < reexportsStatements.length; i++) {\n initStatements.push([reexports[i], reexportsStatements[i]]);\n }\n }\n if (!noIncompleteNsImportDetection) {\n for (const exportName of data.reexportNamespace) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects\n // The [Exports] list is ordered as if an Array of those String values\n // had been sorted using %Array.prototype.sort% using undefined as comparefn\n initStatements.sort(([a], [b]) => {\n if (a < b) return -1;\n if (b < a) return 1;\n return 0;\n });\n\n const results = [];\n if (noIncompleteNsImportDetection) {\n for (const [, initStatement] of initStatements) {\n results.push(initStatement);\n }\n } else {\n // We generate init statements (`exports.a = exports.b = ... = void 0`)\n // for every 100 exported names to avoid deeply-nested AST structures.\n const chunkSize = 100;\n for (let i = 0; i < initStatements.length; i += chunkSize) {\n let uninitializedExportNames = [];\n for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {\n const [exportName, initStatement] = initStatements[i + j];\n if (initStatement !== null) {\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n // reset after uninitializedExportNames has been transformed\n // to init statements\n uninitializedExportNames = [];\n }\n results.push(initStatement);\n } else {\n uninitializedExportNames.push(exportName);\n }\n }\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n }\n }\n }\n\n return results;\n}\n\ninterface InitParts {\n exports: string;\n name: string;\n value: t.Expression;\n}\n\n/**\n * Given a set of export names, create a set of nested assignments to\n * initialize them all to a given expression.\n */\nconst InitTemplate = {\n computed: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}[\"${name}\"] = ${value}`,\n default: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}.${name} = ${value}`,\n define: ({ exports, name, value }: InitParts) =>\n template.expression.ast`\n Object.defineProperty(${exports}, \"${name}\", {\n enumerable: true,\n value: void 0,\n writable: true\n })[\"${name}\"] = ${value}`,\n};\n\nfunction buildInitStatement(\n metadata: ModuleMetadata,\n exportNames: string[],\n initExpr: t.Expression,\n) {\n const { stringSpecifiers, exportName: exports } = metadata;\n return t.expressionStatement(\n exportNames.reduce((value, name) => {\n const params = {\n exports,\n name,\n value,\n };\n\n if (name === \"__proto__\") {\n return InitTemplate.define(params);\n }\n\n if (stringSpecifiers.has(name)) {\n return InitTemplate.computed(params);\n }\n\n return InitTemplate.default(params);\n }, initExpr),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AAWA,IAAAM,IAAA,GAAAN,OAAA;AAGA,IAAAO,cAAA,GAAAP,OAAA;AASA,IAAAQ,cAAA,GAAAR,OAAA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O;MACP8C,IAAI;MACJX;IACF,CAAC;IAED,IAAIW,IAAI,KAAK,WAAW,EAAE;MACxB,OAAO2F,YAAY,CAACG,MAAM,CAACK,MAAM,CAAC;IACpC;IAEA,IAAInD,gBAAgB,CAACM,GAAG,CAACtD,IAAI,CAAC,EAAE;MAC9B,OAAO2F,YAAY,CAACC,QAAQ,CAACO,MAAM,CAAC;IACtC;IAEA,OAAOR,YAAY,CAAClB,OAAO,CAAC0B,MAAM,CAAC;EACrC,CAAC,EAAEH,QAAQ,CACb,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js new file mode 100644 index 00000000..acc89fff --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.toGetWrapperPayload = toGetWrapperPayload; +exports.wrapReference = wrapReference; +var _core = require("@babel/core"); +var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js"); +function toGetWrapperPayload(lazy) { + return (source, metadata) => { + if (lazy === false) return null; + if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null; + if (lazy === true) { + return source.includes(".") ? null : "lazy"; + } + if (Array.isArray(lazy)) { + return !lazy.includes(source) ? null : "lazy"; + } + if (typeof lazy === "function") { + return lazy(source) ? "lazy" : null; + } + throw new Error(`.lazy must be a boolean, string array, or function`); + }; +} +function wrapReference(ref, payload) { + if (payload === "lazy") return _core.types.callExpression(ref, []); + return null; +} + +//# sourceMappingURL=lazy-modules.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map new file mode 100644 index 00000000..890839bc --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","_normalizeAndLoadMetadata","toGetWrapperPayload","lazy","source","metadata","isSideEffectImport","reexportAll","includes","Array","isArray","Error","wrapReference","ref","payload","t","callExpression"],"sources":["../src/lazy-modules.ts"],"sourcesContent":["// TODO: Move `lazy` implementation logic into the CommonJS plugin, since other\n// modules systems do not support `lazy`.\n\nimport { types as t } from \"@babel/core\";\nimport {\n type SourceModuleMetadata,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata.ts\";\n\nexport type Lazy = boolean | string[] | ((source: string) => boolean);\n\nexport function toGetWrapperPayload(lazy: Lazy) {\n return (source: string, metadata: SourceModuleMetadata): null | \"lazy\" => {\n if (lazy === false) return null;\n if (isSideEffectImport(metadata) || metadata.reexportAll) return null;\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n return source.includes(\".\") ? null : \"lazy\";\n }\n if (Array.isArray(lazy)) {\n return !lazy.includes(source) ? null : \"lazy\";\n }\n if (typeof lazy === \"function\") {\n return lazy(source) ? \"lazy\" : null;\n }\n throw new Error(`.lazy must be a boolean, string array, or function`);\n };\n}\n\nexport function wrapReference(\n ref: t.Identifier,\n payload: unknown,\n): t.Expression | null {\n if (payload === \"lazy\") return t.callExpression(ref, []);\n return null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAOO,SAASE,mBAAmBA,CAACC,IAAU,EAAE;EAC9C,OAAO,CAACC,MAAc,EAAEC,QAA8B,KAAoB;IACxE,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;IAC/B,IAAI,IAAAG,4CAAkB,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,WAAW,EAAE,OAAO,IAAI;IACrE,IAAIJ,IAAI,KAAK,IAAI,EAAE;MAGjB,OAAOC,MAAM,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IAC7C;IACA,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,EAAE;MACvB,OAAO,CAACA,IAAI,CAACK,QAAQ,CAACJ,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM;IAC/C;IACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;MAC9B,OAAOA,IAAI,CAACC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IACrC;IACA,MAAM,IAAIO,KAAK,CAAC,oDAAoD,CAAC;EACvE,CAAC;AACH;AAEO,SAASC,aAAaA,CAC3BC,GAAiB,EACjBC,OAAgB,EACK;EACrB,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAOC,WAAC,CAACC,cAAc,CAACH,GAAG,EAAE,EAAE,CAAC;EACxD,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js new file mode 100644 index 00000000..00b0a531 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js @@ -0,0 +1,361 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeModuleAndLoadMetadata; +exports.hasExports = hasExports; +exports.isSideEffectImport = isSideEffectImport; +exports.validateImportInteropOption = validateImportInteropOption; +var _path = require("path"); +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); +function hasExports(metadata) { + return metadata.hasExports; +} +function isSideEffectImport(source) { + return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll; +} +function validateImportInteropOption(importInterop) { + if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") { + throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`); + } + return importInterop; +} +function resolveImportInterop(importInterop, source, filename) { + if (typeof importInterop === "function") { + return validateImportInteropOption(importInterop(source, filename)); + } + return importInterop; +} +function normalizeModuleAndLoadMetadata(programPath, exportName, { + importInterop, + initializeReexports = false, + getWrapperPayload, + esNamespaceOnly = false, + filename +}) { + if (!exportName) { + exportName = programPath.scope.generateUidIdentifier("exports").name; + } + const stringSpecifiers = new Set(); + nameAnonymousExports(programPath); + const { + local, + sources, + hasExports + } = getModuleMetadata(programPath, { + initializeReexports, + getWrapperPayload + }, stringSpecifiers); + removeImportExportDeclarations(programPath); + for (const [source, metadata] of sources) { + const { + importsNamespace, + imports + } = metadata; + if (importsNamespace.size > 0 && imports.size === 0) { + const [nameOfnamespace] = importsNamespace; + metadata.name = nameOfnamespace; + } + const resolvedInterop = resolveImportInterop(importInterop, source, filename); + if (resolvedInterop === "none") { + metadata.interop = "none"; + } else if (resolvedInterop === "node" && metadata.interop === "namespace") { + metadata.interop = "node-namespace"; + } else if (resolvedInterop === "node" && metadata.interop === "default") { + metadata.interop = "node-default"; + } else if (esNamespaceOnly && metadata.interop === "namespace") { + metadata.interop = "default"; + } + } + return { + exportName, + exportNameListName: null, + hasExports, + local, + source: sources, + stringSpecifiers + }; +} +function getExportSpecifierName(path, stringSpecifiers) { + if (path.isIdentifier()) { + return path.node.name; + } else if (path.isStringLiteral()) { + const stringValue = path.node.value; + if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) { + stringSpecifiers.add(stringValue); + } + return stringValue; + } else { + throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`); + } +} +function assertExportSpecifier(path) { + if (path.isExportSpecifier()) { + return; + } else if (path.isExportNamespaceSpecifier()) { + throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`."); + } else { + throw path.buildCodeFrameError("Unexpected export specifier type"); + } +} +function getModuleMetadata(programPath, { + getWrapperPayload, + initializeReexports +}, stringSpecifiers) { + const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers); + const importNodes = new Map(); + const sourceData = new Map(); + const getData = (sourceNode, node) => { + const source = sourceNode.value; + let data = sourceData.get(source); + if (!data) { + data = { + name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name, + interop: "none", + loc: null, + imports: new Map(), + importsNamespace: new Set(), + reexports: new Map(), + reexportNamespace: new Set(), + reexportAll: null, + wrap: null, + get lazy() { + return this.wrap === "lazy"; + }, + referenced: false + }; + sourceData.set(source, data); + importNodes.set(source, [node]); + } else { + importNodes.get(source).push(node); + } + return data; + }; + let hasExports = false; + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + if (spec.isImportDefaultSpecifier()) { + const localName = spec.get("local").node.name; + data.imports.set(localName, "default"); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, "default"); + }); + data.referenced = true; + } + } else if (spec.isImportNamespaceSpecifier()) { + const localName = spec.get("local").node.name; + data.importsNamespace.add(localName); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexportNamespace.add(name); + }); + data.referenced = true; + } + } else if (spec.isImportSpecifier()) { + const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers); + const localName = spec.get("local").node.name; + data.imports.set(localName, importName); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, importName); + }); + data.referenced = true; + } + } + }); + } else if (child.isExportAllDeclaration()) { + hasExports = true; + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + data.reexportAll = { + loc: child.node.loc + }; + data.referenced = true; + } else if (child.isExportNamedDeclaration() && child.node.source) { + hasExports = true; + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + assertExportSpecifier(spec); + const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers); + const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers); + data.reexports.set(exportName, importName); + data.referenced = true; + if (exportName === "__esModule") { + throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".'); + } + }); + } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) { + hasExports = true; + } + }); + for (const metadata of sourceData.values()) { + let needsDefault = false; + let needsNamed = false; + if (metadata.importsNamespace.size > 0) { + needsDefault = true; + needsNamed = true; + } + if (metadata.reexportAll) { + needsNamed = true; + } + for (const importName of metadata.imports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + for (const importName of metadata.reexports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + if (needsDefault && needsNamed) { + metadata.interop = "namespace"; + } else if (needsDefault) { + metadata.interop = "default"; + } + } + if (getWrapperPayload) { + for (const [source, metadata] of sourceData) { + metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source)); + } + } + return { + hasExports, + local: localData, + sources: sourceData + }; +} +function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) { + const bindingKindLookup = new Map(); + programPath.get("body").forEach(child => { + let kind; + if (child.isImportDeclaration()) { + kind = "import"; + } else { + if (child.isExportDefaultDeclaration()) { + child = child.get("declaration"); + } + if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child = child.get("declaration"); + } else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) { + child.get("specifiers").forEach(spec => { + assertExportSpecifier(spec); + bindingKindLookup.set(spec.get("local").node.name, "block"); + }); + return; + } + } + if (child.isFunctionDeclaration()) { + kind = "hoisted"; + } else if (child.isClassDeclaration()) { + kind = "block"; + } else if (child.isVariableDeclaration({ + kind: "var" + })) { + kind = "var"; + } else if (child.isVariableDeclaration()) { + kind = "block"; + } else { + return; + } + } + Object.keys(child.getOuterBindingIdentifiers()).forEach(name => { + bindingKindLookup.set(name, kind); + }); + }); + const localMetadata = new Map(); + const getLocalMetadata = idPath => { + const localName = idPath.node.name; + let metadata = localMetadata.get(localName); + if (!metadata) { + const kind = bindingKindLookup.get(localName); + if (kind === undefined) { + throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`); + } + metadata = { + names: [], + kind + }; + localMetadata.set(localName, metadata); + } + return metadata; + }; + programPath.get("body").forEach(child => { + if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) { + if (child.node.declaration) { + const declaration = child.get("declaration"); + const ids = declaration.getOuterBindingIdentifierPaths(); + Object.keys(ids).forEach(name => { + if (name === "__esModule") { + throw declaration.buildCodeFrameError('Illegal export "__esModule".'); + } + getLocalMetadata(ids[name]).names.push(name); + }); + } else { + child.get("specifiers").forEach(spec => { + const local = spec.get("local"); + const exported = spec.get("exported"); + const localMetadata = getLocalMetadata(local); + const exportName = getExportSpecifierName(exported, stringSpecifiers); + if (exportName === "__esModule") { + throw exported.buildCodeFrameError('Illegal export "__esModule".'); + } + localMetadata.names.push(exportName); + }); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + getLocalMetadata(declaration.get("id")).names.push("default"); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } + }); + return localMetadata; +} +function nameAnonymousExports(programPath) { + programPath.get("body").forEach(child => { + if (!child.isExportDefaultDeclaration()) return; + { + var _child$splitExportDec; + (_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration; + } + child.splitExportDeclaration(); + }); +} +function removeImportExportDeclarations(programPath) { + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + child.remove(); + } else if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child.node.declaration._blockHoist = child.node._blockHoist; + child.replaceWith(child.node.declaration); + } else { + child.remove(); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + declaration._blockHoist = child.node._blockHoist; + child.replaceWith(declaration); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } else if (child.isExportAllDeclaration()) { + child.remove(); + } + }); +} + +//# sourceMappingURL=normalize-and-load-metadata.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map new file mode 100644 index 00000000..944c0902 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","require","_helperValidatorIdentifier","hasExports","metadata","isSideEffectImport","source","imports","size","importsNamespace","reexports","reexportNamespace","reexportAll","validateImportInteropOption","importInterop","Error","resolveImportInterop","filename","normalizeModuleAndLoadMetadata","programPath","exportName","initializeReexports","getWrapperPayload","esNamespaceOnly","scope","generateUidIdentifier","name","stringSpecifiers","Set","nameAnonymousExports","local","sources","getModuleMetadata","removeImportExportDeclarations","nameOfnamespace","resolvedInterop","interop","exportNameListName","getExportSpecifierName","path","isIdentifier","node","isStringLiteral","stringValue","value","isIdentifierName","add","type","assertExportSpecifier","isExportSpecifier","isExportNamespaceSpecifier","buildCodeFrameError","localData","getLocalExportMetadata","importNodes","Map","sourceData","getData","sourceNode","data","get","basename","extname","loc","wrap","lazy","referenced","set","push","forEach","child","isImportDeclaration","spec","isImportDefaultSpecifier","localName","reexport","delete","names","isImportNamespaceSpecifier","isImportSpecifier","importName","isExportAllDeclaration","isExportNamedDeclaration","isExportDefaultDeclaration","values","needsDefault","needsNamed","bindingKindLookup","kind","declaration","isFunctionDeclaration","isClassDeclaration","isVariableDeclaration","Object","keys","getOuterBindingIdentifiers","localMetadata","getLocalMetadata","idPath","undefined","ids","getOuterBindingIdentifierPaths","exported","_child$splitExportDec","splitExportDeclaration","NodePath","prototype","remove","_blockHoist","replaceWith"],"sources":["../src/normalize-and-load-metadata.ts"],"sourcesContent":["import { basename, extname } from \"node:path\";\nimport type { types as t, NodePath } from \"@babel/core\";\n\nimport { isIdentifierName } from \"@babel/helper-validator-identifier\";\n\nexport interface ModuleMetadata {\n exportName: string;\n // The name of the variable that will reference an object containing export names.\n exportNameListName: null | string;\n hasExports: boolean;\n // Lookup from local binding to export information.\n local: Map;\n // Lookup of source file to source file metadata.\n source: Map;\n // List of names that should only be printed as string literals.\n // i.e. `import { \"any unicode\" as foo } from \"some-module\"`\n // `stringSpecifiers` is Set(1) [\"any unicode\"]\n // In most cases `stringSpecifiers` is an empty Set\n stringSpecifiers: Set;\n}\n\nexport type InteropType =\n | \"default\" // Babel interop for default-only imports\n | \"namespace\" // Babel interop for namespace or default+named imports\n | \"node-default\" // Node.js interop for default-only imports\n | \"node-namespace\" // Node.js interop for namespace or default+named imports\n | \"none\"; // No interop, or named-only imports\n\nexport type ImportInterop =\n | \"none\"\n | \"babel\"\n | \"node\"\n | ((source: string, filename?: string) => \"none\" | \"babel\" | \"node\");\n\nexport interface SourceModuleMetadata {\n // A unique variable name to use for this namespace object. Centralized for simplicity.\n name: string;\n loc: t.SourceLocation | undefined | null;\n interop: InteropType;\n // Local binding to reference from this source namespace. Key: Local name, value: Import name\n imports: Map;\n // Local names that reference namespace object.\n importsNamespace: Set;\n // Reexports to create for namespace. Key: Export name, value: Import name\n reexports: Map;\n // List of names to re-export namespace as.\n reexportNamespace: Set;\n // Tracks if the source should be re-exported.\n reexportAll: null | {\n loc: t.SourceLocation | undefined | null;\n };\n wrap?: unknown;\n referenced: boolean;\n}\n\nexport interface LocalExportMetadata {\n names: Array; // names of exports,\n kind: \"import\" | \"hoisted\" | \"block\" | \"var\";\n}\n\n/**\n * Check if the module has any exports that need handling.\n */\nexport function hasExports(metadata: ModuleMetadata) {\n return metadata.hasExports;\n}\n\n/**\n * Check if a given source is an anonymous import, e.g. \"import 'foo';\"\n */\nexport function isSideEffectImport(source: SourceModuleMetadata) {\n return (\n source.imports.size === 0 &&\n source.importsNamespace.size === 0 &&\n source.reexports.size === 0 &&\n source.reexportNamespace.size === 0 &&\n !source.reexportAll\n );\n}\n\nexport function validateImportInteropOption(\n importInterop: any,\n): importInterop is ImportInterop {\n if (\n typeof importInterop !== \"function\" &&\n importInterop !== \"none\" &&\n importInterop !== \"babel\" &&\n importInterop !== \"node\"\n ) {\n throw new Error(\n `.importInterop must be one of \"none\", \"babel\", \"node\", or a function returning one of those values (received ${importInterop}).`,\n );\n }\n return importInterop;\n}\n\nfunction resolveImportInterop(\n importInterop: ImportInterop,\n source: string,\n filename: string | undefined,\n) {\n if (typeof importInterop === \"function\") {\n return validateImportInteropOption(importInterop(source, filename));\n }\n return importInterop;\n}\n\n/**\n * Remove all imports and exports from the file, and return all metadata\n * needed to reconstruct the module's behavior.\n */\nexport default function normalizeModuleAndLoadMetadata(\n programPath: NodePath,\n exportName: string,\n {\n importInterop,\n initializeReexports = false,\n getWrapperPayload,\n esNamespaceOnly = false,\n filename,\n }: {\n importInterop: ImportInterop;\n initializeReexports: boolean | void;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n esNamespaceOnly: boolean;\n filename: string;\n },\n): ModuleMetadata {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n const stringSpecifiers = new Set();\n\n nameAnonymousExports(programPath);\n\n const { local, sources, hasExports } = getModuleMetadata(\n programPath,\n { initializeReexports, getWrapperPayload },\n stringSpecifiers,\n );\n\n removeImportExportDeclarations(programPath);\n\n // Reuse the imported namespace name if there is one.\n for (const [source, metadata] of sources) {\n const { importsNamespace, imports } = metadata;\n // If there is at least one namespace import and other imports, it may collipse with local ident, can be seen in issue 15879.\n if (importsNamespace.size > 0 && imports.size === 0) {\n const [nameOfnamespace] = importsNamespace;\n metadata.name = nameOfnamespace;\n }\n\n const resolvedInterop = resolveImportInterop(\n importInterop,\n source,\n filename,\n );\n\n if (resolvedInterop === \"none\") {\n metadata.interop = \"none\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"namespace\") {\n metadata.interop = \"node-namespace\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"default\") {\n metadata.interop = \"node-default\";\n } else if (esNamespaceOnly && metadata.interop === \"namespace\") {\n // Both the default and namespace interops pass through __esModule\n // objects, but the namespace interop is used to enable Babel's\n // destructuring-like interop behavior for normal CommonJS.\n // Since some tooling has started to remove that behavior, we expose\n // it as the `esNamespace` option.\n metadata.interop = \"default\";\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source: sources,\n stringSpecifiers,\n };\n}\n\nfunction getExportSpecifierName(\n path: NodePath,\n stringSpecifiers: Set,\n): string {\n if (path.isIdentifier()) {\n return path.node.name;\n } else if (path.isStringLiteral()) {\n const stringValue = path.node.value;\n // add specifier value to `stringSpecifiers` only when it can not be converted to an identifier name\n // i.e In `import { \"foo\" as bar }`\n // we do not consider `\"foo\"` to be a `stringSpecifier` because we can treat it as\n // `import { foo as bar }`\n // This helps minimize the size of `stringSpecifiers` and reduce overhead of checking valid identifier names\n // when building transpiled code from metadata\n if (!isIdentifierName(stringValue)) {\n stringSpecifiers.add(stringValue);\n }\n return stringValue;\n } else {\n throw new Error(\n `Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`,\n );\n }\n}\n\nfunction assertExportSpecifier(\n path: NodePath,\n): asserts path is NodePath {\n if (path.isExportSpecifier()) {\n return;\n } else if (path.isExportNamespaceSpecifier()) {\n throw path.buildCodeFrameError(\n \"Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.\",\n );\n } else {\n throw path.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n}\n\n/**\n * Get metadata about the imports and exports present in this module.\n */\nfunction getModuleMetadata(\n programPath: NodePath,\n {\n getWrapperPayload,\n initializeReexports,\n }: {\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n initializeReexports: boolean | void;\n },\n stringSpecifiers: Set,\n) {\n const localData = getLocalExportMetadata(\n programPath,\n initializeReexports,\n stringSpecifiers,\n );\n\n const importNodes = new Map();\n const sourceData = new Map();\n const getData = (sourceNode: t.StringLiteral, node: t.Node) => {\n const source = sourceNode.value;\n\n let data = sourceData.get(source);\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier(\n basename(source, extname(source)),\n ).name,\n\n interop: \"none\",\n\n loc: null,\n\n // Data about the requested sources and names.\n imports: new Map(),\n importsNamespace: new Set(),\n\n // Metadata about data that is passed directly from source to export.\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n\n wrap: null,\n\n // @ts-expect-error lazy is not listed in the type.\n // This is needed for compatibility with older version of the commonjs\n // plusing.\n // TODO(Babel 8): Remove this\n get lazy() {\n return this.wrap === \"lazy\";\n },\n\n referenced: false,\n };\n sourceData.set(source, data);\n importNodes.set(source, [node]);\n } else {\n importNodes.get(source).push(node);\n }\n return data;\n };\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, \"default\");\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n data.referenced = true;\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n data.referenced = true;\n }\n } else if (spec.isImportSpecifier()) {\n const importName = getExportSpecifierName(\n spec.get(\"imported\"),\n stringSpecifiers,\n );\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, importName);\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n data.referenced = true;\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n data.reexportAll = {\n loc: child.node.loc,\n };\n data.referenced = true;\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n const importName = getExportSpecifierName(\n spec.get(\"local\"),\n stringSpecifiers,\n );\n const exportName = getExportSpecifierName(\n spec.get(\"exported\"),\n stringSpecifiers,\n );\n\n data.reexports.set(exportName, importName);\n data.referenced = true;\n\n if (exportName === \"__esModule\") {\n throw spec\n .get(\"exported\")\n .buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (\n child.isExportNamedDeclaration() ||\n child.isExportDefaultDeclaration()\n ) {\n hasExports = true;\n }\n });\n\n for (const metadata of sourceData.values()) {\n let needsDefault = false;\n let needsNamed = false;\n\n if (metadata.importsNamespace.size > 0) {\n needsDefault = true;\n needsNamed = true;\n }\n\n if (metadata.reexportAll) {\n needsNamed = true;\n }\n\n for (const importName of metadata.imports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n // TODO(logan): Using the namespace interop here is unfortunate. Revisit.\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n if (getWrapperPayload) {\n for (const [source, metadata] of sourceData) {\n metadata.wrap = getWrapperPayload(\n source,\n metadata,\n importNodes.get(source),\n );\n }\n }\n\n return {\n hasExports,\n local: localData,\n sources: sourceData,\n };\n}\n\ntype ModuleBindingKind = \"import\" | \"hoisted\" | \"block\" | \"var\";\n/**\n * Get metadata about local variables that are exported.\n */\nfunction getLocalExportMetadata(\n programPath: NodePath,\n initializeReexports: boolean | void,\n stringSpecifiers: Set,\n): Map {\n const bindingKindLookup = new Map();\n\n programPath.get(\"body\").forEach((child: NodePath) => {\n let kind: ModuleBindingKind;\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) {\n child = child.get(\"declaration\");\n }\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (\n initializeReexports &&\n child.node.source &&\n child.get(\"source\").isStringLiteral()\n ) {\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n bindingKindLookup.set(spec.get(\"local\").node.name, \"block\");\n });\n return;\n }\n }\n\n if (child.isFunctionDeclaration()) {\n kind = \"hoisted\";\n } else if (child.isClassDeclaration()) {\n kind = \"block\";\n } else if (child.isVariableDeclaration({ kind: \"var\" })) {\n kind = \"var\";\n } else if (child.isVariableDeclaration()) {\n kind = \"block\";\n } else {\n return;\n }\n }\n\n Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {\n bindingKindLookup.set(name, kind);\n });\n });\n\n const localMetadata = new Map();\n const getLocalMetadata = (idPath: NodePath) => {\n const localName = idPath.node.name;\n let metadata = localMetadata.get(localName);\n\n if (!metadata) {\n const kind = bindingKindLookup.get(localName);\n\n if (kind === undefined) {\n throw idPath.buildCodeFrameError(\n `Exporting local \"${localName}\", which is not declared.`,\n );\n }\n\n metadata = {\n names: [],\n kind,\n };\n localMetadata.set(localName, metadata);\n }\n return metadata;\n };\n\n programPath.get(\"body\").forEach(child => {\n if (\n child.isExportNamedDeclaration() &&\n (initializeReexports || !child.node.source)\n ) {\n if (child.node.declaration) {\n const declaration = child.get(\"declaration\");\n const ids = declaration.getOuterBindingIdentifierPaths();\n Object.keys(ids).forEach(name => {\n if (name === \"__esModule\") {\n throw declaration.buildCodeFrameError(\n 'Illegal export \"__esModule\".',\n );\n }\n getLocalMetadata(ids[name]).names.push(name);\n });\n } else {\n child.get(\"specifiers\").forEach(spec => {\n const local = spec.get(\"local\");\n const exported = spec.get(\"exported\");\n const localMetadata = getLocalMetadata(local);\n const exportName = getExportSpecifierName(exported, stringSpecifiers);\n\n if (exportName === \"__esModule\") {\n throw exported.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n localMetadata.names.push(exportName);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n }\n });\n return localMetadata;\n}\n\n/**\n * Ensure that all exported values have local binding names.\n */\nfunction nameAnonymousExports(programPath: NodePath) {\n // Name anonymous exported locals.\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n child.splitExportDeclaration ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.splitExportDeclaration;\n }\n child.splitExportDeclaration();\n });\n}\n\nfunction removeImportExportDeclarations(programPath: NodePath) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n child.node.declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(child.node.declaration);\n } else {\n child.remove();\n }\n } else if (child.isExportDefaultDeclaration()) {\n // export default foo;\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\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AAW;QAChDtC,KAAK,CAACuC,WAAW,CAACpB,WAAW,CAAC;MAChC,CAAC,MAAM;QAEL,MAAMA,WAAW,CAACtC,mBAAmB,CACnC,uCACF,CAAC;MACH;IACF,CAAC,MAAM,IAAImB,KAAK,CAACW,sBAAsB,CAAC,CAAC,EAAE;MACzCX,KAAK,CAACqC,MAAM,CAAC,CAAC;IAChB;EACF,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js new file mode 100644 index 00000000..f19f0f08 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js @@ -0,0 +1,360 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteLiveReferences; +var _core = require("@babel/core"); +function isInType(path) { + do { + switch (path.parent.type) { + case "TSTypeAnnotation": + case "TSTypeAliasDeclaration": + case "TSTypeReference": + case "TypeAnnotation": + case "TypeAlias": + return true; + case "ExportSpecifier": + return path.parentPath.parent.exportKind === "type"; + default: + if (path.parentPath.isStatement() || path.parentPath.isExpression()) { + return false; + } + } + } while (path = path.parentPath); +} +function rewriteLiveReferences(programPath, metadata, wrapReference) { + const imported = new Map(); + const exported = new Map(); + const requeueInParent = path => { + programPath.requeue(path); + }; + for (const [source, data] of metadata.source) { + for (const [localName, importName] of data.imports) { + imported.set(localName, [source, importName, null]); + } + for (const localName of data.importsNamespace) { + imported.set(localName, [source, null, localName]); + } + } + for (const [local, data] of metadata.local) { + let exportMeta = exported.get(local); + if (!exportMeta) { + exportMeta = []; + exported.set(local, exportMeta); + } + exportMeta.push(...data.names); + } + const rewriteBindingInitVisitorState = { + metadata, + requeueInParent, + scope: programPath.scope, + exported + }; + programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState); + const rewriteReferencesVisitorState = { + seen: new WeakSet(), + metadata, + requeueInParent, + scope: programPath.scope, + imported, + exported, + buildImportReference([source, importName, localName], identNode) { + const meta = metadata.source.get(source); + meta.referenced = true; + if (localName) { + if (meta.wrap) { + var _wrapReference; + identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode; + } + return identNode; + } + let namespace = _core.types.identifier(meta.name); + if (meta.wrap) { + var _wrapReference2; + namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace; + } + if (importName === "default" && meta.interop === "node-default") { + return namespace; + } + const computed = metadata.stringSpecifiers.has(importName); + return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed); + } + }; + programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState); +} +const rewriteBindingInitVisitor = { + Scope(path) { + path.skip(); + }, + ClassDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + const { + id + } = path.node; + if (!id) throw new Error("Expected class to have a name"); + const localName = id.name; + const exportNames = exported.get(localName) || []; + if (exportNames.length > 0) { + const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope)); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + }, + VariableDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + const isVar = path.node.kind === "var"; + for (const decl of path.get("declarations")) { + const { + id + } = decl.node; + let { + init + } = decl.node; + if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) { + if (!init) { + if (isVar) { + continue; + } else { + init = path.scope.buildUndefinedNode(); + } + } + decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope); + requeueInParent(decl.get("init")); + } else { + for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) { + if (exported.has(localName)) { + const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope)); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + } + } + } + } +}; +const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => { + const exportsObjectName = metadata.exportName; + for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) { + if (currentScope.hasOwnBinding(exportsObjectName)) { + currentScope.rename(exportsObjectName); + } + } + return (exportNames || []).reduce((expr, exportName) => { + const { + stringSpecifiers + } = metadata; + const computed = stringSpecifiers.has(exportName); + return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr); + }, localExpr); +}; +const buildImportThrow = localName => { + return _core.template.expression.ast` + (function() { + throw new Error('"' + '${localName}' + '" is read-only.'); + })() + `; +}; +const rewriteReferencesVisitor = { + ReferencedIdentifier(path) { + const { + seen, + buildImportReference, + scope, + imported, + requeueInParent + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const localName = path.node.name; + const importData = imported.get(localName); + if (importData) { + if (isInType(path)) { + throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`); + } + const localBinding = path.scope.getBinding(localName); + const rootBinding = scope.getBinding(localName); + if (rootBinding !== localBinding) return; + const ref = buildImportReference(importData, path.node); + ref.loc = path.node.loc; + if ((path.parentPath.isCallExpression({ + callee: path.node + }) || path.parentPath.isOptionalCallExpression({ + callee: path.node + }) || path.parentPath.isTaggedTemplateExpression({ + tag: path.node + })) && _core.types.isMemberExpression(ref)) { + path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref])); + } else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) { + const { + object, + property + } = ref; + path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name))); + } else { + path.replaceWith(ref); + } + requeueInParent(path); + path.skip(); + } + }, + UpdateExpression(path) { + const { + scope, + seen, + imported, + exported, + requeueInParent, + buildImportReference + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const arg = path.get("argument"); + if (arg.isMemberExpression()) return; + const update = path.node; + if (arg.isIdentifier()) { + const localName = arg.node.name; + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + const exportedNames = exported.get(localName); + const importData = imported.get(localName); + if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { + if (importData) { + path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName))); + } else if (update.prefix) { + path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope)); + } else { + const ref = scope.generateDeclaredUidIdentifier(localName); + path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)])); + } + } + } + requeueInParent(path); + path.skip(); + }, + AssignmentExpression: { + exit(path) { + const { + scope, + seen, + imported, + exported, + requeueInParent, + buildImportReference + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const left = path.get("left"); + if (left.isMemberExpression()) return; + if (left.isIdentifier()) { + const localName = left.node.name; + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + const exportedNames = exported.get(localName); + const importData = imported.get(localName); + if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { + const assignment = path.node; + if (importData) { + assignment.left = buildImportReference(importData, left.node); + assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]); + } + const { + operator + } = assignment; + let newExpr; + if (operator === "=") { + newExpr = assignment; + } else if (operator === "&&=" || operator === "||=" || operator === "??=") { + newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); + } else { + newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); + } + path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope)); + requeueInParent(path); + path.skip(); + } + } else { + const ids = left.getOuterBindingIdentifiers(); + const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName)); + const id = programScopeIds.find(localName => imported.has(localName)); + if (id) { + path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]); + } + const items = []; + programScopeIds.forEach(localName => { + const exportedNames = exported.get(localName) || []; + if (exportedNames.length > 0) { + items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope)); + } + }); + if (items.length > 0) { + let node = _core.types.sequenceExpression(items); + if (path.parentPath.isExpressionStatement()) { + node = _core.types.expressionStatement(node); + node._blockHoist = path.parentPath.node._blockHoist; + } + const statement = path.insertAfter(node)[0]; + requeueInParent(statement); + } + } + } + }, + ForXStatement(path) { + const { + scope, + node + } = path; + const { + left + } = node; + const { + exported, + imported, + scope: programScope + } = this; + if (!_core.types.isVariableDeclaration(left)) { + let didTransformExport = false, + importConstViolationName; + const loopBodyScope = path.get("body").scope; + for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) { + if (programScope.getBinding(name) === scope.getBinding(name)) { + if (exported.has(name)) { + didTransformExport = true; + if (loopBodyScope.hasOwnBinding(name)) { + loopBodyScope.rename(name); + } + } + if (imported.has(name) && !importConstViolationName) { + importConstViolationName = name; + } + } + } + if (!didTransformExport && !importConstViolationName) { + return; + } + path.ensureBlock(); + const bodyPath = path.get("body"); + const newLoopId = scope.generateUidIdentifierBasedOnNode(left); + path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))])); + scope.registerDeclaration(path.get("left")); + if (didTransformExport) { + bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId))); + } + if (importConstViolationName) { + bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName))); + } + } + } +}; + +//# sourceMappingURL=rewrite-live-references.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map new file mode 100644 index 00000000..f24c2cd4 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","isInType","path","parent","type","parentPath","exportKind","isStatement","isExpression","rewriteLiveReferences","programPath","metadata","wrapReference","imported","Map","exported","requeueInParent","requeue","source","data","localName","importName","imports","set","importsNamespace","local","exportMeta","get","push","names","rewriteBindingInitVisitorState","scope","traverse","rewriteBindingInitVisitor","rewriteReferencesVisitorState","seen","WeakSet","buildImportReference","identNode","meta","referenced","wrap","_wrapReference","namespace","t","identifier","name","_wrapReference2","interop","computed","stringSpecifiers","has","memberExpression","stringLiteral","rewriteReferencesVisitor","Scope","skip","ClassDeclaration","id","node","Error","exportNames","length","statement","expressionStatement","buildBindingExportAssignmentExpression","_blockHoist","insertAfter","VariableDeclaration","isVar","kind","decl","init","isIdentifier","isArrowFunctionExpression","isFunctionExpression","isClassExpression","buildUndefinedNode","Object","keys","getOuterBindingIdentifiers","localExpr","exportsObjectName","exportName","currentScope","hasOwnBinding","rename","reduce","expr","assignmentExpression","buildImportThrow","template","expression","ast","ReferencedIdentifier","add","importData","buildCodeFrameError","localBinding","getBinding","rootBinding","ref","loc","isCallExpression","callee","isOptionalCallExpression","isTaggedTemplateExpression","tag","isMemberExpression","replaceWith","sequenceExpression","numericLiteral","isJSXIdentifier","object","property","jsxMemberExpression","jsxIdentifier","UpdateExpression","arg","update","exportedNames","operator","prefix","cloneNode","generateDeclaredUidIdentifier","AssignmentExpression","exit","left","assignment","right","newExpr","logicalExpression","slice","binaryExpression","ids","programScopeIds","filter","find","items","forEach","isExpressionStatement","ForXStatement","programScope","isVariableDeclaration","didTransformExport","importConstViolationName","loopBodyScope","ensureBlock","bodyPath","newLoopId","generateUidIdentifierBasedOnNode","variableDeclaration","variableDeclarator","registerDeclaration","unshiftContainer"],"sources":["../src/rewrite-live-references.ts"],"sourcesContent":["import { template, types as t } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/core\";\n\nimport type { ModuleMetadata } from \"./normalize-and-load-metadata.ts\";\n\ninterface RewriteReferencesVisitorState {\n exported: Map;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n imported: Map;\n buildImportReference: (\n [source, importName, localName]: readonly [string, string, string],\n identNode: t.Identifier | t.CallExpression | t.JSXIdentifier,\n ) => any;\n seen: WeakSet;\n}\n\ninterface RewriteBindingInitVisitorState {\n exported: Map;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n}\n\nfunction isInType(path: NodePath) {\n do {\n switch (path.parent.type) {\n case \"TSTypeAnnotation\":\n case \"TSTypeAliasDeclaration\":\n case \"TSTypeReference\":\n case \"TypeAnnotation\":\n case \"TypeAlias\":\n return true;\n case \"ExportSpecifier\":\n return (\n (\n path.parentPath.parent as\n | t.ExportDefaultDeclaration\n | t.ExportNamedDeclaration\n ).exportKind === \"type\"\n );\n default:\n if (path.parentPath.isStatement() || path.parentPath.isExpression()) {\n return false;\n }\n }\n } while ((path = path.parentPath));\n}\n\nexport default function rewriteLiveReferences(\n programPath: NodePath,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => null | t.Expression,\n) {\n const imported = new Map();\n const exported = new Map();\n const requeueInParent = (path: NodePath) => {\n // Manually re-queue `exports.default =` expressions so that the ES3\n // transform has an opportunity to convert them. Ideally this would\n // happen automatically from the replaceWith above. See #4140 for\n // more info.\n programPath.requeue(path);\n };\n\n for (const [source, data] of metadata.source) {\n for (const [localName, importName] of data.imports) {\n imported.set(localName, [source, importName, null]);\n }\n for (const localName of data.importsNamespace) {\n imported.set(localName, [source, null, localName]);\n }\n }\n\n for (const [local, data] of metadata.local) {\n let exportMeta = exported.get(local);\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n // Rewrite initialization of bindings to update exports.\n const rewriteBindingInitVisitorState: RewriteBindingInitVisitorState = {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported, // local name => exported name list\n };\n programPath.traverse(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n rewriteBindingInitVisitor,\n rewriteBindingInitVisitorState,\n );\n\n // Rewrite reads/writes from imports and exports to have the correct behavior.\n const rewriteReferencesVisitorState: RewriteReferencesVisitorState = {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported, // local / import\n exported, // local name => exported name list\n buildImportReference([source, importName, localName], identNode) {\n const meta = metadata.source.get(source);\n meta.referenced = true;\n\n if (localName) {\n if (meta.wrap) {\n // @ts-expect-error Fixme: we should handle the case when identNode is a JSXIdentifier\n identNode = wrapReference(identNode, meta.wrap) ?? identNode;\n }\n return identNode;\n }\n\n let namespace: t.Expression = t.identifier(meta.name);\n if (meta.wrap) {\n namespace = wrapReference(namespace, meta.wrap) ?? namespace;\n }\n\n if (importName === \"default\" && meta.interop === \"node-default\") {\n return namespace;\n }\n\n const computed = metadata.stringSpecifiers.has(importName);\n\n return t.memberExpression(\n namespace,\n computed ? t.stringLiteral(importName) : t.identifier(importName),\n computed,\n );\n },\n };\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);\n}\n\n/**\n * A visitor to inject export update statements during binding initialization.\n */\nconst rewriteBindingInitVisitor: Visitor = {\n Scope(path) {\n path.skip();\n },\n ClassDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const { id } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n\n const exportNames = exported.get(localName) || [];\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n VariableDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const isVar = path.node.kind === \"var\";\n\n for (const decl of path.get(\"declarations\")) {\n const { id } = decl.node;\n let { init } = decl.node;\n if (\n t.isIdentifier(id) &&\n exported.has(id.name) &&\n !t.isArrowFunctionExpression(init) &&\n (!t.isFunctionExpression(init) || init.id) &&\n (!t.isClassExpression(init) || init.id)\n ) {\n if (!init) {\n if (isVar) {\n // This variable might have already been assigned to, and the\n // uninitalized declaration doesn't set it to `undefined` and does\n // not updated the exported value.\n continue;\n } else {\n init = path.scope.buildUndefinedNode();\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n decl.node.init = buildBindingExportAssignmentExpression(\n metadata,\n exported.get(id.name),\n init,\n path.scope,\n );\n requeueInParent(decl.get(\"init\"));\n } else {\n for (const localName of Object.keys(\n decl.getOuterBindingIdentifiers(),\n )) {\n if (exported.has(localName)) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exported.get(localName),\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n }\n }\n }\n },\n};\n\nconst buildBindingExportAssignmentExpression = (\n metadata: ModuleMetadata,\n exportNames: string[],\n localExpr: t.Expression,\n scope: Scope,\n) => {\n const exportsObjectName = metadata.exportName;\n for (\n let currentScope = scope;\n currentScope != null;\n currentScope = currentScope.parent\n ) {\n if (currentScope.hasOwnBinding(exportsObjectName)) {\n currentScope.rename(exportsObjectName);\n }\n }\n return (exportNames || []).reduce((expr, exportName) => {\n // class Foo {} export { Foo, Foo as Bar };\n // as\n // class Foo {} exports.Foo = exports.Bar = Foo;\n const { stringSpecifiers } = metadata;\n const computed = stringSpecifiers.has(exportName);\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportsObjectName),\n computed ? t.stringLiteral(exportName) : t.identifier(exportName),\n /* computed */ computed,\n ),\n expr,\n );\n }, localExpr);\n};\n\nconst buildImportThrow = (localName: string) => {\n return template.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor: Visitor = {\n ReferencedIdentifier(path) {\n const { seen, buildImportReference, scope, imported, requeueInParent } =\n this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const localName = path.node.name;\n\n const importData = imported.get(localName);\n if (importData) {\n if (isInType(path)) {\n throw path.buildCodeFrameError(\n `Cannot transform the imported binding \"${localName}\" since it's also used in a type annotation. ` +\n `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`,\n );\n }\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const ref = buildImportReference(importData, path.node);\n\n // Preserve the binding location so that sourcemaps are nicer.\n ref.loc = path.node.loc;\n\n if (\n (path.parentPath.isCallExpression({ callee: path.node }) ||\n path.parentPath.isOptionalCallExpression({ callee: path.node }) ||\n path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&\n t.isMemberExpression(ref)\n ) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const { object, property } = ref;\n path.replaceWith(\n t.jsxMemberExpression(\n // @ts-expect-error todo(flow->ts): possible bug `object` might not have a name\n t.jsxIdentifier(object.name),\n // @ts-expect-error todo(flow->ts): possible bug `property` might not have a name\n t.jsxIdentifier(property.name),\n ),\n );\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n\n // The path could have been replaced with an identifier that would\n // otherwise be re-visited, so we skip processing its children.\n path.skip();\n }\n },\n\n UpdateExpression(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n\n seen.add(path.node);\n\n const arg = path.get(\"argument\");\n\n // No change needed\n if (arg.isMemberExpression()) return;\n\n const update = path.node;\n\n if (arg.isIdentifier()) {\n const localName = arg.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n\n if (exportedNames?.length > 0 || importData) {\n if (importData) {\n path.replaceWith(\n t.assignmentExpression(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n (update.operator[0] + \"=\") as t.AssignmentExpression[\"operator\"],\n buildImportReference(importData, arg.node),\n buildImportThrow(localName),\n ),\n );\n } else if (update.prefix) {\n // ++foo\n // => exports.foo = ++foo\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.cloneNode(update),\n path.scope,\n ),\n );\n } else {\n // foo++\n // => (ref = i++, exports.i = i, ref)\n const ref = scope.generateDeclaredUidIdentifier(localName);\n\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\n \"=\",\n t.cloneNode(ref),\n t.cloneNode(update),\n ),\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n t.cloneNode(ref),\n ]),\n );\n }\n }\n }\n\n requeueInParent(path);\n path.skip();\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n\n // No change needed\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n // Simple update-assign foo += 1; export { foo };\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n if (exportedNames?.length > 0 || importData) {\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, left.node);\n\n assignment.right = t.sequenceExpression([\n assignment.right,\n buildImportThrow(localName),\n ]);\n }\n\n const { operator } = assignment;\n let newExpr;\n if (operator === \"=\") {\n newExpr = assignment;\n } else if (\n operator === \"&&=\" ||\n operator === \"||=\" ||\n operator === \"??=\"\n ) {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.logicalExpression(\n operator.slice(0, -1) as t.LogicalExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n } else {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.binaryExpression(\n operator.slice(0, -1) as t.BinaryExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n newExpr,\n path.scope,\n ),\n );\n\n requeueInParent(path);\n\n path.skip();\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(\n localName =>\n scope.getBinding(localName) === path.scope.getBinding(localName),\n );\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([\n path.node.right,\n buildImportThrow(id),\n ]);\n }\n\n // Complex ({a, b, c} = {}); export { a, c };\n // => ({a, b, c} = {}), (exports.a = a, exports.c = c);\n const items: t.Expression[] = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n if (exportedNames.length > 0) {\n items.push(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n }\n });\n\n if (items.length > 0) {\n let node: t.Node = t.sequenceExpression(items);\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n // @ts-expect-error todo(flow->ts): avoid mutations\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n },\n },\n ForXStatement(path) {\n const { scope, node } = path;\n const { left } = node;\n const { exported, imported, scope: programScope } = this;\n\n if (!t.isVariableDeclaration(left)) {\n let didTransformExport = false,\n importConstViolationName;\n const loopBodyScope = path.get(\"body\").scope;\n for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) {\n if (programScope.getBinding(name) === scope.getBinding(name)) {\n if (exported.has(name)) {\n didTransformExport = true;\n if (loopBodyScope.hasOwnBinding(name)) {\n loopBodyScope.rename(name);\n }\n }\n if (imported.has(name) && !importConstViolationName) {\n importConstViolationName = name;\n }\n }\n }\n if (!didTransformExport && !importConstViolationName) {\n return;\n }\n\n path.ensureBlock();\n const bodyPath = path.get(\"body\") as NodePath;\n\n const newLoopId = scope.generateUidIdentifierBasedOnNode(left);\n path\n .get(\"left\")\n .replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.cloneNode(newLoopId)),\n ]),\n );\n scope.registerDeclaration(path.get(\"left\"));\n\n if (didTransformExport) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(t.assignmentExpression(\"=\", left, newLoopId)),\n );\n }\n if (importConstViolationName) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(buildImportThrow(importConstViolationName)),\n );\n }\n }\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAyBA,SAASC,QAAQA,CAACC,IAAc,EAAE;EAChC,GAAG;IACD,QAAQA,IAAI,CAACC,MAAM,CAACC,IAAI;MACtB,KAAK,kBAAkB;MACvB,KAAK,wBAAwB;MAC7B,KAAK,iBAAiB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forms/lib/rewrite-this.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js new file mode 100644 index 00000000..b5376524 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteThis; +var _core = require("@babel/core"); +var _traverse = require("@babel/traverse"); +let rewriteThisVisitor; +function rewriteThis(programPath) { + if (!rewriteThisVisitor) { + rewriteThisVisitor = _traverse.visitors.environmentVisitor({ + ThisExpression(path) { + path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true)); + } + }); + rewriteThisVisitor.noScope = true; + } + (0, _traverse.default)(programPath.node, rewriteThisVisitor); +} + +//# sourceMappingURL=rewrite-this.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map new file mode 100644 index 00000000..3cdfc3f8 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","_traverse","rewriteThisVisitor","rewriteThis","programPath","visitors","environmentVisitor","ThisExpression","path","replaceWith","t","unaryExpression","numericLiteral","noScope","traverse","node"],"sources":["../src/rewrite-this.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport traverse, { visitors, type NodePath } from \"@babel/traverse\";\n\n/**\n * A lazily constructed visitor to walk the tree, rewriting all `this` references in the\n * top-level scope to be `void 0` (undefined).\n *\n */\nlet rewriteThisVisitor: Parameters[1];\n\nexport default function rewriteThis(programPath: NodePath) {\n if (!rewriteThisVisitor) {\n rewriteThisVisitor = visitors.environmentVisitor({\n ThisExpression(path) {\n path.replaceWith(t.unaryExpression(\"void\", t.numericLiteral(0), true));\n },\n });\n rewriteThisVisitor.noScope = true;\n }\n // Rewrite \"this\" to be \"undefined\".\n traverse(programPath.node, rewriteThisVisitor);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAIE,kBAAkD;AAEvC,SAASC,WAAWA,CAACC,WAAqB,EAAE;EACzD,IAAI,CAACF,kBAAkB,EAAE;IACvBA,kBAAkB,GAAGG,kBAAQ,CAACC,kBAAkB,CAAC;MAC/CC,cAAcA,CAACC,IAAI,EAAE;QACnBA,IAAI,CAACC,WAAW,CAACC,WAAC,CAACC,eAAe,CAAC,MAAM,EAAED,WAAC,CAACE,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;MACxE;IACF,CAAC,CAAC;IACFV,kBAAkB,CAACW,OAAO,GAAG,IAAI;EACnC;EAEA,IAAAC,iBAAQ,EAACV,WAAW,CAACW,IAAI,EAAEb,kBAAkB,CAAC;AAChD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/package.json b/node_modules/@babel/helper-module-transforms/package.json new file mode 100644 index 00000000..ab79eae5 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/package.json @@ -0,0 +1,32 @@ +{ + "name": "@babel/helper-module-transforms", + "version": "7.27.1", + "description": "Babel helper functions for implementing ES6 module transformations", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helper-module-transforms", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-transforms" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "devDependencies": { + "@babel/core": "^7.27.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-optimise-call-expression/LICENSE b/node_modules/@babel/helper-optimise-call-expression/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-optimise-call-expression/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-optimise-call-expression/README.md b/node_modules/@babel/helper-optimise-call-expression/README.md new file mode 100644 index 00000000..54732def --- /dev/null +++ b/node_modules/@babel/helper-optimise-call-expression/README.md @@ -0,0 +1,19 @@ +# @babel/helper-optimise-call-expression + +> Helper function to optimise call expression + +See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/babel-helper-optimise-call-expression) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-optimise-call-expression +``` + +or using yarn: + +```sh +yarn add @babel/helper-optimise-call-expression +``` diff --git a/node_modules/@babel/helper-optimise-call-expression/lib/index.js b/node_modules/@babel/helper-optimise-call-expression/lib/index.js new file mode 100644 index 00000000..f7bc0b2a --- /dev/null +++ b/node_modules/@babel/helper-optimise-call-expression/lib/index.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = optimiseCallExpression; +var _t = require("@babel/types"); +const { + callExpression, + identifier, + isIdentifier, + isSpreadElement, + memberExpression, + optionalCallExpression, + optionalMemberExpression +} = _t; +function optimiseCallExpression(callee, thisNode, args, optional) { + if (args.length === 1 && isSpreadElement(args[0]) && isIdentifier(args[0].argument, { + name: "arguments" + })) { + if (optional) { + return optionalCallExpression(optionalMemberExpression(callee, identifier("apply"), false, true), [thisNode, args[0].argument], false); + } + return callExpression(memberExpression(callee, identifier("apply")), [thisNode, args[0].argument]); + } else { + if (optional) { + return optionalCallExpression(optionalMemberExpression(callee, identifier("call"), false, true), [thisNode, ...args], false); + } + return callExpression(memberExpression(callee, identifier("call")), [thisNode, ...args]); + } +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-optimise-call-expression/lib/index.js.map b/node_modules/@babel/helper-optimise-call-expression/lib/index.js.map new file mode 100644 index 00000000..bb10d4c8 --- /dev/null +++ b/node_modules/@babel/helper-optimise-call-expression/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","callExpression","identifier","isIdentifier","isSpreadElement","memberExpression","optionalCallExpression","optionalMemberExpression","optimiseCallExpression","callee","thisNode","args","optional","length","argument","name"],"sources":["../src/index.ts"],"sourcesContent":["import {\n callExpression,\n identifier,\n isIdentifier,\n isSpreadElement,\n memberExpression,\n optionalCallExpression,\n optionalMemberExpression,\n} from \"@babel/types\";\nimport type {\n CallExpression,\n Expression,\n OptionalCallExpression,\n} from \"@babel/types\";\n\n/**\n * A helper function that generates a new call expression with given thisNode.\n It will also optimize `(...arguments)` to `.apply(arguments)`\n *\n * @export\n * @param {Expression} callee The callee of call expression\n * @param {Expression} thisNode The desired this of call expression\n * @param {Readonly} args The arguments of call expression\n * @param {boolean} optional Whether the call expression is optional\n * @returns {CallExpression | OptionalCallExpression} The generated new call expression\n */\nexport default function optimiseCallExpression(\n callee: Expression,\n thisNode: Expression,\n args: Readonly,\n optional: boolean,\n): CallExpression | OptionalCallExpression {\n if (\n args.length === 1 &&\n isSpreadElement(args[0]) &&\n isIdentifier(args[0].argument, { name: \"arguments\" })\n ) {\n // a.b?.(...arguments);\n if (optional) {\n return optionalCallExpression(\n optionalMemberExpression(callee, identifier(\"apply\"), false, true),\n [thisNode, args[0].argument],\n false,\n );\n }\n // a.b(...arguments);\n return callExpression(memberExpression(callee, identifier(\"apply\")), [\n thisNode,\n args[0].argument,\n ]);\n } else {\n // a.b?.(arg1, arg2)\n if (optional) {\n return optionalCallExpression(\n optionalMemberExpression(callee, identifier(\"call\"), false, true),\n [thisNode, ...args],\n false,\n );\n }\n // a.b(arg1, arg2)\n return callExpression(memberExpression(callee, identifier(\"call\")), [\n thisNode,\n ...args,\n ]);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAQsB;EAPpBC,cAAc;EACdC,UAAU;EACVC,YAAY;EACZC,eAAe;EACfC,gBAAgB;EAChBC,sBAAsB;EACtBC;AAAwB,IAAAR,EAAA;AAmBX,SAASS,sBAAsBA,CAC5CC,MAAkB,EAClBC,QAAoB,EACpBC,IAA2C,EAC3CC,QAAiB,EACwB;EACzC,IACED,IAAI,CAACE,MAAM,KAAK,CAAC,IACjBT,eAAe,CAACO,IAAI,CAAC,CAAC,CAAC,CAAC,IACxBR,YAAY,CAACQ,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,EAAE;IAAEC,IAAI,EAAE;EAAY,CAAC,CAAC,EACrD;IAEA,IAAIH,QAAQ,EAAE;MACZ,OAAON,sBAAsB,CAC3BC,wBAAwB,CAACE,MAAM,EAAEP,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAClE,CAACQ,QAAQ,EAAEC,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,EAC5B,KACF,CAAC;IACH;IAEA,OAAOb,cAAc,CAACI,gBAAgB,CAACI,MAAM,EAAEP,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CACnEQ,QAAQ,EACRC,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,CACjB,CAAC;EACJ,CAAC,MAAM;IAEL,IAAIF,QAAQ,EAAE;MACZ,OAAON,sBAAsB,CAC3BC,wBAAwB,CAACE,MAAM,EAAEP,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EACjE,CAACQ,QAAQ,EAAE,GAAGC,IAAI,CAAC,EACnB,KACF,CAAC;IACH;IAEA,OAAOV,cAAc,CAACI,gBAAgB,CAACI,MAAM,EAAEP,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAClEQ,QAAQ,EACR,GAAGC,IAAI,CACR,CAAC;EACJ;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-optimise-call-expression/package.json b/node_modules/@babel/helper-optimise-call-expression/package.json new file mode 100644 index 00000000..110fb716 --- /dev/null +++ b/node_modules/@babel/helper-optimise-call-expression/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/helper-optimise-call-expression", + "version": "7.27.1", + "description": "Helper function to optimise call expression", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-optimise-call-expression" + }, + "homepage": "https://babel.dev/docs/en/next/babel-helper-optimise-call-expression", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "devDependencies": { + "@babel/generator": "^7.27.1", + "@babel/parser": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-plugin-utils/LICENSE b/node_modules/@babel/helper-plugin-utils/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-plugin-utils/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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/node_modules/@babel/helper-plugin-utils/README.md b/node_modules/@babel/helper-plugin-utils/README.md new file mode 100644 index 00000000..a99070f3 --- /dev/null +++ b/node_modules/@babel/helper-plugin-utils/README.md @@ -0,0 +1,19 @@ +# @babel/helper-plugin-utils + +> General utilities for plugins to use + +See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/babel-helper-plugin-utils) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-plugin-utils +``` + +or using yarn: + +```sh +yarn add @babel/helper-plugin-utils +``` diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js b/node_modules/@babel/helper-plugin-utils/lib/index.js new file mode 100644 index 00000000..ae005623 --- /dev/null +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.declare = declare; +exports.declarePreset = void 0; +const apiPolyfills = { + assertVersion: api => range => { + throwVersionError(range, api.version); + } +}; +{ + Object.assign(apiPolyfills, { + targets: () => () => { + return {}; + }, + assumption: () => () => { + return undefined; + }, + addExternalDependency: () => () => {} + }); +} +function declare(builder) { + return (api, options, dirname) => { + let clonedApi; + for (const name of Object.keys(apiPolyfills)) { + if (api[name]) continue; + clonedApi != null ? clonedApi : clonedApi = copyApiObject(api); + clonedApi[name] = apiPolyfills[name](clonedApi); + } + return builder(clonedApi != null ? clonedApi : api, options || {}, dirname); + }; +} +const declarePreset = exports.declarePreset = declare; +function copyApiObject(api) { + let proto = null; + if (typeof api.version === "string" && /^7\./.test(api.version)) { + proto = Object.getPrototypeOf(api); + if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) { + proto = null; + } + } + return Object.assign({}, proto, api); +} +function throwVersionError(range, version) { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + range = `^${range}.0.0-0`; + } + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + const limit = Error.stackTraceLimit; + if (typeof limit === "number" && limit < 25) { + Error.stackTraceLimit = 25; + } + let err; + if (version.slice(0, 2) === "7.") { + err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + `You'll need to update your @babel/core version.`); + } else { + err = new Error(`Requires Babel "${range}", but was loaded with "${version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); + } + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + throw Object.assign(err, { + code: "BABEL_VERSION_UNSUPPORTED", + version, + range + }); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js.map b/node_modules/@babel/helper-plugin-utils/lib/index.js.map new file mode 100644 index 00000000..ab21b76f --- /dev/null +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["apiPolyfills","assertVersion","api","range","throwVersionError","version","Object","assign","targets","assumption","undefined","addExternalDependency","declare","builder","options","dirname","clonedApi","name","keys","copyApiObject","declarePreset","exports","proto","test","getPrototypeOf","hasOwnProperty","call","Number","isInteger","Error","limit","stackTraceLimit","err","slice","code"],"sources":["../src/index.ts"],"sourcesContent":["import type {\n PluginAPI,\n PluginObject,\n PluginPass,\n PresetAPI,\n PresetObject,\n} from \"@babel/core\";\n\ntype APIPolyfillFactory = (\n api: PluginAPI,\n) => PluginAPI[T];\n\ntype APIPolyfills = {\n assertVersion: APIPolyfillFactory<\"assertVersion\">;\n};\n\nconst apiPolyfills: APIPolyfills = {\n // Not supported by Babel 7 and early versions of Babel 7 beta.\n // It's important that this is polyfilled for older Babel versions\n // since it's needed to report the version mismatch.\n assertVersion: (api: PluginAPI) => (range: number | string) => {\n throwVersionError(range, api.version);\n },\n};\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(apiPolyfills, {\n // This is supported starting from Babel 7.13\n targets: () => (): any => {\n return {};\n },\n // This is supported starting from Babel 7.13\n assumption: () => (): any => {\n return undefined;\n },\n // This is supported starting from Babel 7.17\n addExternalDependency: () => () => {},\n });\n}\n\nexport function declare(\n builder: (\n api: PluginAPI,\n options: Option,\n dirname: string,\n ) => PluginObject,\n): (\n api: PluginAPI,\n options: Option,\n dirname: string,\n) => PluginObject {\n return (api, options: Option, dirname: string) => {\n let clonedApi: PluginAPI;\n\n for (const name of Object.keys(\n apiPolyfills,\n ) as (keyof typeof apiPolyfills)[]) {\n if (api[name]) continue;\n\n clonedApi ??= copyApiObject(api);\n clonedApi[name] = apiPolyfills[name](clonedApi);\n }\n\n // @ts-expect-error options || {} may not be assigned to Options\n return builder(clonedApi ?? api, options || {}, dirname);\n };\n}\n\nexport const declarePreset = declare as